From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#64939: 30.0.50; The default auto-mode-interpreter-regexp does not match env with flags Date: Sun, 30 Jul 2023 13:03:27 +0300 Message-ID: <83jzuhlnrk.fsf@gnu.org> References: <87mszebgwy.fsf@gmail.com> <83zg3eknjd.fsf@gnu.org> <87351591ue.fsf@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3578"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 64939@debbugs.gnu.org To: Wilhelm Kirschbaum Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jul 30 12:33:40 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 1qQ3k4-0000ik-Ka for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 30 Jul 2023 12:33:40 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qQ3HQ-0001Uk-5O; Sun, 30 Jul 2023 06:04:04 -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 1qQ3HO-0001S7-A1 for bug-gnu-emacs@gnu.org; Sun, 30 Jul 2023 06:04:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qQ3HO-0003Jg-1t for bug-gnu-emacs@gnu.org; Sun, 30 Jul 2023 06:04:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qQ3HN-0004ip-Tc for bug-gnu-emacs@gnu.org; Sun, 30 Jul 2023 06:04:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 30 Jul 2023 10:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64939 X-GNU-PR-Package: emacs Original-Received: via spool by 64939-submit@debbugs.gnu.org id=B64939.169071141518117 (code B ref 64939); Sun, 30 Jul 2023 10:04:01 +0000 Original-Received: (at 64939) by debbugs.gnu.org; 30 Jul 2023 10:03:35 +0000 Original-Received: from localhost ([127.0.0.1]:49412 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qQ3Gx-0004i8-5W for submit@debbugs.gnu.org; Sun, 30 Jul 2023 06:03:35 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47228) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qQ3Gu-0004hv-Me for 64939@debbugs.gnu.org; Sun, 30 Jul 2023 06:03:33 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qQ3Gp-0003Be-GT; Sun, 30 Jul 2023 06:03:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=G11qumF/ekJhjd5plFLtvIVMyxcNS3dNna/AT7GXMQY=; b=hSmq0jsD0SSm 3Tn5vPzosYshrGuYoa0FgN2cnprBGLv8xDogL8OGZidHTWQdY0Z1PI/PQ/gDmuiD4X4lVQMn3TseO 8CyiPyYeWCF/UbXXQuMn28gf6V2+iI8iTvrXhHyWSm1aIeDMklt/lLHYMOYoGkqW5oQkQEBuIIouB 1I12qT99/vJUOofseoqPgwBtCJvyI5Uj6DlyclTtA+4dLA1dUI8WXV2d+G9viQojXHtoMSBrwkaVU Bv+/e9shARLlR1+Cq6HJCskh1LhqonFepDge5DX6tLBNfdzD/NtWRrfSIZgezlP+20T9mtJHbzI0X sHz/cFp5XOs9cOQ2NR6oGg==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qQ3Go-00069x-W8; Sun, 30 Jul 2023 06:03:27 -0400 In-Reply-To: <87351591ue.fsf@gmail.com> (message from Wilhelm Kirschbaum on Sun, 30 Jul 2023 10:28:14 +0200) 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:266364 Archived-At: > From: Wilhelm Kirschbaum > Cc: 64939@debbugs.gnu.org > Date: Sun, 30 Jul 2023 10:28:14 +0200 > > > Eli Zaretskii writes: > > > That line _is_ matched by auto-mode-interpreter-regexp: > > > > (string-match-p auto-mode-interpreter-regexp "#!/usr/bin/env > > -S ruby -e 'puts 123'") => 0 > > > > The problem is how to find the name of the interpreter if the text > > after "/usr/bin/env" includes more than one word? Once we start > > using command-line switches and their arguments, and take into > > consideration that many GNU/Linux programs can freely intersperse > > options and non-option arguments on the command line in any order, > > where does this end? > > I am hoping there is some way of effectively matching command-line > switches for '/usr/bin/env', but sounds like it is perhaps too > complex? How can we do that without incurring non-trivial maintenance costs? 'env' is being actively developed; e.g., the old version I have where I'm typing this doesn't even have the -S option. Are we supposed to track every new command-line option added to 'env', and update our code accordingly? That is even impractical, because someone could use 2-year old Emacs with Coreutils released just yesterday.