Now on revision 107490. ------------------------------------------------------------ revno: 107490 committer: Glenn Morris branch nick: trunk timestamp: Fri 2012-03-02 20:18:09 -0800 message: lispref/internals.texi Memory Usage tiny change * doc/lispref/internals.texi: (Memory Usage): Copyedit. * src/alloc.c (misc-objects-consed): Doc fix. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-03-03 03:59:22 +0000 +++ doc/lispref/ChangeLog 2012-03-03 04:18:09 +0000 @@ -4,6 +4,7 @@ (Building Emacs): Say less about CANNOT_DUMP platforms. Replace deleted eval-at-startup with custom-initialize-delay. (Pure Storage): Small changes. + (Memory Usage): Copyedit. * tips.texi: Copyedits. (Coding Conventions): Mention autoloads. === modified file 'doc/lispref/internals.texi' --- doc/lispref/internals.texi 2012-03-03 03:59:22 +0000 +++ doc/lispref/internals.texi 2012-03-03 04:18:09 +0000 @@ -456,7 +456,7 @@ These functions and variables give information about the total amount of memory allocation that Emacs has done, broken down by data type. Note the difference between these and the values returned by -@code{(garbage-collect)}; those count objects that currently exist, but +@code{garbage-collect}; those count objects that currently exist, but these count the number or size of all allocations, including those for objects that have since been freed. === modified file 'src/ChangeLog' --- src/ChangeLog 2012-03-03 03:59:22 +0000 +++ src/ChangeLog 2012-03-03 04:18:09 +0000 @@ -1,6 +1,6 @@ 2012-03-03 Glenn Morris - * alloc.c (Fgarbage_collect): Doc fix. + * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes. 2012-03-02 Eli Zaretskii === modified file 'src/alloc.c' --- src/alloc.c 2012-03-03 03:59:22 +0000 +++ src/alloc.c 2012-03-03 04:18:09 +0000 @@ -6446,7 +6446,9 @@ doc: /* Number of string characters that have been consed so far. */); DEFVAR_INT ("misc-objects-consed", misc_objects_consed, - doc: /* Number of miscellaneous objects that have been consed so far. */); + doc: /* Number of miscellaneous objects that have been consed so far. +These include markers and overlays, plus certain objects not visible +to users. */); DEFVAR_INT ("intervals-consed", intervals_consed, doc: /* Number of intervals that have been consed so far. */); ------------------------------------------------------------ revno: 107489 committer: Glenn Morris branch nick: trunk timestamp: Fri 2012-03-02 19:59:22 -0800 message: lispref/internals.texi Pure Storage updates * doc/lispref/internals.texi: (Pure Storage): Small changes. * src/alloc.c (Fgarbage_collect): Doc fix. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-03-03 02:45:21 +0000 +++ doc/lispref/ChangeLog 2012-03-03 03:59:22 +0000 @@ -3,6 +3,7 @@ * internals.texi: Change @appendix section commands to @section. (Building Emacs): Say less about CANNOT_DUMP platforms. Replace deleted eval-at-startup with custom-initialize-delay. + (Pure Storage): Small changes. * tips.texi: Copyedits. (Coding Conventions): Mention autoloads. === modified file 'doc/lispref/internals.texi' --- doc/lispref/internals.texi 2012-03-03 03:33:41 +0000 +++ doc/lispref/internals.texi 2012-03-03 03:59:22 +0000 @@ -158,10 +158,10 @@ Emacs Lisp uses two kinds of storage for user-created Lisp objects: @dfn{normal storage} and @dfn{pure storage}. Normal storage is where -all the new data created during an Emacs session are kept; see the -following section for information on normal storage. Pure storage is -used for certain data in the preloaded standard Lisp files---data that -should never change during actual use of Emacs. +all the new data created during an Emacs session are kept +(@pxref{Garbage Collection}). Pure storage is used for certain data +in the preloaded standard Lisp files---data that should never change +during actual use of Emacs. Pure storage is allocated only while @file{temacs} is loading the standard preloaded Lisp libraries. In the file @file{emacs}, it is @@ -170,14 +170,14 @@ machine at once. Pure storage is not expandable; a fixed amount is allocated when Emacs is compiled, and if that is not sufficient for the preloaded libraries, @file{temacs} allocates dynamic memory for -the part that didn't fit. If that happens, you should increase the -compilation parameter @code{PURESIZE} in the file -@file{src/puresize.h} and rebuild Emacs, even though the resulting -image will work: garbage collection is disabled in this situation, -causing a memory leak. Such an overflow normally won't happen unless you -try to preload additional libraries or add features to the standard -ones. Emacs will display a warning about the overflow when it -starts. +the part that didn't fit. The resulting image will work, but garbage +collection (@pxref{Garbage Collection}) is disabled in this situation, +causing a memory leak. Such an overflow normally won't happen unless +you try to preload additional libraries or add features to the +standard ones. Emacs will display a warning about the overflow when +it starts. If this happens, you should increase the compilation +parameter @code{SYSTEM_PURESIZE_EXTRA} in the file +@file{src/puresize.h} and rebuild Emacs. @defun purecopy object This function makes a copy in pure storage of @var{object}, and returns @@ -188,8 +188,7 @@ them unchanged. It signals an error if asked to copy markers. This function is a no-op except while Emacs is being built and dumped; -it is usually called only in the file @file{emacs/lisp/loaddefs.el}, but -a few packages call it just in case you decide to preload them. +it is usually called only in preloaded Lisp files. @end defun @defvar pure-bytes-used @@ -363,7 +362,7 @@ itself; the latter is only allocated when the string is created.) @end table -If there was overflow in pure space (see the previous section), +If there was overflow in pure space (@pxref{Pure Storage}), @code{garbage-collect} returns @code{nil}, because a real garbage collection can not be done in this situation. @end deffn @@ -371,7 +370,7 @@ @defopt garbage-collection-messages If this variable is non-@code{nil}, Emacs displays a message at the beginning and end of garbage collection. The default value is -@code{nil}, meaning there are no such messages. +@code{nil}. @end defopt @defvar post-gc-hook @@ -390,7 +389,7 @@ the threshold is exhausted, but only the next time the Lisp evaluator is called. -The initial threshold value is 400,000. If you specify a larger +The initial threshold value is 800,000. If you specify a larger value, garbage collection will happen less often. This reduces the amount of time spent garbage collecting, but increases total memory use. You may want to do this when running a program that creates lots of === modified file 'src/ChangeLog' --- src/ChangeLog 2012-03-02 15:40:44 +0000 +++ src/ChangeLog 2012-03-03 03:59:22 +0000 @@ -1,3 +1,7 @@ +2012-03-03 Glenn Morris + + * alloc.c (Fgarbage_collect): Doc fix. + 2012-03-02 Eli Zaretskii * xdisp.c (try_window_reusing_current_matrix): Don't move cursor === modified file 'src/alloc.c' --- src/alloc.c 2012-02-26 01:09:59 +0000 +++ src/alloc.c 2012-03-03 03:59:22 +0000 @@ -1,6 +1,7 @@ /* Storage allocation and gc for GNU Emacs Lisp interpreter. - Copyright (C) 1985-1986, 1988, 1993-1995, 1997-2012 - Free Software Foundation, Inc. + +Copyright (C) 1985-1986, 1988, 1993-1995, 1997-2012 + Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -5010,11 +5011,12 @@ `gc-cons-threshold' bytes of Lisp data since previous garbage collection. `garbage-collect' normally returns a list with info on amount of space in use: ((USED-CONSES . FREE-CONSES) (USED-SYMS . FREE-SYMS) - (USED-MARKERS . FREE-MARKERS) USED-STRING-CHARS USED-VECTOR-SLOTS + (USED-MISCS . FREE-MISCS) USED-STRING-CHARS USED-VECTOR-SLOTS (USED-FLOATS . FREE-FLOATS) (USED-INTERVALS . FREE-INTERVALS) (USED-STRINGS . FREE-STRINGS)) However, if there was overflow in pure space, `garbage-collect' -returns nil, because real GC can't be done. */) +returns nil, because real GC can't be done. +See Info node `(elisp)Garbage Collection'. */) (void) { register struct specbinding *bind; ------------------------------------------------------------ revno: 107488 committer: Glenn Morris branch nick: trunk timestamp: Fri 2012-03-02 19:33:41 -0800 message: * doc/lispref/internals.texi (Building Emacs): Typo fix, I think. diff: === modified file 'doc/lispref/internals.texi' --- doc/lispref/internals.texi 2012-03-03 02:45:21 +0000 +++ doc/lispref/internals.texi 2012-03-03 03:33:41 +0000 @@ -106,13 +106,12 @@ Load the files with @file{site-init.el}, then copy the files into the installation directory for Lisp files when you install Emacs. -@c FIXME the default is non-nil; I don't think this makes sense. @item -Specify a non-@code{nil} value for -@code{byte-compile-dynamic-docstrings} as a local variable in each of these -files, and load them with either @file{site-load.el} or -@file{site-init.el}. (This method has the drawback that the -documentation strings take up space in Emacs all the time.) +Specify a @code{nil} value for @code{byte-compile-dynamic-docstrings} +as a local variable in each of these files, and load them with either +@file{site-load.el} or @file{site-init.el}. (This method has the +drawback that the documentation strings take up space in Emacs all the +time.) @end itemize It is not advisable to put anything in @file{site-load.el} or ------------------------------------------------------------ revno: 107487 committer: Glenn Morris branch nick: trunk timestamp: Fri 2012-03-02 21:45:21 -0500 message: Some lispref/internals.texi updates * doc/lispref/internals.texi: Change @appendix section commands to @section (both forms are equivalent; just being consistent with the rest of lispref). (Building Emacs): Say less about CANNOT_DUMP platforms. Replace deleted eval-at-startup with custom-initialize-delay. * etc/NEWS: Mention eval-at-startup. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-03-03 01:29:55 +0000 +++ doc/lispref/ChangeLog 2012-03-03 02:45:21 +0000 @@ -1,5 +1,9 @@ 2012-03-03 Glenn Morris + * internals.texi: Change @appendix section commands to @section. + (Building Emacs): Say less about CANNOT_DUMP platforms. + Replace deleted eval-at-startup with custom-initialize-delay. + * tips.texi: Copyedits. (Coding Conventions): Mention autoloads. Combine partially duplicated macro items. Fix xref. === modified file 'doc/lispref/internals.texi' --- doc/lispref/internals.texi 2012-02-28 04:17:02 +0000 +++ doc/lispref/internals.texi 2012-03-03 02:45:21 +0000 @@ -21,7 +21,7 @@ @end menu @node Building Emacs -@appendixsec Building Emacs +@section Building Emacs @cindex building Emacs @pindex temacs @@ -44,7 +44,7 @@ bare. @cindex dumping Emacs - It takes a substantial time to load the standard Lisp files. Luckily, + It takes some time to load the standard Lisp files. Luckily, you don't have to do this each time you run Emacs; @file{temacs} can dump out an executable program called @file{emacs} that has these files preloaded. @file{emacs} starts more quickly because it does not need to @@ -61,23 +61,22 @@ named @file{emacs}. The variable @code{preloaded-file-list} stores a list of the Lisp files that were dumped with the @file{emacs} executable. - Some operating systems don't support dumping. On those systems, you -must start Emacs with the @samp{temacs -l loadup} command each time you -use it. This takes a substantial time, but since you need to start -Emacs once a day at most---or once a week if you never log out---the -extra time is not too severe a problem. + If you port Emacs to a new operating system, and are not able to +implement dumping, then Emacs must load @file{loadup.el} each time it +starts. @cindex @file{site-load.el} - You can specify additional files to preload by writing a library named -@file{site-load.el} that loads them. You may need to add a definition +@file{site-load.el} that loads them. You may need to rebuild Emacs +with an added definition @example #define SITELOAD_PURESIZE_EXTRA @var{n} @end example @noindent -to make @var{n} added bytes of pure space to hold the additional files. +to make @var{n} added bytes of pure space to hold the additional files; +see @file{src/puresize.h}. (Try adding increments of 20000 until it is big enough.) However, the advantage of preloading additional files decreases as machines get faster. On modern machines, it is usually not advisable. @@ -107,6 +106,7 @@ Load the files with @file{site-init.el}, then copy the files into the installation directory for Lisp files when you install Emacs. +@c FIXME the default is non-nil; I don't think this makes sense. @item Specify a non-@code{nil} value for @code{byte-compile-dynamic-docstrings} as a local variable in each of these @@ -121,17 +121,27 @@ normal features for your site, do it with @file{default.el}, so that users can override your changes if they wish. @xref{Startup Summary}. - In a package that can be preloaded, it is sometimes useful to -specify a computation to be done when Emacs subsequently starts up. -For this, use @code{eval-at-startup}: - -@defmac eval-at-startup body@dots{} -This evaluates the @var{body} forms, either immediately if running in -an Emacs that has already started up, or later when Emacs does start -up. Since the value of the @var{body} forms is not necessarily -available when the @code{eval-at-startup} form is run, that form -always returns @code{nil}. -@end defmac + In a package that can be preloaded, it is sometimes necessary (or +useful) to delay certain evaluations until Emacs subsequently starts +up. The vast majority of such cases relate to the values of +customizable variables. For example, @code{tutorial-directory} is a +variable defined in @file{startup.el}, which is preloaded. The default +value is set based on @code{data-directory}. The variable needs to +access the value of @code{data-directory} when Emacs starts, not when +it is dumped, because the Emacs executable has probably been installed +in a different location since it was dumped. + +@defun custom-initialize-delay symbol value +This function delays the initialization of @var{symbol} to the next +Emacs start. You normally use this function by specifying it as the +@code{:initialize} property of a customizable variable. (The argument +@var{value} is unused, and is provided only for compatiblity with the +form Custom expects.) +@end defun + +In the unlikely event that you need a more general functionality than +@code{custom-initialize-delay} provides, you can use +@code{before-init-hook} (@pxref{Startup Summary}). @defun dump-emacs to-file from-file @cindex unexec @@ -144,7 +154,7 @@ @end defun @node Pure Storage -@appendixsec Pure Storage +@section Pure Storage @cindex pure storage Emacs Lisp uses two kinds of storage for user-created Lisp objects: @@ -205,7 +215,7 @@ @end defvar @node Garbage Collection -@appendixsec Garbage Collection +@section Garbage Collection @cindex garbage collection @cindex memory allocation @@ -494,7 +504,7 @@ @end defvar @node Writing Emacs Primitives -@appendixsec Writing Emacs Primitives +@section Writing Emacs Primitives @cindex primitive function internals @cindex writing Emacs primitives @@ -512,7 +522,7 @@ @group DEFUN ("or", For, Sor, 0, UNEVALLED, 0, doc: /* Eval args until one of them yields non-nil, then return that -value. The remaining args are not evalled at all. +value. The remaining args are not evalled at all. If all args return nil, return nil. @end group @group @@ -811,7 +821,7 @@ knows about it. @node Object Internals -@appendixsec Object Internals +@section Object Internals @cindex object internals GNU Emacs Lisp manipulates many different types of data. The actual @@ -838,7 +848,7 @@ @end menu @node Buffer Internals -@appendixsubsec Buffer Internals +@subsection Buffer Internals @cindex internals, of buffer @cindex buffer internals @@ -1101,7 +1111,7 @@ @end table @node Window Internals -@appendixsubsec Window Internals +@subsection Window Internals @cindex internals, of window @cindex window internals @@ -1134,8 +1144,8 @@ @item next @itemx prev The next sibling and previous sibling of this window. @code{next} is -@code{nil} if the window is the rightmost or bottommost in its group; -@code{prev} is @code{nil} if it is the leftmost or topmost in its +@code{nil} if the window is the right-most or bottom-most in its group; +@code{prev} is @code{nil} if it is the left-most or top-most in its group. @item left_col @@ -1296,7 +1306,7 @@ @end table @node Process Internals -@appendixsubsec Process Internals +@subsection Process Internals @cindex internals, of process @cindex process internals === modified file 'etc/NEWS' --- etc/NEWS 2012-02-29 04:31:55 +0000 +++ etc/NEWS 2012-03-03 02:45:21 +0000 @@ -1057,6 +1057,11 @@ appropriate conventions may fail to compile. The most common cause of trouble seems to be an old-style backquote followed by a newline. ++++ +** The macro `eval-at-startup' was removed in Emacs 23.2, but this +was not advertised at the time. The function `custom-initialize-delay' +replaced all known uses. + --- ** view-buffer now treats special mode-class in the same way that view-file has since Emacs 22 (ie, it won't enable View mode if the ------------------------------------------------------------ revno: 107486 committer: Glenn Morris branch nick: trunk timestamp: Fri 2012-03-02 20:29:55 -0500 message: Checked lispref/tips.texi * doc/lispref/tips.texi: Copyedits. (Coding Conventions): Mention autoloads. Combine partially duplicated macro items. Fix xref. Refer to Library Headers for copyright notice. (Programming Tips): edit-options is long-obsolete. (Compilation Tips): Mention loading bytecomp for byte-compile props. (Warning Tips): Mention declare-function. (Documentation Tips): Remove old info. (Comment Tips): Mention comment-dwim, not indent-for-comment. (Library Headers): General update. * admin/FOR-RELEASE: Related markup. diff: === modified file 'admin/FOR-RELEASE' --- admin/FOR-RELEASE 2012-03-02 02:52:40 +0000 +++ admin/FOR-RELEASE 2012-03-03 01:29:55 +0000 @@ -227,7 +227,7 @@ symbols.texi cyd syntax.texi cyd text.texi -tips.texi +tips.texi rgm variables.texi cyd windows.texi === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-03-02 03:00:15 +0000 +++ doc/lispref/ChangeLog 2012-03-03 01:29:55 +0000 @@ -1,3 +1,16 @@ +2012-03-03 Glenn Morris + + * tips.texi: Copyedits. + (Coding Conventions): Mention autoloads. + Combine partially duplicated macro items. Fix xref. + Refer to Library Headers for copyright notice. + (Programming Tips): edit-options is long-obsolete. + (Compilation Tips): Mention loading bytecomp for byte-compile props. + (Warning Tips): Mention declare-function. + (Documentation Tips): Remove old info. + (Comment Tips): Mention comment-dwim, not indent-for-comment. + (Library Headers): General update. + 2012-03-02 Glenn Morris * backups.texi (Reverting): Un-duplicate revert-buffer-in-progress-p, === modified file 'doc/lispref/tips.texi' --- doc/lispref/tips.texi 2012-02-19 05:54:33 +0000 +++ doc/lispref/tips.texi 2012-03-03 01:29:55 +0000 @@ -58,7 +58,7 @@ This practice helps avoid name conflicts, since all global variables in Emacs Lisp share the same name space, and all functions share another name space@footnote{The benefits of a Common Lisp-style -package system are considered not to outweigh the costs.} +package system are considered not to outweigh the costs.}. Occasionally, for a command name intended for users to use, it is more convenient if some words come before the package's name prefix. And @@ -110,6 +110,17 @@ Macros}. @item +Avoid loading additional libraries at run time unless they are really +needed. If your file simply cannot work without some other library, +then just @code{require} that library at the top-level and be done +with it. But if your file contains several independent features, and +only one or two require the extra library, then consider putting +@code{require} statements inside the relevant functions rather than at +the top-level. Or use @code{autoload} statements to load the extra +library when needed. This way people who don't use those aspects of +your file do not need to load the extra library. + +@item Please don't require the @code{cl} package of Common Lisp extensions at run time. Use of this package is optional, and it is not part of the standard Emacs namespace. If your package loads @code{cl} at run time, @@ -194,11 +205,8 @@ @item Constructs that define a function or variable should be macros, -not functions, and their names should start with @samp{def}. - -@item -A macro that defines a function or variable should have a name that -starts with @samp{define-}. The macro should receive the name to be +not functions, and their names should start with @samp{define-}. +The macro should receive the name to be defined as the first argument. That will help various tools find the definition automatically. Avoid constructing the names in the macro itself, since that would confuse these tools. @@ -207,7 +215,7 @@ In some other systems there is a convention of choosing variable names that begin and end with @samp{*}. We don't use that convention in Emacs Lisp, so please don't use it in your programs. (Emacs uses such names -only for special-purpose buffers.) The users will find Emacs more +only for special-purpose buffers.) People will find Emacs more coherent if all libraries use the same conventions. @item @@ -216,7 +224,7 @@ the same way, regardless of the user's settings. The easiest way to do this is to use the coding system @code{utf-8-emacs} (@pxref{Coding System Basics}), and specify that coding in the @samp{-*-} line or the -local variables list. @xref{File variables, , Local Variables in +local variables list. @xref{File Variables, , Local Variables in Files, emacs, The GNU Emacs Manual}. @example @@ -224,8 +232,7 @@ @end example @item -Indent each function with @kbd{C-M-q} (@code{indent-sexp}) using the -default indentation parameters. +Indent the file using the default indentation parameters. @item Don't make a habit of putting close-parentheses on lines by @@ -233,29 +240,8 @@ @item Please put a copyright notice and copying permission notice on the -file if you distribute copies. Use a notice like this one: - -@smallexample -;; Copyright (C) @var{year} @var{name} - -;; This program is free software: you can redistribute it and/or -;; modify it under the terms of the GNU General Public License as -;; published by the Free Software Foundation, either version 3 of -;; the License, or (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see -;; . -@end smallexample - -If you have signed papers to assign the copyright to the Foundation, -then use @samp{Free Software Foundation, Inc.} as @var{name}. -Otherwise, use your name. @xref{Library Headers}. +file if you distribute copies. @xref{Library Headers}. + @end itemize @node Key Binding Conventions @@ -324,11 +310,11 @@ is commonly used to cancel a key sequence. @item -Anything which acts like a temporary mode or state which the user can +Anything that acts like a temporary mode or state that the user can enter and leave should define @kbd{@key{ESC} @key{ESC}} or @kbd{@key{ESC} @key{ESC} @key{ESC}} as a way to escape. -For a state which accepts ordinary Emacs commands, or more generally any +For a state that accepts ordinary Emacs commands, or more generally any kind of state in which @key{ESC} followed by a function key or arrow key is potentially meaningful, then you must not define @kbd{@key{ESC} @key{ESC}}, since that would preclude recognizing an escape sequence @@ -398,8 +384,8 @@ with a period. @item -A question asked in the minibuffer with @code{y-or-n-p} or -@code{yes-or-no-p} should start with a capital letter and end with +A question asked in the minibuffer with @code{yes-or-no-p} or +@code{y-or-n-p} should start with a capital letter and end with @samp{? }. @item @@ -457,10 +443,9 @@ @item Try to avoid using recursive edits. Instead, do what the Rmail @kbd{e} -command does: use a new local keymap that contains one command defined -to switch back to the old local keymap. Or do what the -@code{edit-options} command does: switch to another buffer and let the -user switch back at will. @xref{Recursive Editing}. +command does: use a new local keymap that contains a command defined +to switch back to the old local keymap. Or simply switch to another +buffer and let the user switch back at will. @xref{Recursive Editing}. @end itemize @node Compilation Tips @@ -515,6 +500,10 @@ @end group @end example +@noindent +Note that in this case (and many others), you must first load the +@file{bytecomp} library, which defines the @code{byte-compile} property. + @item If calling a small function accounts for a substantial part of your program's running time, make the function inline. This eliminates @@ -541,6 +530,11 @@ not to warn about uses of the variable @code{foo} in this file. @item +Similarly, to avoid a compiler warning about an undefined function +that you know @emph{will} be defined, use a @code{declare-function} +statement (@pxref{Declaring Functions}). + +@item If you use many functions and variables from a certain file, you can add a @code{require} for that package to avoid compilation warnings for them. For instance, @@ -561,8 +555,8 @@ @item The last resort for avoiding a warning, when you want to do something -that usually is a mistake but it's not a mistake in this one case, -is to put a call to @code{with-no-warnings} around it. +that is usually a mistake but you know is not a mistake in your usage, +is to put it inside @code{with-no-warnings}. @xref{Compiler Errors}. @end itemize @node Documentation Tips @@ -580,11 +574,9 @@ should have a documentation string. @item -An internal variable or subroutine of a Lisp program might as well have -a documentation string. In earlier Emacs versions, you could save space -by using a comment instead of a documentation string, but that is no -longer the case---documentation strings now take up very little space in -a running Emacs. +An internal variable or subroutine of a Lisp program might as well +have a documentation string. Documentation strings take up very +little space in a running Emacs. @item Format the documentation string so that it fits in an Emacs window on an @@ -595,14 +587,14 @@ You can fill the text if that looks good. However, rather than blindly filling the entire documentation string, you can often make it much more readable by choosing certain line breaks with care. Use blank lines -between topics if the documentation string is long. +between sections if the documentation string is long. @item The first line of the documentation string should consist of one or two complete sentences that stand on their own as a summary. @kbd{M-x apropos} displays just the first line, and if that line's contents don't stand on their own, the result looks bad. In particular, start the -first line with a capital letter and end with a period. +first line with a capital letter and end it with a period. For a function, the first line should briefly answer the question, ``What does this function do?'' For a variable, the first line should @@ -630,7 +622,7 @@ When a function's documentation string mentions the value of an argument of the function, use the argument name in capital letters as if it were a name for that value. Thus, the documentation string of the function -@code{eval} refers to its second argument as @samp{FORM}, because the +@code{eval} refers to its first argument as @samp{FORM}, because the actual argument name is @code{form}: @example @@ -654,7 +646,7 @@ This might appear to contradict the policy of writing function argument values, but there is no real contradiction; the argument -@emph{value} is not the same thing as the @emph{symbol} which the +@emph{value} is not the same thing as the @emph{symbol} that the function uses to hold the value. If this puts a lower-case letter at the beginning of a sentence @@ -825,8 +817,8 @@ @end example @item -When you define a variable that users ought to set interactively, you -should use @code{defcustom}. @xref{Defining Variables}. +When you define a variable that represents an option users might want +to set, use @code{defcustom}. @xref{Defining Variables}. @item The documentation string for a variable that is a yes-or-no flag should @@ -839,19 +831,14 @@ @section Tips on Writing Comments @cindex comments, Lisp convention for - We recommend these conventions for where to put comments and how to -indent them: + We recommend these conventions for comments: @table @samp @item ; Comments that start with a single semicolon, @samp{;}, should all be aligned to the same column on the right of the source code. Such -comments usually explain how the code on the same line does its job. In -Lisp mode and related modes, the @kbd{M-;} (@code{indent-for-comment}) -command automatically inserts such a @samp{;} in the right place, or -aligns such a comment if it is already present. - -This and following examples are taken from the Emacs sources. +comments usually explain how the code on that line does its job. +For example: @smallexample @group @@ -873,7 +860,7 @@ (prog1 (setq auto-fill-function @dots{} @dots{} - ;; update mode line + ;; Update mode line. (force-mode-line-update))) @end group @end smallexample @@ -882,17 +869,17 @@ @smallexample @group -;; This Lisp code is run in Emacs -;; when it is to operate as a server -;; for other processes. +;; This Lisp code is run in Emacs when it is to operate as +;; a server for other processes. @end group @end smallexample -Every function that has no documentation string (presumably one that is -used only internally within the package it belongs to), should instead -have a two-semicolon comment right before the function, explaining what -the function does and how to call it properly. Explain precisely what -each argument means and how the function interprets its possible values. +If a function has no documentation string, it should instead have a +two-semicolon comment right before the function, explaining what the +function does and how to call it properly. Explain precisely what +each argument means and how the function interprets its possible +values. It is much better to convert such comments to documentation +strings, though. @item ;;; Comments that start with three semicolons, @samp{;;;}, should start at @@ -903,7 +890,7 @@ ``heading'' by Outline minor mode. By default, comments starting with at least three semicolons (followed by a single space and a non-whitespace character) are considered headings, comments starting -with two or less are not. +with two or fewer are not. Another use for triple-semicolon comments is for commenting out lines within a function. We use three semicolons for this precisely so that @@ -934,11 +921,11 @@ @end table @noindent -The indentation commands of the Lisp modes in Emacs, such as @kbd{M-;} -(@code{indent-for-comment}) and @key{TAB} (@code{lisp-indent-line}), -automatically indent comments according to these conventions, -depending on the number of semicolons. @xref{Comments,, -Manipulating Comments, emacs, The GNU Emacs Manual}. +Generally speaking, the @kbd{M-;} (@code{comment-dwim}) command +automatically starts a comment of the appropriate type; or indents an +existing comment to the right place, depending on the number of +semicolons. +@xref{Comments,, Manipulating Comments, emacs, The GNU Emacs Manual}. @node Library Headers @section Conventional Headers for Emacs Libraries @@ -947,39 +934,28 @@ Emacs has conventions for using special comments in Lisp libraries to divide them into sections and give information such as who wrote -them. This section explains these conventions. - - We'll start with an example, a package that is included in the Emacs -distribution. - - Parts of this example reflect its status as part of Emacs; for -example, the copyright notice lists the Free Software Foundation as the -copyright holder, and the copying permission says the file is part of -Emacs. When you write a package and post it, the copyright holder would -be you (unless your employer claims to own it instead), and you should -get the suggested copying permission from the end of the GNU General -Public License itself. Don't say your file is part of Emacs -if we haven't installed it in Emacs yet! - - With that warning out of the way, on to the example: +them. Using a standard format for these items makes it easier for +tools (and people) to extract the relevant information. This section +explains these conventions, starting with an example: @smallexample @group -;;; lisp-mnt.el --- minor mode for Emacs Lisp maintainers +;;; foo.el --- Support for the Foo programming language -;; Copyright (C) 1992 Free Software Foundation, Inc. +;; Copyright (C) 2010-2012 Your Name @end group -;; Author: Eric S. Raymond -;; Maintainer: Eric S. Raymond -;; Created: 14 Jul 1992 -;; Version: 1.2 +;; Author: Your Name +;; Maintainer: Someone Else +;; Created: 14 Jul 2010 @group -;; Keywords: docs - -;; This file is part of GNU Emacs. +;; Keywords: languages + +;; This file is not part of GNU Emacs. + +;; This file is free software@dots{} @dots{} -;; along with GNU Emacs. If not, see . +;; along with this file. If not, see . @end group @end smallexample @@ -990,8 +966,19 @@ @end example @noindent -The description should be complete in one line. If the file +The description should be contained in one line. If the file needs a @samp{-*-} specification, put it after @var{description}. +If this would make the first line too long, use a Local Variables +section at the end of the file. + + The copyright notice usually lists your name (if you wrote the +file). If you have an employer who claims copyright on your work, you +might need to list them instead. Do not say that the copyright holder +is the Free Software Foundation (or that the file is part of GNU +Emacs) unless your file has been accepted into the Emacs distribution. +For more information on the form of copyright and license notices, see +@uref{http://www.gnu.org/licenses/gpl-howto.html, the guide on the GNU +website}. After the copyright notice come several @dfn{header comment} lines, each beginning with @samp{;; @var{header-name}:}. Here is a table of @@ -999,55 +986,55 @@ @table @samp @item Author -This line states the name and net address of at least the principal -author of the library. - -If there are multiple authors, you can list them on continuation lines -led by @code{;;} and a tab character, like this: +This line states the name and email address of at least the principal +author of the library. If there are multiple authors, list them on +continuation lines led by @code{;;} and whitespace (this is easier +for tools to parse than having more than one author on one line). +We recommend including a contact email address, of the form +@samp{<@dots{}>}. For example: @smallexample @group -;; Author: Ashwin Ram -;; Dave Sill -;; Dave Brennan -;; Eric Raymond +;; Author: Your Name +;; Someone Else +;; Another Person @end group @end smallexample @item Maintainer -This line should contain a single name/address as in the Author line, or -an address only, or the string @samp{FSF}. If there is no maintainer -line, the person(s) in the Author field are presumed to be the -maintainers. The example above is mildly bogus because the maintainer -line is redundant. - -The idea behind the @samp{Author} and @samp{Maintainer} lines is to make -possible a Lisp function to ``send mail to the maintainer'' without -having to mine the name out by hand. - -Be sure to surround the network address with @samp{<@dots{}>} if -you include the person's full name as well as the network address. +This header has the same format as the Author header. It lists the +person(s) who currently maintain(s) the file (respond to bug reports, +etc.). + +If there is no maintainer line, the person(s) in the Author field +is/are presumed to be the maintainers. Some files in Emacs use +@samp{FSF} for the maintainer. This means that the original author is +no longer responsible for the file, and that it is maintained as part +of Emacs. @item Created -This optional line gives the original creation date of the -file. For historical interest only. +This optional line gives the original creation date of the file, and +is for historical interest only. @item Version -If you wish to record version numbers for the individual Lisp program, put -them in this line. - -@item Adapted-By -In this header line, place the name of the person who adapted the -library for installation (to make it fit the style conventions, for -example). +If you wish to record version numbers for the individual Lisp program, +put them in this line. Lisp files distributed with Emacs generally do +not have a @samp{Version} header, since the version number of Emacs +itself serves the same purpose. If you are distributing a collection +of multiple files, we recommend not writing the version in every file, +but only the main one. @item Keywords This line lists keywords for the @code{finder-by-keyword} help command. Please use that command to see a list of the meaningful keywords. -This field is important; it's how people will find your package when -they're looking for things by topic area. To separate the keywords, you -can use spaces, commas, or both. +This field is how people will find your package when they're looking +for things by topic. To separate the keywords, you can use spaces, +commas, or both. + +The name of this field is unfortunate, since people often assume it is +the place to write arbitrary keywords that describe their package, +rather than just the relevant Finder keywords. @item Package-Version If @samp{Version} is not suitable for use by the package manager, then @@ -1060,7 +1047,7 @@ for proper operation. @xref{Packaging Basics}. This is used by the package manager both at download time (to ensure that a complete set of packages is downloaded) and at activation time (to ensure that a -package is activated if and only if all its dependencies have been). +package is only activated if all its dependencies have been). Its format is a list of lists. The @code{car} of each sub-list is the name of a package, as a symbol. The @code{cadr} of each sub-list is @@ -1081,8 +1068,8 @@ names---they have no standard meanings, so they can't do any harm. We use additional stylized comments to subdivide the contents of the -library file. These should be separated by blank lines from anything -else. Here is a table of them: +library file. These should be separated from anything else by blank +lines. Here is a table of them: @table @samp @item ;;; Commentary: @@ -1092,16 +1079,12 @@ text is used by the Finder package, so it should make sense in that context. -@item ;;; Documentation: -This was used in some files in place of @samp{;;; Commentary:}, -but it is deprecated. - @item ;;; Change Log: -This begins change log information stored in the library file (if you -store the change history there). For Lisp files distributed with Emacs, -the change history is kept in the file @file{ChangeLog} and not in the -source file at all; these files generally do not have a @samp{;;; Change -Log:} line. @samp{History} is an alternative to @samp{Change Log}. +This begins an optional log of changes to the file over time. Don't +put too much information in this section---it is better to keep the +detailed logs in a separate @file{ChangeLog} file (as Emacs does), +and/or to use a version control system. @samp{History} is an +alternative to @samp{Change Log}. @item ;;; Code: This begins the actual code of the program. ------------------------------------------------------------ revno: 107485 committer: Alan Mackenzie branch nick: cc-mode timestamp: Fri 2012-03-02 22:16:21 +0000 message: Depessimize the handling of very large macros. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-03-02 15:29:28 +0000 +++ lisp/ChangeLog 2012-03-02 22:16:21 +0000 @@ -1,3 +1,25 @@ +2012-03-02 Alan Mackenzie + + Depessimize the handling of very large macros. + + * progmodes/cc-engine.el (c-macro-cache, c-macro-cache-start-pos): + (c-macro-cache-syntactic): New variables to implement a one + element macro cache. + (c-invalidate-macro-cache): New function. + (c-beginning-of-macro, c-end-of-macro, c-syntactic-end-of-macro): + Adapt to use the new cache. + (c-state-safe-place): Use better the cache of safe positions. + (c-state-semi-nonlit-pos-cache) + (c-state-semi-nonlit-pos-cache-limit): + New variables for... + (c-state-semi-safe-place): New function. Here, in a macro is "safe". + (c-invalidate-state-cache-1): New stuff for c-state-semi-safe-place. + (c-in-literal, c-literal-limits, c-determine-limit-get-base): Use + c-state-semi-safe-place. + + * progmodes/cc-langs.el (c-get-state-before-change-functions): Add + c-invalidate-macro-cache to the C, C++, Obj entries. + 2012-03-02 Michael Albinus * jka-compr.el (jka-compr-call-process): Apply === modified file 'lisp/progmodes/cc-engine.el' --- lisp/progmodes/cc-engine.el 2012-02-12 11:06:42 +0000 +++ lisp/progmodes/cc-engine.el 2012-03-02 22:16:21 +0000 @@ -219,6 +219,38 @@ (point)))) c-macro-start)) +;; One element macro cache to cope with continual movement within very large +;; CPP macros. +(defvar c-macro-cache nil) +(make-variable-buffer-local 'c-macro-cache) +;; Nil or cons of the bounds of the most recent CPP form probed by +;; `c-beginning-of-macro', `c-end-of-macro' or `c-syntactic-end-of-macro'. +;; The cdr will be nil if we know only the start of the CPP form. +(defvar c-macro-cache-start-pos nil) +(make-variable-buffer-local 'c-macro-cache-start-pos) +;; The starting position from where we determined `c-macro-cache'. +(defvar c-macro-cache-syntactic nil) +(make-variable-buffer-local 'c-macro-cache-syntactic) +;; non-nil iff `c-macro-cache' has both elements set AND the cdr is at a +;; syntactic end of macro, not merely an apparent one. + +(defun c-invalidate-macro-cache (beg end) + ;; Called from a before-change function. If the change region is before or + ;; in the macro characterised by `c-macro-cache' etc., nullify it + ;; appropriately. BEG and END are the standard before-change-functions + ;; parameters. END isn't used. + (cond + ((null c-macro-cache)) + ((< beg (car c-macro-cache)) + (setq c-macro-cache nil + c-macro-cache-start-pos nil + c-macro-cache-syntactic nil)) + ((and (cdr c-macro-cache) + (< beg (cdr c-macro-cache))) + (setcdr c-macro-cache nil) + (setq c-macro-cache-start-pos beg + c-macro-cache-syntactic nil)))) + (defun c-beginning-of-macro (&optional lim) "Go to the beginning of a preprocessor directive. Leave point at the beginning of the directive and return t if in one, @@ -226,19 +258,36 @@ Note that this function might do hidden buffer changes. See the comment at the start of cc-engine.el for more info." - (when c-opt-cpp-prefix - (let ((here (point))) - (save-restriction - (if lim (narrow-to-region lim (point-max))) - (beginning-of-line) - (while (eq (char-before (1- (point))) ?\\) - (forward-line -1)) - (back-to-indentation) - (if (and (<= (point) here) - (looking-at c-opt-cpp-start)) - t - (goto-char here) - nil))))) + (let ((here (point))) + (when c-opt-cpp-prefix + (if (and (car c-macro-cache) + (>= (point) (car c-macro-cache)) + (or (and (cdr c-macro-cache) + (<= (point) (cdr c-macro-cache))) + (<= (point) c-macro-cache-start-pos))) + (unless (< (car c-macro-cache) (or lim (point-min))) + (progn (goto-char (max (or lim (point-min)) (car c-macro-cache))) + (setq c-macro-cache-start-pos + (max c-macro-cache-start-pos here)) + t)) + (setq c-macro-cache nil + c-macro-cache-start-pos nil + c-macro-cache-syntactic nil) + + (save-restriction + (if lim (narrow-to-region lim (point-max))) + (beginning-of-line) + (while (eq (char-before (1- (point))) ?\\) + (forward-line -1)) + (back-to-indentation) + (if (and (<= (point) here) + (looking-at c-opt-cpp-start)) + (progn + (setq c-macro-cache (cons (point) nil) + c-macro-cache-start-pos here) + t) + (goto-char here) + nil)))))) (defun c-end-of-macro () "Go to the end of a preprocessor directive. @@ -248,12 +297,24 @@ Note that this function might do hidden buffer changes. See the comment at the start of cc-engine.el for more info." - (while (progn - (end-of-line) - (when (and (eq (char-before) ?\\) - (not (eobp))) - (forward-char) - t)))) + (if (and (cdr c-macro-cache) + (<= (point) (cdr c-macro-cache)) + (>= (point) (car c-macro-cache))) + (goto-char (cdr c-macro-cache)) + (unless (and (car c-macro-cache) + (<= (point) c-macro-cache-start-pos) + (>= (point) (car c-macro-cache))) + (setq c-macro-cache nil + c-macro-cache-start-pos nil + c-macro-cache-syntactic nil)) + (while (progn + (end-of-line) + (when (and (eq (char-before) ?\\) + (not (eobp))) + (forward-char) + t))) + (when (car c-macro-cache) + (setcdr c-macro-cache (point))))) (defun c-syntactic-end-of-macro () ;; Go to the end of a CPP directive, or a "safe" pos just before. @@ -268,12 +329,15 @@ ;; at the start of cc-engine.el for more info. (let* ((here (point)) (there (progn (c-end-of-macro) (point))) - (s (parse-partial-sexp here there))) - (while (and (or (nth 3 s) ; in a string - (nth 4 s)) ; in a comment (maybe at end of line comment) - (> there here)) ; No infinite loops, please. - (setq there (1- (nth 8 s))) - (setq s (parse-partial-sexp here there))) + s) + (unless c-macro-cache-syntactic + (setq s (parse-partial-sexp here there)) + (while (and (or (nth 3 s) ; in a string + (nth 4 s)) ; in a comment (maybe at end of line comment) + (> there here)) ; No infinite loops, please. + (setq there (1- (nth 8 s))) + (setq s (parse-partial-sexp here there))) + (setq c-macro-cache-syntactic (car c-macro-cache))) (point))) (defun c-forward-over-cpp-define-id () @@ -2089,6 +2153,18 @@ ;; reduced by buffer changes, and increased by invocations of ;; `c-state-literal-at'. +(defvar c-state-semi-nonlit-pos-cache nil) +(make-variable-buffer-local 'c-state-semi-nonlit-pos-cache) +;; A list of buffer positions which are known not to be in a literal. This is +;; ordered with higher positions at the front of the list. Only those which +;; are less than `c-state-semi-nonlit-pos-cache-limit' are valid. + +(defvar c-state-semi-nonlit-pos-cache-limit 1) +(make-variable-buffer-local 'c-state-semi-nonlit-pos-cache-limit) +;; An upper limit on valid entries in `c-state-semi-nonlit-pos-cache'. This is +;; reduced by buffer changes, and increased by invocations of +;; `c-state-literal-at'. FIMXE!!! + (defsubst c-state-pp-to-literal (from to) ;; Do a parse-partial-sexp from FROM to TO, returning either ;; (STATE TYPE (BEG . END)) if TO is in a literal; or @@ -2129,48 +2205,93 @@ (widen) (save-excursion (let ((c c-state-nonlit-pos-cache) - pos npos lit macro-beg macro-end) + pos npos high-pos lit macro-beg macro-end) ;; Trim the cache to take account of buffer changes. (while (and c (> (car c) c-state-nonlit-pos-cache-limit)) (setq c (cdr c))) (setq c-state-nonlit-pos-cache c) (while (and c (> (car c) here)) + (setq high-pos (car c)) (setq c (cdr c))) (setq pos (or (car c) (point-min))) - (while - ;; Add an element to `c-state-nonlit-pos-cache' each iteration. - (and - (<= (setq npos (+ pos c-state-nonlit-pos-interval)) here) - - ;; Test for being in a literal. - (progn - (setq lit (car (cddr (c-state-pp-to-literal pos npos)))) - (or (null lit) - (prog1 (<= (cdr lit) here) - (setq npos (cdr lit))))) - - ;; Test for being in a macro. - (progn - (goto-char npos) - (setq macro-beg - (and (c-beginning-of-macro) (/= (point) npos) (point))) - (when macro-beg - (c-syntactic-end-of-macro) - (or (eobp) (forward-char)) - (setq macro-end (point))) - (or (null macro-beg) - (prog1 (<= macro-end here) - (setq npos macro-end))))) - - (setq pos npos) - (setq c-state-nonlit-pos-cache (cons pos c-state-nonlit-pos-cache))) + (unless high-pos + (while + ;; Add an element to `c-state-nonlit-pos-cache' each iteration. + (and + (<= (setq npos (+ pos c-state-nonlit-pos-interval)) here) + + ;; Test for being in a literal. If so, go to after it. + (progn + (setq lit (car (cddr (c-state-pp-to-literal pos npos)))) + (or (null lit) + (prog1 (<= (cdr lit) here) + (setq npos (cdr lit))))) + + ;; Test for being in a macro. If so, go to after it. + (progn + (goto-char npos) + (setq macro-beg + (and (c-beginning-of-macro) (/= (point) npos) (point))) + (when macro-beg + (c-syntactic-end-of-macro) + (or (eobp) (forward-char)) + (setq macro-end (point))) + (or (null macro-beg) + (prog1 (<= macro-end here) + (setq npos macro-end))))) + + (setq pos npos) + (setq c-state-nonlit-pos-cache (cons pos c-state-nonlit-pos-cache))) + ;; Add one extra element above HERE so as to to avoid the previous + ;; expensive calculation when the next call is close to the current + ;; one. This is especially useful when inside a large macro. + (setq c-state-nonlit-pos-cache (cons npos c-state-nonlit-pos-cache))) (if (> pos c-state-nonlit-pos-cache-limit) (setq c-state-nonlit-pos-cache-limit pos)) pos)))) +(defun c-state-semi-safe-place (here) + ;; Return a buffer position before HERE which is "safe", i.e. outside any + ;; string or comment. It may be in a macro. + (save-restriction + (widen) + (save-excursion + (let ((c c-state-semi-nonlit-pos-cache) + pos npos high-pos lit macro-beg macro-end) + ;; Trim the cache to take account of buffer changes. + (while (and c (> (car c) c-state-semi-nonlit-pos-cache-limit)) + (setq c (cdr c))) + (setq c-state-semi-nonlit-pos-cache c) + + (while (and c (> (car c) here)) + (setq high-pos (car c)) + (setq c (cdr c))) + (setq pos (or (car c) (point-min))) + + (unless high-pos + (while + ;; Add an element to `c-state-semi-nonlit-pos-cache' each iteration. + (and + (<= (setq npos (+ pos c-state-nonlit-pos-interval)) here) + + ;; Test for being in a literal. If so, go to after it. + (progn + (setq lit (car (cddr (c-state-pp-to-literal pos npos)))) + (or (null lit) + (prog1 (<= (cdr lit) here) + (setq npos (cdr lit)))))) + + (setq pos npos) + (setq c-state-semi-nonlit-pos-cache + (cons pos c-state-semi-nonlit-pos-cache)))) + + (if (> pos c-state-semi-nonlit-pos-cache-limit) + (setq c-state-semi-nonlit-pos-cache-limit pos)) + pos)))) + (defun c-state-literal-at (here) ;; If position HERE is inside a literal, return (START . END), the ;; boundaries of the literal (which may be outside the accessible bit of the @@ -2985,9 +3106,11 @@ ;; ;; This function is called from c-after-change. - ;; The cache of non-literals: + ;; The caches of non-literals: (if (< here c-state-nonlit-pos-cache-limit) (setq c-state-nonlit-pos-cache-limit here)) + (if (< here c-state-semi-nonlit-pos-cache-limit) + (setq c-state-semi-nonlit-pos-cache-limit here)) ;; `c-state-cache': ;; Case 1: if `here' is in a literal containing point-min, everything @@ -4230,7 +4353,7 @@ comment at the start of cc-engine.el for more info." (save-restriction (widen) - (let* ((safe-place (c-state-safe-place (point))) + (let* ((safe-place (c-state-semi-safe-place (point))) (lit (c-state-pp-to-literal safe-place (point)))) (or (cadr lit) (and detect-cpp @@ -4254,7 +4377,7 @@ (save-excursion (let* ((pos (point)) - (lim (or lim (c-state-safe-place pos))) + (lim (or lim (c-state-semi-safe-place pos))) (pp-to-lit (save-restriction (widen) (c-state-pp-to-literal lim pos))) @@ -4372,7 +4495,7 @@ ;; Get a "safe place" approximately TRY-SIZE characters before START. ;; This doesn't preserve point. (let* ((pos (max (- start try-size) (point-min))) - (base (c-state-safe-place pos)) + (base (c-state-semi-safe-place pos)) (s (parse-partial-sexp base pos))) (if (or (nth 4 s) (nth 3 s)) ; comment or string (nth 8 s) === modified file 'lisp/progmodes/cc-langs.el' --- lisp/progmodes/cc-langs.el 2012-01-19 07:21:25 +0000 +++ lisp/progmodes/cc-langs.el 2012-03-02 22:16:21 +0000 @@ -459,8 +459,10 @@ ;; 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 nil - c++ '(c-extend-region-for-CPP c-before-change-check-<>-operators) - (c objc) 'c-extend-region-for-CPP + c++ '(c-extend-region-for-CPP + c-before-change-check-<>-operators + c-invalidate-macro-cache) + (c objc) '(c-extend-region-for-CPP c-invalidate-macro-cache) ;; java 'c-before-change-check-<>-operators awk 'c-awk-record-region-clear-NL) (c-lang-defvar c-get-state-before-change-functions ------------------------------------------------------------ revno: 107484 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2012-03-02 17:40:44 +0200 message: Fix computation of scroll-margin's character position in redisplay_window. src/xdisp.c (redisplay_window): Pass to move_it_vertically the margin in pixels, not in screen lines. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-03-02 12:03:08 +0000 +++ src/ChangeLog 2012-03-02 15:40:44 +0000 @@ -4,6 +4,8 @@ position past the first glyph_row that ends at ZV. (Bug#10902) (redisplay_window, next_element_from_string): Fix typos in comments. + (redisplay_window): Pass to move_it_vertically the margin in + pixels, not in screen lines. 2012-03-02 Glenn Morris === modified file 'src/xdisp.c' --- src/xdisp.c 2012-03-02 12:03:08 +0000 +++ src/xdisp.c 2012-03-02 15:40:44 +0000 @@ -15611,7 +15611,7 @@ SAVE_IT (it1, it, it1data); start_display (&it1, w, startp); - move_it_vertically (&it1, margin); + move_it_vertically (&it1, margin * FRAME_LINE_HEIGHT (f)); margin_pos = IT_CHARPOS (it1); RESTORE_IT (&it, &it, it1data); } ------------------------------------------------------------ revno: 107483 committer: Michael Albinus branch nick: trunk timestamp: Fri 2012-03-02 16:29:28 +0100 message: * jka-compr.el (jka-compr-call-process): Apply `file-accessible-directory-p' only when the default directory is not remote. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-03-01 09:01:08 +0000 +++ lisp/ChangeLog 2012-03-02 15:29:28 +0000 @@ -1,3 +1,9 @@ +2012-03-02 Michael Albinus + + * jka-compr.el (jka-compr-call-process): Apply + `file-accessible-directory-p' only when the default directory is + not remote. + 2012-03-01 Michael Albinus * files.el (file-equal-p): Fix docstring. Avoid unnecessary === modified file 'lisp/jka-compr.el' --- lisp/jka-compr.el 2012-01-21 00:41:05 +0000 +++ lisp/jka-compr.el 2012-03-02 15:29:28 +0000 @@ -203,6 +203,7 @@ ;; call-process barfs if default-directory is inaccessible. (let ((default-directory (if (and default-directory + (not (file-remote-p default-directory)) (file-accessible-directory-p default-directory)) default-directory (file-name-directory infile)))) ------------------------------------------------------------ revno: 107482 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2012-03-02 14:03:08 +0200 message: Fix typos in comments. src/xdisp.c (redisplay_window, next_element_from_string): Fix typos in comments. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-03-02 11:35:51 +0000 +++ src/ChangeLog 2012-03-02 12:03:08 +0000 @@ -2,6 +2,8 @@ * xdisp.c (try_window_reusing_current_matrix): Don't move cursor position past the first glyph_row that ends at ZV. (Bug#10902) + (redisplay_window, next_element_from_string): Fix typos in + comments. 2012-03-02 Glenn Morris === modified file 'src/xdisp.c' --- src/xdisp.c 2012-03-02 11:35:51 +0000 +++ src/xdisp.c 2012-03-02 12:03:08 +0000 @@ -7362,7 +7362,7 @@ if (it->current.overlay_string_index >= 0) { /* Get the next character from an overlay string. In overlay - strings, There is no field width or padding with spaces to + strings, there is no field width or padding with spaces to do. */ if (IT_STRING_CHARPOS (*it) >= SCHARS (it->string)) { @@ -15602,7 +15602,7 @@ accessible region of the buffer. This can happen when we have just switched to a different buffer and/or changed its restriction. In that case, startp is initialized to - the character position 1 (BEG) because we did not yet + the character position 1 (BEGV) because we did not yet have chance to display the buffer even once. */ && BEGV <= CHARPOS (startp) && CHARPOS (startp) <= ZV) { ------------------------------------------------------------ revno: 107481 fixes bug(s): http://debbugs.gnu.org/10902 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2012-03-02 13:35:51 +0200 message: Fix bug #10902 with cursor positioning at EOB. src/xdisp.c (try_window_reusing_current_matrix): Don't move cursor position past the first glyph_row that ends at ZV. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-03-02 02:57:19 +0000 +++ src/ChangeLog 2012-03-02 11:35:51 +0000 @@ -1,3 +1,8 @@ +2012-03-02 Eli Zaretskii + + * xdisp.c (try_window_reusing_current_matrix): Don't move cursor + position past the first glyph_row that ends at ZV. (Bug#10902) + 2012-03-02 Glenn Morris * buffer.c (buffer-list-update-hook): Doc fix. === modified file 'src/xdisp.c' --- src/xdisp.c 2012-02-29 17:50:24 +0000 +++ src/xdisp.c 2012-03-02 11:35:51 +0000 @@ -16322,7 +16322,10 @@ ++first_row_to_display) { if (PT >= MATRIX_ROW_START_CHARPOS (first_row_to_display) - && PT < MATRIX_ROW_END_CHARPOS (first_row_to_display)) + && (PT < MATRIX_ROW_END_CHARPOS (first_row_to_display) + || (PT == MATRIX_ROW_END_CHARPOS (first_row_to_display) + && first_row_to_display->ends_at_zv_p + && pt_row == NULL))) pt_row = first_row_to_display; } @@ -16414,7 +16417,9 @@ if (pt_row) { for (row = MATRIX_ROW (w->current_matrix, w->cursor.vpos); - row < bottom_row && PT >= MATRIX_ROW_END_CHARPOS (row); + row < bottom_row + && PT >= MATRIX_ROW_END_CHARPOS (row) + && !row->ends_at_zv_p; row++) { w->cursor.vpos++; ------------------------------------------------------------ revno: 107480 committer: Michael Albinus branch nick: trunk timestamp: Fri 2012-03-02 10:40:05 +0100 message: * dbus.texi (Signals): Known names will be mapped onto unique names, when registering for signals. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2012-02-29 08:12:51 +0000 +++ doc/misc/ChangeLog 2012-03-02 09:40:05 +0000 @@ -1,3 +1,8 @@ +2012-03-02 Michael Albinus + + * dbus.texi (Signals): Known names will be mapped onto unique + names, when registering for signals. + 2012-02-29 Glenn Morris * url.texi: Fix quote usage in body text. === modified file 'doc/misc/dbus.texi' --- doc/misc/dbus.texi 2012-01-19 07:21:25 +0000 +++ doc/misc/dbus.texi 2012-03-02 09:40:05 +0000 @@ -1606,9 +1606,10 @@ @var{service} is the D-Bus service name used by the sending D-Bus object. It can be either a known name or the unique name of the D-Bus -object sending the signal. In case of a unique name, signals won't be -received any longer once the object owning this unique name has -disappeared, and a new queued object has replaced it. +object sending the signal. A known name will be mapped onto the +unique name of the object, owning @var{service} at registration time. +When the corresponding D-Bus object disappears, signals won't be +received any longer. When @var{service} is @code{nil}, related signals from all D-Bus objects shall be accepted. ------------------------------------------------------------ revno: 107479 committer: Glenn Morris branch nick: trunk timestamp: Thu 2012-03-01 22:01:40 -0500 message: * doc/lispref/README: Small updates. Use outline-mode. diff: === modified file 'doc/lispref/README' --- doc/lispref/README 2012-01-19 07:21:25 +0000 +++ doc/lispref/README 2012-03-02 03:01:40 +0000 @@ -1,37 +1,36 @@ -Copyright (C) 2001-2012 Free Software Foundation, Inc. +Copyright (C) 2001-2012 Free Software Foundation, Inc. -*- outline -*- See the end of the file for license conditions. -README for Edition 3.0 of the Emacs Lisp Reference Manual. +README for the Emacs Lisp Reference Manual. * This directory contains the texinfo source files for the Emacs Lisp Reference Manual. -* Report bugs in the Lisp Manual or in Emacs using M-x report-emacs-bug. -To ask questions, use the newsgroup gnu.emacs.help. +* Report bugs in the Lisp Manual (or in Emacs) using M-x report-emacs-bug. +To ask questions, use the help-gnu-emacs mailing list. * The Emacs Lisp Reference Manual is quite large. It totals around 1100 pages in smallbook format; the info files total around 3.0 megabytes. -* You can format this manual either for Info or for printing hardcopy -using TeX. +* You can format this manual for Info, for printing hardcopy using TeX, +or for HTML. * You can buy nicely printed copies from the Free Software Foundation. Buying a manual from the Free Software Foundation helps support our GNU development work. See . +(At time of writing, this manual is out of print.) -* The master file for formatting this manual for Tex is called -`elisp.texi'. It contains @include commands to include all the -chapters that make up the manual. In addition, `elisp.texi' has -the title page in a new format designed by Karl Berry, using the -@titlespec command. +* The master file for formatting this manual for Tex is called `elisp.texi'. +It contains @include commands to include all the chapters that make up +the manual. * This distribution contains a Makefile that you can use with GNU Make. -** To create a DVI file with a sorted index, run `make elisp.dvi'. - ** To make an Info file, you need to install Texinfo, then run `make info'. +** Use `make elisp.pdf' or `make elisp.html' to create PDF or HTML versions. + This file is part of GNU Emacs.