diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-09-08 22:41:33 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-09-08 22:41:33 +0200 |
commit | 80d4dd2d359a99a4728f494ed483aee0d4c9532b (patch) | |
tree | 576a1d9a533ca76986e8f5a9633e6301201e468d | |
parent | 7fe6ddfecb38fec48450a3957b013c63b5aa498a (diff) |
emacs: Automatically fill project list
-rw-r--r-- | .config/emacs/init.el | 15 |
1 files changed, 15 insertions, 0 deletions
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) |