GNU bug report logs -
#35517
27.0.50; Small improvements to HTML mode
Previous Next
Reported by: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Date: Tue, 30 Apr 2019 23:40:01 UTC
Severity: wishlist
Tags: patch
Found in version 27.0.50
Done: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 35517 in the body.
You can then email your comments to 35517 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#35517
; Package
emacs
.
(Tue, 30 Apr 2019 23:40:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Eric Abrahamsen <eric <at> ericabrahamsen.net>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Tue, 30 Apr 2019 23:40:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
The attached patch provides some small improvements to HTML mode. It
adds `html-div' and `html-span' skeleton commands, and changes the
newline/indent behavior of `html-ordered-list', `html-unordered-list',
`html-list-item', and `html-paragraph'. It also offers "class" and "id"
attributes to most HTML tags in `sgml-attributes'.
Comments welcome!
[0001-Tweaks-to-html-mode.patch (text/x-patch, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#35517
; Package
emacs
.
(Sun, 05 May 2019 18:40:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 35517 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:
> The attached patch provides some small improvements to HTML mode. It
> adds `html-div' and `html-span' skeleton commands, and changes the
> newline/indent behavior of `html-ordered-list', `html-unordered-list',
> `html-list-item', and `html-paragraph'. It also offers "class" and "id"
> attributes to most HTML tags in `sgml-attributes'.
>
> Comments welcome!
Here's an updated patch -- "div" elements should always have "span" and
"id" offered as attributes.
[0001-Tweaks-to-html-mode.patch (text/x-patch, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#35517
; Package
emacs
.
(Sun, 23 Jun 2019 17:17:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 35517 <at> debbugs.gnu.org (full text, mbox):
Eric Abrahamsen <eric <at> ericabrahamsen.net> 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
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#35517
; Package
emacs
.
(Sun, 23 Jun 2019 17:34:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 35517 <at> debbugs.gnu.org (full text, mbox):
On 06/23/19 19:16 PM, Lars Ingebrigtsen wrote:
> Eric Abrahamsen <eric <at> ericabrahamsen.net> 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. :-)
Oops!
> 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...
The patch changes the default value of `html-tag-alist' as well, to add
id and class, so that's already taken care of.
>> +(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.
Cool.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#35517
; Package
emacs
.
(Sun, 23 Jun 2019 17:40:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 35517 <at> debbugs.gnu.org (full text, mbox):
Eric Abrahamsen <eric <at> ericabrahamsen.net> 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...
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#35517
; Package
emacs
.
(Sun, 23 Jun 2019 18:36:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 35517 <at> debbugs.gnu.org (full text, mbox):
On 06/23/19 19:39 PM, Lars Ingebrigtsen wrote:
> Eric Abrahamsen <eric <at> ericabrahamsen.net> 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.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#35517
; Package
emacs
.
(Sun, 23 Jun 2019 18:38:03 GMT)
Full text and
rfc822 format available.
Message #23 received at 35517 <at> debbugs.gnu.org (full text, mbox):
Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:
> 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.
Ah, I see. Then the patch looks good to me.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#35517
; Package
emacs
.
(Mon, 24 Jun 2019 17:22:01 GMT)
Full text and
rfc822 format available.
Message #26 received at 35517 <at> debbugs.gnu.org (full text, mbox):
On 06/23/19 20:37 PM, Lars Ingebrigtsen wrote:
> Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:
>
>> 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.
>
> Ah, I see. Then the patch looks good to me.
Okay, pushed and closing.
Thanks,
Eric
Reply sent
to
Eric Abrahamsen <eric <at> ericabrahamsen.net>
:
You have taken responsibility.
(Mon, 24 Jun 2019 17:22:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Eric Abrahamsen <eric <at> ericabrahamsen.net>
:
bug acknowledged by developer.
(Mon, 24 Jun 2019 17:22:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Tue, 23 Jul 2019 11:24:08 GMT)
Full text and
rfc822 format available.
This bug report was last modified 4 years and 250 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.