unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#64303: 30.0.50; Android build: use Activities as a way to interact with emacsclient?
@ 2023-06-26 16:21 Ant via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-06-27  0:42 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 3+ messages in thread
From: Ant via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-06-26 16:21 UTC (permalink / raw)
  To: 64303


The EmacsActivity.java and EmacsOpenActivity.java files show that it is
possible to pass argument by means of Android Activities. Furthermore,
EmacsOpenActivity (the file that handles Emacs selection in "Open
With..." dialogs) does use emacsclient (or its equivalent
libemacsclient.so) in order to reuse the same Emacs instance and frame.

It is possible to manually invoke Android Activities (with custom 
parameters) by means of the
command "am" in
the adb shell, the command "am" in the Termux shell or also by means of
some Androids applications like ActivityManager
(https://github.com/sdex/ActivityManager) that also allows to make
shortcuts out of them.

It could be an idea to "generalize" EmacsOpenActivity and to have an
activity that allows to insert custom parameters that would be fed to
libemacsclient. EmacsActivity.java already does something similar, by
means of the extra argument "org.gnus.emacs.STARTUP_ARGUMENT".

One use case would be, trivially, to have a shortcut for
org-capture or some other org-protocol.

I'm not an Android guru myself and so I don't know whether this is a good
idea or not, security-wise. Also, I don't know if this is just an hack
that won't last too long anyway.

I'd like to know your opinions in this regard. Thank you in advance!











^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#64303: 30.0.50; Android build: use Activities as a way to interact with emacsclient?
  2023-06-26 16:21 bug#64303: 30.0.50; Android build: use Activities as a way to interact with emacsclient? Ant via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-06-27  0:42 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-06-29  9:22   ` Ant via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 3+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-06-27  0:42 UTC (permalink / raw)
  To: Ant; +Cc: 64303

Ant <n58r@pm.me> writes:

> The EmacsActivity.java and EmacsOpenActivity.java files show that it is
> possible to pass argument by means of Android Activities. Furthermore,
> EmacsOpenActivity (the file that handles Emacs selection in "Open
> With..." dialogs) does use emacsclient (or its equivalent
> libemacsclient.so) in order to reuse the same Emacs instance and frame.
>
> It is possible to manually invoke Android Activities (with custom 
> parameters) by means of the
> command "am" in
> the adb shell, the command "am" in the Termux shell or also by means of
> some Androids applications like ActivityManager
> (https://github.com/sdex/ActivityManager) that also allows to make
> shortcuts out of them.
>
> It could be an idea to "generalize" EmacsOpenActivity and to have an
> activity that allows to insert custom parameters that would be fed to
> libemacsclient. EmacsActivity.java already does something similar, by
> means of the extra argument "org.gnus.emacs.STARTUP_ARGUMENT".
>
> One use case would be, trivially, to have a shortcut for
> org-capture or some other org-protocol.
>
> I'm not an Android guru myself and so I don't know whether this is a good
> idea or not, security-wise. Also, I don't know if this is just an hack
> that won't last too long anyway.
>
> I'd like to know your opinions in this regard. Thank you in advance!

Since this will be similar to controlling the Emacs server through ICE
or D-Bus, we should wait a similar feature to be available on free
systems before implementing this on Android.

Otherwise, this sounds like a good idea.  I will see if I can do both.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#64303: 30.0.50; Android build: use Activities as a way to interact with emacsclient?
  2023-06-27  0:42 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-06-29  9:22   ` Ant via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 3+ messages in thread
From: Ant via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-06-29  9:22 UTC (permalink / raw)
  To: Po Lu; +Cc: 64303

[-- Attachment #1: Type: text/plain, Size: 682 bytes --]

Sorry for the late reply.

On 27/06/23 02:42, Po Lu wrote:

> Since this will be similar to controlling the Emacs server through ICE
> or D-Bus, we should wait a similar feature to be available on free
> systems before implementing this on Android.

It makes sense. It is worth pointing out that that this feature looks more useful on Android than on any system (I think) Emacs is capable of running on, since Android - unlike the other systems - can't access the built-in emacsclient binary by any means. You'd have to install emacsclient separately (e.g. from Termux) and to communicate via TCP

> Otherwise, this sounds like a good idea.  I will see if I can do both.

Thank you!

[-- Attachment #2: Type: text/html, Size: 1380 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-06-29  9:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-26 16:21 bug#64303: 30.0.50; Android build: use Activities as a way to interact with emacsclient? Ant via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-27  0:42 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-29  9:22   ` Ant via Bug reports for GNU Emacs, the Swiss army knife of text editors

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).