help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Frame titles which reflect contents


From: jpkotta
Subject: Re: Frame titles which reflect contents
Date: Tue, 24 Nov 2009 17:26:43 -0800 (PST)
User-agent: G2/1.0

On Nov 22, 10:04 am, Eduardo  Cavazos <address@hidden> 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)
  (buffer-name (window-buffer w)))

(setq frame-title-format
      '("" (:eval (mapconcat #'window-to-buffer-name
                             (window-list)
                             " | "))))

The selected-window is always the first element in window-list by
default.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]