From 6c233cc08319a7a6d7bea4f0e3bc31077a25b394 Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Tue, 7 Aug 2001 09:47:06 +0000 Subject: [PATCH] (executable-set-magic): If executable-find returns a quoted file name, unquote it before inserting it. --- lisp/ChangeLog | 4 ++++ lisp/progmodes/executable.el | 12 +++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) 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) -- 2.39.2