From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Jo=E3o_T=E1vora?= Newsgroups: gmane.emacs.devel,gmane.emacs.help Subject: frames dedicated to buffers, or, always see specific buffers in a specific frame Date: Sun, 14 Apr 2013 19:42:23 +0100 Message-ID: References: <5167D3B7.2080408@gmx.at> <516816E9.1080206@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1365964968 7094 80.91.229.3 (14 Apr 2013 18:42:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 14 Apr 2013 18:42:48 +0000 (UTC) Cc: help-gnu-emacs@gnu.org, Stefan Monnier , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Apr 14 20:42:52 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 1URRt4-0000to-K8 for ged-emacs-devel@m.gmane.org; Sun, 14 Apr 2013 20:42:50 +0200 Original-Received: from localhost ([::1]:55053 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URRt3-0002Ch-VF for ged-emacs-devel@m.gmane.org; Sun, 14 Apr 2013 14:42:49 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:40169) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URRt0-0002CZ-Em for emacs-devel@gnu.org; Sun, 14 Apr 2013 14:42:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1URRsy-0003VJ-S3 for emacs-devel@gnu.org; Sun, 14 Apr 2013 14:42:46 -0400 Original-Received: from mail-pd0-f176.google.com ([209.85.192.176]:62323) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URRsy-0003Up-N9 for emacs-devel@gnu.org; Sun, 14 Apr 2013 14:42:44 -0400 Original-Received: by mail-pd0-f176.google.com with SMTP id r11so2130035pdi.35 for ; Sun, 14 Apr 2013 11:42:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:cc:content-type:content-transfer-encoding; bh=bzeQGNaA7ljIt5YYHO1yQTJuEMBRj2uFBxPv1r+jLXI=; b=0zsEv32NdvRdFQahNmmsVPf6bNxv/+764kF3UlT7LhOlEaBvFWx63zpe4CaMlasDl5 quJpla7tf9YQg/KOG67IAyAVe4p5mvRwe5d6qRadqMaYXTNyEzIuKCzfDhbAbSUnMM2b EIKt3LmCmgLBIXjsQ3dyd/tlkLv6T8axL4d78zRJOihUgKEYumGvMexq0TRdDeyqTjCc S1ngqUKclbv8RGE2OQ5o3ZVpwiOh558jXCIxDMtPSt2MaKs90LEbgNJ07eyWfDQ7JX7x 42kydoEvJyBvaal3BJeRez+U2yiI5TSetV5sbJ+x7PEDDuweXUx5Mj1KuUAzPixeK8z4 cWfg== X-Received: by 10.68.212.168 with SMTP id nl8mt14955116pbc.43.1365964963792; Sun, 14 Apr 2013 11:42:43 -0700 (PDT) Original-Received: by 10.69.16.36 with HTTP; Sun, 14 Apr 2013 11:42:23 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.192.176 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:158908 gmane.emacs.help:90157 Archived-At: >> yes, you understand correctly. > > So for making this general purpose you should use `pop-to-buffer' > instead of `display-buffer'. Yes, that works too. Why exactly is this more general purpose? >> control how `display-buffer' but not > > ... only, I presume ... Sorry I mean "a lot of control over how it gets called, but not when it gets called" >> when it is called. The advice is because I >> want ibuffer and ido to work with this as well. > > These should refrain from using `switch-to-buffer(-...)' and use > `pop-to-buffer' with the `display-buffer-same-window' directive instead. > Wherever this bothers you, file a bug report so it gets fixed. it didn't bother me until now, let's see if I use this frequently... Also, ido has these `ido-default-buffer-method' and `ido-default-file-method' that can be set to various options to control how buffer appears. But the way these options implemented does not bring them all to `display-buffer', which sometimes precludes user's control. Should't they be implemented via `display-buffer-alist', keeping any of the user's entries on top? > [...] Couldn't you use some more human predicate for this purpose? Yes, I could of course, but was too lazy. I could use any buffer-checking predicate. There could be some kind of var `joaot/browse-buffer-predicates' tried in order by `joaot/browse-buffer-p'. > > This was the intention of `display-buffer-alist' and IIRC at some time I > had already removed all calls of `switch-to-buffer' from the Emacs code > base. Somehow this got reverted later. Pity. But what about making `switch-to-buffer' delegate to `display-buffer' too? It could dinamically bind `display-buffer-alist' to display and select the buffer, but keeping any existing entries (probably set by the user, or other programs) on top. If that resulted in `switch-to-buffer' not switching to the buffer's window, it could not be considered unexpected behaviour, since ultimately the user set `display-buffer-alist' himself. > `switch-to-buffer' is the traditional means to interactively show a > buffer in the selected window. It shouldn't be used in Lisp code. Yes I see. But see above for a (possibly naive) fix. > This doesn't sound right. When `display-buffer' has found a window it > should stop right there. Anything else would constitute a bug. If you > can reproduce it, step through it with the debugger to find out what > goes wrong. My fault, sorry. The function displaying the buffer must return a window object, anything else results in funny behaviour. Anyway, it's working nicely now, thanks for the help. -- Jo=E3o T=E1vora