From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Davide Masserut via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#64251: [PATCH] Recognize PKGBUILD as bash style Date: Fri, 23 Jun 2023 15:46:03 +0200 Message-ID: <87mt0qtgqt.fsf@mssdvd.com> Reply-To: Davide Masserut Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14511"; mail-complaints-to="usenet@ciao.gmane.io" To: 64251@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 23 16:08:25 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qChSa-0003Xp-7S for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 23 Jun 2023 16:08:24 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qChSJ-0002tW-Fw; Fri, 23 Jun 2023 10:08:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qChSE-0002tI-UZ for bug-gnu-emacs@gnu.org; Fri, 23 Jun 2023 10:08:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qChSE-0001UH-Lg for bug-gnu-emacs@gnu.org; Fri, 23 Jun 2023 10:08:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qChSE-00084M-GY for bug-gnu-emacs@gnu.org; Fri, 23 Jun 2023 10:08:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Davide Masserut Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 23 Jun 2023 14:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 64251 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.168752922930950 (code B ref -1); Fri, 23 Jun 2023 14:08:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 23 Jun 2023 14:07:09 +0000 Original-Received: from localhost ([127.0.0.1]:39282 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qChRM-000838-NA for submit@debbugs.gnu.org; Fri, 23 Jun 2023 10:07:09 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:51464) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qChRH-00082w-TG for submit@debbugs.gnu.org; Fri, 23 Jun 2023 10:07:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qChRH-0002oD-DP for bug-gnu-emacs@gnu.org; Fri, 23 Jun 2023 10:07:03 -0400 Original-Received: from out-7.mta0.migadu.com ([91.218.175.7]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qChRE-00085M-Cy for bug-gnu-emacs@gnu.org; Fri, 23 Jun 2023 10:07:03 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mssdvd.com; s=key1; t=1687529215; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=/g8FnYtVYP+rfAPFk1925TrmaXcaZcbRO/lQzpJRlHQ=; b=Lq5yoKdndjRuohKJ4Xo44TUBaEOSSzTtkqPjGgTBvyNPxBzOs0iN6ecay4lCYGiEJYMWIV FGAeXnvzeE3t9SRr+pCV8mK4BKjon5hwW5/vaJhn6C6ogZPgV/0W1wOAz7L1wKyps6QvPH Oc9XmX/Yhn9jTd9aK1ZPUL3ByeQPkNs7PpAEgKpc1VgAAfSsJmLJlrNWM6VFUufIEt368+ HE4NaMYnOyUDaaRDDH95Us8BYocXxjfNcs4G2uIFq9nfobN8coecNSjBKoaOeaHtjUK240 GDn/laUidttAWNwiwQ3tXegdXBxmu7GGYWpxqKG7z49rhfrByxHcNBYqFBHFUg== X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=91.218.175.7; envelope-from=dm@mssdvd.com; helo=out-7.mta0.migadu.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:263957 Archived-At: --=-=-= Content-Type: text/plain; format=flowed Tags: patch Arch Linux PKGBUILDs are Bash files [1], this patch adds detection to sh-mode. [1]: https://wiki.archlinux.org/title/Creating_packages#Creating_a_PKGBUILD In GNU Emacs 30.0.50 (build 9, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.17.8) of 2023-06-21 built on T480s Repository revision: 17e16f78596d895d6aca52d96b1caf9e82f7598b Repository branch: master System Description: Arch Linux Configured using: 'configure --sysconfdir=/etc --prefix=/usr --libexecdir=/usr/lib --localstatedir=/var --with-pgtk --with-native-compilation '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-mssdvd-git/src=/usr/src/debug/emacs-mssdvd-git' LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Recognize-PKGBUILD-as-bash-style.patch >From ca838aaabbfefb042e0d7a324708b546022e3ccf Mon Sep 17 00:00:00 2001 From: Davide Masserut Date: Tue, 20 Jun 2023 15:55:11 +0200 Subject: [PATCH] Recognize PKGBUILD as bash style * lisp/progmodes/sh-script.el (sh--guess-shell): Handle PKGBUILD. --- lisp/progmodes/sh-script.el | 1 + 1 file changed, 1 insertion(+) diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 6beff9f41e9..a305c35c5f8 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -1489,6 +1489,7 @@ sh--guess-shell ((string-match "[.]t?csh\\(rc\\)?\\>" buffer-file-name) "csh") ((string-match "[.]zsh\\(rc\\|env\\)?\\>" buffer-file-name) "zsh") ((equal (file-name-nondirectory buffer-file-name) ".profile") "sh") + ((equal (file-name-nondirectory buffer-file-name) "PKGBUILD") "bash") (t sh-shell-file))) ;;;###autoload -- 2.41.0 --=-=-=--