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

Previous Next

Package: emacs;

Reported by: Andrew Pennebaker <andrew.pennebaker <at> gmail.com>

Date: Thu, 10 Jul 2014 18:15:02 UTC

Severity: wishlist

Tags: moreinfo, wontfix

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Andrew Pennebaker <andrew.pennebaker <at> gmail.com>
To: Kevin Rodgers <kevin.d.rodgers <at> gmail.com>
Cc: 17991 <at> debbugs.gnu.org
Subject: bug#17991: shell-mode: fails to recognize .bashrc files as shell scripts
Date: Fri, 11 Jul 2014 07:20:18 -0500
[Message part 1 (text/plain, inline)]
That's not a bad idea.

Personally, I don't like inserting any editor-specific text in my code (I
woundn't use the equivalent Vim cookie either).

My current workaround is to manually add (.\bashrc|\.profile).* to
auto-mode-alist. I just wish this were the default pattern.

... is there another convention for naming multiple bash configs, per
machine, that matches the existing patterns? I guess I could use ".
bashrc.android.sh", ugly but functional.
On Jul 11, 2014 2:20 AM, "Kevin Rodgers" <kevin.d.rodgers <at> gmail.com> wrote:

> 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 <at> gnu.org <mailto:
>> rgm <at> 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
>
>
>
>
>
[Message part 2 (text/html, inline)]

This bug report was last modified 9 years and 206 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.