Tangling would load org libraries. If org hasn't been installed yet,
this means the older version is loaded, later interfering with the
installation and byte-compilation of the new package, causing down the
road.
These options aren't properly supported in this version of the CLI.
Changing the localdir, for instance, doesn't affect when straight is first
bootstrapped. Chaning emacsdir doesn't matter for the first run. I'm
working on a CLI rewrite that will reimplement --doomdir and --localdir
at least, but for now it's best I just remove these.
They can still be customized using the EMACSDIR, DOOMDIR, and
DOOMLOCALDIR envvars.
Closes#3367
elisp lacks an execv implementation (or mature subprocess library), so
we exploit some splenderiffic hackery to get Emacs to execute arbitrary
shell commands after a 'doom ...' command completes. This allows us to
daisy chain doom commands in distinct sessions (wonderful for reloading
doom after a 'doom upgrade', which we do). This minimizes errors when a
'doom upgrade' pulls in breaking changes to Doom's CLI.
We also bring 'doom run' into elisp, since this new functionality
enables us to.
Doom now looks for cli.el files in your private directory or modules,
giving them an opportunity to customize the CLI (add commands or
reconfigure existing ones) to suit their purposes.
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes#2802, #2737, #2386
The big highlights are:
- Fix#2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix#2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix#2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
- Replace doom//upgrade with doom/upgrade
- Replace doom//autoloads with doom/reload-autoloads
- Replace doom//refresh with doom/reload
- Remove doom//install; there should be no workflow for this command
- Remove doom//autoremove; autoremove was replaced with purge. Maybe
I'll write a doom//purge analogue. Not sure yet.
- Use compile instead of hacky wrapper around core-cli API
Rewrite interactive CLI commands
- Rewrite doom//upgrade & doom//autoloads
- Remove doom//install; there really should be no use-case for it
- Remove doom//autoremove; autoremove was replaced with purge. I'll get
around to writing a doom//purge eventually.
fixup! Rewrite interactive CLI commands
Highlights:
- 'doom purge' now purges builds, elpa packages, and repos by default.
Regrafting repos is now opt-in with the -g/--regraft switches.
Negation flags have been added for elpa/repos: -e/--no-elpa and
-r/--no-repos.
- Removed 'doom rebuild' (it is now just 'doom build' or 'doom b').
- Removed 'doom build's -f flag, this is now the default. Added the -r
flag instead, which only builds packages that need rebuilding.
- 'doom update' now updates packages synchronously, but produces more
informative output about the updating process.
- Straight can now prompt in batch mode, which resolves a lot of issues
with 'doom update' (and 'doom upgrade') freezing indefinitely or
throwing repo branch errors.
- 'bin/doom's switches are now positional. Switches aimed at `bin/doom`
must precede any subcommands. e.g.
Do: 'doom -yd upgrade'
Don't do: 'doom upgrade -yd'
- Moved 'doom doctor' from bin/doom-doctor to core/cli/doctor, and
integrated core/doctor.el into it, as to avoid naming conflicts
between it and Emacs doctor.
- The defcli! macro now has a special syntax for declaring flags, their
arguments and descriptions.
Addresses #1981, #1925, #1816, #1721, #1322
Moves init.test.el to core/test/init.el and initializes the test
environment from within the current session, rather than through a bash
script middle man.
TODO: don't buffer the unit test results
This will run the unit tests for each module in a separate Emacs
instance. It's a fair bit slower, but much more useful for something as
stateful as an Emacs config.
Now I just need to push the rewritten tests.
There are a few kinks to iron out, but for the most part it's done. Doom
Emacs, powered by straight. Goodbye gnutls and elpa/quelpa issues.
This update doesn't come with rollback or lockfile support yet, but I
will eventually include one with Doom, and packages will be (by default,
anyway) updated in sync with Doom.
Relevant threads: #1577#1566#1473
Adds new convenience macros like print! and insert!, and adds classes;
which are helper functions that can be called inline within format!,
print! et co, e.g.
(format! "%s" (filename "/tmp/some/file")) ; => file
(format! "%s" (relpath "/tmp/some/file" "/tmp")) ; => some/file
(format! "%s" (dirname "/tmp/some/file")) ; => /tmp/some
Check out doom-format-class-alist for more.
This is second of three big naming convention changes. In this commit,
we change the naming conventions for hook functions and variable
functions:
1. Replace the bar | to indicate a hook function with a -h suffix, e.g.
doom|init-ui -> doom-init-ui-h
doom|run-local-var-hooks -> doom-run-local-var-hooks-h
2. And add a -fn suffix for functions meant to be set on variables,
e.g.
(setq magit-display-buffer-function #'+magit-display-buffer-fn)
See ccf327f8 for the reasoning behind these changes.
This is first of three big naming convention updates that have been a
long time coming. With 2.1 on the horizon, all the breaking updates will
batched together in preparation for the long haul.
In this commit, we do away with the asterix to communicate that a
function is an advice function, and we replace it with the '-a' suffix.
e.g.
doom*shut-up -> doom-shut-up-a
doom*recenter -> doom-recenter-a
+evil*static-reindent -> +evil--static-reindent-a
The rationale behind this change is:
1. Elisp's own formatting/indenting tools would occasionally struggle
with | and * (particularly pp and cl-prettyprint). They have no
problem with / and :, fortunately.
2. External syntax highlighters (like pygmentize, discord markdown or
github markdown) struggle with it, sometimes refusing to highlight
code beyond these symbols.
3. * and | are less expressive than - and -- in communicating the
intended visibility, versatility and stability of a function.
4. It complicated the regexps we must use to search for them.
5. They were arbitrary and over-complicated to begin with, decided
on haphazardly way back when Doom was simply "my private config".
Anyhow, like how predicate functions have the -p suffix, we'll adopt the
-a suffix for advice functions, -h for hook functions and -fn for
variable functions.
Other noteable changes:
- Replaces advice-{add,remove}! macro with new def-advice!
macro. The old pair weren't as useful. The new def-advice! saves on a
lot of space.
- Removed "stage" assertions to make sure you were using the right
macros in the right place. Turned out to not be necessary, we'll
employ better checks later.
Sets out to solve a number of issues with the package management
process. Namely:
- To-be-removed packages that are simply being removed are no longer
incorrectly labeled "quelpa->elpa", but "removed" instead.
- A backend (elpa vs quelpa) column was added to the package listing
confirmation when running `doom update`.
- Doom now correctly recognizes that packages installed with a psuedonym
are installed, and will not endlessly attempt to uninstall and
reinstall them on every `doom refresh`.
- Packages declared with :built-in will no longer lose their built-in
marking if said package is not actually present in Emacs' site load
paths. i.e. if you say it's built in, Doom won't question it.
- package!'s :ignore property is now treated as a form whose evaluated
result will be used as its value.
- Use message library instead of reinventing the wheel
- Fix -d/--debug support for `bin/doom doctor`
- Add indent and autofill support to print! and format!
- Add doom-message-backend for forcing format! to use a specific backend
- Phase out anaphoric when! macro in doctor scripts, it was hardly used
- Reorganize tests into logical groups
- Report Doom initialization with more granularity
- Make better use of whitespace and indentation in output
- Use backquotes for quoting symbols in pcase (for backward
compatibility)
- Initialize Doom completely and manually (less maintanence headache and
more certain to work across Doom updates).
- Will now warn you if both .doom.d and .config/doom exists.
- Include branch and last commit date in doctor/info, next to Doom
version.
- Issues in Doom core are now indented.
+ Bump Emacs version check to 25.3
+ Fix doctor reporting missing packages that are user-disabled
+ Add Doom core checks for over-sized cache files (a possible cause of
freezes/hangs)
+ Emit a backtrace from module doctor script errors
+ Fix doom doctor not respecting DEBUG envvar
Done to make bin/doom produce better debugger output (and more readily).
A lot of bin/doom errors aren't recurring, so it's better to produce the
full error report ASAP.
The `term.el` package defines an environment variable `EMACS` inside its shell process, containing the Emacs and term.el version, in a string that looks like this: `26.1 (term:0.96)`. This interferes with the `bin/doom` command, which expects that environment variable to be a path to an Emacs binary. Trying to run make inside a doom terminal thus gives you this error:
```
Emacs isn't installed
make: *** [Makefile:5: all] Error 1
```
This simple fix just checks if `$EMACS` looks like a term version string, and ignores it if so.
%* is unaffected by SHIFT, so using it results in Emacs loading a
buffer named "run" on startup.
In order to preserve running all supported commands directly with
the bin/doom script, change the magic string in doom.cmd to one that
is unused ("runemacs")
- Using "start" will allow the batch script to return immediately,
rather than waiting for the command to finish.
- Using "runemacs" (instead of plain "emacs") will hide the console
window that is displayed while Emacs is running
As an alternative to the -e/--emacsd options. Sometimes it is more
consistent to customize bin/doom this way. e.g.
EMACS=/another/bin/emacs DOOMDIR=~/someplace EMACSDIR=~/emacsd bin/doom install
Another refactor, again to improve the locality of doom errors and make
the data that accompanies them more useful in determining the origin and
source of issues. Also, bin/doom is now a little more informative about
how to debug errors.
Removes doom-module-table; which was inflexible (though more stable). It
prevented you from putting your doom! block in anywhere but
~/.doom.d/init.el.
It is replaced (somewhat) by (doom-modules).
This commit adds bin/doom, which acts as the middle man that make once
was (and will stay for a while, though the documentation will shift away
from using it). It does everything the previous make interface did, but
is faster and more flexible. bin/doom should eventually replace the
makefile.
bin/doom also makes it easier to run Doom outside of ~/.emacs.d and
~/.doom.d with, for example:
bin/doom run -p ~/.other.doom.d/ -e ~/.other.emacs.d
bin/doom.cmd is included for Windows users, but I don't recommend using
it yet. It hasn't been tested nor have I ever written a batch script
before.
Also update init.example.el with new defaults.
+ Consolidate the CATEGORY -> MODULE terminology
+ Rename functions to make their function easier to understand
+ Rename doom-module-expand-file => doom-module-path
+ Rename doom-module-find-path => doom-module-locate-path
+ Fix frame-spawning when calling bin/org-capture
+ Integrate counsel-org-capture into bin/org-capture workflow
+ Ensure frame is closed if counsel-org-capture is cancelled
+ Ensure org-capture buffer closes the associated frame
+ Add transient frame property for org-capture frames
If you are using a tiling window manager, you'll need to add a rule for
a window named "org-capture" in order to make a floating window.