-
Notifications
You must be signed in to change notification settings - Fork 5
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
add ability to setq, and statically define the particle color #9
base: main
Are you sure you want to change the base?
Conversation
2 things:
However, if you initialize it to a |
Alright, I took a look at faces ( I can't figure out how to set a non-color default value, that leaves a blank a) nil (no (defface power-mode-streak-particle-color
'((t :foreground nil
))
"Streak particle color. If nil it uses the foreground text color."
:group 'power)
b) init to valid color ( (defface power-mode-streak-particle-color
'((t :foreground "medium orchid"
))
"Streak particle color. If nil it uses the foreground text color."
:group 'power) Tried to see, referencing here, if I can then get rid of the (face-remap-add-relative 'power-mode-streak-particle-color '(:inherit default))
(face-remap-add-relative 'power-mode-streak-particle-color `(:foreground ,(face-foreground 'default))) You can get the foreground value and use it in an if statement, and it would work the same as the variable form in the current PR ( (if (face-foreground 'power-mode-streak-particle-color )
(face-foreground 'power-mode-streak-particle-color ) ;; would output something like: medium orchid
"else"
) And then instead of (set-face-attribute 'power-mode-streak-particle-color nil :foreground "medium orchid")
|
So yeah, I'm down with the current PR, where you stick the static color in a variable (not a face), |
Thanks for the PR! I think that there's a way to specify
But I'm not 100% sure. |
Thanks for the response, and for the pointer towards using composite types. The composite types do indeed seem to be the way forward here. Apologies for the delay on my end in terms of a response. Composite-Type Behavior (looks good):1)
2) color selection:
🙋 However, let me know what you think about the label for the
|
1: |
2: |
3: No tag, just a nil: |
(defcustom power-mode-streak-particle-color
nil
"Streak particle color. If nil it uses the foreground text color."
:type '(choice (const :tag "Foreground color" nil) color)
:group 'power)
nil init: |
(defcustom power-mode-streak-particle-color
nil
"Streak particle color. If nil it uses the foreground text color."
:type '(choice (const :tag "nil: Use foreground text color" nil) color)
:group 'power)
Choice dropdown: |
(defcustom power-mode-streak-custom-particle-color
nil
"User-defined streak particle color. If nil the foreground text color is used."
:type '(choice color (const nil))
:group 'power)
nil init: Choice dropdown: |
…tatic-particle-color
…vior, in the variable description.
…g-babel code block incorrectly told me to add an additional parenthesis to balance, in the .el it indicates parethesis balancing correctly. Undoing what babel told me, because it's false, breaks things.
This is ready for review: Tested with (use-package power-mode
:ensure t
:straight (:host github :repo "elizagamedev/power-mode.el" :fork (:host github :repo "fxkrait/power-mode.el" :branch "setParticleColor"))) And then a: #+begin_src emacs-lisp :tangle yes
(power-mode)
(setq power-mode-streak-static-particle-color "turquoise")
#+end_src And it works: I removed the 2nd, additional, incorrectly added parenthesis I had put in from 47e0b5b, because I'm 99.99% sure there's a bug in elisp org-mode source blocks parenthesis highlighting. With current main branch, it says a parenthesis is missing: If you remove this balanced portion: (when (< 0 (current-column))
(backward-char)) It then highlights things correctly, and doesn't tell you to incorrectly add an additional parenthesis. In the |
@elizagamedev bump for review Input: (use-package power-mode
:ensure t
:straight (:host github :repo "elizagamedev/power-mode.el" :fork (:host github :repo "fxkrait/power-mode.el" :branch "setParticleColor")))
(setq power-mode-streak-static-particle-color "turquoise")
(setq power-mode-streak-shake-threshold nil)
(setq power-mode-streak-combo-threshold 1)
(setq power-mode-streak-particle-threshold 1)
(power-mode) |
Implementation for #8.
power-mode--foreground-color-before-point
to make it balanced)Behavior look to be OK, from my testing.
Behavior in 4 cases:
1: No setq
2: Setq, valid color
(setq power-mode-streak-particle-color "medium orchid")
3: setq, nil
4: setq, invalid color