From: Stephen Berman Date: Mon, 25 Feb 2013 22:55:27 +0000 (+0100) Subject: * calendar/todos.el (todos-key-bindings): Add binding for `todos-show'. X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~2070 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c898b975737e7bc9cd14ea40cb5e307cd2c10a53;p=emacs.git * calendar/todos.el (todos-key-bindings): Add binding for `todos-show'. (todos-show): Prompt for which todo file to visit when invoked from Todos mode. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 00ea7098ae5..446557b3442 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2013-02-25 Stephen Berman + + * calendar/todos.el (todos-key-bindings): Add binding for `todos-show'. + (todos-show): Prompt for which todo file to visit when invoked + from Todos mode. + 2013-02-19 Stephen Berman * calendar/todos.el: Item insertion and done/undo fixes. diff --git a/lisp/calendar/todos.el b/lisp/calendar/todos.el index 46d419d642c..4dbb1e3f50b 100644 --- a/lisp/calendar/todos.el +++ b/lisp/calendar/todos.el @@ -2623,6 +2623,7 @@ which is the value of the user option (replace-regexp-in-string "-+" "-" (concat "todos-item-insert-" + ;; (concat "todos-insert-item-" (mapconcat (lambda (e) (if e (symbol-name e))) arglist "-"))))) (defvar todos-insertion-commands-names @@ -2675,6 +2676,7 @@ which is the value of the user option (setq key (concat key key1))))) todos-insertion-commands-arg-key-list) (if (string-match (concat (regexp-quote "todos-item-insert") "\\_>") cname) + ;; (if (string-match (concat (regexp-quote "todos-insert-item") "\\_>") cname) (setq key (concat key "i"))) (define-key map key c)))) @@ -2720,6 +2722,7 @@ which is the value of the user option ;; navigation ("f" . todos-forward-category) ("b" . todos-backward-category) + ("t" . todos-show) ("j" . todos-jump-to-category) ("n" . todos-forward-item) ("p" . todos-backward-item) @@ -3023,11 +3026,14 @@ which is the value of the user option ;;;###autoload (defun todos-show (&optional solicit-file) "Visit a Todos file and display one of its categories. -With non-nil prefix argument SOLICIT-FILE prompt for which todo -file to visit; otherwise visit `todos-default-todos-file'. -Subsequent invocations from outside of Todos mode revisit this -file or, with option `todos-show-current-file' non-nil (the -default), whichever Todos file was last visited. + +When invoked in Todos mode, prompt for which todo file to visit. +When invoked outside of Todos mode with non-nil prefix argument +SOLICIT-FILE prompt for which todo file to visit; otherwise visit +`todos-default-todos-file'. Subsequent invocations from outside +of Todos mode revisit this file or, with option +`todos-show-current-file' non-nil (the default), whichever Todos +file was last visited. Calling this command before any Todos file exists prompts for a file name and an initial category (defaulting to @@ -3053,7 +3059,8 @@ corresponding Todos file, displaying the corresponding category." (interactive "P") (let* ((cat) (show-first todos-show-first) - (file (cond (solicit-file + (file (cond ((or (eq major-mode 'todos-mode) + solicit-file) (if (funcall todos-files-function) (todos-read-file-name "Choose a Todos file to visit: " nil t)