bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#64939: 30.0.50; The default auto-mode-interpreter-regexp does not ma


From: Wilhelm Kirschbaum
Subject: bug#64939: 30.0.50; The default auto-mode-interpreter-regexp does not match env with flags
Date: Sun, 30 Jul 2023 11:38:06 +0200
User-agent: mu4e 1.9.3; emacs 30.0.50


Eli Zaretskii <eliz@gnu.org> writes:

From: Wilhelm Kirschbaum <wkirschbaum@gmail.com>
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.


The problem is that even with a local change, the match group 2 is hard coded.
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?


Understand, it is a bit complex perhaps.
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.


I can perhaps have a look if there is something concrete about how this can be interpreted.
Btw, can't you satisfy your needs via file-local variables?

Not without convincing the project maintainers to add Emacs specific lines to the code, which I don't really think is appropriate in some
cases.

It is not a common occurrence to run into this issue, but thought is strange to not work as expected. If I am the only one, then happy to
close this and just keep a local patch.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]