 (defvar configuration-layer--layers '()
   "A non-sorted list of `cfgl-layer' objects.")
 
+(defvar configuration-layer--delayed-layers '()
+  "A list of layers to check again after first pass of package declaration.")
+
 (defvar configuration-layer--packages '()
   "An alphabetically sorted list of `cfgl-package' objects.")
 

          (re-search-backward "\\(\\[.+\\]\\)" nil t)
          (help-xref-button 1 'help-package pkg-symbol))))))

(defun configuration-layer/get-packages (layers &optional dotfile)
  "Read the package lists of LAYERS and dotfile and return a list of packages."
  (let (result)
    (dolist (layer layers)
      (let* ((layer-name (oref layer :name))
             (layer-dir (oref layer :dir))

    ;; packages
    (setq configuration-layer--packages (configuration-layer//declare-packages
                                         configuration-layer--layers))
    (configuration-layer//load-layers-files configuration-layer--layers
                                            '("funcs.el"))
    (setq configuration-layer--used-distant-packages
          (configuration-layer//get-distant-used-packages
           configuration-layer--packages))
