2013-10-05 102 views
4

具體來說,我試圖讓下面的代碼工作: 問題是term-default-bg-color(接近代碼塊的結尾)似乎並不普遍存在,所以我試圖獲得emacs背景色並使用它如何獲得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)) 
+0

你能否提供你的函數的缺失部分,以便其他人可以測試它,並試圖幫助你找到一個解決方案:'list:Symbol的函數定義是void:hi-lock-regexp-okay'。此外,請描述您收到的錯誤 - 例如,沒有任何反應或特定的錯誤消息。 – lawlist

回答

9

一般來說,背景顏色只是(face-attribute 'default :background)

但是,如果您想在特定位置(可能會顯示一個或多個面孔)的背景顏色,請使用庫eyedropper.el中的功能eyedrop-background-at-point