From 80d4dd2d359a99a4728f494ed483aee0d4c9532b Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sun, 8 Sep 2024 22:41:33 +0200 Subject: emacs: Automatically fill project list --- .config/emacs/init.el | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.config/emacs/init.el b/.config/emacs/init.el index dc40f78..5fd6f06 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -631,6 +631,21 @@ font name, font weight, and font height in that order.") (add-hook 'after-make-frame-functions (lambda (_) (x-set-fonts))) (x-set-fonts)) + ;;; Set Project List +(defun x-set-project-list () + (interactive) + (when-let ((no-dotfiles "\\`[^.]") + (repo-directory (getenv "REPODIR")) + (level-1 (directory-files repo-directory 'full-name no-dotfiles))) + (setq project--list (cl-loop for directory in level-1 + append (mapcar #'list (directory-files + directory + 'full-name + no-dotfiles)))) + (project--write-project-list))) + +(with-eval-after-load 'project + (x-set-project-list)) ;;; C-Style (defun x-c-defun-open-safe (_syntax _position) -- cgit v1.2.3