all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bogus binding of C-w in isearch editing mode
@ 2008-12-17  0:49 Miles Bader
  2008-12-17  1:30 ` Juri Linkov
  2008-12-18  1:34 ` bogus binding of M-s in Info (was: bogus binding of C-w in isearch editing mode) Juri Linkov
  0 siblings, 2 replies; 9+ messages in thread
From: Miles Bader @ 2008-12-17  0:49 UTC (permalink / raw)
  To: emacs-devel

After entering "editing" mode in isearch (to edit the search string),
via M-e, most editing commands work normally, but C-w doesn't work.

Instead, it displays an error that the "binding is obsolete, use M-s w
instead" (for some reason it doesn't saved in *Messages* so I don't have
the exact wording).  Very annoying...

Thanks,

-Miles

-- 
Laughter, n. An interior convulsion, producing a distortion of the features
and accompanied by inarticulate noises. It is infectious and, though
intermittent, incurable.




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: bogus binding of C-w in isearch editing mode
  2008-12-17  0:49 bogus binding of C-w in isearch editing mode Miles Bader
@ 2008-12-17  1:30 ` Juri Linkov
  2008-12-17  3:12   ` Miles Bader
  2008-12-18  1:34 ` bogus binding of M-s in Info (was: bogus binding of C-w in isearch editing mode) Juri Linkov
  1 sibling, 1 reply; 9+ messages in thread
From: Juri Linkov @ 2008-12-17  1:30 UTC (permalink / raw)
  To: Miles Bader; +Cc: emacs-devel

> After entering "editing" mode in isearch (to edit the search string),
> via M-e, most editing commands work normally, but C-w doesn't work.
>
> Instead, it displays an error that the "binding is obsolete, use M-s w
> instead" (for some reason it doesn't saved in *Messages* so I don't have
> the exact wording).  Very annoying...

This was intended for a gradual transition from the old word-search binding
to the normal kill-region binding (declaring it obsolete in the next release
and rebinding it in another release).

We could display this warning only when there is no mark in the minibuffer
and point is at the beginning, and calling kill-region otherwise.
Or we could abandon this half-assed solution altogether and bind C-w
to the standard kill-region binding now.

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




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: bogus binding of C-w in isearch editing mode
  2008-12-17  1:30 ` Juri Linkov
@ 2008-12-17  3:12   ` Miles Bader
  2008-12-17  5:47     ` Stefan Monnier
  0 siblings, 1 reply; 9+ messages in thread
From: Miles Bader @ 2008-12-17  3:12 UTC (permalink / raw)
  To: Juri Linkov; +Cc: emacs-devel

Juri Linkov <juri@jurta.org> writes:
> This was intended for a gradual transition from the old word-search binding
> to the normal kill-region binding (declaring it obsolete in the next release
> and rebinding it in another release).

That's reasonable enough in the normal isearch interaction loop,
but not in isearch _editing mode_.

In editing mode isearch simply shouldn't be binding C-w at all.

-Miles

-- 
97% of everything is grunge




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: bogus binding of C-w in isearch editing mode
  2008-12-17  3:12   ` Miles Bader
@ 2008-12-17  5:47     ` Stefan Monnier
  2008-12-17  5:55       ` Miles Bader
  2008-12-18  1:19       ` Juri Linkov
  0 siblings, 2 replies; 9+ messages in thread
From: Stefan Monnier @ 2008-12-17  5:47 UTC (permalink / raw)
  To: Miles Bader; +Cc: Juri Linkov, emacs-devel

>> This was intended for a gradual transition from the old word-search binding
>> to the normal kill-region binding (declaring it obsolete in the next release
>> and rebinding it in another release).

> That's reasonable enough in the normal isearch interaction loop,
> but not in isearch _editing mode_.

> In editing mode isearch simply shouldn't be binding C-w at all.

You're right, but C-w in edit mode was IIUC the only way to switch to
word-search (!?!).

I wouldn't mind switch to a normal C-w, personally.


        Stefan




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: bogus binding of C-w in isearch editing mode
  2008-12-17  5:47     ` Stefan Monnier
@ 2008-12-17  5:55       ` Miles Bader
  2008-12-18  1:19       ` Juri Linkov
  1 sibling, 0 replies; 9+ messages in thread
From: Miles Bader @ 2008-12-17  5:55 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Juri Linkov, emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> In editing mode isearch simply shouldn't be binding C-w at all.
>
> You're right, but C-w in edit mode was IIUC the only way to switch to
> word-search (!?!).

Hmm, didn't realize that; I don't think I've ever intentionally managed
to invoke word mode in isearch, though I've done so by accident a fair
number of times (without realizing precisely how it happened)!

That seems like such a stupid binding that it really should just be
deleted...

-Miles

-- 
Insurrection, n. An unsuccessful revolution.




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: bogus binding of C-w in isearch editing mode
  2008-12-17  5:47     ` Stefan Monnier
  2008-12-17  5:55       ` Miles Bader
@ 2008-12-18  1:19       ` Juri Linkov
  1 sibling, 0 replies; 9+ messages in thread
From: Juri Linkov @ 2008-12-18  1:19 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel, Miles Bader

>>> This was intended for a gradual transition from the old word-search binding
>>> to the normal kill-region binding (declaring it obsolete in the next release
>>> and rebinding it in another release).
>
>> That's reasonable enough in the normal isearch interaction loop,
>> but not in isearch _editing mode_.
>
>> In editing mode isearch simply shouldn't be binding C-w at all.
>
> You're right, but C-w in edit mode was IIUC the only way to switch to
> word-search (!?!).
>
> I wouldn't mind switch to a normal C-w, personally.

Done.  This half-finished change of replacing an obsolete `C-w' in the
isearch editing minibuffer with `M-s w' was already mentioned in NEWS in
the section "Incompatible Editing Changes".  So no more changes for an
incremental word search are necessary in NEWS.  I only added a few words
about starting a *nonincremental* word search using `M-s w RET' and
`M-s w C-r RET' instead of `C-s RET C-w' and `C-r RET C-w' (with other
related fixes).

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




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: bogus binding of M-s in Info (was: bogus binding of C-w in isearch editing mode)
  2008-12-17  0:49 bogus binding of C-w in isearch editing mode Miles Bader
  2008-12-17  1:30 ` Juri Linkov
@ 2008-12-18  1:34 ` Juri Linkov
  2008-12-18  3:22   ` bogus binding of M-s in Info Miles Bader
  1 sibling, 1 reply; 9+ messages in thread
From: Juri Linkov @ 2008-12-18  1:34 UTC (permalink / raw)
  To: emacs-devel

Currently in Info `M-s' prevents starting a word search with `M-s w'
but a word search is very useful in text documents like Info manuals.
`M-s' is bound to `Info-search' that duplicates a binding `s' on the
same command.

Since there are now better ways to search for a regexp or a string in
Info manuals using incremental search commands C-s, C-M-s, C-r, C-M-r,
I propose to unbind `M-s' from `Info-search' in Info, thus allowing
using search commands from the global `M-s' prefix map like a word search
`M-s w' and occur `M-s o'.

A paragraph about `M-s' can be safely removed from info.texi
because the standalone Info reader doesn't bind `M-s'.

Index: lisp/info.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/info.el,v
retrieving revision 1.553
diff -u -r1.553 info.el
--- lisp/info.el	3 Dec 2008 05:48:28 -0000	1.553
+++ lisp/info.el	18 Dec 2008 01:32:59 -0000
@@ -3241,8 +3241,6 @@
     (define-key map "r" 'Info-history-forward)
     (define-key map "s" 'Info-search)
     (define-key map "S" 'Info-search-case-sensitively)
-    ;; For consistency with Rmail.
-    (define-key map "\M-s" 'Info-search)
     (define-key map "\M-n" 'clone-buffer)
     (define-key map "t" 'Info-top-node)
     (define-key map "T" 'Info-toc)

Index: etc/NEWS
===================================================================
RCS file: /sources/emacs/emacs/etc/NEWS,v
retrieving revision 1.1951
diff -u -r1.1951 NEWS
--- etc/NEWS	18 Dec 2008 01:18:06 -0000	1.1951
+++ etc/NEWS	18 Dec 2008 01:33:20 -0000
@@ -314,6 +314,12 @@
 toggle word search.  To start nonincremental word search you can now use
 `M-s w RET' and `M-s w C-r RET' instead of `C-s RET C-w' and `C-r RET C-w'.
 
++++
+** In Info, `Info-search' is unbound from `M-s' to allow using
+`M-s w' for word search.  `Info-search' is still bound to `s',
+and also `C-s' and `C-M-s' are available for incremental search
+through multiple Info nodes.
+
 ---
 ** In Text mode, `center-line' and `center-paragraph' are rebound
 from `M-s' and `M-S' to global keys `M-o M-s' and `M-o M-S' on the

Index: doc/misc/info.texi
===================================================================
RCS file: /sources/emacs/emacs/doc/misc/info.texi,v
retrieving revision 1.8
diff -u -r1.8 info.texi
--- doc/misc/info.texi	19 Nov 2008 04:28:42 -0000	1.8
+++ doc/misc/info.texi	18 Dec 2008 01:34:05 -0000
@@ -1000,12 +1000,6 @@
 puts your cursor at the occurrence of the string, not at the beginning
 of the node).
 
-@kindex M-s @r{(Info mode)}
-  In Emacs, @kbd{Meta-s} is equivalent to @kbd{s}.  That is for
-compatibility with other GNU packages that use @kbd{M-s} for a similar
-kind of search command.  Both @kbd{s} and @kbd{M-s} run in Emacs the
-command @code{Info-search}.
-
 @kindex C-s @r{(Info mode)}
 @kindex C-r @r{(Info mode)}
 @findex isearch

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




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: bogus binding of M-s in Info
  2008-12-18  1:34 ` bogus binding of M-s in Info (was: bogus binding of C-w in isearch editing mode) Juri Linkov
@ 2008-12-18  3:22   ` Miles Bader
  2008-12-19  0:36     ` Juri Linkov
  0 siblings, 1 reply; 9+ messages in thread
From: Miles Bader @ 2008-12-18  3:22 UTC (permalink / raw)
  To: Juri Linkov; +Cc: emacs-devel

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'...

?

-Miles

-- 
Love is a snowmobile racing across the tundra.  Suddenly it flips over,
pinning you underneath.  At night the ice weasels come.  --Nietzsche




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: bogus binding of M-s in Info
  2008-12-18  3:22   ` bogus binding of M-s in Info Miles Bader
@ 2008-12-19  0:36     ` Juri Linkov
  0 siblings, 0 replies; 9+ messages in thread
From: Juri Linkov @ 2008-12-19  0:36 UTC (permalink / raw)
  To: Miles Bader; +Cc: emacs-devel

> 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/




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-12-19  0:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-17  0:49 bogus binding of C-w in isearch editing mode Miles Bader
2008-12-17  1:30 ` Juri Linkov
2008-12-17  3:12   ` Miles Bader
2008-12-17  5:47     ` Stefan Monnier
2008-12-17  5:55       ` Miles Bader
2008-12-18  1:19       ` Juri Linkov
2008-12-18  1:34 ` bogus binding of M-s in Info (was: bogus binding of C-w in isearch editing mode) Juri Linkov
2008-12-18  3:22   ` bogus binding of M-s in Info Miles Bader
2008-12-19  0:36     ` Juri Linkov

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.