5

具体来说,我正在尝试使以下代码起作用:问题是 term-default-bg-color (接近代码块末尾)似乎并不普遍存在,所以我试图获取 emacs 背景颜色并使用它

(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))
4

1 回答 1

12

一般来说,背景颜色只是(face-attribute 'default :background).

但是,如果您希望在可能显示一个或多个面孔的特定位置使用背景颜色,请使用eyedrop-background-at-pointlibrary中的 function eyedropper.el

于 2013-10-05T19:16:41.257 回答