diff options
author | Alan Pearce | 2017-04-21 20:35:52 +0200 |
---|---|---|
committer | Alan Pearce | 2017-04-21 20:35:52 +0200 |
commit | 0c35d3d3e99aa95c07ad76dac62c002500115b9b (patch) | |
tree | 4b8fd2ffb4d99ada86d6c64e44d16e1bbf5218bb /emacs | |
parent | 967dc8a329804a7b3517a34a4b6c35f11ed9edc4 (diff) | |
download | dotfiles-0c35d3d3e99aa95c07ad76dac62c002500115b9b.tar.lz dotfiles-0c35d3d3e99aa95c07ad76dac62c002500115b9b.tar.zst dotfiles-0c35d3d3e99aa95c07ad76dac62c002500115b9b.zip |
Emacs: Re-implement project-directory functions
Diffstat (limited to 'emacs')
-rw-r--r-- | emacs/.emacs.d/init.org | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/emacs/.emacs.d/init.org b/emacs/.emacs.d/init.org index e7cbedc..0f43c84 100644 --- a/emacs/.emacs.d/init.org +++ b/emacs/.emacs.d/init.org @@ -482,16 +482,21 @@ based upon some folder conventions I use. :config (progn (projectile-global-mode) (add-to-list 'projectile-globally-ignored-directories ".stversions") - (defun ap/subfolder-projects (dir) - (--map (file-relative-name it dir) - (-filter (lambda (subdir) - (--reduce-from (or acc (funcall it subdir)) nil - projectile-project-root-files-functions)) - (-filter #'file-directory-p (directory-files dir t "\\<"))))) + + (defun directory-directories (dir) + (seq-filter #'file-directory-p + (directory-files dir t (rx string-start + (char alnum))))) + + (defun project-directories (start-dir) + (seq-map (lambda (x) (file-relative-name x start-dir)) + (seq-mapcat #'directory-directories + (seq-mapcat #'directory-directories + (directory-directories start-dir))))) (defun ap/open-subfolder-project (from-dir &optional arg) (let ((project-dir (projectile-completing-read "Open project: " - (ap/subfolder-projects from-dir)))) + (project-directories from-dir)))) (projectile-switch-project-by-name (expand-file-name project-dir from-dir) arg))) (defun yarn-install (&optional arg) |