Alexander-Miller / treemacs

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

Treemacs won't show. Error (wrong-type-argument lisp "") #1107

Open cogfor opened 4 months ago

cogfor commented 4 months ago

I am having a hard time getting emacs installed with Treemacs as an IDE for Clojure coding. Whatever I try Treemacs does not show, only an empty buffer is visible.

Please let me know what else I can provide to get this resolved.

Emacs installed using Homebrew on MacOSX Sonoma

brew install emacs-plus@29 --with-imagemagick --with-native-comp --with-modern-sexy-v2-icon --with-xwidgets

Using this init.el file: init.el.txt

Reported version (M-x treemacs-version): Treemacs 3.1 Installed 2024.05.16 Emacs 29.3

Steps to reproduce:

Error:

Debugger entered--Lisp error: (wrong-type-argument listp "")
  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 record)
  counsel-M-x-action("treemacs")
  ivy-call()
  ivy-read("M-x " [company-box--max lsp-erlang-ls-server-start-fun lsp-ui-imenu-window-fix-width vls-tramp archive-proper-file-start lsp-pwsh-help-completion Browse\ URL lsp-ui-doc-hide lsp-xmlls-tramp-after-open-hook access-label :maxLength c-electric-lt-gt lsp-rust-analyzer-injected-modifier-face url-cookie-p cc-vars &error rng-parse-validate-file uniquify-rename-buffer tramp-actions-copy-out-of-band eslint-tramp treemacs-persp-scope edebug-mode-on-hook lisp-mode-map lsp-zig-build-on-save-step treemacs--button-symbol-switch c-make-ml-string-opener-re-function smie-config--guess-value company-box--handle-scroll :where which-key--stop-timer browse-url-gnome-moz-arguments byte-condition-case lsp-elixir-suggest-specs xref--push-markers 0 WatchKind lsp:set-rename-params-uri? lsp-pyls-plugins-flake8-hang-closing lsp-ui-find-workspace-symbol lsp--virtual-buffer lsp-typescript-format-insert-space-after-opening-and-before-closing-nonempty-brackets lsp-lua-hint-enable dash-expand:&JSONResponse? :kill-buffer lsp:set-file-operation-pattern-options? Futura xref-group lsp-rust-analyzer-trait-modifier tramp-handle-make-auto-save-file-name evil-command-window-current-buffer ...] :predicate #f(compiled-function (sym) #<bytecode -0x1f3600338bed889>) :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x)
  counsel-M-x()
  funcall-interactively(counsel-M-x)
  command-execute(counsel-M-x)
cogfor commented 4 months ago

Update: When removing the Nano theme, Treemacs seems to start working. Apparently something in the theme breaks Treemacs

Alexander-Miller commented 4 months ago

treemacs--setup-mode-line()

The modeline code is complicated because treemacs supports a few modeline packages that I am not familiar with. Maybe one of them changed its api somehow. Can you tell me where exactly the error is thrown in this function?

Meqeq commented 4 months ago

I had the same problem, but setting treemacs-user-mode-line-format to a random string solved it.

cogfor commented 4 months ago

I can confirm that this indeed fixes the issue. Thanks @Meqeq !

Alexander-Miller commented 4 months ago

I had the same problem, but setting treemacs-user-mode-line-format to a random string solved it.

That's not a proper fix since setting that value just means overriding treemacs' builtin modeline.

Meqeq commented 3 months ago

I know, I just wanted to share this temporary fix. However, I found some time to investigate and discovered the cause. The Nano Emacs theme sets mode-line-format to an empty string using setq-default, and treemacs--setup-mode-line function tries to perform memq on this.

https://github.com/Alexander-Miller/treemacs/blob/923fbbdea57b27ed3293079b13846206add85d9d/src/elisp/treemacs-mode.el#L226

I'm not sure if there should be a check to see if the default value of mode-line-format is a list or if it should be fixed in Nano Emacs. I don't have much experience with elisp.

stale[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had recent activity (this bot only works as a reminder, it will not close issues).

Alexander-Miller commented 1 month ago

I went with the easy solution for now and added a type check. Does that fix the problem?