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.help,gmane.emacs.devel Subject: Re: frames dedicated to buffers, or, always see specific buffers in a specific frame Date: Fri, 12 Apr 2013 13:12:55 +0100 Message-ID: References: <5167D3B7.2080408@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 1365769091 17137 80.91.229.3 (12 Apr 2013 12:18:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 12 Apr 2013 12:18:11 +0000 (UTC) Cc: "help-gnu-emacs@gnu.org List" , emacs-devel@gnu.org To: martin rudalics Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Apr 12 14:18:15 2013 Return-path: Envelope-to: geh-help-gnu-emacs@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 1UQcvl-0003zP-QQ for geh-help-gnu-emacs@m.gmane.org; Fri, 12 Apr 2013 14:18:13 +0200 Original-Received: from localhost ([::1]:51022 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQcvl-0005v7-Cr for geh-help-gnu-emacs@m.gmane.org; Fri, 12 Apr 2013 08:18:13 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56569) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQcvY-0005tz-24 for help-gnu-emacs@gnu.org; Fri, 12 Apr 2013 08:18:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQcqy-0008QC-NQ for help-gnu-emacs@gnu.org; Fri, 12 Apr 2013 08:13:48 -0400 Original-Received: from mail-pb0-f41.google.com ([209.85.160.41]:36791) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQcqy-0008Pq-Gw; Fri, 12 Apr 2013 08:13:16 -0400 Original-Received: by mail-pb0-f41.google.com with SMTP id mc17so1405052pbc.28 for ; Fri, 12 Apr 2013 05:13:15 -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:to:cc:content-type:content-transfer-encoding; bh=6EP0KXuYQ/vx0lwEmeyAm3Xk7uOvBgcep44nCMTWjKU=; b=oJ1xbJDH0+ZftYoe401Yj8ohGK+WCqFp021TEMAAmI6C2ToCckh1uUfArrVShcM1Pu IssDuA9o9EPsNERg9mlf9/rTlyuuldueXgO/MPWR+1WKQusv9xVAv9YBmlSky0pr6ena 8f38AJALc8OijPR8QtlQI/c8UEhhUAMZqyqhJW9kW4AlG+PELuuBuZM193RQ292uWVxU B/P01EAOCYnCb9gzR0x42sdfN6SgQ+uz3UN4InTbf8zD8bkVnU8ZGtgs+0vh+chVd468 13Qs51gGuSFMhnwcaYG6nz0sWoXpKERV6rEBT9+JXa54iLwpM8TLb2mfcWtbQnK/R1xk mtLQ== X-Received: by 10.66.248.227 with SMTP id yp3mr14929334pac.158.1365768795299; Fri, 12 Apr 2013 05:13:15 -0700 (PDT) Original-Received: by 10.69.16.36 with HTTP; Fri, 12 Apr 2013 05:12:55 -0700 (PDT) In-Reply-To: <5167D3B7.2080408@gmx.at> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.160.41 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:90117 gmane.emacs.devel:158852 Archived-At: On Fri, Apr 12, 2013 at 10:28 AM, martin rudalics wrote: > `switch-to-buffer' uses `pop-to-buffer' to make sure the window > displaying the buffer is selected. You use `display-buffer' which > doesn't necessarily make the window selected - IIUC you rely on the > window manager to select the window. yes, you understand correctly. > Other from that I don't see anything hackish with your approach if the > idea is to make `switch-to-buffer' do what you want when it's called > from other code (which ideally should not happen). In this case you > might also want to advice `switch-to-buffer-other-window' accordingly. I do want that precisely. `display-buffer-alist' apparently allows me (a LO= T of) control how `display-buffer' but not when it is called. The advice is becau= se I want ibuffer and ido to work with this as well. The hackish part is was also that I call the predicate twice, but I can sim= plify that... (defadvice switch-to-buffer (around joaot/browse-buffer-maybe activate) (if (joaot/browse-buffer-p buffer-or-name nil) (let ((display-buffer-alist `(("" . (joaot/browse-buffer-in-special-frame . nil))))) (display-buffer buffer-or-name)) ad-do-it)) However, I still have to have to set `display-buffer-alist' globally for th= ose functions who call `display-buffer' directly, like `describe-function' does= for "*Help*" buffers, for example. (setq display-buffer-alist `((joaot/browse-buffer-p . (joaot/browse-buffer-in-special-frame . ni= l)))) I'm quite happy with this functionally, and find this feature is quite usef= ul to keep focus on one frame, but be able to look at a secondary frame on a seco= nd monitor for reference and only switching to it occasionally. Ideally I would want anywthing with the meaning "switch to some buffer" (be= it `pop-to-buffer', `switch-to-buffer-other-window`, `display-buffer`, etc...)= to be be hookable at some common point, much as is already done with `display- buffer'. Or alternatively, and maybe simpler, if `display-buffer' is so powerful, wh= y can't it be used by `switch-to-buffer' and friends? I know `diplay-buffer''= s semantics are "display without selecting", but can't those be relaxed and t= he "without selecting" part be just the default? Another, distinct, small problem persists, and I suspect it has to do with = not understanding what the various alists are in the documentation of `display-buffer' and `display-buffer-alist'... Specifically, how can I prevent `display-buffer' from stopping at one of the actions that I specify in `display-buffer-alist'? For example, `describe-function' shows me the buffer on the secondary "browse" frame" bu= t still keeps the current pop-to-frame behaviour. I'm going to have a look at `display-buffer-overriding-alist', maybe that will do it. Thanks -- Jo=E3o T=E1vora