Now on revision 106733. ------------------------------------------------------------ revno: 106733 committer: Chong Yidong branch nick: trunk timestamp: Sun 2011-12-25 22:16:00 +0800 message: More updates to Maintaining chapter of Emacs manual. * files.texi (Misc File Ops): Mention vc-delete-file. * maintaining.texi (Tags): Mention Semantic. (Create Tags Table, Etags Regexps): Copyedits. (Find Tag): Mention minibuffer completion. (List Tags): Mention completion-at-point. Completion is actually available in M-x list-tags. * programs.texi (Symbol Completion): Mention completion-at-point explicitly. * vc1-xtra.texi (VC Delete/Rename): Rename from Renaming and VC. Document vc-delete-file. diff: === modified file 'admin/FOR-RELEASE' --- admin/FOR-RELEASE 2011-12-19 07:25:46 +0000 +++ admin/FOR-RELEASE 2011-12-25 14:16:00 +0000 @@ -153,7 +153,7 @@ killing.texi cyd kmacro.texi cyd macos.texi -maintaining.texi +maintaining.texi cyd major.texi mark.texi cyd mini.texi @@ -172,8 +172,8 @@ sending.texi text.texi cyd trouble.texi -vc-xtra.texi -vc1-xtra.texi +vc-xtra.texi cyd +vc1-xtra.texi cyd windows.texi cyd xresources.texi === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2011-12-22 10:14:41 +0000 +++ doc/emacs/ChangeLog 2011-12-25 14:16:00 +0000 @@ -1,3 +1,19 @@ +2011-12-25 Chong Yidong + + * maintaining.texi (Tags): Mention Semantic. + (Create Tags Table, Etags Regexps): Copyedits. + (Find Tag): Mention minibuffer completion. + (List Tags): Mention completion-at-point. Completion is actually + available in M-x list-tags. + + * vc1-xtra.texi (VC Delete/Rename): Rename from Renaming and VC. + Document vc-delete-file. + + * files.texi (Misc File Ops): Mention vc-delete-file. + + * programs.texi (Symbol Completion): Mention completion-at-point + explicitly. + 2011-12-22 Chong Yidong * maintaining.texi (Change Log Commands): Don't specially mention === modified file 'doc/emacs/emacs.texi' --- doc/emacs/emacs.texi 2011-12-21 08:39:32 +0000 +++ doc/emacs/emacs.texi 2011-12-25 14:16:00 +0000 @@ -782,9 +782,8 @@ Miscellaneous Commands and Features of VC * Change Logs and VC:: Generating a change log file from log entries. -* Renaming and VC:: A command to rename both the source and master - file correctly. -* Revision Tags:: Symbolic names for revisions. +* VC Delete/Rename:: Deleting and renaming version-controlled files. +* Revision Tags:: Symbolic names for revisions. * Version Headers:: Inserting version control headers into working files. Customizing VC === modified file 'doc/emacs/files.texi' --- doc/emacs/files.texi 2011-12-21 08:39:32 +0000 +++ doc/emacs/files.texi 2011-12-25 14:16:00 +0000 @@ -1485,6 +1485,12 @@ them delete outright, instead of using the Trash, regardless of @code{delete-by-moving-to-trash}. +@ifnottex + If a file is under version control (@pxref{Version Control}), you +should delete it using @kbd{M-x vc-delete-file} instead of @kbd{M-x +delete-file}. @xref{VC Delete/Rename}. +@end ifnottex + @findex copy-file @cindex copying files @kbd{M-x copy-file} reads the file @var{old} and writes a new file @@ -1514,10 +1520,9 @@ ask for confirmation when the new file name already exists, too. @ifnottex - Note that if a file is under version control (@pxref{Version -Control}), you normally ought to rename it via the version control -system instead, using @kbd{M-x vc-rename-file}. @xref{Renaming and -VC}. + If a file is under version control (@pxref{Version Control}), you +should rename it using @kbd{M-x vc-rename-file} instead of @kbd{M-x +rename-file}. @xref{VC Delete/Rename}. @end ifnottex @findex add-name-to-file === modified file 'doc/emacs/maintaining.texi' --- doc/emacs/maintaining.texi 2011-12-22 10:14:41 +0000 +++ doc/emacs/maintaining.texi 2011-12-25 14:16:00 +0000 @@ -1188,7 +1188,7 @@ active, unmark all the files in the region (@code{vc-dir-unmark}). @item U -If point is on a file entry, umark all files with the same status; if +If point is on a file entry, unmark all files with the same status; if point is on a directory entry, unmark all files in that directory tree (@code{vc-dir-unmark-all-files}). With a prefix argument, unmark all files and directories. @@ -1567,8 +1567,8 @@ @cindex tags and tag tables A @dfn{tag} is a reference to a subunit in a program or in a -document. In program source code, tags reference syntactic elements -of the program: functions, subroutines, data types, macros, etc. In a +document. In source code, tags reference syntactic elements of the +program: functions, subroutines, data types, macros, etc. In a document, tags reference chapters, sections, appendices, etc. Each tag specifies the name of the file where the corresponding subunit is defined, and the position of the subunit's definition in that file. @@ -1582,34 +1582,36 @@ C files; and Fortran files produced by preprocessing @file{.fpp} source files. - To produce a tags table, you use the @samp{etags} command, -submitting it a document or the source code of a program. -@samp{etags} writes the tags to a @dfn{tags table file}, or @dfn{tags -file} in short. The conventional name for a tags file is @file{TAGS}. +@cindex etags + To produce a tags table, you run the @command{etags} shell command +on a document or the source code file. The @samp{etags} program +writes the tags to a @dfn{tags table file}, or @dfn{tags file} in +short. The conventional name for a tags file is @file{TAGS}. +@xref{Create Tags Table}. - Emacs uses the information recorded in tags tables in commands that -search or replace through multiple source files: these commands use -the names of the source files recorded in the tags table to know which -files to search. Other commands, such as @kbd{M-.}, which finds the -definition of a function, use the recorded information about the -function names and positions to find the source file and the position -within that file where the function is defined. + Emacs provides many commands for searching and replacing using the +information recorded in tags tables. For instance, the @kbd{M-.} +(@code{find-tag}) jumps to the location of a specified function +definition in its source file. @xref{Find Tag}. @cindex C++ class browser, tags @cindex tags, C++ @cindex class browser, C++ @cindex Ebrowse - See also the Ebrowse facility, which is tailored for C++. -@xref{Top,, Ebrowse, ebrowse, Ebrowse User's Manual}. + The Ebrowse facility is similar to @command{etags} but specifically +tailored for C++. @xref{Top,, Ebrowse, ebrowse, Ebrowse User's +Manual}. The Semantic package provides another way to generate and +use tags, separate from the @command{etags} facility. +@xref{Semantic}. @menu * Tag Syntax:: Tag syntax for various types of code and text files. -* Create Tags Table:: Creating a tags table with @code{etags}. +* Create Tags Table:: Creating a tags table with @command{etags}. * Etags Regexps:: Create arbitrary tags using regular expressions. * Select Tags Table:: How to visit a tags table. * Find Tag:: Commands to find the definition of a specific tag. * Tags Search:: Using a tags table for searching and replacing. -* List Tags:: Listing and finding tags defined in a file. +* List Tags:: Using tags for completion, and listing them. @end menu @node Tag Syntax @@ -1631,7 +1633,7 @@ You can tag function declarations and external variables in addition to function definitions by giving the @samp{--declarations} option to -@code{etags}. +@command{etags}. @item In C++ code, in addition to all the tag constructs of C code, member @@ -1648,15 +1650,15 @@ @samp{@var{class}.@var{variable}} and @samp{@var{class}.@var{function}}. @item -In La@TeX{} text, the argument of any of the commands @code{\chapter}, +In La@TeX{} documents, the arguments for @code{\chapter}, @code{\section}, @code{\subsection}, @code{\subsubsection}, @code{\eqno}, @code{\label}, @code{\ref}, @code{\cite}, @code{\bibitem}, @code{\part}, @code{\appendix}, @code{\entry}, @code{\index}, @code{\def}, @code{\newcommand}, @code{\renewcommand}, -@code{\newenvironment} or @code{\renewenvironment} is a tag.@refill +@code{\newenvironment} and @code{\renewenvironment} are tags. Other commands can make tags as well, if you specify them in the -environment variable @env{TEXTAGS} before invoking @code{etags}. The +environment variable @env{TEXTAGS} before invoking @command{etags}. The value of this environment variable should be a colon-separated list of command names. For example, @@ -1788,9 +1790,9 @@ @node Create Tags Table @subsection Creating Tags Tables -@cindex @code{etags} program +@cindex @command{etags} program - The @code{etags} program is used to create a tags table file. It knows + The @command{etags} program is used to create a tags table file. It knows the syntax of several languages, as described in @iftex the previous section. @@ -1798,53 +1800,46 @@ @ifnottex @ref{Tag Syntax}. @end ifnottex -Here is how to run @code{etags}: +Here is how to run @command{etags}: @example etags @var{inputfiles}@dots{} @end example @noindent -The @code{etags} program reads the specified files, and writes a tags +The @command{etags} program reads the specified files, and writes a tags table named @file{TAGS} in the current working directory. You can optionally specify a different file name for the tags table by using the @samp{--output=@var{file}} option; specifying @file{-} as a file name prints the tags table to standard output. - If the specified files don't exist, @code{etags} looks for + If the specified files don't exist, @command{etags} looks for compressed versions of them and uncompresses them to read them. Under -MS-DOS, @code{etags} also looks for file names like @file{mycode.cgz} +MS-DOS, @command{etags} also looks for file names like @file{mycode.cgz} if it is given @samp{mycode.c} on the command line and @file{mycode.c} does not exist. - @code{etags} recognizes the language used in an input file based on -its file name and contents. You can specify the language with the -@samp{--language=@var{name}} option, described below. - - If the tags table data become outdated due to changes in the files -described in the table, the way to update the tags table is the same -way it was made in the first place. If the tags table fails to record -a tag, or records it for the wrong file, then Emacs cannot possibly -find its definition until you update the tags table. However, if the -position recorded in the tags table becomes a little bit wrong (due to -other editing), the worst consequence is a slight delay in finding the -tag. Even if the stored position is very far wrong, Emacs will still -find the tag, after searching most of the file for it. That delay is -hardly noticeable with today's computers. + If the tags table becomes outdated due to changes in the files +described in it, you can update it by running the @command{etags} +program again. If the tags table does not record a tag, or records it +for the wrong file, then Emacs will not be able to find that +definition until you update the tags table. But if the position +recorded in the tags table becomes a little bit wrong (due to other +editing), Emacs will still be able to find the right position, with a +slight delay. Thus, there is no need to update the tags table after each edit. You should update a tags table when you define new tags that you want to have listed, or when you move tag definitions from one file to another, or when changes become substantial. - One tags table can virtually include another. Specify the included -tags file name with the @samp{--include=@var{file}} option when -creating the file that is to include it. The latter file then acts as -if it covered all the source files specified in the included file, as -well as the files it directly contains. + You can make a tags table @dfn{include} another tags table, by +passing the @samp{--include=@var{file}} option to @command{etags}. It +then covers all the files covered by the included tags file, as well +as its own. If you specify the source files with relative file names when you run -@code{etags}, the tags file will contain file names relative to the +@command{etags}, the tags file will contain file names relative to the directory where the tags file was initially written. This way, you can move an entire directory tree containing both the tags file and the source files, and the tags file will still refer correctly to the source @@ -1857,40 +1852,41 @@ pointing to a tags file in a different directory, because this would generally render the file names invalid. - If you specify absolute file names as arguments to @code{etags}, then + If you specify absolute file names as arguments to @command{etags}, then the tags file will contain absolute file names. This way, the tags file will still refer to the same files even if you move it, as long as the source files remain in the same place. Absolute file names start with @samp{/}, or with @samp{@var{device}:/} on MS-DOS and MS-Windows. - When you want to make a tags table from a great number of files, you -may have problems listing them on the command line, because some systems -have a limit on its length. The simplest way to circumvent this limit -is to tell @code{etags} to read the file names from its standard input, -by typing a dash in place of the file names, like this: + When you want to make a tags table from a great number of files, +you may have problems listing them on the command line, because some +systems have a limit on its length. You can circumvent this limit by +telling @command{etags} to read the file names from its standard +input, by typing a dash in place of the file names, like this: @smallexample find . -name "*.[chCH]" -print | etags - @end smallexample - Use the option @samp{--language=@var{name}} to specify the language -explicitly. You can intermix these options with file names; each one -applies to the file names that follow it. Specify -@samp{--language=auto} to tell @code{etags} to resume guessing the -language from the file names and file contents. Specify -@samp{--language=none} to turn off language-specific processing -entirely; then @code{etags} recognizes tags by regexp matching alone -(@pxref{Etags Regexps}). + @command{etags} recognizes the language used in an input file based +on its file name and contents. You can specify the language +explicitly with the @samp{--language=@var{name}} option. You can +intermix these options with file names; each one applies to the file +names that follow it. Specify @samp{--language=auto} to tell +@command{etags} to resume guessing the language from the file names +and file contents. Specify @samp{--language=none} to turn off +language-specific processing entirely; then @command{etags} recognizes +tags by regexp matching alone (@pxref{Etags Regexps}). The option @samp{--parse-stdin=@var{file}} is mostly useful when -calling @code{etags} from programs. It can be used (only once) in -place of a file name on the command line. @code{Etags} will read from +calling @command{etags} from programs. It can be used (only once) in +place of a file name on the command line. @command{etags} will read from standard input and mark the produced tags as belonging to the file @var{file}. - @samp{etags --help} outputs the list of the languages @code{etags} + @samp{etags --help} outputs the list of the languages @command{etags} knows, and the file name rules for guessing the language. It also prints -a list of all the available @code{etags} options, together with a short +a list of all the available @command{etags} options, together with a short explanation. If followed by one or more @samp{--language=@var{lang}} options, it outputs detailed information about how tags are generated for @var{lang}. @@ -1898,21 +1894,22 @@ @node Etags Regexps @subsection Etags Regexps - The @samp{--regex} option provides a general way of recognizing tags -based on regexp matching. You can freely intermix this option with -file names, and each one applies to the source files that follow it. -If you specify multiple @samp{--regex} options, all of them are used -in parallel. The syntax is: + The @samp{--regex} option to @command{etags} allows tags to be +recognized by regular expression matching. You can intermix this +option with file names; each one applies to the source files that +follow it. If you specify multiple @samp{--regex} options, all of +them are used in parallel. The syntax is: @smallexample --regex=[@var{@{language@}}]/@var{tagregexp}/[@var{nameregexp}/]@var{modifiers} @end smallexample - The essential part of the option value is @var{tagregexp}, the -regexp for matching tags. It is always used anchored, that is, it -only matches at the beginning of a line. If you want to allow -indented tags, use a regexp that matches initial whitespace; start it -with @samp{[ \t]*}. +@noindent +The essential part of the option value is @var{tagregexp}, the regexp +for matching tags. It is always used anchored, that is, it only +matches at the beginning of a line. If you want to allow indented +tags, use a regexp that matches initial whitespace; start it with +@samp{[ \t]*}. In these regular expressions, @samp{\} quotes the next character, and all the GCC character escape sequences are supported (@samp{\a} for @@ -1929,7 +1926,7 @@ below. The @var{modifiers} are a sequence of zero or more characters that -modify the way @code{etags} does the matching. A regexp with no +modify the way @command{etags} does the matching. A regexp with no modifiers is applied sequentially to each line of the input file, in a case-sensitive way. The modifiers and their meanings are: @@ -1954,22 +1951,22 @@ @end smallexample @noindent -Here @code{etags} chooses the parsing language for @file{voo.doo} and -@file{bar.ber} according to their contents. @code{etags} also uses +Here @command{etags} chooses the parsing language for @file{voo.doo} and +@file{bar.ber} according to their contents. @command{etags} also uses @var{reg1} to recognize additional tags in @file{voo.doo}, and both @var{reg1} and @var{reg2} to recognize additional tags in @file{bar.ber}. @var{reg1} is checked against each line of @file{voo.doo} and @file{bar.ber}, in a case-insensitive way, while @var{reg2} is checked against the whole @file{bar.ber} file, -permitting multi-line matches, in a case-sensitive way. @code{etags} +permitting multi-line matches, in a case-sensitive way. @command{etags} uses only the Lisp tags rules, with no user-specified regexp matching, to recognize tags in @file{los.er}. You can restrict a @samp{--regex} option to match only files of a given language by using the optional prefix @var{@{language@}}. (@samp{etags --help} prints the list of languages recognized by -@code{etags}.) This is particularly useful when storing many -predefined regular expressions for @code{etags} in a file. The +@command{etags}.) This is particularly useful when storing many +predefined regular expressions for @command{etags} in a file. The following example tags the @code{DEFVAR} macros in the Emacs source files, for the C language only: @@ -1979,7 +1976,7 @@ @noindent When you have complex regular expressions, you can store the list of -them in a file. The following option syntax instructs @code{etags} to +them in a file. The following option syntax instructs @command{etags} to read two files of regular expressions. The regular expressions contained in the second file are matched without regard to case. @@ -1988,9 +1985,9 @@ @end smallexample @noindent -A regex file for @code{etags} contains one regular expression per +A regex file for @command{etags} contains one regular expression per line. Empty lines, and lines beginning with space or tab are ignored. -When the first character in a line is @samp{@@}, @code{etags} assumes +When the first character in a line is @samp{@@}, @command{etags} assumes that the rest of the line is the name of another file of regular expressions; thus, one such file can include another file. All the other lines are taken to be regular expressions. If the first @@ -2053,14 +2050,14 @@ @node Select Tags Table @subsection Selecting a Tags Table -@vindex tags-file-name @findex visit-tags-table - Emacs has at any time one @dfn{selected} tags table, and all the + Emacs has at any time one @dfn{selected} tags table. All the commands for working with tags tables use the selected one. To select a tags table, type @kbd{M-x visit-tags-table}, which reads the tags table file name as an argument, with @file{TAGS} in the default directory as the default. +@vindex tags-file-name Emacs does not actually read in the tags table contents until you try to use them; all @code{visit-tags-table} does is store the file name in the variable @code{tags-file-name}, and setting the variable @@ -2124,27 +2121,25 @@ @kindex M-. @findex find-tag - @kbd{M-.}@: (@code{find-tag}) is the command to find the definition of -a specified tag. It searches through the tags table for that tag, as a -string, and then uses the tags table info to determine the file that the -definition is in and the approximate character position in the file of -the definition. Then @code{find-tag} visits that file, moves point to -the approximate character position, and searches ever-increasing -distances away to find the tag definition. + @kbd{M-.}@: (@code{find-tag}) prompts for a tag name and jumps to +its source definition. It works by searching through the tags table +for that tag's file and approximate character position, visiting that +file, and searching for the tag definition at ever-increasing +distances away from the recorded approximate position. - If an empty argument is given (just type @key{RET}), the balanced -expression in the buffer before or around point is used as the -@var{tag} argument. @xref{Expressions}. + When entering the tag argument to @kbd{M-.}, the usual minibuffer +completion commands can be used (@pxref{Completion}), with the tag +names in the selected tags table as completion candidates. If you +specify an empty argument, the balanced expression in the buffer +before or around point is the default argument. @xref{Expressions}. You don't need to give @kbd{M-.} the full name of the tag; a part -will do. This is because @kbd{M-.} finds tags in the table which -contain @var{tag} as a substring. However, it prefers an exact match -to a substring match. To find other tags that match the same -substring, give @code{find-tag} a numeric argument, as in @kbd{C-u -M-.}; this does not read a tag name, but continues searching the tags -table's text for another tag containing the same substring last used. -If you have a real @key{META} key, @kbd{M-0 M-.}@: is an easier -alternative to @kbd{C-u M-.}. +will do. @kbd{M-.} finds tags which contain that argument as a +substring. However, it prefers an exact match to a substring match. +To find other tags that match the same substring, give @code{find-tag} +a numeric argument, as in @kbd{C-u M-.} or @kbd{M-0 M-.}; this does +not read a tag name, but continues searching the tags table's text for +another tag containing the same substring last used. @kindex C-x 4 . @findex find-tag-other-window @@ -2152,23 +2147,23 @@ @findex find-tag-other-frame Like most commands that can switch buffers, @code{find-tag} has a variant that displays the new buffer in another window, and one that -makes a new frame for it. The former is @w{@kbd{C-x 4 .}}, which invokes -the command @code{find-tag-other-window}. The latter is @w{@kbd{C-x 5 .}}, -which invokes @code{find-tag-other-frame}. +makes a new frame for it. The former is @w{@kbd{C-x 4 .}} +(@code{find-tag-other-window}), and the latter is @w{@kbd{C-x 5 .}} +(@code{find-tag-other-frame}). - To move back to places you've found tags recently, use @kbd{C-u - -M-.}; more generally, @kbd{M-.} with a negative numeric argument. This -command can take you to another buffer. @w{@kbd{C-x 4 .}} with a negative -argument finds the previous tag location in another window. + To move back to previous tag definitions, use @kbd{C-u - M-.}; more +generally, @kbd{M-.} with a negative numeric argument. Similarly, +@w{@kbd{C-x 4 .}} with a negative argument finds the previous tag +location in another window. @kindex M-* @findex pop-tag-mark @vindex find-tag-marker-ring-length - As well as going back to places you've found tags recently, you can go -back to places @emph{from where} you found them. Use @kbd{M-*}, which -invokes the command @code{pop-tag-mark}, for this. Typically you would -find and study the definition of something with @kbd{M-.} and then -return to where you were with @kbd{M-*}. + As well as going back to places you've found tags recently, you can +go back to places @emph{from where} you found them, using @kbd{M-*} +(@code{pop-tag-mark}). Thus you can find and examine the definition +of something with @kbd{M-.} and then return to where you were with +@kbd{M-*}. Both @kbd{C-u - M-.} and @kbd{M-*} allow you to retrace your steps to a depth determined by the variable @code{find-tag-marker-ring-length}. @@ -2212,10 +2207,10 @@ @kindex M-, @findex tags-loop-continue - Having found one match, you probably want to find all the rest. To find -one more match, type @kbd{M-,} (@code{tags-loop-continue}) to resume the -@code{tags-search}. This searches the rest of the current buffer, followed -by the remaining files of the tags table.@refill + Having found one match, you probably want to find all the rest. +Type @kbd{M-,} (@code{tags-loop-continue}) to resume the +@code{tags-search}, finding one more match. This searches the rest of +the current buffer, followed by the remaining files of the tags table. @findex tags-query-replace @kbd{M-x tags-query-replace} performs a single @@ -2252,56 +2247,56 @@ Buffers in which no match is found are quickly killed; the others continue to exist. - It may have struck you that @code{tags-search} is a lot like -@code{grep}. You can also run @code{grep} itself as an inferior of -Emacs and have Emacs show you the matching lines one by one. + As an alternative to @code{tags-search}, you can run @command{grep} +as a subprocess and have Emacs show you the matching lines one by one. @xref{Grep Searching}. @node List Tags @subsection Tags Table Inquiries @table @kbd +@item C-M-i +@itemx M-@key{TAB} +Perform completion on the text around point, using the selected tags +table if one is loaded (@code{completion-at-point}). @item M-x list-tags @key{RET} @var{file} @key{RET} Display a list of the tags defined in the program file @var{file}. @item M-x tags-apropos @key{RET} @var{regexp} @key{RET} Display a list of all tags matching @var{regexp}. @end table +@cindex completion (symbol names) + In most programming language modes, you can type @kbd{C-M-i} or +@kbd{M-@key{TAB}} (@code{completion-at-point}) to complete the symbol +at point. If there is a selected tags table, this command can use it +to generate completion candidates. @xref{Symbol Completion}. + @findex list-tags - @kbd{M-x list-tags} reads the name of one of the files described by -the selected tags table, and displays a list of all the tags defined in -that file. The ``file name'' argument is really just a string to -compare against the file names recorded in the tags table; it is read as -a string rather than as a file name. Therefore, completion and -defaulting are not available, and you must enter the file name the same -way it appears in the tags table. Do not include a directory as part of -the file name unless the file name recorded in the tags table includes a -directory. + @kbd{M-x list-tags} reads the name of one of the files covered by +the selected tags table, and displays a list of tags defined in that +file. Do not include a directory as part of the file name unless the +file name recorded in the tags table includes a directory. @findex tags-apropos @vindex tags-apropos-verbose +@vindex tags-tag-face +@vindex tags-apropos-additional-actions @kbd{M-x tags-apropos} is like @code{apropos} for tags -(@pxref{Apropos}). It finds all the tags in the selected tags table -whose entries match @var{regexp}, and displays them. If the variable +(@pxref{Apropos}). It displays a list of tags in the selected tags +table whose entries match @var{regexp}. If the variable @code{tags-apropos-verbose} is non-@code{nil}, it displays the names -of the tags files together with the tag names. - -@vindex tags-tag-face -@vindex tags-apropos-additional-actions - You can customize the appearance of the output by setting the -variable @code{tags-tag-face} to a face. You can display additional -output with @kbd{M-x tags-apropos} by customizing the variable -@code{tags-apropos-additional-actions}---see its documentation for -details. - - You can also use the collection of tag names to complete a symbol -name in the buffer. @xref{Symbol Completion}. - - You can use @kbd{M-x next-file} to visit the files in the selected -tags table. The first time this command is called, it visits the -first file in the tags table. Each subsequent call visits the next -file in the table, unless a prefix argument is supplied, in which case -it returns to the first file. +of the tags files together with the tag names. You can customize the +appearance of the output by setting the variable @code{tags-tag-face} +to a face. You can display additional output by customizing the +variable @code{tags-apropos-additional-actions}; see its documentation +for details. + +@findex next-file + @kbd{M-x next-file} visits files covered by the selected tags table. +The first time it is called, it visits the first file covered by the +table. Each subsequent call visits the next covered file, unless a +prefix argument is supplied, in which case it returns to the first +file. @node EDE @section Emacs Development Environment === modified file 'doc/emacs/programs.texi' --- doc/emacs/programs.texi 2011-12-21 08:39:32 +0000 +++ doc/emacs/programs.texi 2011-12-25 14:16:00 +0000 @@ -1291,18 +1291,18 @@ @kbd{@key{ESC} @key{TAB}} instead. @cindex tags-based completion - In-buffer symbol completion generates its completion list in a -number of different ways. If Semantic mode is enabled, Emacs tries to -use the Semantic parser data for completion (@pxref{Semantic}). If -Semantic mode is not enabled or it fails at performing completion, -Emacs normally tries to complete using a tags table (@pxref{Tags}). - +@findex completion-at-point @cindex Lisp symbol completion @cindex completion (Lisp symbols) - In Emacs Lisp mode, completion is performed using the function, -variable, and property names defined in the current Emacs session. If -there is an open parenthesis immediately before the beginning of the -partial symbol, only symbols with function definitions are considered. + In most programming language modes, @kbd{C-M-i} (or +@kbd{M-@key{TAB}}) invokes the command @code{completion-at-point}, +which generates its completion list in a flexible way. If Semantic +mode is enabled, it tries to use the Semantic parser data for +completion (@pxref{Semantic}). If Semantic mode is not enabled or +fails at performing completion, it tries to complete using the +selected tags table (@pxref{Tags}). If in Emacs Lisp mode, it +performs completion using the function, variable, or property names +defined in the current Emacs session. In all other respects, in-buffer symbol completion behaves like minibuffer completion. For instance, if Emacs cannot complete to a === modified file 'doc/emacs/vc1-xtra.texi' --- doc/emacs/vc1-xtra.texi 2011-12-22 10:14:41 +0000 +++ doc/emacs/vc1-xtra.texi 2011-12-25 14:16:00 +0000 @@ -12,8 +12,7 @@ @menu * Change Logs and VC:: Generating a change log file from log entries. -* Renaming and VC:: A command to rename both the source and master - file correctly. +* VC Delete/Rename:: Deleting and renaming version-controlled files. * Revision Tags:: Symbolic names for revisions. * Version Headers:: Inserting version control headers into working files. @end menu @@ -104,33 +103,48 @@ such files all have the same text, it coalesces them into a single entry. -@node Renaming and VC -@subsubsection Renaming VC Work Files and Master Files +@node VC Delete/Rename +@subsubsection Deleting and Renaming Version-Controlled Files @cindex renaming version-controlled files @table @kbd +@item M-x vc-delete-file +Prompt for a file name, delete the file from the working tree, and +schedule the deletion for committing. + @item M-x vc-rename-file -Prompt for two file names, @var{VAR} and @var{OLD}, and rename them in -the version-controlled working tree. +Prompt for two file names, @var{VAR} and @var{OLD}, rename them in the +working tree, and schedule the renaming for committing. @end table +@findex vc-delete-file + If you wish to delete a version-controlled file, use the command +@kbd{M-x vc-delete-file}. This prompts for the file name, and deletes +it via the version control system. The file is removed from the +working tree, and in the VC Directory buffer +@iftex +(@pxref{VC Directory Mode}), +@end iftex +@ifnottex +(@pxref{VC Directory Mode}), +@end ifnottex +it is displayed with the @samp{removed} status. When you commit it, +the deletion takes effect in the repository. + @findex vc-rename-file - If you wish to rename a registered file in a version-controlled -working tree, use the command @kbd{M-x vc-rename-file}. This prompts -for two arguments: the file you wish to rename, followed by the new -name; then it performs the renaming through the version control -system. + To rename a version-controlled file, type @kbd{M-x vc-rename-file}. +This prompts for two arguments: the name of the file you wish to +rename, and the new name; then it performs the renaming via the +version control system. The renaming takes effect immediately in the +working tree, and takes effect in the repository when you commit the +renamed file. On modern version control systems that have built-in support for -renaming, the renaming operation takes effect immediately in the -working tree, and takes effect in the repository when you commit the -renamed file. The renamed file retains the full change history of the -original file. - - On CVS and older version control systems, the @code{vc-rename-file} -command actually works by creating a copy of the old file under the -new name, registering it, and deleting the old file. In this case, -the change history is not preserved. +renaming, the renamed file retains the full change history of the +original file. On CVS and older version control systems, the +@code{vc-rename-file} command actually works by creating a copy of the +old file under the new name, registering it, and deleting the old +file. In this case, the change history is not preserved. @node Revision Tags @subsubsection Revision Tags === modified file 'etc/NEWS' --- etc/NEWS 2011-12-22 23:30:10 +0000 +++ etc/NEWS 2011-12-25 14:16:00 +0000 @@ -97,10 +97,10 @@ ** Completion *** shell-mode uses pcomplete rules, with the standard completion UI. - ++++ *** Many packages have been changed to use `completion-at-point' rather than their own completion code. - ++++ *** `completion-at-point' now handles tags and semantic completion. --- *** Completion in a non-minibuffer now tries to detect the end of completion ------------------------------------------------------------ revno: 106732 committer: Chong Yidong branch nick: trunk timestamp: Sun 2011-12-25 18:46:49 +0800 message: Fix GDB/MI inline completion. * progmodes/gdb-mi.el (gdb-input): Accept command and handler function as separate arguments. (gdb-init-1, gdb-non-stop-handler, gdb-check-target-async) (gdb-tooltip-print-1, gud-watch, gdb-speedbar-update) (gdb-var-list-children, gdb-var-set-format, gdb-var-delete-1) (gdb-var-delete-children, gdb-edit-value, gdb-var-update) (gdb-stopped, def-gdb-auto-update-trigger) (gdb-place-breakpoints, gdb-select-thread, gdb-select-frame) (gdb-get-changed-registers, gdb-get-main-selected-frame): Callers changed. (gud-gdbmi-completions): New function. (gdb): Use it for generating the completion table. * progmodes/gud.el (gud-gdb-fetch-lines-filter): Just use gud-gdb-marker-filter without taking it as an argument. (gud-gdb-run-command-fetch-lines): Caller changed. (gud-gdb-completion-function): New variable. (gud-gdb-completion-at-point): Use it. (gud-gdb-completions-1): Split from gud-gdb-completions. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-12-24 19:32:31 +0000 +++ lisp/ChangeLog 2011-12-25 10:46:49 +0000 @@ -1,3 +1,25 @@ +2011-12-25 Chong Yidong + + * progmodes/gud.el (gud-gdb-fetch-lines-filter): Just use + gud-gdb-marker-filter without taking it as an argument. + (gud-gdb-run-command-fetch-lines): Caller changed. + (gud-gdb-completion-function): New variable. + (gud-gdb-completion-at-point): Use it. + (gud-gdb-completions-1): Split from gud-gdb-completions. + + * progmodes/gdb-mi.el (gdb-input): Accept command and handler + function as separate arguments. + (gdb-init-1, gdb-non-stop-handler, gdb-check-target-async) + (gdb-tooltip-print-1, gud-watch, gdb-speedbar-update) + (gdb-var-list-children, gdb-var-set-format, gdb-var-delete-1) + (gdb-var-delete-children, gdb-edit-value, gdb-var-update) + (gdb-stopped, def-gdb-auto-update-trigger) + (gdb-place-breakpoints, gdb-select-thread, gdb-select-frame) + (gdb-get-changed-registers, gdb-get-main-selected-frame): Callers + changed. + (gud-gdbmi-completions): New function. + (gdb): Use it for generating the completion table. + 2011-12-24 Alan Mackenzie Introduce a mechanism to widen the region used in context font === modified file 'lisp/progmodes/gdb-mi.el' --- lisp/progmodes/gdb-mi.el 2011-12-15 07:24:10 +0000 +++ lisp/progmodes/gdb-mi.el 2011-12-25 10:46:49 +0000 @@ -811,8 +811,8 @@ (define-key gud-minor-mode-map [left-margin C-mouse-3] 'gdb-mouse-jump) - (set (make-local-variable 'comint-prompt-regexp) - "^(.*gdb[+]?) *") + (set (make-local-variable 'gud-gdb-completion-function) + 'gud-gdbmi-completions) (add-hook 'completion-at-point-functions #'gud-gdb-completion-at-point nil 'local) @@ -862,31 +862,28 @@ (set-process-filter (get-process "gdb-inferior") 'gdb-inferior-filter) (gdb-input ;; Needs GDB 6.4 onwards - (list (concat "-inferior-tty-set " - (or - ;; The process can run on a remote host. - (process-get (get-process "gdb-inferior") 'remote-tty) - (process-tty-name (get-process "gdb-inferior")))) - 'ignore)) + (concat "-inferior-tty-set " + (or + ;; The process can run on a remote host. + (process-get (get-process "gdb-inferior") 'remote-tty) + (process-tty-name (get-process "gdb-inferior")))) + 'ignore) (if (eq window-system 'w32) - (gdb-input (list "-gdb-set new-console off" 'ignore))) - (gdb-input (list "-gdb-set height 0" 'ignore)) + (gdb-input "-gdb-set new-console off" 'ignore)) + (gdb-input "-gdb-set height 0" 'ignore) (when gdb-non-stop - (gdb-input (list "-gdb-set non-stop 1" 'gdb-non-stop-handler))) + (gdb-input "-gdb-set non-stop 1" 'gdb-non-stop-handler)) - (gdb-input (list "-enable-pretty-printing" 'ignore)) + (gdb-input "-enable-pretty-printing" 'ignore) ;; find source file and compilation directory here (if gdb-create-source-file-list - (gdb-input - ; Needs GDB 6.2 onwards. - (list "-file-list-exec-source-files" 'gdb-get-source-file-list))) - (gdb-input - ; Needs GDB 6.0 onwards. - (list "-file-list-exec-source-file" 'gdb-get-source-file)) - (gdb-input - (list "-gdb-show prompt" 'gdb-get-prompt))) + ;; Needs GDB 6.2 onwards. + (gdb-input "-file-list-exec-source-files" 'gdb-get-source-file-list)) + ;; Needs GDB 6.0 onwards. + (gdb-input "-file-list-exec-source-file" 'gdb-get-source-file) + (gdb-input "-gdb-show prompt" 'gdb-get-prompt)) (defun gdb-non-stop-handler () (goto-char (point-min)) @@ -897,8 +894,8 @@ (setq gdb-non-stop nil) (setq gdb-supports-non-stop nil)) (setq gdb-supports-non-stop t) - (gdb-input (list "-gdb-set target-async 1" 'ignore)) - (gdb-input (list "-list-target-features" 'gdb-check-target-async)))) + (gdb-input "-gdb-set target-async 1" 'ignore) + (gdb-input "-list-target-features" 'gdb-check-target-async))) (defun gdb-check-target-async () (goto-char (point-min)) @@ -906,7 +903,7 @@ (message "Target doesn't support non-stop mode. Turning it off.") (setq gdb-non-stop nil) - (gdb-input (list "-gdb-set non-stop 0" 'ignore)))) + (gdb-input "-gdb-set non-stop 0" 'ignore))) (defvar gdb-define-alist nil "Alist of #define directives for GUD tooltips.") @@ -951,9 +948,8 @@ (goto-char (point-min)) (if (search-forward "expands to: " nil t) (unless (looking-at "\\S-+.*(.*).*") - (gdb-input - (list (concat "-data-evaluate-expression " expr) - `(lambda () (gdb-tooltip-print ,expr)))))))) + (gdb-input (concat "-data-evaluate-expression " expr) + `(lambda () (gdb-tooltip-print ,expr))))))) (defun gdb-init-buffer () (set (make-local-variable 'gud-minor-mode) 'gdbmi) @@ -1083,9 +1079,8 @@ (concat (if (derived-mode-p 'gdb-registers-mode) "$") (tooltip-identifier-from-point (point))))))) (set-text-properties 0 (length expr) nil expr) - (gdb-input - (list (concat "-var-create - * " expr "") - `(lambda () (gdb-var-create-handler ,expr))))))) + (gdb-input (concat "-var-create - * " expr "") + `(lambda () (gdb-var-create-handler ,expr)))))) (message "gud-watch is a no-op in this mode.")))) (defun gdb-var-create-handler (expr) @@ -1114,7 +1109,7 @@ (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame) (not (gdb-pending-p 'gdb-speedbar-timer))) ;; Dummy command to update speedbar even when idle. - (gdb-input (list "-environment-pwd" 'gdb-speedbar-timer-fn)) + (gdb-input "-environment-pwd" 'gdb-speedbar-timer-fn) ;; Keep gdb-pending-triggers non-nil till end. (gdb-add-pending 'gdb-speedbar-timer))) @@ -1135,12 +1130,9 @@ ; Uses "-var-list-children --all-values". Needs GDB 6.1 onwards. (defun gdb-var-list-children (varnum) - (gdb-input - (list (concat "-var-update " varnum) 'ignore)) - (gdb-input - (list (concat "-var-list-children --all-values " - varnum) - `(lambda () (gdb-var-list-children-handler ,varnum))))) + (gdb-input (concat "-var-update " varnum) 'ignore) + (gdb-input (concat "-var-list-children --all-values " varnum) + `(lambda () (gdb-var-list-children-handler ,varnum)))) (defun gdb-var-list-children-handler (varnum) (let* ((var-list nil) @@ -1172,13 +1164,11 @@ "Set the output format for a variable displayed in the speedbar." (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list)) (varnum (car var))) - (gdb-input - (list (concat "-var-set-format " varnum " " format) 'ignore)) + (gdb-input (concat "-var-set-format " varnum " " format) 'ignore) (gdb-var-update))) (defun gdb-var-delete-1 (var varnum) - (gdb-input - (list (concat "-var-delete " varnum) 'ignore)) + (gdb-input (concat "-var-delete " varnum) 'ignore) (setq gdb-var-list (delq var gdb-var-list)) (dolist (varchild gdb-var-list) (if (string-match (concat (car var) "\\.") (car varchild)) @@ -1197,17 +1187,15 @@ (defun gdb-var-delete-children (varnum) "Delete children of variable object at point from the speedbar." - (gdb-input - (list (concat "-var-delete -c " varnum) 'ignore))) + (gdb-input (concat "-var-delete -c " varnum) 'ignore)) (defun gdb-edit-value (_text _token _indent) "Assign a value to a variable displayed in the speedbar." (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list)) (varnum (car var)) (value)) (setq value (read-string "New value: ")) - (gdb-input - (list (concat "-var-assign " varnum " " value) - `(lambda () (gdb-edit-value-handler ,value)))))) + (gdb-input (concat "-var-assign " varnum " " value) + `(lambda () (gdb-edit-value-handler ,value))))) (defconst gdb-error-regexp "\\^error,msg=\\(\".+\"\\)") @@ -1219,8 +1207,7 @@ ; Uses "-var-update --all-values". Needs GDB 6.4 onwards. (defun gdb-var-update () (if (not (gdb-pending-p 'gdb-var-update)) - (gdb-input - (list "-var-update --all-values *" 'gdb-var-update-handler))) + (gdb-input "-var-update --all-values *" 'gdb-var-update-handler)) (gdb-add-pending 'gdb-var-update)) (defun gdb-var-update-handler () @@ -1700,13 +1687,17 @@ gdb-continuation string "\"\n")) (setq gdb-continuation nil)))) -(defun gdb-input (item) - (if gdb-enable-debug (push (cons 'send-item item) gdb-debug-log)) +(defun gdb-input (command handler-function) + "Send COMMAND to GDB via the MI interface. +Run the function HANDLER-FUNCTION, with no arguments, once the command is +complete." + (if gdb-enable-debug (push (list 'send-item command handler-function) + gdb-debug-log)) (setq gdb-token-number (1+ gdb-token-number)) - (setcar item (concat (number-to-string gdb-token-number) (car item))) - (push (cons gdb-token-number (car (cdr item))) gdb-handler-alist) + (setq command (concat (number-to-string gdb-token-number) command)) + (push (cons gdb-token-number handler-function) gdb-handler-alist) (process-send-string (get-buffer-process gud-comint-buffer) - (concat (car item) "\n"))) + (concat command "\n"))) ;; NOFRAME is used for gud execution control commands (defun gdb-current-context-command (command) @@ -1893,15 +1884,16 @@ (let ((record-type (cadr output-record)) (arg1 (nth 2 output-record)) (arg2 (nth 3 output-record))) - (if (eq record-type 'gdb-error) - (gdb-done-or-error arg2 arg1 'error) - (if (eq record-type 'gdb-done) - (gdb-done-or-error arg2 arg1 'done) - ;; Suppress "No registers." since GDB 6.8 and earlier duplicates MI - ;; error message on internal stream. Don't print to GUD buffer. - (unless (and (eq record-type 'gdb-internals) - (string-equal (read arg1) "No registers.\n")) - (funcall record-type arg1)))))) + (cond ((eq record-type 'gdb-error) + (gdb-done-or-error arg2 arg1 'error)) + ((eq record-type 'gdb-done) + (gdb-done-or-error arg2 arg1 'done)) + ;; Suppress "No registers." GDB 6.8 and earlier + ;; duplicates MI error message on internal stream. + ;; Don't print to GUD buffer. + ((not (and (eq record-type 'gdb-internals) + (string-equal (read arg1) "No registers.\n"))) + (funcall record-type arg1))))) (setq gdb-output-sink 'user) ;; Remove padding. @@ -1994,11 +1986,10 @@ ;; -data-list-register-names needs to be issued for any stopped ;; thread (when (not gdb-register-names) - (gdb-input - (list (concat "-data-list-register-names" - (if gdb-supports-non-stop - (concat " --thread " thread-id))) - 'gdb-register-names-handler))) + (gdb-input (concat "-data-list-register-names" + (if gdb-supports-non-stop + (concat " --thread " thread-id))) + 'gdb-register-names-handler)) ;;; Don't set gud-last-frame here as it's currently done in gdb-frame-handler ;;; because synchronous GDB doesn't give these fields with CLI. @@ -2065,9 +2056,7 @@ ;; (frontend MI commands should not print to this stream) (defun gdb-console (output-field) (setq gdb-filter-output - (gdb-concat-output - gdb-filter-output - (read output-field)))) + (gdb-concat-output gdb-filter-output (read output-field)))) (defun gdb-done-or-error (output-field token-number type) (if (string-equal token-number "") @@ -2105,12 +2094,11 @@ (assq-delete-all token-number gdb-handler-alist))))) (defun gdb-concat-output (so-far new) - (let ((sink gdb-output-sink)) - (cond - ((eq sink 'user) (concat so-far new)) - ((eq sink 'emacs) - (gdb-append-to-partial-output new) - so-far)))) + (cond + ((eq gdb-output-sink 'user) (concat so-far new)) + ((eq gdb-output-sink 'emacs) + (gdb-append-to-partial-output new) + so-far))) (defun gdb-append-to-partial-output (string) (with-current-buffer (gdb-get-buffer-create 'gdb-partial-output-buffer) @@ -2320,9 +2308,8 @@ (memq signal ,signal-list)) (when (not (gdb-pending-p (cons (current-buffer) ',trigger-name))) - (gdb-input - (list ,gdb-command - (gdb-bind-function-to-buffer ',handler-name (current-buffer)))) + (gdb-input ,gdb-command + (gdb-bind-function-to-buffer ',handler-name (current-buffer))) (gdb-add-pending (cons (current-buffer) ',trigger-name)))))) ;; Used by disassembly buffer only, the rest use @@ -2449,13 +2436,10 @@ ;; Only want one breakpoint icon at each location. (gdb-put-breakpoint-icon (string-equal flag "y") bptno (string-to-number line))) - (gdb-input - (list (concat "list " file ":1") - 'ignore)) - (gdb-input - (list "-file-list-exec-source-file" - `(lambda () (gdb-get-location - ,bptno ,line ,flag)))))))))) + (gdb-input (concat "list " file ":1") 'ignore) + (gdb-input "-file-list-exec-source-file" + `(lambda () (gdb-get-location + ,bptno ,line ,flag))))))))) (defvar gdb-source-file-regexp "fullname=\"\\(.*?\\)\"") @@ -2785,7 +2769,7 @@ (def-gdb-thread-buffer-command gdb-select-thread (let ((new-id (bindat-get-field thread 'id))) (gdb-setq-thread-number new-id) - (gdb-input (list (concat "-thread-select " new-id) 'ignore)) + (gdb-input (concat "-thread-select " new-id) 'ignore) (gdb-update)) "Select the thread at current line of threads buffer.") @@ -3541,8 +3525,8 @@ (if (gdb-buffer-shows-main-thread-p) (let ((new-level (bindat-get-field frame 'level))) (setq gdb-frame-number new-level) - (gdb-input (list (concat "-stack-select-frame " new-level) - 'ignore)) + (gdb-input (concat "-stack-select-frame " new-level) + 'ignore) (gdb-update)) (error "Could not select frame for non-current thread")) (error "Not recognized as frame line")))) @@ -3770,14 +3754,11 @@ ;; Needs GDB 6.4 onwards (used to fail with no stack). (defun gdb-get-changed-registers () - (if (and (gdb-get-buffer 'gdb-registers-buffer) - (not (gdb-pending-p 'gdb-get-changed-registers))) - (progn - (gdb-input - (list - "-data-list-changed-registers" - 'gdb-changed-registers-handler)) - (gdb-add-pending 'gdb-get-changed-registers)))) + (when (and (gdb-get-buffer 'gdb-registers-buffer) + (not (gdb-pending-p 'gdb-get-changed-registers))) + (gdb-input "-data-list-changed-registers" + 'gdb-changed-registers-handler) + (gdb-add-pending 'gdb-get-changed-registers))) (defun gdb-changed-registers-handler () (gdb-delete-pending 'gdb-get-changed-registers) @@ -3815,9 +3796,8 @@ thread. Called from `gdb-update'." (if (not (gdb-pending-p 'gdb-get-main-selected-frame)) (progn - (gdb-input - (list (gdb-current-context-command "-stack-info-frame") - 'gdb-frame-handler)) + (gdb-input (gdb-current-context-command "-stack-info-frame") + 'gdb-frame-handler) (gdb-add-pending 'gdb-get-main-selected-frame)))) (defun gdb-frame-handler () @@ -4259,6 +4239,42 @@ (set-window-margins window left-margin-width right-margin-width))))) + +;;; Functions for inline completion. + +(defvar gud-gdb-fetch-lines-in-progress) +(defvar gud-gdb-fetch-lines-string) +(defvar gud-gdb-fetch-lines-break) +(defvar gud-gdb-fetched-lines) + +(defun gud-gdbmi-completions (context command) + "Completion table for GDB/MI commands. +COMMAND is the prefix for which we seek completion. +CONTEXT is the text before COMMAND on the line." + (let ((gud-gdb-fetch-lines-in-progress t) + (gud-gdb-fetch-lines-string nil) + (gud-gdb-fetch-lines-break (length context)) + (gud-gdb-fetched-lines nil) + ;; This filter dumps output lines to `gud-gdb-fetched-lines'. + (gud-marker-filter #'gud-gdbmi-fetch-lines-filter) + complete-list) + (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer) + (gdb-input (concat "complete " context command) + (lambda () (setq gud-gdb-fetch-lines-in-progress nil))) + (while gud-gdb-fetch-lines-in-progress + (accept-process-output (get-buffer-process gud-comint-buffer)))) + (gud-gdb-completions-1 gud-gdb-fetched-lines))) + +(defun gud-gdbmi-fetch-lines-filter (string) + "Custom filter function for `gud-gdbmi-completions'." + (setq string (concat gud-gdb-fetch-lines-string + (gud-gdbmi-marker-filter string))) + (while (string-match "\n" string) + (push (substring string gud-gdb-fetch-lines-break (match-beginning 0)) + gud-gdb-fetched-lines) + (setq string (substring string (match-end 0)))) + "") + (provide 'gdb-mi) ;;; gdb-mi.el ends here === modified file 'lisp/progmodes/gud.el' --- lisp/progmodes/gud.el 2011-12-12 05:32:49 +0000 +++ lisp/progmodes/gud.el 2011-12-25 10:46:49 +0000 @@ -756,6 +756,8 @@ (add-hook 'completion-at-point-functions #'gud-gdb-completion-at-point nil 'local) + (set (make-local-variable 'gud-gdb-completion-function) 'gud-gdb-completions) + (local-set-key "\C-i" 'completion-at-point) (setq comint-prompt-regexp "^(.*gdb[+]?) *") (setq paragraph-start comint-prompt-regexp) @@ -768,6 +770,12 @@ ;; context-sensitive command completion. We preserve that feature ;; in the GUD buffer by using a GDB command designed just for Emacs. +(defvar gud-gdb-completion-function nil + "Completion function for GDB commands. +It receives two arguments: COMMAND, the prefix for which we seek +completion; and CONTEXT, the text before COMMAND on the line. +It should return a list of completion strings.") + ;; The completion process filter indicates when it is finished. (defvar gud-gdb-fetch-lines-in-progress) @@ -806,28 +814,32 @@ (and complete-list (string-match "^Undefined command: \"complete\"" (car complete-list)) (error "This version of GDB doesn't support the `complete' command")) - ;; Sort the list like readline. - (setq complete-list (sort complete-list (function string-lessp))) - ;; Remove duplicates. - (let ((first complete-list) - (second (cdr complete-list))) - (while second - (if (string-equal (car first) (car second)) - (setcdr first (setq second (cdr second))) - (setq first second - second (cdr second))))) - ;; Add a trailing single quote if there is a unique completion - ;; and it contains an odd number of unquoted single quotes. - (and (= (length complete-list) 1) - (let ((str (car complete-list)) - (pos 0) - (count 0)) - (while (string-match "\\([^'\\]\\|\\\\'\\)*'" str pos) - (setq count (1+ count) - pos (match-end 0))) - (and (= (mod count 2) 1) - (setq complete-list (list (concat str "'")))))) - complete-list)) + (gud-gdb-completions-1 complete-list))) + +;; This function is also used by `gud-gdbmi-completions'. +(defun gud-gdb-completions-1 (complete-list) + ;; Sort the list like readline. + (setq complete-list (sort complete-list (function string-lessp))) + ;; Remove duplicates. + (let ((first complete-list) + (second (cdr complete-list))) + (while second + (if (string-equal (car first) (car second)) + (setcdr first (setq second (cdr second))) + (setq first second + second (cdr second))))) + ;; Add a trailing single quote if there is a unique completion + ;; and it contains an odd number of unquoted single quotes. + (and (= (length complete-list) 1) + (let ((str (car complete-list)) + (pos 0) + (count 0)) + (while (string-match "\\([^'\\]\\|\\\\'\\)*'" str pos) + (setq count (1+ count) + pos (match-end 0))) + (and (= (mod count 2) 1) + (setq complete-list (list (concat str "'")))))) + complete-list) (defun gud-gdb-completion-at-point () "Return the data to complete the GDB command before point." @@ -838,7 +850,7 @@ (point)))) (list start end (completion-table-dynamic - (apply-partially #'gud-gdb-completions + (apply-partially gud-gdb-completion-function (buffer-substring (comint-line-beginning-position) start)))))) @@ -851,11 +863,11 @@ ;; The completion process filter is installed temporarily to slurp the ;; output of GDB up to the next prompt and build the completion list. -(defun gud-gdb-fetch-lines-filter (string filter) +(defun gud-gdb-fetch-lines-filter (string) "Filter used to read the list of lines output by a command. STRING is the output to filter. -It is passed through FILTER before we look at it." - (setq string (funcall filter string)) +It is passed through `gud-gdb-marker-filter' before we look at it." + (setq string (gud-gdb-marker-filter string)) (setq string (concat gud-gdb-fetch-lines-string string)) (while (string-match "\n" string) (push (substring string gud-gdb-fetch-lines-break (match-beginning 0)) @@ -880,17 +892,6 @@ (defvar gud-gdb-fetched-stack-frame nil "Stack frames we are fetching from GDB.") -;(defun gud-gdb-get-scope-data (text token indent) -; ;; checkdoc-params: (indent) -; "Fetch data associated with a stack frame, and expand/contract it. -;Data to do this is retrieved from TEXT and TOKEN." -; (let ((args nil) (scope nil)) -; (gud-gdb-run-command-fetch-lines "info args") -; -; (gud-gdb-run-command-fetch-lines "info local") -; -; )) - (defun gud-gdb-get-stackframe (buffer) "Extract the current stack frame out of the GUD GDB BUFFER." (let ((newlst nil) @@ -934,21 +935,16 @@ BUFFER is the current buffer which may be the GUD buffer in which to run. SKIP is the number of chars to skip on each line, it defaults to 0." (with-current-buffer gud-comint-buffer - (if (and (eq gud-comint-buffer buffer) - (save-excursion - (goto-char (point-max)) - (forward-line 0) - (not (looking-at comint-prompt-regexp)))) - nil - ;; Much of this copied from GDB complete, but I'm grabbing the stack - ;; frame instead. + (unless (and (eq gud-comint-buffer buffer) + (save-excursion + (goto-char (point-max)) + (forward-line 0) + (not (looking-at comint-prompt-regexp)))) (let ((gud-gdb-fetch-lines-in-progress t) (gud-gdb-fetched-lines nil) (gud-gdb-fetch-lines-string nil) (gud-gdb-fetch-lines-break (or skip 0)) - (gud-marker-filter - `(lambda (string) - (gud-gdb-fetch-lines-filter string ',gud-marker-filter)))) + (gud-marker-filter #'gud-gdb-fetch-lines-filter)) ;; Issue the command to GDB. (gud-basic-call command) ;; Slurp the output. @@ -3422,7 +3418,7 @@ ((xdb pdb) (concat "p " expr)) (sdb (concat expr "/")))) -(declare-function gdb-input "gdb-mi" (item)) +(declare-function gdb-input "gdb-mi" (command handler)) (declare-function tooltip-expr-to-print "tooltip" (event)) (declare-function tooltip-event-buffer "tooltip" (event)) @@ -3468,12 +3464,12 @@ (if (eq gud-minor-mode 'gdbmi) (if gdb-macro-info (gdb-input - (list (concat - "server macro expand " expr "\n") - `(lambda () (gdb-tooltip-print-1 ,expr)))) + (concat + "server macro expand " expr "\n") + `(lambda () (gdb-tooltip-print-1 ,expr))) (gdb-input - (list (concat cmd "\n") - `(lambda () (gdb-tooltip-print ,expr))))) + (concat cmd "\n") + `(lambda () (gdb-tooltip-print ,expr)))) (setq gud-tooltip-original-filter (process-filter process)) (set-process-filter process 'gud-tooltip-process-output) (gud-basic-call cmd)) ------------------------------------------------------------ revno: 106731 committer: Andreas Schwab branch nick: emacs timestamp: Sun 2011-12-25 10:55:37 +0100 message: * etags.c (C_entries): Properly skip over string and character constants inside brackets. (Bug#10357) diff: === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2011-12-12 05:32:49 +0000 +++ lib-src/ChangeLog 2011-12-25 09:55:37 +0000 @@ -1,3 +1,8 @@ +2011-12-25 Andreas Schwab + + * etags.c (C_entries): Properly skip over string and character + constants and comments inside brackets. (Bug#10357) + 2011-12-04 Juanma Barranquero * emacsclient.c (decode_options) [WINDOWSNT]: Don't force tty = 0; === modified file 'lib-src/etags.c' --- lib-src/etags.c 2011-11-20 02:29:42 +0000 +++ lib-src/etags.c 2011-12-25 09:55:37 +0000 @@ -3189,24 +3189,12 @@ } continue; } - else if (bracketlev > 0) - { - switch (c) - { - case ']': - if (--bracketlev > 0) - continue; - break; - case '\0': - CNL_SAVE_DEFINEDEF (); - break; - } - continue; - } else switch (c) { case '"': inquote = TRUE; + if (bracketlev > 0) + continue; if (inattribute) break; switch (fvdef) @@ -3224,9 +3212,11 @@ continue; case '\'': inchar = TRUE; + if (bracketlev > 0) + continue; if (inattribute) break; - if (fvdef != finlist && fvdef != fignore && fvdef !=vignore) + if (fvdef != finlist && fvdef != fignore && fvdef != vignore) { fvextern = FALSE; fvdef = fvnone; @@ -3238,6 +3228,8 @@ incomm = TRUE; lp++; c = ' '; + if (bracketlev > 0) + continue; } else if (/* cplpl && */ *lp == '/') { @@ -3270,7 +3262,7 @@ for (cp = newlb.buffer; cp < lp-1; cp++) if (!iswhite (*cp)) { - if (*cp == '*' && *(cp+1) == '/') + if (*cp == '*' && cp[1] == '/') { cp++; cpptoken = TRUE; @@ -3284,7 +3276,17 @@ continue; case '[': bracketlev++; - continue; + continue; + default: + if (bracketlev > 0) + { + if (c == ']') + --bracketlev; + else if (c == '\0') + CNL_SAVE_DEFINEDEF (); + continue; + } + break; } /* switch (c) */ ------------------------------------------------------------ revno: 106730 committer: Andreas Schwab branch nick: emacs timestamp: Sun 2011-12-25 10:06:42 +0100 message: * callint.c (Fcall_interactively): Don't truncate prompt string. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2011-12-24 19:24:10 +0000 +++ src/ChangeLog 2011-12-25 09:06:42 +0000 @@ -1,3 +1,7 @@ +2011-12-24 Andreas Schwab + + * callint.c (Fcall_interactively): Don't truncate prompt string. + 2011-12-23 Eli Zaretskii * xdisp.c (handle_invisible_prop): Handle correctly an invisible === modified file 'src/callint.c' --- src/callint.c 2011-11-25 07:14:48 +0000 +++ src/callint.c 2011-12-25 09:06:42 +0000 @@ -274,8 +274,6 @@ ptrdiff_t i, nargs; int foo; - char prompt1[100]; - char *tem1; int arg_from_tty = 0; struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; int key_count; @@ -491,13 +489,8 @@ tem = string; for (i = 1; *tem; i++) { - strncpy (prompt1, tem + 1, sizeof prompt1 - 1); - prompt1[sizeof prompt1 - 1] = 0; - tem1 = strchr (prompt1, '\n'); - if (tem1) *tem1 = 0; - - visargs[0] = build_string (prompt1); - if (strchr (prompt1, '%')) + visargs[0] = make_string (tem + 1, strcspn (tem + 1, "\n")); + if (strchr (SSDATA (visargs[0]), '%')) callint_message = Fformat (i, visargs); else callint_message = visargs[0]; ------------------------------------------------------------ revno: 106729 committer: Alan Mackenzie branch nick: trunk timestamp: Sat 2011-12-24 19:32:31 +0000 message: Introduce a mechanism to widen the region used in context font locking. Use this to protect declarations from losing their contexts. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2011-12-24 19:16:53 +0000 +++ lisp/ChangeLog 2011-12-24 19:32:31 +0000 @@ -1,3 +1,26 @@ +2011-12-24 Alan Mackenzie + + Introduce a mechanism to widen the region used in context font + locking. Use this to protect declarations from losing their + contexts. + + * progmodes/cc-langs.el (c-before-font-lock-functions): replace + c-set-fl-decl-start with c-change-set-fl-decl-start (Renaming). + (c-before-context-fontification-functions): new defvar, a list of + functions to be run just before context (etc.) font locking. + + * progmodes/cc-mode.el (c-extend-font-lock-region-for-macros): + new, functionality extracted from + c-neutralize-syntax-in-and-mark-CPP. + (c-in-after-change-fontification): new variable. + (c-after-change): Set c-in-after-change-fontification. + (c-set-fl-decl-start): Rejig its interface, so it can be called + from both after-change and context fontifying. + (c-change-set-fl-decl-start, c-context-set-fl-decl-start): new + functions. + (c-standard-font-lock-fontify-region-function): new variable. + (c-font-lock-fontify-region): new function. + 2011-12-24 Juri Linkov * window.el (window--state-get-1): Set `FORCE' arg of `mark' to t. === modified file 'lisp/progmodes/cc-langs.el' --- lisp/progmodes/cc-langs.el 2011-12-23 11:48:54 +0000 +++ lisp/progmodes/cc-langs.el 2011-12-24 19:32:31 +0000 @@ -488,8 +488,9 @@ (c-lang-defconst c-before-font-lock-functions ;; For documentation see the following c-lang-defvar of the same name. ;; The value here may be a list of functions or a single function. - t 'c-set-fl-decl-start - (c c++ objc) '(c-neutralize-syntax-in-and-mark-CPP c-set-fl-decl-start) + t 'c-change-set-fl-decl-start + (c c++ objc) '(c-neutralize-syntax-in-and-mark-CPP + c-change-set-fl-decl-start) awk 'c-awk-extend-and-syntax-tablify-region) (c-lang-defvar c-before-font-lock-functions (let ((fs (c-lang-const c-before-font-lock-functions))) @@ -514,6 +515,27 @@ When the mode is initialized, these functions are called with parameters \(point-min), \(point-max) and .") +(c-lang-defconst c-before-context-fontification-functions + awk nil + t 'c-context-set-fl-decl-start) + ;; For documentation see the following c-lang-defvar of the same name. + ;; The value here may be a list of functions or a single function. +(c-lang-defvar c-before-context-fontification-functions + (let ((fs (c-lang-const c-before-context-fontification-functions))) + (if (listp fs) + fs + (list fs))) + "If non-nil, a list of functions called just before context (or +other non-change) fontification is done. Typically they will +extend the region. + +These functions will be run in the order given. Each of them +takes 2 parameters, the BEG and END of the region to be +fontified. Point is undefined on both entry and exit. On entry, +the buffer will have been widened and match-data will have been +saved; the return value is a cons of the adjusted +region, (NEW-BEG . NEW-END).") + ;;; Syntactic analysis ("virtual semicolons") for line-oriented languages (AWK). (c-lang-defconst c-at-vsemi-p-fn === modified file 'lisp/progmodes/cc-mode.el' --- lisp/progmodes/cc-mode.el 2011-12-23 11:48:54 +0000 +++ lisp/progmodes/cc-mode.el 2011-12-24 19:32:31 +0000 @@ -599,8 +599,8 @@ ;; Buffer local variables defining the region to be fontified by a font lock ;; after-change function. They are set in c-after-change to -;; after-change-function's BEG and END, and may be modified by a -;; `c-before-font-lock-function'. +;; after-change-functions' BEG and END, and may be modified by functions in +;; `c-before-font-lock-functions'. (defvar c-new-BEG 0) (make-variable-buffer-local 'c-new-BEG) (defvar c-new-END 0) @@ -830,6 +830,35 @@ ; with a c-cpp-delimiter category property (setq c-old-EOM (point))) +(defun c-extend-font-lock-region-for-macros (begg endd &optional old-len) + ;; Extend the region (BEGG ENDD) to cover all (possibly changed) + ;; preprocessor macros; return the cons (new-BEG . new-END). OLD-LEN should + ;; be either the old length parameter when called from an + ;; after-change-function, or nil otherwise. This defun uses the variables + ;; c-old-BOM, c-new-BOM. + ;; + ;; Point is undefined on both entry and exit to this function. The buffer + ;; will have been widened on entry. + (let (limits new-beg new-end) + (goto-char c-old-BOM) ; already set to old start of macro or begg. + (setq new-beg + (min begg + (if (setq limits (c-state-literal-at (point))) + (cdr limits) ; go forward out of any string or comment. + (point)))) + + (goto-char endd) + (if (setq limits (c-state-literal-at (point))) + (goto-char (car limits))) ; go backward out of any string or comment. + (if (c-beginning-of-macro) + (c-end-of-macro)) + (setq new-end (max endd + (if old-len + (+ (- c-old-EOM old-len) (- endd begg)) + c-old-EOM) + (point))) + (cons new-beg new-end))) + (defun c-neutralize-CPP-line (beg end) ;; BEG and END bound a region, typically a preprocessor line. Put a ;; "punctuation" syntax-table property on syntactically obtrusive @@ -886,26 +915,14 @@ ;; Note: SPEED _MATTERS_ IN THIS FUNCTION!!! ;; ;; This function might make hidden buffer changes. - (c-save-buffer-state (limits) + (c-save-buffer-state (new-bounds) ;; First determine the region, (c-new-BEG c-new-END), which will get font ;; locked. It might need "neutralizing". This region may not start ;; inside a string, comment, or macro. - (goto-char c-old-BOM) ; already set to old start of macro or begg. - (setq c-new-BEG - (min c-new-BEG - (if (setq limits (c-state-literal-at (point))) - (cdr limits) ; go forward out of any string or comment. - (point)))) - - (goto-char endd) - (if (setq limits (c-state-literal-at (point))) - (goto-char (car limits))) ; go backward out of any string or comment. - (if (c-beginning-of-macro) - (c-end-of-macro)) - (setq c-new-END (max c-new-END - (+ (- c-old-EOM old-len) (- endd begg)) - (point))) - + (setq new-bounds (c-extend-font-lock-region-for-macros + c-new-BEG c-new-END old-len)) + (setq c-new-BEG (car new-bounds) + c-new-END (cdr new-bounds)) ;; Clear all old relevant properties. (c-clear-char-property-with-value c-new-BEG c-new-END 'syntax-table '(1)) (c-clear-char-property-with-value c-new-BEG c-new-END 'category 'c-cpp-delimiter) @@ -1015,6 +1032,11 @@ c-get-state-before-change-functions)) )))) +(defvar c-in-after-change-fontification nil) +(make-variable-buffer-local 'c-in-after-change-fontification) +;; A flag to prevent region expanding stuff being done twice for after-change +;; fontification. + (defun c-after-change (beg end old-len) ;; Function put on `after-change-functions' to adjust various caches ;; etc. Prefer speed to finesse here, since there will be an order @@ -1066,63 +1088,113 @@ ;; larger than (beg end). (setq c-new-BEG beg c-new-END end) + (setq c-in-after-change-fontification t) (save-excursion (mapc (lambda (fn) (funcall fn beg end old-len)) c-before-font-lock-functions)))))) -(defun c-set-fl-decl-start (beg end old-len) - ;; If the beginning of line containing c-new-BEG is in the middle of a - ;; "local" declaration (i.e. one which does not start outside of braces - ;; enclosing this pos, such as a struct), set c-new-BEG to (at most) the - ;; beginning of that declaration. Note that declarations, in this sense, - ;; can be nested. c-new-BEG will be used later by c-font-lock-declarations. - ;; - ;; This function is an element of c-before-font-lock-functions, being called - ;; (indirectly) from an after-change function. The after-change-functions' - ;; parameters BEG, OLD and OLD-LEN are ignored here. - (when font-lock-mode - (goto-char (c-point 'bol c-new-BEG)) - (let ((lit-limits (c-literal-limits)) - bod-lim bo-decl) - - (when lit-limits ; Comment or string. - (goto-char (car lit-limits))) - (setq bod-lim (max (- (point) 500) (point-min))) - - (while - ;; Go to a less nested declaration each time round this loop. - (and - (eq (car (c-beginning-of-decl-1 bod-lim)) 'same) - (progn (setq bo-decl (point)) - ;; Are we looking at a keyword such as "template" or - ;; "typedef" which can decorate a type, or the type itself? - (when (or (looking-at c-prefix-spec-kwds-re) - (c-forward-type t)) - ;; We've found another candidate position. - (setq c-new-BEG (min c-new-BEG bo-decl)) - (goto-char bo-decl)) - t) - ;; Try and go out a level to search again. - (progn - (c-backward-syntactic-ws bod-lim) - (or (memq (char-before) '(?\( ?\[)) - (and (eq (char-before) ?\<) - (eq (c-get-char-property - (1- (point)) 'syntax-table) - c-<-as-paren-syntax)))) - (not (bobp))) - (backward-char))))) ; back over (, [, <. - +(defun c-set-fl-decl-start (pos) + ;; If the beginning of the line containing POS is in the middle of a "local" + ;; declaration (i.e. one which does not start outside of braces enclosing + ;; POS, such as a struct), return the beginning of that declaration. + ;; Otherwise return POS. Note that declarations, in this sense, can be + ;; nested. + ;; + ;; This function is called indirectly from font locking stuff - either from + ;; c-after-change (to prepare for after-change font-lockng) or from font + ;; lock context (etc.) fontification. + (let ((lit-limits (c-literal-limits)) + (new-pos pos) + bod-lim bo-decl) + (goto-char (c-point 'bol new-pos)) + (when lit-limits ; Comment or string. + (goto-char (car lit-limits))) + (setq bod-lim (max (- (point) 500) (point-min))) + + (while + ;; Go to a less nested declaration each time round this loop. + (and + (eq (car (c-beginning-of-decl-1 bod-lim)) 'same) + (progn (setq bo-decl (point)) + ;; Are we looking at a keyword such as "template" or + ;; "typedef" which can decorate a type, or the type itself? + (when (or (looking-at c-prefix-spec-kwds-re) + (c-forward-type t)) + ;; We've found another candidate position. + (setq new-pos (min new-pos bo-decl)) + (goto-char bo-decl)) + t) + ;; Try and go out a level to search again. + (progn + (c-backward-syntactic-ws bod-lim) + (or (memq (char-before) '(?\( ?\[)) + (and (eq (char-before) ?\<) + (eq (c-get-char-property + (1- (point)) 'syntax-table) + c-<-as-paren-syntax)))) + (not (bobp))) + (backward-char)) + new-pos)) ; back over (, [, <. + +(defun c-change-set-fl-decl-start (beg end old-len) + ;; Set c-new-BEG to the beginning of a "local" declaration if it('s BOL) is + ;; inside one. This is called from an after-change-function, but the + ;; parameters BEG END and OLD-LEN are ignored. See `c-set-fl-decl-start' + ;; for the detailed functionality. + (if font-lock-mode + (setq c-new-BEG (c-set-fl-decl-start c-new-BEG)))) + +(defun c-context-set-fl-decl-start (beg end) + ;; Return a cons (NEW-BEG . END), where NEW-BEG is the beginning of a + ;; "local" declaration (BOL at) NEW is inside or BEG. See + ;; `c-set-fl-decl-start' for the detailed functionality. + (cons (c-set-fl-decl-start beg) end)) + +(defvar c-standard-font-lock-fontify-region-function nil + "Standard value of `font-lock-fontify-region-function'") + +(defun c-font-lock-fontify-region (beg end &optional verbose) + ;; Effectively advice around `font-lock-fontify-region' which extends the + ;; region (BEG END), for example, to avoid context fontification chopping + ;; off the start of the context. Do not do anything if it's already been + ;; done (i.e. from and after-change fontification. An example (C++) where + ;; this used to happen is this: + ;; + ;; template + ;; + ;; + ;; void myfunc(T* p) {} + ;; + ;; Type a space in the first blank line, and the fontification of the next + ;; line was fouled up by context fontification. + (let ((new-beg beg) (new-end end) new-region) + (if c-in-after-change-fontification + (setq c-in-after-change-fontification nil) + (save-restriction + (widen) + (save-excursion + (mapc (lambda (fn) + (setq new-region (funcall fn new-beg new-end)) + (setq new-beg (car new-region) new-end (cdr new-region))) + c-before-context-fontification-functions)))) + (funcall c-standard-font-lock-fontify-region-function + new-beg new-end verbose))) + (defun c-after-font-lock-init () - ;; Put on `font-lock-mode-hook'. + ;; Put on `font-lock-mode-hook'. This function ensures our after-change + ;; function will get excuted before the font-lock one. Amongst other + ;; things. (remove-hook 'after-change-functions 'c-after-change t) - (add-hook 'after-change-functions 'c-after-change nil t)) + (add-hook 'after-change-functions 'c-after-change nil t) + (setq c-standard-font-lock-fontify-region-function + (default-value 'font-lock-fontify-region-function))) (defun c-font-lock-init () "Set up the font-lock variables for using the font-lock support in CC Mode. This does not load the font-lock package. Use after -`c-basic-common-init' and after cc-fonts has been loaded." +`c-basic-common-init' and after cc-fonts has been loaded. +This function is called from `c-common-init', once per mode initialization." (set (make-local-variable 'font-lock-defaults) `(,(if (c-major-mode-is 'awk-mode) @@ -1136,6 +1208,10 @@ c-beginning-of-syntax (font-lock-mark-block-function . c-mark-function))) + + (make-local-variable 'font-lock-fontify-region-function) + (setq font-lock-fontify-region-function 'c-font-lock-fontify-region) + (if (featurep 'xemacs) (make-local-hook 'font-lock-mode-hook)) (add-hook 'font-lock-mode-hook 'c-after-font-lock-init nil t))