From ca95e45f7e828aebdf2736c9c7b2d64f9621214e Mon Sep 17 00:00:00 2001 From: Stephen Berman Date: Mon, 11 Sep 2023 16:15:29 +0200 Subject: [PATCH] Avoid confusing message in Ibuffer (bug#64230) * lisp/ibuffer.el (ibuffer-map-lines): With `ibuffer-auto-mode' enabled, Ibuffer counts the automatically popped up (and hence not user-marked) buffer "*Ibuffer confirmation*". Since Ibuffer reports how many user-marked buffers were acted upon, and in this case the reported count would be too high by one, decrement the count to avoid the confusing message. --- lisp/ibuffer.el | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index a26bb1811ec..b5a7f2d04e0 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -1872,7 +1872,8 @@ the buffer object itself and the current mark symbol." (let ((result (if (buffer-live-p (ibuffer-current-buffer)) (when (or (null group) - (when-let ((it (get-text-property (point) 'ibuffer-filter-group))) + (when-let ((it (get-text-property + (point) 'ibuffer-filter-group))) (equal group it))) (save-excursion (funcall function @@ -1897,7 +1898,16 @@ the buffer object itself and the current mark symbol." (t (cl-incf ibuffer-map-lines-count) (forward-line 1))))) - ibuffer-map-lines-count) + ;; With `ibuffer-auto-mode' enabled, the preceding loop + ;; counts the automatically popped up (and hence not + ;; user-marked) buffer "*Ibuffer confirmation*". Since + ;; Ibuffer reports how many user-marked buffers were acted + ;; upon, and in this case the reported count would be too + ;; high by one, we decrement the count to avoid the + ;; confusing message (see bug#64230). + (if (and (featurep 'ibuf-ext) ibuffer-auto-mode) + (1- ibuffer-map-lines-count) + ibuffer-map-lines-count)) (progn (setq buffer-read-only t) (unless nomodify -- 2.39.5