emacs-devel
[Top][All Lists]
Advanced

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

Re: bogus binding of M-s in Info


From: Juri Linkov
Subject: Re: bogus binding of M-s in Info
Date: Fri, 19 Dec 2008 02:36:38 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-pc-linux-gnu)

> Incidentally, wouldn't it be nice if the bindings in the M-s keymap
> (both the global one, and the one in isearch) had Meta-variants too, so
> one could more conveniently type them with a real meta key?
>
> E.g., `M-s M-w' would be a duplicate of `M-s w'...

It would be better to try reserving keys on the `M-s' prefix for commands
similar to normal command but that are isearch specific.  For instance,
`M-w' normally saves the region to the kill ring, so `M-w M-e' could
save the search string to the kill ring.  But this is also possible
with `C-SPC C-r C-r M-w' (i.e. set mark with quiting isearch, go back
to the beginning of the previous search string and copy it).

So perhaps we should bind `M-s M-w' to a more frequently used
command `isearch-forward-word'.  The same could be done for `M-s M-o'
(`isearch-occur') as well:

Index: lisp/isearch.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/isearch.el,v
retrieving revision 1.340
diff -u -r1.340 isearch.el
--- lisp/isearch.el     18 Dec 2008 01:16:26 -0000      1.340
+++ lisp/isearch.el     19 Dec 2008 00:34:59 -0000
@@ -493,10 +493,12 @@
 
     (define-key map "\M-sr" 'isearch-toggle-regexp)
     (define-key map "\M-sw" 'isearch-toggle-word)
+    (define-key map "\M-s\M-w" 'isearch-toggle-word)
 
     (define-key map [?\M-%] 'isearch-query-replace)
     (define-key map [?\C-\M-%] 'isearch-query-replace-regexp)
     (define-key map "\M-so" 'isearch-occur)
+    (define-key map "\M-s\M-o" 'isearch-occur)
     (define-key map "\M-shr" 'isearch-highlight-regexp)
 
     map)
@@ -603,6 +605,7 @@
 (define-key global-map "\C-r" 'isearch-backward)
 (define-key esc-map "\C-r" 'isearch-backward-regexp)
 (define-key search-map "w" 'isearch-forward-word)
+(define-key search-map "\M-w" 'isearch-forward-word)
 
 ;; Entry points to isearch-mode.
 
Index: lisp/bindings.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/bindings.el,v
retrieving revision 1.213
diff -u -r1.213 bindings.el
--- lisp/bindings.el    29 Aug 2008 17:56:33 -0000      1.213
+++ lisp/bindings.el    19 Dec 2008 00:35:29 -0000
@@ -833,7 +833,9 @@
   "Keymap for search related commands.")
 (define-key esc-map "s" search-map)
 
-(define-key search-map "o"  'occur)
+(define-key search-map    "o" 'occur)
+(define-key search-map "\M-o" 'occur)
+
 (define-key search-map "hr" 'highlight-regexp)
 (define-key search-map "hp" 'highlight-phrase)
 (define-key search-map "hl" 'highlight-lines-matching-regexp)

-- 
Juri Linkov
http://www.jurta.org/emacs/




reply via email to

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