bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#17991: shell-mode: fails to recognize .bashrc files as shell scripts


From: Kevin Rodgers
Subject: bug#17991: shell-mode: fails to recognize .bashrc files as shell scripts
Date: Fri, 11 Jul 2014 01:19:40 -0600
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.2.28) Gecko/20120306 Thunderbird/3.1.20

On 7/10/14 1:17 PM, Andrew Pennebaker wrote:
Yes, same on my machine.

I think this problem is specific to alternative config files (I've got a
".bashrc" for primary computer, ".bashrc-cygwin" for Windows, ".bashrc-android"
for Android, and so on.

Could the default auto-mode-alist entry be tweaked to include any file with
".bashrc" as a prefix?

Why not just add a major mode cookie (comment) at the top of your
non-standardly-named files?

# -*- mode: sh; -*-

On Thu, Jul 10, 2014 at 1:23 PM, Glenn Morris <rgm@gnu.org <mailto:rgm@gnu.org>>
wrote:

    Andrew Pennebaker wrote:

     > Would be helpful if shell-mode understood that .bashrc*, .profile*, etc.
     > are shell scripts. Right now, they are treated as fundamental.

    Works for me.

    emacs-24.3 -Q .profile    -> shell-script
    emacs-24.3 -Q .bashrc     -> shell-script

    C-h v auto-mode-alist
      ("\\.[ck]?sh\\'\\|\\.shar\\'\\|/\\.z?profile\\'" . sh-mode)
      ("\\(/\\|\\`\\)\\.\\(bash_profile\\|z?login\\|bash_login\\|z?logout\\)\\'"
      . sh-mode)
      
("\\(/\\|\\`\\)\\.\\(bash_logout\\|shrc\\|[kz]shrc\\|bashrc\\|t?cshrc\\|esrc\\)\\'"
      . sh-mode)




--
Cheers,

Andrew Pennebaker
www.yellosoft.us <http://www.yellosoft.us>


--
Kevin Rodgers
Denver, Colorado, USA






reply via email to

[Prev in Thread] Current Thread [Next in Thread]