[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [StrongED] Re: Rescan

In message <573d85f4b9Lists@xxxxxxxxxxx>
          "Richard Torrens (lists)" <Lists@xxxxxxxxxxx> wrote:

> In article <4535cc3c57.fjgraute@xxxxxxxxx>,
>    Fred Graute <fjgraute@xxxxxxxxx> wrote:
> > You can force a rescan from an Obey file by using:
> >   Message StrongED_ExecCmds RescanModes()
> > However this only works if there is a StrongED view that has the input
> > focus. The problem here is that recent versions of RISC OS 5 support
> > keyboard shortcuts in the Filer.
> > Because of this, as soon as you click in a Filer window it will gain the
> > input focus and hence StrongED loses it and the command(s) sent to it
> > from the Obey file will be ignored.
> > If you can find a way to execute the Obey file from the keyboard (eg
> > Configure -> Keyboard) or a menu (eg StrongMen) then it will work.
> Your last answer provides food for thought - after the brain-ache subsides!
> I now have an Obey file which, when run, renames th two modefies
> correctly. Running it from Blinds keeps the same StrongED window live, as
> expected.
> The last line of the ObeyFile is indeed 
> Message StrongED_ExecCmds RescanModes()
> But it does not work! More weirdly, after running it, doing Rescan dir ->
> Modefile does nothinbg. To get the new modefile recognised I have to quite
> and re-run StrongED! 

Apologies, I've now reread your original post more carefully and see
that you want to reparse the ModeFile after swapping two versions.

RescanModes can't be used for that as it only checks if there are any
modes that StrongED doesn't know about yet, ie that were added after
StrongED was started.

After a lot of experimentation I have managed to do what you want but in
quite a roundabout way. *** Important for this to work the view with the
input focus must in the mode that needs to be reparsed. ***

The Obey file that renames the two ModeFiles should end with:

  Message StrongED_ExecCmds SetTmp() LoadOne("<StrongED$Tmp_ModePath>.ModeFile")
  Filer_Run <pathname>

Where <pathname> points to a second Obey file that contains the line

  Message StrongED_ExecCmds SaveKill()

What this does is that after renaming the two ModeFiles the one now
called 'ModeFile' gets loaded. The second Obey file will save it forcing
a reparse and then kills the text with the ModeFile.

We can't save it from the first Obey file as that would save the text
with the input focus not the freshly loaded ModeFile. This because SE
hasn't yet received the GainCaret event from the Wimp, the Filer_Run
allows for this to happen.


StrongED Developer

To unsubscribe send a mail to StrongED+unsubscribe@xxxxxxxxxxx
List archives and instructions at