help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Prefix Argument and optional argument


From: Christopher Dimech
Subject: Re: Prefix Argument and optional argument
Date: Thu, 7 Jul 2022 16:03:37 +0200


> Sent: Friday, July 08, 2022 at 1:45 AM
> From: "Michael Heerdegen" <michael_heerdegen@web.de>
> To: "Christopher Dimech" <dimech@gmx.com>
> Cc: help-gnu-emacs@gnu.org
> Subject: Re: Prefix Argument and optional argument
>
> Christopher Dimech <dimech@gmx.com> writes:
> 
> > Have recently seen that compiling
> >
> > (defun poke (prefix)
> >   "TODO."
> >   (interactive "P")
> > ...)
> >
> > gives 
> >
> > Warning: misplaced interactive spec: ‘(interactive P)’
> 
> If the order docstring + interactive spec is correct (as above), that
> only happens here when the function body is empty (i.e. nothing follows
> the interactive spec).  Did that happen in other cases - do you have an
> example?

Right.  I only took the example and compiled it.
 
> > Is this associated with trying to call the function non-interactively
> > or because the prefix (C-u) is not always used when running the function
> > interactively?
> 
> No.
> 
> Michael.

It is only because body is empty then, right?




reply via email to

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