]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid confusing message in Ibuffer (bug#64230)
authorStephen Berman <stephen.berman@gmx.net>
Mon, 11 Sep 2023 14:15:29 +0000 (16:15 +0200)
committerStephen Berman <stephen.berman@gmx.net>
Mon, 11 Sep 2023 14:15:29 +0000 (16:15 +0200)
* 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

index a26bb1811ec0f12360a51af9dcc60d3c5719da3f..b5a7f2d04e04daa515e8e8db4465e9b8f5220f88 100644 (file)
@@ -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