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

Re: [StrongED] Re: ModeWhen - News



In message <56a69c9081Lists@xxxxxxxxxxx>
          "Richard Torrens (lists)" <Lists@xxxxxxxxxxx> wrote:

> In article <f33f60a656.fjgraute@xxxxxxxxx>,
>    Fred Graute <fjgraute@xxxxxxxxx> wrote:
> > In message <56a631c3aeLists@xxxxxxxxxxx>
> >           "Richard Torrens (lists)" <Lists@xxxxxxxxxxx> wrote:

[snip]

> > I'm a little confused by this. Are you saying that you have 2 _newstest
> > expressions in the same ModeWhen file?
> 
> Yes. In 
> !StrED_cfg.UserPrefs.Modes.News.ModeWhen
> I have exactly that:
> 
> Match
> 	_newstest	** ( < "From:")
> 	_newstest	** ( < "#! rmail")
> End
> 
> this causes Hewmes spooled incoming mail to open in News Mode but does
> nothing for the server-saves emails as they don't contain the start flag.

I've changed my News mode ModeWhen file so it has both expressions above
in its Match section. As I expected this doesn't work correctly. Only
the rmail expression is being used. Files with only a "From:" line no
longer open in News mode.

The reason is that the expressions are in a linked list and StrongED
will use the first expression with the correct name that it finds.

If I make sure that each expression has a unique name and that the
Include section is adjusted accordingly then everything works fine.

> > If the files are in specific directories on the server then you can set
> > up rules that match to those exact directories.
> 
> That was my other thought - but I thought first to enquire why the
> supplied test did not work.
> 
> <All the saved files get downloaded to
> Transient$TodayDir>.Spam.mail
> 
> Buy of course if I look at a file not today, ideally it should open
> properly as News too. 

You would have to create a rule that matches the full path of
'<Transient$TodayDir>.Spam.mail' but with a wildcard for the actual day
directories. Something like:

  fff, **.$.Transient.Default.*.Spam.mail

> I presume ModeWhen files are searched first and if no match occurs,
> BaseMode is used?

Applying ModeWhen rules is a two stage process:

 - First the rules are checked before the file is loaded to decide which
   mode to use.

 - After the file has been loaded the match expressions are checked to
   see if the initial mode needs to be overridden.

If none of the rules provide a match, BaseMode is used.

Cheers,
Fred.

-- 
StrongED Developer
http://www.stronged.iconbar.com/

-- 
To unsubscribe send a mail to StrongED+unsubscribe@xxxxxxxxxxx
List archives at http://www.Torrens.org/RO/StrongED/index.html