From 20320c65167b630a73ab433bc8800ad8999f189c Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Mon, 8 Nov 2004 12:19:14 +0000 Subject: [PATCH] (compile): Don't overwrite last command in minibuffer history with default command if they are not equal. --- lisp/progmodes/compile.el | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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)) -- 2.39.5