From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel 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 Message-ID: <20181020094142.GA3992@ACM> References: <20181019175416.10874.88992@vcs0.savannah.gnu.org> <20181019175418.27D6920407@vcs0.savannah.gnu.org> <20181019184916.GA6639@ACM> <20181019192132.GB6639@ACM> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1540028897 6941 195.159.176.226 (20 Oct 2018 09:48:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 20 Oct 2018 09:48:17 +0000 (UTC) User-Agent: Mutt/1.10.1 (2018-07-13) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 20 11:48:13 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gDnrg-0001hK-2m for ged-emacs-devel@m.gmane.org; Sat, 20 Oct 2018 11:48:12 +0200 Original-Received: from localhost ([::1]:54396 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDntm-00052T-Cm for ged-emacs-devel@m.gmane.org; Sat, 20 Oct 2018 05:50:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDntd-0004zP-VC for emacs-devel@gnu.org; Sat, 20 Oct 2018 05:50:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gDnta-0006Qb-Js for emacs-devel@gnu.org; Sat, 20 Oct 2018 05:50:13 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:47119 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1gDnta-0006MT-7i for emacs-devel@gnu.org; Sat, 20 Oct 2018 05:50:10 -0400 Original-Received: (qmail 15933 invoked by uid 3782); 20 Oct 2018 09:50:08 -0000 Original-Received: from acm.muc.de (p5B1463CA.dip0.t-ipconnect.de [91.20.99.202]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 20 Oct 2018 11:50:07 +0200 Original-Received: (qmail 4717 invoked by uid 1000); 20 Oct 2018 09:41:42 -0000 Content-Disposition: inline In-Reply-To: X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x [fuzzy] X-Received-From: 193.149.48.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:230519 Archived-At: 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).