summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshynur <one.last.kiss@outlook.com>2024-09-20 12:15:06 +0000
committerEli Zaretskii <eliz@gnu.org>2024-09-28 12:30:12 +0300
commitc12cb25199ebbb665548a1c3f7ec57a4536b76ad (patch)
tree7ea79896c155ad64854b89adcd70ff7f60109d02
parent9c994537cfabd327ada70a3aa4204bc5aae6a9a2 (diff)
Enable 'sh-mode' for files created by Bash 'fc' command
* lisp/files.el (auto-mode-alist): Recognize bash-fc.XXXX files. (Bug#73380)
-rw-r--r--lisp/files.el3
1 files changed, 3 insertions, 0 deletions
diff --git a/lisp/files.el b/lisp/files.el
index a81f742bbb4..58b5a26a492 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -2998,6 +2998,9 @@ since only a single case-insensitive search through the alist is made."
("\\.scm\\.[0-9]*\\'" . scheme-mode)
("\\.[ckz]?sh\\'\\|\\.shar\\'\\|/\\.z?profile\\'" . sh-mode)
("\\.bash\\'" . sh-mode)
+ ;; 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)
("/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)