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

Previous Next

Package: emacs;

Reported by: Gabriel <gabriel376 <at> hotmail.com>

Date: Tue, 21 Sep 2021 05:08:01 UTC

Severity: normal

Found in version 28.0.50

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: martin rudalics <rudalics <at> gmx.at>
To: Lars Ingebrigtsen <larsi <at> gnus.org>, Gabriel <gabriel376 <at> hotmail.com>
Cc: 50716 <at> debbugs.gnu.org
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




This bug report was last modified 3 years and 294 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.