all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: martin rudalics <rudalics@gmx.at>
Cc: germanp82@hotmail.com, 68081@debbugs.gnu.org
Subject: bug#68081: 30.0.50; derived-mode and display-buffer-alist
Date: Sat, 30 Dec 2023 12:12:35 +0200	[thread overview]
Message-ID: <83edf43soc.fsf@gnu.org> (raw)
In-Reply-To: <9fc1e566-d99e-479a-bb38-fce6a964dfc0@gmx.at> (message from martin rudalics on Sat, 30 Dec 2023 10:30:40 +0100)

> Date: Sat, 30 Dec 2023 10:30:40 +0100
> Cc: germanp82@hotmail.com, 68081@debbugs.gnu.org
> From: martin rudalics <rudalics@gmx.at>
> 
>  > Thanks.  I tend to document this subtlety, and otherwise leave it
>  > alone.
> 
> This was not an issue when 'display-buffer' was rewritten in 2011.  It
> became an issue when it started to use 'buffer-match-p' in 2022.

I guess it's a problem on the emacs-29 branch as well, then?

> A fairly safe fix would be
> 
> diff --git a/lisp/info.el b/lisp/info.el
> index 51e9eb72edf..e0d35591ee5 100644
> --- a/lisp/info.el
> +++ b/lisp/info.el
> @@ -768,6 +768,12 @@ info
>       ;; of names that might have been wrapped (in emails, etc.).
>       (setq file-or-node
>             (string-replace "\n" " " file-or-node)))
> +
> +  (unless (or buffer (derived-mode-p 'Info-mode))
> +    (setq buffer (get-buffer-create "*info*"))
> +    (with-current-buffer buffer
> +      (Info-mode)))
> +
>     (info-setup file-or-node
>   	      (pop-to-buffer-same-window (or buffer "*info*"))))
> 
> A still conservative but more advanced fix (that should DTRT in the case
> no window can be found) would be
> 
> diff --git a/lisp/info.el b/lisp/info.el
> index 51e9eb72edf..11e228b9bf8 100644
> --- a/lisp/info.el
> +++ b/lisp/info.el
> @@ -768,8 +768,16 @@ info
>       ;; of names that might have been wrapped (in emails, etc.).
>       (setq file-or-node
>             (string-replace "\n" " " file-or-node)))
> -  (info-setup file-or-node
> -	      (pop-to-buffer-same-window (or buffer "*info*"))))
> +
> +  (unless buffer
> +    (if (derived-mode-p 'Info-mode)
> +	(setq buffer "*info*")
> +      (setq buffer (get-buffer-create "*info*"))
> +      (with-current-buffer buffer
> +	(Info-mode))))
> +
> +  (pop-to-buffer-same-window buffer)
> +  (info-setup file-or-node buffer))
> 
>   (defun info-setup (file-or-node buffer)
>     "Display Info node FILE-OR-NODE in BUFFER."
> 
> Otherwise, you could suggest using
> 
> (setq display-buffer-alist '(((derived-mode . Info-mode)
>                                (display-buffer-in-side-window))
> 			     ("*info*" (display-buffer-in-side-window))))
> 
> as a fallback.

Thanks.  Would you recommend any of the above for the emacs-29 branch?
Or are these not safe enough there?





  reply	other threads:[~2023-12-30 10:12 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-28 13:26 bug#68081: 30.0.50; derived-mode and display-buffer-alist German Pacenza
2023-12-28 14:07 ` Eli Zaretskii
2023-12-29  9:02   ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-29 11:41     ` Eli Zaretskii
2023-12-30  9:30       ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-30 10:12         ` Eli Zaretskii [this message]
2023-12-31  8:57           ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-31 10:30             ` German Pacenza
2024-01-01  9:38               ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-01 12:17                 ` Eli Zaretskii
2024-01-02 10:46                   ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-03 11:59                     ` Eli Zaretskii
2024-01-04 10:21                       ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-04 10:39                         ` Eli Zaretskii
2024-01-05  9:22                           ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-05 10:18                             ` German Pacenza
2024-01-06  8:56                               ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-06 10:35                                 ` German Pacenza
2024-01-06 11:39                                   ` Eli Zaretskii
2024-01-06 11:55                                     ` German Pacenza
2024-01-06 12:01                                       ` Eli Zaretskii
2024-01-13  9:30                                     ` Eli Zaretskii
2024-01-03 10:35                   ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-03 13:22                     ` Eli Zaretskii
2024-01-04 10:21                       ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-06  9:50                     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83edf43soc.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=68081@debbugs.gnu.org \
    --cc=germanp82@hotmail.com \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.