Commit Graph

46 Commits

Author SHA1 Message Date
Henrik Lissner
e08c5f537e Fix #4623: tangle to config.el by default
Only uses this if no compile destination is specified in header or src
block parameters.
2021-02-07 23:57:44 -05:00
Song Pan
338be4f212 Fix 404 link. 2020-11-11 12:33:30 +00:00
Henrik Lissner
4dc888d104
Tangle org files on save if in same dir as config.org 2020-08-28 04:33:56 -04:00
Henrik Lissner
362f101227
config/literate: fix hanging paren
Whoopsidoodlepopsicolanumptywombatbiscuitmuffin.
2020-08-27 17:30:43 -04:00
Henrik Lissner
666ea63591
config/literate: make default tangle target DOOMDIR/config.el
Rather than ./config.el, which means it will end up in the wrong place
if the user moves their config.org out of $DOOMDIR or into a
subdirectory.
2020-08-27 17:19:52 -04:00
Henrik Lissner
63a03848a3
Fix literate tangling on 'doom sync'
Relevant to #3746
2020-08-25 06:01:35 -04:00
Henrik Lissner
a8b7c00426
config/literate: don't add save hook more than once
Hinders the user's ability to disable tangle-on-save behavior.
2020-08-22 17:40:25 -04:00
Henrik Lissner
f83e6fe1cc
Fix #3804: rename TANGLE -> __TANGLE
So 'doom env' will naturally exclude it.
2020-08-22 03:37:14 -04:00
Henrik Lissner
bb1e2247dd
Fix #3781: command not found
Due to overzealous quoting.
2020-08-19 12:45:23 -04:00
Henrik Lissner
9b991fc29f
Fix #3781: revert 55b87b3a9 2020-08-19 12:10:14 -04:00
Henrik Lissner
55b87b3a94
bin/doom: source postscript instead
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).
2020-08-18 20:32:34 -04:00
Henrik Lissner
cbebbd5278
Fix #3746: bin/doom hangs after tangling config
Because +literate-tangle-h wasn't returning non-nil in interactive
sessions.
2020-08-14 00:00:36 -04:00
Henrik Lissner
f5ba3d9498
config/literate: revise readme 2020-08-12 02:52:45 -04:00
Henrik Lissner
64dfc709bf
Fix #3729: config.org not getting tangled
Because the wrong file is being inserted into the temporary org buffer,
org never finds anything to tangle!
2020-08-11 14:00:33 -04:00
Henrik Lissner
eb9cb0c6e9
Fix org version conflicts due to literate config #3649
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.
2020-08-09 01:50:42 -04:00
Henrik Lissner
d2bc2ff44b
config/literate: improve tangling algorithm
- 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.
2020-08-08 02:57:04 -04:00
Henrik Lissner
00a8f750ed
Fix wrong-type-arg: stringp when tangling config.org 2020-08-05 03:32:21 -04:00
Henrik Lissner
01c5c35686
Fix #3688: failure tangling config.org 2020-08-04 18:04:15 -04:00
Henrik Lissner
f641bf4554
Fix 'void-variable: backup' error
Fixes my fix for #3685
2020-08-04 13:58:40 -04:00
Henrik Lissner
8580b53e8e
Fix #3685: don't mutate org buffer when tangling
If the buffer doesn't change, the cursor won't move.
2020-08-04 13:43:14 -04:00
Henrik Lissner
6a64f37435
Minor refactors & revision across the board 2020-07-31 01:39:24 -04:00
Henrik Lissner
8da31dbbab
config/literate: update & revise readme 2020-07-25 22:38:37 -04:00
Henrik Lissner
711e687709
config/literate: expand #+INCLUDE directives
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).
2020-07-25 22:33:52 -04:00
Henrik Lissner
ff21dfe532
Revise :config literate README
Closes #3621

Co-authored-by: Carl Lange <carl@flax.ie>
2020-07-24 15:24:28 -04:00
Henrik Lissner
3aeb177847
Add +literate-enable-recompile-h to enable save-on-tangle 2020-07-24 15:21:44 -04:00
Hanno Perrey
14d6a19462
fix for #3266: wrong-type-arg stringp from format (#3599)
Triggered e.g. by pdf-tools-install when tangling literate config on
interactive save and epdfinfo is missing
2020-07-20 22:13:50 -04:00
Jarmo Riikonen
b5c0005dee
add config/literate readme (#3033)
* add config/literate readme

* Fix personal config paths

It also works from $HOME/.config/doom as @tecosaur said.

* fixes
2020-05-28 03:43:01 -04:00
Henrik Lissner
e1f73bd7cb
Fix void-function +literate-tangle-h on saving org files 2020-05-26 01:00:49 -04:00
Henrik Lissner
1916d26c75
Fix void-function +literate-tangle 2020-05-25 18:18:10 -04:00
Henrik Lissner
20cddb3565
config/literate: fix tangling on 'doom sync' 2020-05-25 16:03:34 -04:00
Henrik Lissner
b63e62ef49
config/literate: allow config.org to be a symlink #2079 2019-11-19 20:37:49 -05:00
Sheng Yang
73e0baba08 Allow +literate-config-file to be a symbolic link
If the literate config file is a symbolic link, the tangled file is with the
target of the link, not with the literate config file.
2019-10-09 21:02:49 -05:00
Henrik Lissner
61b7451b52
config/literate: always tangle asynchronously
Should also fix errors during tangling while running `bin/doom`
commands.
2019-07-29 03:18:38 +02:00
Henrik Lissner
3e357c2e88
Return real version string from fake org-release fn 2019-07-27 02:46:50 +02:00
Henrik Lissner
8931718e8a
config/literate: fix org-version errors 2019-07-23 17:56:37 +02:00
Henrik Lissner
149b2617b0
💥 revise hook/var fns naming convention (2/2)
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.
2019-07-22 02:30:38 +02:00
Henrik Lissner
7eb479e3f7
config/literate: set config.el as default target 2019-03-29 03:40:56 -04:00
Henrik Lissner
132ad7d391
Half-revert 92e604d0
+ 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.
2019-03-28 16:20:25 -04:00
Henrik Lissner
92e604d0dc
config/literate: don't tangle file in this session
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.
2019-03-28 14:32:16 -04:00
Henrik Lissner
5cdc2127be
Refactor config/literate module
+ 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
2019-03-28 01:59:25 -04:00
Henrik Lissner
7d3ffdff06
Remove third line in section headers
This is truly important stuff. We've saved many lives with this update.
2018-09-09 09:58:19 -04:00
Henrik Lissner
0ec4d6ee43
config/literate: earlier check & no byte-compile
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`!
2018-06-10 17:28:17 +02:00
Henrik Lissner
21779f66ad
config/literate: remove compile-on-save hooks
Too volatile and slow.
2018-06-05 16:35:16 +02:00
Henrik Lissner
3245c365d7
config/literate: log compilation 2018-06-05 16:14:38 +02:00
Henrik Lissner
47efd56fd4
compile/literate: refactor & recompile on save
And add autoloaded commands. This may need work to ensure you don't
spawn multiple instances of Emacs all vying to compile the same file.
2018-06-05 16:09:03 +02:00
Henrik Lissner
f5fe36af23
Add :config literate module
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.
2018-06-05 15:56:37 +02:00