From: Gerd Moellmann Date: Tue, 7 Aug 2001 09:47:06 +0000 (+0000) Subject: (executable-set-magic): If X-Git-Tag: emacs-pretest-21.0.105~268 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6c233cc08319a7a6d7bea4f0e3bc31077a25b394;p=emacs.git (executable-set-magic): If executable-find returns a quoted file name, unquote it before inserting it. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9a29f22ea5b..83215282a8e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2001-08-07 Gerd Moellmann + * progmodes/executable.el (executable-set-magic): If + executable-find returns a quoted file name, unquote it before + inserting it. + * image.el (image-type-regexps): For JPEG files, use a regexp derived from the JPEG spec. diff --git a/lisp/progmodes/executable.el b/lisp/progmodes/executable.el index ce2b0b68cbb..bfe860fb223 100644 --- a/lisp/progmodes/executable.el +++ b/lisp/progmodes/executable.el @@ -210,13 +210,19 @@ executable." (let* ((name (read-string "Name or file name of interpreter: ")) (arg (read-string (format "Argument for %s: " name)))) (list name arg (eq executable-query 'function) t))) + (setq interpreter (if (file-name-absolute-p interpreter) interpreter (or (executable-find interpreter) - (error "Interpreter %s not recognized" interpreter))) - argument (concat interpreter + (error "Interpreter %s not recognized" + interpreter)))) + + (setq argument (concat (if (string-match "\\`/:" interpreter) + (replace-match "" nil nil interpreter) + interpreter) (and argument (string< "" argument) " ") argument)) + (or buffer-read-only (if buffer-file-name (string-match executable-magicless-file-regexp @@ -253,7 +259,7 @@ executable." ;;; (eq executable-insert t) ;;; (set-buffer-modified-p buffer-modified-p)) ))) - interpreter) + interpreter)