GNU bug report logs -
#41572
28.0.50; [PATCH] Support plain project marked with file .emacs-project
Previous Next
Reported by: Zhu Zihao <cjpeople2013 <at> gmail.com>
Date: Thu, 28 May 2020 04:46:02 UTC
Severity: normal
Merged with 54228
Found in versions 28.0.50, 29.0.50
Fixed in version 29.1
Done: Dmitry Gutov <dgutov <at> yandex.ru>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Hello,
"Dmitry Gutov" <dgutov <at> yandex.ru> writes:
> I like this suggestion better (no "special" files), but would we be able
> to avoid scope creep? Wouldn't users then expect being able to specify
> ignored directories in such projects? And then faster indexing (e.g.
> using caching), compared to the VC backend?
Isn't this already supported?
In a major mode I'm making right now I believe I have covered both options:
(defcustom elm-root-file "elm.json"
"...")
(defun elm-project-root (dir)
"Create the cons cell `project-root' needs to discover root."
(let ((root (locate-dominating-file dir elm-root-file)))
(when root
(cons 'elm root))))
(cl-defmethod project-root ((project (head elm)))
(cdr project))
(cl-defmethod project-ignores ((project (head elm)) dir)
(append vc-directory-exclusion-list
;; This could also be a defcustom ofc
(list "./elm-stuff/")))
(add-hook 'project-find-functions #'elm-project-root)
- This will add both the option to not execute git init, but still find root.
- Also grepping will ignore the "node-modulesy" "elm-stuff".
- In addition, the vc-directory-exclusion-list can be edited to support arbitrary patterns, at least with my limited testing.
- It should be no problem to add a ".emacs-project" there in your own config?
Am I missing something, or is this already available? This of course depends on major modes supporting this integration?
Theodor
>
> Projectile uses the "special file" for the former, and I'm not really
> fond of its solution for the latter.
This bug report was last modified 2 years and 170 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.