emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting rid of low-level assumptions in yasnippet


From: Stefan Monnier
Subject: Re: Getting rid of low-level assumptions in yasnippet
Date: Mon, 30 Mar 2015 14:53:30 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]