changeset 106326:b7dca98d92a9

(comint-mode-map): Rebind `M-r' from `comint-previous-matching-input' to `comint-history-isearch-backward-regexp'. Unbind `M-s' to allow global key binding `M-s'. Add menu items for `comint-history-isearch-backward' and `comint-history-isearch-backward-regexp'. (Bug#3746)
author Juri Linkov <juri@jurta.org>
date Mon, 30 Nov 2009 16:11:18 +0000
parents d1953939048b
children 8cb95e673f03
files admin/FOR-RELEASE etc/NEWS lisp/ChangeLog lisp/comint.el
diffstat 4 files changed, 19 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/admin/FOR-RELEASE	Mon Nov 30 16:05:47 2009 +0000
+++ b/admin/FOR-RELEASE	Mon Nov 30 16:11:18 2009 +0000
@@ -81,16 +81,12 @@
 2. Minibuffer binds `M-s' to `next-matching-history-element'
    (not useful any more since C-s can now search in the history).
 
-3. Shell mode binds `M-s' to `comint-next-matching-input'.
-   This key binding can be changed later when we will implement
-   incremental search through the shell history.
-
-4. `center-line' in Text mode was already moved to the text formatting
+3. `center-line' in Text mode was already moved to the text formatting
    keymap as `M-o M-s' (thus this binding is not necessary any more
    in `nroff-mode-map' too and can be removed now from the nroff mode
    because it can now use the global key binding `M-o M-s' `center-line').
 
-5. PCL-CVS binds `M-s' to `cvs-status', and log-edit-mode binds it to
+4. PCL-CVS binds `M-s' to `cvs-status', and log-edit-mode binds it to
    `log-edit-comment-search-forward'.  Perhaps search commands
    on the global key binding `M-s' are useless in these modes.
 
--- a/etc/NEWS	Mon Nov 30 16:05:47 2009 +0000
+++ b/etc/NEWS	Mon Nov 30 16:11:18 2009 +0000
@@ -301,8 +301,8 @@
 
 *** Isearch searches in the comint/shell input history when the new variable
 `comint-history-isearch' is non-nil.  New commands `comint-history-isearch-backward'
-and `comint-history-isearch-backward-regexp' start Isearch in the input history
-regardless of the value of `comint-history-isearch'.
+and `comint-history-isearch-backward-regexp' (bound to M-r) start Isearch
+in the input history regardless of the value of `comint-history-isearch'.
 
 +++
 *** Autorevert Tail mode now works also for remote files.
--- a/lisp/ChangeLog	Mon Nov 30 16:05:47 2009 +0000
+++ b/lisp/ChangeLog	Mon Nov 30 16:11:18 2009 +0000
@@ -1,3 +1,12 @@
+2009-11-30  Juri Linkov  <juri@jurta.org>
+
+	* comint.el (comint-mode-map): Rebind `M-r' from
+	`comint-previous-matching-input' to
+	`comint-history-isearch-backward-regexp'.
+	Unbind `M-s' to allow global key binding `M-s'.
+	Add menu items for `comint-history-isearch-backward' and
+	`comint-history-isearch-backward-regexp'.  (Bug#3746)
+
 2009-11-30  Juri Linkov  <juri@jurta.org>
 
 	* replace.el (perform-replace): Let-bind recenter-last-op to nil.
--- a/lisp/comint.el	Mon Nov 30 16:05:47 2009 +0000
+++ b/lisp/comint.el	Mon Nov 30 16:11:18 2009 +0000
@@ -62,8 +62,7 @@
 ;;
 ;; M-p	   comint-previous-input	   Cycle backwards in input history
 ;; M-n	   comint-next-input		   Cycle forwards
-;; M-r     comint-previous-matching-input  Previous input matching a regexp
-;; M-s     comint-next-matching-input      Next input that matches
+;; M-r     comint-history-isearch-backward-regexp  Isearch input regexp backward
 ;; M-C-l   comint-show-output		   Show last batch of process output
 ;; RET	   comint-send-input
 ;; C-d	   comint-delchar-or-maybe-eof     Delete char unless at end of buff
@@ -446,10 +445,7 @@
     (define-key map "\en" 	  'comint-next-input)
     (define-key map [C-up] 	  'comint-previous-input)
     (define-key map [C-down] 	  'comint-next-input)
-    (define-key map "\er" 	  'comint-previous-matching-input)
-    ;; FIXME: maybe M-r better to be bound to Isearch comint history?
-    ;; (define-key map "\er" 	  'comint-history-isearch-backward-regexp)
-    (define-key map "\es" 	  'comint-next-matching-input)
+    (define-key map "\er" 	  'comint-history-isearch-backward-regexp)
     (define-key map [?\C-c ?\M-r] 'comint-previous-matching-input-from-input)
     (define-key map [?\C-c ?\M-s] 'comint-next-matching-input-from-input)
     (define-key map "\e\C-l" 	  'comint-show-output)
@@ -512,6 +508,10 @@
       '("Kill Current Input" . comint-kill-input))
     (define-key map [menu-bar inout copy-input]
       '("Copy Old Input" . comint-copy-old-input))
+    (define-key map [menu-bar inout history-isearch-backward-regexp]
+      '("Isearch Input Regexp Backward..." . comint-history-isearch-backward-regexp))
+    (define-key map [menu-bar inout history-isearch-backward]
+      '("Isearch Input String Backward..." . comint-history-isearch-backward))
     (define-key map [menu-bar inout forward-matching-history]
       '("Forward Matching Input..." . comint-forward-matching-input))
     (define-key map [menu-bar inout backward-matching-history]