diff options
author | Richard M. Stallman <rms@gnu.org> | 1996-04-17 17:30:51 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1996-04-17 17:30:51 +0000 |
commit | a80e89f419ff407bacd22b6a5c19214a8d165b9a (patch) | |
tree | 9af7f365966c6e650e0c332724bf1d0fb5a9b654 /lisp/replace.el | |
parent | 54d26e135a0a95470941615e8c76de2f9317e070 (diff) | |
download | emacs-a80e89f419ff407bacd22b6a5c19214a8d165b9a.tar.gz |
(occur): Fix up interactive code.
Strip text properties from regexp.
Diffstat (limited to 'lisp/replace.el')
-rw-r--r-- | lisp/replace.el | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/lisp/replace.el b/lisp/replace.el index 7af54ccefc6..747adbe27e4 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -330,20 +330,24 @@ Interactively it is the prefix arg. The lines are shown in a buffer named `*Occur*'. It serves as a menu to find any of the occurrences in this buffer. \\[describe-mode] in that buffer will explain how." - (interactive (list (let* ((default (car regexp-history)) - (input - (read-from-minibuffer - (if default - (format "List lines matching regexp (default `%s'): " default) - "List lines matching regexp: ") - nil nil nil - 'regexp-history))) - (if (> (length input) 0) input - (setcar regexp-history default))) - current-prefix-arg)) - (setq nlines (if nlines (prefix-numeric-value nlines) - list-matching-lines-default-context-lines)) - (let ((first t) + (interactive + (list (let* ((default (car regexp-history)) + (input + (read-from-minibuffer + (if default + (format "List lines matching regexp (default `%s'): " + default) + "List lines matching regexp: ") + nil nil nil 'regexp-history))) + (if (string-equal input "") + default + (set-text-properties 0 (length input) nil input) + input)) + current-prefix-arg)) + (let ((nlines (if nlines + (prefix-numeric-value nlines) + list-matching-lines-default-context-lines)) + (first t) (buffer (current-buffer)) (dir default-directory) (linenum 1) |