Using AfterFix Event

SALT, SPICE, Subversion, etc...

Using AfterFix Event

Postby augustk on Fri Apr 12, 2019 12:24 pm

When a function is fixed in the editor window I would like to perform a few additional tasks. I have seen that the namespace script ⎕SE.SALTUtils uses the event 'AfterFix'. How and where do I define a function which is called when this event is triggered? I would like the function to be called when I press Ctrl-down in the editor window.
augustk
 
Posts: 27
Joined: Tue Feb 05, 2019 11:54 am

Re: Using AfterFix Event

Postby Phil Last on Sat Apr 13, 2019 7:33 am

The `EditorFix` function in `SALTUtils` sets itself `⎕IO⊃⎕XSI` as the callback. This keeps the code together rather than introducing unnecessary dependencies.

If you want to do other than copy `EditorFix` I suggest you do a considerable amount of experimentation because there is no documentation for this event or its earlier relation `Fix` and the connections between pressing [Escape] [Shift+Escape], having confirmations on Close, Exit and Abort, having changed the item or not are complex.

Also when the `Fix` event was first exposed in 2006 I extracted a vague promise that changes to the event would be announced. At least to those few who were known to be using it. So far I've discovered changes only when they have caused initially inexplicable errors.
User avatar
Phil Last
 
Posts: 624
Joined: Thu Jun 18, 2009 6:29 pm
Location: Wessex

Re: Using AfterFix Event

Postby Morten|Dyalog on Mon Apr 15, 2019 6:30 am

Phil Last wrote:Also when the `Fix` event was first exposed in 2006 I extracted a vague promise that changes to the event would be announced. At least to those few who were known to be using it. So far I've discovered changes only when they have caused initially inexplicable errors.


We are aware that the current mechanism makes it difficult to replace or modify the behaviour that Dyalog is taking advantage of for SALT and now Link (https://github.com/dyalog/link). We will make it a priority to define a generic hook.

Note that AfterFix only makes it possible to run code when the function is "fixed" (Esc or File|Fix) - not on any arbitrary keystroke.
User avatar
Morten|Dyalog
 
Posts: 451
Joined: Tue Sep 09, 2008 3:52 pm


Return to Source Code Management

Who is online

Users browsing this forum: No registered users and 1 guest