aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Rost2002-09-24 18:40:59 +0000
committerMarkus Rost2002-09-24 18:40:59 +0000
commit9f4b608417309d0480fe17f679d1173cbc534b6f (patch)
tree485b1eea7fe8691be3cb4556b141d8fb127953c3
parent2f552813381994f6bd1ffa56f7179a6d919a351f (diff)
downloademacs-9f4b608417309d0480fe17f679d1173cbc534b6f.tar.gz
emacs-9f4b608417309d0480fe17f679d1173cbc534b6f.zip
(edit-and-eval-command): Protect command-history.
(repeat-complex-command): Protect command-history.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/simple.el36
2 files changed, 25 insertions, 16 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 2a18f67df08..b1f58215d58 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12002-09-24 Markus Rost <rost@math.ohio-state.edu>
2
3 * simple.el (edit-and-eval-command): Protect command-history.
4 (repeat-complex-command): Protect command-history.
5
12002-09-24 Juanma Barranquero <lektu@terra.es> 62002-09-24 Juanma Barranquero <lektu@terra.es>
2 7
3 * replace.el (occur-find-match): New function. 8 * replace.el (occur-find-match): New function.
diff --git a/lisp/simple.el b/lisp/simple.el
index d94d497180d..ecf0e95a620 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -650,14 +650,16 @@ the echo area."
650 "Prompting with PROMPT, let user edit COMMAND and eval result. 650 "Prompting with PROMPT, let user edit COMMAND and eval result.
651COMMAND is a Lisp expression. Let user edit that expression in 651COMMAND is a Lisp expression. Let user edit that expression in
652the minibuffer, then read and evaluate the result." 652the minibuffer, then read and evaluate the result."
653 (let ((command (read-from-minibuffer prompt 653 (let ((command
654 (prin1-to-string command) 654 (unwind-protect
655 read-expression-map t 655 (read-from-minibuffer prompt
656 '(command-history . 1)))) 656 (prin1-to-string command)
657 ;; If command was added to command-history as a string, 657 read-expression-map t
658 ;; get rid of that. We want only evaluable expressions there. 658 '(command-history . 1))
659 (if (stringp (car command-history)) 659 ;; If command was added to command-history as a string,
660 (setq command-history (cdr command-history))) 660 ;; get rid of that. We want only evaluable expressions there.
661 (if (stringp (car command-history))
662 (setq command-history (cdr command-history))))))
661 663
662 ;; If command to be redone does not match front of history, 664 ;; If command to be redone does not match front of history,
663 ;; add it to the history. 665 ;; add it to the history.
@@ -683,14 +685,16 @@ to get different commands to edit and resubmit."
683 (let ((print-level nil) 685 (let ((print-level nil)
684 (minibuffer-history-position arg) 686 (minibuffer-history-position arg)
685 (minibuffer-history-sexp-flag (1+ (minibuffer-depth)))) 687 (minibuffer-history-sexp-flag (1+ (minibuffer-depth))))
686 (read-from-minibuffer 688 (unwind-protect
687 "Redo: " (prin1-to-string elt) read-expression-map t 689 (read-from-minibuffer
688 (cons 'command-history arg)))) 690 "Redo: " (prin1-to-string elt) read-expression-map t
689 691 (cons 'command-history arg))
690 ;; If command was added to command-history as a string, 692
691 ;; get rid of that. We want only evaluable expressions there. 693 ;; If command was added to command-history as a
692 (if (stringp (car command-history)) 694 ;; string, get rid of that. We want only
693 (setq command-history (cdr command-history))) 695 ;; evaluable expressions there.
696 (if (stringp (car command-history))
697 (setq command-history (cdr command-history))))))
694 698
695 ;; If command to be redone does not match front of history, 699 ;; If command to be redone does not match front of history,
696 ;; add it to the history. 700 ;; add it to the history.