comparison man/xemacs/programs.texi @ 458:c33ae14dd6d0 r21-2-44

Import from CVS: tag r21-2-44
author cvs
date Mon, 13 Aug 2007 11:42:25 +0200
parents abe6d1db359e
children 223736d75acb
comparison
equal deleted inserted replaced
457:4b9290a33024 458:c33ae14dd6d0
1026 depends on the programming language of the described file. They 1026 depends on the programming language of the described file. They
1027 normally include all functions and subroutines, and may also include 1027 normally include all functions and subroutines, and may also include
1028 global variables, data types, and anything else convenient. Each name 1028 global variables, data types, and anything else convenient. Each name
1029 recorded is called a @dfn{tag}. 1029 recorded is called a @dfn{tag}.
1030 1030
1031 @cindex C++ class browser, tags
1032 @cindex tags, C++
1033 @cindex class browser, C++
1034 @cindex Ebrowse
1035 The Ebrowse is a separate facility tailored for C++, with tags and a
1036 class browser. @xref{,,, ebrowse, Ebrowse User's Manual}.
1037
1031 @menu 1038 @menu
1032 * Tag Syntax:: Tag syntax for various types of code and text files. 1039 * Tag Syntax:: Tag syntax for various types of code and text files.
1033 * Create Tags Table:: Creating a tags table with @code{etags}. 1040 * Create Tags Table:: Creating a tags table with @code{etags}.
1034 * Etags Regexps:: Create arbitrary tags using regular expressions. 1041 * Etags Regexps:: Create arbitrary tags using regular expressions.
1035 * Select Tags Table:: How to visit a tags table. 1042 * Select Tags Table:: How to visit a tags table.
1036 * Find Tag:: Commands to find the definition of a specific tag. 1043 * Find Tag:: Commands to find the definition of a specific tag.
1037 * Tags Search:: Using a tags table for searching and replacing. 1044 * Tags Search:: Using a tags table for searching and replacing.
1038 * List Tags:: Listing and finding tags defined in a file. 1045 * List Tags:: Listing and finding tags defined in a file.
1039 @end menu 1046 @end menu
1040 1047
1041 @node Tag Syntax, Create Tags Table, Tags, Tags 1048 @node Tag Syntax
1042 @subsection Source File Tag Syntax 1049 @subsection Source File Tag Syntax
1043 1050
1044 Here is how tag syntax is defined for the most popular languages: 1051 Here is how tag syntax is defined for the most popular languages:
1045 1052
1046 @itemize @bullet 1053 @itemize @bullet
1075 @code{\eqno}, @code{\label}, @code{\ref}, @code{\cite}, @code{\bibitem}, 1082 @code{\eqno}, @code{\label}, @code{\ref}, @code{\cite}, @code{\bibitem},
1076 @code{\part}, @code{\appendix}, @code{\entry}, or @code{\index}, is a 1083 @code{\part}, @code{\appendix}, @code{\entry}, or @code{\index}, is a
1077 tag.@refill 1084 tag.@refill
1078 1085
1079 Other commands can make tags as well, if you specify them in the 1086 Other commands can make tags as well, if you specify them in the
1080 environment variable @code{TEXTAGS} before invoking @code{etags}. The 1087 environment variable @env{TEXTAGS} before invoking @code{etags}. The
1081 value of this environment variable should be a colon-separated list of 1088 value of this environment variable should be a colon-separated list of
1082 command names. For example, 1089 command names. For example,
1083 1090
1084 @example 1091 @example
1085 TEXTAGS="def:newcommand:newenvironment" 1092 TEXTAGS="def:newcommand:newenvironment"
1106 1113
1107 @itemize @bullet 1114 @itemize @bullet
1108 1115
1109 @item 1116 @item
1110 In Ada code, functions, procedures, packages, tasks, and types are 1117 In Ada code, functions, procedures, packages, tasks, and types are
1111 tags. Use the @samp{--packages-only} option to create tags for packages 1118 tags. Use the @samp{--packages-only} option to create tags for
1112 only. 1119 packages only.
1120
1121 With Ada, it is possible to have the same name used for different
1122 entity kinds (e.g.@: the same name for a procedure and a function). Also,
1123 for things like packages, procedures and functions, there is the spec
1124 (i.e.@: the interface) and the body (i.e.@: the implementation). To
1125 facilitate the choice to the user, a tag value is appended with a
1126 qualifier:
1127
1128 @table @asis
1129 @item function
1130 @kbd{/f}
1131 @item procedure
1132 @kbd{/p}
1133 @item package spec
1134 @kbd{/s}
1135 @item package body
1136 @kbd{/b}
1137 @item type
1138 @kbd{/t}
1139 @item task
1140 @kbd{/k}
1141 @end table
1142
1143 So, as an example, @kbd{M-x find-tag bidule/b} will go directly to the
1144 body of the package @var{bidule} while @kbd{M-x find-tag bidule} will
1145 just search for any tag @var{bidule}.
1113 1146
1114 @item 1147 @item
1115 In assembler code, labels appearing at the beginning of a line, 1148 In assembler code, labels appearing at the beginning of a line,
1116 followed by a colon, are tags. 1149 followed by a colon, are tags.
1117 1150
1130 1163
1131 @item 1164 @item
1132 In Fortran code, functions, subroutines and blockdata are tags. 1165 In Fortran code, functions, subroutines and blockdata are tags.
1133 1166
1134 @item 1167 @item
1168 In makefiles, targets are tags.
1169
1170 @item
1135 In Objective C code, tags include Objective C definitions for classes, 1171 In Objective C code, tags include Objective C definitions for classes,
1136 class categories, methods, and protocols. 1172 class categories, methods, and protocols.
1137 1173
1138 @item 1174 @item
1139 In Pascal code, the tags are the functions and procedures defined in 1175 In Pascal code, the tags are the functions and procedures defined in
1143 In Perl code, the tags are the procedures defined by the @code{sub}, 1179 In Perl code, the tags are the procedures defined by the @code{sub},
1144 @code{my} and @code{local} keywords. Use @samp{--globals} if you want 1180 @code{my} and @code{local} keywords. Use @samp{--globals} if you want
1145 to tag global variables. 1181 to tag global variables.
1146 1182
1147 @item 1183 @item
1148 In Postscript code, the tags are the functions. 1184 In PostScript code, the tags are the functions.
1149 1185
1150 @item 1186 @item
1151 In Prolog code, a tag name appears at the left margin. 1187 In Prolog code, a tag name appears at the left margin.
1152 1188
1153 @item 1189 @item
1154 In Python code, @code{def} or @code{class} at the beginning of a line 1190 In Python code, @code{def} or @code{class} at the beginning of a line
1155 generate a tag. 1191 generate a tag.
1156 @end itemize 1192 @end itemize
1157 1193
1158 You can also generate tags based on regexp matching 1194 You can also generate tags based on regexp matching (@pxref{Etags
1159 (@pxref{Etags Regexps}) to handle other formats and languages. 1195 Regexps}) to handle other formats and languages.
1160 1196
1161 @node Create Tags Table, Etags Regexps, Tag Syntax, Tags 1197 @node Create Tags Table
1162 @subsection Creating Tags Tables 1198 @subsection Creating Tags Tables
1163 @cindex @code{etags} program 1199 @cindex @code{etags} program
1164 1200
1165 The @code{etags} program is used to create a tags table file. It knows 1201 The @code{etags} program is used to create a tags table file. It knows
1166 the syntax of several languages, as described in 1202 the syntax of several languages, as described in
1249 @samp{etags --help} prints the list of the languages @code{etags} 1285 @samp{etags --help} prints the list of the languages @code{etags}
1250 knows, and the file name rules for guessing the language. It also prints 1286 knows, and the file name rules for guessing the language. It also prints
1251 a list of all the available @code{etags} options, together with a short 1287 a list of all the available @code{etags} options, together with a short
1252 explanation. 1288 explanation.
1253 1289
1254 @node Etags Regexps, Select Tags Table, Create Tags Table, Tags 1290 @node Etags Regexps
1255 @subsection Etags Regexps 1291 @subsection Etags Regexps
1256 1292
1257 The @samp{--regex} option provides a general way of recognizing tags 1293 The @samp{--regex} option provides a general way of recognizing tags
1258 based on regexp matching. You can freely intermix it with file names. 1294 based on regexp matching. You can freely intermix it with file names.
1259 Each @samp{--regex} option adds to the preceding ones, and applies only 1295 Each @samp{--regex} option adds to the preceding ones, and applies only