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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 50716 in the body.
You can then email your comments to 50716 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#50716; Package emacs. (Tue, 21 Sep 2021 05:08:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Gabriel <gabriel376 <at> hotmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 21 Sep 2021 05:08:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Gabriel <gabriel376 <at> hotmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; whitespace-report does not use existing windows
Date: Tue, 21 Sep 2021 02:07:08 -0300
Description:
The command 'whitespace-report' does not using existing windows, so
every new invocation opens a new window at bottom. This behavior is
different from how other emacs commands handle windows. I expect
'whitespace-report' to behave similarly to other commands (e.g.:
'describe-variable', 'memory-report', etc). The problem seems to be on
'whitespace-display-window'.

Steps to reproduce:
1) 'emacs -Q' from master branch
2) M-x 'whitespace-report'
3) 'C-x o' to move to "*Whitespace Report*" buffer
4) 'C-x k RET' to kill the "*Whitespace Report*" buffer
5) Repeat steps 2-4 multiple times

--
        Gabriel




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50716; Package emacs. (Tue, 21 Sep 2021 05:31:02 GMT) Full text and rfc822 format available.

Message #8 received at 50716 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Gabriel <gabriel376 <at> hotmail.com>
Cc: 50716 <at> debbugs.gnu.org
Subject: Re: bug#50716: 28.0.50; whitespace-report does not use existing
 windows
Date: Tue, 21 Sep 2021 07:30:16 +0200
Gabriel <gabriel376 <at> hotmail.com> writes:

> The command 'whitespace-report' does not using existing windows, so
> every new invocation opens a new window at bottom. This behavior is
> different from how other emacs commands handle windows. I expect
> 'whitespace-report' to behave similarly to other commands (e.g.:
> 'describe-variable', 'memory-report', etc). The problem seems to be on
> 'whitespace-display-window'.

Yup.  Fixed now in Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 28.1, send any further explanations to 50716 <at> debbugs.gnu.org and Gabriel <gabriel376 <at> hotmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 21 Sep 2021 05:31:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50716; Package emacs. (Tue, 21 Sep 2021 08:36:02 GMT) Full text and rfc822 format available.

Message #13 received at 50716 <at> debbugs.gnu.org (full text, mbox):

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: Re: 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50716; Package emacs. (Tue, 21 Sep 2021 16:56:02 GMT) Full text and rfc822 format available.

Message #16 received at 50716 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: martin rudalics <rudalics <at> gmx.at>
Cc: Gabriel <gabriel376 <at> hotmail.com>, 50716 <at> debbugs.gnu.org
Subject: Re: bug#50716: 28.0.50; whitespace-report does not use existing
 windows
Date: Tue, 21 Sep 2021 18:55:29 +0200
martin rudalics <rudalics <at> gmx.at> writes:

> 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.

Thanks; pushed now to Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50716; Package emacs. (Wed, 22 Sep 2021 07:50:02 GMT) Full text and rfc822 format available.

Message #19 received at 50716 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Gabriel <gabriel376 <at> hotmail.com>, 50716 <at> debbugs.gnu.org
Subject: Re: bug#50716: 28.0.50; whitespace-report does not use existing
 windows
Date: Wed, 22 Sep 2021 09:49:25 +0200
-  "Display BUFFER in a new window."

Why did you drop the doc-string?

martin




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50716; Package emacs. (Wed, 22 Sep 2021 20:03:01 GMT) Full text and rfc822 format available.

Message #22 received at 50716 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: martin rudalics <rudalics <at> gmx.at>
Cc: Gabriel <gabriel376 <at> hotmail.com>, 50716 <at> debbugs.gnu.org
Subject: Re: bug#50716: 28.0.50; whitespace-report does not use existing
 windows
Date: Wed, 22 Sep 2021 22:02:01 +0200
martin rudalics <rudalics <at> gmx.at> writes:

> -  "Display BUFFER in a new window."
>
> Why did you drop the doc-string?

It's an internal function that has a function name that's descriptive
enough, so the doc string seems superfluous.  If you disagree, feel free
to add a new one.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#50716; Package emacs. (Thu, 23 Sep 2021 08:17:01 GMT) Full text and rfc822 format available.

Message #25 received at 50716 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Gabriel <gabriel376 <at> hotmail.com>, 50716 <at> debbugs.gnu.org
Subject: Re: bug#50716: 28.0.50; whitespace-report does not use existing
 windows
Date: Thu, 23 Sep 2021 10:16:06 +0200
> It's an internal function that has a function name that's descriptive
> enough,

Incidentally that function name is quite misleading - we do not display
"windows" but "buffers".

> so the doc string seems superfluous.  If you disagree, feel free
> to add a new one.

Done.

martin




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 21 Oct 2021 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 159 days ago.

Previous Next


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