From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Monnier Subject: Re: (Emacs 23/24 binary compatibility): defstruct, setf Date: Tue, 03 Sep 2013 22:57:03 -0400 Message-ID: References: <87wqmyi9dj.fsf@gmail.com> <87eh95mwtt.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: <87eh95mwtt.fsf@gmail.com> (Jambunathan K.'s message of "Wed, 04 Sep 2013 02:44:54 +0530") List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org To: Jambunathan K Cc: Nicolas Goaziou , emacs-orgmode@gnu.org, emacs-devel@gnu.org List-Id: emacs-orgmode.gnu.org >>> I think existing *.elc files compiled against Emacs-23.2.1 should load >>> fine on new Emacs versions. >> It's indeed an incompatibility I introduced when we switched from CL's >> setf to gv.el's setf, because the two work in a very different way. > In simple terms, the problem seems to be a 24.x style `setf' on a 23.x > defstruct. More specifically, the setf and the defstruct need to be compiled with "the same version" (either both cl.el, or both gv.el). > If we could report on incompatibiliy that would be awesome. Can the > FIRST EVER setf call make (additional) version checks and report errors. Does the patch below work for you? Stefan === modified file 'lisp/emacs-lisp/gv.el' --- lisp/emacs-lisp/gv.el 2013-08-13 02:30:52 +0000 +++ lisp/emacs-lisp/gv.el 2013-09-04 02:56:26 +0000 @@ -102,7 +102,11 @@ ;; Follow aliases. (setq me (cons (symbol-function head) (cdr place)))) (if (eq me place) - (error "%S is not a valid place expression" place) + (error + (if (and (symbolp head) (get head 'setf-method)) + "Incompatible place expression needs recompilation: %S" + "%S is not a valid place expression") + place) (gv-get me do))))))) ;;;###autoload