how to get emacs background color
Asked Answered
K

1

6

Specifically I am trying to make below codes work: the problem is that term-default-bg-color (close to the end of code block) doesn't seem to exist universally so I am trying to get emacs background color and use that

(defun low-lock-face-phrase-buffer (regexp )
  "Set face of each match of phrase REGEXP to term-default-bg-color to dim it;
  internally it calls to hi-lock-face-phrase-buffer" 
  (interactive
   (list
    (hi-lock-regexp-okay
     (hi-lock-process-phrase
      (read-regexp "Phrase to dim" (car regexp-history))))))
  (unless hi-lock-mode (hi-lock-mode 1))
  (hi-lock-set-pattern regexp 'term-default-bg-color))
Kaiserdom answered 5/10, 2013 at 18:42 Comment(1)
Can you please provide the missing parts of your function so that others can test it and try to help you find a solution: list: Symbol's function definition is void: hi-lock-regexp-okay. Also, please describe the error you are receiving -- e.g., nothing happens, or a specific error message.Unshackle
H
15

In general, the background color is just (face-attribute 'default :background).

But if you want the background color at a particular position, where there might be one or more faces displayed, then use function eyedrop-background-at-point, from library eyedropper.el.

Henequen answered 5/10, 2013 at 19:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.