You are right.
This works:
require'regex'
edit=:3 :0
open file=. (4!:4<y){4!:3''
match=. ,('^ *',y,' *=:')rxmatch toJ fread file
if. match-._1 do.
wd 'sm set edit select ',":+/\match
end.
)
Thanks,
--
Raul
On Fri, Sep 11, 2015 at 12:06 AM, bill lam <[email protected]> wrote:
> If you are using window, eol of file scripts is CRLF, so the tsrep should
> appear somewhere near the 672 line, I suspect you need a toJ
> after fread.
>
> Чт, 10 сен 2015, Raul Miller написал(а):
>> Doh...
>>
>> Thank you, I don't know how I missed that I had missed that.
>>
>> That said, this doesn't do what I need (it positions the edit window
>> on my screen, and I want to position the cursor within the edit
>> window). But I could use the 'set select' mechanism. Except, it
>> doesn't do what I expect, so I am still missing an important concept.
>>
>> Here is a draft implementation of edit:
>>
>> require'regex'
>> edit=:3 :0
>> open file=. (4!:4<y){4!:3''
>> match=. ,('^ *',y,' *=:')rxmatch fread file
>> if. match-._1 do.
>> wd 'sm set edit select ',":+/\match
>> end.
>> )
>>
>> But:
>> edit 'tsrep'
>> does not position the selection where the match is, for me.
>>
>> match is: 14541 7
>> but the selected text is: 8{.15213}.fread file
>>
>> I do not understand the off-by-672 error for that selection start.
>>
>> Still, this is promising... if I could just wrap my head around how it works.
>>
>> Thanks,
>>
>> --
>> Raul
>>
>> P.S.
>> JVERSION
>> Engine: j803/2014-10-19-11:11:11
>> Library: 8.04.11
>> Qt IDE: 1.4.4/5.4.2
>> Platform: Win 64
>> Installer: J804 install
>> InstallPath: c:/users/user/j64-804
>>
>>
>> On Thu, Sep 10, 2015 at 11:11 PM, chris burke <[email protected]> wrote:
>> >> sm : unrecognized sm command: set edit 30 -1 -1
>> >
>> > This should be:
>> >
>> > wd 'sm set edit xywh -1 30 -1 -1'
>> >
>> > On 10 September 2015 at 19:36, Raul Miller <[email protected]> wrote:
>> >
>> >> That looks promising, but somehow it doesn't quite seem to work like I
>> >> would expect, given that documentation:
>> >>
>> >> test=:3 :0
>> >> open '~user/temp/1.ijs'
>> >> wd 'sm set edit -1 30 -1 -1'
>> >> )
>> >>
>> >> test''
>> >> |sm : unrecognized sm command: set edit 30 -1 -1
>> >>
>> >> test=: 3 : 0
>> >> open '~user/temp/1.ijs'
>> >> wd 'sm set edit * 0 30 -1 -1'
>> >> )
>> >>
>> >> test''
>> >> |sm : unrecognized sm command: set edit 0 30 -1 -1
>> >>
>> >> Are there working examples of positioning the active edit window to a
>> >> given line?
>> >>
>> >> Thanks,
>> >>
>> >> --
>> >> Raul
>> >>
>> >>
>> >> On Thu, Sep 10, 2015 at 8:24 PM, Henry Rich <[email protected]> wrote:
>> >> > J804 has many commands for working with term and edit windows. See
>> >> >
>> >> > http://www.jsoftware.com/jwiki/Guides/Window%20Driver/Session%20Manager
>> >> >
>> >> > Henry Rich
>> >> >
>> >> >
>> >> > On 9/10/2015 2:37 PM, Raul Miller wrote:
>> >> >>
>> >> >> Speaking of things we miss from j602, I really liked the (edit) verb,
>> >> >> for inspecting definitions in context.
>> >> >>
>> >> >> Here's the best I can currently approximate it in j804:
>> >> >>
>> >> >> edit=:3 :0
>> >> >> open (4!:3''){~4!:4<y
>> >> >> )
>> >> >>
>> >> >> Example use:
>> >> >>
>> >> >> edit 'tsrep'
>> >> >>
>> >> >> This example gives me system/main/stdlib.ijs in an editor window. What
>> >> >> it doesn't do is find anything that looks like the definition of tsrep
>> >> >> in that file.
>> >> >>
>> >> >> And there's some justice for that - sometimes what looks like the
>> >> >> definition isn't really the definition. But I'd like to try. Maybe put
>> >> >> a user interface in front of it, if it seems ambiguous?
>> >> >>
>> >> >> But I don't know how to move to a position within the opened file.
>> >> >>
>> >> >> Looking at the definition of open:
>> >> >>
>> >> >> 3 : 'wd ''openj *'' , > {. getscripts_j_ y'
>> >> >>
>> >> >> So it's a wd command. But google is useless, and I don't specifically
>> >> >> know where to go to find any relevant reference.
>> >> >>
>> >> >> Looking through:
>> >> >>
>> >> >> http://www.jsoftware.com/jwiki/Guides/Window%20Driver/ChildClasses
>> >> >>
>> >> http://www.jsoftware.com/jwiki/Guides/Window%20Driver/Command%20Reference
>> >> >> http://www.jsoftware.com/jwiki/Guides/Window%20Driver/Parent
>> >> >> http://www.jsoftware.com/jwiki/Guides/Window%20Driver/Window%20Controls
>> >> >>
>> >> >>
>> >> http://www.jsoftware.com/jwiki/Guides/Window%20Driver/Window%20Driver%20Overview
>> >> >>
>> >> >> finds me nothing on 'openj'.
>> >> >>
>> >> >> I might be able to find something under http://jsoftware.com/websvn/
>> >> >> but that's a fairly hostile environment for searching. Still, spending
>> >> >> a few minutes there suggests that the c++ sources are no longer
>> >> >> visible to me.
>> >> >>
>> >> >> At a guess, though, the code is currently not designed to support J
>> >> >> driving the behavior of the edit windows.
>> >> >>
>> >> >
>> >> > ----------------------------------------------------------------------
>> >> > For information about J forums see http://www.jsoftware.com/forums.htm
>> >> ----------------------------------------------------------------------
>> >> For information about J forums see http://www.jsoftware.com/forums.htm
>> >>
>> > ----------------------------------------------------------------------
>> > For information about J forums see http://www.jsoftware.com/forums.htm
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>
> --
> regards,
> ====================================================
> GPG key 1024D/4434BAB3 2008-08-24
> gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
> gpg --keyserver subkeys.pgp.net --armor --export 4434BAB3
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm