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

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

bug#68637: 30.0.50; image-dired-mark-tagged-files and ls -F


From: Manuel Giraud
Subject: bug#68637: 30.0.50; image-dired-mark-tagged-files and ls -F
Date: Sun, 21 Jan 2024 22:44:28 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

"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 via email to

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