Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

what is <find>?

4 views
Skip to first unread message

patrol

unread,
Jun 3, 2010, 12:40:32 PM6/3/10
to
Hi,
After I did a nonincremental search with M-x search-forward, Emacs
sent me this text message: "You can run the command 'search-forward'
with <find>." Can someone please tell me what "<find>" is? I found
something about "find" in the manual related to dired, but it didn't
look related. And googling <find> is hard because Google ignores
special characters when searching.
Thanks

Pascal J. Bourguignon

unread,
Jun 3, 2010, 1:46:33 PM6/3/10
to
patrol <patro...@hotmail.com> writes:

<find> is the name of the Find key.


If you use X11, you can bind it to a physical key if you know its
keycode with the line:

keycode 78 = Find

in ~/.Xmodmap

You can also ignore it, since with emacs you can bind any key to a command.


So assuming you want to be able to search-forward by typing just: C-c C-s
you can put:

(global-set-key (kbd "C-c C-s") 'search-forward)

in ~/.emacs, or for temporarily try it out:

M-x global-set-key RET C-c C-s search-forward RET

Then if you type:

C-h w search-forward RET

you should see the added key binding.

--
__Pascal Bourguignon__ http://www.informatimago.com/

patrol

unread,
Jun 4, 2010, 9:10:38 AM6/4/10
to
On Jun 3, 1:46 pm, p...@informatimago.com (Pascal J. Bourguignon)
wrote:

Great answer, thanks! I'll definitely do the key binding you suggest,
but I'd also like to be able to duplicate the way incremental search
works, where you can repeatedly press the same key (C-s) to move to
subsequent matches. Would there be a way to set it up where C-c C-s
not only finds the first occurrence of the search string, but pressing
C-c C-s again and again finds subsequent occurrences? Or would that
require some programming with Elisp? Alternatively, I guess I could
just pick a different key binding for the command nonincremental-
repeat-search-forward.

Thanks

Stefan Monnier

unread,
Jun 4, 2010, 10:34:23 AM6/4/10
to
> Great answer, thanks! I'll definitely do the key binding you suggest,
> but I'd also like to be able to duplicate the way incremental search
> works, where you can repeatedly press the same key (C-s) to move to
> subsequent matches. Would there be a way to set it up where C-c C-s
> not only finds the first occurrence of the search string, but pressing
> C-c C-s again and again finds subsequent occurrences? Or would that
> require some programming with Elisp? Alternatively, I guess I could
> just pick a different key binding for the command nonincremental-
> repeat-search-forward.

Makes me wonder: why in the world would you want to use
non-incremental search?


Stefan

patrol

unread,
Jun 4, 2010, 11:07:09 AM6/4/10
to
On Jun 4, 10:34 am, Stefan Monnier <monn...@iro.umontreal.ca> wrote:

> Makes me wonder: why in the world would you want to use
> non-incremental search?

Well, it's a good question. I guess one reason is that I'm just more
used to it from working with other programs (though the future trend
does seem to be incremental searches -- IE8, MS Word 2010). Sometimes
I find the highlighting of multiple-matches distracting when I just
want the next match. I wouldn't say these are strong reasons though,
and I'm sure I'd get used to isearch if I just used it more. I suppose
most Emacs users/developers feel as you do, which would explain why
there's so little key binding support for noninc search commands in
Emacs.

LanX

unread,
Jun 9, 2010, 8:18:54 AM6/9/10
to
> > Makes me wonder: why in the world would you want to use
> > non-incremental search?
>
> Well, it's a good question. I guess one reason is that I'm just more
> used to it from working with other programs (though the future trend
> does seem to be incremental searches -- IE8, MS Word 2010).

Well, why don't you bind C-f (like in most M$ progs) to non-
incremental search and leave C-s where it is?

HTH
Rolf

Joseph Brenner

unread,
Jun 10, 2010, 7:56:56 PM6/10/10
to

LanX <lanx...@googlemail.com> writes:

Well, if he's not one of those whipper-snappers who mouses
all over the place, or if he doesn't want to move his hands
away from home to find the arrow keys, he probably uses
C-f to go forward one character.

Hypothetically, one might re-bind every key throughout emacs
to suit your present expectations, but in practice you run
into severe pain when you go that route.

For example, if you were to try to move search from C-s to
C-f, you may very well find that when you go into another
mode search may have moved back to C-s on you.

Or, suppose you decide you want to "C-n" to do something
besides "next-line", and you want that to happen literally
everywhere, so you very carefully bind next-line to your
desired key in every mode. Now you go into dired, and you
discover that your new key doesn't do what the old "C-n"
used to do, because dired has it's own analog of next-line:
"dired-next-line".

Drew Adams

unread,
Dec 8, 2010, 1:34:52 PM12/8/10
to patrol, help-gn...@gnu.org

Consider filing a bug for this: `M-x report-emacs-bug'. Most keyboards do not
have a <find> key. A better default binding should show up in the help. But it
seems that no other key is bound to `search-forward' by default.

That no other key is bound is probably not a bad thing, but then why bind a key
(<find>) that is basically only logical (doesn't exist for most keyboards)?

You can bind your own key to `search-forward', of course.


0 new messages