From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Wilhelm Kirschbaum 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 12:27:38 +0200 Message-ID: <87tttk7e01.fsf@gmail.com> References: <87mszebgwy.fsf@gmail.com> <83zg3eknjd.fsf@gnu.org> <87351591ue.fsf@gmail.com> <83jzuhlnrk.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28390"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.9.3; emacs 30.0.50 Cc: 64939@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jul 31 09:11:44 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 1qQN4C-0007AH-CK for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 31 Jul 2023 09:11:44 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qQN3Z-000211-7n; Mon, 31 Jul 2023 03:11:05 -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 1qQN3W-00020N-8Z for bug-gnu-emacs@gnu.org; Mon, 31 Jul 2023 03:11: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 1qQN3W-0003Y0-0w for bug-gnu-emacs@gnu.org; Mon, 31 Jul 2023 03:11:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qQN3V-0001ZG-TC for bug-gnu-emacs@gnu.org; Mon, 31 Jul 2023 03:11:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Wilhelm Kirschbaum Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 31 Jul 2023 07:11: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.16907874355992 (code B ref 64939); Mon, 31 Jul 2023 07:11:01 +0000 Original-Received: (at 64939) by debbugs.gnu.org; 31 Jul 2023 07:10:35 +0000 Original-Received: from localhost ([127.0.0.1]:51673 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qQN34-0001YZ-I3 for submit@debbugs.gnu.org; Mon, 31 Jul 2023 03:10:34 -0400 Original-Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:49486) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qQN32-0001YK-Nr for 64939@debbugs.gnu.org; Mon, 31 Jul 2023 03:10:33 -0400 Original-Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-3fe12820bffso18341095e9.3 for <64939@debbugs.gnu.org>; Mon, 31 Jul 2023 00:10:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690787426; x=1691392226; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:from:to:cc:subject:date:message-id:reply-to; bh=29x0mTwK9A10OKveJ9Wh49M8UalDrTpsE6jTG2PlA2k=; b=HSbvEK5QFvLm4ylq9Egioa5wnASQSqZqg0qJBQWoXLS69Ms/0CVCxa+gdkm2csSYp4 aF7wb848jZ40tY5rrEO7Yh0e7iJuy7w9X6WUgWdVfllyo/9cBjUYWdSMyHDCD1ycDpSW R56cdf+vc7ZfW8stwqm1c5LEbOYb0Vcrk50ieXugxY6bJVmlQS4fWzpFzs73b7fiaZSN LRDDyKnNib8dxe5W4OThEG82r6gRm0Xa/4FvbaEmUPbwmcabJncODiAVSJFO+bHpbrts oQPuq9QaK7hBZXdu813gImsOxvOZ77jucvV0zCwhsfmlNqXK+WYms50JeryZUcul8fmn vKcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690787426; x=1691392226; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=29x0mTwK9A10OKveJ9Wh49M8UalDrTpsE6jTG2PlA2k=; b=V053lCVOb0tD8EnXM9VNeJgFzMkcva5K9oo06ZP65jK8SYmcE//YsnZmrkK045gicQ OYNGIe1VdKOvx0hsVgyISY4S3sj4yEyVnwRtZVKu+6vy1ifSJAZL3iLBDlQKEYqhE2kb X6ykHZdgUO5RP0Z1eJbpMgzBGb6B6sZaLTMDNWkw09XtEuJJrwBV3Y7kSRt3r/ypo358 K592CjDm7TDKSaFVMxO3kJfkjvC7322t9qpoTvDJ4BmmR07XUSDhJDKIwq7kyxcxGwgd SCaXTy94eIeJvKKcS9iLOWR4O/ehnkHBupS6VzjKXV8LMP+yXYlKEx+VCqJJxgoU3Stj zOZg== X-Gm-Message-State: ABy/qLbdZqAE1e1P7wwQ0ms+J8fBIrWqWdxMe7EeqRvekrWNHkJB42MW n+wJacDxbY2GU+ng6xZYVRfZLdKc6SY= X-Google-Smtp-Source: APBJJlFWZLc1T4nnEYbjGrZ165/J3kk5pxumh2BbtK/OnQb11xylQdyVTHD25sYKKIOWKyxqHPV49w== X-Received: by 2002:a5d:424f:0:b0:315:a043:5e0a with SMTP id s15-20020a5d424f000000b00315a0435e0amr5421932wrr.56.1690787426221; Mon, 31 Jul 2023 00:10:26 -0700 (PDT) Original-Received: from melissa.local ([2c0f:ef18:1431:0:b09:9616:db04:c248]) by smtp.gmail.com with ESMTPSA id k1-20020adff5c1000000b00314417f5272sm12160967wrp.64.2023.07.31.00.10.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 00:10:25 -0700 (PDT) In-reply-to: <83jzuhlnrk.fsf@gnu.org> 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:266397 Archived-At: Eli Zaretskii writes: >> 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. No, I don't think we should track every command-line option added, but just allow to match command-line options for env ( maybe this is the non-trivial part). I don't understand why it will have an impact for someone who is using a version 5+ year old version of Coreutils. If it was possible for a user to add configuration to set-auto-mode script files like the ones mentioned above I think this will be less of an issue.