From: Lars Ingebrigtsen Date: Mon, 5 Jul 2021 13:55:38 +0000 (+0200) Subject: Propagate :safe properties when autoloading defcustoms X-Git-Tag: emacs-28.0.90~1953 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=26b9564bd53685533f71e6e102f5bbf575e0c6af;p=emacs.git Propagate :safe properties when autoloading defcustoms * lisp/emacs-lisp/autoload.el (make-autoload): Propagate the :safe property to the loaddefs file (bug#28104). --- diff --git a/etc/NEWS b/etc/NEWS index 1a3130826a5..a62e9c86c93 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2914,6 +2914,9 @@ The former is now declared obsolete. * Lisp Changes in Emacs 28.1 +--- +*** :safe settings in 'defcustom' are now propagated to the loaddefs files. + +++ ** New function 'syntax-class-to-char'. This does almost the opposite of 'string-to-syntax' -- it returns the diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el index b45984be1d5..9d1ae705976 100644 --- a/lisp/emacs-lisp/autoload.el +++ b/lisp/emacs-lisp/autoload.el @@ -250,7 +250,10 @@ expression, in which case we want to handle forms differently." (custom-autoload ',varname ,file ,(condition-case nil (null (plist-get props :set)) - (error nil)))))) + (error nil))) + ;; Propagate the :safe property to the loaddefs file. + ,@(when-let ((safe (plist-get props :safe))) + `((put ',varname 'safe-local-variable ,safe)))))) ((eq car 'defgroup) ;; In Emacs this is normally handled separately by cus-dep.el, but for