aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRobert Pluim2015-02-04 22:38:52 +0100
committerStephen Berman2015-02-04 22:38:52 +0100
commit008a04ac9af20540d6e7ee4b61fb5bb3b21ef0e6 (patch)
tree49514545684c591e7bacde33537d6ae57e9cafa5 /lisp
parent9615c0dead1b5828fa6a599eb7fa18551921938b (diff)
downloademacs-008a04ac9af20540d6e7ee4b61fb5bb3b21ef0e6.tar.gz
emacs-008a04ac9af20540d6e7ee4b61fb5bb3b21ef0e6.zip
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.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/calendar/todo-mode.el7
2 files changed, 11 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e0c8815c648..0e00cb2f17f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12015-02-04 Robert Pluim <rpluim@gmail.com> (tiny change)
2
3 * calendar/todo-mode.el (todo-item-done): When done items are
4 hidden, restore point to its location prior to invoking this
5 command. (Bug#19727)
6
12015-02-04 Eli Zaretskii <eliz@gnu.org> 72015-02-04 Eli Zaretskii <eliz@gnu.org>
2 8
3 * textmodes/artist.el (artist-ellipse-compute-fill-info): Use 9 * textmodes/artist.el (artist-ellipse-compute-fill-info): Use
diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el
index 7ca57a42b76..dcc960fb9bf 100644
--- a/lisp/calendar/todo-mode.el
+++ b/lisp/calendar/todo-mode.el
@@ -2816,7 +2816,8 @@ visible."
2816 (goto-char (point-min)) 2816 (goto-char (point-min))
2817 (re-search-forward todo-done-string-start nil t))) 2817 (re-search-forward todo-done-string-start nil t)))
2818 (buffer-read-only nil) 2818 (buffer-read-only nil)
2819 item done-item opoint) 2819 item done-item
2820 (opoint (point)))
2820 ;; Don't add empty comment to done item. 2821 ;; Don't add empty comment to done item.
2821 (setq comment (unless (zerop (length comment)) 2822 (setq comment (unless (zerop (length comment))
2822 (concat " [" todo-comment-string ": " comment "]"))) 2823 (concat " [" todo-comment-string ": " comment "]")))
@@ -2854,7 +2855,9 @@ visible."
2854 (todo-update-categories-sexp) 2855 (todo-update-categories-sexp)
2855 (let ((todo-show-with-done show-done)) 2856 (let ((todo-show-with-done show-done))
2856 (todo-category-select) 2857 (todo-category-select)
2857 ;; When done items are shown, put cursor on first just done item. 2858 ;; When done items are visible, put point at the top of the
2859 ;; done items section. When done items are hidden, restore
2860 ;; point to its location prior to invoking this command.
2858 (when opoint (goto-char opoint))))))) 2861 (when opoint (goto-char opoint)))))))
2859 2862
2860(defun todo-item-undone () 2863(defun todo-item-undone ()