unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / Atom feed
* bug#46662: [PATCH] cl-extra: Fix docstring retrieval
@ 2021-02-20 11:42 Julian Scheid
  2021-02-22 15:06 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 2+ messages in thread
From: Julian Scheid @ 2021-02-20 11:42 UTC (permalink / raw)
  To: 46662


[-- Attachment #1.1: Type: text/plain, Size: 1146 bytes --]

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.

[-- Attachment #1.2: Type: text/html, Size: 1296 bytes --]

[-- Attachment #2: cl--describe-class-slots_plist-get.patch --]
[-- Type: application/octet-stream, Size: 1263 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#46662: [PATCH] cl-extra: Fix docstring retrieval
  2021-02-20 11:42 bug#46662: [PATCH] cl-extra: Fix docstring retrieval Julian Scheid
@ 2021-02-22 15:06 ` Lars Ingebrigtsen
  0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2021-02-22 15:06 UTC (permalink / raw)
  To: Julian Scheid; +Cc: 46662

Julian Scheid <julians37@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





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-02-22 15:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-20 11:42 bug#46662: [PATCH] cl-extra: Fix docstring retrieval Julian Scheid
2021-02-22 15:06 ` Lars Ingebrigtsen

unofficial mirror of bug-gnu-emacs@gnu.org 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/emacs-bugs/0 emacs-bugs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 emacs-bugs emacs-bugs/ https://yhetil.org/emacs-bugs \
		bug-gnu-emacs@gnu.org
	public-inbox-index emacs-bugs

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.bugs
	nntp://news.gmane.io/gmane.emacs.bugs


AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git