9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] plan9port's acme - open a file to a desired line number.
@ 2006-06-09  9:11 Lluís Batlle
  2006-06-09 10:27 ` quanstro
  2006-06-09 11:36 ` Arvindh Rajesh Tamilmani
  0 siblings, 2 replies; 13+ messages in thread
From: Lluís Batlle @ 2006-06-09  9:11 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Hi... I'd like to open a file in acme at line, let's say, 10.

acme file:10  # doesn't work

if I already started acme, I tried this way:

(echo name file; echo get; echo dot=10) | 9p write acme/new/ctl

But it doesn't work - it says the "dot=" command is ill-formed. What I
am doing wrong?

Thanks,
Lluís.


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

* Re: [9fans] plan9port's acme - open a file to a desired line number.
  2006-06-09  9:11 [9fans] plan9port's acme - open a file to a desired line number Lluís Batlle
@ 2006-06-09 10:27 ` quanstro
  2006-06-09 10:45   ` Axel Belinfante
  2006-06-09 11:36 ` Arvindh Rajesh Tamilmani
  1 sibling, 1 reply; 13+ messages in thread
From: quanstro @ 2006-06-09 10:27 UTC (permalink / raw)
  To: 9fans

try this:

	; plumb file:10

or use the 9term plumb menu.  you've got to either run awd manually
for this to work or redefine cd to

	fn cd { if(flag i)cd $* && awd }

better yet, run win(1) within acme and use b3 on the file:line combination.

- erik

On Fri Jun  9 04:13:15 CDT 2006, viriketo@gmail.com wrote:
> Hi... I'd like to open a file in acme at line, let's say, 10.
> 
> acme file:10  # doesn't work
> 
> if I already started acme, I tried this way:
> 
> (echo name file; echo get; echo dot=10) | 9p write acme/new/ctl
> 
> But it doesn't work - it says the "dot=" command is ill-formed. What I
> am doing wrong?
> 
> Thanks,
> Lluís.


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

* Re: [9fans] plan9port's acme - open a file to a desired line number.
  2006-06-09 10:27 ` quanstro
@ 2006-06-09 10:45   ` Axel Belinfante
  2006-06-09 10:57     ` Lluís Batlle
                       ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Axel Belinfante @ 2006-06-09 10:45 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="x-unknown", Size: 823 bytes --]

the B command also opens a file in acme from the command prompt:

	 ; B file:10

Axel.

> try this:
> 
> 	; plumb file:10
> 
> or use the 9term plumb menu.  you've got to either run awd manually
> for this to work or redefine cd to
> 
> 	fn cd { if(flag i)cd $* && awd }
> 
> better yet, run win(1) within acme and use b3 on the file:line combination.
> 
> - erik
> 
> On Fri Jun  9 04:13:15 CDT 2006, viriketo@gmail.com wrote:
> > Hi... I'd like to open a file in acme at line, let's say, 10.
> > 
> > acme file:10  # doesn't work
> > 
> > if I already started acme, I tried this way:
> > 
> > (echo name file; echo get; echo dot=10) | 9p write acme/new/ctl
> > 
> > But it doesn't work - it says the "dot=" command is ill-formed. What I
> > am doing wrong?
> > 
> > Thanks,
> > Lluís.


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

* Re: [9fans] plan9port's acme - open a file to a desired line number.
  2006-06-09 10:45   ` Axel Belinfante
@ 2006-06-09 10:57     ` Lluís Batlle
  2006-06-09 11:45       ` Axel Belinfante
  2006-06-09 11:29     ` quanstro
  2006-06-14 14:39     ` Lluís Batlle
  2 siblings, 1 reply; 13+ messages in thread
From: Lluís Batlle @ 2006-06-09 10:57 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Thanks, it works fine! I really needed to open a file from a command
(it's for cbrowser's Edit call).

2006/6/9, Axel Belinfante <Axel.Belinfante@cs.utwente.nl>:
> the B command also opens a file in acme from the command prompt:
>
>          ; B file:10
>
> Axel.
>
> > try this:
> >
> >       ; plumb file:10
> >
> > or use the 9term plumb menu.  you've got to either run awd manually
> > for this to work or redefine cd to
> >
> >       fn cd { if(flag i)cd $* && awd }
> >
> > better yet, run win(1) within acme and use b3 on the file:line combination.
> >
> > - erik
> >
> > On Fri Jun  9 04:13:15 CDT 2006, viriketo@gmail.com wrote:
> > > Hi... I'd like to open a file in acme at line, let's say, 10.
> > >
> > > acme file:10  # doesn't work
> > >
> > > if I already started acme, I tried this way:
> > >
> > > (echo name file; echo get; echo dot=10) | 9p write acme/new/ctl
> > >
> > > But it doesn't work - it says the "dot=" command is ill-formed. What I
> > > am doing wrong?
> > >
> > > Thanks,
> > > Lluís.
>


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

* Re: [9fans] plan9port's acme - open a file to a desired line number.
  2006-06-09 10:45   ` Axel Belinfante
  2006-06-09 10:57     ` Lluís Batlle
@ 2006-06-09 11:29     ` quanstro
  2006-06-14 14:39     ` Lluís Batlle
  2 siblings, 0 replies; 13+ messages in thread
From: quanstro @ 2006-06-09 11:29 UTC (permalink / raw)
  To: 9fans

good point.  what was i thinking.

does anyone know the reason that files on the command line are treated differently
than files passed in via the plumber?

- erik

On Fri Jun  9 05:46:53 CDT 2006, Axel.Belinfante@cs.utwente.nl wrote:
> the B command also opens a file in acme from the command prompt:
> 
> 	 ; B file:10
> 
> Axel.
> 
> > try this:
> > 
> > 	; plumb file:10
> > 
> > or use the 9term plumb menu.  you've got to either run awd manually
> > for this to work or redefine cd to
> > 
> > 	fn cd { if(flag i)cd $* && awd }


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

* Re: [9fans] plan9port's acme - open a file to a desired line number.
  2006-06-09  9:11 [9fans] plan9port's acme - open a file to a desired line number Lluís Batlle
  2006-06-09 10:27 ` quanstro
@ 2006-06-09 11:36 ` Arvindh Rajesh Tamilmani
  1 sibling, 0 replies; 13+ messages in thread
From: Arvindh Rajesh Tamilmani @ 2006-06-09 11:36 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> (echo name file; echo get; echo dot=10) | 9p write acme/new/ctl
>
> But it doesn't work - it says the "dot=" command is ill-formed. What I
> am doing wrong?

The address (10) has to be written to addr and not to ctl file.
To accomplish "B file:10" using acme control files:

	; . $PLAN9/lib/acme.rc
	; newwindow
	; winname /path/to/file
	; winctl get
	; echo -n 10 | winwrite addr
	; winctl 'dot=addr'

Arvindh


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

* Re: [9fans] plan9port's acme - open a file to a desired line number.
  2006-06-09 10:57     ` Lluís Batlle
@ 2006-06-09 11:45       ` Axel Belinfante
  2006-06-09 13:54         ` Paul Lalonde
  0 siblings, 1 reply; 13+ messages in thread
From: Axel Belinfante @ 2006-06-09 11:45 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="x-unknown", Size: 1558 bytes --]

note that there is also E. E (and B) are documented in sam(1) :

  B is a shell-level command that causes an instance of sam [or acme]
  running on the same terminal to load the named files. [...]

  E is a shell-level command that can be used as $EDITOR in a
  Unix environment. It runs B on file and then does not exit
  until file is changed, which is taken as a signal that file
  is done being edited.

Axel.


> Thanks, it works fine! I really needed to open a file from a command
> (it's for cbrowser's Edit call).
> 
> 2006/6/9, Axel Belinfante <Axel.Belinfante@cs.utwente.nl>:
> > the B command also opens a file in acme from the command prompt:
> >
> >          ; B file:10
> >
> >
> > > try this:
> > >
> > >       ; plumb file:10
> > >
> > > or use the 9term plumb menu.  you've got to either run awd manually
> > > for this to work or redefine cd to
> > >
> > >       fn cd { if(flag i)cd $* && awd }
> > >
> > > better yet, run win(1) within acme and use b3 on the file:line combinatio
> n.
> > >
> > > - erik
> > >
> > > On Fri Jun  9 04:13:15 CDT 2006, viriketo@gmail.com wrote:
> > > > Hi... I'd like to open a file in acme at line, let's say, 10.
> > > >
> > > > acme file:10  # doesn't work
> > > >
> > > > if I already started acme, I tried this way:
> > > >
> > > > (echo name file; echo get; echo dot=10) | 9p write acme/new/ctl
> > > >
> > > > But it doesn't work - it says the "dot=" command is ill-formed. What I
> > > > am doing wrong?
> > > >
> > > > Thanks,
> > > > Lluís.
> >


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

* Re: [9fans] plan9port's acme - open a file to a desired line number.
  2006-06-09 11:45       ` Axel Belinfante
@ 2006-06-09 13:54         ` Paul Lalonde
  0 siblings, 0 replies; 13+ messages in thread
From: Paul Lalonde @ 2006-06-09 13:54 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On 9-Jun-06, at 4:45 AM, Axel Belinfante wrote:
>   E is a shell-level command that can be used as $EDITOR in a
>   Unix environment. It runs B on file and then does not exit
>   until file is changed, which is taken as a signal that file
>   is done being edited.

Thank you!  You've just made acme my perforce check-in editor!

Genius :-)

Paul

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFEiX2VpJeHo/Fbu1wRAqhAAJ99mtwuU48H1qqYtZQ8KlwtHTOAawCeNHQf
qy+R5v6PTf5tIwyhzESkwVA=
=GnJz
-----END PGP SIGNATURE-----


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

* Re: [9fans] plan9port's acme - open a file to a desired line number.
  2006-06-09 10:45   ` Axel Belinfante
  2006-06-09 10:57     ` Lluís Batlle
  2006-06-09 11:29     ` quanstro
@ 2006-06-14 14:39     ` Lluís Batlle
  2006-06-14 15:29       ` Arvindh Rajesh Tamilmani
  2 siblings, 1 reply; 13+ messages in thread
From: Lluís Batlle @ 2006-06-14 14:39 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

I don't know how I didn't notice before, but it seems using "B" with
linenumber addressing doesn't work accessing files of a ClearCase view
(that is, a special filesystem in Linux). It opens a filename, as the
filename had the ":linenumber" within. If I right click the title of
the new void window created, it opens a new window with the correct
file, and the cursor at the specified line number.

Does anybody know if that wrong behaviour could be related to acme/B?
Of course I can open those files with gvim or some other editors
without problem - but in acme, not with B.

Ah, if I don't add a line number, the file is correctly opened in any
case (B or right click).

Any clue?

2006/6/9, Axel Belinfante <Axel.Belinfante@cs.utwente.nl>:
> the B command also opens a file in acme from the command prompt:
>
>          ; B file:10
>
> Axel.
>
> > try this:
> >
> >       ; plumb file:10
> >
> > or use the 9term plumb menu.  you've got to either run awd manually
> > for this to work or redefine cd to
> >
> >       fn cd { if(flag i)cd $* && awd }
> >
> > better yet, run win(1) within acme and use b3 on the file:line combination.
> >
> > - erik
> >
> > On Fri Jun  9 04:13:15 CDT 2006, viriketo@gmail.com wrote:
> > > Hi... I'd like to open a file in acme at line, let's say, 10.
> > >
> > > acme file:10  # doesn't work
> > >
> > > if I already started acme, I tried this way:
> > >
> > > (echo name file; echo get; echo dot=10) | 9p write acme/new/ctl
> > >
> > > But it doesn't work - it says the "dot=" command is ill-formed. What I
> > > am doing wrong?
> > >
> > > Thanks,
> > > Lluís.
>


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

* Re: [9fans] plan9port's acme - open a file to a desired line number.
  2006-06-14 14:39     ` Lluís Batlle
@ 2006-06-14 15:29       ` Arvindh Rajesh Tamilmani
  2006-06-14 15:35         ` Lluís Batlle
  2006-06-15 12:18         ` Arvindh Rajesh Tamilmani
  0 siblings, 2 replies; 13+ messages in thread
From: Arvindh Rajesh Tamilmani @ 2006-06-14 15:29 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> I don't know how I didn't notice before, but it seems using "B" with
> linenumber addressing doesn't work accessing files of a ClearCase view
> (that is, a special filesystem in Linux). It opens a filename, as the
> filename had the ":linenumber" within.

This happens because plumber was started before setting
the dynamic view.  If both plumber and acme are started
after setting the view, "B file:linenumber" will work fine.

Arvindh


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

* Re: [9fans] plan9port's acme - open a file to a desired line number.
  2006-06-14 15:29       ` Arvindh Rajesh Tamilmani
@ 2006-06-14 15:35         ` Lluís Batlle
  2006-06-15 12:18         ` Arvindh Rajesh Tamilmani
  1 sibling, 0 replies; 13+ messages in thread
From: Lluís Batlle @ 2006-06-14 15:35 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

2006/6/14, Arvindh Rajesh Tamilmani <arvindht@gmail.com>:
> > I don't know how I didn't notice before, but it seems using "B" with
> > linenumber addressing doesn't work accessing files of a ClearCase view
> > (that is, a special filesystem in Linux). It opens a filename, as the
> > filename had the ":linenumber" within.
>
> This happens because plumber was started before setting
> the dynamic view.  If both plumber and acme are started
> after setting the view, "B file:linenumber" will work fine.
True, it works... I forgot about the plumber!

Thank you very much.

Lluís.


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

* Re: [9fans] plan9port's acme - open a file to a desired line number.
  2006-06-14 15:29       ` Arvindh Rajesh Tamilmani
  2006-06-14 15:35         ` Lluís Batlle
@ 2006-06-15 12:18         ` Arvindh Rajesh Tamilmani
  2006-06-15 13:05           ` Lluís Batlle
  1 sibling, 1 reply; 13+ messages in thread
From: Arvindh Rajesh Tamilmani @ 2006-06-15 12:18 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> > I don't know how I didn't notice before, but it seems using "B" with
> > linenumber addressing doesn't work accessing files of a ClearCase view
> > (that is, a special filesystem in Linux). It opens a filename, as the
> > filename had the ":linenumber" within.
>
> This happens because plumber was started before setting
> the dynamic view.  If both plumber and acme are started
> after setting the view, "B file:linenumber" will work fine.

To avoid restarting plumber and acme everytime the view
is changed, you may replace calls to cleanname in B
    `cleanname -d "$pwd" "$i"`
with
    `cleanname -d "$pwd" "$i" | sed "s;^/vobs/;$CLEARCASE_ROOT&;"`
(assuming all VOB tags start with /vobs.)

Arvindh


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

* Re: [9fans] plan9port's acme - open a file to a desired line number.
  2006-06-15 12:18         ` Arvindh Rajesh Tamilmani
@ 2006-06-15 13:05           ` Lluís Batlle
  0 siblings, 0 replies; 13+ messages in thread
From: Lluís Batlle @ 2006-06-15 13:05 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Oh that's nice. In fact what I did is changing the namespace for it to
depend on $CLEARCASE_ROOT - it worked, but I had to start a plumber
every time. I'll try your solution.

Thanks!

2006/6/15, Arvindh Rajesh Tamilmani <arvindht@gmail.com>:
> > > I don't know how I didn't notice before, but it seems using "B" with
> > > linenumber addressing doesn't work accessing files of a ClearCase view
> > > (that is, a special filesystem in Linux). It opens a filename, as the
> > > filename had the ":linenumber" within.
> >
> > This happens because plumber was started before setting
> > the dynamic view.  If both plumber and acme are started
> > after setting the view, "B file:linenumber" will work fine.
>
> To avoid restarting plumber and acme everytime the view
> is changed, you may replace calls to cleanname in B
>     `cleanname -d "$pwd" "$i"`
> with
>     `cleanname -d "$pwd" "$i" | sed "s;^/vobs/;$CLEARCASE_ROOT&;"`
> (assuming all VOB tags start with /vobs.)
>
> Arvindh
>


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

end of thread, other threads:[~2006-06-15 13:05 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-09  9:11 [9fans] plan9port's acme - open a file to a desired line number Lluís Batlle
2006-06-09 10:27 ` quanstro
2006-06-09 10:45   ` Axel Belinfante
2006-06-09 10:57     ` Lluís Batlle
2006-06-09 11:45       ` Axel Belinfante
2006-06-09 13:54         ` Paul Lalonde
2006-06-09 11:29     ` quanstro
2006-06-14 14:39     ` Lluís Batlle
2006-06-14 15:29       ` Arvindh Rajesh Tamilmani
2006-06-14 15:35         ` Lluís Batlle
2006-06-15 12:18         ` Arvindh Rajesh Tamilmani
2006-06-15 13:05           ` Lluís Batlle
2006-06-09 11:36 ` Arvindh Rajesh Tamilmani

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).