summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2022-04-17 12:11:36 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2022-04-17 12:11:36 +0200
commitd951e9e650aed1fbe9a587282a8614a4a3b9d35b (patch)
treefee050797d1278abff9f7e833359b1dbf61c18f7 /lisp
parentb8c50fe9108b466e9c88c7c5ff9f2c40b9234199 (diff)
downloademacs-d951e9e650aed1fbe9a587282a8614a4a3b9d35b.tar.gz
emacs-d951e9e650aed1fbe9a587282a8614a4a3b9d35b.tar.bz2
emacs-d951e9e650aed1fbe9a587282a8614a4a3b9d35b.zip
Clarify emacs-news--heading-p logic
* lisp/textmodes/emacs-news-mode.el (emacs-news--heading-p): Clarify the logic.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/textmodes/emacs-news-mode.el9
1 files changed, 6 insertions, 3 deletions
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."