GNU bug report logs -
#46662
[PATCH] cl-extra: Fix docstring retrieval
Previous Next
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.
Full log
View this message in rfc822 format
[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)]
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.