dholm / tabbar

Tabbar is an emacs minor mode that displays a tab bar at the top, similar to the idea of web browser’s tabs.
http://www.emacswiki.org/emacs/TabBarMode
GNU General Public License v3.0
181 stars 28 forks source link

Hide forward and back buttons #27

Open wpcarro opened 7 years ago

wpcarro commented 7 years ago

I'm new to tabbar and cannot find any information about hiding these forward and back buttons that load with tabbar by default.

Image:

screen shot 2017-06-29 at 11 34 34 am

I've tried the following but to no avail:

  (setq tabbar-hide-header-button t)
  (setq tabbar-use-images nil)

After this the images are removed, but the area persists. Is there a way to remove this area entirely? I do not foresee myself interacting with it.

screen shot 2017-06-29 at 11 38 24 am
zumbalogy commented 6 years ago

This is maybe a bit hackish, and may not work for you, I am new to emacs and this emac's tabbar. But, this works for me, and let me know if you have any problem with it. Also, I apologize that this answer is so late, but hopefully this info is useful to someone.

If I redefine "tabbar-line-buttons", found here https://github.com/dholm/tabbar/blob/master/tabbar.el#L1119 with something like

(defsubst tabbar-line-buttons (tabset)
  "Return a list of propertized strings for tab bar buttons.
TABSET is the tab set used to choose the appropriate buttons."
  (list
   (if tabbar-home-function
       (car tabbar-home-button-value)
     (cdr tabbar-home-button-value))
   tabbar-separator-value))

then I am able to get rid of the back and forth buttons.

I am also considering hiding the home button as well, since you can scroll while hovering over the tab bar to see other groups (and I only have 2 groups, one for default emacs buffers, and one for the rest of them (all the files I have opened))

Hope this helps!

PS: You might have to restart emacs to have this change take effect. Also, you can see my emacs settings here https://github.com/zumbalogy/emacs_settings/blob/master/tabs.el

zumbalogy commented 6 years ago

Hello again. If anybody wants to get rid of all 3 buttons, and they have button borders/dividers, but still want the left most tab to be flush against whatever its against, the following code might be best:

(defsubst tabbar-line-buttons (tabset)
  "Return a list of propertized strings for tab bar buttons.
TABSET is the tab set used to choose the appropriate buttons."
  (list (propertize "")))

and, if you set your tabbar-separator color to be the same as the tabbar background color, then it will appear as if you have no dangling right separator as well.

(set-face-attribute 'tabbar-separator nil
                    :box '(:line-width 5 :color "#1c1e24" :style nil))

but you will have to change #1c1e24 to whatever color works for you.

yqrashawn commented 5 years ago
  (customize-set-variable 'tabbar-scroll-right-button '(("") ""))
  (customize-set-variable 'tabbar-scroll-left-button '(("") ""))
  (customize-set-variable 'tabbar-buffer-home-button '(("") ""))