]> git.eshelyaron.com Git - emacs.git/commitdiff
Enable 'sh-mode' for files created by Bash 'fc' command
authorshynur <one.last.kiss@outlook.com>
Fri, 20 Sep 2024 12:15:06 +0000 (12:15 +0000)
committerEshel Yaron <me@eshelyaron.com>
Sat, 28 Sep 2024 10:44:59 +0000 (12:44 +0200)
* lisp/files.el (auto-mode-alist): Recognize bash-fc.XXXX files.
(Bug#73380)

(cherry picked from commit c12cb25199ebbb665548a1c3f7ec57a4536b76ad)

lisp/files.el

index 5f5b59ed04a74000b2652b5a982ac29d4af7fdf8..be4e637df22e032e304a8181fc31550fa897d80b 100644 (file)
@@ -3021,6 +3021,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)