From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#19620: 25.0.50; Eieio constructor behaviour changed and broke pcache.el Date: Sat, 17 Jan 2015 09:43:18 -0500 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1421505852 17829 80.91.229.3 (17 Jan 2015 14:44:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 17 Jan 2015 14:44:12 +0000 (UTC) Cc: 19620@debbugs.gnu.org To: Kirill Ignatiev Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jan 17 15:44:11 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1YCUbi-0002vB-Pj for geb-bug-gnu-emacs@m.gmane.org; Sat, 17 Jan 2015 15:44:10 +0100 Original-Received: from localhost ([::1]:59399 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YCUbi-0000p6-4R for geb-bug-gnu-emacs@m.gmane.org; Sat, 17 Jan 2015 09:44:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37948) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YCUbe-0000mr-KI for bug-gnu-emacs@gnu.org; Sat, 17 Jan 2015 09:44:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YCUba-0002md-HP for bug-gnu-emacs@gnu.org; Sat, 17 Jan 2015 09:44:06 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:50911) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YCUba-0002mZ-Dl for bug-gnu-emacs@gnu.org; Sat, 17 Jan 2015 09:44:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YCUba-0003dm-7z for bug-gnu-emacs@gnu.org; Sat, 17 Jan 2015 09:44:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 17 Jan 2015 14:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19620 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19620-submit@debbugs.gnu.org id=B19620.142150580713942 (code B ref 19620); Sat, 17 Jan 2015 14:44:02 +0000 Original-Received: (at 19620) by debbugs.gnu.org; 17 Jan 2015 14:43:27 +0000 Original-Received: from localhost ([127.0.0.1]:59772 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YCUb0-0003co-7y for submit@debbugs.gnu.org; Sat, 17 Jan 2015 09:43:26 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:4403) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YCUay-0003ca-9A for 19620@debbugs.gnu.org; Sat, 17 Jan 2015 09:43:24 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aj4PAOwQflS4rwoL/2dsb2JhbABbgweDYIVawjuCYgQCAoEkFwEBAQEBAXyEAwEBBFYjEAs0EhQYDSSIU9ZZAQEBAQEFAQEBAR6QbweESAWLAZIxj3OCCoF4hBkhgncBAQE X-IPAS-Result: Aj4PAOwQflS4rwoL/2dsb2JhbABbgweDYIVawjuCYgQCAoEkFwEBAQEBAXyEAwEBBFYjEAs0EhQYDSSIU9ZZAQEBAQEFAQEBAR6QbweESAWLAZIxj3OCCoF4hBkhgncBAQE X-IronPort-AV: E=Sophos;i="5.07,502,1413259200"; d="scan'208";a="108060221" Original-Received: from 184-175-10-11.dsl.teksavvy.com (HELO pastel.home) ([184.175.10.11]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 17 Jan 2015 09:43:18 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 58B982214; Sat, 17 Jan 2015 09:43:18 -0500 (EST) In-Reply-To: (Kirill Ignatiev's message of "Fri, 16 Jan 2015 23:56:05 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:98441 Archived-At: > (defmethod constructor :static ((x testing) newname &rest args) > (message "Constructor") > (call-next-method)) Indeed, in Emacs-25, EIEIO's object names have been mostly dropped (with some backward compatibility). In this case, the backward compatibility was broken. Hmm... let me see if we can try to better preserve the backward compatibility here. OK, I installed the patch below which should help. Note that this `newname' argument won't be provided in Emacs-25 if you use `make-instance', so you should try and change your code to use eieio-named objects instead, if you need your objects to have a name. Stefan --- a/lisp/emacs-lisp/eieio.el +++ b/lisp/emacs-lisp/eieio.el @@ -276,12 +276,6 @@ and reference them using the function `class-option'." `(defun ,name (&rest slots) ,(format "Create a new object with name NAME of class type %S." name) - (if (and slots - (let ((x (car slots))) - (or (stringp x) (null x)))) - (funcall (if eieio-backward-compatibility #'ignore #'message) - "Obsolete name %S passed to %S constructor" - (pop slots) ',name)) (apply #'eieio-constructor ',name slots)))))) @@ -656,7 +650,14 @@ SLOTS are the initialization slots used by `shared-initialize'. This static method is called when an object is constructed. It allocates the vector used to represent an EIEIO object, and then calls `shared-initialize' on that object." - (let* ((new-object (copy-sequence (eieio--class-default-object-cache (eieio--class-v class))))) + (let* ((new-object (copy-sequence (eieio--class-default-object-cache + (eieio--class-v class))))) + (if (and slots + (let ((x (car slots))) + (or (stringp x) (null x)))) + (funcall (if eieio-backward-compatibility #'ignore #'message) + "Obsolete name %S passed to %S constructor" + (pop slots) class)) ;; Call the initialize method on the new object with the slots ;; that were passed down to us. (initialize-instance new-object slots)