Juri Linkov wrote:
-(defun compilation-read-command (command)
+(defun compilation-prompt-read-shell-command (command)
   (read-shell-command "Compile command: " command
                       (if (equal (car compile-history) command)
                           '(compile-history . 1)
                         'compile-history)))
 
+(defun compilation-prompt-read-command-with-completion (command)
+  (completing-read "Compile command: " compile-history
+                   nil nil command
+                   (if (equal (car compile-history) command)
+                       '(compile-history . 1)
+                     'compile-history)))
Thanks.  The only problem I see is that the function name
doesn't indicate that it's completing on compile-history.
Probably a better name would be:

  compilation-read-command-with-history-completion

I see what you are saying, however, I do like the current `compilation-prompt` prefix on
these commands, as it distinguishes them from `compilation-read-command`.

If I were to keep both the `-prompt` prefix, and the `history-completion` suffix,
I worry that the command name would be too long at 55 chars.

Instead, I suggest the name `compilation-prompt-read-with-history-completion`

Effectively dropping the word `command`. I think `compilation-prompt` is enough and `command` doesn't add
any information.