From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Lee Newsgroups: gmane.emacs.help Subject: Re: Why function behaves differently when bound to different key combo? Date: Fri, 28 Nov 2008 06:00:13 -0800 (PST) Organization: http://groups.google.com Message-ID: <52652ad0-4657-49d4-ab3e-5066de443801@o40g2000prn.googlegroups.com> References: <6daf5632-fd9e-4ade-a2d3-b23ca738f9da@r37g2000prr.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1227899890 12622 80.91.229.12 (28 Nov 2008 19:18:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 28 Nov 2008 19:18:10 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 28 20:19:11 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1L68ru-0005mC-MU for geh-help-gnu-emacs@m.gmane.org; Fri, 28 Nov 2008 20:19:10 +0100 Original-Received: from localhost ([127.0.0.1]:37669 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L68qk-0006KH-QK for geh-help-gnu-emacs@m.gmane.org; Fri, 28 Nov 2008 14:17:58 -0500 Original-Path: news.stanford.edu!headwall.stanford.edu!newsfeed.stanford.edu!postnews.google.com!o40g2000prn.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 68 Original-NNTP-Posting-Host: 24.6.185.159 Original-X-Trace: posting.google.com 1227880814 16604 127.0.0.1 (28 Nov 2008 14:00:14 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 28 Nov 2008 14:00:14 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: o40g2000prn.googlegroups.com; posting-host=24.6.185.159; posting-account=bRPKjQoAAACxZsR8_VPXCX27T2YcsyMA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:164862 X-Mailman-Approved-At: Fri, 28 Nov 2008 14:17:36 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:60193 Archived-At: On Nov 27, 8:38 pm, "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) (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 "") 'isearch-ring-retreat) (define-key isearch-mode-map (kbd "") 'isearch-ring-advance) ) ) more general guide here: =E2=80=A2 How to Define Keyboard Shortcuts in Emacs http://xahlee.org/emacs/keyboard_shortcuts.html =E2=80=A2 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. 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. Xah =E2=88=91 http://xahlee.org/ =E2=98=84