unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* About tab-line-mode
@ 2022-01-31 19:33 Angelo Graziosi
  2022-01-31 20:30 ` Juri Linkov
  0 siblings, 1 reply; 6+ messages in thread
From: Angelo Graziosi @ 2022-01-31 19:33 UTC (permalink / raw)
  To: emacs-devel@gnu.org

[-- Attachment #1: Type: text/plain, Size: 1231 bytes --]

I have a few questions about tab-line-mode.

1. How to group tabs? 
I want that when I work with a .f90 file the tab line shows all buffers I have visited in that mode and that are open. When I switch to an .sh buffer it should show all buffers in that mode etc.. BUT How to switch? I do not want a M-x COMMAND but the tab line should show a button (similar to the < > arrows) that when clicked displays the tab line NOT with buffer but with mode: F90, Shell, Latex, C etc..

Maybe all this is already there and I wasn't able to find it..

2. How to increase the size of the font with which buffers are displayed on the tab line? 
In my case it is too small (see attachment). How to change the font there? In my init.el I have

(set-frame-font "JetBrains Mono-11" nil t)

(setq default-frame-alist
      '(
        [...]
        (font . "JetBrains Mono-11") ; font
        ))

but it does not help.

I have noticed that when I close the tab relative to a buffer, the buffer it is not closed: clicking the '+' on the right of the last tab, the buffer  is still there and in the 

menu Buffer - List All Buffers

To avoid this I have to 'Close' the buffer via File menu...


All the above permanently in the init.el..

Ciao,
 Angelo.

[-- Attachment #2: tab_line-font-too_small.png --]
[-- Type: image/png, Size: 16198 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: About tab-line-mode
  2022-01-31 19:33 About tab-line-mode Angelo Graziosi
@ 2022-01-31 20:30 ` Juri Linkov
  2022-01-31 22:03   ` Angelo Graziosi
  0 siblings, 1 reply; 6+ messages in thread
From: Juri Linkov @ 2022-01-31 20:30 UTC (permalink / raw)
  To: Angelo Graziosi; +Cc: emacs-devel@gnu.org

> I have a few questions about tab-line-mode.
>
> 1. How to group tabs?
> I want that when I work with a .f90 file the tab line shows all
> buffers I have visited in that mode and that are open.  When I switch
> to an .sh buffer it should show all buffers in that mode etc.. BUT How
> to switch?  I do not want a M-x COMMAND but the tab line should show
> a button (similar to the < > arrows) that when clicked displays the
> tab line NOT with buffer but with mode: F90, Shell, Latex, C etc..
>
> Maybe all this is already there and I wasn't able to find it..

Indeed, this is already there.  Please try to customize
‘tab-line-tabs-function’ to ‘tab-line-tabs-buffer-groups’
("Grouped buffers").

> 2. How to increase the size of the font with which buffers are displayed on the tab line? 
> In my case it is too small (see attachment). How to change the font there? In my init.el I have
>
> (set-frame-font "JetBrains Mono-11" nil t)
>
> (setq default-frame-alist
>       '(
>         [...]
>         (font . "JetBrains Mono-11") ; font
>         ))
>
> but it does not help.

Maybe, it would be sufficient for your needs to just customize the face
‘tab-line’ and change its attribute ‘:height 0.9’ to the default height
‘:height 1.0’.

> I have noticed that when I close the tab relative to a buffer, the
> buffer it is not closed: clicking the '+' on the right of the last
> tab, the buffer is still there and in the
>
> menu Buffer - List All Buffers
>
> To avoid this I have to 'Close' the buffer via File menu...

This is possible to customize as well - you can change the value
of ‘tab-line-close-tab-function’ from ‘bury-buffer’ to ‘kill-buffer’.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: About tab-line-mode
  2022-01-31 20:30 ` Juri Linkov
@ 2022-01-31 22:03   ` Angelo Graziosi
  2022-02-01  0:31     ` Angelo Graziosi
  0 siblings, 1 reply; 6+ messages in thread
From: Angelo Graziosi @ 2022-01-31 22:03 UTC (permalink / raw)
  To: Juri Linkov; +Cc: emacs-devel@gnu.org

> Il 31/01/2022 21:30 Juri Linkov ha scritto:
> 
>  
> > I have a few questions about tab-line-mode.
> >
> > 1. How to group tabs?
> > I want that when I work with a .f90 file the tab line shows all
> > buffers I have visited in that mode and that are open.  When I switch
> > to an .sh buffer it should show all buffers in that mode etc.. BUT How
> > to switch?  I do not want a M-x COMMAND but the tab line should show
> > a button (similar to the < > arrows) that when clicked displays the
> > tab line NOT with buffer but with mode: F90, Shell, Latex, C etc..
> >
> > Maybe all this is already there and I wasn't able to find it..
> 
> Indeed, this is already there.  Please try to customize
> ‘tab-line-tabs-function’ to ‘tab-line-tabs-buffer-groups’
> ("Grouped buffers").
> 
> > 2. How to increase the size of the font with which buffers are displayed on the tab line? 
> > In my case it is too small (see attachment). How to change the font there? In my init.el I have
> >
> > (set-frame-font "JetBrains Mono-11" nil t)
> >
> > (setq default-frame-alist
> >       '(
> >         [...]
> >         (font . "JetBrains Mono-11") ; font
> >         ))
> >
> > but it does not help.
> 
> Maybe, it would be sufficient for your needs to just customize the face
> ‘tab-line’ and change its attribute ‘:height 0.9’ to the default height
> ‘:height 1.0’.
> 
> > I have noticed that when I close the tab relative to a buffer, the
> > buffer it is not closed: clicking the '+' on the right of the last
> > tab, the buffer is still there and in the
> >
> > menu Buffer - List All Buffers
> >
> > To avoid this I have to 'Close' the buffer via File menu...
> 
> This is possible to customize as well - you can change the value
> of ‘tab-line-close-tab-function’ from ‘bury-buffer’ to ‘kill-buffer’.

Thanks for suggestions! I added this to the init file, an it seems to work

;; Native buffer tabs setup
(global-tab-line-mode 1)

(setq tab-line-tabs-function 'tab-line-tabs-buffer-groups)
(setq tab-line-close-tab-function 'kill-buffer)

(set-face-attribute 'tab-line nil :height 1.0)

Is that what you had in mind?

Thanks..



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: About tab-line-mode
  2022-01-31 22:03   ` Angelo Graziosi
@ 2022-02-01  0:31     ` Angelo Graziosi
  2022-02-01 19:43       ` Juri Linkov
  0 siblings, 1 reply; 6+ messages in thread
From: Angelo Graziosi @ 2022-02-01  0:31 UTC (permalink / raw)
  To: Juri Linkov; +Cc: emacs-devel@gnu.org


> Il 31/01/2022 23:03 Angelo Graziosi ha scritto:
> 
>  
> > Il 31/01/2022 21:30 Juri Linkov ha scritto:
> > 
> >  
> > > I have a few questions about tab-line-mode.
> > >
> > > 1. How to group tabs?
> > > I want that when I work with a .f90 file the tab line shows all
> > > buffers I have visited in that mode and that are open.  When I switch
> > > to an .sh buffer it should show all buffers in that mode etc.. BUT How
> > > to switch?  I do not want a M-x COMMAND but the tab line should show
> > > a button (similar to the < > arrows) that when clicked displays the
> > > tab line NOT with buffer but with mode: F90, Shell, Latex, C etc..
> > >
> > > Maybe all this is already there and I wasn't able to find it..
> > 
> > Indeed, this is already there.  Please try to customize
> > ‘tab-line-tabs-function’ to ‘tab-line-tabs-buffer-groups’
> > ("Grouped buffers").
> > 
> > > 2. How to increase the size of the font with which buffers are displayed on the tab line? 
> > > In my case it is too small (see attachment). How to change the font there? In my init.el I have
> > >
> > > (set-frame-font "JetBrains Mono-11" nil t)
> > >
> > > (setq default-frame-alist
> > >       '(
> > >         [...]
> > >         (font . "JetBrains Mono-11") ; font
> > >         ))
> > >
> > > but it does not help.
> > 
> > Maybe, it would be sufficient for your needs to just customize the face
> > ‘tab-line’ and change its attribute ‘:height 0.9’ to the default height
> > ‘:height 1.0’.
> > 
> > > I have noticed that when I close the tab relative to a buffer, the
> > > buffer it is not closed: clicking the '+' on the right of the last
> > > tab, the buffer is still there and in the
> > >
> > > menu Buffer - List All Buffers
> > >
> > > To avoid this I have to 'Close' the buffer via File menu...
> > 
> > This is possible to customize as well - you can change the value
> > of ‘tab-line-close-tab-function’ from ‘bury-buffer’ to ‘kill-buffer’.
> 
> Thanks for suggestions! I added this to the init file, an it seems to work
> 
> ;; Native buffer tabs setup
> (global-tab-line-mode 1)
> 
> (setq tab-line-tabs-function 'tab-line-tabs-buffer-groups)
> (setq tab-line-close-tab-function 'kill-buffer)
> 
> (set-face-attribute 'tab-line nil :height 1.0)
> 
> Is that what you had in mind?
> 
> Thanks..

I have a few more questions.

a. When I am in a mode with more tabs, selecting one tab it becomes the most left tab, near the mode button. Is there a setting to left the tab at its position? How are the tabs ordered? When I have multiple tabs open in a browser they remain there, don't move to the most left position just because I have selected one of them..

b. When a buffer is modified and not saved, one expects the tab changes some of its elements, usually a "star" shows up or the buffer name change color. Is there a setting to have this?

I am afraid of all this questions but I'm almost done..



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: About tab-line-mode
  2022-02-01  0:31     ` Angelo Graziosi
@ 2022-02-01 19:43       ` Juri Linkov
  2022-02-02 16:12         ` Angelo Graziosi
  0 siblings, 1 reply; 6+ messages in thread
From: Juri Linkov @ 2022-02-01 19:43 UTC (permalink / raw)
  To: Angelo Graziosi; +Cc: emacs-devel@gnu.org

>> Thanks for suggestions! I added this to the init file, an it seems to work
>> 
>> ;; Native buffer tabs setup
>> (global-tab-line-mode 1)
>> 
>> (setq tab-line-tabs-function 'tab-line-tabs-buffer-groups)
>> (setq tab-line-close-tab-function 'kill-buffer)
>> 
>> (set-face-attribute 'tab-line nil :height 1.0)
>> 
>> Is that what you had in mind?

Exactly.

> I have a few more questions.
>
> a. When I am in a mode with more tabs, selecting one tab it becomes the
> most left tab, near the mode button. Is there a setting to left the tab at
> its position? How are the tabs ordered? When I have multiple tabs open in
> a browser they remain there, don't move to the most left position just
> because I have selected one of them..

There is a variable for sorting tabs too, so you could set it to e.g.:

(setq tab-line-tabs-buffer-group-sort-function
      (lambda (a b)
	(string< (buffer-name a) (buffer-name b))))

> b. When a buffer is modified and not saved, one expects the tab
> changes some of its elements, usually a "star" shows up or the buffer
> name change color.  Is there a setting to have this?

There is a setting for this as well.  When the list in
'tab-line-tab-face-functions' contains the function
'tab-line-tab-face-modified' then the modified file buffer is
highlighted with the face 'tab-line-tab-modified'.

This is enabled by default.  But I noticed that this is
not supported when 'tab-line-tabs-function' is customized to
'tab-line-tabs-buffer-groups'.  Now this is fixed in master,
so you can have the cake and eat it too.

> I am afraid of all this questions but I'm almost done..

Thanks for the questions.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: About tab-line-mode
  2022-02-01 19:43       ` Juri Linkov
@ 2022-02-02 16:12         ` Angelo Graziosi
  0 siblings, 0 replies; 6+ messages in thread
From: Angelo Graziosi @ 2022-02-02 16:12 UTC (permalink / raw)
  To: Juri Linkov; +Cc: emacs-devel@gnu.org


> Il 01/02/2022 20:43 Juri Linkov ha scritto:
> 
>  
> >> Thanks for suggestions! I added this to the init file, an it seems to work
> >> 
> >> ;; Native buffer tabs setup
> >> (global-tab-line-mode 1)
> >> 
> >> (setq tab-line-tabs-function 'tab-line-tabs-buffer-groups)
> >> (setq tab-line-close-tab-function 'kill-buffer)
> >> 
> >> (set-face-attribute 'tab-line nil :height 1.0)
> >> 
> >> Is that what you had in mind?
> 
> Exactly.
> 
> > I have a few more questions.
> >
> > a. When I am in a mode with more tabs, selecting one tab it becomes the
> > most left tab, near the mode button. Is there a setting to left the tab at
> > its position? How are the tabs ordered? When I have multiple tabs open in
> > a browser they remain there, don't move to the most left position just
> > because I have selected one of them..
> 
> There is a variable for sorting tabs too, so you could set it to e.g.:
> 
> (setq tab-line-tabs-buffer-group-sort-function
>       (lambda (a b)
> 	(string< (buffer-name a) (buffer-name b))))
> 
> > b. When a buffer is modified and not saved, one expects the tab
> > changes some of its elements, usually a "star" shows up or the buffer
> > name change color.  Is there a setting to have this?
> 
> There is a setting for this as well.  When the list in
> 'tab-line-tab-face-functions' contains the function
> 'tab-line-tab-face-modified' then the modified file buffer is
> highlighted with the face 'tab-line-tab-modified'.
> 
> This is enabled by default.  But I noticed that this is
> not supported when 'tab-line-tabs-function' is customized to
> 'tab-line-tabs-buffer-groups'.  Now this is fixed in master,
> so you can have the cake and eat it too.

Thank you very much! I suspected you had implemented this and for some reason I di not find it. I have built master and it works as expected!

> 
> > I am afraid of all this questions but I'm almost done..
> 
> Thanks for the questions.

I think I have finished!

Ciao,
 Angelo.



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-02-02 16:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-31 19:33 About tab-line-mode Angelo Graziosi
2022-01-31 20:30 ` Juri Linkov
2022-01-31 22:03   ` Angelo Graziosi
2022-02-01  0:31     ` Angelo Graziosi
2022-02-01 19:43       ` Juri Linkov
2022-02-02 16:12         ` Angelo Graziosi

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).