all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Bug using "-" last in `skip-chars-forward'
@ 2003-12-05  1:32 Martin Stjernholm
  0 siblings, 0 replies; 2+ messages in thread
From: Martin Stjernholm @ 2003-12-05  1:32 UTC (permalink / raw)


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

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Bug using "-" last in `skip-chars-forward'
       [not found] <mailman.1144.1070591707.399.bug-gnu-emacs@gnu.org>
@ 2003-12-05 18:07 ` Kevin Rodgers
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Rodgers @ 2003-12-05 18:07 UTC (permalink / raw)


Martin Stjernholm wrote:

> The following bug exists both in Emacs 21.3 and XEmacs 21.4 (patch
> 14):
> 
> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-12-05 18:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.1144.1070591707.399.bug-gnu-emacs@gnu.org>
2003-12-05 18:07 ` Bug using "-" last in `skip-chars-forward' Kevin Rodgers
2003-12-05  1:32 Martin Stjernholm

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.