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: Mon, 03 Dec 2012 18:42:45 +0100 Message-ID: <50BCE495.4020604@gmx.at> References: <50BB9407.7060104@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1354556590 13261 80.91.229.3 (3 Dec 2012 17:43:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 3 Dec 2012 17:43:10 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Matt Price Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Dec 03 18:43:22 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 1Tfa35-0005M2-JK for geh-help-gnu-emacs@m.gmane.org; Mon, 03 Dec 2012 18:43:19 +0100 Original-Received: from localhost ([::1]:36302 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tfa2t-0000v7-UE for geh-help-gnu-emacs@m.gmane.org; Mon, 03 Dec 2012 12:43:07 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:54007) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tfa2j-0000tW-Qx for help-gnu-emacs@gnu.org; Mon, 03 Dec 2012 12:43:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tfa2i-0000X2-Te for help-gnu-emacs@gnu.org; Mon, 03 Dec 2012 12:42:57 -0500 Original-Received: from mailout-de.gmx.net ([213.165.64.22]:34719) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1Tfa2i-0000Wl-Jx for help-gnu-emacs@gnu.org; Mon, 03 Dec 2012 12:42:56 -0500 Original-Received: (qmail invoked by alias); 03 Dec 2012 17:42:55 -0000 Original-Received: from 62-47-53-55.adsl.highway.telekom.at (EHLO [62.47.53.55]) [62.47.53.55] by mail.gmx.net (mp072) with SMTP; 03 Dec 2012 18:42:55 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX18Z7vUASpAZlk/AtdQ8WHYfBCGn8hN3+7OHYET7t1 Ezg+9FMmYOKYa1 In-Reply-To: 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:88031 Archived-At: > (defun writers-room-windows (width) > "Trying to figure out how to get a nice windows config for a writers > room mode" > (interactive ) > (global-linum-mode 0) > (delete-other-windows) > (set-window-name (selected-window) 'guide) > (let ((new-window (split-window-horizontally width))) > (set-window-name new-window 'main)) > (select-window (window-with-name 'main)) > (let ((new-window (split-window-horizontally (- width)))) > (set-window-name new-window 'metadata)) > (select-window (window-with-name 'guide)) > ) > > (writers-room-windows 25) You frequently select a window for the sole purpose to apply `split-window-horizontally' to it. But it's better to use `select-window' exclusively for editing its buffer. I would recommend to rewrite this part as (let* ((main (split-window nil width t)) (metadata (split-window main (- width) t))) (set-window-name (selected-window) "guide") (set-window-name main "main") (set-window-name metadata "metadata")) > emacs-version reports: > GNU Emacs 24.2.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.6.0) of > 2012-10-09 on meitnerium, modified by Debian > > If you have any more hints for this next problem -- forcing an > indirect buffer to open in a particular window -- I'd be very > grateful. As a start try playing around with these: (defun display-buffer-in-foo (buffer alist) "Try displaying BUFFER in a window named *foo*." (let ((window (window-with-name "*foo*"))) (when window (window--display-buffer buffer window 'reuse alist display-buffer-mark-dedicated)))) (let ((display-buffer-alist (cons '("\\*foo\\*" (display-buffer-in-foo)) display-buffer-alist))) (pop-to-buffer (get-buffer-create "*foo*"))) martin