[Top][All Lists]

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

bug#8688: 23.2; search-whitespace-regexp not working as documented

From: Worik Stanton
Subject: bug#8688: 23.2; search-whitespace-regexp not working as documented
Date: Thu, 19 May 2011 07:29:54 +1200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20110424 Thunderbird/3.1.10

On 18/05/11 19:15, Glenn Morris wrote:
Worik Stanton wrote:

I set search-whitespace-regexp to [ \t\r\n]+ in customise as suggested
in the documentation but when I do a isearch-forward-regexp the space
character only matches a literal space.

  '(search-whitespace-regexp "[ \\t\\r\\n]+"))

is the line from .emacs
I think you're being confused by the way customize treats regexps (it
confuses me as well; I'm not sure it is helpful). There is extra
escaping in the setting of search-whitespace-regexp that is written to
your .emacs. It should be:

   '(search-whitespace-regexp "[ \t\r\n]+"))

The doc of search-whitespace-regexp says:

   In the Customization buffer, that is `[' followed by a space,
   a tab, a carriage return (control-M), a newline, and `]+'

If you literally use that input, does it work?
Yes. I copied the string direct from the documentation. Perhaps this is a bug in the documentation?

Also I uncovered another bug, I guess it could be described as aesthetic. I changed the "custom-set-variables" command to...

  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(delete-by-moving-to-trash t)
 '(save-place t nil (saveplace))
 '(search-whitespace-regexp "[ \t\r\n]+"))

And executed it.  (regex-search works as expected now).

But C-h v search-whitespace-regexp  says it is set to...

search-whitespace-regexp's value is "[     ^M\n]+"

I was about to report that the custom-set-variables command did not work...

Thanks for your help, all the serious problems are solved.


Oh, it's not possible to type a TAB, or ctrl-M, or newline, in a custom
field, since it moves you out of the editable field... This is even more

reply via email to

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