From 2e7af2fc5304b9dfda944ced67b366e4576a1035 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 5 Sep 2023 12:56:13 -0400 Subject: [PATCH] * lisp/emacs-lisp/cl-lib.el (cl-old-struct-compat-mode): Mark as obsolete * lisp/emacs-lisp/cl-preloaded.el: Emit a message before enabling `cl-old-struct-compat-mode`. See bug#63282. --- etc/NEWS | 3 +++ lisp/emacs-lisp/cl-lib.el | 1 + lisp/emacs-lisp/cl-preloaded.el | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/etc/NEWS b/etc/NEWS index fbb13254e64..a68e67e0694 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -882,6 +882,9 @@ Use 'define-minor-mode' and 'define-globalized-minor-mode' instead. See the "(elisp) Porting Old Advice" node for help converting them to use 'advice-add' or 'define-advice' instead. +** 'cl-old-struct-compat-mode' is marked as obsolete. +You may need to recompile our code if it was compiled with Emacs<24.3. + +++ ** New macro 'static-if' for conditional evaluation of code. This macro hides a form from the evaluator or byte-compiler based on a diff --git a/lisp/emacs-lisp/cl-lib.el b/lisp/emacs-lisp/cl-lib.el index 83396dabc1a..f4c1ac85b13 100644 --- a/lisp/emacs-lisp/cl-lib.el +++ b/lisp/emacs-lisp/cl-lib.el @@ -571,6 +571,7 @@ of record objects." (advice-add 'type-of :around #'cl--old-struct-type-of)) (t (advice-remove 'type-of #'cl--old-struct-type-of)))) +(make-obsolete 'cl-old-struct-compat-mode nil "30.1") (defun cl-constantly (value) "Return a function that takes any number of arguments, but returns VALUE." diff --git a/lisp/emacs-lisp/cl-preloaded.el b/lisp/emacs-lisp/cl-preloaded.el index f410270d340..676326980aa 100644 --- a/lisp/emacs-lisp/cl-preloaded.el +++ b/lisp/emacs-lisp/cl-preloaded.el @@ -159,7 +159,9 @@ supertypes from the most specific to least specific.") (cl-check-type name (satisfies cl--struct-name-p)) (unless type ;; Legacy defstruct, using tagged vectors. Enable backward compatibility. - (cl-old-struct-compat-mode 1)) + (with-suppressed-warnings ((obsolete cl-old-struct-compat-mode)) + (message "cl-old-struct-compat-mode is obsolete!") + (cl-old-struct-compat-mode 1))) (if (eq type 'record) ;; Defstruct using record objects. (setq type nil)) -- 2.39.2