emacs-devel
[Top][All Lists]
Advanced

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

RE: [PATCH] (Or "question"...) isearch-kill-found


From: Drew Adams
Subject: RE: [PATCH] (Or "question"...) isearch-kill-found
Date: Mon, 31 May 2010 12:14:01 -0700

> Every new key we use tends to collide with its current use of "exit
> isearch and run the command globally bound to that key".  I.e. people
> who currently expect C-d/delete to exit isearch and delete 
> the next char will be badly surprised.
> 
> Now, I haven't heard a proposal yet that doesn't suffer from this kind
> of problem...
>
> I'm not sure C-SPC is a good choice (OT1H it's pretty common to use
> C-SPC to exit isearch, so many uses will be affected,

What you're thinking of: `C-s KEY C-w', where KEY exits isearch and sets the
mark at the search-match start.  You use `C-w' only if you want to delete the
selected text.  In `delete-selection-mode', you could use `C-s KEY abcd' to
replace the text with `abcd'.  Or you could extend the active region (`M-f'
etc.).

If you do the search+kill several times in succession: `C-s KEY C-w C-s C-s KEY
C-w...'.  Likewise, for replacements.

What you say about the limitation regarding the choice of KEY is correct.  But a
single-touch chord or key such as `C-SPC' is not a big deal - you just hit it
twice to get the normal effect (almost - there will be an extra mark on the
ring).  Or hit `RET' and then the key: `RET C-SPC'.

The alternative that I proposed does not affect any keys that exit isearch - you
exit it normally, any way you want.  What it does do is leave the mark-setting
on or off until you toggle it, with `C-SPC' during isearch.

IOW, once you've hit `C-SPC' to turn marking on: `C-s RET C-w' or `C-s RET
abcd', where RET could be any other key that exits isearch.  If you do the
search+kill several times in succession: `C-s RET C-w C-s C-s RET C-w...'.  This
is identical to your case above, with RET (or any exiting key) in place of KEY.

So that's the choice I see:

1. a KEY (e.g. C-SPC) to exit and mark

versus

2. a KEY (e.g. C-SPC) to toggle marking

#1 has the disadvantage that KEY can no longer be used to exit normally.  But
that just means you have to hit KEY twice to get the normal behavior.  (Well,
ALMOST the normal behavior, because the first hit adds a position to the mark
ring.)

#2 has the disadvantage that you need to turn it off if you want to do this only
as a one-off action.  But that just means you need to hit KEY a second time.

The choice I think depends on how often you (a) want to exit normally using KEY
versus (b) how often you want to do this only as a one-off.

For #1, each time you would exit normally using KEY you need to hit KEY twice.
For #2, each time you would set mark as a one-off you need to hit KEY twice.

For #2, if you never use this marking feature, then nothing changes for you.
For #1, if you never use KEY to exit normally, then nothing changes for you.

If you use this feature sometimes, but rarely, then change "never" and "nothing"
to "rarely" and "almost nothing".  For people who use this rarely or never, #2
is preferable.





reply via email to

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