]> git.eshelyaron.com Git - emacs.git/commitdiff
Fixes: debbugs:20832
authorStephen Berman <stephen.berman@gmx.net>
Fri, 19 Jun 2015 15:03:49 +0000 (17:03 +0200)
committerStephen Berman <stephen.berman@gmx.net>
Fri, 19 Jun 2015 15:03:49 +0000 (17:03 +0200)
* lisp/calendar/todo-mode.el (todo-show): Don't visit todo file
in the minibuffer.

lisp/calendar/todo-mode.el

index 6e975249a3fa3169e6b607b73df1007f561e5d4a..c869727f4c19a60cab7c5a805f1cbe5ddca516e2 100644 (file)
@@ -672,7 +672,7 @@ corresponding todo file, displaying the corresponding category."
                                                      todo-filtered-items-mode))))
                          (if (funcall todo-files-function)
                              (todo-read-file-name "Choose a todo file to visit: "
-                                                   nil t)
+                                                  nil t)
                            (user-error "There are no todo files")))
                         ((and (eq major-mode 'todo-archive-mode)
                               ;; Called noninteractively via todo-quit
@@ -732,7 +732,10 @@ corresponding todo file, displaying the corresponding category."
        (when (or (member file todo-visited)
                  (eq todo-show-first 'first))
          (unless (todo-check-file file) (throw 'end nil))
-         (set-window-buffer (selected-window)
+          ;; If todo-show is called from the minibuffer, don't visit
+          ;; the todo file there.
+         (set-window-buffer (if (minibufferp) (minibuffer-selected-window)
+                              (selected-window))
                             (set-buffer (find-file-noselect file 'nowarn)))
          (if (equal (file-name-extension (buffer-file-name)) "toda")
              (unless (derived-mode-p 'todo-archive-mode) (todo-archive-mode))