How to set the local boundary buffer attribute for a specific buffer?

I want to change the face attribute only in the Org-Agenda buffer. Therefore, I need to change the local attribute attribute locally .

Here is my code: (which is global)

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

Please help me make this buffer locally. Thanks

+6
source share
1 answer

Here is what you need to do:

 ;; 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) 
+9
source

Source: https://habr.com/ru/post/949360/


All Articles