1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-03 08:30:09 +00:00

* lisp/calendar/calendar.el (calendar-in-read-only-buffer):

Call `special-mode' to enable the standard read-only keybindings.
This commit is contained in:
Sam Steingold 2012-06-06 11:19:39 -04:00
parent 21ffb35a97
commit 628299e039
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2012-06-06 Sam Steingold <sds@gnu.org>
* calendar/calendar.el (calendar-in-read-only-buffer):
Call `special-mode' to enable the standard read-only keybindings.
2012-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/macroexp.el (macroexpand-all-1): Don't spam the output

View File

@ -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