aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Steingold2012-06-06 11:19:39 -0400
committerSam Steingold2012-06-06 11:19:39 -0400
commit628299e039e9b16f7daec2c7afe44e1b43c5753d (patch)
tree8ac039dc31433784649b4469e7031ce007818d5a
parent21ffb35a9782dcdb2032ad69f2cf515d9cc51862 (diff)
downloademacs-628299e039e9b16f7daec2c7afe44e1b43c5753d.tar.gz
emacs-628299e039e9b16f7daec2c7afe44e1b43c5753d.zip
* lisp/calendar/calendar.el (calendar-in-read-only-buffer):
Call `special-mode' to enable the standard read-only keybindings.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/calendar/calendar.el4
2 files changed, 7 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 0911da1a03b..fff6a2295f5 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12012-06-06 Sam Steingold <sds@gnu.org>
2
3 * calendar/calendar.el (calendar-in-read-only-buffer):
4 Call `special-mode' to enable the standard read-only keybindings.
5
12012-06-06 Stefan Monnier <monnier@iro.umontreal.ca> 62012-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
2 7
3 * emacs-lisp/macroexp.el (macroexpand-all-1): Don't spam the output 8 * emacs-lisp/macroexp.el (macroexpand-all-1): Don't spam the output
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."
1105 ,index (1+ ,index))) 1105 ,index (1+ ,index)))
1106 sum)) 1106 sum))
1107 1107
1108;; FIXME bind q to bury-buffer?
1109(defmacro calendar-in-read-only-buffer (buffer &rest body) 1108(defmacro calendar-in-read-only-buffer (buffer &rest body)
1110 "Switch to BUFFER and executes the forms in BODY. 1109 "Switch to BUFFER and execute the forms in BODY.
1111First creates or erases BUFFER as needed. Leaves BUFFER read-only, 1110First creates or erases BUFFER as needed. Leaves BUFFER read-only,
1112with disabled undo. Leaves point at point-min, displays BUFFER." 1111with disabled undo. Leaves point at point-min, displays BUFFER."
1113 (declare (indent 1) (debug t)) 1112 (declare (indent 1) (debug t))
@@ -1120,6 +1119,7 @@ with disabled undo. Leaves point at point-min, displays BUFFER."
1120 (goto-char (point-min)) 1119 (goto-char (point-min))
1121 (set-buffer-modified-p nil) 1120 (set-buffer-modified-p nil)
1122 (setq buffer-read-only t) 1121 (setq buffer-read-only t)
1122 (special-mode)
1123 (display-buffer ,buffer))) 1123 (display-buffer ,buffer)))
1124 1124
1125;; The following are in-line for speed; they can be called thousands of times 1125;; The following are in-line for speed; they can be called thousands of times