From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#61639: 30.0.50; [PATCH] Do not error out on non image file in image-dired Date: Mon, 20 Feb 2023 16:45:04 +0200 Message-ID: <83a618v1jj.fsf@gnu.org> References: <87sff1quwk.fsf@ledu-giraud.fr> <83sff0v6wz.fsf@gnu.org> <87ttzgtq6p.fsf@ledu-giraud.fr> <83edqkv48n.fsf@gnu.org> <87k00ctofi.fsf@ledu-giraud.fr> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26193"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 61639@debbugs.gnu.org To: Manuel Giraud Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 20 15:46:20 2023 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 1pU7Qq-0006eT-0z for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 20 Feb 2023 15:46:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pU7Qb-0004of-9L; Mon, 20 Feb 2023 09:46:05 -0500 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 1pU7QY-0004np-Vl for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2023 09:46:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pU7QY-0003IG-GU for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2023 09:46:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pU7QY-0007Ej-C0 for bug-gnu-emacs@gnu.org; Mon, 20 Feb 2023 09:46:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 20 Feb 2023 14:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61639 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 61639-submit@debbugs.gnu.org id=B61639.167690430527742 (code B ref 61639); Mon, 20 Feb 2023 14:46:02 +0000 Original-Received: (at 61639) by debbugs.gnu.org; 20 Feb 2023 14:45:05 +0000 Original-Received: from localhost ([127.0.0.1]:51144 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pU7Pd-0007DO-4p for submit@debbugs.gnu.org; Mon, 20 Feb 2023 09:45:05 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:36652) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pU7Pa-0007Ca-Jx for 61639@debbugs.gnu.org; Mon, 20 Feb 2023 09:45:03 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pU7PU-0002q8-NO; Mon, 20 Feb 2023 09:44:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=x+MYMOSEr2l5pduTZiX9fAcCDB9Hv8r5H3mG0pQo/oA=; b=ry6Zn4iaYl+5 jYvfPnTmwcGMTbv4u4k30VytCA7EG9vwsXk6t3CKFW5fzIXrdHshFjd8spygFFioCzSnVr+tqAo2x Mdmax8zatv3lgg7W9eoV6HlKmN3dteccmL9etyksBeYgQyPtuYazPbsxO6NI1RsYXHadKlShFRdHi YEvezYpdINvsolJscdmyaMcPn94q4hW0BvHJnbGajR+eOthHM9YBjCuUELRbJ97xIRODpXmg3Su2A ONE/Ms+ZFBrMGXZrZLdlR2loNN+h3B+DI2miUdNWppPx2dHUssFwmIfdzKvXjl5YH/2JO2pVNaXzE Ox2/85alwk/Xfj+oo7uEaw==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pU7PT-0003QC-DU; Mon, 20 Feb 2023 09:44:56 -0500 In-Reply-To: <87k00ctofi.fsf@ledu-giraud.fr> (message from Manuel Giraud on Mon, 20 Feb 2023 15:13:37 +0100) 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:256187 Archived-At: > From: Manuel Giraud > Cc: 61639@debbugs.gnu.org > Date: Mon, 20 Feb 2023 15:13:37 +0100 > > Eli Zaretskii writes: > > > So maybe "C-t d" should filter the selected "images" before it calls > > the function which errors out? > > That is what `image-dired-show-all-from-dir' is doing: it selects files > from the given directory with the correct "image files" regexp and so no > non image will be present. > > So your idea is to keep `image-dired--get-create-thumbnail-file' as is > and filter its input in `image-dired-display-thumbs'? But then we won't > get any message or error that something was not an image (this could go > unnoticed as well ;-) I don't necessarily see a reason to alert the user in this case, but if you think we had better done that, we could show a message when we find a non-image file in the list of the selected ones. > > IOW, if the application doesn't want an API to fail for reasons > > specific to the application, the onus of avoiding the error is on the > > application, no? > > Yes, but maybe `image-dired--get-create-thumbnail-file' is not really an > established API. It is called twice in Emacs (and the other place it is > called non images are already filtered out). > > Do you think it could have been used in third-party package? That's not what bothers me. What bothers me is that we burden a low-level API with considerations whose source is the application.