emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: some proposed tweaks to HTML mode


From: Eric Abrahamsen
Subject: Re: some proposed tweaks to HTML mode
Date: Thu, 21 Mar 2019 15:53:23 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Eric Abrahamsen <address@hidden> writes:

> Andreas Schwab <address@hidden> writes:
>
>> On Mär 21 2019, Eric Abrahamsen <address@hidden> wrote:
>>
>>> @@ -1743,6 +1744,8 @@ html-mode-map
>>>      (define-key map "\C-c1" 'html-headline-1)
>>>      (define-key map "\C-c\r" 'html-paragraph)
>>>      (define-key map "\C-c\n" 'html-line)
>>> +    (define-key map "\C-cd" 'html-div)
>>> +    (define-key map "\C-cs" 'html-span)
>>
>> C-c <letter> is reserved for the user, and no mode should bind them.
>
> Ah, thanks for that catch. And I see that's exactly what
> `html-quick-keys' is for. I've regularized the keybindings accordingly.

And! There was garbage in the re-search-backwards calls. Should look
like this (also removed it from the span tag, which shouldn't start a
newline):

(define-skeleton html-list-item
  "HTML list item tag."
  nil
  (if (re-search-backward "^[[:blank:]]+" (point-at-bol) t) nil '\n)
  "<li>" _ (if sgml-xml-mode "</li>"))

(define-skeleton html-paragraph
  "HTML paragraph tag."
  nil
  (if (re-search-backward "^[[:blank:]]+" (point-at-bol) t) nil ?\n)
  "<p>" > _ (if sgml-xml-mode "</p>"))

(define-skeleton html-div
  "HTML div tag."
  nil
  (if (re-search-backward "^[[:blank:]]+" (point-at-bol) t) nil ?\n)
  "<div>" > \n _ \n "</div>" >)

(define-skeleton html-span
  "HTML span tag."
  nil
  "<span>" > _ "</span>")




reply via email to

[Prev in Thread] Current Thread [Next in Thread]