From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 17 11:54:09 2011 Received: (at submit) by debbugs.gnu.org; 17 Aug 2011 15:54:09 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QtiRU-0006JZ-AS for submit@debbugs.gnu.org; Wed, 17 Aug 2011 11:54:09 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QtiRS-0006JS-7a for submit@debbugs.gnu.org; Wed, 17 Aug 2011 11:54:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QtiPa-0004jB-Qs for submit@debbugs.gnu.org; Wed, 17 Aug 2011 11:52:11 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_00,FROM_12LTRDOM, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:52717) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QtiPa-0004j7-PQ for submit@debbugs.gnu.org; Wed, 17 Aug 2011 11:52:10 -0400 Received: from eggs.gnu.org ([140.186.70.92]:51277) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QtiPZ-0005yf-MF for bug-gnu-emacs@gnu.org; Wed, 17 Aug 2011 11:52:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QtiPY-0004io-CE for bug-gnu-emacs@gnu.org; Wed, 17 Aug 2011 11:52:09 -0400 Received: from v3-1008.vxen.de ([79.140.41.8]:55777) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QtiPY-0004iT-0C for bug-gnu-emacs@gnu.org; Wed, 17 Aug 2011 11:52:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=randomsample.de; s=a; h=Content-Type:MIME-Version:Message-ID:Date:Subject:To:From; bh=C5nmtgnJ9gG3ws6vUzBjyHdaRNPCIv74dIkjUpga9vk=; b=EPgC7pZ36xUeR48WLcxzmYMIyshWj3VCjepHzQxg88p45nWPtnVFVTv77Jn5vJDvhYN/FC4rz+ZlR+HdDipIUvssIxIoOOm37o3MAQBncZxssEc79r7fUDSXLutxI7y5; Received: from dslc-082-083-057-129.pools.arcor-ip.net ([82.83.57.129] helo=spaten) by v3-1008.vxen.de with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1QtiPU-0006eS-La for bug-gnu-emacs@gnu.org; Wed, 17 Aug 2011 17:52:05 +0200 From: David Engster To: bug-gnu-emacs@gnu.org Subject: 24.0.50; Emacs 24 cannot load byte-compiled code from Emacs 23.3 when using EIEIO's defmethod Date: Wed, 17 Aug 2011 17:52:03 +0200 Message-ID: <87wreckpcs.fsf@engster.org> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -4.4 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.5 (----) This is a very late followup to an older message from emacs-devel, regarding the issue that Emacs24 after the lexbind merge cannot run byte-compiled code from Emacs23.3 if that is using EIEIO's 'defmethod': http://thread.gmane.org/gmane.emacs.devel/138030/focus=78338 In that message Stefan Monnier says that this is considered a bug, so I'm writing this report. Also, this issue is popping up more frequently now as people are migrating to Emacs24-bzr, but still have compiled Gnus or CEDET sources with Emacs23, so I think this should be fixed before a release. Here's a recipe: * Create a file ~/eieio-test/eieio-test.el with the following contents: (require 'eieio) (defclass someclass () ((astring :initarg :astring :initform "")) "Some test class.") (defmethod somemethod ((arg someclass)) "Some method." (message "Somemethod called.")) (provide 'eieio-test) * Byte-compile the file using Emacs 23.3: emacs23 --batch -f batch-byte-compile eieio-test.el * Load Emacs24-bzr with emacs24 -Q -L ~/eieio-test and evaluate (require 'eieio-test) * The following backtrace will appear: Debugger entered--Lisp error: (void-function eieio-defmethod) (eieio-defmethod (quote somemethod) (quote (((arg someclass)) #[(arg) "\300\301!\207" [message "Somemethod called."] 2 "Some method."]))) require(eieio-test) eval((require (quote eieio-test)) nil) * Note that the following setups work: - Byte compile with Emacs23, require with Emacs23 - Byte compile with Emacs24, require with Emacs24 - Require uncompiled el-file. * This issue is occuring since the lexbind merge. Cheers, David From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 22 17:49:45 2011 Received: (at 9313) by debbugs.gnu.org; 22 Aug 2011 21:49:45 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QvcNN-0001dV-6R for submit@debbugs.gnu.org; Mon, 22 Aug 2011 17:49:45 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.181] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QvcNL-0001dO-0B for 9313@debbugs.gnu.org; Mon, 22 Aug 2011 17:49:44 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EABzOUk5Ld+HZ/2dsb2JhbABBqBV4gUABAQQBViMFCwsOJgcLFBgNJIgEtWyGSASfcYQ2 X-IronPort-AV: E=Sophos;i="4.68,265,1312171200"; d="scan'208";a="132239370" Received: from 75-119-225-217.dsl.teksavvy.com (HELO ceviche.home) ([75.119.225.217]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 22 Aug 2011 17:47:17 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 7CFA96610A; Mon, 22 Aug 2011 17:47:17 -0400 (EDT) From: Stefan Monnier To: David Engster Subject: Re: bug#9313: 24.0.50; Emacs 24 cannot load byte-compiled code from Emacs 23.3 when using EIEIO's defmethod Message-ID: References: <87wreckpcs.fsf@engster.org> Date: Mon, 22 Aug 2011 17:47:17 -0400 In-Reply-To: <87wreckpcs.fsf@engster.org> (David Engster's message of "Wed, 17 Aug 2011 17:52:03 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.0 (--) X-Debbugs-Envelope-To: 9313 Cc: 9313@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.0 (--) > This is a very late followup to an older message from emacs-devel, > regarding the issue that Emacs24 after the lexbind merge cannot run > byte-compiled code from Emacs23.3 if that is using EIEIO's 'defmethod': Does the patch below fix the problem for you? Stefan === modified file 'lisp/emacs-lisp/eieio.el' --- lisp/emacs-lisp/eieio.el 2011-05-23 00:39:25 +0000 +++ lisp/emacs-lisp/eieio.el 2011-08-22 21:46:05 +0000 @@ -2864,6 +2864,106 @@ ) +;;; Obsolete backward compatibility functions. +;; Used to run byte-code compiled with Emacs-23. + +(defun eieio-defmethod (method args) + "Work part of the `defmethod' macro defining METHOD with ARGS." + (let ((key nil) (body nil) (firstarg nil) (argfix nil) (argclass nil) loopa) + ;; find optional keys + (setq key + (cond ((or (eq ':BEFORE (car args)) + (eq ':before (car args))) + (setq args (cdr args)) + method-before) + ((or (eq ':AFTER (car args)) + (eq ':after (car args))) + (setq args (cdr args)) + method-after) + ((or (eq ':PRIMARY (car args)) + (eq ':primary (car args))) + (setq args (cdr args)) + method-primary) + ((or (eq ':STATIC (car args)) + (eq ':static (car args))) + (setq args (cdr args)) + method-static) + ;; Primary key + (t method-primary))) + ;; get body, and fix contents of args to be the arguments of the fn. + (setq body (cdr args) + args (car args)) + (setq loopa args) + ;; Create a fixed version of the arguments + (while loopa + (setq argfix (cons (if (listp (car loopa)) (car (car loopa)) (car loopa)) + argfix)) + (setq loopa (cdr loopa))) + ;; make sure there is a generic + (eieio-defgeneric + method + (if (stringp (car body)) + (car body) (format "Generically created method `%s'." method))) + ;; create symbol for property to bind to. If the first arg is of + ;; the form (varname vartype) and `vartype' is a class, then + ;; that class will be the type symbol. If not, then it will fall + ;; under the type `primary' which is a non-specific calling of the + ;; function. + (setq firstarg (car args)) + (if (listp firstarg) + (progn + (setq argclass (nth 1 firstarg)) + (if (not (class-p argclass)) + (error "Unknown class type %s in method parameters" + (nth 1 firstarg)))) + (if (= key -1) + (signal 'wrong-type-argument (list :static 'non-class-arg))) + ;; generics are higher + (setq key (eieio-specialized-key-to-generic-key key))) + ;; Put this lambda into the symbol so we can find it + (if (byte-code-function-p (car-safe body)) + (eieiomt-add method (car-safe body) key argclass) + (eieiomt-add method (append (list 'lambda (reverse argfix)) body) + key argclass)) + ) + + (when eieio-optimize-primary-methods-flag + ;; Optimizing step: + ;; + ;; If this method, after this setup, only has primary methods, then + ;; we can setup the generic that way. + (if (generic-primary-only-p method) + ;; If there is only one primary method, then we can go one more + ;; optimization step. + (if (generic-primary-only-one-p method) + (eieio-defgeneric-reset-generic-form-primary-only-one method) + (eieio-defgeneric-reset-generic-form-primary-only method)) + (eieio-defgeneric-reset-generic-form method))) + + method) +(make-obsolete 'eieio-defmethod 'eieio--defmethod "24.1") + +(defun eieio-defgeneric (method doc-string) + "Engine part to `defgeneric' macro defining METHOD with DOC-STRING." + (if (and (fboundp method) (not (generic-p method)) + (or (byte-code-function-p (symbol-function method)) + (not (eq 'autoload (car (symbol-function method))))) + ) + (error "You cannot create a generic/method over an existing symbol: %s" + method)) + ;; Don't do this over and over. + (unless (fboundp 'method) + ;; This defun tells emacs where the first definition of this + ;; method is defined. + `(defun ,method nil) + ;; Make sure the method tables are installed. + (eieiomt-install method) + ;; Apply the actual body of this function. + (fset method (eieio-defgeneric-form method doc-string)) + ;; Return the method + 'method)) +(make-obsolete 'eieio-defgeneric nil "24.1") + ;;; Interfacing with edebug ;; (defun eieio-edebug-prin1-to-string (object &optional noescape) From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 23 12:16:27 2011 Received: (at 9313) by debbugs.gnu.org; 23 Aug 2011 16:16:27 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QvteM-0001yb-B5 for submit@debbugs.gnu.org; Tue, 23 Aug 2011 12:16:26 -0400 Received: from v3-1008.vxen.de ([79.140.41.8]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QvteJ-0001yQ-I2 for 9313@debbugs.gnu.org; Tue, 23 Aug 2011 12:16:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=randomsample.de; s=a; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To:Subject:Cc:To:From; bh=2g2SQEoWGs4VDhy/xQ8RBEjc5pCGy/4DpCZIEBFJlR4=; b=EhBEQWfAtzSEt1kbx/WQCLh86RD4hBUJRTyIAp8IC5shcwa14kcrS74Aj6Ti+UKZ57EKlTaz2doHMjXQhPuPNZQCeJER/A0vI4cF8IA0JPsuc7O4q/nXaVKlBZXaIwzI; Received: from ibookg4-c2.pc.gwdg.de ([134.76.4.219]) by v3-1008.vxen.de with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1Qvtbt-0000xI-Jc; Tue, 23 Aug 2011 18:13:53 +0200 From: David Engster To: Stefan Monnier Subject: Re: bug#9313: 24.0.50; Emacs 24 cannot load byte-compiled code from Emacs 23.3 when using EIEIO's defmethod In-Reply-To: (Stefan Monnier's message of "Mon, 22 Aug 2011 17:47:17 -0400") References: <87wreckpcs.fsf@engster.org> User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (darwin) Date: Tue, 23 Aug 2011 18:13:47 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -3.2 (---) X-Debbugs-Envelope-To: 9313 Cc: 9313@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.2 (---) Stefan Monnier writes: >> This is a very late followup to an older message from emacs-devel, >> regarding the issue that Emacs24 after the lexbind merge cannot run >> byte-compiled code from Emacs23.3 if that is using EIEIO's 'defmethod': > > Does the patch below fix the problem for you? Yes. Thanks, David From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 23 14:56:47 2011 Received: (at 9313-done) by debbugs.gnu.org; 23 Aug 2011 18:56:47 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qvw9X-0004JT-3o for submit@debbugs.gnu.org; Tue, 23 Aug 2011 14:56:47 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.183] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Qvw9U-0004JK-OO for 9313-done@debbugs.gnu.org; Tue, 23 Aug 2011 14:56:45 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAIP2U05Ld+HZ/2dsb2JhbABCp2N4gUABAQQBViMQCw4mBwsUGA0kiAS9aoZIBJ93hDg X-IronPort-AV: E=Sophos;i="4.68,270,1312171200"; d="scan'208";a="132444977" Received: from 75-119-225-217.dsl.teksavvy.com (HELO ceviche.home) ([75.119.225.217]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 23 Aug 2011 14:54:15 -0400 Received: by ceviche.home (Postfix, from userid 20848) id E746E6610A; Tue, 23 Aug 2011 14:54:14 -0400 (EDT) From: Stefan Monnier To: David Engster Subject: Re: bug#9313: 24.0.50; Emacs 24 cannot load byte-compiled code from Emacs 23.3 when using EIEIO's defmethod Message-ID: References: <87wreckpcs.fsf@engster.org> Date: Tue, 23 Aug 2011 14:54:14 -0400 In-Reply-To: (David Engster's message of "Tue, 23 Aug 2011 18:13:47 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.0 (--) X-Debbugs-Envelope-To: 9313-done Cc: 9313-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.0 (--) >>> This is a very late followup to an older message from emacs-devel, >>> regarding the issue that Emacs24 after the lexbind merge cannot run >>> byte-compiled code from Emacs23.3 if that is using EIEIO's 'defmethod': >> Does the patch below fix the problem for you? > Yes. Thanks, installed, Stefan From unknown Sun Jun 22 04:26:30 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 21 Sep 2011 11:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator