unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Kiso Katsuyuki <katsuyuki2388@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Selecting *Compile-log* buffer automatically
Date: Sun, 24 Dec 2023 19:28:48 +0200	[thread overview]
Message-ID: <86o7efse5r.fsf@mail.linkov.net> (raw)
In-Reply-To: <CAOq35dgmnuyzCFxBsKf_YOnBPPw4VURq164D8aaBg5mDi4s0tA@mail.gmail.com> (Kiso Katsuyuki's message of "Sun, 24 Dec 2023 06:51:23 -0600")

>>>>I believe this should be customizable with something like
>>>> 
>>>>  (setopt display-buffer-alist
>>>>   '(("\\*Compile-log\\*" nil (select-window . t))))
>>>
>>> Thank you for the advice, but I tried this and it didn't work.
>>> *Compile-log* buffer isn't selected.
>>> I used emacs 29.1 with no init files loaded.
>> 
>>This feature was discussed in bug#33258 and bug#46034,
>>but not yet implemented.  It should be easy to implement
>>exactly the same way as 'windmove-display-in-direction'
>>selects the old or new window in 'post-command-hook'.
>>Ok, I will post a patch to bug-gnu-emacs.
>
> There seems to be another problem with using display-buffer-alist.
> byte-compile-file repeats byte-compile, display-warning (this uses
> display-buffer)
> for each S-expression. Selecting *Compile-log* buffer before finishing
> byte-compiling the last
> S-expression causes an error. I checked the error using 
>
> (defun select-visible-warning-buffer (_type _message &optional _level
> buffer-name)
>   "Select the visible warning buffer"
>   (unless buffer-name
>     (setq buffer-name "*Warnings*"))
>   (let ((window (get-buffer-window (get-buffer buffer-name))))
>     (if window (select-window window))))
>
> (advice-add 'display-warning :after #'select-visible-warning-buffer)
>
> , and byte-compile causes "Error: End of file during parsing".
>
> display-buffer-alist should affect every display-buffer, so I think
> it leads to the same error.

Indeed, you can't select arbitrary windows in every display-buffer,
because code after every display-buffer expects certain buffers
to be selected.  This was discussed in bug#33258, and the only
possible solution is to select the window when the current command
finishes.  This is implemented in bug#67993.



  reply	other threads:[~2023-12-24 17:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-10 18:38 Selecting *Compile-log* buffer automatically Kiso Katsuyuki
2023-12-10 19:32 ` Eli Zaretskii
2023-12-11  1:07   ` Kiso Katsuyuki
2023-12-11 11:56     ` Eli Zaretskii
2023-12-17  2:22       ` Kiso Katsuyuki
2023-12-11 17:04 ` Juri Linkov
2023-12-23  8:19   ` Kiso Katsuyuki
2023-12-23 17:41     ` Juri Linkov
2023-12-24 12:51       ` Kiso Katsuyuki
2023-12-24 17:28         ` Juri Linkov [this message]
2023-12-25 13:03           ` Kiso Katsuyuki
2024-02-17 18:20             ` Kiso Katsuyuki

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=86o7efse5r.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=emacs-devel@gnu.org \
    --cc=katsuyuki2388@gmail.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).