From: Juri Linkov Date: Mon, 8 Nov 2004 12:19:14 +0000 (+0000) Subject: (compile): Don't overwrite last command in minibuffer history X-Git-Tag: ttn-vms-21-2-B4~4109 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=20320c65167b630a73ab433bc8800ad8999f189c;p=emacs.git (compile): Don't overwrite last command in minibuffer history with default command if they are not equal. --- diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 223455e9872..034cdaf5fdd 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -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))