Subject: 28.0.50; Clean up EIEIO

From: Michael Heerdegen <[email-masked]>
Date: Fri, 25 Sep 2020 21:49:46 +0200

Hi,

I'm currently seriously learning and using EIEIO for the first time.
Here are my findings (so far):

(1) Manual

(1a) (info "(eieio) Introduction")

| Method dispatch
|      EIEO does not support method dispatch for built-in types and
|      multiple arguments types.  In other words, method dispatch only
|      looks at the first argument, and this one must be an EIEIO type.

What's said about dispatching only looking at the first argument is not
true anymore, right?  And

| ‘:around’ method tag
|      This CLOS method tag is non-functional.

Also not correct any more, right?

That whole paragraph should be overhauled and adapted to the obviously
new state of the code I guess.

(1b) Manual (info "(eieio) Building Classes")

| Whenever defclass is used to create a new class, a predicate is created
| for it, named ‘CLASS-NAME-p’:
| 
|  -- Function: CLASS-NAME-p object
|      Return non-‘nil’ if and only if OBJECT is of the class CLASS-NAME.

I found it surprising that the predicate fails for instances of classes
that inherit from CLASS-NAME.  If this is intended, I guess this should
be mentioned...?

(2) `info-lookup' doesn't work for eieio functions.  I guess it should?

(3) Doc of `defclass':

|  :writer     - A function symbol which will `write' an object's slot.

I find "`write'" confusing: there is no function `write' (so why quote
it like this?), and it should better be "set" anyway, since in other
places (in eieio!) "write" is used as synonym for "print".

(4) Whitespace in generated docs

In quite a few places generated docs have newlines missing or misplaced
space characters and such things.  Stuff like this:

diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el
index 5bf74792c0..5701fcf026 100644
--- a/lisp/emacs-lisp/cl-extra.el
+++ b/lisp/emacs-lisp/cl-extra.el
@@ -800,8 +800,9 @@ cl--describe-class

     ;; Type's documentation.
     (let ((doc (cl--class-docstring class)))
-      (when doc
-        (insert "\n" doc "\n\n")))
+      (if doc
+          (insert "\n" doc "\n\n")
+        (insert "\n")))

     ;; Describe all the slots in this class.
     (cl--describe-class-slots class)
diff --git a/lisp/emacs-lisp/eieio-opt.el b/lisp/emacs-lisp/eieio-opt.el
index 59af7e12d2..b9bab42470 100644
--- a/lisp/emacs-lisp/eieio-opt.el
+++ b/lisp/emacs-lisp/eieio-opt.el
@@ -136,9 +136,9 @@ eieio-help-constructor
 	  (def (symbol-function ctr)))
       (goto-char (point-min))
       (prin1 ctr)
-      (insert (format " is an %s object constructor function"
+      (insert (format " is an%s object constructor function"
 		      (if (autoloadp def)
-			  "autoloaded"
+			  " autoloaded"
 			"")))
       (when (and (autoloadp def)
 		 (null location))

Some love is needed here.

Ok, that's what I found so far.

TIA, Michael.

In GNU Emacs 28.0.50 (build 49, x86_64-pc-linux-gnu, GTK+ Version 3.24.23, cairo version 1.16.0)
 of 2020-09-25 built on drachen
Repository revision: d10ef50c9b7c8eeb04194edc8d729dcc5a41b8f6
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12008000
System Description: Debian GNU/Linux bullseye/sid