all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Jeremy Bryant <jb@jeremybryant.net>
Cc: 67499@debbugs.gnu.org
Subject: bug#67499: [PATCH] Add use cases of (fn) documentation facility.
Date: Sat, 02 Dec 2023 15:44:35 +0200	[thread overview]
Message-ID: <83bkb890sc.fsf@gnu.org> (raw)
In-Reply-To: <87edg89lsn.fsf@jeremybryant.net> (message from Jeremy Bryant on Wed, 29 Nov 2023 23:29:58 +0000)

> From: Jeremy Bryant <jb@jeremybryant.net>
> Cc: 67499@debbugs.gnu.org
> Date: Wed, 29 Nov 2023 23:29:58 +0000
> 
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > I wonder whether we need this to be said in so many words.  Can't we
> > instead just enumerate the uses, describing each one in a couple of
> > sentences, and format that as, say, an @itemize'd list?  IOW, do we
> > really need to show an explicit example for each use?  Examples are
> > useful when an example is worth a thousand words, which is not the
> > case here, I think.
> 
> Understood, and substantially rewritten as attached, as an @itemize'd list.

Thanks.  I actually had in mind an even shorter variant:

  The @code{(fn)} feature is typically used in the following situations:

  @itemize @minus
  @item To spell out arguments and their purposes in a macro or a
  function.  Example:

  @example
  (defmacro lambda (&rest cdr)
    "@dots{}
  \(fn ARGS [DOCSTRING] [INTERACTIVE] BODY)"@dots{})
  @end example

  @item To provide a more detailed description and names of arguments.
  Example:

  @example
  (defmacro macroexp--accumulate (var+list &rest body)
    "@dots{}
  \(fn (VAR LIST) BODY@dots{})"
    (declare (indent 1))
    (let ((var (car var+list))
	  (list (cadr var+list))
  @dots{})))
  @end example

  @item To better explain the purpose of a @code{defalias}.  Example:

  @example
  (defalias 'abbrev-get 'get
    "@dots{}
  \(fn ABBREV PROP)")
  @end example

WDYT?

> The reader can then use find-function at point in the info manual, to
>  read the code.

We don't include pointers to our sources in the manual, except in very
rare cases.  I'm not sure we need to do it here.  One disadvantage of
having pointers to files is that we need to keep the pointers
up-to-date as development continues.

Thanks.





  reply	other threads:[~2023-12-02 13:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-27 23:30 bug#67499: [PATCH] Add use cases of (fn) documentation facility Jeremy Bryant via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-29 14:42 ` Eli Zaretskii
2023-11-29 23:29   ` Jeremy Bryant via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-02 13:44     ` Eli Zaretskii [this message]
2023-12-03 21:35       ` Jeremy Bryant via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-12 22:15         ` bug#67499: Fwd: " Jeremy Bryant via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-15 13:50           ` Eli Zaretskii
2023-12-16 12:58           ` 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=83bkb890sc.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=67499@debbugs.gnu.org \
    --cc=jb@jeremybryant.net \
    /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.