Commit Graph

105 Commits

Author SHA1 Message Date
Tim Ruffing
efe8d476bc fix(lib): use unibyte in binary temp buffers 2024-01-24 12:14:54 -05:00
Tim Ruffing
2b54b5732c docs(lib): improve docs of doom-file-read/-write 2024-01-24 12:14:54 -05:00
Henrik Lissner
88c59129ec
fix(lib): doom/bumpify-diff: skip non-package! forms
Would formerly error out if it tries to read invalid forms in misc files
included in bump commits.
2023-11-29 23:14:11 -05:00
Liam Hupfer
4b81a70aff nit(docs): fix typo and extraneous backquote 2023-09-20 20:23:26 +02:00
Henrik Lissner
88bb045388
docs(*): replace all-the-icons with nerd-icons
Also colorizes the leading icon in notices.
2023-09-16 20:19:11 +02:00
Ellis Kenyő
e97b05c07c
fix: nerd-icons-material => nerd-icons-mdicon
Fix: #7422
Amend: #7411
2023-09-14 14:58:01 +02:00
Ellis Kenyő
9787022b83
refactor!: replace all-the-icons with nerd-icons
BREAKING CHANGE: This commit replaces all-the-icons with nerd-fonts. Any
all-the-icons-* function calls or variable references in your private
config will break and should be replaced with their nerd-icons-*
equivalent. That said, Doom will continue to install all-the-icons for
a while, so feel free to load it if you don't want to fully commit to
the change yet.

This change is happening because nerd-icon has wider support for GUI and
TUI Emacs; has a larger, more consistent selection of symbols; plus unicode
coverage.

Fix: #7368
Close: #6675
Close: #7364
2023-09-14 01:03:55 +02:00
Henrik Lissner
af8ec870ac
fix(lib): 'back to *' links in doom-docs 2023-09-12 21:30:56 +02:00
Henrik Lissner
7f3d5d54bd
refactor(lib): hoist new org-id-locations-file value 2023-09-11 23:53:35 +02:00
Henrik Lissner
75d4046820
fix(lib): doom/reload-docs: `org-id-get' warnings
Prevents '`org-id-get' expects a file-visiting buffer' warnings in some
in-repo org files.
2023-09-11 23:53:35 +02:00
Henrik Lissner
deb83dc6a9
fix(lib): doom-docs-mode: hiding property drawers
Includes a minor optimization: reading the current level from an
org-element object, rather than relying on (org-current-level), which
resorts to walking the buffer with regex.
2023-09-11 23:53:35 +02:00
mosquito-magnet
f4e74e17ad
fix(lib): doom/help-packages: handle missing homepage
When a package is added via straight local-repo, no homepage can be
determined. Prevent doom--help-insert-button throwing an error in this
case.
2023-09-06 14:40:07 +02:00
Henrik Lissner
af5add0e9e
merge: pull request #7389 from hpfr/misc 2023-09-06 14:28:57 +02:00
StrawberryTea
3cafa0223e
fix(org): check org-fold-outline in invisible property
Fix: #7206
2023-09-06 14:27:35 +02:00
Liam Hupfer
088bd387f6 tweak(lib): add alpha-background support to opacity setter
This is preferred when available because it does not affect foreground
content like text and images.

Ref: https://git.savannah.gnu.org/cgit/emacs.git/tree/etc/NEWS?h=emacs-29.1#n801
2023-09-02 12:27:37 -05:00
Jacob
5155f4aa78
fix(lib): unquote base-directory in project-file-exists-p!
Fix: #7356
Amend: b1cc719063
2023-08-19 22:57:32 +02:00
Jeetaditya Chatterjee
09504ef9fe feat: ask before quickloading a session 2023-08-18 19:20:01 +02:00
Henrik Lissner
b1cc719063
feat(lib): add base-directory arg to project-file-exists-p!
I also revise its docstring.

Ref: #7333
Co-authored-by: LemonBreezes <LemonBreezes@users.noreply.github.com>
2023-08-18 19:04:25 +02:00
Henrik Lissner
1cd2a287f5
nit: comment revision, spellcheck, & reformatting
Close: #7262
Co-authored-by: emergenz <emergenz@users.noreply.github.com>
2023-07-22 19:01:35 +02:00
Ta Quang Trung
7cd0b87cd6
fix(lib): doom-region-*: only use evil visual range in visual mode
evil-visual-{beginning,end} contains stale ranges in non-evil states (like evil-emacs-state).
2023-07-22 16:18:56 +02:00
Peter Hoeg
12dfc62ae5
fix(lib): doom-system-distro-version: check nixos-version first
Even if a NixOS machine has lsb_release in its PATH, lsb_release will be used
instead of nixos-version to determine the distro version.
2023-07-22 16:16:09 +02:00
Itai Y. Efrat
e5dbd4e8b1 bump: :completion vertico compat
iyefrat/all-the-icons-completion@4da28584a1 -> iyefrat/all-the-icons-completion@b08f053cee
minad/consult@ffaaf6da90 -> minad/consult@052399ed05
minad/marginalia@ccf573e214 -> minad/marginalia@2633b2dee2
minad/vertico@6f22ff1298 -> minad/vertico@b6b8420d29
oantolin/embark@5497a19eef -> oantolin/embark@3ffb27a833
oantolin/orderless@d09aab3795 -> oantolin/orderless@e678402671
tumashu/vertico-posframe@f57b170b43 -> tumashu/vertico-posframe@7da6d648ff
emacs-compat/compat@38280a7b54 -> emacs-compat/compat@7775c31857

---

consult--grep added support for searching in multiple directories, so we
can drop the advice in `doom--help-search`. The other changes just adapt
to upstream API changes.
2023-03-22 16:35:07 -04:00
Henrik Lissner
1af08011df
fix(lib): doom/help-modules: omit nil in module list
Some psuedo module categories (like :core and :user) don't have a module
component. Rather than display them as ':core nil' or ':user nil' in
module listings (like doom/help-modules), omit the nil entirely.
2023-03-20 20:43:32 -04:00
Henrik Lissner
382058e1e6
fix(debug): doom-info: improve git error
In case Doom has been deployed without git (for some reason), or with an
unconventional structure.
2023-03-20 20:43:28 -04:00
Itai Y. Efrat
f5f9c7222a fix(lib): letf! in doom--help-search
Slipped by manual testing due to consult not being loaded at the time
and doom--help-search going to default grep-find usage instead of
hitting the failiure.

Amend: 54c4340740
2023-02-24 16:06:38 -05:00
Henrik Lissner
8f50ead5c8
fix(lib): doom/bumpify-diff: remove duplicates 2023-02-21 19:37:16 -05:00
TEC
33af29f7d5 feat(docs): use header-line for header info 2023-02-21 18:35:15 -05:00
Henrik Lissner
d24e197964
fix(lib): doom/bumpify-diffs missing packages
This command would skip over consecutive package! statements in the
generated commit message. This commit fixes that.

That said, this command is still a temporary measure until formal bump
CI/CD is done, but should make dealing with doom/bumpify-diffs and
doom/commit-bumps a little less painful.
2023-02-21 00:35:17 -05:00
Alexey Nesterov
06c794faf5
fix(lib): don't overwrite kill-ring on doom/backward-kill-word
When calling backward-kill-word (which is in turn is calling kill-new),
not only kill-ring variable should be overridden, but also
kill-ring-yank-pointer.

Otherwise when deleting a word backwards, kill-ring pointer is moved and
next yank will insert (not so expected) rubbish.
2023-02-20 20:21:59 -05:00
Henrik Lissner
2c652259a5
tweak(lib): open file after doom/copy-this-file
As mentioned in #6964, it's rare for anyone to want to copy a file
without opening the new file.

Close: #6964
2023-02-18 15:27:48 -05:00
Itai Y. Efrat
54c4340740 fix(lib): consult case of doom--help-search
advise consult--ripgrep-make-builder instead of reimplementing
2023-02-17 12:34:26 -05:00
Ivan
850907ed9a
fix(lib): doom/delete-this-file nil path handling
Fix the handling of a nil path within doom/delete-this-file.

If path is nil (e.g. called interactively when buffer is not visiting a
file), avoid calling abbreviate-file-name on nil, otherwise an error
will be signaled:

  (wrong-type-argument stringp nil)

Additionally, fix the subsequent path checks. These were treating two
distinct scenarios as a "Buffer is not visiting any file" user-error:

- nil path
- non-existent path
- Only the first should result in that error. The second should proceed
  to the next path check (which was previously unreachable), to signal
  the appropriate error, "File doesn't exist: %s".
2022-09-30 22:48:59 +02:00
Henrik Lissner
95bdc3b566
fix(lib): doom/reload-*: void-function doom-with-context
This macro used to be `doom-with-context`, but was renamed in the middle
of backporting f9201eb218, but these references were missed.

Fix: #6849
Amend: f9201eb218
2022-09-26 12:06:42 +02:00
Henrik Lissner
39b8934236
fix(lib): package! error from doom/bump-* commands
package! complains that "package! can only be used in packages.el
files".

Amend: 4efaf6837b
Amend: f9201eb218
2022-09-25 19:18:05 +02:00
Henrik Lissner
d362490d45
fix(docs): if doom-emacs-dir doesn't end w/ slash
Doom is slowly transitioning away from requiring that its doom-*-dir
variables end in a slash (see two refs below), but there are some
vestiges of it left. This is one of them.

Fix: #6842
Ref: 00e8f6b72a
Ref: b914830403
2022-09-25 18:21:32 +02:00
ivanbrennan
2bb7e8d018 fix(lib): doom-info symlink-path
The `if` clauses were swapped, such that a non-symlinked path was shown
like,

  ~/.config/emacs/ -> ~/.config/emacs/

and a symlinked path was shown as,

  ~/.config/emacs/
2022-09-25 18:18:00 +02:00
Henrik Lissner
2645ed491b
perf: autoloads: remove definition-prefixes & abbreviate paths
Reduces the file size of the autoloads path by ~5%, memory usage by ~7%,
and buys around ~30-50ms in startup time.
2022-09-25 17:52:07 +02:00
Henrik Lissner
4efaf6837b
refactor: introduce doom-module-context
Where f9201eb introduced a general context system, this one introduces
one for modules, to simplify our let-bind game when interacting with
modules, and to more efficiently expose module state to modulep! (which
gets called at runtime a great deal, so its performance is important).

* lisp/doom-lib.el (doom-log): simplify macro and introduce
  doom-inhibit-log variable.
* lisp/doom-modules.el (modulep!): fix reported file path if modulep!
  fails to find the local module.
* lisp/lib/debug.el (doom-debug-variables): disable doom-inhibit-log
  when debug mode is on.

Ref: f9201eb218
2022-09-24 22:09:46 +02:00
Henrik Lissner
f9201eb218
refactor: introduce doom-context
Introduces a system to announce what execution contexts are active, so I
can react appropriately, emit more helpful logs/warnings in the case of
issues, and throw more meaningful errors.

* bin/doom: load module CLIs in the 'modules' context.
* lisp/cli/doctor.el: load package files in 'packages' context.
* lisp/doom-cli.el:
  - (doom-before-init-hook, doom-after-init-hook): trigger hooks at the
    correct time. This may increase startup load time, as the benchmark
    now times more of the startup process.
  - (doom-cli-execute, doom-cli-context-execute,
    doom-cli-context-restore, doom-cli-context-parse,
    doom-cli--output-benchmark-h, doom-cli-call, doom-cli--restart,
    doom-cli-load, run!): remove redundant context prefix in debug logs,
    it's now redundant with doom-context, which doom-log now prefixes
    them with.
* lisp/doom-lib.el (doom-log): prefix doom-context to doom-log output,
  unless it starts with :.
* lisp/doom-packages.el (package!, doom-packages--read): throw error if
  not used in a packages.el file or in the context of our package
  manager.
* lisp/doom-profiles.el (doom-profile--generate-init-vars,
  doom-profile--generate-load-modules): use modules doom-context instead
  of doom-init-time to detect startup.
* lisp/doom-start.el (doom-load-packages-incrementally-h): move function
  closer to end of doom-after-init-hook.
* lisp/doom.el:
  - (doom-before-init-hook, doom--set-initial-values-h,
    doom--begin-init-h): rename doom--set-initial-values-h to
    doom--begin-init-h and ensure it runs as late in
    doom-before-init-hook as possible, as that is the point where Doom's
    "initialization" formally begins.
  - (doom-after-init-hook): don't trigger at the end of command-line-1
    in non-interactive sessions. This will be triggered manually in
    doom-cli.el's run!.
* lisp/lib/config.el (doom/reload, doom/reload-autoloads,
  doom/reload-env): use 'reload' context for reload commands.
* modules/lang/emacs-lisp/autoload.el (+emacs-lisp-eval): use 'eval'
  context.
* modules/lang/org/config.el: remove doom-reloading-p; check for
  'reload' doom context instead.
2022-09-24 22:09:05 +02:00
Henrik Lissner
6c76b98dbb
refactor: use doom-module-*-file variables; add two
- Adds doom-module-packages-file and doom-module-metadata-file.
- Uses them and the other doom-module-*-file variables where they were
  previously hardcoded.
- Add .el extension to doom-module-{init,config}-file; it is now the
  consumer's responsibility to strip/change/keep the extension as they
  see fit.
2022-09-24 20:31:34 +02:00
Henrik Lissner
5a5195b84d
fix: add :depth field to modules
This introduces a depth field for modules so that they may dictate their
load order explicitly, it also treats depths <= -100 or >= 100 as
special depths, which will be loaded early, before their respective
doom-{before,after}-module-{init,config}-hook. This permits psuedo
modules like :core and :user modules to be treated as normal modules
without too many special cases.

This also fixes a module load order issue on Emacs 29 (#6813), caused by
emacs-mirror/emacs@4311bd0bd7, which changed the return value order of
hash-table-{keys,values} causing modules to be loaded in reverse order;
resulting in the loss of evil keybinds, among other things.

Other notable changes:
- Changes the data structure for module data caches from a list to a
  vector. Uses less memory and permits faster lookups. Also adds two
  depth fields to the front of it.
- Changes the signature of doom-module-list and doom-package-list.
- Renames doom--read-packages -> doom-packages--read for consistency
  with naming convention.
- Add doom-module-depth function.
- Adds a temporary doom-core-dir/init.el file, which is responsible for
  loading doom-*.el.

Fix: #6813
Ref: emacs-mirror/emacs@4311bd0bd7
2022-09-24 18:46:21 +02:00
Henrik Lissner
7a81b0252f
fix(lib): doom/help-search-{load-path,loaded-files}
And updates them to reflect upstream changes to the consult--grep API.

Ref: c994e3ed59
2022-09-20 02:29:08 +02:00
Henrik Lissner
024048dd5e
perf: disable autoload-compute-prefixes & optimize var cache
- Batch more variables in Doom's autoloads files.
- Remove all the register-definition-prefixes calls generated in
  autoloads files (for both modules' and packages' autoloads). These
  don't serve much purpose, and only incur added cost growing a large
  hash table.
2022-09-20 01:43:33 +02:00
Henrik Lissner
46d99917ba
fix(cli): debug output despite no debug-mode
Let's not fall back on original `message` function, at the end of
`with-output-to!`s advice stack.
2022-09-19 17:33:25 +02:00
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
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
b804a2f34f
refactor(lib): convert cli/autoloads.el to lib 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