diff options
author | Sam Steingold <sds@gnu.org> | 2012-06-06 11:19:39 -0400 |
---|---|---|
committer | Sam Steingold <sds@gnu.org> | 2012-06-06 11:19:39 -0400 |
commit | 628299e039e9b16f7daec2c7afe44e1b43c5753d (patch) | |
tree | 8ac039dc31433784649b4469e7031ce007818d5a /lisp/calendar/calendar.el | |
parent | 21ffb35a9782dcdb2032ad69f2cf515d9cc51862 (diff) | |
download | emacs-628299e039e9b16f7daec2c7afe44e1b43c5753d.tar.gz |
* lisp/calendar/calendar.el (calendar-in-read-only-buffer):
Call `special-mode' to enable the standard read-only keybindings.
Diffstat (limited to 'lisp/calendar/calendar.el')
-rw-r--r-- | lisp/calendar/calendar.el | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index 62d09c6b62c..33cb57b352d 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el @@ -1105,9 +1105,8 @@ inclusive. The standard macro `dotimes' is preferable in most cases." ,index (1+ ,index))) sum)) -;; FIXME bind q to bury-buffer? (defmacro calendar-in-read-only-buffer (buffer &rest body) - "Switch to BUFFER and executes the forms in BODY. + "Switch to BUFFER and execute the forms in BODY. First creates or erases BUFFER as needed. Leaves BUFFER read-only, with disabled undo. Leaves point at point-min, displays BUFFER." (declare (indent 1) (debug t)) @@ -1120,6 +1119,7 @@ with disabled undo. Leaves point at point-min, displays BUFFER." (goto-char (point-min)) (set-buffer-modified-p nil) (setq buffer-read-only t) + (special-mode) (display-buffer ,buffer))) ;; The following are in-line for speed; they can be called thousands of times |