emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-28 ead5c5c: Avoid using variable before it has been initialized


From: Stefan Kangas
Subject: emacs-28 ead5c5c: Avoid using variable before it has been initialized
Date: Tue, 5 Oct 2021 17:25:25 -0400 (EDT)

branch: emacs-28
commit ead5c5cc5196c373421eaf8ebd996e652a37de81
Author: Stefan Kangas <stefan@marxist.se>
Commit: Stefan Kangas <stefan@marxist.se>

    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)
---
 lisp/ibuffer.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el
index 6c01805..046595a 100644
--- a/lisp/ibuffer.el
+++ b/lisp/ibuffer.el
@@ -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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]