From c4403522df754627d698f0806d3920764e3d1291 Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Wed, 5 Oct 2022 11:28:34 +1100 Subject: Adding ability to navigate within help buffer --- hcel-results.el | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'hcel-results.el') diff --git a/hcel-results.el b/hcel-results.el index 6cac9de..3a676b9 100644 --- a/hcel-results.el +++ b/hcel-results.el @@ -436,17 +436,20 @@ Start by choosing a package." (hcel-ids 'package query hcel-package-id)) (define-key hcel-mode-map "i" #'hcel-package-ids) -;; TODO: it is impossible with the current API to follow link within the help -;; buffer, as definitionSite does not contain signature, and ExactLocation does -;; not contain component name or even name +(defun hcel-tag-span-button-help (marker) + (hcel-help-internal + (hcel-global-identifier + (get-text-property marker 'location-info) + (hcel-string-with-text-property-at-point 'location-info)))) + (defun hcel-help-internal (identifier) (help-setup-xref (list #'hcel-help-internal identifier) (called-interactively-p 'interactive)) (with-help-window (help-buffer) - (with-current-buffer standard-output - (insert - (hcel-ids-render-identifier - identifier 'hcel-tag-span-button-load-source))))) + (with-current-buffer standard-output + (insert + (hcel-ids-render-identifier + identifier 'hcel-tag-span-button-help))))) (defun hcel-help (query) (interactive -- cgit v1.2.3