[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r110363: * lisp/replace.el (query-rep
From: |
Juri Linkov |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r110363: * lisp/replace.el (query-replace-interactive): Declare obsolete. |
Date: |
Thu, 04 Oct 2012 22:28:11 +0300 |
User-agent: |
Bazaar (2.5.0) |
------------------------------------------------------------
revno: 110363
fixes bug: http://debbugs.gnu.org/12526
committer: Juri Linkov <address@hidden>
branch nick: trunk
timestamp: Thu 2012-10-04 22:28:11 +0300
message:
* lisp/replace.el (query-replace-interactive): Declare obsolete.
(query-replace-read-from): Add the last incremental search string
to the list of default values accessible via M-n.
(map-query-replace-regexp): Use `read-regexp'.
(query-replace, query-replace-regexp, query-replace-regexp-eval)
(map-query-replace-regexp, replace-string, replace-regexp):
Fix docstrings to replace mentions of `query-replace-interactive'
with alternatives.
modified:
etc/NEWS
lisp/ChangeLog
lisp/replace.el
=== modified file 'etc/NEWS'
--- a/etc/NEWS 2012-10-04 18:30:08 +0000
+++ b/etc/NEWS 2012-10-04 19:28:11 +0000
@@ -858,6 +858,7 @@
*** `macro-declaration-function' (use `macro-declarations-alist').
*** `window-system-version'
*** `dired-pop-to-buffer' (use `dired-mark-pop-up')
+*** `query-replace-interactive'
* Changes in Emacs 24.3 on non-free operating systems
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2012-10-04 18:30:08 +0000
+++ b/lisp/ChangeLog 2012-10-04 19:28:11 +0000
@@ -1,5 +1,16 @@
2012-10-04 Juri Linkov <address@hidden>
+ * replace.el (query-replace-interactive): Declare obsolete.
+ (query-replace-read-from): Add the last incremental search string
+ to the list of default values accessible via M-n.
+ (map-query-replace-regexp): Use `read-regexp'.
+ (query-replace, query-replace-regexp, query-replace-regexp-eval)
+ (map-query-replace-regexp, replace-string, replace-regexp):
+ Fix docstrings to replace mentions of `query-replace-interactive'
+ with alternatives. (Bug#12526)
+
+2012-10-04 Juri Linkov <address@hidden>
+
* dired.el (dired-shrink-to-fit): Declare obsolete. (Bug#1806)
(dired-pop-to-buffer): Declare obsolete.
(dired-mark-pop-up): Doc fix.
=== modified file 'lisp/replace.el'
--- a/lisp/replace.el 2012-09-25 04:13:02 +0000
+++ b/lisp/replace.el 2012-10-04 19:28:11 +0000
@@ -62,6 +62,10 @@
(defvar query-replace-interactive nil
"Non-nil means `query-replace' uses the last search string.
That becomes the \"string to replace\".")
+(make-obsolete-variable 'query-replace-interactive
+ "use `M-n' to pull the last incremental search string
+to the minibuffer that reads the string to replace, or invoke replacements
+from Isearch by using a key sequence like `C-s C-s M-%'." "24.3")
(defcustom query-replace-from-history-variable 'query-replace-history
"History list to use for the FROM argument of `query-replace' commands.
@@ -142,7 +146,8 @@
(if regexp-flag
(read-regexp prompt nil query-replace-from-history-variable)
(read-from-minibuffer
- prompt nil nil nil query-replace-from-history-variable nil
t)))))
+ prompt nil nil nil query-replace-from-history-variable
+ (car (if regexp-flag regexp-search-ring search-ring)) t)))))
(if (and (zerop (length from)) query-replace-defaults)
(cons (car query-replace-defaults)
(query-replace-compile-replacement
@@ -231,9 +236,11 @@
In Transient Mark mode, if the mark is active, operate on the contents
of the region. Otherwise, operate from point to the end of the buffer.
-If `query-replace-interactive' is non-nil, the last incremental search
-string is used as FROM-STRING--you don't have to specify it with the
-minibuffer.
+Use \\<minibuffer-local-map>\\[next-history-element] \
+to pull the last incremental search string to the minibuffer
+that reads FROM-STRING, or invoke replacements from
+incremental search with a key sequence like `C-s C-s M-%'
+to use its current search string as the string to replace.
Matching is independent of case if `case-fold-search' is non-nil and
FROM-STRING has no uppercase letters. Replacement transfers the case
@@ -279,9 +286,11 @@
In Transient Mark mode, if the mark is active, operate on the contents
of the region. Otherwise, operate from point to the end of the buffer.
-If `query-replace-interactive' is non-nil, the last incremental search
-regexp is used as REGEXP--you don't have to specify it with the
-minibuffer.
+Use \\<minibuffer-local-map>\\[next-history-element] \
+to pull the last incremental search regexp to the minibuffer
+that reads REGEXP, or invoke replacements from
+incremental search with a key sequence like `C-M-s C-M-s C-M-%'
+to use its current search regexp as the regexp to replace.
Matching is independent of case if `case-fold-search' is non-nil and
REGEXP has no uppercase letters. Replacement transfers the case
@@ -364,9 +373,9 @@
In Transient Mark mode, if the mark is active, operate on the contents
of the region. Otherwise, operate from point to the end of the buffer.
-If `query-replace-interactive' is non-nil, the last incremental search
-regexp is used as REGEXP--you don't have to specify it with the
-minibuffer.
+Use \\<minibuffer-local-map>\\[next-history-element] \
+to pull the last incremental search regexp to the minibuffer
+that reads REGEXP.
Preserves case in each replacement if `case-replace' and `case-fold-search'
are non-nil and REGEXP has no uppercase letters.
@@ -417,19 +426,16 @@
Non-interactively, TO-STRINGS may be a list of replacement strings.
-If `query-replace-interactive' is non-nil, the last incremental search
-regexp is used as REGEXP--you don't have to specify it with the minibuffer.
+Use \\<minibuffer-local-map>\\[next-history-element] \
+to pull the last incremental search regexp to the minibuffer
+that reads REGEXP.
A prefix argument N says to use each replacement string N times
before rotating to the next.
Fourth and fifth arg START and END specify the region to operate on."
(interactive
- (let* ((from (if query-replace-interactive
- (car regexp-search-ring)
- (read-from-minibuffer "Map query replace (regexp): "
- nil nil nil
- query-replace-from-history-variable
- nil t)))
+ (let* ((from (read-regexp "Map query replace (regexp): " nil
+ query-replace-from-history-variable))
(to (read-from-minibuffer
(format "Query replace %s with (space-separated strings): "
(query-replace-descr from))
@@ -475,9 +481,9 @@
only matches surrounded by word boundaries.
Fourth and fifth arg START and END specify the region to operate on.
-If `query-replace-interactive' is non-nil, the last incremental search
-string is used as FROM-STRING--you don't have to specify it with the
-minibuffer.
+Use \\<minibuffer-local-map>\\[next-history-element] \
+to pull the last incremental search string to the minibuffer
+that reads FROM-STRING.
This function is usually the wrong thing to use in a Lisp program.
What you probably want is a loop like this:
@@ -540,8 +546,9 @@
text, TO-STRING is actually made a list instead of a string.
Use \\[repeat-complex-command] after this command for details.
-If `query-replace-interactive' is non-nil, the last incremental search
-regexp is used as REGEXP--you don't have to specify it with the minibuffer.
+Use \\<minibuffer-local-map>\\[next-history-element] \
+to pull the last incremental search regexp to the minibuffer
+that reads REGEXP.
This function is usually the wrong thing to use in a Lisp program.
What you probably want is a loop like this:
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r110363: * lisp/replace.el (query-replace-interactive): Declare obsolete.,
Juri Linkov <=