mirror of
https://github.com/doomemacs/doomemacs.git
synced 2025-12-06 02:30:33 -08: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:
parent
da08aa2d7d
commit
201321c929
1 changed files with 14 additions and 0 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue