unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* EIEIO accessing class slots
@ 2021-06-10 15:20 pillule
  2021-06-10 19:38 ` pillule
  2021-06-10 22:02 ` Stefan Monnier via Users list for the GNU Emacs text editor
  0 siblings, 2 replies; 14+ messages in thread
From: pillule @ 2021-06-10 15:20 UTC (permalink / raw)
  To: help-gnu-emacs



Hi

How can I accede to the initarg of an eieio class ?

Let's say I have a class as :

(defclass moirai-dired-side ()
  ((display-alist
    :initarg :display-alist
    :initform '((moirai-dired-p)
                (display-buffer--in-dired-side-window)
                (slot . 0) (side . left) (select . t)
                (preserve-size (t . t)) (window-width . 35)
                (window-parameters . ((no-other-window . t)
                                      (no-delete-other-windows . t))))
    :custom (custom-variable-type 'display-buffer-alist)
    :documentation
    "Alist of conditionals actions for `display-buffer',
It is the same format that `display-buffer-alist'.")))


Now I can create instances with

(setf morai-dired-side-left (moirai-dired-side))

And so far manipulating the object will work fine,
but if we go back to the class itself ...

;; apparently this is not an eieio-class ?!
(eieio--class-p 'morai-dired-side)
;; => nil

;; but I can anyway access its slots
(eieio-class-slots 'moirai-dired-side)
;; => (#s(cl-slot-descriptor display-alist '((moirai-dired-p) (display-buffer--in-dired-side-window) (slot . 0) (side . left) (select . t) (preserve-size (t . t)) (window-width . 35) (window-parameters (no-other-window . t) (no-delete-other-windows . t))) t ((:documentation . "Alist of conditionals actions for `display-buffer',
It is the same format that `display-buffer-alist'.") (:custom custom-variable-type 'display-buffer-alist) (:group default))))

;; the issue is I have no idea of how to get them individually
(eieio--class-slot-initarg 'moirai-dired-side :display-alist)
;; ! Wrong type argument: eieio--class, moirai-dired-side, class


Am I missing something ? I seen a bug report from 2015 at this subject (#bug19552) but it doesn't help.

As a side note the eieio manual is outdated, it references 'class-slot-initarg',
while it is now 'eieio--class-slot-initarg'.

--



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

end of thread, other threads:[~2021-06-12 10:35 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-10 15:20 EIEIO accessing class slots pillule
2021-06-10 19:38 ` pillule
2021-06-10 22:03   ` Stefan Monnier via Users list for the GNU Emacs text editor
2021-06-10 22:02 ` Stefan Monnier via Users list for the GNU Emacs text editor
2021-06-10 23:04   ` pillule
2021-06-11  0:04     ` Stefan Monnier via Users list for the GNU Emacs text editor
2021-06-11  0:23       ` pillule
2021-06-11  0:59         ` pillule
2021-06-11 13:50           ` Stefan Monnier
2021-06-11 13:45         ` Stefan Monnier
2021-06-11 14:23           ` Stefan Monnier via Users list for the GNU Emacs text editor
2021-06-11 14:29             ` Stefan Monnier via Users list for the GNU Emacs text editor
2021-06-12 10:35           ` pillule
2021-06-11  2:52       ` pillule

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