[Top][All Lists]

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

Re: Word search

From: Stefan Monnier
Subject: Re: Word search
Date: Mon, 10 Mar 2008 14:34:35 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

>>> It also gets rid of all trickery used to read the first character
>>> typed in the minibuffer (that removes another set of problems;
>>> see related old bug reports).  It adds a new backward-compatible
>>> command `isearch-edit-string-set-word' bound to C-w in the minibuffer
>>> that calls `kill-region' when the mark is active, and otherwise does
>>> word search after exiting `isearch-edit-string' (the mark is not active
>>> when `isearch-edit-string' just created the minibuffer, and without
>>> the mark `kill-region' would fail anyway).
>>> This preserves the behavior described in the Emacs manual:
>>> `C-s <RET> C-w WORDS <RET>'
>>> Search for WORDS, ignoring details of punctuation.
>> This seems unrelated, right?

> This is slightly related, but now I see it can be installed with
> a separate patch.

>> It looks like a good change.  But I wonder why we don't use an approach
>> similar to the M-r binding to isearch-toggle-regexp.

> Keeping C-w to specify word search in the minibuffer is necessary
> for backward compatibility.  When we find a better method to toggle
> word search, we could remove the description of the old method
> from the manual, and remove its code in later releases.

Backward compatibility with old elisp packages is important.
Backward compatibility with old Emacs users is a bit less important.

>> Of course, we'd rather not eat yet-another key (e.g. bind M-w to
>> isearch-toggle-word), but maybe we could change isearch-toggle-regexp
>> into isearch-cycle-regexp-word, such that the command cycles between
>> plain/regexp/word searches.

> One disadvantage of M-r is that it's not mnemonic to toggle word search.
> OTOH, it is convenient to cycle between search types.

> We could also add another keybinding to separately toggle only
> word search `M-s w' and regexp search `M-s r'.  Their key sequences are
> longer than `M-r' but they will allow specifying the exact search type.

Using M-s as a prefix might be a good idea.  What do others think?


reply via email to

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