Avoid using variable before it has been initialized

* lisp/ibuffer.el (ibuffer-shrink-to-fit): Don't try to use
ibuffer-auto-mode variable before ibuf-ext.el has been loaded.
(Bug#51029)
This commit is contained in:
Stefan Kangas 2021-10-05 23:22:16 +02:00
parent b2c50d7cf3
commit ead5c5cc51

View file

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