]> git.eshelyaron.com Git - emacs.git/commitdiff
Another fix for 'ibuffer-shrink-to-fit' (Bug#7218, Bug#51029)
authorMartin Rudalics <rudalics@gmx.at>
Mon, 11 Oct 2021 16:58:10 +0000 (18:58 +0200)
committerMartin Rudalics <rudalics@gmx.at>
Mon, 11 Oct 2021 16:58:10 +0000 (18:58 +0200)
* lisp/ibuffer.el (ibuffer-shrink-to-fit): Fit window only if its
buffer is in 'ibuffer-mode' (Bug#7218, Bug#51029).

lisp/ibuffer.el

index 046595a4d909081aba196a89c4b030f6971163a5..e5095455c26d829586965279a41ca606b0b566d8 100644 (file)
@@ -1079,8 +1079,8 @@ a new window in the current frame, splitting vertically."
   ;; Make sure that redisplay is performed, otherwise there can be a
   ;; bad interaction with code in the window-scroll-functions hook
   (redisplay t)
-  (when (and (boundp 'ibuffer-auto-mode) ; ibuf-ext.el might not be loaded yet
-             (buffer-local-value 'ibuffer-auto-mode (window-buffer)))
+  (when (with-current-buffer (window-buffer)
+          (eq major-mode 'ibuffer-mode))
     (fit-window-to-buffer
      nil (and owin
               (/ (frame-height)