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 08:04:53 +0300 Message-ID: <83y1iykn0q.fsf@gnu.org> References: <87mszebgwy.fsf@gmail.com> <878rays89s.fsf@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18810"; 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 07:26:35 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 1qPywt-0004gn-4g for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 30 Jul 2023 07:26:35 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qPycG-0000ZE-J2; Sun, 30 Jul 2023 01:05:16 -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 1qPyc3-0000Vp-3S for bug-gnu-emacs@gnu.org; Sun, 30 Jul 2023 01:05:03 -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 1qPyc2-0000yc-Qo for bug-gnu-emacs@gnu.org; Sun, 30 Jul 2023 01:05:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qPyc2-0000Oo-HJ for bug-gnu-emacs@gnu.org; Sun, 30 Jul 2023 01:05:02 -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 05:05:02 +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.16906935011522 (code B ref 64939); Sun, 30 Jul 2023 05:05:02 +0000 Original-Received: (at 64939) by debbugs.gnu.org; 30 Jul 2023 05:05:01 +0000 Original-Received: from localhost ([127.0.0.1]:49170 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qPyc0-0000OT-OU for submit@debbugs.gnu.org; Sun, 30 Jul 2023 01:05:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42632) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qPybz-0000OH-FE for 64939@debbugs.gnu.org; Sun, 30 Jul 2023 01:04:59 -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 1qPybu-0000vd-91; Sun, 30 Jul 2023 01:04:54 -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=G/2VXlHePi/XFe1ZZ4R4WqROz+Zr0TbrH+x7nCh3kvA=; b=kPaFz3/zga7r KrB9rhRW33E/Vh9i0u+3/LC3esemjn++pzJKl9gp4qLj236N06YX32fTv0dKgM2Q1+vgbrUQMhjU0 O7m4T0Ps2ozjbm08xmvwngI3tf81FEs4DqfP5fVx0TPWQ2aIoRJb1upWpDICIGJMM+5iaQdA0hRLA qp+5Wz/X7Tv+lIahPI3mZW/3cg9lsFuWmbV7FLukgPKCS4KK30e35BclgU2YyhUVDyChZhBlzdq0P F8V6xBac+7mMLyT/TTsMKZo++VDWQZdUubmtWA8WbAGNe94fZe6uGJitKxC8hCsiZkekqmq8oCZwZ LMfmcN5I1SMgtoTlkBFoqQ==; 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 1qPybt-0000FQ-OE; Sun, 30 Jul 2023 01:04:54 -0400 In-Reply-To: <878rays89s.fsf@gmail.com> (message from Wilhelm Kirschbaum on Sat, 29 Jul 2023 23:38:07 +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:266351 Archived-At: > From: Wilhelm Kirschbaum > Date: Sat, 29 Jul 2023 23:38:07 +0200 > > This is a very naive solution to the above, but I am probably > missing some knowledge here and will break for anyone setting the > var to something custom. Feel free to make this change locally, but I don't see how this can be general enough for us to install it as the default value. For starters, 'env' can be invoked with several options, not just with one. Also, some 'env' options accept arguments, and how do we know if the word that follows "env -OPTION" is the command to check against interpreter-mode-alist or an argument of an option? IOW, I don't think this is a problem for a regexp-based solution. If we want to support such complex shebang lines (btw, does the Posix or GNU/Linux shell support them?), we should analyze the text after "env" to find the candidate interpreter. Not sure whether even that will provide a robust solution. Btw, can't you satisfy your needs via file-local variables?