Commit Graph

32 Commits

Author SHA1 Message Date
Henrik Lissner
1ab8dac872
Fix arg-less color functions in print!/format! 2019-04-24 18:16:07 -04:00
Henrik Lissner
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
Henrik Lissner
ca9a2c8c17
Refactor interactiove bin/doom commands #1220 2019-03-09 04:28:25 -05:00
Henrik Lissner
884957bdc6
Refactor format! macro
By removing the cl-flet call, we reduce the size of backtraces produced
during bin/doom commands by a whopping 80%. Noice.

Also renames doom-ansi-apply -> doom-color-apply
2019-03-07 18:26:44 -05:00
Henrik Lissner
1e710e94e3
Minor refactors
+ cl-flet* -> cl-flet
+ refactor display-line-numbers-mode
2018-09-19 19:43:32 -04:00
Henrik Lissner
d9a9243a62 Remove unnecessary let block 2018-09-12 23:03:23 +01:00
Edwin Török
8f5d822363 make compile-core: fix warnings
It is easier to spot real problems if the code is warning-free.

Replacing `gensym` with `make-symbol` is an idea taken from here:
b44c08dd45

In defer-until!:
core-lib.el:150:19:Warning: function ‘gensym’ from cl package called at
    runtime

In add-transient-hook!:
core-lib.el:216:16:Warning: function ‘gensym’ from cl package called at
    runtime

In toplevel form:
autoload/message.el:35:1:Warning: Unused lexical variable ‘spec’

In toplevel form:
autoload/line-numbers.el:31:1:Warning: defcustom for
    ‘display-line-numbers-type’ fails to specify containing group
autoload/line-numbers.el:31:1:Warning: defcustom for
    ‘display-line-numbers-type’ fails to specify containing group
autoload/line-numbers.el:39:1:Warning: defcustom for
    ‘display-line-numbers-grow-only’ fails to specify containing group
autoload/line-numbers.el:39:1:Warning: defcustom for
    ‘display-line-numbers-grow-only’ fails to specify containing group
autoload/line-numbers.el:44:1:Warning: defcustom for
    ‘display-line-numbers-width-start’ fails to specify containing group
autoload/line-numbers.el:44:1:Warning: defcustom for
    ‘display-line-numbers-width-start’ fails to specify containing group

In toplevel form:
cli/autoloads.el:137:1:Warning: Unused lexical variable ‘type’

Preserve name of unused lexical var _type

Makes it obvious what is stored there.
2018-09-12 23:03:23 +01:00
Henrik Lissner
4d10c28c37
Change doom-ansi-apply, print! & format!
Color let-functions no longer take format string arguments. e.g.

  (format! (red "Hello %s" "world"))

Becomes

  (format! (red "Hello %s") "world")

The same goes for print!. Also, doom-ansi-apply now takes two arguments
instead of three.

Also merges doom-message-{fg,bg,fx} into doom-ansi-alist, and reduces
backtrace noise when errors originate from inside these macros.
2018-09-09 09:58:20 -04:00
Henrik Lissner
887e3e11af
Remove unused printerr! macro 2018-05-25 00:49:03 +02:00
Henrik Lissner
47ccbb5d41
print!: use terpri instead of princ for newline
Will produce the appropriate newline for the current OS.
2018-05-24 18:30:37 +02:00
Henrik Lissner
0d9db6f149
Rewrite autoload/message library
+ Rename message! => print!
+ New printerr! macro
+ Extended color support to interactive sessions (now propertized using
  term faces, so we don't have to rely on a popup window to display it).
2018-05-20 11:44:10 +02:00
Henrik Lissner
b5db4f1fb6
Debug log missing modules; remove log! macro 2018-03-24 07:25:00 -04:00
Henrik Lissner
74c8b1d113
Rewrite doctor; move warn! blocks out in doctor.el files 2018-03-12 13:32:01 -04:00
Henrik Lissner
74d8ea2b0f
New doom-demote-warnings option for suppress dependency warnings 2018-03-05 03:02:17 -05:00
Henrik Lissner
2b1c323dbf
💥 Redesign private sub-module system
~/.doom.d/modules is now a full module tree, like ~/.emacs.d/modules.
Symlinks are no longer involved.

Private modules can now shadow Doom modules. e.g.
~/.doom.d/modules/lang/org will take precendence over
~/.emacs.d/modules/lang/org.

Also, made doom--*-load-path variables public (e.g. doom--site-load-path
=> doom-site-load-path), and rearranged the load-path for a 10-15%
startup boost.
2018-02-16 02:11:10 -05:00
Henrik Lissner
ae52b2ff60
Fix empty load-file-name in warn! macro during byte-compilation 2018-02-14 20:52:25 -05:00
Henrik Lissner
11373e0128
Move doom-ansi-apply away from macros + add docstring 2018-02-14 05:40:37 -05:00
Henrik Lissner
f6039eaee3
Use delay-warning instead of message in warn! macro 2018-02-14 03:17:51 -05:00
Henrik Lissner
7e87ab3e29
New warn! macro; replace debug! with log! macro 2018-02-04 17:53:31 -05:00
Henrik Lissner
b681917082
Remove/replace references to doom-popup-buffer 2018-01-06 03:27:23 -05:00
Henrik Lissner
50f924bcfc Fix doom-ansi-apply alias to autoload in format!
A wrong-type-argument: symbolp error occurs when core files are
byte-compiled and the expanded message!/format! macros are trying to
cl-flet-alias 'color to doom-ansi-apply (which hasn't been loaded yet).
2017-06-24 02:25:15 +02:00
Henrik Lissner
8f7e138357
Add debug! macro 2017-06-21 16:09:34 +02:00
Henrik Lissner
c7254e7bdc
Major optimization refactor, across the board
+ enable lexical-scope everywhere (lexical-binding = t): ~5-10% faster
  startup; ~5-20% general boost
+ reduce consing, function calls & garbage collection by preferring
  cl-loop & dolist over lambda closures (for mapc[ar], add-hook, and
  various cl-lib filter/map/reduce functions) -- where possible
+ prefer functions with dedicated opcodes, like assq (see byte-defop's
  in bytecomp.el for more)
+ prefer pcase & cond (faster) over cl-case
+ general refactor for code readability
+ ensure naming & style conventions are adhered to
+ appease byte-compiler by marking unused variables with underscore
+ defer minor mode activation to after-init, emacs-startup or
  window-setup hooks; a customization opportunity for users + ensures
  custom functionality won't interfere with startup.
2017-06-09 00:47:45 +02:00
Henrik Lissner
a94a591072 message!: add newline in doom buffer 2017-04-17 16:54:00 -04:00
Henrik Lissner
5ae94b765c PRAISE BE TO THE BYTE COMPILER FOR THY SHARP QUOTES 2017-04-17 02:17:10 -04:00
Henrik Lissner
fedfa1ffad Generalize message! & format! (interactive vs noninteractive) 2017-04-15 03:14:03 -04:00
Henrik Lissner
e48c6c5381 ansi-{format,message}! => {format,message}! (to be generalized) 2017-04-15 01:29:24 -04:00
Henrik Lissner
e32a804f1d autoload/message: doom--ansi-apply => doom-ansi-apply + autoload 2017-04-15 01:22:42 -04:00
Henrik Lissner
e50dabfde4 Replace ansi plugin with internal ansi library 2017-04-12 10:51:29 -04:00
Henrik Lissner
d0c3dcbb19 Remove unused core/autoload/message.el 2017-02-20 00:26:48 -05:00
Henrik Lissner
bc402868a6 Add provide's to module config.el files + fix module header comments 2017-02-20 00:23:08 -05:00
Henrik Lissner
403d7dce6c Add core/autoload/message.el; rudimentary doom message buffer library 2017-02-20 00:23:06 -05:00