bug-gnu-emacs
[Top][All Lists]
Advanced

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

Re: dubious phrase in on-line help for skip-chars-forward


From: Kim F. Storm
Subject: Re: dubious phrase in on-line help for skip-chars-forward
Date: 19 Nov 2001 16:38:34 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

erajonj@ki.ericsson.se (Jonas Jarnestrom) writes:

> In skip-chars-forward's doc-string it says:
> 
> STRING is like the inside of a `[...]' in a regular expression
> except that `]' is never special and `\' quotes `^', `-' or `\'
> ==> (but not as the end of a range; quoting is never needed there). <==
> 
> As far as I can see, this assertion doesnt always hold for `-'.
>
A range is something like "x-z", meaning that whatever you use as `z'
does not need to be quoted. 

  
> If I have a buffer string like:
> sdfsdfsd-
> I can skip over it with (skip-chars-forward "a-z-")
> i.e. dash doesnt need quoting. 

That is because `-' is following a character which ends a previous range, so
it does not start an new range; so it will stand for itself.

> However, if I have an expr like (skip-chars-forward "a-zA-Z0-9_.-")
> it stops at the `-'
> 
This is because here the trailing `.-' is a range from `.' (to ?) - in
which case the `-' is not itself part of the set of characters.

> It seems as if I have to quote the trailing dash to get what I want:
> (skip-chars-forward "a-zA-Z0-9_.\\-")
> which according to the on-line doc, should not be needed at the end of
> the range.
> 

Well, the trailing `-' is not at the end of the range; it *is* the range
operator.

So the documentation is correct.

-- 
Kim F. Storm  http://www.cua.dk



reply via email to

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