GNU bug report logs -
#61639
30.0.50; [PATCH] Do not error out on non image file in image-dired
Previous Next
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: Manuel Giraud <manuel <at> ledu-giraud.fr>
> Cc: 61639 <at> debbugs.gnu.org
> Date: Mon, 20 Feb 2023 17:41:35 +0100
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> > 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.
>
> Ok. Here is a new version of the patch that address those issues. I
> choose to not alert the user.
Thanks. This LGTM, but what is 'plusp'?
> diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el
> index cfcd1851188..5798af77f35 100644
> --- a/lisp/image/image-dired.el
> +++ b/lisp/image/image-dired.el
> @@ -586,13 +586,15 @@ image-dired-display-thumbs
> (erase-buffer))
> (goto-char (point-max)))
> (dolist (file files)
> - (let ((thumb (image-dired--get-create-thumbnail-file file)))
> + (when (string-match-p (image-dired--file-name-regexp) file)
> (image-dired-insert-thumbnail
> - thumb file dired-buf
> + (image-dired--get-create-thumbnail-file file) file dired-buf
> (cl-incf image-dired--number-of-thumbnails)))))
> - (if do-not-pop
> - (display-buffer buf)
> - (pop-to-buffer buf))
> + (if (plusp image-dired--number-of-thumbnails) <<<<<<<<<<<<<<<<<<<<<<
> + (if do-not-pop
> + (display-buffer buf)
> + (pop-to-buffer buf))
> + (message "No images selected"))
> (image-dired--line-up-with-method)
> (image-dired--update-header-line))))
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.