From 39cdf4726c1a73ef6474404e84fc065b0933ee23 Mon Sep 17 00:00:00 2001 From: shynur Date: Sat, 7 Mar 2026 13:50:16 +0800 Subject: [PATCH] * lisp/files.el (auto-mode-alist): Recognize /etc/profile as sh. --- lisp/files.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lisp/files.el b/lisp/files.el index d42154cf8a2..edbeb43e9b9 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -3114,6 +3114,8 @@ since only a single case-insensitive search through the alist is made." ;; Bash builtin 'fc' creates a temp file named "bash-fc.XXXXXX" ;; to edit shell commands from its history list. ("/bash-fc\\.[0-9A-Za-z]\\{6\\}\\'" . sh-mode) + ;; A login sh first attempts to read /etc/profile. + ("\\`/etc/profile\\'" . sh-mode) ("/PKGBUILD\\'" . sh-mode) ("\\(/\\|\\`\\)\\.\\(bash_\\(profile\\|history\\|log\\(in\\|out\\)\\)\\|z?log\\(in\\|out\\)\\)\\'" . sh-mode) ("\\(/\\|\\`\\)\\.\\(shrc\\|zshrc\\|m?kshrc\\|bashrc\\|t?cshrc\\|esrc\\)\\'" . sh-mode)