emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: info faces for strings and quotations


From: David Kastrup
Subject: Re: info faces for strings and quotations
Date: Thu, 07 Oct 2004 17:13:47 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>> 2. The pb of not interpreting " to begin a string if it is escaped (\") is
>> no doubt fixable, at the risk of complicating the regexp. Suggested fixes
>> welcome.
>
> Prefix the regexp with "\\(^\\|[^\\]\\)\\(\\\\\\\\\\)*".  The (match-end) of
> this regexp is guaranteed to not be preceded by an odd number
> of backspashes.
>
> You can find this regexp used by various major modes for comment-start-skip.

If you don't need regexps, it is usually quite faster just to check
with 
(zerop (mod (save-excursion (skip-chars-backward "\\\\")) 2))
whether you have an even number of preceding backslashes.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

[Prev in Thread] Current Thread [Next in Thread]