I'm using emacs in a text terminal and would like to have an overview over the frames at all times. Something like the tab bar in firefox would be neat. Is that possible somehow?

  • 2
    What do you want out of an overview? A list of all open buffers? The status bar at the top of the screen? Something else? – zck Sep 14 '17 at 16:59
  • not a list of all buffers but a list of all frames. Preferably in a status bar at the top of the screen – Jonas Sep 14 '17 at 17:44

Not entirely sure what the use case is, but something like the following creates a selectable "tab bar" of frames in the header line.:

(require 'cl-lib)
(setq-default header-line-format
         (let ((frames (frame-list)))
            (cl-loop for frame in frames
                     as map = (make-sparse-keymap)
                     do (define-key
                          [header-line mouse-1]
                          `(lambda () (interactive) (select-frame-set-input-focus ,frame)))
                     if (eq frame (selected-frame))
                     collect (propertize
                              (frame-parameter frame 'name)
                              'face '(:foreground "#B8bb26")
                              'keymap map)
                     else collect (propertize
                                   (frame-parameter frame 'name)
                                   'face '(:foreground "#FB4933")
                                   'keymap map))
            " | ")))))
| improve this answer | |
  • Unfortunately this doesn't work for me. It only shows an empty black line on the top of each buffer. Even if I comment out all other customizations. The use-case is to keep the overview over open frames in the same way as e.g. byobu does (e.g. on this image on the bottom i.ytimg.com/vi/rVMn3xk5mcY/maxresdefault.jpg). – Jonas Oct 3 '17 at 14:08
  • @Jonas, I suspect that if you change (string-join to (mapconcat 'identity it will stop being empty. – phils Nov 25 '17 at 23:18
  • @phils darn, you're probably right. I should get used to knowing which functions are in subr-x and which have backward compatibility. – dieggsy Nov 26 '17 at 14:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.