all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: bojohan+news@gnu.org (Johan Bockgård)
To: help-gnu-emacs@gnu.org
Subject: Re: font-lock-keywords and lines containing comments / quotes
Date: Fri, 26 Feb 2010 22:51:06 +0100	[thread overview]
Message-ID: <87d3zrpsxh.fsf@gnu.org> (raw)
In-Reply-To: mailman.1902.1267156792.14305.help-gnu-emacs@gnu.org

Erik Iverson <eriki@ccbr.umn.edu> writes:

> ;; syntax highlight lines that start with a "*" in the current buffer
> (font-lock-add-keywords nil
> 			'(("^\\*\\{1\\}.*" . font-lock-keyword-face)))

The \\{1\\} is not useful.

> As soon as I type the ; or " characters, the previous part of the line
> becomes "normal" and the comment or quote appears as it should.  I
> would like for the initial part of the line to remain highlighted
> though.

Use the OVERRIDE element.

    (font-lock-add-keywords
     nil '(("^\\*.*" 0 font-lock-keyword-face keep)))


       reply	other threads:[~2010-02-26 21:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1902.1267156792.14305.help-gnu-emacs@gnu.org>
2010-02-26 21:51 ` Johan Bockgård [this message]
2010-02-26  1:57 font-lock-keywords and lines containing comments / quotes Erik Iverson
2010-02-26 15:17 ` Tim Visher
     [not found] ` <mailman.1939.1267197484.14305.help-gnu-emacs@gnu.org>
2010-02-26 18:41   ` despen

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=87d3zrpsxh.fsf@gnu.org \
    --to=bojohan+news@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /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.