summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorStephen Berman <stephen.berman@gmx.net>2013-05-31 15:43:25 +0200
committerStephen Berman <stephen.berman@gmx.net>2013-05-31 15:43:25 +0200
commit9fa64073386ba6607afdddd773be9aed2a85370d (patch)
treee497f53f84a0c01f41c747371acd9bfb995ea426 /lisp
parenta9b0e28e232e4043267f3ee3d739e12c04c7a170 (diff)
downloademacs-9fa64073386ba6607afdddd773be9aed2a85370d.tar.gz
emacs-9fa64073386ba6607afdddd773be9aed2a85370d.tar.bz2
emacs-9fa64073386ba6607afdddd773be9aed2a85370d.zip
* todos.el (todos-edit-quit): After editing an item, make sure to
return to its category.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/calendar/ChangeLog5
-rw-r--r--lisp/calendar/todos.el7
2 files changed, 10 insertions, 2 deletions
diff --git a/lisp/calendar/ChangeLog b/lisp/calendar/ChangeLog
index fe8f83e2df2..43fbbf2ec41 100644
--- a/lisp/calendar/ChangeLog
+++ b/lisp/calendar/ChangeLog
@@ -1,5 +1,10 @@
2013-05-31 Stephen Berman <stephen.berman@gmx.net>
+ * todos.el (todos-edit-quit): After editing an item, make sure to
+ return to its category.
+
+2013-05-31 Stephen Berman <stephen.berman@gmx.net>
+
* todos.el: Clean up code. Uncapitalize file name in first line.
Require cl-lib instead of cl. Add section title separators.
Reindent some code and comments. Comment out Todos mode menu
diff --git a/lisp/calendar/todos.el b/lisp/calendar/todos.el
index 2e28e9e9bfc..0bbf139b7ee 100644
--- a/lisp/calendar/todos.el
+++ b/lisp/calendar/todos.el
@@ -1385,7 +1385,8 @@ in the number or names of categories."
(if (> (buffer-size) (- (point-max) (point-min)))
;; We got here via `e m'.
(let ((item (buffer-string))
- (regex "\\(\n\\)[^[:blank:]]"))
+ (regex "\\(\n\\)[^[:blank:]]")
+ (buf (buffer-base-buffer)))
(while (not (string-match (concat todos-date-string-start
todos-date-pattern) item))
(setq item (read-from-minibuffer
@@ -1395,7 +1396,9 @@ in the number or names of categories."
(setq item (replace-regexp-in-string regex "\n\t" item nil nil 1))
(delete-region (point-min) (point-max))
(insert item))
- (kill-buffer))
+ (kill-buffer)
+ (unless (eq (current-buffer) buf)
+ (set-window-buffer (selected-window) (set-buffer buf))))
;; We got here via `F e'.
(when (todos-check-format)
;; FIXME: separate out sexp check?