From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.help Subject: Re: naming and/or directly addressing particular windows? Date: Sun, 02 Dec 2012 18:46:47 +0100 Message-ID: <50BB9407.7060104@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1354470432 16851 80.91.229.3 (2 Dec 2012 17:47:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 2 Dec 2012 17:47:12 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: moptop99@gmail.com Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Dec 02 18:47:24 2012 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 1TfDdM-00050R-Pe for geh-help-gnu-emacs@m.gmane.org; Sun, 02 Dec 2012 18:47:16 +0100 Original-Received: from localhost ([::1]:35768 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TfDdB-0001Lq-7b for geh-help-gnu-emacs@m.gmane.org; Sun, 02 Dec 2012 12:47:05 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:34476) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TfDd5-0001Lj-PH for help-gnu-emacs@gnu.org; Sun, 02 Dec 2012 12:47:00 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TfDd4-00083G-29 for help-gnu-emacs@gnu.org; Sun, 02 Dec 2012 12:46:59 -0500 Original-Received: from mailout-de.gmx.net ([213.165.64.22]:37191) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1TfDd3-000825-P3 for help-gnu-emacs@gnu.org; Sun, 02 Dec 2012 12:46:57 -0500 Original-Received: (qmail invoked by alias); 02 Dec 2012 17:46:56 -0000 Original-Received: from 62-47-40-197.adsl.highway.telekom.at (EHLO [62.47.40.197]) [62.47.40.197] by mail.gmx.net (mp036) with SMTP; 02 Dec 2012 18:46:56 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX18v9Lc1L5cvyG1T290yfmIdT6T7dq1nPqBT3kQ5aE HtN2s4cYkPq49I Original-References: CAN_Dec_0JJXFAn7013poJL=swdvmPZ=2GbsS8ppdSfpoo8kARQ@mail.gmail.com X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 213.165.64.22 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:88021 Archived-At: > I'm slowly starting to understand. I now have this primitive code, > which at least sets up the windows the way I want them: > > (defun my-windows-function () > "Trying to figure out how to get a nice windows config for writers-room-mode" ... > (split-window-horizontally) > (windmove-right) > (fix-window-horizontal-size 35) > (add-to-list 'my-winlist > (cons 'metadata (selected-window)) > ) ... > (select-window(cdr(assoc 'guide my-winlist)) ) > ) I'm not sure why you need names at all but with Emacs 24 it's simpler to use window parameters as (defun set-window-name (window name) (set-window-parameter window 'name name)) (defun window-with-name (name) (window-with-parameter 'name name)) which also relieves you from the task to recycle dead windows from `my-winlist', and rewrite your code as (let ((new-window (split-window-horizontally -35))) (set-window-name new-window 'metadata)) ... (select-window (window-with-name 'guide)) > I'm not having an easy time figuring out how that function decides > which window to use when creating and focussing on the new indirect > buffer. I can see (and the documentation states) that a choice is > first made between using a new or dedicated frame, or the same frame > with either the original or another window. But the code to put the > buffer in another window in the same frame is quite simple: > > ((eq org-indirect-buffer-display 'other-window) > (pop-to-buffer ibuf)) > > > I've been chasing the code down to native emacs functions -- > pop-to-buffer ends up relying on display-buffer -- but I haven't yet > found a place where I an specify a particular window for the new > buffer. Does anyone else know a way? Depends (also) on the version of your Emacs. martin