diff options
| author | Daniel Mendler <mail@daniel-mendler.de> | 2024-12-15 00:48:26 +0100 |
|---|---|---|
| committer | Daniel Mendler <mail@daniel-mendler.de> | 2024-12-15 01:19:47 +0100 |
| commit | 5be942f10fab7fed8321a9e20fe831730d79738b (patch) | |
| tree | 7e379f96dba6f99e5821929b25aeae630f9e8966 /compat-macs.el | |
| parent | f06c24c2498a8b9642fdef3bd8336ac75da4ad07 (diff) | |
compat-30: untrusted-content, trusted-files, trusted-content-p
Diffstat (limited to 'compat-macs.el')
| -rw-r--r-- | compat-macs.el | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/compat-macs.el b/compat-macs.el index ffd5223..d200fbb 100644 --- a/compat-macs.el +++ b/compat-macs.el @@ -221,6 +221,8 @@ definition is generated. - :constant :: Mark the variable as constant if t. +- :risky :: Mark the variable as risky if t. + - :local :: Make the variable buffer-local if t. If the value is `permanent' make the variable additionally permanently local. @@ -232,11 +234,13 @@ definition is generated. (doc-string 3) (indent 2)) (compat-macs--guard attrs (list :constant #'booleanp + :risky #'booleanp :local (lambda (x) (memq x '(nil t permanent))) :obsolete (lambda (x) (or (booleanp x) (stringp x)))) - (lambda (constant local obsolete) + (lambda (constant risky local obsolete) (compat-macs--strict (not (boundp name)) "%s already defined" name) (compat-macs--assert (not (and constant local)) "Both :constant and :local") + (compat-macs--assert (not (and local risky)) "Both :risky and :local") ;; The boundp check is performed at runtime to make sure that we never ;; redefine an existing definition if Compat is loaded on a newer Emacs ;; version. @@ -250,6 +254,7 @@ definition is generated. ',name ,(if (stringp obsolete) obsolete "No substitute") ,compat-macs--version)))) ,@(and local `((make-variable-buffer-local ',name))) + ,@(and risky `((put ',name 'risky-local-variable t))) ,@(and (eq local 'permanent) `((put ',name 'permanent-local t))))))) (defmacro compat-version (version) |
