Fix (set-lookup-handlers! MODES nil) syntax
This commit is contained in:
parent
46b7945015
commit
957e1dd080
1 changed files with 21 additions and 18 deletions
|
@ -1,8 +1,7 @@
|
||||||
;;; tools/lookup/autoload/lookup.el -*- lexical-binding: t; -*-
|
;;; tools/lookup/autoload/lookup.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
;;;###autodef
|
;;;###autodef
|
||||||
(cl-defun set-lookup-handlers!
|
(defun set-lookup-handlers! (modes &rest plist)
|
||||||
(modes &rest plist &key definition references documentation file xref-backend async)
|
|
||||||
"Define jump handlers for major or minor MODES.
|
"Define jump handlers for major or minor MODES.
|
||||||
|
|
||||||
A handler is either an interactive command that changes the current buffer
|
A handler is either an interactive command that changes the current buffer
|
||||||
|
@ -56,7 +55,9 @@ defined for other minor modes or the major mode it's activated in.
|
||||||
|
|
||||||
This can be passed nil as its second argument to unset handlers for MODES. e.g.
|
This can be passed nil as its second argument to unset handlers for MODES. e.g.
|
||||||
|
|
||||||
(set-lookup-handlers! 'python-mode nil)"
|
(set-lookup-handlers! 'python-mode nil)
|
||||||
|
|
||||||
|
\(fn MODES &key DEFINITION REFERENCES DOCUMENTATION FILE XREF-BACKEND ASYNC)"
|
||||||
(declare (indent defun))
|
(declare (indent defun))
|
||||||
(dolist (mode (doom-enlist modes))
|
(dolist (mode (doom-enlist modes))
|
||||||
(let ((hook (intern (format "%s-hook" mode)))
|
(let ((hook (intern (format "%s-hook" mode)))
|
||||||
|
@ -67,21 +68,23 @@ This can be passed nil as its second argument to unset handlers for MODES. e.g.
|
||||||
((fset
|
((fset
|
||||||
fn
|
fn
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(cl-mapc #'+lookup--set-handler
|
(cl-destructuring-bind (&key definition references documentation file xref-backend async)
|
||||||
(list definition
|
plist
|
||||||
references
|
(cl-mapc #'+lookup--set-handler
|
||||||
documentation
|
(list definition
|
||||||
file
|
references
|
||||||
xref-backend)
|
documentation
|
||||||
(list '+lookup-definition-functions
|
file
|
||||||
'+lookup-references-functions
|
xref-backend)
|
||||||
'+lookup-documentation-functions
|
(list '+lookup-definition-functions
|
||||||
'+lookup-file-functions
|
'+lookup-references-functions
|
||||||
'xref-backend-functions)
|
'+lookup-documentation-functions
|
||||||
(make-list 5 async)
|
'+lookup-file-functions
|
||||||
(make-list 5 (or (eq major-mode mode)
|
'xref-backend-functions)
|
||||||
(and (boundp mode)
|
(make-list 5 async)
|
||||||
(symbol-value mode)))))))
|
(make-list 5 (or (eq major-mode mode)
|
||||||
|
(and (boundp mode)
|
||||||
|
(symbol-value mode))))))))
|
||||||
(add-hook hook fn))))))
|
(add-hook hook fn))))))
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue