aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2004-09-03 20:32:57 +0000
committerJuri Linkov2004-09-03 20:32:57 +0000
commitd85519bb21a368ca9d4be6a62b9197b898dec2be (patch)
tree249882896eebab9fac5042c922b09f765f3064ae
parentb4fab893cc4fb88a74e6ee203d77ac9bcd35c393 (diff)
downloademacs-d85519bb21a368ca9d4be6a62b9197b898dec2be.tar.gz
emacs-d85519bb21a368ca9d4be6a62b9197b898dec2be.zip
(isearch-toggle-regexp): Set `isearch-success' and `isearch-adjusted' to `t'.
(isearch-toggle-case-fold): Set `isearch-success' to `t'. (isearch-message-prefix): Add "pending" for isearch-adjusted. (isearch-other-meta-char): Restore isearch-point unconditionally. (isearch-query-replace): Add new arg `regexp-flag' and use it. Set point to start of match if region is not active in transient mark mode (to include the current match to region boundaries). Push the search string to `query-replace-from-history-variable'. Add prompt "Query replace regexp" for isearch-regexp. Add region beginning/end as last arguments of `perform-replace.' (isearch-query-replace-regexp): Replace code by the call to `isearch-query-replace' with arg `t'.
-rw-r--r--lisp/isearch.el36
1 files changed, 21 insertions, 15 deletions
diff --git a/lisp/isearch.el b/lisp/isearch.el
index b8865693d0b..9d1e56aaf6e 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -1088,6 +1088,7 @@ Use `isearch-exit' to quit without signaling."
1088 (interactive) 1088 (interactive)
1089 (setq isearch-regexp (not isearch-regexp)) 1089 (setq isearch-regexp (not isearch-regexp))
1090 (if isearch-regexp (setq isearch-word nil)) 1090 (if isearch-regexp (setq isearch-word nil))
1091 (setq isearch-success t isearch-adjusted t)
1091 (isearch-update)) 1092 (isearch-update))
1092 1093
1093(defun isearch-toggle-case-fold () 1094(defun isearch-toggle-case-fold ()
@@ -1100,34 +1101,39 @@ Use `isearch-exit' to quit without signaling."
1100 (isearch-message-prefix nil nil isearch-nonincremental) 1101 (isearch-message-prefix nil nil isearch-nonincremental)
1101 isearch-message 1102 isearch-message
1102 (if isearch-case-fold-search "in" ""))) 1103 (if isearch-case-fold-search "in" "")))
1103 (setq isearch-adjusted t) 1104 (setq isearch-success t isearch-adjusted t)
1104 (sit-for 1) 1105 (sit-for 1)
1105 (isearch-update)) 1106 (isearch-update))
1106 1107
1107(defun isearch-query-replace () 1108(defun isearch-query-replace (&optional regexp-flag)
1108 "Start query-replace with string to replace from last search string." 1109 "Start query-replace with string to replace from last search string."
1109 (interactive) 1110 (interactive)
1110 (barf-if-buffer-read-only) 1111 (barf-if-buffer-read-only)
1112 (if regexp-flag (setq isearch-regexp t))
1111 (let ((case-fold-search isearch-case-fold-search)) 1113 (let ((case-fold-search isearch-case-fold-search))
1112 (isearch-done) 1114 (isearch-done)
1113 (isearch-clean-overlays) 1115 (isearch-clean-overlays)
1114 (and isearch-forward isearch-other-end (goto-char isearch-other-end)) 1116 (if (and (< isearch-other-end (point))
1117 (not (and transient-mark-mode mark-active
1118 (< isearch-opoint (point)))))
1119 (goto-char isearch-other-end))
1120 (set query-replace-from-history-variable
1121 (cons isearch-string
1122 (symbol-value query-replace-from-history-variable)))
1115 (perform-replace 1123 (perform-replace
1116 isearch-string 1124 isearch-string
1117 (query-replace-read-to isearch-string "Query replace" isearch-regexp) 1125 (query-replace-read-to
1118 t isearch-regexp isearch-word))) 1126 isearch-string
1127 (if isearch-regexp "Query replace regexp" "Query replace")
1128 isearch-regexp)
1129 t isearch-regexp isearch-word nil nil
1130 (if (and transient-mark-mode mark-active) (region-beginning))
1131 (if (and transient-mark-mode mark-active) (region-end)))))
1119 1132
1120(defun isearch-query-replace-regexp () 1133(defun isearch-query-replace-regexp ()
1121 "Start query-replace-regexp with string to replace from last search string." 1134 "Start query-replace-regexp with string to replace from last search string."
1122 (interactive) 1135 (interactive)
1123 (let ((query-replace-interactive t) 1136 (isearch-query-replace t))
1124 (case-fold-search isearch-case-fold-search))
1125 ;; Put search string into the right ring
1126 (setq isearch-regexp t)
1127 (isearch-done)
1128 (isearch-clean-overlays)
1129 (and isearch-forward isearch-other-end (goto-char isearch-other-end))
1130 (call-interactively 'query-replace-regexp)))
1131 1137
1132 1138
1133(defun isearch-delete-char () 1139(defun isearch-delete-char ()
@@ -1620,8 +1626,7 @@ Isearch mode."
1620 (let ((ab-bel (isearch-string-out-of-window isearch-point))) 1626 (let ((ab-bel (isearch-string-out-of-window isearch-point)))
1621 (if ab-bel 1627 (if ab-bel
1622 (isearch-back-into-window (eq ab-bel 'above) isearch-point) 1628 (isearch-back-into-window (eq ab-bel 'above) isearch-point)
1623 (or (eq (point) isearch-point) 1629 (goto-char isearch-point)))
1624 (goto-char isearch-point))))
1625 (isearch-update)) 1630 (isearch-update))
1626 (search-exit-option 1631 (search-exit-option
1627 (let (window) 1632 (let (window)
@@ -1895,6 +1900,7 @@ If there is no completion possible, say so and continue searching."
1895 ;; If currently failing, display no ellipsis. 1900 ;; If currently failing, display no ellipsis.
1896 (or isearch-success (setq ellipsis nil)) 1901 (or isearch-success (setq ellipsis nil))
1897 (let ((m (concat (if isearch-success "" "failing ") 1902 (let ((m (concat (if isearch-success "" "failing ")
1903 (if isearch-adjusted "pending " "")
1898 (if (and isearch-wrapped 1904 (if (and isearch-wrapped
1899 (not isearch-wrap-function) 1905 (not isearch-wrap-function)
1900 (if isearch-forward 1906 (if isearch-forward