Pegasus Mail Suggestions
pmail filter operation: skip command, highlight command

[quote user="Neil Fraser"]SKIP command

In place of the SkipNext "" command, I would like to suggest a Skip "N" command where N is the number of lines to skip.  This will allow a condition to be tested and multiple lines skipped without the need for a Label.  <...> In a particular script of mine where a lot of tests are done, it would make the code much more elegant[/quote]

Pegasus provides powerful filtering tools, inviting users to build large and complex scripts. There is definitely a need for the scripting language to match those capabilities, but...  I believe there are a couple of real drawbacks to the suggested solution:

  • Less readable code
  • Major maintenance headaches, for example when later adding or deleting rules inside the skipped range
These were lessons learned by many, many using a multitude of computer languages over 40+ years. Because of this, I vote no to the suggestion. I would much prefer a solution along the following lines:
  • A structured IF ... END construct that encapsulates and hides the underlying GOTOs
  • The possibility to combine multiple matching rules with AND and OR operators
[quote user="Neil Fraser"]HIGHLIGHT / COLOUR commands

It appears that applying a highlight does not affect the email until the script is complete.  I tried setting a colour to an email in my script then testing for this colour later in script, using colour as a marker.  Is this modus operandi intentional, or could the highlight command be made to take effect at the point in the script where it is used?[/quote]

AFAIK this applies to all modifications made by the filtering script. Similarly, running an external task against the message is done using a copy, so the external task can not modify the contents of the actual email.

I would welcome a change to the script semantics, making changes visible immediately. This probably has to be discussed further due to possible side effects. Migration of old scripts? When should a MOVE MESSAGE take place and what does that mean for the rest of the script?

&lt;p&gt;[quote user=&quot;Neil Fraser&quot;]SKIP command&lt;/p&gt;&lt;p&gt;In place of the SkipNext &quot;&quot; command, I would like to suggest a Skip &quot;N&quot; command where N is the number of lines to skip.&amp;nbsp; This will allow a condition to be tested and multiple lines skipped without the need for a Label.&amp;nbsp; &amp;lt;...&amp;gt; In a particular script of mine where a lot of tests are done, it would make the code much more elegant[/quote]&lt;/p&gt;&lt;p&gt;Pegasus provides powerful filtering tools, inviting users to build large and complex scripts. There is definitely a need for the scripting language to match those capabilities, but...&amp;nbsp; I believe there are a couple of real drawbacks to the suggested solution:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Less readable code &lt;/li&gt;&lt;li&gt;Major maintenance headaches, for example when later adding or deleting rules inside the skipped range&lt;/li&gt;&lt;/ul&gt;These were lessons learned by many, many using a multitude of computer languages over 40+ years. Because of this, I vote no to the suggestion. I would much prefer a solution along the following lines:&lt;ul&gt;&lt;li&gt;A structured IF ... END construct that encapsulates and hides the underlying GOTOs&lt;/li&gt;&lt;li&gt;The possibility to combine multiple matching rules with AND and OR operators &lt;/li&gt;&lt;/ul&gt;[quote user=&quot;Neil Fraser&quot;]HIGHLIGHT / COLOUR commands&lt;p&gt;It appears that applying a highlight does not affect the email until the script is complete.&amp;nbsp; I tried setting a colour to an email in my script then testing for this colour later in script, using colour as a marker.&amp;nbsp; Is this modus operandi intentional, or could the highlight command be made to take effect at the point in the script where it is used?[/quote]&lt;/p&gt;&lt;p&gt;AFAIK this applies to all modifications made by the filtering script. Similarly, running an external task against the message is done using a copy, so the external task can not modify the contents of the actual email.&lt;/p&gt;&lt;p&gt;I would welcome a change to the script semantics, making changes visible immediately. This probably has to be discussed further due to possible side effects. Migration of old scripts? When should a MOVE MESSAGE take place and what does that mean for the rest of the script? &lt;/p&gt;

SKIP command

In place of the SkipNext "" command, I would like to suggest a Skip "N" command where N is the number of lines to skip.  This will allow a condition to be tested and multiple lines skipped without the need for a Label.

Special cases: Skip "0" should be equivalent to Skip "1"

If N > remaining number of lines, skip to last line

In a particular script of mine where a lot of tests are done, it would make the code much more elegant.

HIGHLIGHT / COLOUR commands

It appears that applying a highlight does not affect the email until the script is complete.  I tried setting a colour to an email in my script then testing for this colour later in script, using colour as a marker.  Is this modus operandi intentional, or could the highlight command be made to take effect at the point in the script where it is used?

 

&lt;p&gt;SKIP command&lt;/p&gt;&lt;p&gt;In place of the SkipNext &quot;&quot; command, I would like to suggest a Skip &quot;N&quot; command where N is the number of lines to skip.&amp;nbsp; This will allow a condition to be tested and multiple lines skipped without the need for a Label.&lt;/p&gt;&lt;p&gt;Special cases: Skip &quot;0&quot; should be equivalent to Skip &quot;1&quot;&lt;/p&gt;&lt;p&gt;If N &amp;gt; remaining number of lines, skip to last line &lt;/p&gt;&lt;p&gt;In a particular script of mine where a lot of tests are done, it would make the code much more elegant. &lt;/p&gt;&lt;p&gt;HIGHLIGHT / COLOUR commands&lt;/p&gt;&lt;p&gt;It appears that applying a highlight does not affect the email until the script is complete.&amp;nbsp; I tried setting a colour to an email in my script then testing for this colour later in script, using colour as a marker.&amp;nbsp; Is this modus operandi intentional, or could the highlight command be made to take effect at the point in the script where it is used?&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft