emacs-devel
[Top][All Lists]
Advanced

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

Re: master a30781399b3: * subr-x (eval-command-interactive-spec): New fu


From: Sean Whitton
Subject: Re: master a30781399b3: * subr-x (eval-command-interactive-spec): New function.
Date: Tue, 06 Jun 2023 12:18:27 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Hello,

On Mon 05 Jun 2023 at 12:14PM -04, Stefan Monnier wrote:

>>     * subr-x (eval-command-interactive-spec): New function.
> [...]
>> +;; FIXME: How about renaming this to just `eval-interactive-spec'?
>> +;; It's not specific to the advice system.
>
> Agreed.
>
>> +(defun eval-command-interactive-spec (command)
>> +  "Evaluate COMMAND's interactive form and return resultant list.
>> +If COMMAND has no interactive form, return nil."
>> +  (advice-eval-interactive-spec
>> +   (cadr (or (and (symbolp command) (get command 'interactive-form))
>> +             (interactive-form command)))))
>
> Why the `get` business?  If we want that, it should be in
> `interactive-form`, no (and AFAICT it is there, BTW)?

I missed that interactive-form already handles this.
I've dropped it now.

> And why is that preferable over `(advice-)eval-interactive-spec`?

You mean, why is it worth factoring out

    (advice-eval-interactive-spec (cadr (interactive-form command)))

?

Well, it's indeed less worth factoring out now that you've pointed out
my mistake about interactive-form, but it seems seems worth it to me on
balance.

-- 
Sean Whitton



reply via email to

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