[Projects] Simplify directory name concatenation

This commit is contained in:
Daniel - 2018-08-05 16:23:37 +02:00
parent 3f828b64fc
commit b64c830ac5
Signed by: dbo
GPG Key ID: 4F63DB96D45AA9C6
1 changed files with 4 additions and 5 deletions

View File

@ -22,15 +22,14 @@
(defun projects-project-exists-p (short-name)
"Check whether a project named SHORT-NAME already exists"
(file-exists-p (expand-file-name ".projectile"
(expand-file-name short-name
projects-main-project-directory))))
(file-exists-p (expand-file-name (concat (file-name-as-directory short-name) ".projectile")
projects-main-project-directory)))
(defun projects-existing-projects ()
"Return list of all short-names of existing projects"
(cl-remove-if-not (lambda (name)
(file-exists-p (expand-file-name ".projectile"
(expand-file-name name projects-main-project-directory))))
(file-exists-p (expand-file-name (concat (file-name-as-directory name) ".projectile")
projects-main-project-directory)))
(directory-files projects-main-project-directory)))
(defun projects-add-project (short-name long-name)