From unknown Fri Aug 08 19:51:59 2025 X-Loop: help-debbugs@gnu.org Subject: bug#35517: 27.0.50; Small improvements to HTML mode Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 30 Apr 2019 23:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 35517 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 35517@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.155666756230854 (code B ref -1); Tue, 30 Apr 2019 23:40:01 +0000 Received: (at submit) by debbugs.gnu.org; 30 Apr 2019 23:39:22 +0000 Received: from localhost ([127.0.0.1]:42789 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hLcLJ-00081a-Tz for submit@debbugs.gnu.org; Tue, 30 Apr 2019 19:39:22 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51367) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hLcLH-00081N-Uv for submit@debbugs.gnu.org; Tue, 30 Apr 2019 19:39:20 -0400 Received: from lists.gnu.org ([209.51.188.17]:54973) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hLcLC-0003te-JL for submit@debbugs.gnu.org; Tue, 30 Apr 2019 19:39:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37494) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLcL8-0003b6-Fh for bug-gnu-emacs@gnu.org; Tue, 30 Apr 2019 19:39:14 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_40,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hLcL7-0003s1-Ax for bug-gnu-emacs@gnu.org; Tue, 30 Apr 2019 19:39:10 -0400 Received: from ericabrahamsen.net ([52.70.2.18]:47872 helo=mail.ericabrahamsen.net) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hLcL6-0003hS-SR for bug-gnu-emacs@gnu.org; Tue, 30 Apr 2019 19:39:08 -0400 Received: from localhost (50-251-205-17-static.hfc.comcastbusiness.net [50.251.205.17]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 48DBCFA026 for ; Tue, 30 Apr 2019 23:38:35 +0000 (UTC) From: Eric Abrahamsen Date: Tue, 30 Apr 2019 16:38:33 -0700 Message-ID: <87wojb5aiu.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 52.70.2.18 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -1.4 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) --=-=-= Content-Type: text/plain 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! --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Tweaks-to-html-mode.patch >From 0293d7bb423950264558363e4e3a3d695f323347 Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen Date: Tue, 30 Apr 2019 16:00:46 -0700 Subject: [PATCH] Tweaks to html mode * lisp/textmodes/sgml-mode.el (sgml-attributes): Add the "class" and "id" attributes when needed. (html-mode-map): Add the `html-div' and `html-span' commands to the `html-quick-keys' map. (html-ordered-list, html-unordered-list, html-paragraph): Use the "\n" element properly. (html-div, html-span): New HTML skeletons. --- lisp/textmodes/sgml-mode.el | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index 9e3be99af1..b0d0ba8536 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el @@ -773,8 +773,16 @@ sgml-attributes (symbolp (car (car alist)))) (setq car (car alist) alist (cdr alist))) - (or quiet - (message "No attributes configured.")) + (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)))) (if (stringp (car alist)) (progn (insert (if (eq (preceding-char) ?\s) "" ?\s) @@ -1752,6 +1760,7 @@ html-mode-map (define-key map "\C-c\C-ci" 'html-image) (when html-quick-keys (define-key map "\C-c-" 'html-horizontal-rule) + (define-key map "\C-cd" 'html-div) (define-key map "\C-co" 'html-ordered-list) (define-key map "\C-cu" 'html-unordered-list) (define-key map "\C-cr" 'html-radio-buttons) @@ -1759,7 +1768,8 @@ html-mode-map (define-key map "\C-cl" 'html-list-item) (define-key map "\C-ch" 'html-href-anchor) (define-key map "\C-cn" 'html-name-anchor) - (define-key map "\C-ci" 'html-image)) + (define-key map "\C-ci" 'html-image) + (define-key map "\C-cs" 'html-span)) (define-key map "\C-c\C-s" 'html-autoview-mode) (define-key map "\C-c\C-v" 'browse-url-of-buffer) (define-key map [menu-bar html] (cons "HTML" menu-map)) @@ -2446,16 +2456,16 @@ html-line (define-skeleton html-ordered-list "HTML ordered list tags." nil - "
    " \n + \n "
      " \n "
    1. " _ (if sgml-xml-mode "
    2. ") \n - "
    ") + "
" > \n) (define-skeleton html-unordered-list "HTML unordered list tags." nil - "
    " \n + \n "
      " \n "
    • " _ (if sgml-xml-mode "
    • ") \n - "
    ") + "
" > \n) (define-skeleton html-list-item "HTML list item tag." @@ -2466,8 +2476,17 @@ html-list-item (define-skeleton html-paragraph "HTML paragraph tag." nil - (if (bolp) nil ?\n) - "

" _ (if sgml-xml-mode "

")) + \n "

" _ (if sgml-xml-mode "

")) + +(define-skeleton html-div + "HTML div tag." + nil + "
" > \n _ \n "
" >) + +(define-skeleton html-span + "HTML span tag." + nil + "" > _ "") (define-skeleton html-checkboxes "Group of connected checkbox inputs." -- 2.21.0 --=-=-=-- From unknown Fri Aug 08 19:51:59 2025 X-Loop: help-debbugs@gnu.org Subject: bug#35517: 27.0.50; Small improvements to HTML mode Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 May 2019 18:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35517 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 35517@debbugs.gnu.org Received: via spool by 35517-submit@debbugs.gnu.org id=B35517.155708154230190 (code B ref 35517); Sun, 05 May 2019 18:40:02 +0000 Received: (at 35517) by debbugs.gnu.org; 5 May 2019 18:39:02 +0000 Received: from localhost ([127.0.0.1]:54824 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hNM2P-0007qb-2s for submit@debbugs.gnu.org; Sun, 05 May 2019 14:39:02 -0400 Received: from ericabrahamsen.net ([52.70.2.18]:56234 helo=mail.ericabrahamsen.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hNM2M-0007qN-Gg for 35517@debbugs.gnu.org; Sun, 05 May 2019 14:38:59 -0400 Received: from localhost (75-172-97-110.tukw.qwest.net [75.172.97.110]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 9DF29FA026 for <35517@debbugs.gnu.org>; Sun, 5 May 2019 18:38:51 +0000 (UTC) From: Eric Abrahamsen References: <87wojb5aiu.fsf@ericabrahamsen.net> Date: Sun, 05 May 2019 11:38:49 -0700 In-Reply-To: <87wojb5aiu.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Tue, 30 Apr 2019 16:38:33 -0700") Message-ID: <875zqoeog6.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Eric Abrahamsen 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. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Tweaks-to-html-mode.patch >From 3928b1a04deaf74812bffa221d0883da9a52bab3 Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen Date: Tue, 30 Apr 2019 16:00:46 -0700 Subject: [PATCH] Tweaks to html mode * lisp/textmodes/sgml-mode.el (sgml-attributes): Add the "class" and "id" attributes when needed. (html-mode-map): Add the `html-div' and `html-span' commands to the `html-quick-keys' map. (html-ordered-list, html-unordered-list, html-paragraph): Use the "\n" element properly. (html-div, html-span): New HTML skeletons. --- lisp/textmodes/sgml-mode.el | 39 +++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index 9e3be99af1..28ca40b733 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el @@ -773,8 +773,16 @@ sgml-attributes (symbolp (car (car alist)))) (setq car (car alist) alist (cdr alist))) - (or quiet - (message "No attributes configured.")) + (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)))) (if (stringp (car alist)) (progn (insert (if (eq (preceding-char) ?\s) "" ?\s) @@ -1752,6 +1760,7 @@ html-mode-map (define-key map "\C-c\C-ci" 'html-image) (when html-quick-keys (define-key map "\C-c-" 'html-horizontal-rule) + (define-key map "\C-cd" 'html-div) (define-key map "\C-co" 'html-ordered-list) (define-key map "\C-cu" 'html-unordered-list) (define-key map "\C-cr" 'html-radio-buttons) @@ -1759,7 +1768,8 @@ html-mode-map (define-key map "\C-cl" 'html-list-item) (define-key map "\C-ch" 'html-href-anchor) (define-key map "\C-cn" 'html-name-anchor) - (define-key map "\C-ci" 'html-image)) + (define-key map "\C-ci" 'html-image) + (define-key map "\C-cs" 'html-span)) (define-key map "\C-c\C-s" 'html-autoview-mode) (define-key map "\C-c\C-v" 'browse-url-of-buffer) (define-key map [menu-bar html] (cons "HTML" menu-map)) @@ -1960,7 +1970,7 @@ html-tag-alist ("dd" ,(not sgml-xml-mode)) ("del" nil ("cite") ("datetime")) ("dfn") - ("div") + ("div" \n ("id") ("class")) ("dl" (nil \n ( "Term: " "
" str (if sgml-xml-mode "
") @@ -2446,16 +2456,16 @@ html-line (define-skeleton html-ordered-list "HTML ordered list tags." nil - "
    " \n + \n "
      " \n "
    1. " _ (if sgml-xml-mode "
    2. ") \n - "
    ") + "
" > \n) (define-skeleton html-unordered-list "HTML unordered list tags." nil - "
    " \n + \n "
      " \n "
    • " _ (if sgml-xml-mode "
    • ") \n - "
    ") + "
" > \n) (define-skeleton html-list-item "HTML list item tag." @@ -2466,8 +2476,17 @@ html-list-item (define-skeleton html-paragraph "HTML paragraph tag." nil - (if (bolp) nil ?\n) - "

" _ (if sgml-xml-mode "

")) + \n "

" _ (if sgml-xml-mode "

")) + +(define-skeleton html-div + "HTML div tag." + nil + "
" > \n _ \n "
" >) + +(define-skeleton html-span + "HTML span tag." + nil + "" > _ "") (define-skeleton html-checkboxes "Group of connected checkbox inputs." -- 2.21.0 --=-=-=-- From unknown Fri Aug 08 19:51:59 2025 X-Loop: help-debbugs@gnu.org Subject: bug#35517: 27.0.50; Small improvements to HTML mode Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 23 Jun 2019 17:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35517 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eric Abrahamsen Cc: 35517@debbugs.gnu.org Received: via spool by 35517-submit@debbugs.gnu.org id=B35517.156131017220018 (code B ref 35517); Sun, 23 Jun 2019 17:17:02 +0000 Received: (at 35517) by debbugs.gnu.org; 23 Jun 2019 17:16:12 +0000 Received: from localhost ([127.0.0.1]:54408 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hf667-0005Ca-NN for submit@debbugs.gnu.org; Sun, 23 Jun 2019 13:16:12 -0400 Received: from quimby.gnus.org ([80.91.231.51]:43948) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hf664-00059y-Uk for 35517@debbugs.gnu.org; Sun, 23 Jun 2019 13:16:09 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hf661-0008JZ-9K; Sun, 23 Jun 2019 19:16:07 +0200 From: Lars Ingebrigtsen References: <87wojb5aiu.fsf@ericabrahamsen.net> <875zqoeog6.fsf@ericabrahamsen.net> Date: Sun, 23 Jun 2019 19:16:05 +0200 In-Reply-To: <875zqoeog6.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Sun, 05 May 2019 11:38:49 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Eric Abrahamsen 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. :-) Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eric Abrahamsen 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
s always have class/id attributes? I guess it's unusual to have neither, but I find myself writing
s all the time with just class. Or just id... > +(define-skeleton html-div > + "HTML div tag." > + nil > + "
" > \n _ \n "
" >) > + > +(define-skeleton html-span > + "HTML span tag." > + nil > + "" > _ "") The skeleton commands look uncontroversial, though. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Fri Aug 08 19:51:59 2025 X-Loop: help-debbugs@gnu.org Subject: bug#35517: 27.0.50; Small improvements to HTML mode Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 23 Jun 2019 17:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35517 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Lars Ingebrigtsen Cc: 35517@debbugs.gnu.org Received: via spool by 35517-submit@debbugs.gnu.org id=B35517.15613112404244 (code B ref 35517); Sun, 23 Jun 2019 17:34:02 +0000 Received: (at 35517) by debbugs.gnu.org; 23 Jun 2019 17:34:00 +0000 Received: from localhost ([127.0.0.1]:54444 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hf6NM-00016N-70 for submit@debbugs.gnu.org; Sun, 23 Jun 2019 13:34:00 -0400 Received: from ericabrahamsen.net ([52.70.2.18]:49812 helo=mail.ericabrahamsen.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hf6NL-00016A-4H for 35517@debbugs.gnu.org; Sun, 23 Jun 2019 13:33:59 -0400 Received: from localhost (unknown [172.92.212.120]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id CC7CAFA648; Sun, 23 Jun 2019 17:33:52 +0000 (UTC) From: Eric Abrahamsen References: <87wojb5aiu.fsf@ericabrahamsen.net> <875zqoeog6.fsf@ericabrahamsen.net> Date: Sun, 23 Jun 2019 10:33:46 -0700 In-Reply-To: (Lars Ingebrigtsen's message of "Sun, 23 Jun 2019 19:16:05 +0200") Message-ID: <87sgs0tddx.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) On 06/23/19 19:16 PM, Lars Ingebrigtsen wrote: > Eric Abrahamsen 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
s always have class/id attributes? I guess it's unusual to > have neither, but I find myself writing
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 >> + "
" > \n _ \n "
" >) >> + >> +(define-skeleton html-span >> + "HTML span tag." >> + nil >> + "" > _ "") > > The skeleton commands look uncontroversial, though. Cool. From unknown Fri Aug 08 19:51:59 2025 X-Loop: help-debbugs@gnu.org Subject: bug#35517: 27.0.50; Small improvements to HTML mode Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 23 Jun 2019 17:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35517 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eric Abrahamsen Cc: 35517@debbugs.gnu.org Received: via spool by 35517-submit@debbugs.gnu.org id=B35517.15613115664947 (code B ref 35517); Sun, 23 Jun 2019 17:40:01 +0000 Received: (at 35517) by debbugs.gnu.org; 23 Jun 2019 17:39:26 +0000 Received: from localhost ([127.0.0.1]:54462 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hf6Sb-0001Hf-U8 for submit@debbugs.gnu.org; Sun, 23 Jun 2019 13:39:26 -0400 Received: from quimby.gnus.org ([80.91.231.51]:44380) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hf6Sa-0001HQ-12 for 35517@debbugs.gnu.org; Sun, 23 Jun 2019 13:39:24 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hf6SW-000079-Kj; Sun, 23 Jun 2019 19:39:22 +0200 From: Lars Ingebrigtsen References: <87wojb5aiu.fsf@ericabrahamsen.net> <875zqoeog6.fsf@ericabrahamsen.net> <87sgs0tddx.fsf@ericabrahamsen.net> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEULCwsHBwc0MjNRTU+A fH0ZGRrSzc8QEBDiLqT7AAACS0lEQVQ4jV2UQW/cIBCFsaLKV0gPubZglGvL4Oy1iunmbhv5Gqkr crW8sfj7fQO73TTPF4uPNzMMHosv8aY9LhlqV5F30d7Wc9EqIIAHvC87sRzRRPTtA7iqbIYQKgpZ 19o1t0I0jRCqOKJQa8YjsCpk0zRyVaItDiXyegnRqOJQslS16BwtTDnvyL7R5sNh9yEITVqbuKDa MQzH93Q+prf5mJJwpONUjjEzOG3H9DoHAO2tnSwD4+npnADeuuLwzo49A/LkZ4BjBX1HeurRpnGA Y745ekPWOBjORMb/B4zWBIA20QWYVADqIhsXbmN3PnG5UwVkXHeIpcF+C+yY6jkg08eRu+5ruTfg +jg5zSBwqLEAAzBcQPd++geey+UBaEemm09bSq/V4WEY+uVOO1MAehUr8H4Ih2Vj4Eu5v8Zr8hB6 ADux4xP4nTdcC1XHSy1Xc5kDuajNxVGB1Xb0aRic1Vr7dz55BTFaEwLud4TjaSo5qiM6fxqw2yLH E06eLi3p47M/EYOo+Wqnj+APAwQzoUtzunwlADRxKB31hKgFpAq6x20guzPzQ3cFdnfnweaRUHDe jfYAXXXQYsLgljwacst9COGlgmV7zJmPgjGLegQ4VICPGWQfPZAQ7UjBHBl8UKNYmITM81FGhiXV FbSrAni4TJ4USl0djWrhuIGmejBUkkNdRxVDpxoJBCvnaHPmPGt1SdHAKtu9gKUWcNfRjxJQtnnn HLyKfeLO008pkaQCCcBhlfxq3PdSF/8TYsn6SRV8Xq1gj38BCRUOP4pOIfkAAAAASUVORK5CYII= Date: Sun, 23 Jun 2019 19:39:20 +0200 In-Reply-To: <87sgs0tddx.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Sun, 23 Jun 2019 10:33:46 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Eric Abrahamsen 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 [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eric Abrahamsen 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
s always have class/id attributes? I guess it's unusual to >> have neither, but I find myself writing
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
? That's what I was worried about... -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Fri Aug 08 19:51:59 2025 X-Loop: help-debbugs@gnu.org Subject: bug#35517: 27.0.50; Small improvements to HTML mode Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 23 Jun 2019 18:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35517 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Lars Ingebrigtsen Cc: 35517@debbugs.gnu.org Received: via spool by 35517-submit@debbugs.gnu.org id=B35517.156131495012812 (code B ref 35517); Sun, 23 Jun 2019 18:36:02 +0000 Received: (at 35517) by debbugs.gnu.org; 23 Jun 2019 18:35:50 +0000 Received: from localhost ([127.0.0.1]:54599 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hf7LB-0003Ka-Jz for submit@debbugs.gnu.org; Sun, 23 Jun 2019 14:35:49 -0400 Received: from ericabrahamsen.net ([52.70.2.18]:51714 helo=mail.ericabrahamsen.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hf7L8-0003KH-Gg for 35517@debbugs.gnu.org; Sun, 23 Jun 2019 14:35:48 -0400 Received: from localhost (unknown [172.92.212.120]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id BBE37FA05D; Sun, 23 Jun 2019 18:35:39 +0000 (UTC) From: Eric Abrahamsen References: <87wojb5aiu.fsf@ericabrahamsen.net> <875zqoeog6.fsf@ericabrahamsen.net> <87sgs0tddx.fsf@ericabrahamsen.net> Date: Sun, 23 Jun 2019 11:35:29 -0700 In-Reply-To: (Lars Ingebrigtsen's message of "Sun, 23 Jun 2019 19:39:20 +0200") Message-ID: <87k1dctaj2.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) On 06/23/19 19:39 PM, Lars Ingebrigtsen wrote: > Eric Abrahamsen 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
s always have class/id attributes? I guess it's unusual to >>> have neither, but I find myself writing
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
? > 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. From unknown Fri Aug 08 19:51:59 2025 X-Loop: help-debbugs@gnu.org Subject: bug#35517: 27.0.50; Small improvements to HTML mode Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 23 Jun 2019 18:38:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35517 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eric Abrahamsen Cc: 35517@debbugs.gnu.org Received: via spool by 35517-submit@debbugs.gnu.org id=B35517.156131508213091 (code B ref 35517); Sun, 23 Jun 2019 18:38:03 +0000 Received: (at 35517) by debbugs.gnu.org; 23 Jun 2019 18:38:02 +0000 Received: from localhost ([127.0.0.1]:54607 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hf7NK-0003P1-B7 for submit@debbugs.gnu.org; Sun, 23 Jun 2019 14:38:02 -0400 Received: from quimby.gnus.org ([80.91.231.51]:45282) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hf7NI-0003Ol-2J for 35517@debbugs.gnu.org; Sun, 23 Jun 2019 14:38:00 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hf7NE-0000aI-Pv; Sun, 23 Jun 2019 20:37:59 +0200 From: Lars Ingebrigtsen References: <87wojb5aiu.fsf@ericabrahamsen.net> <875zqoeog6.fsf@ericabrahamsen.net> <87sgs0tddx.fsf@ericabrahamsen.net> <87k1dctaj2.fsf@ericabrahamsen.net> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEULCwsHBwc0MjNRTU+A fH0ZGRrSzc8QEBDiLqT7AAACS0lEQVQ4jV2UQW/cIBCFsaLKV0gPubZglGvL4Oy1iunmbhv5Gqkr crW8sfj7fQO73TTPF4uPNzMMHosv8aY9LhlqV5F30d7Wc9EqIIAHvC87sRzRRPTtA7iqbIYQKgpZ 19o1t0I0jRCqOKJQa8YjsCpk0zRyVaItDiXyegnRqOJQslS16BwtTDnvyL7R5sNh9yEITVqbuKDa MQzH93Q+prf5mJJwpONUjjEzOG3H9DoHAO2tnSwD4+npnADeuuLwzo49A/LkZ4BjBX1HeurRpnGA Y745ekPWOBjORMb/B4zWBIA20QWYVADqIhsXbmN3PnG5UwVkXHeIpcF+C+yY6jkg08eRu+5ruTfg +jg5zSBwqLEAAzBcQPd++geey+UBaEemm09bSq/V4WEY+uVOO1MAehUr8H4Ih2Vj4Eu5v8Zr8hB6 ADux4xP4nTdcC1XHSy1Xc5kDuajNxVGB1Xb0aRic1Vr7dz55BTFaEwLud4TjaSo5qiM6fxqw2yLH E06eLi3p47M/EYOo+Wqnj+APAwQzoUtzunwlADRxKB31hKgFpAq6x20guzPzQ3cFdnfnweaRUHDe jfYAXXXQYsLgljwacst9COGlgmV7zJmPgjGLegQ4VICPGWQfPZAQ7UjBHBl8UKNYmITM81FGhiXV FbSrAni4TJ4USl0djWrhuIGmejBUkkNdRxVDpxoJBCvnaHPmPGt1SdHAKtu9gKUWcNfRjxJQtnnn HLyKfeLO008pkaQCCcBhlfxq3PdSF/8TYsn6SRV8Xq1gj38BCRUOP4pOIfkAAAAASUVORK5CYII= Date: Sun, 23 Jun 2019 20:37:56 +0200 In-Reply-To: <87k1dctaj2.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Sun, 23 Jun 2019 11:35:29 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Eric Abrahamsen 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, whe [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eric Abrahamsen 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 From unknown Fri Aug 08 19:51:59 2025 X-Loop: help-debbugs@gnu.org Subject: bug#35517: 27.0.50; Small improvements to HTML mode Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Jun 2019 17:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35517 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Lars Ingebrigtsen Cc: 35517-done@debbugs.gnu.org, 35517@debbugs.gnu.org Received: via spool by 35517-submit@debbugs.gnu.org id=B35517.156139691523511 (code B ref 35517); Mon, 24 Jun 2019 17:22:01 +0000 Received: (at 35517) by debbugs.gnu.org; 24 Jun 2019 17:21:55 +0000 Received: from localhost ([127.0.0.1]:57881 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfSfD-000674-8y for submit@debbugs.gnu.org; Mon, 24 Jun 2019 13:21:55 -0400 Received: from ericabrahamsen.net ([52.70.2.18]:55276 helo=mail.ericabrahamsen.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfSf9-00066i-BT; Mon, 24 Jun 2019 13:21:53 -0400 Received: from localhost (97-126-73-209.tukw.qwest.net [97.126.73.209]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id D7815FA00A; Mon, 24 Jun 2019 17:21:44 +0000 (UTC) From: Eric Abrahamsen References: <87wojb5aiu.fsf@ericabrahamsen.net> <875zqoeog6.fsf@ericabrahamsen.net> <87sgs0tddx.fsf@ericabrahamsen.net> <87k1dctaj2.fsf@ericabrahamsen.net> Date: Mon, 24 Jun 2019 10:21:43 -0700 In-Reply-To: (Lars Ingebrigtsen's message of "Sun, 23 Jun 2019 20:37:56 +0200") Message-ID: <87mui66grc.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) On 06/23/19 20:37 PM, Lars Ingebrigtsen wrote: > Eric Abrahamsen 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 From unknown Fri Aug 08 19:51:59 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Eric Abrahamsen Subject: bug#35517: closed (Re: bug#35517: 27.0.50; Small improvements to HTML mode) Message-ID: References: <87mui66grc.fsf@ericabrahamsen.net> <87wojb5aiu.fsf@ericabrahamsen.net> X-Gnu-PR-Message: they-closed 35517 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 35517@debbugs.gnu.org Date: Mon, 24 Jun 2019 17:22:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1561396922-23533-1" This is a multi-part message in MIME format... ------------=_1561396922-23533-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #35517: 27.0.50; Small improvements to HTML mode which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 35517@debbugs.gnu.org. --=20 35517: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D35517 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1561396922-23533-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 35517-done) by debbugs.gnu.org; 24 Jun 2019 17:21:55 +0000 Received: from localhost ([127.0.0.1]:57879 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfSfD-000672-0o for submit@debbugs.gnu.org; Mon, 24 Jun 2019 13:21:55 -0400 Received: from ericabrahamsen.net ([52.70.2.18]:55276 helo=mail.ericabrahamsen.net) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfSf9-00066i-BT; Mon, 24 Jun 2019 13:21:53 -0400 Received: from localhost (97-126-73-209.tukw.qwest.net [97.126.73.209]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id D7815FA00A; Mon, 24 Jun 2019 17:21:44 +0000 (UTC) From: Eric Abrahamsen To: Lars Ingebrigtsen Subject: Re: bug#35517: 27.0.50; Small improvements to HTML mode References: <87wojb5aiu.fsf@ericabrahamsen.net> <875zqoeog6.fsf@ericabrahamsen.net> <87sgs0tddx.fsf@ericabrahamsen.net> <87k1dctaj2.fsf@ericabrahamsen.net> Date: Mon, 24 Jun 2019 10:21:43 -0700 In-Reply-To: (Lars Ingebrigtsen's message of "Sun, 23 Jun 2019 20:37:56 +0200") Message-ID: <87mui66grc.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 35517-done Cc: 35517-done@debbugs.gnu.org, 35517@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) On 06/23/19 20:37 PM, Lars Ingebrigtsen wrote: > Eric Abrahamsen 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 ------------=_1561396922-23533-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 30 Apr 2019 23:39:22 +0000 Received: from localhost ([127.0.0.1]:42789 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hLcLJ-00081a-Tz for submit@debbugs.gnu.org; Tue, 30 Apr 2019 19:39:22 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51367) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hLcLH-00081N-Uv for submit@debbugs.gnu.org; Tue, 30 Apr 2019 19:39:20 -0400 Received: from lists.gnu.org ([209.51.188.17]:54973) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hLcLC-0003te-JL for submit@debbugs.gnu.org; Tue, 30 Apr 2019 19:39:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37494) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hLcL8-0003b6-Fh for bug-gnu-emacs@gnu.org; Tue, 30 Apr 2019 19:39:14 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_40,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hLcL7-0003s1-Ax for bug-gnu-emacs@gnu.org; Tue, 30 Apr 2019 19:39:10 -0400 Received: from ericabrahamsen.net ([52.70.2.18]:47872 helo=mail.ericabrahamsen.net) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hLcL6-0003hS-SR for bug-gnu-emacs@gnu.org; Tue, 30 Apr 2019 19:39:08 -0400 Received: from localhost (50-251-205-17-static.hfc.comcastbusiness.net [50.251.205.17]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 48DBCFA026 for ; Tue, 30 Apr 2019 23:38:35 +0000 (UTC) From: Eric Abrahamsen To: bug-gnu-emacs@gnu.org Subject: 27.0.50; Small improvements to HTML mode Date: Tue, 30 Apr 2019 16:38:33 -0700 Message-ID: <87wojb5aiu.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 52.70.2.18 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) --=-=-= Content-Type: text/plain 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! --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Tweaks-to-html-mode.patch >From 0293d7bb423950264558363e4e3a3d695f323347 Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen Date: Tue, 30 Apr 2019 16:00:46 -0700 Subject: [PATCH] Tweaks to html mode * lisp/textmodes/sgml-mode.el (sgml-attributes): Add the "class" and "id" attributes when needed. (html-mode-map): Add the `html-div' and `html-span' commands to the `html-quick-keys' map. (html-ordered-list, html-unordered-list, html-paragraph): Use the "\n" element properly. (html-div, html-span): New HTML skeletons. --- lisp/textmodes/sgml-mode.el | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index 9e3be99af1..b0d0ba8536 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el @@ -773,8 +773,16 @@ sgml-attributes (symbolp (car (car alist)))) (setq car (car alist) alist (cdr alist))) - (or quiet - (message "No attributes configured.")) + (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)))) (if (stringp (car alist)) (progn (insert (if (eq (preceding-char) ?\s) "" ?\s) @@ -1752,6 +1760,7 @@ html-mode-map (define-key map "\C-c\C-ci" 'html-image) (when html-quick-keys (define-key map "\C-c-" 'html-horizontal-rule) + (define-key map "\C-cd" 'html-div) (define-key map "\C-co" 'html-ordered-list) (define-key map "\C-cu" 'html-unordered-list) (define-key map "\C-cr" 'html-radio-buttons) @@ -1759,7 +1768,8 @@ html-mode-map (define-key map "\C-cl" 'html-list-item) (define-key map "\C-ch" 'html-href-anchor) (define-key map "\C-cn" 'html-name-anchor) - (define-key map "\C-ci" 'html-image)) + (define-key map "\C-ci" 'html-image) + (define-key map "\C-cs" 'html-span)) (define-key map "\C-c\C-s" 'html-autoview-mode) (define-key map "\C-c\C-v" 'browse-url-of-buffer) (define-key map [menu-bar html] (cons "HTML" menu-map)) @@ -2446,16 +2456,16 @@ html-line (define-skeleton html-ordered-list "HTML ordered list tags." nil - "
    " \n + \n "
      " \n "
    1. " _ (if sgml-xml-mode "
    2. ") \n - "
    ") + "
" > \n) (define-skeleton html-unordered-list "HTML unordered list tags." nil - "
    " \n + \n "
      " \n "
    • " _ (if sgml-xml-mode "
    • ") \n - "
    ") + "
" > \n) (define-skeleton html-list-item "HTML list item tag." @@ -2466,8 +2476,17 @@ html-list-item (define-skeleton html-paragraph "HTML paragraph tag." nil - (if (bolp) nil ?\n) - "

" _ (if sgml-xml-mode "

")) + \n "

" _ (if sgml-xml-mode "

")) + +(define-skeleton html-div + "HTML div tag." + nil + "
" > \n _ \n "
" >) + +(define-skeleton html-span + "HTML span tag." + nil + "" > _ "") (define-skeleton html-checkboxes "Group of connected checkbox inputs." -- 2.21.0 --=-=-=-- ------------=_1561396922-23533-1--