[Top] [All Lists]

Re: imapflags and variables

2003-05-12 15:15:34

[Marc Mutz]:

  On Sunday 11 May 2003 05:16, Kjetil Torgrim Homme wrote:
  > Marc suggests a system variable for accessing the current value,
  > ${#imapflags}.
  Actually, I suggested a test for it, but ok.

sorry, I have missed that.  would you mind repeating it?  I think it
makes sense.

  > you can get rid of ':globalflags_plus "Flag"' like 
  > this:
  >         keep :flags "${#imapflags} Flag";
  more like
    set "safe_flags" "${#imapflags}";
    addflag "Flag";
    keep :globalflags
    setflags "${safe_flags}";

this was the added verbosity I hinted at if :flags was removed.

  > my suggestion is to add a another action instead, only available when
  > the variables extension is in effect:
  >         STOREFLAGS <variable: string>
  The downside of that is that you need to come up with such an
  action for each and every extension that possibly wants to store
  away state temporarily.

true.  it remains to be seen how common that is, though.

  So how could imapflags progress in this light? I see two routes:
  I non-system variables:
  1. Dump :globalflags, keep only :flags. This means that implicit
  keep never sets any flags, but you can always end your script with
  an explicit keep (multiscript might make problems, though).

the implicit keep can't be emulated _that_ easily.  consider

  if ... {
     fileinto "somewhere";
  keep :flags "${myflags}";

(message uniqueness only concerns a single folder.)

so you'd need to keep track of it yourself.

  if ... {
    set "kept" "yes";
    fileinto "somewhere";
  if not string "${kept}" "yes" {
    keep :flags "${myflags}";

thank you for your very useful summary!

Kjetil T.

<Prev in Thread] Current Thread [Next in Thread>