diff options
| author | Po Lu | 2023-07-10 13:31:57 +0800 |
|---|---|---|
| committer | Po Lu | 2023-07-10 13:31:57 +0800 |
| commit | cf2dde4261a311406203a38d6bf1be72b4f9e8a7 (patch) | |
| tree | 904aa8c47417f9c16018ed04bf7ef05bfd446268 /src/androidselect.c | |
| parent | faca007b61422969f5c8888c67a1e356a8c5b64a (diff) | |
| download | emacs-cf2dde4261a311406203a38d6bf1be72b4f9e8a7.tar.gz emacs-cf2dde4261a311406203a38d6bf1be72b4f9e8a7.zip | |
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.
Diffstat (limited to 'src/androidselect.c')
| -rw-r--r-- | src/androidselect.c | 16 |
1 files changed, 10 insertions, 6 deletions
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, | |||
| 232 | } | 232 | } |
| 233 | 233 | ||
| 234 | DEFUN ("android-browse-url", Fandroid_browse_url, | 234 | DEFUN ("android-browse-url", Fandroid_browse_url, |
| 235 | Sandroid_browse_url, 1, 1, 0, | 235 | Sandroid_browse_url, 1, 2, 0, |
| 236 | doc: /* Start the system web browser. | 236 | doc: /* Open URL in an external application. URL should be a |
| 237 | Then, point the web browser to URL, which should be a URL-encoded | 237 | URL-encoded URL with a scheme specified unless SEND is non-nil. |
| 238 | URL with a scheme specified. Signal an error upon failure. */) | 238 | Signal an error upon failure. |
| 239 | (Lisp_Object url) | 239 | |
| 240 | If SEND is nil, start a program that is able to display the URL, such | ||
| 241 | as a web browser. Otherwise, try to share URL using programs such as | ||
| 242 | email clients. */) | ||
| 243 | (Lisp_Object url, Lisp_Object send) | ||
| 240 | { | 244 | { |
| 241 | Lisp_Object value; | 245 | Lisp_Object value; |
| 242 | 246 | ||
| @@ -244,7 +248,7 @@ URL with a scheme specified. Signal an error upon failure. */) | |||
| 244 | error ("No Android display connection!"); | 248 | error ("No Android display connection!"); |
| 245 | 249 | ||
| 246 | CHECK_STRING (url); | 250 | CHECK_STRING (url); |
| 247 | value = android_browse_url (url); | 251 | value = android_browse_url (url, send); |
| 248 | 252 | ||
| 249 | /* Signal an error upon failure. */ | 253 | /* Signal an error upon failure. */ |
| 250 | if (!NILP (value)) | 254 | if (!NILP (value)) |