Alexander-Miller / treemacs

GNU General Public License v3.0
2.09k stars 153 forks source link

Treemacs + Doom Modeline on emacs 29.1 #1047

Closed gmemstr closed 1 year ago

gmemstr commented 1 year ago

After updating past commit aa0944a29eee48302fd76b6c3a59c5aece114fa6, I encountered the same error describe here: https://github.com/Alexander-Miller/treemacs/issues/1046. Interestingly, despite a patch being pushed and confirming I am using the latest commit, I still encounter the error. Rolling back to before the doom modeline patches resolves the issue.

I am using https://github.com/hlissner/emacs-hide-mode-line, which is maybe the only "special" bit of my setup in regards to the modeline, with the relevant init.el config:

(use-package hide-mode-line :straight t)

(add-hook 'treemacs-mode-hook #'hide-mode-line-mode)
(use-package treemacs
  :straight t
  :init (with-eval-after-load 'winum
          (define-key winum-keymap (kbd "M-0") #'treemacs-select-window))
  :bind
  (:map global-map
        ("M-0" . treemacs-select-window)
        ("C-x t t" . treemacs)
        ("C-x t C-t" . treemacs-find-file)))
(use-package treemacs-projectile
  :straight t
  :after (treemacs projectile))
(use-package treemacs-magit
  :straight t
  :after (treemacs magit)
  :ensure t)
(use-package treemacs-icons-dired
  :straight t
  :hook (dired-mode . treemacs-icons-dired-enable-once)
  :ensure t)

However removing the hook doesn't have any impact.

I do plan to dig into this more after work but wanted to file an issue so I don't forget.

sebastiaanspeck commented 1 year ago

Do you have a workspace set? What is the result of (treemacs-workspace->name (treemacs-current-workspace))? If that returns nil, maybe test if this works for you: (propertize (format " %s " (or (treemacs-workspace->name (treemacs-current-workspace)) ""))))

gmemstr commented 1 year ago

@sebastiaanspeck I do indeed have a workspace set

image

gmemstr commented 1 year ago

(To aide in replication if needed my entire init.el is here: https://git.gmem.ca/arch/dotfiles/src/branch/master/.emacs.d/init.el)

sebastiaanspeck commented 1 year ago

Maybe a backtrace could help to investigate this further? Other people reported that Treemacs is fixed with the latest patch

gmemstr commented 1 year ago
Debugger entered--Lisp error: (void-variable treemacs)
  treemacs--setup-mode-line()
  #<subr treemacs-mode>()
  treemacs--mode-check-advice(#<subr treemacs-mode>)
  apply(treemacs--mode-check-advice #<subr treemacs-mode> nil)
  treemacs-mode()
  treemacs--init()
  treemacs(nil)
  funcall-interactively(treemacs nil)
  command-execute(treemacs)

I'm not sure if I can get more granular than that unfortunately, I'm not super experienced with debugging elisp.

sebastiaanspeck commented 1 year ago
Treemacs

This is the issue... maybe need some help from the author of doom-modeline how to fix this?

sebastiaanspeck commented 1 year ago
image

This is a way without errors/warnings. Not sure if this is the nicest way..

shakor0 commented 1 year ago

Yeah my treemacs broke when adding: (use-package doom-modeline :init (doom-modeline-mode 1) :custom ((doom-modeline-height 15)))

Dawnblaze commented 1 year ago

I had the same problem, but i run treemacs first, and then run doom-modeline, then this problem was solved.

jtl5770 commented 1 year ago

I had the same problem, but i run treemacs first, and then run doom-modeline, then this problem was solved.

I actually have no idea how to do that with using use-package in my init.el. I tried switching the order of the respective calls around, but to no big surprise, it didn't change anything

sebastiaanspeck commented 1 year ago

"Fix" is merged (reverted the breaking change). Please test the latest version

sebastiaanspeck commented 1 year ago

IMG_1083

right now, the rhs shows invalid. That’s because the rhs is an empty list. This looks like the perfect place to show the current workspace name. Please take a look at https://github.com/Alexander-Miller/treemacs/pull/1049 to see if this works for you!