4.6.3 Macro

Syntax: Macro [filename]
Abbreviation: MA

executes the given file name as a macro.

If the optional filename argument is not specified, the file requester is opened, and you are prompted to select a file. (You can inhibit the file requester opening by using the NoFileReq command; see NoFileReq.)

If you escape from the file requester, you can input the file name on the command line.

Note that macros whose names do not conflict with a command can be called without using Macro. Whenever ne is required to perform a command it cannot find in its internal tables, it will look for a macro by that name in the current directory. If this search also fails, ne looks in ~/.ne and finally in the macros subdirectory of ne’s global directory (defined when ne was built, or in a place specified by your NE_GLOBAL_DIR environment variable) for a macro file by that name.

Warning: the first time a macro is executed it is cached into a hash table and is kept forever in memory unless the UnloadMacros command is issued; see UnloadMacros. The next time a macro with the same file name is invoked, the cached list is searched for it before accessing the file using a case insensitive string comparison. That is, if you call ~/foobar/macro, a subsequent call for /usr/MACRO or even just MaCrO will use the cached version of ~/foobar/macro. Note that the cache table is global to ne and not specific to any single document. This greatly improves efficiency when macros are used repeatedly.