mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 18:40:39 -08:00
Backward compatibility with pre-existing struct instances.
* lisp/emacs-lisp/cl-lib.el (cl--old-struct-type-of): New function. (cl-old-struct-compat-mode): New minor mode. * lisp/emacs-lisp/cl-macs.el (cl-defstruct): Pass `record' to cl-struct-define to signal use of record objects. * lisp/emacs-lisp/cl-preloaded.el (cl--struct-get-class, cl-struct-define): Enable legacy defstruct compatibility. * test/lisp/emacs-lisp/cl-lib-tests.el (cl-lib-old-struct, old-struct): New tests. * doc/lispref/elisp.texi, doc/lispref/records.texi: Document `old-struct-compat'.
This commit is contained in:
parent
b6738682ae
commit
2c68192c6b
6 changed files with 84 additions and 3 deletions
|
|
@ -2847,8 +2847,8 @@ non-nil value, that slot cannot be set via `setf'.
|
|||
;; struct as a parent.
|
||||
(eval-and-compile
|
||||
(cl-struct-define ',name ,docstring ',include-name
|
||||
',type ,(eq named t) ',descs ',tag-symbol ',tag
|
||||
',print-auto))
|
||||
',(or type 'record) ,(eq named t) ',descs
|
||||
',tag-symbol ',tag ',print-auto))
|
||||
',name)))
|
||||
|
||||
;;; Add cl-struct support to pcase
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue