Commit graph

18658 commits

Author SHA1 Message Date
Henrik Lissner
55c27a0ae9
fix(cli): avoid misinterpreted switches in argv
If early-init.el is loaded by another doomscript that uses
--init-directory or --profile for its own purposes, then they could
unintentionally alter user-emacs-directory. Lets only respect the
envvars in noninteractive sessions.
2022-09-18 00:46:52 +02:00
Henrik Lissner
87f85ab459
bump: :tools debugger lsp
emacs-lsp/dap-mode@50c2a99059 -> emacs-lsp/dap-mode@5d5043f962
emacs-lsp/lsp-ivy@3e87441a62 -> emacs-lsp/lsp-ivy@9ecf4dd9b1
emacs-lsp/lsp-mode@3fa645c039 -> emacs-lsp/lsp-mode@68bdac0f80
joaotavora/eglot@bd970be047 -> joaotavora/eglot@aeea7c719a
realgud/realgud@3c88611c4e -> realgud/realgud@aff03aeef1

Close: #6721
2022-09-18 00:28:13 +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
7fc0cbff5e
perf(cli): use nosuffix loading early-init
Don't waste file IO time looking for
early-init.el{.so{,.gz},.elc{,.gz},.el{,gz}}.
2022-09-17 21:41:43 +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
b8cca048c4
refactor: only process --init-directory w/o --profile
Using them both makes no sense, so don't process --init-directory if
--profile is given.
2022-09-17 21:41:42 +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
3a4233582b
perf: add MUST-SUFFIX when loading profile bootstrapper 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
f748a5d15d
fix(cli): inability to find user-emacs-directory (part 2)
I misunderstood the issue in 1081588. `user-emacs-directory` is never
nil, even in batch sessions. Instead, it is simply set to the wrong path
in cases where Doom is deployed to a non-standard location. It's needed
to change it there, but never in interactive sessions.

Fix: #6777
Amend: 108158876c
2022-09-17 15:29:18 +02:00
Henrik Lissner
1a6524cecc
nit: mention file-name-handler-alist optimization in lisp/doom.el 2022-09-17 15:29:18 +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
f5786a7284
docs: fix 3rd step indentation in "How to use profiles"
Not properly indented, so was treated as a sub-item of #2.
2022-09-17 12:11:05 +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
46527c0b85
fix(org): eldoc showing empty heading breadcrumbs
Fix: #6795
Amend: ab9896c526
2022-09-17 10:37:09 +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
6bd8cbf903
fix(vertico): relax doctor tests
consult--grep-lookahead-p throws an error if argv[0] can't be found, and
so will require if consult isn't installed (which would be redundant
with the package checks the doctor already does). To prevent misleading
backtraces here, I've suppressed the latter issue, but the former will
need attention later.
2022-09-16 17:33:44 +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
7ffe0df8eb
bump: :editor evil
edkolev/evil-lion@4da660e124 -> edkolev/evil-lion@a55eb64742
emacs-evil/evil-collection@6cc02b238c -> emacs-evil/evil-collection@665d5c99e2
emacs-evil/evil@157af04d2c -> emacs-evil/evil@26ec0cda1b
redguardtoo/evil-nerd-commenter@386cd758a4 -> redguardtoo/evil-nerd-commenter@b1a92221c9
2022-09-16 17:01:57 +02:00
Henrik Lissner
108158876c
fix(cli): inability to find user-emacs-directory
user-emacs-directory is nil in batch sessions, which early-init.el
wasn't expecting, which caused bin/doom to refuse to run out of a
non-standard location.

Fix: #6777
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
Gerry Agbobada
559229c250 fix(layout): Bépo rotation happening before magit
Fixes an issue where binding rotations in Bépo were happening too soon,
resulting in some remaps not being visible to the user when interacting
with magit, :editor evil +everywhere, and :input layout +bepo

Ref: https://discourse.doomemacs.org/t/layout-bepo-does-not-properly-remap-k-in-magit/3063
2022-09-16 13:15:46 +02:00
AlessandroW
d156e58577
fix(org): respect org-insert-heading-hook in +org--insert-item
Doom replaces `org-insert-heading`, but its replacement does not respect
`org-insert-heading-hook`. This commit fixes that, enabling folks to
customize their insert-heading behavior, e.g.  adding a time stamp:

  (defun my/org-set-creation-date-heading-property ()
    (save-excursion
      (org-back-to-heading)
      (org-set-property "CREATED" (format-time-string "[%Y-%m-%d %T]"))))
  (add-hook 'org-insert-heading-hook #'my/org-set-creation-date-heading-property)

Ref: https://git.savannah.gnu.org/cgit/emacs/org-mode.git/tree/lisp/org.el#n6187
Ref: https://git.savannah.gnu.org/cgit/emacs/org-mode.git/tree/lisp/org.el#n1615
2022-09-16 13:14:36 +02:00
Henrik Lissner
e1ef4cc001
fix(emacs-lisp): datatype error in fileless elisp buffers
Due to +emacs-lisp-non-package-mode assuming it would always execute in
a file-visiting buffer.

Fix: #6786
2022-09-16 13:07:28 +02:00
Henrik Lissner
f3ffb9e1e1
bump: :ui doom
doomemacs/themes@83fd9545c2 -> doomemacs/themes@535800fd6c

Improves Emacs 29 compatibility (see ref).

Ref: emacs-mirror/emacs@d0a66f3e0e
2022-09-16 13:07:28 +02:00
Henrik Lissner
67a42e8222
bump: :ui modeline
emacsorphanage/evil-anzu@d3f6ed4773 -> emacsorphanage/evil-anzu@d1e98ee697
seagle0128/doom-modeline@ce9899f00a -> seagle0128/doom-modeline@bed80b82d7

Also improves Emacs 29 compatibility (see ref).

Ref: emacs-mirror/emacs@d0a66f3e0e
2022-09-16 13:07:28 +02:00
Henrik Lissner
405f6cdd1e
fix: load-file-suffixes not being restored
This setting (along with load-file-rep-suffixes) is simplified at
startup to optimize file IO at startup, but it was supposed to be undone
at the end of doom-start (in doom-before-init-hook). Unfortunately, the
restoration hook was not reaching their top-level bindings, causing
dynamic modules (like vterm-modules.so) to fail to load.
2022-09-16 13:07:28 +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
511f0ca38f
fix(org): void-variable doom-user-dir on org-async export
This advice needed to be updated to reflect recent changes.

Fix: #6624
2022-09-16 03:17:46 +02:00
Henrik Lissner
e499e05ff3
fix(fold): void-function evil-define-key* error on Emacs 29 2022-09-16 03:17:46 +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