summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Berman <stephen.berman@gmx.net>2014-06-25 14:06:00 +0200
committerStephen Berman <stephen.berman@gmx.net>2014-06-25 14:06:00 +0200
commita5128e3ded506a54619177d9a7c95d58463baace (patch)
treebf4f3c2a7b70eea0e0bb97cdf30fd8ff2d7278f8
parent50f290812618d79c29a5c540bb65ee6e52dc548d (diff)
downloademacs-a5128e3ded506a54619177d9a7c95d58463baace.tar.gz
* calendar/todo-mode.el: Fix two bugs.
(todo-insert-item--basic): If user cancels item insertion to another category before setting priority, show original category whether it is in the same or a different file. (todo-set-item-priority): After selecting category, instead of moving point to top, which extends an active region, restore it.
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/calendar/todo-mode.el19
2 files changed, 18 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f0fecd95e9f..d5583eef10e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,12 @@
+2014-06-25 Stephen Berman <stephen.berman@gmx.net>
+
+ * calendar/todo-mode.el: Fix two bugs.
+ (todo-insert-item--basic): If user cancels item insertion to
+ another category before setting priority, show original category
+ whether it is in the same or a different file.
+ (todo-set-item-priority): After selecting category, instead of
+ moving point to top, which extends an active region, restore it.
+
2014-06-25 Stefan Monnier <monnier@iro.umontreal.ca>
* help-fns.el (describe-function-1): Check file-name is a string before
diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el
index ab2ab3e4cb8..1a54cc2c67b 100644
--- a/lisp/calendar/todo-mode.el
+++ b/lisp/calendar/todo-mode.el
@@ -1962,13 +1962,12 @@ their associated keys and their effects."
;; If user cancels before setting priority, restore
;; display.
(unless item-added
- (if ocat
- (progn
- (unless (equal cat ocat)
- (todo-category-number ocat)
- (todo-category-select))
- (and done-only (todo-toggle-view-done-only)))
- (set-window-buffer (selected-window) (set-buffer obuf)))
+ (set-window-buffer (selected-window) (set-buffer obuf))
+ (when ocat
+ (unless (equal cat ocat)
+ (todo-category-number ocat)
+ (todo-category-select))
+ (and done-only (todo-toggle-view-done-only)))
(goto-char opoint))
;; If the todo items section is not visible when the
;; insertion command is called (either because only done
@@ -2553,9 +2552,9 @@ meaning to raise or lower the item's priority by one."
(goto-char (point-min))
(setq done (re-search-forward todo-done-string-start nil t))))
(let ((todo-show-with-done done))
- (todo-category-select)
- ;; Keep top of category in view while setting priority.
- (goto-char (point-min)))))
+ ;; Keep current item or top of moved to category in view
+ ;; while setting priority.
+ (save-excursion (todo-category-select)))))
;; Prompt for priority only when the category has at least one
;; todo item.
(when (> maxnum 1)