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

From: Lars Ingebrigtsen <[email-masked]>
Date: Sun, 23 Jun 2019 19:16:05 +0200

Eric Abrahamsen <[email-masked]> writes:

> Here's an updated patch -- "div" elements should always have "span" and
> "id" offered as attributes.

This made me confused until I read the code -- which is "class" and
"id", which makes more sense.  :-)

But...

[...]

> +	(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...

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

The skeleton commands look uncontroversial, though.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no