all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: Documentation of `:documentation`
Date: Tue, 18 Oct 2022 17:08:44 +0300	[thread overview]
Message-ID: <83a65t1axf.fsf@gnu.org> (raw)
In-Reply-To: <jwv4jw1di6s.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Mon, 17 Oct 2022 21:43:50 -0400)

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Date: Mon, 17 Oct 2022 21:43:50 -0400
> 
> Someone pointed out that I forgot to document the `:documentation`
> thingy for functions.
> 
> I came up with the text below, but I find it too terse.  I'm wondering
> whether maybe it should be expanded to a subsubsection maybe, where
> I could more easily put some examples.

Thanks.

> +@cindex Computed documentation string

Index entries should avoid using capital letters as much as possible
(to avoid differences due to locale-dependent sorting).

> +@kindex{:documentation}
> +Documentation strings are usually completely static, but occasionally
> +it can be necessary to generate them dynamically.  In some cases this
> +can be done by writing a macro which will generate at compile time the
> +code of the function, including the desired documentation string.
> +But you can also generate the docstring at run-time when the function
> +is defined by writing @code{(:documentation @var{form})} instead of
> +the documentation string@footnote{This only works in code using
> +@code{lexical-binding}.}.  Furthermore, you can also compute the
> +documentation string on the fly when it is requested by setting
> +the @code{function-documentation} property of the function's symbol to
> +a Lisp form that should evaluate to a string.

This is quite clear, but I think an example or two will make it even
mode clear.



  reply	other threads:[~2022-10-18 14:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-18  1:43 Documentation of `:documentation` Stefan Monnier
2022-10-18 14:08 ` Eli Zaretskii [this message]
2022-10-18 16:05 ` [External] : " Drew Adams

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=83a65t1axf.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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.