emacs-devel
[Top][All Lists]
Advanced

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

Re: Tabs


From: Juri Linkov
Subject: Re: Tabs
Date: Sun, 06 Oct 2019 01:12:07 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)

> What I didn't get working is to show tabs only for Info buffers and hide
> it for all others.  Whatever I tried tabs are either displayed in every
> window or in none.
>
> This is what I have so far:
>
> #+begin_src emacs-lisp
> (customize-set-variable 'tab-bar-show 1)
> (setq-default tab-bar-tabs-function #'ignore)
> (add-hook 'Info-mode-hook
>           (defun my-Info-mode-hook-configure-tab-bar ()
>             (setq-local
>              tab-bar-tabs-function
>              (lambda ()
>                (mapcan
>                 (lambda (b)
>                   (when (with-current-buffer b (derived-mode-p 'Info-mode))
>                     (list `(,(if (eq b (current-buffer)) 'current-tab 'tab)
>                             (name . ,(buffer-name b))
>                             (binding . (lambda () (interactive) 
> (switch-to-buffer ,b)))
>                             (close-binding . (lambda () (interactive) 
> (kill-buffer ,b) (force-mode-line-update)))))))
>                 (buffer-list))))))
> #+end_src
>
> Can I get it work?

I tried your code, and it works fine: tabs are shown only when
the current buffer is in Info mode, and hidden when the selected window's
buffer is in other modes.



reply via email to

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