Skip to content

Autocomplete compile comands based on compile-history #531

Answered by SpyrosRoum
SpyrosRoum asked this question in Q&A
Discussion options

You must be logged in to vote

To my absolute surprise I was able to do this myself after reading through vertico's readme and the linked emacs docs for completions.. I'll leave my solution here since I don't want this to be another "nvm I fixed it" post, and I'll leave the issue open in case you know of any better solutions, but feel free to just close.

;; compilation-read-command uses `read-shell-command` by default, which doesn't use
;; completion at all. So I overwrite it to use `completing-read` instead, which seems to work great.
(defun compilation-read-command (command)
  (completing-read "Compile command: " compile-history
    nil nil command
    (if (equal (car compile-history) command)
      '(compile-history . 

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@minad
Comment options

Answer selected by minad
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@SpyrosRoum
Comment options

@rudolf-adamkovic
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #530 on October 16, 2024 13:03.