all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 68637@debbugs.gnu.org
Cc: contovob@tcd.ie, stefankangas@gmail.com
Subject: bug#68637: 30.0.50; image-dired-mark-tagged-files and ls -F
Date: Sun, 21 Jan 2024 22:44:28 +0100	[thread overview]
Message-ID: <87a5oywedf.fsf@ledu-giraud.fr> (raw)
In-Reply-To: <87mssyak4w.fsf@epfl.ch> (Basil L. Contovounesios's message of "Sun, 21 Jan 2024 14:30:55 +0100")

"Basil L. Contovounesios" via "Bug reports for GNU Emacs, the Swiss army
knife of text editors" <bug-gnu-emacs@gnu.org> writes:

[...]

> At first glance it looks like the
>
>   (search-forward-regexp (format "\\s %s$" curr-file) nil t)
>
> in image-dired-mark-tagged-files doesn't take into account any of the
> indicators that 'ls -F' may append to file names.

Thanks for this insight.  The following patch seems to do the trick.  I
think we can limit ourselves to executable and symlink since I can't see
how directories, pipes, sockets or doors(?) could be regular image
files.

diff --git a/lisp/image/image-dired-dired.el b/lisp/image/image-dired-dired.el
index f4778d8e121..7219a106ca8 100644
--- a/lisp/image/image-dired-dired.el
+++ b/lisp/image/image-dired-dired.el
@@ -383,7 +383,7 @@ image-dired-mark-tagged-files
                       (file-name-directory curr-file)))
         (setq curr-file (file-name-nondirectory curr-file))
         (goto-char (point-min))
-        (when (search-forward-regexp (format "\\s %s$" curr-file) nil t)
+        (when (search-forward-regexp (format "\\s %s[*@]?$" curr-file) nil t)
           (setq hits (+ hits 1))
           (dired-mark 1))))
     (message "%d files with matching tag marked" hits)))

> The commentary suggests using dired-mark-files-regexp would be too slow.
> I wonder if that's still the case, or if there are any faster
> alternatives without loss of generality?

I did not try this alternative.
-- 
Manuel Giraud





  reply	other threads:[~2024-01-21 21:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-21 13:30 bug#68637: 30.0.50; image-dired-mark-tagged-files and ls -F Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-21 21:44 ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-01-23  9:51   ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-27 10:35     ` Eli Zaretskii
2024-01-27 16:25       ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-27 18:45         ` 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=87a5oywedf.fsf@ledu-giraud.fr \
    --to=bug-gnu-emacs@gnu.org \
    --cc=68637@debbugs.gnu.org \
    --cc=contovob@tcd.ie \
    --cc=manuel@ledu-giraud.fr \
    --cc=stefankangas@gmail.com \
    /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.