9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] 9p write event to Acme?
@ 2013-08-29  6:47 James A. Robinson
  2013-08-30 12:41 ` James A. Robinson
  0 siblings, 1 reply; 2+ messages in thread
From: James A. Robinson @ 2013-08-29  6:47 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

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

[argh, I posted this to the google group though I know that it won't show
up...]

Folks,

I'm interested in writing some Acme commands to simulate
execution of certain built-in commands.  For example, I would
like to be able to simulate the user 2-1 chording on an Edit
command in the tag.

Is my understanding correct if I am thinking that this would
consist of a single event

c0: M
c1: x
flag ^= 8
nb: 4
nr: 4
text: Edit
arg: ...

where ... represents the argument passed to Edit?
Or would this consist of two events, with text set
to Edit and then to the command to pass in?

It's not clear to me if I also have muck with q0, q1,
oq0, oq1 or loc.  I was guessing that only people
reading an event would be interested in those.

I looked around to see if I could find examples of
programs sending events to acme via 9p, but I haven't
managed to find them.  I see several examples of
scripts calling something named winwriteevent, and
the man page for that sounds promising, but I don't
see it as part of plan9port, and I was guessing that
people might use 9p write to acme/$winid/event
instead, or write Go/C program using the acme api
libraries that Russ provided?

Jim

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

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

* Re: [9fans] 9p write event to Acme?
  2013-08-29  6:47 [9fans] 9p write event to Acme? James A. Robinson
@ 2013-08-30 12:41 ` James A. Robinson
  0 siblings, 0 replies; 2+ messages in thread
From: James A. Robinson @ 2013-08-30 12:41 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

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

So I see that it actually isn't possible to do what
I want, that the write operations to an event file
are limited to just positional information.  That's
unfortunate, I had really hoped it was possible to
simulate events via an external program.


.../src/libacme/acme.c:

int
winwriteevent(Win *w, Event *e)
{
char buf[100];

snprint(buf, sizeof buf, "%c%c%d %d \n", e->c1, e->c2, e->q0, e->q1);
return fswrite(wfid(w, "event"), buf, strlen(buf));
}

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

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

end of thread, other threads:[~2013-08-30 12:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-29  6:47 [9fans] 9p write event to Acme? James A. Robinson
2013-08-30 12:41 ` James A. Robinson

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 NNTP newsgroup(s).