   (shell-command (concat  "git clone " (vendle:package-url package) " "
                           (vendle:concat-path vendle-directory (vendle:package-name package)))
                  vendle-directory)
-  (byte-recompile-directory (vendle:package-path package)  0))
+  (vendle:compile package (vendle:package-path package)))
 
 ;;;; check
-(cl-defun vendle:check ()
+(cl-defun vendle:check-packages ()
   (cl-mapc
    (lambda (package)
      (vendle:install-package package))
    *vendle-package-list*))
-
 
 ;;;; register
 

               (not (file-symlink-p path)))
      (progn
        (cd-absolute path)
        (message "vendle: updating vendle package %s.." path)
        (shell-command "git pull")
        (cd-absolute user-emacs-directory)
        (byte-recompile-directory path 0)
        (message "vendle: updating vendle package %s.. done" path)))))

;;;; install


(cl-defun vendle:add-to-package-list (package)
  (add-to-list '*vendle-package-list* package))

;;;; utilily functions

(cl-defun vendle:concat-path (&rest parts)
  (cl-reduce (lambda (a b) (expand-file-name b a)) parts))

(cl-defun vendle:compile (package path)
  (if (vendle:package-compile package)
      (byte-recompile-directory path 0)))

(cl-defun vendle:message (fmt &rest text)
  (apply 'message (cl-concatenate 'string "vendle: " fmt)
         text))

;;;; search
(cl-defun vendle:search-registered (_key _term)
  (cl-remove-if-not
   (lambda (p)
     (cl-case _term
       (name
        (cl-equalp _key (vendle:package-name p)))
       (type
        (cl-equalp _key (vendle:package-type p)))
       (path
        (cl-equalp _key (vendle:package-path p)))))
   *vendle-package-list*))

;;;; initialize

