aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/replace.el
diff options
context:
space:
mode:
authorJuri Linkov2009-08-12 20:56:25 +0000
committerJuri Linkov2009-08-12 20:56:25 +0000
commit99910cf46a463a2f9cd3f960ebd26577a3ad8abe (patch)
treece49706c125d6f222f29f1647801db9c1d0c82a6 /lisp/replace.el
parent770f36f8bdac1f78dfe2d0395d64283bfa6ab4d1 (diff)
downloademacs-99910cf46a463a2f9cd3f960ebd26577a3ad8abe.tar.gz
emacs-99910cf46a463a2f9cd3f960ebd26577a3ad8abe.zip
(read-regexp): Return empty string when `default-value' is nil.
(keep-lines-read-args): Don't use empty string as the default value for `read-regexp'. (Bug#2495)
Diffstat (limited to 'lisp/replace.el')
-rw-r--r--lisp/replace.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/replace.el b/lisp/replace.el
index a375c87e74f..c69b4cd3c2b 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -556,7 +556,7 @@ regexp, the last isearch string, and the last replacement regexp."
556 (format "%s: " prompt)) 556 (format "%s: " prompt))
557 nil nil nil 'regexp-history defaults t))) 557 nil nil nil 'regexp-history defaults t)))
558 (if (equal input "") 558 (if (equal input "")
559 default-value 559 (or default-value input)
560 (prog1 input 560 (prog1 input
561 (add-to-history 'regexp-history input))))) 561 (add-to-history 'regexp-history input)))))
562 562
@@ -570,7 +570,7 @@ regexp, the last isearch string, and the last replacement regexp."
570 "Read arguments for `keep-lines' and friends. 570 "Read arguments for `keep-lines' and friends.
571Prompt for a regexp with PROMPT. 571Prompt for a regexp with PROMPT.
572Value is a list, (REGEXP)." 572Value is a list, (REGEXP)."
573 (list (read-regexp prompt "") nil nil t)) 573 (list (read-regexp prompt) nil nil t))
574 574
575(defun keep-lines (regexp &optional rstart rend interactive) 575(defun keep-lines (regexp &optional rstart rend interactive)
576 "Delete all lines except those containing matches for REGEXP. 576 "Delete all lines except those containing matches for REGEXP.