tools/lookup: conform to new conventions
This commit is contained in:
parent
d106272574
commit
6cda303ae6
4 changed files with 20 additions and 20 deletions
|
@ -33,10 +33,10 @@ produces an url. Used by `+lookup/online'.")
|
|||
"Function to use to open search urls.")
|
||||
|
||||
(defvar +lookup-definition-functions
|
||||
'(+lookup-xref-definitions-backend
|
||||
+lookup-dumb-jump-backend
|
||||
+lookup-project-search-backend
|
||||
+lookup-evil-goto-definition-backend)
|
||||
'(+lookup-xref-definitions-backend-fn
|
||||
+lookup-dumb-jump-backend-fn
|
||||
+lookup-project-search-backend-fn
|
||||
+lookup-evil-goto-definition-backend-fn)
|
||||
"Functions for `+lookup/definition' to try, before resorting to `dumb-jump'.
|
||||
Stops at the first function to return non-nil or change the current
|
||||
window/point.
|
||||
|
@ -47,8 +47,8 @@ argument: the identifier at point. See `set-lookup-handlers!' about adding to
|
|||
this list.")
|
||||
|
||||
(defvar +lookup-references-functions
|
||||
'(+lookup-xref-references-backend
|
||||
+lookup-project-search-backend)
|
||||
'(+lookup-xref-references-backend-fn
|
||||
+lookup-project-search-backend-fn)
|
||||
"Functions for `+lookup/references' to try, before resorting to `dumb-jump'.
|
||||
Stops at the first function to return non-nil or change the current
|
||||
window/point.
|
||||
|
@ -59,7 +59,7 @@ argument: the identifier at point. See `set-lookup-handlers!' about adding to
|
|||
this list.")
|
||||
|
||||
(defvar +lookup-documentation-functions
|
||||
'(+lookup-online-backend)
|
||||
'(+lookup-online-backend-fn)
|
||||
"Functions for `+lookup/documentation' to try, before resorting to
|
||||
`dumb-jump'. Stops at the first function to return non-nil or change the current
|
||||
window/point.
|
||||
|
@ -108,10 +108,10 @@ this list.")
|
|||
;; xref to be one too.
|
||||
(remove-hook 'xref-backend-functions #'etags--xref-backend)
|
||||
;; ...however, it breaks `projectile-find-tag', unless we put it back.
|
||||
(defun +lookup*projectile-find-tag (orig-fn)
|
||||
(def-advice! +lookup-projectile-find-tag-a (orig-fn)
|
||||
:around #'projectile-find-tag
|
||||
(let ((xref-backend-functions '(etags--xref-backend t)))
|
||||
(funcall orig-fn)))
|
||||
(advice-add #'projectile-find-tag :around #'+lookup*projectile-find-tag)
|
||||
|
||||
;; Use `better-jumper' instead of xref's marker stack
|
||||
(advice-add #'xref-push-marker-stack :around #'doom-set-jump-a)
|
||||
|
@ -133,7 +133,7 @@ this list.")
|
|||
(def-package! dash-docs
|
||||
:when (featurep! +docsets)
|
||||
:init
|
||||
(add-hook '+lookup-documentation-functions #'+lookup-dash-docsets-backend)
|
||||
(add-hook '+lookup-documentation-functions #'+lookup-dash-docsets-backend-fn)
|
||||
:config
|
||||
(setq dash-docs-enable-debugging doom-debug-mode
|
||||
dash-docs-docsets-path (concat doom-etc-dir "docsets/")
|
||||
|
@ -143,16 +143,16 @@ this list.")
|
|||
;; Before `gnutls' is loaded, `gnutls-algorithm-priority' is treated as a
|
||||
;; lexical variable, which breaks `+lookup*fix-gnutls-error'
|
||||
(defvar gnutls-algorithm-priority)
|
||||
(defun +lookup*fix-gnutls-error (orig-fn url)
|
||||
(def-advice! +lookup-fix-gnutls-error-a (orig-fn url)
|
||||
"Fixes integer-or-marker-p errors emitted from Emacs' url library,
|
||||
particularly, the `url-retrieve-synchronously' call in
|
||||
`dash-docs-read-json-from-url'. This is part of a systemic issue with Emacs 26's
|
||||
networking library (fixed in Emacs 27+, apparently).
|
||||
|
||||
See https://github.com/magit/ghub/issues/81"
|
||||
:around #'dash-docs-read-json-from-url
|
||||
(let ((gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3"))
|
||||
(funcall orig-fn url)))
|
||||
(advice-add #'dash-docs-read-json-from-url :around #'+lookup*fix-gnutls-error)
|
||||
|
||||
(def-package! helm-dash
|
||||
:when (featurep! :completion helm))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue