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:
Henrik Lissner 2018-08-22 16:26:31 +02:00
parent 34fcaec678
commit 8e7a7c1878
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -1,5 +1,13 @@
;;; 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
(cl-defun set-formatter! (modes formatter &key
name
@ -106,8 +114,11 @@ Advanced examples:
(if (or ok-statuses error-regexp)
(apply #'format-all-buffer-hard ok-statuses error-regexp args)
(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 (format-all-resolve-system install) format-all-install-table)
(dolist (mode (doom-enlist modes))
(cl-destructuring-bind (m &optional probe)
(doom-enlist mode)