]> git.eshelyaron.com Git - emacs.git/commitdiff
(previous-matching-history-element): No need to bind
authorKarl Heuer <kwzh@gnu.org>
Thu, 2 Oct 1997 03:04:15 +0000 (03:04 +0000)
committerKarl Heuer <kwzh@gnu.org>
Thu, 2 Oct 1997 03:04:15 +0000 (03:04 +0000)
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.

lisp/simple.el

index 6bb122646b1a0fa10c26d87f3eb4e275c0d76d7b..f57abdb9effe9655a9ed530aad163e2a0462b0f8 100644 (file)
@@ -563,7 +563,7 @@ to get different commands to edit and resubmit."
          (setq newcmd
                (let ((print-level nil)
                      (minibuffer-history-position arg)
-                     (minibuffer-history-sexp-flag t))
+                     (minibuffer-history-sexp-flag (1+ (minibuffer-depth))))
                  (read-from-minibuffer
                   "Redo: " (prin1-to-string elt) read-expression-map t
                   (cons 'command-history arg))))
@@ -587,7 +587,9 @@ except when an alternate history list is specified.")
 (defvar minibuffer-history-sexp-flag nil
   "Non-nil when doing history operations on `command-history'.
 More generally, indicates that the history list being acted on
-contains expressions rather than strings.")
+contains expressions rather than strings.
+It is only valid if its value equals the current minibuffer depth,
+to handle recursive uses of the minibuffer.")
 (setq minibuffer-history-variable 'minibuffer-history)
 (setq minibuffer-history-position nil)
 (defvar minibuffer-history-search-history nil)
@@ -639,7 +641,6 @@ With prefix argument N, search for Nth previous match.
 If N is negative, find the next or Nth next match."
   (interactive
    (let* ((enable-recursive-minibuffers t)
-         (minibuffer-history-sexp-flag nil)
          (regexp (read-from-minibuffer "Previous element matching (regexp): "
                                        nil
                                        minibuffer-local-map
@@ -666,7 +667,8 @@ If N is negative, find the next or Nth next match."
                     "No later matching history item"
                   "No earlier matching history item")))
       (if (string-match regexp
-                       (if minibuffer-history-sexp-flag
+                       (if (eq minibuffer-history-sexp-flag
+                               (minibuffer-depth))
                            (let ((print-level nil))
                              (prin1-to-string (nth (1- pos) history)))
                          (nth (1- pos) history)))
@@ -674,7 +676,7 @@ If N is negative, find the next or Nth next match."
     (setq minibuffer-history-position pos)
     (erase-buffer)
     (let ((elt (nth (1- pos) history)))
-      (insert (if minibuffer-history-sexp-flag
+      (insert (if (eq minibuffer-history-sexp-flag (minibuffer-depth))
                  (let ((print-level nil))
                    (prin1-to-string elt))
                elt)))
@@ -690,7 +692,6 @@ With prefix argument N, search for Nth next match.
 If N is negative, find the previous or Nth previous match."
   (interactive
    (let* ((enable-recursive-minibuffers t)
-         (minibuffer-history-sexp-flag nil)
          (regexp (read-from-minibuffer "Next element matching (regexp): "
                                        nil
                                        minibuffer-local-map
@@ -728,7 +729,7 @@ If N is negative, find the previous or Nth previous match."
              (t (setq elt (nth (1- minibuffer-history-position)
                                (symbol-value minibuffer-history-variable)))))
        (insert
-        (if minibuffer-history-sexp-flag
+        (if (eq minibuffer-history-sexp-flag (minibuffer-depth))
             (let ((print-level nil))
               (prin1-to-string elt))
           elt))