Minor, general refactors

Also rename custom lookup handlers for consistency and use the new
inline :async property instead.
This commit is contained in:
Henrik Lissner 2019-05-02 17:57:31 -04:00
parent d17764366e
commit 1c976dc0e4
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
6 changed files with 18 additions and 13 deletions

View file

@ -141,7 +141,7 @@
;; OS specific fixes
(when IS-MAC
;; Fix MacOS shift+tab
(define-key input-decode-map [S-iso-lefttab] [backtab])
(define-key key-translation-map [S-iso-lefttab] [backtab])
;; Fix conventional OS keys in Emacs
(map! "s-`" #'other-frame ; fix frame-switching
;; fix OS window/frame navigation/manipulation keys

View file

@ -1,5 +1,17 @@
;;; lang/clojure/autoload.el -*- lexical-binding: t; -*-
;;;###autoload
(defun +clojure-cider-lookup-definition (identifier)
"A lookup handler for `cider-mode'.
This is necessary to fix `cider-find-dwim's inability to capture the full symbol
at point."
(cider-find-dwim identifier))
;;
;;; Commands
;;;###autoload
(defun +clojure/repl (&optional arg)
"Open a Cider REPL and return the buffer."
@ -12,9 +24,3 @@
"TODO"
(interactive)
(cider-switch-to-repl-buffer t))
;;;###autoload
(defun +clojure-lookup-symbol (identifier)
"A lookup handler for `cider-find-dwim'.
This is necessary to fix its inability to capture the full symbol at point."
(cider-find-dwim identifier))

View file

@ -13,7 +13,7 @@
(set-repl-handler! 'clojure-mode #'+clojure/repl)
(set-eval-handler! 'clojure-mode #'cider-eval-region)
(set-lookup-handlers! 'cider-mode
:definition #'+clojure-lookup-symbol
:definition #'+clojure-cider-lookup-definition
:documentation #'cider-doc)
(add-hook 'cider-mode-hook #'eldoc-mode)
:config

View file

@ -30,7 +30,6 @@ This marks a foldable marker for `outline-minor-mode' in elisp buffers.")
:symbols '(("t" "nil")
("let" "let*")
("when" "unless")
("append" "prepend")
("advice-add" "advice-remove")
("add-hook" "remove-hook")
("add-hook!" "remove-hook!")))

View file

@ -159,9 +159,9 @@
(setq-default company-backends (delq 'company-tide (default-value 'company-backends))))
(set-company-backend! 'tide-mode 'company-tide)
;; navigation
(set-lookup-handlers! 'tide-mode :async t
:definition #'tide-jump-to-definition
:references #'tide-references)
(set-lookup-handlers! 'tide-mode
:definition '(tide-jump-to-definition :async t)
:references '(tide-references :async t))
;; resolve to `doom-project-root' if `tide-project-root' fails
(advice-add #'tide-project-root :override #'+javascript*tide-project-root)
;; cleanup tsserver when no tide buffers are left

View file

@ -57,7 +57,7 @@
(if (string-match "\\(?:>\\|]\\|}\\)+\\'" string)
(replace-match "" t t string)
string))))))
(delq (assq nil web-mode-engines-auto-pairs) web-mode-engines-auto-pairs))
(delq! nil web-mode-engines-auto-pairs))
(map! :map web-mode-map
(:localleader