[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] master 7cfe2dc: In edebug in GUIs, move focus to the s

From: Alan Mackenzie
Subject: Re: [Emacs-diffs] master 7cfe2dc: In edebug in GUIs, move focus to the selected frame.
Date: Sat, 20 Oct 2018 09:41:42 +0000
User-agent: Mutt/1.10.1 (2018-07-13)

Hello, Stefan.

On Fri, Oct 19, 2018 at 17:12:38 -0400, Stefan Monnier wrote:
> >> If the intention is only to display the code shouldn't use pop-to-buffer
> >> but display-buffer.
> > The doc string of display-buffer is a bit of a heavy read at this time
> > of night.  ;-)

> pop-to-buffer is no simpler: it's basically the same as (select-window
> (display-buffer BUF)).

> BTW, pop-to-buffer already calls `select-frame-set-input-focus`.
> And I see that edebug-pop-to-buffer doesn't call pop-to-buffer, and that
> it comes with:

>     ;; FIXME: We should probably just be using `pop-to-buffer'.

> So maybe the better path is indeed to scratch edebug-pop-to-buffer and
> use pop-to-buffer instead (or more likely, to change
> edebug-pop-to-buffer so that it uses pop-to-buffer internally).

I've thought about this overnight.  And I think the answer is no, it
would not be better to use pop-to-buffer.  At least, not if an ACTION
argument needs to be constructed.

The specification of the ACTION argument seems so arcane, so implicit, so
difficult to use, that it will be simpler just to write a function such
as edebug-pop-to-buffer.  edebug-pop-to-buffer will also be much easier
to understand and maintain than an equivalent using pop-to-buffer with an

In short, pop-to-buffer and display-buffer with ACTION seem to be
"pyrrhic functions".  At least, that's how I see it from reading the doc,
not having yet tried to use them.  Also, edebug-pop-to-buffer already
exists and works.

There are around 479 calls to these two functions in the Emacs source.  A
quick eyeballing of the grep results found just one single use of ACTION,
in replace.el.  I dare say there are more, but very few altogether.

>         Stefan

Alan Mackenzie (Nuremberg, Germany).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]