Fixes: debbugs:20832

* lisp/calendar/todo-mode.el (todo-show): Don't visit todo file
in the minibuffer.
This commit is contained in:
Stephen Berman 2015-06-19 17:03:49 +02:00
parent b9f02cf65a
commit a5e6f33b4c

View file

@ -732,7 +732,10 @@ corresponding todo file, displaying the corresponding category."
(when (or (member file todo-visited) (when (or (member file todo-visited)
(eq todo-show-first 'first)) (eq todo-show-first 'first))
(unless (todo-check-file file) (throw 'end nil)) (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))) (set-buffer (find-file-noselect file 'nowarn)))
(if (equal (file-name-extension (buffer-file-name)) "toda") (if (equal (file-name-extension (buffer-file-name)) "toda")
(unless (derived-mode-p 'todo-archive-mode) (todo-archive-mode)) (unless (derived-mode-p 'todo-archive-mode) (todo-archive-mode))