From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andrew Pennebaker Newsgroups: gmane.emacs.bugs Subject: bug#17991: shell-mode: fails to recognize .bashrc files as shell scripts Date: Fri, 11 Jul 2014 07:20:18 -0500 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=20cf301afbffeb1a9704fde9f68c X-Trace: ger.gmane.org 1405081284 30613 80.91.229.3 (11 Jul 2014 12:21:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 11 Jul 2014 12:21:24 +0000 (UTC) Cc: 17991@debbugs.gnu.org To: Kevin Rodgers Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 11 14:21:18 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1X5ZpF-0003Jt-9M for geb-bug-gnu-emacs@m.gmane.org; Fri, 11 Jul 2014 14:21:17 +0200 Original-Received: from localhost ([::1]:44516 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5ZpE-0001z8-PN for geb-bug-gnu-emacs@m.gmane.org; Fri, 11 Jul 2014 08:21:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50905) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5Zp5-0001py-Ii for bug-gnu-emacs@gnu.org; Fri, 11 Jul 2014 08:21:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X5Zp1-0007Cs-2R for bug-gnu-emacs@gnu.org; Fri, 11 Jul 2014 08:21:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:38283) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5Zp0-0007Cj-Vq for bug-gnu-emacs@gnu.org; Fri, 11 Jul 2014 08:21:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1X5Zp0-0005Y4-C4 for bug-gnu-emacs@gnu.org; Fri, 11 Jul 2014 08:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andrew Pennebaker Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 11 Jul 2014 12:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17991 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 17991-submit@debbugs.gnu.org id=B17991.140508123421271 (code B ref 17991); Fri, 11 Jul 2014 12:21:02 +0000 Original-Received: (at 17991) by debbugs.gnu.org; 11 Jul 2014 12:20:34 +0000 Original-Received: from localhost ([127.0.0.1]:53082 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X5ZoU-0005Wx-Ju for submit@debbugs.gnu.org; Fri, 11 Jul 2014 08:20:34 -0400 Original-Received: from mail-ie0-f176.google.com ([209.85.223.176]:41603) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X5ZoO-0005Wa-Fa for 17991@debbugs.gnu.org; Fri, 11 Jul 2014 08:20:28 -0400 Original-Received: by mail-ie0-f176.google.com with SMTP id tr6so813663ieb.35 for <17991@debbugs.gnu.org>; Fri, 11 Jul 2014 05:20:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=tV1ZlHL3n7hGx0i0wmW7s+531Jn2WUv4BfOsTN8kTOM=; b=IL3uRmBV3TR2M4SISAccZ1/o9C0MTpekLKuxRFnx5E5kADLBz5impRqzftdjhgFAFd wDPEps9SryupMxhf7kO4BblZEQAWLJGq5dYfHmv/gd5pLMZihv+gxT5bu6iYRydimiSV SrGQ9Vzjfx0eeRb1h29ecJuHgEI+RE2J7Q3yZksyLtfs7Vm6vop/eA+2ZL6jOwv3kyYp 0O3ymfezaYtES4fnmo3zt0/TrjCy92JH3J8rKKJfFkibCib0IaQ5y+y/jv/HEluxdmcV OZGCxvx56TgLo/3wIHRyydbeIJ3I0CClmiQrQuOWysCes2YlsjTtA296P5sEtgy1yPXv kIxg== X-Received: by 10.42.202.14 with SMTP id fc14mr4376348icb.8.1405081218650; Fri, 11 Jul 2014 05:20:18 -0700 (PDT) Original-Received: by 10.42.16.16 with HTTP; Fri, 11 Jul 2014 05:20:18 -0700 (PDT) Original-Received: by 10.42.16.16 with HTTP; Fri, 11 Jul 2014 05:20:18 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:91439 Archived-At: --20cf301afbffeb1a9704fde9f68c Content-Type: text/plain; charset=UTF-8 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" 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>> >> 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 >> > > > -- > Kevin Rodgers > Denver, Colorado, USA > > > > > --20cf301afbffeb1a9704fde9f68c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

That's not a bad idea.

Personally, I don't like inserting any editor-specific t= ext 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 con= figs, per machine, that matches the existing patterns? I guess I could use = ".bashrc.android.sh", ug= ly but functional.

On Jul 11, 2014 2:20 AM, "Kevin Rodgers&quo= t; <kevin.d.rodgers@gmail.c= om> 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 Wi= ndows, ".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:

=C2=A0 =C2=A0 Andrew Pennebaker wrote:

=C2=A0 =C2=A0 =C2=A0> Would be helpful if shell-mode understood that .ba= shrc*, .profile*, etc.
=C2=A0 =C2=A0 =C2=A0> are shell scripts. Right now, they are treated as = fundamental.

=C2=A0 =C2=A0 Works for me.

=C2=A0 =C2=A0 emacs-24.3 -Q .profile =C2=A0 =C2=A0-> shell-script
=C2=A0 =C2=A0 emacs-24.3 -Q .bashrc =C2=A0 =C2=A0 -> shell-script

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




--
Cheers,

Andrew Pennebaker
www.yellosoft.us = <http://www.yellos= oft.us>


--
Kevin Rodgers
Denver, Colorado, USA




--20cf301afbffeb1a9704fde9f68c--