Commit Graph

128 Commits

Author SHA1 Message Date
a7ce48c2df bin/doom: add -l/--local/DOOMLOCALDIR
Will come in handy for the new testing framework.
2019-07-22 02:37:48 +02:00
060ede0e2e General, minor reformatting across the board
And an offering of blood to our great lord Byte Compiler-sama.
2019-07-22 02:37:45 +02:00
b90dede1ab 💥 Replace package.el/quelpa with straight #374
There are a few kinks to iron out, but for the most part it's done. Doom
Emacs, powered by straight. Goodbye gnutls and elpa/quelpa issues.

This update doesn't come with rollback or lockfile support yet, but I
will eventually include one with Doom, and packages will be (by default,
anyway) updated in sync with Doom.

Relevant threads: #1577 #1566 #1473
2019-07-22 02:30:40 +02:00
987061aedd Rewrite autoload/message.el & move to format.el
Adds new convenience macros like print! and insert!, and adds classes;
which are helper functions that can be called inline within format!,
print! et co, e.g.

  (format! "%s" (filename "/tmp/some/file")) ; => file
  (format! "%s" (relpath "/tmp/some/file" "/tmp")) ; => some/file
  (format! "%s" (dirname "/tmp/some/file")) ; => /tmp/some

Check out doom-format-class-alist for more.
2019-07-22 02:30:39 +02:00
149b2617b0 💥 revise hook/var fns naming convention (2/2)
This is second of three big naming convention changes. In this commit,
we change the naming conventions for hook functions and variable
functions:

1. Replace the bar | to indicate a hook function with a -h suffix, e.g.

     doom|init-ui -> doom-init-ui-h
     doom|run-local-var-hooks -> doom-run-local-var-hooks-h

2. And add a -fn suffix for functions meant to be set on variables,
   e.g.

     (setq magit-display-buffer-function #'+magit-display-buffer-fn)

See ccf327f8 for the reasoning behind these changes.
2019-07-22 02:30:38 +02:00
51d3b1b424 💥 revise advice naming convention (1/2)
This is first of three big naming convention updates that have been a
long time coming. With 2.1 on the horizon, all the breaking updates will
batched together in preparation for the long haul.

In this commit, we do away with the asterix to communicate that a
function is an advice function, and we replace it with the '-a' suffix.
e.g.

  doom*shut-up -> doom-shut-up-a
  doom*recenter -> doom-recenter-a
  +evil*static-reindent -> +evil--static-reindent-a

The rationale behind this change is:

1. Elisp's own formatting/indenting tools would occasionally struggle
   with | and * (particularly pp and cl-prettyprint). They have no
   problem with / and :, fortunately.
2. External syntax highlighters (like pygmentize, discord markdown or
   github markdown) struggle with it, sometimes refusing to highlight
   code beyond these symbols.
3. * and | are less expressive than - and -- in communicating the
   intended visibility, versatility and stability of a function.
4. It complicated the regexps we must use to search for them.
5. They were arbitrary and over-complicated to begin with, decided
   on haphazardly way back when Doom was simply "my private config".

Anyhow, like how predicate functions have the -p suffix, we'll adopt the
-a suffix for advice functions, -h for hook functions and -fn for
variable functions.

Other noteable changes:
- Replaces advice-{add,remove}! macro with new def-advice!
  macro. The old pair weren't as useful. The new def-advice! saves on a
  lot of space.
- Removed "stage" assertions to make sure you were using the right
  macros in the right place. Turned out to not be necessary, we'll
  employ better checks later.
2019-07-22 02:27:45 +02:00
7900d8a10e bin/doom-doctor: fix void-variable it error 2019-07-13 23:39:31 +02:00
d9f4b13d78 doctor: fix false positive missing packages #1544 2019-07-09 02:19:35 +02:00
710a18d18a Fix #1501: fix sh function
`format` is variadic
2019-06-18 22:09:28 +02:00
798e10c4f2 Refactor doom doctor
And move font check into core/doctor.el
2019-06-18 17:29:50 +02:00
6641e26283 Refactor package management API
Sets out to solve a number of issues with the package management
process. Namely:

- To-be-removed packages that are simply being removed are no longer
  incorrectly labeled "quelpa->elpa", but "removed" instead.
- A backend (elpa vs quelpa) column was added to the package listing
  confirmation when running `doom update`.
- Doom now correctly recognizes that packages installed with a psuedonym
  are installed, and will not endlessly attempt to uninstall and
  reinstall them on every `doom refresh`.
- Packages declared with :built-in will no longer lose their built-in
  marking if said package is not actually present in Emacs' site load
  paths. i.e. if you say it's built in, Doom won't question it.
- package!'s :ignore property is now treated as a form whose evaluated
  result will be used as its value.
2019-06-11 08:01:42 +02:00
5a380e9db2 fix shebang for doctor, org-capture and -tangle 2019-06-08 07:27:36 +02:00
9236999df1 fix shebang 2019-06-08 07:13:19 +02:00
d2d7f7330e bin/org-tangle POSIX compliance 2019-06-03 21:31:15 +10:00
cbe11ae926 bin/org-capture POSIX compliance 2019-06-03 21:21:11 +10:00
944e243c5d bin/doom-doctor POSIX compliance 2019-06-03 21:17:53 +10:00
902f734cfb bin/doom POSIX compliance 2019-06-03 21:16:11 +10:00
89b20d71ce doom-doctor: prevent errors we don't care about 2019-05-05 14:21:44 -04:00
6b69eaa397 Minor refactors across the board 2019-04-26 17:42:44 -04:00
9bea168cc1 Rewrite doom-doctor
- Use message library instead of reinventing the wheel
- Fix -d/--debug support for `bin/doom doctor`
- Add indent and autofill support to print! and format!
- Add doom-message-backend for forcing format! to use a specific backend
- Phase out anaphoric when! macro in doctor scripts, it was hardly used
2019-04-24 18:16:05 -04:00
0caf0abcbb Major refactor of the Doctor
- Reorganize tests into logical groups
- Report Doom initialization with more granularity
- Make better use of whitespace and indentation in output
- Use backquotes for quoting symbols in pcase (for backward
  compatibility)
- Initialize Doom completely and manually (less maintanence headache and
  more certain to work across Doom updates).
2019-04-19 13:31:27 -04:00
6afc8e5563 Add stale elc check to doctor
And short-circuit internal checks if Doom fails to load.
2019-04-17 18:38:02 -04:00
20a63a35ab Reformat doctor output & add DOOMDIR check
- Will now warn you if both .doom.d and .config/doom exists.
- Include branch and last commit date in doctor/info, next to Doom
  version.
- Issues in Doom core are now indented.
2019-04-16 20:57:03 -04:00
f37b1342a2 Don't show hostname in doom info or doctor output
It doesn't help me, and some folks may not want it publicized.
2019-04-16 20:57:03 -04:00
54d180b376 Ensure user-emacs-directory in doctor
Also allow it to be customized with EMACSDIR envvar
2019-04-15 03:47:24 -04:00
348ba8f7d0 Correct type in bin/doom help 2019-04-04 18:54:27 -04:00
36919fedda bin/org-capture: refactor & use -k switch 2019-03-29 23:49:47 -04:00
ddfcc4299c bin/doom-doctor: minor refactor
Also allow Doom init errors to be debugged.
2019-03-28 02:01:38 -04:00
acf67244ca Improve doom doctor
+ Bump Emacs version check to 25.3
+ Fix doctor reporting missing packages that are user-disabled
+ Add Doom core checks for over-sized cache files (a possible cause of
  freezes/hangs)
+ Emit a backtrace from module doctor script errors
+ Fix doom doctor not respecting DEBUG envvar
2019-03-16 23:59:50 -04:00
2e4feed1a4 bin/doom: alias -h/--help to help command 2019-03-03 21:56:24 -05:00
0d902e8cf1 bin/doom: demote missing -p path error to warning
The error would prevent bin/doom quickstart from working with a custom
private directory. Instead, just warn that it doesn't exist.

Fixes #974
2018-10-21 20:01:09 -04:00
2637544022 bin/doom: refactor no-args error message
Dumping usage to stdout just drowns out the problem: they forgot a
command!
2018-09-30 00:55:39 -04:00
a91df46aa8 bin/doom: revert debug-on-error = t
It's too destructive. Will sometimes crash the script with no error
output.
2018-09-28 21:59:06 -04:00
8a8b5c6089 Refactor bin/doom & doom-dispatch
Done to make bin/doom produce better debugger output (and more readily).
A lot of bin/doom errors aren't recurring, so it's better to produce the
full error report ASAP.
2018-09-28 21:13:27 -04:00
575c3cccd9 make compile: exit with non-zero code on error
This would allow the CI to fail to compilation errors.
2018-09-12 22:55:13 +01:00
f7326a2c40 Update doom doctor for new init process
For changes made in 31bcac9a
2018-09-09 09:58:19 -04:00
33d692a6be Make bin/doom work when it's symlinked 2018-08-30 16:31:09 +02:00
e5096f854d bin/doom: minimize user-error messages 2018-08-19 03:24:41 +02:00
94092081db Fix running make from inside doom
The `term.el` package defines an environment variable `EMACS` inside its shell process, containing the Emacs and term.el version, in a string that looks like this: `26.1 (term:0.96)`. This interferes with the `bin/doom` command, which expects that environment variable to be a path to an Emacs binary. Trying to run make inside a doom terminal thus gives you this error:

```
Emacs isn't installed
make: *** [Makefile:5: all] Error 1
```

This simple fix just checks if `$EMACS` looks like a term version string, and ignores it if so.
2018-08-14 01:08:13 -07:00
bc5621adb6 Add ability to pass additional args to 'doom run' 2018-07-16 16:35:05 -07:00
92b8222529 %* doesn't behave as expected
%* is unaffected by SHIFT, so using it results in Emacs loading a
buffer named "run" on startup.

In order to preserve running all supported commands directly with
the bin/doom script, change the magic string in doom.cmd to one that
is unused ("runemacs")
2018-07-13 19:08:24 -07:00
a0604e3feb Tweak the command used for the "run" argument
- Using "start" will allow the batch script to return immediately,
  rather than waiting for the command to finish.
- Using "runemacs" (instead of plain "emacs") will hide the console
  window that is displayed while Emacs is running
2018-07-12 15:45:37 -07:00
31143f9f9e Fix a couple errors in doom.cmd
- Properly stringize the optional first argument
- Use correct path to init.el (relative to script directory)
2018-07-12 15:20:19 -07:00
1b98422291 $* -> %* in bin/doom.cmd 2018-07-09 15:29:38 +02:00
8b8c7c7411 doom-doctor: use ~ instead of HOME envvar 2018-07-05 01:32:38 +02:00
ca5ff92192 Fix void-variable: package errors in doom doctor
Reported by @zaiste
2018-06-27 12:02:21 +02:00
81753150a7 doctor: don't regard disabled/ignored packages
And refactor error handling.
2018-06-26 18:58:07 +02:00
6c8df7c6bb bin/org-capture: reformat & improve daemon cleanup
Ensures the temporary daemon is killed after org-capture is finished.
2018-06-24 16:31:14 +02:00
8e23ab0a05 Add -h/--help usage info to bin/org-tangle 2018-06-20 11:29:29 +02:00
60d6f70646 bin/org-tangle: fix uninitialzed all-blocks et co 2018-06-20 11:00:20 +02:00