GNU bug report logs - #68081
30.0.50; derived-mode and display-buffer-alist

Previous Next

Package: emacs;

Reported by: German Pacenza <germanp82 <at> hotmail.com>

Date: Thu, 28 Dec 2023 13:32:02 UTC

Severity: normal

Found in version 30.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: martin rudalics <rudalics <at> gmx.at>
Cc: germanp82 <at> hotmail.com, 68081 <at> debbugs.gnu.org
Subject: bug#68081: 30.0.50; derived-mode and display-buffer-alist
Date: Fri, 29 Dec 2023 13:41:36 +0200
> Date: Fri, 29 Dec 2023 10:02:50 +0100
> Cc: 68081 <at> debbugs.gnu.org
> From: martin rudalics <rudalics <at> gmx.at>
> 
>  >> display-buffer-alist rules that use derived-mode or major-mode are
>  >> ignored on first use.
>  >>
>  >> emacs -Q:
>  >>
>  >> (setq display-buffer-alist '(((derived-mode . Info-mode)
>  >>                                (display-buffer-in-side-window))))
>  >> "C-h i"
>  >> The info buffer takes the whole window
>  >> "q"
>  >> "C-h i"
>  >> The info buffer opens in side window as expected
>  >>
>  >> Info and Compilation modes are affected, but Help and Man work as expected
>  >
>  > Martin, any comments or suggestions?
> 
> C-h i does
> 
>    (info-setup file-or-node
> 	      (pop-to-buffer-same-window (or buffer "*info*"))))
> 
> In the first call BUFFER is nil and the
> 
>                         (provided-mode-derived-p
>                          (buffer-local-value 'major-mode buffer)
>                          mode))
> 
> rigmarole in 'buffer-match-p' won't report a match because the major
> mode of *info* is still fundamental mode.  In later calls the *info*
> buffer exists already, is in Info-mode, and 'buffer-match-p' will
> produce the desired result.
> 
> We could try to call 'Info-mode' _before_ calling 'display-buffer' but
> I'm not sure of the consequences this would have.

Thanks.  I tend to document this subtlety, and otherwise leave it
alone.




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

Previous Next


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