GNU bug report logs - #64303
30.0.50; Android build: use Activities as a way to interact with emacsclient?

Previous Next

Package: emacs;

Reported by: Ant <n58r <at> pm.me>

Date: Mon, 26 Jun 2023 16:23:01 UTC

Severity: normal

Found in version 30.0.50

To reply to this bug, email your comments to 64303 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#64303; Package emacs. (Mon, 26 Jun 2023 16:23:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ant <n58r <at> pm.me>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 26 Jun 2023 16:23:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ant <n58r <at> pm.me>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50;
 Android build: use Activities as a way to interact with emacsclient?
Date: Mon, 26 Jun 2023 16:21:52 +0000
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!










Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64303; Package emacs. (Tue, 27 Jun 2023 00:43:02 GMT) Full text and rfc822 format available.

Message #8 received at 64303 <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Ant <n58r <at> pm.me>
Cc: 64303 <at> debbugs.gnu.org
Subject: Re: bug#64303: 30.0.50; Android build: use Activities as a way to
 interact with emacsclient?
Date: Tue, 27 Jun 2023 08:42:14 +0800
Ant <n58r <at> 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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64303; Package emacs. (Thu, 29 Jun 2023 09:23:02 GMT) Full text and rfc822 format available.

Message #11 received at 64303 <at> debbugs.gnu.org (full text, mbox):

From: Ant <n58r <at> pm.me>
To: Po Lu <luangruo <at> yahoo.com>
Cc: 64303 <at> debbugs.gnu.org
Subject: Re: bug#64303: 30.0.50;
 Android build: use Activities as a way to interact with emacsclient?
Date: Thu, 29 Jun 2023 09:22:08 +0000
[Message part 1 (text/plain, inline)]
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!
[Message part 2 (text/html, inline)]

This bug report was last modified 1 year and 151 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.