all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: Uwe Brauer <oub@mat.ucm.es>
Cc: emacs-orgmode@gnu.org
Subject: Re: how to set faces?
Date: Tue, 28 Sep 2010 18:10:31 +0200	[thread overview]
Message-ID: <9C69B4E8-6CB3-4DF2-BBA0-84D9B56547A4@gmail.com> (raw)
In-Reply-To: <878w2nxz4m.fsf@gilgamesch.quim.ucm.es>


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	other threads:[~2010-09-28 16:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-27 10:24 how to set faces? Uwe Brauer
2010-09-28 16:10 ` Carsten Dominik [this message]
2010-09-28 17:48   ` Uwe Brauer
2010-09-28 17:53     ` Carsten Dominik
2010-09-28 20:12       ` Uwe Brauer
  -- strict thread matches above, loose matches on Subject: below --
2010-09-28 16:56 Carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9C69B4E8-6CB3-4DF2-BBA0-84D9B56547A4@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=oub@mat.ucm.es \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.