Commit graph

153 commits

Author SHA1 Message Date
Henrik Lissner
dcae7187b4
refactor(lib): doom-info & remove unused commands
- Simplify doom-info and doom/info.
- Remove doom/copy-buffer-contents (may be moved later, but atm not very
  useful).
- Remove doom/am-i-secure (this will later be replaced with CLI
  commands)
2022-03-30 17:32:47 +02:00
Henrik Lissner
2aeca577c8
refactor: correct version variables
These two variables have been the wrong way around for a while. In
preparation for splitting Doom into separate repos (its core and module
libraries), I've corrected them. doom-modules-version is a placeholder
and will be removed later.

I've also settled on -dev suffix for inter-release versions of Doom,
rather than alpha.
2022-03-21 03:57:31 +01:00
Henrik Lissner
319665bbdc
feat(lib): time stamp *Messages* lines
...when doom-debug-mode is active.
2022-03-21 03:57:03 +01:00
Henrik Lissner
39886536c3 fix(lib): incorrect &user markers in doom-info
M-x doom/info marks modules that live in $DOOMDIR with &user, but what
if the user has moved their ~/.emacs.d into $DOOMDIR? As this seems to
happen often with Chemacs users, I've made this check a little more
procise.
2022-02-10 21:07:20 +01:00
Henrik Lissner
2d7e0c90ba refactor(lib): add Emacs version to doom/version 2022-01-27 03:43:51 +01:00
Henrik Lissner
68d8364aea refactor: adopt CalVer and reorganize core.el
Doom is adopting CalVer (starting at 21.12) and, later, I'll move Doom's
core out to a separate repo, where it'll stay with SemVer (starting at
3.0).
2021-10-10 18:36:46 +02:00
Henrik Lissner
fe9d45bcf5 Add/Fix doom/{discourse,issue-tracker,report-bug}
Updated their URLs
2021-05-20 21:09:32 -04:00
Henrik Lissner
fdfd60dbad Don't call uname on Windows for doom/info
Mentioned in #5022
2021-05-10 04:46:14 -04:00
Henrik Lissner
5d7526a224 doom-info: rename distro->system & add window-system 2021-05-06 04:27:33 -04:00
Henrik Lissner
45147aace8 Refactor doom-debug-mode
Store intiial value in symbol plist instead. More info in 8ec8b2b.
2021-05-06 04:27:33 -04:00
Henrik Lissner
ff64a9d106 Add doom-run-hooks
Produces more helpful (and harder-to-miss) error messages when a hook
emits an error. Also advises run-hook when doom-debug-mode is active, so
errors in hooks (generally, major mode hooks) don't quietly go
unnoticed.
2021-05-06 04:27:33 -04:00
Henrik Lissner
2ef54eb782 Fix void-variable emacs-repository-branch in doom-info
Seems this var doesn't exist in some Emacs builds?
2021-04-29 17:24:40 -04:00
Henrik Lissner
6e49cb5ce2 Reduce false positive symlinks in doom/info {emacs,doom}dir 2021-04-17 23:26:27 -04:00
Henrik Lissner
233fd93b65 Add custom-file trait & custom-vars list to doom/info
So I can tell if users may have a custom.el where something may be
inadvertently saved.
2021-04-17 23:26:27 -04:00
Henrik Lissner
079feb26e4 Left align fields in doom-info
The leading whitespace can cause issues with some whitespace trimming
clipboard managers and <pre> blocks.
2021-04-14 23:31:13 -04:00
Henrik Lissner
ce65645fb8 Minor refactors & comment revision 2021-03-27 18:27:19 -04:00
Henrik Lissner
ea105b874e Toggle async-debug on doom-debug-mode 2021-03-12 22:58:15 -05:00
Henrik Lissner
2e1c10a6a4 Move sandbox code into own library 2021-03-12 22:58:15 -05:00
Henrik Lissner
abec86310b Fix #4777: wrong-type-argument listp unpin error 2021-03-11 10:57:41 -05:00
Henrik Lissner
ab7710adfd doom-info: fix args-out-of-range error 2021-03-08 10:25:09 -05:00
Henrik Lissner
4192d87dcd Redesign doom/info
+ Focus on the important information and cut down on excess.
+ Prompt the user to open pastebin.com after copying doom-info to
  clipboard.
+ Include timestamp in doom-info.
2021-03-07 00:03:04 -05:00
Henrik Lissner
c5e3f4d632 New autoload/system.el core library 2021-03-01 22:27:17 -05:00
Henrik Lissner
1a7536cbd1 Extend & compact doom/info
+ Output is now a couple lines shorter
+ Now tries to guess Linux distro names and versions
+ Displays symlinked EMACSDIR and DOOMDIR
+ Replaces elc-files segment with 'byte-compiled-config trait
2021-02-11 17:35:48 -05:00
Henrik Lissner
fc184852d0
Only replace usernames in file paths in doom/info 2021-01-11 02:49:00 -05:00
Henrik Lissner
b7f6532e4f
Fix startup hooks not running in vanilla sandbox 2020-12-01 18:16:12 -05:00
Henrik Lissner
affd076d53
Minor refactors & reformatting 2020-12-01 13:53:46 -05:00
Henrik Lissner
2c663ea5d4
Mention current theme and font in doom/info 2020-11-10 18:36:47 -05:00
Henrik Lissner
45179fbf59
Mention current frame type in doom/info 2020-11-10 18:36:47 -05:00
Henrik Lissner
611fdade09
Add doom/copy-buffer-contents command
To make it easier for beginners to copy content from logs or backtrace
windows.
2020-11-04 19:41:57 -05:00
Henrik Lissner
3e0432959a
Set user-init-file in sandbox 2020-11-02 21:03:28 -05:00
Henrik Lissner
fe37a590cc
Set doom--initial-load-path in sandbox
Prevents loaded packages miscount (e.g. -1) in dashboard/log in sandbox
instance.

This occurs because the benchmark line uses a simple heuristic to
determine the loaded packages: length of load-path minus the length of
doom--initial-load-path (to save on more expensive counting methods).
However, in the sandbox, load-path is pre-populated with all packages
right from the get-go, so doom--initial-load-path will be incorrect.
2020-10-26 05:52:30 -04:00
Henrik Lissner
9e1ac0c0be
Reduce active message-log-max; scale in debug mode
8kb of log isn't really necessary. We'll scale it up when debug mode is
on, instead.
2020-10-26 05:51:12 -04:00
Henrik Lissner
9b4fd806bb
Simplify doom/info output 2020-10-20 23:21:11 -04:00
Henrik Lissner
db07304c71
Don't enable explain-pause-mode at startup
When starting Emacs in debug mode, explain-pause-mode is enabled. This
pulls in other packages with it, which can taint results when testing
package load order. Also, explain-pause-mode is for measuring pauses
during interactive use, it isn't very useful for startup benchmarking.

So we only toggle it if doom-debug-mode is toggled interactively.
2020-10-11 16:41:07 -04:00
Henrik Lissner
b29b865d30
Fix #3975: configure native-comp in sandbox 2020-10-06 02:08:17 -04:00
Henrik Lissner
3cb7458d34
Fix #4033: correctly toggle explain-pause-mode
On doom-debug-mode.
2020-10-05 23:02:36 -04:00
Henrik Lissner
ae3a2fa8c2
doom-info: use &nopath prefix for 404'd modules
The alternative is a stringp error.
2020-09-02 14:23:11 -04:00
Henrik Lissner
5c6189fb4e
Simplify doom/version output
Only really needs to output Doom's version and build info.
2020-08-24 23:00:32 -04:00
Henrik Lissner
7e362e8fbd
Redesign doom/info
+ Replace "daemonp" and "windowsys" fields with "traits" field, which
  can now indicate the presence of: Chemacs, exec-path-from-shell,
  symlinked EMACSDIR/DOOMDIR, a running server, the daemon and an envvar
  file.
+ Now replaces $USER in absolute paths with literal "$USER".
+ Reordered fields from most to least general (system -> emacs -> doom)
+ Show "&user" next to modules that are private modules (defined in
  ~/.doom.d/modules/)
2020-08-24 22:27:40 -04:00
Henrik Lissner
4e82ee4397
Refactor doom-debug-mode
+ Add explain-pause-mode
+ Now reloads itself if doom-debug-variables is changed or when one of
  its variables becomes available.
+ doom-debug-variables now supports a cons cell entry where its CAR is
  the name of the variable and CDR is the value it should be set to when
  doom-debug-mode is active.
2020-08-21 01:26:24 -04:00
Henrik Lissner
b5706c5793
Fix inverted on/off message from doom-debug-mode 2020-08-06 00:22:40 -04:00
Henrik Lissner
a9bf0b8985
Add cmd!, cmd!!, cmds! convenience macros
It's kind of silly that our command lambda macros (λ! and λ!!) need a
snippet, special key sequence or copy-paste to insert, so in the spirit
of fn! -- and to make sure they take up less space than `lambda!` --
I've added `cmd!` and `cmd!!` aliases. `lambda!` and `lambda!!` are now
deprecated. λ! and λ!! will remain.

I've also added `cmds!` as a convenience wrapper around
general-predicate-dispatch.
2020-05-27 18:29:35 -04:00
Henrik Lissner
3253ca8435
Minor refactors & comment/message revision 2020-05-25 22:11:15 -04:00
Henrik Lissner
d1fcbf244b
doom/toggle-debug-mode -> doom-debug-mode 2020-05-25 20:18:36 -04:00
Henrik Lissner
cc5f498586
Add magic cli.el in modules & refactor module init
Doom now looks for cli.el files in your private directory or modules,
giving them an opportunity to customize the CLI (add commands or
reconfigure existing ones) to suit their purposes.
2020-05-25 15:55:28 -04:00
Henrik Lissner
3a38fc633c
Change doom-{interactive,debug}-mode suffix to -p
Because these are not really modes.

Also makes `doom-debug-mode` an actual (global) minor mode.
2020-05-25 03:43:40 -04:00
Henrik Lissner
0e851ace9b
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.

Fixes #2802, #2737, #2386

The big highlights are:

- Fix #2802: We now update recipe repos *before* updating/installing any
  new packages. No more "Could not find package X in recipe repositories".

- Fix #2737: An edge case where straight couldn't reach a pinned
  commit (particularly with agda).

- Doom is now smarter about what option it recommends when straight
  prompts you to make a choice.

- Introduces a new init path for Doom. The old way:
  - Launch in "minimal" CLI mode in non-interactive sessions
  - Launch a "full" interactive mode otherwise.
  The new way
  - Launch in "minimal" CLI mode *only* for bin/doom
  - Launch is a simple mode for non-interactive sessions that still need
    access to your interactive config (like async org export/babel).
  - Launch a "full" interactive mode otherwise.

  This should fix compatibility issues with plugins that use the
  async.el library or spawn child Emacs processes to fake
  parallelization (like org's async export and babel functionality).

- Your private init.el is now loaded more reliably when running any
  bin/doom command. This gives you an opportunity to configure its
  settings.

- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
  deferred activation of a number of packages. Users can remove these
  modes from these hooks; altogether preventing them from loading,
  rather than waiting for them to load to then disable them,
  e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
  'doom-first-buffer #'smartparens-global-mode)

  Hooks added to doom-first-*-hook variables will be removed once they
  run.

  This should also indirectly fix #2386, by preventing interactive modes
  from running in non-interactive session.

- Added `doom/bump-*` commands to make bumping modules and packages
  easier, and `doom/bumpify-*` commands for converting package!
  statements into user/repo@sha1hash format for bump commits.

- straight.el is now commit-pinned, like all other packages. We also
  more reliably install straight.el by cloning it ourselves, rather than
  relying on its bootstrap.el.

  This should prevent infinite "straight has diverged from master"
  prompts whenever we change branches (though, you might have to put up
  with it one more after this update -- see #2937 for workaround).

All the other minor changes:

- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
  simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
  already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
  trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
  doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
  1. Child instances will no longer inherit the process environment of
     the host instance,
  2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-15 01:33:52 -04:00
Henrik Lissner
d12752324a
Introduce letf! convenience macro
A more succinct cl-letf, which allows for local functions and macros.
2020-04-29 23:48:21 -04:00
Vu Quoc Huy
9709d257d9 Fix TLS error caused by #2763
Check whether the current gnutls library supports tls1.3
Add more tests for `doom/am-i-secure`
2020-03-28 02:24:12 +01:00
Henrik Lissner
8f68237e8b
Don't pretty-print doom/info's packages section
Your doom/info should be a compact summary of your config. Pretty
printing the packages listing vertically consumed too much space.
2020-03-10 23:54:07 -04:00