The string is written to inputx_jrx_, then after all Qt events have
finished processing, the interpreter is called with:

  0!:100 inputx_jrx_    NB. or 0!:101 for display

This runs in the current context. For example, try:

  F3;1;test;coname''


On Sat, Oct 4, 2014 at 12:36 PM, Henry Rich <[email protected]> wrote:

> 1. In what locale is the text executed in modes 0 & 1?
>
> 2. If it is not executed in the user context, can I use the immex trick to
> cause a sentence to execute in the user's context?  The question here is
> really what the relationship of the IDE to the engine is - does the IDE
> just feed sentences to the engine, with the text being another such
> sentence?
>
> I am thinking that to execute a sentence in user context I would have:
>
> Case 1 (if the sentence runs in a fixed locale like jijs):
>
> F5;1;Dissect Current;rundissect_jijs_ 0
>
> and
>
> dissect_jijs_ =: 3 : 0
> get text of line under cursor;
>
> set immex to the line;
> )
>
>
> Case 2 (if the sentence runs in user context including suspension etc)
>
> F5;1;Dissect Current;dissect get_cursor_line ''
>
>
> Henry Rich
>
>
>
>
> On 10/4/2014 3:12 PM, chris burke wrote:
>
>> Agreed on the modes, thanks.
>>
>> Yes, the next beta will have get/set of text, selection, and position for
>> the term/edit/edit2 windows.
>>
>> On Sat, Oct 4, 2014 at 11:27 AM, 'Pascal Jasmin' via Beta <
>> [email protected]> wrote:
>>
>>  Thank you Chris,
>>>
>>> perhaps there is a reason to keep the existing mode 2 behaviour, which is
>>> to append to the bottom of the "document".
>>> mode 3 - append at cursor position
>>> mode 4 - append at end of current line.
>>>
>>> Is there also a way to get/set the contents of the current window
>>> (term/editor)?
>>>
>>> thank you.
>>>
>>>
>>> ----- Original Message -----
>>> From: chris burke <[email protected]>
>>> To: Beta forum <[email protected]>
>>> Cc:
>>> Sent: Saturday, October 4, 2014 12:48 PM
>>> Subject: Re: [Jbeta] user defined keys
>>>
>>> Thanks for the suggestions.
>>>
>>> 1. Agreed that mode 2 should append to the current line, not the
>>> following
>>> line, and that it should be to the current window (term or edit).
>>>
>>> 2. I like the other suggestions, but wonder if the following might work
>>> better:
>>>
>>> * mode 3 is like mode 2, except insert into the current line at the
>>> current cursor position
>>>
>>> * when a user key is pressed, the current window text and current window
>>> selection (cursor position if no selection) are first written to globals
>>> in
>>> the jqtide locale. This means that any expression run in modes 0 or 1 can
>>> use them as parameters, and I think this captures the intent of the 2nd
>>> mode digit.
>>>
>>> 3. The next J803 beta has commands to query the text and select state of
>>> the term or edit windows.
>>>
>>>
>>>
>>>
>>>
>>> On Tue, Sep 16, 2014 at 10:39 AM, 'Pascal Jasmin' via Beta <
>>> [email protected]> wrote:
>>>
>>>  defining this in userkeys.cfg
>>>>
>>>> F3;2;add|;|
>>>>
>>>> where the token chosen is actually 28 { a.
>>>>
>>>> there's 2 problems:
>>>>
>>>> 1. instead of inserting into the current terminal (jqt repl) line, it
>>>> creates and inserts on the following line.  If this is intended, perhaps
>>>> there could be a mode 3, that inserts at current cursor position?
>>>>
>>>> 2. In the editor, pressing the shortcut also inserts to terminal instead
>>>> of in editor.  Even if selected through menu option.
>>>>
>>>> A request would be to have mode use an optional 2nd digit to pass
>>>> parameters:
>>>> 0 - same as elided, no parameter
>>>> 1 - selection (with say line feeds inserted if multi lines)
>>>> 2 - whole line as y parameter to monad
>>>> 3 - left of cursor as x, right of cursor as y
>>>>
>>>> '' would be substituted for no data at left or right or in line or
>>>> selection.
>>>>
>>>> Perhaps there already is, or could be, a way to query the line and
>>>> cursor
>>>> position in both editor and jqt terminal?
>>>>
>>>> These 2 modes aren't important enough.  They would allow returning a
>>>>
>>> verb,
>>>
>>>> but its hard to imagine an application.
>>>> 4 - left of cursor as m to adverb
>>>> 5 - whole line as m to adverb.
>>>> ----------------------------------------------------------------------
>>>> 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
>>
>>  ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to