GNU bug report logs - #28557
26.0.60; Bugs using (:documentation FORM) in closures

Previous Next

Package: emacs;

Reported by: Gemini Lasswell <gazally <at> runbox.com>

Date: Fri, 22 Sep 2017 17:32:02 UTC

Severity: normal

Found in version 26.0.60

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 28557 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Gemini Lasswell <gazally <at> runbox.com>
Cc: 28557 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Subject: Re: bug#28557: 26.0.60; Bugs using (:documentation FORM) in closures
Date: Sun, 03 May 2020 03:32:50 +0200
Gemini Lasswell <gazally <at> runbox.com> writes:

> Since Emacs 25, docstrings can be constructed using
> (:documentation FORM) in closures, when lexical-binding is on. This
> isn't documented except in NEWS. Bug #24773 is about Edebug specs
> which have not been updated to recognize :documentation. I'd like to
> fix it, so I started trying to figure out which macros accept
> :documentation forms so I would know which Edebug specs to update, and
> that effort turned into a collection of tests for the feature, see
> attached:

There is a long list of tests here, but it seems like none of this was
ever committed to master.  Should it be?

> While doing this I found these bugs:
>
> 1. A lambda wrapped by cl-function with a :documentation form will
> not get a docstring and the :documentation form will be left in the
> body of the closure.
>
> 2. In code run interactively, a :documentation form in cl-defmacro or
> defmacro will work correctly. However if you byte-compile that code,
> the byte-compiler stops with the following error message:
>     Symbol’s function definition is void: internal-make-closure
>
> 3. A :documentation form in cl-defgeneric only works if its argument
> is a string literal. In cl-defmethod, it works whether the argument is
> a string literal or an expression.
>
> 4. A :documentation form works in cl-iter-defun and iter-defun, but
> not in iter-lambda.
>
> Stefan, here's a list of macros in which it appears to me that
> (:documentation FORM) is supposed to work. Is this correct? Am I
> missing any?
>
> lambda
> pcase-lambda
> defun
> defmacro
> cl-defun
> cl-defmacro
> iter-defun
> cl-iter-defun
> iter-lambda
> function
> cl-function
> cl-defgeneric
> cl-defmethod
> defsubst
> cl-defsubst

Does anyone know the answers to the above questions?

Best regards,
Stefan Kangas




This bug report was last modified 3 years and 210 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.