emacs-devel
[Top][All Lists]
Advanced

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

Re: Tabs


From: Michael Heerdegen
Subject: Re: Tabs
Date: Fri, 25 Oct 2019 13:19:36 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Juri Linkov <address@hidden> writes:

> Do you think we should have global-tab-bar-mode that affects all frames,
> and tab-bar-mode to enable/disable the tab-bar only in the selected frame?

> Analogously, having global-tab-line-mode to enable tab-line in all windows,
> and tab-line-mode to toggle tab-line only in the selected window?

Could be useful maybe.  I've now just found out that what I want is to
use a tab-line, like this:

#+begin_src emacs-lisp
(require 'tab-line)
(setq-default tab-line-format nil)
(setq-default tab-line-close-tab-action #'kill-buffer)

(setq-default
 tab-line-tabs-function
 (defun my-tab-line-get-mode-tabs ()
   (cl-sort
    (let ((mode major-mode))
      (delq nil
            (mapcar
             (lambda (b)
               (and (with-current-buffer b
                      (derived-mode-p mode))
                    (not (string-match-p (rx bos " ")
                                         (buffer-name b)))
                    b))
             (buffer-list))))
            #'string< :key #'buffer-name)))

(defun my-enable-tab-line ()
  (setq-local tab-line-format '(:eval (tab-line-format))))

(dolist (hook '(Info-mode-hook eww-mode-hook))
  (add-hook hook #'my-enable-tab-line))
#+end_src

I think a local tab-line mode doesn't make that much sense currently
since everything, as far as I can see, is programmed around a global tab
bar/line, and using it as I want still requires local setup, so a local
mode per se isn't that useful for me.  FWIW, I think it would be an
improvement when the documentation just told somewhere how the tab-line
can be set up to cover use cases like mine.

I see that you did not have my use case in mind when I e.g. try
`tab-line-switch-to-next-tab': it switches to buffers that are not
displayed in the tab-line, and the tab-line just vanishes.

Maybe there could be different tab-bar/tab-line modes for the different
use cases, or something like that, haven't thought about it.


Thanks,

Michael.



reply via email to

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