From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [Emacs-diffs] master 63f4f02: If requested, use external image converters for exotic formats Date: Sun, 29 Sep 2019 09:22:12 -0400 Message-ID: References: <20190928232618.29254.42705@vcs0.savannah.gnu.org> <20190928232619.9AF492068F@vcs0.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="203415"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Lars Ingebrigtsen To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Sep 29 15:23:41 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iEZAp-000qky-Nr for ged-emacs-devel@m.gmane.org; Sun, 29 Sep 2019 15:23:39 +0200 Original-Received: from localhost ([::1]:39354 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iEZAo-0002VX-9E for ged-emacs-devel@m.gmane.org; Sun, 29 Sep 2019 09:23:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58943) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iEZ9W-0002VJ-FH for emacs-devel@gnu.org; Sun, 29 Sep 2019 09:22:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iEZ9U-0000Si-Uh for emacs-devel@gnu.org; Sun, 29 Sep 2019 09:22:17 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:52971) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iEZ9U-0000QD-OB for emacs-devel@gnu.org; Sun, 29 Sep 2019 09:22:16 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 1A24D1006CE; Sun, 29 Sep 2019 09:22:15 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 87E2C10064F; Sun, 29 Sep 2019 09:22:13 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1569763333; bh=XQODAj8eFD7A0vvO00vszJIVLnqHT1Q01UXj4izQKtg=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=PjVPeFfUuORRLnpfZr3IqXQKPQtVt5QdESNYtPcvAXVfQb5BVCfeIjVuxniTgNNAJ Utbm9k0Hb9RB83iEJ8wH7/Mz9ouUlAKEKVpyCrLIFb0/2AuE9c5YTvtD5hSeGGpk35 tjtyllwzyqpp4EeYPN3TZuwRehc03ctjHqoSM2HXxixcCYW2tD4Vg8Eo7hzQM7VVkI mysMQQos74wyr80lGDNyMz2fw26cZNK3GR8W63K8ZE7vs1bk0oO4B79B/kLpVVrJkJ IU8QjCLiKhSbnaC1qOxE0q4awlOJHdG3c3fMD9kY0saMAMf+zDUv6n9K9NDCa3mBqs KiTR+Ts+LIhuA== Original-Received: from pastel (107-179-151-143.cpe.teksavvy.com [107.179.151.143]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 4EC5012065C; Sun, 29 Sep 2019 09:22:13 -0400 (EDT) In-Reply-To: <20190928232619.9AF492068F@vcs0.savannah.gnu.org> (Lars Ingebrigtsen's message of "Sat, 28 Sep 2019 19:26:19 -0400 (EDT)") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 132.204.25.50 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:240390 Archived-At: > +(defvar image-converter--converters > + '((graphicsmagick :command "gm convert" :probe "-list format") > + (imagemagick :command "convert" :probe "-list format") > + (ffmpeg :command "ffmpeg" :probe "-decoders")) > + "List of supported image converters to try.") [...] > + (let ((command (split-string (image-converter--value type :command) " ")) > + formats) > + (when (zerop (apply #'call-process (car command) nil '(t nil) nil Why not split the string directly in image-converter--converters? Same for the ":probe" part? I.e. use something like: (defvar image-converter--converters '((graphicsmagick :command "gm" :convertargs ("convert") :probe ("-list" "format")) (imagemagick :command "convert" :probe ("-list" "format")) (ffmpeg :command "ffmpeg" :probe "-decoders")) so it works even if the command's name (or some of the args your need to pass to the command) contains spaces? This said, given that you use separate methods for the different backends: (cl-defmethod image-converter--probe ((type (eql imagemagick))) I don't understand why you need those args in image-converter--converters instead of putting them directly into their respective methods. Stefan