unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Default via M-n for M-x occur
@ 2004-07-08 15:33 Stephan Stahl
  2004-07-08 16:55 ` Juri Linkov
  0 siblings, 1 reply; 5+ messages in thread
From: Stephan Stahl @ 2004-07-08 15:33 UTC (permalink / raw)


Hi.

I'm a big fan of M-n in read-from-minibuffer and co. I think this change
to occur-read-primary-args in replace.el would be useful:

diff -c "replace.el.~1.170.~" "replace.el"
*** replace.el.~1.170.~ Mon Apr 26 12:13:32 2004
--- replace.el Thu Jul  8 17:25:39 2004
***************
*** 682,688 ****
  		 nil
  		 nil
  		 nil
! 		 'regexp-history)))
  	  (if (equal input "")
  	      default
  	    input))
--- 682,689 ----
  		 nil
  		 nil
  		 nil
! 		 'regexp-history
! 		 default)))
  	  (if (equal input "")
  	      default
  	    input))

Stephan "M-n everywhere" :)
-- 
Stephan Stahl

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Default via M-n for M-x occur
  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
  0 siblings, 1 reply; 5+ messages in thread
From: Juri Linkov @ 2004-07-08 16:55 UTC (permalink / raw)
  Cc: emacs-devel

"Stephan Stahl" <stahl@eos.franken.de> writes:
> I'm a big fan of M-n in read-from-minibuffer and co.

I like M-n too, but only when it provides a reasonable default.

> I think this change to occur-read-primary-args in replace.el would
> be useful:

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.

It would be more useful to provide a better default value,
for example, the last isearch regexp.

-- 
Juri Linkov
http://www.jurta.org/emacs/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Default via M-n for M-x occur
  2004-07-08 16:55 ` Juri Linkov
@ 2004-07-09 16:05   ` Richard Stallman
  2004-07-09 16:09     ` David Kastrup
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Stallman @ 2004-07-09 16:05 UTC (permalink / raw)
  Cc: stahl, emacs-devel

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Default via M-n for M-x occur
  2004-07-09 16:05   ` Richard Stallman
@ 2004-07-09 16:09     ` David Kastrup
  2004-07-09 20:57       ` Juri Linkov
  0 siblings, 1 reply; 5+ messages in thread
From: David Kastrup @ 2004-07-09 16:09 UTC (permalink / raw)
  Cc: Juri Linkov, stahl, emacs-devel

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Default via M-n for M-x occur
  2004-07-09 16:09     ` David Kastrup
@ 2004-07-09 20:57       ` Juri Linkov
  0 siblings, 0 replies; 5+ messages in thread
From: Juri Linkov @ 2004-07-09 20:57 UTC (permalink / raw)
  Cc: stahl, rms, emacs-devel

David Kastrup <dak@gnu.org> writes:
> 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.
>
> 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.

And if RET will not use the default value and the prompt will not
display the default then it makes no sense to make the last history
element available through M-n because exactly the same value (as well
as all other history value) is available through M-n.

-- 
Juri Linkov
http://www.jurta.org/emacs/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-07-09 20:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2004-07-09 20:57       ` Juri Linkov

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