Commit c09ac768805a
Changed files (1)
lisp
lisp/setup-org.el
@@ -194,18 +194,18 @@ like this : [[pt:REGEXP:FOLDER]]"
(org-link-set-parameters "gh"
:follow #'my/follow-gh-link
:export (lambda (path desc backend)
- (setq expressions (split-string path "#"))
- (setq project (nth 0 expressions))
- (setq issue (nth 1 expressions))
- (format "https://github.com/%s/issues/%s" project issue))
+ (vde/gh-get-url path))
:face '(:foreground "DimGrey" :underline t))
(defun my/follow-gh-link (issue)
"Browse github issue/pr specified"
- (setq expressions (split-string issue "#"))
+ (browse-url (vde/gh-get-url issue)))
+
+ (defun vde/gh-get-url (path)
+ "Translate org-mode link `gh:foo/bar#1' to github url."
+ (setq expressions (split-string path "#"))
(setq project (nth 0 expressions))
(setq issue (nth 1 expressions))
- (browse-url
- (format "https://github.com/%s/issues/%s" project issue)))
+ (format "https://github.com/%s/issues/%s" project issue))
(org-link-set-parameters
"org"