unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Richard Stallman <rms@gnu.org>
Cc: stahl@eos.franken.de, emacs-devel@gnu.org
Subject: Re: Default via M-n for M-x occur
Date: Fri, 09 Jul 2004 12:05:57 -0400	[thread overview]
Message-ID: <E1Bixsr-0001vV-Dz@fencepost.gnu.org> (raw)
In-Reply-To: <87acyas80r.fsf@mail.jurta.org> (message from Juri Linkov on Thu,  08 Jul 2004 19:55:29 +0300)

    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))))

  reply	other threads:[~2004-07-09 16:05 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 [this message]
2004-07-09 16:09     ` David Kastrup
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=E1Bixsr-0001vV-Dz@fencepost.gnu.org \
    --to=rms@gnu.org \
    --cc=emacs-devel@gnu.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).