From: Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 61639@debbugs.gnu.org
Subject: bug#61639: 30.0.50; [PATCH] Do not error out on non image file in image-dired
Date: Tue, 21 Feb 2023 15:23:01 +0100 [thread overview]
Message-ID: <87mt57kshm.fsf@ledu-giraud.fr> (raw)
In-Reply-To: <83cz63tbkf.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 21 Feb 2023 15:03:44 +0200")
[-- Attachment #1: Type: text/plain, Size: 695 bytes --]
Eli Zaretskii <eliz@gnu.org> writes:
[...]
>> 'plusp' is a classic Common Lisp predicate (that also seems to be
>> defined in Emacs). It is equivalent to (> x 0)… maybe you prefer that.
>> Should I fix my patch?
>
> Where is it defined? It isn't defined in "emacs -Q", and not after
> loading image-dired. (Tested in Emacs 29.)
C-h f gives me this:
--8<---------------cut here---------------start------------->8---
plusp is an alias for ‘cl-plusp’ in ‘cl.el’.
This function is obsolete since 27.1; use ‘cl-plusp’ instead.
--8<---------------cut here---------------end--------------->8---
… anyway here is an updated version of the patch to avoid this.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Do-not-error-out-on-non-image-file-bug-61639.patch --]
[-- Type: text/x-patch, Size: 1503 bytes --]
From e9b6f649a97800fcc045b52a63556d25ca4b472c Mon Sep 17 00:00:00 2001
From: Manuel Giraud <manuel@ledu-giraud.fr>
Date: Sun, 19 Feb 2023 21:03:57 +0100
Subject: [PATCH] Do not error out on non image file (bug#61639)
* lisp/image/image-dired.el
(image-dired-display-thumbs): Do not insert non image file and do not
display image-dired buffer if it is empty.
---
lisp/image/image-dired.el | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el
index cfcd1851188..20697b3c9e0 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 (> image-dired--number-of-thumbnails 0)
+ (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))))
--
2.39.1
[-- Attachment #3: Type: text/plain, Size: 18 bytes --]
--
Manuel Giraud
next prev parent reply other threads:[~2023-02-21 14:23 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-19 20:09 bug#61639: 30.0.50; [PATCH] Do not error out on non image file in image-dired Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-20 12:49 ` Eli Zaretskii
2023-02-20 13:35 ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-20 13:46 ` Eli Zaretskii
2023-02-20 14:13 ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-20 14:45 ` Eli Zaretskii
2023-02-20 16:41 ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-21 12:01 ` Eli Zaretskii
2023-02-21 12:16 ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-21 13:03 ` Eli Zaretskii
2023-02-21 14:23 ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-02-22 13:22 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87mt57kshm.fsf@ledu-giraud.fr \
--to=bug-gnu-emacs@gnu.org \
--cc=61639@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=manuel@ledu-giraud.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.