Skip to content

Commit 1b25f34

Browse files
committed
Merge branch 'future-doc'
2 parents 00b0a92 + fce5aed commit 1b25f34

File tree

10 files changed

+153
-73
lines changed

10 files changed

+153
-73
lines changed

README.adoc

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,18 @@ provides only a brief overview.
5353
Emacs version] even on the same machine; can also use
5454
{uri-documentation}#docker[Docker] or
5555
{uri-documentation}#podman[Podman] for that.
56-
* There are {uri-documentation}#setup-procedure[_four_ levels of
56+
* There are {uri-documentation}#setup-procedure[four levels of
5757
configuration] — you can customize most aspects of Eldev for your
5858
project needs and personal preferences.
5959
* {uri-documentation}#dependencies[Project dependency] downloading,
60-
installation etc. is fully automated, you only need to specify which
61-
Elisp package archive(s) to use.
62-
* You can also use {uri-documentation}#local-dependencies[local
63-
dependencies], even those that don’t use Eldev (some restrictions
64-
still apply). This is similar to Cask linking, but with more
65-
flexibility.
60+
installation etc. is fully automated, you only need to tell the tool
61+
where to find them:
62+
** {uri-documentation}#package-archives[in package archives] (MELPA,
63+
GNU ELPA, etc.);
64+
** {uri-documentation}#vc-repositories[in VC (Git) repositories];
65+
** {uri-documentation}#local-sources[in a local directory on your
66+
machine] (this is similar to Cask linking, but with more
67+
flexibility).
6668
* Full support for {uri-documentation}#autoloads[autoloads] during
6769
development.
6870
* Miscellaneous operations useful during development:

doc/README.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
:since-1-8: image:https://img.shields.io/badge/since-1.8-8be[Since 1.8,float=right]
7777
:since-1-9: image:https://img.shields.io/badge/since-1.9-8be[Since 1.9,float=right]
7878
:since-1-10: image:https://img.shields.io/badge/since-1.10-8be[Since 1.10,float=right]
79+
:since-1-11: image:https://img.shields.io/badge/since-1.11-8be[Since 1.11,float=right]
7980

8081

8182
toc::[]

doc/build-system.adoc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ And a short explanation of various elements:
8686

8787
==== Target cross-dependencies
8888

89-
FIXME
89+
NOTE: _This feature is present in Eldev, but is not documented yet._
9090

9191
[#target-sets]
9292
==== Target sets
@@ -187,8 +187,9 @@ can also reuse previous package file if Eldev says “up-to-date”.
187187

188188
You can use Eldev to byte-compile your project. Indirectly, this can
189189
be done by <<loading-modes,selecting appropriate loading mode>> for
190-
the project or its local dependencies. However, sometimes you might
191-
want to do this explicitly. For this, use command `compile`:
190+
the project or <<local-sources,local-source dependencies>>. However,
191+
sometimes you might want to do this explicitly. For this, use command
192+
`compile`:
192193

193194
$ eldev compile
194195

doc/extending-eldev.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,4 +398,4 @@ function Elisp documentation for the syntax.
398398

399399
=== Custom test runners
400400

401-
FIXME
401+
NOTE: _This feature is present in Eldev, but is not documented yet._

doc/initializing.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
[#initializing]
12
== Initializing a project
23

34
When Eldev starts up, it configures itself for the project in the

doc/loading-modes.adoc

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11
[#loading-modes]
22
== Loading modes
33

4-
In Eldev the project’s package and its local dependencies have
5-
_loading modes_. This affects exactly how the package (that of the
6-
project or of its local dependency) becomes loadable by Emacs.
4+
In Eldev the project’s package and its <<local-sources,local-source
5+
dependencies>> have _loading modes_. This affects exactly how the
6+
package (that of the project or of its local-source dependency)
7+
becomes loadable by Emacs.
78

89
Default loading mode is called `as-is`. It means the directory where
9-
project (or local dependency) is located is simply added to Emacs
10-
varible `load-path` and normal Emacs loading should be able to find
11-
required features from there on. This is the fastest mode, since it
12-
requires no preparation and in most cases is basically what you want
13-
during development.
10+
the project (or local sources of its dependency) is located is simply
11+
added to Emacs varible `load-path` and normal Emacs loading should be
12+
able to find required features from there on. This is the fastest
13+
mode, since it requires no preparation and in most cases is basically
14+
what you want during development.
1415

1516
However, users won’t have your project loaded like that. To emulate
1617
the way that most of the people will use it, you can use loading mode
1718
`packaged`. In this mode, Eldev will first build a package out of
18-
your project (or local dependency), then install and activate it using
19-
Emacs’ packaging system. This is quite a bit slower than `as-is`,
20-
because it involves several preparation steps. However, this is
21-
almost exactly the way normal users will use your project after
19+
your project (or local-source dependency), then install and activate
20+
it using Emacs’ packaging system. This is quite a bit slower than
21+
`as-is`, because it involves several preparation steps. However, this
22+
is almost exactly the way normal users will use your project after
2223
e.g. installing it from MELPA. For this reason, this mode is
2324
recommended for <<continuous-integration,continuous integration>> and
2425
other forms of automated testing.
@@ -79,12 +80,12 @@ this to your `Eldev-local`:
7980
(setf eldev-project-loading-mode 'byte-compiled)
8081
----
8182

82-
For local dependencies the mode can be chosen when calling
83-
`eldev-use-local-dependency`. For example:
83+
For dependencies built from sources local to your machine the mode can
84+
be chosen when calling `eldev-use-local-sources`. For example:
8485

8586
[source]
8687
----
87-
(eldev-use-local-dependency "~/barlib" 'packaged)
88+
(eldev-use-local-sources "~/barlib" 'packaged)
8889
----
8990

9091
As mentioned above, loading mode defaults to `as-is`.
@@ -98,11 +99,11 @@ You can always ask Eldev for a full list:
9899
=== Indirect build information
99100

100101
When a loading mode require Eldev to do something in order to prepare
101-
the project or its local dependencies for loading, it tries to do so
102-
silently in that only stderr is normally displayed. The purpose is to
103-
prevent secondary and partially unpredictable (more precisely,
104-
depending on previous builds) output from interfering with normal
105-
output. For example, if you run
102+
the project or its <<local-sources,local-source dependencies>> for
103+
loading, it tries to do so silently in that only stderr is normally
104+
displayed. The purpose is to prevent secondary and partially
105+
unpredictable (more precisely, depending on previous builds) output
106+
from interfering with normal output. For example, if you run
106107

107108
$ eldev eval "(some-project-function)"
108109

@@ -121,10 +122,11 @@ involves some custom non-trivial build steps, like e.g. compilation of
121122
a helper non-Elisp program.
122123

123124
Unlike with some other settings, the main project ignores values in
124-
local dependencies. Instead, `eldev-display-indirect-build-stdout` as
125-
defined in the main project affects both the project itself and all
126-
local dependencies at once: only the main project “knows” if it is
127-
important to avoid indirect build output for it or not.
125+
its local-source dependencies. Instead,
126+
`eldev-display-indirect-build-stdout` as defined in the main project
127+
affects both the project itself and all local sources at once: only
128+
the main project “knows” if it is important to avoid indirect build
129+
output for it or not.
128130

129131
[#source-directory]
130132
=== Project source directory
@@ -174,7 +176,8 @@ that many projects — especially those not providing user-visible
174176
functionality, or those that consist of a single file — don’t have any
175177
autoloading functions or other forms.
176178

177-
Local dependencies also have their autoloads activated regardless of
178-
loading mode. If the autoloads file is kept up-to-date using
179-
<<autoloads-plugin,the plugin>>, Eldev will take care to do this as
180-
needed in local dependencies too.
179+
Dependencies built from <<local-sources,local sources>> also have
180+
their autoloads activated regardless of loading mode. If the
181+
autoloads file is kept up-to-date using <<autoloads-plugin,the
182+
plugin>>, Eldev will take care to do this as needed in these
183+
dependencies too.

doc/overview.adoc

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,16 @@ Eldev features:
1111
* Can run on <<different-emacs-versions,different Emacs version>> even
1212
on the same machine; can also use <<docker,Docker>> or
1313
<<podman,Podman>> for that.
14-
* There are <<setup-procedure,_four_ levels of configuration>> — you
15-
can customize most aspects of Eldev for your project needs and
16-
personal preferences.
14+
* There are <<setup-procedure,four levels of configuration>> — you can
15+
customize most aspects of Eldev for your project needs and personal
16+
preferences.
1717
* <<dependencies,Project dependency>> downloading, installation etc.
18-
is fully automated, you only need to specify which Elisp package
19-
archive(s) to use.
20-
* You can also use <<local-dependencies,local dependencies>>, even
21-
those that don’t use Eldev (some restrictions still apply). This
22-
is similar to Cask linking, but with more flexibility.
18+
is fully automated, you only need to tell the tool where to find
19+
them:
20+
** <<package-archives,in package archives>> (MELPA, GNU ELPA, etc.);
21+
** <<vc-repositories,in VC (Git) repositories>>;
22+
** <<local-sources,in a local directory on your machine>> (this is
23+
similar to Cask linking, but with more flexibility).
2324
* Full support for <<autoloads,autoloads>> during development.
2425
* Miscellaneous operations useful during development:
2526
<<running-emacs,running Emacs>> with only your project,

doc/plugins.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ also registered as a dependency to all `.elc` targets in the project;
6969
this way, byte-compiling always has access to up-to-date list of
7070
autoloaded functions.
7171

72-
This plugin can also be activated in projects you use as
73-
<<local-dependencies,local dependencies>> for other projects. Eldev
72+
This plugin can also be activated in projects used as
73+
<<local-sources,local-source dependencies>> for other projects. Eldev
7474
knows how to keep the autoloads file up-to-date in all local
7575
dependencies, regardless of their <<loading-modes,loading mode>>.
7676

doc/project-dependencies.adoc

Lines changed: 88 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,17 @@ you don’t need to declare these dependencies second time in `Eldev`
1010
and keep track that they remain in sync.
1111

1212
However, you do need to tell Eldev how to _find_ these dependencies.
13-
Like Cask, by default it doesn’t use any package archives. To tell it
14-
to use an archive, call function `eldev-use-package-archive` in
15-
`Eldev` (you have such forms already in place if you have used `eldev
16-
init`). For example:
13+
There are three ways of locating packages: <<package-archives,using
14+
Elisp package archives>>, <<vc-repositories,using VC (Git)
15+
repositories>> and <<local-sources,on your local file system>>.
16+
17+
[#package-archives]
18+
=== From Elisp package archives
19+
20+
By default Eldev doesn’t use any package archives. To instruct it to
21+
use an archive to locate packages, call function
22+
`eldev-use-package-archive` in file `Eldev` (you have such forms
23+
already in place if you have used `eldev init`). For example:
1724

1825
[source]
1926
----
@@ -62,39 +69,102 @@ they are installed first. However, if you want to check if package
6269
archives have been specified correctly and all dependencies can be
6370
looked up without problems, you can explicitly use command `prepare`.
6471

65-
[#local-dependencies]
66-
=== Local dependencies
72+
[#vc-repositories]
73+
=== From VC (Git) repositories
74+
75+
{since-1-11} If a package you depend on isn’t available from a package
76+
archive (e.g. MELPA), this is still not a problem as long as there is
77+
a Git repository for it. Simply add to file `Eldev` a form like this:
78+
79+
[source]
80+
----
81+
(eldev-use-vc-repository 'dep-name :git "FULL-URL")
82+
----
83+
84+
If the package is available on GitHub, you can avoid specifying the
85+
full URL by using the shortened form:
86+
87+
[source]
88+
----
89+
(eldev-use-vc-repository 'dep-name :github "USER/REPOSITORY")
90+
----
91+
92+
Now, whenever a package called `dep-name` is needed, Eldev will first
93+
fetch given Git repository, build an Elisp package from it and provide
94+
it to the standard Emacs package manager for use.
95+
96+
Like <<package-archives,with package archives>>, function
97+
`eldev-use-vc-repository` itself doesn’t describe _how_ you intend to
98+
use given package. It merely tells Eldev where to find it. Only if
99+
the package is listed as a <<dependencies,regular dependency>> of your
100+
project or you register it as <<additional-dependencies,an additional
101+
dependency>>, will the repository actually get fetched.
102+
103+
If the project fetched from a repository doesn’t use Eldev itself, the
104+
tool might have problems building a package from it. In this case you
105+
can pass a <<setup-procedure,setup form>> to it:
106+
107+
[source]
108+
----
109+
(eldev-use-vc-repository ... :setup FORM)
110+
----
111+
112+
This form will be given to child Eldev processes whenever a package
113+
needs to be created out of the VC-fetched project. Most likely you
114+
will need to tell child Eldev how to locate dependencies of _that_
115+
project. The best way to figure it out is to check out the repository
116+
and create file `Eldev` in it with required contents
117+
(<<initializing,`eldev init`>> might help). Instead of committing the
118+
created file, convert its contents into an Elisp form (use `progn` if
119+
needed) and pass it as a value of `:setup` in your _main_ project.
120+
121+
By default, Eldev will check out the repository at the latest stable
122+
tagged release. If there are none, however, it will just use the HEAD
123+
commit. Eldev respects the options `--stable`/`--unstable` described
124+
in the previous section also for VC repositories. For example, the
125+
latter makes it ignore the releases and always use the latest commit.
126+
Finally, if you _always_ want to build from a specific commit, e.g. to
127+
make build process more stable, you can pass optional argument
128+
`:commit` to `eldev-use-vc-repository`. Its value must be a string:
129+
either a tag name or a _full_ (not shortened) Git commit hash.
130+
131+
[#local-sources]
132+
=== From your file system (local sources)
67133

68134
Imagine you are developing more than one project at once and they
69135
depend on each other. You’d typically want to test the changes you
70136
make in one of them from another right away. If you are familiar with
71137
Cask, this is solved by linking projects in it.
72138

73139
Eldev provides a more flexible approach to this problem called _local
74-
dependencies_. Let’s assume you develop project `foo` in directory
75-
`~/foo` and also a library called `barlib` in `~/barlib`. And `foo`
76-
uses the library. To have Eldev use your local copy of `barlib`
77-
instead of downloading it e.g. from MELPA, add the following form in
78-
file `~/foo/Eldev-local`:
140+
sources_. Let’s assume you develop project `foo` in directory `~/foo`
141+
and also a library called `barlib` in `~/barlib`. And `foo` uses the
142+
library. To have Eldev use your local copy of `barlib` instead of
143+
downloading it e.g. from MELPA, add the following form in file
144+
`~/foo/Eldev-local`:
79145

80146
[source]
81147
----
82-
(eldev-use-local-dependency "~/barlib")
148+
(eldev-use-local-sources "~/barlib")
83149
----
84150

151+
NOTE: Before 1.11 the function was named `eldev-use-local-dependency`.
152+
This name is still available for backward compatibility.
153+
85154
Note that the form _must not_ be added to `Eldev`: other developers
86155
who check out your project probably don’t even have a local copy of
87156
`barlib` or maybe have it in some other place. In other words, this
88157
should really remain your own private setting and go to `Eldev-local`.
89158

90-
Local dependencies have _loading modes_, just as the project’s package
159+
Local sources have _loading modes_, just as the project’s package
91160
itself. Those will be discussed <<loading-modes,later>>.
92161

93-
Eldev correctly handles situations with changing definitions of local
94-
dependencies. I.e. by simply commenting out or uncommenting
95-
`eldev-use-local-dependency` call, you can quickly test your project
96-
both with a MELPA-provided package and with a local dependency — Eldev
97-
will adapt without any additional work from you.
162+
Eldev correctly handles situations with adding, removing or otherwise
163+
changing local source definitions. I.e. by simply commenting out or
164+
uncommenting `eldev-use-local-sources` call, you can quickly test your
165+
project both with a MELPA-provided package and with local (and
166+
presumably just changed) copy of its dependency sources — Eldev will
167+
adapt without any additional work from you.
98168

99169
[#additional-dependencies]
100170
=== Additional dependencies

doc/setup-procedure.adoc

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ File `Eldev-local` is _working directory_ or _user/project-specific_.
3636
Unlike `Eldev`, it _should not_ be added to VCS: it is meant to be
3737
created by each developer (should he want to do so) to customize how
3838
Eldev behaves in this specific directory. The most common use is to
39-
define local dependencies. A good practice is to instruct your VSC to
40-
ignore this file, e.g. list it in `.gitignore` for Git.
39+
define <<local-sources,local sources>> to build project’s
40+
dependencies. A good practice is to instruct your VSC to ignore this
41+
file, e.g. list it in `.gitignore` for Git.
4142

4243
Finally, it is possible to specify some (short) setup forms on the
4344
command line using `--setup` (`-S`) option. This is not supposed to
@@ -90,10 +91,10 @@ anything. In all such cases, i.e. when required dependencies are not
9091
correctly preinstalled in the specified external directory, Eldev will
9192
simply fail.
9293

93-
<<local-dependencies,Local dependencies>> discussed later take
94-
precedence even in this mode: anything declared as local will override
95-
dependencies available from an external directory, just like it will
96-
in usual full isolation mode.
94+
<<local-sources,Local sources>> discussed later take precedence even
95+
in this mode: anything declared as local will override dependencies
96+
available from an external directory, just like it will in usual full
97+
isolation mode.
9798

9899
This mode can be useful to load exactly the same dependency versions
99100
as those installed in your normal Emacs. However, it is not suitable

0 commit comments

Comments
 (0)