[Top][All Lists]

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

Re: How to really escape a double quote?

From: David Kastrup
Subject: Re: How to really escape a double quote?
Date: Sat, 26 Feb 2011 10:00:22 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Kevin Rodgers <address@hidden> writes:

> On 2/24/11 5:00 PM, David Kastrup wrote:
> ...
>> ^ loses its special meaning if it is not the first character of the
>> string.  So move your escaped double-quote one position to the right.
> I didn't know that!  Here's the reference from (elisp)Regexp Special:
>      For historical compatibility reasons, `^' can be used only at the
>      beginning of the regular expression, or after `\(', `\(?:' or
>      `\|'.

You are looking in a non-obvious place for information which you then
somehow map to the required one, making it appear like using Emacs is a
black art.  It would suffice to consult the DOC string of the function
in question:

skip-chars-forward is a built-in function in `C source code'.

(skip-chars-forward STRING &optional LIM)

Move point forward, stopping before a char not in STRING, or at pos LIM.
STRING is like the inside of a `[...]' in a regular expression
except that `]' is never special and `\' quotes `^', `-' or `\'
 (but not at the end of a range; quoting is never needed there).
Thus, with arg "a-zA-Z", this skips letters stopping before first nonletter.
With arg "^a-zA-Z", skips nonletters stopping before first letter.
Char classes, e.g. `[:alpha:]', are supported.

Returns the distance traveled, either zero or positive.


David Kastrup

reply via email to

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