]> git.eshelyaron.com Git - emacs.git/commitdiff
(compile): Don't overwrite last command in minibuffer history
authorJuri Linkov <juri@jurta.org>
Mon, 8 Nov 2004 12:19:14 +0000 (12:19 +0000)
committerJuri Linkov <juri@jurta.org>
Mon, 8 Nov 2004 12:19:14 +0000 (12:19 +0000)
with default command if they are not equal.

lisp/progmodes/compile.el

index 223455e987209af266a6dd1b347640f55c8ccbad..034cdaf5fdd8b70a8062b6f2971b765558c6ad2c 100644 (file)
@@ -785,11 +785,14 @@ the function in `compilation-buffer-name-function', so you can set that
 to a function that generates a unique name."
   (interactive
    (list
-    (if (or compilation-read-command current-prefix-arg)
-        (read-from-minibuffer "Compile command: "
-                             (eval compile-command) nil nil
-                             '(compile-history . 1))
-      (eval compile-command))
+    (let ((command (eval compile-command)))
+      (if (or compilation-read-command current-prefix-arg)
+         (read-from-minibuffer "Compile command: "
+                               command nil nil
+                               (if (equal (car compile-history) command)
+                                   '(compile-history . 1)
+                                 'compile-history))
+       command))
     (consp current-prefix-arg)))
   (unless (equal command (eval compile-command))
     (setq compile-command command))