]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid using variable before it has been initialized
authorStefan Kangas <stefan@marxist.se>
Tue, 5 Oct 2021 21:22:16 +0000 (23:22 +0200)
committerStefan Kangas <stefan@marxist.se>
Tue, 5 Oct 2021 21:25:03 +0000 (23:25 +0200)
* 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)

lisp/ibuffer.el

index 6c0180590b925c30b0ad389e03d420129881c7a1..046595a4d909081aba196a89c4b030f6971163a5 100644 (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
   ;; bad interaction with code in the window-scroll-functions hook
   (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
      nil (and owin
               (/ (frame-height)