9

我只想更改 Org-Agenda 缓冲区中的人脸属性。所以我需要在本地更改 Org-Agenda 人脸属性缓冲区

这是我的代码:(这是全球性的)

(defun my-org-agenda-hl-line ()
  (hl-line-mode)
  (set-face-attribute 'hl-line nil
                  :box '(:color "deep pink" :line-width 2))
)
(add-hook 'org-agenda-mode-hook 'my-org-agenda-hl-line)

请帮我在本地制作这个缓冲区。谢谢

4

2 回答 2

12

这是您需要做的:

;; First create new face which is a copy of hl-line-face
(copy-face 'hl-line 'hl-line-agenda-face)

;; Change what you want in this new face 
(set-face-attribute 'hl-line-agenda-face nil
                    :box '(:color "deep pink" :line-width 2))

;; The function to use the new face
(defun my-org-agenda-hl-line ()
  (set (make-local-variable 'hl-line-face) ; This is how to make it local
       'hl-line-agenda-face)
    (hl-line-mode))

;; Finally, the hook
(add-hook 'org-agenda-mode-hook 'my-org-agenda-hl-line)
于 2013-07-13T14:01:17.080 回答
2

尝试face-remap-add-relative

(add-hook 'org-agenda-mode-hook
          (lambda ()
            (hl-line-mode)
            (face-remap-add-relative 'hl-line :box '(:color "deep pink" :line-width 2))))

另请参阅如何修改特定缓冲区的面

于 2020-07-16T03:36:21.400 回答