all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Philip Kaludercic <philipk@posteo.net>
To: emacs-devel@gnu.org
Cc: Sean Whitton <spwhitton@spwhitton.name>
Subject: Re: master a30781399b3: * subr-x (eval-command-interactive-spec): New function.
Date: Mon, 05 Jun 2023 10:24:16 +0000	[thread overview]
Message-ID: <87a5xeb41b.fsf@posteo.net> (raw)
In-Reply-To: <20230605073635.19060C00613@vcs2.savannah.gnu.org> (Sean Whitton's message of "Mon, 5 Jun 2023 03:36:34 -0400 (EDT)")

Sean Whitton <spwhitton@spwhitton.name> writes:

> branch: master
> commit a30781399b3ef48150b9cb13cb0aeba7086c2d9e
> Author: Sean Whitton <spwhitton@spwhitton.name>
> Commit: Sean Whitton <spwhitton@spwhitton.name>
>
>     * subr-x (eval-command-interactive-spec): New function.
> ---
>  etc/NEWS                   | 5 +++++
>  lisp/emacs-lisp/nadvice.el | 2 ++
>  lisp/emacs-lisp/subr-x.el  | 7 +++++++
>  3 files changed, 14 insertions(+)
>
> diff --git a/etc/NEWS b/etc/NEWS
> index 9529282f047..910472e5519 100644
> --- a/etc/NEWS
> +++ b/etc/NEWS
> @@ -648,6 +648,11 @@ Since circular alias chains now cannot occur, 'function-alias-p',
>  'indirect-function' and 'indirect-variable' will never signal an error.
>  Their 'noerror' arguments have no effect and are therefore obsolete.
>  
> +---
> +** New function 'eval-command-interactive-spec' in the subr-x library.
> +This function evaluates a command's interactive form and returns the
> +resultant list.

What is the motivation for this feature?

> > +
>  \f
>  * Changes in Emacs 30.1 on Non-Free Operating Systems
>  
> diff --git a/lisp/emacs-lisp/nadvice.el b/lisp/emacs-lisp/nadvice.el
> index e457387acc9..e6977f2012a 100644
> --- a/lisp/emacs-lisp/nadvice.el
> +++ b/lisp/emacs-lisp/nadvice.el
> @@ -165,6 +165,8 @@ DOC is a string where \"FUNCTION\" and \"OLDFUN\" are expected.")
>           (buffer-string))
>         usage))))
>  
> +;; FIXME: How about renaming this to just `eval-interactive-spec'?
> +;; It's not specific to the advice system.
>  (defun advice-eval-interactive-spec (spec)
>    "Evaluate the interactive spec SPEC."
>    (cond
> diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el
> index 9e906930b92..a7d8f785508 100644
> --- a/lisp/emacs-lisp/subr-x.el
> +++ b/lisp/emacs-lisp/subr-x.el
> @@ -504,6 +504,13 @@ Used by `emacs-authors-mode' and `emacs-news-mode'."
>                            (progn (forward-line -1) (point))
>                          (point-max)))))
>  
> +(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)))))
> +
>  (provide 'subr-x)
>  
>  ;;; subr-x.el ends here



       reply	other threads:[~2023-06-05 10:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <168595059426.2523.2109338263713299231@vcs2.savannah.gnu.org>
     [not found] ` <20230605073635.19060C00613@vcs2.savannah.gnu.org>
2023-06-05 10:24   ` Philip Kaludercic [this message]
2023-06-06 11:10     ` master a30781399b3: * subr-x (eval-command-interactive-spec): New function Sean Whitton
2023-06-06 11:25     ` Mattias Engdegård
2023-06-05 16:14   ` Stefan Monnier
2023-06-06 11:18     ` Sean Whitton
2023-06-09 14:39       ` Stefan Monnier
2023-06-14 10:14         ` Sean Whitton
2023-06-14 20:52           ` Stefan Monnier
2023-06-16  7:12             ` Sean Whitton
2023-06-05 11:40 Eli Zaretskii
2023-06-06 11:10 ` Sean Whitton
2023-06-06 11:59   ` Eli Zaretskii
2023-06-14 10:18     ` Sean Whitton
2023-06-14 11:35       ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a5xeb41b.fsf@posteo.net \
    --to=philipk@posteo.net \
    --cc=emacs-devel@gnu.org \
    --cc=spwhitton@spwhitton.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.