Skip to content

Commit

Permalink
Set "default-directory" to package directory during init
Browse files Browse the repository at this point in the history
This allows recipes to avoid using the "pdir" variable, which is
arguably an implementation detail.
  • Loading branch information
DarwinAwardWinner committed Feb 14, 2012
1 parent 72b411a commit 94dc290
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
13 changes: 9 additions & 4 deletions el-get-custom.el
Original file line number Diff line number Diff line change
Expand Up @@ -221,27 +221,32 @@ definition provided by `el-get' recipes locally.
Intended for use from recipes, it will run once both the
`Info-directory-list' and the `load-path' variables have been
taken care of, but before any further action from
`el-get-init'.
`el-get-init'. It will be run with `default-directory' set
to the package directory.
:before
A pre-init function to run once before `el-get-init' calls
`load' and `require'. It gets to run with `load-path'
already set, and after :prepare has been called. It's not
intended for use from recipes.
intended for use from recipes. It will be run with
`default-directory' set to the package directory.
:post-init
Intended for use from recipes. This function is registered
for `eval-after-load' against the recipe library by
`el-get-init' once the :load and :features have been setup.
It will be run with `default-directory' set to the package
directory.
:after
A function to register for `eval-after-load' against the
recipe library, after :post-init, and after per-package
user-init-file (see `el-get-user-package-directory'). That's not
intended for recipe use.
user-init-file (see `el-get-user-package-directory'). That's
not intended for recipe use. It will be run with
`default-directory' set to the package directory.
:lazy
Expand Down
3 changes: 2 additions & 1 deletion el-get.el
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,8 @@ called by `el-get' (usually at startup) for each installed package."
(after (plist-get source :after))
(pkgname (plist-get source :pkgname))
(library (or (plist-get source :library) pkgname package))
(pdir (el-get-package-directory package)))
(pdir (el-get-package-directory package))
(default-directory pdir))

;; a builtin package initialisation is about calling recipe and user
;; code only, no load-path nor byte-compiling support needed here.
Expand Down

0 comments on commit 94dc290

Please sign in to comment.