unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Jeremy Bryant via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 67499@debbugs.gnu.org, Eli Zaretskii <eliz@gnu.org>
Subject: bug#67499: Fwd: bug#67499: [PATCH] Add use cases of (fn) documentation facility.
Date: Tue, 12 Dec 2023 22:15:59 +0000	[thread overview]
Message-ID: <8734w783oj.fsf@jeremybryant.net> (raw)
In-Reply-To: <87il5mai0x.fsf@jeremybryant.net>

[-- Attachment #1: Type: text/plain, Size: 1990 bytes --]


Jeremy Bryant via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org> writes:

> [1. text/x-diff; 0001-Add-use-cases-of-fn-documentation-facility.patch]...
>
>
>>
>> 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?
>>
>
> Agree this is a more readable version of my initial attempts.
>
> The only thing that is not clear in my mind is the use of the @ifnottex.
> I have left it in the attached patch, as I understand we are trying to
> reduce the size of the printed manual?
>
> I have a 2-volume Elisp manual, which is out of date as the current ones
> don't seem to be printed.
>
> I have also added a line to the commit message which seems appropriate
> here given the rewrites:
> Co-authored-by: Eli Zaretskii <eliz@gnu.org>
>
> If this is all suitable to install I agree to close the original bug.

Eli,
Kindly let me know if the attached patch is good to install or if
anything else is needed to work on for this bug report?
Apologies if it's too soon to follow-up, as a newer contributor I do
not yet have a good sense of timing on these things.
Best, Jeremy


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-use-cases-of-fn-documentation-facility.patch --]
[-- Type: text/x-diff, Size: 1689 bytes --]

From 3f427ea7e437a83b5e62121032d0352abf6b4bd8 Mon Sep 17 00:00:00 2001
From: Jeremy Bryant <jb@jeremybryant.net>
Date: Sun, 3 Dec 2023 21:32:01 +0000
Subject: [PATCH] Add use cases of (fn) documentation facility.

* doc/lispref/functions.texi (Function Documentation):  Add examples

Co-authored-by: Eli Zaretskii <eliz@gnu.org>
---
 doc/lispref/functions.texi | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi
index e646e7c8b0a..34a568b728e 100644
--- a/doc/lispref/functions.texi
+++ b/doc/lispref/functions.texi
@@ -533,6 +533,39 @@ Function Documentation
 compiler emit a warning message when it compiles Lisp programs which
 use the deprecated calling convention.
 
+@ifnottex
+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
+@end ifnottex
+
 @cindex computed documentation string
 @kindex :documentation
 Documentation strings are usually static, but occasionally it can be
-- 
2.42.0


  reply	other threads:[~2023-12-12 22:15 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
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         ` Jeremy Bryant via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-12-15 13:50           ` bug#67499: Fwd: " 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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8734w783oj.fsf@jeremybryant.net \
    --to=bug-gnu-emacs@gnu.org \
    --cc=67499@debbugs.gnu.org \
    --cc=eliz@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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).