From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: managing windows in two frames Date: Fri, 06 Sep 2013 15:00:40 -0400 Message-ID: References: <8561uiclrj.fsf@stephe-leake.org> <5225EF0F.1090109@gmx.at> <52260D12.4040002@gmx.at> <5226D26F.7090301@gmx.at> <52274BE9.1010504@gmx.at> <5229B427.9010303@gmx.at> <522A0D72.5060204@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; CHARSET=US-ASCII Content-Transfer-Encoding: 7BIT X-Trace: ger.gmane.org 1378494065 13987 80.91.229.3 (6 Sep 2013 19:01:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 6 Sep 2013 19:01:05 +0000 (UTC) Cc: Stephen Leake , emacs-devel@gnu.org To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 06 21:01:06 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VI1HF-00070K-Px for ged-emacs-devel@m.gmane.org; Fri, 06 Sep 2013 21:01:05 +0200 Original-Received: from localhost ([::1]:39446 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VI1HF-0006Lu-Fz for ged-emacs-devel@m.gmane.org; Fri, 06 Sep 2013 15:01:05 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36641) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VI1H5-0006Lk-Dp for emacs-devel@gnu.org; Fri, 06 Sep 2013 15:01:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VI1Gy-00018P-2y for emacs-devel@gnu.org; Fri, 06 Sep 2013 15:00:55 -0400 Original-Received: from relais.videotron.ca ([24.201.245.36]:34963) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VI1Gx-00018L-TG for emacs-devel@gnu.org; Fri, 06 Sep 2013 15:00:47 -0400 Original-Received: from ceviche.home ([24.203.189.74]) by VL-VM-MR001.ip.videotron.ca (Oracle Communications Messaging Exchange Server 7u4-22.01 64bit (built Apr 21 2011)) with ESMTP id <0MSP007DLWT8FA91@VL-VM-MR001.ip.videotron.ca> for emacs-devel@gnu.org; Fri, 06 Sep 2013 15:00:47 -0400 (EDT) Original-Received: by ceviche.home (Postfix, from userid 20848) id E4C2666084; Fri, 06 Sep 2013 15:00:40 -0400 (EDT) In-reply-to: <522A0D72.5060204@gmx.at> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 24.201.245.36 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:163236 Archived-At: > That's irrational. Not at all. It's a half-common need (tho most people don't realize that other frames could be involved so they just use save-window-excursion thinking it'll undo any damage). > What's wrong with > (let ((display-buffer-function 'ignore)) > (describe-function 'ignore)) Ah, indeed it's simpler. It does have the disadvantage of relying on an obsolete variable, tho. >> but it fails if the buffer ends up displayed in some other frame (or >> worse, in a new frame), which can happen depending on the user's >> settings. So Jorge really wants he code to work regardless of any >> user's customization of display-buffer, in the same sense that >> find-file-noselect does not pay attention to the user's >> display-buffer settings. > If he "sits close enough" to `display-buffer', Jorge can always (1) use > `display-buffer-function', (2) `display-buffer-overriding-action', or > (3) bind `display-buffer-alist' to do whatever he wants. Of course a real fix is to change the code so that it provide a "non-displaying" variant, but Jorge often doesn't have the necessary control over that code. In the case of lisp--company-doc-buffer (in lisp.el), Jorge actually does have this control but doesn't have the energy to "do it right". (1) uses an obsolete var. (3) binds a user variable, which is bad karma. (2) is good, but the question remains: "bind it to what?". You did provide a answer to that question, admittedly, but it's a bit longwinded, I think we should have a simpler answer. Maybe we should define a new macro `with-inhibit-window-changes' which could replace save-window-excursion for those uses (it might use save-window-excursion internally, just in case, but would also try to prevent creation of frames and window changes in other frames). Stefan