# HG changeset patch # User Juri Linkov # Date 1250110531 0 # Node ID 97bc7c2be2d09bcad73970e6f527de802fd82793 # Parent a3d4286317cea420d4ae8c3e5f82cf3a567f9029 (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) diff -r a3d4286317ce -r 97bc7c2be2d0 lisp/replace.el --- a/lisp/replace.el Wed Aug 12 20:54:46 2009 +0000 +++ b/lisp/replace.el Wed Aug 12 20:55:31 2009 +0000 @@ -556,7 +556,7 @@ (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 @@ "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.