bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#61639: 30.0.50; [PATCH] Do not error out on non image file in image-


From: Eli Zaretskii
Subject: bug#61639: 30.0.50; [PATCH] Do not error out on non image file in image-dired
Date: Tue, 21 Feb 2023 14:01:34 +0200

> From: Manuel Giraud <manuel@ledu-giraud.fr>
> Cc: 61639@debbugs.gnu.org
> Date: Mon, 20 Feb 2023 17:41:35 +0100
> 
> Eli Zaretskii <eliz@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))))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]