+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.
(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
(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?