summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKarl Heuer <kwzh@gnu.org>1994-04-07 07:09:16 +0000
committerKarl Heuer <kwzh@gnu.org>1994-04-07 07:09:16 +0000
commitaab46e8bc583f07d4f92e3ebb95751dbb78ecf06 (patch)
tree6e9af84b108ab82a7fd4b7953fe5fe8726e5f54a /lisp
parent719ca0956d82cded221045a5a1185aafa3a55729 (diff)
downloademacs-aab46e8bc583f07d4f92e3ebb95751dbb78ecf06.tar.gz
(rmail-summary-disable): New function.
(rmail-summary-enable): New function. (rmail-summary-mode): Call rmail-summary-enable.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/mail/rmailsum.el19
1 files changed, 16 insertions, 3 deletions
diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el
index a4079f2f527..a8428e065b5 100644
--- a/lisp/mail/rmailsum.el
+++ b/lisp/mail/rmailsum.el
@@ -515,7 +515,6 @@ Commands for sorting the summary:
(kill-all-local-variables)
(setq major-mode 'rmail-summary-mode)
(setq mode-name "RMAIL Summary")
- (use-local-map rmail-summary-mode-map)
(setq truncate-lines t)
(setq buffer-read-only t)
(set-syntax-table text-mode-syntax-table)
@@ -526,11 +525,25 @@ Commands for sorting the summary:
(make-local-variable 'rmail-summary-redo)
(setq rmail-summary-redo nil)
(make-local-variable 'revert-buffer-function)
- (setq revert-buffer-function 'rmail-update-summary)
(make-local-variable 'post-command-hook)
- (add-hook 'post-command-hook 'rmail-summary-rmail-update)
+ (rmail-summary-enable)
(run-hooks 'rmail-summary-mode-hook))
+;; Summary features need to be disabled during edit mode.
+(defun rmail-summary-disable ()
+ (save-excursion
+ (set-buffer rmail-summary-buffer)
+ (use-local-map text-mode-map)
+ (remove-hook 'post-command-hook 'rmail-summary-rmail-update)
+ (setq revert-buffer-function nil)))
+
+(defun rmail-summary-enable ()
+ (save-excursion
+ (set-buffer rmail-summary-buffer)
+ (use-local-map rmail-summary-mode-map)
+ (add-hook 'post-command-hook 'rmail-summary-rmail-update)
+ (setq revert-buffer-function 'rmail-update-summary)))
+
;; Show in Rmail the message described by the summary line that point is on,
;; but only if the Rmail buffer is already visible.
;; This is a post-command-hook in summary buffers.