]> git.eshelyaron.com Git - emacs.git/commitdiff
todo-mode.el: Handle calling todo-mode interactively.
authorStephen Berman <stephen.berman@gmx.net>
Wed, 26 Nov 2014 22:00:42 +0000 (23:00 +0100)
committerStephen Berman <stephen.berman@gmx.net>
Wed, 26 Nov 2014 22:00:42 +0000 (23:00 +0100)
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.

lisp/ChangeLog
lisp/calendar/todo-mode.el

index 351472d02fdbee64939970d941b033bbe420eafb..0741bfd41c9d32186d323bb046a961426d98b311 100644 (file)
@@ -1,3 +1,9 @@
+2014-11-26  Stephen Berman  <stephen.berman@gmx.net>
+
+       * calendar/todo-mode.el (todo-mode): If called interactively, just
+       display a message saying to call todo-show to enter Todo mode
+       (Bug#19112).
+
 2014-11-24  Dmitry Gutov  <dgutov@yandex.ru>
 
        * vc/vc-hg.el (vc-hg-dir-status-files): Include ignored files.
index ab12ebc17f055692cf4604f6cd27c7d0950cf7ad..ed7c60776b2b6d1aff8f0a6f886c906ac9a2de08 100644 (file)
@@ -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)