emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-24 008a04a: todo-mode.el: Restore point on setting i


From: Stephen Berman
Subject: [Emacs-diffs] emacs-24 008a04a: todo-mode.el: Restore point on setting item done (Bug#19727)
Date: Wed, 04 Feb 2015 21:39:58 +0000

branch: emacs-24
commit 008a04ac9af20540d6e7ee4b61fb5bb3b21ef0e6
Author: Robert Pluim <address@hidden>
Commit: Stephen Berman <address@hidden>

    todo-mode.el: Restore point on setting item done  (Bug#19727)
    
    calendar/todo-mode.el (todo-item-done): When done items are hidden,
    restore point to its location prior to invoking this command.
---
 lisp/ChangeLog             |    6 ++++++
 lisp/calendar/todo-mode.el |    7 +++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e0c8815..0e00cb2 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2015-02-04  Robert Pluim  <address@hidden>  (tiny change)
+
+       * calendar/todo-mode.el (todo-item-done): When done items are
+       hidden, restore point to its location prior to invoking this
+       command.  (Bug#19727)
+
 2015-02-04  Eli Zaretskii  <address@hidden>
 
        * textmodes/artist.el (artist-ellipse-compute-fill-info): Use
diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el
index 7ca57a4..dcc960f 100644
--- a/lisp/calendar/todo-mode.el
+++ b/lisp/calendar/todo-mode.el
@@ -2816,7 +2816,8 @@ visible."
                          (goto-char (point-min))
                          (re-search-forward todo-done-string-start nil t)))
             (buffer-read-only nil)
-            item done-item opoint)
+            item done-item
+            (opoint (point)))
        ;; Don't add empty comment to done item.
        (setq comment (unless (zerop (length comment))
                        (concat " [" todo-comment-string ": " comment "]")))
@@ -2854,7 +2855,9 @@ visible."
        (todo-update-categories-sexp)
        (let ((todo-show-with-done show-done))
          (todo-category-select)
-         ;; When done items are shown, put cursor on first just done item.
+         ;; When done items are visible, put point at the top of the
+         ;; done items section.  When done items are hidden, restore
+         ;; point to its location prior to invoking this command.
          (when opoint (goto-char opoint)))))))
 
 (defun todo-item-undone ()



reply via email to

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