From: David Ponce <da_vid@orange.fr>
To: 65270@debbugs.gnu.org
Cc: Stefan Monnier <monnier@iro.umontreal.ca>
Subject: bug#65270: 30.0.50; `describe-function' issue with some methods
Date: Mon, 14 Aug 2023 12:41:17 +0200 [thread overview]
Message-ID: <a9ecfa25-1709-9cfb-1be6-93898d93505a@orange.fr> (raw)
In-Reply-To: <efcde695-03d2-630b-07d9-48fe4e14f877@orange.fr>
[-- Attachment #1: Type: text/plain, Size: 722 bytes --]
On 13/08/2023 12:36, David Ponce wrote:
> Hello,
>
> It seems there is an issue with `describe-function' of a method that
> calls `cl-call-next-method'. For a such method `describe-function' says
> that the method is "Undocumented" even if a doc string is present.
>
> Also the mentioned signature is weird. See an illustration below using
> a simple recipe, running 'emacs -Q'.
>
[...]
Hello,
The attached patch fixed for me the doc string issue with `describe-function'
for methods calling `cl-call-next-method'.
It would be nice if someone who better knows the cl-generic library will
double check it (CC Stefan, the author).
Unfortunately, I didn't find a solution for arguments.
Hope it will help.
Thanks
[-- Attachment #2: cl-generic-docstring-1.patch --]
[-- Type: text/x-patch, Size: 2189 bytes --]
diff --git a/lisp/emacs-lisp/cl-generic.el b/lisp/emacs-lisp/cl-generic.el
index b062c280a41..722211d6ba8 100644
--- a/lisp/emacs-lisp/cl-generic.el
+++ b/lisp/emacs-lisp/cl-generic.el
@@ -429,6 +429,15 @@ cl-generic-define-context-rewriter
(lexical-binding
(cons 'curried
`#'(lambda (,nm) ;Called when constructing the effective method.
+ ,@(let* ((prebody (car parsed-body))
+ (ds (if (stringp (car prebody))
+ prebody
+ (setq prebody (cons nil prebody))))
+ (usage (help-split-fundoc (car ds) nil)))
+ (unless usage
+ (setcar ds (help-add-fundoc-usage (car ds)
+ args)))
+ prebody)
(let ((,nmp (if (cl--generic-isnot-nnm-p ,nm)
#'always #'ignore)))
;; This `(λ (&rest x) .. (apply (λ (args) ..) x))'
@@ -446,15 +455,6 @@ cl-generic-define-context-rewriter
;; is always called directly and there are no
;; `&optional' args.
(lambda (&rest ,arglist)
- ,@(let* ((prebody (car parsed-body))
- (ds (if (stringp (car prebody))
- prebody
- (setq prebody (cons nil prebody))))
- (usage (help-split-fundoc (car ds) nil)))
- (unless usage
- (setcar ds (help-add-fundoc-usage (car ds)
- args)))
- prebody)
(let ((,cnm (lambda (&rest args)
(apply ,nm (or args ,arglist)))))
;; This `apply+lambda' basically parses
next prev parent reply other threads:[~2023-08-14 10:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-13 10:36 bug#65270: 30.0.50; `describe-function' issue with some methods David Ponce
2023-08-14 10:41 ` David Ponce [this message]
2023-08-14 22:04 ` David Ponce
2023-08-15 2:40 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-15 9:09 ` David Ponce
2023-09-15 12:24 ` Stefan Kangas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a9ecfa25-1709-9cfb-1be6-93898d93505a@orange.fr \
--to=da_vid@orange.fr \
--cc=65270@debbugs.gnu.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.