diff options
| author | Richard M. Stallman <rms@gnu.org> | 1998-06-06 22:10:19 +0000 |
|---|---|---|
| committer | Richard M. Stallman <rms@gnu.org> | 1998-06-06 22:10:19 +0000 |
| commit | b5e00b02008b667ed32e6fd47fd90e64a6ab95b6 (patch) | |
| tree | fbca4f05add4bca9a2d233134cbe2fa47882590c /lisp | |
| parent | 9cc4fad570353aafafdcaffe457b51d2a04f709f (diff) | |
| download | emacs-b5e00b02008b667ed32e6fd47fd90e64a6ab95b6.tar.gz | |
(rmail): Prevent find-file from calling
rmail-mode for a new buffer. Do it later, instead.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/mail/rmail.el | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 0f3063769a8..5d6889a1b5a 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -511,7 +511,8 @@ If `rmail-display-summary' is non-nil, make a summary for this RMAIL file." (eq major-mode 'rmail-mode)) (progn (rmail-forget-messages) (rmail-set-message-counters)))) - (find-file file-name)) + (let ((enable-local-variables nil)) + (find-file file-name))) (if (eq major-mode 'rmail-edit-mode) (error "Exit Rmail Edit mode before getting new mail")) (if (and existed (> (buffer-size) 0)) @@ -528,16 +529,14 @@ If `rmail-display-summary' is non-nil, make a summary for this RMAIL file." (if (and rmail-enable-multibyte (not enable-multibyte-characters)) (set-buffer-multibyte t)) - (goto-char (point-max)) - (if (null rmail-inbox-list) - (progn - (rmail-set-message-counters) - (rmail-show-message) - (setq msg-shown t)))) + (goto-char (point-max))) + ;; Unconditionally rescan to find all the messages. + ;; It is useful to have M-x rmail as a way to do that. + (rmail-set-message-counters) (unwind-protect - (or (and (null file-name-arg) - (rmail-get-new-mail)) - (or msg-shown (rmail-show-message (rmail-first-unseen-message)))) + (unless (and (not file-name-arg) + (rmail-get-new-mail)) + (rmail-show-message (rmail-first-unseen-message))) (progn (if rmail-display-summary (rmail-summary)) (rmail-construct-io-menu) |
