On Fri, 13 Nov 2026 at 00:45, Alex Bennée <[email protected]> wrote: > > Unfortunately this relied on trusting the source tree via the > safe-local-variable-directories otherwise users keep being prompted > that ".dir-locals.el contains values that may not be safe". > > An alternative is for the user to add something like this to their > local emacs config: > > (defun my-return-source-if-in-qemu-tree() > "Return the root of source when in QEMU code." > (when-let ((src (expand-file-name (locate-dominating-file > default-directory ".git")))) > (if (file-exists-p (concat src "/qemu-options.hx")) > src))) > > (defun my-set-qemu-python-path() > "Set local python environment for QEMU." > (when-let ((root (my-return-source-if-in-qemu-tree))) > (setq-local process-environment (copy-sequence process-environment)) > (setenv "PYTHONPATH" (concat (expand-file-name "python" root) ":" > (expand-file-name "tests/functional" > root))))) > > (use-package python > :hook ((python-mode python-ts-mode) . my-set-qemu-python-path)) > > This reverts commit 3112269be3ac92343a5f0e5d9eae919edd176a35. > > Signed-off-by: Alex Bennée <[email protected]> > ---
Reviewed-by: Peter Maydell <[email protected]> thanks -- PMM
