emacsorphanage / helm-swoop

Efficiently hopping squeezed lines powered by Emacs helm interface
GNU General Public License v3.0
688 stars 55 forks source link

Changing faces of helm-swoop results #202

Closed AtomicNess123 closed 2 years ago

AtomicNess123 commented 3 years ago

This is not working in my init to change the faces of helm-swoop. Any help welcome, thanks.

(defface helm-swoop-target-line-face
  '((t (:background "#e3e300" :foreground "#222222")))
  "Face for helm-swoop target line"
  :group 'helm-swoop)
(defface helm-swoop-target-line-block-face
  '((t (:background "#cccc00" :foreground "#222222")))
  "Face for target line"
  :group 'helm-swoop)
(defface helm-swoop-target-word-face
  '((t (:background "#7700ff" :foreground "#ffffff")))
  "Face for target word"
  :group 'helm-swoop)
(defface helm-swoop-line-number-face
  '((t (:foreground "#999999")))
  "Face for line numbers"
  :group 'helm-swoop)
cireu commented 2 years ago

how do you execute this code in your init file? before requiring? after loading helm-swoop? Maybe I can help you if there's a more elaborated example... :thinking:

AtomicNess123 commented 2 years ago

I had it as is. In the meanwhile I found this syntax that seems to work:

(set-face-attribute 'helm-swoop-target-word-face nil
                    :background "#e33987"
                    :foreground 'unspecified
                    :inherit 'isearch)

I am not sure what inherit : 'isearch refers to, maybe you could explain? Thanks!

cireu commented 2 years ago

I had it as is.

I can't understand your code, isn't it just the same code in helm-swoop.el? What kind of customize you did?

I am not sure what inherit : 'isearch refers to, maybe you could explain? Thanks!

Elisp manual says that :inherit would merge the attributes from the give face, just like inheritance in some OO lanugage.

AtomicNess123 commented 2 years ago

It's not exactly the same, in helm-swoop.el it's expressed with defface, but defface does not seem to work when declared in init. Thanks for the :inherit explanation. That means it gets the face parameters from isearch?

cireu commented 2 years ago

Thanks for the :inherit explanation. That means it gets the face parameters from isearch?

Yes, the parameter without explicit modification will inherit from isearch.