From ae782bc1703e689bffffea36efe6663bb45347e1 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Wed, 12 Apr 2017 00:15:11 +0200 Subject: [PATCH] Make browse-url work in Termux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To do so, we override the `browse-url-default-browser` command. It’s a shame there is no better way to do it. --- init.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/init.el b/init.el index 555f826..f3f6271 100644 --- a/init.el +++ b/init.el @@ -1108,6 +1108,18 @@ INFO plist." (add-hook 'after-init-hook #'secretaria-today-unknown-time-appt-always-remind-me)) +(when (termux-p) + (use-package browse-url + :ensure nil + :config + (advice-add 'browse-url-default-browser :override + (lambda (url &rest args) + (start-process-shell-command + "open-url" + nil + (concat "am start -a android.intent.action.VIEW --user 0 -d " + url)))))) + (add-hook 'python-mode-hook (lambda () (add-to-list 'prettify-symbols-alist