From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: rustom Newsgroups: gmane.emacs.help Subject: Re: Frame titles which reflect contents Date: Wed, 25 Nov 2009 09:04:08 -0800 (PST) Organization: http://groups.google.com Message-ID: <720bb258-1757-4f0f-9d57-9e648048295a@o9g2000prg.googlegroups.com> References: <7696d7fd-a38f-4b65-9291-b09a4074189d@j4g2000yqe.googlegroups.com> <07b74a66-b7df-469e-ab0e-71a969b9b610@m16g2000yqc.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1259170846 18786 80.91.229.12 (25 Nov 2009 17:40:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 25 Nov 2009 17:40:46 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Nov 25 18:40:39 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NDLr4-0008VM-Ku for geh-help-gnu-emacs@m.gmane.org; Wed, 25 Nov 2009 18:40:38 +0100 Original-Received: from localhost ([127.0.0.1]:42418 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NDLr4-0003H1-9u for geh-help-gnu-emacs@m.gmane.org; Wed, 25 Nov 2009 12:40:38 -0500 Original-Path: news.stanford.edu!usenet.stanford.edu!postnews.google.com!o9g2000prg.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 45 Original-NNTP-Posting-Host: 59.95.19.57 Original-X-Trace: posting.google.com 1259168649 2725 127.0.0.1 (25 Nov 2009 17:04:09 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 25 Nov 2009 17:04:09 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: o9g2000prg.googlegroups.com; posting-host=59.95.19.57; posting-account=mBpa7woAAAAGLEWUUKpmbxm-Quu5D8ui User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5,gzip(gfe),gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:175053 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:70126 Archived-At: On Nov 25, 6:26=A0am, jpkotta wrote: > On Nov 22, 10:04=A0am, Eduardo =A0Cavazos wrote: > > > > > Hello! > > > Today I had three frames open. One frame had a single window with file > > 'a'. Another had a single window with file 'b'. The third frame had 3 > > windows; file 'a', file 'b', and a *scheme* buffer. > > > I was running this Emacs in Gnome. The three frames are reflected in > > the window list in the bottom panel. The trouble is that, the third > > frame with the multiple windows is named based on the buffer that's > > currently selected in that frame. So if buffer 'b' is selected, > > there's no way to distinguish frame 2 and frame 3 based on the window > > list alone. > > > Any thoughts on how to solve the problem? > > > One approach is to have the frame title be based on more than just the > > name of the currently selected buffer. So for example, if a frame has > > two windows with buffers 'a.sls' and '*scheme*', the frame could be > > called "[a.sls] | *scheme*". I.e. with the [...] indicating which > > buffer in that frame is active. > > > I'm sure there are other approaches as well! Comments, suggestions, > > and elisp welcome! :-) > > > Ed > > I think this will do what you want, it works for me anyway: > > (defun window-to-buffer-name (w) > =A0 (buffer-name (window-buffer w))) > > (setq frame-title-format > =A0 =A0 =A0 '("" (:eval (mapconcat #'window-to-buffer-name > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(window-list) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0" | ")))) > > The selected-window is always the first element in window-list by > default. Thanks for that -- Neat!