emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Add completion to compilation-read-command


From: Visuwesh
Subject: Re: Add completion to compilation-read-command
Date: Thu, 26 Dec 2024 20:34:21 +0530
User-agent: Gnus/5.13 (Gnus v5.13)

[வியாழன் டிசம்பர் 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]