all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: emacs-devel@gnu.org
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	[thread overview]
Message-ID: <20181020094142.GA3992@ACM> (raw)
In-Reply-To: <jwvva5xr6ju.fsf-monnier+emacsdiffs@gnu.org>

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

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	other threads:[~2018-10-20  9:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20181019175416.10874.88992@vcs0.savannah.gnu.org>
     [not found] ` <20181019175418.27D6920407@vcs0.savannah.gnu.org>
2018-10-19 17:58   ` [Emacs-diffs] master 7cfe2dc: In edebug in GUIs, move focus to the selected frame Stefan Monnier
2018-10-19 18:49     ` Alan Mackenzie
2018-10-19 19:07       ` Stefan Monnier
2018-10-19 19:21         ` Alan Mackenzie
2018-10-19 19:39           ` Davis Herring
2018-10-19 19:50             ` Alan Mackenzie
2018-10-19 21:12           ` Stefan Monnier
2018-10-20  9:41             ` Alan Mackenzie [this message]

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=20181020094142.GA3992@ACM \
    --to=acm@muc.de \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@IRO.UMontreal.CA \
    /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.