diff options
| author | Stephen Berman | 2014-11-26 23:17:41 +0100 |
|---|---|---|
| committer | Stephen Berman | 2014-11-26 23:17:41 +0100 |
| commit | 47f573a4bf6b5126884286690ce1e8818ada74ee (patch) | |
| tree | df54debfe5b2239e525486b7fe91f6145656e87b | |
| parent | ebf026bdd0afb368a8d5f89f29ef792ea21560e5 (diff) | |
| download | emacs-47f573a4bf6b5126884286690ce1e8818ada74ee.tar.gz emacs-47f573a4bf6b5126884286690ce1e8818ada74ee.zip | |
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.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/calendar/todo-mode.el | 10 |
2 files changed, 17 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0741bfd41c9..5947c76ac17 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,12 @@ | |||
| 1 | 2014-11-26 Stephen Berman <stephen.berman@gmx.net> | 1 | 2014-11-26 Stephen Berman <stephen.berman@gmx.net> |
| 2 | 2 | ||
| 3 | * calendar/todo-mode.el: Handle calling revert-buffer (bug#19187). | ||
| 4 | (todo-revert-buffer): New function. | ||
| 5 | (todo-modes-set-1): Use it as the buffer-local value of | ||
| 6 | revert-buffer-function. | ||
| 7 | |||
| 8 | 2014-11-26 Stephen Berman <stephen.berman@gmx.net> | ||
| 9 | |||
| 3 | * calendar/todo-mode.el (todo-mode): If called interactively, just | 10 | * calendar/todo-mode.el (todo-mode): If called interactively, just |
| 4 | display a message saying to call todo-show to enter Todo mode | 11 | display a message saying to call todo-show to enter Todo mode |
| 5 | (Bug#19112). | 12 | (Bug#19112). |
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'." | |||
| 5194 | 5194 | ||
| 5195 | (add-function :override diary-goto-entry-function #'todo-diary-goto-entry) | 5195 | (add-function :override diary-goto-entry-function #'todo-diary-goto-entry) |
| 5196 | 5196 | ||
| 5197 | (defun todo-revert-buffer (&optional ignore-auto noconfirm) | ||
| 5198 | "Call `revert-buffer', preserving buffer's current modes. | ||
| 5199 | Also preserve category display, if applicable." | ||
| 5200 | (interactive (list (not current-prefix-arg))) | ||
| 5201 | (let ((revert-buffer-function nil)) | ||
| 5202 | (revert-buffer ignore-auto noconfirm 'preserve-modes) | ||
| 5203 | (when (memq major-mode '(todo-mode todo-archive-mode)) | ||
| 5204 | (todo-category-select)))) | ||
| 5205 | |||
| 5197 | (defun todo-desktop-save-buffer (_dir) | 5206 | (defun todo-desktop-save-buffer (_dir) |
| 5198 | `((catnum . ,(todo-category-number (todo-current-category))))) | 5207 | `((catnum . ,(todo-category-number (todo-current-category))))) |
| 5199 | 5208 | ||
| @@ -6540,6 +6549,7 @@ Added to `window-configuration-change-hook' in Todo mode." | |||
| 6540 | (defun todo-modes-set-1 () | 6549 | (defun todo-modes-set-1 () |
| 6541 | "Make some settings that apply to multiple Todo modes." | 6550 | "Make some settings that apply to multiple Todo modes." |
| 6542 | (setq-local font-lock-defaults '(todo-font-lock-keywords t)) | 6551 | (setq-local font-lock-defaults '(todo-font-lock-keywords t)) |
| 6552 | (setq-local revert-buffer-function 'todo-revert-buffer) | ||
| 6543 | (setq-local tab-width todo-indent-to-here) | 6553 | (setq-local tab-width todo-indent-to-here) |
| 6544 | (setq-local indent-line-function 'todo-indent) | 6554 | (setq-local indent-line-function 'todo-indent) |
| 6545 | (when todo-wrap-lines | 6555 | (when todo-wrap-lines |