emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 b7871cefe7b: Prevent an infinite loop in todo-mode (bug#66994)


From: Stephen Berman
Subject: emacs-29 b7871cefe7b: Prevent an infinite loop in todo-mode (bug#66994)
Date: Wed, 8 Nov 2023 18:13:24 -0500 (EST)

branch: emacs-29
commit b7871cefe7b94ac6a6a4fd561d41af00ae3d3578
Author: Stephen Berman <stephen.berman@gmx.net>
Commit: Stephen Berman <stephen.berman@gmx.net>

    Prevent an infinite loop in todo-mode (bug#66994)
    
    * lisp/calendar/todo-mode.el (todo-item-start): Moving an item to
    a todo file (with `C-u m') that had not yet been read into a
    buffer puts point at the beginning of the file, from where it is
    impossible to reach todo-item-start by this function, so don't try
    in that case.
---
 lisp/calendar/todo-mode.el | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el
index ad18e8f035e..393dd1851f3 100644
--- a/lisp/calendar/todo-mode.el
+++ b/lisp/calendar/todo-mode.el
@@ -5240,7 +5240,12 @@ changes you have made in the order of the categories.
            ;; Point is on done items separator.
            (save-excursion (beginning-of-line) (looking-at todo-category-done))
           ;; Buffer is widened.
-          (looking-at (regexp-quote todo-category-beg)))
+          (looking-at (regexp-quote todo-category-beg))
+           ;; Moving an item to a todo file (with `C-u m') that had
+           ;; not yet been read into a buffer puts point at the
+           ;; beginning of the file, from where it is impossible to
+           ;; reach todo-item-start by the loop below (bug#66994).
+          (= (point) 1))
     (goto-char (line-beginning-position))
     (while (not (looking-at todo-item-start))
       (forward-line -1))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]