[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master d951e9e650 1/2: Clarify emacs-news--heading-p logic
From: |
Lars Ingebrigtsen |
Subject: |
master d951e9e650 1/2: Clarify emacs-news--heading-p logic |
Date: |
Sun, 17 Apr 2022 06:17:51 -0400 (EDT) |
branch: master
commit d951e9e650aed1fbe9a587282a8614a4a3b9d35b
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Clarify emacs-news--heading-p logic
* lisp/textmodes/emacs-news-mode.el (emacs-news--heading-p):
Clarify the logic.
---
lisp/textmodes/emacs-news-mode.el | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/lisp/textmodes/emacs-news-mode.el
b/lisp/textmodes/emacs-news-mode.el
index e31a7105b8..d9c5b15bf4 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."