aboutsummaryrefslogtreecommitdiff
path: root/sx-button.el
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2015-02-12 18:54:41 -0200
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-02-12 18:54:41 -0200
commitb7d1d7c47e6bbb907df90ee078ef18ba47412b75 (patch)
tree0b3650b5513e01ea4c16e6b4e573bb52f2e09529 /sx-button.el
parent2d4b14482c92997b3c97731795e1eb6f054fecf6 (diff)
Try sx-open-link, THEN do sx-visit-externally
Diffstat (limited to 'sx-button.el')
-rw-r--r--sx-button.el7
1 files changed, 6 insertions, 1 deletions
diff --git a/sx-button.el b/sx-button.el
index e00b086..992c654 100644
--- a/sx-button.el
+++ b/sx-button.el
@@ -100,7 +100,12 @@ usually part of a code-block."
(interactive)
(let ((url (or (get-text-property (or pos (point)) 'sx-button-url)
(sx-user-error "No url under point: %s" (or pos (point))))))
- (sx-open-link url)))
+ ;; If we didn't recognize the link, this errors immediately. If
+ ;; we mistakenly recognize it, it will error when we try to fetch
+ ;; whatever we thought it was.
+ (condition-case nil (sx-open-link url)
+ ;; When it errors, don't blame the user, just visit externally.
+ (error (sx-visit-externally url)))))
;;; Help-echo definitions