* bug#17991: shell-mode: fails to recognize .bashrc files as shell scripts @ 2014-07-10 18:13 Andrew Pennebaker 2014-07-10 18:23 ` Glenn Morris 0 siblings, 1 reply; 6+ messages in thread From: Andrew Pennebaker @ 2014-07-10 18:13 UTC (permalink / raw) To: 17991 [-- Attachment #1: Type: text/plain, Size: 185 bytes --] Would be helpful if shell-mode understood that .bashrc*, .profile*, etc. are shell scripts. Right now, they are treated as fundamental. -- Cheers, Andrew Pennebaker www.yellosoft.us [-- Attachment #2: Type: text/html, Size: 339 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#17991: shell-mode: fails to recognize .bashrc files as shell scripts 2014-07-10 18:13 bug#17991: shell-mode: fails to recognize .bashrc files as shell scripts Andrew Pennebaker @ 2014-07-10 18:23 ` Glenn Morris 2014-07-10 19:17 ` Andrew Pennebaker 0 siblings, 1 reply; 6+ messages in thread From: Glenn Morris @ 2014-07-10 18:23 UTC (permalink / raw) To: Andrew Pennebaker; +Cc: 17991 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) ^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#17991: shell-mode: fails to recognize .bashrc files as shell scripts 2014-07-10 18:23 ` Glenn Morris @ 2014-07-10 19:17 ` Andrew Pennebaker 2014-07-11 7:19 ` Kevin Rodgers 0 siblings, 1 reply; 6+ messages in thread From: Andrew Pennebaker @ 2014-07-10 19:17 UTC (permalink / raw) To: Glenn Morris; +Cc: 17991 [-- Attachment #1: Type: text/plain, Size: 991 bytes --] 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? On Thu, Jul 10, 2014 at 1:23 PM, Glenn Morris <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 [-- Attachment #2: Type: text/html, Size: 1614 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#17991: shell-mode: fails to recognize .bashrc files as shell scripts 2014-07-10 19:17 ` Andrew Pennebaker @ 2014-07-11 7:19 ` Kevin Rodgers 2014-07-11 12:20 ` Andrew Pennebaker 0 siblings, 1 reply; 6+ messages in thread From: Kevin Rodgers @ 2014-07-11 7:19 UTC (permalink / raw) To: 17991 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 ^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#17991: shell-mode: fails to recognize .bashrc files as shell scripts 2014-07-11 7:19 ` Kevin Rodgers @ 2014-07-11 12:20 ` Andrew Pennebaker 2014-07-11 12:52 ` Andreas Schwab 0 siblings, 1 reply; 6+ messages in thread From: Andrew Pennebaker @ 2014-07-11 12:20 UTC (permalink / raw) To: Kevin Rodgers; +Cc: 17991 [-- Attachment #1: Type: text/plain, Size: 1947 bytes --] 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@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@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 > > > > > [-- Attachment #2: Type: text/html, Size: 3061 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#17991: shell-mode: fails to recognize .bashrc files as shell scripts 2014-07-11 12:20 ` Andrew Pennebaker @ 2014-07-11 12:52 ` Andreas Schwab 0 siblings, 0 replies; 6+ messages in thread From: Andreas Schwab @ 2014-07-11 12:52 UTC (permalink / raw) To: Andrew Pennebaker; +Cc: Kevin Rodgers, 17991 Andrew Pennebaker <andrew.pennebaker@gmail.com> writes: > My current workaround is to manually add (.\bashrc|\.profile).* to > auto-mode-alist. I just wish this were the default pattern. I don't consider this a workaround, but rather the correct way to handle such personal preferences. > ... 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. Since the shell is a full programming language, there are no limits in what people will do with the startup scripts. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-07-11 12:52 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-07-10 18:13 bug#17991: shell-mode: fails to recognize .bashrc files as shell scripts Andrew Pennebaker 2014-07-10 18:23 ` Glenn Morris 2014-07-10 19:17 ` Andrew Pennebaker 2014-07-11 7:19 ` Kevin Rodgers 2014-07-11 12:20 ` Andrew Pennebaker 2014-07-11 12:52 ` Andreas Schwab
Code repositories for project(s) associated with this external index https://git.savannah.gnu.org/cgit/emacs.git https://git.savannah.gnu.org/cgit/emacs/org-mode.git This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.