unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#18859: 24.3; ibuffer-mark-by-file-name-regexp does not match displayed name
@ 2014-10-27 21:19 Reuben Thomas
  2019-08-03 16:54 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 7+ messages in thread
From: Reuben Thomas @ 2014-10-27 21:19 UTC (permalink / raw)
  To: 18859

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.


In GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.10.7)
 of 2014-03-07 on lamiak, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.11600000
System Description:	Ubuntu 14.04.1 LTS

Configured using:
 `configure '--build' 'x86_64-linux-gnu' '--build' 'x86_64-linux-gnu'
 '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib'
 '--localstatedir=/var/lib' '--infodir=/usr/share/info'
 '--mandir=/usr/share/man' '--with-pop=yes'
 '--enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.3/site-lisp:/usr/share/emacs/site-lisp'
 '--with-crt-dir=/usr/lib/x86_64-linux-gnu' '--with-x=yes'
 '--with-x-toolkit=gtk3' '--with-toolkit-scroll-bars'
 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -fstack-protector
 --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall'
 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro'
 'CPPFLAGS=-D_FORTIFY_SOURCE=2''

Important settings:
  value of $LC_MONETARY: en_GB.UTF-8
  value of $LC_NUMERIC: en_GB.UTF-8
  value of $LC_TIME: en_GB.UTF-8
  value of $LANG: en_GB.UTF-8
  value of $XMODIFIERS: @im=local
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Ibuffer

Minor modes in effect:
  server-mode: t
  savehist-mode: t
  minibuffer-electric-default-mode: t
  icomplete-mode: t
  global-auto-revert-mode: t
  desktop-save-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  global-whitespace-mode: t
  TeX-PDF-mode: t
  TeX-source-correlate-mode: t
  dtrt-indent-mode: t
  global-auto-complete-mode: t
  ido-everywhere: t
  shell-dirtrack-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
C-x C-b % f ~ / r e p o / <return> % f ~ / r e p o 
<return> % f / m e t a p o l a t o r - r r t h o m 
a s <return> D y C-n C-n C-n C-n C-n C-n C-n C-n C-n 
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n 
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n 
C-n C-n C-n C-n C-n C-n C-n C-p C-p C-p C-p C-p C-p 
C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p 
C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p 
C-p C-n % f \ ~ / r e p o <return> % f | <return> % 
f ~ <return> C-s ~ C-a C-p % f [ ~ ] <return> C-h m 
C-s % C-a q C-a <up> <up> <up> <up> <up> <up> <up> 
<up> <up> <up> <up> <down> <down> <down> <down> <down> 
C-h k % f C-n C-e C-b C-b C-b C-b C-b C-b C-b C-b C-b 
C-b <return> <down> <down> <down> <down> <down> <down> 
<down> <down> <down> <down> <down> <down> <down> <up> 
<up> <down> <right> <right> <right> <right> <right> 
<right> <right> <right> q C-g C-g C-g C-a C-p C-p C-p 
C-p C-p C-p C-x k <return> % f / h o m e / r r t / 
r e p o <return> D y M-x r e p o r t - e m a c s - 
b u f g <backspace> <backspace> g <return>

Recent messages:
Mark saved where search started
line-move-visual: Beginning of buffer [9 times]
Type "q" to restore previous buffer.
uncompressing ibuf-ext.el.gz...done
Note: file is write protected
call-interactively: Buffer is read-only: #<buffer ibuf-ext.el.gz>
Quit [3 times]
Marked 12 buffers
Really kill 12 buffers? (y or n)  y
Operation finished; killed 12 buffers

Load-path shadows:
/home/rrt/.emacs.d/el-get/org-mode/.dir-locals hides /home/rrt/.emacs.d/el-get/ess/.dir-locals
/home/rrt/.emacs.d/el-get/org-mode/.dir-locals hides /home/rrt/.emacs.d/el-get/el-get/.dir-locals
/home/rrt/.emacs.d/el-get/dictionary/lpath hides /home/rrt/.emacs.d/el-get/auctex/lpath
/home/rrt/.emacs.d/el-get/ess/lisp/ess-xls-d hides /usr/share/emacs24/site-lisp/ess/ess-xls-d
/home/rrt/.emacs.d/el-get/ess/lisp/ess-mouse hides /usr/share/emacs24/site-lisp/ess/ess-mouse
/home/rrt/.emacs.d/el-get/ess/lisp/ess-noweb hides /usr/share/emacs24/site-lisp/ess/ess-noweb
/home/rrt/.emacs.d/el-get/ess/lisp/ess-sp5-d hides /usr/share/emacs24/site-lisp/ess/ess-sp5-d
/home/rrt/.emacs.d/el-get/ess/lisp/ess-sta-l hides /usr/share/emacs24/site-lisp/ess/ess-sta-l
/home/rrt/.emacs.d/el-get/ess/lisp/ess-comp hides /usr/share/emacs24/site-lisp/ess/ess-comp
/home/rrt/.emacs.d/el-get/ess/lisp/ess-compat hides /usr/share/emacs24/site-lisp/ess/ess-compat
/home/rrt/.emacs.d/el-get/ess/lisp/ess-toolbar hides /usr/share/emacs24/site-lisp/ess/ess-toolbar
/home/rrt/.emacs.d/el-get/ess/lisp/ess-arc-d hides /usr/share/emacs24/site-lisp/ess/ess-arc-d
/home/rrt/.emacs.d/el-get/ess/lisp/ess hides /usr/share/emacs24/site-lisp/ess/ess
/home/rrt/.emacs.d/el-get/ess/lisp/ess-dde hides /usr/share/emacs24/site-lisp/ess/ess-dde
/home/rrt/.emacs.d/el-get/ess/lisp/ess-lsp-l hides /usr/share/emacs24/site-lisp/ess/ess-lsp-l
/home/rrt/.emacs.d/el-get/ess/lisp/ess-r-gui hides /usr/share/emacs24/site-lisp/ess/ess-r-gui
/home/rrt/.emacs.d/el-get/ess/lisp/ess-install hides /usr/share/emacs24/site-lisp/ess/ess-install
/home/rrt/.emacs.d/el-get/ess/lisp/ess-sas-l hides /usr/share/emacs24/site-lisp/ess/ess-sas-l
/home/rrt/.emacs.d/el-get/ess/lisp/ess-utils hides /usr/share/emacs24/site-lisp/ess/ess-utils
/home/rrt/.emacs.d/el-get/ess/lisp/ess-rdired hides /usr/share/emacs24/site-lisp/ess/ess-rdired
/home/rrt/.emacs.d/el-get/ess/lisp/ess-sas-a hides /usr/share/emacs24/site-lisp/ess/ess-sas-a
/home/rrt/.emacs.d/el-get/ess/lisp/msdos hides /usr/share/emacs24/site-lisp/ess/msdos
/home/rrt/.emacs.d/el-get/ess/lisp/ess-font-lock hides /usr/share/emacs24/site-lisp/ess/ess-font-lock
/home/rrt/.emacs.d/el-get/ess/lisp/ess-jags-d hides /usr/share/emacs24/site-lisp/ess/ess-jags-d
/home/rrt/.emacs.d/el-get/ess/lisp/make-regexp hides /usr/share/emacs24/site-lisp/ess/make-regexp
/home/rrt/.emacs.d/el-get/ess/lisp/ess-gretl hides /usr/share/emacs24/site-lisp/ess/ess-gretl
/home/rrt/.emacs.d/el-get/ess/lisp/ess-sta-d hides /usr/share/emacs24/site-lisp/ess/ess-sta-d
/home/rrt/.emacs.d/el-get/ess/lisp/ess-s4-d hides /usr/share/emacs24/site-lisp/ess/ess-s4-d
/home/rrt/.emacs.d/el-get/ess/lisp/ess-trns hides /usr/share/emacs24/site-lisp/ess/ess-trns
/home/rrt/.emacs.d/el-get/ess/lisp/ess-custom hides /usr/share/emacs24/site-lisp/ess/ess-custom
/home/rrt/.emacs.d/el-get/ess/lisp/ess-mode hides /usr/share/emacs24/site-lisp/ess/ess-mode
/home/rrt/.emacs.d/el-get/ess/lisp/ess-noweb-mode hides /usr/share/emacs24/site-lisp/ess/ess-noweb-mode
/home/rrt/.emacs.d/el-get/ess/lisp/ess-roxy hides /usr/share/emacs24/site-lisp/ess/ess-roxy
/home/rrt/.emacs.d/el-get/ess/lisp/ess-debug hides /usr/share/emacs24/site-lisp/ess/ess-debug
/home/rrt/.emacs.d/el-get/ess/lisp/ess-rd hides /usr/share/emacs24/site-lisp/ess/ess-rd
/home/rrt/.emacs.d/el-get/ess/lisp/ess-sas-d hides /usr/share/emacs24/site-lisp/ess/ess-sas-d
/home/rrt/.emacs.d/el-get/ess/lisp/ess-menu hides /usr/share/emacs24/site-lisp/ess/ess-menu
/home/rrt/.emacs.d/el-get/ess/lisp/ess-r-args hides /usr/share/emacs24/site-lisp/ess/ess-r-args
/home/rrt/.emacs.d/el-get/ess/lisp/ess-sp3-d hides /usr/share/emacs24/site-lisp/ess/ess-sp3-d
/home/rrt/.emacs.d/el-get/ess/lisp/ess-omg-d hides /usr/share/emacs24/site-lisp/ess/ess-omg-d
/home/rrt/.emacs.d/el-get/ess/lisp/ess-vst-d hides /usr/share/emacs24/site-lisp/ess/ess-vst-d
/home/rrt/.emacs.d/el-get/ess/lisp/ess-sp6-d hides /usr/share/emacs24/site-lisp/ess/ess-sp6-d
/home/rrt/.emacs.d/el-get/ess/lisp/ess-s3-d hides /usr/share/emacs24/site-lisp/ess/ess-s3-d
/home/rrt/.emacs.d/el-get/ess/lisp/ess-swv hides /usr/share/emacs24/site-lisp/ess/ess-swv
/home/rrt/.emacs.d/el-get/ess/lisp/mouseme hides /usr/share/emacs24/site-lisp/ess/mouseme
/home/rrt/.emacs.d/el-get/ess/lisp/ess-inf hides /usr/share/emacs24/site-lisp/ess/ess-inf
/home/rrt/.emacs.d/el-get/ess/lisp/ess-sp4-d hides /usr/share/emacs24/site-lisp/ess/ess-sp4-d
/home/rrt/.emacs.d/el-get/ess/lisp/ess-help hides /usr/share/emacs24/site-lisp/ess/ess-help
/home/rrt/.emacs.d/el-get/ess/lisp/ess-r-d hides /usr/share/emacs24/site-lisp/ess/ess-r-d
/home/rrt/.emacs.d/el-get/ess/lisp/ess-developer hides /usr/share/emacs24/site-lisp/ess/ess-developer
/home/rrt/.emacs.d/el-get/ess/lisp/ess-s-l hides /usr/share/emacs24/site-lisp/ess/ess-s-l
/home/rrt/.emacs.d/el-get/ess/lisp/ess-sp6w-d hides /usr/share/emacs24/site-lisp/ess/ess-sp6w-d
/home/rrt/.emacs.d/el-get/ess/lisp/ess-omg-l hides /usr/share/emacs24/site-lisp/ess/ess-omg-l
/home/rrt/.emacs.d/el-get/ess/lisp/ess-tracebug hides /usr/share/emacs24/site-lisp/ess/ess-tracebug
/home/rrt/.emacs.d/el-get/ess/lisp/ess-r-a hides /usr/share/emacs24/site-lisp/ess/ess-r-a
/home/rrt/.emacs.d/el-get/ess/lisp/ess-noweb-font-lock-mode hides /usr/share/emacs24/site-lisp/ess/ess-noweb-font-lock-mode
/home/rrt/.emacs.d/el-get/ess/lisp/ess-send2 hides /usr/share/emacs24/site-lisp/ess/ess-send2
/home/rrt/.emacs.d/el-get/ess/lisp/ess-rutils hides /usr/share/emacs24/site-lisp/ess/ess-rutils
/home/rrt/.emacs.d/el-get/ess/lisp/ess-site hides /usr/share/emacs24/site-lisp/ess/ess-site
/home/rrt/.emacs.d/el-get/ess/lisp/ess-send hides /usr/share/emacs24/site-lisp/ess/ess-send
/home/rrt/.emacs.d/el-get/ess/lisp/essd-els hides /usr/share/emacs24/site-lisp/ess/essd-els
/home/rrt/.emacs.d/el-get/ess/lisp/ess-bugs-l hides /usr/share/emacs24/site-lisp/ess/ess-bugs-l
/home/rrt/.emacs.d/el-get/ess/lisp/ess-eldoc hides /usr/share/emacs24/site-lisp/ess/ess-eldoc
/home/rrt/.emacs.d/el-get/ess/lisp/ess-bugs-d hides /usr/share/emacs24/site-lisp/ess/ess-bugs-d
/home/rrt/.emacs.d/el-get/ess/lisp/ess-julia hides /usr/share/emacs24/site-lisp/ess/ess-julia
/home/rrt/.emacs.d/el-get/apache-mode/apache-mode hides /usr/share/emacs24/site-lisp/emacs-goodies-el/apache-mode
/home/rrt/.emacs.d/el-get/org-mode/contrib/lisp/htmlize hides /usr/share/emacs24/site-lisp/emacs-goodies-el/htmlize
/home/rrt/.emacs.d/el-get/quack/quack hides /usr/share/emacs24/site-lisp/emacs-goodies-el/quack
/home/rrt/.emacs.d/elpa/csv-mode-1.2/csv-mode hides /usr/share/emacs24/site-lisp/emacs-goodies-el/csv-mode
/home/rrt/.emacs.d/el-get/graphviz-dot-mode/graphviz-dot-mode hides /usr/share/emacs24/site-lisp/emacs-goodies-el/graphviz-dot-mode
/home/rrt/.emacs.d/el-get/browse-kill-ring/browse-kill-ring hides /usr/share/emacs24/site-lisp/emacs-goodies-el/browse-kill-ring
/home/rrt/.emacs.d/el-get/filladapt/filladapt hides /usr/share/emacs24/site-lisp/emacs-goodies-el/filladapt
/home/rrt/.emacs.d/el-get/xrdb-mode/xrdb-mode hides /usr/share/emacs24/site-lisp/emacs-goodies-el/xrdb-mode
/home/rrt/.emacs.d/el-get/markdown-mode/markdown-mode hides /usr/share/emacs24/site-lisp/emacs-goodies-el/markdown-mode
/home/rrt/.emacs.d/el-get/cmake-mode/cmake-mode hides /usr/share/emacs/site-lisp/cmake-mode
/home/rrt/.local/share/emacs/site-lisp/lilypond-font-lock hides /usr/share/emacs/site-lisp/lilypond-font-lock
/home/rrt/.local/share/emacs/site-lisp/lilypond-mode hides /usr/share/emacs/site-lisp/lilypond-mode
/home/rrt/.local/share/emacs/site-lisp/lilypond-init hides /usr/share/emacs/site-lisp/lilypond-init
/usr/share/emacs/24.3/site-lisp/cdargs hides /usr/share/emacs/site-lisp/cdargs
/home/rrt/.local/share/emacs/site-lisp/lilypond-indent hides /usr/share/emacs/site-lisp/lilypond-indent
/usr/share/emacs/24.3/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup
/home/rrt/.local/share/emacs/site-lisp/lilypond-song hides /usr/share/emacs/site-lisp/lilypond-song
/home/rrt/.local/share/emacs/site-lisp/lilypond-what-beat hides /usr/share/emacs/site-lisp/lilypond-what-beat
/home/rrt/.local/share/emacs/site-lisp/whitespace hides /usr/share/emacs/24.3/lisp/whitespace
/usr/share/emacs/site-lisp/rst hides /usr/share/emacs/24.3/lisp/textmodes/rst
/usr/share/emacs24/site-lisp/dictionaries-common/flyspell hides /usr/share/emacs/24.3/lisp/textmodes/flyspell
/usr/share/emacs24/site-lisp/dictionaries-common/ispell hides /usr/share/emacs/24.3/lisp/textmodes/ispell
/home/rrt/.emacs.d/el-get/cperl-mode/cperl-mode hides /usr/share/emacs/24.3/lisp/progmodes/cperl-mode
/home/rrt/.emacs.d/el-get/flymake/flymake hides /usr/share/emacs/24.3/lisp/progmodes/flymake
/home/rrt/.emacs.d/el-get/org-mode/.dir-locals hides /usr/share/emacs/24.3/lisp/gnus/.dir-locals

Features:
(shadow sort mail-extr emacsbug message rfc822 mml mml-sec mm-decode
mm-bodies mm-encode mailabbrev gmm-utils mailheader sendmail mail-utils
mule-util tabify jka-compr misearch multi-isearch ibuf-ext ibuffer
json-mode json-reformat json-snatcher rx js css-mode paredit autoconf
autoconf-mode make-mode tern url-http tls url-auth mail-parse rfc2231
rfc2047 rfc2045 ietf-drums url-gw json js3-mode imenu js3-parse
js3-browse js3-highlight js3-ast js3-messages js3-scan js3-util js3-vars
cc-langs js3-externs sh-script smie window-margin markdown-mode
ruby-mode vc-git flymake face-remap flyspell ispell goto-addr
smart-quotes cperl-mode csv-mode-autoloads dos-autoloads
eldoc-extension-autoloads perl-completion-autoloads vlf-autoloads
ff-paths uniquify paren server savehist minibuf-eldef icomplete
autorevert cus-start cus-load quack cmuscheme scheme iimage org
org-macro org-footnote org-pcomplete org-list org-faces org-entities
noutline outline org-version ob-emacs-lisp ob ob-tangle org-src ob-ref
ob-lob ob-table ob-keys ob-exp ob-comint ob-core ob-eval org-compat
org-macs find-func cal-menu calendar cal-loaddefs go-mode url url-proxy
url-privacy url-expand url-methods url-history url-cookie url-domsuf
mailcap ffap dired-x desktop undo-tree diff whitespace url-util
url-parse auth-source gnus-util mm-util mail-prsvr password-cache
url-vars tex dbus xml crm locate yasnippet derived po-mode php-mode
etags cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align
cc-engine speedbar sb-image ezimage dframe org-loaddefs init-paredit
ido-hacks magit-autoloads geiser-load geiser frame-restore flymake-point
filladapt dtrt-indent warnings init-eldoc eldoc-extension csv
auto-complete-config auto-complete edmacro kmacro popup preview-latex
tex-site auto-loads .loaddefs eieio byte-opt el-get el-get-autoloads
el-get-list-packages el-get-dependencies el-get-build el-get-status pp
el-get-methods el-get-fossil el-get-svn el-get-pacman el-get-github-zip
el-get-github-tar el-get-http-zip el-get-http-tar el-get-hg el-get-go
el-get-git-svn el-get-fink el-get-emacswiki el-get-http el-get-notify
help-mode el-get-emacsmirror el-get-github el-get-git el-get-elpa
package cl-macs gv el-get-darcs el-get-cvs el-get-bzr el-get-brew
el-get-builtin el-get-apt-get el-get-recipes el-get-byte-compile
el-get-custom el-get-core autoload bytecomp byte-compile cconv cl dired
user-site-loaddefs ido ess-toolbar ess-mouse mouseme thingatpt
browse-url ess-menu ess-swv ess-noweb ess-noweb-font-lock-mode
ess-bugs-l essd-els ess-sas-d ess-sas-l ess-sas-a shell pcomplete
ess-sta-d ess-sta-l cc-vars cc-defs make-regexp ess-sp6-d ess-sp3-d
ess-julia ess-r-d compile ess-tracebug format-spec ess-roxy advice
cl-lib advice-preload hideshow ess-help ess-developer ess-r-args eldoc
help-fns ess-s-l ess ess-inf comint ansi-color ring ess-mode
ess-noweb-mode ess-utils ess-custom executable easymenu ess-compat
ess-site emacs-goodies-el emacs-goodies-custom emacs-goodies-loaddefs
easy-mmode devhelp time-date tooltip ediff-hook vc-hooks lisp-float-type
mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list newcomment lisp-mode register page menu-bar rfn-eshadow
timer select scroll-bar mouse jit-lock font-lock syntax facemenu
font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan
thai tai-viet lao korean japanese hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
make-network-process dbusbind dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)

-- 
http://rrt.sc3d.org/





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#18859: 24.3; ibuffer-mark-by-file-name-regexp does not match displayed name
  2014-10-27 21:19 bug#18859: 24.3; ibuffer-mark-by-file-name-regexp does not match displayed name Reuben Thomas
@ 2019-08-03 16:54 ` Lars Ingebrigtsen
  2019-08-23  0:53   ` Lars Ingebrigtsen
  2021-01-17 16:06   ` Basil L. Contovounesios
  0 siblings, 2 replies; 7+ messages in thread
From: Lars Ingebrigtsen @ 2019-08-03 16:54 UTC (permalink / raw)
  To: Reuben Thomas; +Cc: 18859

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





^ permalink raw reply related	[flat|nested] 7+ messages in thread

* bug#18859: 24.3; ibuffer-mark-by-file-name-regexp does not match displayed name
  2019-08-03 16:54 ` Lars Ingebrigtsen
@ 2019-08-23  0:53   ` Lars Ingebrigtsen
  2021-01-17 16:06   ` Basil L. Contovounesios
  1 sibling, 0 replies; 7+ messages in thread
From: Lars Ingebrigtsen @ 2019-08-23  0:53 UTC (permalink / raw)
  To: Reuben Thomas; +Cc: 18859

Lars Ingebrigtsen <larsi@gnus.org> writes:

> 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?  

[...]

> -	   (string-match regexp name))))))
> +           ;; Match on the displayed file name (which is abbreviated).
> +	   (string-match regexp (abbreviate-file-name name)))))))

There weren't any objections over a two week period, so I've now applied
this patch.

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





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#18859: 24.3; ibuffer-mark-by-file-name-regexp does not match displayed name
  2019-08-03 16:54 ` Lars Ingebrigtsen
  2019-08-23  0:53   ` Lars Ingebrigtsen
@ 2021-01-17 16:06   ` Basil L. Contovounesios
  2021-01-17 16:32     ` Basil L. Contovounesios
  1 sibling, 1 reply; 7+ messages in thread
From: Basil L. Contovounesios @ 2021-01-17 16:06 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 18859, Reuben Thomas

[-- Attachment #1: Type: text/plain, Size: 1249 bytes --]

Lars Ingebrigtsen <larsi@gnus.org> writes:

> 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)))))))

Any objections to this followup fix for master?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-ibuffer-mark-by-file-name-regexp-abbreviations.patch --]
[-- Type: text/x-diff, Size: 1796 bytes --]

From 2a66de550d184728ca281d400538b0954728a69e Mon Sep 17 00:00:00 2001
From: "Basil L. Contovounesios" <contovob@tcd.ie>
Date: Sun, 17 Jan 2021 15:53:53 +0000
Subject: [PATCH] Fix ibuffer-mark-by-file-name-regexp abbreviations

* 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).
---
 lisp/ibuf-ext.el | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el
index 7be1b3d16c..53ccd7a96e 100644
--- a/lisp/ibuf-ext.el
+++ b/lisp/ibuf-ext.el
@@ -1823,18 +1823,14 @@ ibuffer-mark-by-mode-regexp
 ;;;###autoload
 (defun ibuffer-mark-by-file-name-regexp (regexp)
   "Mark all buffers whose file name matches REGEXP."
-  (interactive "sMark by file name (regexp): ")
+  (interactive (list (read-regexp "Mark by file name (regexp)")))
   (ibuffer-mark-on-buffer
-   #'(lambda (buf)
-       (let ((name (or (buffer-file-name buf)
-		       (with-current-buffer buf
-			 (and
-			  (boundp 'dired-directory)
-			  (stringp dired-directory)
-			  dired-directory)))))
-	 (when name
-           ;; Match on the displayed file name (which is abbreviated).
-	   (string-match regexp (abbreviate-file-name name)))))))
+   (lambda (buf)
+     (let ((name (with-current-buffer buf (ibuffer-buffer-file-name))))
+       (when name
+         ;; Match on the displayed file name (which is abbreviated).
+         (let ((directory-abbrev-alist ibuffer-directory-abbrev-alist))
+           (string-match-p regexp (abbreviate-file-name name))))))))
 
 ;;;###autoload
 (defun ibuffer-mark-by-content-regexp (regexp &optional all-buffers)
-- 
2.29.2


[-- Attachment #3: Type: text/plain, Size: 20 bytes --]


Thanks,

-- 
Basil

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* bug#18859: 24.3; ibuffer-mark-by-file-name-regexp does not match displayed name
  2021-01-17 16:06   ` Basil L. Contovounesios
@ 2021-01-17 16:32     ` Basil L. Contovounesios
  2021-01-18 16:39       ` Lars Ingebrigtsen
  0 siblings, 1 reply; 7+ messages in thread
From: Basil L. Contovounesios @ 2021-01-17 16:32 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 18859, Reuben Thomas

[-- Attachment #1: Type: text/plain, Size: 1394 bytes --]

"Basil L. Contovounesios" <contovob@tcd.ie> writes:

> Lars Ingebrigtsen <larsi@gnus.org> writes:
>
>> 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)))))))
>
> Any objections to this followup fix for master?

Or rather, the improved patch attached.

-- 
Basil


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-ibuffer-mark-by-file-name-regexp-abbreviations.patch --]
[-- Type: text/x-diff, Size: 2875 bytes --]

From 4cf9d4f2be9095b3fa77ef4a54929f0a47c986dc Mon Sep 17 00:00:00 2001
From: "Basil L. Contovounesios" <contovob@tcd.ie>
Date: Sun, 17 Jan 2021 15:53:53 +0000
Subject: [PATCH] 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).
---
 lisp/ibuf-ext.el | 17 ++++++-----------
 lisp/ibuffer.el  |  9 ++++++---
 2 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el
index 7be1b3d16c..a6523e10e4 100644
--- a/lisp/ibuf-ext.el
+++ b/lisp/ibuf-ext.el
@@ -1823,18 +1823,13 @@ ibuffer-mark-by-mode-regexp
 ;;;###autoload
 (defun ibuffer-mark-by-file-name-regexp (regexp)
   "Mark all buffers whose file name matches REGEXP."
-  (interactive "sMark by file name (regexp): ")
+  (interactive (list (read-regexp "Mark by file name (regexp)")))
   (ibuffer-mark-on-buffer
-   #'(lambda (buf)
-       (let ((name (or (buffer-file-name buf)
-		       (with-current-buffer buf
-			 (and
-			  (boundp 'dired-directory)
-			  (stringp dired-directory)
-			  dired-directory)))))
-	 (when name
-           ;; Match on the displayed file name (which is abbreviated).
-	   (string-match regexp (abbreviate-file-name name)))))))
+   (lambda (buf)
+     (let ((name (with-current-buffer buf (ibuffer-buffer-file-name))))
+       (when name
+         ;; Match on the displayed file name (which is abbreviated).
+         (string-match-p regexp (ibuffer--abbreviate-file-name name)))))))
 
 ;;;###autoload
 (defun ibuffer-mark-by-content-regexp (regexp &optional all-buffers)
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el
index 4800e0243d..84c53b16ac 100644
--- a/lisp/ibuffer.el
+++ b/lisp/ibuffer.el
@@ -1308,6 +1308,11 @@ ibuffer-buffer-file-name
                           (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 @@ filename
        (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"
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* bug#18859: 24.3; ibuffer-mark-by-file-name-regexp does not match displayed name
  2021-01-17 16:32     ` Basil L. Contovounesios
@ 2021-01-18 16:39       ` Lars Ingebrigtsen
  2021-01-18 18:05         ` Basil L. Contovounesios
  0 siblings, 1 reply; 7+ messages in thread
From: Lars Ingebrigtsen @ 2021-01-18 16:39 UTC (permalink / raw)
  To: Basil L. Contovounesios; +Cc: 18859, Reuben Thomas

"Basil L. Contovounesios" <contovob@tcd.ie> writes:

> * 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).

Makes sense to me, but I'm not an ibuffer user.

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





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#18859: 24.3; ibuffer-mark-by-file-name-regexp does not match displayed name
  2021-01-18 16:39       ` Lars Ingebrigtsen
@ 2021-01-18 18:05         ` Basil L. Contovounesios
  0 siblings, 0 replies; 7+ messages in thread
From: Basil L. Contovounesios @ 2021-01-18 18:05 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 18859, Reuben Thomas

Lars Ingebrigtsen <larsi@gnus.org> writes:

> "Basil L. Contovounesios" <contovob@tcd.ie> writes:
>
>> * 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).
>
> Makes sense to me, but I'm not an ibuffer user.

Thanks, pushed.

Fix ibuffer-mark-by-file-name-regexp abbreviations
8f4b3b812a 2021-01-18 17:58:42 +0000
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=8f4b3b812aab62a5a205bc2f8690c3b4c460ba09

-- 
Basil





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-01-18 18:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-27 21:19 bug#18859: 24.3; ibuffer-mark-by-file-name-regexp does not match displayed name Reuben Thomas
2019-08-03 16:54 ` Lars Ingebrigtsen
2019-08-23  0:53   ` Lars Ingebrigtsen
2021-01-17 16:06   ` Basil L. Contovounesios
2021-01-17 16:32     ` Basil L. Contovounesios
2021-01-18 16:39       ` Lars Ingebrigtsen
2021-01-18 18:05         ` Basil L. Contovounesios

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).