emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Default via M-n for M-x occur


From: Richard Stallman
Subject: Re: Default via M-n for M-x occur
Date: Fri, 09 Jul 2004 12:05:57 -0400

    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 via email to

[Prev in Thread] Current Thread [Next in Thread]