all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: Xah Lee <xahlee@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: isearch key bindings [was: Why function behaves differently when bound to different key combo?]
Date: Fri, 28 Nov 2008 20:54:09 +0000	[thread overview]
Message-ID: <20081128205409.GB10822@muc.de> (raw)
In-Reply-To: <52652ad0-4657-49d4-ab3e-5066de443801@o40g2000prn.googlegroups.com>

Well, good evening, Xah!

On Fri, Nov 28, 2008 at 06:00:13AM -0800, Xah Lee wrote:
> On Nov 27, 8:38 pm, "seber...@spawar.navy.mil"
> <seber...@spawar.navy.mil> wrote:
> > Normally incremental search can be repeated by pressing C-s multiple
> > times.

> > Why if I remap incremental search to C-f I CANNOT repeat it by
> > pressing C-f multiple times?....

> > Here is how I remapped it...

> > (global-set-key "\^f" 'isearch-forward)

> other mentioned you need to bind isearch-repeart-forward too, but that
> won't work if you just bind them to global map, because when you run
> isearch, you are technically in isearch mino mode.

> Here's what to do. for example, if you want M-s to be isearch, then
> do:

> (global-set-key (kbd "M-s") 'isearch-forward)
> (global-set-key (kbd "M-S") 'isearch-backward)

Yes, but why would anybody want M-s to be isearch?

> (add-hook 'isearch-mode-hook
>  (lambda ()
>  (define-key isearch-mode-map (kbd "M-s") 'isearch-repeat-forward)
>  (define-key isearch-mode-map (kbd "M-S") 'isearch-repeat-backward)

>  (define-key isearch-mode-map (kbd "M-n") 'forward-char) ; was isearch-ring-advance
>  (define-key isearch-mode-map (kbd "M-p") 'kill-word) ; was isearch-
> ring-retreat

>  (define-key isearch-mode-map (kbd "M-c") 'previous-line) ; was
> isearch-toggle-case-fold
>  (define-key isearch-mode-map (kbd "M-r") 'forward-word) ; was isearch-
> toggle-regexp
>  (define-key isearch-mode-map (kbd "M-e") 'delete-backward-char) ; was
> isearch-edit-string

>  (define-key isearch-mode-map (kbd "<f11>") 'isearch-ring-retreat)
>  (define-key isearch-mode-map (kbd "<f12>") 'isearch-ring-advance)
>  )
> )

If you put that functionality in isearch-mode-hook, you'll rebind these
keys EVERY time you start an isearch.  I suppose, with the power of
modern PCs, you won't notice too much, but the cells in the isearch key
map might get a little worn out.  :-)

> more general guide here:

> ??? How to Define Keyboard Shortcuts in Emacs
>   http://xahlee.org/emacs/keyboard_shortcuts.html

> ??? How To Reclaim Keybindings In Emacs
>   http://xahlee.org/emacs/ergonomic_emacs_keybinding_minibuffer.html

> -----------------

> PS when you look into isearch's map, you'll notice that it defines
> quite a lot other features/shortcuts. I'd say, 90% of them are never
> used once for those who have 4 years of emacs experience . For veteran
> emacs diehards, say those who used emacs over 10 years, if i can make
> a guess with my 10 years of daily emacs use and observation of other
> emacs users, i'd say 50% of the shortcuts provided by isearch are
> never used once in their life.

I think you're very wrong there.  Different users will use different
subsets of them, but do feel free to try to identify those which are
never used.  I think you'd be surprised.

> These complexity and buried features should be reorganized. The proper
> isearch key should be Ctrl+f or Ctrl +g. That's the universal modern UI
> standard.

Emacs UI is good rather than modern.  The term "find" is less accurate
than "search", because often the editor fails to find what you're looking
for.  But it always searches.  C-s is thus more mnemonic.

>   Xah

-- 
Alan Mackenzie (Nuremberg, Germany).




  reply	other threads:[~2008-11-28 20:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-28  4:38 Why function behaves differently when bound to different key combo? seberino
2008-11-28  6:22 ` Phil Carmody
2008-11-28  6:28 ` Andy Stewart
2008-11-28 14:00 ` Xah Lee
2008-11-28 20:54   ` Alan Mackenzie [this message]
     [not found]   ` <mailman.1453.1227904853.26697.help-gnu-emacs@gnu.org>
2008-11-30  2:38     ` isearch key bindings [was: Why function behaves differently when bound to different key combo?] Xah Lee
2008-11-30 15:22       ` Kevin Rodgers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081128205409.GB10822@muc.de \
    --to=acm@muc.de \
    --cc=help-gnu-emacs@gnu.org \
    --cc=xahlee@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.