@@ -917,24 +917,28 @@ With a prefix argument prompt for the remote's name.
917
917
Defaults to \" origin\" ."
918
918
919
919
(interactive (list (git-link--select-remote)))
920
- (let* (commit handler remote-info (remote-url (git-link--remote-url remote)))
920
+ (let* ((remote-url (git-link--remote-url remote))
921
+ commit handler remote-info git-host web-host)
921
922
(if (null remote-url)
922
923
(message " Remote `%s' not found " remote)
923
924
924
925
(setq remote-info (git-link--parse-remote remote-url)
926
+ git-host (car remote-info)
925
927
commit (word-at-point )
926
- handler (git-link--handler git-link-commit-remote-alist (car remote-info)))
928
+ handler (git-link--handler git-link-commit-remote-alist git-host)
929
+ web-host (or (assoc-default git-host git-link-web-host-alist #'string-match-p )
930
+ git-host))
927
931
928
- (cond ((null ( car remote-info) )
932
+ (cond ((null git-host )
929
933
(message " Remote `%s' contains an unsupported URL " remote))
930
934
((not (string-match-p " [a-fA-F0-9]\\ {7,40\\ }" (or commit " " )))
931
935
(message " Point is not on a commit hash " ))
932
936
((not (functionp handler))
933
- (message " No handler for %s " ( car remote-info) ))
937
+ (message " No handler for %s " git-host ))
934
938
; ; null ret val
935
939
((git-link--new
936
940
(funcall handler
937
- ( car remote-info)
941
+ web-host
938
942
(cadr remote-info)
939
943
(substring-no-properties commit))))))))
940
944
@@ -951,15 +955,18 @@ Defaults to \"origin\"."
951
955
952
956
(interactive (list (git-link--select-remote)))
953
957
954
- (let* (handler remote-info
955
- (remote-url ( git-link--remote-url remote ))
956
- (git-link-open-in-browser ( or git-link-open-in-browser ( equal ( list 16 ) current-prefix-arg))) )
958
+ (let* ((remote-url (git-link-- remote-url remote))
959
+ (git-link-open-in-browser ( or git-link-open-in-browser ( equal ( list 16 ) current-prefix-arg) ))
960
+ handler remote-info git-host web-host )
957
961
958
962
(if (null remote-url)
959
963
(message " Remote `%s' not found " remote)
960
964
961
965
(setq remote-info (git-link--parse-remote remote-url)
962
- handler (git-link--handler git-link-homepage-remote-alist (car remote-info)))
966
+ git-host (car remote-info)
967
+ handler (git-link--handler git-link-homepage-remote-alist git-host)
968
+ web-host (or (assoc-default git-host git-link-web-host-alist #'string-match-p )
969
+ git-host))
963
970
964
971
(cond ((null (car remote-info))
965
972
(message " Remote `%s' contains an unsupported URL " remote))
@@ -968,7 +975,7 @@ Defaults to \"origin\"."
968
975
; ; null ret val
969
976
((git-link--new
970
977
(funcall handler
971
- ( car remote-info)
978
+ web-host
972
979
(cadr remote-info))))))))
973
980
974
981
(provide 'git-link )
0 commit comments