A REDUCE mode submenu provides rapid access to some of the main facilities for finding a procedure definition via a tag file. Two commands (and submenu options) facilitate tagging the REDUCE files in one directory or in a directory and its sub-directories. The former is useful for tagging all the files associated with a single project or package – the directory defaults to the directory of the current REDUCE file; the latter is useful for tagging all the packages in a standard REDUCE installation – the directory defaults to the parent of the directory of the current REDUCE file.
Once a TAGS file has been generated, the standard Emacs xref
interface is available to find identifier references, in particular
the command xref-find-definitions
, which is also available
via the REDUCE mode submenu. See Find Identifier References in GNU Emacs Manual.
The tagging commands use the standard Emacs etags
program,
which should be available in the Emacs bin
directory. REDUCE
mode uses the value of the option reduce-etags-directory,
which should be appropriate by default, but if not can be customized.
(It is not required that the Emacs bin
directory be in your
execution path, but if it is you can optionally set
reduce-etags-directory to nil.)
The tagging commands use the list of regular expressions in the
customizable option reduce-etags-regexps
to find tags. By
default, these are currently all procedure names, identifiers with the
property psopfn
or simpfn
, and up to the first five
identifiers listed in the same operator
declaration.
Show the definitions of the identifier at point. With a prefix argument, or if there’s no identifier at point, prompt for the identifier.
Generate a REDUCE TAGS file for (all .red files in) the specified directory, by default the current directory. The TAGS file goes in the specified directory.
Generate a REDUCE TAGS file for (all .red
files in) the
specified directory, by default the parent of the current directory,
and its sub-directories to the specified depth. The depth defaults to
2, which means the specified directory and each of its immediate
sub-directories, but no deeper sub-directories. Specifying a depth
less than or equal to 0 means all sub-directories with no limit. This
may fail on the REDUCE packages
directory because it attempts
to tag too many files. The TAGS file goes in the specified directory.