# HG changeset patch # User Karl Heuer # Date 765702556 0 # Node ID 6728ad7f85e9831232f61fb2f2fa1bbeb3c9f525 # Parent 6ff74185a672b0a33a73a6a1171108d218717845 (rmail-summary-disable): New function. (rmail-summary-enable): New function. (rmail-summary-mode): Call rmail-summary-enable. diff -r 6ff74185a672 -r 6728ad7f85e9 lisp/mail/rmailsum.el --- a/lisp/mail/rmailsum.el Thu Apr 07 06:56:25 1994 +0000 +++ b/lisp/mail/rmailsum.el Thu Apr 07 07:09:16 1994 +0000 @@ -515,7 +515,6 @@ (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 @@ (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.