[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-24 47f573a: todo-mode.el: Handle calling revert-buff
From: |
Stephen Berman |
Subject: |
[Emacs-diffs] emacs-24 47f573a: todo-mode.el: Handle calling revert-buffer. |
Date: |
Wed, 26 Nov 2014 22:19:12 +0000 |
branch: emacs-24
commit 47f573a4bf6b5126884286690ce1e8818ada74ee
Author: Stephen Berman <address@hidden>
Date: Wed Nov 26 23:17:41 2014 +0100
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.
---
lisp/ChangeLog | 7 +++++++
lisp/calendar/todo-mode.el | 10 ++++++++++
2 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 0741bfd..5947c76 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,12 @@
2014-11-26 Stephen Berman <address@hidden>
+ * calendar/todo-mode.el: Handle calling revert-buffer (bug#19187).
+ (todo-revert-buffer): New function.
+ (todo-modes-set-1): Use it as the buffer-local value of
+ revert-buffer-function.
+
+2014-11-26 Stephen Berman <address@hidden>
+
* calendar/todo-mode.el (todo-mode): If called interactively, just
display a message saying to call todo-show to enter Todo mode
(Bug#19112).
diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el
index ed7c607..3ba263f 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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs-24 47f573a: todo-mode.el: Handle calling revert-buffer.,
Stephen Berman <=