Commits

Anonymous committed 416f762 Merge

merge trunk

Comments (0)

Files changed (73)

doc/emacs/ChangeLog

+2011-12-05  Chong Yidong  <cyd@gnu.org>
+
+	* programs.texi (Comment Commands): Fix description of for M-; on
+	blank lines.  Move documentation of comment-region here.
+	(Multi-Line Comments): Clarify the role of comment-multi-line.
+	Refer to Comment Commands for comment-region doc.
+	(Options for Comments): Refer to Multi-Line Comments for
+	comment-multi-line doc, instead of duplicating it.  Fix default
+	values of comment-padding and comment-start-skip.
+
 2011-12-04  Chong Yidong  <cyd@gnu.org>
 
 	* programs.texi (Program Modes): Mention modes that are not

doc/emacs/programs.texi

 also do spell checking on comments with Flyspell Prog mode
 (@pxref{Spelling}).
 
+  Some major modes have special rules for indenting different kinds of
+comments.  For example, in Lisp code, comments starting with two
+semicolons are indented as if they were lines of code, while those
+starting with three semicolons are supposed to be aligned to the left
+margin and are often used for sectioning purposes.  Emacs understand
+these conventions; for instance, typing @key{TAB} on a comment line
+will indent the comment to the appropriate position.
+
+@example
+;; This function is just an example.
+;;; Here either two or three semicolons are appropriate.
+(defun foo (x)
+;;;  And now, the first part of the function:
+  ;; The following line adds one.
+  (1+ x))           ; This line adds one.
+@end example
+
 @menu
 * Comment Commands::    Inserting, killing, and aligning comments.
 * Multi-Line Comments:: Commands for adding and editing multi-line comments.
 @cindex indentation for comments
 @cindex alignment for comments
 
-  The commands in this table insert, kill and align comments:
+  The following commands operate on comments:
 
 @table @asis
 @item @kbd{M-;}
-Insert or realign comment on current line; alternatively, comment or
-uncomment the region (@code{comment-dwim}).
+Insert or realign comment on current line; if the region is active,
+comment or uncomment the region instead (@code{comment-dwim}).
 @item @kbd{C-u M-;}
 Kill comment on current line (@code{comment-kill}).
 @item @kbd{C-x ;}
 (@code{comment-indent-new-line}).  @xref{Multi-Line Comments}.
 @item @kbd{M-x comment-region}
 @itemx @kbd{C-c C-c} (in C-like modes)
-Add or remove comment delimiters on all the lines in the region.
+Add comment delimiters to all the lines in the region.
 @end table
 
 @kindex M-;
 different jobs relating to comments, depending on the situation where
 you use it.
 
-  When a region is active, @kbd{M-;} either adds or removes comment
-delimiters on each line of the region.  @xref{Mark}.  If every line in
-the region is a comment, it removes comment delimiters from each;
-otherwise, it adds comment delimiters to each.  You can also use the
-commands @code{comment-region} and @code{uncomment-region} to
-explicitly comment or uncomment the text in the region
-(@pxref{Multi-Line Comments}).  If you supply a prefix argument to
-@kbd{M-;} when a region is active, that specifies how many comment
-delimiters to add or how many to delete.
+  When a region is active (@pxref{Mark}), @kbd{M-;} either adds
+comment delimiters to the region, or removes them.  If every line in
+the region is already a comment, it ``uncomments'' each of those lines
+by removing their comment delimiters.  Otherwise, it adds comment
+delimiters to enclose the text in the region.
 
-  If the region is not active, @kbd{M-;} inserts a new comment if
-there is no comment already on the line.  The new comment is normally
-aligned at a specific column called the @dfn{comment column}; if the
-text of the line extends past the comment column, @kbd{M-;} aligns the
-comment start string to a suitable boundary (usually, at least one
-space is inserted).  The comment begins with the string Emacs thinks
-comments should start with (the value of @code{comment-start}; see
-below).  Emacs places point after that string, so you can insert the
-text of the comment right away.  If the major mode has specified a
-string to terminate comments, @kbd{M-;} inserts that string after
-point, to keep the syntax valid.
+  If you supply a prefix argument to @kbd{M-;} when a region is
+active, that specifies the number of comment delimiters to add or
+delete.  A positive argument @var{n} adds @var{n} delimiters, while a
+negative argument @var{-n} removes @var{n} delimiters.
+
+  If the region is not active, and there is no existing comment on the
+current line, @kbd{M-;} adds a new comment to the current line.  If
+the line is blank (i.e.@: empty or containing only whitespace
+characters), the comment is indented to the same position where
+@key{TAB} would indent to (@pxref{Basic Indent}).  If the line is
+non-blank, the comment is placed after the last non-whitespace
+character on the line; normally, Emacs tries putting it at the column
+specified by the variable @code{comment-column} (@pxref{Options for
+Comments}), but if the line already extends past that column, it puts
+the comment at some suitable position, usually separated from the
+non-comment text by at least one space.  In each case, Emacs places
+point after the comment's starting delimiter, so that you can start
+typing the comment text right away.
 
   You can also use @kbd{M-;} to align an existing comment.  If a line
 already contains the comment-start string, @kbd{M-;} realigns it to
-the conventional alignment and moves point after it.  (Exception:
-comments starting in column 0 are not moved.)  Even when an existing
-comment is properly aligned, @kbd{M-;} is still useful for moving
-directly to the start of the text inside the comment.
+the conventional alignment and moves point after the comment's
+starting delimiter.  As an exception, comments starting in column 0
+are not moved.  Even when an existing comment is properly aligned,
+@kbd{M-;} is still useful for moving directly to the start of the
+comment text.
 
 @findex comment-kill
 @kindex C-u M-;
-  @kbd{C-u M-;} kills any comment on the current line, along with the
-whitespace before it.  To reinsert the comment on another line, move
-to the end of that line, do @kbd{C-y}, and then do @kbd{M-;} to
-realign it.
+  @kbd{C-u M-;} (@code{comment-dwim} with a prefix argument) kills any
+comment on the current line, along with the whitespace before it.
+Since the comment is saved to the kill ring, you can reinsert it on
+another line by moving to the end of that line, doing @kbd{C-y}, and
+then @kbd{M-;} to realign the command.  You can achieve the same
+effect as @kbd{C-u M-;} by typing @kbd{M-x comment-kill}
+(@code{comment-dwim} actually calls @code{comment-kill} as a
+subroutine when it is given a prefix argument).
 
-  Note that @kbd{C-u M-;} is not a distinct key; it is @kbd{M-;}
-(@code{comment-dwim}) with a prefix argument.  That command is
-programmed so that when it receives a prefix argument it calls
-@code{comment-kill}.  However, @code{comment-kill} is a valid command
-in its own right, and you can bind it directly to a key if you wish.
-
-  Some major modes have special rules for aligning certain kinds of
-comments in certain contexts.  For example, in Lisp code, comments which
-start with two semicolons are indented as if they were lines of code,
-instead of at the comment column.  Comments which start with three
-semicolons are supposed to start at the left margin and are often used
-for sectioning purposes.  Emacs understands
-these conventions by indenting a double-semicolon comment using @key{TAB},
-and by not changing the indentation of a triple-semicolon comment at all.
-
-@example
-;; This function is just an example.
-;;; Here either two or three semicolons are appropriate.
-(defun foo (x)
-;;;  And now, the first part of the function:
-  ;; The following line adds one.
-  (1+ x))           ; This line adds one.
-@end example
+@kindex C-c C-c (C mode)
+@findex comment-region
+@findex uncomment-region
+  The command @kbd{M-x comment-region} is equivalent to calling
+@kbd{M-;} on an active region, except that it always acts on the
+region, even if the mark is inactive.  In C mode and related modes,
+this command is bound to @kbd{C-c C-c}.  The command @kbd{M-x
+uncomment-region} uncomments each line in the region; a numeric prefix
+argument specifies the number of comment delimiters to remove
+(negative arguments specify the number of comment to delimiters to
+add).
 
   For C-like modes, you can configure the exact effect of @kbd{M-;} by
 setting the variables @code{c-indent-comment-alist} and
 @kindex M-j
 @cindex blank lines in programs
 @findex comment-indent-new-line
+@vindex comment-multi-line
+  If you are typing a comment and wish to continue it to another line,
+type @kbd{M-j} or @kbd{C-M-j} (@code{comment-indent-new-line}).  This
+breaks the current line, and inserts the necessary comment delimiters
+and indentation to continue the comment.
 
-  If you are typing a comment and wish to continue it on another line,
-you can use the command @kbd{C-M-j} or @kbd{M-j}
-(@code{comment-indent-new-line}).  If @code{comment-multi-line}
-(@pxref{Options for Comments}) is non-@code{nil}, it moves to a new
-line within the comment.  Otherwise it closes the comment and starts a
-new comment on a new line.  When Auto Fill mode is on, going past the
-fill column while typing a comment causes the comment to be continued
-in just this fashion.
+  For languages with closing comment delimiters (e.g.@: @samp{*/} in
+C), the exact behavior of @kbd{M-j} depends on the value of the
+variable @code{comment-multi-line}.  If the value is @code{nil}, the
+command closes the comment on the old line and starts a new comment on
+the new line.  Otherwise, it opens a new line within the current
+comment delimiters.
 
-@kindex C-c C-c (C mode)
-@findex comment-region
-  To turn existing lines into comment lines, use the @kbd{M-x
-comment-region} command (or type @kbd{C-c C-c} in C-like modes).  It
-adds comment delimiters to the lines that start in the region, thus
-commenting them out.  With a negative argument, it does the
-opposite---it deletes comment delimiters from the lines in the region.
+  When Auto Fill mode is on, going past the fill column while typing a
+comment also continues the comment, in the same way as an explicit
+invocation of @kbd{M-j}.
 
-  With a positive argument, @code{comment-region} duplicates the last
-character of the comment start sequence it adds; the argument
-specifies how many copies of the character to insert.  Thus, in Lisp
-mode, @kbd{C-u 2 M-x comment-region} adds @samp{;;} to each line.
-Duplicating the comment delimiter is a way of calling attention to the
-comment.  It can also affect how the comment is aligned or indented.
-In Lisp, for proper indentation, you should use an argument of two or
-three, if between defuns; if within a defun, it must be three.
+  To turn existing lines into comment lines, use @kbd{M-;} with the
+region active, or use @kbd{M-x comment-region}
+@ifinfo
+(@pxref{Comment Commands}).
+@end ifinfo
+@ifnotinfo
+as described in the preceding section.
+@end ifnotinfo
 
   You can configure C Mode such that when you type a @samp{/} at the
 start of a line in a multi-line block comment, this closes the
 @vindex comment-column
 @kindex C-x ;
 @findex comment-set-column
-  The @dfn{comment column}, the column at which Emacs tries to place
-comments, is stored in the variable @code{comment-column}.  You can
-set it to a number explicitly.  Alternatively, the command @kbd{C-x ;}
-(@code{comment-set-column}) sets the comment column to the column
-point is at.  @kbd{C-u C-x ;} sets the comment column to match the
-last comment before point in the buffer, and then does a @kbd{M-;} to
-align the current line's comment under the previous one.
-
-  The variable @code{comment-column} is per-buffer: setting the variable
-in the normal fashion affects only the current buffer, but there is a
-default value which you can change with @code{setq-default}.
-@xref{Locals}.  Many major modes initialize this variable for the
-current buffer.
+  As mentioned in @ref{Comment Commands}, when the @kbd{M-j} command
+adds a comment to a line, it tries to place the comment at the column
+specified by the buffer-local variable @code{comment-column}.  You can
+set either the local value or the default value of this buffer-local
+variable in the usual way (@pxref{Locals}).  Alternatively, you can
+type @kbd{C-x ;} (@code{comment-set-column}) to set the value of
+@code{comment-column} in the current buffer to the column where point
+is currently located.  @kbd{C-u C-x ;} sets the comment column to
+match the last comment before point in the buffer, and then does a
+@kbd{M-;} to align the current line's comment under the previous one.
 
 @vindex comment-start-skip
   The comment commands recognize comments based on the regular
 than the comment starting delimiter in the strictest sense of the word;
 for example, in C mode the value of the variable is
 @c This stops M-q from breaking the line inside that @code.
-@code{@w{"/\\*+ *\\|//+ *"}}, which matches extra stars and spaces
-after the @samp{/*} itself, and accepts C++ style comments also.
-(Note that @samp{\\} is needed in Lisp syntax to include a @samp{\} in
-the string, which is needed to deny the first star its special meaning
-in regexp syntax.  @xref{Regexp Backslash}.)
+@code{@w{"\\(//+\\|/\\*+\\)\\s *"}}, which matches extra stars and
+spaces after the @samp{/*} itself, and accepts C++ style comments
+also.  (Note that @samp{\\} is needed in Lisp syntax to include a
+@samp{\} in the string, which is needed to deny the first star its
+special meaning in regexp syntax.  @xref{Regexp Backslash}.)
 
 @vindex comment-start
 @vindex comment-end
   When a comment command makes a new comment, it inserts the value of
-@code{comment-start} to begin it.  The value of @code{comment-end} is
-inserted after point, so that it will follow the text that you will
-insert into the comment.  When @code{comment-end} is non-empty, it
-should start with a space.  For example, in C mode,
-@code{comment-start} has the value @w{@code{"/* "}} and
-@code{comment-end} has the value @w{@code{" */"}}.
+@code{comment-start} as an opening comment delimiter.  It also inserts
+the value of @code{comment-end} after point, as a closing comment
+delimiter.  For example, in Lisp mode, @code{comment-start} is
+@samp{";"} and @code{comment-end} is @code{""} (the empty string).  In
+C mode, @code{comment-start} is @code{"/* "} and @code{comment-end} is
+@code{" */"}.
 
 @vindex comment-padding
-  The variable @code{comment-padding} specifies how many spaces
-@code{comment-region} should insert on each line between the comment
-delimiter and the line's original text.  The default is 1, to insert
-one space.  @code{nil} means 0.  Alternatively, @code{comment-padding}
-can hold the actual string to insert.
+  The variable @code{comment-padding} specifies a string that the
+commenting commands should insert between the comment delimiter(s) and
+the comment text.  The default, @samp{" "}, specifies a single space.
+Alternatively, the value can be a number, which specifies that number
+of spaces, or @code{nil}, which means no spaces at all.
 
-@vindex comment-multi-line
-  The variable @code{comment-multi-line} controls how @kbd{C-M-j}
-(@code{indent-new-comment-line}) behaves when used inside a comment.
-Specifically, when @code{comment-multi-line} is @code{nil}, the
-command inserts a comment terminator, begins a new line, and finally
-inserts a comment starter.  Otherwise it does not insert the
-terminator and starter, so it effectively continues the current
-comment across multiple lines.  In languages that allow multi-line
-comments, the choice of value for this variable is a matter of taste.
-The default for this variable depends on the major mode.
+  The variable @code{comment-multi-line} controls how @kbd{M-j} and
+Auto Fill mode continue comments over multiple lines.
+@xref{Multi-Line Comments}.
 
 @vindex comment-indent-function
   The variable @code{comment-indent-function} should contain a function

doc/lispref/ChangeLog

+2011-12-05  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* text.texi (Special Properties): Warn against `intangible' properties
+	(bug#10222).
+
 2011-11-26  Eli Zaretskii  <eliz@gnu.org>
 
 	* display.texi (Truncation):
 
 2011-11-21  Martin Rudalics  <rudalics@gmx.at>
 
-	* windows.texi (Windows and Frames, Splitting Windows): Fix
-	typos.
+	* windows.texi (Windows and Frames, Splitting Windows):
+	Fix typos.
 
 2011-11-21  Chong Yidong  <cyd@gnu.org>
 
 	(Buffers and Windows): Copyedits.
 	(Choosing Window): Document special handling of special-display-*.
 	(Choosing Window Options): Fix display-buffer-reuse-frames doc.
-	Don't document even-window-heights, which is going away.  Clarify
-	which options are obeyed by which action functions.
+	Don't document even-window-heights, which is going away.
+	Clarify which options are obeyed by which action functions.
 
 2011-11-20  Stefan Monnier  <monnier@iro.umontreal.ca>
 

doc/lispref/commands.texi

 
   It is not easy to display a value of point in the middle of a
 sequence of text that has the @code{display}, @code{composition} or
-@code{intangible} property, or is invisible.  Therefore, after a
-command finishes and returns to the command loop, if point is within
-such a sequence, the command loop normally moves point to the edge of
-the sequence.
+is invisible.  Therefore, after a command finishes and returns to the
+command loop, if point is within such a sequence, the command loop
+normally moves point to the edge of the sequence.
 
   A command can inhibit this feature by setting the variable
 @code{disable-point-adjustment}:

doc/lispref/text.texi

 When the variable @code{inhibit-point-motion-hooks} is non-@code{nil},
 the @code{intangible} property is ignored.
 
+Beware: this property operates at a very low level, and affects a lot of code
+in unexpected ways.  So use it with extreme caution.  A common misuse is to put
+an intangible property on invisible text, which is actually unnecessary since
+the command loop will move point outside of the invisible text at the end of
+each command anyway.  @xref{Adjusting Point}.
+
 @item field
 @kindex field @r{(text property)}
 Consecutive characters with the same @code{field} property constitute a

doc/misc/eshell.texi

 
 @item Using C-p and C-n with rebind gets into a locked state
 
-This happened a few times in Emacs 21, but has been unreproducible
+This happened a few times in Emacs 21, but has been irreproducible
 since.
 
 @item If an interactive process is currently running, @kbd{M-!} doesn't work

doc/misc/gnus.texi

 @acronym{ASCII} equivalents (@code{gnus-article-treat-non-ascii}).
 This is mostly useful if you're on a terminal that has a limited font
 and doesn't show accented characters, ``advanced'' punctuation, and the
-like.  For instance, @samp{�} is tranlated into @samp{>>}, and so on.
+like.  For instance, @samp{�} is translated into @samp{>>}, and so on.
 
 @item W Y f
 @kindex W Y f (Summary)
 
 *** The mode-line tooltips have been improved to provide more details.
 
-*** The VC, line/colum number and minor mode indicators on the mode
+*** The VC, line/column number and minor mode indicators on the mode
 line are now interactive: mouse-1 can be used on them to pop up a menu.
 
 ** File deletion can make use of the Recycle Bin or system Trash folder.

etc/srecode/doc-cpp.srt

 ----
 
 template variable-same-line-comment :tag
-"A comment occurring after a veriable declaration.
+"A comment occurring after a variable declaration.
 Recycle doxygen comment code from the more general template set."
 ----
 {{>:declaration:doxygen-variable-same-line}}

etc/srecode/doc-default.srt

 ----
 
 template variable-same-line-comment :tag
-"A comment occurring after a veriable declaration."
+"A comment occurring after a variable declaration."
 ----
 {{comment_start}} {{?DOC}} {{comment_end}}
 ----

etc/srecode/doc-java.srt

 ----
 
 template variable-same-line-comment :tag
-"A comment occurring after a veriable declaration.
+"A comment occurring after a variable declaration.
 Recycle javadoc comment code from the more general template set."
 ----
 {{>:declaration:javadoc-variable-same-line}}

leim/quail/croatian.el

-;;; quail/croatian.el -- Quail package for inputing Croatian  -*-coding: iso-8859-2;-*-
+;;; quail/croatian.el -- Quail package for inputting Croatian  -*-coding: iso-8859-2;-*-
 
 ;; Copyright (C) 2003-2011  Free Software Foundation, Inc.
 

leim/quail/czech.el

 All digits except of `1' are replaced by Czech characters as on the standard
 Czech keyboard.
 `[' and `]' are replaced with `,Bz(B' and `,By(B', respectively.
-There are two dead keys on `=' and `+'.  Characters with diaresis are
+There are two dead keys on `=' and `+'.  Characters with diaereses are
 accessible through `+='.
 All other keys are the same as on standard US keyboard."
  nil t nil nil t nil nil nil nil nil t)

leim/quail/greek.el

 
 In the right of ,Fk(B key is a combination key, where
  ,F4(B acute
- ,F((B diaresis
+ ,F((B diaeresis
 
 e.g.
  ,F4(B + ,Fa(B -> ,F\(B
 
 In the right of ,Fk(B key is a combination key, where
  ,F4(B acute
- ,F((B diaresis
+ ,F((B diaeresis
 
 e.g.
  ,Fa(B + ,F4(B -> ,F\(B

leim/quail/persian.el

 ;;;
 ;;;  This translit keyboard is designed to be intuitive such that
 ;;;  mapping are easy and natural to remember for a persian writer.
-;;;  For some persian characters there are multiple ways of inputing
+;;;  For some persian characters there are multiple ways of inputting
 ;;;  the same character.
 ;;;
 ;;;  The letter 'h' is used for a number of two character mappings,
-;;;  this means that some character sequence inputs need to be repeated 
+;;;  this means that some character sequence inputs need to be repeated
 ;;;  followed by a backspace followed by the 'h'.
 ;;;    For example:  سحر = 's' 's' '<bs>' 'h' 'h' 'r'
 ;;;  In practice such sequences are rare.
+2011-12-05  Christopher Genovese  <genovese.cr@gmail.com>  (tiny change)
+
+	* emacs-lisp/assoc.el (aput): Fix return value (bug#10146)
+
+2011-12-05  Eli Zaretskii  <eliz@gnu.org>
+
+	* descr-text.el (describe-char): Fix display of strong
+	right-to-left characters and directional embeddings and overrides.
+
+	* simple.el (what-cursor-position): Fix display of codepoints of
+	strong right-to-left characters.
+
+2011-12-05  Chong Yidong  <cyd@gnu.org>
+
+	* faces.el (read-color): Doc fix.
+
 2011-12-05  Glenn Morris  <rgm@gnu.org>
 
 	* align.el (align--set-marker): Add doc-string.
 
 	* net/network-stream.el (network-stream-open-starttls): Support
 	upgrading to STARTTLS always, even if we don't have built-in support.
-	(open-network-stream): Add the :always-query-capabilies keyword.
+	(open-network-stream): Add the :always-query-capabilities keyword.
 
 	* mail/smtpmail.el: Rewritten to do opportunistic STARTTLS
 	upgrades with `open-network-stream', and rely solely on

lisp/ChangeLog.13

 
 2007-09-23  Glenn Morris  <rgm@gnu.org>
 
-	* ses.el (ses-calculate-cell): Don't evaluate unsafe formulae.
+	* ses.el (ses-calculate-cell): Don't evaluate unsafe formulas.
 
 2007-09-23  Dan Nicolaescu  <dann@ics.uci.edu>
 
 
 1988-08-03  Robert J. Chassell  (bob@frosted-flakes.ai.mit.edu)
 
-	* texinfo.el: Changed fill-colum from 75 to 72.  The larger
+	* texinfo.el: Changed fill-column from 75 to 72.  The larger
 	fill-column causes numerous overfull hboxes in TeX when you are
 	writing Emacs Lisp code that will be formatted as a Texinfo example.
 
 ;; simple algorithm that understand only basic regular expressions.
 ;; Parts of the code were broken up and included in vhdl-mode.el
 ;; around this time.  After several comments from users, and a need to
-;; find a more robust, performant algorithm, 2.0 was born in late
+;; find a more robust, higher performing algorithm, 2.0 was born in late
 ;; 1998.  Many different approaches were taken (mostly due to the
 ;; complexity of TeX tables), but finally a scheme was discovered
 ;; which worked fairly well for most common usage cases.  Development

lisp/allout-widgets.el

 ;;;_  > allout-widgets-setup (varname value)
 ;;;###autoload
 (defun allout-widgets-setup (varname value)
-  "Commission or decommision allout-widgets-mode along with allout-mode.
+  "Commission or decommission allout-widgets-mode along with allout-mode.
 
 Meant to be used by customization of `allout-widgets-auto-activation'."
   (set-default varname value)
 
                              Extending Allout
 
-Allout exposure and authoring activites all have associated
+Allout exposure and authoring activities all have associated
 hooks, by which independent code can cooperate with allout
 without changes to the allout core.  Here are key ones:
 

lisp/ansi-color.el

 	  (setq ansi-color-context-region nil))))))
 
 ;; This function helps you look for overlapping overlays.  This is
-;; usefull in comint-buffers.  Overlapping overlays should not happen!
+;; useful in comint-buffers.  Overlapping overlays should not happen!
 ;; A possible cause for bugs are the markers.  If you create an overlay
 ;; up to the end of the region, then that end might coincide with the
 ;; process-mark.  As text is added BEFORE the process-mark, the overlay

lisp/calendar/solar.el

 (defun solar-mean-equinoxes/solstices (k year)
   "Julian day of mean equinox/solstice K for YEAR.
 K=0, spring equinox; K=1, summer solstice; K=2, fall equinox; K=3, winter
-solstice.  These formulae are only to be used between 1000 BC and 3000 AD."
+solstice.  These formulas are only to be used between 1000 BC and 3000 AD."
   (let ((y (/ year 1000.0))
         (z (/ (- year 2000) 1000.0)))
     (if (< year 1000)                ; actually between -1000 and 1000

lisp/cedet/semantic/db-find.el

   "Synchronize the search index IDX with some NEW-TAGS."
   ;; Reset our parts.
   (semantic-reset idx)
-  ;; Notify dependants by clearning their indicies.
+  ;; Notify dependants by clearing their indices.
   (semanticdb-notify-references
    (oref idx table)
    (lambda (tab me)
   (if (semantic-find-tags-by-class 'include new-tags)
       (progn
 	(semantic-reset idx)
-	;; Notify dependants by clearning their indicies.
+	;; Notify dependants by clearing their indices.
 	(semanticdb-notify-references
 	 (oref idx table)
 	 (lambda (tab me)
     (when (oref idx type-cache)
       (when (semanticdb-partial-synchronize (oref idx type-cache) new-tags)
 	;; If the synchronize returns true, we need to notify.
-	;; Notify dependants by clearning their indicies.
+	;; Notify dependants by clearing their indices.
 	(semanticdb-notify-references
 	 (oref idx table)
 	 (lambda (tab me)
 	;; do a caching lookup.
 	(let ((index (semanticdb-get-table-index table)))
 	  (if (semanticdb-find-need-cache-update-p table)
-	      ;; Lets go look up our indicies
+	      ;; Let's go look up our indices.
 	      (let ((ans (semanticdb-find-translate-path-includes--internal path)))
 		(oset index include-path ans)
-		;; Once we have our new indicies set up, notify those
+		;; Once we have our new indices set up, notify those
 		;; who depend on us if we found something for them to
 		;; depend on.
 		(when ans (semanticdb-refresh-references table))
 	  (setq ans (semanticdb-file-table
 		     (car systemdb)
 		     ;; I would expect most omniscient to return the same
-		     ;; thing reguardless of filename, but we may have
+		     ;; thing regardless of filename, but we may have
 		     ;; one that can return a table of all things the
 		     ;; current file needs.
 		     (buffer-file-name (current-buffer))))

lisp/cedet/semantic/debug.el

   "For IFACE, highlight NONTERM in the parser buffer.
 NONTERM is the name of the rule currently being processed that shows up
 as a nonterminal (or tag) in the source buffer.
-If RULE and MATCH indicies are specified, highlight those also."
+If RULE and MATCH indices are specified, highlight those also."
   (set-buffer (oref iface :parser-buffer))
 
   (let* ((rules (semantic-find-tags-by-class 'nonterminal (current-buffer)))

lisp/cedet/srecode/args.el

 ;;; :blank
 ;;
 ;; Using :blank means that the template should force blank lines
-;; before and after the template, reguardless of where the insertion
+;; before and after the template, regardless of where the insertion
 ;; is occurring.
 (defun srecode-semantic-handle-:blank (dict)
   "Add macros into the dictionary DICT specifying blank line spacing.
 (provide 'srecode/args)
 
 ;;; srecode/args.el ends here
-

lisp/cedet/srecode/insert.el

 	  (setq doit nil)))
       (goto-char pm)
       )
-    ;; Do indentation reguardless of the newline.
+    ;; Do indentation regardless of the newline.
     (when (and (eq i t) inbuff)
       (indent-according-to-mode)
       (goto-char pm))

lisp/descr-text.el

               (setq charset (char-charset char)
                     code (encode-char char charset)))
         (setq code char))
+      (cond
+       ;; Append a PDF character to directional embeddings and
+       ;; overrides, to prevent potential messup of the following
+       ;; text.
+       ((memq char '(?\x202a ?\x202b ?\x202d ?\x202e))
+	(setq char-description
+	      (concat char-description
+		      (propertize (string ?\x202c) 'invisible t))))
+       ;; Append a LRM character to any strong character to avoid
+       ;; messing up the numerical codepoint.
+       ((memq (get-char-code-property char 'bidi-class) '(R AL))
+	(setq char-description
+	      (concat char-description
+		      (propertize (string ?\x200e) 'invisible t)))))
       (when composition
         ;; When the composition is trivial (i.e. composed only with the
         ;; current character itself without any alternate characters),
 (defvar dired-re-no-dot "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*")
 
 ;; Delete file, possibly delete a directory and all its files.
-;; This function is usefull outside of dired.  One could change it's name
+;; This function is useful outside of dired.  One could change it's name
 ;; to e.g. recursive-delete-file and put it somewhere else.
 (defun dired-delete-file (file &optional recursive trash) "\
 Delete FILE or directory (possibly recursively if optional RECURSIVE is true.)

lisp/emacs-lisp/assoc.el

 
 
 (defun aput (alist-symbol key &optional value)
-  "Inserts a key-value pair into an alist.
+  "Insert a key-value pair into an alist.
 The alist is referenced by ALIST-SYMBOL.  The key-value pair is made
-from KEY and optionally, VALUE.  Returns the altered alist or nil if
-ALIST is nil.
+from KEY and optionally, VALUE.  Returns the altered alist.
 
 If the key-value pair referenced by KEY can be found in the alist, and
 VALUE is supplied non-nil, then the value of KEY will be set to VALUE.
     (setq alist (symbol-value alist-symbol))
     (cond ((null alist) (set alist-symbol elem))
 	  ((anot-head-p alist key) (set alist-symbol (nconc elem alist)))
-	  (value (setcar alist (car elem)))
+	  (value (setcar alist (car elem)) alist)
 	  (t alist))))
 
 

lisp/emulation/cua-rect.el

   (untabify (point-min) (point-max)))
 
 (defun cua-text-fill-rectangle (width text)
-  "Replace rectagle with filled TEXT read from minibuffer.
+  "Replace rectangle with filled TEXT read from minibuffer.
 A numeric prefix argument is used a new width for the filled rectangle."
   (interactive (list
                 (prefix-numeric-value current-prefix-arg)
     (lambda () (insert text))))
 
 (defun cua-refill-rectangle (width)
-  "Fill contents of current rectagle.
+  "Fill contents of current rectangle.
 A numeric prefix argument is used as new width for the filled rectangle."
   (interactive "P")
   (cua--rectangle-aux-replace

lisp/emulation/viper-cmd.el

 ;; Quote region by each line with a user supplied string.
 (defun viper-quote-region ()
   (let ((quote-str viper-quote-string)
-	(donot-change-dafault t))
+	(donot-change-default t))
     (setq quote-str
 	  (viper-read-string-with-history
 	   "Quote string: "
 		 ((string-match "lisp.*-mode" (symbol-name major-mode)) ";;")
 		 ((memq major-mode '(c-mode cc-mode c++-mode)) "//")
 		 ((memq major-mode '(sh-mode shell-mode)) "#")
-		 (t (setq donot-change-dafault nil)
+		 (t (setq donot-change-default nil)
 		    quote-str))))
-    (or donot-change-dafault
+    (or donot-change-default
 	(setq viper-quote-string quote-str))
     (viper-enlarge-region (point) (mark t))
     (if (> (point) (mark t)) (exchange-point-and-mark))

lisp/eshell/em-rebind.el

 ;;; Functions:
 
 (defun eshell-rebind-initialize ()
-  "Initialize the inputing code."
+  "Initialize the inputting code."
   (unless eshell-non-interactive-p
     (add-hook 'eshell-mode-hook 'eshell-setup-input-keymap nil t)
     (make-local-variable 'eshell-previous-point)
       (> (tty-color-gray-shades display) 2)))))
 
 (defun read-color (&optional prompt convert-to-RGB allow-empty-name msg)
-  "Read a color name or RGB triplet of the form \"#RRRRGGGGBBBB\".
+  "Read a color name or RGB triplet.
 Completion is available for color names, but not for RGB triplets.
 
-RGB triplets have the form #XXXXXXXXXXXX, where each X is a hex
-digit.  The number of Xs must be a multiple of 3, with the same
-number of Xs for each of red, green, and blue.  The order is red,
-green, blue.
+RGB triplets have the form \"#RRGGBB\".  Each of the R, G, and B
+components can have one to four digits, but all three components
+must have the same number of digits.  Each digit is a hex value
+between 0 and F; either upper case or lower case for A through F
+are acceptable.
 
 In addition to standard color names and RGB hex values, the
 following are available as color candidates.  In each case, the

lisp/gnus/ChangeLog.2

 2003-02-02  Katsumi Yamaoka  <yamaoka@jpl.org>
 
 	* nnheader.el (nnheader-directory-separator-character): Change the
-	way to compute the dafault value.
+	way to compute the default value.
 
 2003-02-02  Jesper Harder  <harder@ifa.au.dk>
 
 (declare-function x-display-pixel-width "xfns.c" (&optional terminal))
 
 (defun gs-width-in-pt (frame pixel-width)
-  "Return, on FRAME, pixel width PIXEL-WIDTH tranlated to pt."
+  "Return, on FRAME, pixel width PIXEL-WIDTH translated to pt."
   (let ((mm (* (float pixel-width)
 	       (/ (float (x-display-mm-width frame))
 		  (float (x-display-pixel-width frame))))))
 (declare-function x-display-pixel-height "xfns.c" (&optional terminal))
 
 (defun gs-height-in-pt (frame pixel-height)
-  "Return, on FRAME, pixel height PIXEL-HEIGHT tranlated to pt."
+  "Return, on FRAME, pixel height PIXEL-HEIGHT translated to pt."
   (let ((mm (* (float pixel-height)
 	       (/ (float (x-display-mm-height frame))
 		  (float (x-display-pixel-height frame))))))

lisp/hilit-chg.el

 
 ;;;###autoload
 (define-minor-mode highlight-changes-visible-mode
-  "Toggle visiblility of highlighting due to Highlight Changes mode.
+  "Toggle visibility of highlighting due to Highlight Changes mode.
 With a prefix argument ARG, enable Highlight Changes Visible mode
 if ARG is positive, and disable it otherwise.  If called from
 Lisp, enable the mode if ARG is omitted or nil.

lisp/htmlfontify.el

             (color-values colour)
           ;;(message "[%S]" window-system)
           (x-color-values colour))
-      ;; blarg - tty colours are no good - go fetch some X colours:
+      ;; blarg - tty colors are no good - go fetch some X colors:
       (hfy-fallback-colour-values colour))))
 
 (defvar hfy-cperl-mode-kludged-p nil)

lisp/international/ccl.el

 ARG := REG | integer
 
 OPERATOR :=
-	;; Normal arithmethic operators (same meaning as C code).
+	;; Normal arithmetic operators (same meaning as C code).
 	+ | - | * | / | %
 
 	;; Bitwise operators (same meaning as C code)

lisp/language/ethio-util.el

 
 ;;;###autoload
 (defun ethio-find-file nil
-  "Transliterate file content into Ethiopic dependig on filename suffix."
+  "Transliterate file content into Ethiopic depending on filename suffix."
   (cond
 
    ((string-match "\\.sera$" (buffer-file-name))

lisp/language/lao-util.el

   "Transcribe a Romanized Lao syllable in the region FROM and TO to Lao string.
 Only the first syllable is transcribed.
 The value has the form: (START END LAO-STRING), where
-START and END are the beggining and end positions of the Roman Lao syllable,
+START and END are the beginning and end positions of the Roman Lao syllable,
 LAO-STRING is the Lao character transcription of it.
 
 Optional 3rd arg STR, if non-nil, is a string to search for Roman Lao

lisp/net/netrc.el

 ;;;###autoload
 (defun netrc-credentials (machine &rest ports)
   "Return a user name/password pair.
-Port specifications will be prioritised in the order they are
+Port specifications will be prioritized in the order they are
 listed in the PORTS list."
   (let ((list (netrc-parse))
 	found)

lisp/net/network-stream.el

   capability command, and should return the command to switch on
   STARTTLS if the server supports STARTTLS, and nil otherwise.
 
-:always-query-capabilies says whether to query the server for
+:always-query-capabilities says whether to query the server for
   capabilities, even if we're doing a `plain' network connection.
 
 :client-certificate should either be a list where the first

lisp/net/tramp-gvfs.el

 ;;   STRING		  stable_name
 ;;   STRING		  x_content_types	Since GVFS 1.0 only !!!
 ;;   STRING		  icon
-;;   STRING		  prefered_filename_encoding
+;;   STRING		  preferred_filename_encoding
 ;;   BOOLEAN		  user_visible
 ;;   ARRAY BYTE		  fuse_mountpoint
 ;;   STRUCT		  mount_spec

lisp/net/tramp.el

       (search-forward-regexp "Missing ControlMaster argument" nil t))))
 
 (defcustom tramp-default-method
-  ;; An external copy method seems to be preferred, because it is much
-  ;; more performant for large files, and it hasn't too serious delays
+  ;; An external copy method seems to be preferred, because it performs
+  ;; much better for large files, and it hasn't too serious delays
   ;; for small files.  But it must be ensured that there aren't
   ;; permanent password queries.  Either a password agent like
   ;; "ssh-agent" or "Pageant" shall run, or the optional

lisp/net/xesam.el

 
 (defun xesam-dbus-call-method (&rest args)
   "Apply a D-Bus method call.
-`dbus-call-method' is to be preferred, because it is more
-performant.  If the target D-Bus service is owned by Emacs, this
+`dbus-call-method' is preferred, because it performs better.
+If the target D-Bus service is owned by Emacs, this
 is not applicable, and `dbus-call-method-non-blocking' must be
 used instead.  ARGS are identical to the argument list of both
 functions."

lisp/progmodes/cc-defs.el

 
   (let ((saved-undo-list (elt saved-state 0)))
     (if (eq buffer-undo-list saved-undo-list)
-	;; No change was done afterall.
+	;; No change was done after all.
 	(setq buffer-undo-list (cdr saved-undo-list))
 
       (if keep

lisp/progmodes/cc-engine.el

 		       got-suffix-after-parens
 		       (eq (char-after got-suffix-after-parens) ?\())
 	      ;; Got a type, no declarator but a paren suffix. I.e. it's a
-	      ;; normal function call afterall (or perhaps a C++ style object
+	      ;; normal function call after all (or perhaps a C++ style object
 	      ;; instantiation expression).
 	      (throw 'at-decl-or-cast nil))))
 
 				    'label))
 			    (if (eq step 'up)
 				(setq placeholder (point))
-			      ;; There was no containing statement afterall.
+			      ;; There was no containing statement after all.
 			      (goto-char placeholder)))))
 		    placeholder))
 	       (if (looking-at c-block-stmt-2-key)

lisp/progmodes/vhdl-mode.el

 
   CODE BEAUTIFICATION:
     `C-c M-b' and `C-c C-b' beautify the code of a region or of the entire
-    buffer respectively.  This inludes indentation, alignment, and case
+    buffer respectively.  This includes indentation, alignment, and case
     fixing.  Code beautification can also be run non-interactively using the
     command:
 
     (list ps-mule-bitmap-prologue)))
 
 (defun ps-mule-generate-bitmap-font (font-spec size relative-compose
-					       baselie-offset bbx)
+					       baseline-offset bbx)
   (let* ((id (ps-mule-font-spec-id font-spec))
 	 (bytes (ps-mule-font-spec-bytes font-spec))
 	 output-list)
 	      (list (format "/E%02X [ 0 1 255 {pop /.notdef} for ] def\n" id)
 		    (format "%%%% %s\n" (ps-mule-font-spec-name font-spec))
 		    (format "/F%02X %f %S %d E%02X NBF\n" id size
-			    relative-compose baselie-offset id)))
+			    relative-compose baseline-offset id)))
       (setq output-list
 	    (list (list (format "/E%02X [ 0 1 255 { pop 0 } for ] def\n" id))
 		  (list (format "/V%02X [" id))
 		  (format "/F%02X E%02X V%02X NPF\n" id id id))))
     (aset ps-mule-bitmap-font-record id
 	  (vector (= bytes 1) output-list
-		  size relative-compose baselie-offset bbx))
+		  size relative-compose baseline-offset bbx))
     (if ps-mule-bitmap-dict-list
 	output-list
       (setq ps-mule-bitmap-dict-list (list "/BitmapDict <<\n" ">> def\n"))
 ;; But autoload them here to make the separation invisible.
 
 ;;;### (autoloads (ps-mule-end-job ps-mule-begin-job ps-mule-initialize
-;;;;;;  ps-multibyte-buffer) "ps-mule" "ps-mule.el" "98fcbceecff2ac603ba35672b99b5278")
+;;;;;;  ps-multibyte-buffer) "ps-mule" "ps-mule.el" "01641c7c3af4e45e1c3afeb75a73120c")
 ;;; Generated autoloads from ps-mule.el
 
 (defvar ps-multibyte-buffer nil "\
 
 ;;;###autoload
 (define-minor-mode reveal-mode
-  "Toggle decloaking of invisible text near point (Reveal mode).
+  "Toggle uncloaking of invisible text near point (Reveal mode).
 With a prefix argument ARG, enable Reveal mode if ARG is
 positive, and disable it otherwise.  If called from Lisp, enable
 Reveal mode if ARG is omitted or nil.
 
-Reveral mode is a buffer-local minor mode.  When enabled, it
+Reveal mode is a buffer-local minor mode.  When enabled, it
 reveals invisible text around point."
   :group 'reveal
   :lighter (global-reveal-mode nil " Reveal")
 in *Help* buffer.  See also the command `describe-char'."
   (interactive "P")
   (let* ((char (following-char))
-	 ;; If the character is one of LRE, LRO, RLE, RLO, it will
-	 ;; start a directional embedding, which could completely
-	 ;; disrupt the rest of the line (e.g., RLO will display the
-	 ;; rest of the line right-to-left).  So we put an invisible
-	 ;; PDF character after these characters, to end the
-	 ;; embedding, which eliminates any effects on the rest of the
-	 ;; line.
-	 (pdf (if (memq char '(?\x202a ?\x202b ?\x202d ?\x202e))
-		  (propertize (string ?\x202c) 'invisible t)
-		""))
+	 (bidi-fixer
+	  (cond ((memq char '(?\x202a ?\x202b ?\x202d ?\x202e))
+		 ;; If the character is one of LRE, LRO, RLE, RLO, it
+		 ;; will start a directional embedding, which could
+		 ;; completely disrupt the rest of the line (e.g., RLO
+		 ;; will display the rest of the line right-to-left).
+		 ;; So we put an invisible PDF character after these
+		 ;; characters, to end the embedding, which eliminates
+		 ;; any effects on the rest of the line.
+		 (propertize (string ?\x202c) 'invisible t))
+		;; Strong right-to-left characters cause reordering of
+		;; the following numerical characters which show the
+		;; codepoint, so append LRM to countermand that.
+		((memq (get-char-code-property char 'bidi-class) '(R AL))
+		 (propertize (string ?\x200e) 'invisible t))
+		(t
+		 "")))
 	 (beg (point-min))
 	 (end (point-max))
          (pos (point))
 		     (if (< char 256)
 			 (single-key-description char)
 		       (buffer-substring-no-properties (point) (1+ (point))))
-		     pdf encoding-msg pos total percent beg end col hscroll)
+		     bidi-fixer
+		     encoding-msg pos total percent beg end col hscroll)
 	  (message "Char: %s%s %s point=%d of %d (%d%%) column=%d%s"
 		   (if enable-multibyte-characters
 		       (if (< char 128)
 			   (single-key-description char)
 			 (buffer-substring-no-properties (point) (1+ (point))))
 		     (single-key-description char))
-		   pdf encoding-msg pos total percent col hscroll))))))
+		   bidi-fixer encoding-msg pos total percent col hscroll))))))
 
 ;; Initialize read-expression-map.  It is defined at C level.
 (let ((m (make-sparse-keymap)))

lisp/term/rxvt.el

 	;; 216 non-gray colors first
 	(let ((r 0) (g 0) (b 0))
 	  (while (> ncolors 24)
-	    ;; This and other formulae taken from 256colres.pl and
+	    ;; This and other formulas taken from 256colres.pl and
 	    ;; 88colres.pl in the xterm distribution.
 	    (tty-color-define (format "color-%d" (- 256 ncolors))
 			      (- 256 ncolors)

lisp/term/xterm.el

 	;; 216 non-gray colors first
 	(let ((r 0) (g 0) (b 0))
 	  (while (> ncolors 24)
-	    ;; This and other formulae taken from 256colres.pl and
+	    ;; This and other formulas taken from 256colres.pl and
 	    ;; 88colres.pl in the xterm distribution.
 	    (tty-color-define (format "color-%d" (- 256 ncolors))
 			      (- 256 ncolors)

lisp/textmodes/picture.el

 Entry to this mode calls the value of `picture-mode-hook' if non-nil.
 
 Note that Picture mode commands will work outside of Picture mode, but
-they are not defaultly assigned to keys."
+they are not by default assigned to keys."
   (interactive)
   (if (eq major-mode 'picture-mode)
       (error "You are already editing a picture")
   "Update `view-return-to-alist' of buffer BUFFER.
 Remove from `view-return-to-alist' all entries referencing dead
 windows.  Optional argument ITEM non-nil means add ITEM to
-`view-return-to-alist' after purging.  For a decsription of items
+`view-return-to-alist' after purging.  For a description of items
 that can be added see the RETURN-TO-ALIST argument of the
 function `view-mode-exit'.  If `view-return-to-alist' contains an
 entry for the selected window, purge that entry from
  */
 typedef struct _XAssoc {
 	struct _XAssoc *next;	/* Next object in this bucket. */
-	struct _XAssoc *prev;	/* Previous obejct in this bucket. */
+	struct _XAssoc *prev;	/* Previous object in this bucket. */
 	Display *display;	/* Display which owns the id. */
 	XID x_id;		/* X Window System id. */
 	void *data;		/* Pointer to untyped memory. */
  *
  */
 typedef enum _xmstyle {
-    LEFT,			/* Left oriented obejct. */
-    RIGHT,			/* Right oriented obejct. */
+    LEFT,			/* Left oriented object. */
+    RIGHT,			/* Right oriented object. */
     CENTER			/* Center oriented object. */
 } XMStyle;
 
+2011-12-05  Chong Yidong  <cyd@gnu.org>
+
+	* keyboard.c (process_special_events): New function.
+	(swallow_events, Finput_pending_p): Use it (Bug#10195).
+
+2011-12-05  Paul Eggert  <eggert@cs.ucla.edu>
+
+	* coding.c (encode_designation_at_bol): Don't use uninitialized
+	local variable (Bug#9318).
+
 2011-12-05  Kenichi Handa  <handa@m17n.org>
 
 	* ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
 			   int *charbuf, int *charbuf_end,
 			   unsigned char *dst)
 {
-  unsigned char *orig;
+  unsigned char *orig = dst;
   struct charset *charset;
   /* Table of charsets to be designated to each graphic register.  */
   int r[4];
 	  /* If REPLACE is non-nil and we succeeded in not replacing the
 	     beginning or end of the buffer text with the file's contents,
 	     call format-decode with `point' positioned at the beginning
-	     of the buffer and `inserted' equalling the number of
+	     of the buffer and `inserted' equaling the number of
 	     characters in the buffer.  Otherwise, format-decode might
 	     fail to correctly analyze the beginning or end of the buffer.
 	     Hence we temporarily save `point' and `inserted' here and
 static int ftxfont_draw_bitmap (FRAME_PTR, GC, GC *, struct font *,
                                 unsigned, int, int, XPoint *, int, int *,
                                 int);
-static void ftxfont_draw_backgrond (FRAME_PTR, struct font *, GC,
-                                    int, int, int);
+static void ftxfont_draw_background (FRAME_PTR, struct font *, GC,
+				     int, int, int);
 
 struct ftxfont_frame_data
 {
 }
 
 static void
-ftxfont_draw_backgrond (FRAME_PTR f, struct font *font, GC gc, int x, int y, int width)
+ftxfont_draw_background (FRAME_PTR f, struct font *font, GC gc, int x, int y,
+			 int width)
 {
   XGCValues xgcv;
 
 
   BLOCK_INPUT;
   if (with_background)
-    ftxfont_draw_backgrond (f, font, s->gc, x, y, s->width);
+    ftxfont_draw_background (f, font, s->gc, x, y, s->width);
   code = alloca (sizeof (unsigned) * len);
   for (i = 0; i < len; i++)
     code[i] = ((XCHAR2B_BYTE1 (s->char2b + from + i) << 8)
 				       Lisp_Object);
 static void handle_interrupt (void);
 static void quit_throw_to_read_char (int) NO_RETURN;
+static void process_special_events (void);
 static void timer_start_idle (void);
 static void timer_stop_idle (void);
 static void timer_resume_idle (void);
   return (obj);
 }
 
-/* Process any events that are not user-visible,
-   then return, without reading any user-visible events.  */
-
-void
-swallow_events (int do_display)
-{
-  int old_timers_run;
-
+/* Process any non-user-visible events (currently X selection events),
+   without reading any user-visible events.  */
+
+static void
+process_special_events (void)
+{
   while (kbd_fetch_ptr != kbd_store_ptr)
     {
       struct input_event *event;
       else
 	break;
     }
+}
+
+/* Process any events that are not user-visible, run timer events that
+   are ripe, and return, without reading any user-visible events.  */
+
+void
+swallow_events (int do_display)
+{
+  int old_timers_run;
+
+  process_special_events ();
 
   old_timers_run = timers_run;
   get_input_pending (&input_pending, READABLE_EVENTS_DO_TIMERS_NOW);
       || !NILP (Vunread_input_method_events))
     return (Qt);
 
+  /* Process non-user-visible events (Bug#10195).  */
+  process_special_events ();
+
   get_input_pending (&input_pending,
 		     READABLE_EVENTS_DO_TIMERS_NOW
 		     | READABLE_EVENTS_FILTER_EVENTS);
     }
   else
     {
-      /* Scolling down.  Make sure we don't copy over the mode line.
+      /* Scrolling down.  Make sure we don't copy over the mode line.
 	 at the bottom.  */
       if (to_y + run->height > bottom_y)
 	height = bottom_y - to_y;
 	(HAVE_WCTYPE_H && HAVE_WCHAR_H && HAVE_BTOWC && !emacs)
 #endif
 
-/* For platform which support the ISO C amendement 1 functionality we
+/* For platform which support the ISO C amendment 1 functionality we
    support user defined character classes.  */
 #if WIDE_CHAR_SUPPORT
 /* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>.  */
 }
 #endif	/* C++ */
 
-/* For platform which support the ISO C amendement 1 functionality we
+/* For platform which support the ISO C amendment 1 functionality we
    support user defined character classes.  */
 #if WIDE_CHAR_SUPPORT
 /* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>.  */
 
 #if WIDE_CHAR_SUPPORT
 /* The GNU C library provides support for user-defined character classes
-   and the functions from ISO C amendement 1.  */
+   and the functions from ISO C amendment 1.  */
 # ifdef CHARCLASS_NAME_MAX
 #  define CHAR_CLASS_MAX_LENGTH CHARCLASS_NAME_MAX
 # else
 
 DEFUN ("text-property-any", Ftext_property_any,
        Stext_property_any, 4, 5, 0,
-       doc: /* Check text from START to END for property PROPERTY equalling VALUE.
+       doc: /* Check text from START to END for property PROPERTY equaling VALUE.
 If so, return the position of the first character whose property PROPERTY
 is `eq' to VALUE.  Otherwise return nil.
 If the optional fifth argument OBJECT is a buffer (or nil, which means
 
 DEFUN ("text-property-not-all", Ftext_property_not_all,
        Stext_property_not_all, 4, 5, 0,
-       doc: /* Check text from START to END for property PROPERTY not equalling VALUE.
+       doc: /* Check text from START to END for property PROPERTY not equaling VALUE.
 If so, return the position of the first character whose property PROPERTY
 is not `eq' to VALUE.  Otherwise, return nil.
 If the optional fifth argument OBJECT is a buffer (or nil, which means
  *
  * When copying or cutting (sending data to the OS), the data is
  * announced and stored internally, but only actually rendered on
- * request.  The requester determines the format provided.  The
+ * request.  The requestor determines the format provided.  The
  * {next-}selection-coding-system is only used, when its corresponding
  * clipboard type matches the type requested.
  *
 
   OpenClipboard (NULL);
 
-  /* There is no usefull means to report errors here, there are none
+  /* There is no useful means to report errors here, there are none
      expected anyway, and even if there were errors, they wouldn't do
      any harm.  So we just go ahead and do what has to be done without
      bothering with error handling.  */
       else
 	{
 	  /* Advertise all supported formats so that whatever the
-	     requester chooses, only one encoding step needs to be
+	     requestor chooses, only one encoding step needs to be
 	     made.  This is intentionally different from what we do in
 	     the handler for WM_RENDERALLFORMATS.  */
 	  SetClipboardData (CF_UNICODETEXT, NULL);
 
   clipboard_owner = create_owner ();
 }
-
     }
   else
     {
-      /* Scolling down.  Make sure we don't copy over the mode line.
+      /* Scrolling down.  Make sure we don't copy over the mode line.
 	 at the bottom.  */
       if (to_y + run->height > bottom_y)
 	height = bottom_y - to_y;
 	 environments with anti-aliased text: if the same text is
 	 drawn onto the same place multiple times, it gets thicker.
 	 If the overlap we are processing is for the erased cursor, we
-	 take the intersection with the rectagle of the cursor.  */
+	 take the intersection with the rectangle of the cursor.  */
       if (s->for_overlaps & OVERLAPS_ERASED_CURSOR)
 	{
 	  XRectangle rc, r_save = r;
 static Atom conversion_fail_tag;
 
 /* Used as an unwind-protect clause so that, if a selection-converter signals
-   an error, we tell the requester that we were unable to do what they wanted
+   an error, we tell the requestor that we were unable to do what they wanted
    before we throw to top-level or go into the debugger or whatever.  */
 
 static Lisp_Object
 	bytes_remaining = cs->size;
 	bytes_remaining *= format_bytes;
 
-	/* Wait for the requester to ack by deleting the property.
+	/* Wait for the requestor to ack by deleting the property.
 	   This can run Lisp code (process handlers) or signal.  */
 	if (! had_errors)
 	  {
 
 	    if (had_errors) break;
 
-	    /* Wait for the requester to ack this chunk by deleting
+	    /* Wait for the requestor to ack this chunk by deleting
 	       the property.  This can run Lisp code or signal.  */
 	    TRACE1 ("Waiting for increment ACK (deletion of %s)",
 		    XGetAtomName (display, cs->property));
 	  }
 
 	/* Now write a zero-length chunk to the property to tell the
-	   requester that we're done.  */
+	   requestor that we're done.  */
 	BLOCK_INPUT;
 	if (! waiting_for_other_props_on_window (display, window))
 	  XSelectInput (display, window, 0L);
     }
   else
     {
-      /* Scolling down.  Make sure we don't copy over the mode line.
+      /* Scrolling down.  Make sure we don't copy over the mode line.
 	 at the bottom.  */
       if (to_y + run->height > bottom_y)
 	height = bottom_y - to_y;