From: Gabriel do Nascimento Ribeiro Date: Thu, 10 Nov 2022 09:11:03 +0000 (-0300) Subject: Make ibuffer directory filter buffer aware X-Git-Tag: emacs-29.0.90~1519 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=75101583c3f645aa845fb78f88b02eae92bfdc44;p=emacs.git Make ibuffer directory filter buffer aware * lisp/ibuf-ext.el (define-ibuffer-filter): Make ibuffer directory filter buffer aware for buffer not visiting files. (Bug#59165) --- diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el index 6b5cccec515..adffef43259 100644 --- a/lisp/ibuf-ext.el +++ b/lisp/ibuf-ext.el @@ -1336,10 +1336,12 @@ against '/a/b'. For a buffer not associated with a file, this matches against the value of `default-directory' in that buffer." ( :description "directory name" :reader (read-from-minibuffer "Filter by directory name (regex): ")) - (if-let ((it (with-current-buffer buf (ibuffer-buffer-file-name)))) - (when-let ((dirname (file-name-directory it))) - (string-match qualifier dirname)) - (when default-directory (string-match qualifier default-directory)))) + (with-current-buffer buf + (if-let* ((filename (ibuffer-buffer-file-name)) + (dirname (file-name-directory filename))) + (string-match qualifier dirname) + (when default-directory + (string-match qualifier default-directory))))) ;;;###autoload (autoload 'ibuffer-filter-by-size-gt "ibuf-ext") (define-ibuffer-filter size-gt