summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2019-10-30 01:02:43 +0100
committerLars Ingebrigtsen <larsi@gnus.org>2019-10-30 01:02:48 +0100
commit7ce00e9a8bf9dc3793348d2c6f4762e90f45c11b (patch)
tree934e1875d897933450ce50eb6816bee0aa51ad32
parentba7755bfb78884fd57e2506bcaebb51b5ff1ba1b (diff)
downloademacs-7ce00e9a8bf9dc3793348d2c6f4762e90f45c11b.tar.gz
emacs-7ce00e9a8bf9dc3793348d2c6f4762e90f45c11b.tar.bz2
emacs-7ce00e9a8bf9dc3793348d2c6f4762e90f45c11b.zip
Fix image-converter probes
* lisp/image/image-converter.el (image-converter--probe): Check that the executable exists before trying to call it.
-rw-r--r--lisp/image/image-converter.el19
1 files changed, 11 insertions, 8 deletions
diff --git a/lisp/image/image-converter.el b/lisp/image/image-converter.el
index f046529fd57..2e09976c011 100644
--- a/lisp/image/image-converter.el
+++ b/lisp/image/image-converter.el
@@ -100,9 +100,10 @@ where created with DATA-P nil (i.e., it has to refer to a file)."
(with-temp-buffer
(let ((command (image-converter--value type :command))
formats)
- (when (zerop (apply #'call-process (car command) nil '(t nil) nil
- (append (cdr command)
- (image-converter--value type :probe))))
+ (when (and (executable-find (car command))
+ (zerop (apply #'call-process (car command) nil '(t nil) nil
+ (append (cdr command)
+ (image-converter--value type :probe)))))
(goto-char (point-min))
(when (re-search-forward "^-" nil t)
(forward-line 1)
@@ -119,8 +120,9 @@ where created with DATA-P nil (i.e., it has to refer to a file)."
formats)
;; Can't check return value; ImageMagick convert usually returns
;; a non-zero result on "-list format".
- (apply #'call-process (car command) nil '(t nil) nil
- (append (cdr command) (image-converter--value type :probe)))
+ (when (executable-find (car command))
+ (apply #'call-process (car command) nil '(t nil) nil
+ (append (cdr command) (image-converter--value type :probe))))
(goto-char (point-min))
(when (re-search-forward "^-" nil t)
(forward-line 1)
@@ -135,9 +137,10 @@ where created with DATA-P nil (i.e., it has to refer to a file)."
(with-temp-buffer
(let ((command (image-converter--value type :command))
formats)
- (when (zerop (apply #'call-process (car command) nil '(t nil) nil
- (append (cdr command)
- (image-converter--value type :probe))))
+ (when (and (executable-find (car command))
+ (zerop (apply #'call-process (car command) nil '(t nil) nil
+ (append (cdr command)
+ (image-converter--value type :probe)))))
(goto-char (point-min))
(when (re-search-forward "^ *-" nil t)
(forward-line 1)