Wilfred / deadgrep

fast, friendly searching with ripgrep and Emacs
714 stars 46 forks source link

deadgrep faces not registered until first run #124

Closed starenka closed 1 year ago

starenka commented 1 year ago

I'm trying to set dg faces to match my theme colors, but I'm failing miserably.

(load-theme 'twilight-bright t)
(set-face-attribute 'deadgrep-match-face nil :foreground "black" :background "#e3f4ff")

this will fail, because the faces are not present util first deadgrep run

  internal-set-lisp-face-attribute(deadgrep-match-face :foreground "black" 0)
  set-face-attribute(deadgrep-match-face nil :foreground "black" :background "#e3f4ff")
  eval-buffer(#<buffer  *load*-840086> nil "/home/starenka/.emacs.d/visage.el" nil t)  ; Reading at buffer position 1087
  load-with-code-conversion("/home/starenka/.emacs.d/visage.el" "/home/starenka/.emacs.d/visage.el" nil nil)
  load("/home/starenka/.emacs.d/visage.el" nil nil t)
  load-file("/home/starenka/.emacs.d/visage.el")
  load-user-file("visage.el")
  eval-buffer(#<buffer  *load*> nil "/home/starenka/.emacs.d/init.el" nil t)  ; Reading at buffer position 2257
  load-with-code-conversion("/home/starenka/.emacs.d/init.el" "/home/starenka/.emacs.d/init.el" t t)
  load("/home/starenka/.emacs.d/init" noerror nomessage)
  startup--load-user-init-file(#f(compiled-function () #<bytecode 0x156412611681>) #f(compiled-function () #<bytecode 0x156412611619>) t)
  command-line()
  normal-top-level()

I can't see them in list-faces-display and will automagically materialize after first deadgrep invocation. How to set those faces for good? Cheers

// to be frank i started with


(use-package twilight-bright-theme
  :ensure t
  :config
  (custom-theme-set-faces
   'twilight-bright
   '(deadgrep-match-face ((nil :foreground "black" :background "#e3f4ff")))))```

which didn't work either...
starenka commented 1 year ago

ok, silly me... this works

(use-package twilight-bright-theme
  :ensure t
  :custom-face
  (hl-line ((nil :foreground "black" :background "#e3f4ff")))
  (deadgrep-match-face ((nil :foreground "#cf7900" :background "#fdf9f2")))
  :config
  (load-theme 'twilight-bright t)
  (setq company-quickhelp-color-background "white"))