Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions ace-link.el
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,32 @@ call at PT."
(push (point) candidates))))
(nreverse candidates)))

;;*`ace-link-button'
(defun ace-link--button-collect ()
"Return a list of button positions."
(let (candidates pt)
(save-excursion
(goto-char (window-start))
(setq pt (point))
(when-let ((first-button (forward-button 0 nil nil t)))
(setq pt (point))
(push (point) candidates))
(while (and (forward-button 1 nil nil t)
(> (point) pt))
(setq pt (point))
(push (point) candidates)))
(nreverse candidates)))

;;;###autoload
(defun ace-link-button ()
"Open or go to a visible button."
(interactive)
(let ((res (avy-with ace-link-button
(avy-process
(ace-link--button-collect)
(avy--style-fn avy-style)))))
(push-button res)))

;;* `ace-link-org'
;;;###autoload
(defun ace-link-org ()
Expand Down Expand Up @@ -1053,6 +1079,8 @@ call at PT."
'(ace-link-sldb . pre))
(add-to-list 'avy-styles-alist
'(ace-link-slime-xref . pre))
(add-to-list 'avy-styles-alist
'(ace-link-button . pre))
(add-to-list 'avy-styles-alist
'(ace-link-slime-inspector . pre))
(eval-after-load "xref"
Expand Down Expand Up @@ -1091,6 +1119,9 @@ call at PT."
(eval-after-load "indium-debugger"
`(progn
(define-key indium-debugger-frames-mode-map ,key 'ace-link-indium-debugger-frames)))
(eval-after-load "dictionary"
`(progn
(define-key dictionary-mode-map ,key 'ace-link-button)))
(eval-after-load "cider-inspector"
`(progn
(define-key cider-inspector-mode-map ,key 'ace-link-cider-inspector))))
Expand Down