aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/replace.el
diff options
context:
space:
mode:
authorJuri Linkov2008-07-29 14:44:35 +0000
committerJuri Linkov2008-07-29 14:44:35 +0000
commit714da7572890f8b56c65e405ad87017b4bbbe07f (patch)
treefc7d9814035d0c76dfffd95c7232f3353965ea3e /lisp/replace.el
parent6d9f0d00ea7012554b2e3c77ddb19b6ab858a04e (diff)
downloademacs-714da7572890f8b56c65e405ad87017b4bbbe07f.tar.gz
emacs-714da7572890f8b56c65e405ad87017b4bbbe07f.zip
(read-regexp): Add second arg `default'. Doc fix.
(occur-read-primary-args): Use `(car regexp-history)' as the second arg of `read-regexp'.
Diffstat (limited to 'lisp/replace.el')
-rw-r--r--lisp/replace.el18
1 files changed, 9 insertions, 9 deletions
diff --git a/lisp/replace.el b/lisp/replace.el
index 2572125b052..086380ffc4c 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -522,15 +522,14 @@ which will run faster and will not set the mark or print anything."
522Maximum length of the history list is determined by the value 522Maximum length of the history list is determined by the value
523of `history-length', which see.") 523of `history-length', which see.")
524 524
525(defun read-regexp (prompt) 525(defun read-regexp (prompt &optional default)
526 "Read regexp as a string using the regexp history and some useful defaults. 526 "Read regexp as a string using the regexp history and some useful defaults.
527Prompt for a regular expression with PROMPT in the minibuffer. 527Prompt for a regular expression with PROMPT (without a colon and
528Provide the last element of the regexp history as the basic default, 528space) in the minibuffer. The optional string argument DEFAULT
529and return it on typing RET. Additional defaults are the string 529provides the basic default value, that is returned on typing RET.
530at point, the last isearch regexp, the last isearch string, and the 530Additional defaults are the string at point, the last isearch regexp,
531last replacement regexp. Return the regexp as a string." 531the last isearch string, and the last replacement regexp."
532 (let* ((default (car regexp-history)) 532 (let* ((defaults
533 (defaults
534 (list (regexp-quote 533 (list (regexp-quote
535 (or (funcall (or find-tag-default-function 534 (or (funcall (or find-tag-default-function
536 (get major-mode 'find-tag-default-function) 535 (get major-mode 'find-tag-default-function)
@@ -1022,7 +1021,8 @@ which means to discard all text properties."
1022 (nreverse result)))) 1021 (nreverse result))))
1023 1022
1024(defun occur-read-primary-args () 1023(defun occur-read-primary-args ()
1025 (list (read-regexp "List lines matching regexp") 1024 (list (read-regexp "List lines matching regexp"
1025 (car regexp-history))
1026 (when current-prefix-arg 1026 (when current-prefix-arg
1027 (prefix-numeric-value current-prefix-arg)))) 1027 (prefix-numeric-value current-prefix-arg))))
1028 1028