mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
feat(lib): backport safe-local-variable-directories
Necessary to silence safe-local-variable warnings/prompts for $EMACSDIR and $DOOMDIR, later.
This commit is contained in:
@ -137,5 +137,19 @@ and return the value found in PLACE instead."
|
|||||||
(assq mode major-mode-remap-defaults)))
|
(assq mode major-mode-remap-defaults)))
|
||||||
mode)))
|
mode)))
|
||||||
|
|
||||||
|
;; Introduced in Emacs 30+
|
||||||
|
(unless (boundp 'safe-local-variable-directories)
|
||||||
|
(defvar safe-local-variable-directories ())
|
||||||
|
(define-advice hack-local-variables-filter
|
||||||
|
(:around (fn variables dir-name) backport-safe-local-variable-directories)
|
||||||
|
(let ((enable-local-variables
|
||||||
|
(if (delq nil (mapcar (lambda (dir)
|
||||||
|
(and dir-name dir
|
||||||
|
(file-equal-p dir dir-name)))
|
||||||
|
safe-local-variable-directories))
|
||||||
|
:all
|
||||||
|
enable-local-variables)))
|
||||||
|
(funcall fn variables dir-name))))
|
||||||
|
|
||||||
(provide 'doom-compat)
|
(provide 'doom-compat)
|
||||||
;;; doom-compat.el ends here
|
;;; doom-compat.el ends here
|
||||||
|
Reference in New Issue
Block a user