2013-07-13 3 views
6

Org-Agendaバッファでのみface属性を変更したいと思います。 したがって、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) 

私はローカルでこのバッファを作るためにしてください。おかげ

答えて

9

は、ここにあなたが何をする必要があるかです:

;; 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

うわー、これは、おかげで非常に、非常に素晴らしいです。 – stardiviner

関連する問題