diff --git a/lisp/emacs-lisp/cl-lib.el b/lisp/emacs-lisp/cl-lib.el index 7fee780a735..28d42cb69ab 100644 --- a/lisp/emacs-lisp/cl-lib.el +++ b/lisp/emacs-lisp/cl-lib.el @@ -560,6 +560,7 @@ cl-old-struct-compat-mode (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 9445093f143..da2780503b8 100644 --- a/lisp/emacs-lisp/cl-preloaded.el +++ b/lisp/emacs-lisp/cl-preloaded.el @@ -158,7 +158,9 @@ cl-struct-define (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))