unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Help with cl-generic.el, please!
@ 2023-03-19 11:27 Alan Mackenzie
  0 siblings, 0 replies; only message in thread
From: Alan Mackenzie @ 2023-03-19 11:27 UTC (permalink / raw)
  To: emacs-devel

Hello, Emacs.

I'm having trouble with cl-generic.el.  I'm constructing a variant
Emacs.

Consider the test function in
..../test/lisp/progmodes/elisp-mode-tests.el:

    (cl-defmethod xref-elisp-generic-implicit-generic (arg1 arg2)
      "Doc string generic implicit-generic default."
      "default for implicit generic"
      (list arg1 arg2)) ; silence byte-compiler

..  When I evaluate this in Emacs, I get a byte-compiled function.
Element 4 of this vector is a doc string "\n\n(fn ARG &rest ARGS)".
This is correct.

When I do the same in my Emacs variant, that element 4 of the function
vector is nil.  This is a bug I'm trying to solve.

I find the complexity of cl-generic.el unfathomable.  I've spent several
days trying to make sense of it, without much success.  I would have
expected to solve the sort of bug I'm faced with in a few hours at most,
but with cl-defmethod and friends, this has already stretched to several
days.  The problem is cl-generic.el is almost entirely undocumented.
The vast bulk of functions in it have no doc string.  There are no
comments explaining what the code does and why.  There is no
documentation of what the internal structures are.  There is no
explanation of terms such as dispatcher, generalizer, specializer, tag,
...., all of which are used in a tighly context dependent way.

I think cl-generic.el needs to be documented.

Back to my bug.  Somewhere in the tree of functions invoked from
cl-defmethod and friends, some function causes element 4 of the function
vector to get set to a doc string.  Would somebody (?Stefan) familiar
with cl-generic.el please identify where in the source code this
happens, so as to help me solve my bug.

Thanks!

-- 
Alan Mackenzie (Nuremberg, Germany).



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-19 11:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-19 11:27 Help with cl-generic.el, please! Alan Mackenzie

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