Re: HTML-formatted NEWS for Emacs 29

Peter Oliver <[email protected]>
Newsgroups gmane.emacs.devel
Message-ID <[email protected]>
On Sat, 29 Aug 2026, Eli Zaretskii wrote:

> It would be good not to have such requirements for formatting NEWS;

Indeed so.  Attached is a patch to do that.

Nevertheless, we have to have *some* expectations, of course, else formatting is impossible.  Enforcing consistency allows the formatter to be simpler and, I would expect, more predictable.  We should perhaps not get too carried away if we discover similar issues.

-- 
Peter Oliver
0005-Relax-formatting-requirements-on-NEWS-when-convertin.patch (text/plain, 1.3 KB)
From 083434e286fb1f728fd63d47f811c1ee7a2c98cf Mon Sep 17 00:00:00 2001
From: Peter Oliver <[email protected]>
Date: Tue, 1 Sep 2026 13:54:35 +0100
Subject: [PATCH 5/5] Relax formatting requirements on NEWS when converting to
 HTML

* admin/admin.el (make-news-html-file): Accurately detect blocks even
when not separated by blank lines.
---
 admin/admin.el | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/admin/admin.el b/admin/admin.el
index 5fc44909537..e67d32177b7 100644
--- a/admin/admin.el
+++ b/admin/admin.el
@@ -947,11 +947,15 @@ make-news-html-file
     ;; Format code blocks.
     (while (re-search-forward "^    " nil t)
       (let ((elisp-block (looking-at "(")))
-        (backward-paragraph)
+        (let ((paragraph-start "^    "))
+          (backward-paragraph))
+        (unless (looking-at paragraph-separate)
+          (save-excursion (insert "\n")))
         (insert (if elisp-block
                     "\n#+BEGIN_SRC emacs-lisp"
                   "\n#+BEGIN_EXAMPLE"))
-        (forward-paragraph)
+        (let ((paragraph-start "^[^ ]"))
+          (forward-paragraph))
         (insert (if elisp-block
                     "#+END_SRC\n"
                   "#+END_EXAMPLE\n"))))
-- 
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.