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
10965505
Commit
10965505
authored
Oct 19, 2008
by
Juri Linkov
Browse files
(read-regexp): Rename arg `default' to `default-value'. Doc fix.
parent
b8fc05a9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
8 deletions
+15
-8
lisp/ChangeLog
lisp/ChangeLog
+5
-0
lisp/replace.el
lisp/replace.el
+10
-8
No files found.
lisp/ChangeLog
View file @
10965505
2008-10-19 Juri Linkov <juri@jurta.org>
* replace.el (read-regexp): Rename arg `default' to `default-value'.
Doc fix.
2008-10-19 Eli Zaretskii <eliz@gnu.org>
2008-10-19 Eli Zaretskii <eliz@gnu.org>
* subr.el (apply-partially): Moved here from minibuffer.el. Doc fix.
* subr.el (apply-partially): Moved here from minibuffer.el. Doc fix.
...
...
lisp/replace.el
View file @
10965505
...
@@ -522,13 +522,14 @@ which will run faster and will not set the mark or print anything."
...
@@ -522,13 +522,14 @@ which will run faster and will not set the mark or print anything."
Maximum length of the history list is determined by the value
Maximum length of the history list is determined by the value
of `history-length', which see."
)
of `history-length', which see."
)
(
defun
read-regexp
(
prompt
&optional
default
)
(
defun
read-regexp
(
prompt
&optional
default
-value
)
"Read regexp as a string using the regexp history and some useful defaults.
"Read regexp as a string using the regexp history and some useful defaults.
Prompt for a regular expression with PROMPT (without a colon and
Prompt for a regular expression with PROMPT (without a colon and
space) in the minibuffer. The optional string argument DEFAULT
space) in the minibuffer. The optional argument DEFAULT-VALUE
provides the basic default value, that is returned on typing RET.
provides the value to display in the minibuffer prompt that is
Additional defaults are the string at point, the last isearch regexp,
returned if the user just types RET.
the last isearch string, and the last replacement regexp."
Values available via M-n are the string at point, the last isearch
regexp, the last isearch string, and the last replacement regexp."
(
let*
((
defaults
(
let*
((
defaults
(
list
(
regexp-quote
(
list
(
regexp-quote
(
or
(
funcall
(
or
find-tag-default-function
(
or
(
funcall
(
or
find-tag-default-function
...
@@ -544,12 +545,13 @@ the last isearch string, and the last replacement regexp."
...
@@ -544,12 +545,13 @@ the last isearch string, and the last replacement regexp."
(
history-add-new-input
nil
)
(
history-add-new-input
nil
)
(
input
(
input
(
read-from-minibuffer
(
read-from-minibuffer
(
if
default
(
if
default-value
(
format
"%s (default %s): "
prompt
(
query-replace-descr
default
))
(
format
"%s (default %s): "
prompt
(
query-replace-descr
default-value
))
(
format
"%s: "
prompt
))
(
format
"%s: "
prompt
))
nil
nil
nil
'regexp-history
defaults
t
)))
nil
nil
nil
'regexp-history
defaults
t
)))
(
if
(
equal
input
""
)
(
if
(
equal
input
""
)
default
default
-value
(
prog1
input
(
prog1
input
(
add-to-history
'regexp-history
input
)))))
(
add-to-history
'regexp-history
input
)))))
...
...
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