|
From: | Spyros Roum |
Subject: | Re: Add completion to compilation-read-command |
Date: | Thu, 26 Dec 2024 16:00:37 +0000 |
Visuwesh wrote:
[வியாழன் டிசம்பர் 26, 2024] Spyros Roum wrote:+(defcustom compilation-read-command-function + #'compilation-prompt-read-shell-command + "`compilation-read-command' uses this function to get user's input. +Defaults to `compilation-prompt-read-shell-command', +but 'compilation-prompt-read-with-history-completion' can be used instead for +a completing version based on past runs." + :version "31.1" + :type 'function + :options + (list + #'compilation-prompt-read-shell-command + #'compilation-prompt-read-with-history-completion))It would be nice to say what these options mean in plain English (with :tag IIRC).I like this suggestion, and it made me realize that even though I use `:options`, there is no actual list of options in the customization interface, which seems weird. [...] +(defcustom compilation-read-command-function + #'compilation-prompt-read-shell-command + "`compilation-read-command' uses this function to get user's input. +Defaults to `compilation-prompt-read-shell-command', +but `compilation-prompt-read-with-history-completion' can be used instead for +a completing version based on past runs." + :version "31.1" + :type + '(choice + (function :tag + "Read command using read-shell-command" + compilation-prompt-read-shell-command) + (function :tag + "Read command using completing-read, completing on compile-history" + compilation-prompt-read-with-history-completion)))I *think* this prevents adding a custom function from the Customise interface since we don't have a "any function" choice, and would warn when you say (setopt compilation-read-command-function #'any-other-function-other-than-two) Unfortunately, I do know how to go about adding it myself since I am unfamiliar with defcustoms. I did some more research and I ended up with this, which seems to work great. `:tag` is not used, but `function-item` displays the docstrings
of the functions in the customize interface. Seems to play nicely with `setopt`, and the customize interface.
After reading some docs Worth noting that the earlier revision that used `:options` was
normal to not work, |
0001-Add-option-for-making-compilation-read-command-use-c.patch
Description: Text Data
[Prev in Thread] | Current Thread | [Next in Thread] |