Move doom--condition-case! to core/cli/packages
The only place it is being used
This commit is contained in:
parent
4b2dbe42a5
commit
31a0ad5b95
2 changed files with 13 additions and 13 deletions
|
@ -13,19 +13,6 @@
|
||||||
nil t)
|
nil t)
|
||||||
table))))
|
table))))
|
||||||
|
|
||||||
(defmacro doom--condition-case! (&rest body)
|
|
||||||
`(condition-case-unless-debug e
|
|
||||||
(progn ,@body)
|
|
||||||
('user-error
|
|
||||||
(print! (bold (red " NOTICE: %s")) e))
|
|
||||||
('file-error
|
|
||||||
(print! (bold (red " FILE ERROR: %s")) (error-message-string e))
|
|
||||||
(print! " Trying again...")
|
|
||||||
(quiet! (doom-refresh-packages-maybe t))
|
|
||||||
,@body)
|
|
||||||
('error
|
|
||||||
(print! (bold (red " FATAL ERROR: %s\n Run again with the -d flag for details")) e))))
|
|
||||||
|
|
||||||
(defun doom--refresh-pkg-cache ()
|
(defun doom--refresh-pkg-cache ()
|
||||||
"Clear the cache for `doom-refresh-packages-maybe'."
|
"Clear the cache for `doom-refresh-packages-maybe'."
|
||||||
(setq doom--refreshed-p nil)
|
(setq doom--refreshed-p nil)
|
||||||
|
|
|
@ -14,6 +14,19 @@
|
||||||
;;
|
;;
|
||||||
;; Helpers
|
;; Helpers
|
||||||
|
|
||||||
|
(defmacro doom--condition-case! (&rest body)
|
||||||
|
`(condition-case-unless-debug e
|
||||||
|
(progn ,@body)
|
||||||
|
('user-error
|
||||||
|
(print! (bold (red " NOTICE: %s")) e))
|
||||||
|
('file-error
|
||||||
|
(print! (bold (red " FILE ERROR: %s")) (error-message-string e))
|
||||||
|
(print! " Trying again...")
|
||||||
|
(quiet! (doom-refresh-packages-maybe t))
|
||||||
|
,@body)
|
||||||
|
('error
|
||||||
|
(print! (bold (red " FATAL ERROR: %s\n Run again with the -d flag for details")) e))))
|
||||||
|
|
||||||
(defsubst doom--do (fn)
|
(defsubst doom--do (fn)
|
||||||
(doom-reload-doom-autoloads)
|
(doom-reload-doom-autoloads)
|
||||||
(when (funcall fn doom-auto-accept)
|
(when (funcall fn doom-auto-accept)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue