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

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

Re: [External] : Supplying DOC string in a `defun' using `defvar'


From: Michael Heerdegen
Subject: Re: [External] : Supplying DOC string in a `defun' using `defvar'
Date: Tue, 01 Jun 2021 16:26:07 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

ludvig-faddeev@gmx.com writes:

> Is it possible to define a function that sets a documentation string and
> then calls
>
> (put 'wyfunc
>      'function-documentation 'mydetail)

You don't need a variable as an intermediate step in that case at all,
that would be redundant -- because can use `get' to look up what is
stored in the function-documentation property of your symbol so far.

Use `put' to set it to something else, whether that reuses the old value
or not.  There is really no magic here at all, it's just that trivial.
That symbol property is where the documentation is stored, just like a
variable - only the way of getting and setting the value looks different
compared to a variable.

If you need a more concrete suggestion, I need to know more about your
use case.


Regards,

Michael.





reply via email to

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