From cf2dde4261a311406203a38d6bf1be72b4f9e8a7 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Mon, 10 Jul 2023 13:31:57 +0800 Subject: Update Android port * java/org/gnu/emacs/EmacsService.java (browseUrl): New argument SEND. Choose from a list of applications that want to share the URL if true. * lisp/net/browse-url.el (browse-url-android-share): New user option. (browse-url-default-android-browser): Respect said user option. * src/android.c (android_init_emacs_service) (android_browse_url): Expose new option. * src/android.h: Update prototypes. * src/androidselect.c (Fandroid_browse_url): Likewise. --- src/androidselect.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/androidselect.c') diff --git a/src/androidselect.c b/src/androidselect.c index d1f2ebb52f9..f5371280457 100644 --- a/src/androidselect.c +++ b/src/androidselect.c @@ -232,11 +232,15 @@ DEFUN ("android-clipboard-exists-p", Fandroid_clipboard_exists_p, } DEFUN ("android-browse-url", Fandroid_browse_url, - Sandroid_browse_url, 1, 1, 0, - doc: /* Start the system web browser. -Then, point the web browser to URL, which should be a URL-encoded -URL with a scheme specified. Signal an error upon failure. */) - (Lisp_Object url) + Sandroid_browse_url, 1, 2, 0, + doc: /* Open URL in an external application. URL should be a +URL-encoded URL with a scheme specified unless SEND is non-nil. +Signal an error upon failure. + +If SEND is nil, start a program that is able to display the URL, such +as a web browser. Otherwise, try to share URL using programs such as +email clients. */) + (Lisp_Object url, Lisp_Object send) { Lisp_Object value; @@ -244,7 +248,7 @@ URL with a scheme specified. Signal an error upon failure. */) error ("No Android display connection!"); CHECK_STRING (url); - value = android_browse_url (url); + value = android_browse_url (url, send); /* Signal an error upon failure. */ if (!NILP (value)) -- cgit v1.2.1