diff options
| author | Karl Heuer | 1997-10-02 03:04:15 +0000 |
|---|---|---|
| committer | Karl Heuer | 1997-10-02 03:04:15 +0000 |
| commit | 99ea24de6749d72ef56a4673bdf2095a29cac8cc (patch) | |
| tree | f1b121d663c9cdef6f53eb741bf28f63ee3656b1 | |
| parent | 39f9c42439c4e146b3d35e7a864802535ab2d117 (diff) | |
| download | emacs-99ea24de6749d72ef56a4673bdf2095a29cac8cc.tar.gz emacs-99ea24de6749d72ef56a4673bdf2095a29cac8cc.zip | |
(previous-matching-history-element): No need to bind
minibuffer-history-sexp-flag any more.
(next-matching-history-element): Likewise.
(repeat-complex-command): Bind
minibuffer-history-sexp-flag to the minibuffer depth.
(next-history-element): Compare minibuffer-history-sexp-flag
against the current minibuffer depth to verify its validity.
(previous-matching-history-element): Likewise.
(minibuffer-history-sexp-flag): Update doc string.
| -rw-r--r-- | lisp/simple.el | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index 6bb122646b1..f57abdb9eff 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -563,7 +563,7 @@ to get different commands to edit and resubmit." | |||
| 563 | (setq newcmd | 563 | (setq newcmd |
| 564 | (let ((print-level nil) | 564 | (let ((print-level nil) |
| 565 | (minibuffer-history-position arg) | 565 | (minibuffer-history-position arg) |
| 566 | (minibuffer-history-sexp-flag t)) | 566 | (minibuffer-history-sexp-flag (1+ (minibuffer-depth)))) |
| 567 | (read-from-minibuffer | 567 | (read-from-minibuffer |
| 568 | "Redo: " (prin1-to-string elt) read-expression-map t | 568 | "Redo: " (prin1-to-string elt) read-expression-map t |
| 569 | (cons 'command-history arg)))) | 569 | (cons 'command-history arg)))) |
| @@ -587,7 +587,9 @@ except when an alternate history list is specified.") | |||
| 587 | (defvar minibuffer-history-sexp-flag nil | 587 | (defvar minibuffer-history-sexp-flag nil |
| 588 | "Non-nil when doing history operations on `command-history'. | 588 | "Non-nil when doing history operations on `command-history'. |
| 589 | More generally, indicates that the history list being acted on | 589 | More generally, indicates that the history list being acted on |
| 590 | contains expressions rather than strings.") | 590 | contains expressions rather than strings. |
| 591 | It is only valid if its value equals the current minibuffer depth, | ||
| 592 | to handle recursive uses of the minibuffer.") | ||
| 591 | (setq minibuffer-history-variable 'minibuffer-history) | 593 | (setq minibuffer-history-variable 'minibuffer-history) |
| 592 | (setq minibuffer-history-position nil) | 594 | (setq minibuffer-history-position nil) |
| 593 | (defvar minibuffer-history-search-history nil) | 595 | (defvar minibuffer-history-search-history nil) |
| @@ -639,7 +641,6 @@ With prefix argument N, search for Nth previous match. | |||
| 639 | If N is negative, find the next or Nth next match." | 641 | If N is negative, find the next or Nth next match." |
| 640 | (interactive | 642 | (interactive |
| 641 | (let* ((enable-recursive-minibuffers t) | 643 | (let* ((enable-recursive-minibuffers t) |
| 642 | (minibuffer-history-sexp-flag nil) | ||
| 643 | (regexp (read-from-minibuffer "Previous element matching (regexp): " | 644 | (regexp (read-from-minibuffer "Previous element matching (regexp): " |
| 644 | nil | 645 | nil |
| 645 | minibuffer-local-map | 646 | minibuffer-local-map |
| @@ -666,7 +667,8 @@ If N is negative, find the next or Nth next match." | |||
| 666 | "No later matching history item" | 667 | "No later matching history item" |
| 667 | "No earlier matching history item"))) | 668 | "No earlier matching history item"))) |
| 668 | (if (string-match regexp | 669 | (if (string-match regexp |
| 669 | (if minibuffer-history-sexp-flag | 670 | (if (eq minibuffer-history-sexp-flag |
| 671 | (minibuffer-depth)) | ||
| 670 | (let ((print-level nil)) | 672 | (let ((print-level nil)) |
| 671 | (prin1-to-string (nth (1- pos) history))) | 673 | (prin1-to-string (nth (1- pos) history))) |
| 672 | (nth (1- pos) history))) | 674 | (nth (1- pos) history))) |
| @@ -674,7 +676,7 @@ If N is negative, find the next or Nth next match." | |||
| 674 | (setq minibuffer-history-position pos) | 676 | (setq minibuffer-history-position pos) |
| 675 | (erase-buffer) | 677 | (erase-buffer) |
| 676 | (let ((elt (nth (1- pos) history))) | 678 | (let ((elt (nth (1- pos) history))) |
| 677 | (insert (if minibuffer-history-sexp-flag | 679 | (insert (if (eq minibuffer-history-sexp-flag (minibuffer-depth)) |
| 678 | (let ((print-level nil)) | 680 | (let ((print-level nil)) |
| 679 | (prin1-to-string elt)) | 681 | (prin1-to-string elt)) |
| 680 | elt))) | 682 | elt))) |
| @@ -690,7 +692,6 @@ With prefix argument N, search for Nth next match. | |||
| 690 | If N is negative, find the previous or Nth previous match." | 692 | If N is negative, find the previous or Nth previous match." |
| 691 | (interactive | 693 | (interactive |
| 692 | (let* ((enable-recursive-minibuffers t) | 694 | (let* ((enable-recursive-minibuffers t) |
| 693 | (minibuffer-history-sexp-flag nil) | ||
| 694 | (regexp (read-from-minibuffer "Next element matching (regexp): " | 695 | (regexp (read-from-minibuffer "Next element matching (regexp): " |
| 695 | nil | 696 | nil |
| 696 | minibuffer-local-map | 697 | minibuffer-local-map |
| @@ -728,7 +729,7 @@ If N is negative, find the previous or Nth previous match." | |||
| 728 | (t (setq elt (nth (1- minibuffer-history-position) | 729 | (t (setq elt (nth (1- minibuffer-history-position) |
| 729 | (symbol-value minibuffer-history-variable))))) | 730 | (symbol-value minibuffer-history-variable))))) |
| 730 | (insert | 731 | (insert |
| 731 | (if minibuffer-history-sexp-flag | 732 | (if (eq minibuffer-history-sexp-flag (minibuffer-depth)) |
| 732 | (let ((print-level nil)) | 733 | (let ((print-level nil)) |
| 733 | (prin1-to-string elt)) | 734 | (prin1-to-string elt)) |
| 734 | elt)) | 735 | elt)) |