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

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

Re: docstrings (was: Prefix Argument and optional argument)


From: Christopher Dimech
Subject: Re: docstrings (was: Prefix Argument and optional argument)
Date: Thu, 7 Jul 2022 19:48:34 +0200



> Sent: Friday, July 08, 2022 at 5:06 AM
> From: "Christopher Dimech" <dimech@gmx.com>
> To: "Emanuel Berg" <incal@dataswamp.org>
> Cc: help-gnu-emacs@gnu.org
> Subject: Re: docstrings (was:  Prefix Argument and optional argument)
>
>
>
> > Sent: Friday, July 08, 2022 at 5:03 AM
> > From: "Emanuel Berg" <incal@dataswamp.org>
> > To: help-gnu-emacs@gnu.org
> > Subject: docstrings (was: Re: Prefix Argument and optional argument)
> >
> > Christopher Dimech wrote:
> >
> > > (defun poke (prefix)
> > >  "TODO."
> > >  (interactive "P"))
> > >
> > > It is only because body is empty then, right?
> >
> > The way it is implemented actually the docstring is part of
> > the body!
>
> Which complicates things even more.  Why are we getting warnings then!!!

Then we require a minimal test without warnings which would be

(defun poke (prefix)
  "Pokes the prefix argument
PREFIX in the prefix argument."
  (interactive "P")
  (message "poke function"))


> > Eval this which has the same interface/signature as the
> > `defun' macro:
> >
> >   (defmacro defun-ds (name args &rest body)
> >     (car body) )
> >
> > And then try it:
> >
> >   (defun-ds f (x) "Doc string." x)
> >
> > --
> > underground experts united
> > https://dataswamp.org/~incal
> >
> >
> >
>
>



reply via email to

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