summaryrefslogtreecommitdiff
path: root/lisp/net
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/net')
-rw-r--r--lisp/net/browse-url.el22
-rw-r--r--lisp/net/eww.el8
2 files changed, 26 insertions, 4 deletions
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el
index 0177d12f236..c2629b69d59 100644
--- a/lisp/net/browse-url.el
+++ b/lisp/net/browse-url.el
@@ -52,6 +52,7 @@
;; browse-url-xdg-open freedesktop.org xdg-open
;; browse-url-kde KDE konqueror (kfm)
;; browse-url-elinks Elinks Don't know (tried with 0.12.GIT)
+;; browse-url-default-android-browser Android 2.3.3 (should work on 2.2 too)
;; eww-browse-url Emacs Web Wowser
;; Browsers can cache web pages so it may be necessary to tell them to
@@ -173,6 +174,9 @@
,@(when (eq system-type 'darwin)
(list '(function-item :tag "Default macOS browser"
:value browse-url-default-macosx-browser)))
+ ,@(when (eq system-type 'android)
+ (list '(function-item :tag "Default Android browser"
+ :value browse-url-default-android-browser)))
(function-item :tag "Default browser"
:value browse-url-default-browser)
(function :tag "Your own function")
@@ -1057,6 +1061,8 @@ instead of `browse-url-new-window-flag'."
'browse-url-default-macosx-browser)
((featurep 'haiku)
'browse-url-default-haiku-browser)
+ ((eq system-type 'android)
+ 'browse-url-default-android-browser)
((browse-url-can-use-xdg-open) 'browse-url-xdg-open)
;;; ((executable-find browse-url-gnome-moz-program) 'browse-url-gnome-moz)
((executable-find browse-url-firefox-program) 'browse-url-firefox)
@@ -1294,6 +1300,22 @@ Default to the URL around or before point."
(function-put 'browse-url-default-haiku-browser
'browse-url-browser-kind 'external)
+(declare-function android-browse-url "androidselect.c")
+
+;;;###autoload
+(defun browse-url-default-android-browser (url &optional _new-window)
+ "Browse URL with the system default browser.
+Default to the URL around or before point."
+ (interactive (browse-url-interactive-arg "URL: "))
+ (setq url (browse-url-encode-url url))
+ ;; Make sure the URL starts with an appropriate scheme.
+ (unless (string-match "\\(.+\\):/" url)
+ (setq url (concat "http://" url)))
+ (android-browse-url url))
+
+(function-put 'browse-url-default-android-browser
+ 'browse-url-browser-kind 'external)
+
;;;###autoload
(defun browse-url-emacs (url &optional same-window)
"Ask Emacs to load URL into a buffer and show it in another window.
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index 61f0f47373d..26aee532255 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -249,7 +249,7 @@ parameter, and should return the (possibly) transformed URL."
:version "29.1")
(defface eww-form-submit
- '((((type x w32 ns haiku pgtk) (class color)) ; Like default mode line
+ '((((type x w32 ns haiku pgtk android) (class color)) ; Like default mode line
:box (:line-width 2 :style released-button)
:background "#808080" :foreground "black"))
"Face for eww buffer buttons."
@@ -257,7 +257,7 @@ parameter, and should return the (possibly) transformed URL."
:group 'eww)
(defface eww-form-file
- '((((type x w32 ns haiku pgtk) (class color)) ; Like default mode line
+ '((((type x w32 ns haiku pgtk android) (class color)) ; Like default mode line
:box (:line-width 2 :style released-button)
:background "#808080" :foreground "black"))
"Face for eww buffer buttons."
@@ -265,7 +265,7 @@ parameter, and should return the (possibly) transformed URL."
:group 'eww)
(defface eww-form-checkbox
- '((((type x w32 ns haiku pgtk) (class color)) ; Like default mode line
+ '((((type x w32 ns haiku pgtk android) (class color)) ; Like default mode line
:box (:line-width 2 :style released-button)
:background "lightgrey" :foreground "black"))
"Face for eww buffer buttons."
@@ -273,7 +273,7 @@ parameter, and should return the (possibly) transformed URL."
:group 'eww)
(defface eww-form-select
- '((((type x w32 ns haiku pgtk) (class color)) ; Like default mode line
+ '((((type x w32 ns haiku pgtk android) (class color)) ; Like default mode line
:box (:line-width 2 :style released-button)
:background "lightgrey" :foreground "black"))
"Face for eww buffer buttons."