unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: David Ponce <da_vid@orange.fr>
To: 65270@debbugs.gnu.org
Subject: bug#65270: 30.0.50; `describe-function' issue with some methods
Date: Sun, 13 Aug 2023 12:36:25 +0200	[thread overview]
Message-ID: <efcde695-03d2-630b-07d9-48fe4e14f877@orange.fr> (raw)

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'.

Thanks!

<1> In scratch buffer eval:
===========================
*scratch*
------------------------------------------------------------------
(cl-defgeneric foo (arg)
   "Generic foo receiving any ARG."
   (format "%S" arg))
foo

(cl-defmethod foo ((arg atom))
   "Specialized foo receiving any atoms."
   (format "atom %s" (cl-call-next-method)))
foo

(cl-defmethod foo ((arg string))
   "Specialized foo receiving strings."
   (format "string %S" arg))
foo

;; Check results are correct
(foo 1)
"atom 1"
(foo '(1))
"(1)"
(foo "1")
"string \"1\""
------------------------------------------------------------------

<2> M-x describe-function RET foo RET
=====================================
*Help* (is not correct for the method using `cl-call-next-method')
------------------------------------------------------------------
foo is a byte-compiled Lisp function.

(foo ARG)

Generic foo receiving any ARG.

   Probably introduced at or before Emacs version 1.2.


This is a generic function.

Implementations:

(foo (ARG string))
Specialized foo receiving strings.

(foo (ARG0 atom) &rest CL--ARGS) <<<<<<<<<<<<< Incorrect
Undocumented

(foo ARG)
Undocumented
------------------------------------------------------------------


<3> In scratch buffer eval:
===========================
*scratch*
------------------------------------------------------------------
;; Redefine method without calling `cl-call-next-method'
(cl-defmethod foo ((arg atom))
   "Specialized foo receiving any atoms."
   (format "atom %S" arg))
foo

;; Check results are correct
(foo 1)
"atom 1"
(foo '(1))
"(1)"
(foo "1")
"string \"1\""
------------------------------------------------------------------

<4> M-x describe-function RET foo RET
=====================================
*Help* (is correct)
------------------------------------------------------------------
foo is a byte-compiled Lisp function.

(foo ARG)

Generic foo receiving any ARG.

   Probably introduced at or before Emacs version 1.2.


This is a generic function.

Implementations:

(foo (ARG string))
Specialized foo receiving strings.

(foo (ARG atom)) <<<<<<<<<<<<< Correct
Specialized foo receiving any atoms.

(foo ARG)
Undocumented
------------------------------------------------------------------

In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
  3.24.38, cairo version 1.17.8) of 2023-08-13
Repository revision: de6c1c4d5c92b92d5b280e157c2a5bc3228749f2
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12014000
System Description: Fedora Linux 38 (KDE Plasma)

Configured using:
  'configure --with-x-toolkit=gtk3
  --with-native-compilation=no'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON
LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB

Important settings:
   value of $LC_TIME: fr_FR.utf8
   value of $LANG: fr_FR.UTF-8
   locale-coding-system: utf-8-unix





             reply	other threads:[~2023-08-13 10:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-13 10:36 David Ponce [this message]
2023-08-14 10:41 ` bug#65270: 30.0.50; `describe-function' issue with some methods David Ponce
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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=efcde695-03d2-630b-07d9-48fe4e14f877@orange.fr \
    --to=da_vid@orange.fr \
    --cc=65270@debbugs.gnu.org \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).