# HG changeset patch # User Richard M. Stallman # Date 897171019 0 # Node ID aaa851980d1e8863209756f6f82fe619fdca2041 # Parent cb8484085daf6fb6420df47033c56898e7a315ec (rmail): Prevent find-file from calling rmail-mode for a new buffer. Do it later, instead. diff -r cb8484085daf -r aaa851980d1e lisp/mail/rmail.el --- a/lisp/mail/rmail.el Sat Jun 06 22:04:07 1998 +0000 +++ b/lisp/mail/rmail.el Sat Jun 06 22:10:19 1998 +0000 @@ -511,7 +511,8 @@ (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 (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)