Re: HTML-formatted NEWS for Emacs 29

Peter Oliver <[email protected]>
Newsgroups gmane.emacs.devel
Message-ID <[email protected]>
On Sat, 2 Sep 2023, Eli Zaretskii wrote:

>> From: Stefan Kangas <[email protected]>
>> Date: Sat, 2 Sep 2023 11:49:35 -0700
>> Cc: [email protected]
>>
>> Eli Zaretskii <[email protected]> writes:
>>
>>> According to CVS log, NEWS.28.html was added by Stefan Kangas (CC'ed).
>>> If Stefan can share the procedure he used to generate that file, and
>>> if that procedure is practical enough to be added to make-tarball.txt,
>>> we will follow it from now on.  Alternatively, if Someone wants to
>>> volunteer to prepare such a file, I will upload it.
>>
>> The code is already on the emacs-29 branch.  Here are the instructions:
>>
>>     cd $EMACS_RELEASE_DIR
>>     ./src/emacs -l admin/admin.el -f make-news-html-file
>>     mv etc/NEWS.XX.Y.html $EMACS_WEBROOT/news
>>     cd $EMACS_WEBROOT
>>     cvs commit -m "Update NEWS.XX.Y.html" news/NEWS.XX.Y.html
>>
>> Please see `make-news-html-file' in admin/admin.el for more details.
>>
>> If it is considered useful, we could indeed consider adding these
>> instructions to admin/make-tarball.txt.
>
> Yes, I think we should.

Better late than never, here is a patch against the emacs-31 branch to do that (along with a few more patches to fix the generation for current or older editions of NEWS).

Perhaps someone might like to upload HTML-formatted NEWS for historic versions of Emacs, too.  The formatter appears to pretty-much work all the way back.

-- 
Peter Oliver
0001-Escape-in-NEWS-when-generating-HTML-via-org.patch (text/plain, 837 B)
From 066a972f8dbf810aa1ae3dd4cf69e3134038520f Mon Sep 17 00:00:00 2001
From: Peter Oliver <[email protected]>
Date: Tue, 25 Aug 2026 13:22:14 +0100
Subject: [PATCH 1/4] Escape [[ in NEWS when generating HTML via org

* admin/admin.el (make-news-html-file): Escape [[ with zero width space.
---
 admin/admin.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/admin/admin.el b/admin/admin.el
index d524c369327..bb83de45a95 100644
--- a/admin/admin.el
+++ b/admin/admin.el
@@ -925,6 +925,7 @@ make-news-html-file
 
     ;; Escape some characters.
     (replace-regexp-in-region (rx "$") "@@html:&dollar;@@" (point-min) (point-max))
+    (replace-regexp-in-region (rx "[[") "[\u200B[" (point-min) (point-max))
 
     ;; Use Org-mode markers for 'symbols', 'C-x k', etc.
     (replace-regexp-in-region
-- 
2.55.0
0002-Don-t-assume-NEWS-has-local-variables-when-convertin.patch (text/plain, 1011 B)
From ad17ad006ec48a6032b912496a4bdf87a9afed47 Mon Sep 17 00:00:00 2001
From: Peter Oliver <[email protected]>
Date: Tue, 25 Aug 2026 13:25:12 +0100
Subject: [PATCH 2/4] =?UTF-8?q?Don=E2=80=99t=20assume=20NEWS=20has=20local?=
 =?UTF-8?q?=20variables=20when=20converting=20to=20HTML?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* admin/admin.el (make-news-html-file): Don’t error if no "Local
variables" section is found to remove.
---
 admin/admin.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/admin/admin.el b/admin/admin.el
index bb83de45a95..f05dc0980e1 100644
--- a/admin/admin.el
+++ b/admin/admin.el
@@ -955,7 +955,7 @@ make-news-html-file
 
     ;; Delete buffer local variables.
     (goto-char (point-max))
-    (when (re-search-backward "Local variables:")
+    (when (re-search-backward "Local variables:" nil t)
       (forward-line -1)
       (delete-region (point) (point-max)))
 
-- 
2.55.0
0003-admin-make-tarball.txt-Publish-HTML-formatted-NEWS.patch (text/plain, 1.8 KB)
From 41b5a6ded44195f354beec9f87fecf8810c621bf Mon Sep 17 00:00:00 2001
From: Peter Oliver <[email protected]>
Date: Tue, 25 Aug 2026 13:27:52 +0100
Subject: [PATCH 3/4] * admin/make-tarball.txt: Publish HTML formatted NEWS.

---
 admin/make-tarball.txt | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/admin/make-tarball.txt b/admin/make-tarball.txt
index d17adfbf79c..560d152ffd2 100644
--- a/admin/make-tarball.txt
+++ b/admin/make-tarball.txt
@@ -349,14 +349,18 @@ General steps (for each step, check for possible errors):
     (Use e.g. `M-x mml-secure-message-sign' in `message-mode' to sign
     an email.)
 
-14. After a release, update the Emacs pages as described below.
+14. Generate an HTML-formatted version of the NEWS file:
+
+      ./src/emacs --batch --load=admin/admin.el --funcall=make-news-html-file
+
+15. After a release, update the Emacs pages as described below.
     Note: it is important to add the new NEWS file _before_ bumping the
     Emacs version on the release branch, because doing the latter will
     add (empty) sections to NEWS for the next version, and you don't
     want those sections in the NEWS file reachable from the GNU Emacs
     page.
 
-15. After a release, bump the Emacs version on the release branch.
+16. After a release, bump the Emacs version on the release branch.
     There is no need to bump the version after a pretest; the version
     is bumped before the next pretest or release instead.
 
@@ -376,6 +380,7 @@ The pages and files to update are:
    update is needed)
  . history.html (add a line for the new release)
  . add the new NEWS file as news/NEWS.xx.y
+ . add the new NEWS.xx.html file as news/NEWS.xx.html
  . copy new etc/MACHINES to MACHINES and CONTRIBUTE to CONTRIBUTE
  . possibly/rarely also download.html (see below)
 
-- 
2.55.0
0004-Allow-generation-of-historic-NEWS-as-HTML.patch (text/plain, 7.8 KB)
From 17ffefe2bd9cade8acdd200771c5014491b8226e Mon Sep 17 00:00:00 2001
From: Peter Oliver <[email protected]>
Date: Tue, 25 Aug 2026 13:35:08 +0100
Subject: [PATCH 4/4] Allow generation of historic NEWS as HTML
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* admin/admin.el (make-news-html-file): If the major version given has
it’s own NEWS file, use that.  Understand non-continuous copyright
years.
* etc/NEWS.1-17:, etc/NEWS.19, etc/NEWS.20, etc/NEWS.22, etc/NEWS.24,
etc/NEWS.25: Tweak formatting for expectations of make-news-html-file.
---
 admin/admin.el |  7 +++++--
 etc/NEWS.1-17  | 12 ++++++++++++
 etc/NEWS.19    |  6 ++++++
 etc/NEWS.20    |  5 ++++-
 etc/NEWS.22    |  1 +
 etc/NEWS.24    |  2 ++
 etc/NEWS.25    |  1 +
 7 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/admin/admin.el b/admin/admin.el
index f05dc0980e1..5fc44909537 100644
--- a/admin/admin.el
+++ b/admin/admin.el
@@ -896,7 +896,10 @@ make-news-html-file
   (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* ((newsfile (expand-file-name "etc/NEWS" root))
+  (let* ((oldnewsfile (expand-file-name (format "etc/NEWS.%s" version) root))
+         (newsfile (if (file-exists-p oldnewsfile)
+                       oldnewsfile
+                     (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")))
@@ -906,7 +909,7 @@ make-news-html-file
 
     ;; Find the copyright range.
     (goto-char (point-min))
-    (re-search-forward "^Copyright (C) \\([0-9-]+\\) Free Software Foundation, Inc.")
+    (re-search-forward "^Copyright (C) \\([0-9, -]+\\) Free Software Foundation, Inc.")
     (setq copyright-years (match-string 1))
 
     ;; Delete some unnecessary stuff.
diff --git a/etc/NEWS.1-17 b/etc/NEWS.1-17
index 793dc2a3014..cfa6dd8abf7 100644
--- a/etc/NEWS.1-17
+++ b/etc/NEWS.1-17
@@ -635,7 +635,9 @@ To implement a switch that uses up one or more following arguments,
 use the fact that the remaining command line arguments are kept
 as a list in the variable 'command-line-args'.  FUNCTION can
 examine this variable, and do
+
     (setq command-line-args (cdr command-line-args)
+
 to "use up" an argument.
 
 ** New variable 'load-in-progress'.
@@ -1424,7 +1426,9 @@ This is because -batch (see above) is now used in building Emacs.
 
  The function 'featurep' of one argument may be used to test for the
  presence of a feature.  It is just the same as
+
     (not (null (memq FEATURE features)))
+
  where FEATURE is its argument.  For example,
 
     (if (featurep 'magic-window-hack)
@@ -2028,7 +2032,9 @@ C-u C-x C-d passes the -l switch to 'ls'.
 ** M-ESC (eval-expression) is now a disabled command by default.
  This prevents users who type ESC ESC accidentally from
  getting confusing results.  Put
+
     (put 'eval-expression 'disabled nil)
+
  in your ~/.emacs file to enable the command.
 
 ** Self-inserting text is grouped into bunches for undoing.
@@ -2130,6 +2136,7 @@ C-u C-x C-d passes the -l switch to 'ls'.
  are chosen.
 
 ** 'expand-file-name' no longer discards a final slash.
+
     (expand-file-name "foo" "/lose") => "/lose/foo"
     (expand-file-name "foo/" "/lose") => "/lose/foo/"
 
@@ -2342,10 +2349,15 @@ to be read by Emacs's superior shell after Emacs exits.
 
 ** Lisp macros now exist.
  For example, you can write
+
     (defmacro mycadr (arg) (list 'car (list 'cdr arg)))
+
  and then the expression
+
     (mycadr foo)
+
  will expand into
+
     (car (cdr foo))
 
 
diff --git a/etc/NEWS.19 b/etc/NEWS.19
index 4d13ee9a923..079f0fa1e9f 100644
--- a/etc/NEWS.19
+++ b/etc/NEWS.19
@@ -1286,7 +1286,9 @@ room for more); to overcome this limitation, add this to autoexec.bat:
 
 ** The escape character can now be displayed on X frames.  Try
 this:
+
     (aset standard-display-table 27 (vector 27))
+
 after first creating a display table (you can do that by loading
 the disp-table library).
 
@@ -2404,7 +2406,9 @@ which are ways of translating between the data in a file and things
 
 'format-alist' has one element for each format.  Each element is a
 list like this:
+
   (NAME DOC-STRING REGEXP FROM-FN TO-FN MODIFY MODE-FN)
+
 containing the name of the format, a documentation string, a regular
 expression which is used to recognize files in that format, a decoding
 function, an encoding function, a flag that indicates whether the
@@ -2712,7 +2716,9 @@ functions called for insertions at the end of the overlay.
 
 Each function is called both before and after each change that it
 applies to.  Before the change, it is called with four arguments:
+
     (funcall FUNCTION OVERLAY nil START END)
+
 START and END are the same arguments that the before-change-functions
 receive.
 
diff --git a/etc/NEWS.20 b/etc/NEWS.20
index 36ccfd64b61..a8672f07f01 100644
--- a/etc/NEWS.20
+++ b/etc/NEWS.20
@@ -2082,7 +2082,7 @@ Here is the substitution rule:
     defined in the variable x-charset-registries.  For instance, ASCII has
     the entry (ascii . "ISO8859-1") in this variable.  Then, reduce
     sequences of wild cards -*-...-*- with a single wildcard -*-.
-    (This is to prevent use of auto-scaled fonts.)
+    This is to prevent use of auto-scaled fonts.
 
 The function which processes the fontset resource value to create the
 fontset is called 'create-fontset-from-fontset-spec'.  You can also call
@@ -3618,8 +3618,11 @@ velocity to scroll (with mouse-drag-throw) or the distance to scroll
 (with mouse-drag-drag).  Horizontal scrolling is enabled when needed.
 
 Enable mouse-drag with:
+
     (global-set-key [down-mouse-2] 'mouse-drag-throw)
+
 -or-
+
     (global-set-key [down-mouse-2] 'mouse-drag-drag)
 
 *** mspools.el is useful for determining which mail folders have
diff --git a/etc/NEWS.22 b/etc/NEWS.22
index 41a9718c0f3..1c3840fbc87 100644
--- a/etc/NEWS.22
+++ b/etc/NEWS.22
@@ -1620,6 +1620,7 @@ The new variables 'x-alt-keysym', 'x-hyper-keysym', 'x-meta-keysym',
 and 'x-super-keysym' can be used to choose which keysyms Emacs should
 use for the modifiers.  For example, the following two lines swap
 Meta and Alt:
+
     (setq x-alt-keysym 'meta)
     (setq x-meta-keysym 'alt)
 
diff --git a/etc/NEWS.24 b/etc/NEWS.24
index 4a5ac24cfff..b512d52d39b 100644
--- a/etc/NEWS.24
+++ b/etc/NEWS.24
@@ -3226,6 +3226,7 @@ this was not advertised at the time.
 
 *** partial-completion-mode (complete.el) is obsolete.
 You can get a comparable behavior with:
+
     (setq completion-styles '(partial-completion initials))
     (setq completion-pcm-complete-word-inserts-delimiters t)
 
@@ -3790,6 +3791,7 @@ functions 'display-delayed-warnings' and 'collapse-delayed-warnings'.
 ** New function 'make-composed-keymap' that constructs a new keymap
 from multiple input maps.  You can use this to make a keymap that
 inherits from multiple maps, eg:
+
     (set-keymap-parent newmap (make-composed-keymap othermap parent))
 
 ** New function 'string-prefix-p'.
diff --git a/etc/NEWS.25 b/etc/NEWS.25
index 1801020619e..83c0859c7d3 100644
--- a/etc/NEWS.25
+++ b/etc/NEWS.25
@@ -550,6 +550,7 @@ When you invoke 'shell' interactively, the '*shell*' buffer will now
 display in a new window.  However, you can customize this behavior via
 the 'display-buffer-alist' variable.  For example, to get
 the old behavior -- '*shell*' buffer displays in current window -- use
+
     (add-to-list 'display-buffer-alist
          '("\\`\\*shell\\*\\'" . (display-buffer-same-window))).
 
-- 
2.55.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.