[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:44: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.
I also find this part of `sgml-attributes' really weird. `alist' is the
list of valid attributes. It counts down the number of valid attributes,
but doesn't actually keep track of which you've added: the <img> tag has
nine distinct valid attributes, but the code will happily let you add
nine "src" attributes and then bail. It also doesn't handle
keyboard-quit gracefully. Ideally this would pop attributes off the list
of acceptable choices, and also delete extra spaces on keyboard quit.
(setq i (length alist))
(while (> i 0)
(insert ?\s)
(insert (funcall skeleton-transformation-function
(setq attribute
(skeleton-read (lambda ()
(completing-read
"Attribute: "
alist))))))
(if (string= "" attribute)
(setq i 0)
(sgml-value (assoc (downcase attribute) alist))
(setq i (1- i))))