summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/autoload.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2021-07-05 15:55:38 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2021-07-05 15:55:38 +0200
commit26b9564bd53685533f71e6e102f5bbf575e0c6af (patch)
tree039fd1d8fa7c836a0fc62c19f08c3e07800b0ff1 /lisp/emacs-lisp/autoload.el
parent62fbeed9a91429a852fed882d8bf30bc04377bf0 (diff)
downloademacs-26b9564bd53685533f71e6e102f5bbf575e0c6af.tar.gz
Propagate :safe properties when autoloading defcustoms
* lisp/emacs-lisp/autoload.el (make-autoload): Propagate the :safe property to the loaddefs file (bug#28104).
Diffstat (limited to 'lisp/emacs-lisp/autoload.el')
-rw-r--r--lisp/emacs-lisp/autoload.el5
1 files changed, 4 insertions, 1 deletions
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