From 5d227ae83e57eb5ef2144e3af3e3431d26d77bc1 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Fri, 16 Sep 2022 18:54:59 +0200 Subject: [PATCH 1/5] ; * etc/NEWS: Fix formatting. --- etc/NEWS | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 47e82a96e64..2fed65e7391 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1319,18 +1319,18 @@ comma-separated list. *** New commands to filter the package list. The filter commands are bound to the following keys: -key binding ---- ------- -/ a package-menu-filter-by-archive -/ d package-menu-filter-by-description -/ k package-menu-filter-by-keyword -/ N package-menu-filter-by-name-or-description -/ n package-menu-filter-by-name -/ s package-menu-filter-by-status -/ v package-menu-filter-by-version -/ m package-menu-filter-marked -/ u package-menu-filter-upgradable -/ / package-menu-clear-filter + key binding + --- ------- + / a package-menu-filter-by-archive + / d package-menu-filter-by-description + / k package-menu-filter-by-keyword + / N package-menu-filter-by-name-or-description + / n package-menu-filter-by-name + / s package-menu-filter-by-status + / v package-menu-filter-by-version + / m package-menu-filter-marked + / u package-menu-filter-upgradable + / / package-menu-clear-filter *** Option to automatically native-compile packages upon installation. Customize the user option 'package-native-compile' to enable automatic From bcc84ac7feccf285811d3bc3254fa10062c9334c Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Fri, 16 Sep 2022 19:33:02 +0200 Subject: [PATCH 2/5] Add version headlines to HTML NEWS export This allows linking to, e.g. "NEWS.28.html#28.1" to go directly to those release notes. * admin/admin.el (admin--org-export-headers-format) (make-news-html-file): Add XX.Y version headlines with an HTML anchor. --- admin/admin.el | 49 +++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 39 insertions(+), 10 deletions(-) diff --git a/admin/admin.el b/admin/admin.el index 60b043a3516..14f0f80188b 100644 --- a/admin/admin.el +++ b/admin/admin.el @@ -773,7 +773,7 @@ Optional argument TYPE is type of output (nil means all)." (defvar admin--org-export-headers-format "\ #+title: GNU Emacs %s NEWS -- history of user-visible changes #+author: -#+options: author:nil creator:nil toc:1 num:2 *:nil \\n:t ^:nil tex:nil +#+options: author:nil creator:nil toc:2 num:3 *:nil \\n:t ^:nil tex:nil #+language: en #+HTML_LINK_HOME: /software/emacs #+HTML_LINK_UP: /software/emacs @@ -851,12 +851,13 @@ $Date: %s $ (unless (file-exists-p (expand-file-name "src/emacs.c" root)) (user-error "%s doesn't seem to be the root of an Emacs source tree" root)) (admin--require-external-package 'htmlize) - (let* ((orig (expand-file-name "etc/NEWS" root)) - (new (expand-file-name (format "etc/NEWS.%s.org" version) root)) - (html-file (format "%s.html" (file-name-base new))) + (let* ((newsfile (expand-file-name "etc/NEWS" root)) + (orgfile (expand-file-name (format "etc/NEWS.%s.org" version) root)) + (html (format "%s.html" (file-name-base orgfile))) (copyright-years (format-time-string "%Y"))) - (copy-file orig new t) - (find-file new) + (delete-file orgfile) + (copy-file newsfile orgfile t) + (find-file orgfile) ;; Find the copyright range. (goto-char (point-min)) @@ -931,6 +932,34 @@ $Date: %s $ (org-mode) (save-buffer) + ;; Make everything one level lower. + (goto-char (point-min)) + (while (re-search-forward (rx bol (group (+ "*")) " ") nil t) + (replace-match "*\\1" nil nil nil 1)) + + ;; Insert anchors for different versions. + (goto-char (point-min)) + (let (last-major last-minor) + (while (re-search-forward (rx bol "** " (+ (not "\n")) "in Emacs " + (group digit digit) "." (group digit) + eol) + nil t) + (unless (and (equal (match-string 1) last-major) + (equal (match-string 2) last-minor)) + (setq last-major (match-string 1)) + (setq last-minor (match-string 2)) + (forward-line -1) + (insert (format + (concat + ;; Add anchor to allow linking to + ;; e.g. "NEWS.28.html#28.1". + "#+HTML:

 

\n" + "* Changes in Emacs %s.%s\n") + last-major last-minor + last-major last-minor))))) + + (save-buffer) + ;; Make the HTML export. (let* ((org-html-postamble (format admin--org-html-postamble @@ -942,12 +971,12 @@ $Date: %s $ (org-html-export-as-html)) ;; Write HTML to file. - (let ((new (expand-file-name html-file (expand-file-name "etc" root)))) - (write-file new) + (let ((html (expand-file-name html (expand-file-name "etc" root)))) + (write-file html) (unless noninteractive - (find-file new) + (find-file html) (html-mode)) - (message "Successfully exported HTML to %s" new)))) + (message "Successfully exported HTML to %s" html)))) ;; Stuff to check new `defcustom's got :version tags. From 069ffbda0934b114959ca514616d9a56cdb0063a Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Fri, 16 Sep 2022 19:46:31 +0200 Subject: [PATCH 3/5] * admin/admin.el (make-news-html-file): Set id on correct tag. --- admin/admin.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/admin/admin.el b/admin/admin.el index 14f0f80188b..4727dd08e6f 100644 --- a/admin/admin.el +++ b/admin/admin.el @@ -951,10 +951,13 @@ $Date: %s $ (forward-line -1) (insert (format (concat + "#+HTML:

 

\n" + "* Changes in Emacs %s.%s\n" ;; Add anchor to allow linking to ;; e.g. "NEWS.28.html#28.1". - "#+HTML:

 

\n" - "* Changes in Emacs %s.%s\n") + ":PROPERTIES:\n" + ":CUSTOM_ID: %s.%s\n" + ":END:\n") last-major last-minor last-major last-minor))))) From 5dbe4fa64abe9e9991e060ecd61f34e675b1bf8a Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 17 Sep 2022 02:13:05 +0200 Subject: [PATCH 4/5] Simplify regexp in make-news-html-file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * admin/admin.el (make-news-html-file): Simplify regexp. Suggested by Mattias EngdegÄrd . --- admin/admin.el | 35 +++++++++++------------------------ 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/admin/admin.el b/admin/admin.el index 4727dd08e6f..3906dd8d63c 100644 --- a/admin/admin.el +++ b/admin/admin.el @@ -883,30 +883,17 @@ $Date: %s $ ;; Use Org-mode markers for 'symbols', 'C-x k', etc. (replace-regexp-in-region - (rx-let ((key (seq - ;; Modifier (optional) - (? (any "ACHMSs") "-") - (or - ;; single key - (not (any " \n")) - ;; "" and " " - (seq "<" - (+ (any "A-Za-z-")) - (+ (seq " " (+ (any "A-Za-z-")))) - ">") - "NUL" "RET" "LFD" "TAB" - "ESC" "SPC" "DEL"))) - (email (seq (+ (not (any " @\n"))) - "@" - (+ (not (any " @\n"))))) - (lisp-symbol (regexp lisp-mode-symbol-regexp))) - (rx "'" (group - (or lisp-symbol - email - (seq "M-x " lisp-symbol) - (seq key (+ " " key)))) - "'")) - "~\\1~" (point-min) (point-max)) + (rx (or (: (group (in " \t\n(")) + "'" + (group (+ (or (not (in "'\n")) + (: "'" (not (in " .,\t\n)")))))) + "'" + (group (in ",.;:!? \t\n)"))) + ;; Buffer names, e.g. "*scratch*". + (: "\"" + (group-n 2 "*" (+ (not (in "*\""))) "*") + "\""))) + "\\1~\\2~\\3" (point-min) (point-max)) ;; Format code blocks. (while (re-search-forward "^ " nil t) From 320f0cac8008a54b988c0166dbfd195f5de8790f Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 17 Sep 2022 02:13:27 +0200 Subject: [PATCH 5/5] ; * etc/NEWS: Fix typo. --- etc/NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/NEWS b/etc/NEWS index 2fed65e7391..8694b575a7a 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2623,7 +2623,7 @@ non-nil. ** ERC -*** Starting with Emacs 28.1 and ERC 5.4, see the ERC-NEWS file for +Starting with Emacs 28.1 and ERC 5.4, see the ERC-NEWS file for user-visible changes in ERC. ** Xwidget Webkit mode