diff options
Diffstat (limited to 'custom/jao-custom-browse.el')
| -rw-r--r-- | custom/jao-custom-browse.el | 57 |
1 files changed, 32 insertions, 25 deletions
diff --git a/custom/jao-custom-browse.el b/custom/jao-custom-browse.el index 99b7fda..76ea32d 100644 --- a/custom/jao-custom-browse.el +++ b/custom/jao-custom-browse.el @@ -147,9 +147,14 @@ "meet.google.com" "docs.google.com" "x.com" "twitter.com" "t.com" "linkedin.com" "bigml.com" "slack.com" "zoom.us")) -(defvar jao-browse--external-regexp - (format "https?://\\(.+\\.\\)*%s\\(/.*\\)?" - (regexp-opt jao-browse-external-domains))) +(defvar jao-browse--external-regexp nil) + +(defun jao-browse-add-external (&rest rx) + (dolist (r rx) (add-to-list 'jao-browse-external-domains r)) + (setq jao-browse--external-regexp + (format "https?://\\(.+\\.\\)*%s\\(/.*\\)?" + (regexp-opt jao-browse-external-domains))) + (jao-browse-setup)) (defun jao-wget--regexp () (concat "^http[s]?://.+\\(\\." @@ -171,28 +176,30 @@ (defun jao-browse-url-browse (&rest args) (apply jao-browse-url-function args)) -(jao-d-l - (setq browse-url-handlers - `((jao-video--url-p . jao-mac-open) - (,jao--doc-exts . jao-mac-open) - (,jao--see-exts . jao-mac-open) - ("^file://?.+\\.html?$" . ,jao-browse-url-function) - ("^file://?" . jao--find-file-other-window) - (,jao-browse--external-regexp . ,jao-browse-url-external-function) - (,jao-browse--sound-rx . jao-browse-play-sound-url) - ("." . jao-browse-url-browse))) - (setq browse-url-handlers - `((jao-video--url-p . jao-maybe-view-video) - (,jao--doc-exts . jao--browse-doc) - (,jao--see-exts . jao--see) - ("^file://?.+\\.html?$" . ,jao-browse-url-function) - ("^file://?" . jao--find-file-other-window) - (,jao-browse--external-regexp . ,jao-browse-url-external-function) - ("^https?://.*\\.gotomeeting\\.com\\.*" . browse-url-chrome) - (,jao-browse--sound-rx . jao-browse-play-sound-url) - (,(jao-wget--regexp) . jao-download) - ("." . jao-browse-url-browse)))) - +(defun jao-browse-setup () + (jao-d-l + (setq browse-url-handlers + `((jao-video--url-p . jao-mac-open) + (,jao--doc-exts . jao-mac-open) + (,jao--see-exts . jao-mac-open) + ("^file://?.+\\.html?$" . ,jao-browse-url-function) + ("^file://?" . jao--find-file-other-window) + (,jao-browse--external-regexp . ,jao-browse-url-external-function) + (,jao-browse--sound-rx . jao-browse-play-sound-url) + ("." . jao-browse-url-browse))) + (setq browse-url-handlers + `((jao-video--url-p . jao-maybe-view-video) + (,jao--doc-exts . jao--browse-doc) + (,jao--see-exts . jao--see) + ("^file://?.+\\.html?$" . ,jao-browse-url-function) + ("^file://?" . jao--find-file-other-window) + (,jao-browse--external-regexp . ,jao-browse-url-external-function) + ("^https?://.*\\.gotomeeting\\.com\\.*" . browse-url-chrome) + (,jao-browse--sound-rx . jao-browse-play-sound-url) + (,(jao-wget--regexp) . jao-download) + ("." . jao-browse-url-browse))))) + +(jao-browse-add-external) (provide 'jao-custom-browse) |
