From 9304ca12490e636149a563b28e25195df5213ff6 Mon Sep 17 00:00:00 2001 From: jao Date: Thu, 4 Nov 2021 01:53:04 +0000 Subject: nits --- init.org | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'init.org') diff --git a/init.org b/init.org index c6e9ad5..acb9342 100644 --- a/init.org +++ b/init.org @@ -1498,10 +1498,18 @@ (defvar jao-browse-url-wget-exts '("ps" "pdf" "dvi" "djvu" "zip" "gz" "tgz" "mp4" "mp3" "flv")) + (defvar jao-browse-external-domains + '("github.com" "gitlab.com" "slack.com" "meet.google.com" + "twitter.com" "t.com" "bigml.com")) + + (defvar jao-browse--external-regexp + (format "https?://.*%s\\(/.*\\)?" + (regexp-opt jao-browse-external-domains))) + (defun jao-wget--regexp () (concat "^http[s]?://.+\\(\\." - (mapconcat 'identity jao-browse-url-wget-exts "\\|\\.") - "\\)\\'")) + (mapconcat 'identity jao-browse-url-wget-exts "\\|\\.") + "\\)\\'")) (defun jao--see (url &rest _r) (start-process-shell-command "see" nil (format "see %s" (jao--fln url)))) @@ -1519,12 +1527,8 @@ (,jao--see-exts . jao--see) ("^file://?.+\\.html?$" . ,jao-browse-url-function) ("^file://?" . jao--find-file-other-window) - ("^https?://git\\(hub\\|lab\\)\\.com/.*" . - ,jao-browse-url-external-function) - ("^https?://.*\\.slack\\..*" . ,jao-browse-url-external-function) + (,jao-browse--external-regexp . ,jao-browse-url-external-function) ("^https?://.*\\.gotomeeting\\.com\\.*" . browse-url-chrome) - ("^https?://meet\\.google\\.com\\.*" . ,jao-browse-url-external-function) - ("^https?://t\\(witter\\)?\\.com?/.*" . ,jao-browse-url-external-function) (,(jao-wget--regexp) . jao-download) (jao-video--url-p . jao-maybe-view-video) ("." . ,jao-browse-url-function))) @@ -2007,8 +2011,7 @@ (defun jao-shell-here-toggle () (interactive) - (if (or (eq (current-buffer) (jao-shell-frame-buffer)) - (eq (current-buffer) (jao-shell-frame-buffer nil t))) + (if (eq (current-buffer) (jao-shell-frame-buffer)) (eshell/x) (jao-shell-here t))) -- cgit v1.2.3