Skip to content

Commit

Permalink
[radian-software#320] Make it easier to use a fork of straight.el
Browse files Browse the repository at this point in the history
  • Loading branch information
raxod502 committed May 23, 2019
1 parent 886df80 commit dcf78e9
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 10 deletions.
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2172,7 +2172,7 @@ Here is the default recipe used for `straight.el`, if you don't
override it:

(straight :type git :host github
:repo "raxod502/straight.el"
:repo ,(format "%s/straight.el" straight-repository-user)
:files ("straight*.el")
:branch ,straight-repository-branch)

Expand All @@ -2186,6 +2186,10 @@ If all you want to do is change which branch you are installing
least until the recipe happens to be changed upstream and your
init-file isn't updated.)

Similarly, if all you want to do is switch to your own fork of
`straight.el` on GitHub, simply customize the variable
`straight-repository-user` to your GitHub username.

There is one minor caveat to the above discussion. If your fork makes
changes to the way in which recipes are interpreted, then those
changes will not be effective during the interpretation of your own
Expand Down Expand Up @@ -2653,8 +2657,16 @@ switch to that branch with

(setq straight-repository-branch "develop")

and base your pull requests from it. Please try to follow the style of
the surrounding code and documentation, but anything is welcome.
and base your pull requests from it. If you have an outstanding pull
request whose features you would like to use in your configuration,
there is full support for defining `straight.el` as coming from any
branch in any fork:

(setq straight-repository-user "my-github-username")
(setq straight-repository-branch "feat/my-cool-feature")

Please try to follow the style of the surrounding code and
documentation, but anything is welcome.

You can run the linting locally simply by running

Expand Down
3 changes: 2 additions & 1 deletion bootstrap.el
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@

;; Then we register (and build) straight.el itself.
(straight-use-package `(straight :type git :host github
:repo "raxod502/straight.el"
:repo ,(format "%s/straight.el"
straight-repository-user)
:files ("straight*.el")
:branch ,straight-repository-branch))

Expand Down
4 changes: 2 additions & 2 deletions install.el
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@

(let (;; This needs to have a default value, just in case the user
;; doesn't have any lockfiles.
(version :neptune)
(version :pluto)
(straight-profiles (if (boundp 'straight-profiles)
straight-profiles
'((nil . "default")))))
Expand Down Expand Up @@ -170,7 +170,7 @@
;; skipping the build phase.)
(straight-use-package-no-build
`(straight :type git :host github
:repo "raxod502/straight.el"
:repo ,(format "%s/straight.el" straight-repository-user)
:branch ,straight-repository-branch))
(unless (and (boundp 'bootstrap-version)
(integerp bootstrap-version)
Expand Down
2 changes: 1 addition & 1 deletion straight-x.el
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
(let ((lockfile-path (straight--versions-lockfile 'pinned)))
(with-temp-file lockfile-path
(insert
(format "(%s)\n:neptune\n"
(format "(%s)\n:pluto\n"
(mapconcat
(apply-partially #'format "%S")
straight-x-pinned-packages
Expand Down
18 changes: 15 additions & 3 deletions straight.el
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,22 @@ bind this variable to different symbols using `let' over
different parts of your init-file."
:type 'symbol)

(defcustom straight-repository-user "raxod502"
"String identifying the GitHub user from which to clone straight.el.
You must set this variable before straight.el is bootstrapped for
it to have an effect. (It is used in the default recipe for
straight.el which is registered during bootstrap.)
If you have forked raxod502/straight.el to your-name/straight.el,
then to use your fork you should set `straight-repository-user'
to \"your-name\"."
:type 'string)

(defcustom straight-repository-branch "master"
"String identifying the branch of straight.el to clone.
You can set this variable before straight.el is bootstrapped (and
should)."
You must set this variable before straight.el is bootstrapped for
it to have an effect. (It is used in the default recipe for
straight.el which is registered during bootstrap.)"
:type '(choice
(const :tag "Stable version (master)" "master")
(const :tag "Development version (develop)" "develop")
Expand Down Expand Up @@ -5181,7 +5193,7 @@ according to the value of `straight-profiles'."
;;
;; The version keyword comes after the versions alist so
;; that you can ignore it if you don't need it.
"(%s)\n:neptune\n"
"(%s)\n:pluto\n"
(mapconcat
(apply-partially #'format "%S")
versions-alist
Expand Down

0 comments on commit dcf78e9

Please sign in to comment.