GNU bug report logs - #46662
[PATCH] cl-extra: Fix docstring retrieval

Previous Next

Package: emacs;

Reported by: Julian Scheid <julians37 <at> gmail.com>

Date: Sat, 20 Feb 2021 11:43:02 UTC

Severity: normal

Tags: fixed, patch

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

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 46662 in the body.
You can then email your comments to 46662 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#46662; Package emacs. (Sat, 20 Feb 2021 11:43:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Julian Scheid <julians37 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 20 Feb 2021 11:43:02 GMT) Full text and rfc822 format available.

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

From: Julian Scheid <julians37 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] cl-extra: Fix docstring retrieval
Date: Sun, 21 Feb 2021 00:42:20 +1300
[Message part 1 (text/plain, inline)]
Given

  (require 'cl-macs)
  (cl-defstruct foobar
    (baz nil :documentation "an important piece of information"))

Now, (describe-symbol 'foobar-baz) will include "an important piece of
information".

However, (describe-symbol 'foobar) will not:

Name Type Default
———— ———— ———————
baz t nil

... even though the intention to include it can be seen by looking for
the string ':documentation' in `cl--describe-class-slots`.

This is because `cl--describe-class-slots` accidentally uses
`alist-get` instead of `plist-get`.

With the attached patch, (describe-symbol 'foobar) works as intended:

Name Type Default Doc
———— ———— ——————— ———
baz t nil an important piece of information

Note: `cl--describe-class-slot' (a different function) appears to have
the same bug, but I have no idea how one would go about adding class
slots to a struct and therefore no way of testing any changes to this
other function.

Could it be a code path that is never executed anyway?  I decided to
leave it alone, this patch should be an improvement regardless.
[Message part 2 (text/html, inline)]
[cl--describe-class-slots_plist-get.patch (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#46662; Package emacs. (Mon, 22 Feb 2021 15:07:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Julian Scheid <julians37 <at> gmail.com>
Cc: 46662 <at> debbugs.gnu.org
Subject: Re: bug#46662: [PATCH] cl-extra: Fix docstring retrieval
Date: Mon, 22 Feb 2021 16:06:32 +0100
Julian Scheid <julians37 <at> gmail.com> writes:

> With the attached patch, (describe-symbol 'foobar) works as intended:
>
> Name Type Default Doc
> ———— ———— ——————— ———
> baz t nil an important piece of information

Thanks; applied to Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 22 Feb 2021 15:07:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 46662 <at> debbugs.gnu.org and Julian Scheid <julians37 <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 22 Feb 2021 15:07: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. (Tue, 23 Mar 2021 11:24:50 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 173 days ago.

Previous Next


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