This removes expansion of #+INCLUDE directives at tangle time because
it's too much trouble to maintain a workflow that org doesn't support,
without modifying the user's files, which goes against Doom's "your
system your rules" mantra. The tangling process is just too brittle to
hack without compounding edge cases.
Fixes#5089
This way the postscript can refer to the doom script via "$0" and its
arguments via "$@" (making it easier for cli commands to rerun the last
command).
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.
- Tangling no longer adds temp files to recentf (#3685)
- If :tangle yes is used, the result is no longer tangled to
/tmp/config.org.*.el
- In interactive sessions the org buffer is no longer interfered with
when tangling (by scrolling up to the top of the page, or undoing
overlays/markers).
- Tangling no longer triggers formatters (or any save/write hooks).
- Appease byte-compiler sama, complaining about free variables.
It's surprising that tangling doesn't expand #+INCLUDE directives. It's
so useful for literate configs I decided to expand them manually before
tangling (and relative to DOOMDIR, unless given an absolute path).
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.
+ Fixes config.org buffer being killed when tangled
+ Tangle files in same session if ob-tangle is loaded (and in
noninteractive sessions). i.e. only tangle quietly when starting up
interactive Emacs.
org-babel-tangle-file has reportedly killed config.org buffers, despite
them being visited. Since we're not doing anything with the return
value, may as well keep it in a separate process.
+ Now recompiles literate config if you modify org files in DOOMDIR
+ Replaced +literate/compile with +literate/reload
+ Calls org-babel-tangle-file directly if org package is loaded
+ Change mtime check mechanism for literate tangling at startup
Making the compile check happen earlier fixes an edge case where the
resulting files from a literate config being tangled into multiple files
aren't recognized by Doom's package management or autoload generation
systems.
Disabling byte-compiling fixes an all too common issue where packages
and macros are undefined at compile time, causing a plethora of invalid
function errors.
Leave byte-compilation to `bin/doom compile`!
It will tangle and byte-compile a config.org in your private config.
Doom will then load the resulting config.elc later.
Org is only loaded when updating this file.