From: Lars Ingebrigtsen Date: Sun, 17 Apr 2022 10:11:36 +0000 (+0200) Subject: Clarify emacs-news--heading-p logic X-Git-Tag: emacs-29.0.90~1931^2~472 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d951e9e650aed1fbe9a587282a8614a4a3b9d35b;p=emacs.git Clarify emacs-news--heading-p logic * lisp/textmodes/emacs-news-mode.el (emacs-news--heading-p): Clarify the logic. --- diff --git a/lisp/textmodes/emacs-news-mode.el b/lisp/textmodes/emacs-news-mode.el index e31a7105b80..d9c5b15bf42 100644 --- a/lisp/textmodes/emacs-news-mode.el +++ b/lisp/textmodes/emacs-news-mode.el @@ -131,11 +131,14 @@ untagged NEWS entry." (defun emacs-news--heading-p () (save-excursion (beginning-of-line) + ;; A heading starts with * characters, and then a blank line, and + ;; then paragraphs with more * characters than in the heading. (and (looking-at "\\(\\*+\\) ") (let ((level (length (match-string 1)))) - (goto-char (match-end 0)) - (when (re-search-forward "^\\(\\*+\\) " nil t) - (> (length (match-string 1)) level)))))) + (forward-line 1) + (and (looking-at "$") + (re-search-forward "^\\(\\*+\\) " nil t) + (> (length (match-string 1)) level)))))) (defun emacs-news-previous-untagged-entry () "Go to the previous untagged NEWS entry."