Definition searching involves taking a function name and finding the actual definition of that function. This is particularly useful in large systems, where code may exist in a large number of source files.
Function definitions are found by using information provided either by the LispWorks cross-referencer or by a Tags buffer. If cross-referencing or Tags information has not been produced, then the following commands do not work.
Cross-referencing information is produced by turning source debugging on while compiling and loading the relevant definitions (seetoggle-source-debugging in the LispWorks Reference Manual).
Tag information is set up by the editor itself, and can be saved to a file for future use. For each file in a defined system, the tag file contains a relevant file name entry, followed by names and positions of each defining form in that file. Before tag searching can take place, there must exist a buffer containing the required tag information. You can specify a previously saved tag file as the current tag buffer, or you can create a new one usingCreate Tags Buffer. GNU Emacs tag files are fully compatible with LispWorks editor tag files.
Editor Command
+.function [tags-file] Find Sourcefinds the first definition, and +, (Continue Tags Search) finds subsequent definitions. Find Sourcefirst looks for definitions that have been loaded or evaluated (i.e. using cross-referencing information). If it cannot find the definition here, it looks at the current tags file by issuing the commandFind Tag (for this reason,Find Source is recommended rather thanFind Tag). Find Source prompts for the name of a tags file. The default is a file calledTAGS in the current directory. If there is no such file, you can create one usingCreate Tags Buffer. If you want to search a different directory, specify the name of a tags file in that directory (see documentation on Tags commands given below). DSPEC package in the LispWorks Reference Manual for information on how to use thedpsec:*active-finders* variable to control how this command operates. The fileconfig/a-dot-lispworks.lisp contains an example setting for this variable. Editor Command
Find Source, but takes a dspec instead of a name as its argument. foo of one argument, with methods specializing onbar andbaz, Find Source foo
Meta+), whereas Find Source for Dspec (method foo (bar))
bar. Editor Command
Find Source or Find Source for Dspec) in the Find Definitions view of the Editor. Editor Command
.lisp files in the current directory. If you want to use this information at a later date then save this buffer to a file (preferably a file calledTAGS in the current directory). Editor Command
+? Find Tagfinds the first definition, and +, (Continue Tags Search) finds subsequent definitions. Find Tag prompts for the name of a tags file. The default is a file calledTAGS in the current directory. If there is no such file, you can create one usingCreate Tags Buffer. If you want to search a different directory, specify the name of a tags file in that directory. DSPEC package in the LispWorks Reference Manual for information on how to use thedpsec:*active-finders* variable to control how this command operates. The fileconfig/a-do-lispworks.lisp contains an example setting for this variable. Find Source and Find Source for Dspec, which find the source code for a function. Editor Command
Tags Searchfinds the first definition, and +, (Continue Tags Search) finds subsequent definitions. Tags Search prompts for the name of a tags file. The default is a file calledTAGS in the current directory. If there is no such file, you can create one usingCreate Tags Buffer. If you want to search a different directory, specify the name of a tags file in that directory. Editor Command
+, Find Source,Find Tag orTags Search command. Editor Command
Query Replace on page 73. Tags Query Replace prompts for the name of a tags file. The default is a file calledTAGS in the current directory. If there is no such file, you can create one usingCreate Tags Buffer. Editor Command
TAGS in the current directory. The tag information contained in the new buffer is subsequently used for tag searches.