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.
Thanks for that -- Neat!
This is very nice... Thanks!
Ed