aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1993-05-06 18:54:32 +0000
committerRichard M. Stallman1993-05-06 18:54:32 +0000
commitc1172a195d9a325e5348a710bb36bafe4fc172b5 (patch)
tree79d31692212ee1f7e0c99c2052ebd3921cd32e0c
parent080478d65a338f7fd401c1497dc6702dee026391 (diff)
downloademacs-c1172a195d9a325e5348a710bb36bafe4fc172b5.tar.gz
emacs-c1172a195d9a325e5348a710bb36bafe4fc172b5.zip
(previous-matching-history-element): If minibuf is empty,
use the last regexp specified a the default. (next-matching-history-element): Likewise.
-rw-r--r--lisp/simple.el38
1 files changed, 24 insertions, 14 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index a991481995d..db499b4f5a4 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -478,13 +478,18 @@ contains expressions rather than strings.")
478With prefix argument N, search for Nth previous match. 478With prefix argument N, search for Nth previous match.
479If N is negative, find the next or Nth next match." 479If N is negative, find the next or Nth next match."
480 (interactive 480 (interactive
481 (let ((enable-recursive-minibuffers t) 481 (let* ((enable-recursive-minibuffers t)
482 (minibuffer-history-sexp-flag nil)) 482 (minibuffer-history-sexp-flag nil)
483 (list (read-from-minibuffer "Previous element matching (regexp): " 483 (regexp (read-from-minibuffer "Previous element matching (regexp): "
484 nil 484 nil
485 minibuffer-local-map 485 minibuffer-local-map
486 nil 486 nil
487 'minibuffer-history-search-history) 487 'minibuffer-history-search-history)))
488 ;; Use the last regexp specified, by default, if input is empty.
489 (list (if (string= regexp "")
490 (setcar minibuffer-history-search-history
491 (nth 1 minibuffer-history-search-history))
492 regexp)
488 (prefix-numeric-value current-prefix-arg)))) 493 (prefix-numeric-value current-prefix-arg))))
489 (let ((history (symbol-value minibuffer-history-variable)) 494 (let ((history (symbol-value minibuffer-history-variable))
490 prevpos 495 prevpos
@@ -518,13 +523,18 @@ If N is negative, find the next or Nth next match."
518With prefix argument N, search for Nth next match. 523With prefix argument N, search for Nth next match.
519If N is negative, find the previous or Nth previous match." 524If N is negative, find the previous or Nth previous match."
520 (interactive 525 (interactive
521 (let ((enable-recursive-minibuffers t) 526 (let* ((enable-recursive-minibuffers t)
522 (minibuffer-history-sexp-flag nil)) 527 (minibuffer-history-sexp-flag nil)
523 (list (read-from-minibuffer "Next element matching (regexp): " 528 (regexp (read-from-minibuffer "Next element matching (regexp): "
524 nil 529 nil
525 minibuffer-local-map 530 minibuffer-local-map
526 nil 531 nil
527 'minibuffer-history-search-history) 532 'minibuffer-history-search-history)))
533 ;; Use the last regexp specified, by default, if input is empty.
534 (list (if (string= regexp "")
535 (setcar minibuffer-history-search-history
536 (nth 1 minibuffer-history-search-history))
537 regexp)
528 (prefix-numeric-value current-prefix-arg)))) 538 (prefix-numeric-value current-prefix-arg))))
529 (previous-matching-history-element regexp (- n))) 539 (previous-matching-history-element regexp (- n)))
530 540