GNU bug report logs -
#8688
23.2; search-whitespace-regexp not working as documented
Previous Next
Reported by: Worik Stanton <worik.stanton <at> gmail.com>
Date: Tue, 17 May 2011 23:37:02 UTC
Severity: normal
Found in version 23.2
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
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
;; 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.
cheers
Worik
> 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
> confusing.
>
This bug report was last modified 3 years and 171 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.