[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Default value in previous-matching-history-element
From: |
Stephan Stahl |
Subject: |
Default value in previous-matching-history-element |
Date: |
29 May 2004 03:13:37 +0200 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 |
Hi.
-----
I'm sorry. I have sent a message about this without a subject so i
suppose no one read the first one.. I have changed the patch a little
bit since the time.
-----
Since i learned that M-n while doing completing-read and friends
brings up the default value and lets you edit it, i used that feature
very often.
However it does not work in previous-matching-history-element (M-r
while the minibuffer is active). The following very simple patch
will do the trick..
Maybe someone wants to include that in emacs.
*** simple.1.645.el Sat May 29 02:47:35 2004
--- simple.new.el Sat May 29 02:47:15 2004
***************
*** 949,963 ****
See also `minibuffer-history-case-insensitive-variables'."
(interactive
(let* ((enable-recursive-minibuffers t)
(regexp (read-from-minibuffer "Previous element matching (regexp): "
nil
minibuffer-local-map
nil
! 'minibuffer-history-search-history)))
;; Use the last regexp specified, by default, if input is empty.
(list (if (string= regexp "")
(if minibuffer-history-search-history
! (car minibuffer-history-search-history)
(error "No previous history search regexp"))
regexp)
(prefix-numeric-value current-prefix-arg))))
--- 949,965 ----
See also `minibuffer-history-case-insensitive-variables'."
(interactive
(let* ((enable-recursive-minibuffers t)
+ (default (car minibuffer-history-search-history))
(regexp (read-from-minibuffer "Previous element matching (regexp): "
nil
minibuffer-local-map
nil
! 'minibuffer-history-search-history
! default)))
;; Use the last regexp specified, by default, if input is empty.
(list (if (string= regexp "")
(if minibuffer-history-search-history
! default
(error "No previous history search regexp"))
regexp)
(prefix-numeric-value current-prefix-arg))))
--
Stephan Stahl
- Default value in previous-matching-history-element,
Stephan Stahl <=