emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bruno Barbier <brubar.cs@gmail.com>
To: Daniel Fleischer <danflscr@gmail.com>, emacs-orgmode@gnu.org
Subject: Re: How to add font-lock keywords
Date: Tue, 21 Dec 2021 20:35:22 +0100	[thread overview]
Message-ID: <61c228a1.1c69fb81.c99be.46d6@mx.google.com> (raw)
In-Reply-To: <m2lf0r4cba.fsf@gmail.com>


Daniel Fleischer <danflscr@gmail.com> writes:

> Hi, I want to add custom keywords to be highlighted. I used
>     (font-lock-add-keywords nil '(("books" . org-level-4)) t)
> but nothing happens after I restart orgmode or call 'font-lock-update'.

The following works for me, in an org mode buffer:

| (font-lock-add-keywords nil '(("books" . 'org-level-4)) t)

(I added a quote before the face name).

No need to call font-lock-update or restart: any new or modified text
gets the new fontification.


> -- 
> Daniel Fleischer

  reply	other threads:[~2021-12-21 19:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-11 11:21 Daniel Fleischer
2021-12-21 19:35 ` Bruno Barbier [this message]
2021-12-23  8:20   ` Daniel Fleischer
  -- strict thread matches above, loose matches on Subject: below --
2011-08-23 17:51 how " Le Wang
2011-08-24  1:01 ` John Wiegley
2011-08-24  1:17   ` John Wiegley
2011-08-24  4:25     ` Le Wang

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:

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to=61c228a1.1c69fb81.c99be.46d6@mx.google.com \
    --to=brubar.cs@gmail.com \
    --cc=danflscr@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: How to add font-lock keywords' \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).