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

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

bug#18859: 24.3; ibuffer-mark-by-file-name-regexp does not match display


From: Lars Ingebrigtsen
Subject: bug#18859: 24.3; ibuffer-mark-by-file-name-regexp does not match displayed name
Date: Sat, 03 Aug 2019 18:54:07 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Reuben Thomas <rrt@sc3d.org> writes:

> In the *IBuffer*, files in my home directory are displayed with names
> starting with ā€˜~ā€™, but when I type % f ~ RET I get no matches. If I type
> instead % f /home/MYUSER RET then all files in my home directory are
> matched.
>
> Iā€™m not convinced that the matches should be made in the second case,
> even; but certainly they _should_ be made in the first.

The following patch fixes this by matching on the abbreviated file name
(which is what ibuffer uses to create the displayed file name).

But I guess this could be a controversial change -- does anybody have an
objection to making this change?  

diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el
index 1b69574a39..06a2248d40 100644
--- a/lisp/ibuf-ext.el
+++ b/lisp/ibuf-ext.el
@@ -1846,7 +1846,8 @@ ibuffer-mark-by-file-name-regexp
                          (stringp dired-directory)
                          dired-directory)))))
         (when name
-          (string-match regexp name))))))
+           ;; Match on the displayed file name (which is abbreviated).
+          (string-match regexp (abbreviate-file-name name)))))))
 
 ;;;###autoload
 (defun ibuffer-mark-by-content-regexp (regexp &optional all-buffers)


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

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