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).

ただし、1 つ以上の面が表示される可能性がある特定の位置に背景色が必要な場合はeyedrop-background-at-point、ライブラリのfunction を使用しますeyedropper.el

于 2013-10-05T19:16:41.257 に答える