Improve target handling for forge embark target finder
This commit is contained in:
parent
d6fdb649ce
commit
43204e2ced
@ -122,11 +122,17 @@ targets."
|
||||
"U" #'password-store-url)
|
||||
(add-to-list 'embark-keymap-alist '(password-store . embark-password-store-actions)))
|
||||
(add-to-list 'embark-target-injection-hooks '(xref-find-references embark--ignore-target))
|
||||
(with-eval-after-load 'forge
|
||||
(defun embark-target-finder-forge ()
|
||||
"Identify Forge commits/issues/PRs at point."
|
||||
(when-let ((target (forge--browse-target)))
|
||||
`(forge . ,(format "%s" target)))))
|
||||
(when-let ((target (and
|
||||
(fboundp 'forge--browse-target)
|
||||
(forge--browse-target))))
|
||||
`(forge ,(or
|
||||
(and (stringp target) target)
|
||||
(ignore-errors (forge-get-url target))
|
||||
(s-chomp (thing-at-point 'line t)))
|
||||
,(line-beginning-position)
|
||||
. ,(line-end-position))))
|
||||
(add-to-list 'embark-target-finders #'embark-target-finder-forge)
|
||||
(defvar-keymap embark-forge-actions
|
||||
:doc "Keymap for actions for forge."
|
||||
|
Loading…
Reference in New Issue
Block a user