From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.devel Subject: Re: master ca47390: image-dired: Report when a necessary executable is not found Date: Mon, 5 Sep 2016 12:42:31 +0900 (JST) Message-ID: References: <20160904134431.30494.94659@vcs.savannah.gnu.org> <20160904134431.7513F220140@vcs.savannah.gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Trace: blaine.gmane.org 1473046981 18043 195.159.176.226 (5 Sep 2016 03:43:01 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 5 Sep 2016 03:43:01 +0000 (UTC) User-Agent: Alpine 2.20 (DEB 67 2015-01-07) Cc: Tino Calancha , Emacs developers To: Glenn Morris Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 05 05:42:57 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bgkoB-000410-As for ged-emacs-devel@m.gmane.org; Mon, 05 Sep 2016 05:42:55 +0200 Original-Received: from localhost ([::1]:52072 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgko8-0002TM-Ry for ged-emacs-devel@m.gmane.org; Sun, 04 Sep 2016 23:42:52 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49851) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgko2-0002T4-2H for emacs-devel@gnu.org; Sun, 04 Sep 2016 23:42:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bgko0-00058A-Q2 for emacs-devel@gnu.org; Sun, 04 Sep 2016 23:42:46 -0400 Original-Received: from mail-pa0-x22c.google.com ([2607:f8b0:400e:c03::22c]:34010) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgknt-00056q-Rd; Sun, 04 Sep 2016 23:42:38 -0400 Original-Received: by mail-pa0-x22c.google.com with SMTP id to9so19453605pac.1; Sun, 04 Sep 2016 20:42:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=tHoBlkZ3+slpNm/S2/KB43pg/N/D6rB+7+jTNUkO5as=; b=OHD5QtBj9NH1xUU2NoT8+93ZWMscEBD+P/vdIJaR6mfJFUw7pWGHhLGgGg4BrvrFZW 8MhnLB3DlJRaXruHsFObiK179NiwjriT2K6w1C8qdfYbpah+hEpmK6MARHXlLlvx/8rR C9berJryEUISScOQIt4rBSNlTtXFRmnGfH0ZJDGdjQMHLW2XoZDTDSRsoupZXvcPsJms f+SdNEDALCTIRG3JmdVydwjlkCeqZSbxwPS/wFJ52EXQ2XtLUaMYHKIeuwJ4rceVd+y4 d9FuwqXHFtJrm5d+p0cPvdiG8es4cUQSJ0R7bmNNSkRKW6SBzfW4Hn8qYIDqmxlzMctF 8row== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=tHoBlkZ3+slpNm/S2/KB43pg/N/D6rB+7+jTNUkO5as=; b=bNmvpU0kVVPCRYjXnPHYLDTukkAgZKSeEJ/3vLD6c6v/0qUStHX4DG01TQ7JD0UpMD W3RguaaBe2e3y5fllHht4rR5DImv/z9pFUw4LUYoG6bLGWwRKOz42u8IYEfW/QkEaHH0 zkW0zMweIDWpyR8q+4PtbAPX9zWSpT+jOOJcI9tTBfoUvkMzI4S4bgJ61SghEkq3HQJu mihszBgldjY33yk6bpMX2VCXMvJOAP84rewPG45Opz9qFOHMbFYI/txVowSTRAkWRGpD r4fwCsEI2+jeQCq1HSxKBfAmzBuDLr5rXrs9Z9lBa4fyAbTY776o+0vbroqpYJYehLc+ 8JQA== X-Gm-Message-State: AE9vXwPbKXU95V+Wg0bXfy82NDnrS4CjeSkDqnKW0VGgJUWIZFrgWlUV6BwjVH63gaSoqw== X-Received: by 10.66.161.132 with SMTP id xs4mr59201022pab.140.1473046955265; Sun, 04 Sep 2016 20:42:35 -0700 (PDT) Original-Received: from calancha-pc (69.191.218.133.dy.bbexcite.jp. [133.218.191.69]) by smtp.gmail.com with ESMTPSA id ww14sm29955314pac.34.2016.09.04.20.42.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Sep 2016 20:42:34 -0700 (PDT) X-Google-Original-From: Tino Calancha X-X-Sender: calancha@calancha-pc In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c03::22c X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:207186 Archived-At: 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 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 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;