[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r112975: * lisp/isearch.el (isearch-query-replace):
From: |
Juri Linkov |
Subject: |
[Emacs-diffs] trunk r112975: * lisp/isearch.el (isearch-query-replace): Add " symbol" and other |
Date: |
Thu, 13 Jun 2013 22:08:51 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 112975
revision-id: address@hidden
parent: address@hidden
committer: Juri Linkov <address@hidden>
branch nick: trunk
timestamp: Fri 2013-06-14 01:08:45 +0300
message:
* lisp/isearch.el (isearch-query-replace): Add " symbol" and other
possible search modes from `isearch-message-prefix' to the prompt.
(isearch-occur): Use `with-isearch-suspended' to not exit Isearch
when reading a regexp to collect.
* lisp/replace.el (perform-replace): Display "symbol " and other search
modes from `isearch-message-prefix' in the *Help* buffer.
modified:
lisp/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1432
lisp/isearch.el isearch.el-20091113204419-o5vbwnq5f7feedwu-486
lisp/replace.el replace.el-20091113204419-o5vbwnq5f7feedwu-119
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2013-06-13 21:49:10 +0000
+++ b/lisp/ChangeLog 2013-06-13 22:08:45 +0000
@@ -1,5 +1,15 @@
2013-06-13 Juri Linkov <address@hidden>
+ * replace.el (perform-replace): Display "symbol " and other search
+ modes from `isearch-message-prefix' in the *Help* buffer.
+
+ * isearch.el (isearch-query-replace): Add " symbol" and other
+ possible search modes from `isearch-message-prefix' to the prompt.
+ (isearch-occur): Use `with-isearch-suspended' to not exit Isearch
+ when reading a regexp to collect.
+
+2013-06-13 Juri Linkov <address@hidden>
+
* isearch.el (word-search-regexp): Match whitespace if the search
string begins or ends in whitespace. The LAX arg is applied to
both ends of the search string. Use `regexp-quote' and explicit
=== modified file 'lisp/isearch.el'
--- a/lisp/isearch.el 2013-06-13 21:49:10 +0000
+++ b/lisp/isearch.el 2013-06-13 22:08:45 +0000
@@ -1678,9 +1678,10 @@
"Start `query-replace' with string to replace from last search string.
The arg DELIMITED (prefix arg if interactive), if non-nil, means replace
only matches surrounded by word boundaries. Note that using the prefix arg
-is possible only when `isearch-allow-scroll' is non-nil, and it doesn't
-always provide the correct matches for `query-replace', so the preferred
-way to run word replacements from Isearch is `M-s w ... M-%'."
+is possible only when `isearch-allow-scroll' is non-nil or
+`isearch-allow-prefix' is non-nil, and it doesn't always provide the
+correct matches for `query-replace', so the preferred way to run word
+replacements from Isearch is `M-s w ... M-%'."
(interactive
(list current-prefix-arg))
(barf-if-buffer-read-only)
@@ -1714,7 +1715,15 @@
(query-replace-read-to
isearch-string
(concat "Query replace"
- (if (or delimited isearch-word) " word" "")
+ (if (or delimited isearch-word)
+ (let* ((symbol (or delimited isearch-word))
+ (string (and symbol (symbolp symbol)
+ (get symbol 'isearch-message-prefix))))
+ (if (stringp string)
+ ;; Move space from the end to the beginning.
+ (replace-regexp-in-string "\\(.*\\) \\'" " \\1" string)
+ " word"))
+ "")
(if isearch-regexp " regexp" "")
(if (and transient-mark-mode mark-active) " in region" ""))
isearch-regexp)
@@ -1756,12 +1765,14 @@
;; No subexpression so collect the entire match.
"\\&"
;; Get the regexp for collection pattern.
- (isearch-done nil t)
- (isearch-clean-overlays)
- (let ((default (car occur-collect-regexp-history)))
- (read-regexp
- (format "Regexp to collect (default %s): " default)
- default 'occur-collect-regexp-history)))
+ (let ((default (car occur-collect-regexp-history))
+ regexp-collect)
+ (with-isearch-suspended
+ (setq regexp-collect
+ (read-regexp
+ (format "Regexp to collect (default %s): " default)
+ default 'occur-collect-regexp-history)))
+ regexp-collect))
;; Otherwise normal occur takes numerical prefix argument.
(when current-prefix-arg
(prefix-numeric-value current-prefix-arg))))))
=== modified file 'lisp/replace.el'
--- a/lisp/replace.el 2013-06-11 16:51:12 +0000
+++ b/lisp/replace.el 2013-06-13 22:08:45 +0000
@@ -2156,7 +2156,10 @@
(with-output-to-temp-buffer "*Help*"
(princ
(concat "Query replacing "
- (if delimited-flag "word " "")
+ (if delimited-flag
+ (or (and (symbolp delimited-flag)
+ (get delimited-flag
'isearch-message-prefix))
+ "word ") "")
(if regexp-flag "regexp " "")
from-string " with "
next-replacement ".\n\n"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r112975: * lisp/isearch.el (isearch-query-replace): Add " symbol" and other,
Juri Linkov <=