ema2159 / centaur-tabs

Emacs plugin aiming to become an aesthetic, modern looking tabs plugin
GNU General Public License v3.0
755 stars 51 forks source link

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

Closed LionyxML closed 2 years ago

LionyxML commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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

(centaur-tabs-group-by-projectile-project)
kskarthik commented 2 years ago

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

sorawee commented 2 years ago

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

xevrem commented 2 years ago

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

LionyxML commented 2 years ago

Re-opening since this is still an issue.

feluxe commented 2 years ago

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

hlissner commented 2 years ago

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

ema2159 commented 2 years ago

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.