mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-26 07:33:47 +00:00
Fix two project-find-file issues
* lisp/progmodes/project.el (project--value-in-dir): Temporarily set enable-local-variables to :all. (project-find-file, project-or-external-find-file): All autoloads. (project--find-file-in): Require xref.
This commit is contained in:
parent
30abf295e8
commit
a034dd384c
@ -258,7 +258,8 @@ DIRS must contain directory names."
|
|||||||
(defun project--value-in-dir (var dir)
|
(defun project--value-in-dir (var dir)
|
||||||
(with-temp-buffer
|
(with-temp-buffer
|
||||||
(setq default-directory dir)
|
(setq default-directory dir)
|
||||||
(hack-dir-local-variables-non-file-buffer)
|
(let ((enable-local-variables :all))
|
||||||
|
(hack-dir-local-variables-non-file-buffer))
|
||||||
(symbol-value var)))
|
(symbol-value var)))
|
||||||
|
|
||||||
(declare-function grep-read-files "grep")
|
(declare-function grep-read-files "grep")
|
||||||
@ -310,12 +311,14 @@ pattern to search for."
|
|||||||
(user-error "No matches for: %s" regexp))
|
(user-error "No matches for: %s" regexp))
|
||||||
(xref--show-xrefs xrefs nil)))
|
(xref--show-xrefs xrefs nil)))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
(defun project-find-file ()
|
(defun project-find-file ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(let* ((pr (project-current t))
|
(let* ((pr (project-current t))
|
||||||
(dirs (project-roots pr)))
|
(dirs (project-roots pr)))
|
||||||
(project--find-file-in dirs pr)))
|
(project--find-file-in dirs pr)))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
(defun project-or-external-find-file ()
|
(defun project-or-external-find-file ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(let* ((pr (project-current t))
|
(let* ((pr (project-current t))
|
||||||
@ -326,6 +329,7 @@ pattern to search for."
|
|||||||
|
|
||||||
;; FIXME: Uniquely abbreviate the roots?
|
;; FIXME: Uniquely abbreviate the roots?
|
||||||
(defun project--find-file-in (dirs project)
|
(defun project--find-file-in (dirs project)
|
||||||
|
(require 'xref)
|
||||||
(let* ((all-files
|
(let* ((all-files
|
||||||
(cl-mapcan
|
(cl-mapcan
|
||||||
(lambda (dir)
|
(lambda (dir)
|
||||||
|
Loading…
Reference in New Issue
Block a user