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

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

search-spaces-regexp bunches spaces


From: Chong Yidong
Subject: search-spaces-regexp bunches spaces
Date: Tue, 8 Feb 2005 06:17:27 -0500 (EST)
User-agent: SquirrelMail/1.4.3a

When search-spaces-regexp is non-nil, it does not distinguish between an
individual space and any number of spaces.

To reproduce, create a buffer with the contents

a
a

with no trailing whitespace. Then,

M-<
M-: (let ((search-spaces-regexp "[ \n]")) (re-search-forward "a a"))
[search succeeds]
M-<
M-: (let ((search-spaces-regexp "[ \n]")) (re-search-forward "a     a"))
[search still succeeds!]

This behavior makes it impossible to make a space stand for "exactly one
space or one newline," which may be desirable in text modes. Also, the
values "[ \n]" and "[ \n]+" are treated identically, which is rather
strange.

It would make more sense for *each* space to be replaced by
search-spaces-regexp, if search-spaces-regexp is non-nil.

(search-spaces-regexp is a variable that is new to CVS Emacs.)





reply via email to

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