GNU bug report logs -
#22462
25.0.50; Docstring of cl-defun/defmacro are too short
Previous Next
Reported by: Artur Malabarba <bruce.connor.am <at> gmail.com>
Date: Mon, 25 Jan 2016 10:44:01 UTC
Severity: minor
Tags: fixed, patch
Found in version 25.0.50
Fixed in version 25.1
Done: npostavs <at> users.sourceforge.net
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 22462 in the body.
You can then email your comments to 22462 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#22462
; Package
emacs
.
(Mon, 25 Jan 2016 10:44:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Artur Malabarba <bruce.connor.am <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Mon, 25 Jan 2016 10:44:01 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Every time I turn to cl-defun or cl-defmacro (usually for the extra
arglist versatility), I end up asking myself “was it &key or &keys?” or
“what was the name of that really long option?”.
Naturally, I turn to `C-h f cl-defun', only to be told that it works
“Like normal ‘defun’, except ARGLIST allows full Common Lisp
conventions”. That's not very helpful for someone who's not profficient
in Common Lisp.
I think there should be a link to the relevant info node and, preferably,
a brief summary of the conventions.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#22462
; Package
emacs
.
(Mon, 25 Jan 2016 11:05:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 22462 <at> debbugs.gnu.org (full text, mbox):
On 2016-01-25, at 09:43, Artur Malabarba <bruce.connor.am <at> gmail.com> wrote:
> Every time I turn to cl-defun or cl-defmacro (usually for the extra
> arglist versatility), I end up asking myself “was it &key or &keys?” or
> “what was the name of that really long option?”.
>
> Naturally, I turn to `C-h f cl-defun', only to be told that it works
> “Like normal ‘defun’, except ARGLIST allows full Common Lisp
> conventions”. That's not very helpful for someone who's not profficient
> in Common Lisp.
>
> I think there should be a link to the relevant info node and, preferably,
> a brief summary of the conventions.
+1. And I'd vote for a summary, not a link.
Best,
--
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#22462
; Package
emacs
.
(Mon, 25 Jan 2016 14:24:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 22462 <at> debbugs.gnu.org (full text, mbox):
+1. The Emacs Common-Lisp emulations have generally just punted
wrt doc, sending you off to consult the C-L doc. That's OK
for a start, but it could be better. Especially, any differences
from the C-L behavior should be noted (they usually are).
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#22462
; Package
emacs
.
(Mon, 25 Jan 2016 15:59:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 22462 <at> debbugs.gnu.org (full text, mbox):
> From: Artur Malabarba <bruce.connor.am <at> gmail.com>
> Date: Mon, 25 Jan 2016 08:43:13 +0000
>
> I think there should be a link to the relevant info node and, preferably,
> a brief summary of the conventions.
A link to the manual shouldn't replace the documentation in the doc
string. It could explain more and provide additional background
information, but the essentials should be in the doc string.
I hope Someone™ will volunteer soon to fill the voids. TIA.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#22462
; Package
emacs
.
(Sat, 02 Jul 2016 04:03:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 22462 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
tags 22462 patch
quit
Marcin Borkowski <mbork <at> mbork.pl> writes:
> On 2016-01-25, at 09:43, Artur Malabarba <bruce.connor.am <at> gmail.com> wrote:
>
>> Every time I turn to cl-defun or cl-defmacro (usually for the extra
>> arglist versatility), I end up asking myself “was it &key or &keys?” or
>> “what was the name of that really long option?”.
>>
>> Naturally, I turn to `C-h f cl-defun', only to be told that it works
>> “Like normal ‘defun’, except ARGLIST allows full Common Lisp
>> conventions”. That's not very helpful for someone who's not profficient
>> in Common Lisp.
>>
>> I think there should be a link to the relevant info node and, preferably,
>> a brief summary of the conventions.
>
> +1. And I'd vote for a summary, not a link.
Here's a patch adding both a terse summary and a link, does it look ok?
[v1-0001-Add-details-to-cl-lib-defining-macros-docstrings.patch (text/x-diff, inline)]
From a19d4e880eb54cd68733666cdb43f4c7510ad91b Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs <at> gmail.com>
Date: Fri, 1 Jul 2016 23:53:26 -0400
Subject: [PATCH v1] Add details to cl-lib defining macros docstrings
* lisp/emacs-lisp/cl-macs.el (cl-defun, cl-defmacro): Add terse summary
of supported arglist forms (Bug #22462).
---
lisp/emacs-lisp/cl-macs.el | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index 2cb821e..c51ed9d 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -327,6 +327,20 @@ cl-defun
Like normal `defun', except ARGLIST allows full Common Lisp conventions,
and BODY is implicitly surrounded by (cl-block NAME ...).
+The full form of a Common Lisp function argument list is
+
+ (VAR...
+ [&optional (VAR [INITFORM [SVAR]])...]
+ [&rest|&body VAR]
+ [&key (([KEYWORD] VAR) [INITFORM [SVAR]])... [&allow-other-keys]]
+ [&aux (VAR [INITFORM])...])
+
+VAR maybe be replaced recursively with an argument list for
+destructing, `&whole' is supported within these sublists. If
+SVAR, INITFORM, and KEYWORD are all omitted, then `(VAR)' may be
+written simply `VAR'. See the Info node `(cl)Argument Lists' for
+more details.
+
\(fn NAME ARGLIST [DOCSTRING] BODY...)"
(declare (debug
;; Same as defun but use cl-lambda-list.
@@ -406,6 +420,21 @@ cl-defmacro
Like normal `defmacro', except ARGLIST allows full Common Lisp conventions,
and BODY is implicitly surrounded by (cl-block NAME ...).
+The full form of a Common Lisp macro argument list is
+
+ (VAR...
+ [&optional (VAR [INITFORM [SVAR]])...]
+ [&rest|&body VAR]
+ [&key (([KEYWORD] VAR) [INITFORM [SVAR]])... [&allow-other-keys]]
+ [&aux (VAR [INITFORM])...]
+ [&environment VAR])
+
+VAR maybe be replaced recursively with an argument list for
+destructing, `&whole' is supported within these sublists. If
+SVAR, INITFORM, and KEYWORD are all omitted, then `(VAR)' may be
+written simply `VAR'. See the Info node `(cl)Argument Lists' for
+more details.
+
\(fn NAME ARGLIST [DOCSTRING] BODY...)"
(declare (debug
(&define name cl-macro-list cl-declarations-or-string def-body))
--
2.8.0
Added tag(s) patch.
Request was from
npostavs <at> users.sourceforge.net
to
control <at> debbugs.gnu.org
.
(Sat, 02 Jul 2016 04:03:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#22462
; Package
emacs
.
(Tue, 05 Jul 2016 23:07:02 GMT)
Full text and
rfc822 format available.
Message #22 received at 22462 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Looks fine to me!
On Sat, Jul 2, 2016 at 1:02 AM <npostavs <at> users.sourceforge.net> wrote:
> tags 22462 patch
> quit
>
> Marcin Borkowski <mbork <at> mbork.pl> writes:
>
> > On 2016-01-25, at 09:43, Artur Malabarba <bruce.connor.am <at> gmail.com>
> wrote:
> >
> >> Every time I turn to cl-defun or cl-defmacro (usually for the extra
> >> arglist versatility), I end up asking myself “was it &key or &keys?” or
> >> “what was the name of that really long option?”.
> >>
> >> Naturally, I turn to `C-h f cl-defun', only to be told that it works
> >> “Like normal ‘defun’, except ARGLIST allows full Common Lisp
> >> conventions”. That's not very helpful for someone who's not profficient
> >> in Common Lisp.
> >>
> >> I think there should be a link to the relevant info node and,
> preferably,
> >> a brief summary of the conventions.
> >
> > +1. And I'd vote for a summary, not a link.
>
> Here's a patch adding both a terse summary and a link, does it look ok?
>
>
[Message part 2 (text/html, inline)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#22462
; Package
emacs
.
(Sat, 09 Jul 2016 15:02:01 GMT)
Full text and
rfc822 format available.
Message #25 received at 22462 <at> debbugs.gnu.org (full text, mbox):
tags 22462 fixed
close 22462 25.1
quit
Artur Malabarba <bruce.connor.am <at> gmail.com> writes:
> Looks fine to me!
>
Pushed as aac62a67
Added tag(s) fixed.
Request was from
npostavs <at> users.sourceforge.net
to
control <at> debbugs.gnu.org
.
(Sat, 09 Jul 2016 15:02:02 GMT)
Full text and
rfc822 format available.
bug marked as fixed in version 25.1, send any further explanations to
22462 <at> debbugs.gnu.org and Artur Malabarba <bruce.connor.am <at> gmail.com>
Request was from
npostavs <at> users.sourceforge.net
to
control <at> debbugs.gnu.org
.
(Sat, 09 Jul 2016 15:02:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sun, 07 Aug 2016 11:24:03 GMT)
Full text and
rfc822 format available.
This bug report was last modified 8 years and 355 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.