Mercurial > hg > xemacs-beta
comparison man/xemacs/programs.texi @ 398:74fd4e045ea6 r21-2-29
Import from CVS: tag r21-2-29
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:13:30 +0200 |
parents | cc15677e0335 |
children | de805c49cfc1 |
comparison
equal
deleted
inserted
replaced
397:f4aeb21a5bad | 398:74fd4e045ea6 |
---|---|
506 indentation is computed by @kbd{C-M-q}; if the value is a number, | 506 indentation is computed by @kbd{C-M-q}; if the value is a number, |
507 @kbd{C-M-q} need not recalculate indentation for the following lines | 507 @kbd{C-M-q} need not recalculate indentation for the following lines |
508 until the end of the list. | 508 until the end of the list. |
509 @end table | 509 @end table |
510 | 510 |
511 @node C Indent,, Lisp Indent, Grinding | 511 @node C Indent, , Lisp Indent, Grinding |
512 @subsection Customizing C Indentation | 512 @subsection Customizing C Indentation |
513 | 513 |
514 Two variables control which commands perform C indentation and when. | 514 Two variables control which commands perform C indentation and when. |
515 | 515 |
516 @vindex c-auto-newline | 516 @vindex c-auto-newline |
882 @kindex M-( | 882 @kindex M-( |
883 @kindex M-) | 883 @kindex M-) |
884 @findex insert-parentheses | 884 @findex insert-parentheses |
885 @findex move-over-close-and-reindent | 885 @findex move-over-close-and-reindent |
886 The commands @kbd{M-(} (@code{insert-parentheses}) and @kbd{M-)} | 886 The commands @kbd{M-(} (@code{insert-parentheses}) and @kbd{M-)} |
887 (@code{move-over-close-@*and-reindent}) are designed to facilitate a style of | 887 (@code{move-over-close-and-reindent}) are designed to facilitate a style of |
888 editing which keeps parentheses balanced at all times. @kbd{M-(} inserts a | 888 editing which keeps parentheses balanced at all times. @kbd{M-(} inserts a |
889 pair of parentheses, either together as in @samp{()}, or, if given an | 889 pair of parentheses, either together as in @samp{()}, or, if given an |
890 argument, around the next several sexps, and leaves point after the open | 890 argument, around the next several sexps, and leaves point after the open |
891 parenthesis. Instead of typing @kbd{( F O O )}, you can type @kbd{M-( F O | 891 parenthesis. Instead of typing @kbd{( F O O )}, you can type @kbd{M-( F O |
892 O}, which has the same effect except for leaving the cursor before the | 892 O}, which has the same effect except for leaving the cursor before the |
1010 A @dfn{tags table} is a description of how a multi-file program is | 1010 A @dfn{tags table} is a description of how a multi-file program is |
1011 broken up into files. It lists the names of the component files and the | 1011 broken up into files. It lists the names of the component files and the |
1012 names and positions of the functions (or other named subunits) in each | 1012 names and positions of the functions (or other named subunits) in each |
1013 file. Grouping the related files makes it possible to search or replace | 1013 file. Grouping the related files makes it possible to search or replace |
1014 through all the files with one command. Recording the function names | 1014 through all the files with one command. Recording the function names |
1015 and positions makes possible the @kbd{M-.} command which finds the | 1015 and positions makes possible the @kbd{M-.} command which finds the |
1016 definition of a function by looking up which of the files it is in. | 1016 definition of a function by looking up which of the files it is in. |
1017 | 1017 |
1018 Tags tables are stored in files called @dfn{tags table files}. The | 1018 Tags tables are stored in files called @dfn{tags table files}. The |
1019 conventional name for a tags table file is @file{TAGS}. | 1019 conventional name for a tags table file is @file{TAGS}. |
1020 | 1020 |
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 @menu | 1031 @menu |
1032 * Tag Syntax:: Tag syntax for various types of code and text files. | 1032 * Tag Syntax:: Tag syntax for various types of code and text files. |
1033 * Create Tags Table:: Creating a tags table with @code{etags}. | 1033 * Create Tags Table:: Creating a tags table with @code{etags}. |
1034 * Etags Regexps:: Create arbitrary tags using regular expressions. | |
1034 * Select Tags Table:: How to visit a tags table. | 1035 * Select Tags Table:: How to visit a tags table. |
1035 * Find Tag:: Commands to find the definition of a specific tag. | 1036 * Find Tag:: Commands to find the definition of a specific tag. |
1036 * Tags Search:: Using a tags table for searching and replacing. | 1037 * Tags Search:: Using a tags table for searching and replacing. |
1037 * List Tags:: Listing and finding tags defined in a file. | 1038 * List Tags:: Listing and finding tags defined in a file. |
1038 @end menu | 1039 @end menu |
1039 | 1040 |
1040 @node Tag Syntax | 1041 @node Tag Syntax, Create Tags Table, Tags, Tags |
1041 @subsection Source File Tag Syntax | 1042 @subsection Source File Tag Syntax |
1042 | 1043 |
1043 Here is how tag syntax is defined for the most popular languages: | 1044 Here is how tag syntax is defined for the most popular languages: |
1044 | 1045 |
1045 @itemize @bullet | 1046 @itemize @bullet |
1046 @item | 1047 @item |
1047 In C code, any C function or typedef is a tag, and so are definitions of | 1048 In C code, any C function or typedef is a tag, and so are definitions of |
1048 @code{struct}, @code{union} and @code{enum}. @code{#define} macro | 1049 @code{struct}, @code{union} and @code{enum}. You can tag function |
1049 definitions and @code{enum} constants are also tags, unless you specify | 1050 declarations and external variables in addition to function definitions |
1050 @samp{--no-defines} when making the tags table. Similarly, global | 1051 by giving the @samp{--declarations} option to @code{etags}. |
1051 variables are tags, unless you specify @samp{--no-globals}. Use of | 1052 @code{#define} macro definitions and @code{enum} constants are also |
1052 @samp{--no-globals} and @samp{--no-defines} can make the tags table file | 1053 tags, unless you specify @samp{--no-defines} when making the tags table. |
1053 much smaller. | 1054 Similarly, global variables are tags, unless you specify |
1055 @samp{--no-globals}. Use of @samp{--no-globals} and @samp{--no-defines} | |
1056 can make the tags table file much smaller. | |
1054 | 1057 |
1055 @item | 1058 @item |
1056 In C++ code, in addition to all the tag constructs of C code, member | 1059 In C++ code, in addition to all the tag constructs of C code, member |
1057 functions are also recognized, and optionally member variables if you | 1060 functions are also recognized, and optionally member variables if you |
1058 use the @samp{--members} option. Tags for variables and functions in | 1061 use the @samp{--members} option. Tags for variables and functions in |
1059 classes are named @samp{@var{class}::@var{variable}} and | 1062 classes are named @samp{@var{class}::@var{variable}} and |
1060 @samp{@var{class}::@var{function}}. | 1063 @samp{@var{class}::@var{function}}. @code{operator} functions tags are |
1064 named, for example @samp{operator+}. | |
1061 | 1065 |
1062 @item | 1066 @item |
1063 In Java code, tags include all the constructs recognized in C++, plus | 1067 In Java code, tags include all the constructs recognized in C++, plus |
1064 the @code{extends} and @code{implements} constructs. Tags for variables | 1068 the @code{interface}, @code{extends} and @code{implements} constructs. |
1065 and functions in classes are named @samp{@var{class}.@var{variable}} and | 1069 Tags for variables and functions in classes are named |
1066 @samp{@var{class}.@var{function}}. | 1070 @samp{@var{class}.@var{variable}} and @samp{@var{class}.@var{function}}. |
1067 | 1071 |
1068 @item | 1072 @item |
1069 In La@TeX{} text, the argument of any of the commands @code{\chapter}, | 1073 In La@TeX{} text, the argument of any of the commands @code{\chapter}, |
1070 @code{\section}, @code{\subsection}, @code{\subsubsection}, | 1074 @code{\section}, @code{\subsection}, @code{\subsubsection}, |
1071 @code{\eqno}, @code{\label}, @code{\ref}, @code{\cite}, @code{\bibitem}, | 1075 @code{\eqno}, @code{\label}, @code{\ref}, @code{\cite}, @code{\bibitem}, |
1073 tag.@refill | 1077 tag.@refill |
1074 | 1078 |
1075 Other commands can make tags as well, if you specify them in the | 1079 Other commands can make tags as well, if you specify them in the |
1076 environment variable @code{TEXTAGS} before invoking @code{etags}. The | 1080 environment variable @code{TEXTAGS} before invoking @code{etags}. The |
1077 value of this environment variable should be a colon-separated list of | 1081 value of this environment variable should be a colon-separated list of |
1078 commands names. For example, | 1082 command names. For example, |
1079 | 1083 |
1080 @example | 1084 @example |
1081 TEXTAGS="def:newcommand:newenvironment" | 1085 TEXTAGS="def:newcommand:newenvironment" |
1082 export TEXTAGS | 1086 export TEXTAGS |
1083 @end example | 1087 @end example |
1099 @end itemize | 1103 @end itemize |
1100 | 1104 |
1101 Several other languages are also supported: | 1105 Several other languages are also supported: |
1102 | 1106 |
1103 @itemize @bullet | 1107 @itemize @bullet |
1108 | |
1109 @item | |
1110 In Ada code, functions, procedures, packages, tasks, and types are | |
1111 tags. Use the @samp{--packages-only} option to create tags for packages | |
1112 only. | |
1113 | |
1104 @item | 1114 @item |
1105 In assembler code, labels appearing at the beginning of a line, | 1115 In assembler code, labels appearing at the beginning of a line, |
1106 followed by a colon, are tags. | 1116 followed by a colon, are tags. |
1107 | 1117 |
1108 @item | 1118 @item |
1109 In Bison or Yacc input files, each rule defines as a tag the nonterminal | 1119 In Bison or Yacc input files, each rule defines as a tag the nonterminal |
1110 it constructs. The portions of the file that contain C code are parsed | 1120 it constructs. The portions of the file that contain C code are parsed |
1111 as C code. | 1121 as C code. |
1112 | 1122 |
1113 @item | 1123 @item |
1114 In Cobol code, paragraphs names are the tags, i.e. any word starting in | 1124 In Cobol code, tags are paragraph names; that is, any word starting in |
1115 column 8 and followed by a full stop. | 1125 column 8 and followed by a period. |
1116 | 1126 |
1117 @item | 1127 @item |
1118 In Erlang code, the tags are the functions, records, and macros defined | 1128 In Erlang code, the tags are the functions, records, and macros defined |
1119 in the file. | 1129 in the file. |
1120 | 1130 |
1121 @item | 1131 @item |
1122 In Fortran code, functions and subroutines are tags. | 1132 In Fortran code, functions, subroutines and blockdata are tags. |
1123 | 1133 |
1124 @item | 1134 @item |
1125 In Objective C code, tags include Objective C definitions for classes, | 1135 In Objective C code, tags include Objective C definitions for classes, |
1126 class categories, methods and protocols. | 1136 class categories, methods, and protocols. |
1127 | 1137 |
1128 @item | 1138 @item |
1129 In Pascal code, the tags are the functions and procedures defined in | 1139 In Pascal code, the tags are the functions and procedures defined in |
1130 the file. | 1140 the file. |
1131 | 1141 |
1132 @item | 1142 @item |
1133 In Perl code, the tags are the procedures defined by the @code{sub} | 1143 In Perl code, the tags are the procedures defined by the @code{sub}, |
1134 keyword. | 1144 @code{my} and @code{local} keywords. Use @samp{--globals} if you want |
1145 to tag global variables. | |
1135 | 1146 |
1136 @item | 1147 @item |
1137 In Postscript code, the tags are the functions. | 1148 In Postscript code, the tags are the functions. |
1138 | 1149 |
1139 @item | 1150 @item |
1140 In Prolog code, a tag name appears at the left margin. | 1151 In Prolog code, a tag name appears at the left margin. |
1152 | |
1153 @item | |
1154 In Python code, @code{def} or @code{class} at the beginning of a line | |
1155 generate a tag. | |
1141 @end itemize | 1156 @end itemize |
1142 | 1157 |
1143 You can also generate tags based on regexp matching (@pxref{Create | 1158 You can also generate tags based on regexp matching |
1144 Tags Table}) to handle other formats and languages. | 1159 (@pxref{Etags Regexps}) to handle other formats and languages. |
1145 | 1160 |
1146 @node Create Tags Table | 1161 @node Create Tags Table, Etags Regexps, Tag Syntax, Tags |
1147 @subsection Creating Tags Tables | 1162 @subsection Creating Tags Tables |
1148 @cindex @code{etags} program | 1163 @cindex @code{etags} program |
1149 | 1164 |
1150 The @code{etags} program is used to create a tags table file. It knows | 1165 The @code{etags} program is used to create a tags table file. It knows |
1151 the syntax of several languages, as described in | 1166 the syntax of several languages, as described in |
1160 @example | 1175 @example |
1161 etags @var{inputfiles}@dots{} | 1176 etags @var{inputfiles}@dots{} |
1162 @end example | 1177 @end example |
1163 | 1178 |
1164 @noindent | 1179 @noindent |
1165 The @code{etags} program reads the specified files, and writes a tags table | 1180 The @code{etags} program reads the specified files, and writes a tags |
1166 named @file{TAGS} in the current working directory. @code{etags} | 1181 table named @file{TAGS} in the current working directory. You can |
1167 recognizes the language used in an input file based on its file name and | 1182 intermix compressed and plain text source file names. @code{etags} |
1168 contents. You can specify the language with the | 1183 knows about the most common compression formats, and does the right |
1184 thing. So you can compress all your source files and have @code{etags} | |
1185 look for compressed versions of its file name arguments, if it does not | |
1186 find uncompressed versions. Under MS-DOS, @code{etags} also looks for | |
1187 file names like @samp{mycode.cgz} if it is given @samp{mycode.c} on the | |
1188 command line and @samp{mycode.c} does not exist. | |
1189 | |
1190 @code{etags} recognizes the language used in an input file based on | |
1191 its file name and contents. You can specify the language with the | |
1169 @samp{--language=@var{name}} option, described below. | 1192 @samp{--language=@var{name}} option, described below. |
1170 | 1193 |
1171 If the tags table data become outdated due to changes in the files | 1194 If the tags table data become outdated due to changes in the files |
1172 described in the table, the way to update the tags table is the same way it | 1195 described in the table, the way to update the tags table is the same way it |
1173 was made in the first place. It is not necessary to do this often. | 1196 was made in the first place. It is not necessary to do this often. |
1200 | 1223 |
1201 If you specify absolute file names as arguments to @code{etags}, then | 1224 If you specify absolute file names as arguments to @code{etags}, then |
1202 the tags file will contain absolute file names. This way, the tags file | 1225 the tags file will contain absolute file names. This way, the tags file |
1203 will still refer to the same files even if you move it, as long as the | 1226 will still refer to the same files even if you move it, as long as the |
1204 source files remain in the same place. Absolute file names start with | 1227 source files remain in the same place. Absolute file names start with |
1205 @samp{/}, or with @samp{@var{device}:/} on MS-DOS and Windows. | 1228 @samp{/}, or with @samp{@var{device}:/} on MS-DOS and MS-Windows. |
1206 | 1229 |
1207 When you want to make a tags table from a great number of files, you | 1230 When you want to make a tags table from a great number of files, you |
1208 may have problems listing them on the command line, because some systems | 1231 may have problems listing them on the command line, because some systems |
1209 have a limit on its length. The simplest way to circumvent this limit | 1232 have a limit on its length. The simplest way to circumvent this limit |
1210 is to tell @code{etags} to read the file names from its standard input, | 1233 is to tell @code{etags} to read the file names from its standard input, |
1211 by typing a dash in place of the file names, like this: | 1234 by typing a dash in place of the file names, like this: |
1212 | 1235 |
1213 @example | 1236 @smallexample |
1214 find . -name "*.[chCH]" -print | etags - | 1237 find . -name "*.[chCH]" -print | etags - |
1215 @end example | 1238 @end smallexample |
1216 | 1239 |
1217 Use the option @samp{--language=@var{name}} to specify the language | 1240 Use the option @samp{--language=@var{name}} to specify the language |
1218 explicitly. You can intermix these options with file names; each one | 1241 explicitly. You can intermix these options with file names; each one |
1219 applies to the file names that follow it. Specify | 1242 applies to the file names that follow it. Specify |
1220 @samp{--language=auto} to tell @code{etags} to resume guessing the | 1243 @samp{--language=auto} to tell @code{etags} to resume guessing the |
1221 language from the file names and file contents. Specify | 1244 language from the file names and file contents. Specify |
1222 @samp{--language=none} to turn off language-specific processing | 1245 @samp{--language=none} to turn off language-specific processing |
1223 entirely; then @code{etags} recognizes tags by regexp matching alone. | 1246 entirely; then @code{etags} recognizes tags by regexp matching alone |
1224 @samp{etags --help} prints the list of the languages @code{etags} knows, | 1247 (@pxref{Etags Regexps}). |
1225 and the file name rules for guessing the language. | 1248 |
1249 @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 | |
1251 a list of all the available @code{etags} options, together with a short | |
1252 explanation. | |
1253 | |
1254 @node Etags Regexps, Select Tags Table, Create Tags Table, Tags | |
1255 @subsection Etags Regexps | |
1226 | 1256 |
1227 The @samp{--regex} option provides a general way of recognizing tags | 1257 The @samp{--regex} option provides a general way of recognizing tags |
1228 based on regexp matching. You can freely intermix it with file names. | 1258 based on regexp matching. You can freely intermix it with file names. |
1229 Each @samp{--regex} option adds to the preceding ones, and applies only | 1259 Each @samp{--regex} option adds to the preceding ones, and applies only |
1230 to the following files. The syntax is: | 1260 to the following files. The syntax is: |
1231 | 1261 |
1232 @example | 1262 @smallexample |
1233 --regex=/@var{tagregexp}[/@var{nameregexp}]/ | 1263 --regex=/@var{tagregexp}[/@var{nameregexp}]/ |
1234 @end example | 1264 @end smallexample |
1235 | 1265 |
1236 @noindent | 1266 @noindent |
1237 where @var{tagregexp} is used to match the lines to tag. It is always | 1267 where @var{tagregexp} is used to match the lines to tag. It is always |
1238 anchored, that is, it behaves as if preceded by @samp{^}. If you want | 1268 anchored, that is, it behaves as if preceded by @samp{^}. If you want |
1239 to account for indentation, just match any initial number of blanks by | 1269 to account for indentation, just match any initial number of blanks by |
1249 @samp{\@{@var{m},@var{n}\@}}, and its meaning is to match the preceding | 1279 @samp{\@{@var{m},@var{n}\@}}, and its meaning is to match the preceding |
1250 expression at least @var{m} times and up to @var{n} times. | 1280 expression at least @var{m} times and up to @var{n} times. |
1251 | 1281 |
1252 You should not match more characters with @var{tagregexp} than that | 1282 You should not match more characters with @var{tagregexp} than that |
1253 needed to recognize what you want to tag. If the match is such that | 1283 needed to recognize what you want to tag. If the match is such that |
1254 more characters than needed are unavoidably matched by @var{tagregexp}, | 1284 more characters than needed are unavoidably matched by @var{tagregexp} |
1255 you may find useful to add a @var{nameregexp}, in order to narrow the tag | 1285 (as will usually be the case), you should add a @var{nameregexp}, to |
1256 scope. You can find some examples below. | 1286 pick out just the tag. This will enable Emacs to find tags more |
1287 accurately and to do completion on tag names more reliably. You can | |
1288 find some examples below. | |
1289 | |
1290 The option @samp{--ignore-case-regex} (or @samp{-c}) is like | |
1291 @samp{--regex}, except that the regular expression provided will be | |
1292 matched without regard to case, which is appropriate for various | |
1293 programming languages. | |
1257 | 1294 |
1258 The @samp{-R} option deletes all the regexps defined with | 1295 The @samp{-R} option deletes all the regexps defined with |
1259 @samp{--regex} options. It applies to the file names following it, as | 1296 @samp{--regex} options. It applies to the file names following it, as |
1260 you can see from the following example: | 1297 you can see from the following example: |
1261 | 1298 |
1262 @example | 1299 @smallexample |
1263 etags --regex=/@var{reg1}/ voo.doo --regex=/@var{reg2}/ \ | 1300 etags --regex=/@var{reg1}/ voo.doo --regex=/@var{reg2}/ \ |
1264 bar.ber -R --lang=lisp los.er | 1301 bar.ber -R --lang=lisp los.er |
1265 @end example | 1302 @end smallexample |
1266 | 1303 |
1267 @noindent | 1304 @noindent |
1268 Here @code{etags} chooses the parsing language for @file{voo.doo} and | 1305 Here @code{etags} chooses the parsing language for @file{voo.doo} and |
1269 @file{bar.ber} according to their contents. @code{etags} also uses | 1306 @file{bar.ber} according to their contents. @code{etags} also uses |
1270 @var{reg1} to recognize additional tags in @file{voo.doo}, and both | 1307 @var{reg1} to recognize additional tags in @file{voo.doo}, and both |
1271 @var{reg1} and @var{reg2} to recognize additional tags in | 1308 @var{reg1} and @var{reg2} to recognize additional tags in |
1272 @file{bar.ber}. @code{etags} uses the Lisp tags rules, and no regexp | 1309 @file{bar.ber}. @code{etags} uses the Lisp tags rules, and no regexp |
1273 matching, to recognize tags in @file{los.er}. | 1310 matching, to recognize tags in @file{los.er}. |
1274 | 1311 |
1312 A regular expression can be bound to a given language, by prepending | |
1313 it with @samp{@{lang@}}. When you do this, @code{etags} will use the | |
1314 regular expression only for files of that language. @samp{etags --help} | |
1315 prints the list of languages recognised by @code{etags}. The following | |
1316 example tags the @code{DEFVAR} macros in the Emacs source files. | |
1317 @code{etags} applies this regular expression to C files only: | |
1318 | |
1319 @smallexample | |
1320 --regex='@{c@}/[ \t]*DEFVAR_[A-Z_ \t(]+"\([^"]+\)"/' | |
1321 @end smallexample | |
1322 | |
1323 @noindent | |
1324 This feature is particularly useful when storing a list of regular | |
1325 expressions in a file. The following option syntax instructs | |
1326 @code{etags} to read two files of regular expressions. The regular | |
1327 expressions contained in the second file are matched without regard to | |
1328 case. | |
1329 | |
1330 @smallexample | |
1331 --regex=@@first-file --ignore-case-regex=@@second-file | |
1332 @end smallexample | |
1333 | |
1334 @noindent | |
1335 A regex file contains one regular expressions per line. Empty lines, | |
1336 and lines beginning with space or tab are ignored. When the first | |
1337 character in a line is @samp{@@}, @code{etags} assumes that the rest of | |
1338 the line is the name of a file of regular expressions. This means that | |
1339 such files can be nested. All the other lines are taken to be regular | |
1340 expressions. For example, one can create a file called | |
1341 @samp{emacs.tags} with the following contents (the first line in the | |
1342 file is a comment): | |
1343 | |
1344 @smallexample | |
1345 -- This is for GNU Emacs source files | |
1346 @{c@}/[ \t]*DEFVAR_[A-Z_ \t(]+"\([^"]+\)"/\1/ | |
1347 @end smallexample | |
1348 | |
1349 @noindent | |
1350 and then use it like this: | |
1351 | |
1352 @smallexample | |
1353 etags --regex=@@emacs.tags *.[ch] */*.[ch] | |
1354 @end smallexample | |
1355 | |
1275 Here are some more examples. The regexps are quoted to protect them | 1356 Here are some more examples. The regexps are quoted to protect them |
1276 from shell interpretation. | 1357 from shell interpretation. |
1277 | 1358 |
1359 @itemize @bullet | |
1360 | |
1361 @item | |
1362 Tag Octave files: | |
1363 | |
1364 @smallexample | |
1365 etags --language=none \ | |
1366 --regex='/[ \t]*function.*=[ \t]*\([^ \t]*\)[ \t]*(/\1/' \ | |
1367 --regex='/###key \(.*\)/\1/' \ | |
1368 --regex='/[ \t]*global[ \t].*/' \ | |
1369 *.m | |
1370 @end smallexample | |
1371 | |
1278 @noindent | 1372 @noindent |
1279 Tag the @code{DEFVAR} macros in the emacs source files: | 1373 Note that tags are not generated for scripts so that you have to add a |
1280 | 1374 line by yourself of the form `###key <script-name>' if you want to jump |
1281 @example | 1375 to it. |
1282 --regex='/[ \t]*DEFVAR_[A-Z_ \t(]+"\([^"]+\)"/' | 1376 |
1283 @end example | 1377 @item |
1284 | 1378 Tag Tcl files: |
1285 @noindent | 1379 |
1286 Tag VHDL files (this example is a single long line, broken here for | 1380 @smallexample |
1287 formatting reasons): | 1381 etags --language=none --regex='/proc[ \t]+\([^ \t]+\)/\1/' *.tcl |
1288 | 1382 @end smallexample |
1289 @example | 1383 |
1290 --language=none | 1384 @item |
1291 --regex='/[ \t]*\(ARCHITECTURE\|CONFIGURATION\) +[^ ]* +OF/' | 1385 Tag VHDL files: |
1386 | |
1387 @smallexample | |
1388 --language=none \ | |
1389 --regex='/[ \t]*\(ARCHITECTURE\|CONFIGURATION\) +[^ ]* +OF/' \ | |
1292 --regex='/[ \t]*\(ATTRIBUTE\|ENTITY\|FUNCTION\|PACKAGE\ | 1390 --regex='/[ \t]*\(ATTRIBUTE\|ENTITY\|FUNCTION\|PACKAGE\ |
1293 \( BODY\)?\|PROCEDURE\|PROCESS\|TYPE\)[ \t]+\([^ \t(]+\)/\3/' | 1391 \( BODY\)?\|PROCEDURE\|PROCESS\|TYPE\)[ \t]+\([^ \t(]+\)/\3/' |
1294 @end example | 1392 @end smallexample |
1295 | 1393 @end itemize |
1296 @noindent | 1394 |
1297 Tag TCL files (this last example shows the usage of a @var{nameregexp}): | 1395 @node Select Tags Table, Find Tag, Etags Regexps, Tags |
1298 | |
1299 @example | |
1300 --lang=none --regex='/proc[ \t]+\([^ \t]+\)/\1/' | |
1301 @end example | |
1302 | |
1303 For a list of the other available @code{etags} options, execute | |
1304 @code{etags --help}. | |
1305 | |
1306 @node Select Tags Table, Find Tag, Create Tags Table, Tags | |
1307 @subsection Selecting a Tags Table | 1396 @subsection Selecting a Tags Table |
1308 | 1397 |
1309 @vindex tag-table-alist | 1398 @vindex tag-table-alist |
1310 At any time Emacs has one @dfn{selected} tags table, and all the commands | 1399 At any time Emacs has one @dfn{selected} tags table, and all the commands |
1311 for working with tags tables use the selected one. To select a tags table, | 1400 for working with tags tables use the selected one. To select a tags table, |
1333 | 1422 |
1334 For example: | 1423 For example: |
1335 | 1424 |
1336 @example | 1425 @example |
1337 (setq tag-table-alist | 1426 (setq tag-table-alist |
1338 '(("/usr/src/public/perl/" . "/usr/src/public/perl/perl-3.0/") | 1427 '(("/usr/src/public/perl/" . "/usr/src/public/perl/perl-3.0/") |
1339 ("\\.el$" . "/usr/local/emacs/src/") | 1428 ("\\.el$" . "/usr/local/emacs/src/") |
1340 ("/jbw/gnu/" . "/usr15/degree/stud/jbw/gnu/") | 1429 ("/jbw/gnu/" . "/usr15/degree/stud/jbw/gnu/") |
1341 ("" . "/usr/local/emacs/src/") | 1430 ("" . "/usr/local/emacs/src/") |
1342 )) | 1431 )) |
1343 @end example | 1432 @end example |
1344 | 1433 |
1345 The example defines the tags table alist in the following way: | 1434 The example defines the tags table alist in the following way: |
1346 | 1435 |
1347 @itemize @bullet | 1436 @itemize @bullet |
1449 @vindex tag-mark-stack-max | 1538 @vindex tag-mark-stack-max |
1450 | 1539 |
1451 @table @kbd | 1540 @table @kbd |
1452 @item tag-table-alist | 1541 @item tag-table-alist |
1453 Controls which tables apply to which buffers. | 1542 Controls which tables apply to which buffers. |
1454 @item tags-file-name | 1543 @item tags-file-name |
1455 Stores a default tags table. | 1544 Stores a default tags table. |
1456 @item tags-build-completion-table | 1545 @item tags-build-completion-table |
1457 Controls completion behavior. | 1546 Controls completion behavior. |
1458 @item buffer-tag-table | 1547 @item buffer-tag-table |
1459 Specifies a buffer-local table. | 1548 Specifies a buffer-local table. |
1460 @item make-tags-files-invisible | 1549 @item make-tags-files-invisible |
1461 Sets whether tags tables should be very hidden. | 1550 Sets whether tags tables should be very hidden. |
1462 @item tag-mark-stack-max | 1551 @item tag-mark-stack-max |
1463 Specifies how many tags-based hops to remember. | 1552 Specifies how many tags-based hops to remember. |
1464 @end table | 1553 @end table |
1465 | 1554 |
1466 @kindex C-x 4 . | 1555 @kindex C-x 4 . |
1467 @findex find-tag-other-window | 1556 @findex find-tag-other-window |
1553 file in the tags table and prepare to advance sequentially by files. | 1642 file in the tags table and prepare to advance sequentially by files. |
1554 @item M-x next-file | 1643 @item M-x next-file |
1555 Visit the next file in the selected tags table. | 1644 Visit the next file in the selected tags table. |
1556 @end table | 1645 @end table |
1557 | 1646 |
1558 @node List Tags,, Tags Search, Tags | 1647 @node List Tags, , Tags Search, Tags |
1559 @subsection Tags Table Inquiries | 1648 @subsection Tags Table Inquiries |
1560 | 1649 |
1561 @table @kbd | 1650 @table @kbd |
1562 @item M-x list-tags | 1651 @item M-x list-tags |
1563 Display a list of the tags defined in a specific program file. | 1652 Display a list of the tags defined in a specific program file. |
1738 If you fail to follow these conventions, the indentation commands may | 1827 If you fail to follow these conventions, the indentation commands may |
1739 indent some lines unaesthetically. However, a correct Fortran program will | 1828 indent some lines unaesthetically. However, a correct Fortran program will |
1740 retain its meaning when reindented even if the conventions are not | 1829 retain its meaning when reindented even if the conventions are not |
1741 followed. | 1830 followed. |
1742 | 1831 |
1743 @node ForIndent Vars,, ForIndent Conv, Fortran Indent | 1832 @node ForIndent Vars, , ForIndent Conv, Fortran Indent |
1744 @subsubsection Variables for Fortran Indentation | 1833 @subsubsection Variables for Fortran Indentation |
1745 | 1834 |
1746 @vindex fortran-do-indent | 1835 @vindex fortran-do-indent |
1747 @vindex fortran-if-indent | 1836 @vindex fortran-if-indent |
1748 @vindex fortran-continuation-indent | 1837 @vindex fortran-continuation-indent |
1895 For even more help, use @kbd{C-c C-w} (@code{fortran-window-create}), a | 1984 For even more help, use @kbd{C-c C-w} (@code{fortran-window-create}), a |
1896 command which splits the current window horizontally, resulting in a window 72 | 1985 command which splits the current window horizontally, resulting in a window 72 |
1897 columns wide. When you edit in this window, you can immediately see | 1986 columns wide. When you edit in this window, you can immediately see |
1898 when a line gets too wide to be correct Fortran. | 1987 when a line gets too wide to be correct Fortran. |
1899 | 1988 |
1900 @node Fortran Abbrev,, Fortran Columns, Fortran | 1989 @node Fortran Abbrev, , Fortran Columns, Fortran |
1901 @subsection Fortran Keyword Abbrevs | 1990 @subsection Fortran Keyword Abbrevs |
1902 | 1991 |
1903 Fortran mode provides many built-in abbrevs for common keywords and | 1992 Fortran mode provides many built-in abbrevs for common keywords and |
1904 declarations. These are the same sort of abbrevs that you can define | 1993 declarations. These are the same sort of abbrevs that you can define |
1905 yourself. To use them, you must turn on Abbrev mode. @pxref{Abbrevs}. | 1994 yourself. To use them, you must turn on Abbrev mode. @pxref{Abbrevs}. |
1915 automatically to @samp{continue}, provided Abbrev mode is enabled.@refill | 2004 automatically to @samp{continue}, provided Abbrev mode is enabled.@refill |
1916 | 2005 |
1917 Type @samp{;?} or @samp{;C-h} to display a list of all built-in | 2006 Type @samp{;?} or @samp{;C-h} to display a list of all built-in |
1918 Fortran abbrevs and what they stand for. | 2007 Fortran abbrevs and what they stand for. |
1919 | 2008 |
1920 @node Asm Mode,, Fortran, Programs | 2009 @node Asm Mode, , Fortran, Programs |
1921 @section Asm Mode | 2010 @section Asm Mode |
1922 | 2011 |
1923 @cindex Asm mode | 2012 @cindex Asm mode |
1924 Asm mode is a major mode for editing files of assembler code. It | 2013 Asm mode is a major mode for editing files of assembler code. It |
1925 defines these commands: | 2014 defines these commands: |