Make browse-url work in Termux

To do so, we override the `browse-url-default-browser` command.  It’s a
shame there is no better way to do it.
This commit is contained in:
Gergely Polonkai 2017-04-12 00:15:11 +02:00
parent d0ec63b872
commit ae782bc170

12
init.el
View File

@ -1108,6 +1108,18 @@ INFO plist."
(add-hook 'after-init-hook (add-hook 'after-init-hook
#'secretaria-today-unknown-time-appt-always-remind-me)) #'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 (add-hook 'python-mode-hook
(lambda () (lambda ()
(add-to-list 'prettify-symbols-alist (add-to-list 'prettify-symbols-alist