emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] how to set faces?


From: Carsten Dominik
Subject: Re: [Orgmode] how to set faces?
Date: Tue, 28 Sep 2010 18:10:31 +0200


On Sep 27, 2010, at 12:24 PM, Uwe Brauer wrote:


Hello

The following setting works in lisp mode

(let ((lisp-regexp-4 " ?\\(\\<\\*[a-zA-Z]*\\*\\>\\)"))
  (setq lisp-font-lock-keywords-1
          (append lisp-font-lock-keywords-1
                  (list (list lisp-regexp-4 0
                              'font-lock-log-warn-face t))))
  (setq lisp-font-lock-keywords-2
          (append lisp-font-lock-keywords-2
                  (list (list lisp-regexp-4 0
                              'font-lock-log-warn-face t)))))

Every word surrounded by an * gets highlighted by the
font-lock-log-warn-face.

I tried something similar for org-mode, like

(let ((lisp-regexp-4 " ?\\(\\<\\*[a-zA-Z]*\\*\\>\\)"))
  (setq org-font-lock-keywords
          (append lisp-font-lock-keywords-1


Typo

                  (list (list lisp-regexp-4 0
                              'font-lock-comment-warn-face t)))))


Or

(add-to-list 'org-font-lock-keywords            
'(" ?\\(\\<\\*[a-zA-Z]*\\*\\>\\)" 1 'font-lock-comment-warn-face append t))

Org-mode sets org-font-lock-keywords while the mode is turned
on, locally in each org-mode buffer, because depending on setup,
the keywords can be different in different buffers.

Please take a look at the function org-set-font-lock-defaults,
and in particular use the hook org-font-lock-set-keywords-hook
in order to append your stuff to the variable
org-font-lock-keywords-extra (no, I do not know why
it is called extra - I must have had a reason for it once :-) )

HTH

- Carsten




reply via email to

[Prev in Thread] Current Thread [Next in Thread]