diff options
author | Basil L. Contovounesios <contovob@tcd.ie> | 2021-01-17 15:53:53 +0000 |
---|---|---|
committer | Basil L. Contovounesios <contovob@tcd.ie> | 2021-01-18 17:58:42 +0000 |
commit | 8f4b3b812aab62a5a205bc2f8690c3b4c460ba09 (patch) | |
tree | 7ac73d2a4aa5718a11541551d3bde1e9ba89c6e3 /lisp/ibuffer.el | |
parent | bdb9889f784dc6113a74c259a53cf0623e49ab2d (diff) | |
download | emacs-8f4b3b812aab62a5a205bc2f8690c3b4c460ba09.tar.gz emacs-8f4b3b812aab62a5a205bc2f8690c3b4c460ba09.tar.bz2 emacs-8f4b3b812aab62a5a205bc2f8690c3b4c460ba09.zip |
Fix ibuffer-mark-by-file-name-regexp abbreviations
* lisp/ibuffer.el (ibuffer--abbreviate-file-name): New function.
(filename): Use it.
* lisp/ibuf-ext.el (ibuffer-mark-by-file-name-regexp): Prefer
read-regexp over read-string for reading regexps. Determine file
name using ibuffer-buffer-file-name for consistency. Abbreviate
file name using ibuffer-directory-abbrev-alist (bug#18859).
Diffstat (limited to 'lisp/ibuffer.el')
-rw-r--r-- | lisp/ibuffer.el | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index 4800e0243d7..84c53b16acf 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -1308,6 +1308,11 @@ a new window in the current frame, splitting vertically." (car dired-directory))))) (and dirname (expand-file-name dirname)))))) +(defun ibuffer--abbreviate-file-name (filename) + "Abbreviate FILENAME using `ibuffer-directory-abbrev-alist'." + (let ((directory-abbrev-alist ibuffer-directory-abbrev-alist)) + (abbreviate-file-name filename))) + (define-ibuffer-op ibuffer-do-save () "Save marked buffers as with `save-buffer'." (:complex t @@ -1885,9 +1890,7 @@ If point is on a group name, this function operates on that group." (cond ((zerop total) "No files") ((= 1 total) "1 file") (t (format "%d files" total)))))) - (let ((directory-abbrev-alist ibuffer-directory-abbrev-alist)) - (abbreviate-file-name - (or (ibuffer-buffer-file-name) "")))) + (ibuffer--abbreviate-file-name (or (ibuffer-buffer-file-name) ""))) (define-ibuffer-column filename-and-process (:name "Filename/Process" |