summaryrefslogtreecommitdiff
path: root/lisp/calendar
diff options
context:
space:
mode:
authorStephen Berman <stephen.berman@gmx.net>2014-11-26 23:00:42 +0100
committerStephen Berman <stephen.berman@gmx.net>2014-11-26 23:00:42 +0100
commitebf026bdd0afb368a8d5f89f29ef792ea21560e5 (patch)
tree3302d591098ffc3d1e4e51237cc2df7a3a288976 /lisp/calendar
parentd9ad26a6df4110d32454496d2d864fb9a15d6d00 (diff)
downloademacs-ebf026bdd0afb368a8d5f89f29ef792ea21560e5.tar.gz
todo-mode.el: Handle calling todo-mode interactively.
Fixes: debbugs:19112 * calendar/todo-mode.el (todo-mode): If called interactively, just display a message saying to call todo-show to enter Todo mode.
Diffstat (limited to 'lisp/calendar')
-rw-r--r--lisp/calendar/todo-mode.el35
1 files changed, 18 insertions, 17 deletions
diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el
index ab12ebc17f0..ed7c60776b2 100644
--- a/lisp/calendar/todo-mode.el
+++ b/lisp/calendar/todo-mode.el
@@ -6573,23 +6573,24 @@ Added to `window-configuration-change-hook' in Todo mode."
"Major mode for displaying, navigating and editing todo lists.
\\{todo-mode-map}"
- ;; (easy-menu-add todo-menu)
- (todo-modes-set-1)
- (todo-modes-set-2)
- (todo-modes-set-3)
- ;; Initialize todo-current-todo-file.
- (when (member (file-truename (buffer-file-name))
- (funcall todo-files-function))
- (setq-local todo-current-todo-file (file-truename (buffer-file-name))))
- (setq-local todo-show-done-only nil)
- (setq-local todo-categories-with-marks nil)
- ;; (add-hook 'find-file-hook 'todo-add-to-buffer-list nil t)
- (add-hook 'post-command-hook 'todo-update-buffer-list nil t)
- (when todo-show-current-file
- (add-hook 'pre-command-hook 'todo-show-current-file nil t))
- (add-hook 'window-configuration-change-hook
- 'todo-reset-and-enable-done-separator nil t)
- (add-hook 'kill-buffer-hook 'todo-reset-global-current-todo-file nil t))
+ (if (called-interactively-p 'any)
+ (message "Type `M-x todo-show' to enter Todo mode")
+ (todo-modes-set-1)
+ (todo-modes-set-2)
+ (todo-modes-set-3)
+ ;; Initialize todo-current-todo-file.
+ (when (member (file-truename (buffer-file-name))
+ (funcall todo-files-function))
+ (setq-local todo-current-todo-file (file-truename (buffer-file-name))))
+ (setq-local todo-show-done-only nil)
+ (setq-local todo-categories-with-marks nil)
+ ;; (add-hook 'find-file-hook 'todo-add-to-buffer-list nil t)
+ (add-hook 'post-command-hook 'todo-update-buffer-list nil t)
+ (when todo-show-current-file
+ (add-hook 'pre-command-hook 'todo-show-current-file nil t))
+ (add-hook 'window-configuration-change-hook
+ 'todo-reset-and-enable-done-separator nil t)
+ (add-hook 'kill-buffer-hook 'todo-reset-global-current-todo-file nil t)))
(put 'todo-archive-mode 'mode-class 'special)