Demote errors more better-er
This commit is contained in:
parent
bcf56eff21
commit
144e5244d2
|
@ -29,23 +29,37 @@
|
|||
"Warn the user that something bad happened in `setup'."
|
||||
(display-warning 'setup (format message args)))
|
||||
|
||||
(defun +setup-wrap-to-demote-errors (body name)
|
||||
"Wrap BODY in a `with-demoted-errors' block.
|
||||
This behavior is prevented if `setup-attributes' contains the
|
||||
symbol `without-error-demotion'.
|
||||
|
||||
This function differs from `setup-wrap-to-demote-errors' in that
|
||||
it includes the NAME of the setup form in the warning output."
|
||||
(if (memq 'without-error-demotion setup-attributes)
|
||||
body
|
||||
`(with-demoted-errors ,(format "Error in setup form on line %d (%s): %%S"
|
||||
(line-number-at-pos)
|
||||
name)
|
||||
,body)))
|
||||
|
||||
(setup-define :quit
|
||||
'setup-quit
|
||||
:documentation "Quit the current `setup' form.
|
||||
Good for commenting.")
|
||||
|
||||
(setup-define :face
|
||||
(lambda (face spec)
|
||||
`(custom-set-faces (list ,face ,spec 'now "Customized by `setup'.")))
|
||||
(lambda (face spec)
|
||||
`(custom-set-faces (list ,face ,spec 'now "Customized by `setup'.")))
|
||||
:documentation "Customize FACE with SPEC using `custom-set-faces'."
|
||||
:repeatable t)
|
||||
|
||||
(setup-define :load-after
|
||||
(lambda (&rest features)
|
||||
(let ((body `(require ',(setup-get 'feature))))
|
||||
(dolist (feature (nreverse features))
|
||||
(setq body `(with-eval-after-load ',feature ,body)))
|
||||
body))
|
||||
(lambda (&rest features)
|
||||
(let ((body `(require ',(setup-get 'feature))))
|
||||
(dolist (feature (nreverse features))
|
||||
(setq body `(with-eval-after-load ',feature ,body)))
|
||||
body))
|
||||
:documentation "Load the current feature after FEATURES.")
|
||||
|
||||
(setup-define :load-from
|
||||
|
|
Loading…
Reference in New Issue