all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: Joe Riel <joer@san.rr.com>
Cc: Help GNU Emacs <help-gnu-emacs@gnu.org>
Subject: Re: Display an eieio object
Date: Fri, 15 Jun 2018 05:53:29 +0200	[thread overview]
Message-ID: <87y3fgln7q.fsf@web.de> (raw)
In-Reply-To: <20180614074508.124fe601@gauss> (Joe Riel's message of "Thu, 14 Jun 2018 07:45:08 -0700")

Joe Riel <joer@san.rr.com> writes:

> Is there a way to nicely display an eieio object?  Using
> describe-variable (C-h v) shows the values but not the slot names,
> which makes it less than helpful.

Depends a bit on your Emacs version.

Since Emacs 26, C-h v uses the new cl-print.el to print variable values.
Eieio implements the cl-print-object method for eieio-objects, and that
just falls back to `object-print'.  `object-print' also existed before
Emacs 26, but AFAIK it prints only a wrapper and no values at all.  You
would need to reimplement the `object-print' method to do what you want,
probably looping over the `eieio-class-slots'.  You can even use
different implementations for different classes - the infrastructure is
all there.  If you have a recent enough Emacs version, C-v should
automatically use your method implementation(s).


Michael.



  parent reply	other threads:[~2018-06-15  3:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-14 14:45 Display an eieio object Joe Riel
2018-06-15  1:18 ` Pierre Lorenzon
2018-06-15  3:53 ` Michael Heerdegen [this message]
2018-06-15 14:36   ` Joe Riel

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=87y3fgln7q.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=help-gnu-emacs@gnu.org \
    --cc=joer@san.rr.com \
    /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.