GNU bug report logs - #70773
30.0.50; display-delayed-warnings does not respect display-buffer-alist

Previous Next

Package: emacs;

Reported by: Protesilaos Stavrou <info <at> protesilaos.com>

Date: Sat, 4 May 2024 18:32:02 UTC

Severity: normal

Merged with 70795

Fixed in version 30.0.50

Done: Juri Linkov <juri <at> linkov.net>

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 70773 in the body.
You can then email your comments to 70773 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#70773; Package emacs. (Sat, 04 May 2024 18:32:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Protesilaos Stavrou <info <at> protesilaos.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 04 May 2024 18:32:02 GMT) Full text and rfc822 format available.

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

From: Protesilaos Stavrou <info <at> protesilaos.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; display-delayed-warnings does not respect
 display-buffer-alist
Date: Sat, 04 May 2024 21:30:25 +0300
Dear maintainers,

The display-delayed-warnings does not conform with display-buffer-no-window.

To test this, I create a new directory and write an init.el with the
following contents:

    (setq display-buffer-alist
          '(("\\`\\*\\(Warnings\\|Compile-Log\\|Org Links\\)\\*\\'"
             (display-buffer-no-window)
             (allow-no-window . t))))

Then I start Emacs with:

     emacs --init-directory=/path/to/testing/dir/

This produces the following:

    display-delayed-warnings: Wrong type argument: window-live-p, nil
    Error in delayed-warnings-hook (display-delayed-warnings): (wrong-type-argument window-live-p nil)

What I ultimately want is to not see those warnings at startup. I know I
can do it by setting the delayed-warnings-hook to nil, though there may
be a better option I have not discovered yet...

Thank you for your time,
Protesilaos (or simply "Prot")

* * *

In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.38, cairo version 1.16.0) of 2024-05-04 built on kronos
Repository revision: fa0f65aa342e181e0e98f55cbf5d9a9be5ed3be6
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101007
System Description: Debian GNU/Linux 12 (bookworm)

Configured using:
 'configure --prefix=/usr/local --with-x-toolkit=gtk3
 --with-native-compilation=aot --without-gif --without-tiff
 --without-selinux --without-xinput2 --without-gpm
 --without-compress-install --without-xft --with-cairo --with-harfbuzz
 --with-tree-sitter=ifavailable --without-gsettings --without-gconf'

Configured features:
ACL CAIRO DBUS FREETYPE GLIB GMP GNUTLS HARFBUZZ JPEG LCMS2 LIBOTF
LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER
PNG RSVG SECCOMP SOUND THREADS TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM XPM
GTK3 ZLIB

-- 
Protesilaos Stavrou
https://protesilaos.com




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70773; Package emacs. (Sat, 04 May 2024 19:17:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Protesilaos Stavrou <info <at> protesilaos.com>
Cc: 70773 <at> debbugs.gnu.org
Subject: Re: bug#70773: 30.0.50;
 display-delayed-warnings does not respect display-buffer-alist
Date: Sat, 04 May 2024 22:16:04 +0300
> From: Protesilaos Stavrou <info <at> protesilaos.com>
> Date: Sat, 04 May 2024 21:30:25 +0300
> 
> Dear maintainers,
> 
> The display-delayed-warnings does not conform with display-buffer-no-window.
> 
> To test this, I create a new directory and write an init.el with the
> following contents:
> 
>     (setq display-buffer-alist
>           '(("\\`\\*\\(Warnings\\|Compile-Log\\|Org Links\\)\\*\\'"
>              (display-buffer-no-window)
>              (allow-no-window . t))))
> 
> Then I start Emacs with:
> 
>      emacs --init-directory=/path/to/testing/dir/
> 
> This produces the following:
> 
>     display-delayed-warnings: Wrong type argument: window-live-p, nil
>     Error in delayed-warnings-hook (display-delayed-warnings): (wrong-type-argument window-live-p nil)
> 
> What I ultimately want is to not see those warnings at startup. I know I
> can do it by setting the delayed-warnings-hook to nil, though there may
> be a better option I have not discovered yet...

I say either set delayed-warnings-hook to nil or customize
warning-suppress-log-types to suppress the warnings you don't want to
see.  display-buffer-alist is not the best way of doing this,
especially not when you want to affect what Emacs does at startup,
when the various elements of the UI might not yet be ready for your
trickery.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70773; Package emacs. (Sun, 05 May 2024 07:02:03 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Protesilaos Stavrou <info <at> protesilaos.com>
Cc: 70773 <at> debbugs.gnu.org
Subject: Re: bug#70773: 30.0.50; display-delayed-warnings does not respect
 display-buffer-alist
Date: Sun, 05 May 2024 09:58:13 +0300
> The display-delayed-warnings does not conform with display-buffer-no-window.

Thanks for the bug report.

> To test this, I create a new directory and write an init.el with the
> following contents:
>
>     (setq display-buffer-alist
>           '(("\\`\\*\\(Warnings\\|Compile-Log\\|Org Links\\)\\*\\'"
>              (display-buffer-no-window)
>              (allow-no-window . t))))

`allow-no-window' is intended to be provided only by the caller,
when the caller can handle the nil value for window.

So here is the patch that implements this in the caller:

diff --git a/lisp/emacs-lisp/warnings.el b/lisp/emacs-lisp/warnings.el
index 8c1e43934ff..d0e130abaf8 100644
--- a/lisp/emacs-lisp/warnings.el
+++ b/lisp/emacs-lisp/warnings.el
@@ -372,15 +372,17 @@ display-warning
 		     (warning-suppress-p type warning-suppress-types)
 		     (let ((window (display-buffer
 				    buffer
-				    (when warning-display-at-bottom
-				      '(display-buffer--maybe-at-bottom
-					(window-height . (lambda (window)
-					  (fit-window-to-buffer window 10)))
-					(category . warning))))))
-		       (when (and (markerp warning-series)
+				    (if warning-display-at-bottom
+				        '(display-buffer--maybe-at-bottom
+					  (window-height . (lambda (window)
+                                            (fit-window-to-buffer window 10)))
+					  (category . warning)
+                                          (allow-no-window . t))
+                                      '(nil (allow-no-window . t))))))
+		       (when (and window (markerp warning-series)
 				  (eq (marker-buffer warning-series) buffer))
 			 (set-window-start window warning-series))
-		       (when warning-display-at-bottom
+		       (when (and warning-display-at-bottom window)
 			 (with-selected-window window
 			   (goto-char (point-max))
 			   (forward-line -1)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70773; Package emacs. (Sun, 05 May 2024 10:50:01 GMT) Full text and rfc822 format available.

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

From: Protesilaos Stavrou <info <at> protesilaos.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 70773 <at> debbugs.gnu.org
Subject: Re: bug#70773: 30.0.50; display-delayed-warnings does not respect
 display-buffer-alist
Date: Sun, 05 May 2024 13:48:29 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> Date: Sat,  4 May 2024 22:16:04 +0300
>
>> From: Protesilaos Stavrou <info <at> protesilaos.com>
>> Date: Sat, 04 May 2024 21:30:25 +0300
>> 
>> Dear maintainers,
>> 
>> The display-delayed-warnings does not conform with display-buffer-no-window.
>> 
>> To test this, I create a new directory and write an init.el with the
>> following contents:
>> 
>>     (setq display-buffer-alist
>>           '(("\\`\\*\\(Warnings\\|Compile-Log\\|Org Links\\)\\*\\'"
>>              (display-buffer-no-window)
>>              (allow-no-window . t))))
>> 
>> Then I start Emacs with:
>> 
>>      emacs --init-directory=/path/to/testing/dir/
>> 
>> This produces the following:
>> 
>>     display-delayed-warnings: Wrong type argument: window-live-p, nil
>>     Error in delayed-warnings-hook (display-delayed-warnings): (wrong-type-argument window-live-p nil)
>> 
>> What I ultimately want is to not see those warnings at startup. I know I
>> can do it by setting the delayed-warnings-hook to nil, though there may
>> be a better option I have not discovered yet...
>
> I say either set delayed-warnings-hook to nil or customize
> warning-suppress-log-types to suppress the warnings you don't want to
> see.

Fine.

> display-buffer-alist is not the best way of doing this, especially not
> when you want to affect what Emacs does at startup, when the various
> elements of the UI might not yet be ready for your trickery.

I reported this bug because it is only now that I observe this
behaviour. I have had that display-buffer-alist setting for a long time
already.

-- 
Protesilaos Stavrou
https://protesilaos.com




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#70773; Package emacs. (Sun, 05 May 2024 16:45:04 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Protesilaos Stavrou <info <at> protesilaos.com>
Cc: 70773 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#70773: 30.0.50; display-delayed-warnings does not respect
 display-buffer-alist
Date: Sun, 05 May 2024 19:35:03 +0300
>> I say either set delayed-warnings-hook to nil or customize
>> warning-suppress-log-types to suppress the warnings you don't want to
>> see.
>
> Fine.
>
>> display-buffer-alist is not the best way of doing this, especially not
>> when you want to affect what Emacs does at startup, when the various
>> elements of the UI might not yet be ready for your trickery.
>
> I reported this bug because it is only now that I observe this
> behaviour. I have had that display-buffer-alist setting for a long time
> already.

Then I retract the proposed patch.  Instead of hiding the warning window
the right way to disable lexical-binding warnings is to add
'lexical-binding' to 'warning-suppress-log-types'.




Forcibly Merged 70773 70795. Request was from Juri Linkov <juri <at> linkov.net> to control <at> debbugs.gnu.org. (Mon, 06 May 2024 17:03:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 30.0.50, send any further explanations to 70795 <at> debbugs.gnu.org and Gerard Vermeulen <gerard.vermeulen <at> posteo.net> Request was from Juri Linkov <juri <at> linkov.net> to control <at> debbugs.gnu.org. (Mon, 06 May 2024 17:03:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 04 Jun 2024 11:24:12 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 71 days ago.

Previous Next


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