[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Default via M-n for M-x occur
From: |
David Kastrup |
Subject: |
Re: Default via M-n for M-x occur |
Date: |
09 Jul 2004 18:09:52 +0200 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 |
Richard Stallman <address@hidden> writes:
> Currently `occur-read-primary-args' sets the default value to the
> last element of the regexp history. But the whole history list is
> available by M-p. It makes no sense to duplicate the last history
> element as a default value available by M-n.
>
> Since it does have a default, that default should (for consistency)
> be available through M-n.
>
> What I have in mind is this change.
>
> ***************
> *** 757,776 ****
> (nreverse result))))
>
> (defun occur-read-primary-args ()
> ! (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 (equal input "")
> ! default
> ! input))
> (when current-prefix-arg
> (prefix-numeric-value current-prefix-arg))))
>
> --- 776,792 ----
> (nreverse result))))
>
> (defun occur-read-primary-args ()
> ! (list (let ((default (car regexp-history)))
> ! (read-from-minibuffer
> ! (if default
> ! (format "List lines matching regexp (default `%s'): "
> ! default)
> ! "List lines matching regexp: ")
> ! nil
> ! nil
> ! nil
> ! 'regexp-history
> ! default))
> (when current-prefix-arg
> (prefix-numeric-value current-prefix-arg))))
It is not a good idea to mention the default in the prompt then: this
will lead people to think that just typing RET would provide them
with the default.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum