all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: help-gnu-emacs@gnu.org
Subject: Re: Best way to detect font-lock mode is on?
Date: Mon, 10 Jan 2011 12:39:01 -0500	[thread overview]
Message-ID: <jwvwrmcacf0.fsf-monnier+gnu.emacs.help@gnu.org> (raw)
In-Reply-To: 87aajfbx8x.fsf@puma.rapttech.com.au

>> syntax-ppss is supposed to automatically flush the (relevant part of)
>> the cache after any buffer modification.  The only exceptions are when
>> the buffer is modified in a context where inhibit-modification-hooks is
>> set (e.g. font-lock-syntactic-keywords).
> hmm, that is interesting. I was getting a problem where characters were
> being incorrectly classified as comments when I ran syntax-ppss if I
> didn't also run syntax-ppss-flush-cache before calling syntax-ppss, but
> the characters were not being fontified as comments. If font-lock is
> using the same mechanism, I would have expected more consistency

Indeed.

> - must be something else going on.

My point exactly.  If you can come up with a recipe that reproduces it,
we can probably help track down the origin of the problem.

> Ah, must have missed that - didn't realise there was a local variable
> called font-lock-mode. Much better solution. thanks.

(Almost) all minor modes have both a function and a variable of the same
name, where the variable stores the state (on/off) of the mode.
Check the Minor mode section in the Elisp manual.


        Stefan


  reply	other threads:[~2011-01-10 17:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-03  2:51 Best way to detect font-lock mode is on? Tim X
2011-01-03  4:59 ` Stefan Monnier
2011-01-03  6:08   ` Tim X
2011-01-05  5:50     ` Stefan Monnier
2011-01-05  7:55       ` Tim X
2011-01-10 17:39         ` Stefan Monnier [this message]
2011-01-05 14:52       ` Elena
2011-01-10 17:40         ` Stefan Monnier
2011-01-12  3:46 ` Ilya Zakharevich
2011-01-12 15:45   ` Stefan Monnier
2011-01-13  1:21   ` Tim X
2011-01-14  1:35     ` Ilya Zakharevich
2011-01-14  6:59       ` Tim X
2011-01-15  7:54         ` Ilya Zakharevich

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=jwvwrmcacf0.fsf-monnier+gnu.emacs.help@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --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.