2013-07-13 57 views
6

Tôi muốn thay đổi thuộc tính khuôn mặt chỉ trong bộ đệm Org-Agenda. Vì vậy, tôi cần phải thay đổi thuộc tính khuôn mặt Org-Agenda bộ đệm cục bộ.Làm cách nào để đặt thuộc tính khuôn mặt bộ đệm cho một bộ đệm cụ thể?

Đây là mã của tôi: (đó là trên toàn cầu)

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

hãy giúp tôi làm bộ đệm này tại địa phương. Cảm ơn

Trả lời

9

Dưới đây là những gì bạn cần làm:

;; 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) 
+0

wow, điều này rất tuyệt vời, cảm ơn rất nhiều. – stardiviner