       (write-file (expand-file-name "projekttagebuch.org" project-directory))
       (bookmark-set (format "Projekttagebuch %s" short-name)))
     (write-region (format "%s" long-name) nil
-                  (expand-file-name ".projectile" project-directory))))
+                  (expand-file-name ".projectile" project-directory))
+    (when (require 'projectile nil 'no-error)
+      (projectile-add-known-project project-directory))))
 
 (defun projects-archive-project (short-name)
   "Archive existing project."


;;; Commentary:

;; XXX: add projectile integration
;; XXX: check that newly created projects aren’t name the same as archived projects

;;; Code:

  (rename-file (expand-file-name short-name projects-main-project-directory)
               (expand-file-name short-name projects-archive-directory)
               nil)
  (bookmark-delete (format "Projekttagebuch %s" short-name))
  (when (require 'projectile nil 'no-error)
    (projectile-cleanup-known-projects)))

(provide 'db-projects)

