master 29c91f781c8 1/2: Disable 'auto-mode-alist' during M-x rmail

Eli Zaretskii <[email protected]> Wed, 8 Jul 2026 09:21:58 -0400 (EDT)
Newsgroups gmane.emacs.diffs
Message-ID <[email protected]>
branch: master
commit 29c91f781c8ef00f12e7d591272561ade281bed7
Author: Paul Nelson <[email protected]>
Commit: Eli Zaretskii <[email protected]>

    Disable 'auto-mode-alist' during M-x rmail
    
    * lisp/mail/rmail.el (rmail): Bind 'auto-mode-alist' to nil
    while visiting the Rmail file, so that filename-based major mode
    selection does not invoke 'rmail' recursively.  (Bug#81368)
---
 lisp/mail/rmail.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 9f495ddf0f8..123c16d0e04 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -903,6 +903,7 @@ If `rmail-display-summary' is non-nil, make a summary for this RMAIL file."
       ;; The mail file is either unchanged or not visited.  Visit it.
       (switch-to-buffer
        (let ((enable-local-variables nil)
+	     (auto-mode-alist nil)
 	     ;; Force no-conversion by default, since that's what
 	     ;; pre-mbox Rmail did with BABYL files (via
 	     ;; auto-coding-regexp-alist).