Use default-value in project--value-in-dir

When in a VC project whose dir-locals file specifies `project-vc-name',
the function `project--value-in-dir' previously used `symbol-value' to
retrieve the variable value, causing `project-name' to return the same
name for all VC projects without an explicit `project-vc-name'.  Use
`default-value' instead to correctly fall back to the default value.

* lisp/progmodes/project.el (project--value-in-dir): Replace `symbol-value'
with `default-value' (bug#81293).

Copyright-paperwork-exempt: yes
This commit is contained in:
Zhengyi Fu 2026-06-24 14:02:59 +08:00 committed by Dmitry Gutov
parent b34952ee94
commit 72b8d88171

View file

@ -974,7 +974,7 @@ DIRS must contain directory names."
(let ((res (project--read-dir-locals dir)))
(project--set-cached dir 'project-vc-dir-locals (or res 'none))
res))))
(symbol-value var)))
(default-value var)))
(defun project--read-dir-locals (dir)
(with-temp-buffer