unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Davide Masserut via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 54727@debbugs.gnu.org
Subject: bug#54727: Recognize .bashrc as bash
Date: Tue, 05 Apr 2022 17:00:04 +0200	[thread overview]
Message-ID: <87bkxftw23.fsf@mssdvd.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1354 bytes --]

Tags: patch

I have just noticed that the .bashrc file is not recognized as a bash
file, so here is patch that should fix it.



In GNU Emacs 29.0.50 (build 45, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.17.6)
 of 2022-04-05 built on T480s
Repository revision: 7d504c9acc0c8d75d11c3a2b5e016f39e6156bf8
Repository branch: master
System Description: Arch Linux

Configured using:
 'configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
 --localstatedir=/var --mandir=/usr/share/man --with-gameuser=:games
 --with-sound=alsa --with-modules --without-libotf --without-m17n-flt
 --without-gconf --without-gsettings --with-native-compilation
 --with-xinput2 --with-pgtk --without-xaw3d --with-sound=no
 --without-gpm --without-compress-install
 '--program-transform-name=s/\([ec]tags\)/\1.emacs/'
 'CFLAGS=-march=native -O2 -pipe -fno-plt -fexceptions
 -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security
 -fstack-clash-protection -fcf-protection -g
 -ffile-prefix-map=/home/davide/src/emacs-git/src=/usr/src/debug'
 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now
 'CXXFLAGS=-march=native -O2 -pipe -fno-plt -fexceptions
 -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security
 -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -g
 -ffile-prefix-map=/home/davide/src/emacs-git/src=/usr/src/debug''


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-.bashrc-detection-to-sh-mode.patch --]
[-- Type: text/patch, Size: 1098 bytes --]

From 5c7da5307751e1d8c4eb6e715f5073fc3f179018 Mon Sep 17 00:00:00 2001
From: Davide Masserut <dm@mssdvd.com>
Date: Tue, 5 Apr 2022 16:42:37 +0200
Subject: [PATCH] Add .bashrc detection to sh-mode

* lisp/progmodes/sh-script.el (sh-mode): Add .bashrc string-match
---
 lisp/progmodes/sh-script.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index 8dc5562143..9151fd0a34 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -1549,7 +1549,7 @@ sh-mode
          ;; Checks that use `buffer-file-name' follow.
          ((string-match "\\.m?spec\\'" buffer-file-name) "rpm")
          ((string-match "[.]sh\\>"     buffer-file-name) "sh")
-         ((string-match "[.]bash\\>"   buffer-file-name) "bash")
+         ((string-match "[.]bash\\(rc\\)?\\>"   buffer-file-name) "bash")
          ((string-match "[.]ksh\\>"    buffer-file-name) "ksh")
          ((string-match "[.]mkshrc\\>" buffer-file-name) "mksh")
          ((string-match "[.]t?csh\\(rc\\)?\\>" buffer-file-name) "csh")
-- 
2.35.1


             reply	other threads:[~2022-04-05 15:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-05 15:00 Davide Masserut via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-04-06  9:37 ` bug#54727: Recognize .bashrc as bash Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bkxftw23.fsf@mssdvd.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=54727@debbugs.gnu.org \
    --cc=dm@mssdvd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).