summaryrefslogtreecommitdiffhomepage
path: root/completion.org
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-10-26 21:57:43 +0100
committerjao <jao@gnu.org>2021-10-26 21:57:43 +0100
commitd8e60ed296861200283772db606ad72d9b9fae8a (patch)
tree0756a1ce6a658c71c73617ba711175b4c9cbda26 /completion.org
parent63c3013ee281783c3264ef589d54fa5b9fdb8ca3 (diff)
downloadelibs-d8e60ed296861200283772db606ad72d9b9fae8a.tar.gz
elibs-d8e60ed296861200283772db606ad72d9b9fae8a.tar.bz2
link-hints improvements (dictionary action)
Diffstat (limited to 'completion.org')
-rw-r--r--completion.org15
1 files changed, 13 insertions, 2 deletions
diff --git a/completion.org b/completion.org
index 41331e1..1e0bb4b 100644
--- a/completion.org
+++ b/completion.org
@@ -324,6 +324,10 @@
(require 'embark-consult)))
#+end_src
+*** dict
+ #+begin_src emacs-lisp
+ (define-key embark-identifier-map "D" #'dictionary-search)
+ #+end_src
*** org targets
#+begin_src emacs-lisp
(declare-function org-link-any-re "ol")
@@ -441,7 +445,7 @@
(add-to-list 'embark-keymap-alist
'(spotify-search-item . spotify-item-keymap)))
#+end_src
-* avy link hints
+* avy and link hints
[[https://karthinks.com/software/avy-can-do-anything/][Avy can do anything | Karthinks]]
#+begin_src emacs-lisp
@@ -460,6 +464,13 @@
(embark-act)))
(add-to-list 'avy-dispatch-alist '(?\; . avy-embark-act))
+ (defun avy-dictionary-act (pt)
+ "Use dictionary lookup to act on the completion at PT."
+ (save-excursion
+ (goto-char pt)
+ (dictionary-lookup-definition)))
+ (add-to-list 'avy-dispatch-alist '(?d . avy-dictionary-act))
+
:bind ("C-c a" . avy-goto-char-timer))
(use-package link-hint
@@ -479,7 +490,7 @@
(defun jao-link-hint--notmuch-part-p ()
(and (get-text-property (point) :notmuch-part)
- (button-label (button-at (point)))))
+ (when-let (b (button-at (point))) (button-label b))))
(link-hint-define-type 'notmuch-part
:next #'jao-link-hint--notmuch-next-part