Commit graph

214 commits

Author SHA1 Message Date
Henrik Lissner
f9de598daa
tweak(lib): doom-info: split byte-compiled-config trait into 3
What used to be a `byte-compiled-config` trait, displayed in your `M-x
doom/info`, is now `compiled-user-config`, `compiled-core`, and
`compiled-modules`, for more helpful granularity for debugging possible
byte-code issues.
2022-09-18 14:01:52 +02:00
Henrik Lissner
231fc9cf53
fix(cli): link $XDG_*_HOME to fake $HOME for doom run
Due to a technical limitation of Emacs <=28, launching Emacs out of a
non-standard location is non-trivial, and `doom run` tries to promise
that it can do so on demand. Emacs 29 does introduce a --init-directory
switch that would make this easy, but it'll be some time before we can
rely on it.

So 'doom run' creates a fake $HOME in /tmp/doom.run/ and writes a
bootloader there to load your Doom config remotely. But there's a
problem: in this fake $HOME, none of the user's config, cache, data, or
binscript directories are available, so I symlink them there. This
should at least resolve the most trivial incompatibilities (like the
lack of all-the-icons fonts, which typically get installed to
$HOME/.local/share/fonts/ -- see #6807), but there may be yet more edge
cases. Still, this is a good enough compromise for now.

Fix: #6807
2022-09-18 13:55:47 +02:00
Henrik Lissner
e2ce4345d2
bump: :lang org
abo-abo/org-download@947ca22364 -> abo-abo/org-download@19e166f0a8
alf/ob-restclient.el@3ac834b02b -> alf/ob-restclient.el@1b021ce1c6
emacs-straight/org-mode@00adad9357 -> emacs-straight/org-mode@86c4635dba
emacsmirror/org-contrib@39e2abc562 -> emacsmirror/org-contrib@0740bd3fe6
hakimel/reveal.js@e219184f37 -> hakimel/reveal.js@c1c4145240
org-roam/org-roam@7f453f3fff -> org-roam/org-roam@d95d25615e

Close: #6692
Fix: #6691
2022-09-18 13:10:49 +02:00
Henrik Lissner
8fd7e8bed0
fix(lib): doom/reload to reflect recent changes
Fix: #6806
2022-09-18 13:10:49 +02:00
Henrik Lissner
195359cf99
fix: properly disable tooltip-mode
In 4a25375, it seemed that only setting the variables to nil early
enough would be sufficient, but this turned out not to be the case.
There's no avoiding calling the mode to disable it.

Ref: 58c0de6841
Amend: 4a253757cb
2022-09-18 10:36:00 +02:00
Henrik Lissner
9d52ba2747
fix: envvar file not loading
This is because display-graphic-p returns nil so early in the startup
process.

Fix: #6802
2022-09-18 01:08:27 +02:00
Henrik Lissner
7fd6cd4398
refactor: remove redundant server-auth-dir setting
And move server-name setter to :config.
2022-09-18 00:54:10 +02:00
Henrik Lissner
f99cf0ccc8
feat(cli): introduce DOOMPROFILELOAD{FILE,PATH} envvars
- Adds $DOOMPROFILELOADFILE: Controls where to read and write the
  profile loader. Changing this may be helpful for users on nix/guix,
  who have deployed Doom to a read-only location. This sets
  `doom-profile-load-file`.
- Changed profile load file's default location (used to be
  $EMACSDIR/profiles/init.el, is now $EMACSDIR/profiles/load.el). The
  gitignore was updated to reflect this.
- Adds $DOOMPROFILELOADPATH: A colon-delimited list of profile config
  files and directories (semi-colon on Windows) which dictate what Doom
  reads in order to discover your profiles. Config files are required to
  have an *.el extension. This sets `doom-profile-load-path`.
- Changes the nomenclature around this loader script. I used to refer to
  it as the profile bootstrapper. I'll now refer to it as the profile
  load file, and I've renamed `doom-profiles-bootstrap-file` to
  `doom-profile-load-file` to reflect this.
- The variables `doom-profile-dirs` and `doom-profile-config-files` were
  merged into doom-profile-load-path.
- Both envvars have also been documented in `doom help` (and
  $DOOMPROFILE's has been updated).

Ref: #6794
2022-09-18 00:28:13 +02:00
Henrik Lissner
dc107e4a15
refactor: restore doom-profile-default
And throw errors if a profile has the same name as the default (_).
2022-09-17 21:41:43 +02:00
Henrik Lissner
21f2ad58b5
fix(cli): ensure doom envvars are set for post-script sessions
Particularly DOOMPROFILE, without which the --profile switch wasn't
actually doing anything, and profile sessions would (silently) use the
default user-emacs-directory and doom-user-dir.
2022-09-17 21:41:42 +02:00
Henrik Lissner
6dffa09c71
refactor(profiles): bootstrap script
- Swap out the funcall+alist lookup for a pcase (which is expanded to a
  cond, which is is faster and easier to read).
- Wrap bootstrap file to $EMACSDIR/profiles/init.el, but byte-compile it
  to $EMACSDIR/profiles/init.X.el where X is emacs-major-version.
- Make doom-profiles-save's second argument optional (defaults to
  doom-profiles-bootstrap-file).
- Make doom-profiles-save throw a error if byte-compilation fails for
  some reason.
- Rename the tempvars to include 'doom' in their name, so debuggers know
  where they originate.
2022-09-17 21:41:42 +02:00
Henrik Lissner
09d24cd68a
fix(cli): type error trying to split a cons cell
doom-profile was changed to a cons cell in 18cd2eb.

Amend: 18cd2eb483
2022-09-17 21:41:42 +02:00
Henrik Lissner
a726ba33b9
tweak: use doom-profile-*-dir for core dir/file vars
In this commit I start using doom-profile-*-dir vars, though it will
make no difference to the default Doom install (only to profiles, and in
the future, in v3, where we'll drop $EMACSDIR/.local entirely).
2022-09-17 21:41:42 +02:00
Henrik Lissner
25bc9c9765
fix: defconst->defvar for more doom-*-dir vars
So they can be changed before doom.el is loaded (e.g. by profiles).
2022-09-17 21:41:42 +02:00
Henrik Lissner
4a3654d666
refactor(cli): read $DEBUG in early-init.el instead
This opens up $DEBUG as an alternative to --debug-init, and allows more
of the startup process to react to it.
2022-09-17 21:41:42 +02:00
Henrik Lissner
7fec2cf5bb
tweak(profiles): regen profiles if generator version changed
The profile bootstrap file's first form is the doom-version it was
generated with. If this has changed, it should be considered outdated,
even if the user's profiles haven't changed.
2022-09-17 21:41:42 +02:00
Henrik Lissner
36a9637e79
fix(profiles): no bootstrap file for non-bootloaders
If Doom doesn't live in ~/.emacs.d or ~/.config/emacs, then it cannot
play the role of bootloader, so opt out of generating the profile
bootstrappper in this case.

That said, don't disable the profile system entirely; it can still be
useful for internal, noninteractive, and sandbox use.
2022-09-17 15:29:17 +02:00
Henrik Lissner
753b479ea6
feat(cli): add --reload switch to 'profiles sync'
So 'doom profiles sync' can be relied on to forcibly regenerate the
profile init by default.
2022-09-17 15:11:48 +02:00
Henrik Lissner
edf54a398b
tweak(profiles): suppress profile init compilation warnings
It's not useful information, but should still be emitted if debug mode
is on.
2022-09-17 15:11:47 +02:00
Henrik Lissner
750d75a45b
refactor(profiles): simplify profile init file
So that the resulting file expands to less code and doesn't apply too
magic to file paths (it may be unwanted).

And don't try to unintern a lexical binding.
2022-09-17 15:11:47 +02:00
Henrik Lissner
329d65d0d4
fix(profiles): unexpanded paths in implicit profiles
Fixes two issues with implicit profiles:

1. Where user-emacs-directory (and sometimes doom-user-dir) would be
   unexpanded in the profile init file (generated by 'doom profiles
   sync'), which would be ineffective at runtime.
2. Where an implicit profile with a .doomprofile that lacks a
   user-emacs-directory setting would not have any user-emacs-directory
   set for it at all. Instead, it should fall back to that profile's
   location.
2022-09-17 15:11:47 +02:00
Henrik Lissner
fd61150f60
refactor: local-vars: don't intern unneeded symbols
If the hook doesn't exist, it hasn't been bound to, and doom-run-hooks
will no-op if passed a nil. Saves a tiny bit on memory usage.
2022-09-17 12:12:11 +02:00
Henrik Lissner
00e8f6b72a
fix: don't require doom-local-dir end with a slash 2022-09-17 11:00:08 +02:00
Henrik Lissner
811c18ca68
fix(cli): remove redundant comp-effective-async-max-jobs advice
Amend: 51a9745f38
2022-09-16 19:20:45 +02:00
Henrik Lissner
fe602fe9cd
fix(lib): suppress 'Function X is already compiled'
Emitted from `byte-compile`.
2022-09-16 19:19:55 +02:00
Henrik Lissner
51a9745f38
perf: native-comp: use 1/4 of your cores instead of 1/2
The sudden spike in CPU and memory utilization alarms people, so I've
reduced how many cores native-comp will use. In non-interactive
sessions, it will use all of them, however (that is, when I later
introduce an AOT switch).

You can still override this by setting native-comp-async-jobs-number or
comp-num-cpus yourself.

I use advice instead of setting comp-num-cpus so that users to avoid
trampling on default behavior, or attempts by the user to change them.
2022-09-16 19:09:34 +02:00
Henrik Lissner
0694be43ee
fix(cli): reference to free variable id
Fix: #6791
2022-09-16 19:09:34 +02:00
Henrik Lissner
3ba56eb008
fix(lib): ignore doom-compile-functions failures
It really isn't important if this function succeeds or not, but it seems
its stability is highly variable, dependent on your specific build and
version of Emacs. Since there are a lot of 29 Doom users, best to be
more permissive and simply fall back to byte-compilation if native-comp
fails.
2022-09-16 19:09:28 +02:00
Henrik Lissner
58c0de6841
fix: menu-bar not disabled in some instances
It seems unsetting menu-bar-mode is enough on *some* builds of Emacs,
but not all. Best we cover all the bases.

Amend: 4a253757cb
Fix: #6790
2022-09-16 18:27:04 +02:00
Henrik Lissner
9121100bb4
fix(cli): remove redundant doom-env-file
Causing the envvar file to be generated to wrong place, and thus never
be updated/properly loaded at runtime.

This new setting is for later, where I'll integrate the envvar generate
into the profile generator proper.
2022-09-16 17:06:49 +02:00
Henrik Lissner
732d87ac3e
nit: minor comment revision and refactors 2022-09-16 17:01:57 +02:00
Henrik Lissner
c5e88d229f
fix(lib): doom-compile-function throwing native-compiler-error 2022-09-16 16:15:07 +02:00
Henrik Lissner
3f866983e5
refactor(lib): doom-load 2022-09-16 13:07:28 +02:00
Henrik Lissner
b804a2f34f
refactor(lib): convert cli/autoloads.el to lib 2022-09-16 13:07:28 +02:00
Henrik Lissner
7ea4b21953
fix(cli): remove vestigial doom-initialize-modules calls
Fix: #6784
2022-09-16 13:07:28 +02:00
Henrik Lissner
ab9896c526
refactor(org): move doom-docs link defs to :lang org
Where they will be further generalized, later.

This also prevents an issue where org was loaded while the profile init
files are generated, which caused a warning about org-loaddefs which
introduces a noticable delay.
2022-09-16 13:06:17 +02:00
Henrik Lissner
9cbc173e0d
fix(lib): update doom/reload-autoloads
To reflect recent changes (particularly b914830).

Amend: b914830403
2022-09-16 03:17:46 +02:00
Henrik Lissner
39197618ec
fix(lib): only set doom-print-minimum-level in debug-mode 2022-09-16 03:17:46 +02:00
Henrik Lissner
354d71566a
fix: inhibit-null-byte-detection = t at startup 2022-09-16 03:08:29 +02:00
Henrik Lissner
00ff149ebe
fix(cli): print-group-if! -> print-group! + :if
Remove some vestigial references to the former, which was replaced with
the latter in b7bd27d.

Amend: b7bd27d22b
2022-09-16 02:42:48 +02:00
Henrik Lissner
7b1ac7cdc1
fix(cli): doom-autoloads-reload -> doom-profile-generate
Remove vestigial references to the former, which was replaced with the
latter in b914830.

Amend: b914830403
2022-09-16 02:42:30 +02:00
Henrik Lissner
cc0e6a61c3
fix(cli): add lisp/cli/profiles.el
I forgot to add the definitions for the 'doom profile{s,}' commands in
b914830, which causes "unrecognized command 'profiles sync'" errors on
'doom {sync,upgrade}'.

My unparalleled brilliance is 4 parallel universes ahead of me, clearly.

Amend: b914830403
2022-09-16 02:26:00 +02:00
Henrik Lissner
b395bd5392
refactor: use print! to emit doom! module warnings 2022-09-16 01:14:25 +02:00
Henrik Lissner
b598d41ffb
nit: correct comment header about startup optimizations
To claim they're ordered by effectiveness was silly of me, and was never
*quite* true, so I remove it altogether.
2022-09-16 01:14:25 +02:00
Henrik Lissner
f34e91d3b9
fix: guard tty-run-terminal-initialization against GUI sessions 2022-09-16 01:14:25 +02:00
Henrik Lissner
aa53ad2c1b
fix: load subr-x at compile-time in doom.el
This is more to nip 27.x issues in the bud, where fewer of subr-x's
macros are autoloaded.
2022-09-16 01:14:25 +02:00
Henrik Lissner
e411762e8c
refactor: enable module whether or not it exists
The doom-modules table should reflect the user's intentions, not the
actual state of its modules (e.g. by omitting modules that couldn't be
found at activation time).
2022-09-16 01:14:25 +02:00
Henrik Lissner
a9e0156416
docs: update modulep! docstring
To clarify, reflect recent changes, and link to `doom!` for details.
2022-09-16 01:14:24 +02:00
Henrik Lissner
85f3b19f61
docs: revise version check failure message
- Recommend 28.1.
- Swap condition.
2022-09-16 01:14:24 +02:00
Henrik Lissner
c7289da99b
fix(cli): suppress redundant logs from straight-prune-build-cache 2022-09-16 01:14:24 +02:00