diff options
author | Stephen Berman <stephen.berman@gmx.net> | 2014-11-26 23:17:41 +0100 |
---|---|---|
committer | Stephen Berman <stephen.berman@gmx.net> | 2014-11-26 23:17:41 +0100 |
commit | 47f573a4bf6b5126884286690ce1e8818ada74ee (patch) | |
tree | df54debfe5b2239e525486b7fe91f6145656e87b /lisp/calendar/todo-mode.el | |
parent | ebf026bdd0afb368a8d5f89f29ef792ea21560e5 (diff) | |
download | emacs-47f573a4bf6b5126884286690ce1e8818ada74ee.tar.gz |
todo-mode.el: Handle calling revert-buffer.
Fixes: debbugs:19187
* calendar/todo-mode.el: (todo-revert-buffer): New function.
(todo-modes-set-1): Use it as the buffer-local value of
revert-buffer-function.
Diffstat (limited to 'lisp/calendar/todo-mode.el')
-rw-r--r-- | lisp/calendar/todo-mode.el | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el index ed7c60776b2..3ba263f00e3 100644 --- a/lisp/calendar/todo-mode.el +++ b/lisp/calendar/todo-mode.el @@ -5194,6 +5194,15 @@ Overrides `diary-goto-entry'." (add-function :override diary-goto-entry-function #'todo-diary-goto-entry) +(defun todo-revert-buffer (&optional ignore-auto noconfirm) + "Call `revert-buffer', preserving buffer's current modes. +Also preserve category display, if applicable." + (interactive (list (not current-prefix-arg))) + (let ((revert-buffer-function nil)) + (revert-buffer ignore-auto noconfirm 'preserve-modes) + (when (memq major-mode '(todo-mode todo-archive-mode)) + (todo-category-select)))) + (defun todo-desktop-save-buffer (_dir) `((catnum . ,(todo-category-number (todo-current-category))))) @@ -6540,6 +6549,7 @@ Added to `window-configuration-change-hook' in Todo mode." (defun todo-modes-set-1 () "Make some settings that apply to multiple Todo modes." (setq-local font-lock-defaults '(todo-font-lock-keywords t)) + (setq-local revert-buffer-function 'todo-revert-buffer) (setq-local tab-width todo-indent-to-here) (setq-local indent-line-function 'todo-indent) (when todo-wrap-lines |