[Top][All Lists]

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

Re: (Emacs 23/24 binary compatibility): defstruct, setf

From: Stefan Monnier
Subject: Re: (Emacs 23/24 binary compatibility): defstruct, setf
Date: Tue, 03 Sep 2013 22:57:03 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

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


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

reply via email to

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