summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--lisp/+setup.el28
1 files changed, 21 insertions, 7 deletions
diff --git a/lisp/+setup.el b/lisp/+setup.el index 194baa8..d5a3a77 100644 --- a/lisp/+setup.el +++ b/lisp/+setup.el
@@ -29,23 +29,37 @@
29 "Warn the user that something bad happened in `setup'." 29 "Warn the user that something bad happened in `setup'."
30 (display-warning 'setup (format message args))) 30 (display-warning 'setup (format message args)))
31 31
32(defun +setup-wrap-to-demote-errors (body name)
33 "Wrap BODY in a `with-demoted-errors' block.
34This behavior is prevented if `setup-attributes' contains the
35symbol `without-error-demotion'.
36
37This function differs from `setup-wrap-to-demote-errors' in that
38it includes the NAME of the setup form in the warning output."
39 (if (memq 'without-error-demotion setup-attributes)
40 body
41 `(with-demoted-errors ,(format "Error in setup form on line %d (%s): %%S"
42 (line-number-at-pos)
43 name)
44 ,body)))
45
32(setup-define :quit 46(setup-define :quit
33 'setup-quit 47 'setup-quit
34 :documentation "Quit the current `setup' form. 48 :documentation "Quit the current `setup' form.
35Good for commenting.") 49Good for commenting.")
36 50
37(setup-define :face 51(setup-define :face
38 (lambda (face spec) 52 (lambda (face spec)
39 `(custom-set-faces (list ,face ,spec 'now "Customized by `setup'."))) 53 `(custom-set-faces (list ,face ,spec 'now "Customized by `setup'.")))
40 :documentation "Customize FACE with SPEC using `custom-set-faces'." 54 :documentation "Customize FACE with SPEC using `custom-set-faces'."
41 :repeatable t) 55 :repeatable t)
42 56
43(setup-define :load-after 57(setup-define :load-after
44 (lambda (&rest features) 58 (lambda (&rest features)
45 (let ((body `(require ',(setup-get 'feature)))) 59 (let ((body `(require ',(setup-get 'feature))))
46 (dolist (feature (nreverse features)) 60 (dolist (feature (nreverse features))
47 (setq body `(with-eval-after-load ',feature ,body))) 61 (setq body `(with-eval-after-load ',feature ,body)))
48 body)) 62 body))
49 :documentation "Load the current feature after FEATURES.") 63 :documentation "Load the current feature after FEATURES.")
50 64
51(setup-define :load-from 65(setup-define :load-from