unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
Cc: Juri Linkov <juri@jurta.org>, stahl@eos.franken.de, emacs-devel@gnu.org
Subject: Re: Default via M-n for M-x occur
Date: 09 Jul 2004 18:09:52 +0200	[thread overview]
Message-ID: <x5n029b1rj.fsf@lola.goethe.zz> (raw)
In-Reply-To: <E1Bixsr-0001vV-Dz@fencepost.gnu.org>

Richard Stallman <rms@gnu.org> 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

  reply	other threads:[~2004-07-09 16:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-08 15:33 Default via M-n for M-x occur Stephan Stahl
2004-07-08 16:55 ` Juri Linkov
2004-07-09 16:05   ` Richard Stallman
2004-07-09 16:09     ` David Kastrup [this message]
2004-07-09 20:57       ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=x5n029b1rj.fsf@lola.goethe.zz \
    --to=dak@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=juri@jurta.org \
    --cc=stahl@eos.franken.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).