all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#70773: 30.0.50; display-delayed-warnings does not respect display-buffer-alist
@ 2024-05-04 18:30 Protesilaos Stavrou
  2024-05-04 19:16 ` Eli Zaretskii
  2024-05-05  6:58 ` Juri Linkov
  0 siblings, 2 replies; 5+ messages in thread
From: Protesilaos Stavrou @ 2024-05-04 18:30 UTC (permalink / raw)
  To: 70773

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





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#70773: 30.0.50; display-delayed-warnings does not respect display-buffer-alist
  2024-05-04 18:30 bug#70773: 30.0.50; display-delayed-warnings does not respect display-buffer-alist Protesilaos Stavrou
@ 2024-05-04 19:16 ` Eli Zaretskii
  2024-05-05 10:48   ` Protesilaos Stavrou
  2024-05-05  6:58 ` Juri Linkov
  1 sibling, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2024-05-04 19:16 UTC (permalink / raw)
  To: Protesilaos Stavrou; +Cc: 70773

> From: Protesilaos Stavrou <info@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.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#70773: 30.0.50; display-delayed-warnings does not respect display-buffer-alist
  2024-05-04 18:30 bug#70773: 30.0.50; display-delayed-warnings does not respect display-buffer-alist Protesilaos Stavrou
  2024-05-04 19:16 ` Eli Zaretskii
@ 2024-05-05  6:58 ` Juri Linkov
  1 sibling, 0 replies; 5+ messages in thread
From: Juri Linkov @ 2024-05-05  6:58 UTC (permalink / raw)
  To: Protesilaos Stavrou; +Cc: 70773

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





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#70773: 30.0.50; display-delayed-warnings does not respect display-buffer-alist
  2024-05-04 19:16 ` Eli Zaretskii
@ 2024-05-05 10:48   ` Protesilaos Stavrou
  2024-05-05 16:35     ` Juri Linkov
  0 siblings, 1 reply; 5+ messages in thread
From: Protesilaos Stavrou @ 2024-05-05 10:48 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 70773

> From: Eli Zaretskii <eliz@gnu.org>
> Date: Sat,  4 May 2024 22:16:04 +0300
>
>> From: Protesilaos Stavrou <info@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





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#70773: 30.0.50; display-delayed-warnings does not respect display-buffer-alist
  2024-05-05 10:48   ` Protesilaos Stavrou
@ 2024-05-05 16:35     ` Juri Linkov
  0 siblings, 0 replies; 5+ messages in thread
From: Juri Linkov @ 2024-05-05 16:35 UTC (permalink / raw)
  To: Protesilaos Stavrou; +Cc: 70773, Eli Zaretskii

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





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-05-05 16:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-04 18:30 bug#70773: 30.0.50; display-delayed-warnings does not respect display-buffer-alist Protesilaos Stavrou
2024-05-04 19:16 ` Eli Zaretskii
2024-05-05 10:48   ` Protesilaos Stavrou
2024-05-05 16:35     ` Juri Linkov
2024-05-05  6:58 ` Juri Linkov

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.