unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Jon Dufresne <jon.dufresne@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: c-mode syntax strings and regexp word boundaries
Date: Fri, 06 Sep 2013 11:44:15 -0400	[thread overview]
Message-ID: <jwvmwnq0xm7.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <CADhq2b7fVcETNAUGDMV5KALf1yAoTKPTdj76=j3JMeqou4AsDg@mail.gmail.com> (Jon Dufresne's message of "Fri, 6 Sep 2013 07:55:08 -0700")

>> This changes the syntax of this "D" from "w" to "|".
> In this simplified example I *want* the entire string "END" to be
> a single end of string syntax.

Yes, I understand.

> It is not part of the actual string, only marks the end of one.
> Instead, I went with only marking the "D" because marking all
> characters appears (to me) to create three string fences when I only
> want one.

Depending on the particular constraints imposed on you, you might get
away with marking the character *after* END as being the string
delimiter.  But that tends to come with its own set of problems, so most
likely, you'll have to live with what you're currently using.

> Ah, ok. Understood. Is it possible to do regexp search of the buffer with
> all text properties ignored?

No.  We have `parse-sexp-lookup-properties' to control whether
syntax-table text-properties are ignored or not by parsing function
(like forward-sexp), but there's no such control for regexp matching.

> Or is there a better way to search for the "END" delimiter? I'll need
> it to work before the buffer is propertized and after the propertized
> buffer changed.

Don't rely on syntax (i.e. things like \b, \>, \<, \s), and instead use
something like "^END\\(?:[^[:alnum:]]\\|\\'\\)".


        Stefan



  reply	other threads:[~2013-09-06 15:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-06  5:14 c-mode syntax strings and regexp word boundaries Jon Dufresne
2013-09-06 12:21 ` Andreas Röhler
2013-09-06 14:07 ` Stefan Monnier
2013-09-06 14:55   ` Jon Dufresne
2013-09-06 15:44     ` Stefan Monnier [this message]
2013-09-06 17:04       ` Jon Dufresne
2013-09-06 20:19 ` Alan Mackenzie
2013-09-06 22:38   ` Jon Dufresne
2013-09-11  8:57   ` Andreas Röhler

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=jwvmwnq0xm7.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=jon.dufresne@gmail.com \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).