From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Getting rid of low-level assumptions in yasnippet Date: Mon, 30 Mar 2015 14:53:30 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1427741707 13830 80.91.229.3 (30 Mar 2015 18:55:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 30 Mar 2015 18:55:07 +0000 (UTC) Cc: =?windows-1252?B?Sm/jbyBU4XZvcmE=?= , emacs-devel@gnu.org To: Matthew Fidler Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 30 20:54:56 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ycepd-0005nh-Us for ged-emacs-devel@m.gmane.org; Mon, 30 Mar 2015 20:54:42 +0200 Original-Received: from localhost ([::1]:35614 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ycepd-0006Uq-Ee for ged-emacs-devel@m.gmane.org; Mon, 30 Mar 2015 14:54:41 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43182) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YcepP-0006Ue-Rt for emacs-devel@gnu.org; Mon, 30 Mar 2015 14:54:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YcepN-0007bo-6Y for emacs-devel@gnu.org; Mon, 30 Mar 2015 14:54:27 -0400 Original-Received: from mercure.iro.umontreal.ca ([132.204.24.67]:32845) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YcepM-0007bH-O7 for emacs-devel@gnu.org; Mon, 30 Mar 2015 14:54:25 -0400 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id D2CD685CA1; Mon, 30 Mar 2015 14:54:10 -0400 (EDT) Original-Received: from lechon.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 6E58D1E5B8B; Mon, 30 Mar 2015 14:53:30 -0400 (EDT) Original-Received: by lechon.iro.umontreal.ca (Postfix, from userid 20848) id 42B48B40DB; Mon, 30 Mar 2015 14:53:30 -0400 (EDT) In-Reply-To: (Matthew Fidler's message of "Mon, 30 Mar 2015 10:15:43 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.71, requis 5, autolearn=not spam, ALL_TRUSTED -2.82, MC_TRANSFR 0.11, MC_TSTLAST 0.00) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 132.204.24.67 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:184561 Archived-At: > 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 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))