aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/replace.el
diff options
context:
space:
mode:
authorKaroly Lorentey2005-02-20 18:47:54 +0000
committerKaroly Lorentey2005-02-20 18:47:54 +0000
commitb5d78df397f8cdcd20f3bcfbed2eb71d522abddd (patch)
treecedfc1db69595526c12da068ea7ff5bdf3b806f2 /lisp/replace.el
parent60c73d2ed638e5d51643c65a0fc6dea618fc72c8 (diff)
parenteedeacb3074baad8ce752a506f9f435c98e42ff4 (diff)
downloademacs-b5d78df397f8cdcd20f3bcfbed2eb71d522abddd.tar.gz
emacs-b5d78df397f8cdcd20f3bcfbed2eb71d522abddd.zip
Merged from miles@gnu.org--gnu-2005 (patch 17-26, 107-116)
Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-107 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-108 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-109 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-110 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-111 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-112 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-113 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-114 <no summary provided> * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-115 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-116 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-17 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-18 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-19 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-20 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-21 More work on moving images to etc/images * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-22 Update from CVS * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-23 Fix errors with image-file installation * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-24 etc/Makefile.in (install): Put gnus-tut.txt in the right place. * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-25 etc/Makefile.in (install, uninstall): Fix installed image dirs. * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-26 etc/Makefile.in (install): Create $(etcdir)/images/gnus dir. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-296
Diffstat (limited to 'lisp/replace.el')
-rw-r--r--lisp/replace.el31
1 files changed, 25 insertions, 6 deletions
diff --git a/lisp/replace.el b/lisp/replace.el
index de3577913c1..2c60cd006f1 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -115,8 +115,11 @@ wants to replace FROM with TO."
115 query-replace-from-history-variable 115 query-replace-from-history-variable
116 nil t t)))) 116 nil t t))))
117 (if (and (zerop (length from)) lastto lastfrom) 117 (if (and (zerop (length from)) lastto lastfrom)
118 (cons lastfrom 118 (progn
119 (query-replace-compile-replacement lastto regexp-flag)) 119 (cons lastfrom
120 (query-replace-compile-replacement lastto regexp-flag))
121 (set query-replace-from-history-variable
122 (cdr (symbol-value query-replace-from-history-variable))))
120 ;; Warn if user types \n or \t, but don't reject the input. 123 ;; Warn if user types \n or \t, but don't reject the input.
121 (and regexp-flag 124 (and regexp-flag
122 (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\(\\\\[nt]\\)" from) 125 (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\(\\\\[nt]\\)" from)
@@ -214,7 +217,11 @@ Fourth and fifth arg START and END specify the region to operate on.
214 217
215To customize possible responses, change the \"bindings\" in `query-replace-map'." 218To customize possible responses, change the \"bindings\" in `query-replace-map'."
216 (interactive (let ((common 219 (interactive (let ((common
217 (query-replace-read-args "Query replace" nil))) 220 (query-replace-read-args
221 (if (and transient-mark-mode mark-active)
222 "Query replace in region"
223 "Query replace")
224 nil)))
218 (list (nth 0 common) (nth 1 common) (nth 2 common) 225 (list (nth 0 common) (nth 1 common) (nth 2 common)
219 ;; These are done separately here 226 ;; These are done separately here
220 ;; so that command-history will record these expressions 227 ;; so that command-history will record these expressions
@@ -274,7 +281,11 @@ text, TO-STRING is actually made a list instead of a string.
274Use \\[repeat-complex-command] after this command for details." 281Use \\[repeat-complex-command] after this command for details."
275 (interactive 282 (interactive
276 (let ((common 283 (let ((common
277 (query-replace-read-args "Query replace regexp" t))) 284 (query-replace-read-args
285 (if (and transient-mark-mode mark-active)
286 "Query replace regexp in region"
287 "Query replace regexp")
288 t)))
278 (list (nth 0 common) (nth 1 common) (nth 2 common) 289 (list (nth 0 common) (nth 1 common) (nth 2 common)
279 ;; These are done separately here 290 ;; These are done separately here
280 ;; so that command-history will record these expressions 291 ;; so that command-history will record these expressions
@@ -420,7 +431,11 @@ which will run faster and will not set the mark or print anything.
420and TO-STRING is also null.)" 431and TO-STRING is also null.)"
421 (interactive 432 (interactive
422 (let ((common 433 (let ((common
423 (query-replace-read-args "Replace string" nil))) 434 (query-replace-read-args
435 (if (and transient-mark-mode mark-active)
436 "Replace string in region"
437 "Replace string")
438 nil)))
424 (list (nth 0 common) (nth 1 common) (nth 2 common) 439 (list (nth 0 common) (nth 1 common) (nth 2 common)
425 (if (and transient-mark-mode mark-active) 440 (if (and transient-mark-mode mark-active)
426 (region-beginning)) 441 (region-beginning))
@@ -474,7 +489,11 @@ What you probably want is a loop like this:
474which will run faster and will not set the mark or print anything." 489which will run faster and will not set the mark or print anything."
475 (interactive 490 (interactive
476 (let ((common 491 (let ((common
477 (query-replace-read-args "Replace regexp" t))) 492 (query-replace-read-args
493 (if (and transient-mark-mode mark-active)
494 "Replace regexp in region"
495 "Replace regexp")
496 t)))
478 (list (nth 0 common) (nth 1 common) (nth 2 common) 497 (list (nth 0 common) (nth 1 common) (nth 2 common)
479 (if (and transient-mark-mode mark-active) 498 (if (and transient-mark-mode mark-active)
480 (region-beginning)) 499 (region-beginning))