Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] doom-modeline-def-segment results in void variable #653

Closed
2 of 3 tasks
sebastiaanspeck opened this issue Aug 11, 2023 · 5 comments
Closed
2 of 3 tasks

[Bug] doom-modeline-def-segment results in void variable #653

sebastiaanspeck opened this issue Aug 11, 2023 · 5 comments
Labels
invalid This doesn't seem right

Comments

@sebastiaanspeck
Copy link
Contributor

Thank you for the bug report

  • I am using the latest version of doom-modeline related packages.
  • I checked FAQ.
  • You may also try reproduce the issue using clean environment and minimal configurations with
    the command emacs -Q.

Bug description

When using (doom-modeline-def-segment) outside of doom-modeline, it triggers the warning void variable. A good example is Alexander-Miller/treemacs#1049. Maybe we need some help for this issue?

Steps to reproduce

Define a new segment outside of doom-modeline.
The name for the segment creates the warning void variable

Expected behavior

Defining a new segment outside of doom-modeline shouldn’t trigger the warning

OS

Windows

Emacs Version

29

Emacs Configurations

No response

Error callstack

No response

Anything else

No response

@sebastiaanspeck sebastiaanspeck added the bug Something isn't working label Aug 11, 2023
@sebastiaanspeck
Copy link
Contributor Author

sebastiaanspeck commented Aug 12, 2023

When using (doom-modeline-def-segment 'name …), the segment can’t be used/found when creating the modeline:

Debugger entered--Lisp error: (error "'name is not a valid segment")
  error("%s is not a valid segment" 'name)
  doom-modeline--prepare-segments(('name))
  doom-modeline-def-modeline(custom (bar " " major-mode) ('name))

Looking at the doom-modeline-var-alist, the segment is in the alist:
(('name. doom-modeline-segment--\'name)

When using (doom-modeline-def-segment “name” …), you can’t find/reference the segment anymore.
doom-modeline-def-modeline(custom (bar " " major-mode) '(“name”) results in a segment with the string “name” instead of the segment.

Looking at the doom-modeline-var-alist, the segment with “name” looks okay, apart of the name:
((”name”. doom-modeline-segment--name)

@seagle0128
Copy link
Owner

Have you byte-compiled doom-modeline?

@sebastiaanspeck
Copy link
Contributor Author

Yes, I did

@seagle0128
Copy link
Owner

I believe doom-modeline-def-segment does work. I tried on Windows, Linux and macOS, with Emacs 28 and 29. I also tested with emacs -Q, and it works well. Please provide all details to reproduce the issue. I didn't catch the points according to the descriptions above. void variable or name is not a valid segment? What's the exact problem and backtrace?

@seagle0128 seagle0128 added invalid This doesn't seem right and removed bug Something isn't working labels Aug 15, 2023
@seagle0128
Copy link
Owner

See Alexander-Miller/treemacs#1049 (comment). Closing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants