 
 ;;;; initialize
 
-(defvar *vendle-directory* "")
+(defvar *vendle-directory* (expand-file-name (file-name-as-directory "vendle") user-emacs-directory))
 (defvar *vendle-package-list* '())
 
 (cl-defun vendle:initialize (&optional path)
   (setq *vendle-package-list* nil)
-  (if path
-      (setq *vendle-directory* path)
-    (setq *vendle-directory*
-          (expand-file-name (file-name-as-directory "vendle") user-emacs-directory)))
+  (when path
+    (setq *vendle-directory* path))
   (unless (file-exists-p *vendle-directory*)
     (make-directory *vendle-directory*))
   *vendle-directory*)
-
 
 ;;;; update
 

(eval-when-compile
  (require 'cl-lib))

;;; internal functions

(cl-defun vendle:source-git-p (source)
  (cond ((or (string-match (rx "git://") source)
             (string-match (rx ".git" (zero-or-one "/") line-end) source))
         t)
        (t nil)))

(cl-defun vendle:source-github-p (source)
  (cond ((string-match (rx "github:" (submatch (+ (or (syntax word) (syntax symbol)))
                                               "/"
                                               (+ (or (syntax word) (syntax symbol)))))
                       source)
         t)
        ((string-match (rx   line-start
                             (one-or-more (or (syntax symbol) (syntax word)))
                             "/"
                             (one-or-more (or (syntax symbol)
                                              (syntax word)))
                             line-end)
                       source)
         t)
        (t nil)))

(cl-defun vendle:source-format-github (source)
  (cond
   ((string-match (rx "github:" (submatch (+ (or (syntax word) (syntax symbol)))
                                          "/"
                                          (+ (or (syntax word) (syntax symbol)))))
                  source)
    (match-string-no-properties 1 source))
   ((string-match (rx   line-start
                        (one-or-more (or (syntax symbol) (syntax word)))
                        "/"
                        (one-or-more (or (syntax symbol)
                                         (syntax word)))
                        line-end)
                  source)
    (match-string-no-properties 0 source))))


(cl-defun vendle:directory-git-p (p)
  (if (file-directory-p (expand-file-name ".git" p))

    (cl-mapc (lambda (p) (delete-directory p t))
             paths)))


;; commands
(cl-defun vendle-install ()
