bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#50716: 28.0.50; whitespace-report does not use existing windows


From: martin rudalics
Subject: bug#50716: 28.0.50; whitespace-report does not use existing windows
Date: Tue, 21 Sep 2021 10:35:06 +0200

@@ -1839,13 +1839,8 @@ cleaning up these problems."
   "Display BUFFER in a new window."
   (goto-char (point-min))
   (set-buffer-modified-p nil)
-  (when (< (window-height) (* 2 window-min-height))
-    (kill-buffer buffer)
-    (error "Window height is too small; \
-can't split window to display whitespace toggle options"))
-  (let ((win (split-window)))
-    (set-window-buffer win buffer)
-    (shrink-window-if-larger-than-buffer win)))
+  (pop-to-buffer buffer)
+  (shrink-window-if-larger-than-buffer))

I think this needs a new doc-string and the last two lines should
probably become something like

(let ((window (display-buffer
               buffer
               `((display-buffer-reuse-window
                  display-buffer-below-selected)))))
  (shrink-window-if-larger-than-buffer window))

since the original code did not select the window and tried to show it
below the selected one.

martin





reply via email to

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