emacs-devel
[Top][All Lists]
Advanced

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

Re: executable-set-magic update


From: Stefan Monnier
Subject: Re: executable-set-magic update
Date: Sat, 10 Jun 2017 08:26:30 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

> It would also be nice if `executable-set-magic’ were supported beyond
> `sh-set-shell’ (in lisp/progmodes/sh-script.el), so I implemented
> a minor mode that adds the following hook to find-file:
>
> (defun script-set-magic ()
>   "Look up interpreter associated with current major mode in
> `script-set-magic-alist' and call `executable-set-magic'."
>   (let ((interpreter (alist-get major-mode script-set-magic-alist)))
>     (if interpreter (executable-set-magic interpreter)))
>   )

Doesn't this add a #! to every file using modes like
js/ruby/awk/perl/python/...?

In multi-file programs, only the main file needs a "#!", so I don't
understand why adding #! to all files would make sense.


        Stefan




reply via email to

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