[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/isearch.el
From: |
Juri Linkov |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/isearch.el |
Date: |
Thu, 01 Jul 2004 05:57:14 -0400 |
Index: emacs/lisp/isearch.el
diff -c emacs/lisp/isearch.el:1.229 emacs/lisp/isearch.el:1.230
*** emacs/lisp/isearch.el:1.229 Mon Jun 21 03:15:43 2004
--- emacs/lisp/isearch.el Thu Jul 1 09:54:51 2004
***************
*** 294,301 ****
(define-key map " " 'isearch-whitespace-chars)
(define-key map [?\S-\ ] 'isearch-whitespace-chars)
! (define-key map "\C-w" 'isearch-yank-word-or-char)
! (define-key map "\C-y" 'isearch-yank-line)
;; Define keys for regexp chars * ? |.
;; Nothing special for + because it matches at least once.
--- 294,303 ----
(define-key map " " 'isearch-whitespace-chars)
(define-key map [?\S-\ ] 'isearch-whitespace-chars)
! (define-key map "\C-w" 'isearch-yank-word-or-char)
! (define-key map "\M-\C-w" 'isearch-del-char)
! (define-key map "\M-\C-y" 'isearch-yank-char)
! (define-key map "\C-y" 'isearch-yank-line)
;; Define keys for regexp chars * ? |.
;; Nothing special for + because it matches at least once.
***************
*** 336,353 ****
(define-key map "\M-r" 'isearch-toggle-regexp)
(define-key map "\M-e" 'isearch-edit-string)
map)
"Keymap for `isearch-mode'.")
(defvar minibuffer-local-isearch-map
(let ((map (make-sparse-keymap)))
(set-keymap-parent map minibuffer-local-map)
! (define-key map "\r" 'isearch-nonincremental-exit-minibuffer)
! (define-key map "\M-n" 'isearch-ring-advance-edit)
! (define-key map "\M-p" 'isearch-ring-retreat-edit)
(define-key map "\M-\t" 'isearch-complete-edit)
! (define-key map "\C-s" 'isearch-forward-exit-minibuffer)
! (define-key map "\C-r" 'isearch-reverse-exit-minibuffer)
map)
"Keymap for editing isearch strings in the minibuffer.")
--- 338,364 ----
(define-key map "\M-r" 'isearch-toggle-regexp)
(define-key map "\M-e" 'isearch-edit-string)
+ (define-key map (kbd "M-%") 'isearch-query-replace)
+ (define-key map (kbd "C-M-%") 'isearch-query-replace-regexp)
+
map)
"Keymap for `isearch-mode'.")
(defvar minibuffer-local-isearch-map
(let ((map (make-sparse-keymap)))
(set-keymap-parent map minibuffer-local-map)
! (define-key map "\r" 'isearch-nonincremental-exit-minibuffer)
! (define-key map "\M-n" 'isearch-ring-advance-edit)
! (define-key map [next] 'isearch-ring-advance-edit)
! (define-key map [down] 'isearch-ring-advance-edit)
! (define-key map "\M-p" 'isearch-ring-retreat-edit)
! (define-key map [prior] 'isearch-ring-retreat-edit)
! (define-key map [up] 'isearch-ring-retreat-edit)
(define-key map "\M-\t" 'isearch-complete-edit)
! (define-key map "\C-s" 'isearch-forward-exit-minibuffer)
! (define-key map "\C-r" 'isearch-reverse-exit-minibuffer)
! (define-key map "\C-f" 'isearch-yank-char-in-minibuffer)
! (define-key map [right] 'isearch-yank-char-in-minibuffer)
map)
"Keymap for editing isearch strings in the minibuffer.")
***************
*** 449,462 ****
The following non-printing keys are bound in `isearch-mode-map'.
Type \\[isearch-delete-char] to cancel last input item from end of search
string.
- Type \\[isearch-del-char] to cancel last character from end of search string.
Type \\[isearch-exit] to exit, leaving point at location found.
Type LFD (C-j) to match end of line.
Type \\[isearch-repeat-forward] to search again forward,\
\\[isearch-repeat-backward] to search again backward.
! Type \\[isearch-yank-char] to yank character from buffer onto end of search\
string and search for it.
! Type \\[isearch-yank-word] to yank word from buffer onto end of search\
string and search for it.
Type \\[isearch-yank-line] to yank rest of line onto end of search string\
and search for it.
--- 460,473 ----
The following non-printing keys are bound in `isearch-mode-map'.
Type \\[isearch-delete-char] to cancel last input item from end of search
string.
Type \\[isearch-exit] to exit, leaving point at location found.
Type LFD (C-j) to match end of line.
Type \\[isearch-repeat-forward] to search again forward,\
\\[isearch-repeat-backward] to search again backward.
! Type \\[isearch-yank-word-or-char] to yank word from buffer onto end of
search\
string and search for it.
! Type \\[isearch-del-char] to delete character from end of search string.
! Type \\[isearch-yank-char] to yank char from buffer onto end of search\
string and search for it.
Type \\[isearch-yank-line] to yank rest of line onto end of search string\
and search for it.
***************
*** 792,798 ****
\\[isearch-ring-retreat-edit] to replace the search string with the previous
item in the search ring.
\\[isearch-complete-edit] to complete the search string using the search ring.
\\<isearch-mode-map>
! If first char entered is \\[isearch-yank-word], then do word search instead."
;; This code is very hairy for several reasons, explained in the code.
;; Mainly, isearch-mode must be terminated while editing and then restarted.
--- 803,809 ----
\\[isearch-ring-retreat-edit] to replace the search string with the previous
item in the search ring.
\\[isearch-complete-edit] to complete the search string using the search ring.
\\<isearch-mode-map>
! If first char entered is \\[isearch-yank-word-or-char], then do word search
instead."
;; This code is very hairy for several reasons, explained in the code.
;; Mainly, isearch-mode must be terminated while editing and then restarted.
***************
*** 1048,1053 ****
--- 1059,1089 ----
(sit-for 1)
(isearch-update))
+ (defun isearch-query-replace ()
+ "Start query-replace with string to replace from last search string."
+ (interactive)
+ (let ((query-replace-interactive 'initial)
+ (case-fold-search isearch-case-fold-search))
+ ;; Put search string into the right ring
+ (setq isearch-regexp nil)
+ (isearch-done)
+ (isearch-clean-overlays)
+ (and isearch-forward isearch-other-end (goto-char isearch-other-end))
+ (call-interactively 'query-replace)))
+
+ (defun isearch-query-replace-regexp ()
+ "Start query-replace-regexp with string to replace from last search string."
+ (interactive)
+ (let ((query-replace-interactive 'initial)
+ (case-fold-search isearch-case-fold-search))
+ ;; Put search string into the right ring
+ (setq isearch-regexp t)
+ (isearch-done)
+ (isearch-clean-overlays)
+ (and isearch-forward isearch-other-end (goto-char isearch-other-end))
+ (call-interactively 'query-replace-regexp)))
+
+
(defun isearch-delete-char ()
"Discard last input item and move point back.
If no previous match was done, just beep."
***************
*** 1057,1071 ****
(isearch-pop-state))
(isearch-update))
! (defun isearch-del-char ()
! "Discard last character and move point back.
! If there is no previous character, just beep."
! (interactive)
! (if (equal isearch-string "")
(ding)
! (setq isearch-string (substring isearch-string 0 -1)
isearch-message (mapconcat 'isearch-text-char-description
! isearch-string "")))
(isearch-search-and-update))
(defun isearch-yank-string (string)
--- 1093,1109 ----
(isearch-pop-state))
(isearch-update))
! (defun isearch-del-char (&optional arg)
! "Delete character from end of search string and search again.
! If search string is empty, just beep."
! (interactive "p")
! (if (= 0 (length isearch-string))
(ding)
! (setq isearch-string (substring isearch-string 0 (- (or arg 1)))
isearch-message (mapconcat 'isearch-text-char-description
! isearch-string "")
! ;; Don't move cursor in reverse search.
! isearch-yank-flag t))
(isearch-search-and-update))
(defun isearch-yank-string (string)
***************
*** 1127,1136 ****
(goto-char isearch-other-end))
(buffer-substring-no-properties (point) (funcall jumpform)))))
! (defun isearch-yank-char ()
"Pull next character from buffer into search string."
! (interactive)
! (isearch-yank-internal (lambda () (forward-char 1) (point))))
(defun isearch-yank-word-or-char ()
"Pull next character or word from buffer into search string."
--- 1165,1185 ----
(goto-char isearch-other-end))
(buffer-substring-no-properties (point) (funcall jumpform)))))
! (defun isearch-yank-char-in-minibuffer (&optional arg)
! "Pull next character from buffer into end of search string in minibuffer."
! (interactive "p")
! (if (eobp)
! (insert
! (save-excursion
! (set-buffer (cadr (buffer-list)))
! (buffer-substring-no-properties
! (point) (progn (forward-char arg) (point)))))
! (forward-char arg)))
!
! (defun isearch-yank-char (&optional arg)
"Pull next character from buffer into search string."
! (interactive "p")
! (isearch-yank-internal (lambda () (forward-char arg) (point))))
(defun isearch-yank-word-or-char ()
"Pull next character or word from buffer into search string."
- [Emacs-diffs] Changes to emacs/lisp/isearch.el,
Juri Linkov <=