clojure: refactor

- Moved backend determination to `config.el`
- Replaced `pcase` form with only one-arm with `when` or `unless` form
This commit is contained in:
Lucius Hu 2021-03-17 23:51:24 -04:00 committed by duianto
parent dae0231fed
commit 4bf3501488
2 changed files with 2 additions and 11 deletions

View file

@ -41,7 +41,7 @@
(defvar clojure-enable-linters nil
"If non-nil, enable clojure linters.")
(defvar clojure-backend nil
(defvar clojure-backend (if (configuration-layer/layer-used-p 'lsp) 'lsp 'cider)
"The backend to use for IDE features.
Possible values are `lsp' and `cider'.
If `nil' then 'cider` is the default backend unless `lsp' layer is used")

View file

@ -21,18 +21,9 @@
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
(defun spacemacs//clojure-backend ()
"Return selected backend."
(if clojure-backend
clojure-backend
(cond
((configuration-layer/layer-used-p 'lsp) 'lsp)
(t 'cider))))
(defun spacemacs//clojure-setup-backend ()
"Conditionally setup clojure backend."
(pcase (spacemacs//clojure-backend)
(`lsp (lsp))))
(when (eq clojure-backend 'lsp) (lsp)))
(defun clojure/fancify-symbols (mode)
"Pretty symbols for Clojure's anonymous functions and sets,