fix(tabs): wrong-type-arg stringp (Git "...") error
Newer versions of project.el changed the return value of `project-current` to a three-part list, rather than a cons cell. centaur-tabs expects the old signature and we get a type error. This advice ensures centaur-tabs works with old or new versions of project, and is a temporary measure until the issue is resolved upstream. Ref: ema2159/centaur-tabs#181 Fix: #6280
This commit is contained in:
parent
fb1c8eb11d
commit
8b93e8b15c
1 changed files with 14 additions and 1 deletions
|
@ -19,7 +19,20 @@
|
|||
(defun +tabs-disable-centaur-tabs-mode-maybe-h ()
|
||||
"Disable `centaur-tabs-mode' in current buffer."
|
||||
(when (centaur-tabs-mode-on-p)
|
||||
(centaur-tabs-local-mode)))))
|
||||
(centaur-tabs-local-mode))))
|
||||
|
||||
(defadvice! +tabs--fixed-centaur-tabs-project-name-a ()
|
||||
:override #'centaur-tabs-project-name
|
||||
(let ((project-name (cdr (project-current))))
|
||||
;; In earlier versions of project.el, `project-current' returned a cons
|
||||
;; cell (VCBACKEND . PROJECTROOT). In more recent versions it returns
|
||||
;; (TYPE VCBACKEND PROJECTROOT), which throws an error.
|
||||
;; REVIEW This should be upstreamed.
|
||||
(when (listp project-name)
|
||||
(setq project-name (cadr project-name)))
|
||||
(if project-name
|
||||
(format "Project: %s" (expand-file-name project-name))
|
||||
centaur-tabs-common-group-name))))
|
||||
|
||||
|
||||
;; TODO tab-bar-mode (emacs 27)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue