Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
2f2f7e58
Commit
2f2f7e58
authored
Mar 05, 2003
by
Richard M. Stallman
Browse files
(query-replace-read-args): Use save-excursion.
(map-query-replace-regexp): Use prefix-numeric-value.
parent
0ebcabe7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
8 deletions
+20
-8
lisp/ChangeLog
lisp/ChangeLog
+5
-0
lisp/replace.el
lisp/replace.el
+15
-8
No files found.
lisp/ChangeLog
View file @
2f2f7e58
2003-03-05 Richard M. Stallman <rms@gnu.org>
* replace.el (query-replace-read-args): Use save-excursion.
(map-query-replace-regexp): Use prefix-numeric-value.
2003-03-05 Juanma Barranquero <lektu@terra.es>
* term/w32-win.el (x-handle-geometry): Put sizes on
...
...
lisp/replace.el
View file @
2f2f7e58
...
...
@@ -70,10 +70,14 @@ strings or patterns."
(
let
(
from
to
)
(
if
query-replace-interactive
(
setq
from
(
car
(
if
regexp-flag
regexp-search-ring
search-ring
)))
(
setq
from
(
read-from-minibuffer
(
format
"%s: "
string
)
nil
nil
nil
query-replace-from-history-variable
nil
t
))
;; The save-excursion here is in case the user marks and copies
;; a region in order to specify the minibuffer input.
;; That should not clobber the region for the query-replace itself.
(
save-excursion
(
setq
from
(
read-from-minibuffer
(
format
"%s: "
string
)
nil
nil
nil
query-replace-from-history-variable
nil
t
)))
;; Warn if user types \n or \t, but don't reject the input.
(
if
(
string-match
"\\\\[nt]"
from
)
(
let
((
match
(
match-string
0
from
)))
...
...
@@ -84,9 +88,10 @@ strings or patterns."
(
message
"Note: `\\t' here doesn't match a tab; to do that, just type TAB"
)))
(
sit-for
2
))))
(
setq
to
(
read-from-minibuffer
(
format
"%s %s with: "
string
from
)
nil
nil
nil
query-replace-to-history-variable
from
t
))
(
save-excursion
(
setq
to
(
read-from-minibuffer
(
format
"%s %s with: "
string
from
)
nil
nil
nil
query-replace-to-history-variable
from
t
)))
(
list
from
to
current-prefix-arg
)))
(
defun
query-replace
(
from-string
to-string
&optional
delimited
start
end
)
...
...
@@ -252,7 +257,9 @@ Fourth and fifth arg START and END specify the region to operate on."
from
)
nil
nil
nil
'query-replace-history
from
t
))
(
list
from
to
current-prefix-arg
(
list
from
to
(
and
current-prefix-arg
(
prefix-numeric-value
current-prefix-arg
))
(
if
(
and
transient-mark-mode
mark-active
)
(
region-beginning
))
(
if
(
and
transient-mark-mode
mark-active
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment