9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] question re acme and plumber
@ 2019-07-10 18:44 James A. Robinson
  2019-07-11  6:25 ` Martin Kühl
  0 siblings, 1 reply; 6+ messages in thread
From: James A. Robinson @ 2019-07-10 18:44 UTC (permalink / raw)
  To: 9fans

If I add a plumber rule for javac output:

type is text
data matches '\[ERROR\] ([.a-zA-Z¡-�0-9_/\-]+\.java):\[([0-9]+),[0-9]+\] .*'
arg isfile $1
data set $file
attr add addr=$2
plumb to edit
plumb client $editor

I can sweep a line (short of its trailing newline):

[ERROR] /Users/jimr/proj/github/src/github.com/.../Cpio.java:[151,31]
';' expected

in acme using button 3 and open up Cpio.java:151.  Is there any way
for me to just button 3 click within the text of the filename to get
the same behavior?

Also I had hoped I could do something like

attr add addr=$2'-+#'$3

(assuming I captured the 2nd number in the data matches line), but it
turns out Java is producing a 'column number', which means a tab is +8
column positions.  My only thought upon discovering that was that I'd
have to write some custom program to pick out the $1:$2 and evaluate
it to determine what the actual character count was.  Anyone have a
better suggestion?  The sam(1) addressing appeared to, very sensibly
imo, limit itself to talking about lines, character counts, and
regular expressions...

Jim



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

end of thread, other threads:[~2019-07-25 20:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-10 18:44 [9fans] question re acme and plumber James A. Robinson
2019-07-11  6:25 ` Martin Kühl
2019-07-11 19:57   ` James A. Robinson
2019-07-11 21:28     ` James A. Robinson
2019-07-24 21:18       ` Ole-Hjalmar Kristensen
2019-07-25 20:54         ` 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).