From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: AKIYAMA Kouhei Newsgroups: gmane.emacs.bugs Subject: bug#73231: 30.0.91; image-dired cannot be operated until all thumbnails are created (MS-Windows) Date: Sun, 15 Sep 2024 16:32:34 +0900 Message-ID: References: <861q1n1z2z.fsf@gmail.com> <867cbfk0e5.fsf@gnu.org> <86v7yyiven.fsf@gnu.org> <8634m2h3cq.fsf@gnu.org> <86jzfde8o1.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22784"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 73231@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 15 12:11:19 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1spmDt-0005hZ-DN for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 15 Sep 2024 12:11:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1spmDY-0006v3-Jp; Sun, 15 Sep 2024 06:10:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1spmDS-0006tj-S2 for bug-gnu-emacs@gnu.org; Sun, 15 Sep 2024 06:10:51 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1spmDS-0003oZ-Ic for bug-gnu-emacs@gnu.org; Sun, 15 Sep 2024 06:10:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:From:In-Reply-To:References:MIME-Version:To:Subject; bh=+LRKNnH7/dIaAJ0mYkS2mWIoffoIuWZGw67BxeaQoCQ=; b=u+1t8bRg6GR5YRR1379IgaZIhq3iZe2GKlSc1UWn9mIViDu2Qb5PsF0u4ErONDk5aSeFZrUKJiT2e0mCEnUbc1rPR9VnoZ/Rr6Ch8hvH78/rRrTEt46klXgF5V6XQI0BxzO200ARzvl4sJJbDMWm1R6yEK3OsKxop7qydr4kej+F8gkPIh1nJfn5ww6/TumLJRGiLnJTcWV2i7ks4XNizKxIzzHbJmJ0MbvQqlsK6gbokOdxW8JOjVi/3CXh6kLFbazjv1y6S0JPWb6d55UXIgyKwkd0f/VfdVol71dfrM/1hO9OcZR6y2ZqNfhI9ob/W1KwMXQ4WdEwsRPH0tAJuQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1spmDe-0001Z0-7s for bug-gnu-emacs@gnu.org; Sun, 15 Sep 2024 06:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: AKIYAMA Kouhei Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Sep 2024 10:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73231 X-GNU-PR-Package: emacs Original-Received: via spool by 73231-submit@debbugs.gnu.org id=B73231.17263950285939 (code B ref 73231); Sun, 15 Sep 2024 10:11:02 +0000 Original-Received: (at 73231) by debbugs.gnu.org; 15 Sep 2024 10:10:28 +0000 Original-Received: from localhost ([127.0.0.1]:48458 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spmD5-0001Xh-Uz for submit@debbugs.gnu.org; Sun, 15 Sep 2024 06:10:28 -0400 Original-Received: from mail-lj1-f170.google.com ([209.85.208.170]:55784) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spjlk-0001Cg-A4 for 73231@debbugs.gnu.org; Sun, 15 Sep 2024 03:34:04 -0400 Original-Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-2f752d9ab62so22308581fa.3 for <73231@debbugs.gnu.org>; Sun, 15 Sep 2024 00:33:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726385567; x=1726990367; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=+LRKNnH7/dIaAJ0mYkS2mWIoffoIuWZGw67BxeaQoCQ=; b=iDCZcKO/eu5FQsPC7GzUOhthRJgrgkIYcsapHp7FbZXF7D+i6DKNqxu7aTLFbn+kAr 2+Ra7sUyQfZ/I7WSxIwXq42P8faDeT8Wd8AKD48GqM3Ar9IsOlpQTqyXHLs/NYdmh10J to0LTr3Ag2bhWmlUOlPfoZyMrwm977BUtChj1h74+Z+aaQUpWapMRs6fmAUvAoJq/4BG fobGxN3qPo3wXC0+8pPB3hTftPk+/gyJxmwkaGdMJlE6v7a/0zAa2c29x75xLI4QwC7G olg6GNkygIAOKe5+1UHiK3crJXqmZyNY6U4nOXb8TqwpZWeAk44Q62reJjCvQyPC/MJC M5Ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726385567; x=1726990367; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+LRKNnH7/dIaAJ0mYkS2mWIoffoIuWZGw67BxeaQoCQ=; b=TToYMSDOZwElIChMBs9AR3zprz9rrQGMFzhJEmhbheXzBt87XHoksVBPAjHiUlS5VX niOFyhytmDf2W4ouwpOoEbHBn22ZVk9Ht/ZSoHDdQjYwvRYQsDh1ljolRRptF7390uo7 TUeCve2LkkagKfn/UnVaanbbGoEj25mKHs9/JiScorGekWyz9aUyTUpyTIaRH/9W5fqj WF0xrPbFB5Qa2jPUaFch7hHDbiZVmt5Q4JbHv8Wq/Z6WJJH/dudSyrERsE9pZidS4QPf Xi30o54WY+tKCETy1AkztGzJvfpvD60lKUoCY+DMiPA3yBvx9poKNhrDTS7h65aJ3uFf S8xA== X-Gm-Message-State: AOJu0Yy5EgNCWYMRG+w5alzo1SAl+EDAZg/yezT3N4EVzjahmg0mINF0 AEsYBGMD8SL/9yb3k0x1zSm5FG6hoLznwTXVOTaQ79xzM55ol/u1HXuUTWzfdnoxN3+LmA3EsCK 0cX/4w+6SB+J1DS8v28OAaJ9H9S8= X-Google-Smtp-Source: AGHT+IHADfoUUoea2mk8qlqsQCZZ1zE9QABD4a3RrR/iFhOY5BMAXZGkpJVQTjsS+M3SmKyNqempUl3StLXABEULFLE= X-Received: by 2002:a05:651c:b0f:b0:2f7:5914:c22e with SMTP id 38308e7fff4ca-2f7918e09e0mr38635491fa.6.1726385566050; Sun, 15 Sep 2024 00:32:46 -0700 (PDT) In-Reply-To: <86jzfde8o1.fsf@gnu.org> X-Mailman-Approved-At: Sun, 15 Sep 2024 06:10:26 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:291840 Archived-At: > > By the way, why didn't you include the option to use > > w32image-create-thumbnail in image-dired-cmd-create-thumbnail-program? > > In other words, wouldn't it have been okay to define it like this: > > > > (defcustom image-dired-cmd-create-thumbnail-program > > (cond > > ((executable-find "gm") "gm") > > ((and (not (image-dired--probe-thumbnail-cmd "convert")) > > (fboundp 'w32image-create-thumbnail)) > > 'built-in-function) > > (t "convert")) > > "..." > > :type (if (fboundp 'w32image-create-thumbnail) > > '(choice (const built-in-function) file) > > 'file) > > :version "29.1") > > This causes trouble for run-time tests, because a defcustom is > evaluated only once, when the package is loaded by Emacs. What are the trouble for runtime tests? If this is implemented, obviously no check for the existence of the command will be performed at runtime. If necessary, the user can change the settings of the program that creates thumbnails by themselves (after installing ImageMagick or GraphicsMagick). In other words, first create thumbnails with the built-in function (w32image-create-thumbnail), and if a user is dissatisfied with them, they can install either ImageMagick or GraphicsMagick and specify the program they installed via M-x customize-variable image-dired-cmd-create-thumbnail-program. Isn't this the same for most other parts of Emacs? For example, if a user is dissatisfied with grep and installs ripgrep, they will have to manually change grep-command themselves. Isn't it the same? Why does Emacs automatically determine the thumbnail creation method without the user's permission? > > This way, even if convert is installed, users who want to try the > > w32image-create-thumbnail function can explicitly select it. > > I didn't expect users who have ImageMagick installed to want to use > w32image-create-thumbnail. If we hear enough requests for that, we > might need to reconsider. If the quality of ImageMagick is bad as you say, the convert command may have a bug that makes it impossible to convert some images. Also, if w32image-create-thumbnail is improved in the future (at least if the aspect ratio and rotation are resolved), people will want to use it. It seems that w32image-create-thumbnail is faster in many cases. To be honest, I don't understand why you want to prioritize the even more legacy command of ImageMagick, which you dislike. > > > > > I'm open to ideas. ("Queue length is 0" would mean you don't test > > > > > when a new image directory is visited, right? > > > > > > > > This is incorrect. The "queue" being referred to here is the > > > > image-dired-queue. In other words, while there are pending conversion > > > > jobs, no checks are made, but once the conversion jobs are cleared, > > > > the check is performed the next time a conversion job is added. > > > > > > The scenario I had in mind was that the user installs ImageMagick, > > > then visits a directory with images. In this case, the queue will not > > > be empty, so Emacs would not check for the availability of 'convert', > > > which is not what the user will expect. > > > > Sorry, I don't quite understand this. So you start Emacs, then install > > ImageMagick, then go to the directory with the images and run M-x > > image-dired, etc.? Of course the queue is empty at first. > > No, not AFAIU, because the moment you invoke image-dired, it starts > thumbnail creation. So by the time you get to the test, the queue > is already not empty. Ah, sorry. That was a mistake on my part. The queue is definitely not empty when queue-run is first called. Checking whether the queue is empty would be meaningless unless it is done before the first job is added to the queue. Or I need to use the approach you showed. > Maybe we should simply have a command to check whether an external > tool is installed, and then thumbnail creation will use the results > of that check. The variable that holds the result of the check > could be initialized to 'unknown, in which case the first thumbnail > creation will perform the check and set the variable to either nil > or t. This will probably be simpler, although it will now be up to > the user to invoke the command manually if ImageMagick is installed > while an Emacs sessions runs. So when the queue is empty, just after the last of the series of thumbnails has been created, we set it back to 'unknown.