centaur-tabs icon indicating copy to clipboard operation
centaur-tabs copied to clipboard

[bug] - Emacs 28.1 and 29 - no tabs if inside git folder

Open LionyxML opened this issue 2 years ago • 8 comments

I am running emacs version:

GNU Emacs 29.0.50 (build 1, x86_64-apple-darwin21.4.0, NS appkit-2113.40 Version 12.3 (Build 21E230)) of 2022-03-21

When using a default buffer or a emacs buffer, centaur tabs is working properly: image

But as soon as I open any file, buttons and tabs disappear and only the background stays: image

On the messages buffer I get:

QuitError during redisplay: (eval (centaur-tabs-line)) signaled (wrong-type-argument stringp (Git "~/github/auto-dark-emacs/"))
Error during redisplay: (eval (centaur-tabs-line)) signaled (wrong-type-argument stringp (Git "~/github/auto-dark-emacs/")) [8 times]

It seems to be happening only when I open a file inside GIT directories.

LionyxML avatar Mar 23 '22 01:03 LionyxML

My debug when eval (centaur-tabs-line)

Debugger entered--Lisp error: (wrong-type-argument stringp (Git "~/github/auto-dark-emacs/"))
  expand-file-name((Git "~/github/auto-dark-emacs/"))
  centaur-tabs-project-name()
  centaur-tabs-get-group-name(#<buffer README.md>)
  centaur-tabs-buffer-groups()
  #f(compiled-function (b) #<bytecode -0x12a33519fd1cac41>)(#<buffer README.md>)
  mapcar(#f(compiled-function (b) #<bytecode -0x12a33519fd1cac41>) (#<buffer README.md> #<buffer *scratch*> #<buffer .gitlab-ci.yml> #<buffer *Messages*> #<buffer *Backtrace*>))
  cl-mapcar(#f(compiled-function (b) #<bytecode -0x12a33519fd1cac41>) (#<buffer README.md> #<buffer *scratch*> #<buffer .gitlab-ci.yml> #<buffer *Messages*> #<buffer *Backtrace*>))
  centaur-tabs-buffer-update-groups()
  centaur-tabs-buffer-tabs()
  centaur-tabs-current-tabset(t)
  centaur-tabs-line()
  eval((centaur-tabs-line) t)
  eval-expression((centaur-tabs-line) nil nil 127)
  funcall-interactively(eval-expression (centaur-tabs-line) nil nil 127)
  call-interactively(eval-expression nil nil)
  command-execute(eval-expression)

LionyxML avatar Mar 23 '22 01:03 LionyxML

Ok, I do not understand why, but adding this to my .emacs solved the problem.

(centaur-tabs-group-by-projectile-project)

LionyxML avatar Mar 23 '22 01:03 LionyxML

@LionyxML thanks a lot. (centaur-tabs-group-by-projectile-project) Solved for me too

kskarthik avatar Apr 13 '22 19:04 kskarthik

This issue should be reopened, I think. As @hlissner said in https://github.com/hlissner/doom-emacs/issues/6280:

The reason why [the workaround that uses (centaur-tabs-group-by-projectile-project)] works is it forces centaur-tabs to use projectile instead of project.el. This might work for now, but the issue will resurface when I replace projectile with project.el in the future. Centaur-tabs will need to update its usage of project.el in preparation for the change (since it'll likely be endemic to Emacs 29).

The change that introduces the issue is https://github.com/emacs-mirror/emacs/commit/86969f9658e278ebacb3d625d0309046ff1f2b54. See the GitHub comment for the root cause.

It looks to me, then, that https://github.com/ema2159/centaur-tabs/blob/f4cef95acbd2eb99c8db3b6cdde74a6e0a966a0a/centaur-tabs-functions.el#L1257 should be changed to something like https://github.com/seagle0128/doom-modeline/blob/7d8eb7c44087a62d8dd6e8ba1afc26facd914fbc/doom-modeline-core.el#L1250

sorawee avatar Apr 14 '22 06:04 sorawee

Just an FYI - this bug is now occurring in Emacs 28.1, not just 29

xevrem avatar Apr 18 '22 15:04 xevrem

Re-opening since this is still an issue.

LionyxML avatar Apr 18 '22 23:04 LionyxML

I have the same issue. What can I do if I don't want to enable centaur-tabs-group-by-projectile-project?

feluxe avatar Jun 23 '22 11:06 feluxe

I have the same issue. What can I do if I don't want to enable centaur-tabs-group-by-projectile-project?

Replace/advice centaur-tabs-project-name as I have in https://github.com/doomemacs/doomemacs/commit/8b93e8b15cc081860a8eb156b1584ef60b6bc9e4

hlissner avatar Jun 23 '22 12:06 hlissner

If I'm not wrong, this should be fixed in https://github.com/ema2159/centaur-tabs/commit/7d9fad0daa44ffb2acecf6525759e46e08e35f2c. Please let me know if that's not the case.

ema2159 avatar Sep 27 '22 04:09 ema2159