ui/tabs: fix recursive load errors & update

An autoload was causing an autoload before their respective packages
could declare they had been loaded, leading to cyclical loading errors.
This commit is contained in:
Henrik Lissner
2019-09-05 13:43:49 -04:00
parent 1031adb6af
commit 7e36c5c2b3
2 changed files with 36 additions and 32 deletions

View File

@@ -1,7 +1,7 @@
;;; ui/tabs/config.el -*- lexical-binding: t; -*-
(use-package! centaur-tabs
:after-call (after-find-file dired-initial-position-hook)
:after-call after-find-file dired-initial-position-hook
:init
(setq centaur-tabs-height 28
centaur-tabs-set-bar 'left
@@ -18,6 +18,37 @@
(add-to-list 'window-persistent-parameters '(tab-buffers . writable))
(defun +tabs-window-buffer-list-fn ()
(centaur-tabs-filter-out
'centaur-tabs-hide-tab-cached
(delq nil
(cl-mapcar #'(lambda (b)
(cond
;; Always include the current buffer.
((eq (current-buffer) b) b)
((buffer-file-name b) b)
((char-equal ?\ (aref (buffer-name b) 0)) nil)
((buffer-live-p b) b)))
(window-parameter nil 'tab-buffers)))))
(defun +tabs-buffer-groups-fn ()
(list
(cond ((or (string-equal "*" (substring (buffer-name) 0 1))
(memq major-mode '(magit-process-mode
magit-status-mode
magit-diff-mode
magit-log-mode
magit-file-mode
magit-blob-mode
magit-blame-mode
)))
"Emacs")
((derived-mode-p 'eshell-mode)
"EShell")
((derived-mode-p 'dired-mode)
"Dired")
((centaur-tabs-get-group-name (current-buffer))))))
(setq centaur-tabs-buffer-list-function #'+tabs-window-buffer-list-fn
centaur-tabs-buffer-groups-function #'+tabs-buffer-groups-fn)