[Top][All Lists]

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

Info-search-whitespace (Was: Improvements to `(emacs)File Variables')

From: Juri Linkov
Subject: Info-search-whitespace (Was: Improvements to `(emacs)File Variables')
Date: Fri, 19 Nov 2004 03:23:29 +0200
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:
> Go to the Emacs manual and do a M-s search for "unibyte: *t".

Out of curiosity I looked at what the Emacs manual does say about
unibyte mode and noticed such a problem: Emacs hangs with "unibyte: *t"
Info search string.  This is because Info-search expands it with
Info-search-whitespace to "unibyte:\\(?:\\s-+\\)*t" and on the line

* --unibyte:                             Initial Options.     (line 101)

Emacs goes into a long loop because it tries to match whitespace
\\(?:\\s-+\\)* in extremely many ways.

Perhaps Info-search should search for a string only, not a regexp:
i.e. preprocess a search string with `regexp-quote' before replacing
whitespace with Info-search-whitespace and re-searching for it.

Anyway, the standalone Info reader already doesn't search for a regexp
with the `s' key, and the Emacs Info reader should not differ from it.
Of course, this doesn't prohibit from adding a new command
`Info-search-regexp' (without keybinding) to the Emacs Info reader,
which won't expand whitespace to Info-search-whitespace and will
use a search regexp exactly as specified by the user.

Juri Linkov

reply via email to

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