all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
Subject: Re: identifiing strings and comments in program source files (to skip them over)
Date: Wed, 26 Apr 2006 02:01:53 -0400	[thread overview]
Message-ID: <871wvkanam.fsf-monnier+gnu.emacs.help@gnu.org> (raw)
In-Reply-To: 11laoqnlgqlxp.80dh81qx3xik.dlg@40tude.net

> I have a mode what uses font-lock-mode and highlights everything nicely. I
> think I could use this (= the face set by font-lock-mode) for identifiing
> if e.g. a search stopped in a string or comment. (I know font-lock-mode
> must be enabled for this.) This way I could omit reparsing the buffer (with
> parse-partial-sexp) e.g. in a function what searches something "real" (=
> strings and comments should be skipped).

You can use this (I've used it in several occasions).
In Emacs-CVS you can also use syntax-ppss which is like parse-partial-sexp
except it does caching (and it's used by font-lock so the cache is already
filled by the font-lock activity).


        Stefan

  parent reply	other threads:[~2006-04-26  6:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-25 21:14 identifiing strings and comments in program source files (to skip them over) Peter Tury
2006-04-26  3:53 ` Thien-Thi Nguyen
2006-04-26  8:04   ` Peter Tury
2006-04-26  6:01 ` Stefan Monnier [this message]
2006-04-26  8:06   ` Peter Tury
  -- strict thread matches above, loose matches on Subject: below --
2006-04-26  6:38 martin rudalics
     [not found] <mailman.964.1146057880.9609.help-gnu-emacs@gnu.org>
2006-04-26 19:05 ` Peter Tury

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