Subject: Re: bug#35517: 27.0.50; Small improvements to HTML mode

From: Eric Abrahamsen <[email-masked]>
Date: Sun, 23 Jun 2019 11:35:29 -0700

On 06/23/19 19:39 PM, Lars Ingebrigtsen wrote:
> Eric Abrahamsen <[email-masked]> writes:
>
>>>> +	(unless (or alist quiet)
>>>> +	  (message "No attributes configured."))
>>>> +        (when alist
>>>> +          ;; Add class and id attributes if a) the element has any
>>>> +          ;; other attributes configured, and b) they're not already
>>>> +          ;; present.
>>>> +          (unless (assoc-string "class" alist)
>>>> +            (setq alist (cons '("class") alist)))
>>>> +          (unless (assoc-string "id" alist)
>>>> +            (setq alist (cons '("id") alist))))
>>>
>>> Should <div>s always have class/id attributes?  I guess it's unusual to
>>> have neither, but I find myself writing <div>s all the time with just
>>> class.  Or just id...
>>
>> The patch changes the default value of `html-tag-alist' as well, to add
>> id and class, so that's already taken care of.
>
> I may well be misreading the patch, but doesn't the change above mean
> that the user will be prompted for class/id when they insert a <div>?
> That's what I was worried about...

Oh, no, those are two separate things. There are now keybindings for
inserting div/span, but no prompting happens until you try to insert an
attribute into a div. Now it offers you id/class, whereas before it told
you "No attributes configured", which I always found infuriating.