emacscollective / borg

Assimilate Emacs packages as Git submodules
https://emacsmirror.net/manual/borg
GNU General Public License v3.0
255 stars 28 forks source link

Maybe the borg-load-path not always work. #101

Closed lld2001 closed 3 years ago

lld2001 commented 3 years ago

Maybe the load-path of treemacs is not correctly set.

(borg-load-path "treemacs")  ;;("e:/emacs/.emacs.d/lib/treemacs/")
                                            ;; should be e:/emacs/.emacs.d/lib/treemacs/src/elisp 
                                            ;; there are some src located in  e:/emacs/.emacs.d/lib/treemacs/src/extra
(defun borg-load-path (clone)
  "Return the `load-path' for the clone named CLONE."
  (let ((repo (borg-worktree clone))
        (path (borg-get-all clone "load-path")))
    (if  path
        (mapcar (lambda (d) (expand-file-name d repo)) path)
      (let ((elisp (expand-file-name "elisp" repo))
            (lisp (expand-file-name "lisp" repo)))
        (list (cond ((file-exists-p elisp) elisp)
                    ((file-exists-p lisp) lisp)
                    (t repo)))))))

In treemacs package, there's an extra src directory.

Originally posted by @lld2001 in https://github.com/emacscollective/borg/issues/100#issuecomment-846674589

tarsius commented 3 years ago

See submodule.DRONE.load-path in the manual: https://emacsmirror.net/manual/borg/Variables.html.

dakra commented 3 years ago

Maybe it's helpful. You could have a look at my .gitmodules treemacs secion where I also exclude some extra packages that I don't want.

lld2001 commented 3 years ago

Thank you. It's very helpful.