r2 - 2009-12-23 - 14:11:02 - TWikiAdminUserYou are here: NTP >  TWiki Web > MacrosPlugin
NTP users are strongly urged to take immediate action to ensure that their NTP daemons are not susceptible to being used in distributed denial-of-service (DDoS) attacks. Please also take this opportunity to defeat denial-of-service attacks by implementing Ingress and Egress filtering through BCP38.

ntp-4.2.8p15 was released on 23 June 2020. It addresses 1 medium-severity security issue in ntpd, and provides 13 non-security bugfixes over 4.2.8p13.

Please see the NTP Security Notice for vulnerability and mitigation details.

Are you using Autokey in production? If so, please contact Harlan - he's got some questions for you.


Lets you use parameterised includes in TWiki. This plugin supports tags originally included with the TWiki:Plugins/FormQueryPlugin, but now split out for clarity.


  • Macros defined in topics
  • Topic-scope SET function
  • Strip newlines from macro topics

Syntax Rules


%CALLMACRO is used to include a macro defined in a topic in the current web immediately, as if it were simply typed in the topic. It is like %INCLUDE% except that parameters can be passed in and expanded in the included text.

A macro is defined by creating a topic that contains the macro body. For example, a topic named MacroMaturity may contain the text:

The science of %science% is %state%
This macro can be included in another topic using %CALLMACRO :
%CALLMACRO{topic=MacroMaturity science="biology" state="mature"}%
%CALLMACRO{topic=MacroMaturity science="nanotechnology" state="in its infancy"}%
With fairly obvious results. Note that standard TWiki variables such as %TOPIC% are expanded with the values of the calling topic and not the macro topic. Macro parameter expansions take precedence over any TWiki variable or %SET value for the same name.


To support the inclusion of macros that don't generate any text (e.g. macros containing only %FORMQUERY and %TABLEFORMAT) then the special tag %STRIP% can be included in the macro text. If this is seen, all newlines will be stripped from the macro before it is included in the calling topic. The %STRIP tag only works in the context of a macro body.

%SET pseudo-tag

%SET is called a pseudo-tag because it doesn't operate the same way as normal twiki tags; it generates no output, and is delimited by end-of line.

%SET is used to set a variable value within the context of the current topic. Variable values which are set remain in force only within the current topic, or until the variable is set to a new value. Note that variable values %SET within a %CALLMACRO are available in the calling topic.

%SET tags must occur at the start of a line (no leading spaces) and are terminated by the end of line. For example,

%SET X = 1000
will set %X% to 1000 for the rest of the topic.

Another difference from standard Set is that the RHS of a %SET is fully evaluated immediately. This means that it is unlike a macro, and more like an assignment expression in a programming language. For example,

%SET X = 1000
%SET Y = 100
%SET Z = %CALC{"%X% / %Y%"}%
will set %Z% to the string 10 and NOT the string "%CALC{"1000 / 100"}%". This is a critically important difference; values that are %SET can be used alongside plugins (such as SpreadSheetPlugin) that are very sensitive to format.

MacrosPlugin Settings

One line description, shown in the TextFormattingRules topic:
  • Set SHORTDESCRIPTION = Supports parameterised includes.

Plugin Installation Instructions

Note: These instructions are for the TWiki maintainer. No changes to your browser are required.
  • Download the ZIP file from the Plugin web (see below). Contents:
    File: Description:
    lib/TWiki/Plugins/MacrosPlugin.pm Main plugin script
    data/TWiki/MacrosPlugin.txt Plugin topic

  • Unzip MacrosPlugin.zip in your twiki installation directory.
  • Optionally, run MacrosPlugin_installer to automatically check and install other TWiki modules that this module depends on. You can also do this step manually.
  • Alternatively, manually make sure the dependencies listed in the table below are resolved. None
  • (Dakar) Visit configure in your TWiki installation, and enable the plugin in the {Plugins} section.

Plugin Info

Plugin Author: TWiki:Main/CrawfordCurrie
Plugin Version: 15763 (12 Dec 2008)
Change History:  
6173 TWikibug:Item196 - updates for MacrosPlugin
5223 Documentation fixes, adding gifs.
5048 Cairo readiness
5002 Initial version
28 June 2004 Initial version, split out from TWiki:Plugins/FormQueryPlugin
Dependencies: None
Perl Version: 5.6
Plugin Home: https://TWiki.org/cgi-bin/view/Plugins/MacrosPlugin
Feedback: https://TWiki.org/cgi-bin/view/Plugins/MacrosPluginDev

Related Topics: TWikiPreferences, TWikiPlugins

Further development

Further development of this code is welcomed. It is recommended that you unpack the distribution into a development directory and use the supplied build file which provides targets to run the test suite, and install and uninstall your development code into a test installation. Please, please, please run, and extend if necessary, the test set!

Developer discussion is in TWiki:Plugins/MacrosPluginDev.


This code is based on an original development of Motorola Inc. and is protected by the following copyrights:

  • Copyright © 2002-2003 Motorola. All Rights Reserved.
  • Portions Copyright © 2004 Crawford Currie https://www.c-dot.co.uk


As required for the publication of all extensions to TWiki, this software is published under the terms of the GNU General Public License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details, published at https://www.gnu.org/copyleft/gpl.html

-- TWiki:Main/CrawfordCurrie - 02:26:17 12 December 2008

Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r2 < r1 | More topic actions
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding NTP? Send feedback
Note: Please contribute updates to this topic on TWiki.org at TWiki:TWiki.MacrosPlugin