Fix void-function format-all-resolve-system error
This function is only defined at compile time for the format-all package, so we must extract it into a new function.
This commit is contained in:
parent
34fcaec678
commit
8e7a7c1878
1 changed files with 12 additions and 1 deletions
|
@ -1,5 +1,13 @@
|
||||||
;;; editor/format/autoload.el -*- lexical-binding: t; -*-
|
;;; editor/format/autoload.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun +format--resolve-system (choices)
|
||||||
|
"Get first choice matching `format-all-system-type' from CHOICES."
|
||||||
|
(cl-loop for choice in choices
|
||||||
|
if (atom choice) return choice
|
||||||
|
else if (eql format-all-system-type (car choice))
|
||||||
|
return (cadr choice)))
|
||||||
|
|
||||||
;;;###autodef
|
;;;###autodef
|
||||||
(cl-defun set-formatter! (modes formatter &key
|
(cl-defun set-formatter! (modes formatter &key
|
||||||
name
|
name
|
||||||
|
@ -106,8 +114,11 @@ Advanced examples:
|
||||||
(if (or ok-statuses error-regexp)
|
(if (or ok-statuses error-regexp)
|
||||||
(apply #'format-all-buffer-hard ok-statuses error-regexp args)
|
(apply #'format-all-buffer-hard ok-statuses error-regexp args)
|
||||||
(apply #'format-all-buffer-easy args))))))) format-all-format-table)
|
(apply #'format-all-buffer-easy args))))))) format-all-format-table)
|
||||||
|
(puthash name (cond ((null install) install)
|
||||||
|
((listp install) (cdr (assq (+format--resolve-system) install)))
|
||||||
|
(install))
|
||||||
|
format-all-install-table)
|
||||||
(puthash name (car command-list) format-all-executable-table)
|
(puthash name (car command-list) format-all-executable-table)
|
||||||
(puthash name (format-all-resolve-system install) format-all-install-table)
|
|
||||||
(dolist (mode (doom-enlist modes))
|
(dolist (mode (doom-enlist modes))
|
||||||
(cl-destructuring-bind (m &optional probe)
|
(cl-destructuring-bind (m &optional probe)
|
||||||
(doom-enlist mode)
|
(doom-enlist mode)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue