Commit graph

13 commits

Author SHA1 Message Date
Henrik Lissner
7e7d8ebdfd
fix(lib): print!: don't resolve printed symlinks 2024-06-22 18:14:05 -04:00
Henrik Lissner
703173a6d2
feat(lib): doom-print: allow lexical redirection 2024-06-22 18:14:05 -04:00
Henrik Lissner
8d50cd8bfb
tweak(lib): print!: join (path ...) segments 2024-03-24 18:09:54 -04: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
26914d0369
refactor(lib): use ansi-color-apply
Rather than reimplement its face lookup (and have two versions of
doom-print-ansi-alist -- one for 27.x and one for 28+), let's just rely
on ansi-color.
2022-09-16 01:14:21 +02:00
Henrik Lissner
b7bd27d22b
refactor(cli,lib): print levels & output redirection
This refactors how Doom captures and redirects its output (to stdout and
stderr) into a more general with-output-to! macro, and:

- Simplifies the "print level" system. The various doom-print-*-level
  variables have been removed.
- Adds a new print level: notice, which will be the default level for
  all standard output (from print!, doom-print, prin[ct1], etc).
- Adds a with-output-to! macro for capturing and redirecting
  output to multiple streams (without suppressing it from stdout). It
  can also be nested.
- Changes the following about doom-print:
  - Default :format changed to nil (was t)
  - Default :level changed to t (was `doom-print-level`)
  - No longer no-ops if OUTPUT is only whitespace
2022-09-16 01:14:20 +02:00
Ivan
6af7338140
refactor(lib): remove unreachable code in doom-print-class-alist
An earlier element in this alist associates buffer with
doom-print--buffer, so this later element is unreachable.
2022-09-10 23:51:40 +02:00
Henrik Lissner
d290152a8e
refactor(lib): replace doom-debugger with advice
Writing a debugger for Elisp is too much hassle. `debug` itself isn't
very customizable without a *lot* of boilerplate, so instead of writing
my own, it's more effective to advise debug instead. Certainly, I don't
do anything with it yet, but I will soon.
2022-09-10 18:36:24 +02:00
Henrik Lissner
b121c5e1c6
refactor(lib): provide doom-libs as subfeatures
This allows us to load them via doom-require. Why not use normal
features? Because Doom's libraries are designed to be loaded as part of
Doom, and will openly rely on Doom state if needed; this is a contract I
want to enforce by ensuring their only entry points are through
`doom-require` or autoloading.

I will add them to the rest of the libraries later.

Site-node: this also adds Commentary+Code to the comment headings, as I
want a space to use that space to describe the library, when I get
around to it.
2022-09-08 00:20:26 +02:00
Henrik Lissner
2b1f6031b2
refactor(lib): rely less on global state for defaults
I prefer to be more explicit about these variables' defaults, then to
rely on proper load order and unverified global state to ensure they're
properly set.
2022-09-06 23:51:44 +02:00
Henrik Lissner
0a51fdff53
refactor(lib): move doom-log to doom-lib
This is such an essential macro that it should be universally available,
and not stowed away in the print library.
2022-09-06 23:46:42 +02:00
Henrik Lissner
55736ac2a6
fix(lib): prevent autoload failure at startup
In some edge cases, an early call to doom-log will cause an autoload
error because of one or more of the following is true:

- The autoloads file hasn't been generated or loaded,
- The autoloads file is out of date (especially relevant after
  b9933e6),
- doom-cli hasn't loaded lib/files eagerly yet.

To avoid this, and due to how prolific doom-log's uses are, and how
trivial the dependency is, I simply remove the dependency.

Amend: b9933e6637
2022-07-31 13:31:21 +02:00
Henrik Lissner
b9933e6637
refactor!: restructure Doom core
BREAKING CHANGE: This restructures the project in preparation for Doom
to be split into two repos. Users that have reconfigured Doom's CLI
stand a good chance of seeing breakage, especially if they've referred
to any core-* feature, e.g.

  (after! core-cli-ci ...)

To fix it, simply s/core-/doom-/, i.e.

  (after! doom-cli-ci ...)

What this commit specifically changes is:
- Renames all core features from core-* to doom-*
- Moves core/core-* -> lisp/doom-*
- Moves core/autoloads/* -> lisp/lib/*
- Moves core/templates -> templates/

Ref: #4273
2022-07-30 22:41:13 +02:00
Renamed from core/autoload/print.el (Browse further)