GNU bug report logs - #61639
30.0.50; [PATCH] Do not error out on non image file in image-dired

Previous Next

Package: emacs;

Reported by: Manuel Giraud <manuel <at> ledu-giraud.fr>

Date: Sun, 19 Feb 2023 20:10:02 UTC

Severity: normal

Tags: patch

Found in version 30.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Manuel Giraud <manuel <at> ledu-giraud.fr>
Cc: 61639 <at> debbugs.gnu.org
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
> From: Manuel Giraud <manuel <at> ledu-giraud.fr>
> Cc: 61639 <at> debbugs.gnu.org
> Date: Mon, 20 Feb 2023 15:13:37 +0100
> 
> Eli Zaretskii <eliz <at> gnu.org> 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.




This bug report was last modified 2 years and 150 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.