diff options
author | Juri Linkov <juri@jurta.org> | 2009-08-12 20:56:25 +0000 |
---|---|---|
committer | Juri Linkov <juri@jurta.org> | 2009-08-12 20:56:25 +0000 |
commit | 99910cf46a463a2f9cd3f960ebd26577a3ad8abe (patch) | |
tree | ce49706c125d6f222f29f1647801db9c1d0c82a6 /lisp/replace.el | |
parent | 770f36f8bdac1f78dfe2d0395d64283bfa6ab4d1 (diff) | |
download | emacs-99910cf46a463a2f9cd3f960ebd26577a3ad8abe.tar.gz |
(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.el | 4 |
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." (format "%s: " prompt)) nil nil nil 'regexp-history defaults t))) (if (equal input "") - default-value + (or default-value input) (prog1 input (add-to-history 'regexp-history input))))) @@ -570,7 +570,7 @@ regexp, the last isearch string, and the last replacement regexp." "Read arguments for `keep-lines' and friends. Prompt for a regexp with PROMPT. Value is a list, (REGEXP)." - (list (read-regexp prompt "") nil nil t)) + (list (read-regexp prompt) nil nil t)) (defun keep-lines (regexp &optional rstart rend interactive) "Delete all lines except those containing matches for REGEXP. |