[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: master ca47390: image-dired: Report when a necessary executable is n
From: |
Tino Calancha |
Subject: |
Re: master ca47390: image-dired: Report when a necessary executable is not found |
Date: |
Mon, 5 Sep 2016 12:42:31 +0900 (JST) |
User-agent: |
Alpine 2.20 (DEB 67 2015-01-07) |
On Sun, 4 Sep 2016, Glenn Morris wrote:
Hi,
Tino Calancha wrote:
(defcustom image-dired-cmd-create-thumbnail-program
- "convert"
+ (executable-find "convert")
"Executable used to create thumbnail.
Used together with `image-dired-cmd-create-thumbnail-options'."
:type 'string
Please update this and all the other affected :types to allow for the
nil values that may now occur. You might also want to document what a
value of nil means. Thanks.
Please let me know if the following patch is OK:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
From e8d540387d92c64b971a31f372fd4627c5198948 Mon Sep 17 00:00:00 2001
From: Tino Calancha <address@hidden>
Date: Mon, 5 Sep 2016 12:32:42 +0900
Subject: [PATCH] image-dired: Update :type declaration for several options
* lisp/image-dired.el (image-dired-cmd-create-thumbnail-program)
(image-dired-cmd-create-temp-image-program)
(image-dired-cmd-rotate-thumbnail-program)
(image-dired-cmd-rotate-original-program)
(image-dired-cmd-write-exif-data-program)
(image-dired-cmd-read-exif-data-program):
Update :type to allow for a nil value.
Mention in the doc string that if the value is nil, then
the function using this option signals an error.
---
lisp/image-dired.el | 32 +++++++++++++++++++-------------
1 file changed, 19 insertions(+), 13 deletions(-)
diff --git a/lisp/image-dired.el b/lisp/image-dired.el
index 5ac4600..eddaee1 100644
--- a/lisp/image-dired.el
+++ b/lisp/image-dired.el
@@ -224,10 +224,11 @@ image-dired-gallery-thumb-image-root-url
:group 'image-dired)
(defcustom image-dired-cmd-create-thumbnail-program
- (executable-find "convert")
+ (when (executable-find "convert") "convert")
"Executable used to create thumbnail.
+If nil, `image-dired-create-thumb' signals an error.
Used together with `image-dired-cmd-create-thumbnail-options'."
- :type 'string
+ :type '(choice (const :tag "Not Set" nil) string)
:group 'image-dired)
(defcustom image-dired-cmd-create-thumbnail-options
@@ -242,10 +243,11 @@ image-dired-cmd-create-thumbnail-options
:group 'image-dired)
(defcustom image-dired-cmd-create-temp-image-program
- (executable-find "convert")
+ (when (executable-find "convert") "convert")
"Executable used to create temporary image.
+If nil, `image-dired-display-image' signals an error.
Used together with `image-dired-cmd-create-temp-image-options'."
- :type 'string
+ :type '(choice (const :tag "Not Set" nil) string)
:group 'image-dired)
(defcustom image-dired-cmd-create-temp-image-options
@@ -308,10 +310,11 @@ image-dired-cmd-create-standard-thumbnail-command
:group 'image-dired)
(defcustom image-dired-cmd-rotate-thumbnail-program
- (executable-find "mogrify")
+ (when (executable-find "mogrify") "mogrify")
"Executable used to rotate thumbnail.
+If nil, `image-dired-rotate-thumbnail' signals an error.
Used together with `image-dired-cmd-rotate-thumbnail-options'."
- :type 'string
+ :type '(choice (const :tag "Not Set" nil) string)
:group 'image-dired)
(defcustom image-dired-cmd-rotate-thumbnail-options
@@ -326,11 +329,12 @@ image-dired-cmd-rotate-thumbnail-options
:group 'image-dired)
(defcustom image-dired-cmd-rotate-original-program
- (cond ((executable-find "jpegtran"))
- ((executable-find "convert")))
+ (cond ((executable-find "jpegtran") "jpegtran")
+ ((executable-find "convert") "convert"))
"Executable used to rotate original image.
+If nil, `image-dired-rotate-original' signals an error.
Used together with `image-dired-cmd-rotate-original-options'."
- :type 'string
+ :type '(choice (const :tag "Not Set" nil) string)
:group 'image-dired)
(defcustom image-dired-cmd-rotate-original-options
@@ -364,10 +368,11 @@ image-dired-rotate-original-ask-before-overwrite
:group 'image-dired)
(defcustom image-dired-cmd-write-exif-data-program
- (executable-find "exiftool")
+ (when (executable-find "exiftool") "exiftool")
"Program used to write EXIF data to image.
+If nil, `image-dired-set-exif-data' signals an error.
Used together with `image-dired-cmd-write-exif-data-options'."
- :type 'string
+ :type '(choice (const :tag "Not Set" nil) string)
:group 'image-dired)
(defcustom image-dired-cmd-write-exif-data-options
@@ -381,10 +386,11 @@ image-dired-cmd-write-exif-data-options
:group 'image-dired)
(defcustom image-dired-cmd-read-exif-data-program
- (executable-find "exiftool")
+ (when (executable-find "exiftool") "exiftool")
"Program used to read EXIF data to image.
+If nil, `image-dired-get-exif-data' signals an error.
Used together with `image-dired-cmd-read-exif-data-program-options'."
- :type 'string
+ :type '(choice (const :tag "Not Set" nil) string)
:group 'image-dired)
(defcustom image-dired-cmd-read-exif-data-options
--
2.9.3
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;