mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
Add doom/reload-project; improve doom-project-root docstring
This commit is contained in:
@ -55,13 +55,23 @@ state are passed in.")
|
|||||||
;;
|
;;
|
||||||
;; Library
|
;; Library
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
(defun doom/reload-project ()
|
||||||
|
"Reload the project root cache."
|
||||||
|
(interactive)
|
||||||
|
(projectile-invalidate-cache nil)
|
||||||
|
(projectile-reset-cached-project-root)
|
||||||
|
(dolist (fn projectile-project-root-files-functions)
|
||||||
|
(remhash (format "%s-%s" fn default-directory) projectile-project-root-cache)))
|
||||||
|
|
||||||
(defun doom-project-p (&optional strict-p)
|
(defun doom-project-p (&optional strict-p)
|
||||||
"Whether or not this buffer is currently in a project or not."
|
"Whether or not this buffer is currently in a project or not."
|
||||||
(let ((projectile-require-project-root strict-p))
|
(let ((projectile-require-project-root strict-p))
|
||||||
(projectile-project-p)))
|
(projectile-project-p)))
|
||||||
|
|
||||||
(defun doom-project-root (&optional strict-p)
|
(defun doom-project-root (&optional strict-p)
|
||||||
|
"Get the path to the root of your project.
|
||||||
|
If STRICT-P, return nil if no project was found, otherwise return
|
||||||
`default-directory'."
|
`default-directory'."
|
||||||
(let ((projectile-require-project-root strict-p))
|
(let ((projectile-require-project-root strict-p))
|
||||||
(ignore-errors (projectile-project-root))))
|
(ignore-errors (projectile-project-root))))
|
||||||
|
Reference in New Issue
Block a user