summaryrefslogtreecommitdiff
path: root/.config/emacs
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-12-12 22:38:30 +0100
committerThomas Voss <mail@thomasvoss.com> 2024-12-12 22:38:30 +0100
commitfecdc73a715dae291759b71a2ed3b3f588e5b307 (patch)
tree800e1506d256b32e638707f409233e99e140e4ae /.config/emacs
parent6c9c519e61849de2b7b6cec7f5b36878639587a3 (diff)
emacs: Generate the project list asyncronously
Diffstat (limited to '.config/emacs')
-rw-r--r--.config/emacs/modules/mm-projects.el29
1 files changed, 17 insertions, 12 deletions
diff --git a/.config/emacs/modules/mm-projects.el b/.config/emacs/modules/mm-projects.el
index f3a8710..be80789 100644
--- a/.config/emacs/modules/mm-projects.el
+++ b/.config/emacs/modules/mm-projects.el
@@ -20,18 +20,23 @@ This is intended to be called interactively via
(mm-projects-project-magit-status "Git Status" ?s)))
:config
(unless mm-darwin-p
- (if-let ((repo-directory (getenv "REPODIR"))
- (directories
- (cl-loop
- for author in (directory-files repo-directory :full "\\`[^.]")
- append (cl-loop
- for path in (directory-files author :full "\\`[^.]")
- collect (list (concat path "/"))))))
- (progn
- (with-temp-buffer
- (prin1 directories (current-buffer))
- (write-file project-list-file))
- (project--read-project-list))
+ (if-let ((repo-directory (getenv "REPODIR")))
+ (with-eval-after-load 'async
+ (async-start
+ (lambda ()
+ (require 'project)
+ (let* ((list-dir
+ (lambda (path)
+ (directory-files path :full "\\`[^.]")))
+ (directories
+ (cl-loop for author in (funcall list-dir (getenv "REPODIR"))
+ append (cl-loop for path in (funcall list-dir author)
+ collect (list (concat path "/"))))))
+ (with-temp-buffer
+ (prin1 directories (current-buffer))
+ (write-file project-list-file))))
+ (lambda (_proc)
+ (project--read-project-list))))
(warn "The REPODIR environment variable is not set."))))