From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Matthew Fidler <matthew.fidler@gmail.com>
Cc: "João Távora" <joaotavora@gmail.com>, emacs-devel@gnu.org
Subject: Re: Getting rid of low-level assumptions in yasnippet
Date: Mon, 30 Mar 2015 14:53:30 -0400 [thread overview]
Message-ID: <jwvego6qtrg.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <CAOmN8O6k2yoGaGFS0jS5wR0RjaVRX2P_Kb-hyoUK4CqQVsoqbw@mail.gmail.com> (Matthew Fidler's message of "Mon, 30 Mar 2015 10:15:43 -0500")
> I believe the problem is with named components. In the old eieio, it
> allowed nil names, but in the current implementation it requires a name for
> named components.
Actually, (clone <foo> nil) in Emacs-24.4 did not pass nil as the object
name either and signaled the same error, so the problem is elsewhere.
IOW, in Emacs-24.4, this same "clone" call did not receive nil as
argument, but received a string. So the problem seems to be that
(oref global object-name) returns nil now.
I think the problem is in the fact that ergoemacs uses a mix of "native
EIEIO object names" (the thing which is now deprecated) and "proper
eieio-named names". E.g. it does things like
(clone ergoemacs-theme-component-maps--curr-component
(concat (oref ergoemacs-theme-component-maps--curr-component object-name) "::" version)))
which passes a string as "native EIEIO object name" and it also uses things then later on in
ergoemacs-copy-obj it expects (oref global object-name) to return
that name. Instead it should use :object-name
(clone ergoemacs-theme-component-maps--curr-component
:object-name (concat (oref ergoemacs-theme-component-maps--curr-component object-name) "::" version)))
With the patch below I get further but bump into another bug where
ergoemacs seems to use the symbol `standard' as the name of an object
(if I understood the backtrace correctly). I have to leave now, so
here's what I have so far, which seems to be working (the "format"
thingy is just the current workaround. Not sure if the bug is on Emacs
side or not).
Stefan
diff --git a/lisp/emacs-lisp/eieio-base.el b/lisp/emacs-lisp/eieio-base.el
index 5b3d902..86235bd 100644
--- a/lisp/emacs-lisp/eieio-base.el
+++ b/lisp/emacs-lisp/eieio-base.el
@@ -498,6 +498,14 @@ All slots are unbound, except those initialized with PARAMS."
(concat nm "-1")))))
nobj))
+(cl-defmethod make-instance ((class (subclass eieio-named)) &rest args)
+ (if (not (stringp (car args)))
+ (cl-call-next-method)
+ (funcall (if eieio-backward-compatibility #'ignore #'message)
+ "Obsolete: object-name passed without :object-name to %S constructor"
+ (car args) class)
+ (apply #'cl-call-next-method class :object-name args)))
+
(provide 'eieio-base)
;;; eieio-base.el ends here
diff --git a/ergoemacs-theme-engine.el b/ergoemacs-theme-engine.el
index 6c0b922..4cca730 100644
--- a/ergoemacs-theme-engine.el
+++ b/ergoemacs-theme-engine.el
@@ -2162,7 +2163,7 @@ Allows the component not to be calculated."
COMPONENT can be defined as component::version"
(if (listp component)
(ergoemacs-theme-component-map-list
- (or name "list") :map-list (mapcar (lambda(comp) (ergoemacs-theme-get-component comp version)) component)
+ (if name (format "%s" name) "list") :map-list (mapcar (lambda(comp) (ergoemacs-theme-get-component comp version)) component)
:components component)
(let* ((comp-name (or (and (symbolp component) (symbol-name component))
component))
prev parent reply other threads:[~2015-03-30 18:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-19 19:49 Getting rid of low-level assumptions in yasnippet Stefan Monnier
2015-03-20 11:03 ` João Távora
2015-03-20 14:18 ` Stefan Monnier
2015-03-28 15:59 ` João Távora
2015-03-28 20:32 ` Stefan Monnier
2015-03-28 21:23 ` João Távora
2015-03-29 19:36 ` Matthew Fidler
2015-03-30 0:47 ` Stefan Monnier
2015-03-30 15:15 ` Matthew Fidler
2015-03-30 18:53 ` Stefan Monnier [this message]
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=jwvego6qtrg.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@gnu.org \
--cc=joaotavora@gmail.com \
--cc=matthew.fidler@gmail.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.