[Top][All Lists]

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

Re: Bug using "-" last in `skip-chars-forward'

From: Kevin Rodgers
Subject: Re: Bug using "-" last in `skip-chars-forward'
Date: Fri, 05 Dec 2003 11:07:17 -0700
User-agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv: Gecko/20020406 Netscape6/6.2.2

Martin Stjernholm wrote:

The following bug exists both in Emacs 21.3 and XEmacs 21.4 (patch

1.  Start (X)Emacs with -q -no-site-file.
2.  Create a buffer and type "-" in it.
3.  Go back to the beginning of the buffer.
4.  Evaluate (skip-chars-forward "y-").

The point does not move, whereas I expected it to skip forward past
the "-". That since a "-" last in a normal regexp character
alternative is not special. `skip-chars-forward' does not use quite
the same syntax, but according to the manual that detail should still
be the same.

Furthermore, if "-" in the buffer is replaced with "y", it still
doesn't skip forward past it.

I.e. when the string to `skip-chars-forward' or `skip-chars-backward'
ends with a "-" that doesn't also start it, both it and the preceding
character are ignored.

I'm not sure this is a bug.  The doc string for skip-chars-forward 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).

(skip-chars-forward "y\\-") works, as does (skip-chars-forward "y---").

Since "y-" is not a range, I don't think the parenthetical remark in
the doc string is relevant.

Kevin Rodgers

reply via email to

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