From: Tino Calancha <tino.calancha@gmail.com>
To: Glenn Morris <rgm@gnu.org>
Cc: Tino Calancha <tino.calancha@gmail.com>,
Emacs developers <emacs-devel@gnu.org>
Subject: Re: master ca47390: image-dired: Report when a necessary executable is not found
Date: Mon, 5 Sep 2016 12:42:31 +0900 (JST) [thread overview]
Message-ID: <alpine.DEB.2.20.1609051241180.15417@calancha-pc> (raw)
In-Reply-To: <dyd1kj8vnt.fsf@fencepost.gnu.org>
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 <tino.calancha@gmail.com>
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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
next prev parent reply other threads:[~2016-09-05 3:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20160904134431.30494.94659@vcs.savannah.gnu.org>
[not found] ` <20160904134431.7513F220140@vcs.savannah.gnu.org>
2016-09-04 16:41 ` master ca47390: image-dired: Report when a necessary executable is not found Glenn Morris
2016-09-05 3:42 ` Tino Calancha [this message]
2016-09-05 4:42 ` Clément Pit--Claudel
2016-09-05 5:30 ` Tino Calancha
2016-09-05 6:41 ` Andreas Schwab
2016-09-05 7:12 ` Tino Calancha
2016-09-05 15:48 ` Clément Pit--Claudel
2016-09-05 18:00 ` Tino Calancha
2016-09-12 18:44 ` Glenn Morris
2016-09-12 19:44 ` Tino Calancha
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.20.1609051241180.15417@calancha-pc \
--to=tino.calancha@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=rgm@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).