all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Thien-Thi Nguyen <ttn@gnuvola.org>
To: help-gnu-emacs@gnu.org
Subject: Re: does emacs regular expression support (?!expression)
Date: Sat, 04 Feb 2012 16:26:35 +0100	[thread overview]
Message-ID: <87vcnm62ms.fsf@gnuvola.org> (raw)
In-Reply-To: <m3mx8ygb5a.fsf@passepartout.tim-landscheidt.de> (Tim Landscheidt's message of "Sat, 04 Feb 2012 10:12:33 +0000")

() Tim Landscheidt <tim@tim-landscheidt.de>
() Sat, 04 Feb 2012 10:12:33 +0000

   Thien-Thi Nguyen <ttn@gnuvola.org> wrote:

   >    > You can add a spec for ‘ErrorMode’, with default face, prior to this one.

   >    Which Emacs version does support that?

   > Any that processes these specs in the given order, with
   > "masking semantics", i suppose.  (I haven't tried.)

   What does:

   | (search-forward-regexp "\\([Ee][Rr][Rr]\\)\\(?!orMode\\)")

   give on your Emacs?

It throws an error "Invalid regular expression".
Sorry for being unclear.  Here is a reformulation:

"Presuming that Emacs processes the user-specified font-lock specs
in the order given and that once a piece of text is marked as 
fontified, it no longer qualifies for further processing,
one way to "not match ErrorMode but match "Err" is to specify first
"ErrorMode" with the default face (thus simulating "not matching"
and simultaneously making that text unavailable for...), and second
the "Err" with the warning face."

That is, two entries in the list, neither of which use ‘?:’.

So, instead of asking Emacs to look ahead on "Err" and decline to
match if the trailing text is "orMode", you ask Emacs to explicitly
find "ErrorMode" and (quietly) exclude it from future hits when
looking for "Err".  This is like sweeping the path with a glue gun.



  parent reply	other threads:[~2012-02-04 15:26 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-02 14:02 does emacs regular expression support (?!expression) 土星五号
2012-02-02 18:56 ` Tassilo Horn
2012-02-02 21:14   ` Tim Landscheidt
2012-02-02 21:45     ` Tassilo Horn
2012-02-02 22:11       ` Tim Landscheidt
2012-02-02 22:17         ` Tim Landscheidt
2012-02-03  0:37       ` Kevin Rodgers
2012-02-03  2:12         ` 土星五号
2012-02-03  8:30           ` Thien-Thi Nguyen
2012-02-03 11:17             ` Tim Landscheidt
2012-02-03 11:48               ` Thien-Thi Nguyen
2012-02-04 10:12                 ` Tim Landscheidt
2012-02-04 12:16                   ` 土星五号
2012-02-04 15:26                   ` Thien-Thi Nguyen [this message]
2012-02-05 11:57                     ` Tim Landscheidt
2012-02-02 22:09     ` Glenn Morris

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=87vcnm62ms.fsf@gnuvola.org \
    --to=ttn@gnuvola.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.