From unknown Sun Jun 22 22:43:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13815: Wrong mode for files with awkward shebang lines Resent-From: Andrew Pennebaker Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 26 Feb 2013 01:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 13815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 13815@debbugs.gnu.org X-Debbugs-Original-To: Emacs Bugs Received: via spool by submit@debbugs.gnu.org id=B.13618419354654 (code B ref -1); Tue, 26 Feb 2013 01:26:01 +0000 Received: (at submit) by debbugs.gnu.org; 26 Feb 2013 01:25:35 +0000 Received: from localhost ([127.0.0.1]:50217 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UA9IV-0001D1-DF for submit@debbugs.gnu.org; Mon, 25 Feb 2013 20:25:35 -0500 Received: from eggs.gnu.org ([208.118.235.92]:35124) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UA9IT-0001Cu-9k for submit@debbugs.gnu.org; Mon, 25 Feb 2013 20:25:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UA9Gn-0000U6-Kz for submit@debbugs.gnu.org; Mon, 25 Feb 2013 20:23:51 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-101.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE,T_DKIM_INVALID,USER_IN_WHITELIST autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:55349) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UA9Gn-0000U2-HM for submit@debbugs.gnu.org; Mon, 25 Feb 2013 20:23:49 -0500 Received: from eggs.gnu.org ([208.118.235.92]:46473) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UA9Gm-0007AR-HQ for bug-gnu-emacs@gnu.org; Mon, 25 Feb 2013 20:23:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UA9Gl-0000TM-06 for bug-gnu-emacs@gnu.org; Mon, 25 Feb 2013 20:23:48 -0500 Received: from mail-ia0-x233.google.com ([2607:f8b0:4001:c02::233]:36929) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UA61l-0001Eq-9l for bug-gnu-emacs@gnu.org; Mon, 25 Feb 2013 16:56:05 -0500 Received: by mail-ia0-f179.google.com with SMTP id x24so2874737iak.24 for ; Mon, 25 Feb 2013 13:56:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type; bh=3c2VDzhHmt0LNb56+Br6hDHMQ9mNLg1Im4fjRjsFoMw=; b=R0C5pNvIr3cHIInpTq7gyChDpNnhtJl2GPq1TDuX2LZe+TfSg1LlvuzploMc/2HUC+ NPzlRBTdKEw5w8ubPUr82bU5VCO4ggaT8lSSLQsmrD8o44/4/nrgNqZ9pZaFn2vODMJ5 WjwdfIBu29SP3/JqWQeDEh3nPxK/mR1cHl4RA0F0jDD1Mu9HD3+schAWSQ0GBSID2gMj BsYMak30zSQ++0GfqccJ9CxB3jwdfV2t6rMH9p7oZvkI/Q1FoghhW/I2+qWvK6Dsqc6W Ia0HnwUeYtAyGduPeFQojzHdoP6wqCtx1GNLNZWW7FXXXEffptukJ0Hio9sAsHA31Vse ET0Q== MIME-Version: 1.0 X-Received: by 10.50.5.244 with SMTP id v20mr4048398igv.86.1361829363849; Mon, 25 Feb 2013 13:56:03 -0800 (PST) Received: by 10.43.71.196 with HTTP; Mon, 25 Feb 2013 13:56:03 -0800 (PST) Date: Mon, 25 Feb 2013 16:56:03 -0500 Message-ID: From: Andrew Pennebaker Content-Type: multipart/alternative; boundary=e89a8f502d527a21fb04d6939b2b X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -3.4 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.7 (----) --e89a8f502d527a21fb04d6939b2b Content-Type: text/plain; charset=ISO-8859-1 Some of my Scala code opens as Shell script major mode in Emacs, a problem caused by several factors: In order to enable dot-slashing for Scala scripts, programmers sometimes start their code as follows: #!/bin/sh exec scala "$0" "$@" !# object Hello { def main(args: Array[String]) { println("Hello World!") } } This is an awkward shebang line; due to the nature of shebangs, it must be split across three lines of code, starting with #!/bin/sh. This creates problems for Emacs, as Emacs uses `file` to detect which major mode should be used, and `file` returns 'text/x-shellscript' when a file begins #!/bin/sh, regardless of the file extension or programming language content the file actually contains. This could be solved a variety of ways, but I think the simplest is to prioritize file extension over mimetype when a file extension is available. We can't trust mimetypes for code that contains these awkward shebangs. -- Cheers, Andrew Pennebaker www.yellosoft.us --e89a8f502d527a21fb04d6939b2b Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Some of my Scala code opens as Shell script maj= or mode in Emacs, a problem caused by several factors:

= In order to enable dot-slashing for Scala scripts, programmers sometimes st= art their code as follows:

#!/bin/sh
exec scala "$0" "= ;$@"
!#

object Hello {
def main(args: Array[Strin= g]) {
println("Hell= o World!")
}
}

This is an awkward shebang l= ine; due to the nature of shebangs, it must be split across three lines of = code, starting with #!/bin/sh.

This creates problems for Emacs, as Emacs u= ses `file` to detect which major mode should be used, and `file` returns &#= 39;text/x-shellscript' when a file begins #!/bin/sh, regardless of the = file extension or programming language content the file actually contains.<= /div>

This could be solved a variety of ways, but= I think the simplest is to prioritize file extension over mimetype when a = file extension is available. We can't trust mimetypes for code that con= tains these awkward shebangs.

--
Cheers,

Andrew Pennebak= er
--e89a8f502d527a21fb04d6939b2b-- From unknown Sun Jun 22 22:43:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13815: Wrong mode for files with awkward shebang lines Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 26 Feb 2013 03:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Andrew Pennebaker Cc: 13815@debbugs.gnu.org Received: via spool by 13815-submit@debbugs.gnu.org id=B13815.136184767716873 (code B ref 13815); Tue, 26 Feb 2013 03:02:01 +0000 Received: (at 13815) by debbugs.gnu.org; 26 Feb 2013 03:01:17 +0000 Received: from localhost ([127.0.0.1]:50248 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UAAn6-0004O5-QD for submit@debbugs.gnu.org; Mon, 25 Feb 2013 22:01:17 -0500 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:59793) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UAAn4-0004Ny-Ms for 13815@debbugs.gnu.org; Mon, 25 Feb 2013 22:01:15 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFHO+KLv/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA0kiB4GwS2RCgOIYZwZgV6DFQ X-IPAS-Result: Av4EABK/CFHO+KLv/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA0kiB4GwS2RCgOIYZwZgV6DFQ X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="2460740" Received: from 206-248-162-239.dsl.teksavvy.com (HELO pastel.home) ([206.248.162.239]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 25 Feb 2013 21:59:30 -0500 Received: by pastel.home (Postfix, from userid 20848) id 0D9056C0A9; Mon, 25 Feb 2013 21:59:30 -0500 (EST) From: Stefan Monnier Message-ID: References: Date: Mon, 25 Feb 2013 21:59:30 -0500 In-Reply-To: (Andrew Pennebaker's message of "Mon, 25 Feb 2013 16:56:03 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.8 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.8 (/) > This could be solved a variety of ways, but I think the simplest is to > prioritize file extension over mimetype when a file extension is available. IIRC no strict priority will do, because for some files, the content is more important than the filename. > We can't trust mimetypes for code that contains these awkward shebangs. [ FWIW Emacs doesn't actually use "mimtypes" but its own set of file-contents-based rules. Not that it matters to this discussion, really. ] I think the right way is to check both file content and file name and if the type they specify do not agree, fall back on a disambiguation function, which should include various ad-hoc rules, and may ultimately prompt the user if none of the ad-hoc rules resolved the ambiguity. But in your specific case, you might get away with tweaking inhibit-local-variables-regexps. Stefan From unknown Sun Jun 22 22:43:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13815: Wrong mode for files with awkward shebang lines In-Reply-To: Resent-From: Glenn Morris Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 26 Feb 2013 03:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Andrew Pennebaker Cc: 13815@debbugs.gnu.org Received: via spool by 13815-submit@debbugs.gnu.org id=B13815.136184785117135 (code B ref 13815); Tue, 26 Feb 2013 03:05:01 +0000 Received: (at 13815) by debbugs.gnu.org; 26 Feb 2013 03:04:11 +0000 Received: from localhost ([127.0.0.1]:50256 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UAApt-0004SI-EB for submit@debbugs.gnu.org; Mon, 25 Feb 2013 22:04:11 -0500 Received: from fencepost.gnu.org ([208.118.235.10]:51032) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UAApq-0004S9-7r for 13815@debbugs.gnu.org; Mon, 25 Feb 2013 22:04:07 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1UAAoB-0006UH-0Z; Mon, 25 Feb 2013 22:02:23 -0500 From: Glenn Morris References: X-Spook: fissionable UMTS Fortezza cryptographic Abbas ASLET X-Ran: Xgt}`U%UDS| User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -3.7 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.5 (----) Andrew Pennebaker wrote: > #!/bin/sh > exec scala "$0" "$@" [...] > This creates problems for Emacs, as Emacs uses `file` to detect which major > mode should be used, Emacs does not use `file', it uses interpreter-mode-alist (amongst other things). > This could be solved a variety of ways, but I think the simplest is to > prioritize file extension over mimetype when a file extension is available. It used to work that way prior to Emacs 22.1. Then it was changed for reasons that were never properly explained IMO. http://debbugs.gnu.org/3354 All you can do is add a mode: cookie. Or use /usr/bin/env, IIUC https://github.com/scala/scala/pull/9 From unknown Sun Jun 22 22:43:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13815: Wrong mode for files with awkward shebang lines Resent-From: Glenn Morris Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 26 Feb 2013 08:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: 13815@debbugs.gnu.org Received: via spool by 13815-submit@debbugs.gnu.org id=B13815.136186645412271 (code B ref 13815); Tue, 26 Feb 2013 08:15:02 +0000 Received: (at 13815) by debbugs.gnu.org; 26 Feb 2013 08:14:14 +0000 Received: from localhost ([127.0.0.1]:50524 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UAFfx-0003Bs-Mm for submit@debbugs.gnu.org; Tue, 26 Feb 2013 03:14:13 -0500 Received: from fencepost.gnu.org ([208.118.235.10]:58845) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UAFfv-0003Bl-05 for 13815@debbugs.gnu.org; Tue, 26 Feb 2013 03:14:12 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1UAFeD-0001mF-FN; Tue, 26 Feb 2013 03:12:25 -0500 From: Glenn Morris References: X-Spook: red noise CNCIS Arnett sweep CISU terrorism Taiwan hackers X-Ran: Q*(g)uf3n' (Stefan Monnier's message of "Mon, 25 Feb 2013 21:59:30 -0500") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -4.9 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -7.6 (-------) Stefan Monnier wrote: > IIRC no strict priority will do, because for some files, the content is > more important than the filename. I've never seen a real-world example where the #! line says one thing, the filename extension says another, and the #! line is correct. Does anyone have such an example? (Going back to #3354, I now have 414 *.conf files in /etc, and not one has a #! line.) From unknown Sun Jun 22 22:43:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13815: Wrong mode for files with awkward shebang lines Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 23 Aug 2021 01:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Glenn Morris Cc: 13815@debbugs.gnu.org, Andrew Pennebaker Received: via spool by 13815-submit@debbugs.gnu.org id=B13815.162968124916076 (code B ref 13815); Mon, 23 Aug 2021 01:15:02 +0000 Received: (at 13815) by debbugs.gnu.org; 23 Aug 2021 01:14:09 +0000 Received: from localhost ([127.0.0.1]:40067 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mHyXR-0004BE-Gk for submit@debbugs.gnu.org; Sun, 22 Aug 2021 21:14:09 -0400 Received: from quimby.gnus.org ([95.216.78.240]:38830) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mHyXP-0004Am-DE for 13815@debbugs.gnu.org; Sun, 22 Aug 2021 21:14:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=yWzG/86cW13RwFm/x7OnGtEqI8MleqGlUgf++AFwzxY=; b=SqN9FagyHjxpxiF3/SMoY7D2qx YBpMlAcUPeMpLeILtLVTy8IX+NGg0hkMEQHWpijqswsGL6jatlLrYeBC9Q/FCRfrNvBx/VyY+42l1 eJ0PDKITH+5kjvh15Y9r4hxTqgvRhBTGudNjqdTI3oFjFfIMQBe06WLeoo14Y+Vk7wFM=; Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mHyXE-0005Qc-1T; Mon, 23 Aug 2021 03:14:00 +0200 From: Lars Ingebrigtsen References: Date: Mon, 23 Aug 2021 03:13:55 +0200 In-Reply-To: (Glenn Morris's message of "Mon, 25 Feb 2013 22:02:22 -0500") Message-ID: <874kbhufn0.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Glenn Morris writes: > It used to work that way prior to Emacs 22.1. Then it was changed for > reasons that were never properly explained IMO. > > http://debbugs.gnu.org/3354 > > All you can do is add a mode: cookie. > > [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Glenn Morris writes: > It used to work that way prior to Emacs 22.1. Then it was changed for > reasons that were never properly explained IMO. > > http://debbugs.gnu.org/3354 > > All you can do is add a mode: cookie. > > Or use /usr/bin/env, IIUC > https://github.com/scala/scala/pull/9 So I think the conclusion here is that this is working as designed, and I'm closing this bug report. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 22 21:14:14 2021 Received: (at control) by debbugs.gnu.org; 23 Aug 2021 01:14:14 +0000 Received: from localhost ([127.0.0.1]:40070 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mHyXV-0004BY-Ow for submit@debbugs.gnu.org; Sun, 22 Aug 2021 21:14:14 -0400 Received: from quimby.gnus.org ([95.216.78.240]:38846) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mHyXU-0004B5-4v for control@debbugs.gnu.org; Sun, 22 Aug 2021 21:14:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Jiw1zCqwapRizcNyOIomdHyQwJ5WsRLu5Mw/Q6CJPNc=; b=ICucyf1y/kkpiL5b+xrwBz1aNa BtXLujB2vMakAy/A7ExEGelkf6A6SkV1dYwe0z0mFGW8qOI4oS3EDBg8MFSX1xTreUBSjX3ujl1Jt GL3xIRwfjm96R6eNf6Bwnj5wRYiZw3pkEPu9nWlZBNEfgntQqen6B9R3MRqcrF7uhwOE=; Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mHyXM-0005Qu-DT for control@debbugs.gnu.org; Mon, 23 Aug 2021 03:14:06 +0200 Date: Mon, 23 Aug 2021 03:14:03 +0200 Message-Id: <8735r1ufms.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #13815 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 13815 wontfix close 13815 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) tags 13815 wontfix close 13815 quit From unknown Sun Jun 22 22:43:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13815: Wrong mode for files with awkward shebang lines Resent-From: Glenn Morris Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 23 Aug 2021 15:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: wontfix To: 13815@debbugs.gnu.org Received: via spool by 13815-submit@debbugs.gnu.org id=B13815.16297312171355 (code B ref 13815); Mon, 23 Aug 2021 15:07:01 +0000 Received: (at 13815) by debbugs.gnu.org; 23 Aug 2021 15:06:57 +0000 Received: from localhost ([127.0.0.1]:42351 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mIBXJ-0000Lj-Ey for submit@debbugs.gnu.org; Mon, 23 Aug 2021 11:06:57 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38020) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mIBXD-0000LQ-Qr for 13815@debbugs.gnu.org; Mon, 23 Aug 2021 11:06:52 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:52386) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mIBX8-0001Mv-Mo for 13815@debbugs.gnu.org; Mon, 23 Aug 2021 11:06:42 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1mIBX7-000419-EJ; Mon, 23 Aug 2021 11:06:41 -0400 From: Glenn Morris References: <874kbhufn0.fsf@gnus.org> X-Spook: Gorizont security Goodwin M-14 Plague Bust Phishing X-Ran: r\KG+w%*D!zo2}ZX+FD$6>C@OJG?ER8P*UK%!p(&s.?v8^1fmEstLmffjRg`"f#3-C!5Gf X-Hue: green X-Attribution: GM Date: Mon, 23 Aug 2021 11:06:41 -0400 In-Reply-To: <874kbhufn0.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 23 Aug 2021 03:13:55 +0200") Message-ID: <9d5yvwgpz2.fsf@fencepost.gnu.org> User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) FTR, this issue would be fixed if auto-mode-alist took priority over interpreter-mode-alist. That's how it was before Emacs 22.1. I've never seen an explanation for why it was changed (ref bug#3354). From unknown Sun Jun 22 22:43:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13815: Wrong mode for files with awkward shebang lines Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 23 Aug 2021 15:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: wontfix To: Glenn Morris Cc: 13815@debbugs.gnu.org Received: via spool by 13815-submit@debbugs.gnu.org id=B13815.16297314581805 (code B ref 13815); Mon, 23 Aug 2021 15:11:02 +0000 Received: (at 13815) by debbugs.gnu.org; 23 Aug 2021 15:10:58 +0000 Received: from localhost ([127.0.0.1]:42367 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mIBbF-0000T2-QG for submit@debbugs.gnu.org; Mon, 23 Aug 2021 11:10:57 -0400 Received: from quimby.gnus.org ([95.216.78.240]:45080) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mIBbD-0000Sc-MQ for 13815@debbugs.gnu.org; Mon, 23 Aug 2021 11:10:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=kTG3+mRHKh6mF+lwfhLP8FBehhVK6Ii5MEbFSdV4E7s=; b=O82QsF+HOCooKw0zqEqF5HHEa4 sMqnzvXrdJJFIyxFwORorlgmmy6y99eEmKeWyh/lk4cGaKVvb44yylK77QaIeIE9UyNlblUZ3kPN9 5IHYtuLFTql+HjRr/Q1GAAMhtUtk839z5ij41HZPNnz8iYKHHNlbj1K81nBXkO6wCnA4=; Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mIBb3-0004XA-Hr; Mon, 23 Aug 2021 17:10:49 +0200 From: Lars Ingebrigtsen References: <874kbhufn0.fsf@gnus.org> <9d5yvwgpz2.fsf@fencepost.gnu.org> Date: Mon, 23 Aug 2021 17:10:45 +0200 In-Reply-To: <9d5yvwgpz2.fsf@fencepost.gnu.org> (Glenn Morris's message of "Mon, 23 Aug 2021 11:06:41 -0400") Message-ID: <8735r0qjre.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Glenn Morris writes: > FTR, this issue would be fixed if auto-mode-alist took priority over > interpreter-mode-alist. That's how it was before Emacs 22.1. > I've never seen an explanation for why it was changed (ref bug#3 [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Glenn Morris writes: > FTR, this issue would be fixed if auto-mode-alist took priority over > interpreter-mode-alist. That's how it was before Emacs 22.1. > I've never seen an explanation for why it was changed (ref bug#3354). I thought it was because Debian changed the names of all their conf files (many of which are shell scripts) to .conf? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From unknown Sun Jun 22 22:43:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13815: Wrong mode for files with awkward shebang lines Resent-From: Glenn Morris Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 30 Aug 2021 15:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: wontfix To: Lars Ingebrigtsen Cc: 13815@debbugs.gnu.org Received: via spool by 13815-submit@debbugs.gnu.org id=B13815.163033627929233 (code B ref 13815); Mon, 30 Aug 2021 15:12:02 +0000 Received: (at 13815) by debbugs.gnu.org; 30 Aug 2021 15:11:19 +0000 Received: from localhost ([127.0.0.1]:59996 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKiwQ-0007bR-Vs for submit@debbugs.gnu.org; Mon, 30 Aug 2021 11:11:19 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44532) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKiwO-0007b0-UE for 13815@debbugs.gnu.org; Mon, 30 Aug 2021 11:11:17 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:50024) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mKiwJ-0001yq-MF; Mon, 30 Aug 2021 11:11:11 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1mKiwJ-000229-I1; Mon, 30 Aug 2021 11:11:11 -0400 From: Glenn Morris References: <874kbhufn0.fsf@gnus.org> <9d5yvwgpz2.fsf@fencepost.gnu.org> <8735r0qjre.fsf@gnus.org> X-Spook: al-Qa'ida Chelsea Noriega Maple Radicals MARTA SADF BfV X-Ran: xHNq^1'r5EA'k7Y&2[HU5(MET*%YEP(x_.24:~xivfJ]6Y2w{)qx](%f75JzaU!y)Gz?U! X-Hue: black X-Attribution: GM Date: Mon, 30 Aug 2021 11:11:11 -0400 In-Reply-To: <8735r0qjre.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 23 Aug 2021 17:10:45 +0200") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -1.6 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) Lars Ingebrigtsen wrote: > I thought it was because Debian changed the names of all their conf > files (many of which are shell scripts) to .conf? I'll repeat my earlier comments in the hope that this time someone will read them. I have 468 .conf files in /etc on my Debian system. A single one (it used to be zero years ago) has a #! line. It is nftables.conf, which contains "#!/usr/sbin/nft -f". Emacs has no mode for "nft". Therefore this provides zero motivation for interpreter-mode-alist to take precedence over auto-mode-alist. From unknown Sun Jun 22 22:43:54 2025 X-Loop: help-debbugs@gnu.org Subject: bug#13815: Wrong mode for files with awkward shebang lines Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 31 Aug 2021 01:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13815 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: wontfix To: Glenn Morris Cc: 13815@debbugs.gnu.org Received: via spool by 13815-submit@debbugs.gnu.org id=B13815.163037489811041 (code B ref 13815); Tue, 31 Aug 2021 01:55:02 +0000 Received: (at 13815) by debbugs.gnu.org; 31 Aug 2021 01:54:58 +0000 Received: from localhost ([127.0.0.1]:60702 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKszG-0002rx-3i for submit@debbugs.gnu.org; Mon, 30 Aug 2021 21:54:58 -0400 Received: from quimby.gnus.org ([95.216.78.240]:41366) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mKszA-0002rj-W3 for 13815@debbugs.gnu.org; Mon, 30 Aug 2021 21:54:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=J3rMv4LnaMdDG6yuCa2tFkYGG9/Vxq5l0cKaSFprWHg=; b=jYPqVyW0D6igpoEh2V5ZTVlNhO dtpp7Y2jysrQoKbGWE68xytmXnl8z6f7WmdRvmGdapvvUhOEYVNBWFBQBibuvJ4M28G8QZEzAaM37 s7Ma4n5sRBeoIt8v/AcutRbkleIgcwClcNol1RhR2lE7VOnuT936JHyf6t5+dfLU8nGw=; Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mKsz0-0005UU-74; Tue, 31 Aug 2021 03:54:42 +0200 From: Lars Ingebrigtsen References: <874kbhufn0.fsf@gnus.org> <9d5yvwgpz2.fsf@fencepost.gnu.org> <8735r0qjre.fsf@gnus.org> Date: Tue, 31 Aug 2021 03:54:37 +0200 In-Reply-To: (Glenn Morris's message of "Mon, 30 Aug 2021 11:11:11 -0400") Message-ID: <87v93m5qg2.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Glenn Morris writes: > I'll repeat my earlier comments in the hope that this time someone will > read them. Sorry; I misremembered. Well -- then that's not a good reason to change this (i.e., making #! take precedence over .suffix). Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Glenn Morris writes: > I'll repeat my earlier comments in the hope that this time someone will > read them. Sorry; I misremembered. Well -- then that's not a good reason to change this (i.e., making #! take precedence over .suffix). Does anybody remember what the rationale was for this change? It's somewhat puzzling behaviour. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no