lang/org: add lookup handlers for src blocks
- Fixes: `set-lookup-handlers!` couldn't define :definition or :references handlers in text-mode derivatives. - Adds: support for evaluating code in jupyter blocks (#2477).
This commit is contained in:
parent
3b159dda0a
commit
5a80db875c
4 changed files with 60 additions and 9 deletions
|
@ -41,7 +41,8 @@ Used by `+lookup/online'.")
|
|||
"Function to use to open search urls.")
|
||||
|
||||
(defvar +lookup-definition-functions
|
||||
'(+lookup-xref-definitions-backend-fn
|
||||
'(+lookup-dictionary-definition-backend-fn
|
||||
+lookup-xref-definitions-backend-fn
|
||||
+lookup-dumb-jump-backend-fn
|
||||
+lookup-project-search-backend-fn
|
||||
+lookup-evil-goto-definition-backend-fn)
|
||||
|
@ -73,7 +74,8 @@ argument: the identifier at point. See `set-lookup-handlers!' about adding to
|
|||
this list.")
|
||||
|
||||
(defvar +lookup-references-functions
|
||||
'(+lookup-xref-references-backend-fn
|
||||
'(+lookup-thesaurus-definition-backend-fn
|
||||
+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
|
||||
|
@ -203,11 +205,5 @@ Dictionary.app behind the scenes to get definitions.")
|
|||
collect (cons service #'+eval-display-results-in-popup))))
|
||||
|
||||
|
||||
(when (featurep! +dictionary)
|
||||
(define-key! text-mode-map
|
||||
[remap +lookup/definition] #'+lookup/dictionary-definition
|
||||
[remap +lookup/references] #'+lookup/synonyms))
|
||||
|
||||
|
||||
;;;###package synosaurus
|
||||
(setq synosaurus-choose-method 'default) ; use ivy/helm instead of ido
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue