     (when (file-exists-p start-file)
       (load-file start-file))))
 
+
+
+;;;
+;;; Main entry point
+;;;
+
 (defun homectl-startup ()
   "Load all enabled homectl packages with Emacs customizations,
 and make sure the package's binaries are available in Emacs's
 environment."
   (interactive)
+
+  ; Make sure we're ready to fetch remote packages
+  (when (homectl-load-package-el)
+    (package-initialize))
 
   ; The following is a Darwin-specific hack to make sure the shell's $PATH
   ; is picked up by Emacs when running in Aqua mode.




(defmacro homectl-foreach-enabled (path-var &rest body)
  "Loop through each enabled homectl package, placing its path in /path-var/."
  `(dolist (,path-var (directory-files homectl-dir t nil t))
     (when (not (string-prefix-p "." (file-name-nondirectory ,path-var)))
       ,@body)))

(defun homectl-env-add-to-path (var path)
  "Add a path to a :-separated environment variable."

; Because we update Info-directory-* below
(require 'info)

;;;
;;; Customization
;;;

(defvar homectl-dir (concat (getenv "HOME") "/.homectl")
  "The location of the homectl directory.  You should not change
