changeset 107741:0e10810ea0f9

Merge from trunk
author Jan D. <jan.h.d@swipnet.se>
date Thu, 01 Apr 2010 08:50:44 +0200
parents cc6fa055586c (current diff) 0e2821d60d4c (diff)
children db1729fac410
files etc/NEWS.23 lisp/progmodes/gdb-ui.el test/cedet/tests/scopetest.cpp test/cedet/tests/scopetest.java test/cedet/tests/templates.cpp test/cedet/tests/test.cpp test/cedet/tests/test.py test/cedet/tests/teststruct.cpp test/cedet/tests/testtemplates.cpp test/cedet/tests/testusing.cpp test/cedet/tests/testusing.hh
diffstat 124 files changed, 11775 insertions(+), 9209 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Mar 26 08:01:19 2010 +0100
+++ b/ChangeLog	Thu Apr 01 08:50:44 2010 +0200
@@ -1,3 +1,12 @@
+2010-03-30  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* configure.in: Remove all references to C_DEBUG_SWITCH.
+
+2010-03-27  Eli Zaretskii  <eliz@gnu.org>
+
+	* config.bat <lib-src>: Edit out lines that begin with several #
+	characters.
+
 2010-03-20  Dan Nicolaescu  <dann@ics.uci.edu>
 
 	* configure.in: Remove support for old UNIX System V systems and
--- a/admin/CPP-DEFINES	Fri Mar 26 08:01:19 2010 +0100
+++ b/admin/CPP-DEFINES	Thu Apr 01 08:50:44 2010 +0200
@@ -106,7 +106,6 @@
 CLASH_DETECTION
 COFF_BSD_SYMBOLS
 CRT0_DUMMIES
-C_DEBUG_SWITCH
 C_SWITCH_MACHINE
 C_SWITCH_SYSTEM
 C_SWITCH_SYSTEM_TEMACS
@@ -234,7 +233,6 @@
 LD_SWITCH_SYSTEM_TEMACS
 LD_SWITCH_SYSTEM_tmp
 LD_SWITCH_X_DEFAULT
-LIBS_DEBUG
 LIBS_MACHINE
 LIBS_SYSTEM
 LIBS_TERMCAP
--- a/config.bat	Fri Mar 26 08:01:19 2010 +0100
+++ b/config.bat	Thu Apr 01 08:50:44 2010 +0200
@@ -222,7 +222,7 @@
 Echo Configuring the library source directory...
 cd lib-src
 rem   Create "makefile" from "makefile.in".
-sed -e "1,/== start of cpp stuff ==/s@^#[ 	].*$@@" <Makefile.in >junk.c
+sed -e "1,/== start of cpp stuff ==/s@^##*[ 	].*$@@" <Makefile.in >junk.c
 gcc -E -traditional -I. -I../src junk.c | sed -e "s/^ /	/" -e "/^#/d" -e "/^[ 	]*$/d" >makefile.new
 If "%DJGPP_VER%" == "2" goto libsrc-v2
 sed -f ../msdos/sed3.inp <makefile.new >Makefile
--- a/configure.in	Fri Mar 26 08:01:19 2010 +0100
+++ b/configure.in	Thu Apr 01 08:50:44 2010 +0200
@@ -888,10 +888,6 @@
 configure___ use_mmap_for_buffers=no
 #endif
 
-#ifndef C_DEBUG_SWITCH
-#define C_DEBUG_SWITCH -g
-#endif
-
 #ifndef C_OPTIMIZE_SWITCH
 #ifdef __GNUC__
 #define C_OPTIMIZE_SWITCH -O2
@@ -923,18 +919,18 @@
 
 /* Get the CFLAGS for tests in configure.  */
 #ifdef __GNUC__
-configure___ CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '${SPECIFIED_CFLAGS}'
+configure___ CFLAGS=C_OPTIMIZE_SWITCH '${SPECIFIED_CFLAGS}'
 #else
-configure___ CFLAGS=C_DEBUG_SWITCH '${SPECIFIED_CFLAGS}'
+configure___ CFLAGS='${SPECIFIED_CFLAGS}'
 #endif
 
 #else /* not THIS_IS_CONFIGURE */
 
 /* Get the CFLAGS for real compilation.  */
 #ifdef __GNUC__
-configure___ REAL_CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH C_WARNINGS_SWITCH ${PROFILING_CFLAGS} '${SPECIFIED_CFLAGS}'
+configure___ REAL_CFLAGS=C_OPTIMIZE_SWITCH C_WARNINGS_SWITCH ${PROFILING_CFLAGS} '${SPECIFIED_CFLAGS}'
 #else
-configure___ REAL_CFLAGS=C_DEBUG_SWITCH '${SPECIFIED_CFLAGS}'
+configure___ REAL_CFLAGS='${SPECIFIED_CFLAGS}'
 #endif
 
 #endif /* not THIS_IS_CONFIGURE */
--- a/doc/emacs/ChangeLog	Fri Mar 26 08:01:19 2010 +0100
+++ b/doc/emacs/ChangeLog	Thu Apr 01 08:50:44 2010 +0200
@@ -1,3 +1,81 @@
+2010-03-30  Eli Zaretskii  <eliz@gnu.org>
+
+	* mule.texi (Input Methods): Mention "C-x 8 RET" and add a
+	cross-reference to "Inserting Text".
+
+	* basic.texi (Inserting Text): Add an index entry for "C-x 8 RET".
+	Mention completion provided by `ucs-insert'.
+
+2010-03-30  Chong Yidong  <cyd@stupidchicken.com>
+
+	* sending.texi (Sending Mail): Note variables that may need
+	customizing.
+	(Mail Sending): Expand discussion of send-mail-function.
+
+2010-03-30  Chong Yidong  <cyd@stupidchicken.com>
+
+	Document Message mode as the default mail mode.
+
+	* sending.texi (Sending Mail): Copyedits.
+	(Mail Format, Mail Headers): Document mail-from-style changes.
+	(Mail Commands): Rename from Mail mode.  Document Message mode.
+	(Mail Misc): Rename from Mail mode Misc.
+	(Mail Sending, Header Editing, Mail Misc): Switch to Message mode
+	command names and update keybindings.
+	(Header Editing): Document message-tab.  De-document
+	mail-self-blind, mail-default-reply-to, and mail-archive-file-name in
+	favor of mail-default-headers.  Ad index entries for user-full-name and
+	user-mail-address.
+	(Citing Mail): Update changes in Message mode behavior.  Document
+	mail-yank-prefix.
+	(Mail Signature): New node, moved from Mail Misc.
+	(Mail Aliases): Mail abbrevs are the default with Message mode.
+	(Mail Methods): Note that Message mode is now the default.
+
+	* rmail.texi (Rmail Reply):
+	* text.texi (Text Mode):
+	* major.texi (Major Modes):
+	* mule.texi (Output Coding): Refer to Message mode.
+
+	* custom.texi (Init Examples): Add xref to Mail Header.
+
+	* emacs.texi (Top):  Fix xrefs.
+
+2010-03-30  Chong Yidong  <cyd@stupidchicken.com>
+
+	* maintaining.texi (VC With A Merging VCS): C-x v v now creates a
+	repository if there is none.
+	(VC Change Log): Rename from VC Status.  Document vc-log-show-limit and
+	vc-print-root-log.
+	(Old Revisions): Copyedits.  Document vc-root-diff.
+
+	* programs.texi (Program Modes): Mention Javascript mode.
+
+	* text.texi (HTML Mode): Note that nXML is now the default XML mode.
+	* emacs.texi: Update node description.
+
+	* misc.texi (Navigation): Document doc-view-continuous.
+	(Shell Ring): Document new M-r binding.  M-s is no longer bound.
+
+2010-03-30  Juri Linkov  <juri@jurta.org>
+
+	* search.texi (Other Repeating Search): Remove line that `occur'
+	can not handle multiline matches.
+
+2010-03-30  Eli Zaretskii  <eliz@gnu.org>
+
+	* mule.texi (International): Mention support of bidirectional editing.
+	(Bidirectional Editing): New section.
+
+2010-03-28  Nick Roberts  <nickrob@snap.net.nz>
+
+	* emacs.texi (Top): Update node names to those in building.texi.
+
+2010-03-27  Nick Roberts  <nickrob@snap.net.nz>
+
+	doc/emacs/building.texi: Describe restored GDB/MI fuctionality removed by r99212.
+	doc/emacs/emacs.texi: Update node names for building.texi.
+
 2010-03-24  Glenn Morris  <rgm@gnu.org>
 
 	* ack.texi (Acknowledgments):
--- a/doc/emacs/basic.texi	Fri Mar 26 08:01:19 2010 +0100
+++ b/doc/emacs/basic.texi	Thu Apr 01 08:50:44 2010 +0200
@@ -100,13 +100,15 @@
 character to insert (@pxref{Arguments}).
 
 @findex ucs-insert
+@kindex C-x 8 RET
 @cindex Unicode
   Instead of @kbd{C-q}, you can use @kbd{C-x 8 @key{RET}}
 (@code{ucs-insert}) to insert a character based on its Unicode name or
 code-point.  This commands prompts for a character to insert, using
 the minibuffer; you can specify the character using either (i) the
 character's name in the Unicode standard, or (ii) the character's
-code-point in the Unicode standard.
+code-point in the Unicode standard.  If you specify the character's
+name, the command provides completion.
 
 @node Moving Point
 @section Changing the Location of Point
--- a/doc/emacs/building.texi	Fri Mar 26 08:01:19 2010 +0100
+++ b/doc/emacs/building.texi	Thu Apr 01 08:50:44 2010 +0200
@@ -853,18 +853,19 @@
 multiple programs within one Emacs session.
 
 @menu
-* GDB-UI Layout::               Control the number of displayed buffers.
+* GDB User Interface Layout::   Control the number of displayed buffers.
 * Source Buffers::              Use the mouse in the fringe/margin to
                                 control your program.
 * Breakpoints Buffer::          A breakpoint control panel.
+* Threads Buffer::              Displays your threads.
 * Stack Buffer::                Select a frame from the call stack.
-* Other GDB-UI Buffers::        Input/output, locals, registers,
+* Other GDB Buffers::           Input/output, locals, registers,
                                 assembler, threads and memory buffers.
 * Watch Expressions::           Monitor variable values in the speedbar.
-* Reverse Debugging::           Execute and reverse debug your program.
+* Multithreaded Debugging::     Debugging programs with several threads.
 @end menu
 
-@node GDB-UI Layout
+@node GDB User Interface Layout
 @subsubsection GDB User Interface Layout
 @cindex GDB User Interface layout
 
@@ -1014,10 +1015,92 @@
 Visit the source line for the breakpoint you click on.
 @end table
 
+@vindex gdb-show-threads-by-default
 When @code{gdb-many-windows} is non-@code{nil}, the breakpoints buffer
 shares its window with the threads buffer.  To switch from one to the
 other click with @kbd{Mouse-1} on the relevant button in the header
-line.
+line.  If @code{gdb-show-threads-by-default} is non-@code{nil}, the
+threads buffer, rather than the breakpoints buffer, is shown at start
+up.
+
+@node Threads Buffer
+@subsubsection Threads Buffer
+
+@findex gdb-select-thread
+The threads buffer displays a summary of all threads currently in your
+program (@pxref{Threads, Threads, Debugging programs with multiple
+threads, gdb, The GNU debugger}).  Move point to any thread in the list
+and press @key{RET} to select it (@code{gdb-select-thread}) and
+display the associated source in the primary source buffer.
+Alternatively, click @kbd{Mouse-2} on a thread to select it.  Contents
+of all GDB buffers are updated whenever you select a thread.
+
+  You can customize variables under @code{gdb-buffers} group to select
+fields included in threads buffer.
+
+@table @code
+@item gdb-thread-buffer-verbose-names
+@vindex gdb-thread-buffer-verbose-names
+Show long thread names like @samp{Thread 0x4e2ab70 (LWP 1983)} in
+threads buffer.
+
+@item gdb-thread-buffer-arguments
+@vindex gdb-thread-buffer-arguments
+Show arguments of thread top frames in threads buffer.
+
+@item gdb-thread-buffer-locations
+@vindex gdb-thread-buffer-locations
+Show file information or library names in threads buffer.
+
+@item gdb-thread-buffer-addresses
+@vindex gdb-thread-buffer-addresses
+Show addresses for thread frames in threads buffer.
+@end table
+
+  It’s possible to observe information for several threads
+simultaneously (in addition to buffers which show information for
+currently selected thread) using the following keys from the threads
+buffer.
+
+@table @kbd
+@item d
+@kindex d @r{(GDB threads buffer)}
+@findex gdb-display-disassembly-for-thread
+Display disassembly buffer for the thread at current line.
+(@code{gdb-display-disassembly-for-thread})
+
+@item f
+@kindex f @r{(GDB threads buffer)}
+@findex gdb-display-stack-for-thread
+Display stack buffer for the thread at current line.
+(@code{gdb-display-stack-for-thread}).
+
+@item l
+@kindex l @r{(GDB threads buffer)}
+@findex gdb-display-locals-for-thread
+Display locals buffer for the thread at current line.
+(@code{gdb-display-locals-for-thread}).
+
+@item r
+@kindex r @r{(GDB threads buffer)}
+@findex gdb-display-registers-for-thread
+Display registers buffer for the thread at current line.
+(@code{gdb-display-registers-for-thread}).
+@end table
+
+Pressing their upper-case counterparts, @kbd{D}, @kbd{F} ,@kbd{L} and
+@kbd{R} displays the corresponding buffer in a new frame.
+
+  When you create a buffer showing information about some specific
+thread, it becomes bound to that thread and keeps showing actual
+information while you debug your program.  Every GDB buffer contains a
+number of thread it shows information for in its mode name.  Thread
+number is also included in the buffer name of bound buffers to prevent
+buffer names clashing.
+
+Further commands are available in the threads buffer which depend on the
+mode of GDB that is used for controlling execution of your program.
+(@pxref{Multithreaded Debugging, Stopping and Starting Multi-threaded Programs}).
 
 @node Stack Buffer
 @subsubsection Stack Buffer
@@ -1035,7 +1118,7 @@
 selecting a stack frame updates it to display the local variables of the
 new frame.
 
-@node Other GDB-UI Buffers
+@node Other GDB Buffers
 @subsubsection Other Buffers
 
 @table @asis
@@ -1079,21 +1162,6 @@
 breakpoints as in a source buffer.  Breakpoint icons also appear in
 the fringe or margin.
 
-@item Threads Buffer
-@findex gdb-threads-select
-The threads buffer displays a summary of all threads currently in your
-program (@pxref{Threads, Threads, Debugging programs with multiple
-threads, gdb, The GNU debugger}).  Move point to any thread in the
-list and press @key{RET} to select it (@code{gdb-threads-select}) and
-display the associated source in the primary source buffer.
-Alternatively, click @kbd{Mouse-2} on a thread to select it.  If the
-locals buffer is visible, its contents update to display the variables
-that are local in the new thread.
-
-When there is more than one main thread and the threads buffer is
-present, Emacs displays the selected thread number in the mode line of
-many of the GDB-UI Buffers.
-
 @item Memory Buffer
 The memory buffer lets you examine sections of program memory
 (@pxref{Memory, Memory, Examining memory, gdb, The GNU debugger}).
@@ -1104,9 +1172,9 @@
 size for these data items.
 @end table
 
-When @code{gdb-many-windows} is non-@code{nil}, the threads buffer
-shares its window with the breakpoints buffer, and the locals buffer
-with the registers buffer.  To switch from one to the other click with
+When @code{gdb-many-windows} is non-@code{nil}, the locals buffer
+shares its window with the registers buffer, just like breakpoints
+and threads buffers. To switch from one to the other click with
 @kbd{Mouse-1} on the relevant button in the header line.
 
 @node Watch Expressions
@@ -1175,26 +1243,96 @@
 non-@code{nil}.  This can be useful if you are debugging with a full
 screen Emacs frame.
 
-@node Reverse Debugging
-@subsubsection Reverse Debugging
+@node Multithreaded Debugging
+@subsubsection Stopping and Starting Multi-threaded Programs
+@cindex Multithreaded debugging in GDB
+
+@subsubheading All-stop Debugging
+
+In all-stop mode, whenever your program stops, @emph{all} threads of
+execution stop.  Likewise, whenever you restart the program, all
+threads start executing.  @xref{All-Stop Mode, , All-Stop Mode, gdb,
+The GNU debugger}.  You can enable this behaviour in Emacs by setting
+@code{gdb-non-stop-setting} to @code{nil} before starting a debugging
+session.
+
+@subsubheading Non-stop Debugging
+@cindex Non-stop debugging in GDB
+
+For some multi-threaded targets, GDB supports a further mode of
+operation in which you can examine stopped program threads in the
+debugger while other threads continue to execute freely.
+@xref{Non-Stop Mode, , Non-Stop Mode, gdb, The GNU debugger}.
+This is referred to as @dfn{non-stop} mode.
+
+Versions of GDB prior to 7.0 do not support non-stop mode and it does
+not work on all targets.  In such cases, Emacs uses all-stop mode
+regardless of the value of @code{gdb-non-stop-setting}.
+
+@vindex gdb-non-stop-setting
+If the variable @code{gdb-non-stop-setting} is non-@code{nil} (the
+default value), Emacs tries to start GDB in non-stop mode.  Note that
+GDB debugging session needs to be restarted for change of this setting
+to take effect.
+
+@vindex gdb-switch-when-another-stopped
+When a thread stops in non-stop mode, Emacs automatically switches to
+that thread.  It may be undesirable to allow switching of current
+thread when some other stopped thread is already selected.  Set
+@code{gdb-switch-when-another-stopped} to @code{nil} to prevent this.
+
+@vindex gdb-switch-reasons
+Emacs can decide whether or not to switch to the stopped thread
+depending on the reason which caused the stop.  Customize
+@code{gdb-switch-reasons} to select stop reasons which make Emacs
+switch thread.
 
-  The GDB tool bar shares many buttons with the other GUD debuggers
-for tasks like stepping and printing expressions.  It also has a
-further set of buttons that allow reverse debugging (@pxref{Process
-Record and Replay, , ,gdb, The GNU debugger}).  This is useful when it
-takes a long time to reproduce the conditions where your program fails
-or for transient problems, like race conditions in multi-threaded
-programs, where a failure might otherwise be hard to reproduce.
+@vindex gdb-stopped-hooks
+The variable @code{gdb-stopped-hooks} allows you to execute your
+functions whenever some thread stops.
+
+  In non-stop mode, you can switch between different modes for GUD
+execution control commands.
+
+@vindex gdb-gud-control-all-threads
+@table @dfn
+@item Non-stop/A
+
+When @code{gdb-gud-control-all-threads} is @code{t} (the default
+value), interruption and continuation commands apply to all threads,
+so you can halt or continue all your threads with one command using
+@code{gud-stop-subjob} and @code{gud-cont}, respectively.  The
+@samp{Go} button is shown on the toolbar when at least one thread is
+stopped, whereas @samp{Stop} button is shown when at least one thread
+is running.
+
+@item Non-stop/T
 
-To use reverse debugging, set a breakpoint slightly before the
-location of interest and run your program to that point.  Enable
-process recording by clicking on the record button.  At this point, a
-new set of buttons appear.  These buttons allow program execution in
-the reverse direction.  Run your program over the code where the
-problem occurs, and then use the new set of buttons to retrace your
-steps, examine values, and analyze the problem.  When analysis is
-complete, turn off process recording by clicking on the record button
-again.
+When @code{gdb-gud-control-all-threads} is @code{nil}, only the
+current thread is stopped/continued.  @samp{Go} and @samp{Stop}
+buttons on the GUD toolbar are shown depending on the state of current
+thread.
+@end table
+
+You can change the current value of @code{gdb-gud-control-all-threads}
+from the tool bar or from @samp{GUD->GDB-MI} menu.
+
+  Stepping commands always apply to the current thread.
+
+@subsubheading Fine Thread Control
+
+  In non-stop mode, you can interrupt/continue your threads without
+selecting them.  Hitting @kbd{i} in threads buffer interrupts thread
+under point, @kbd{c} continues it, @kbd{s} steps through.  More such
+commands may be added in the future.
+
+Combined with creating bound buffers for any thread, this allows you
+to change and track state of many threads in the same time.
+
+  Note that when you interrupt a thread, it stops with @samp{signal
+received} reason.  If that reason is included in your
+@code{gdb-switch-reasons} (it is by default), Emacs will switch to
+that thread.
 
 @node Executing Lisp
 @section Executing Lisp Expressions
--- a/doc/emacs/custom.texi	Fri Mar 26 08:01:19 2010 +0100
+++ b/doc/emacs/custom.texi	Thu Apr 01 08:50:44 2010 +0200
@@ -2269,8 +2269,9 @@
 (setq user-mail-address "cheney@@torture.gov")
 @end example
 
-Various Emacs packages that need your own email address use the value of
-@code{user-mail-address}.
+Various Emacs packages, such as Message mode, consult
+@code{user-mail-address} when they need to know your email address.
+@xref{Mail Headers}.
 
 @item
 Make Text mode the default mode for new buffers.
--- a/doc/emacs/emacs.texi	Fri Mar 26 08:01:19 2010 +0100
+++ b/doc/emacs/emacs.texi	Thu Apr 01 08:50:44 2010 +0200
@@ -574,7 +574,7 @@
 * Text Mode::	        The major modes for editing text files.
 * Outline Mode::        Editing outlines.
 * TeX Mode::	        Editing input to the formatter TeX.
-* HTML Mode::           Editing HTML, SGML, and XML files.
+* HTML Mode::           Editing HTML and SGML files.
 * Nroff Mode::	        Editing input to the formatter nroff.
 * Formatted Text::      Editing formatted text directly in WYSIWYG fashion.
 * Text Based Tables::   Editing text-based tables in WYSIWYG fashion.
@@ -746,14 +746,16 @@
 
 GDB Graphical Interface
 
-* GDB-UI Layout::       Control the number of displayed buffers.
-* Source Buffers::      Use the mouse in the fringe/margin to
-                          control your program.
-* Breakpoints Buffer::  A breakpoint control panel.
-* Stack Buffer::        Select a frame from the call stack.
-* Other GDB-UI Buffers::Input/output, locals, registers,
-                          assembler, threads and memory buffers.
-* Watch Expressions::   Monitor variable values in the speedbar.
+* GDB User Interface Layout::   Control the number of displayed buffers.
+* Source Buffers::              Use the mouse in the fringe/margin to
+                                control your program.
+* Breakpoints Buffer::          A breakpoint control panel.
+* Threads Buffer::              Displays your threads.
+* Stack Buffer::                Select a frame from the call stack.
+* Other GDB Buffers::           Input/output, locals, registers,
+                                assembler, threads and memory buffers.
+* Watch Expressions::           Monitor variable values in the speedbar.
+* Multithreaded Debugging::     Debugging programs with several threads.
 
 Maintaining Large Programs
 
@@ -794,7 +796,7 @@
 The Secondary Commands of VC
 
 * Registering::         Putting a file under version control.
-* VC Status::           Viewing the VC status of files.
+* VC Change Log::       Viewing the VC Change Log.
 * VC Undo::             Canceling changes before or after check-in.
 
 VC Directory Mode
@@ -886,16 +888,17 @@
 * Mail Format:: 	Format of the mail being composed.
 * Mail Headers::        Details of some standard mail header fields.
 * Mail Aliases::        Abbreviating and grouping mail addresses.
-* Mail Mode::   	Special commands for editing mail being composed.
+* Mail Commands::   	Special commands for editing mail being composed.
+* Mail Signature::      Adding a signature to every message.
 * Mail Amusements::     Distracting the NSA; adding fortune messages.
 * Mail Methods::        Using alternative mail-composition methods.
 
-Mail Mode
+Mail Commands
 
 * Mail Sending::        Commands to send the message.
 * Header Editing::      Commands to move to header fields and edit them.
-* Citing Mail::         Copying all or part of a message you are replying to.
-* Mail Mode Misc::      Spell checking, signatures, etc.
+* Citing Mail::         Quoting a message you are replying to.
+* Mail Misc::           Attachments, spell checking, etc.
 
 Reading Mail with Rmail
 
--- a/doc/emacs/maintaining.texi	Fri Mar 26 08:01:19 2010 +0100
+++ b/doc/emacs/maintaining.texi	Thu Apr 01 08:50:44 2010 +0200
@@ -224,7 +224,7 @@
 @cindex revision
 @cindex revision ID
   A copy of a file stored in a repository is called a @dfn{revision}.
-The history of a file is a sequence of revisions.  Each revisions is
+The history of a file is a sequence of revisions.  Each revision is
 named by a @dfn{revision ID}.  The format of the revision ID depends
 on the version control system; in the simplest case, it is just an
 integer.
@@ -403,10 +403,10 @@
 consists of the marked files (@pxref{VC Directory Mode}).
 
   The principal VC command is an all-purpose command, @kbd{C-x v v}
-(@code{vc-next-action}), that performs either locking, merging or a
-check-in (depending on the situation) on the current VC fileset.  You
-can use @kbd{C-x v v} in a file-visiting buffer or in a VC Directory
-buffer.
+(@code{vc-next-action}), that performs either registration, locking,
+merging or a check-in (depending on the situation) on the current VC
+fileset.  You can use @kbd{C-x v v} in a file-visiting buffer or in a
+VC Directory buffer.
 
 @table @kbd
 @itemx C-x v v
@@ -461,23 +461,31 @@
 
 @itemize @bullet
 @item
-If the work file is the same as in the repository, it does nothing.
+If the work file is in a directory that is not controlled by any
+version control system, prompt for a repository type.  Then, create a
+version control repository of that type and register the file with it.
+
+@item
+If the work file is in a directory that is controlled by a version
+control system but not registered with it, register the file.
+
+@item
+If the work file is the same as in the repository, do nothing.
 
 @item
 If you have not changed the work file, but some other user has checked
-in changes to the repository, @kbd{C-x v v} merges those changes into
-the work file.
+in changes to the repository, merge those changes into the work file.
 
 @item
-If you have made modifications to the work file, @kbd{C-x v v}
-attempts to check in your changes.  To do this, Emacs first reads the
-log entry for the new revision (@pxref{Log Buffer}).  If some other
-user has checked in changes to the repository since you last checked
-it out, the checkin fails.  In that case, type @kbd{C-x v v} again to
-merge those changes into your own work file; this puts the work file
-into a ``conflicted'' state.  Type @kbd{C-x v v} to clear the
-``conflicted'' state; VC then regards the file as up-to-date and
-modified, and you can try to check it in again.
+If you have made modifications to the work file, attempts to check in
+your changes.  To do this, Emacs first reads the log entry for the new
+revision (@pxref{Log Buffer}).  If some other user has checked in
+changes to the repository since you last checked it out, the checkin
+fails.  In that case, type @kbd{C-x v v} again to merge those changes
+into your own work file; this puts the work file into a ``conflicted''
+state.  Type @kbd{C-x v v} to clear the ``conflicted'' state; VC then
+regards the file as up-to-date and modified, and you can try to check
+it in again.
 
 To pick up any recent changes from the repository @emph{without}
 trying to commit your own changes, type @kbd{C-x v m @key{RET}}.
@@ -485,15 +493,15 @@
 @end itemize
 
   These rules also apply when you use RCS in its ``non-locking'' mode,
-except that changes will not be automatically merged from the
-repository.  Nothing informs you if another user has checked in
-changes in the same file since you began editing it; when you check in
-your revision, his changes are removed (however, they remain in the
-repository and are thus not irrevocably lost).  Therefore, you must
-verify that the current revision is unchanged before checking in your
-changes.  In addition, locking is possible with RCS even in this mode:
-@kbd{C-x v v} with an unmodified file locks the file, just as it does
-with RCS in its normal locking mode (@pxref{VC With A Locking VCS}).
+except that changes are not automatically merged from the repository.
+Nothing informs you if another user has checked in changes in the same
+file since you began editing it; when you check in your revision, his
+changes are removed (however, they remain in the repository and are
+thus not irrevocably lost).  Therefore, you must verify that the
+current revision is unchanged before checking in your changes.  In
+addition, locking is possible with RCS even in this mode: @kbd{C-x v
+v} with an unmodified file locks the file, just as it does with RCS in
+its normal locking mode (@pxref{VC With A Locking VCS}).
 
 @node VC With A Locking VCS
 @subsubsection Basic Version Control with Locking
@@ -501,26 +509,25 @@
   Under a locking-based version control system (such as SCCS, and RCS
 in its default mode), @kbd{C-x v v} does the following:
 
- @itemize @bullet
+@itemize @bullet
 @item
-If the file is not locked, @kbd{C-x v v} locks it, and makes it
-writable so that you can change it.
+If the file is not locked, lock it and make it writable, so that you
+can change it.
 
 @item
-If the file is locked by you, and contains changes, @kbd{C-x v v}
-checks in the changes.  In order to do this, it first reads the log
-entry for the new revision.  @xref{Log Buffer}.
+If the file is locked by you, and contains changes, check in the
+changes.  In order to do this, Emacs first reads the log entry for the
+new revision.  @xref{Log Buffer}.
 
 @item
 If the file is locked by you, but you have not changed it since you
-locked it, @kbd{C-x v v} releases the lock and makes the file
-read-only again.
+locked it, release the lock and makes the file read-only again.
 
 @item
-If the file is locked by some other user, @kbd{C-x v v} asks you whether
-you want to ``steal the lock'' from that user.  If you say yes, the file
-becomes locked by you, but a message is sent to the person who had
-formerly locked the file, to inform him of what has happened.
+If the file is locked by some other user, ask whether you want to
+``steal the lock'' from that user.  If you say yes, the file becomes
+locked by you, but a message is sent to the person who had formerly
+locked the file, to inform him of what has happened.
 @end itemize
 
   These rules also apply when you use CVS in locking mode, except
@@ -639,20 +646,23 @@
 to examine any revision of a file, or compare two revisions.
 
 @table @kbd
-@item C-x v ~ @var{revision} @key{RET}
-Examine revision @var{revision} of the visited file, in a buffer of its
-own.
+@item C-x v ~
+Prompt for a revision of the current file, and visit it in a buffer of
+its own (@code{vc-revision-other-window}).
 
 @item C-x v =
-Compare the buffer contents associated with the current
-fileset with the working revision(s) from which you started editing.
+Compare the files in the current fileset with the working revision(s)
+you started from (@code{vc-diff}).  With a prefix argument, prompt for
+two revisions of the current fileset and compare them.
 
-@item C-u C-x v = @key{RET} @var{oldvers} @key{RET} @var{newvers} @key{RET}
-Compare the specified two repository revisions of the current fileset.
+@item C-x v D
+Compare the entire tree corresponding to the current fileset with the
+tree you started from (@code{vc-root-diff}).  With a prefix argument,
+prompt for two revisions and compare their trees.
 
 @item C-x v g
 Display an annotated version of the file: for each line, show the
-latest revision in which it was modified.
+latest revision in which it was modified (@code{vc-annotate}).
 @end table
 
 @findex vc-revision-other-window
@@ -673,12 +683,11 @@
 
 @findex vc-diff
 @kindex C-x v =
-  @kbd{C-x v =} (@code{vc-diff}) compares the current buffer contents
-of each file in the current VC fileset (saving them if necessary) with
-the repository revision from which you started editing.  Note that the
-latter may or may not be the latest revision of the file(s).  The diff
-is displayed in a special buffer in another window.  @xref{Comparing
-Files}.
+  @kbd{C-x v =} (@code{vc-diff}) compares each file in the current VC
+fileset (saving them if necessary) with the repository revision(s)
+from which you started editing.  Note that the latter may or may not
+be the latest revision of the file(s).  The diff is displayed in a
+special buffer in another window.  @xref{Comparing Files}.
 
 @findex vc-diff
 @kindex C-u C-x v =
@@ -700,6 +709,12 @@
 name) is unlikely to return diffs that are connected in any meaningful
 way.
 
+  The command @kbd{C-x v D} (@code{vc-root-diff}) is similar to
+@kbd{C-x v =}, but it compares the entire tree associated with the
+current VC fileset with the tree you started with.  This means all the
+files controlled by the current version control repository, even those
+that are not part of the current VC fileset.
+
   If you invoke @kbd{C-x v =} or @kbd{C-u C-x v =} from a buffer that
 is neither visiting a version-controlled file nor a VC directory
 buffer, these commands generate a diff of all registered files in the
@@ -801,7 +816,7 @@
 
 @menu
 * Registering::         Putting a file under version control.
-* VC Status::           Viewing the VC status of files.
+* VC Change Log::       Viewing the VC Change Log.
 * VC Undo::             Canceling changes before or after check-in.
 @end menu
 
@@ -857,22 +872,36 @@
 initial comment to describe the purpose of this source file.  Reading
 the initial comment works like reading a log entry (@pxref{Log Buffer}).
 
-@node VC Status
-@subsubsection VC Status Commands
+@node VC Change Log
+@subsubsection VC Change Log
 
 @table @kbd
 @item C-x v l
-Display revision control state and change history.
+Display revision control state and change history
+(@code{vc-print-log}).
+
+@item C-x v L
+Display the change history for the current repository
+(@code{vc-print-root-log}).
 @end table
 
 @kindex C-x v l
 @findex vc-print-log
-  To view the detailed revision control status and history of a file,
-type @kbd{C-x v l} (@code{vc-print-log}).  This pops up a special
-buffer named @samp{*vc-change-log*}, in a new window, that displays
-the history of changes to the current file, including the text of the
-log entries.  The point is centered at the revision of the file that
-is currently being visited.
+  The command @kbd{C-x v l} (@code{vc-print-log}) displays a buffer
+named @samp{*vc-change-log*} in a new window.  This buffer lists the
+changes to the current file, including the associated log entries.
+(These are the log entries associated with the version control system,
+i.e. the ones you enter via the @samp{*VC-Log*} buffer.  @xref{Log
+Buffer}.)  Point is centered at the revision of the file currently
+being visited.  With a prefix argument, the command prompts for the
+revision to center on, and the maximum number of revisions to display.
+
+@findex vc-print-root-log
+  Type @kbd{C-x v L} (@code{vc-print-root-log}) to display a
+@samp{*vc-change-log*} buffer showing the history of the
+version-controlled directory tree as a whole.  With a prefix argument,
+the command prompts for the maximum number of revisions to display.
+RCS, SCCS, and CVS do not support this feature.
 
   In the @samp{*vc-change-log*} buffer, you can use the following keys
 to move between the logs of revisions and of files, to view past
@@ -926,6 +955,16 @@
 indicated on the current line did when it was committed.
 @end table
 
+@vindex vc-log-show-limit
+Because fetching many log entries can be slow, the
+@samp{*vc-change-log*} buffer displays no more than 2000 revisions by
+default.  The variable @code{vc-log-show-limit} specifies this limit;
+if you set the value to zero, that removes the limit.  You can also
+increase the number of revisions shown in an existing
+@samp{*vc-change-log*} buffer by clicking on the @samp{Show 2X
+entries} or @samp{Show unlimited entries} buttons at the end of the
+buffer.  However, RCS, SCCS, and CVS do not support this feature.
+
 @node VC Undo
 @subsubsection Undoing Version Control Actions
 
--- a/doc/emacs/major.texi	Fri Mar 26 08:01:19 2010 +0100
+++ b/doc/emacs/major.texi	Thu Apr 01 08:50:44 2010 +0200
@@ -41,7 +41,7 @@
 mode, Fortran mode, and others.  The remaining major modes are not
 intended for use on users' files; they are used in buffers created for
 specific purposes by Emacs, such as Dired mode for buffers made by
-Dired (@pxref{Dired}), Mail mode for buffers made by @kbd{C-x m}
+Dired (@pxref{Dired}), Message mode for buffers made by @kbd{C-x m}
 (@pxref{Sending Mail}), and Shell mode for buffers used for
 communicating with an inferior shell process (@pxref{Interactive
 Shell}).
--- a/doc/emacs/misc.texi	Fri Mar 26 08:01:19 2010 +0100
+++ b/doc/emacs/misc.texi	Thu Apr 01 08:50:44 2010 +0200
@@ -84,11 +84,20 @@
 Emacs movement keys: @kbd{C-p}, @kbd{C-n}, @kbd{C-b}, @kbd{C-f}, and
 the arrow keys.
 
+@vindex doc-view-continuous
+  By default, the line-motion keys @kbd{C-p} and @kbd{C-n} stop
+scrolling at the beginning and end of the current page, respectively.
+However, if you change the variable @code{doc-view-continuous} to a
+non-@code{nil} value, then @kbd{C-p} displays the previous page if you
+are already at the beginning of the current page, and @kbd{C-n}
+displays the next page if you are at the end of the current page.
+
 @findex doc-view-next-page
 @findex doc-view-previous-page
-  To display the next page, type @kbd{n}, @key{next} or @kbd{C-x ]}
-(@code{doc-view-next-page}).  To display the previous page, type
-@kbd{p}, @key{prior} or @kbd{C-x [} (@code{doc-view-previous-page}).
+  You can also display the next page by typing @kbd{n}, @key{next} or
+@kbd{C-x ]} (@code{doc-view-next-page}).  To display the previous
+page, type @kbd{p}, @key{prior} or @kbd{C-x [}
+(@code{doc-view-previous-page}).
 
 @findex doc-view-scroll-up-or-next-page
 @findex doc-view-scroll-down-or-previous-page
@@ -957,12 +966,9 @@
 Fetch the next later old shell command.
 
 @kindex M-r @r{(Shell mode)}
-@kindex M-s @r{(Shell mode)}
-@findex comint-previous-matching-input
-@findex comint-next-matching-input
-@item M-r @var{regexp} @key{RET}
-@itemx M-s @var{regexp} @key{RET}
-Search backwards or forwards for old shell commands that match @var{regexp}.
+@findex comint-history-isearch-backward-regexp
+@item M-r
+Begin an incremental regexp search of old shell commands.
 
 @item C-c C-x
 @kindex C-c C-x @r{(Shell mode)}
@@ -995,15 +1001,15 @@
 @kbd{C-@key{UP}} works like @kbd{M-p}, and @kbd{C-@key{DOWN}} like
 @kbd{M-n}.
 
-  The history search commands @kbd{M-r} and @kbd{M-s} read a regular
-expression and search through the history for a matching command.  Aside
-from the choice of which command to fetch, they work just like @kbd{M-p}
-and @kbd{M-n}.  If you enter an empty regexp, these commands reuse the
-same regexp used last time.
-
-  When you find the previous input you want, you can resubmit it by
-typing @key{RET}, or you can edit it first and then resubmit it if you
-wish.  Any partial input you were composing before navigating the
+  The history search command @kbd{M-r} begins an incremental regular
+expression search of previous shell commands.  After typing @kbd{M-r},
+start typing the desired string or regular expression; the last
+matching shell command will be displayed in the current line.
+Incremental search commands have their usual effects---for instance,
+@kbd{C-s} and @kbd{C-r} search forward and backward for the next match
+(@pxref{Incremental Search}).  When you find the desired input, type
+@key{RET} to terminate the search.  This puts the input in the command
+line.  Any partial input you were composing before navigating the
 history list is restored when you go to the beginning or end of the
 history ring.
 
--- a/doc/emacs/mule.texi	Fri Mar 26 08:01:19 2010 +0100
+++ b/doc/emacs/mule.texi	Thu Apr 01 08:50:44 2010 +0200
@@ -67,6 +67,12 @@
 possible problems and explains how to solve them.
 
 @item
+Characters from scripts whose natural ordering of text is from right
+to left are reordered for display (@pxref{Bidirectional Editing}).
+These scripts include Arabic, Hebrew, Syriac, Thaana, and a few
+others.
+
+@item
 You can insert non-@acronym{ASCII} characters or search for them.  To do that,
 you can specify an input method (@pxref{Select Input Method}) suitable
 for your language, or use the default input method set up when you set
@@ -107,6 +113,7 @@
 * Unibyte Mode::            You can pick one European character set
                               to use without multibyte characters.
 * Charsets::                How Emacs groups its internal character codes.
+* Bidirectional Editing::   Support for right-to-left scripts.
 @end menu
 
 @node International Chars
@@ -533,6 +540,11 @@
 possible characters to type next is displayed in the echo area (but
 not when you are in the minibuffer).
 
+  Another facility for typing characters not on your keyboard is by
+using the @kbd{C-x 8 @key{RET}} (@code{ucs-insert}) to insert a single
+character based on its Unicode name or code-point; see @ref{Inserting
+Text}.
+
 @node Select Input Method
 @section Selecting an Input Method
 
@@ -961,15 +973,16 @@
 to the question.)
 
 @vindex sendmail-coding-system
-  When you send a message with Mail mode (@pxref{Sending Mail}), Emacs has
-four different ways to determine the coding system to use for encoding
-the message text.  It tries the buffer's own value of
-@code{buffer-file-coding-system}, if that is non-@code{nil}.  Otherwise,
-it uses the value of @code{sendmail-coding-system}, if that is
-non-@code{nil}.  The third way is to use the default coding system for
-new files, which is controlled by your choice of language environment,
-if that is non-@code{nil}.  If all of these three values are @code{nil},
-Emacs encodes outgoing mail using the Latin-1 coding system.
+  When you send a message with Message mode (@pxref{Sending Mail}),
+Emacs has four different ways to determine the coding system to use
+for encoding the message text.  It tries the buffer's own value of
+@code{buffer-file-coding-system}, if that is non-@code{nil}.
+Otherwise, it uses the value of @code{sendmail-coding-system}, if that
+is non-@code{nil}.  The third way is to use the default coding system
+for new files, which is controlled by your choice of language
+environment, if that is non-@code{nil}.  If all of these three values
+are @code{nil}, Emacs encodes outgoing mail using the Latin-1 coding
+system.
 
 @node Text Coding
 @section Specifying a Coding System for File Text
@@ -1653,6 +1666,84 @@
 point before it and type @kbd{C-u C-x =} (@pxref{International
 Chars}).
 
+@node Bidirectional Editing
+@section Bidirectional Editing
+@cindex bidirectional editing
+@cindex right-to-left text
+
+  Emacs supports editing text written in scripts, such as Arabic and
+Hebrew, whose natural ordering of horizontal text for display is from
+right to left.  However, digits and Latin text embedded in these
+scripts are still displayed left to right.  It is also not uncommon to
+have small portions of text in Arabic or Hebrew embedded in otherwise
+Latin document, e.g., as comments and strings in a program source
+file.  For these reasons, text that uses these scripts is actually
+@dfn{bidirectional}: a mixture of runs of left-to-right and
+right-to-left characters.
+
+  This section describes the facilities and options provided by Emacs
+for editing bidirectional text.
+
+@cindex logical order
+@cindex visual order
+  Emacs stores right-to-left and bidirectional text in the so-called
+@dfn{logical} (or @dfn{reading}) order: the buffer or string position
+of the first character you read precedes that of the next character.
+Reordering of bidirectional text into the @dfn{visual} order happens
+at display time.  As result, character positions no longer increase
+monotonically with their positions on display.  Emacs implements the
+Unicode Bidirectional Algorithm described in the Unicode Standard
+Annex #9, for reordering of bidirectional text for display.
+
+@vindex bidi-display-reordering
+  The buffer-local variable @code{bidi-display-reordering} controls
+whether text in the buffer is reordered for display.  If its value is
+non-@code{nil}, Emacs reorders characters that have right-to-left
+directionality when they are displayed.  The default value is
+@code{nil}.
+
+  Each paragraph of bidirectional text can have its own @dfn{base
+direction}, either right-to-left or left-to-right.  (Paragraph
+boundaries are defined by the regular expressions
+@code{paragraph-start} and @code{paragraph-separate}, see
+@ref{Paragraphs}.)  Text in left-to-right paragraphs begins at the
+left margin of the window and is truncated or continued when it
+reaches the right margin.  By contrast, text in right-to-left
+paragraphs begins at the right margin and is continued or truncated at
+the left margin.
+
+@vindex bidi-paragraph-direction
+  Emacs determines the base direction of each paragraph dynamically,
+based on the text at the beginning of the paragraph.  However,
+sometimes a buffer may need to force a certain base direction for its
+paragraphs.  The variable @code{bidi-paragraph-direction}, if
+non-@code{nil}, disables the dynamic determination of the base
+direction, and instead forces all paragraphs in the buffer to have the
+direction specified by its buffer-local value.  The value can be either
+@code{right-to-left} or @code{left-to-right}.  Any other value is
+interpreted as @code{nil}.
+
+@cindex LRM
+@cindex RLM
+  Alternatively, you can control the base direction of a paragraph by
+inserting special formatting characters in front of the paragraph.
+The special character @code{RIGHT-TO-LEFT MARK}, or @sc{rlm}, forces
+the right-to-left direction on the following paragraph, while
+@code{LEFT-TO-RIGHT MARK}, or @sc{lrm} forces the left-to-right
+direction.  (You can use @kbd{C-x 8 RET} to insert these characters.)
+In a GUI session, the @sc{lrm} and @sc{rlm} characters display as
+blanks.
+
+  Because characters are reordered for display, Emacs commands that
+operate in the logical order or on stretches of buffer positions may
+produce unusual effects.  For example, @kbd{C-f} and @kbd{C-b}
+commands move point in the logical order, so the cursor will sometimes
+jump when point traverses reordered bidirectional text.  Similarly, a
+highlighted region covering a contiguous range of character positions
+may look discontinuous if the region spans reordered text.  This is
+normal and similar to behavior of other programs that support
+bidirectional text.
+
 @ignore
    arch-tag: 310ba60d-31ef-4ce7-91f1-f282dd57b6b3
 @end ignore
--- a/doc/emacs/programs.texi	Fri Mar 26 08:01:19 2010 +0100
+++ b/doc/emacs/programs.texi	Thu Apr 01 08:50:44 2010 +0200
@@ -88,11 +88,12 @@
 @cindex PostScript mode
 @cindex Conf mode
 @cindex DNS mode
+@cindex Javascript mode
   The existing programming language major modes include Lisp, Scheme
 (a variant of Lisp) and the Scheme-based DSSSL expression language,
 Ada, ASM, AWK, C, C++, Delphi (Object Pascal), Fortran, Icon, IDL
-(CORBA), IDLWAVE, Java, Metafont (@TeX{}'s companion for font
-creation), Modula2, Objective-C, Octave, Pascal, Perl, Pike,
+(CORBA), IDLWAVE, Java, Javascript, Metafont (@TeX{}'s companion for
+font creation), Modula2, Objective-C, Octave, Pascal, Perl, Pike,
 PostScript, Prolog, Python, Ruby, Simula, Tcl, and VHDL.  An
 alternative mode for Perl is called CPerl mode.  Modes are available
 for the scripting languages of the common GNU and Unix shells, VMS
--- a/doc/emacs/rmail.texi	Fri Mar 26 08:01:19 2010 +0100
+++ b/doc/emacs/rmail.texi	Thu Apr 01 08:50:44 2010 +0200
@@ -683,12 +683,12 @@
 @node Rmail Reply
 @section Sending Replies
 
-  Rmail has several commands that use Mail mode to send outgoing mail.
-@xref{Sending Mail}, for information on using Mail mode, including
-certain features meant to work with Rmail.  What this section documents
-are the special commands of Rmail for entering Mail mode.  Note that the
-usual keys for sending mail---@kbd{C-x m}, @kbd{C-x 4 m}, and @kbd{C-x 5
-m}---also work normally in Rmail mode.
+  Rmail has several commands to send outgoing mail.  @xref{Sending
+Mail}, for information on using Message mode, including certain
+features meant to work with Rmail.  What this section documents are
+the special commands of Rmail for entering the mail buffer.  Note that
+the usual keys for sending mail---@kbd{C-x m}, @kbd{C-x 4 m}, and
+@kbd{C-x 5 m}---also work normally in Rmail mode.
 
 @table @kbd
 @item m
@@ -735,12 +735,12 @@
 This means to reply only to the sender of the original message.
 
   Once the @samp{*mail*} buffer has been initialized, editing and
-sending the mail goes as usual (@pxref{Sending Mail}).  You can edit the
-presupplied header fields if they are not what you want.  You can also
-use the commands of Mail mode (@pxref{Mail Mode}), including @kbd{C-c
-C-y} which yanks in the message that you are replying to.  You can
-also switch to the Rmail buffer, select a different message there, switch
-back, and yank the new current message.
+sending the mail goes as usual (@pxref{Sending Mail}).  You can edit
+the presupplied header fields if they are not what you want.  You can
+also use commands such as @kbd{C-c C-y}, which yanks in the message
+that you are replying to (@pxref{Mail Commands}).  You can also switch
+to the Rmail buffer, select a different message there, switch back,
+and yank the new current message.
 
 @kindex M-m @r{(Rmail)}
 @findex rmail-retry-failure
--- a/doc/emacs/search.texi	Fri Mar 26 08:01:19 2010 +0100
+++ b/doc/emacs/search.texi	Thu Apr 01 08:50:44 2010 +0200
@@ -1311,8 +1311,7 @@
 buffer that contains a match for it.  To limit the search to part of
 the buffer, narrow to that part (@pxref{Narrowing}).  A numeric
 argument @var{n} specifies that @var{n} lines of context are to be
-displayed before and after each matching line.  Currently,
-@code{occur} can not correctly handle multiline matches.
+displayed before and after each matching line.
 
 @kindex RET @r{(Occur mode)}
 @kindex o @r{(Occur mode)}
--- a/doc/emacs/sending.texi	Fri Mar 26 08:01:19 2010 +0100
+++ b/doc/emacs/sending.texi	Thu Apr 01 08:50:44 2010 +0200
@@ -6,120 +6,110 @@
 @chapter Sending Mail
 @cindex sending mail
 @cindex mail
+@cindex email
 @cindex message
 
-  To send a message in Emacs, you start by typing a command (@kbd{C-x m})
-to select and initialize the @samp{*mail*} buffer.  Then you edit the text
-and headers of the message in this buffer, and type another command
-(@kbd{C-c C-s} or @kbd{C-c C-c}) to send the message.
+@kindex C-x m
+@findex compose-mail
+  To send an @dfn{e-mail} message in Emacs, type @kbd{C-x m}.  This
+selects and initializes a buffer named @samp{*mail*}, where you can
+edit the text and headers of the message.  Finally, type @kbd{C-c C-s}
+or @kbd{C-c C-c} to send the message.
 
 @table @kbd
 @item C-x m
-Begin composing a message to send (@code{compose-mail}).
+Begin composing mail (@code{compose-mail}).
 @item C-x 4 m
-Likewise, but display the message in another window
-(@code{compose-mail-other-window}).
+Likewise, in another window (@code{compose-mail-other-window}).
 @item C-x 5 m
-Likewise, but make a new frame (@code{compose-mail-other-frame}).
+Likewise, but in a new frame (@code{compose-mail-other-frame}).
 @item C-c C-s
-In Mail mode, send the message (@code{mail-send}).
+In the mail buffer, send the message (@code{message-send}).
 @item C-c C-c
-Send the message and bury the mail buffer (@code{mail-send-and-exit}).
+In the mail buffer, send the message and bury the buffer
+(@code{message-send-and-exit}).
 @end table
 
-@kindex C-x m
-@findex compose-mail
 @kindex C-x 4 m
 @findex compose-mail-other-window
 @kindex C-x 5 m
 @findex compose-mail-other-frame
-  The command @kbd{C-x m} (@code{compose-mail}) selects a buffer named
-@samp{*mail*} and initializes it with the skeleton of an outgoing
-message.  @kbd{C-x 4 m} (@code{compose-mail-other-window}) selects the
-@samp{*mail*} buffer in a different window, leaving the previous current
-buffer visible.  @kbd{C-x 5 m} (@code{compose-mail-other-frame}) creates
-a new frame to select the @samp{*mail*} buffer.
-
-  Because the mail-composition buffer is an ordinary Emacs buffer, you can
-switch to other buffers while in the middle of composing mail, and switch
-back later (or never).  If you use the @kbd{C-x m} command again when you
-have been composing another message but have not sent it, you are asked to
-confirm before the old message is erased.  If you answer @kbd{n}, the
-@samp{*mail*} buffer remains selected with its old contents, so you can
-finish the old message and send it.  @kbd{C-u C-x m} is another way to do
-this.  Sending the message marks the @samp{*mail*} buffer ``unmodified,''
-which avoids the need for confirmation when @kbd{C-x m} is next used.
+@noindent
+The command @kbd{C-x 4 m} (@code{compose-mail-other-window}) does the
+same as @kbd{C-x m}, except it displays the mail buffer in a different
+window.  The command @kbd{C-x 5 m} (@code{compose-mail-other-frame})
+creates a new frame for the mail buffer.
 
-  If you are composing a message in the @samp{*mail*} buffer and want to
-send another message before finishing the first, rename the
-@samp{*mail*} buffer using @kbd{M-x rename-uniquely} (@pxref{Misc
-Buffer}).  Then you can use @kbd{C-x m} or its variants described above
-to make a new @samp{*mail*} buffer.  Once you've done that, you can work
-with each mail buffer independently.
-
-@vindex mail-default-directory
-  The variable @code{mail-default-directory} controls the default
-directory for mail buffers, and also says where to put their auto-save
-files.
+  Because the mail buffer is an ordinary Emacs buffer, you can switch
+to other buffers while in the middle of composing mail, and switch
+back later (or never).  If you type @kbd{C-x m} again when you have
+been composing another message but have not sent it, Emacs asks for
+confirmation before erasing the old message.  If you answer @kbd{n},
+Emacs selects the mail buffer with its old contents, so you can finish
+the old message and send it.  @kbd{C-u C-x m} is another way to do
+this.  Sending the message marks the mail buffer ``unmodified,'' which
+avoids the need for confirmation when @kbd{C-x m} is next used.
 
-@c Not mentioned: mail-bury-selects-summary.  Really an Rmail feature.
+  If you want to send another message before finishing the current
+message, use the command @kbd{M-x rename-uniquely} to rename the
+current mail buffer (@pxref{Misc Buffer}).  Then you can use @kbd{C-x
+m} to make a new mail buffer, and work with each mail buffer
+independently.
 
-@ignore
-@c Commented out because it is not user-oriented;
-@c it doesn't say how to do some job.  -- rms.
-@cindex directory servers
-@cindex LDAP
-@cindex PH/QI
-@cindex names and addresses
-There is an interface to directory servers using various protocols such
-as LDAP or the CCSO white pages directory system (PH/QI), described in a
-separate manual.  It may be useful for looking up names and addresses.
-@xref{Top,,EUDC, eudc, EUDC Manual}.
-@end ignore
+  Before using Emacs to send mail, you may need to customize the
+variable @code{send-mail-function} if your system is not set up to
+deliver mail directly via SMTP (@pxref{Mail Sending}).  In addition,
+you may need to customize @code{user-mail-address} if the system
+cannot receive mail via SMTP (@pxref{Mail Headers}).
 
 @menu
-* Format: Mail Format.	     Format of the mail being composed.
-* Headers: Mail Headers.     Details of some standard mail header fields.
-* Aliases: Mail Aliases.     Abbreviating and grouping mail addresses.
-* Mode: Mail Mode.	     Special commands for editing mail being composed.
-* Amuse: Mail Amusements.    Distracting the NSA; adding fortune messages.
-* Methods: Mail Methods.     Using alternative mail-composition methods.
+* Format: Mail Format.	      Format of a mail message.
+* Headers: Mail Headers.      Details of some standard mail header fields.
+* Aliases: Mail Aliases.      Abbreviating and grouping mail addresses.
+* Commands: Mail Commands.    Special commands for editing mail being composed.
+* Signature: Mail Signature.  Adding a signature to every message.
+* Amuse: Mail Amusements.     Distracting the NSA; adding fortune messages.
+* Methods: Mail Methods.      Using alternative mail-composition methods.
 @end menu
 
 @node Mail Format
 @section The Format of the Mail Buffer
 
-  In addition to the @dfn{text} or @dfn{body}, a message has @dfn{header
-fields} which say who sent it, when, to whom, why, and so on.  Some
-header fields, such as @samp{Date} and @samp{Message-Id}, are created
-automatically when you send the message.  Others, such as the recipient
-names, must be specified by you in order to send the message properly.
+  An email message must contain certain pieces of information, called
+@dfn{headers}, which specify the message's sender, recipient(s), and
+so on.
 
-  In the mail buffer, you can insert and edit header fields using
-ordinary editing commands.  Mail mode provides commands to help you
-edit some header fields, and some are automatically preinitialized in
-the buffer, when appropriate.
+  At the top of the mail buffer is a set of @dfn{header fields}, where
+you can enter this information.  You can insert and edit header fields
+using ordinary editing commands.  @xref{Header Editing}, for commands
+specific to editing header fields.
+
+  Some header fields are automatically pre-initialized in the buffer,
+when appropriate; other headers, such as @samp{Date} and
+@samp{Message-Id}, are normally omitted from the mail buffer and
+created automatically when the message is sent.
 
 @vindex mail-header-separator
   The line in the buffer that says
 
-@example
+@smallexample
 --text follows this line--
-@end example
+@end smallexample
 
 @noindent
-is a special delimiter that separates the headers you have specified from
-the text.  Whatever follows this line is the text of the message; the
-headers precede it.  The delimiter line itself does not appear in the
-message actually sent.  The text used for the delimiter line is controlled
-by the variable @code{mail-header-separator}.
+separates the header fields from the @dfn{body} (or @dfn{text}) of the
+message.  Everything above this line is treated as part of the
+headers; everything below it is treated as the body.  The delimiter
+line itself does not appear in the message actually sent.  The text
+used for the delimiter line is controlled by the variable
+@code{mail-header-separator}.
 
   Here is an example of what the headers and text in the mail buffer
 might look like.
 
 @example
-To: gnu@@gnu.org
-CC: lungfish@@spam.org, byob@@spam.org
+To: gnu@@example.org
+CC: lungfish@@example.com, byob@@example.net
 Subject: The Emacs Manual
 --text follows this line--
 Please ignore this message.
@@ -134,85 +124,51 @@
 equivalent in field names (and in mailing addresses also).  After the
 colon and optional whitespace comes the contents of the field.
 
-  You can use any name you like for a header field, but normally people
-use only standard field names with accepted meanings.  Here is a table
-of fields commonly used in outgoing messages.  Emacs preinitializes some
-of these when you start to compose a mail, depending on various options
-you can set.  You can delete or alter any header field before you send
-the message, if you wish.
+  You can use any name you like for a header field, but normally
+people use only standard field names with accepted meanings.  Here is
+a table of commonly-used fields.  Emacs pre-initializes some of these,
+depending on various options you can set.  You can delete or alter any
+header field before you send the message, if you wish.
 
 @table @samp
+@item From
+@vindex user-mail-address
+The address of the sender (you).  This should be a valid mailing
+address, as replies will normally go there.  Emacs initializes this
+field using the variables @code{user-full-name} and
+@code{user-mail-address}; see below.
+
 @item To
-This field contains the mailing addresses to which the message is
-addressed.  If you list more than one address, use commas, not spaces,
-to separate them.
+The mailing address(es) to which the message is addressed.  To list
+more than one address, use commas (not spaces) to separate them.
 
 @item Subject
-The contents of the @samp{Subject} field should be a piece of text
-that says what the message is about.  The reason @samp{Subject} fields
-are useful is that most mail-reading programs can provide a summary of
-messages, listing the subject of each message but not its text.
+A piece of text saying what the message is about.  Most mail-reading
+programs can display a summary of messages, listing the subject of
+each message but not its text.
 
 @item CC
-This field contains additional mailing addresses to send the message to,
-like @samp{To} except that these readers should not regard the message
-as directed at them.
+Additional mailing address(es) to send the message to.  This is like
+@samp{To}, except that these readers should not regard the message as
+directed at them.
 
 @item BCC
-This field contains additional mailing addresses to send the message to,
-which should not appear in the header of the message actually sent.
-Copies sent this way are called @dfn{blind carbon copies}.
-
-@vindex mail-self-blind
-@cindex copy of every outgoing message
-To send a blind carbon copy of every outgoing message to yourself, set
-the variable @code{mail-self-blind} to @code{t}.  To send a blind carbon
-copy of every message to some other @var{address}, set the variable
-@code{mail-default-headers} to @code{"Bcc: @var{address}\n"}.
+Additional mailing address(es) to send the message to, which should
+not appear in the header of the message actually sent.  ``BCC'' stands
+for @dfn{blind carbon copies}.
 
 @item FCC
-This field contains the name of one file and directs Emacs to append a
-copy of the message to that file when you send the message.  Emacs
-writes the message in mbox format, unless the file is in Babyl format
-(used by Rmail before Emacs 23), in which case Emacs writes Babyl.  If
-an Rmail buffer is visiting the file, Emacs updates it accordingly.
-To specify more than one file, use several @samp{FCC} fields, with one
-file name in each field.
-
-@vindex mail-archive-file-name
-To put a fixed file name in the @samp{FCC} field each time you start
-editing an outgoing message, set the variable
-@code{mail-archive-file-name} to that file name.  Unless you remove the
-@samp{FCC} field before sending, the message will be written into that
-file when it is sent.
-
-@item From
-Use the @samp{From} field to say who you are.  You might need to change
-this if the account you are using to send the mail is not your own.  The
-contents of the @samp{From} field should be a valid mailing address,
-since replies will normally go there.  
-
-@vindex mail-setup-with-from
-Emacs initializes this field (unless the variable
-@code{mail-setup-with-from} is @code{nil}) using
-@code{user-mail-address} as the default.  If there is no @samp{From}
-field when you send a mail, Emacs adds one.
+The name of one file, to which a copy of the sent message should be
+appended.  Emacs writes the message in mbox format, unless the file is
+in Babyl format (used by Rmail before Emacs 23), in which case Emacs
+writes Babyl.  If an Rmail buffer is visiting the file, Emacs updates
+it accordingly.  To specify more than one file, use several @samp{FCC}
+fields, with one file name in each field.
 
 @item Reply-to
-Use this field to direct replies to a different address.  Most
-mail-reading programs (including Rmail) automatically send replies to
-the @samp{Reply-to} address in preference to the @samp{From} address.
-By adding a @samp{Reply-to} field to your header, you can work around
-any problems your @samp{From} address may cause for replies.
-
-@cindex @env{REPLYTO} environment variable
-@vindex mail-default-reply-to
-To put a fixed @samp{Reply-to} address into every outgoing message, set
-the variable @code{mail-default-reply-to} to that address (as a string).
-Then Emacs initializes the message with a @samp{Reply-to} field as
-specified.  When you first compose a mail, if
-@code{mail-default-reply-to} is @code{nil}, Emacs initializes it from the
-environment variable @env{REPLYTO}.
+An address to which replies should be sent, instead of @samp{From}.
+You can use this header if, for some reason, your @samp{From} address
+is unable to receive replies.
 
 @item Mail-reply-to
   This field takes precedence over @samp{Reply-to}.  It is used because
@@ -225,70 +181,88 @@
 It usually indicates that you want replies to go to the list, and that
 you do not need an extra copy sent directly to you.
 
-@vindex mail-mailing-lists
-  The variable @code{mail-mailing-lists} holds a list of mailing list
-addresses that you are subscribed to.  If it is non-@code{nil}, Emacs
-inserts an appropriate @samp{Mail-followup-to} header when sending mail
-to a mailing list.
-
-@c There is also "Sent-via", added by C-c C-v, but it does not seem
-@c particularly useful (?).
+@c Message mode handles this differently...
+@c @vindex mail-mailing-lists
+@c   The variable @code{mail-mailing-lists} holds a list of mailing list
+@c addresses that you are subscribed to.  If it is non-@code{nil}, Emacs
+@c inserts an appropriate @samp{Mail-followup-to} header when sending mail
+@c to a mailing list.
 
 @item In-reply-to
-This field contains a piece of text describing the message you are
-replying to.  Some mail systems can use this information to correlate
-related pieces of mail.  Normally this field is filled in by Rmail
-when you reply to a message in Rmail, and you never need to
-think about it (@pxref{Rmail}).
+A piece of text describing the message you are replying to.  Some mail
+systems can use this information to correlate related pieces of mail.
+Normally, you never need to think about this, because it is filled in
+automatically when you reply to a message in Rmail (or any other mail
+program built into Emacs).
 
 @item References
-This field lists the Message-Ids of related previous messages (a
-Message-Id is a unique identifier generated when a message is sent).
-Rmail sets up this field automatically when you reply to a message.
+The Message-Ids of previous related messages (a Message-Id is a unique
+identifier generated when a message is sent).  Like
+@samp{In-reply-to}, this is normally set up automatically for you.
 @end table
 
-  The @samp{To}, @samp{CC}, and @samp{BCC} header fields can appear
-any number of times, and each such header field can contain multiple
-addresses, separated by commas.  This way, you can specify any number
-of places to send the message.  These fields can also have
-continuation lines: one or more lines starting with whitespace,
-following the starting line of the field, are considered part of the
-field.  Here's an example of a @samp{To} field with a continuation
-line:
+@noindent
+The @samp{To}, @samp{CC}, and @samp{BCC} fields can appear any number
+of times, and each such header field can contain multiple addresses,
+separated by commas.  This way, you can specify any number of places
+to send the message.  These fields can also have continuation lines:
+one or more lines starting with whitespace, following the starting
+line of the field, are considered part of the field.  Here's an
+example of a @samp{To} field with a continuation line:
 
 @example
 @group
-To: foo@@here.net, this@@there.net,
-  me@@gnu.cambridge.mass.usa.earth.spiral3281
+To: foo@@example.net, this@@example.net,
+  bob@@example.com
 @end group
 @end example
 
+@vindex user-full-name
+@vindex user-mail-address
+  The default contents of the @samp{From} header field are computed
+from the variables @code{user-full-name} and @code{user-mail-address}.
+On some operating systems, Emacs initializes these two variables using
+environment variables (@pxref{General Variables}).  If this
+information is unavailable or wrong, you can customize the variables
+yourself (@pxref{Easy Customization}).
+
 @vindex mail-from-style
-  When you send the message, if you didn't write a @samp{From} field
-yourself, Emacs puts in one for you, using @code{user-mail-address}.
-The variable @code{mail-from-style} controls the format:
+  The value of the variable @code{mail-from-style} specifies how to
+format the address in the @samp{From} field:
 
-@table @code
-@item nil
-Use just the email address, as in @samp{king@@grassland.com}.
-@item parens
-Use both email address and full name, as in:@*
+@table @asis
+@item @code{nil}
+Use just the address, as in @samp{king@@grassland.com}.
+@item @code{parens}
+Use both address and full name, as in:@*
 @samp{king@@grassland.com (Elvis Parsley)}.
-@item angles
-Use both email address and full name, as in:@*
+@item @code{angles}
+Use both address and full name, as in:@*
 @samp{Elvis Parsley <king@@grassland.com>}.
-@item system-default
-Allow the system to insert the @samp{From} field.
+@item any other value
+Use @code{angles} for most addresses.  However, if the address must be
+``quoted'' to remain syntactically-valid under the @code{angles}
+format but not under the @code{parens} format, use @code{parens}
+instead.  This is the default.
 @end table
 
 @c There is also mail-specify-envelope-from and mail-envelope-from, but
 @c these are probably not topics for the Emacs manual.
 
 @vindex mail-default-headers
-  You can direct Emacs to insert certain default headers into the
-outgoing message by setting the variable @code{mail-default-headers}
-to a string.  Then @code{C-x m} inserts this string into the message
-headers.  If the default header fields are not appropriate for a
+  You can direct Emacs to insert certain default headers into the mail
+buffer by setting the variable @code{mail-default-headers} to a
+string.  Then @kbd{C-x m} inserts this string into the message
+headers.  For example, here is how to add a @samp{Reply-to} and
+@samp{FCC} header to each message:
+
+@smallexample
+(setq mail-default-headers
+      "Reply-to: foo@@example.com\nFCC: ~/Mail/sent")
+@end smallexample
+
+@noindent
+If the default header fields are not appropriate for a
 particular message, edit them as necessary before sending the message.
 
 @node Mail Aliases
@@ -296,29 +270,26 @@
 @cindex mail aliases
 @cindex @file{.mailrc} file
 @cindex mailrc file
+@vindex mail-personal-alias-file
 
-  You can define @dfn{mail aliases} in a file named @file{~/.mailrc}.
-These are short mnemonic names which stand for mail addresses or groups of
-mail addresses.  Like many other mail programs, Emacs expands aliases
-when they occur in the @samp{To}, @samp{From}, @samp{CC}, @samp{BCC}, and
-@samp{Reply-to} fields, plus their @samp{Resent-} variants.
-@c The list is defined by mail-address-field-regexp.
+  You can define @dfn{mail aliases}, which are short mnemonic names
+that stand for mail addresses or groups of mail addresses.  By
+default, mail aliases are defined in the file @file{~/.mailrc}.  You
+can specify a different file name to use, by setting the variable
+@code{mail-personal-alias-file}.
 
-  To define an alias in @file{~/.mailrc}, write a line in the following
+  To define an alias in @file{.mailrc}, write a line in the following
 format:
 
 @example
-alias @var{shortaddress} @var{fulladdresses}
+alias @var{nick} @var{fulladdresses}
 @end example
 
 @noindent
-Here @var{fulladdresses} stands for one or more mail addresses for
-@var{shortaddress} to expand into.  Separate multiple addresses with
-spaces; if an address contains a space, quote the whole address with a
-pair of double quotes.
-
-For instance, to make @code{maingnu} stand for
-@code{gnu@@gnu.org} plus a local address of your own, put in
+This means that @var{nick} should expand into @var{fulladdresses},
+where @var{fulladdresses} can be either a single address, or multiple
+addresses separated with spaces.  For instance, to make @code{maingnu}
+stand for @code{gnu@@gnu.org} plus a local address of your own, put in
 this line:@refill
 
 @example
@@ -326,329 +297,248 @@
 @end example
 
 @noindent
-Addresses specified in this way should use double quotes around an
-entire address when the address contains spaces.  But you need not
-include double quotes around parts of the address, such as the person's
-full name.  Emacs puts them in if they are needed.  For example,
+If an address contains a space, quote the whole address with a pair of
+double quotes, like this:
 
 @example
 alias jsmith "John Q. Smith <none@@example.com>"
 @end example
 
 @noindent
-is correct in @samp{.mailrc}.  Emacs will insert the address as
+Note that you need not include double quotes around individual parts
+of the address, such as the person's full name.  Emacs puts them in if
+they are needed.  For instance, it inserts the above address as
 @samp{"John Q. Smith" <none@@example.com>}.
 
-  Emacs also recognizes ``include'' commands in @samp{.mailrc} files.
-They look like this:
+  Emacs also recognizes ``include'' commands in @file{.mailrc}.  They
+look like this:
 
 @example
 source @var{filename}
 @end example
 
 @noindent
-The file @file{~/.mailrc} is used primarily by other mail-reading
-programs; it can contain various other commands.  Emacs ignores
-everything in it except for alias definitions and include commands.
-
-@findex define-mail-alias
-  Another way to define a mail alias, within Emacs alone, is with the
-@code{define-mail-alias} command.  It prompts for the alias and then the
-full address.  You can use it to define aliases in your @file{.emacs}
-file, like this:
-
-@example
-(define-mail-alias "maingnu" "gnu@@gnu.org")
-@end example
-
-@vindex mail-aliases
-  @code{define-mail-alias} records aliases by adding them to a
-variable named @code{mail-aliases}.  If you are comfortable with
-manipulating Lisp lists, you can set @code{mail-aliases} directly.  The
-initial value of @code{mail-aliases} is @code{t}, which means that
-Emacs should read @file{.mailrc} to get the proper value.
+The @file{.mailrc} file is not unique to Emacs; many other
+mail-reading programs use it for mail aliases, and it can contain
+various other commands.  However, Emacs ignores everything except
+alias definitions and include commands.
 
-@vindex mail-personal-alias-file
-  You can specify a different file name to use instead of
-@file{~/.mailrc} by setting the variable
-@code{mail-personal-alias-file}.
-
-@c There is also mail-alias-file for the system aliases.
+@findex mail-abbrev-insert-alias
+  Mail aliases expand as abbrevs---that is to say, as soon as you type
+a word-separator character after an alias (@pxref{Abbrevs}).  This
+expansion takes place only within the @samp{To}, @samp{From},
+@samp{CC}, @samp{BCC}, and @samp{Reply-to} header fields (plus their
+@samp{Resent-} variants); it does not take place in other header
+fields, such as @samp{Subject}.
 
-@findex expand-mail-aliases
-  Normally, Emacs expands aliases when you send the message.  You do not
-need to expand mail aliases before sending the message, but you can
-expand them if you want to see where the mail will actually go.  To do
-this, use the command @kbd{M-x expand-mail-aliases}; it expands all mail
-aliases currently present in the mail headers that hold addresses.
-
-  If you like, you can have mail aliases expand as abbrevs, as soon as
-you type them in (@pxref{Abbrevs}).  To enable this feature, execute the
-following:
-
-@example
-(add-hook 'mail-mode-hook 'mail-abbrevs-setup)
-@end example
+  You can also insert an aliased address directly, using the command
+@kbd{M-x mail-abbrev-insert-alias}.  This reads an alias name, with
+completion, and inserts its definition at point.
 
-@noindent
-@findex define-mail-abbrev
-@vindex mail-abbrevs
-This can go in your @file{.emacs} file.  @xref{Hooks}.  If you use this
-feature, you must use @code{define-mail-abbrev} instead of
-@code{define-mail-alias}; the latter does not work with this package.
-Note that the mail abbreviation package uses the variable
-@code{mail-abbrevs} instead of @code{mail-aliases}, and that all alias
-names are converted to lower case.
-
-@kindex C-c C-a @r{(Mail mode)}
-@findex mail-abbrev-insert-alias
-  The mail abbreviation package also provides the @kbd{C-c C-a}
-(@code{mail-abbrev-insert-alias}) command, which reads an alias
-name (with completion) and inserts its definition at point.  This is
-useful when editing the message text itself or a header field such as
-@samp{Subject} in which Emacs does not normally expand aliases.
-
-  Note that abbrevs expand only if you insert a word-separator character
-afterward.  However, you can rebind @kbd{C-n} and @kbd{M->} to cause
-expansion as well.  Here's how to do that:
+@node Mail Commands
+@section Mail Commands
+@cindex Message mode
+@cindex mode, Message
 
-@smallexample
-(add-hook 'mail-mode-hook
-    (lambda ()
-      (define-key
-        mail-mode-map [remap next-line] 'mail-abbrev-next-line)
-      (define-key
-        mail-mode-map [remap end-of-buffer] 'mail-abbrev-end-of-buffer)))
-@end smallexample
+  The default major mode for the @samp{*mail*} buffer is called
+Message mode.  It behaves like Text mode in many ways, but provides
+several additional commands on the @kbd{C-c} prefix, which make
+editing a message more convenient.
 
-@node Mail Mode
-@section Mail Mode
-@cindex Mail mode
-@cindex mode, Mail
-
-  The major mode used in the mail buffer is Mail mode, which is much
-like Text mode except that various special commands are provided on the
-@kbd{C-c} prefix.  These commands all have to do specifically with
-editing or sending the message. 
-
-  Mail mode is normally used in buffers set up automatically by the
-@code{mail} command and related commands.  However, you can also switch
-to Mail mode in a file-visiting buffer.  This is a useful thing to do if
-you have saved the text of a draft message in a file.
+  In this section, we will describe some of the most commonly-used
+commands available in Message mode.
+@ifnottex
+Message mode also has its own manual, where its features are described
+in greater detail.  @xref{Top,,Message, message, Message}.
+@end ifnottex
 
 @menu
 * Mail Sending::        Commands to send the message.
 * Header Editing::      Commands to move to header fields and edit them.
-* Citing Mail::         Copying all or part of a message you are replying to.
-* Mail Mode Misc::      Spell checking, signatures, etc.
+* Citing Mail::         Quoting a message you are replying to.
+* Mail Misc::           Attachments, spell checking, etc.
 @end menu
 
 @node Mail Sending
 @subsection Mail Sending
 
-  Mail mode has two commands for sending the message you have been
-editing:
+  There are two commands to send a message you have been editing:
 
 @table @kbd
+@item C-c C-c
+Send the message, and deselect the mail buffer (@code{message-send-and-exit}).
 @item C-c C-s
-Send the message, and leave the mail buffer selected (@code{mail-send}).
-@item C-c C-c
-Send the message, and select some other buffer (@code{mail-send-and-exit}).
+Send the message, and leave the mail buffer selected (@code{message-send}).
 @end table
 
-@kindex C-c C-s @r{(Mail mode)}
-@kindex C-c C-c @r{(Mail mode)}
-@findex mail-send
-@findex mail-send-and-exit
-@vindex mail-send-hook
-  @kbd{C-c C-s} (@code{mail-send}) sends the message and marks the mail
-buffer unmodified, but leaves that buffer selected so that you can
-modify the message (perhaps with new recipients) and send it again.
-@kbd{C-c C-c} (@code{mail-send-and-exit}) sends and then deletes the
-window or switches to another buffer.  It puts the mail buffer at the
-lowest priority for reselection by default, since you are finished with
-using it.  This is the usual way to send the message.  Sending a message
-runs the hook @code{mail-send-hook}.
+@kindex C-c C-s @r{(Message mode)}
+@kindex C-c C-c @r{(Message mode)}
+@findex message-send
+  If you want to send a message and be done with it, type @kbd{C-c
+C-c} (@code{mail-send-and-exit}).  This sends the message and then
+either deletes the window or switches to another buffer.  It also
+``buries'' the mail buffer, putting it at the lowest priority for
+reselection.  This is the usual command for sending a message.
 
-@c Options not mentioned: mail-interactive, mail-use-dsn.
+@findex message-send-and-exit
+  The command @kbd{C-c C-s} (@code{message-send}) sends the message
+and marks the mail buffer unmodified, but leaves the buffer selected.
+Use this command if you want to modify the message (perhaps with new
+recipients) and send it again.
+
+@vindex message-send-hook
+  Sending a message runs the hook @code{message-send-hook}.
 
   In a file-visiting buffer, sending the message does not clear the
 modified flag, because only saving the file should do that.  Also, you
 don't get a warning if you try to send the same message twice.
 
-@c This is indexed in mule.texi, node "Recognize Coding".
-@c @vindex sendmail-coding-system
-  When you send a message that contains non-@acronym{ASCII} characters, they need
-to be encoded with a coding system (@pxref{Coding Systems}).  Usually
-the coding system is specified automatically by your chosen language
-environment (@pxref{Language Environments}).  You can explicitly specify
-the coding system for outgoing mail by setting the variable
-@code{sendmail-coding-system} (@pxref{Recognize Coding}).
-
-  If the coding system thus determined does not handle the characters in
-a particular message, Emacs asks you to select the coding system to use,
+@vindex sendmail-coding-system
+  When you send a message containing non-@acronym{ASCII} characters,
+they need to be encoded with a coding system (@pxref{Coding Systems}).
+Usually the coding system is specified automatically by your chosen
+language environment (@pxref{Language Environments}).  You can
+explicitly specify the coding system for outgoing mail by setting the
+variable @code{sendmail-coding-system} (@pxref{Recognize Coding}).  If
+the coding system thus determined does not handle the characters in a
+particular message, Emacs asks you to select the coding system to use,
 showing a list of possible coding systems.
 
-@c Not mentioned: mail-send-nonascii.
-
 @cindex SMTP
 @cindex Feedmail
 @cindex Sendmail
 @cindex Mailclient
 @vindex send-mail-function
   The variable @code{send-mail-function} controls how the default mail
-user agent sends mail.  It should be set to a function.  In most cases,
-the default is @code{sendmail-send-it}, which delivers mail using the
-Sendmail installation on the local host.  On Mac OS X and MS-Windows,
-however, the default is normally @code{mailclient-send-it}, which
-passes the mail buffer on to the system's designated mail client (see
-@file{mailclient.el}).  To send mail through an SMTP server, set
-@code{send-mail-function} to @code{smtpmail-send-it} and set up the
-Emacs SMTP library (@pxref{Top,,Emacs SMTP Library, smtpmail, Sending
-mail via SMTP}).  Another option is @code{feedmail-send-it} (see the
-commentary section of the @file{feedmail.el} package).
+user agent sends mail.  Its value should be a function, which can be
+one of the following:
+
+@table @code
+@item sendmail-send-it
+Send mail using the system's default @command{sendmail} (or
+@command{sendmail}-compatible) program.  This is the default on Unix
+and GNU, and works provided the system is a valid @dfn{mail host}
+(that is, provided it can deliver mail via SMTP).
+
+@item mailclient-send-it
+Pass the mail buffer on to the system's designated mail client (see
+@file{mailclient.el}).  This is the default on Mac OS X and
+MS-Windows.
+
+@item smtpmail-send-it
+Send mail through an external mail host (e.g., your Internet service
+provider's SMTP server).  You will need to tell Emacs how to contact
+the SMTP server, by customizing the variables
+@code{smtpmail-smtp-server} and @code{smtpmail-auth-credentials}.
+@xref{Top,,Emacs SMTP Library, smtpmail, Sending mail via SMTP}.
+
+@item feedmail-send-it
+This is similar to @code{sendmail-send-it}, but allows you to queue
+messages for later sending.  See the commentary section in the file
+@file{feedmail.el} for more information.
+@end table
 
 @node Header Editing
 @subsection Mail Header Editing
 
-  Mail mode provides special commands to move to particular header
-fields and to complete addresses in headers.
+  Message mode provides the following special commands to move to
+particular header fields and to complete addresses in headers.
 
 @table @kbd
 @item C-c C-f C-t
-Move to the @samp{To} header field, creating one if there is none
-(@code{mail-to}).
+Move to the @samp{To} header (@code{message-goto-to}).
 @item C-c C-f C-s
-Move to the @samp{Subject} header field, creating one if there is
-none (@code{mail-subject}).
+Move to the @samp{Subject} header (@code{message-goto-subject}).
 @item C-c C-f C-c
-Move to the @samp{CC} header field, creating one if there is none
-(@code{mail-cc}).
+Move to the @samp{CC} header (@code{message-goto-cc}).
 @item C-c C-f C-b
-Move to the @samp{BCC} header field, creating one if there is none
-(@code{mail-bcc}).
+Move to the @samp{BCC} header (@code{message-goto-bcc}).
 @item C-c C-f C-r
-Move to the @samp{Reply-To} header field, creating one if there is none
-(@code{mail-reply-to}).
-@item C-c C-f C-a
-Move to the @samp{Mail-Reply-To} header field, creating one if there is none
-(@code{mail-mail-reply-to}).
-@item C-c C-f C-l
-Move to the @samp{Mail-Followup-To} header field, creating one if there is none
-(@code{mail-mail-followup-to}).
+Move to the @samp{Reply-To} header (@code{message-goto-reply-to}).
 @item C-c C-f C-f
+Move to the @samp{Mail-Followup-To} header field
+(@code{message-goto-followup-to}).
+@item C-c C-f C-w
 Add a new @samp{FCC} header field, with file-name completion
-(@code{mail-fcc}).
-@c There is also C-c C-v, mail-sent-via, which adds one or more
-@c "Sent-via" headers, but I don't know what the point of that header is.
-@item M-@key{TAB}
-Complete a mailing address (@code{mail-complete}).
+(@code{message-goto-fcc}).
+@item C-c C-b
+Move to the start of the message body (@code{message-goto-body}).
+@item @key{TAB}
+Complete a mailing address (@code{message-tab}).
 @end table
 
-@kindex C-c C-f C-t @r{(Mail mode)}
-@findex mail-to
-@kindex C-c C-f C-s @r{(Mail mode)}
-@findex mail-subject
-@kindex C-c C-f C-c @r{(Mail mode)}
-@findex mail-cc
-@kindex C-c C-f C-b @r{(Mail mode)}
-@findex mail-bcc
-@kindex C-c C-f C-r @r{(Mail mode)}
-@findex mail-reply-to
-@kindex C-c C-f C-a @r{(Mail mode)}
-@findex mail-mail-reply-to
-@kindex C-c C-f C-l @r{(Mail mode)}
-@findex mail-mail-followup-to
-@kindex C-c C-f C-f @r{(Mail mode)}
-@findex mail-fcc
-  There are several commands to move point to particular header fields,
-all based on the prefix @kbd{C-c C-f} (@samp{C-f} is for ``field'').
-They are listed in the table above.  If the field in question does not
-exist, these commands create one (the exception is @code{mail-fcc},
-which creates a new field each time).  We provide special motion
-commands for these particular fields because they are the fields users
-most often want to edit.
+@kindex C-c C-f C-t @r{(Message mode)}
+@findex message-goto-to
+@kindex C-c C-f C-s @r{(Message mode)}
+@findex message-goto-subject
+@kindex C-c C-f C-c @r{(Message mode)}
+@findex message-goto-cc
+@kindex C-c C-f C-b @r{(Message mode)}
+@findex message-goto-bcc
+@kindex C-c C-f C-r @r{(Message mode)}
+@findex goto-reply-to
+@kindex C-c C-f C-f @r{(Message mode)}
+@findex goto-followup-to
+@kindex C-c C-f C-w @r{(Message mode)}
+@findex message-goto-fcc
+  The commands to move point to particular header fields are all based
+on the prefix @kbd{C-c C-f} (@samp{C-f} is for ``field'').  If the
+field in question does not exist, the command creates one (the
+exception is @code{mail-fcc}, which creates a new field each time).
 
-@findex mail-complete
-@kindex M-TAB @r{(Mail mode)}
-@c `mail-complete-alist' specifies the headers.
-  While editing a header field that contains mailing addresses, such
-as @samp{To:}, @samp{CC:} and @samp{BCC:}, you can complete a mailing
-address by typing @kbd{M-@key{TAB}} (@code{mail-complete}).  It
-inserts the full name corresponding to the address, if it can
-determine the full name.  The variable @code{mail-complete-style}
-controls whether to insert the full name, and what style to use, as in
-@code{mail-from-style} (@pxref{Mail Headers}).  (If your window
-manager defines @kbd{M-@key{TAB}} to switch windows, you can type
-@kbd{@key{ESC} @key{TAB}} or @kbd{C-M-i}.)
+@kindex C-c C-b @r{(Message mode)}
+@findex mail-text
+  The command @kbd{C-c C-b} (@code{message-goto-body}) moves point to
+just after the header separator line---that is, to the beginning of
+the body.
 
-  For completion purposes, the valid mailing addresses are taken to be
-the local users' names plus your personal mail aliases (@pxref{Mail
-Aliases}).  You can specify additional sources of valid addresses;
-browse the customization group @samp{mailalias} to see the variables for
-customizing this feature (@pxref{Customization Groups}).
-
-  If you type @kbd{M-@key{TAB}} in the body of the message, or on a
-unrecognized header, @code{mail-complete} invokes the function specified
-by @code{mail-complete-function}.  By default, this is
-@code{ispell-complete-word}, as in Text mode.
+@findex message-tab
+@kindex TAB @r{(Message mode)}
+  While editing a header field that contains addresses, such as
+@samp{To:}, @samp{CC:} and @samp{BCC:}, you can complete an address by
+typing @key{TAB} (@code{message-tab}).  This attempts to insert the
+full name corresponding to the address based on a couple of methods,
+including EUDC, a library that recognizes a number of directory server
+protocols (@pxref{Top,,EUDC,eudc, The Emacs Unified Directory
+Client}).  Failing that, it attempts to expand the address as a mail
+alias (@pxref{Mail Aliases}).  If point is on a header field that does
+not take addresses, or if it is in the message body, then @key{TAB}
+just inserts a tab character.
 
 @node Citing Mail
 @subsection Citing Mail
 @cindex citing mail
 
-  Mail mode also has commands for yanking or @dfn{citing} all or part of
-a message that you are replying to.  These commands are active only when
-you started sending a message using an Rmail command.
-
 @table @kbd
 @item C-c C-y
-Yank the selected message from Rmail (@code{mail-yank-original}).
-@item C-c C-r
-Yank the region from the Rmail buffer (@code{mail-yank-region}).
+Yank the selected message from Rmail (@code{message-yank-original}).
 @item C-c C-q
 Fill each paragraph cited from another message
-(@code{mail-fill-yanked-message}).
-@c There is also mail-split-line, but it does not seem very useful.
+(@code{message-fill-yanked-message}).
 @end table
 
-@kindex C-c C-y @r{(Mail mode)}
-@findex mail-yank-original
-  When mail sending is invoked from the Rmail mail reader using an Rmail
-command, @kbd{C-c C-y} can be used inside the mail buffer to insert the
-text of the message you are replying to.  Normally it indents each line
-of that message three spaces and eliminates most header fields (as
-specified by the variable @code{mail-yank-ignored-headers}).  A numeric
-argument specifies the number of spaces to indent (the variable
-@code{mail-indentation-spaces} specifies the default number).  An
-argument of just @kbd{C-u} says not to indent at all and not to
-eliminate anything.  @kbd{C-c C-y} always uses the current message from
-the Rmail buffer, so you can insert several old messages by selecting
-one in Rmail, switching to @samp{*mail*} and yanking it, then switching
-back to Rmail to select another.
+@kindex C-c C-y @r{(Message mode)}
+@findex message-yank-original
+@findex message-yank-prefix
+  You can use the command @kbd{C-c C-y} (@code{message-yank-original})
+to @dfn{cite} a message that you are replying to.  This inserts the
+text of that message into the mail buffer.  This command is active
+only when the mail buffer is invoked from a mail program running in
+Emacs, such as Rmail.
 
-@vindex mail-yank-prefix
-  You can specify the text for @kbd{C-c C-y} to insert at the beginning
-of each line: set @code{mail-yank-prefix} to the desired string.  (A
-value of @code{nil} means to use indentation; this is the default.)
-However, @kbd{C-u C-c C-y} never adds anything at the beginning of the
-inserted lines, regardless of the value of @code{mail-yank-prefix}.
+  By default, Emacs inserts the string @samp{>} in front of each line
+of the cited text; this prefix string is specified by the variable
+@code{message-yank-prefix}.  If you call @code{message-yank-original}
+with a prefix argument, the citation prefix is not inserted.
 
-@kindex C-c C-r @r{(Mail mode)}
-@findex mail-yank-region
-  To yank just a part of an incoming message, set the region in Rmail to
-the part you want; then go to the @samp{*Mail*} message and type
-@kbd{C-c C-r} (@code{mail-yank-region}).  Each line that is copied is
-indented or prefixed according to @code{mail-yank-prefix}.
-
-@kindex C-c C-q @r{(Mail mode)}
+@kindex C-c C-q @r{(Message mode)}
 @findex mail-fill-yanked-message
-  After using @kbd{C-c C-y} or @kbd{C-c C-r}, you can type @kbd{C-c C-q}
-(@code{mail-fill-yanked-message}) to fill the paragraphs of the yanked
-old message or messages.  One use of @kbd{C-c C-q} fills all such
-paragraphs, each one individually.  To fill a single paragraph of the
-quoted message, use @kbd{M-q}.  If filling does not automatically
-handle the type of citation prefix you use, try setting the fill prefix
+  After using @kbd{C-c C-y}, you can type @kbd{C-c C-q}
+(@code{message-fill-yanked-message}) to fill the paragraphs of the
+cited message.  One use of @kbd{C-c C-q} fills all such paragraphs,
+each one individually.  To fill a single paragraph of the quoted
+message, use @kbd{M-q}.  If filling does not automatically handle the
+type of citation prefix you use, try setting the fill prefix
 explicitly.  @xref{Filling}.
 
 @vindex mail-citation-hook
@@ -657,91 +547,103 @@
 package, which provides more flexible citation
 (@pxref{Introduction,,,sc, Supercite}).
 
-@c No need to mention: mail-citation-prefix-regexp.
-
-@node Mail Mode Misc
-@subsection Mail Mode Miscellany
+@node Mail Misc
+@subsection Mail Miscellany
 
-@table @kbd
-@item C-c C-t
-Move to the beginning of the message body text (@code{mail-text}).
-@item C-c C-w
-Insert a signature at the end of the message text (@code{mail-signature}).
-@item C-c C-i @var{file} @key{RET}
-Insert the contents of @var{file} at the end of the message text
-(@code{mail-attach-file}).
-@item M-x ispell-message
-Perform spelling correction on the message text, but not on citations from
-other messages, or the message headers.
-@end table
-
-@kindex C-c C-t @r{(Mail mode)}
-@findex mail-text
-  @kbd{C-c C-t} (@code{mail-text}) moves point to just after the header
-separator line---that is, to the beginning of the message body text.
+@kindex C-c C-a @r{(Message mode)}
+@findex mail-attach-file
+@cindex MIME
+@cindex Multipurpose Internet Mail Extensions
+  You can @dfn{attach} a file to an outgoing message by typing
+@kbd{C-c C-a} (@code{mml-attach-file}) in the mail buffer.  Attaching
+is done using the MIME (Multipurpose Internet Mail Extensions)
+standard.
 
-@kindex C-c C-w @r{(Mail mode)}
-@findex mail-signature
-@vindex mail-signature
-  @kbd{C-c C-w} (@code{mail-signature}) adds a standard piece of text
-(your @dfn{mail signature}) at the end of the message to say more about who
-you are.  For example, it may contain telephone numbers, or your
-physical location.  The text comes from the variable
-@code{mail-signature}.  It can be a fixed string, or a Lisp expression
-that returns a string.  If it is @code{t} or @code{nil}, the function
-inserts the contents of the file @code{mail-signature-file}.  By
-default, this is the file @file{~/.signature} in your home directory.
+  The @code{mml-attach-file} command prompts for the name of the file,
+and for the attachment's @dfn{content type}, @dfn{description}, and
+@dfn{disposition}.  The content type is normally detected
+automatically; just type @key{RET} to accept the default.  The
+description is a single line of text that the recipient will see next
+to the attachment; you may also choose to leave this empty.  The
+disposition is either @samp{inline} (the default), which means the
+recipient will see a link to the attachment within the message body,
+or @samp{attachment}, which means the link will be separate from the
+body.
 
-  If the variable @code{mail-signature} has a non-@code{nil} value,
-starting a mail automatically inserts your signature.  Otherwise, you
-must explicitly use the command @code{mail-signature}.  If you want to
-omit your signature from a particular message, just delete it from the
-buffer before you send the message.
+  The actual contents of the attached file are not inserted into the
+mail buffer.  Instead, some placeholder text is inserted into the mail
+buffer, like this:
 
-  Convention says that the start of your signature should be marked by a
-line whose contents are @samp{-- }.  If your signature comes from a
-file, this prefix is added for you, but in all other cases you must add
-it yourself.  The remainder of your signature should be no more than
-four lines.
+@smallexample
+<#part type="text/plain" filename="~/foo.txt" disposition=inline>
+<#/part>
+@end smallexample
+
+@noindent
+When you type @kbd{C-c C-c} or @kbd{C-c C-s} to send the message, the
+attached file will be delivered with it.
 
 @findex ispell-message
-  You can do spelling correction on the message text you have written
-with the command @kbd{M-x ispell-message}.  If you have yanked an
-incoming message into the outgoing draft, this command skips what was
-yanked, but it checks the text that you yourself inserted.  (It looks
-for indentation or @code{mail-yank-prefix} to distinguish the cited
-lines from your input.)  @xref{Spelling}.
-
-@kindex C-c C-i @r{(Mail mode)}
-@findex mail-attach-file
-  To include a file in the outgoing message, you can use @kbd{C-x i},
-the usual command to insert a file in the current buffer.  But it is
-often more convenient to use a special command, @kbd{C-c C-i}
-(@code{mail-attach-file}).  This command inserts the file contents at
-the end of the buffer, after your signature (if any), with a delimiter
-line that includes the file name.  Note that this is not a MIME
-attachment.
+  While composing a message, you can do spelling correction on the
+message text by typing @kbd{M-x ispell-message}.  If you have yanked
+an incoming message into the outgoing draft, this command skips what
+was yanked, but it checks the text that you yourself inserted (it
+looks for indentation or @code{mail-yank-prefix} to distinguish the
+cited lines from your input).  @xref{Spelling}.
 
 @vindex mail-mode-hook
 @vindex mail-setup-hook
-  Turning on Mail mode (which @kbd{C-x m} does automatically) runs the
-normal hooks @code{text-mode-hook} and @code{mail-mode-hook}.
+  Turning on Message mode (which @kbd{C-x m} does automatically) runs
+the normal hooks @code{text-mode-hook} and @code{message-mode-hook}.
 Initializing a new outgoing message runs the normal hook
-@code{mail-setup-hook}; if you want to add special fields to your mail
-header or make other changes to the appearance of the mail buffer, use
-that hook.  @xref{Hooks}.
+@code{message-setup-hook}; you can use this hook if you want to make
+changes to the appearance of the mail buffer.  @xref{Hooks}.
 
   The main difference between these hooks is just when they are
-invoked.  Whenever you type @kbd{M-x mail}, @code{mail-mode-hook} runs
-as soon as the @samp{*mail*} buffer is created.  Then the
-@code{mail-setup} function inserts the default contents of the buffer.
-After these default contents are inserted, @code{mail-setup-hook} runs.
+invoked.  Whenever you type @kbd{C-x m}, @code{message-mode-hook} runs
+as soon as the mail buffer is created.  Then the @code{message-setup}
+function inserts the default contents of the buffer.  After these
+default contents are inserted, @code{message-setup-hook} runs.
+
+  If you use @kbd{C-x m} to continue an existing composition,
+@code{message-mode-hook} runs immediately after switching to the mail
+buffer.  If the buffer is unmodified, or if you decide to erase it and
+start again, @code{message-setup-hook} runs after the default contents
+are inserted.
+
+@node Mail Signature
+@section Mail Signature
 
-  If you use @kbd{M-x mail} to continue an existing composition,
-@code{mail-mode-hook} runs immediately after switching to the
-@samp{*mail*} buffer.  If the buffer is unmodified, or if you decide to
-erase it and start again, @code{mail-setup-hook} runs after the default
-contents are inserted.
+@cindex mail signature
+@vindex mail-signature-file
+@vindex mail-signature
+  You can add a standard piece of text---your @dfn{mail
+signature}---to the end of every message.  This signature may contain
+information such as your telephone number or your physical location.
+The variable @code{mail-signature} determines how Emacs handles the
+mail signature.
+
+  The default value of @code{mail-signature} is @code{t}; this means
+to look for your mail signature in the file @file{~/.signature}.  If
+this file exists, its contents are automatically inserted into the end
+of the mail buffer.  You can change the signature file via the
+variable @code{mail-signature-file}.
+
+  If you change @code{mail-signature} to a string, that specifies the
+text of the signature directly.
+
+@kindex C-c C-w @r{(Message mode)}
+@findex message-insert-signature
+  If you change @code{mail-signature} to @code{nil}, Emacs will not
+insert your mail signature automatically.  You can insert your mail
+signature by typing @kbd{C-c C-w} (@code{message-insert-signature}) in
+the mail buffer.  Emacs will look for your signature in the signature
+file.
+
+  By convention, a mail signature should be marked by a line whose
+contents are @samp{-- }.  If your signature lacks this prefix, it is
+added for you.  The remainder of your signature should be no more than
+four lines.
 
 @node Mail Amusements
 @section Mail Amusements
@@ -778,28 +680,32 @@
 @node Mail Methods
 @section Mail-Composition Methods
 @cindex mail-composition methods
+@cindex Mail mode
+@cindex mode, Mail
 
 @cindex MH mail interface
 @cindex Message mode for sending mail
   In this chapter we have described the usual Emacs mode for editing
-and sending mail---Mail mode.  Emacs has alternative facilities for
-editing and sending mail, including
-MH-E and Message mode, not documented in this manual.
-@xref{Top,,MH-E,mh-e, The Emacs Interface to MH}.  @xref{Top,,Message,message,
-Message Manual}.  You can choose any of them as your preferred method.
-The commands @code{C-x m}, @code{C-x 4 m} and @code{C-x 5 m} use
-whichever agent you have specified, as do various other Emacs commands
-and facilities that send mail.
+and sending mail---Message mode.  This is only one of several
+available modes.  Prior to Emacs 23.2, the default mode was Mail mode,
+which is similar to Message mode in many respects but lacks features
+such as MIME support.  Another available mode is MH-E
+(@pxref{Top,,MH-E,mh-e, The Emacs Interface to MH}).
 
 @vindex mail-user-agent
-  To specify your mail-composition method, customize the variable
-@code{mail-user-agent}.  Currently legitimate values include
-@code{sendmail-user-agent} (Mail mode), @code{mh-e-user-agent},
-@code{message-user-agent} and @code{gnus-user-agent}.
+  You can choose any of these @dfn{mail user agents} as your preferred
+method for editing and sending mail.  The commands @code{C-x m},
+@code{C-x 4 m} and @code{C-x 5 m} use whichever agent you have
+specified; so do various other parts of Emacs that send mail, such as
+the bug reporter (@pxref{Bugs}).  To specify a mail user agent,
+customize the variable @code{mail-user-agent}.  Currently, legitimate
+values include @code{message-user-agent} (Message mode)
+@code{sendmail-user-agent} (Mail mode), @code{gnus-user-agent}, and
+@code{mh-e-user-agent}.
 
   If you select a different mail-composition method, the information
-in this chapter about the @samp{*mail*} buffer and Mail mode does not
-apply; the other methods use a different format of text in a different
+in this chapter about the mail buffer and Message mode does not apply;
+the other methods use a different format of text in a different
 buffer, and their commands are different as well.
 
 @vindex read-mail-command
--- a/doc/emacs/text.texi	Fri Mar 26 08:01:19 2010 +0100
+++ b/doc/emacs/text.texi	Thu Apr 01 08:50:44 2010 +0200
@@ -26,11 +26,16 @@
 @xref{Outline Mode}.
 @end iftex
 
+@cindex nXML mode
+@cindex mode, XML
+@cindex mode, nXML
+@findex nxml-mode
   Emacs has other major modes for text which contains ``embedded''
-commands, such as @TeX{} and La@TeX{} (@pxref{TeX Mode}); HTML, SGML,
-and XML (@pxref{HTML Mode}); and Groff and Nroff (@pxref{Nroff Mode}).
-In addition, you can edit formatted text in WYSIWYG style (``what you
-see is what you get''), using Enriched mode (@pxref{Formatted Text}).
+commands, such as @TeX{} and La@TeX{} (@pxref{TeX Mode}); HTML and
+SGML (@pxref{HTML Mode}); XML (@pxref{Top, nXML Mode,,nxml-mode, nXML
+Mode}); and Groff and Nroff (@pxref{Nroff Mode}).  In addition, you
+can edit formatted text in WYSIWYG style (``what you see is what you
+get''), using Enriched mode (@pxref{Formatted Text}).
 
 @cindex ASCII art
   If you need to edit pictures made out of text characters (commonly
@@ -61,7 +66,7 @@
 * Text Mode::	        The major modes for editing text files.
 * Outline Mode::        Editing outlines.
 * TeX Mode::	        Editing input to the formatter TeX.
-* HTML Mode::           Editing HTML, SGML, and XML files.
+* HTML Mode::           Editing HTML and SGML files.
 * Nroff Mode::	        Editing input to the formatter nroff.
 * Formatted Text::      Editing formatted text directly in WYSIWYG fashion.
 * Text Based Tables::   Editing text-based tables in WYSIWYG fashion.
@@ -923,10 +928,10 @@
 @vindex text-mode-hook
   Entering Text mode runs the hook @code{text-mode-hook}.  Other major
 modes related to Text mode also run this hook, followed by hooks of
-their own; this includes Paragraph-Indent Text mode, Nroff mode, @TeX{}
-mode, Outline mode, and Mail mode.  Hook functions on
-@code{text-mode-hook} can look at the value of @code{major-mode} to see
-which of these modes is actually being entered.  @xref{Hooks}.
+their own; this includes Paragraph-Indent Text mode, Nroff mode,
+@TeX{} mode, Outline mode, and Message mode.  Hook functions on
+@code{text-mode-hook} can look at the value of @code{major-mode} to
+see which of these modes is actually being entered.  @xref{Hooks}.
 
 @node Outline Mode
 @section Outline Mode
@@ -1743,29 +1748,17 @@
 Ref@TeX{}.  @inforef{Top,, reftex}.
 
 @node HTML Mode
-@section SGML, XML, and HTML Modes
+@section SGML and HTML Modes
 @cindex SGML mode
 @cindex HTML mode
-@cindex XML mode
 @cindex mode, SGML
 @cindex mode, HTML
-@cindex mode, XML
 @findex sgml-mode
 @findex html-mode
-@findex xml-mode
-
-  The major modes for SGML, XML, and HTML provide indentation support
-and commands for operating on tags.  XML mode is actually identical to
-SGML mode (to be precise, @code{xml-mode} is an alias for
-@code{sgml-mode}), because XML is a strict subset of SGML.  HTML mode
-is a slightly customized variant of SGML mode.
-
-@vindex sgml-xml-mode
-  In XML, every opening tag must have an explicit closing tag.  When
-the variable @code{sgml-xml-mode} is non-@code{nil}, the tag insertion
-commands described below always insert explicit closing tags as well.
-When you visit a file, Emacs determines whether it is XML by examining
-the file contents, and sets @code{sgml-xml-mode} accordingly.
+
+  The major modes for SGML and HTML provide indentation support and
+commands for operating on tags.  HTML mode is a slightly customized
+variant of SGML mode.
 
 @table @kbd
 @item C-c C-n
@@ -1855,13 +1848,22 @@
 @cindex mode, nXML
 @findex nxml-mode
 @cindex XML schema
-  Emacs also provides a more advanced mode for editing XML
-documents, called nXML mode (@code{nxml-mode}).  nXML mode is aware of
-many existing XML schema, and uses them to provide completion of XML
-elements via @kbd{C-@key{RET}} or @kbd{M-@key{TAB}}, as well as
-``on-the-fly'' validation of XML, with errors highlighted via Font
-Lock (@pxref{Font Lock}).  It is described in its own manual.
-@xref{Top, nXML Mode,,nxml-mode, nXML Mode}.
+  The default mode for editing XML documents is called nXML mode
+(@code{xml-mode} or @code{nxml-mode}).  This is a powerful major mode
+that can recognize many existing XML schema and use them to provide
+completion of XML elements via @kbd{C-@key{RET}} or @kbd{M-@key{TAB}},
+as well as ``on-the-fly'' XML validation with error highlighting.  It
+is described in its own manual.  @xref{Top, nXML Mode,,nxml-mode, nXML
+Mode}.
+
+@vindex sgml-xml-mode
+  However, you can also use SGML mode to edit XML, since XML is a
+strict subset of SGML.  In XML, every opening tag must have an
+explicit closing tag.  When the variable @code{sgml-xml-mode} is
+non-@code{nil}, the tag insertion commands described above always
+insert explicit closing tags as well.  When you visit a file in SGML
+mode, Emacs determines whether it is XML by examining the file
+contents, and sets @code{sgml-xml-mode} accordingly.
 
 @node Nroff Mode
 @section Nroff Mode
--- a/doc/lispref/ChangeLog	Fri Mar 26 08:01:19 2010 +0100
+++ b/doc/lispref/ChangeLog	Thu Apr 01 08:50:44 2010 +0200
@@ -1,3 +1,8 @@
+2010-03-26  Chong Yidong  <cyd@stupidchicken.com>
+
+	* loading.texi (Hooks for Loading): Document after-load-functions.
+	Copyedits.
+
 2010-03-24  Arni Magnusson  <arnima@hafro.is>  (tiny change)
 
 	* frames.texi (Cursor Parameters): Fix typo.  (Bug#5760)
--- a/doc/lispref/loading.texi	Fri Mar 26 08:01:19 2010 +0100
+++ b/doc/lispref/loading.texi	Thu Apr 01 08:50:44 2010 +0200
@@ -920,8 +920,17 @@
 @cindex loading hooks
 @cindex hooks for loading
 
-You can ask for code to be executed if and when a particular library is
-loaded, by calling @code{eval-after-load}.
+You can ask for code to be executed each time Emacs loads a library,
+by using the variable @code{after-load-functions}:
+
+@defvar after-load-functions
+This abnormal hook is run after loading a file.  Each function in the
+hook is called with a single argument, the absolute filename of the
+file that was just loaded.
+@end defvar
+
+If you want code to be executed when a @emph{particular} library is
+loaded, use the function @code{eval-after-load}:
 
 @defun eval-after-load library form
 This function arranges to evaluate @var{form} at the end of loading
@@ -930,7 +939,7 @@
 Don't forget to quote @var{form}!
 
 You don't need to give a directory or extension in the file name
-@var{library}---normally you just give a bare file name, like this:
+@var{library}.  Normally, you just give a bare file name, like this:
 
 @example
 (eval-after-load "edebug" '(def-edebug-spec c-point t))
@@ -955,31 +964,30 @@
 execution of the rest of @var{form}.
 @end defun
 
-In general, well-designed Lisp programs should not use this feature.
-The clean and modular ways to interact with a Lisp library are (1)
-examine and set the library's variables (those which are meant for
-outside use), and (2) call the library's functions.  If you wish to
-do (1), you can do it immediately---there is no need to wait for when
-the library is loaded.  To do (2), you must load the library (preferably
-with @code{require}).
+Normally, well-designed Lisp programs should not use
+@code{eval-after-load}.  If you need to examine and set the variables
+defined in another library (those meant for outside use), you can do
+it immediately---there is no need to wait until the library is loaded.
+If you need to call functions defined by that library, you should load
+the library, preferably with @code{require} (@pxref{Named Features}).
 
 But it is OK to use @code{eval-after-load} in your personal
-customizations if you don't feel they must meet the design standards for
-programs meant for wider use.
+customizations if you don't feel that they must meet the design
+standards for programs meant for wider use.
 
 @defvar after-load-alist
-This variable, an alist built by @code{eval-after-load}, holds the
-expressions to evaluate when particular libraries are loaded.  Each
-element looks like this:
+This variable stores an alist built by @code{eval-after-load},
+containing the expressions to evaluate when certain libraries are
+loaded.  Each element looks like this:
 
 @example
 (@var{regexp-or-feature} @var{forms}@dots{})
 @end example
 
 The key @var{regexp-or-feature} is either a regular expression or a
-symbol, and the value is a list of forms.  The forms are evaluated when
-the key matches the absolute true name of the file being
-@code{load}ed or the symbol being @code{provide}d.
+symbol, and the value is a list of forms.  The forms are evaluated
+when the key matches the absolute true name or feature name of the
+library being loaded.
 @end defvar
 
 @ignore
--- a/doc/misc/ChangeLog	Fri Mar 26 08:01:19 2010 +0100
+++ b/doc/misc/ChangeLog	Thu Apr 01 08:50:44 2010 +0200
@@ -1,3 +1,13 @@
+2010-03-31  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* gnus.texi (MIME Commands): Update description of
+	gnus-article-browse-html-article.
+
+2010-03-27  Teodor Zlatanov  <tzz@lifelogs.com>
+
+	* auth.texi (Secret Service API): Add TODO node.
+	(Help for users): Explain the new source options for `auth-sources'.
+
 2010-03-24  Michael Albinus  <michael.albinus@gmx.de>
 
 	* trampver.texi: Update release number.
--- a/doc/misc/auth.texi	Fri Mar 26 08:01:19 2010 +0100
+++ b/doc/misc/auth.texi	Thu Apr 01 08:50:44 2010 +0200
@@ -57,6 +57,7 @@
 @menu
 * Overview::                    Overview of the auth-source library.
 * Help for users::              
+* Secret Service API::          
 * Help for developers::         
 * Index::                       
 * Function Index::              
@@ -68,15 +69,15 @@
 @chapter Overview
 
 The auth-source library is simply a way for Emacs and Gnus, among
-others, to find the answer to the old burning question ``I have a
-server name and a port, what are my user name and password?''
+others, to answer the old burning question ``I have a server name and
+a port, what are my user name and password?''
 
 The auth-source library actually supports more than just the user name
 (known as the login) or the password, but only those two are in use
-today in Emacs or Gnus.  Similarly, the auth-source library can in
-theory support multiple storage formats, but currently it only
-understands the classic ``netrc'' format, examples of which you can
-see later in this document.
+today in Emacs or Gnus.  Similarly, the auth-source library supports
+multiple storage formats, currently either the classic ``netrc''
+format, examples of which you can see later in this document, or the
+Secret Service API.
 
 @node Help for users
 @chapter Help for users
@@ -120,17 +121,21 @@
 @defvar auth-sources
 
 The @code{auth-sources} variable tells the auth-source library where
-your netrc files live for a particular host and protocol.  While you
-can get fancy, the default and simplest configuration is:
+your netrc files or Secret Service API collection items live for a
+particular host and protocol.  While you can get fancy, the default
+and simplest configuration is:
 
 @lisp
+;;; old default: required :host and :protocol, not needed anymore
 (setq auth-sources '((:source "~/.authinfo.gpg" :host t :protocol t)))
+;;; mostly equivalent (see below about fallbacks) but shorter:
+(setq auth-sources '((:source "~/.authinfo.gpg")))
 @end lisp
 
 This says ``for any host and any protocol, use just that one file.''
-Sweet simplicity.  In fact, this is already the default, so unless you
-want to move your netrc file, it will just work if you have that
-file.  You may not, though, so make sure it exists.
+Sweet simplicity.  In fact, the latter is already the default, so
+unless you want to move your netrc file, it will just work if you have
+that file.  Make sure it exists.
 
 By adding multiple entries to @code{auth-sources} with a particular
 host or protocol, you can have specific netrc files for that host or
@@ -138,6 +143,35 @@
 shared netrc files or some other unusual setup (90% of Emacs users
 have unusual setups and the remaining 10% are @emph{really} unusual).
 
+Here's an example that uses the Secret Service API for all lookups,
+using the default collection:
+
+@lisp
+(setq auth-sources '((:source (:secrets default))))
+@end lisp
+
+And here's a mixed example, using two sources:
+
+@lisp
+(setq auth-sources '((:source (:secrets default) :host "myserver" :user "joe")
+                     (:source "~/.authinfo.gpg")))
+@end lisp
+
+The best match is determined by order (starts from the bottom) only
+for the first pass, where things are checked exactly.  In the example
+above, the first pass would find a single match for host
+@code{myserver}.  The netrc choice would fail because it matches any
+host and protocol implicitly (as a @emph{fallback}).  A specified
+value of @code{:host t} in @code{auth-sources} is considered a match
+on the first pass, unlike a missing @code{:host}.
+
+Now if you look for host @code{missing}, it won't match either source
+explicitly.  The second pass (the @emph{fallback} pass) will look at
+all the implicit matches and collect them.  They will be scored and
+returned sorted by score.  The score is based on the number of
+explicit parameters that matched. See the @code{auth-pick} function
+for details.
+
 @end defvar
 
 If you don't customize @code{auth-sources}, you'll have to live with
@@ -190,25 +224,32 @@
 earlier.  Since Tramp has about 88 connection methods, this may be
 necessary if you have an unusual (see earlier comment on those) setup.
 
+@node Secret Service API
+@chapter Secret Service API
+
+TODO: how does it work generally, how does secrets.el work, some examples.
+
 @node Help for developers
 @chapter Help for developers
 
 The auth-source library only has one function for external use.
 
-@defun auth-source-user-or-password mode host port
+@defun auth-source-user-or-password mode host port &optional username
 
 Retrieve appropriate authentication tokens, determined by @var{mode},
-for host @var{host} and @var{port}.  If @code{auth-source-debug} is t,
-debugging messages will be printed.  Set @code{auth-source-debug} to a
-function to use that function for logging.  The parameters passed will
-be the same that the @code{message} function takes, that is, a string
+for host @var{host} and @var{port}.  If @var{username} is provided it
+will also be checked.  If @code{auth-source-debug} is t, debugging
+messages will be printed.  Set @code{auth-source-debug} to a function
+to use that function for logging.  The parameters passed will be the
+same that the @code{message} function takes, that is, a string
 formatting spec and optional parameters.
 
 If @var{mode} is a list of strings, the function will return a list of
 strings or @code{nil} objects (thus you can avoid parsing the netrc
-file more than once).  If it's a string, the function will return a
-string or a @code{nil} object.  Currently only the modes ``login'' and
-``password'' are recognized but more may be added in the future.
+file or checking the Secret Service API more than once).  If it's a
+string, the function will return a string or a @code{nil} object.
+Currently only the modes ``login'' and ``password'' are recognized but
+more may be added in the future.
 
 @var{host} is a string containing the host name.
 
@@ -216,6 +257,8 @@
 a port number.  It must be a string, corresponding to the port in the
 users' netrc files.
 
+@var{username} contains the user name (e.g. ``joe'') as a string.
+
 @example
 ;; IMAP example
 (setq auth (auth-source-user-or-password
--- a/doc/misc/calc.texi	Fri Mar 26 08:01:19 2010 +0100
+++ b/doc/misc/calc.texi	Thu Apr 01 08:50:44 2010 +0200
@@ -12167,7 +12167,7 @@
 their default values, then settings from the file you named are loaded
 if this file exists, and this file becomes the one that Calc will
 use in the future for commands like @kbd{m m}.  The default settings
-file name is @file{~/.calc.el}.  You can see the current file name by
+file name is @file{~/.emacs.d/calc.el}.  You can see the current file name by
 giving a blank response to the @kbd{m F} prompt.  See also the
 discussion of the @code{calc-settings-file} variable; @pxref{Customizing Calc}.
 
@@ -16006,7 +16006,7 @@
 Selections show deep structure (@kbd{j b}; @pxref{Making Selections}).
 
 @item Save
-Record modes in @file{~/.calc.el} (@kbd{m R}; @pxref{General Mode Commands}).
+Record modes in @file{~/.emacs.d/calc.el} (@kbd{m R}; @pxref{General Mode Commands}).
 
 @item Local
 Record modes in Embedded buffer (@kbd{m R}).
@@ -28108,7 +28108,7 @@
 @cindex Calc init file, user-defined units
 The @kbd{u p} (@code{calc-permanent-units}) command stores the user-defined
 units in your Calc init file (the file given by the variable
-@code{calc-settings-file}, typically @file{~/.calc.el}), so that the
+@code{calc-settings-file}, typically @file{~/.emacs.d/calc.el}), so that the
 units will still be available in subsequent Emacs sessions.  If there
 was already a set of user-defined units in your Calc init file, it
 is replaced by the new set.  (@xref{General Mode Commands}, for a way to
@@ -28509,7 +28509,7 @@
 @cindex Calc init file, variables
 The @kbd{s p} (@code{calc-permanent-variable}) command saves a
 variable's value permanently in your Calc init file (the file given by
-the variable @code{calc-settings-file}, typically @file{~/.calc.el}), so
+the variable @code{calc-settings-file}, typically @file{~/.emacs.d/calc.el}), so
 that its value will still be available in future Emacs sessions.  You
 can re-execute @w{@kbd{s p}} later on to update the saved value, but the
 only way to remove a saved variable is to edit your calc init file
@@ -30862,7 +30862,7 @@
 which are also available outside of Embedded mode.  
 (@pxref{General Mode Commands}.) They are @code{Save},  in which mode
 settings are recorded permanently in your Calc init file (the file given
-by the variable @code{calc-settings-file}, typically @file{~/.calc.el})
+by the variable @code{calc-settings-file}, typically @file{~/.emacs.d/calc.el})
 rather than by annotating the current document, and no-recording
 mode (where there is no symbol like @code{Save} or @code{Local} in
 the mode line), in which mode-changing commands do not leave any
@@ -31122,7 +31122,7 @@
 binding permanent so that it will remain in effect even in future Emacs
 sessions.  (It does this by adding a suitable bit of Lisp code into
 your Calc init file; that is, the file given by the variable
-@code{calc-settings-file}, typically @file{~/.calc.el}.)  For example,
+@code{calc-settings-file}, typically @file{~/.emacs.d/calc.el}.)  For example,
 @kbd{Z P s} would register our @code{sincos} command permanently.  If
 you later wish to unregister this command you must edit your Calc init
 file by hand.  (@xref{General Mode Commands}, for a way to tell Calc to
@@ -31855,7 +31855,7 @@
 
 A good place to put your @code{defmath} commands is your Calc init file
 (the file given by @code{calc-settings-file}, typically
-@file{~/.calc.el}), which will not be loaded until Calc starts.
+@file{~/.emacs.d/calc.el}), which will not be loaded until Calc starts.
 If a file named @file{.emacs} exists in your home directory, Emacs reads
 and executes the Lisp forms in this file as it starts up.  While it may
 seem reasonable to put your favorite @code{defmath} commands there,
@@ -34956,7 +34956,9 @@
 @code{nil}, then Calc will automatically load your settings file (if it
 exists) the first time Calc is invoked.
 
-The default value for this variable is @code{"~/.calc.el"}.
+The default value for this variable is @code{"~/.emacs.d/calc.el"}
+unless the file @file{~/.calc.el} exists, in which case the default
+value will be @code{"~/.calc.el"}.
 @end defvar
 
 @defvar calc-gnuplot-name
--- a/doc/misc/gnus.texi	Fri Mar 26 08:01:19 2010 +0100
+++ b/doc/misc/gnus.texi	Thu Apr 01 08:50:44 2010 +0200
@@ -10506,17 +10506,24 @@
 @kindex K H (Summary)
 @findex gnus-article-browse-html-article
 View @samp{text/html} parts of the current article with a WWW browser.
-The message header is added to the beginning of every html part unless
-the prefix argument is given.
-
-Warning: Spammers use links to images in HTML articles to verify whether
-you have read the message.  As this command passes the @acronym{HTML}
-content to the browser without eliminating these ``web bugs'' you should
-only use it for mails from trusted senders.
+Inline images embedded in a message using the @code{cid} scheme, as they
+are generally considered to be safe, will be processed properly.  The
+message header is added to the beginning of every @acronym{HTML} part
+unless the prefix argument is given.
+
+Warning: Spammers use links to images (using the @code{http} scheme) in
+@acronym{HTML} articles to verify whether you have read the message.  As
+this command passes the @acronym{HTML} content to the browser without
+eliminating these ``web bugs'' you should only use it for mails from
+trusted senders.
 
 If you always want to display @acronym{HTML} parts in the browser, set
 @code{mm-text-html-renderer} to @code{nil}.
 
+This command creates temporary files to pass @acronym{HTML} contents
+including images if any to the browser, and deletes them when exiting
+the group (if you want).
+
 @item K b
 @kindex K b (Summary)
 Make all the @acronym{MIME} parts have buttons in front of them.  This is
--- a/etc/ChangeLog	Fri Mar 26 08:01:19 2010 +0100
+++ b/etc/ChangeLog	Thu Apr 01 08:50:44 2010 +0200
@@ -1,3 +1,21 @@
+2010-03-30  Chong Yidong  <cyd@stupidchicken.com>
+
+	* images/icons/hicolor/scalable/apps/emacs.svg: Put preamble after
+	svg tag (Bug#5790).
+
+2010-03-30  Eli Zaretskii  <eliz@gnu.org>
+
+	* PROBLEMS: Mention problems on MS-Windows with incompatible
+	regex.h headers.
+
+2010-03-28  Eli Zaretskii  <eliz@gnu.org>
+
+	* HELLO: Reorder Arabic and Hebrew into logical order, and
+	insert RLM before the opening paren, to make the display more
+	reasonable.  Add setting for bidi-display-reordering in the local
+	variables section.
+	* NEWS: Mention initial support for bidirectional editing.
+
 2010-03-24  Francesc Rocher  <rocher@member.fsf.org>
 
 	* MORE.STUFF: Remove CEDET entry, now distributed as part of
--- a/etc/HELLO	Fri Mar 26 08:01:19 2010 +0100
+++ b/etc/HELLO	Thu Apr 01 08:50:44 2010 +0200
@@ -16,7 +16,7 @@
 LANGUAGE (NATIVE NAME)	HELLO
 ----------------------	-----
 Amharic ($,1O M[MmN{(B)	$,1M`MKM](B
-Arabic (,GIqjHQYdG(B)	,GecjdY(B ,GeGdqSdG(B
+Arabic $,1ro(B(,GGdYQHjqI(B)	,GecjdY(B ,GeGdqSdG(B
 Bengali ($,17,7>6b727>(B)	$,17(7.787M6u7>70(B
 Braille	$,2(3(1('('(5(B
 Burmese ($,1H9HYH;H4HYrlH9HL(B)	$,1H9H$HYrmH"H<HLH5HL(B
@@ -34,7 +34,7 @@
 German (Deutsch)	Guten Tag / Gr,A|_(B Gott
 Greek (,Fekkgmij\(B)	,FCei\(B ,Fsar(B
 Gujarati ($,19W:!9\9p9~9d: (B)	$,19h9n9x:-9d:'(B
-Hebrew (,Hzixar(B)	,Hylem(B
+Hebrew $,1ro(B($,1-",q-(,y-*(B)	,Hylem(B
 Hungarian (magyar)	Sz,Bi(Bp j,Bs(B napot!
 Hindi ($,15y55B5f6 (B)	$,15h5n5x6-5d6'(B / $,15h5n5x6-5U5~5p(B $,16D(B
 Italian (italiano)	Ciao / Buon giorno
@@ -91,4 +91,5 @@
 
 ;;; Local Variables:
 ;;; tab-width: 32
+;;; bidi-display-reordering: t
 ;;; End:
--- a/etc/NEWS	Fri Mar 26 08:01:19 2010 +0100
+++ b/etc/NEWS	Thu Apr 01 08:50:44 2010 +0200
@@ -36,6 +36,32 @@
 
 * Changes in Emacs 24.1
 
+** auto-mode-case-fold is now enabled by default.
+
++++
+** Emacs now supports display and editing of bidirectional text.
+Warning: This is still very much experimental!  The existing support
+is minimal, and when it's turned on (see below), many features are
+likely to give unexpected results, or break, or even crash!  Use at
+your own risk!
+
+See the node "Bidirectional Editing" in the Emacs Manual for some
+initial documentation.
+
+To turn this on in any given buffer, set the buffer-local variable
+`bidi-display-reordering' to a non-nil value.  The default is nil.
+
+The buffer-local variable `bidi-paragraph-direction', if non-nil,
+forces each paragraph in the buffer to have its base direction
+according to the value of this variable.  Possible values are
+`right-to-left' and `left-to-right'.  If the value is nil (the
+default), Emacs determines the base direction of each paragraph from
+its text, as specified by the Unicode Bidirectional Algorithm.
+
+Reordering of bidirectional text for display in Emacs is a "Full
+bidirectionality" class implementation of the Unicode Bidirectional
+Algorithm.
+
 ** GTK scroll-bars are now placed on the right by default.
 Use `set-scroll-bar-mode' to change this.
 
@@ -82,6 +108,12 @@
 ** s-region.el is now declared obsolete, superceded by shift-select-mode
 enabled by default in 23.1.
 
+** gdb-mi
+
+*** GDB User Interface migrated to GDB Machine Interface and now
+supports multithread non-stop debugging and debugging of several
+threads simultaneously.
+
 
 * New Modes and Packages in Emacs 24.1
 
@@ -100,12 +132,21 @@
 ** Image API
 
 *** When the image type is one of listed in `image-animated-types'
-and the number of sub-images in the image is more then one, then the
+and the number of sub-images in the image is more than one, then the
 new function `create-animated-image' creates an animated image where
 sub-images are displayed successively with the duration defined by
 `image-animate-max-time' and the delay between sub-images defined
 by the Graphic Control Extension of the image.
 
+*** `image-extension-data' is renamed to `image-metadata'.
+
+** Progress reporters can now "spin".
+The MIN-VALUE and MAX-VALUE arguments of `make-progress-reporter' can
+now be nil, or omitted.  This makes a "non-numeric" reporter.  Each
+time you call `progress-reporter-update' on that progress reporter,
+with a nil or omitted VALUE argument, the reporter message is
+displayed with a "spinning bar".
+
 
 * Changes in Emacs 24.1 on non-free operating systems
 
--- a/etc/NEWS.23	Fri Mar 26 08:01:19 2010 +0100
+++ b/etc/NEWS.23	Thu Apr 01 08:50:44 2010 +0200
@@ -148,7 +148,7 @@
 +++
 *** The new completion-style `initials' is available.
 For instance, this can complete M-x lch to list-command-history.
-
+---
 *** The new variable `completions-format' determines how completions
 are displayed in the *Completions* buffer.  If you set it to
 `vertical', completions are sorted vertically in columns.
@@ -227,7 +227,7 @@
 Dired buffers to be reverted automatically on revisiting them.
 
 ** DocView
-
++++
 *** When `doc-view-continuous' is non-nil, scrolling a line
 on the page edge advances to the next/previous page.
 
@@ -250,6 +250,7 @@
 manual that generates an Info file which gives the same information
 through a menu structure.
 
++++
 ** Message mode is now the default mode for composing mail.
 
 The default for `mail-user-agent' is now message-user-agent, so the
@@ -259,6 +260,7 @@
 for several years.  It provides several features that are absent in
 Mail mode, such as MIME handling.
 
+---
 *** If the user has not customized mail-user-agent, `compose-mail'
 checks for Mail mode customizations, and issues a warning if these
 customizations are found.  This alerts users who may otherwise be
@@ -271,49 +273,59 @@
 Emacs will wait for the process sending mail to return.  If you
 experience delays when sending mail, you may wish to set this to nil.
 
++++
 ** nXML mode is now the default for editing XML files.
 
-** Shell
+** Shell (and other comint modes)
++++
+*** M-s is no longer bound to `comint-next-matching-input'.
 +++
-*** ansi-color is now enabled by default.
+*** M-r is now bound to `comint-history-isearch-backward-regexp'.
+This starts an incremental search of the comint/shell input history.
++++
+*** ansi-color is now enabled by default in Shell mode.
 To disable it, set ansi-color-for-comint-mode to nil.
 
+** Tramp
 +++
-** Tramp
-
 *** New connection methods "rsyncc", "imap" and "imaps".
 On systems which support GVFS-Fuse, Tramp offers also the new
 connection methods "dav", "davs", "obex" and "synce".
 
 ** VC and related modes
-
++++
 *** When using C-x v v or C-x v i on a unregistered file that is in a
 directory not controlled by any VCS, ask the user what VC backend to
 use to create a repository, create a new repository and register the
 file.
-
-*** FIXME: add info about the new VC functions: vc-root-diff and
-vc-root-print-log once they stabilize.
-
-*** The log functions (C-x v l and C-x v L) do not show the full log
-by default anymore.  The number of entries shown can be chosen
-interactively with a prefix argument, by customizing
-vc-log-show-limit.  The log buffer display buttons that can be used
-to change the number of entries shown.
-RCS, SCCS, CVS do not support this feature.
-
++++
+*** New command `vc-root-print-log', bound to `C-x v L'.
+This displays a `*vc-change-log*' buffer showing the history of the
+version-controlled directory tree as a whole.
++++
+*** New command `vc-root-diff', bound to `C-x v D'.
+This is similar to `vc-diff', but compares the entire directory tree
+of the current VC directory with its working revision.
++++
+*** `C-x v l' and `C-x v L' do not show the full log by default.
+The number of entries shown can be chosen interactively with a prefix
+argument, or by customizing vc-log-show-limit.  The `*vc-change-log*'
+buffer now contains buttons at the end of the buffer, which can be
+used to increase the number of entries shown.  RCS, SCCS, and CVS do
+not support this feature.
+---
 *** vc-annotate supports annotations through file copies and renames,
 it displays the old names for the files and it can show logs/diffs for
 the corresponding lines.  Currently only Git and Mercurial take
 advantage of this feature.
-
+---
 *** The log command in vc-annotate can display a single log entry
 instead of redisplaying the full log.  The RCS, CVS and SCCS VC
 backends do not support this.
-
+---
 *** When a file is not found, VC will not try to check it out of RCS anymore.
 
-*** Diff and log operations can be used from dired buffers.
+*** Diff and log operations can be used from Dired buffers.
 
 *** vc-git changes
 
@@ -330,7 +342,7 @@
 
 *** vc-bzr supports operating with shelves: the shelve list is
 displayed in the *vc-dir* header, shelves can be created, removed and applied.
-
+---
 *** log-edit-strip-single-file-name controls whether or not single filenames
 are stripped when copying text from the ChangeLog to the *VC-Log* buffer.
 
@@ -355,11 +367,6 @@
 the command asynchronously without the need to manually add ampersand to
 the end of the command.  Its output appears in the buffer `*Async Shell
 Command*'.
-
-*** Isearch searches in the comint/shell input history when the new variable
-`comint-history-isearch' is non-nil.  New commands `comint-history-isearch-backward'
-and `comint-history-isearch-backward-regexp' (bound to M-r) start Isearch
-in the input history regardless of the value of `comint-history-isearch'.
 +++
 *** Interactively `multi-isearch-buffers' and `multi-isearch-buffers-regexp'
 read buffer names to search, one by one, ended with RET.  With a prefix
@@ -414,6 +421,7 @@
 
 ** htmlfontify.el turns a fontified Emacs buffer into an HTML page.
 
++++
 ** js.el is a new major mode for JavaScript files.
 
 ** imap-hash.el is a new library to address IMAP mailboxes as hashtables.
@@ -523,9 +531,9 @@
 *** make-network-process can now also create `seqpacket' Unix sockets.
 
 ** Loading changes
-
+---
 *** eval-next-after-load is obsolete.
-
++++
 *** New hook `after-load-functions' run after loading an Elisp file.
 
 ** Byte compilation changes
--- a/etc/PROBLEMS	Fri Mar 26 08:01:19 2010 +0100
+++ b/etc/PROBLEMS	Thu Apr 01 08:50:44 2010 +0200
@@ -2478,6 +2478,26 @@
 4.1.1, and 4.1.2, are currently the _only_ versions known to succeed
 in building Emacs (as of v22.1).
 
+*** Building the native MS-Windows port fails due to unresolved externals
+
+The linker error messages look like this:
+
+ oo-spd/i386/ctags.o:ctags.c:(.text+0x156e): undefined reference to `_imp__re_set_syntax'
+ collect2: ld returned 1 exit status
+
+This happens because GCC finds an incompatible header regex.h
+somewhere on the include path, before the version of regex.h supplied
+with Emacs.  One such incompatible version of regex.h is part of the
+GnuWin32 Regex package.
+
+The solution is to remove the incompatible regex.h from the include
+path, when compiling Emacs.  Alternatively, re-run the configure.bat
+script with the "-isystem C:/GnuWin32/include" switch (adapt for your
+system's place where you keep the GnuWin32 include files) -- this will
+cause the compiler to search headers in the directories specified by
+the Emacs Makefile _before_ it looks in the GnuWin32 include
+directories.
+
 *** Building the native MS-Windows port with Cygwin GCC can fail.
 
 Emacs may not build using some Cygwin builds of GCC, such as Cygwin
--- a/etc/TODO	Fri Mar 26 08:01:19 2010 +0100
+++ b/etc/TODO	Thu Apr 01 08:50:44 2010 +0200
@@ -128,8 +128,6 @@
 
 ** Enhance scroll-bar to handle tall line (similar to line-move).
 
-** Make occur handle multi-line matches cleanly with context.
-
 ** In Custom buffers, put the option that turns a mode on or off first,
   using a heuristic of some kind?
 
--- a/etc/images/icons/hicolor/scalable/apps/emacs.svg	Fri Mar 26 08:01:19 2010 +0100
+++ b/etc/images/icons/hicolor/scalable/apps/emacs.svg	Thu Apr 01 08:50:44 2010 +0200
@@ -1,8 +1,16 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   version="1.0"
+   width="48"
+   height="48"
+   viewBox="0.171 0.201 512 512"
+   id="svg4768"
+   xml:space="preserve">
 <!-- Gnu Emacs Icon
-
-   Copyright (C) 2008, 2009, 2010
-   Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
 
    This file is part of GNU Emacs.
 
@@ -21,16 +29,6 @@
 
 -->
 <!-- Created with Inkscape (http://www.inkscape.org/) -->
-<svg
-   xmlns:svg="http://www.w3.org/2000/svg"
-   xmlns="http://www.w3.org/2000/svg"
-   xmlns:xlink="http://www.w3.org/1999/xlink"
-   version="1.0"
-   width="48"
-   height="48"
-   viewBox="0.171 0.201 512 512"
-   id="svg4768"
-   xml:space="preserve">
 <defs
    id="defs4770"><linearGradient
    id="linearGradient3294"><stop
--- a/leim/ChangeLog	Fri Mar 26 08:01:19 2010 +0100
+++ b/leim/ChangeLog	Thu Apr 01 08:50:44 2010 +0200
@@ -1,3 +1,9 @@
+2010-03-27  Eli Zaretskii  <eliz@gnu.org>
+
+	* makefile.w32-in ($(TIT), $(MISC_DIC), leim-list.el): Enclose the
+	argument of "-l" in $(ARGQUOTE), in case it includes blanks or
+	other special characters.
+
 2010-03-18  Glenn Morris  <rgm@gnu.org>
 
 	* Makefile.in (maintainer-clean): Use bootstrap-clean.
--- a/leim/makefile.w32-in	Fri Mar 26 08:01:19 2010 +0100
+++ b/leim/makefile.w32-in	Thu Apr 01 08:50:44 2010 +0200
@@ -170,17 +170,21 @@
 # WARNING: Do NOT split the part inside $(ARGQUOTE)s into multiple lines as
 #          this can break with GNU Make 3.81 and later if sh.exe is used.
 $(TIT):
-	$(RUN_EMACS) -l $(buildlisppath)/international/titdic-cnv \
+	$(RUN_EMACS) -l \
+	    $(ARGQUOTE)$(buildlisppath)/international/titdic-cnv$(ARGQUOTE) \
 	    --eval $(ARGQUOTE)(batch-titdic-convert t)$(ARGQUOTE) \
 	    -dir quail $(srcdir)/CXTERM-DIC
-	$(RUN_EMACS)  -l $(buildlisppath)/international/quail \
+	$(RUN_EMACS)  -l \
+	    $(ARGQUOTE)$(buildlisppath)/international/quail$(ARGQUOTE) \
 	    -f batch-byte-compile $(TIT:.elc=.el)
 
 # Rule to generate quail/*.el from MISC_DIC/*.tit.
 $(MISC_DIC):
-	$(RUN_EMACS) -l $(buildlisppath)/international/titdic-cnv \
+	$(RUN_EMACS) -l \
+	    $(ARGQUOTE)$(buildlisppath)/international/titdic-cnv$(ARGQUOTE) \
 	    -f batch-miscdic-convert -dir quail $(srcdir)/MISC-DIC
-	$(RUN_EMACS)  -l $(buildlisppath)/international/quail \
+	$(RUN_EMACS)  -l \
+	    $(ARGQUOTE)$(buildlisppath)/international/quail$(ARGQUOTE) \
 	    -f batch-byte-compile $(MISC_DIC:.elc=.el)
 
 #
@@ -188,7 +192,8 @@
 #          this can break with GNU Make 3.81 and later if sh.exe is used.
 leim-list.el: $(SUBDIRS) $(WORLD) $(srcdir)/leim-ext.el
 	- $(DEL) leim-list.el
-	$(RUN_EMACS) -l $(buildlisppath)/international/quail \
+	$(RUN_EMACS) -l \
+	    $(ARGQUOTE)$(buildlisppath)/international/quail$(ARGQUOTE) \
 	    --eval $(ARGQUOTE)(update-leim-list-file $(DQUOTE).$(DQUOTE))$(ARGQUOTE)
 	$(RUN_EMACS) --eval $(ARGQUOTE)(w32-append-code-lines $(DQUOTE)$@$(DQUOTE) $(DQUOTE)$(srcdir)/leim-ext.el$(DQUOTE))$(ARGQUOTE)
 
--- a/lisp/ChangeLog	Fri Mar 26 08:01:19 2010 +0100
+++ b/lisp/ChangeLog	Thu Apr 01 08:50:44 2010 +0200
@@ -1,3 +1,155 @@
+2010-03-31  Chong Yidong  <cyd@stupidchicken.com>
+
+	* cus-edit.el (custom-buffer-sort-alphabetically): Update
+	:version.
+
+2010-03-31  Juri Linkov  <juri@jurta.org>
+
+	* simple.el (next-line, previous-line): Re-throw a signal
+	with `signal' instead of using `ding'.
+	http://lists.gnu.org/archive/html/emacs-devel/2010-03/msg01432.html
+
+2010-03-31  Juri Linkov  <juri@jurta.org>
+
+	* simple.el (keyboard-escape-quit): Raise deselecting the active
+	region higher than exiting the minibuffer.
+	http://lists.gnu.org/archive/html/emacs-devel/2010-03/msg00904.html
+
+2010-03-31  Juri Linkov  <juri@jurta.org>
+
+	* image.el (image-animated-p): Use `image-metadata' instead of
+	`image-extension-data'.  Get GIF extenstion data from metadata
+	property `extension-data'.
+
+2010-03-31  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* simple.el (append-to-buffer): Simplify.
+
+2010-03-31  Tomas Abrahamsson  <tab@lysator.liu.se>
+
+	* textmodes/artist.el (artist-mode): Fix typo in docstring.
+	Reported by Alex Schröder <kensanata@gmail.com>.  (Bug#5807)
+
+2010-03-31  Kenichi Handa  <handa@m17n.org>
+
+	* language/sinhala.el (composition-function-table): Fix regexp for
+	the new Unicode specification.
+
+	* language/indian.el (devanagari-composable-pattern)
+	(tamil-composable-pattern, kannada-composable-pattern)
+	(malayalam-composable-pattern): Adjust for the new Unicode
+	specification.
+	(bengali-composable-pattern, gurmukhi-composable-pattern)
+	(gujarati-composable-pattern, oriya-composable-pattern)
+	(telugu-composable-pattern): New variables to cope with the new
+	Unicode specification.  Use them in composition-function-table.
+
+2010-03-31  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	Make tmm-menubar work for the Buffers menu again.
+	* tmm.el (tmm-prompt): Also handle keymap entries in the form of
+	vectors rather than cons cells, as used in menu-bar-update-buffers.
+
+2010-03-31  Chong Yidong  <cyd@stupidchicken.com>
+
+	* progmodes/js.el (js-auto-indent-flag, js-mode-map)
+	(js-insert-and-indent): Revert 2009-08-15 change, restoring
+	electric punctuation for "{}();,:" (Bug#5586).
+
+	* mail/sendmail.el (mail-default-directory): Doc fix.
+
+2010-03-31  Chong Yidong  <cyd@stupidchicken.com>
+
+	* mail/sendmail.el (mail-default-directory): Doc fix.
+
+2010-03-31  Eli Zaretskii  <eliz@gnu.org>
+
+	* subr.el (version-regexp-alist, version-to-list)
+	(version-list-<, version-list-=, version-list-<=)
+	(version-list-not-zero, version<, version<=, version=): Doc fix.
+	(Bug#5744).
+
+2010-02-31  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* vc.el (vc-root-diff): Doc fix.
+
+2010-03-31  Chong Yidong  <cyd@stupidchicken.com>
+
+	* vc.el (vc-print-log, vc-print-root-log): Doc fix.
+
+	* simple.el (append-to-buffer): Fix last change.
+
+2010-03-31  Chong Yidong  <cyd@stupidchicken.com>
+
+	* simple.el (append-to-buffer): Ensure that point is preserved if
+	BUFFER is the current buffer.  Suggested by YAMAMOTO Mitsuharu.
+	(Bug#5749)
+
+2010-03-31  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* files.el (auto-mode-case-fold): Change default to t.
+
+2010-03-30  Juri Linkov  <juri@jurta.org>
+
+	* dired-x.el (dired-omit-mode): Doc fix.
+
+2010-03-30  Juri Linkov  <juri@jurta.org>
+
+	* replace.el (occur-accumulate-lines): Move occur-engine related
+	functions `occur-accumulate-lines' and `occur-engine-add-prefix'
+	to be located after `occur-engine'.
+
+2010-03-30  Juri Linkov  <juri@jurta.org>
+
+	Make occur handle multi-line matches cleanly with context.
+	http://lists.gnu.org/archive/html/emacs-devel/2010-03/msg01280.html
+
+	* replace.el (occur-accumulate-lines): Add optional arg `pt'.
+	(occur-engine): Add local variables `ret', `prev-after-lines',
+	`prev-lines'.  Use more arguments for `occur-context-lines'.
+	Set first elem of its returned list to `data', and the second elem
+	to `prev-after-lines'.  Don't print the separator line.
+	In the end, print remaining context after-lines.
+	(occur-context-lines): Add new arguments `begpt', `endpt',
+	`lines', `prev-lines', `prev-after-lines'.  Rewrite to combine
+	after-lines of the previous match with before-lines of the
+	current match and not overlap them.  Return a list with two
+	values: the output line and the list of context after-lines.
+
+2010-03-30  Juri Linkov  <juri@jurta.org>
+
+	* replace.el (occur-accumulate-lines): Fix a bug where the first
+	context line at the beginning of the buffer was missing.
+
+2010-03-30  Eli Zaretskii  <eliz@gnu.org>
+
+	* files.el: Make bidi-display-reordering safe variable for boolean
+	values.
+
+2010-03-29  Phil Hagelberg  <phil@evri.com>
+	    Chong Yidong  <cyd@stupidchicken.com>
+
+	* subr.el: Extend progress reporters to perform "spinning".
+	(progress-reporter-update, progress-reporter-do-update):
+	Handle non-numeric value arguments.
+	(progress-reporter--pulse-characters): New var.
+
+2010-03-28  Chong Yidong  <cyd@stupidchicken.com>
+
+	* progmodes/compile.el (compilation-start): Fix regexp detection
+	of initial cd command (Bug#5771).
+
+2010-03-28  Stefan Guath  <stefan@automata.se>  (tiny change)
+
+	* find-dired.el (find-dired): Use read-directory-name (Bug#5777).
+
+2010-03-27  Nick Roberts  <nickrob@snap.net.nz>
+
+	Restore GDB/MI fuctionality removed by r99212.
+	* lisp/progmodes/gdb-mi.el: Restore.
+	* lisp/progmodes/gdb-ui.el: Remove.
+	* lisp/progmodes/gud.el: Re-accommodate for gdb-mi.el.
+
 2010-03-25  Glenn Morris  <rgm@gnu.org>
 
 	* desktop.el (desktop-save-buffer-p): Don't mistakenly include
@@ -311,11 +463,13 @@
 
 	* vc-bzr.el (vc-bzr-checkin): Pass extra arguments to the commit
 	command.
-	(log-edit-extra-flags, log-edit-before-checkin-process): New declarations.
+	(log-edit-extra-flags, log-edit-before-checkin-process):
+	New declarations.
 
 	* vc-hg.el (vc-hg-checkin): Pass extra arguments to the commit
 	command.
-	(log-edit-extra-flags, log-edit-before-checkin-process): New declarations.
+	(log-edit-extra-flags, log-edit-before-checkin-process):
+	New declarations.
 	(vc-hg-log-edit-mode): New derived mode.
 
 	* vc-arch.el (vc-arch-checkin):
@@ -414,8 +568,8 @@
 	(widget-field-value-set): New fun.
 	(editable-field): Use it.
 	(widget-field-value-get): Clean up unused var.
-	(widget-color-value-create, widget-color--choose-action): New
-	funs.  Allow using list-colors-display to choose color.
+	(widget-color-value-create, widget-color--choose-action):
+	New funs.  Allow using list-colors-display to choose color.
 
 2010-03-12  Chong Yidong  <cyd@stupidchicken.com>
 
@@ -426,8 +580,7 @@
 	(custom-buffer-create-internal): Add custom-apropos search field.
 	(custom-add-parent-links): Don't display parent doc.
 	(custom-group-value-create): Don't sort top-level custom group.
-	(custom-magic-value-create): Show visibility button before option
-	name.
+	(custom-magic-value-create): Show visibility button before option name.
 
 	(custom-variable-state): New fun, from custom-variable-state-set.
 	(custom-variable-state-set): Use it.
@@ -565,8 +718,8 @@
 
 2010-03-07  Štěpán Němec  <stepnem@gmail.com>  (tiny change)
 
-	* vc-git.el (vc-git-annotate-extract-revision-at-line): Use
-	vc-git-root as default directory for revision path (Bug#5657).
+	* vc-git.el (vc-git-annotate-extract-revision-at-line):
+	Use vc-git-root as default directory for revision path (Bug#5657).
 
 2010-03-06  Chong Yidong  <cyd@stupidchicken.com>
 
@@ -655,8 +808,8 @@
 2010-02-28  Michael Albinus  <michael.albinus@gmx.de>
 
 	* net/dbus.el (dbus-introspect, dbus-get-property)
-	(dbus-set-property, dbus-get-all-properties): Use
-	`dbus-call-method' when noninteractive.  (Bug#5645)
+	(dbus-set-property, dbus-get-all-properties):
+	Use `dbus-call-method' when noninteractive.  (Bug#5645)
 
 2010-02-28  Chong Yidong  <cyd@stupidchicken.com>
 
@@ -2041,9 +2194,9 @@
 
 2009-12-18  Ulf Jasper  <ulf.jasper@web.de>
 
-	* calendar/icalendar.el (icalendar--convert-tz-offset): Fixed
-	timezone names.
-	(icalendar--convert-tz-offset): Fixed the "last-day-problem".
+	* calendar/icalendar.el (icalendar--convert-tz-offset):
+	Fix timezone names.
+	(icalendar--convert-tz-offset): Fix the "last-day-problem".
 	(icalendar--add-diary-entry): Remove the trailing blank that
 	diary-make-entry inserts.
 
@@ -2060,7 +2213,7 @@
 	(tramp-advice-file-expand-wildcards): Remove it.
 
 	* net/tramp-compat.el (top): Autoload `tramp-handle-file-remote-p'.
-	(tramp-advice-file-expand-wildcards): Moved from tramp.el.
+	(tramp-advice-file-expand-wildcards): Move from tramp.el.
 	Activate advice for older GNU Emacs versions.  (Bug#5237)
 
 2009-12-17  Juanma Barranquero  <lekktu@gmail.com>
@@ -2077,12 +2230,12 @@
 
 	* files.el (hack-local-variables-filter): While ignoring duplicates,
 	don't take `mode' into account.
-	(hack-local-variables-filter, hack-dir-local-variables): Don't
-	remove duplicate `mode' from local-variables-alist (like `eval').
+	(hack-local-variables-filter, hack-dir-local-variables):
+	Don't remove duplicate `mode' from local-variables-alist (like `eval').
 
 2009-12-17  Juri Linkov  <juri@jurta.org>
 
-	Make `dired-diff' more safe.  (Bug#5225)
+	Make `dired-diff' safer.  (Bug#5225)
 
 	* dired-aux.el (dired-diff): Signal an error when `file' equals to
 	`current' or when `file' is a directory of the `current' file.
@@ -2279,7 +2432,7 @@
 
 2009-12-09  Vivek Dasmohapatra  <vivek@etla.org>
 
-	Drop some properties to avoid surprises.
+	Drop some properties to avoid surprises (bug#5002).
 	* htmlfontify.el (hfy-ignored-properties): New defcustom.
 	(hfy-fontify-buffer): Use it.
 
--- a/lisp/Makefile.in	Fri Mar 26 08:01:19 2010 +0100
+++ b/lisp/Makefile.in	Thu Apr 01 08:50:44 2010 +0200
@@ -30,7 +30,7 @@
 
 # We sometimes change directory before running Emacs (typically when
 # building out-of-tree, we chdir to the source directory), so we need
-# to use an aboluste file name.
+# to use an absolute file name.
 EMACS = ${abs_top_builddir}/src/emacs
 
 # Command line flags for Emacs.  This must include --multibyte,
--- a/lisp/cus-edit.el	Fri Mar 26 08:01:19 2010 +0100
+++ b/lisp/cus-edit.el	Thu Apr 01 08:50:44 2010 +0200
@@ -675,7 +675,8 @@
 (defcustom custom-buffer-sort-alphabetically t
   "Whether to sort customization groups alphabetically in Custom buffer."
   :type 'boolean
-  :group 'custom-buffer)
+  :group 'custom-buffer
+  :version "24.1")
 
 (defcustom custom-buffer-order-groups 'last
   "If non-nil, order group members within each customization group.
--- a/lisp/dired-x.el	Fri Mar 26 08:01:19 2010 +0100
+++ b/lisp/dired-x.el	Thu Apr 01 08:50:44 2010 +0200
@@ -163,7 +163,13 @@
 otherwise.  Enabling and disabling is buffer-local.
 If enabled, \"uninteresting\" files are not listed.
 Uninteresting files are those whose filenames match regexp `dired-omit-files',
-plus those ending with extensions in `dired-omit-extensions'."
+plus those ending with extensions in `dired-omit-extensions'.
+
+To enable omitting in every Dired buffer, you can put in your ~/.emacs
+
+  (add-hook 'dired-mode-hook (lambda () (dired-omit-mode 1)))
+
+See Info node `(dired-x) Omitting Variables' for more information."
   :group 'dired-x
   (if dired-omit-mode
       ;; This will mention how many lines were omitted:
--- a/lisp/files.el	Fri Mar 26 08:01:19 2010 +0100
+++ b/lisp/files.el	Thu Apr 01 08:50:44 2010 +0200
@@ -2159,7 +2159,7 @@
   (if (fboundp 'ucs-set-table-for-input) ; don't lose when building
       (ucs-set-table-for-input)))
 
-(defcustom auto-mode-case-fold nil
+(defcustom auto-mode-case-fold t
   "Non-nil means to try second pass through `auto-mode-alist'.
 This means that if the first case-sensitive search through the alist fails
 to find a matching major mode, a second case-insensitive search is made.
@@ -2768,14 +2768,15 @@
 
 (mapc (lambda (pair)
 	(put (car pair) 'safe-local-variable (cdr pair)))
-      '((buffer-read-only     . booleanp)   ;; C source code
-	(default-directory    . stringp)    ;; C source code
-	(fill-column          . integerp)   ;; C source code
-	(indent-tabs-mode     . booleanp)   ;; C source code
-	(left-margin          . integerp)   ;; C source code
-	(no-update-autoloads  . booleanp)
-	(tab-width            . integerp)   ;; C source code
-	(truncate-lines       . booleanp))) ;; C source code
+      '((buffer-read-only        . booleanp)   ;; C source code
+	(default-directory       . stringp)    ;; C source code
+	(fill-column             . integerp)   ;; C source code
+	(indent-tabs-mode        . booleanp)   ;; C source code
+	(left-margin             . integerp)   ;; C source code
+	(no-update-autoloads     . booleanp)
+	(tab-width               . integerp)   ;; C source code
+	(truncate-lines          . booleanp)   ;; C source code
+	(bidi-display-reordering . booleanp))) ;; C source code
 
 (put 'c-set-style 'safe-local-eval-function t)
 
--- a/lisp/find-dired.el	Fri Mar 26 08:01:19 2010 +0100
+++ b/lisp/find-dired.el	Thu Apr 01 08:50:44 2010 +0200
@@ -99,7 +99,7 @@
 
 except that the variable `find-ls-option' specifies what to use
 as the final argument."
-  (interactive (list (read-file-name "Run find in directory: " nil "" t)
+  (interactive (list (read-directory-name "Run find in directory: " nil "" t)
 		     (read-string "Run find (with args): " find-args
 				  '(find-args-history . 1))))
   (let ((dired-buffers dired-buffers))
--- a/lisp/gnus/ChangeLog	Fri Mar 26 08:01:19 2010 +0100
+++ b/lisp/gnus/ChangeLog	Thu Apr 01 08:50:44 2010 +0200
@@ -1,3 +1,57 @@
+2010-03-31  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* gnus-art.el (gnus-article-browse-html-save-cid-content): Rename from
+	gnus-article-browse-html-save-cid-image; make it work recursively for
+	forwarded messages as well.
+	(gnus-article-browse-html-parts): Work when prefix arg is given.
+	(gnus-article-browse-html-article): Doc fix.
+
+2010-03-30  Chong Yidong  <cyd@stupidchicken.com>
+
+	* message.el (message-default-mail-headers):
+	(message-default-headers): Carry the value mail-default-headers over
+	into message-default-mail-headers, rather than message-default-headers.
+
+2010-03-30  Martin Stjernholm  <mast@lysator.liu.se>
+
+	* mm-decode.el (mm-add-meta-html-tag): Add option to override the
+	charset.
+
+	* gnus-art.el (gnus-article-browse-html-parts): Force the correct
+	charset into the <meta> tag when the article is encoded to utf-8.
+
+2010-03-30  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* gnus-art.el (gnus-article-browse-delete-temp-files):
+	Delete directories as well.
+	(gnus-article-browse-html-parts): Work for images that do not specify
+	file names; delete temp directory when quitting; insert header at the
+	right place; use file: scheme for image files.
+
+2010-03-30  Eric Schulte  <schulte.eric@gmail.com>
+
+	* gnus-art.el (gnus-article-browse-html-save-cid-image): New function.
+	(gnus-article-browse-html-parts): Use it to make temporary cid image
+	files in addition to html file so that browser may display them.
+
+2010-03-29  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* mm-decode.el (mm-add-meta-html-tag): Fix regexp matching meta tag.
+
+2010-03-29  Teodor Zlatanov  <tzz@lifelogs.com>
+
+	* auth-source.el (auth-source-pick): Fix for non-secrets specifier.
+
+2010-03-27  Teodor Zlatanov  <tzz@lifelogs.com>
+
+	* auth-source.el (auth-sources): Change default to be simpler.
+	Explain about Secret Service API sources.  Improve Customize options.
+	(auth-source-pick): Change to accept any number of search parameters.
+	Implement fallbacks iteratively, not recursively.  Add scoring on the
+	second pass and sort by score.  Call Secret Service API when needed.
+	(auth-source-user-or-password): Use it.  Call Secret Service API
+	directly when needed to get the user name and the password.
+
 2010-03-24  Juanma Barranquero  <lekktu@gmail.com>
 
 	* message.el (message-interactive): Doc fix.
--- a/lisp/gnus/auth-source.el	Fri Mar 26 08:01:19 2010 +0100
+++ b/lisp/gnus/auth-source.el	Thu Apr 01 08:50:44 2010 +0200
@@ -38,6 +38,7 @@
 (autoload 'secrets-search-items "secrets")
 (autoload 'secrets-get-alias "secrets")
 (autoload 'secrets-get-attribute "secrets")
+(autoload 'secrets-get-secret "secrets")
 
 (defgroup auth-source nil
   "Authentication sources."
@@ -60,6 +61,7 @@
 			       (string :tag "Name")))))
 
 ;;; generate all the protocols in a format Customize can use
+;;; TODO: generate on the fly from auth-source-protocols
 (defconst auth-source-protocols-customize
   (mapcar (lambda (a)
 	    (let ((p (car-safe a)))
@@ -102,9 +104,13 @@
   :version "23.2" ;; No Gnus
   :type `boolean)
 
-(defcustom auth-sources '((:source "~/.authinfo.gpg" :host t :protocol t))
+(defcustom auth-sources '((:source "~/.authinfo.gpg"))
   "List of authentication sources.
 
+The default will get login and password information from a .gpg
+file, which you should set up with the EPA/EPG packages to be
+encrypted.  See the auth.info manual for details.
+
 Each entry is the authentication type with optional properties.
 
 It's best to customize this with `M-x customize-variable' because the choices
@@ -121,27 +127,24 @@
                                      (choice :tag "Collection to use"
                                              (string :tag "Collection name")
                                              (const :tag "Default" 'default)
-                                             (const :tag "Any" t)
-                                             (const :tag "Temporary" "session")
-                                             (string :tag "Specific session name")
-                                             (const :tag "Fallback" nil))))
-		       (const :format "" :value :host)
-		       (choice :tag "Host (machine) choice"
-			       (const :tag "Any" t)
-			       (regexp :tag "Host (machine) regular expression (TODO)")
-			       (const :tag "Fallback" nil))
-		       (const :format "" :value :protocol)
-		       (choice :tag "Protocol"
-			       (const :tag "Any" t)
-			       (const :tag "Fallback" nil)
-			       ,@auth-source-protocols-customize)
+                                             (const :tag "Login" "login")
+                                             (const :tag "Temporary" "session"))))
 		       (repeat :tag "Extra Parameters" :inline t
 			       (choice :tag "Extra parameter"
-				       (list :tag "Preferred username" :inline t
-					     (const :format "" :value :preferred-username)
+				       (list :tag "Host (omit to match as a fallback)"
+					     (const :format "" :value :host)
+					     (choice :tag "Host (machine) choice"
+						     (const :tag "Any" t)
+						     (regexp :tag "Host (machine) regular expression")))
+				       (list :tag "Protocol (omit to match as a fallback)"
+					     (const :format "" :value :protocol)
+					     (choice :tag "Protocol"
+						     (const :tag "Any" t)
+						     ,@auth-source-protocols-customize))
+				       (list :tag "User  (omit to match as a fallback)" :inline t
+					     (const :format "" :value :user)
 					     (choice :tag "Personality or username"
 						     (const :tag "Any" t)
-						     (const :tag "Fallback" nil)
 						     (string :tag "Specific user name"))))))))
 
 ;; temp for debugging
@@ -153,7 +156,7 @@
 ;; (customize-variable 'auth-source-protocols)
 ;; (setq auth-source-protocols nil)
 ;; (format "%S" auth-source-protocols)
-;; (auth-source-pick "a" 'imap)
+;; (auth-source-pick nil :host "a" :port 'imap)
 ;; (auth-source-user-or-password "login" "imap.myhost.com" 'imap)
 ;; (auth-source-user-or-password "password" "imap.myhost.com" 'imap)
 ;; (auth-source-user-or-password-imap "login" "imap.myhost.com")
@@ -173,27 +176,121 @@
 		    'message)))
       (apply logger msg))))
 
-(defun auth-source-pick (host protocol &optional fallback)
-  "Parse `auth-sources' for HOST, and PROTOCOL matches.
+;; (auth-source-pick nil :host "any" :protocol 'imap :user "joe")
+;; (auth-source-pick t :host "any" :protocol 'imap :user "joe")
+;; (setq auth-sources '((:source (:secrets default) :host t :protocol t :user "joe") 
+;; 		     (:source (:secrets "session") :host t :protocol t :user "joe") 
+;; 		     (:source (:secrets "login") :host t :protocol t)
+;; 		     (:source "~/.authinfo.gpg" :host t :protocol t)))
+
+;; (setq auth-sources '((:source (:secrets default) :host t :protocol t :user "joe") 
+;; 		     (:source (:secrets "session") :host t :protocol t :user "joe") 
+;; 		     (:source (:secrets "login") :host t :protocol t)
+;; 		     ))
+
+;; (setq auth-sources '((:source "~/.authinfo.gpg" :host t :protocol t)))
 
-Returns fallback choices (where PROTOCOL or HOST are nil) with FALLBACK t."
-  (interactive "sHost: \nsProtocol: \n") ;for testing
+(defun auth-source-pick (&rest spec)
+  "Parse `auth-sources' for matches of the SPEC plist.
+
+Common keys are :host, :protocol, and :user.  A value of t in
+SPEC means to always succeed in the match.  A string value is
+matched as a regex.
+
+The first pass skips fallback choices.  If no choices are found
+on the first pass, a second pass is made including the fallback
+choices.
+
+For string (filename) sources, fallback choices are those where
+PROTOCOL or HOST are nil.
+
+For secrets.el collections, the :host and :protocol keys are not
+checked for fallback choices."
   (let (choices)
-    (dolist (choice auth-sources)
-      (let ((h (plist-get choice :host))
-	    (p (plist-get choice :protocol)))
-	(when (and
-	       (or (equal t h)
-		   (and (stringp h) (string-match h host))
-		   (and fallback (equal h nil)))
-	       (or (equal t p)
-		   (and (symbolp p) (equal p protocol))
-		   (and fallback (equal p nil))))
-	  (push choice choices))))
-    (if choices
-	choices
-      (unless fallback
-	(auth-source-pick host protocol t)))))
+    (dolist (fallback '(nil t))
+      (let ((keys (loop for i below (length spec) by 2
+			collect (nth i spec)))
+	    (default-session-fallback "login"))
+	(dolist (choice auth-sources)
+	  (let* ((s (plist-get choice :source))
+		 ;; this is only set for Secret Service API specs (see secrets.el)
+		 (coll (and (consp s) (plist-get s :secrets)))
+		 (score 0))
+	    (cond
+	     (coll				; use secrets.el here
+	      (when (eq coll 'default)
+		(setq coll (secrets-get-alias "default"))
+		(unless coll 
+		  (auth-source-do-debug
+		   "No 'default' alias.  Trying collection '%s'."
+		   default-session-fallback)
+		  (setq coll default-session-fallback)))
+	      (let* ((coll-search (cond
+				   ((stringp coll) coll)
+				   
+				   ;; when the collection is nil:
+				   ;; in fallback mode, accept it as any
+				   ;; otherwise, hope to fail
+				   ((null coll) (if fallback
+						    nil
+						  " *fallback-fail*"))))
+		     ;; assemble a search query for secrets-search-items
+		     ;; in fallback mode, host and protocol are not checked
+		     (other-search (loop for k
+					 in (if fallback
+						(remove :host 
+							(remove :protocol keys))
+					      keys)
+					 append (list
+						 k
+						 ;; convert symbols to a string
+						 (let ((v (plist-get spec k)))
+						   (if (stringp v)
+						       v
+						     (prin1-to-string v))))))
+		     ;; the score is based on how exact the search was, 
+		     ;; plus base score = 1 for any match
+		     (score (1+ (length other-search)))
+		     (results (apply 'secrets-search-items
+				     coll-search
+				     other-search)))
+		(auth-source-do-debug
+		 "auth-source-pick: got items %s in collection '%s' + %s"
+		 results coll-search other-search)
+		;; put the results in the choices variable
+		(dolist (result results)
+		  (setq choices (cons (list score
+					    `(:source secrets
+						      :item ,result
+						      :collection ,coll
+						      :search ,coll-search
+						      ,@other-search))
+				      choices)))))
+	     ;; this is any non-secrets spec (currently means a string filename)
+	     (t
+	      (let ((match t))
+		(dolist (k keys)
+		  (let* ((v (plist-get spec k))
+			 (choicev (plist-get choice k)))
+		    (setq match
+			  (and match
+			       (or (eq t choicev) ; source always matches spec key
+				   ;; source key gives regex to match against spec
+				   (and (stringp choicev) (string-match choicev v))
+				   ;; source key gives symbol to match against spec
+				   (and (symbolp choicev) (eq choicev v))
+				   ;; in fallback mode, missing source key is OK
+				   fallback)))
+		    (when match (incf score)))) ; increment the score for each match
+
+		;; now if the whole iteration resulted in a match:
+		(when match
+		  (setq choices (cons (list score choice) choices))))))))
+	;; when there were matches, skip the second pass
+	(when choices (return choices))))
+
+      ;; return the results sorted by score
+      (mapcar 'cadr (sort choices (lambda (x y) (> (car x) (car y)))))))
 
 (defun auth-source-forget-user-or-password (mode host protocol)
   (interactive "slogin/password: \nsHost: \nsProtocol: \n") ;for testing
@@ -204,44 +301,81 @@
   (interactive)
   (setq auth-source-cache (make-hash-table :test 'equal)))
 
-(defun auth-source-user-or-password (mode host protocol)
+;; (progn
+;;   (auth-source-forget-all-cached)
+;;   (list
+;;    (auth-source-user-or-password '("login" "password") "imap.myhost.com" "other")
+;;    (auth-source-user-or-password '("login" "password") "imap.myhost.com" "other" "tzz")
+;;    (auth-source-user-or-password '("login" "password") "imap.myhost.com" "other" "joe")))
+
+(defun auth-source-user-or-password (mode host protocol &optional username)
   "Find MODE (string or list of strings) matching HOST and PROTOCOL.
+
+USERNAME is optional and will be used as \"login\" in a search
+across the Secret Service API (see secrets.el) if the resulting
+items don't have a username.  This means that if you search for
+username \"joe\" and it matches an item but the item doesn't have
+a :user attribute, the username \"joe\" will be returned.
+
 MODE can be \"login\" or \"password\" for example."
   (auth-source-do-debug
-   "auth-source-user-or-password: get %s for %s (%s)"
-   mode host protocol)
+   "auth-source-user-or-password: get %s for %s (%s) + user=%s"
+   mode host protocol username)
   (let* ((listy (listp mode))
 	 (mode (if listy mode (list mode)))
-	 (cname (format "%s %s:%s" mode host protocol))
+	 (extras (when username `(:user ,username)))
+	 (cname (format "%s %s:%s %s" mode host protocol extras))
+	 (search (list :host host :protocol protocol))
+	 (search (if username (append search (list :user username)) search))
 	 (found (gethash cname auth-source-cache)))
     (if found
 	(progn
 	  (auth-source-do-debug
-	   "auth-source-user-or-password: cached %s=%s for %s (%s)"
+	   "auth-source-user-or-password: cached %s=%s for %s (%s) + %s"
+	   mode
+	   ;; don't show the password
+	   (if (and (member "password" mode) auth-source-hide-passwords)
+	       "SECRET"
+	     found)
+	   host protocol extras)
+	  found)			; return the found data
+      ;; else, if not found
+      (dolist (choice (apply 'auth-source-pick search))
+	(setq found (cond
+		     ;; the secrets.el spec
+		     ((eq (plist-get choice :source) 'secrets)
+		      (let ((coll (plist-get choice :search))
+			    (item (plist-get choice :item)))
+			(mapcar (lambda (m)
+				  (if (equal "password" m)
+				      (secrets-get-secret coll item)
+				    ;; the user name is either
+				    (or
+				     ;; the secret's attribute :user, or
+				     (secrets-get-attribute coll item :user)
+				     ;; the originally requested :user
+				     username
+				     "unknown-user")))
+				mode)))
+		     (t		; anything else is netrc
+		      (netrc-machine-user-or-password
+		       mode
+		       (plist-get choice :source)
+		       (list host)
+		       (list (format "%s" protocol))
+		       (auth-source-protocol-defaults protocol)))))
+	(when found
+	  (auth-source-do-debug
+	   "auth-source-user-or-password: found %s=%s for %s (%s) + %s"
 	   mode
 	   ;; don't show the password
 	   (if (and (member "password" mode) auth-source-hide-passwords) "SECRET" found)
-	   host protocol)
-	  found)
-      (dolist (choice (auth-source-pick host protocol))
-	(setq found (netrc-machine-user-or-password
-		     mode
-		     (plist-get choice :source)
-		     (list host)
-		     (list (format "%s" protocol))
-		     (auth-source-protocol-defaults protocol)))
-	(when found
-	  (auth-source-do-debug
-	   "auth-source-user-or-password: found %s=%s for %s (%s)"
-	   mode
-	   ;; don't show the password
-	   (if (and (member "password" mode) auth-source-hide-passwords) "SECRET" found)
-	   host protocol)
+	   host protocol extras)
 	  (setq found (if listy found (car-safe found)))
 	  (when auth-source-do-cache
 	    (puthash cname found auth-source-cache)))
 	(return found)))))
-
+  
 (defun auth-source-protocol-defaults (protocol)
   "Return a list of default ports and names for PROTOCOL."
   (cdr-safe (assoc protocol auth-source-protocols)))
--- a/lisp/gnus/gnus-art.el	Fri Mar 26 08:01:19 2010 +0100
+++ b/lisp/gnus/gnus-art.el	Thu Apr 01 08:50:44 2010 +0200
@@ -2819,18 +2819,47 @@
 		     ;; `how' is neither `nil', `ask' nor `t' (i.e. `file'):
 		     (gnus-y-or-n-p
 		      (format "Delete temporary HTML file `%s'? " file))))
-	(delete-file file)))
+	(if (file-directory-p file)
+	    (gnus-delete-directory file)
+	  (delete-file file))))
     ;; Also remove file from the list when not deleted or if file doesn't
     ;; exist anymore.
     (setq gnus-article-browse-html-temp-list nil))
   gnus-article-browse-html-temp-list)
 
+(defun gnus-article-browse-html-save-cid-content (cid handles directory)
+  "Find CID content in HANDLES and save it in a file in DIRECTORY.
+Return file name."
+  (save-match-data
+    (let (file type)
+      (catch 'found
+	(dolist (handle handles)
+	  (cond
+	   ((not (listp handle)))
+	   ((equal (mm-handle-media-supertype handle) "multipart")
+	    (when (setq file (gnus-article-browse-html-save-cid-content
+			      cid handle directory))
+	      (throw 'found file)))
+	   ((equal (concat "<" cid ">") (mm-handle-id handle))
+	    (setq file
+		  (expand-file-name
+		   (or (mail-content-type-get
+			(mm-handle-disposition handle) 'filename)
+		       (mail-content-type-get
+			(setq type (mm-handle-type handle)) 'name)
+		       (concat
+			(make-temp-name "cid")
+			(car (rassoc (car type) mailcap-mime-extensions))))
+		   directory))
+	    (mm-save-part-to-file handle file)
+	    (throw 'found file))))))))
+
 (defun gnus-article-browse-html-parts (list &optional header)
   "View all \"text/html\" parts from LIST.
 Recurse into multiparts.  The optional HEADER that should be a decoded
 message header will be added to the bodies of the \"text/html\" parts."
   ;; Internal function used by `gnus-article-browse-html-article'.
-  (let (type file charset tmp-file showed)
+  (let (type file charset content cid-dir tmp-file showed)
     ;; Find and show the html-parts.
     (dolist (handle list)
       ;; If HTML, show it:
@@ -2853,16 +2882,42 @@
 			(setq handle (mm-handle-cache handle)
 			      type (mm-handle-type handle))
 			(equal (car type) "text/html"))))
-	     (when (or (setq charset (mail-content-type-get type 'charset))
-		       header
-		       (not file))
+	     (setq charset (mail-content-type-get type 'charset)
+		   content (mm-get-part handle))
+	     (with-temp-buffer
+	       (if (eq charset 'gnus-decoded)
+		   (mm-enable-multibyte)
+		 (mm-disable-multibyte))
+	       (insert content)
+	       ;; resolve cid contents
+	       (let ((case-fold-search t)
+		     cid-file)
+		 (goto-char (point-min))
+		 (while (re-search-forward "\
+<img[\t\n ]+\\(?:[^\t\n >]+[\t\n ]+\\)*src=\"\\(cid:\\([^\"]+\\)\\)\""
+					   nil t)
+		   (unless cid-dir
+		     (setq cid-dir (make-temp-file "cid" t))
+		     (add-to-list 'gnus-article-browse-html-temp-list cid-dir))
+		   (setq file nil
+			 content nil)
+		   (when (setq cid-file
+			       (gnus-article-browse-html-save-cid-content
+				(match-string 2)
+				(with-current-buffer gnus-article-buffer
+				  gnus-article-mime-handles)
+				cid-dir))
+		     (replace-match (concat "file://" cid-file)
+				    nil nil nil 1))))
+	       (unless content (setq content (buffer-string))))
+	     (when (or charset header (not file))
 	       (setq tmp-file (mm-make-temp-file
 			       ;; Do we need to care for 8.3 filenames?
 			       "mm-" nil ".html")))
 	     ;; Add a meta html tag to specify charset and a header.
 	     (cond
 	      (header
-	       (let (title eheader body hcharset coding)
+	       (let (title eheader body hcharset coding force-charset)
 		 (with-temp-buffer
 		   (mm-enable-multibyte)
 		   (setq case-fold-search t)
@@ -2885,8 +2940,8 @@
 							      charset)
 			     title (when title
 				     (mm-encode-coding-string title charset))
-			     body (mm-encode-coding-string (mm-get-part handle)
-							   charset))
+			     body (mm-encode-coding-string content charset)
+			     force-charset t)
 		     (setq hcharset (mm-find-mime-charset-region (point-min)
 								 (point-max)))
 		     (cond ((= (length hcharset) 1)
@@ -2907,7 +2962,7 @@
 					 title (when title
 						 (mm-encode-coding-string
 						  title coding))
-					 body (mm-get-part handle))
+					 body content)
 				 (setq charset 'utf-8
 				       eheader (mm-encode-coding-string
 						(buffer-string) charset)
@@ -2916,22 +2971,23 @@
 						title charset))
 				       body (mm-encode-coding-string
 					     (mm-decode-coding-string
-					      (mm-get-part handle) body)
-					     charset))))
+					      content body)
+					     charset)
+				       force-charset t)))
 			   (setq charset hcharset
 				 eheader (mm-encode-coding-string
 					  (buffer-string) coding)
 				 title (when title
 					 (mm-encode-coding-string
 					  title coding))
-				 body (mm-get-part handle)))
+				 body content))
 		       (setq eheader (mm-string-as-unibyte (buffer-string))
-			     body (mm-get-part handle))))
+			     body content)))
 		   (erase-buffer)
 		   (mm-disable-multibyte)
 		   (insert body)
 		   (when charset
-		     (mm-add-meta-html-tag handle charset))
+		     (mm-add-meta-html-tag handle charset force-charset))
 		   (when title
 		     (goto-char (point-min))
 		     (unless (search-forward "<title>" nil t)
@@ -2948,10 +3004,9 @@
 	      (charset
 	       (mm-with-unibyte-buffer
 		 (insert (if (eq charset 'gnus-decoded)
-			     (mm-encode-coding-string
-			      (mm-get-part handle)
-			      (setq charset 'utf-8))
-			   (mm-get-part handle)))
+			     (mm-encode-coding-string content
+						      (setq charset 'utf-8))
+			   content))
 		 (if (or (mm-add-meta-html-tag handle charset)
 			 (not file))
 		     (mm-write-region (point-min) (point-max)
@@ -2998,17 +3053,23 @@
 
 (defun gnus-article-browse-html-article (&optional arg)
   "View \"text/html\" parts of the current article with a WWW browser.
+Inline images embedded in a message using the cid scheme, as they are
+generally considered to be safe, will be processed properly.
 The message header is added to the beginning of every html part unless
 the prefix argument ARG is given.
 
-Warning: Spammers use links to images in HTML articles to verify
-whether you have read the message.  As
+Warning: Spammers use links to images (using the http scheme) in HTML
+articles to verify whether you have read the message.  As
 `gnus-article-browse-html-article' passes the HTML content to the
 browser without eliminating these \"web bugs\" you should only
 use it for mails from trusted senders.
 
 If you always want to display HTML parts in the browser, set
-`mm-text-html-renderer' to nil."
+`mm-text-html-renderer' to nil.
+
+This command creates temporary files to pass HTML contents including
+images if any to the browser, and deletes them when exiting the group
+\(if you want)."
   ;; Cf. `mm-w3m-safe-url-regexp'
   (interactive "P")
   (if arg
--- a/lisp/gnus/message.el	Fri Mar 26 08:01:19 2010 +0100
+++ b/lisp/gnus/message.el	Thu Apr 01 08:50:44 2010 +0200
@@ -1167,11 +1167,7 @@
   :valid-regexp "^\\'"
   :error "All header lines must be newline terminated")
 
-(defcustom message-default-headers
-  ;; Default to the value of `mail-default-headers' if available.
-  ;; Note: as for Emacs 21, XEmacs 21.4 and 21.5, it is unavailable
-  ;; unless sendmail.el is loaded.
-  (if (boundp 'mail-default-headers) mail-default-headers "")
+(defcustom message-default-headers ""
   "*A string containing header lines to be inserted in outgoing messages.
 It is inserted before you edit the message, so you can edit or delete
 these lines."
@@ -1184,16 +1180,18 @@
   ;; Ease the transition from mail-mode to message-mode.  See bugs#4431, 5555.
   (concat (if (and (boundp 'mail-default-reply-to)
 		   (stringp mail-default-reply-to))
-	      (format "Reply-to: %s\n" mail-default-reply-to)
-	    "")
+	      (format "Reply-to: %s\n" mail-default-reply-to))
 	  (if (and (boundp 'mail-self-blind)
 		   mail-self-blind)
-	      (format "BCC: %s\n" user-mail-address)
-	    "")
+	      (format "BCC: %s\n" user-mail-address))
 	  (if (and (boundp 'mail-archive-file-name)
 		   (stringp mail-archive-file-name))
-	      (format "FCC: %s\n" mail-archive-file-name)
-	    ""))
+	      (format "FCC: %s\n" mail-archive-file-name))
+	  ;; Use the value of `mail-default-headers' if available.
+	  ;; Note: as for Emacs 21, XEmacs 21.4 and 21.5, it is
+	  ;; unavailable unless sendmail.el is loaded.
+	  (if (boundp 'mail-default-headers)
+	      mail-default-headers))
   "*A string of header lines to be inserted in outgoing mails."
   :version "23.2"
   :group 'message-headers
--- a/lisp/gnus/mm-decode.el	Fri Mar 26 08:01:19 2010 +0100
+++ b/lisp/gnus/mm-decode.el	Thu Apr 01 08:50:44 2010 +0200
@@ -1258,11 +1258,11 @@
 	   (mm-save-part-to-file handle file)
 	   file))))
 
-(defun mm-add-meta-html-tag (handle &optional charset)
+(defun mm-add-meta-html-tag (handle &optional charset force-charset)
   "Add meta html tag to specify CHARSET of HANDLE in the current buffer.
 CHARSET defaults to the one HANDLE specifies.  Existing meta tag that
-specifies charset will not be modified.  Return t if meta tag is added
-or replaced."
+specifies charset will not be modified unless FORCE-CHARSET is non-nil.
+Return t if meta tag is added or replaced."
   (when (equal (mm-handle-media-type handle) "text/html")
     (when (or charset
 	      (setq charset (mail-content-type-get (mm-handle-type handle)
@@ -1273,8 +1273,9 @@
 	(goto-char (point-min))
 	(if (re-search-forward "\
 <meta\\s-+http-equiv=[\"']?content-type[\"']?\\s-+content=[\"']\
-text/\\(\\sw+\\)\\(?:\;\\s-*charset=\\(.+?\\)\\)?[\"'][^>]*>" nil t)
-	    (if (and (match-beginning 2)
+text/\\(\\sw+\\)\\(?:\;\\s-*charset=\\(.+\\)\\)?[\"'][^>]*>" nil t)
+	    (if (and (not force-charset)
+		     (match-beginning 2)
 		     (string-match "\\`html\\'" (match-string 1)))
 		;; Don't modify existing meta tag.
 		nil
--- a/lisp/image.el	Fri Mar 26 08:01:19 2010 +0100
+++ b/lisp/image.el	Thu Apr 01 08:50:44 2010 +0200
@@ -681,8 +681,9 @@
 shall be displayed."
   (cond
    ((eq (plist-get (cdr image) :type) 'gif)
-    (let* ((extdata (image-extension-data image))
-	   (images (plist-get extdata 'count))
+    (let* ((metadata (image-metadata image))
+	   (images (plist-get metadata 'count))
+	   (extdata (plist-get metadata 'extension-data))
 	   (anim (plist-get extdata #xF9)))
       (and (integerp images) (> images 1)
 	   (stringp anim) (>= (length anim) 4)
--- a/lisp/language/indian.el	Fri Mar 26 08:01:19 2010 +0100
+++ b/lisp/language/indian.el	Thu Apr 01 08:50:44 2010 +0200
@@ -140,28 +140,25 @@
 
 (defconst devanagari-composable-pattern
   (let ((table
-	 '(("V" . "[\u0904-\u0914\u0960-\u0961\u0972]") ; independent vowel
-	   ("C" . "[\u0915-\u0939\u0958-\u095F\u097B-\u097C\u097E-\u097F]") ; consonant
-	   ("R" . "\u0930")			 ; RA
-	   ("n" . "\u093C")			 ; NUKTA
-	   ("H" . "\u094D")			 ; HALANT
-	   ("m" . "\u093F")			 ; vowel sign (pre)
-	   ("u" . "[\u0945-\u0948\u0955]")	 ; vowel sign (above)
-	   ("b" . "[\u0941-\u0944\u0962-\u0963]") ; vowel sign (below)
-	   ("p" . "[\u093E\u0940\u0949-\u094C]") ; vowel sign (post)
-	   ("A" . "[\u0900-\u0902\u0953-\u0954]") ; vowel modifier (above)
-	   ("a" . "\u0903")			 ; vowel modifier (post) 
-	   ("S" . "\u0951")			 ; stress sign (above)
-	   ("s" . "\u0952")			 ; stress sign (below)
-	   ("N" . "\u200C")			 ; ZWNJ
-	   ("J" . "\u200D")			 ; ZWJ
-	   ("X" . "[\u0900-\u097F]"))))		 ; all coverage
+	 '(("a" . "[\u0900-\u0902]")	; vowel modifier (above)
+	   ("A" . "\u0903")		; vowel modifier (post) 
+	   ("V" . "[\u0904-\u0914\u0960-\u0961\u0972]") ; independent vowel
+	   ("C" . "[\u0915-\u0939\u0958-\u095F\u0979-\u097F]") ; consonant
+	   ("R" . "\u0930")		; RA
+	   ("n" . "\u093C")		; NUKTA
+	   ("v" . "[\u093E-\u094C\u094E\u0955\u0962-\u0963]") ; vowel sign
+	   ("H" . "\u094D")		; HALANT
+	   ("s" . "[\u0951-\u0952]")	; stress sign
+	   ("t" . "[\u0953-\u0954]")	; accent
+	   ("N" . "\u200C")		; ZWNJ
+	   ("J" . "\u200D")		; ZWJ
+	   ("X" . "[\u0900-\u097F]"))))	; all coverage
     (indian-compose-regexp
      (concat
       ;; syllables with an independent vowel, or
-      "\\(?:RH\\)?Vn?m?b?u?p?n?A?s?S?a?\\|"
+      "\\(?:RH\\)?Vn?\\(?:J?HR\\)?v*n?a?s?t?A?\\|"
       ;; consonant-based syllables, or
-      "\\(?:Cn?J?HJ?\\)*Cn?\\(?:H[NJ]?\\|m?b?u?p?n?A?s?S?a?\\)\\|"
+      "Cn?\\(?:J?HJ?Cn?\\)*\\(?:H[NJ]?\\|v*n?a?s?t?A?\\)\\|"
       ;; special consonant form, or
       "JHR\\|"
       ;; any other singleton characters
@@ -169,43 +166,202 @@
      table))
   "Regexp matching a composable sequence of Devanagari characters.")
 
+(defconst bengali-composable-pattern
+  (let ((table
+	 '(("a" . "\u0981")		; SIGN CANDRABINDU
+	   ("A" . "[\u0982-\u0983]")	; SIGN ANUSVARA .. VISARGA
+	   ("V" . "[\u0985-\u0994\u09E0-\u09E1]") ; independent vowel
+	   ("C" . "[\u0995-\u09B9\u09DC-\u09DF\u09F1]") ; consonant
+	   ("B" . "[\u09AC\u09AF-\u09B0\u09F0]")		; BA, YA, RA
+	   ("R" . "[\u09B0\u09F0]")		; RA
+	   ("n" . "\u09BC")		; NUKTA
+	   ("v" . "[\u09BE-\u09CC\u09D7\u09E2-\u09E3]") ; vowel sign
+	   ("H" . "\u09CD")		; HALANT
+	   ("T" . "\u09CE")		; KHANDA TA
+	   ("N" . "\u200C")		; ZWNJ
+	   ("J" . "\u200D")		; ZWJ
+	   ("X" . "[\u0980-\u09FF]"))))	; all coverage
+    (indian-compose-regexp
+     (concat
+      ;; syllables with an independent vowel, or
+      "\\(?:RH\\)?Vn?\\(?:J?HB\\)?v*n?a?A?\\|"
+      ;; consonant-based syllables, or
+      "Cn?\\(?:J?HJ?Cn?\\)*\\(?:H[NJ]?\\|v*[NJ]?v?a?A?\\)\\|"
+      ;; another syllables with an independent vowel, or
+      "\\(?:RH\\)?T\\|"
+      ;; special consonant form, or
+      "JHB\\|"
+      ;; any other singleton characters
+      "X")
+     table))
+  "Regexp matching a composable sequence of Bengali characters.")
+
+(defconst gurmukhi-composable-pattern
+  (let ((table
+	 '(("a" . "[\u0A01-\u0A02]")	; SIGN ADAK BINDI .. BINDI
+	   ("A" . "\u0A03]")		; SIGN VISARGA
+	   ("V" . "[\u0A05-\u0A14]")	; independent vowel
+	   ("C" . "[\u0A15-\u0A39\u0A59-\u0A5E]")	; consonant
+	   ("Y" . "[\u0A2F\u0A30\u0A35\u0A39]") ; YA, RA, VA, HA
+	   ("n" . "\u0A3C")		; NUKTA
+	   ("v" . "[\u0A3E-\u0A4C]")	; vowel sign
+	   ("H" . "\u0A4D")		; VIRAMA
+	   ("a" . "\u0A70")		; TIPPI
+	   ("N" . "\u200C")		; ZWNJ
+	   ("J" . "\u200D")		; ZWJ
+	   ("X" . "[\u0A00-\u0A7F]"))))	; all coverage
+    (indian-compose-regexp
+     (concat
+      ;; consonant-based syllables, or
+      "Cn?\\(?:J?HJ?Cn?\\)*\\(?:H[NJ]?\\|v*n?a?A?\\)\\|"
+      ;; syllables with an independent vowel, or
+      "Vn?\\(?:J?HY\\)?v*n?a?A?\\|"
+      ;; special consonant form, or
+      "JHY\\|"
+      ;; any other singleton characters
+      "X")
+     table))
+  "Regexp matching a composable sequence of Gurmukhi characters.")
+
+(defconst gujarati-composable-pattern
+  (let ((table
+	 '(("a" . "[\u0A81-\u0A82]")	; SIGN CANDRABINDU .. ANUSVARA
+	   ("A" . "\u0A83]")		; SIGN VISARGA
+	   ("V" . "[\u0A85-\u0A94\u0AE0-\u0AE1]") ; independent vowel
+	   ("C" . "[\u0A95-\u0AB9]")	; consonant
+	   ("R" . "\u0AB0")		; RA
+	   ("n" . "\u0ABC")		; NUKTA
+	   ("v" . "[\u0ABE-\u0ACC\u0AE2-\u0AE3]") ; vowel sign
+	   ("H" . "\u0ACD")		; VIRAMA
+	   ("N" . "\u200C")		; ZWNJ
+	   ("J" . "\u200D")		; ZWJ
+	   ("X" . "[\u0A80-\u0AFF]"))))	; all coverage
+    (indian-compose-regexp
+     (concat
+      ;; syllables with an independent vowel, or
+      "\\(?:RH\\)?Vn?\\(?:J?HR\\)?v*n?a?A?\\|"
+      ;; consonant-based syllables, or
+      "Cn?\\(?:J?HJ?Cn?\\)*\\(?:H[NJ]?|v*n?a?A?\\)\\|"
+      ;; special consonant form, or
+      "JHR\\|"
+      ;; any other singleton characters
+      "X")
+     table))
+  "Regexp matching a composable sequence of Gujarati characters.")
+
+(defconst oriya-composable-pattern
+  (let ((table
+	 '(("a" . "\u0B01")		; SIGN CANDRABINDU
+	   ("A" . "[\u0B02-\u0B03]")	; SIGN ANUSVARA .. VISARGA
+	   ("V" . "[\u0B05-\u0B14\u0B60-\u0B61]") ; independent vowel
+	   ("C" . "[\u0B15-\u0B39\u0B5C-\u0B5D\u0B71]")	; consonant
+	   ("B" . "[\u0B15-\u0B17\u0B1B-\u0B1D\u0B1F-\u0B21\u0B23-\u0B24\u0B27-\u0B30\u0B32-\u0B35\u0B38-\u0B39]") ; consonant with below form
+	   ("n" . "\u0B3C")		; NUKTA
+	   ("v" . "[\u0B3E-\u0B44\u0B56-\u0B57\u0B62-\u0B63]") ; vowel sign
+	   ("H" . "\u0B4D")		; VIRAMA
+	   ("N" . "\u200C")		; ZWNJ
+	   ("J" . "\u200D")		; ZWJ
+	   ("X" . "[\u0B00-\u0B7F]"))))	; all coverage
+    (indian-compose-regexp
+     (concat
+      ;; syllables with an independent vowel, or
+      "\\(?:RH\\)?Vn?\\(?:J?HB\\)?v*n?a?A?\\|"
+      ;; consonant-based syllables, or
+      "Cn?\\(?:J?HJ?Cn?\\)*\\(?:H[NJ]?|v*n?a?A?\\)\\|"
+      ;; special consonant form, or
+      "JHB\\|"
+      ;; any other singleton characters
+      "X")
+     table))
+  "Regexp matching a composable sequence of Oriya characters.")
+
 (defconst tamil-composable-pattern
-  (concat
-   "\\([à®…-à®”]\\)\\|"
-   "[ஂஃ]\\|" ;; vowel modifier considered independent
-   "\\(\\(?:\\(?:கà¯à®·\\)\\|[க-ஹ]\\)[à¯à®¾-ௌ]?\\)\\|"
-   "\\(à®·à¯à®°à¯€\\)")
+  (let ((table
+	 '(("a" . "\u0B82")		; SIGN ANUSVARA
+	   ("V" . "[\u0B85-\u0B94]")	; independent vowel
+	   ("C" . "[\u0B95-\u0BB9]")	; consonant
+	   ("v" . "[\u0BBE-\u0BC8\u0BD7]") ; vowel sign
+	   ("H" . "\u0BCD")		; VIRAMA
+	   ("N" . "\u200C")		; ZWNJ
+	   ("J" . "\u200D")		; ZWJ
+	   ("X" . "[\u0B80-\u0BFF]"))))	; all coverage
+    (indian-compose-regexp
+     (concat
+      ;; consonant-based syllables, or
+      "C\\(?:J?HJ?C\\)*\\(?:H[NJ]?|v*a?\\)\\|"
+      ;; syllables with an independent vowel, or
+      "Vv*a?\\|"
+      ;; any other singleton characters
+      "X")
+     table))
   "Regexp matching a composable sequence of Tamil characters.")
 
+(defconst telugu-composable-pattern
+  (let ((table
+	 '(("a" . "[\u0C01-\u0C03]")	; SIGN CANDRABINDU .. VISARGA
+	   ("V" . "[\u0C05-\u0C14\u0C60-\u0C61]") ; independent vowel
+	   ("C" . "[\u0C15-\u0C39\u0C58-\u0C59]") ; consonant
+	   ("v" . "[\u0C3E-\u0C4C\u0C55-\u0C56\u0C62-\u0C63]")	; vowel sign
+	   ("H" . "\u0BCD")		; VIRAMA
+	   ("N" . "\u200C")		; ZWNJ
+	   ("J" . "\u200D")		; ZWJ
+	   ("X" . "[\u0C00-\u0C7F]"))))	; all coverage
+    (indian-compose-regexp
+     (concat
+      ;; consonant-based syllables, or
+      "C\\(?:J?HJ?C\\)*\\(?:H[NJ]?|v*a?\\)\\|"
+      ;; syllables with an independent vowel, or
+      "V\\(?:J?HC\\)?v*a?\\|"
+      ;; special consonant form, or
+      "JHC\\|"
+      ;; any other singleton characters
+      "X")
+     table))
+  "Regexp matching a composable sequence of Telugu characters.")
+
 (defconst kannada-composable-pattern
-  (concat
-   "\\([ಂ-ಔೠಌ]\\)\\|[ಃ]"
-   "\\|\\("
-   "\\(?:\\(?:[ಕ-ಹ]à³\\)?\\(?:[ಕ-ಹ]à³\\)?\\(?:[ಕ-ಹ]à³\\)?[ಕ-ಹ]à³\\)?"
-   "[ಕ-ಹ]\\(?:à³\\|[ಾ-à³à³•à³ƒ]?\\)?"
-   "\\)")
+  (let ((table
+	 '(("A" . "[\u0C82-\u0C83]")	; SIGN ANUSVARA .. VISARGA
+	   ("V" . "[\u0C85-\u0C94\u0CE0-\u0CE1]") ; independent vowel
+	   ("C" . "[\u0C95-\u0CB9\u0CDE]")	  ; consonant
+	   ("B" . "\u0CB0")		; RA
+	   ("n" . "\u0CBC")		; NUKTA
+	   ("v" . "[\u0CBE-\u0CCC\u0CD5-\u0CD6\u0CE2-\u0CE3]") ; vowel sign
+	   ("H" . "\u0CCD")		; VIRAMA
+	   ("N" . "\u200C")		; ZWNJ
+	   ("J" . "\u200D")		; ZWJ
+	   ("X" . "[\u0C80-\u0CFF]"))))	; all coverage
+    (indian-compose-regexp
+     (concat
+      ;; syllables with an independent vowel, or
+      "\\(?:RH\\)?Vn?\\(?:J?HC\\)?v?A?\\|"
+      ;; consonant-based syllables, or
+      "Cn?\\(?:J?HJ?Cn?\\)*\\(?:H[NJ]?|v*n?A?\\)\\|"
+      ;; special consonant form, or
+      "JHB\\|"
+      ;; any other singleton characters
+      "X")
+     table))
   "Regexp matching a composable sequence of Kannada characters.")
 
 (defconst malayalam-composable-pattern
   (let ((table
-	 '(("V" . "[\u0D05-\u0D14\u0D60-\u0D61]") ; independent vowel
+	 '(("A" . "[\u0D02-\u0D03]")	; SIGN ANUSVARA .. VISARGA
+	   ("V" . "[\u0D05-\u0D14\u0D60-\u0D61]") ; independent vowel
 	   ("C" . "[\u0D15-\u0D39]")		  ; consonant 
-	   ("m" . "[\u0D46-\u0D48\u0D4A-\u0D4C]") ; prebase matra
-	   ("p" . "[\u0D3E-\u0D44\u0D57]")	  ; postbase matra
-	   ("b" . "[\u0D62-\u0D63]")		  ; belowbase matra
-	   ("a" . "[\u0D02-\u0D03]")		  ; abovebase sign
-	   ("H" . "\u0D4D")			  ; virama sign 
+	   ("Y" . "[\u0D2F-\u0D30\u0D32\u0D35]")  ; YA, RA, LA, VA
+	   ("v" . "[\u0D3E-\u0D48\u0D57\u0D62-\u0D63]")	; postbase matra
 	   ("N" . "\u200C")			  ; ZWNJ
 	   ("J" . "\u200D")			  ; ZWJ
 	   ("X" . "[\u0D00-\u0D7F]"))))		  ; all coverage
     (indian-compose-regexp
      (concat
+      ;; consonant-based syllables, or
+      "\\(?:CJ?HJ?C\\)*\\(?:H[NJ]?\\|v?A?\\)\\|"
       ;; syllables with an independent vowel, or
-      "V\\(?:J?HC\\)?m?b?p?a?\\|"
-      ;; consonant-based syllables, or
-      "\\(?:CJ?HJ?\\)\\{0,4\\}C\\(?:H[NJ]?\\|m?b?p?a?\\)\\|"
+      "V\\(?:J?HY\\)?v*?A?\\|"
       ;; special consonant form, or
-      "JHC\\|"
+      "JHY\\|"
       ;; any other singleton characters
       "X")
      table))
@@ -213,13 +369,13 @@
 
 (let ((script-regexp-alist
        `((devanagari . ,devanagari-composable-pattern)
-	 (bengali . "[\x980-\x9FF\x200C\x200D]+")
-	 (gurmukhi . "[\xA00-\xA7F\x200C\x200D]+")
-	 (gujarati . "[\xA80-\xAFF\x200C\x200D]+")
-	 (oriya . "[\xB00-\xB7F\x200C\x200D]+")
-	 (tamil . "[\xB80-\xBFF\x200C\x200D]+")
-	 (telugu . "[\xC00-\xC7F\x200C\x200D]+")
-	 (kannada . "[\xC80-\xCFF\x200C\x200D]+")
+	 (bengali . ,bengali-composable-pattern)
+	 (gurmukhi . ,gurmukhi-composable-pattern)
+	 (gujarati . ,gujarati-composable-pattern)
+	 (oriya . ,oriya-composable-pattern)
+	 (tamil . ,tamil-composable-pattern)
+	 (telugu . ,telugu-composable-pattern)
+	 (kannada . ,kannada-composable-pattern)
 	 (malayalam . ,malayalam-composable-pattern))))
   (map-char-table
    #'(lambda (key val)
--- a/lisp/language/sinhala.el	Fri Mar 26 08:01:19 2010 +0100
+++ b/lisp/language/sinhala.el	Thu Apr 01 08:50:44 2010 +0200
@@ -33,7 +33,17 @@
 (set-char-table-range 
  composition-function-table
  '(#xD80 . #xDFF)
- (list (vector "[\xD80-\xDFF\x200C\x200D]+" 0 'font-shape-gstring)))
+ (list (vector
+	;; C:consonant, H:HALANT, J:ZWJ, v:vowel sign,
+	;; V:independent vowel, a:ANUSVARA .. VISARGA
+	(concat
+	 ;; C(HJC)*v*H?a?, or
+	 "[\u0D9A-\u0DC6]\\(?:\u0DCA\u200D[\u0D9A-\u0DC6]\\)*[\u0DCF-\u0DDF\u0DF2-\u0DF3]*\u0DCA?[\u0D82-\u0D83]?\\|"
+	 ;; Va?, or
+	 "[\u0D85-\u0D96][\u0D82-\u0D83]?\\|"
+	 ;; any other singleton characters
+	 "[\u0D80-\u0DFF]")
+	0 'font-shape-gstring)))
 
 ;; arch-tag: 87b9ad3b-5090-422f-b942-eb85b9d52e7c
 ;; sinhala.el ends here
--- a/lisp/ldefs-boot.el	Fri Mar 26 08:01:19 2010 +0100
+++ b/lisp/ldefs-boot.el	Thu Apr 01 08:50:44 2010 +0200
@@ -5,7 +5,7 @@
 
 ;;;### (autoloads (5x5-crack 5x5-crack-xor-mutate 5x5-crack-mutating-best
 ;;;;;;  5x5-crack-mutating-current 5x5-crack-randomly 5x5) "5x5"
-;;;;;;  "play/5x5.el" (19277 34922))
+;;;;;;  "play/5x5.el" (19279 5151))
 ;;; Generated autoloads from play/5x5.el
 
 (autoload '5x5 "5x5" "\
@@ -65,7 +65,7 @@
 ;;;***
 
 ;;;### (autoloads (list-one-abbrev-table) "abbrevlist" "abbrevlist.el"
-;;;;;;  (19277 34915))
+;;;;;;  (19279 5148))
 ;;; Generated autoloads from abbrevlist.el
 
 (autoload 'list-one-abbrev-table "abbrevlist" "\
@@ -76,7 +76,7 @@
 ;;;***
 
 ;;;### (autoloads (ada-mode ada-add-extensions) "ada-mode" "progmodes/ada-mode.el"
-;;;;;;  (19312 41311))
+;;;;;;  (19313 15414))
 ;;; Generated autoloads from progmodes/ada-mode.el
 
 (autoload 'ada-add-extensions "ada-mode" "\
@@ -96,7 +96,7 @@
 ;;;***
 
 ;;;### (autoloads (ada-header) "ada-stmt" "progmodes/ada-stmt.el"
-;;;;;;  (19279 53114))
+;;;;;;  (19279 38446))
 ;;; Generated autoloads from progmodes/ada-stmt.el
 
 (autoload 'ada-header "ada-stmt" "\
@@ -107,7 +107,7 @@
 ;;;***
 
 ;;;### (autoloads (ada-find-file) "ada-xref" "progmodes/ada-xref.el"
-;;;;;;  (19279 53114))
+;;;;;;  (19279 38446))
 ;;; Generated autoloads from progmodes/ada-xref.el
 
 (autoload 'ada-find-file "ada-xref" "\
@@ -121,8 +121,8 @@
 ;;;### (autoloads (change-log-merge add-log-current-defun change-log-mode
 ;;;;;;  add-change-log-entry-other-window add-change-log-entry find-change-log
 ;;;;;;  prompt-for-change-log-name add-log-mailing-address add-log-full-name
-;;;;;;  add-log-current-defun-function) "add-log" "add-log.el" (19277
-;;;;;;  34915))
+;;;;;;  add-log-current-defun-function) "add-log" "add-log.el" (19279
+;;;;;;  5148))
 ;;; Generated autoloads from add-log.el
 
 (put 'change-log-default-name 'safe-local-variable 'string-or-null-p)
@@ -261,7 +261,7 @@
 
 ;;;### (autoloads (defadvice ad-activate ad-add-advice ad-disable-advice
 ;;;;;;  ad-enable-advice ad-default-compilation-action ad-redefinition-action)
-;;;;;;  "advice" "emacs-lisp/advice.el" (19321 45634))
+;;;;;;  "advice" "emacs-lisp/advice.el" (19323 49698))
 ;;; Generated autoloads from emacs-lisp/advice.el
 
 (defvar ad-redefinition-action 'warn "\
@@ -404,7 +404,7 @@
 
 ;;;### (autoloads (align-newline-and-indent align-unhighlight-rule
 ;;;;;;  align-highlight-rule align-current align-entire align-regexp
-;;;;;;  align) "align" "align.el" (19277 34915))
+;;;;;;  align) "align" "align.el" (19279 5148))
 ;;; Generated autoloads from align.el
 
 (autoload 'align "align" "\
@@ -494,7 +494,7 @@
 ;;;***
 
 ;;;### (autoloads (outlineify-sticky allout-mode) "allout" "allout.el"
-;;;;;;  (19277 34915))
+;;;;;;  (19279 5148))
 ;;; Generated autoloads from allout.el
 
 (put 'allout-use-hanging-indents 'safe-local-variable (if (fboundp 'booleanp) 'booleanp '(lambda (x) (member x '(t nil)))))
@@ -801,7 +801,7 @@
 ;;;***
 
 ;;;### (autoloads (ange-ftp-hook-function ange-ftp-reread-dir) "ange-ftp"
-;;;;;;  "net/ange-ftp.el" (19360 14173))
+;;;;;;  "net/ange-ftp.el" (19356 10801))
 ;;; Generated autoloads from net/ange-ftp.el
 
 (defalias 'ange-ftp-re-read-dir 'ange-ftp-reread-dir)
@@ -823,7 +823,7 @@
 ;;;***
 
 ;;;### (autoloads (animate-birthday-present animate-sequence animate-string)
-;;;;;;  "animate" "play/animate.el" (19277 34922))
+;;;;;;  "animate" "play/animate.el" (19279 5151))
 ;;; Generated autoloads from play/animate.el
 
 (autoload 'animate-string "animate" "\
@@ -851,7 +851,7 @@
 ;;;***
 
 ;;;### (autoloads (ansi-color-process-output ansi-color-for-comint-mode-on)
-;;;;;;  "ansi-color" "ansi-color.el" (19277 34915))
+;;;;;;  "ansi-color" "ansi-color.el" (19279 5148))
 ;;; Generated autoloads from ansi-color.el
 
 (autoload 'ansi-color-for-comint-mode-on "ansi-color" "\
@@ -877,7 +877,7 @@
 ;;;***
 
 ;;;### (autoloads (antlr-set-tabs antlr-mode antlr-show-makefile-rules)
-;;;;;;  "antlr-mode" "progmodes/antlr-mode.el" (19277 34922))
+;;;;;;  "antlr-mode" "progmodes/antlr-mode.el" (19279 5151))
 ;;; Generated autoloads from progmodes/antlr-mode.el
 
 (autoload 'antlr-show-makefile-rules "antlr-mode" "\
@@ -914,7 +914,7 @@
 ;;;***
 
 ;;;### (autoloads (appt-activate appt-make-list appt-delete appt-add)
-;;;;;;  "appt" "calendar/appt.el" (19277 34917))
+;;;;;;  "appt" "calendar/appt.el" (19279 5149))
 ;;; Generated autoloads from calendar/appt.el
 
 (autoload 'appt-add "appt" "\
@@ -954,7 +954,7 @@
 
 ;;;### (autoloads (apropos-documentation apropos-value apropos-library
 ;;;;;;  apropos apropos-documentation-property apropos-command apropos-variable
-;;;;;;  apropos-read-pattern) "apropos" "apropos.el" (19277 34915))
+;;;;;;  apropos-read-pattern) "apropos" "apropos.el" (19279 5148))
 ;;; Generated autoloads from apropos.el
 
 (autoload 'apropos-read-pattern "apropos" "\
@@ -1057,8 +1057,8 @@
 
 ;;;***
 
-;;;### (autoloads (archive-mode) "arc-mode" "arc-mode.el" (19318
-;;;;;;  65023))
+;;;### (autoloads (archive-mode) "arc-mode" "arc-mode.el" (19321
+;;;;;;  4517))
 ;;; Generated autoloads from arc-mode.el
 
 (autoload 'archive-mode "arc-mode" "\
@@ -1078,7 +1078,7 @@
 
 ;;;***
 
-;;;### (autoloads (array-mode) "array" "array.el" (19277 34915))
+;;;### (autoloads (array-mode) "array" "array.el" (19279 5148))
 ;;; Generated autoloads from array.el
 
 (autoload 'array-mode "array" "\
@@ -1149,8 +1149,8 @@
 
 ;;;***
 
-;;;### (autoloads (artist-mode) "artist" "textmodes/artist.el" (19315
-;;;;;;  24485))
+;;;### (autoloads (artist-mode) "artist" "textmodes/artist.el" (19321
+;;;;;;  4517))
 ;;; Generated autoloads from textmodes/artist.el
 
 (autoload 'artist-mode "artist" "\
@@ -1356,8 +1356,8 @@
 
 ;;;***
 
-;;;### (autoloads (asm-mode) "asm-mode" "progmodes/asm-mode.el" (19277
-;;;;;;  34922))
+;;;### (autoloads (asm-mode) "asm-mode" "progmodes/asm-mode.el" (19279
+;;;;;;  5151))
 ;;; Generated autoloads from progmodes/asm-mode.el
 
 (autoload 'asm-mode "asm-mode" "\
@@ -1385,7 +1385,7 @@
 ;;;***
 
 ;;;### (autoloads (autoarg-kp-mode autoarg-mode) "autoarg" "autoarg.el"
-;;;;;;  (19277 34915))
+;;;;;;  (19279 5148))
 ;;; Generated autoloads from autoarg.el
 
 (defvar autoarg-mode nil "\
@@ -1439,7 +1439,7 @@
 ;;;***
 
 ;;;### (autoloads (autoconf-mode) "autoconf" "progmodes/autoconf.el"
-;;;;;;  (19277 34922))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from progmodes/autoconf.el
 
 (autoload 'autoconf-mode "autoconf" "\
@@ -1450,7 +1450,7 @@
 ;;;***
 
 ;;;### (autoloads (auto-insert-mode define-auto-insert auto-insert)
-;;;;;;  "autoinsert" "autoinsert.el" (19277 34915))
+;;;;;;  "autoinsert" "autoinsert.el" (19279 5148))
 ;;; Generated autoloads from autoinsert.el
 
 (autoload 'auto-insert "autoinsert" "\
@@ -1489,7 +1489,7 @@
 
 ;;;### (autoloads (batch-update-autoloads update-directory-autoloads
 ;;;;;;  update-file-autoloads) "autoload" "emacs-lisp/autoload.el"
-;;;;;;  (19361 52486))
+;;;;;;  (19365 25156))
 ;;; Generated autoloads from emacs-lisp/autoload.el
 
 (put 'generated-autoload-file 'safe-local-variable 'stringp)
@@ -1528,7 +1528,7 @@
 
 ;;;### (autoloads (global-auto-revert-mode turn-on-auto-revert-tail-mode
 ;;;;;;  auto-revert-tail-mode turn-on-auto-revert-mode auto-revert-mode)
-;;;;;;  "autorevert" "autorevert.el" (19277 34915))
+;;;;;;  "autorevert" "autorevert.el" (19279 5148))
 ;;; Generated autoloads from autorevert.el
 
 (autoload 'auto-revert-mode "autorevert" "\
@@ -1609,7 +1609,7 @@
 ;;;***
 
 ;;;### (autoloads (mouse-avoidance-mode mouse-avoidance-mode) "avoid"
-;;;;;;  "avoid.el" (19277 34915))
+;;;;;;  "avoid.el" (19279 5148))
 ;;; Generated autoloads from avoid.el
 
 (defvar mouse-avoidance-mode nil "\
@@ -1650,7 +1650,7 @@
 ;;;***
 
 ;;;### (autoloads (display-battery-mode battery) "battery" "battery.el"
-;;;;;;  (19277 34915))
+;;;;;;  (19279 5148))
 ;;; Generated autoloads from battery.el
  (put 'battery-mode-line-string 'risky-local-variable t)
 
@@ -1682,7 +1682,7 @@
 ;;;***
 
 ;;;### (autoloads (benchmark benchmark-run-compiled benchmark-run)
-;;;;;;  "benchmark" "emacs-lisp/benchmark.el" (19277 34919))
+;;;;;;  "benchmark" "emacs-lisp/benchmark.el" (19279 5149))
 ;;; Generated autoloads from emacs-lisp/benchmark.el
 
 (autoload 'benchmark-run "benchmark" "\
@@ -1715,7 +1715,7 @@
 ;;;***
 
 ;;;### (autoloads (bibtex-search-entry bibtex-mode bibtex-initialize)
-;;;;;;  "bibtex" "textmodes/bibtex.el" (19279 53114))
+;;;;;;  "bibtex" "textmodes/bibtex.el" (19279 38446))
 ;;; Generated autoloads from textmodes/bibtex.el
 
 (autoload 'bibtex-initialize "bibtex" "\
@@ -1802,7 +1802,7 @@
 ;;;***
 
 ;;;### (autoloads (bibtex-style-mode) "bibtex-style" "textmodes/bibtex-style.el"
-;;;;;;  (19277 34923))
+;;;;;;  (19279 5152))
 ;;; Generated autoloads from textmodes/bibtex-style.el
  (add-to-list 'auto-mode-alist (cons (purecopy "\\.bst\\'") 'bibtex-style-mode))
 
@@ -1815,7 +1815,7 @@
 
 ;;;### (autoloads (binhex-decode-region binhex-decode-region-external
 ;;;;;;  binhex-decode-region-internal) "binhex" "mail/binhex.el"
-;;;;;;  (19277 34921))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from mail/binhex.el
 
 (defconst binhex-begin-line "^:...............................................................$")
@@ -1838,8 +1838,8 @@
 
 ;;;***
 
-;;;### (autoloads (blackbox) "blackbox" "play/blackbox.el" (19277
-;;;;;;  34922))
+;;;### (autoloads (blackbox) "blackbox" "play/blackbox.el" (19279
+;;;;;;  5151))
 ;;; Generated autoloads from play/blackbox.el
 
 (autoload 'blackbox "blackbox" "\
@@ -1962,7 +1962,7 @@
 ;;;;;;  bookmark-save bookmark-write bookmark-delete bookmark-insert
 ;;;;;;  bookmark-rename bookmark-insert-location bookmark-relocate
 ;;;;;;  bookmark-jump-other-window bookmark-jump bookmark-set) "bookmark"
-;;;;;;  "bookmark.el" (19325 42040))
+;;;;;;  "bookmark.el" (19326 6129))
 ;;; Generated autoloads from bookmark.el
  (define-key ctl-x-r-map "b" 'bookmark-jump)
  (define-key ctl-x-r-map "m" 'bookmark-set)
@@ -2169,7 +2169,7 @@
 ;;;;;;  browse-url-of-dired-file browse-url-of-buffer browse-url-of-file
 ;;;;;;  browse-url-url-at-point browse-url-galeon-program browse-url-firefox-program
 ;;;;;;  browse-url-browser-function) "browse-url" "net/browse-url.el"
-;;;;;;  (19360 14173))
+;;;;;;  (19356 10801))
 ;;; Generated autoloads from net/browse-url.el
 
 (defvar browse-url-browser-function (cond ((memq system-type '(windows-nt ms-dos cygwin)) 'browse-url-default-windows-browser) ((memq system-type '(darwin)) 'browse-url-default-macosx-browser) (t 'browse-url-default-browser)) "\
@@ -2499,8 +2499,8 @@
 
 ;;;***
 
-;;;### (autoloads (snarf-bruces bruce) "bruce" "play/bruce.el" (19277
-;;;;;;  34922))
+;;;### (autoloads (snarf-bruces bruce) "bruce" "play/bruce.el" (19279
+;;;;;;  5151))
 ;;; Generated autoloads from play/bruce.el
 
 (autoload 'bruce "bruce" "\
@@ -2516,7 +2516,7 @@
 ;;;***
 
 ;;;### (autoloads (bs-show bs-customize bs-cycle-previous bs-cycle-next)
-;;;;;;  "bs" "bs.el" (19277 34915))
+;;;;;;  "bs" "bs.el" (19279 5148))
 ;;; Generated autoloads from bs.el
 
 (autoload 'bs-cycle-next "bs" "\
@@ -2556,7 +2556,7 @@
 
 ;;;***
 
-;;;### (autoloads (bubbles) "bubbles" "play/bubbles.el" (19277 34922))
+;;;### (autoloads (bubbles) "bubbles" "play/bubbles.el" (19279 5151))
 ;;; Generated autoloads from play/bubbles.el
 
 (autoload 'bubbles "bubbles" "\
@@ -2578,7 +2578,7 @@
 ;;;***
 
 ;;;### (autoloads (bug-reference-prog-mode bug-reference-mode) "bug-reference"
-;;;;;;  "progmodes/bug-reference.el" (19277 34922))
+;;;;;;  "progmodes/bug-reference.el" (19279 5151))
 ;;; Generated autoloads from progmodes/bug-reference.el
 
 (put 'bug-reference-url-format 'safe-local-variable 'stringp)
@@ -2600,7 +2600,7 @@
 ;;;;;;  compile-defun byte-compile-file byte-recompile-directory
 ;;;;;;  byte-force-recompile byte-compile-enable-warning byte-compile-disable-warning
 ;;;;;;  byte-compile-warnings-safe-p) "bytecomp" "emacs-lisp/bytecomp.el"
-;;;;;;  (19277 34919))
+;;;;;;  (19279 5149))
 ;;; Generated autoloads from emacs-lisp/bytecomp.el
 (put 'byte-compile-dynamic 'safe-local-variable 'booleanp)
 (put 'byte-compile-disable-print-circle 'safe-local-variable 'booleanp)
@@ -2724,8 +2724,8 @@
 
 ;;;***
 
-;;;### (autoloads nil "cal-china" "calendar/cal-china.el" (19277
-;;;;;;  34917))
+;;;### (autoloads nil "cal-china" "calendar/cal-china.el" (19279
+;;;;;;  5149))
 ;;; Generated autoloads from calendar/cal-china.el
 
 (put 'calendar-chinese-time-zone 'risky-local-variable t)
@@ -2734,7 +2734,7 @@
 
 ;;;***
 
-;;;### (autoloads nil "cal-dst" "calendar/cal-dst.el" (19277 34917))
+;;;### (autoloads nil "cal-dst" "calendar/cal-dst.el" (19279 5149))
 ;;; Generated autoloads from calendar/cal-dst.el
 
 (put 'calendar-daylight-savings-starts 'risky-local-variable t)
@@ -2746,7 +2746,7 @@
 ;;;***
 
 ;;;### (autoloads (calendar-hebrew-list-yahrzeits) "cal-hebrew" "calendar/cal-hebrew.el"
-;;;;;;  (19340 9803))
+;;;;;;  (19345 41626))
 ;;; Generated autoloads from calendar/cal-hebrew.el
 
 (autoload 'calendar-hebrew-list-yahrzeits "cal-hebrew" "\
@@ -2762,8 +2762,8 @@
 
 ;;;### (autoloads (defmath calc-embedded-activate calc-embedded calc-grab-rectangle
 ;;;;;;  calc-grab-region full-calc-keypad calc-keypad calc-eval quick-calc
-;;;;;;  full-calc calc calc-dispatch) "calc" "calc/calc.el" (19286
-;;;;;;  4503))
+;;;;;;  full-calc calc calc-dispatch) "calc" "calc/calc.el" (19282
+;;;;;;  55646))
 ;;; Generated autoloads from calc/calc.el
  (define-key ctl-x-map "*" 'calc-dispatch)
 
@@ -2845,8 +2845,8 @@
 
 ;;;***
 
-;;;### (autoloads (calculator) "calculator" "calculator.el" (19354
-;;;;;;  34807))
+;;;### (autoloads (calculator) "calculator" "calculator.el" (19356
+;;;;;;  10801))
 ;;; Generated autoloads from calculator.el
 
 (autoload 'calculator "calculator" "\
@@ -2857,8 +2857,8 @@
 
 ;;;***
 
-;;;### (autoloads (calendar) "calendar" "calendar/calendar.el" (19277
-;;;;;;  34918))
+;;;### (autoloads (calendar) "calendar" "calendar/calendar.el" (19279
+;;;;;;  5149))
 ;;; Generated autoloads from calendar/calendar.el
 
 (autoload 'calendar "calendar" "\
@@ -2902,7 +2902,7 @@
 ;;;***
 
 ;;;### (autoloads (canlock-verify canlock-insert-header) "canlock"
-;;;;;;  "gnus/canlock.el" (19277 34919))
+;;;;;;  "gnus/canlock.el" (19279 5150))
 ;;; Generated autoloads from gnus/canlock.el
 
 (autoload 'canlock-insert-header "canlock" "\
@@ -2920,7 +2920,7 @@
 ;;;***
 
 ;;;### (autoloads (capitalized-words-mode) "cap-words" "progmodes/cap-words.el"
-;;;;;;  (19277 34922))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from progmodes/cap-words.el
 
 (autoload 'capitalized-words-mode "cap-words" "\
@@ -2955,15 +2955,15 @@
 
 ;;;***
 
-;;;### (autoloads nil "cc-compat" "progmodes/cc-compat.el" (19277
-;;;;;;  34922))
+;;;### (autoloads nil "cc-compat" "progmodes/cc-compat.el" (19279
+;;;;;;  5151))
 ;;; Generated autoloads from progmodes/cc-compat.el
 (put 'c-indent-level 'safe-local-variable 'integerp)
 
 ;;;***
 
 ;;;### (autoloads (c-guess-basic-syntax) "cc-engine" "progmodes/cc-engine.el"
-;;;;;;  (19340 34420))
+;;;;;;  (19370 36541))
 ;;; Generated autoloads from progmodes/cc-engine.el
 
 (autoload 'c-guess-basic-syntax "cc-engine" "\
@@ -2975,7 +2975,7 @@
 
 ;;;### (autoloads (pike-mode idl-mode java-mode objc-mode c++-mode
 ;;;;;;  c-mode c-initialize-cc-mode) "cc-mode" "progmodes/cc-mode.el"
-;;;;;;  (19335 21247))
+;;;;;;  (19338 9841))
 ;;; Generated autoloads from progmodes/cc-mode.el
 
 (autoload 'c-initialize-cc-mode "cc-mode" "\
@@ -3135,7 +3135,7 @@
 ;;;***
 
 ;;;### (autoloads (c-set-offset c-add-style c-set-style) "cc-styles"
-;;;;;;  "progmodes/cc-styles.el" (19277 34922))
+;;;;;;  "progmodes/cc-styles.el" (19279 5151))
 ;;; Generated autoloads from progmodes/cc-styles.el
 
 (autoload 'c-set-style "cc-styles" "\
@@ -3186,7 +3186,7 @@
 
 ;;;***
 
-;;;### (autoloads nil "cc-vars" "progmodes/cc-vars.el" (19277 34922))
+;;;### (autoloads nil "cc-vars" "progmodes/cc-vars.el" (19279 5151))
 ;;; Generated autoloads from progmodes/cc-vars.el
 (put 'c-basic-offset 'safe-local-variable 'integerp)
 (put 'c-backslash-column 'safe-local-variable 'integerp)
@@ -3196,7 +3196,7 @@
 
 ;;;### (autoloads (ccl-execute-with-args check-ccl-program define-ccl-program
 ;;;;;;  declare-ccl-program ccl-dump ccl-compile) "ccl" "international/ccl.el"
-;;;;;;  (19277 34920))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from international/ccl.el
 
 (autoload 'ccl-compile "ccl" "\
@@ -3455,7 +3455,7 @@
 ;;;***
 
 ;;;### (autoloads (cfengine-mode) "cfengine" "progmodes/cfengine.el"
-;;;;;;  (19277 34922))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from progmodes/cfengine.el
 
 (autoload 'cfengine-mode "cfengine" "\
@@ -3470,7 +3470,7 @@
 ;;;***
 
 ;;;### (autoloads (check-declare-directory check-declare-file) "check-declare"
-;;;;;;  "emacs-lisp/check-declare.el" (19277 34919))
+;;;;;;  "emacs-lisp/check-declare.el" (19279 5149))
 ;;; Generated autoloads from emacs-lisp/check-declare.el
 
 (autoload 'check-declare-file "check-declare" "\
@@ -3495,7 +3495,7 @@
 ;;;;;;  checkdoc-comments checkdoc-continue checkdoc-start checkdoc-current-buffer
 ;;;;;;  checkdoc-eval-current-buffer checkdoc-message-interactive
 ;;;;;;  checkdoc-interactive checkdoc checkdoc-list-of-strings-p)
-;;;;;;  "checkdoc" "emacs-lisp/checkdoc.el" (19277 34919))
+;;;;;;  "checkdoc" "emacs-lisp/checkdoc.el" (19279 5149))
 ;;; Generated autoloads from emacs-lisp/checkdoc.el
 (put 'checkdoc-force-docstrings-flag 'safe-local-variable 'booleanp)
 (put 'checkdoc-force-history-flag 'safe-local-variable 'booleanp)
@@ -3690,7 +3690,7 @@
 
 ;;;### (autoloads (pre-write-encode-hz post-read-decode-hz encode-hz-buffer
 ;;;;;;  encode-hz-region decode-hz-buffer decode-hz-region) "china-util"
-;;;;;;  "language/china-util.el" (19277 34920))
+;;;;;;  "language/china-util.el" (19279 5150))
 ;;; Generated autoloads from language/china-util.el
 
 (autoload 'decode-hz-region "china-util" "\
@@ -3728,7 +3728,7 @@
 ;;;***
 
 ;;;### (autoloads (command-history list-command-history repeat-matching-complex-command)
-;;;;;;  "chistory" "chistory.el" (19277 34915))
+;;;;;;  "chistory" "chistory.el" (19279 5148))
 ;;; Generated autoloads from chistory.el
 
 (autoload 'repeat-matching-complex-command "chistory" "\
@@ -3767,7 +3767,7 @@
 
 ;;;***
 
-;;;### (autoloads nil "cl" "emacs-lisp/cl.el" (19277 34919))
+;;;### (autoloads nil "cl" "emacs-lisp/cl.el" (19279 5149))
 ;;; Generated autoloads from emacs-lisp/cl.el
 
 (defvar custom-print-functions nil "\
@@ -3783,7 +3783,7 @@
 ;;;***
 
 ;;;### (autoloads (common-lisp-indent-function) "cl-indent" "emacs-lisp/cl-indent.el"
-;;;;;;  (19277 34919))
+;;;;;;  (19279 5149))
 ;;; Generated autoloads from emacs-lisp/cl-indent.el
 
 (autoload 'common-lisp-indent-function "cl-indent" "\
@@ -3862,7 +3862,7 @@
 ;;;***
 
 ;;;### (autoloads (c-macro-expand) "cmacexp" "progmodes/cmacexp.el"
-;;;;;;  (19277 34922))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from progmodes/cmacexp.el
 
 (autoload 'c-macro-expand "cmacexp" "\
@@ -3882,8 +3882,8 @@
 
 ;;;***
 
-;;;### (autoloads (run-scheme) "cmuscheme" "cmuscheme.el" (19277
-;;;;;;  34915))
+;;;### (autoloads (run-scheme) "cmuscheme" "cmuscheme.el" (19279
+;;;;;;  5148))
 ;;; Generated autoloads from cmuscheme.el
 
 (autoload 'run-scheme "cmuscheme" "\
@@ -3907,7 +3907,7 @@
 ;;;### (autoloads (comint-redirect-results-list-from-process comint-redirect-results-list
 ;;;;;;  comint-redirect-send-command-to-process comint-redirect-send-command
 ;;;;;;  comint-run make-comint make-comint-in-buffer) "comint" "comint.el"
-;;;;;;  (19277 34915))
+;;;;;;  (19279 5148))
 ;;; Generated autoloads from comint.el
 
 (defvar comint-output-filter-functions '(comint-postoutput-scroll-to-bottom comint-watch-for-password-prompt) "\
@@ -3999,8 +3999,8 @@
 
 ;;;***
 
-;;;### (autoloads (compare-windows) "compare-w" "compare-w.el" (19277
-;;;;;;  34915))
+;;;### (autoloads (compare-windows) "compare-w" "compare-w.el" (19279
+;;;;;;  5148))
 ;;; Generated autoloads from compare-w.el
 
 (autoload 'compare-windows "compare-w" "\
@@ -4037,8 +4037,8 @@
 ;;;;;;  compilation-shell-minor-mode compilation-mode compilation-start
 ;;;;;;  compile compilation-disable-input compile-command compilation-search-path
 ;;;;;;  compilation-ask-about-save compilation-window-height compilation-start-hook
-;;;;;;  compilation-mode-hook) "compile" "progmodes/compile.el" (19328
-;;;;;;  18581))
+;;;;;;  compilation-mode-hook) "compile" "progmodes/compile.el" (19375
+;;;;;;  49830))
 ;;; Generated autoloads from progmodes/compile.el
 
 (defvar compilation-mode-hook nil "\
@@ -4216,7 +4216,7 @@
 ;;;***
 
 ;;;### (autoloads (partial-completion-mode) "complete" "complete.el"
-;;;;;;  (19360 14173))
+;;;;;;  (19358 54001))
 ;;; Generated autoloads from complete.el
 
 (defvar partial-completion-mode nil "\
@@ -4258,7 +4258,7 @@
 ;;;***
 
 ;;;### (autoloads (dynamic-completion-mode) "completion" "completion.el"
-;;;;;;  (19277 34915))
+;;;;;;  (19279 5148))
 ;;; Generated autoloads from completion.el
 
 (defvar dynamic-completion-mode nil "\
@@ -4280,7 +4280,7 @@
 ;;;### (autoloads (conf-xdefaults-mode conf-ppd-mode conf-colon-mode
 ;;;;;;  conf-space-keywords conf-space-mode conf-javaprop-mode conf-windows-mode
 ;;;;;;  conf-unix-mode conf-mode) "conf-mode" "textmodes/conf-mode.el"
-;;;;;;  (19277 34923))
+;;;;;;  (19279 5152))
 ;;; Generated autoloads from textmodes/conf-mode.el
 
 (autoload 'conf-mode "conf-mode" "\
@@ -4436,7 +4436,7 @@
 ;;;***
 
 ;;;### (autoloads (shuffle-vector cookie-snarf cookie-insert cookie)
-;;;;;;  "cookie1" "play/cookie1.el" (19277 34922))
+;;;;;;  "cookie1" "play/cookie1.el" (19279 5151))
 ;;; Generated autoloads from play/cookie1.el
 
 (autoload 'cookie "cookie1" "\
@@ -4468,8 +4468,8 @@
 ;;;***
 
 ;;;### (autoloads (copyright-update-directory copyright copyright-fix-years
-;;;;;;  copyright-update) "copyright" "emacs-lisp/copyright.el" (19277
-;;;;;;  34919))
+;;;;;;  copyright-update) "copyright" "emacs-lisp/copyright.el" (19279
+;;;;;;  5149))
 ;;; Generated autoloads from emacs-lisp/copyright.el
 
 (autoload 'copyright-update "copyright" "\
@@ -4502,7 +4502,7 @@
 ;;;***
 
 ;;;### (autoloads (cperl-perldoc-at-point cperl-perldoc cperl-mode)
-;;;;;;  "cperl-mode" "progmodes/cperl-mode.el" (19277 34922))
+;;;;;;  "cperl-mode" "progmodes/cperl-mode.el" (19279 5151))
 ;;; Generated autoloads from progmodes/cperl-mode.el
 (put 'cperl-indent-level 'safe-local-variable 'integerp)
 (put 'cperl-brace-offset 'safe-local-variable 'integerp)
@@ -4701,7 +4701,7 @@
 ;;;***
 
 ;;;### (autoloads (cpp-parse-edit cpp-highlight-buffer) "cpp" "progmodes/cpp.el"
-;;;;;;  (19277 34922))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from progmodes/cpp.el
 
 (autoload 'cpp-highlight-buffer "cpp" "\
@@ -4720,7 +4720,7 @@
 ;;;***
 
 ;;;### (autoloads (crisp-mode crisp-mode) "crisp" "emulation/crisp.el"
-;;;;;;  (19277 34919))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from emulation/crisp.el
 
 (defvar crisp-mode nil "\
@@ -4744,7 +4744,7 @@
 ;;;***
 
 ;;;### (autoloads (completing-read-multiple) "crm" "emacs-lisp/crm.el"
-;;;;;;  (19277 34919))
+;;;;;;  (19279 5149))
 ;;; Generated autoloads from emacs-lisp/crm.el
 
 (autoload 'completing-read-multiple "crm" "\
@@ -4779,8 +4779,8 @@
 
 ;;;***
 
-;;;### (autoloads (css-mode) "css-mode" "textmodes/css-mode.el" (19277
-;;;;;;  34923))
+;;;### (autoloads (css-mode) "css-mode" "textmodes/css-mode.el" (19279
+;;;;;;  5152))
 ;;; Generated autoloads from textmodes/css-mode.el
  (add-to-list 'auto-mode-alist (cons (purecopy "\\.css\\'") 'css-mode))
 
@@ -4792,7 +4792,7 @@
 ;;;***
 
 ;;;### (autoloads (cua-selection-mode cua-mode) "cua-base" "emulation/cua-base.el"
-;;;;;;  (19277 34919))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from emulation/cua-base.el
 
 (defvar cua-mode nil "\
@@ -4851,7 +4851,7 @@
 ;;;;;;  customize-mode customize customize-save-variable customize-set-variable
 ;;;;;;  customize-set-value custom-menu-sort-alphabetically custom-buffer-sort-alphabetically
 ;;;;;;  custom-browse-sort-alphabetically) "cus-edit" "cus-edit.el"
-;;;;;;  (19360 14173))
+;;;;;;  (19356 10801))
 ;;; Generated autoloads from cus-edit.el
 
 (defvar custom-browse-sort-alphabetically nil "\
@@ -5154,7 +5154,7 @@
 ;;;***
 
 ;;;### (autoloads (customize-create-theme) "cus-theme" "cus-theme.el"
-;;;;;;  (19277 34915))
+;;;;;;  (19279 5148))
 ;;; Generated autoloads from cus-theme.el
 
 (autoload 'customize-create-theme "cus-theme" "\
@@ -5165,7 +5165,7 @@
 ;;;***
 
 ;;;### (autoloads (cvs-status-mode) "cvs-status" "cvs-status.el"
-;;;;;;  (19277 34915))
+;;;;;;  (19279 5148))
 ;;; Generated autoloads from cvs-status.el
 
 (autoload 'cvs-status-mode "cvs-status" "\
@@ -5176,7 +5176,7 @@
 ;;;***
 
 ;;;### (autoloads (global-cwarn-mode turn-on-cwarn-mode cwarn-mode)
-;;;;;;  "cwarn" "progmodes/cwarn.el" (19277 34922))
+;;;;;;  "cwarn" "progmodes/cwarn.el" (19279 5151))
 ;;; Generated autoloads from progmodes/cwarn.el
 
 (autoload 'cwarn-mode "cwarn" "\
@@ -5223,7 +5223,7 @@
 
 ;;;### (autoloads (standard-display-cyrillic-translit cyrillic-encode-alternativnyj-char
 ;;;;;;  cyrillic-encode-koi8-r-char) "cyril-util" "language/cyril-util.el"
-;;;;;;  (19277 34920))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from language/cyril-util.el
 
 (autoload 'cyrillic-encode-koi8-r-char "cyril-util" "\
@@ -5252,7 +5252,7 @@
 ;;;***
 
 ;;;### (autoloads (dabbrev-expand dabbrev-completion) "dabbrev" "dabbrev.el"
-;;;;;;  (19277 34915))
+;;;;;;  (19279 5148))
 ;;; Generated autoloads from dabbrev.el
 (put 'dabbrev-case-fold-search 'risky-local-variable t)
 (put 'dabbrev-case-replace 'risky-local-variable t)
@@ -5299,7 +5299,7 @@
 ;;;***
 
 ;;;### (autoloads (data-debug-new-buffer) "data-debug" "cedet/data-debug.el"
-;;;;;;  (19324 55755))
+;;;;;;  (19323 49698))
 ;;; Generated autoloads from cedet/data-debug.el
 
 (autoload 'data-debug-new-buffer "data-debug" "\
@@ -5309,8 +5309,8 @@
 
 ;;;***
 
-;;;### (autoloads (dbus-handle-event) "dbus" "net/dbus.el" (19339
-;;;;;;  10551))
+;;;### (autoloads (dbus-handle-event) "dbus" "net/dbus.el" (19345
+;;;;;;  41626))
 ;;; Generated autoloads from net/dbus.el
 
 (autoload 'dbus-handle-event "dbus" "\
@@ -5323,8 +5323,8 @@
 
 ;;;***
 
-;;;### (autoloads (dcl-mode) "dcl-mode" "progmodes/dcl-mode.el" (19277
-;;;;;;  34922))
+;;;### (autoloads (dcl-mode) "dcl-mode" "progmodes/dcl-mode.el" (19279
+;;;;;;  5151))
 ;;; Generated autoloads from progmodes/dcl-mode.el
 
 (autoload 'dcl-mode "dcl-mode" "\
@@ -5451,7 +5451,7 @@
 ;;;***
 
 ;;;### (autoloads (cancel-debug-on-entry debug-on-entry debug) "debug"
-;;;;;;  "emacs-lisp/debug.el" (19277 34919))
+;;;;;;  "emacs-lisp/debug.el" (19279 5149))
 ;;; Generated autoloads from emacs-lisp/debug.el
 
 (setq debugger 'debug)
@@ -5495,7 +5495,7 @@
 ;;;***
 
 ;;;### (autoloads (decipher-mode decipher) "decipher" "play/decipher.el"
-;;;;;;  (19277 34922))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from play/decipher.el
 
 (autoload 'decipher "decipher" "\
@@ -5524,8 +5524,8 @@
 ;;;***
 
 ;;;### (autoloads (delimit-columns-rectangle delimit-columns-region
-;;;;;;  delimit-columns-customize) "delim-col" "delim-col.el" (19324
-;;;;;;  55755))
+;;;;;;  delimit-columns-customize) "delim-col" "delim-col.el" (19323
+;;;;;;  49698))
 ;;; Generated autoloads from delim-col.el
 
 (autoload 'delimit-columns-customize "delim-col" "\
@@ -5550,7 +5550,7 @@
 ;;;***
 
 ;;;### (autoloads (delphi-mode) "delphi" "progmodes/delphi.el" (19279
-;;;;;;  53114))
+;;;;;;  38446))
 ;;; Generated autoloads from progmodes/delphi.el
 
 (autoload 'delphi-mode "delphi" "\
@@ -5601,8 +5601,8 @@
 
 ;;;***
 
-;;;### (autoloads (delete-selection-mode) "delsel" "delsel.el" (19277
-;;;;;;  34915))
+;;;### (autoloads (delete-selection-mode) "delsel" "delsel.el" (19279
+;;;;;;  5148))
 ;;; Generated autoloads from delsel.el
 
 (defalias 'pending-delete-mode 'delete-selection-mode)
@@ -5631,7 +5631,7 @@
 ;;;***
 
 ;;;### (autoloads (derived-mode-init-mode-variables define-derived-mode)
-;;;;;;  "derived" "emacs-lisp/derived.el" (19277 34919))
+;;;;;;  "derived" "emacs-lisp/derived.el" (19279 5149))
 ;;; Generated autoloads from emacs-lisp/derived.el
 
 (autoload 'define-derived-mode "derived" "\
@@ -5696,7 +5696,7 @@
 ;;;***
 
 ;;;### (autoloads (describe-char describe-text-properties) "descr-text"
-;;;;;;  "descr-text.el" (19277 34915))
+;;;;;;  "descr-text.el" (19279 5148))
 ;;; Generated autoloads from descr-text.el
 
 (autoload 'describe-text-properties "descr-text" "\
@@ -5724,7 +5724,7 @@
 ;;;### (autoloads (desktop-revert desktop-save-in-desktop-dir desktop-change-dir
 ;;;;;;  desktop-load-default desktop-read desktop-remove desktop-save
 ;;;;;;  desktop-clear desktop-locals-to-save desktop-save-mode) "desktop"
-;;;;;;  "desktop.el" (19277 34915))
+;;;;;;  "desktop.el" (19372 27330))
 ;;; Generated autoloads from desktop.el
 
 (defvar desktop-save-mode nil "\
@@ -5908,7 +5908,7 @@
 
 ;;;### (autoloads (gnus-article-outlook-deuglify-article gnus-outlook-deuglify-article
 ;;;;;;  gnus-article-outlook-repair-attribution gnus-article-outlook-unwrap-lines)
-;;;;;;  "deuglify" "gnus/deuglify.el" (19277 34919))
+;;;;;;  "deuglify" "gnus/deuglify.el" (19279 5150))
 ;;; Generated autoloads from gnus/deuglify.el
 
 (autoload 'gnus-article-outlook-unwrap-lines "deuglify" "\
@@ -5941,7 +5941,7 @@
 ;;;***
 
 ;;;### (autoloads (diary-mode diary-mail-entries diary) "diary-lib"
-;;;;;;  "calendar/diary-lib.el" (19295 48708))
+;;;;;;  "calendar/diary-lib.el" (19299 25154))
 ;;; Generated autoloads from calendar/diary-lib.el
 
 (autoload 'diary "diary-lib" "\
@@ -5984,7 +5984,7 @@
 ;;;***
 
 ;;;### (autoloads (diff-backup diff diff-command diff-switches) "diff"
-;;;;;;  "diff.el" (19277 34915))
+;;;;;;  "diff.el" (19279 5148))
 ;;; Generated autoloads from diff.el
 
 (defvar diff-switches (purecopy "-c") "\
@@ -6022,7 +6022,7 @@
 ;;;***
 
 ;;;### (autoloads (diff-minor-mode diff-mode) "diff-mode" "diff-mode.el"
-;;;;;;  (19354 34807))
+;;;;;;  (19356 10801))
 ;;; Generated autoloads from diff-mode.el
 
 (autoload 'diff-mode "diff-mode" "\
@@ -6050,7 +6050,7 @@
 
 ;;;***
 
-;;;### (autoloads (dig) "dig" "net/dig.el" (19277 34921))
+;;;### (autoloads (dig) "dig" "net/dig.el" (19279 5151))
 ;;; Generated autoloads from net/dig.el
 
 (autoload 'dig "dig" "\
@@ -6063,7 +6063,7 @@
 
 ;;;### (autoloads (dired-mode dired-auto-revert-buffer dired-noselect
 ;;;;;;  dired-other-frame dired-other-window dired dired-trivial-filenames
-;;;;;;  dired-listing-switches) "dired" "dired.el" (19307 9881))
+;;;;;;  dired-listing-switches) "dired" "dired.el" (19313 15414))
 ;;; Generated autoloads from dired.el
 
 (defvar dired-listing-switches (purecopy "-al") "\
@@ -6208,7 +6208,7 @@
 ;;;***
 
 ;;;### (autoloads (dirtrack dirtrack-mode) "dirtrack" "dirtrack.el"
-;;;;;;  (19299 41380))
+;;;;;;  (19299 25154))
 ;;; Generated autoloads from dirtrack.el
 
 (autoload 'dirtrack-mode "dirtrack" "\
@@ -6234,8 +6234,8 @@
 
 ;;;***
 
-;;;### (autoloads (disassemble) "disass" "emacs-lisp/disass.el" (19277
-;;;;;;  34919))
+;;;### (autoloads (disassemble) "disass" "emacs-lisp/disass.el" (19279
+;;;;;;  5149))
 ;;; Generated autoloads from emacs-lisp/disass.el
 
 (autoload 'disassemble "disass" "\
@@ -6254,7 +6254,7 @@
 ;;;;;;  standard-display-g1 standard-display-ascii standard-display-default
 ;;;;;;  standard-display-8bit describe-current-display-table describe-display-table
 ;;;;;;  set-display-table-slot display-table-slot make-display-table)
-;;;;;;  "disp-table" "disp-table.el" (19277 34916))
+;;;;;;  "disp-table" "disp-table.el" (19279 5148))
 ;;; Generated autoloads from disp-table.el
 
 (autoload 'make-display-table "disp-table" "\
@@ -6366,7 +6366,7 @@
 ;;;***
 
 ;;;### (autoloads (dissociated-press) "dissociate" "play/dissociate.el"
-;;;;;;  (19277 34922))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from play/dissociate.el
 
 (autoload 'dissociated-press "dissociate" "\
@@ -6382,7 +6382,7 @@
 
 ;;;***
 
-;;;### (autoloads (dnd-protocol-alist) "dnd" "dnd.el" (19277 34916))
+;;;### (autoloads (dnd-protocol-alist) "dnd" "dnd.el" (19279 5148))
 ;;; Generated autoloads from dnd.el
 
 (defvar dnd-protocol-alist `((,(purecopy "^file:///") . dnd-open-local-file) (,(purecopy "^file://") . dnd-open-file) (,(purecopy "^file:") . dnd-open-local-file) (,(purecopy "^\\(https?\\|ftp\\|file\\|nfs\\)://") . dnd-open-file)) "\
@@ -6403,7 +6403,7 @@
 ;;;***
 
 ;;;### (autoloads (dns-mode-soa-increment-serial dns-mode) "dns-mode"
-;;;;;;  "textmodes/dns-mode.el" (19277 34923))
+;;;;;;  "textmodes/dns-mode.el" (19279 5152))
 ;;; Generated autoloads from textmodes/dns-mode.el
 
 (autoload 'dns-mode "dns-mode" "\
@@ -6428,7 +6428,7 @@
 ;;;***
 
 ;;;### (autoloads (doc-view-bookmark-jump doc-view-minor-mode doc-view-mode
-;;;;;;  doc-view-mode-p) "doc-view" "doc-view.el" (19324 55755))
+;;;;;;  doc-view-mode-p) "doc-view" "doc-view.el" (19323 49698))
 ;;; Generated autoloads from doc-view.el
 
 (autoload 'doc-view-mode-p "doc-view" "\
@@ -6463,7 +6463,7 @@
 
 ;;;***
 
-;;;### (autoloads (doctor) "doctor" "play/doctor.el" (19277 34922))
+;;;### (autoloads (doctor) "doctor" "play/doctor.el" (19279 5151))
 ;;; Generated autoloads from play/doctor.el
 
 (autoload 'doctor "doctor" "\
@@ -6473,7 +6473,7 @@
 
 ;;;***
 
-;;;### (autoloads (double-mode) "double" "double.el" (19277 34916))
+;;;### (autoloads (double-mode) "double" "double.el" (19279 5148))
 ;;; Generated autoloads from double.el
 
 (autoload 'double-mode "double" "\
@@ -6488,7 +6488,7 @@
 
 ;;;***
 
-;;;### (autoloads (dunnet) "dunnet" "play/dunnet.el" (19277 34922))
+;;;### (autoloads (dunnet) "dunnet" "play/dunnet.el" (19279 5151))
 ;;; Generated autoloads from play/dunnet.el
 
 (autoload 'dunnet "dunnet" "\
@@ -6499,7 +6499,7 @@
 ;;;***
 
 ;;;### (autoloads (gnus-earcon-display) "earcon" "gnus/earcon.el"
-;;;;;;  (19277 34919))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from gnus/earcon.el
 
 (autoload 'gnus-earcon-display "earcon" "\
@@ -6511,7 +6511,7 @@
 
 ;;;### (autoloads (easy-mmode-defsyntax easy-mmode-defmap easy-mmode-define-keymap
 ;;;;;;  define-globalized-minor-mode define-minor-mode) "easy-mmode"
-;;;;;;  "emacs-lisp/easy-mmode.el" (19277 34919))
+;;;;;;  "emacs-lisp/easy-mmode.el" (19279 5149))
 ;;; Generated autoloads from emacs-lisp/easy-mmode.el
 
 (defalias 'easy-mmode-define-minor-mode 'define-minor-mode)
@@ -6616,8 +6616,8 @@
 ;;;***
 
 ;;;### (autoloads (easy-menu-change easy-menu-create-menu easy-menu-do-define
-;;;;;;  easy-menu-define) "easymenu" "emacs-lisp/easymenu.el" (19277
-;;;;;;  34919))
+;;;;;;  easy-menu-define) "easymenu" "emacs-lisp/easymenu.el" (19279
+;;;;;;  5149))
 ;;; Generated autoloads from emacs-lisp/easymenu.el
 
 (put 'easy-menu-define 'lisp-indent-function 'defun)
@@ -6771,7 +6771,7 @@
 ;;;;;;  ebnf-eps-file ebnf-eps-directory ebnf-spool-region ebnf-spool-buffer
 ;;;;;;  ebnf-spool-file ebnf-spool-directory ebnf-print-region ebnf-print-buffer
 ;;;;;;  ebnf-print-file ebnf-print-directory ebnf-customize) "ebnf2ps"
-;;;;;;  "progmodes/ebnf2ps.el" (19277 34922))
+;;;;;;  "progmodes/ebnf2ps.el" (19279 5151))
 ;;; Generated autoloads from progmodes/ebnf2ps.el
 
 (autoload 'ebnf-customize "ebnf2ps" "\
@@ -7045,8 +7045,8 @@
 ;;;;;;  ebrowse-tags-find-declaration-other-window ebrowse-tags-find-definition
 ;;;;;;  ebrowse-tags-view-definition ebrowse-tags-find-declaration
 ;;;;;;  ebrowse-tags-view-declaration ebrowse-member-mode ebrowse-electric-choose-tree
-;;;;;;  ebrowse-tree-mode) "ebrowse" "progmodes/ebrowse.el" (19277
-;;;;;;  34922))
+;;;;;;  ebrowse-tree-mode) "ebrowse" "progmodes/ebrowse.el" (19279
+;;;;;;  5151))
 ;;; Generated autoloads from progmodes/ebrowse.el
 
 (autoload 'ebrowse-tree-mode "ebrowse" "\
@@ -7197,7 +7197,7 @@
 ;;;***
 
 ;;;### (autoloads (electric-buffer-list) "ebuff-menu" "ebuff-menu.el"
-;;;;;;  (19277 34916))
+;;;;;;  (19279 5148))
 ;;; Generated autoloads from ebuff-menu.el
 
 (autoload 'electric-buffer-list "ebuff-menu" "\
@@ -7222,7 +7222,7 @@
 ;;;***
 
 ;;;### (autoloads (Electric-command-history-redo-expression) "echistory"
-;;;;;;  "echistory.el" (19277 34916))
+;;;;;;  "echistory.el" (19279 5148))
 ;;; Generated autoloads from echistory.el
 
 (autoload 'Electric-command-history-redo-expression "echistory" "\
@@ -7234,7 +7234,7 @@
 ;;;***
 
 ;;;### (autoloads (ecomplete-setup) "ecomplete" "gnus/ecomplete.el"
-;;;;;;  (19277 34919))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from gnus/ecomplete.el
 
 (autoload 'ecomplete-setup "ecomplete" "\
@@ -7244,7 +7244,7 @@
 
 ;;;***
 
-;;;### (autoloads (global-ede-mode) "ede" "cedet/ede.el" (19324 55755))
+;;;### (autoloads (global-ede-mode) "ede" "cedet/ede.el" (19323 49698))
 ;;; Generated autoloads from cedet/ede.el
 
 (defvar global-ede-mode nil "\
@@ -7270,7 +7270,7 @@
 
 ;;;### (autoloads (edebug-all-forms edebug-all-defs edebug-eval-top-level-form
 ;;;;;;  edebug-basic-spec edebug-all-forms edebug-all-defs) "edebug"
-;;;;;;  "emacs-lisp/edebug.el" (19277 34919))
+;;;;;;  "emacs-lisp/edebug.el" (19279 5149))
 ;;; Generated autoloads from emacs-lisp/edebug.el
 
 (defvar edebug-all-defs nil "\
@@ -7343,7 +7343,7 @@
 ;;;;;;  ediff-merge-directories-with-ancestor ediff-merge-directories
 ;;;;;;  ediff-directories3 ediff-directory-revisions ediff-directories
 ;;;;;;  ediff-buffers3 ediff-buffers ediff-backup ediff-current-file
-;;;;;;  ediff-files3 ediff-files) "ediff" "ediff.el" (19277 34916))
+;;;;;;  ediff-files3 ediff-files) "ediff" "ediff.el" (19279 5148))
 ;;; Generated autoloads from ediff.el
 
 (autoload 'ediff-files "ediff" "\
@@ -7575,7 +7575,7 @@
 ;;;***
 
 ;;;### (autoloads (ediff-customize) "ediff-help" "ediff-help.el"
-;;;;;;  (19277 34916))
+;;;;;;  (19279 5148))
 ;;; Generated autoloads from ediff-help.el
 
 (autoload 'ediff-customize "ediff-help" "\
@@ -7586,7 +7586,7 @@
 ;;;***
 
 ;;;### (autoloads (ediff-show-registry) "ediff-mult" "ediff-mult.el"
-;;;;;;  (19277 34916))
+;;;;;;  (19279 5148))
 ;;; Generated autoloads from ediff-mult.el
 
 (autoload 'ediff-show-registry "ediff-mult" "\
@@ -7599,7 +7599,7 @@
 ;;;***
 
 ;;;### (autoloads (ediff-toggle-use-toolbar ediff-toggle-multiframe)
-;;;;;;  "ediff-util" "ediff-util.el" (19304 58663))
+;;;;;;  "ediff-util" "ediff-util.el" (19313 15414))
 ;;; Generated autoloads from ediff-util.el
 
 (autoload 'ediff-toggle-multiframe "ediff-util" "\
@@ -7620,7 +7620,7 @@
 
 ;;;### (autoloads (format-kbd-macro read-kbd-macro edit-named-kbd-macro
 ;;;;;;  edit-last-kbd-macro edit-kbd-macro) "edmacro" "edmacro.el"
-;;;;;;  (19277 34916))
+;;;;;;  (19279 5148))
 ;;; Generated autoloads from edmacro.el
 
 (defvar edmacro-eight-bits nil "\
@@ -7673,7 +7673,7 @@
 ;;;***
 
 ;;;### (autoloads (edt-emulation-on edt-set-scroll-margins) "edt"
-;;;;;;  "emulation/edt.el" (19280 45063))
+;;;;;;  "emulation/edt.el" (19281 39617))
 ;;; Generated autoloads from emulation/edt.el
 
 (autoload 'edt-set-scroll-margins "edt" "\
@@ -7691,7 +7691,7 @@
 ;;;***
 
 ;;;### (autoloads (electric-helpify with-electric-help) "ehelp" "ehelp.el"
-;;;;;;  (19277 34916))
+;;;;;;  (19279 5148))
 ;;; Generated autoloads from ehelp.el
 
 (autoload 'with-electric-help "ehelp" "\
@@ -7728,7 +7728,7 @@
 ;;;***
 
 ;;;### (autoloads (turn-on-eldoc-mode eldoc-mode eldoc-minor-mode-string)
-;;;;;;  "eldoc" "emacs-lisp/eldoc.el" (19277 34919))
+;;;;;;  "eldoc" "emacs-lisp/eldoc.el" (19279 5149))
 ;;; Generated autoloads from emacs-lisp/eldoc.el
 
 (defvar eldoc-minor-mode-string (purecopy " ElDoc") "\
@@ -7771,8 +7771,8 @@
 
 ;;;***
 
-;;;### (autoloads (elide-head) "elide-head" "elide-head.el" (19277
-;;;;;;  34916))
+;;;### (autoloads (elide-head) "elide-head" "elide-head.el" (19279
+;;;;;;  5148))
 ;;; Generated autoloads from elide-head.el
 
 (autoload 'elide-head "elide-head" "\
@@ -7789,7 +7789,7 @@
 
 ;;;### (autoloads (elint-initialize elint-defun elint-current-buffer
 ;;;;;;  elint-directory elint-file) "elint" "emacs-lisp/elint.el"
-;;;;;;  (19339 10551))
+;;;;;;  (19338 9840))
 ;;; Generated autoloads from emacs-lisp/elint.el
 
 (autoload 'elint-file "elint" "\
@@ -7825,8 +7825,8 @@
 ;;;***
 
 ;;;### (autoloads (elp-results elp-instrument-package elp-instrument-list
-;;;;;;  elp-instrument-function) "elp" "emacs-lisp/elp.el" (19277
-;;;;;;  34919))
+;;;;;;  elp-instrument-function) "elp" "emacs-lisp/elp.el" (19279
+;;;;;;  5149))
 ;;; Generated autoloads from emacs-lisp/elp.el
 
 (autoload 'elp-instrument-function "elp" "\
@@ -7861,7 +7861,7 @@
 ;;;***
 
 ;;;### (autoloads (report-emacs-bug) "emacsbug" "mail/emacsbug.el"
-;;;;;;  (19361 52486))
+;;;;;;  (19365 25156))
 ;;; Generated autoloads from mail/emacsbug.el
 
 (autoload 'report-emacs-bug "emacsbug" "\
@@ -7876,7 +7876,7 @@
 ;;;;;;  emerge-revisions emerge-files-with-ancestor-remote emerge-files-remote
 ;;;;;;  emerge-files-with-ancestor-command emerge-files-command emerge-buffers-with-ancestor
 ;;;;;;  emerge-buffers emerge-files-with-ancestor emerge-files) "emerge"
-;;;;;;  "emerge.el" (19267 61658))
+;;;;;;  "emerge.el" (19256 49601))
 ;;; Generated autoloads from emerge.el
 
 (autoload 'emerge-files "emerge" "\
@@ -7937,7 +7937,7 @@
 ;;;***
 
 ;;;### (autoloads (enriched-decode enriched-encode enriched-mode)
-;;;;;;  "enriched" "textmodes/enriched.el" (19277 34923))
+;;;;;;  "enriched" "textmodes/enriched.el" (19279 5152))
 ;;; Generated autoloads from textmodes/enriched.el
 
 (autoload 'enriched-mode "enriched" "\
@@ -7972,8 +7972,8 @@
 ;;;;;;  epa-sign-region epa-verify-cleartext-in-region epa-verify-region
 ;;;;;;  epa-decrypt-armor-in-region epa-decrypt-region epa-encrypt-file
 ;;;;;;  epa-sign-file epa-verify-file epa-decrypt-file epa-select-keys
-;;;;;;  epa-list-secret-keys epa-list-keys) "epa" "epa.el" (19277
-;;;;;;  34916))
+;;;;;;  epa-list-secret-keys epa-list-keys) "epa" "epa.el" (19279
+;;;;;;  5148))
 ;;; Generated autoloads from epa.el
 
 (autoload 'epa-list-keys "epa" "\
@@ -8146,7 +8146,7 @@
 ;;;***
 
 ;;;### (autoloads (epa-dired-do-encrypt epa-dired-do-sign epa-dired-do-verify
-;;;;;;  epa-dired-do-decrypt) "epa-dired" "epa-dired.el" (19277 34916))
+;;;;;;  epa-dired-do-decrypt) "epa-dired" "epa-dired.el" (19279 5148))
 ;;; Generated autoloads from epa-dired.el
 
 (autoload 'epa-dired-do-decrypt "epa-dired" "\
@@ -8172,7 +8172,7 @@
 ;;;***
 
 ;;;### (autoloads (epa-file-disable epa-file-enable epa-file-handler)
-;;;;;;  "epa-file" "epa-file.el" (19277 34916))
+;;;;;;  "epa-file" "epa-file.el" (19279 5148))
 ;;; Generated autoloads from epa-file.el
 
 (autoload 'epa-file-handler "epa-file" "\
@@ -8194,7 +8194,7 @@
 
 ;;;### (autoloads (epa-global-mail-mode epa-mail-import-keys epa-mail-encrypt
 ;;;;;;  epa-mail-sign epa-mail-verify epa-mail-decrypt epa-mail-mode)
-;;;;;;  "epa-mail" "epa-mail.el" (19277 34916))
+;;;;;;  "epa-mail" "epa-mail.el" (19279 5148))
 ;;; Generated autoloads from epa-mail.el
 
 (autoload 'epa-mail-mode "epa-mail" "\
@@ -8258,7 +8258,7 @@
 
 ;;;***
 
-;;;### (autoloads (epg-make-context) "epg" "epg.el" (19277 34916))
+;;;### (autoloads (epg-make-context) "epg" "epg.el" (19279 5148))
 ;;; Generated autoloads from epg.el
 
 (autoload 'epg-make-context "epg" "\
@@ -8269,7 +8269,7 @@
 ;;;***
 
 ;;;### (autoloads (epg-expand-group epg-check-configuration epg-configuration)
-;;;;;;  "epg-config" "epg-config.el" (19354 34807))
+;;;;;;  "epg-config" "epg-config.el" (19356 10801))
 ;;; Generated autoloads from epg-config.el
 
 (autoload 'epg-configuration "epg-config" "\
@@ -8290,7 +8290,7 @@
 ;;;***
 
 ;;;### (autoloads (erc-handle-irc-url erc erc-select-read-args) "erc"
-;;;;;;  "erc/erc.el" (19294 23005))
+;;;;;;  "erc/erc.el" (19299 25154))
 ;;; Generated autoloads from erc/erc.el
 
 (autoload 'erc-select-read-args "erc" "\
@@ -8332,33 +8332,33 @@
 
 ;;;***
 
-;;;### (autoloads nil "erc-autoaway" "erc/erc-autoaway.el" (19277
-;;;;;;  34919))
+;;;### (autoloads nil "erc-autoaway" "erc/erc-autoaway.el" (19279
+;;;;;;  5150))
 ;;; Generated autoloads from erc/erc-autoaway.el
  (autoload 'erc-autoaway-mode "erc-autoaway")
 
 ;;;***
 
-;;;### (autoloads nil "erc-button" "erc/erc-button.el" (19277 34919))
+;;;### (autoloads nil "erc-button" "erc/erc-button.el" (19279 5150))
 ;;; Generated autoloads from erc/erc-button.el
  (autoload 'erc-button-mode "erc-button" nil t)
 
 ;;;***
 
-;;;### (autoloads nil "erc-capab" "erc/erc-capab.el" (19277 34919))
+;;;### (autoloads nil "erc-capab" "erc/erc-capab.el" (19279 5150))
 ;;; Generated autoloads from erc/erc-capab.el
  (autoload 'erc-capab-identify-mode "erc-capab" nil t)
 
 ;;;***
 
-;;;### (autoloads nil "erc-compat" "erc/erc-compat.el" (19277 34919))
+;;;### (autoloads nil "erc-compat" "erc/erc-compat.el" (19279 5150))
 ;;; Generated autoloads from erc/erc-compat.el
  (autoload 'erc-define-minor-mode "erc-compat")
 
 ;;;***
 
 ;;;### (autoloads (erc-ctcp-query-DCC pcomplete/erc-mode/DCC erc-cmd-DCC)
-;;;;;;  "erc-dcc" "erc/erc-dcc.el" (19277 34919))
+;;;;;;  "erc-dcc" "erc/erc-dcc.el" (19279 5150))
 ;;; Generated autoloads from erc/erc-dcc.el
  (autoload 'erc-dcc-mode "erc-dcc")
 
@@ -8391,7 +8391,7 @@
 ;;;;;;  erc-ezb-add-session erc-ezb-end-of-session-list erc-ezb-init-session-list
 ;;;;;;  erc-ezb-identify erc-ezb-notice-autodetect erc-ezb-lookup-action
 ;;;;;;  erc-ezb-get-login erc-cmd-ezb) "erc-ezbounce" "erc/erc-ezbounce.el"
-;;;;;;  (19277 34919))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from erc/erc-ezbounce.el
 
 (autoload 'erc-cmd-ezb "erc-ezbounce" "\
@@ -8453,8 +8453,8 @@
 
 ;;;***
 
-;;;### (autoloads (erc-fill) "erc-fill" "erc/erc-fill.el" (19277
-;;;;;;  34919))
+;;;### (autoloads (erc-fill) "erc-fill" "erc/erc-fill.el" (19279
+;;;;;;  5150))
 ;;; Generated autoloads from erc/erc-fill.el
  (autoload 'erc-fill-mode "erc-fill" nil t)
 
@@ -8466,15 +8466,15 @@
 
 ;;;***
 
-;;;### (autoloads nil "erc-hecomplete" "erc/erc-hecomplete.el" (19277
-;;;;;;  34919))
+;;;### (autoloads nil "erc-hecomplete" "erc/erc-hecomplete.el" (19279
+;;;;;;  5150))
 ;;; Generated autoloads from erc/erc-hecomplete.el
  (autoload 'erc-hecomplete-mode "erc-hecomplete" nil t)
 
 ;;;***
 
 ;;;### (autoloads (erc-identd-stop erc-identd-start) "erc-identd"
-;;;;;;  "erc/erc-identd.el" (19277 34919))
+;;;;;;  "erc/erc-identd.el" (19279 5150))
 ;;; Generated autoloads from erc/erc-identd.el
  (autoload 'erc-identd-mode "erc-identd")
 
@@ -8496,7 +8496,7 @@
 ;;;***
 
 ;;;### (autoloads (erc-create-imenu-index) "erc-imenu" "erc/erc-imenu.el"
-;;;;;;  (19277 34919))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from erc/erc-imenu.el
 
 (autoload 'erc-create-imenu-index "erc-imenu" "\
@@ -8506,20 +8506,20 @@
 
 ;;;***
 
-;;;### (autoloads nil "erc-join" "erc/erc-join.el" (19277 34919))
+;;;### (autoloads nil "erc-join" "erc/erc-join.el" (19279 5150))
 ;;; Generated autoloads from erc/erc-join.el
  (autoload 'erc-autojoin-mode "erc-join" nil t)
 
 ;;;***
 
-;;;### (autoloads nil "erc-list" "erc/erc-list.el" (19277 34919))
+;;;### (autoloads nil "erc-list" "erc/erc-list.el" (19279 5150))
 ;;; Generated autoloads from erc/erc-list.el
  (autoload 'erc-list-mode "erc-list")
 
 ;;;***
 
 ;;;### (autoloads (erc-save-buffer-in-logs erc-logging-enabled) "erc-log"
-;;;;;;  "erc/erc-log.el" (19277 34919))
+;;;;;;  "erc/erc-log.el" (19279 5150))
 ;;; Generated autoloads from erc/erc-log.el
  (autoload 'erc-log-mode "erc-log" nil t)
 
@@ -8551,7 +8551,7 @@
 ;;;### (autoloads (erc-delete-dangerous-host erc-add-dangerous-host
 ;;;;;;  erc-delete-keyword erc-add-keyword erc-delete-fool erc-add-fool
 ;;;;;;  erc-delete-pal erc-add-pal) "erc-match" "erc/erc-match.el"
-;;;;;;  (19277 34919))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from erc/erc-match.el
  (autoload 'erc-match-mode "erc-match")
 
@@ -8597,14 +8597,14 @@
 
 ;;;***
 
-;;;### (autoloads nil "erc-menu" "erc/erc-menu.el" (19277 34919))
+;;;### (autoloads nil "erc-menu" "erc/erc-menu.el" (19279 5150))
 ;;; Generated autoloads from erc/erc-menu.el
  (autoload 'erc-menu-mode "erc-menu" nil t)
 
 ;;;***
 
 ;;;### (autoloads (erc-cmd-WHOLEFT) "erc-netsplit" "erc/erc-netsplit.el"
-;;;;;;  (19277 34919))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from erc/erc-netsplit.el
  (autoload 'erc-netsplit-mode "erc-netsplit")
 
@@ -8616,7 +8616,7 @@
 ;;;***
 
 ;;;### (autoloads (erc-server-select erc-determine-network) "erc-networks"
-;;;;;;  "erc/erc-networks.el" (19277 34919))
+;;;;;;  "erc/erc-networks.el" (19279 5150))
 ;;; Generated autoloads from erc/erc-networks.el
 
 (autoload 'erc-determine-network "erc-networks" "\
@@ -8634,7 +8634,7 @@
 ;;;***
 
 ;;;### (autoloads (pcomplete/erc-mode/NOTIFY erc-cmd-NOTIFY) "erc-notify"
-;;;;;;  "erc/erc-notify.el" (19277 34919))
+;;;;;;  "erc/erc-notify.el" (19279 5150))
 ;;; Generated autoloads from erc/erc-notify.el
  (autoload 'erc-notify-mode "erc-notify" nil t)
 
@@ -8652,33 +8652,33 @@
 
 ;;;***
 
-;;;### (autoloads nil "erc-page" "erc/erc-page.el" (19277 34919))
+;;;### (autoloads nil "erc-page" "erc/erc-page.el" (19279 5150))
 ;;; Generated autoloads from erc/erc-page.el
  (autoload 'erc-page-mode "erc-page")
 
 ;;;***
 
-;;;### (autoloads nil "erc-pcomplete" "erc/erc-pcomplete.el" (19277
-;;;;;;  34919))
+;;;### (autoloads nil "erc-pcomplete" "erc/erc-pcomplete.el" (19279
+;;;;;;  5150))
 ;;; Generated autoloads from erc/erc-pcomplete.el
  (autoload 'erc-completion-mode "erc-pcomplete" nil t)
 
 ;;;***
 
-;;;### (autoloads nil "erc-replace" "erc/erc-replace.el" (19277 34919))
+;;;### (autoloads nil "erc-replace" "erc/erc-replace.el" (19279 5150))
 ;;; Generated autoloads from erc/erc-replace.el
  (autoload 'erc-replace-mode "erc-replace")
 
 ;;;***
 
-;;;### (autoloads nil "erc-ring" "erc/erc-ring.el" (19277 34919))
+;;;### (autoloads nil "erc-ring" "erc/erc-ring.el" (19279 5150))
 ;;; Generated autoloads from erc/erc-ring.el
  (autoload 'erc-ring-mode "erc-ring" nil t)
 
 ;;;***
 
 ;;;### (autoloads (erc-nickserv-identify erc-nickserv-identify-mode)
-;;;;;;  "erc-services" "erc/erc-services.el" (19311 8632))
+;;;;;;  "erc-services" "erc/erc-services.el" (19313 15414))
 ;;; Generated autoloads from erc/erc-services.el
  (autoload 'erc-services-mode "erc-services" nil t)
 
@@ -8695,14 +8695,14 @@
 
 ;;;***
 
-;;;### (autoloads nil "erc-sound" "erc/erc-sound.el" (19277 34919))
+;;;### (autoloads nil "erc-sound" "erc/erc-sound.el" (19279 5150))
 ;;; Generated autoloads from erc/erc-sound.el
  (autoload 'erc-sound-mode "erc-sound")
 
 ;;;***
 
 ;;;### (autoloads (erc-speedbar-browser) "erc-speedbar" "erc/erc-speedbar.el"
-;;;;;;  (19277 34919))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from erc/erc-speedbar.el
 
 (autoload 'erc-speedbar-browser "erc-speedbar" "\
@@ -8713,21 +8713,21 @@
 
 ;;;***
 
-;;;### (autoloads nil "erc-spelling" "erc/erc-spelling.el" (19277
-;;;;;;  34919))
+;;;### (autoloads nil "erc-spelling" "erc/erc-spelling.el" (19279
+;;;;;;  5150))
 ;;; Generated autoloads from erc/erc-spelling.el
  (autoload 'erc-spelling-mode "erc-spelling" nil t)
 
 ;;;***
 
-;;;### (autoloads nil "erc-stamp" "erc/erc-stamp.el" (19277 34919))
+;;;### (autoloads nil "erc-stamp" "erc/erc-stamp.el" (19279 5150))
 ;;; Generated autoloads from erc/erc-stamp.el
  (autoload 'erc-timestamp-mode "erc-stamp" nil t)
 
 ;;;***
 
 ;;;### (autoloads (erc-track-minor-mode) "erc-track" "erc/erc-track.el"
-;;;;;;  (19277 34919))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from erc/erc-track.el
 
 (defvar erc-track-minor-mode nil "\
@@ -8750,7 +8750,7 @@
 ;;;***
 
 ;;;### (autoloads (erc-truncate-buffer erc-truncate-buffer-to-size)
-;;;;;;  "erc-truncate" "erc/erc-truncate.el" (19277 34919))
+;;;;;;  "erc-truncate" "erc/erc-truncate.el" (19279 5150))
 ;;; Generated autoloads from erc/erc-truncate.el
  (autoload 'erc-truncate-mode "erc-truncate" nil t)
 
@@ -8770,7 +8770,7 @@
 ;;;***
 
 ;;;### (autoloads (erc-xdcc-add-file) "erc-xdcc" "erc/erc-xdcc.el"
-;;;;;;  (19277 34919))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from erc/erc-xdcc.el
  (autoload 'erc-xdcc-mode "erc-xdcc")
 
@@ -8781,8 +8781,8 @@
 
 ;;;***
 
-;;;### (autoloads (eshell-mode) "esh-mode" "eshell/esh-mode.el" (19277
-;;;;;;  34919))
+;;;### (autoloads (eshell-mode) "esh-mode" "eshell/esh-mode.el" (19279
+;;;;;;  5150))
 ;;; Generated autoloads from eshell/esh-mode.el
 
 (autoload 'eshell-mode "esh-mode" "\
@@ -8794,8 +8794,8 @@
 
 ;;;***
 
-;;;### (autoloads (eshell-test) "esh-test" "eshell/esh-test.el" (19277
-;;;;;;  34919))
+;;;### (autoloads (eshell-test) "esh-test" "eshell/esh-test.el" (19279
+;;;;;;  5150))
 ;;; Generated autoloads from eshell/esh-test.el
 
 (autoload 'eshell-test "esh-test" "\
@@ -8806,7 +8806,7 @@
 ;;;***
 
 ;;;### (autoloads (eshell-command-result eshell-command eshell) "eshell"
-;;;;;;  "eshell/eshell.el" (19330 62404))
+;;;;;;  "eshell/eshell.el" (19330 37505))
 ;;; Generated autoloads from eshell/eshell.el
 
 (autoload 'eshell "eshell" "\
@@ -8847,7 +8847,7 @@
 ;;;;;;  visit-tags-table tags-table-mode find-tag-default-function
 ;;;;;;  find-tag-hook tags-add-tables tags-compression-info-list
 ;;;;;;  tags-table-list tags-case-fold-search) "etags" "progmodes/etags.el"
-;;;;;;  (19277 34922))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from progmodes/etags.el
 
 (defvar tags-file-name nil "\
@@ -9155,7 +9155,7 @@
 ;;;;;;  ethio-fidel-to-sera-marker ethio-fidel-to-sera-region ethio-fidel-to-sera-buffer
 ;;;;;;  ethio-sera-to-fidel-marker ethio-sera-to-fidel-region ethio-sera-to-fidel-buffer
 ;;;;;;  setup-ethiopic-environment-internal) "ethio-util" "language/ethio-util.el"
-;;;;;;  (19277 34920))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from language/ethio-util.el
 
 (autoload 'setup-ethiopic-environment-internal "ethio-util" "\
@@ -9325,7 +9325,7 @@
 
 ;;;### (autoloads (eudc-load-eudc eudc-query-form eudc-expand-inline
 ;;;;;;  eudc-get-phone eudc-get-email eudc-set-server) "eudc" "net/eudc.el"
-;;;;;;  (19277 34921))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from net/eudc.el
 
 (autoload 'eudc-set-server "eudc" "\
@@ -9381,7 +9381,7 @@
 
 ;;;### (autoloads (eudc-display-jpeg-as-button eudc-display-jpeg-inline
 ;;;;;;  eudc-display-sound eudc-display-mail eudc-display-url eudc-display-generic-binary)
-;;;;;;  "eudc-bob" "net/eudc-bob.el" (19277 34921))
+;;;;;;  "eudc-bob" "net/eudc-bob.el" (19279 5151))
 ;;; Generated autoloads from net/eudc-bob.el
 
 (autoload 'eudc-display-generic-binary "eudc-bob" "\
@@ -9417,7 +9417,7 @@
 ;;;***
 
 ;;;### (autoloads (eudc-try-bbdb-insert eudc-insert-record-at-point-into-bbdb)
-;;;;;;  "eudc-export" "net/eudc-export.el" (19277 34921))
+;;;;;;  "eudc-export" "net/eudc-export.el" (19279 5151))
 ;;; Generated autoloads from net/eudc-export.el
 
 (autoload 'eudc-insert-record-at-point-into-bbdb "eudc-export" "\
@@ -9434,7 +9434,7 @@
 ;;;***
 
 ;;;### (autoloads (eudc-edit-hotlist) "eudc-hotlist" "net/eudc-hotlist.el"
-;;;;;;  (19277 34921))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from net/eudc-hotlist.el
 
 (autoload 'eudc-edit-hotlist "eudc-hotlist" "\
@@ -9444,8 +9444,8 @@
 
 ;;;***
 
-;;;### (autoloads (ewoc-create) "ewoc" "emacs-lisp/ewoc.el" (19277
-;;;;;;  34919))
+;;;### (autoloads (ewoc-create) "ewoc" "emacs-lisp/ewoc.el" (19279
+;;;;;;  5149))
 ;;; Generated autoloads from emacs-lisp/ewoc.el
 
 (autoload 'ewoc-create "ewoc" "\
@@ -9474,7 +9474,7 @@
 ;;;### (autoloads (executable-make-buffer-file-executable-if-script-p
 ;;;;;;  executable-self-display executable-set-magic executable-interpret
 ;;;;;;  executable-command-find-posix-p) "executable" "progmodes/executable.el"
-;;;;;;  (19277 34922))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from progmodes/executable.el
 
 (autoload 'executable-command-find-posix-p "executable" "\
@@ -9517,7 +9517,7 @@
 
 ;;;### (autoloads (expand-jump-to-next-slot expand-jump-to-previous-slot
 ;;;;;;  expand-abbrev-hook expand-add-abbrevs) "expand" "expand.el"
-;;;;;;  (19277 34916))
+;;;;;;  (19279 5148))
 ;;; Generated autoloads from expand.el
 
 (autoload 'expand-add-abbrevs "expand" "\
@@ -9566,7 +9566,7 @@
 
 ;;;***
 
-;;;### (autoloads (f90-mode) "f90" "progmodes/f90.el" (19325 45050))
+;;;### (autoloads (f90-mode) "f90" "progmodes/f90.el" (19326 6129))
 ;;; Generated autoloads from progmodes/f90.el
 
 (autoload 'f90-mode "f90" "\
@@ -9632,8 +9632,8 @@
 ;;;### (autoloads (variable-pitch-mode buffer-face-toggle buffer-face-set
 ;;;;;;  buffer-face-mode text-scale-adjust text-scale-decrease text-scale-increase
 ;;;;;;  text-scale-set face-remap-set-base face-remap-reset-base
-;;;;;;  face-remap-add-relative) "face-remap" "face-remap.el" (19360
-;;;;;;  14173))
+;;;;;;  face-remap-add-relative) "face-remap" "face-remap.el" (19358
+;;;;;;  54001))
 ;;; Generated autoloads from face-remap.el
 
 (autoload 'face-remap-add-relative "face-remap" "\
@@ -9773,7 +9773,7 @@
 
 ;;;### (autoloads (feedmail-queue-reminder feedmail-run-the-queue
 ;;;;;;  feedmail-run-the-queue-global-prompt feedmail-run-the-queue-no-prompts
-;;;;;;  feedmail-send-it) "feedmail" "mail/feedmail.el" (19267 61658))
+;;;;;;  feedmail-send-it) "feedmail" "mail/feedmail.el" (19256 49601))
 ;;; Generated autoloads from mail/feedmail.el
 
 (autoload 'feedmail-send-it "feedmail" "\
@@ -9827,7 +9827,7 @@
 ;;;***
 
 ;;;### (autoloads (ffap-bindings dired-at-point ffap-at-mouse ffap-menu
-;;;;;;  find-file-at-point ffap-next) "ffap" "ffap.el" (19318 65023))
+;;;;;;  find-file-at-point ffap-next) "ffap" "ffap.el" (19321 4517))
 ;;; Generated autoloads from ffap.el
 
 (autoload 'ffap-next "ffap" "\
@@ -9891,7 +9891,7 @@
 ;;;### (autoloads (file-cache-minibuffer-complete file-cache-add-directory-recursively
 ;;;;;;  file-cache-add-directory-using-locate file-cache-add-directory-using-find
 ;;;;;;  file-cache-add-file file-cache-add-directory-list file-cache-add-directory)
-;;;;;;  "filecache" "filecache.el" (19277 34916))
+;;;;;;  "filecache" "filecache.el" (19279 5148))
 ;;; Generated autoloads from filecache.el
 
 (autoload 'file-cache-add-directory "filecache" "\
@@ -9951,7 +9951,7 @@
 ;;;;;;  copy-file-locals-to-dir-locals delete-dir-local-variable
 ;;;;;;  add-dir-local-variable delete-file-local-variable-prop-line
 ;;;;;;  add-file-local-variable-prop-line delete-file-local-variable
-;;;;;;  add-file-local-variable) "files-x" "files-x.el" (19277 34916))
+;;;;;;  add-file-local-variable) "files-x" "files-x.el" (19279 5148))
 ;;; Generated autoloads from files-x.el
 
 (autoload 'add-file-local-variable "files-x" "\
@@ -10016,8 +10016,8 @@
 
 ;;;***
 
-;;;### (autoloads (filesets-init) "filesets" "filesets.el" (19277
-;;;;;;  34916))
+;;;### (autoloads (filesets-init) "filesets" "filesets.el" (19279
+;;;;;;  5148))
 ;;; Generated autoloads from filesets.el
 
 (autoload 'filesets-init "filesets" "\
@@ -10028,7 +10028,7 @@
 
 ;;;***
 
-;;;### (autoloads (find-cmd) "find-cmd" "find-cmd.el" (19279 53114))
+;;;### (autoloads (find-cmd) "find-cmd" "find-cmd.el" (19279 38446))
 ;;; Generated autoloads from find-cmd.el
 
 (autoload 'find-cmd "find-cmd" "\
@@ -10049,7 +10049,7 @@
 
 ;;;### (autoloads (find-grep-dired find-name-dired find-dired find-grep-options
 ;;;;;;  find-ls-subdir-switches find-ls-option) "find-dired" "find-dired.el"
-;;;;;;  (19277 34916))
+;;;;;;  (19375 49830))
 ;;; Generated autoloads from find-dired.el
 
 (defvar find-ls-option (if (eq system-type 'berkeley-unix) (purecopy '("-ls" . "-gilsb")) (purecopy '("-exec ls -ld {} \\;" . "-ld"))) "\
@@ -10110,7 +10110,7 @@
 
 ;;;### (autoloads (ff-mouse-find-other-file-other-window ff-mouse-find-other-file
 ;;;;;;  ff-find-other-file ff-get-other-file) "find-file" "find-file.el"
-;;;;;;  (19277 34916))
+;;;;;;  (19279 5148))
 ;;; Generated autoloads from find-file.el
 
 (defvar ff-special-constructs `((,(purecopy "^#\\s *\\(include\\|import\\)\\s +[<\"]\\(.*\\)[>\"]") lambda nil (buffer-substring (match-beginning 2) (match-end 2)))) "\
@@ -10204,7 +10204,7 @@
 ;;;;;;  find-variable find-variable-noselect find-function-other-frame
 ;;;;;;  find-function-other-window find-function find-function-noselect
 ;;;;;;  find-function-search-for-symbol find-library) "find-func"
-;;;;;;  "emacs-lisp/find-func.el" (19277 34919))
+;;;;;;  "emacs-lisp/find-func.el" (19279 5149))
 ;;; Generated autoloads from emacs-lisp/find-func.el
 
 (autoload 'find-library "find-func" "\
@@ -10359,7 +10359,7 @@
 ;;;***
 
 ;;;### (autoloads (find-lisp-find-dired-filter find-lisp-find-dired-subdirectories
-;;;;;;  find-lisp-find-dired) "find-lisp" "find-lisp.el" (19277 34916))
+;;;;;;  find-lisp-find-dired) "find-lisp" "find-lisp.el" (19279 5148))
 ;;; Generated autoloads from find-lisp.el
 
 (autoload 'find-lisp-find-dired "find-lisp" "\
@@ -10380,7 +10380,7 @@
 ;;;***
 
 ;;;### (autoloads (finder-by-keyword finder-commentary finder-list-keywords)
-;;;;;;  "finder" "finder.el" (19360 14173))
+;;;;;;  "finder" "finder.el" (19368 35187))
 ;;; Generated autoloads from finder.el
 
 (autoload 'finder-list-keywords "finder" "\
@@ -10402,7 +10402,7 @@
 ;;;***
 
 ;;;### (autoloads (enable-flow-control-on enable-flow-control) "flow-ctrl"
-;;;;;;  "flow-ctrl.el" (19277 34916))
+;;;;;;  "flow-ctrl.el" (19279 5148))
 ;;; Generated autoloads from flow-ctrl.el
 
 (autoload 'enable-flow-control "flow-ctrl" "\
@@ -10424,7 +10424,7 @@
 ;;;***
 
 ;;;### (autoloads (fill-flowed fill-flowed-encode) "flow-fill" "gnus/flow-fill.el"
-;;;;;;  (19277 34919))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from gnus/flow-fill.el
 
 (autoload 'fill-flowed-encode "flow-fill" "\
@@ -10440,7 +10440,7 @@
 ;;;***
 
 ;;;### (autoloads (flymake-mode-off flymake-mode-on flymake-mode)
-;;;;;;  "flymake" "progmodes/flymake.el" (19299 5862))
+;;;;;;  "flymake" "progmodes/flymake.el" (19299 25155))
 ;;; Generated autoloads from progmodes/flymake.el
 
 (autoload 'flymake-mode "flymake" "\
@@ -10464,7 +10464,7 @@
 
 ;;;### (autoloads (flyspell-buffer flyspell-region flyspell-mode-off
 ;;;;;;  turn-off-flyspell turn-on-flyspell flyspell-mode flyspell-prog-mode)
-;;;;;;  "flyspell" "textmodes/flyspell.el" (19324 55756))
+;;;;;;  "flyspell" "textmodes/flyspell.el" (19370 36541))
 ;;; Generated autoloads from textmodes/flyspell.el
 
 (autoload 'flyspell-prog-mode "flyspell" "\
@@ -10534,7 +10534,7 @@
 
 ;;;### (autoloads (follow-delete-other-windows-and-split follow-mode
 ;;;;;;  turn-off-follow-mode turn-on-follow-mode) "follow" "follow.el"
-;;;;;;  (19277 34916))
+;;;;;;  (19279 5148))
 ;;; Generated autoloads from follow.el
 
 (autoload 'turn-on-follow-mode "follow" "\
@@ -10607,8 +10607,8 @@
 
 ;;;***
 
-;;;### (autoloads (footnote-mode) "footnote" "mail/footnote.el" (19277
-;;;;;;  34921))
+;;;### (autoloads (footnote-mode) "footnote" "mail/footnote.el" (19279
+;;;;;;  5150))
 ;;; Generated autoloads from mail/footnote.el
 
 (autoload 'footnote-mode "footnote" "\
@@ -10622,7 +10622,7 @@
 ;;;***
 
 ;;;### (autoloads (forms-find-file-other-window forms-find-file forms-mode)
-;;;;;;  "forms" "forms.el" (19277 34916))
+;;;;;;  "forms" "forms.el" (19279 5148))
 ;;; Generated autoloads from forms.el
 
 (autoload 'forms-mode "forms" "\
@@ -10659,7 +10659,7 @@
 ;;;***
 
 ;;;### (autoloads (fortran-mode) "fortran" "progmodes/fortran.el"
-;;;;;;  (19277 34922))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from progmodes/fortran.el
 
 (autoload 'fortran-mode "fortran" "\
@@ -10737,7 +10737,7 @@
 ;;;***
 
 ;;;### (autoloads (fortune fortune-to-signature fortune-compile fortune-from-region
-;;;;;;  fortune-add-fortune) "fortune" "play/fortune.el" (19277 34922))
+;;;;;;  fortune-add-fortune) "fortune" "play/fortune.el" (19279 5151))
 ;;; Generated autoloads from play/fortune.el
 
 (autoload 'fortune-add-fortune "fortune" "\
@@ -10786,14 +10786,19 @@
 
 ;;;***
 
-;;;### (autoloads (gdb-enable-debug gdb) "gdb-ui" "progmodes/gdb-ui.el"
-;;;;;;  (19326 57936))
-;;; Generated autoloads from progmodes/gdb-ui.el
-
-(autoload 'gdb "gdb-ui" "\
+;;;### (autoloads (gdb gdb-enable-debug) "gdb-mi" "progmodes/gdb-mi.el"
+;;;;;;  (19375 49830))
+;;; Generated autoloads from progmodes/gdb-mi.el
+
+(defvar gdb-enable-debug nil "\
+Non-nil means record the process input and output in `gdb-debug-log'.")
+
+(custom-autoload 'gdb-enable-debug "gdb-mi" t)
+
+(autoload 'gdb "gdb-mi" "\
 Run gdb on program FILE in buffer *gud-FILE*.
-The directory containing FILE becomes the initial working
-directory and source-file directory for your debugger.
+The directory containing FILE becomes the initial working directory
+and source-file directory for your debugger.
 
 If `gdb-many-windows' is nil (the default value) then gdb just
 pops up the GUD buffer unless `gdb-show-main' is t.  In this case
@@ -10801,10 +10806,8 @@
 other with the source file with the main routine of the inferior.
 
 If `gdb-many-windows' is t, regardless of the value of
-`gdb-show-main', the layout below will appear unless
-`gdb-use-separate-io-buffer' is nil when the source buffer
-occupies the full width of the frame.  Keybindings are shown in
-some of the buffers.
+`gdb-show-main', the layout below will appear.  Keybindings are
+shown in some of the buffers.
 
 Watch expressions appear in the speedbar/slowbar.
 
@@ -10816,37 +10819,37 @@
 See Info node `(emacs)GDB Graphical Interface' for a more
 detailed description of this mode.
 
+
 +----------------------------------------------------------------------+
 |                               GDB Toolbar                            |
 +-----------------------------------+----------------------------------+
-|  GUD buffer (I/O of GDB)          |  Locals buffer                   |
-|-----------------------------------+----------------------------------+
+| GUD buffer (I/O of GDB)           | Locals buffer                    |
+|                                   |                                  |
+|                                   |                                  |
 |                                   |                                  |
-|  Source buffer                    |  I/O buffer for debugged program |
++-----------------------------------+----------------------------------+
+| Source buffer                     | I/O buffer (of debugged program) |
+|                                   | (comint-mode)                    |
+|                                   |                                  |
+|                                   |                                  |
 |                                   |                                  |
-|-----------------------------------+----------------------------------+
-|  Stack buffer                     |  Breakpoints/threads buffer      |
+|                                   |                                  |
+|                                   |                                  |
+|                                   |                                  |
 +-----------------------------------+----------------------------------+
-
-The option \"--annotate=3\" must be included in this value.  To
-run GDB in text command mode, use `gud-gdb'.  You need to use
-text command mode to debug multiple programs within one Emacs
-session.
+| Stack buffer                      | Breakpoints buffer               |
+| RET      gdb-select-frame         | SPC    gdb-toggle-breakpoint     |
+|                                   | RET    gdb-goto-breakpoint       |
+|                                   | D      gdb-delete-breakpoint     |
++-----------------------------------+----------------------------------+
 
 \(fn COMMAND-LINE)" t nil)
 
-(defalias 'gdba 'gdb)
-
-(defvar gdb-enable-debug nil "\
-Non-nil means record the process input and output in `gdb-debug-log'.")
-
-(custom-autoload 'gdb-enable-debug "gdb-ui" t)
-
 ;;;***
 
 ;;;### (autoloads (generic-make-keywords-list generic-mode generic-mode-internal
-;;;;;;  define-generic-mode) "generic" "emacs-lisp/generic.el" (19277
-;;;;;;  34919))
+;;;;;;  define-generic-mode) "generic" "emacs-lisp/generic.el" (19279
+;;;;;;  5149))
 ;;; Generated autoloads from emacs-lisp/generic.el
 
 (defvar generic-mode-list nil "\
@@ -10921,7 +10924,7 @@
 ;;;***
 
 ;;;### (autoloads (glasses-mode) "glasses" "progmodes/glasses.el"
-;;;;;;  (19277 34922))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from progmodes/glasses.el
 
 (autoload 'glasses-mode "glasses" "\
@@ -10935,7 +10938,7 @@
 
 ;;;### (autoloads (gmm-tool-bar-from-list gmm-widget-p gmm-error
 ;;;;;;  gmm-message gmm-regexp-concat) "gmm-utils" "gnus/gmm-utils.el"
-;;;;;;  (19362 59593))
+;;;;;;  (19365 25156))
 ;;; Generated autoloads from gnus/gmm-utils.el
 
 (autoload 'gmm-regexp-concat "gmm-utils" "\
@@ -10990,7 +10993,7 @@
 ;;;***
 
 ;;;### (autoloads (gnus gnus-other-frame gnus-slave gnus-no-server
-;;;;;;  gnus-slave-no-server) "gnus" "gnus/gnus.el" (19277 34920))
+;;;;;;  gnus-slave-no-server) "gnus" "gnus/gnus.el" (19279 5150))
 ;;; Generated autoloads from gnus/gnus.el
 (when (fboundp 'custom-autoload)
  (custom-autoload 'gnus-select-method "gnus"))
@@ -11043,7 +11046,7 @@
 ;;;;;;  gnus-agent-get-undownloaded-list gnus-agent-delete-group
 ;;;;;;  gnus-agent-rename-group gnus-agent-possibly-save-gcc gnus-agentize
 ;;;;;;  gnus-slave-unplugged gnus-plugged gnus-unplugged) "gnus-agent"
-;;;;;;  "gnus/gnus-agent.el" (19277 34920))
+;;;;;;  "gnus/gnus-agent.el" (19368 35187))
 ;;; Generated autoloads from gnus/gnus-agent.el
 
 (autoload 'gnus-unplugged "gnus-agent" "\
@@ -11134,7 +11137,7 @@
 ;;;***
 
 ;;;### (autoloads (gnus-article-prepare-display) "gnus-art" "gnus/gnus-art.el"
-;;;;;;  (19333 26940))
+;;;;;;  (19368 35187))
 ;;; Generated autoloads from gnus/gnus-art.el
 
 (autoload 'gnus-article-prepare-display "gnus-art" "\
@@ -11145,7 +11148,7 @@
 ;;;***
 
 ;;;### (autoloads (gnus-audio-play) "gnus-audio" "gnus/gnus-audio.el"
-;;;;;;  (19277 34920))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from gnus/gnus-audio.el
 
 (autoload 'gnus-audio-play "gnus-audio" "\
@@ -11156,7 +11159,7 @@
 ;;;***
 
 ;;;### (autoloads (gnus-bookmark-bmenu-list gnus-bookmark-jump gnus-bookmark-set)
-;;;;;;  "gnus-bookmark" "gnus/gnus-bookmark.el" (19277 34920))
+;;;;;;  "gnus-bookmark" "gnus/gnus-bookmark.el" (19279 5150))
 ;;; Generated autoloads from gnus/gnus-bookmark.el
 
 (autoload 'gnus-bookmark-set "gnus-bookmark" "\
@@ -11181,8 +11184,8 @@
 
 ;;;### (autoloads (gnus-cache-delete-group gnus-cache-rename-group
 ;;;;;;  gnus-cache-generate-nov-databases gnus-cache-generate-active
-;;;;;;  gnus-jog-cache) "gnus-cache" "gnus/gnus-cache.el" (19277
-;;;;;;  34920))
+;;;;;;  gnus-jog-cache) "gnus-cache" "gnus/gnus-cache.el" (19279
+;;;;;;  5150))
 ;;; Generated autoloads from gnus/gnus-cache.el
 
 (autoload 'gnus-jog-cache "gnus-cache" "\
@@ -11224,7 +11227,7 @@
 ;;;***
 
 ;;;### (autoloads (gnus-delay-initialize gnus-delay-send-queue gnus-delay-article)
-;;;;;;  "gnus-delay" "gnus/gnus-delay.el" (19277 34920))
+;;;;;;  "gnus-delay" "gnus/gnus-delay.el" (19279 5150))
 ;;; Generated autoloads from gnus/gnus-delay.el
 
 (autoload 'gnus-delay-article "gnus-delay" "\
@@ -11260,7 +11263,7 @@
 ;;;***
 
 ;;;### (autoloads (gnus-user-format-function-D gnus-user-format-function-d)
-;;;;;;  "gnus-diary" "gnus/gnus-diary.el" (19279 53114))
+;;;;;;  "gnus-diary" "gnus/gnus-diary.el" (19279 38446))
 ;;; Generated autoloads from gnus/gnus-diary.el
 
 (autoload 'gnus-user-format-function-d "gnus-diary" "\
@@ -11276,7 +11279,7 @@
 ;;;***
 
 ;;;### (autoloads (turn-on-gnus-dired-mode) "gnus-dired" "gnus/gnus-dired.el"
-;;;;;;  (19277 34920))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from gnus/gnus-dired.el
 
 (autoload 'turn-on-gnus-dired-mode "gnus-dired" "\
@@ -11287,7 +11290,7 @@
 ;;;***
 
 ;;;### (autoloads (gnus-draft-reminder) "gnus-draft" "gnus/gnus-draft.el"
-;;;;;;  (19277 34920))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from gnus/gnus-draft.el
 
 (autoload 'gnus-draft-reminder "gnus-draft" "\
@@ -11299,8 +11302,8 @@
 
 ;;;### (autoloads (gnus-convert-png-to-face gnus-convert-face-to-png
 ;;;;;;  gnus-face-from-file gnus-x-face-from-file gnus-insert-random-x-face-header
-;;;;;;  gnus-random-x-face) "gnus-fun" "gnus/gnus-fun.el" (19277
-;;;;;;  34920))
+;;;;;;  gnus-random-x-face) "gnus-fun" "gnus/gnus-fun.el" (19279
+;;;;;;  5150))
 ;;; Generated autoloads from gnus/gnus-fun.el
 
 (autoload 'gnus-random-x-face "gnus-fun" "\
@@ -11345,7 +11348,7 @@
 ;;;***
 
 ;;;### (autoloads (gnus-fetch-group-other-frame gnus-fetch-group)
-;;;;;;  "gnus-group" "gnus/gnus-group.el" (19277 34920))
+;;;;;;  "gnus-group" "gnus/gnus-group.el" (19279 5150))
 ;;; Generated autoloads from gnus/gnus-group.el
 
 (autoload 'gnus-fetch-group "gnus-group" "\
@@ -11363,7 +11366,7 @@
 ;;;***
 
 ;;;### (autoloads (gnus-batch-score) "gnus-kill" "gnus/gnus-kill.el"
-;;;;;;  (19277 34920))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from gnus/gnus-kill.el
 
 (defalias 'gnus-batch-kill 'gnus-batch-score)
@@ -11378,7 +11381,7 @@
 
 ;;;### (autoloads (gnus-mailing-list-mode gnus-mailing-list-insinuate
 ;;;;;;  turn-on-gnus-mailing-list-mode) "gnus-ml" "gnus/gnus-ml.el"
-;;;;;;  (19277 34920))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from gnus/gnus-ml.el
 
 (autoload 'turn-on-gnus-mailing-list-mode "gnus-ml" "\
@@ -11403,7 +11406,7 @@
 
 ;;;### (autoloads (gnus-group-split-fancy gnus-group-split gnus-group-split-update
 ;;;;;;  gnus-group-split-setup) "gnus-mlspl" "gnus/gnus-mlspl.el"
-;;;;;;  (19277 34920))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from gnus/gnus-mlspl.el
 
 (autoload 'gnus-group-split-setup "gnus-mlspl" "\
@@ -11504,7 +11507,7 @@
 ;;;***
 
 ;;;### (autoloads (gnus-change-server) "gnus-move" "gnus/gnus-move.el"
-;;;;;;  (19277 34920))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from gnus/gnus-move.el
 
 (autoload 'gnus-change-server "gnus-move" "\
@@ -11516,7 +11519,7 @@
 ;;;***
 
 ;;;### (autoloads (gnus-button-reply gnus-button-mailto gnus-msg-mail)
-;;;;;;  "gnus-msg" "gnus/gnus-msg.el" (19277 34920))
+;;;;;;  "gnus-msg" "gnus/gnus-msg.el" (19279 5150))
 ;;; Generated autoloads from gnus/gnus-msg.el
 
 (autoload 'gnus-msg-mail "gnus-msg" "\
@@ -11541,7 +11544,7 @@
 ;;;***
 
 ;;;### (autoloads (gnus-nocem-load-cache gnus-nocem-scan-groups)
-;;;;;;  "gnus-nocem" "gnus/gnus-nocem.el" (19277 34920))
+;;;;;;  "gnus-nocem" "gnus/gnus-nocem.el" (19279 5150))
 ;;; Generated autoloads from gnus/gnus-nocem.el
 
 (autoload 'gnus-nocem-scan-groups "gnus-nocem" "\
@@ -11558,7 +11561,7 @@
 
 ;;;### (autoloads (gnus-treat-newsgroups-picon gnus-treat-mail-picon
 ;;;;;;  gnus-treat-from-picon) "gnus-picon" "gnus/gnus-picon.el"
-;;;;;;  (19277 34920))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from gnus/gnus-picon.el
 
 (autoload 'gnus-treat-from-picon "gnus-picon" "\
@@ -11585,7 +11588,7 @@
 ;;;;;;  gnus-sorted-nintersection gnus-sorted-range-intersection
 ;;;;;;  gnus-sorted-intersection gnus-intersection gnus-sorted-complement
 ;;;;;;  gnus-sorted-ndifference gnus-sorted-difference) "gnus-range"
-;;;;;;  "gnus/gnus-range.el" (19277 34920))
+;;;;;;  "gnus/gnus-range.el" (19279 5150))
 ;;; Generated autoloads from gnus/gnus-range.el
 
 (autoload 'gnus-sorted-difference "gnus-range" "\
@@ -11653,7 +11656,7 @@
 ;;;***
 
 ;;;### (autoloads (gnus-registry-install-hooks gnus-registry-initialize)
-;;;;;;  "gnus-registry" "gnus/gnus-registry.el" (19277 34920))
+;;;;;;  "gnus-registry" "gnus/gnus-registry.el" (19368 35187))
 ;;; Generated autoloads from gnus/gnus-registry.el
 
 (autoload 'gnus-registry-initialize "gnus-registry" "\
@@ -11669,8 +11672,8 @@
 ;;;***
 
 ;;;### (autoloads (gnus-sieve-article-add-rule gnus-sieve-generate
-;;;;;;  gnus-sieve-update) "gnus-sieve" "gnus/gnus-sieve.el" (19277
-;;;;;;  34920))
+;;;;;;  gnus-sieve-update) "gnus-sieve" "gnus/gnus-sieve.el" (19279
+;;;;;;  5150))
 ;;; Generated autoloads from gnus/gnus-sieve.el
 
 (autoload 'gnus-sieve-update "gnus-sieve" "\
@@ -11698,7 +11701,7 @@
 ;;;***
 
 ;;;### (autoloads (gnus-batch-brew-soup) "gnus-soup" "gnus/gnus-soup.el"
-;;;;;;  (19277 34920))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from gnus/gnus-soup.el
 
 (autoload 'gnus-batch-brew-soup "gnus-soup" "\
@@ -11718,7 +11721,7 @@
 ;;;***
 
 ;;;### (autoloads (gnus-update-format) "gnus-spec" "gnus/gnus-spec.el"
-;;;;;;  (19277 34920))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from gnus/gnus-spec.el
 
 (autoload 'gnus-update-format "gnus-spec" "\
@@ -11729,8 +11732,8 @@
 ;;;***
 
 ;;;### (autoloads (gnus-fixup-nnimap-unread-after-getting-new-news
-;;;;;;  gnus-declare-backend) "gnus-start" "gnus/gnus-start.el" (19277
-;;;;;;  34920))
+;;;;;;  gnus-declare-backend) "gnus-start" "gnus/gnus-start.el" (19279
+;;;;;;  5150))
 ;;; Generated autoloads from gnus/gnus-start.el
 
 (autoload 'gnus-declare-backend "gnus-start" "\
@@ -11746,7 +11749,7 @@
 ;;;***
 
 ;;;### (autoloads (gnus-add-configuration) "gnus-win" "gnus/gnus-win.el"
-;;;;;;  (19277 34920))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from gnus/gnus-win.el
 
 (autoload 'gnus-add-configuration "gnus-win" "\
@@ -11756,7 +11759,7 @@
 
 ;;;***
 
-;;;### (autoloads (gomoku) "gomoku" "play/gomoku.el" (19277 34922))
+;;;### (autoloads (gomoku) "gomoku" "play/gomoku.el" (19279 5151))
 ;;; Generated autoloads from play/gomoku.el
 
 (autoload 'gomoku "gomoku" "\
@@ -11783,8 +11786,8 @@
 ;;;***
 
 ;;;### (autoloads (goto-address-prog-mode goto-address-mode goto-address
-;;;;;;  goto-address-at-point) "goto-addr" "net/goto-addr.el" (19360
-;;;;;;  14173))
+;;;;;;  goto-address-at-point) "goto-addr" "net/goto-addr.el" (19356
+;;;;;;  10801))
 ;;; Generated autoloads from net/goto-addr.el
 
 (define-obsolete-function-alias 'goto-address-at-mouse 'goto-address-at-point "22.1")
@@ -11824,7 +11827,7 @@
 
 ;;;### (autoloads (zrgrep rgrep lgrep grep-find grep grep-mode grep-compute-defaults
 ;;;;;;  grep-process-setup grep-setup-hook grep-find-command grep-command
-;;;;;;  grep-window-height) "grep" "progmodes/grep.el" (19304 58663))
+;;;;;;  grep-window-height) "grep" "progmodes/grep.el" (19304 5068))
 ;;; Generated autoloads from progmodes/grep.el
 
 (defvar grep-window-height nil "\
@@ -11980,7 +11983,7 @@
 
 ;;;***
 
-;;;### (autoloads (gs-load-image) "gs" "gs.el" (19277 34916))
+;;;### (autoloads (gs-load-image) "gs" "gs.el" (19279 5148))
 ;;; Generated autoloads from gs.el
 
 (autoload 'gs-load-image "gs" "\
@@ -11994,7 +11997,7 @@
 ;;;***
 
 ;;;### (autoloads (gud-tooltip-mode gdb-script-mode jdb pdb perldb
-;;;;;;  xdb dbx sdb gud-gdb) "gud" "progmodes/gud.el" (19277 34922))
+;;;;;;  xdb dbx sdb gud-gdb) "gud" "progmodes/gud.el" (19374 384))
 ;;; Generated autoloads from progmodes/gud.el
 
 (autoload 'gud-gdb "gud" "\
@@ -12082,8 +12085,8 @@
 
 ;;;***
 
-;;;### (autoloads (handwrite) "handwrite" "play/handwrite.el" (19277
-;;;;;;  34922))
+;;;### (autoloads (handwrite) "handwrite" "play/handwrite.el" (19279
+;;;;;;  5151))
 ;;; Generated autoloads from play/handwrite.el
 
 (autoload 'handwrite "handwrite" "\
@@ -12101,7 +12104,7 @@
 ;;;***
 
 ;;;### (autoloads (hanoi-unix-64 hanoi-unix hanoi) "hanoi" "play/hanoi.el"
-;;;;;;  (19267 61658))
+;;;;;;  (19256 49601))
 ;;; Generated autoloads from play/hanoi.el
 
 (autoload 'hanoi "hanoi" "\
@@ -12130,7 +12133,7 @@
 
 ;;;### (autoloads (mail-check-payment mail-add-payment-async mail-add-payment
 ;;;;;;  hashcash-verify-payment hashcash-insert-payment-async hashcash-insert-payment)
-;;;;;;  "hashcash" "mail/hashcash.el" (19361 52486))
+;;;;;;  "hashcash" "mail/hashcash.el" (19365 25156))
 ;;; Generated autoloads from mail/hashcash.el
 
 (autoload 'hashcash-insert-payment "hashcash" "\
@@ -12175,7 +12178,7 @@
 ;;;### (autoloads (scan-buf-previous-region scan-buf-next-region
 ;;;;;;  scan-buf-move-to-region help-at-pt-display-when-idle help-at-pt-set-timer
 ;;;;;;  help-at-pt-cancel-timer display-local-help help-at-pt-kbd-string
-;;;;;;  help-at-pt-string) "help-at-pt" "help-at-pt.el" (19277 34916))
+;;;;;;  help-at-pt-string) "help-at-pt" "help-at-pt.el" (19279 5148))
 ;;; Generated autoloads from help-at-pt.el
 
 (autoload 'help-at-pt-string "help-at-pt" "\
@@ -12305,7 +12308,7 @@
 ;;;### (autoloads (describe-categories describe-syntax describe-variable
 ;;;;;;  variable-at-point describe-function-1 find-lisp-object-file-name
 ;;;;;;  help-C-file-name describe-function) "help-fns" "help-fns.el"
-;;;;;;  (19277 34916))
+;;;;;;  (19279 5148))
 ;;; Generated autoloads from help-fns.el
 
 (autoload 'describe-function "help-fns" "\
@@ -12375,7 +12378,7 @@
 ;;;***
 
 ;;;### (autoloads (three-step-help) "help-macro" "help-macro.el"
-;;;;;;  (19277 34916))
+;;;;;;  (19279 5148))
 ;;; Generated autoloads from help-macro.el
 
 (defvar three-step-help nil "\
@@ -12391,8 +12394,8 @@
 
 ;;;### (autoloads (help-xref-on-pp help-insert-xref-button help-xref-button
 ;;;;;;  help-make-xrefs help-buffer help-setup-xref help-mode-finish
-;;;;;;  help-mode-setup help-mode) "help-mode" "help-mode.el" (19277
-;;;;;;  34916))
+;;;;;;  help-mode-setup help-mode) "help-mode" "help-mode.el" (19279
+;;;;;;  5148))
 ;;; Generated autoloads from help-mode.el
 
 (autoload 'help-mode "help-mode" "\
@@ -12484,7 +12487,7 @@
 ;;;***
 
 ;;;### (autoloads (Helper-help Helper-describe-bindings) "helper"
-;;;;;;  "emacs-lisp/helper.el" (19277 34919))
+;;;;;;  "emacs-lisp/helper.el" (19279 5149))
 ;;; Generated autoloads from emacs-lisp/helper.el
 
 (autoload 'Helper-describe-bindings "helper" "\
@@ -12500,7 +12503,7 @@
 ;;;***
 
 ;;;### (autoloads (hexlify-buffer hexl-find-file hexl-mode) "hexl"
-;;;;;;  "hexl.el" (19279 53114))
+;;;;;;  "hexl.el" (19279 38446))
 ;;; Generated autoloads from hexl.el
 
 (autoload 'hexl-mode "hexl" "\
@@ -12597,7 +12600,7 @@
 ;;;### (autoloads (hi-lock-write-interactive-patterns hi-lock-unface-buffer
 ;;;;;;  hi-lock-face-phrase-buffer hi-lock-face-buffer hi-lock-line-face-buffer
 ;;;;;;  global-hi-lock-mode hi-lock-mode) "hi-lock" "hi-lock.el"
-;;;;;;  (19277 34916))
+;;;;;;  (19279 5148))
 ;;; Generated autoloads from hi-lock.el
 
 (autoload 'hi-lock-mode "hi-lock" "\
@@ -12731,7 +12734,7 @@
 ;;;***
 
 ;;;### (autoloads (hide-ifdef-mode) "hideif" "progmodes/hideif.el"
-;;;;;;  (19277 34922))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from progmodes/hideif.el
 
 (autoload 'hide-ifdef-mode "hideif" "\
@@ -12771,7 +12774,7 @@
 ;;;***
 
 ;;;### (autoloads (turn-off-hideshow hs-minor-mode) "hideshow" "progmodes/hideshow.el"
-;;;;;;  (19277 34922))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from progmodes/hideshow.el
 
 (defvar hs-special-modes-alist (mapcar 'purecopy '((c-mode "{" "}" "/[*/]" nil nil) (c++-mode "{" "}" "/[*/]" nil nil) (bibtex-mode ("@\\S(*\\(\\s(\\)" 1)) (java-mode "{" "}" "/[*/]" nil nil) (js-mode "{" "}" "/[*/]" nil))) "\
@@ -12833,8 +12836,8 @@
 ;;;;;;  highlight-compare-buffers highlight-changes-rotate-faces
 ;;;;;;  highlight-changes-previous-change highlight-changes-next-change
 ;;;;;;  highlight-changes-remove-highlight highlight-changes-visible-mode
-;;;;;;  highlight-changes-mode) "hilit-chg" "hilit-chg.el" (19277
-;;;;;;  34916))
+;;;;;;  highlight-changes-mode) "hilit-chg" "hilit-chg.el" (19279
+;;;;;;  5148))
 ;;; Generated autoloads from hilit-chg.el
 
 (autoload 'highlight-changes-mode "hilit-chg" "\
@@ -12963,7 +12966,7 @@
 ;;;;;;  hippie-expand-ignore-buffers hippie-expand-max-buffers hippie-expand-no-restriction
 ;;;;;;  hippie-expand-dabbrev-as-symbol hippie-expand-dabbrev-skip-space
 ;;;;;;  hippie-expand-verbose hippie-expand-try-functions-list) "hippie-exp"
-;;;;;;  "hippie-exp.el" (19277 34916))
+;;;;;;  "hippie-exp.el" (19279 5148))
 ;;; Generated autoloads from hippie-exp.el
 
 (defvar hippie-expand-try-functions-list '(try-complete-file-name-partially try-complete-file-name try-expand-all-abbrevs try-expand-list try-expand-line try-expand-dabbrev try-expand-dabbrev-all-buffers try-expand-dabbrev-from-kill try-complete-lisp-symbol-partially try-complete-lisp-symbol) "\
@@ -13036,7 +13039,7 @@
 ;;;***
 
 ;;;### (autoloads (global-hl-line-mode hl-line-mode) "hl-line" "hl-line.el"
-;;;;;;  (19354 34807))
+;;;;;;  (19356 10801))
 ;;; Generated autoloads from hl-line.el
 
 (autoload 'hl-line-mode "hl-line" "\
@@ -13080,7 +13083,7 @@
 ;;;;;;  holiday-bahai-holidays holiday-islamic-holidays holiday-christian-holidays
 ;;;;;;  holiday-hebrew-holidays holiday-other-holidays holiday-local-holidays
 ;;;;;;  holiday-oriental-holidays holiday-general-holidays) "holidays"
-;;;;;;  "calendar/holidays.el" (19277 34918))
+;;;;;;  "calendar/holidays.el" (19279 5149))
 ;;; Generated autoloads from calendar/holidays.el
 
 (defvar holiday-general-holidays (mapcar 'purecopy '((holiday-fixed 1 1 "New Year's Day") (holiday-float 1 1 3 "Martin Luther King Day") (holiday-fixed 2 2 "Groundhog Day") (holiday-fixed 2 14 "Valentine's Day") (holiday-float 2 1 3 "President's Day") (holiday-fixed 3 17 "St. Patrick's Day") (holiday-fixed 4 1 "April Fools' Day") (holiday-float 5 0 2 "Mother's Day") (holiday-float 5 1 -1 "Memorial Day") (holiday-fixed 6 14 "Flag Day") (holiday-float 6 0 3 "Father's Day") (holiday-fixed 7 4 "Independence Day") (holiday-float 9 1 1 "Labor Day") (holiday-float 10 1 2 "Columbus Day") (holiday-fixed 10 31 "Halloween") (holiday-fixed 11 11 "Veteran's Day") (holiday-float 11 4 4 "Thanksgiving"))) "\
@@ -13228,8 +13231,8 @@
 
 ;;;***
 
-;;;### (autoloads (html2text) "html2text" "gnus/html2text.el" (19277
-;;;;;;  34920))
+;;;### (autoloads (html2text) "html2text" "gnus/html2text.el" (19279
+;;;;;;  5150))
 ;;; Generated autoloads from gnus/html2text.el
 
 (autoload 'html2text "html2text" "\
@@ -13240,8 +13243,8 @@
 ;;;***
 
 ;;;### (autoloads (define-ibuffer-filter define-ibuffer-op define-ibuffer-sorter
-;;;;;;  define-ibuffer-column) "ibuf-macs" "ibuf-macs.el" (19277
-;;;;;;  34916))
+;;;;;;  define-ibuffer-column) "ibuf-macs" "ibuf-macs.el" (19279
+;;;;;;  5148))
 ;;; Generated autoloads from ibuf-macs.el
 
 (autoload 'define-ibuffer-column "ibuf-macs" "\
@@ -13330,7 +13333,7 @@
 ;;;***
 
 ;;;### (autoloads (ibuffer ibuffer-other-window ibuffer-list-buffers)
-;;;;;;  "ibuffer" "ibuffer.el" (19279 53114))
+;;;;;;  "ibuffer" "ibuffer.el" (19279 5148))
 ;;; Generated autoloads from ibuffer.el
 
 (autoload 'ibuffer-list-buffers "ibuffer" "\
@@ -13371,7 +13374,7 @@
 
 ;;;### (autoloads (icalendar-import-buffer icalendar-import-file
 ;;;;;;  icalendar-export-region icalendar-export-file) "icalendar"
-;;;;;;  "calendar/icalendar.el" (19339 10551))
+;;;;;;  "calendar/icalendar.el" (19338 9840))
 ;;; Generated autoloads from calendar/icalendar.el
 
 (autoload 'icalendar-export-file "icalendar" "\
@@ -13423,8 +13426,8 @@
 
 ;;;***
 
-;;;### (autoloads (icomplete-mode) "icomplete" "icomplete.el" (19277
-;;;;;;  34916))
+;;;### (autoloads (icomplete-mode) "icomplete" "icomplete.el" (19279
+;;;;;;  5148))
 ;;; Generated autoloads from icomplete.el
 
 (defvar icomplete-mode nil "\
@@ -13445,7 +13448,7 @@
 
 ;;;***
 
-;;;### (autoloads (icon-mode) "icon" "progmodes/icon.el" (19277 34922))
+;;;### (autoloads (icon-mode) "icon" "progmodes/icon.el" (19279 5151))
 ;;; Generated autoloads from progmodes/icon.el
 
 (autoload 'icon-mode "icon" "\
@@ -13486,7 +13489,7 @@
 ;;;***
 
 ;;;### (autoloads (idlwave-shell) "idlw-shell" "progmodes/idlw-shell.el"
-;;;;;;  (19277 34922))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from progmodes/idlw-shell.el
 
 (autoload 'idlwave-shell "idlw-shell" "\
@@ -13512,7 +13515,7 @@
 ;;;***
 
 ;;;### (autoloads (idlwave-mode) "idlwave" "progmodes/idlwave.el"
-;;;;;;  (19279 53114))
+;;;;;;  (19279 38446))
 ;;; Generated autoloads from progmodes/idlwave.el
 
 (autoload 'idlwave-mode "idlwave" "\
@@ -13646,8 +13649,8 @@
 ;;;;;;  ido-find-alternate-file ido-find-file-other-window ido-find-file
 ;;;;;;  ido-find-file-in-dir ido-switch-buffer-other-frame ido-insert-buffer
 ;;;;;;  ido-kill-buffer ido-display-buffer ido-switch-buffer-other-window
-;;;;;;  ido-switch-buffer ido-mode ido-mode) "ido" "ido.el" (19286
-;;;;;;  4503))
+;;;;;;  ido-switch-buffer ido-mode ido-mode) "ido" "ido.el" (19292
+;;;;;;  15231))
 ;;; Generated autoloads from ido.el
 
 (defvar ido-mode nil "\
@@ -13908,7 +13911,7 @@
 
 ;;;***
 
-;;;### (autoloads (ielm) "ielm" "ielm.el" (19277 34916))
+;;;### (autoloads (ielm) "ielm" "ielm.el" (19279 5148))
 ;;; Generated autoloads from ielm.el
  (add-hook 'same-window-buffer-names (purecopy "*ielm*"))
 
@@ -13921,7 +13924,7 @@
 ;;;***
 
 ;;;### (autoloads (iimage-mode turn-on-iimage-mode) "iimage" "iimage.el"
-;;;;;;  (19277 34916))
+;;;;;;  (19279 5148))
 ;;; Generated autoloads from iimage.el
 
 (autoload 'turn-on-iimage-mode "iimage" "\
@@ -13940,7 +13943,7 @@
 ;;;;;;  insert-sliced-image insert-image put-image create-image image-type-auto-detected-p
 ;;;;;;  image-type-available-p image-type image-type-from-file-name
 ;;;;;;  image-type-from-file-header image-type-from-buffer image-type-from-data)
-;;;;;;  "image" "image.el" (19351 60740))
+;;;;;;  "image" "image.el" (19356 10801))
 ;;; Generated autoloads from image.el
 
 (autoload 'image-type-from-data "image" "\
@@ -14139,7 +14142,7 @@
 ;;;;;;  image-dired-jump-thumbnail-buffer image-dired-delete-tag
 ;;;;;;  image-dired-tag-files image-dired-show-all-from-dir image-dired-display-thumbs
 ;;;;;;  image-dired-dired-with-window-configuration image-dired-dired-insert-marked-thumbs)
-;;;;;;  "image-dired" "image-dired.el" (19277 34916))
+;;;;;;  "image-dired" "image-dired.el" (19370 36540))
 ;;; Generated autoloads from image-dired.el
 
 (autoload 'image-dired-dired-insert-marked-thumbs "image-dired" "\
@@ -14181,7 +14184,7 @@
 With optional argument APPEND, append thumbnail to thumbnail buffer
 instead of erasing it first.
 
-Option argument DO-NOT-POP controls if `pop-to-buffer' should be
+Optional argument DO-NOT-POP controls if `pop-to-buffer' should be
 used or not.  If non-nil, use `display-buffer' instead of
 `pop-to-buffer'.  This is used from functions like
 `image-dired-next-line-and-display' and
@@ -14273,7 +14276,7 @@
 
 ;;;### (autoloads (auto-image-file-mode insert-image-file image-file-name-regexp
 ;;;;;;  image-file-name-regexps image-file-name-extensions) "image-file"
-;;;;;;  "image-file.el" (19277 34916))
+;;;;;;  "image-file.el" (19279 5148))
 ;;; Generated autoloads from image-file.el
 
 (defvar image-file-name-extensions (purecopy '("png" "jpeg" "jpg" "gif" "tiff" "tif" "xbm" "xpm" "pbm" "pgm" "ppm" "pnm" "svg")) "\
@@ -14335,7 +14338,7 @@
 ;;;***
 
 ;;;### (autoloads (image-bookmark-jump image-mode-as-text image-minor-mode
-;;;;;;  image-mode) "image-mode" "image-mode.el" (19351 60435))
+;;;;;;  image-mode) "image-mode" "image-mode.el" (19356 10801))
 ;;; Generated autoloads from image-mode.el
  (push (cons (purecopy "\\.jpe?g\\'")    'image-mode) auto-mode-alist)
  (push (cons (purecopy "\\.png\\'")      'image-mode) auto-mode-alist)
@@ -14385,7 +14388,7 @@
 ;;;***
 
 ;;;### (autoloads (imenu imenu-add-menubar-index imenu-add-to-menubar
-;;;;;;  imenu-sort-function) "imenu" "imenu.el" (19277 34916))
+;;;;;;  imenu-sort-function) "imenu" "imenu.el" (19279 5148))
 ;;; Generated autoloads from imenu.el
 
 (defvar imenu-sort-function nil "\
@@ -14502,7 +14505,7 @@
 
 ;;;### (autoloads (indian-2-column-to-ucs-region in-is13194-pre-write-conversion
 ;;;;;;  in-is13194-post-read-conversion indian-compose-string indian-compose-region)
-;;;;;;  "ind-util" "language/ind-util.el" (19277 34920))
+;;;;;;  "ind-util" "language/ind-util.el" (19279 5150))
 ;;; Generated autoloads from language/ind-util.el
 
 (autoload 'indian-compose-region "ind-util" "\
@@ -14534,7 +14537,7 @@
 
 ;;;### (autoloads (inferior-lisp inferior-lisp-prompt inferior-lisp-load-command
 ;;;;;;  inferior-lisp-program inferior-lisp-filter-regexp) "inf-lisp"
-;;;;;;  "progmodes/inf-lisp.el" (19277 34922))
+;;;;;;  "progmodes/inf-lisp.el" (19279 5151))
 ;;; Generated autoloads from progmodes/inf-lisp.el
 
 (defvar inferior-lisp-filter-regexp (purecopy "\\`\\s *\\(:\\(\\w\\|\\s_\\)\\)?\\s *\\'") "\
@@ -14602,7 +14605,7 @@
 ;;;;;;  Info-goto-emacs-command-node Info-mode info-finder info-apropos
 ;;;;;;  Info-index Info-directory Info-on-current-buffer info-standalone
 ;;;;;;  info-emacs-manual info info-other-window) "info" "info.el"
-;;;;;;  (19360 14173))
+;;;;;;  (19368 35187))
 ;;; Generated autoloads from info.el
 
 (autoload 'info-other-window "info" "\
@@ -14677,8 +14680,11 @@
 
 (autoload 'info-finder "info" "\
 Display descriptions of the keywords in the Finder virtual manual.
-
-\(fn)" t nil)
+In interactive use, a prefix argument directs this command to read
+a list of keywords separated by comma.  After that, it displays a node
+with a list packages that contain all specified keywords.
+
+\(fn &optional KEYWORDS)" t nil)
 
 (autoload 'Info-mode "info" "\
 Info mode provides commands for browsing through the Info documentation tree.
@@ -14781,7 +14787,7 @@
 
 ;;;### (autoloads (info-complete-file info-complete-symbol info-lookup-file
 ;;;;;;  info-lookup-symbol info-lookup-reset) "info-look" "info-look.el"
-;;;;;;  (19277 34916))
+;;;;;;  (19279 5148))
 ;;; Generated autoloads from info-look.el
 
 (autoload 'info-lookup-reset "info-look" "\
@@ -14829,7 +14835,7 @@
 ;;;***
 
 ;;;### (autoloads (info-xref-check-all-custom info-xref-check-all
-;;;;;;  info-xref-check) "info-xref" "info-xref.el" (19277 34916))
+;;;;;;  info-xref-check) "info-xref" "info-xref.el" (19279 5148))
 ;;; Generated autoloads from info-xref.el
 
 (autoload 'info-xref-check "info-xref" "\
@@ -14856,7 +14862,7 @@
 ;;;***
 
 ;;;### (autoloads (batch-info-validate Info-validate Info-split Info-split-threshold
-;;;;;;  Info-tagify) "informat" "informat.el" (19277 34916))
+;;;;;;  Info-tagify) "informat" "informat.el" (19279 5148))
 ;;; Generated autoloads from informat.el
 
 (autoload 'Info-tagify "informat" "\
@@ -14903,7 +14909,7 @@
 
 ;;;### (autoloads (isearch-process-search-multibyte-characters isearch-toggle-input-method
 ;;;;;;  isearch-toggle-specified-input-method) "isearch-x" "international/isearch-x.el"
-;;;;;;  (19277 34920))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from international/isearch-x.el
 
 (autoload 'isearch-toggle-specified-input-method "isearch-x" "\
@@ -14923,8 +14929,8 @@
 
 ;;;***
 
-;;;### (autoloads (isearchb-activate) "isearchb" "isearchb.el" (19277
-;;;;;;  34916))
+;;;### (autoloads (isearchb-activate) "isearchb" "isearchb.el" (19279
+;;;;;;  5148))
 ;;; Generated autoloads from isearchb.el
 
 (autoload 'isearchb-activate "isearchb" "\
@@ -14940,7 +14946,7 @@
 ;;;### (autoloads (iso-cvt-define-menu iso-cvt-write-only iso-cvt-read-only
 ;;;;;;  iso-sgml2iso iso-iso2sgml iso-iso2duden iso-iso2gtex iso-gtex2iso
 ;;;;;;  iso-tex2iso iso-iso2tex iso-german iso-spanish) "iso-cvt"
-;;;;;;  "international/iso-cvt.el" (19277 34920))
+;;;;;;  "international/iso-cvt.el" (19279 5150))
 ;;; Generated autoloads from international/iso-cvt.el
 
 (autoload 'iso-spanish "iso-cvt" "\
@@ -15031,7 +15037,7 @@
 ;;;***
 
 ;;;### (autoloads nil "iso-transl" "international/iso-transl.el"
-;;;;;;  (19277 34920))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from international/iso-transl.el
  (or key-translation-map (setq key-translation-map (make-sparse-keymap)))
  (define-key key-translation-map "\C-x8" 'iso-transl-ctl-x-8-map)
@@ -15043,7 +15049,7 @@
 ;;;;;;  ispell-complete-word ispell-continue ispell-buffer ispell-comments-and-strings
 ;;;;;;  ispell-region ispell-change-dictionary ispell-kill-ispell
 ;;;;;;  ispell-help ispell-pdict-save ispell-word ispell-personal-dictionary)
-;;;;;;  "ispell" "textmodes/ispell.el" (19304 58663))
+;;;;;;  "ispell" "textmodes/ispell.el" (19313 15415))
 ;;; Generated autoloads from textmodes/ispell.el
 (put 'ispell-check-comments 'safe-local-variable (lambda (a) (memq a '(nil t exclusive))))
 
@@ -15261,8 +15267,8 @@
 
 ;;;***
 
-;;;### (autoloads (iswitchb-mode) "iswitchb" "iswitchb.el" (19315
-;;;;;;  24485))
+;;;### (autoloads (iswitchb-mode) "iswitchb" "iswitchb.el" (19321
+;;;;;;  4517))
 ;;; Generated autoloads from iswitchb.el
 
 (defvar iswitchb-mode nil "\
@@ -15287,7 +15293,7 @@
 ;;;### (autoloads (read-hiragana-string japanese-zenkaku-region japanese-hankaku-region
 ;;;;;;  japanese-hiragana-region japanese-katakana-region japanese-zenkaku
 ;;;;;;  japanese-hankaku japanese-hiragana japanese-katakana setup-japanese-environment-internal)
-;;;;;;  "japan-util" "language/japan-util.el" (19277 34920))
+;;;;;;  "japan-util" "language/japan-util.el" (19279 5150))
 ;;; Generated autoloads from language/japan-util.el
 
 (autoload 'setup-japanese-environment-internal "japan-util" "\
@@ -15365,7 +15371,7 @@
 ;;;***
 
 ;;;### (autoloads (jka-compr-uninstall jka-compr-handler) "jka-compr"
-;;;;;;  "jka-compr.el" (19294 23005))
+;;;;;;  "jka-compr.el" (19292 15231))
 ;;; Generated autoloads from jka-compr.el
 
 (defvar jka-compr-inhibit nil "\
@@ -15388,7 +15394,7 @@
 
 ;;;***
 
-;;;### (autoloads (js-mode) "js" "progmodes/js.el" (19277 34922))
+;;;### (autoloads (js-mode) "js" "progmodes/js.el" (19279 5151))
 ;;; Generated autoloads from progmodes/js.el
 
 (autoload 'js-mode "js" "\
@@ -15406,7 +15412,7 @@
 
 ;;;### (autoloads (keypad-setup keypad-numlock-shifted-setup keypad-shifted-setup
 ;;;;;;  keypad-numlock-setup keypad-setup) "keypad" "emulation/keypad.el"
-;;;;;;  (19277 34919))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from emulation/keypad.el
 
 (defvar keypad-setup nil "\
@@ -15462,7 +15468,7 @@
 ;;;***
 
 ;;;### (autoloads (kinsoku) "kinsoku" "international/kinsoku.el"
-;;;;;;  (19277 34920))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from international/kinsoku.el
 
 (autoload 'kinsoku "kinsoku" "\
@@ -15483,8 +15489,8 @@
 
 ;;;***
 
-;;;### (autoloads (kkc-region) "kkc" "international/kkc.el" (19277
-;;;;;;  34920))
+;;;### (autoloads (kkc-region) "kkc" "international/kkc.el" (19279
+;;;;;;  5150))
 ;;; Generated autoloads from international/kkc.el
 
 (defvar kkc-after-update-conversion-functions nil "\
@@ -15509,7 +15515,7 @@
 ;;;### (autoloads (kmacro-end-call-mouse kmacro-end-and-call-macro
 ;;;;;;  kmacro-end-or-call-macro kmacro-start-macro-or-insert-counter
 ;;;;;;  kmacro-call-macro kmacro-end-macro kmacro-start-macro kmacro-exec-ring-item)
-;;;;;;  "kmacro" "kmacro.el" (19277 34916))
+;;;;;;  "kmacro" "kmacro.el" (19279 5148))
 ;;; Generated autoloads from kmacro.el
  (global-set-key "\C-x(" 'kmacro-start-macro)
  (global-set-key "\C-x)" 'kmacro-end-macro)
@@ -15620,7 +15626,7 @@
 ;;;***
 
 ;;;### (autoloads (setup-korean-environment-internal) "korea-util"
-;;;;;;  "language/korea-util.el" (19277 34920))
+;;;;;;  "language/korea-util.el" (19279 5150))
 ;;; Generated autoloads from language/korea-util.el
 
 (defvar default-korean-keyboard (purecopy (if (string-match "3" (or (getenv "HANGUL_KEYBOARD_TYPE") "")) "3" "")) "\
@@ -15635,7 +15641,7 @@
 ;;;***
 
 ;;;### (autoloads (lm lm-test-run) "landmark" "play/landmark.el"
-;;;;;;  (19277 34922))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from play/landmark.el
 
 (defalias 'landmark-repeat 'lm-test-run)
@@ -15669,7 +15675,7 @@
 
 ;;;### (autoloads (lao-compose-region lao-composition-function lao-transcribe-roman-to-lao-string
 ;;;;;;  lao-transcribe-single-roman-syllable-to-lao lao-compose-string)
-;;;;;;  "lao-util" "language/lao-util.el" (19277 34920))
+;;;;;;  "lao-util" "language/lao-util.el" (19279 5150))
 ;;; Generated autoloads from language/lao-util.el
 
 (autoload 'lao-compose-string "lao-util" "\
@@ -15708,7 +15714,7 @@
 
 ;;;### (autoloads (latexenc-find-file-coding-system latexenc-coding-system-to-inputenc
 ;;;;;;  latexenc-inputenc-to-coding-system latex-inputenc-coding-alist)
-;;;;;;  "latexenc" "international/latexenc.el" (19277 34920))
+;;;;;;  "latexenc" "international/latexenc.el" (19279 5150))
 ;;; Generated autoloads from international/latexenc.el
 
 (defvar latex-inputenc-coding-alist (purecopy '(("ansinew" . windows-1252) ("applemac" . mac-roman) ("ascii" . us-ascii) ("cp1250" . windows-1250) ("cp1252" . windows-1252) ("cp1257" . cp1257) ("cp437de" . cp437) ("cp437" . cp437) ("cp850" . cp850) ("cp852" . cp852) ("cp858" . cp858) ("cp865" . cp865) ("latin1" . iso-8859-1) ("latin2" . iso-8859-2) ("latin3" . iso-8859-3) ("latin4" . iso-8859-4) ("latin5" . iso-8859-5) ("latin9" . iso-8859-15) ("next" . next) ("utf8" . utf-8) ("utf8x" . utf-8))) "\
@@ -15740,7 +15746,7 @@
 ;;;***
 
 ;;;### (autoloads (latin1-display-ucs-per-lynx latin1-display latin1-display)
-;;;;;;  "latin1-disp" "international/latin1-disp.el" (19277 34920))
+;;;;;;  "latin1-disp" "international/latin1-disp.el" (19279 5150))
 ;;; Generated autoloads from international/latin1-disp.el
 
 (defvar latin1-display nil "\
@@ -15782,7 +15788,7 @@
 ;;;***
 
 ;;;### (autoloads (ld-script-mode) "ld-script" "progmodes/ld-script.el"
-;;;;;;  (19277 34922))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from progmodes/ld-script.el
 
 (add-to-list 'auto-mode-alist (purecopy '("\\.ld[si]?\\>" . ld-script-mode)))
@@ -15799,7 +15805,7 @@
 ;;;***
 
 ;;;### (autoloads (ledit-from-lisp-mode ledit-mode) "ledit" "ledit.el"
-;;;;;;  (19277 34916))
+;;;;;;  (19279 5148))
 ;;; Generated autoloads from ledit.el
 
 (defconst ledit-save-files t "\
@@ -15834,7 +15840,7 @@
 
 ;;;***
 
-;;;### (autoloads (life) "life" "play/life.el" (19277 34922))
+;;;### (autoloads (life) "life" "play/life.el" (19279 5151))
 ;;; Generated autoloads from play/life.el
 
 (autoload 'life "life" "\
@@ -15848,7 +15854,7 @@
 ;;;***
 
 ;;;### (autoloads (global-linum-mode linum-mode linum-format) "linum"
-;;;;;;  "linum.el" (19277 34916))
+;;;;;;  "linum.el" (19279 5148))
 ;;; Generated autoloads from linum.el
 
 (defvar linum-format 'dynamic "\
@@ -15886,8 +15892,8 @@
 
 ;;;***
 
-;;;### (autoloads (unload-feature) "loadhist" "loadhist.el" (19277
-;;;;;;  34916))
+;;;### (autoloads (unload-feature) "loadhist" "loadhist.el" (19279
+;;;;;;  5148))
 ;;; Generated autoloads from loadhist.el
 
 (autoload 'unload-feature "loadhist" "\
@@ -15919,7 +15925,7 @@
 ;;;***
 
 ;;;### (autoloads (locate-with-filter locate locate-ls-subdir-switches)
-;;;;;;  "locate" "locate.el" (19277 34916))
+;;;;;;  "locate" "locate.el" (19279 5148))
 ;;; Generated autoloads from locate.el
 
 (defvar locate-ls-subdir-switches (purecopy "-al") "\
@@ -15970,12 +15976,13 @@
 
 ;;;***
 
-;;;### (autoloads (log-edit) "log-edit" "log-edit.el" (19354 34807))
+;;;### (autoloads (log-edit) "log-edit" "log-edit.el" (19370 36540))
 ;;; Generated autoloads from log-edit.el
 
 (autoload 'log-edit "log-edit" "\
 Setup a buffer to enter a log message.
-\\<log-edit-mode-map>The buffer will be put in `log-edit-mode'.
+\\<log-edit-mode-map>The buffer will be put in mode MODE or `log-edit-mode'
+if MODE is nil.
 If SETUP is non-nil, the buffer is then erased and `log-edit-hook' is run.
 Mark and point will be set around the entire contents of the buffer so
 that it is easy to kill the contents of the buffer with \\[kill-region].
@@ -15992,12 +15999,12 @@
 log message and go back to the current buffer when done.  Otherwise, it
 uses the current buffer.
 
-\(fn CALLBACK &optional SETUP PARAMS BUFFER &rest IGNORE)" nil nil)
-
-;;;***
-
-;;;### (autoloads (log-view-mode) "log-view" "log-view.el" (19360
-;;;;;;  14173))
+\(fn CALLBACK &optional SETUP PARAMS BUFFER MODE &rest IGNORE)" nil nil)
+
+;;;***
+
+;;;### (autoloads (log-view-mode) "log-view" "log-view.el" (19358
+;;;;;;  54001))
 ;;; Generated autoloads from log-view.el
 
 (autoload 'log-view-mode "log-view" "\
@@ -16007,8 +16014,8 @@
 
 ;;;***
 
-;;;### (autoloads (longlines-mode) "longlines" "longlines.el" (19277
-;;;;;;  34916))
+;;;### (autoloads (longlines-mode) "longlines" "longlines.el" (19279
+;;;;;;  5148))
 ;;; Generated autoloads from longlines.el
 
 (autoload 'longlines-mode "longlines" "\
@@ -16029,8 +16036,8 @@
 ;;;***
 
 ;;;### (autoloads (print-region lpr-region print-buffer lpr-buffer
-;;;;;;  lpr-command lpr-switches printer-name) "lpr" "lpr.el" (19277
-;;;;;;  34916))
+;;;;;;  lpr-command lpr-switches printer-name) "lpr" "lpr.el" (19279
+;;;;;;  5148))
 ;;; Generated autoloads from lpr.el
 
 (defvar lpr-windows-system (memq system-type '(ms-dos windows-nt)))
@@ -16124,7 +16131,7 @@
 ;;;***
 
 ;;;### (autoloads (ls-lisp-support-shell-wildcards) "ls-lisp" "ls-lisp.el"
-;;;;;;  (19315 24485))
+;;;;;;  (19321 4517))
 ;;; Generated autoloads from ls-lisp.el
 
 (defvar ls-lisp-support-shell-wildcards t "\
@@ -16135,8 +16142,8 @@
 
 ;;;***
 
-;;;### (autoloads (lunar-phases) "lunar" "calendar/lunar.el" (19277
-;;;;;;  34918))
+;;;### (autoloads (lunar-phases) "lunar" "calendar/lunar.el" (19279
+;;;;;;  5149))
 ;;; Generated autoloads from calendar/lunar.el
 
 (autoload 'lunar-phases "lunar" "\
@@ -16150,8 +16157,8 @@
 
 ;;;***
 
-;;;### (autoloads (m4-mode) "m4-mode" "progmodes/m4-mode.el" (19277
-;;;;;;  34922))
+;;;### (autoloads (m4-mode) "m4-mode" "progmodes/m4-mode.el" (19279
+;;;;;;  5151))
 ;;; Generated autoloads from progmodes/m4-mode.el
 
 (autoload 'm4-mode "m4-mode" "\
@@ -16163,7 +16170,7 @@
 ;;;***
 
 ;;;### (autoloads (macroexpand-all) "macroexp" "emacs-lisp/macroexp.el"
-;;;;;;  (19277 34919))
+;;;;;;  (19279 5149))
 ;;; Generated autoloads from emacs-lisp/macroexp.el
 
 (autoload 'macroexpand-all "macroexp" "\
@@ -16177,7 +16184,7 @@
 ;;;***
 
 ;;;### (autoloads (apply-macro-to-region-lines kbd-macro-query insert-kbd-macro
-;;;;;;  name-last-kbd-macro) "macros" "macros.el" (19344 29797))
+;;;;;;  name-last-kbd-macro) "macros" "macros.el" (19345 41626))
 ;;; Generated autoloads from macros.el
 
 (autoload 'name-last-kbd-macro "macros" "\
@@ -16266,7 +16273,7 @@
 ;;;***
 
 ;;;### (autoloads (what-domain mail-extract-address-components) "mail-extr"
-;;;;;;  "mail/mail-extr.el" (19277 34921))
+;;;;;;  "mail/mail-extr.el" (19279 5150))
 ;;; Generated autoloads from mail/mail-extr.el
 
 (autoload 'mail-extract-address-components "mail-extr" "\
@@ -16298,7 +16305,7 @@
 
 ;;;### (autoloads (mail-hist-put-headers-into-history mail-hist-keep-history
 ;;;;;;  mail-hist-enable mail-hist-define-keys) "mail-hist" "mail/mail-hist.el"
-;;;;;;  (19277 34921))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from mail/mail-hist.el
 
 (autoload 'mail-hist-define-keys "mail-hist" "\
@@ -16330,7 +16337,7 @@
 ;;;### (autoloads (mail-fetch-field mail-unquote-printable-region
 ;;;;;;  mail-unquote-printable mail-quote-printable-region mail-quote-printable
 ;;;;;;  mail-file-babyl-p mail-use-rfc822) "mail-utils" "mail/mail-utils.el"
-;;;;;;  (19306 22782))
+;;;;;;  (19313 15414))
 ;;; Generated autoloads from mail/mail-utils.el
 
 (defvar mail-use-rfc822 nil "\
@@ -16392,8 +16399,8 @@
 ;;;***
 
 ;;;### (autoloads (define-mail-abbrev build-mail-abbrevs mail-abbrevs-setup
-;;;;;;  mail-abbrevs-mode) "mailabbrev" "mail/mailabbrev.el" (19277
-;;;;;;  34921))
+;;;;;;  mail-abbrevs-mode) "mailabbrev" "mail/mailabbrev.el" (19279
+;;;;;;  5150))
 ;;; Generated autoloads from mail/mailabbrev.el
 
 (defvar mail-abbrevs-mode nil "\
@@ -16435,8 +16442,8 @@
 ;;;***
 
 ;;;### (autoloads (mail-complete define-mail-alias expand-mail-aliases
-;;;;;;  mail-complete-style) "mailalias" "mail/mailalias.el" (19277
-;;;;;;  34921))
+;;;;;;  mail-complete-style) "mailalias" "mail/mailalias.el" (19279
+;;;;;;  5150))
 ;;; Generated autoloads from mail/mailalias.el
 
 (defvar mail-complete-style 'angles "\
@@ -16482,7 +16489,7 @@
 ;;;***
 
 ;;;### (autoloads (mailclient-send-it) "mailclient" "mail/mailclient.el"
-;;;;;;  (19277 34921))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from mail/mailclient.el
 
 (autoload 'mailclient-send-it "mailclient" "\
@@ -16496,7 +16503,7 @@
 
 ;;;### (autoloads (makefile-imake-mode makefile-bsdmake-mode makefile-makepp-mode
 ;;;;;;  makefile-gmake-mode makefile-automake-mode makefile-mode)
-;;;;;;  "make-mode" "progmodes/make-mode.el" (19277 34922))
+;;;;;;  "make-mode" "progmodes/make-mode.el" (19372 27330))
 ;;; Generated autoloads from progmodes/make-mode.el
 
 (autoload 'makefile-mode "make-mode" "\
@@ -16613,8 +16620,8 @@
 
 ;;;***
 
-;;;### (autoloads (make-command-summary) "makesum" "makesum.el" (19277
-;;;;;;  34916))
+;;;### (autoloads (make-command-summary) "makesum" "makesum.el" (19279
+;;;;;;  5148))
 ;;; Generated autoloads from makesum.el
 
 (autoload 'make-command-summary "makesum" "\
@@ -16625,7 +16632,7 @@
 
 ;;;***
 
-;;;### (autoloads (man-follow man) "man" "man.el" (19345 51357))
+;;;### (autoloads (man-follow man) "man" "man.el" (19345 41626))
 ;;; Generated autoloads from man.el
 
 (defalias 'manual-entry 'man)
@@ -16674,7 +16681,7 @@
 
 ;;;***
 
-;;;### (autoloads (master-mode) "master" "master.el" (19277 34916))
+;;;### (autoloads (master-mode) "master" "master.el" (19279 5148))
 ;;; Generated autoloads from master.el
 
 (autoload 'master-mode "master" "\
@@ -16697,7 +16704,7 @@
 ;;;***
 
 ;;;### (autoloads (minibuffer-depth-indicate-mode) "mb-depth" "mb-depth.el"
-;;;;;;  (19277 34916))
+;;;;;;  (19279 5148))
 ;;; Generated autoloads from mb-depth.el
 
 (defvar minibuffer-depth-indicate-mode nil "\
@@ -16728,7 +16735,7 @@
 ;;;;;;  message-forward-make-body message-forward message-recover
 ;;;;;;  message-supersede message-cancel-news message-followup message-wide-reply
 ;;;;;;  message-reply message-news message-mail message-mode) "message"
-;;;;;;  "gnus/message.el" (19362 59593))
+;;;;;;  "gnus/message.el" (19370 36541))
 ;;; Generated autoloads from gnus/message.el
 
 (define-mail-user-agent 'message-user-agent 'message-mail 'message-send-and-exit 'message-kill-buffer 'message-send-hook)
@@ -16894,7 +16901,7 @@
 ;;;***
 
 ;;;### (autoloads (metapost-mode metafont-mode) "meta-mode" "progmodes/meta-mode.el"
-;;;;;;  (19277 34922))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from progmodes/meta-mode.el
 
 (autoload 'metafont-mode "meta-mode" "\
@@ -16921,7 +16928,7 @@
 
 ;;;### (autoloads (metamail-region metamail-buffer metamail-interpret-body
 ;;;;;;  metamail-interpret-header) "metamail" "mail/metamail.el"
-;;;;;;  (19354 34807))
+;;;;;;  (19356 10801))
 ;;; Generated autoloads from mail/metamail.el
 
 (autoload 'metamail-interpret-header "metamail" "\
@@ -16966,7 +16973,7 @@
 
 ;;;### (autoloads (mh-fully-kill-draft mh-send-letter mh-user-agent-compose
 ;;;;;;  mh-smail-batch mh-smail-other-window mh-smail) "mh-comp"
-;;;;;;  "mh-e/mh-comp.el" (19277 34921))
+;;;;;;  "mh-e/mh-comp.el" (19279 5150))
 ;;; Generated autoloads from mh-e/mh-comp.el
 
 (autoload 'mh-smail "mh-comp" "\
@@ -17056,7 +17063,7 @@
 
 ;;;***
 
-;;;### (autoloads (mh-version) "mh-e" "mh-e/mh-e.el" (19277 34921))
+;;;### (autoloads (mh-version) "mh-e" "mh-e/mh-e.el" (19279 5150))
 ;;; Generated autoloads from mh-e/mh-e.el
 
 (put 'mh-progs 'risky-local-variable t)
@@ -17073,7 +17080,7 @@
 ;;;***
 
 ;;;### (autoloads (mh-folder-mode mh-nmail mh-rmail) "mh-folder"
-;;;;;;  "mh-e/mh-folder.el" (19277 34921))
+;;;;;;  "mh-e/mh-folder.el" (19279 5150))
 ;;; Generated autoloads from mh-e/mh-folder.el
 
 (autoload 'mh-rmail "mh-folder" "\
@@ -17155,7 +17162,7 @@
 ;;;***
 
 ;;;### (autoloads (midnight-delay-set clean-buffer-list) "midnight"
-;;;;;;  "midnight.el" (19277 34917))
+;;;;;;  "midnight.el" (19369 15960))
 ;;; Generated autoloads from midnight.el
 
 (autoload 'clean-buffer-list "midnight" "\
@@ -17182,7 +17189,7 @@
 ;;;***
 
 ;;;### (autoloads (minibuffer-electric-default-mode) "minibuf-eldef"
-;;;;;;  "minibuf-eldef.el" (19277 34917))
+;;;;;;  "minibuf-eldef.el" (19279 5148))
 ;;; Generated autoloads from minibuf-eldef.el
 
 (defvar minibuffer-electric-default-mode nil "\
@@ -17209,7 +17216,7 @@
 
 ;;;***
 
-;;;### (autoloads (butterfly) "misc" "misc.el" (19277 34917))
+;;;### (autoloads (butterfly) "misc" "misc.el" (19279 5148))
 ;;; Generated autoloads from misc.el
 
 (autoload 'butterfly "misc" "\
@@ -17228,7 +17235,7 @@
 
 ;;;### (autoloads (multi-isearch-files-regexp multi-isearch-files
 ;;;;;;  multi-isearch-buffers-regexp multi-isearch-buffers multi-isearch-setup)
-;;;;;;  "misearch" "misearch.el" (19277 34917))
+;;;;;;  "misearch" "misearch.el" (19279 5148))
 ;;; Generated autoloads from misearch.el
  (add-hook 'isearch-mode-hook 'multi-isearch-setup)
 
@@ -17310,7 +17317,7 @@
 ;;;***
 
 ;;;### (autoloads (mixal-mode) "mixal-mode" "progmodes/mixal-mode.el"
-;;;;;;  (19360 14173))
+;;;;;;  (19358 54001))
 ;;; Generated autoloads from progmodes/mixal-mode.el
 
 (autoload 'mixal-mode "mixal-mode" "\
@@ -17324,7 +17331,7 @@
 ;;;***
 
 ;;;### (autoloads (mm-inline-external-body mm-extern-cache-contents)
-;;;;;;  "mm-extern" "gnus/mm-extern.el" (19277 34920))
+;;;;;;  "mm-extern" "gnus/mm-extern.el" (19279 5150))
 ;;; Generated autoloads from gnus/mm-extern.el
 
 (autoload 'mm-extern-cache-contents "mm-extern" "\
@@ -17343,7 +17350,7 @@
 ;;;***
 
 ;;;### (autoloads (mm-inline-partial) "mm-partial" "gnus/mm-partial.el"
-;;;;;;  (19277 34920))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from gnus/mm-partial.el
 
 (autoload 'mm-inline-partial "mm-partial" "\
@@ -17357,7 +17364,7 @@
 ;;;***
 
 ;;;### (autoloads (mm-url-insert-file-contents-external mm-url-insert-file-contents)
-;;;;;;  "mm-url" "gnus/mm-url.el" (19277 34920))
+;;;;;;  "mm-url" "gnus/mm-url.el" (19279 5150))
 ;;; Generated autoloads from gnus/mm-url.el
 
 (autoload 'mm-url-insert-file-contents "mm-url" "\
@@ -17374,7 +17381,7 @@
 ;;;***
 
 ;;;### (autoloads (mm-uu-dissect-text-parts mm-uu-dissect) "mm-uu"
-;;;;;;  "gnus/mm-uu.el" (19277 34920))
+;;;;;;  "gnus/mm-uu.el" (19279 5150))
 ;;; Generated autoloads from gnus/mm-uu.el
 
 (autoload 'mm-uu-dissect "mm-uu" "\
@@ -17394,7 +17401,7 @@
 ;;;***
 
 ;;;### (autoloads (mml1991-sign mml1991-encrypt) "mml1991" "gnus/mml1991.el"
-;;;;;;  (19362 59593))
+;;;;;;  (19365 25156))
 ;;; Generated autoloads from gnus/mml1991.el
 
 (autoload 'mml1991-encrypt "mml1991" "\
@@ -17411,7 +17418,7 @@
 
 ;;;### (autoloads (mml2015-self-encrypt mml2015-sign mml2015-encrypt
 ;;;;;;  mml2015-verify-test mml2015-verify mml2015-decrypt-test mml2015-decrypt)
-;;;;;;  "mml2015" "gnus/mml2015.el" (19362 59593))
+;;;;;;  "mml2015" "gnus/mml2015.el" (19365 25156))
 ;;; Generated autoloads from gnus/mml2015.el
 
 (autoload 'mml2015-decrypt "mml2015" "\
@@ -17452,7 +17459,7 @@
 ;;;***
 
 ;;;### (autoloads (modula-2-mode) "modula2" "progmodes/modula2.el"
-;;;;;;  (19267 61659))
+;;;;;;  (19256 49603))
 ;;; Generated autoloads from progmodes/modula2.el
 
 (autoload 'modula-2-mode "modula2" "\
@@ -17484,7 +17491,7 @@
 ;;;***
 
 ;;;### (autoloads (unmorse-region morse-region) "morse" "play/morse.el"
-;;;;;;  (19277 34922))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from play/morse.el
 
 (autoload 'morse-region "morse" "\
@@ -17500,7 +17507,7 @@
 ;;;***
 
 ;;;### (autoloads (mouse-drag-drag mouse-drag-throw) "mouse-drag"
-;;;;;;  "mouse-drag.el" (19277 34917))
+;;;;;;  "mouse-drag.el" (19279 5148))
 ;;; Generated autoloads from mouse-drag.el
 
 (autoload 'mouse-drag-throw "mouse-drag" "\
@@ -17547,8 +17554,8 @@
 
 ;;;***
 
-;;;### (autoloads (mouse-sel-mode) "mouse-sel" "mouse-sel.el" (19277
-;;;;;;  34917))
+;;;### (autoloads (mouse-sel-mode) "mouse-sel" "mouse-sel.el" (19279
+;;;;;;  5148))
 ;;; Generated autoloads from mouse-sel.el
 
 (defvar mouse-sel-mode nil "\
@@ -17600,7 +17607,7 @@
 
 ;;;***
 
-;;;### (autoloads (mpc) "mpc" "mpc.el" (19277 34917))
+;;;### (autoloads (mpc) "mpc" "mpc.el" (19372 27330))
 ;;; Generated autoloads from mpc.el
 
 (autoload 'mpc "mpc" "\
@@ -17610,7 +17617,7 @@
 
 ;;;***
 
-;;;### (autoloads (mpuz) "mpuz" "play/mpuz.el" (19277 34922))
+;;;### (autoloads (mpuz) "mpuz" "play/mpuz.el" (19279 5151))
 ;;; Generated autoloads from play/mpuz.el
 
 (autoload 'mpuz "mpuz" "\
@@ -17620,7 +17627,7 @@
 
 ;;;***
 
-;;;### (autoloads (msb-mode) "msb" "msb.el" (19277 34917))
+;;;### (autoloads (msb-mode) "msb" "msb.el" (19279 5148))
 ;;; Generated autoloads from msb.el
 
 (defvar msb-mode nil "\
@@ -17647,7 +17654,7 @@
 ;;;;;;  describe-current-coding-system describe-current-coding-system-briefly
 ;;;;;;  describe-coding-system describe-character-set list-charset-chars
 ;;;;;;  read-charset list-character-sets) "mule-diag" "international/mule-diag.el"
-;;;;;;  (19277 34920))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from international/mule-diag.el
 
 (autoload 'list-character-sets "mule-diag" "\
@@ -17784,7 +17791,7 @@
 ;;;;;;  coding-system-translation-table-for-decode coding-system-pre-write-conversion
 ;;;;;;  coding-system-post-read-conversion lookup-nested-alist set-nested-alist
 ;;;;;;  truncate-string-to-width store-substring string-to-sequence)
-;;;;;;  "mule-util" "international/mule-util.el" (19312 33528))
+;;;;;;  "mule-util" "international/mule-util.el" (19313 15414))
 ;;; Generated autoloads from international/mule-util.el
 
 (autoload 'string-to-sequence "mule-util" "\
@@ -17924,8 +17931,8 @@
 ;;;### (autoloads (network-connection network-connection-to-service
 ;;;;;;  whois-reverse-lookup whois finger ftp run-dig dns-lookup-host
 ;;;;;;  nslookup nslookup-host ping traceroute route arp netstat
-;;;;;;  iwconfig ifconfig) "net-utils" "net/net-utils.el" (19277
-;;;;;;  34921))
+;;;;;;  iwconfig ifconfig) "net-utils" "net/net-utils.el" (19279
+;;;;;;  5151))
 ;;; Generated autoloads from net/net-utils.el
 
 (autoload 'ifconfig "net-utils" "\
@@ -18024,7 +18031,7 @@
 ;;;;;;  uncomment-region comment-kill comment-set-column comment-indent
 ;;;;;;  comment-indent-default comment-normalize-vars comment-multi-line
 ;;;;;;  comment-padding comment-style comment-column) "newcomment"
-;;;;;;  "newcomment.el" (19277 34917))
+;;;;;;  "newcomment.el" (19279 5148))
 ;;; Generated autoloads from newcomment.el
 
 (defalias 'indent-for-comment 'comment-indent)
@@ -18224,7 +18231,7 @@
 ;;;***
 
 ;;;### (autoloads (newsticker-start newsticker-running-p) "newst-backend"
-;;;;;;  "net/newst-backend.el" (19277 34921))
+;;;;;;  "net/newst-backend.el" (19279 5151))
 ;;; Generated autoloads from net/newst-backend.el
 
 (autoload 'newsticker-running-p "newst-backend" "\
@@ -18246,7 +18253,7 @@
 ;;;***
 
 ;;;### (autoloads (newsticker-plainview) "newst-plainview" "net/newst-plainview.el"
-;;;;;;  (19277 34921))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from net/newst-plainview.el
 
 (autoload 'newsticker-plainview "newst-plainview" "\
@@ -18257,7 +18264,7 @@
 ;;;***
 
 ;;;### (autoloads (newsticker-show-news) "newst-reader" "net/newst-reader.el"
-;;;;;;  (19277 34921))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from net/newst-reader.el
 
 (autoload 'newsticker-show-news "newst-reader" "\
@@ -18268,7 +18275,7 @@
 ;;;***
 
 ;;;### (autoloads (newsticker-start-ticker newsticker-ticker-running-p)
-;;;;;;  "newst-ticker" "net/newst-ticker.el" (19277 34921))
+;;;;;;  "newst-ticker" "net/newst-ticker.el" (19279 5151))
 ;;; Generated autoloads from net/newst-ticker.el
 
 (autoload 'newsticker-ticker-running-p "newst-ticker" "\
@@ -18289,7 +18296,7 @@
 ;;;***
 
 ;;;### (autoloads (newsticker-treeview) "newst-treeview" "net/newst-treeview.el"
-;;;;;;  (19277 34921))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from net/newst-treeview.el
 
 (autoload 'newsticker-treeview "newst-treeview" "\
@@ -18300,7 +18307,7 @@
 ;;;***
 
 ;;;### (autoloads (nndiary-generate-nov-databases) "nndiary" "gnus/nndiary.el"
-;;;;;;  (19279 53114))
+;;;;;;  (19279 38446))
 ;;; Generated autoloads from gnus/nndiary.el
 
 (autoload 'nndiary-generate-nov-databases "nndiary" "\
@@ -18310,8 +18317,8 @@
 
 ;;;***
 
-;;;### (autoloads (nndoc-add-type) "nndoc" "gnus/nndoc.el" (19277
-;;;;;;  34920))
+;;;### (autoloads (nndoc-add-type) "nndoc" "gnus/nndoc.el" (19279
+;;;;;;  5150))
 ;;; Generated autoloads from gnus/nndoc.el
 
 (autoload 'nndoc-add-type "nndoc" "\
@@ -18326,7 +18333,7 @@
 ;;;***
 
 ;;;### (autoloads (nnfolder-generate-active-file) "nnfolder" "gnus/nnfolder.el"
-;;;;;;  (19277 34920))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from gnus/nnfolder.el
 
 (autoload 'nnfolder-generate-active-file "nnfolder" "\
@@ -18338,7 +18345,7 @@
 ;;;***
 
 ;;;### (autoloads (nnkiboze-generate-groups) "nnkiboze" "gnus/nnkiboze.el"
-;;;;;;  (19277 34920))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from gnus/nnkiboze.el
 
 (autoload 'nnkiboze-generate-groups "nnkiboze" "\
@@ -18350,7 +18357,7 @@
 ;;;***
 
 ;;;### (autoloads (nnml-generate-nov-databases) "nnml" "gnus/nnml.el"
-;;;;;;  (19279 53114))
+;;;;;;  (19279 38446))
 ;;; Generated autoloads from gnus/nnml.el
 
 (autoload 'nnml-generate-nov-databases "nnml" "\
@@ -18361,7 +18368,7 @@
 ;;;***
 
 ;;;### (autoloads (nnsoup-revert-variables nnsoup-set-variables nnsoup-pack-replies)
-;;;;;;  "nnsoup" "gnus/nnsoup.el" (19277 34920))
+;;;;;;  "nnsoup" "gnus/nnsoup.el" (19279 5150))
 ;;; Generated autoloads from gnus/nnsoup.el
 
 (autoload 'nnsoup-pack-replies "nnsoup" "\
@@ -18382,7 +18389,7 @@
 ;;;***
 
 ;;;### (autoloads (disable-command enable-command disabled-command-function)
-;;;;;;  "novice" "novice.el" (19277 34917))
+;;;;;;  "novice" "novice.el" (19279 5148))
 ;;; Generated autoloads from novice.el
 
 (defvar disabled-command-function 'disabled-command-function "\
@@ -18415,7 +18422,7 @@
 ;;;***
 
 ;;;### (autoloads (nroff-mode) "nroff-mode" "textmodes/nroff-mode.el"
-;;;;;;  (19277 34923))
+;;;;;;  (19279 5152))
 ;;; Generated autoloads from textmodes/nroff-mode.el
 
 (autoload 'nroff-mode "nroff-mode" "\
@@ -18430,7 +18437,7 @@
 ;;;***
 
 ;;;### (autoloads (nxml-glyph-display-string) "nxml-glyph" "nxml/nxml-glyph.el"
-;;;;;;  (19277 34921))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from nxml/nxml-glyph.el
 
 (autoload 'nxml-glyph-display-string "nxml-glyph" "\
@@ -18442,8 +18449,8 @@
 
 ;;;***
 
-;;;### (autoloads (nxml-mode) "nxml-mode" "nxml/nxml-mode.el" (19354
-;;;;;;  34807))
+;;;### (autoloads (nxml-mode) "nxml-mode" "nxml/nxml-mode.el" (19356
+;;;;;;  10801))
 ;;; Generated autoloads from nxml/nxml-mode.el
 
 (autoload 'nxml-mode "nxml-mode" "\
@@ -18505,7 +18512,7 @@
 ;;;***
 
 ;;;### (autoloads (nxml-enable-unicode-char-name-sets) "nxml-uchnm"
-;;;;;;  "nxml/nxml-uchnm.el" (19277 34921))
+;;;;;;  "nxml/nxml-uchnm.el" (19279 5151))
 ;;; Generated autoloads from nxml/nxml-uchnm.el
 
 (autoload 'nxml-enable-unicode-char-name-sets "nxml-uchnm" "\
@@ -18518,7 +18525,7 @@
 ;;;***
 
 ;;;### (autoloads (inferior-octave) "octave-inf" "progmodes/octave-inf.el"
-;;;;;;  (19277 34922))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from progmodes/octave-inf.el
 
 (autoload 'inferior-octave "octave-inf" "\
@@ -18541,7 +18548,7 @@
 ;;;***
 
 ;;;### (autoloads (octave-mode) "octave-mod" "progmodes/octave-mod.el"
-;;;;;;  (19277 34922))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from progmodes/octave-mod.el
 
 (autoload 'octave-mode "octave-mod" "\
@@ -18636,7 +18643,7 @@
 ;;;;;;  org-map-entries org-open-link-from-string org-open-at-point-global
 ;;;;;;  org-insert-link-global org-store-link org-run-like-in-org-mode
 ;;;;;;  turn-on-orgstruct++ turn-on-orgstruct orgstruct-mode org-global-cycle
-;;;;;;  org-mode) "org" "org/org.el" (19354 34807))
+;;;;;;  org-mode) "org" "org/org.el" (19356 10801))
 ;;; Generated autoloads from org/org.el
 
 (autoload 'org-mode "org" "\
@@ -18849,7 +18856,7 @@
 ;;;;;;  org-diary org-agenda-list-stuck-projects org-tags-view org-todo-list
 ;;;;;;  org-search-view org-agenda-list org-batch-store-agenda-views
 ;;;;;;  org-store-agenda-views org-batch-agenda-csv org-batch-agenda
-;;;;;;  org-agenda) "org-agenda" "org/org-agenda.el" (19277 34922))
+;;;;;;  org-agenda) "org-agenda" "org/org-agenda.el" (19279 5151))
 ;;; Generated autoloads from org/org-agenda.el
 
 (autoload 'org-agenda "org-agenda" "\
@@ -19112,7 +19119,7 @@
 
 ;;;### (autoloads (org-archive-subtree-default-with-confirmation
 ;;;;;;  org-archive-subtree-default) "org-archive" "org/org-archive.el"
-;;;;;;  (19277 34922))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from org/org-archive.el
 
 (autoload 'org-archive-subtree-default "org-archive" "\
@@ -19131,7 +19138,7 @@
 
 ;;;### (autoloads (org-export-as-ascii org-export-region-as-ascii
 ;;;;;;  org-replace-region-by-ascii org-export-as-ascii-to-buffer)
-;;;;;;  "org-ascii" "org/org-ascii.el" (19277 34922))
+;;;;;;  "org-ascii" "org/org-ascii.el" (19279 5151))
 ;;; Generated autoloads from org/org-ascii.el
 
 (autoload 'org-export-as-ascii-to-buffer "org-ascii" "\
@@ -19184,8 +19191,8 @@
 
 ;;;***
 
-;;;### (autoloads (org-attach) "org-attach" "org/org-attach.el" (19277
-;;;;;;  34922))
+;;;### (autoloads (org-attach) "org-attach" "org/org-attach.el" (19279
+;;;;;;  5151))
 ;;; Generated autoloads from org/org-attach.el
 
 (autoload 'org-attach "org-attach" "\
@@ -19197,7 +19204,7 @@
 ;;;***
 
 ;;;### (autoloads (org-bbdb-anniversaries) "org-bbdb" "org/org-bbdb.el"
-;;;;;;  (19277 34922))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from org/org-bbdb.el
 
 (autoload 'org-bbdb-anniversaries "org-bbdb" "\
@@ -19208,7 +19215,7 @@
 ;;;***
 
 ;;;### (autoloads (org-clock-persistence-insinuate org-get-clocktable)
-;;;;;;  "org-clock" "org/org-clock.el" (19277 34922))
+;;;;;;  "org-clock" "org/org-clock.el" (19279 5151))
 ;;; Generated autoloads from org/org-clock.el
 
 (autoload 'org-get-clocktable "org-clock" "\
@@ -19228,7 +19235,7 @@
 ;;;### (autoloads (org-export-as-docbook org-export-as-docbook-pdf-and-open
 ;;;;;;  org-export-as-docbook-pdf org-export-region-as-docbook org-replace-region-by-docbook
 ;;;;;;  org-export-as-docbook-to-buffer org-export-as-docbook-batch)
-;;;;;;  "org-docbook" "org/org-docbook.el" (19277 34922))
+;;;;;;  "org-docbook" "org/org-docbook.el" (19279 5151))
 ;;; Generated autoloads from org/org-docbook.el
 
 (autoload 'org-export-as-docbook-batch "org-docbook" "\
@@ -19305,7 +19312,7 @@
 
 ;;;### (autoloads (org-insert-export-options-template org-export-as-org
 ;;;;;;  org-export-visible org-export) "org-exp" "org/org-exp.el"
-;;;;;;  (19277 34922))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from org/org-exp.el
 
 (autoload 'org-export "org-exp" "\
@@ -19362,8 +19369,8 @@
 ;;;***
 
 ;;;### (autoloads (org-feed-show-raw-feed org-feed-goto-inbox org-feed-update
-;;;;;;  org-feed-update-all) "org-feed" "org/org-feed.el" (19277
-;;;;;;  34922))
+;;;;;;  org-feed-update-all) "org-feed" "org/org-feed.el" (19279
+;;;;;;  5151))
 ;;; Generated autoloads from org/org-feed.el
 
 (autoload 'org-feed-update-all "org-feed" "\
@@ -19391,7 +19398,7 @@
 ;;;***
 
 ;;;### (autoloads (org-footnote-normalize org-footnote-action) "org-footnote"
-;;;;;;  "org/org-footnote.el" (19277 34922))
+;;;;;;  "org/org-footnote.el" (19279 5151))
 ;;; Generated autoloads from org/org-footnote.el
 
 (autoload 'org-footnote-action "org-footnote" "\
@@ -19418,7 +19425,7 @@
 ;;;### (autoloads (org-freemind-to-org-mode org-freemind-from-org-sparse-tree
 ;;;;;;  org-freemind-from-org-mode org-freemind-from-org-mode-node
 ;;;;;;  org-freemind-show org-export-as-freemind) "org-freemind"
-;;;;;;  "org/org-freemind.el" (19324 55756))
+;;;;;;  "org/org-freemind.el" (19323 49698))
 ;;; Generated autoloads from org/org-freemind.el
 
 (autoload 'org-export-as-freemind "org-freemind" "\
@@ -19456,7 +19463,7 @@
 ;;;### (autoloads (org-export-htmlize-generate-css org-export-as-html
 ;;;;;;  org-export-region-as-html org-replace-region-by-html org-export-as-html-to-buffer
 ;;;;;;  org-export-as-html-batch org-export-as-html-and-open) "org-html"
-;;;;;;  "org/org-html.el" (19277 34922))
+;;;;;;  "org/org-html.el" (19279 5151))
 ;;; Generated autoloads from org/org-html.el
 
 (put 'org-export-html-style-include-default 'safe-local-variable 'booleanp)
@@ -19549,7 +19556,7 @@
 
 ;;;### (autoloads (org-export-icalendar-combine-agenda-files org-export-icalendar-all-agenda-files
 ;;;;;;  org-export-icalendar-this-file) "org-icalendar" "org/org-icalendar.el"
-;;;;;;  (19277 34922))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from org/org-icalendar.el
 
 (autoload 'org-export-icalendar-this-file "org-icalendar" "\
@@ -19576,7 +19583,7 @@
 
 ;;;### (autoloads (org-id-find-id-file org-id-find org-id-goto org-id-get-with-outline-drilling
 ;;;;;;  org-id-get-with-outline-path-completion org-id-get org-id-copy
-;;;;;;  org-id-get-create) "org-id" "org/org-id.el" (19277 34922))
+;;;;;;  org-id-get-create) "org-id" "org/org-id.el" (19279 5151))
 ;;; Generated autoloads from org/org-id.el
 
 (autoload 'org-id-get-create "org-id" "\
@@ -19640,7 +19647,7 @@
 ;;;***
 
 ;;;### (autoloads (org-indent-mode) "org-indent" "org/org-indent.el"
-;;;;;;  (19277 34922))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from org/org-indent.el
 
 (autoload 'org-indent-mode "org-indent" "\
@@ -19655,7 +19662,7 @@
 ;;;***
 
 ;;;### (autoloads (org-irc-store-link) "org-irc" "org/org-irc.el"
-;;;;;;  (19277 34922))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from org/org-irc.el
 
 (autoload 'org-irc-store-link "org-irc" "\
@@ -19668,7 +19675,7 @@
 ;;;### (autoloads (org-export-as-pdf-and-open org-export-as-pdf org-export-as-latex
 ;;;;;;  org-export-region-as-latex org-replace-region-by-latex org-export-as-latex-to-buffer
 ;;;;;;  org-export-as-latex-batch) "org-latex" "org/org-latex.el"
-;;;;;;  (19277 34922))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from org/org-latex.el
 
 (autoload 'org-export-as-latex-batch "org-latex" "\
@@ -19748,8 +19755,8 @@
 ;;;***
 
 ;;;### (autoloads (org-mobile-create-sumo-agenda org-mobile-pull
-;;;;;;  org-mobile-push) "org-mobile" "org/org-mobile.el" (19277
-;;;;;;  34922))
+;;;;;;  org-mobile-push) "org-mobile" "org/org-mobile.el" (19279
+;;;;;;  5151))
 ;;; Generated autoloads from org/org-mobile.el
 
 (autoload 'org-mobile-push "org-mobile" "\
@@ -19774,7 +19781,7 @@
 ;;;***
 
 ;;;### (autoloads (org-plot/gnuplot) "org-plot" "org/org-plot.el"
-;;;;;;  (19277 34922))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from org/org-plot.el
 
 (autoload 'org-plot/gnuplot "org-plot" "\
@@ -19788,7 +19795,7 @@
 
 ;;;### (autoloads (org-publish-current-project org-publish-current-file
 ;;;;;;  org-publish-all org-publish) "org-publish" "org/org-publish.el"
-;;;;;;  (19277 34922))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from org/org-publish.el
 
 (defalias 'org-publish-project 'org-publish)
@@ -19822,7 +19829,7 @@
 
 ;;;### (autoloads (org-remember-handler org-remember org-remember-apply-template
 ;;;;;;  org-remember-annotation org-remember-insinuate) "org-remember"
-;;;;;;  "org/org-remember.el" (19277 34922))
+;;;;;;  "org/org-remember.el" (19279 5151))
 ;;; Generated autoloads from org/org-remember.el
 
 (autoload 'org-remember-insinuate "org-remember" "\
@@ -19897,7 +19904,7 @@
 ;;;***
 
 ;;;### (autoloads (org-table-to-lisp orgtbl-mode turn-on-orgtbl)
-;;;;;;  "org-table" "org/org-table.el" (19277 34922))
+;;;;;;  "org-table" "org/org-table.el" (19279 5151))
 ;;; Generated autoloads from org/org-table.el
 
 (autoload 'turn-on-orgtbl "org-table" "\
@@ -19922,7 +19929,7 @@
 
 ;;;### (autoloads (org-timer-set-timer org-timer-item org-timer-change-times-in-region
 ;;;;;;  org-timer org-timer-start) "org-timer" "org/org-timer.el"
-;;;;;;  (19277 34922))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from org/org-timer.el
 
 (autoload 'org-timer-start "org-timer" "\
@@ -19966,7 +19973,7 @@
 ;;;***
 
 ;;;### (autoloads (org-export-as-xoxo) "org-xoxo" "org/org-xoxo.el"
-;;;;;;  (19277 34922))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from org/org-xoxo.el
 
 (autoload 'org-export-as-xoxo "org-xoxo" "\
@@ -19978,7 +19985,7 @@
 ;;;***
 
 ;;;### (autoloads (outline-minor-mode outline-mode) "outline" "outline.el"
-;;;;;;  (19354 34807))
+;;;;;;  (19365 25156))
 ;;; Generated autoloads from outline.el
 (put 'outline-regexp 'safe-local-variable 'string-or-null-p)
 
@@ -20035,7 +20042,7 @@
 
 ;;;***
 
-;;;### (autoloads (show-paren-mode) "paren" "paren.el" (19277 34917))
+;;;### (autoloads (show-paren-mode) "paren" "paren.el" (19279 5148))
 ;;; Generated autoloads from paren.el
 
 (defvar show-paren-mode nil "\
@@ -20060,7 +20067,7 @@
 ;;;***
 
 ;;;### (autoloads (parse-time-string) "parse-time" "calendar/parse-time.el"
-;;;;;;  (19277 34918))
+;;;;;;  (19279 5149))
 ;;; Generated autoloads from calendar/parse-time.el
 (put 'parse-time-rules 'risky-local-variable t)
 
@@ -20073,8 +20080,8 @@
 
 ;;;***
 
-;;;### (autoloads (pascal-mode) "pascal" "progmodes/pascal.el" (19277
-;;;;;;  34922))
+;;;### (autoloads (pascal-mode) "pascal" "progmodes/pascal.el" (19279
+;;;;;;  5151))
 ;;; Generated autoloads from progmodes/pascal.el
 
 (autoload 'pascal-mode "pascal" "\
@@ -20127,7 +20134,7 @@
 ;;;***
 
 ;;;### (autoloads (password-cache-expiry password-cache) "password-cache"
-;;;;;;  "password-cache.el" (19362 59593))
+;;;;;;  "password-cache.el" (19365 25156))
 ;;; Generated autoloads from password-cache.el
 
 (defvar password-cache t "\
@@ -20144,7 +20151,7 @@
 ;;;***
 
 ;;;### (autoloads (pc-bindings-mode) "pc-mode" "emulation/pc-mode.el"
-;;;;;;  (19277 34919))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from emulation/pc-mode.el
 
 (autoload 'pc-bindings-mode "pc-mode" "\
@@ -20162,7 +20169,7 @@
 ;;;***
 
 ;;;### (autoloads (pc-selection-mode) "pc-select" "emulation/pc-select.el"
-;;;;;;  (19354 34807))
+;;;;;;  (19356 10801))
 ;;; Generated autoloads from emulation/pc-select.el
 
 (defvar pc-selection-mode nil "\
@@ -20228,8 +20235,8 @@
 
 ;;;***
 
-;;;### (autoloads (pcomplete/cvs) "pcmpl-cvs" "pcmpl-cvs.el" (19277
-;;;;;;  34917))
+;;;### (autoloads (pcomplete/cvs) "pcmpl-cvs" "pcmpl-cvs.el" (19279
+;;;;;;  5148))
 ;;; Generated autoloads from pcmpl-cvs.el
 
 (autoload 'pcomplete/cvs "pcmpl-cvs" "\
@@ -20240,7 +20247,7 @@
 ;;;***
 
 ;;;### (autoloads (pcomplete/tar pcomplete/make pcomplete/bzip2 pcomplete/gzip)
-;;;;;;  "pcmpl-gnu" "pcmpl-gnu.el" (19277 34917))
+;;;;;;  "pcmpl-gnu" "pcmpl-gnu.el" (19279 5148))
 ;;; Generated autoloads from pcmpl-gnu.el
 
 (autoload 'pcomplete/gzip "pcmpl-gnu" "\
@@ -20268,7 +20275,7 @@
 ;;;***
 
 ;;;### (autoloads (pcomplete/mount pcomplete/umount pcomplete/kill)
-;;;;;;  "pcmpl-linux" "pcmpl-linux.el" (19277 34917))
+;;;;;;  "pcmpl-linux" "pcmpl-linux.el" (19279 5148))
 ;;; Generated autoloads from pcmpl-linux.el
 
 (autoload 'pcomplete/kill "pcmpl-linux" "\
@@ -20288,8 +20295,8 @@
 
 ;;;***
 
-;;;### (autoloads (pcomplete/rpm) "pcmpl-rpm" "pcmpl-rpm.el" (19277
-;;;;;;  34917))
+;;;### (autoloads (pcomplete/rpm) "pcmpl-rpm" "pcmpl-rpm.el" (19279
+;;;;;;  5148))
 ;;; Generated autoloads from pcmpl-rpm.el
 
 (autoload 'pcomplete/rpm "pcmpl-rpm" "\
@@ -20301,7 +20308,7 @@
 
 ;;;### (autoloads (pcomplete/scp pcomplete/ssh pcomplete/chgrp pcomplete/chown
 ;;;;;;  pcomplete/which pcomplete/xargs pcomplete/rm pcomplete/rmdir
-;;;;;;  pcomplete/cd) "pcmpl-unix" "pcmpl-unix.el" (19286 4503))
+;;;;;;  pcomplete/cd) "pcmpl-unix" "pcmpl-unix.el" (19282 55646))
 ;;; Generated autoloads from pcmpl-unix.el
 
 (autoload 'pcomplete/cd "pcmpl-unix" "\
@@ -20358,8 +20365,8 @@
 
 ;;;### (autoloads (pcomplete-shell-setup pcomplete-comint-setup pcomplete-list
 ;;;;;;  pcomplete-help pcomplete-expand pcomplete-continue pcomplete-expand-and-complete
-;;;;;;  pcomplete-reverse pcomplete) "pcomplete" "pcomplete.el" (19277
-;;;;;;  34917))
+;;;;;;  pcomplete-reverse pcomplete) "pcomplete" "pcomplete.el" (19279
+;;;;;;  5148))
 ;;; Generated autoloads from pcomplete.el
 
 (autoload 'pcomplete "pcomplete" "\
@@ -20418,7 +20425,7 @@
 
 ;;;### (autoloads (cvs-dired-use-hook cvs-dired-action cvs-status
 ;;;;;;  cvs-update cvs-examine cvs-quickdir cvs-checkout) "pcvs"
-;;;;;;  "pcvs.el" (19277 34917))
+;;;;;;  "pcvs.el" (19279 5148))
 ;;; Generated autoloads from pcvs.el
 
 (autoload 'cvs-checkout "pcvs" "\
@@ -20493,7 +20500,7 @@
 
 ;;;***
 
-;;;### (autoloads nil "pcvs-defs" "pcvs-defs.el" (19277 34917))
+;;;### (autoloads nil "pcvs-defs" "pcvs-defs.el" (19279 5148))
 ;;; Generated autoloads from pcvs-defs.el
 
 (defvar cvs-global-menu (let ((m (make-sparse-keymap "PCL-CVS"))) (define-key m [status] `(menu-item ,(purecopy "Directory Status") cvs-status :help ,(purecopy "A more verbose status of a workarea"))) (define-key m [checkout] `(menu-item ,(purecopy "Checkout Module") cvs-checkout :help ,(purecopy "Check out a module from the repository"))) (define-key m [update] `(menu-item ,(purecopy "Update Directory") cvs-update :help ,(purecopy "Fetch updates from the repository"))) (define-key m [examine] `(menu-item ,(purecopy "Examine Directory") cvs-examine :help ,(purecopy "Examine the current state of a workarea"))) (fset 'cvs-global-menu m)))
@@ -20501,7 +20508,7 @@
 ;;;***
 
 ;;;### (autoloads (perl-mode) "perl-mode" "progmodes/perl-mode.el"
-;;;;;;  (19277 34922))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from progmodes/perl-mode.el
 (put 'perl-indent-level 'safe-local-variable 'integerp)
 (put 'perl-continued-statement-offset 'safe-local-variable 'integerp)
@@ -20565,7 +20572,7 @@
 ;;;### (autoloads (pgg-snarf-keys pgg-snarf-keys-region pgg-insert-key
 ;;;;;;  pgg-verify pgg-verify-region pgg-sign pgg-sign-region pgg-decrypt
 ;;;;;;  pgg-decrypt-region pgg-encrypt pgg-encrypt-symmetric pgg-encrypt-symmetric-region
-;;;;;;  pgg-encrypt-region) "pgg" "pgg.el" (19277 34917))
+;;;;;;  pgg-encrypt-region) "pgg" "pgg.el" (19279 5148))
 ;;; Generated autoloads from pgg.el
 
 (autoload 'pgg-encrypt-region "pgg" "\
@@ -20699,7 +20706,7 @@
 ;;;***
 
 ;;;### (autoloads (pgg-gpg-symmetric-key-p) "pgg-gpg" "pgg-gpg.el"
-;;;;;;  (19277 34917))
+;;;;;;  (19279 5148))
 ;;; Generated autoloads from pgg-gpg.el
 
 (autoload 'pgg-gpg-symmetric-key-p "pgg-gpg" "\
@@ -20710,7 +20717,7 @@
 ;;;***
 
 ;;;### (autoloads (picture-mode) "picture" "textmodes/picture.el"
-;;;;;;  (19354 34807))
+;;;;;;  (19356 10801))
 ;;; Generated autoloads from textmodes/picture.el
 
 (autoload 'picture-mode "picture" "\
@@ -20791,7 +20798,7 @@
 ;;;***
 
 ;;;### (autoloads (po-find-file-coding-system) "po" "textmodes/po.el"
-;;;;;;  (19277 34923))
+;;;;;;  (19279 5152))
 ;;; Generated autoloads from textmodes/po.el
 
 (autoload 'po-find-file-coding-system "po" "\
@@ -20802,7 +20809,7 @@
 
 ;;;***
 
-;;;### (autoloads (pong) "pong" "play/pong.el" (19277 34922))
+;;;### (autoloads (pong) "pong" "play/pong.el" (19279 5151))
 ;;; Generated autoloads from play/pong.el
 
 (autoload 'pong "pong" "\
@@ -20820,7 +20827,7 @@
 
 ;;;### (autoloads (pp-macroexpand-last-sexp pp-eval-last-sexp pp-macroexpand-expression
 ;;;;;;  pp-eval-expression pp pp-buffer pp-to-string) "pp" "emacs-lisp/pp.el"
-;;;;;;  (19277 34919))
+;;;;;;  (19279 5149))
 ;;; Generated autoloads from emacs-lisp/pp.el
 
 (autoload 'pp-to-string "pp" "\
@@ -20888,7 +20895,7 @@
 ;;;;;;  pr-ps-buffer-print pr-ps-buffer-using-ghostscript pr-ps-buffer-preview
 ;;;;;;  pr-ps-directory-ps-print pr-ps-directory-print pr-ps-directory-using-ghostscript
 ;;;;;;  pr-ps-directory-preview pr-interface) "printing" "printing.el"
-;;;;;;  (19277 34917))
+;;;;;;  (19279 5148))
 ;;; Generated autoloads from printing.el
 
 (autoload 'pr-interface "printing" "\
@@ -21475,7 +21482,7 @@
 
 ;;;***
 
-;;;### (autoloads (proced) "proced" "proced.el" (19277 34917))
+;;;### (autoloads (proced) "proced" "proced.el" (19279 5148))
 ;;; Generated autoloads from proced.el
 
 (autoload 'proced "proced" "\
@@ -21491,7 +21498,7 @@
 ;;;***
 
 ;;;### (autoloads (switch-to-prolog prolog-mode) "prolog" "progmodes/prolog.el"
-;;;;;;  (19277 34922))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from progmodes/prolog.el
 
 (autoload 'prolog-mode "prolog" "\
@@ -21514,8 +21521,8 @@
 
 ;;;***
 
-;;;### (autoloads (bdf-directory-list) "ps-bdf" "ps-bdf.el" (19277
-;;;;;;  34917))
+;;;### (autoloads (bdf-directory-list) "ps-bdf" "ps-bdf.el" (19279
+;;;;;;  5148))
 ;;; Generated autoloads from ps-bdf.el
 
 (defvar bdf-directory-list (if (memq system-type '(ms-dos windows-nt)) (list (expand-file-name "fonts/bdf" installation-directory)) '("/usr/local/share/emacs/fonts/bdf")) "\
@@ -21526,8 +21533,8 @@
 
 ;;;***
 
-;;;### (autoloads (ps-mode) "ps-mode" "progmodes/ps-mode.el" (19277
-;;;;;;  34922))
+;;;### (autoloads (ps-mode) "ps-mode" "progmodes/ps-mode.el" (19279
+;;;;;;  5151))
 ;;; Generated autoloads from progmodes/ps-mode.el
 
 (autoload 'ps-mode "ps-mode" "\
@@ -21578,8 +21585,8 @@
 ;;;;;;  ps-spool-region ps-spool-buffer-with-faces ps-spool-buffer
 ;;;;;;  ps-print-region-with-faces ps-print-region ps-print-buffer-with-faces
 ;;;;;;  ps-print-buffer ps-print-customize ps-print-color-p ps-paper-type
-;;;;;;  ps-page-dimensions-database) "ps-print" "ps-print.el" (19354
-;;;;;;  34807))
+;;;;;;  ps-page-dimensions-database) "ps-print" "ps-print.el" (19356
+;;;;;;  10801))
 ;;; Generated autoloads from ps-print.el
 
 (defvar ps-page-dimensions-database (purecopy (list (list 'a4 (/ (* 72 21.0) 2.54) (/ (* 72 29.7) 2.54) "A4") (list 'a3 (/ (* 72 29.7) 2.54) (/ (* 72 42.0) 2.54) "A3") (list 'letter (* 72 8.5) (* 72 11.0) "Letter") (list 'legal (* 72 8.5) (* 72 14.0) "Legal") (list 'letter-small (* 72 7.68) (* 72 10.16) "LetterSmall") (list 'tabloid (* 72 11.0) (* 72 17.0) "Tabloid") (list 'ledger (* 72 17.0) (* 72 11.0) "Ledger") (list 'statement (* 72 5.5) (* 72 8.5) "Statement") (list 'executive (* 72 7.5) (* 72 10.0) "Executive") (list 'a4small (* 72 7.47) (* 72 10.85) "A4Small") (list 'b4 (* 72 10.125) (* 72 14.33) "B4") (list 'b5 (* 72 7.16) (* 72 10.125) "B5") '(addresslarge 236.0 99.0 "AddressLarge") '(addresssmall 236.0 68.0 "AddressSmall") '(cuthanging13 90.0 222.0 "CutHanging13") '(cuthanging15 90.0 114.0 "CutHanging15") '(diskette 181.0 136.0 "Diskette") '(eurofilefolder 139.0 112.0 "EuropeanFilefolder") '(eurofoldernarrow 526.0 107.0 "EuroFolderNarrow") '(eurofolderwide 526.0 136.0 "EuroFolderWide") '(euronamebadge 189.0 108.0 "EuroNameBadge") '(euronamebadgelarge 223.0 136.0 "EuroNameBadgeLarge") '(filefolder 230.0 37.0 "FileFolder") '(jewelry 76.0 136.0 "Jewelry") '(mediabadge 180.0 136.0 "MediaBadge") '(multipurpose 126.0 68.0 "MultiPurpose") '(retaillabel 90.0 104.0 "RetailLabel") '(shipping 271.0 136.0 "Shipping") '(slide35mm 26.0 104.0 "Slide35mm") '(spine8mm 187.0 26.0 "Spine8mm") '(topcoated 425.19685 136.0 "TopCoatedPaper") '(topcoatedpaper 396.0 136.0 "TopcoatedPaper150") '(vhsface 205.0 127.0 "VHSFace") '(vhsspine 400.0 50.0 "VHSSpine") '(zipdisk 156.0 136.0 "ZipDisk"))) "\
@@ -21776,7 +21783,7 @@
 ;;;***
 
 ;;;### (autoloads (python-shell jython-mode python-mode run-python)
-;;;;;;  "python" "progmodes/python.el" (19336 30736))
+;;;;;;  "python" "progmodes/python.el" (19338 9841))
 ;;; Generated autoloads from progmodes/python.el
 
 (add-to-list 'interpreter-mode-alist (cons (purecopy "jython") 'jython-mode))
@@ -21892,7 +21899,7 @@
 ;;;***
 
 ;;;### (autoloads (quoted-printable-decode-region) "qp" "gnus/qp.el"
-;;;;;;  (19277 34920))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from gnus/qp.el
 
 (autoload 'quoted-printable-decode-region "qp" "\
@@ -21915,7 +21922,7 @@
 ;;;;;;  quail-defrule quail-install-decode-map quail-install-map
 ;;;;;;  quail-define-rules quail-show-keyboard-layout quail-set-keyboard-layout
 ;;;;;;  quail-define-package quail-use-package quail-title) "quail"
-;;;;;;  "international/quail.el" (19277 34920))
+;;;;;;  "international/quail.el" (19279 5150))
 ;;; Generated autoloads from international/quail.el
 
 (autoload 'quail-title "quail" "\
@@ -22146,8 +22153,8 @@
 
 ;;;### (autoloads (quickurl-list quickurl-list-mode quickurl-edit-urls
 ;;;;;;  quickurl-browse-url-ask quickurl-browse-url quickurl-add-url
-;;;;;;  quickurl-ask quickurl) "quickurl" "net/quickurl.el" (19277
-;;;;;;  34921))
+;;;;;;  quickurl-ask quickurl) "quickurl" "net/quickurl.el" (19279
+;;;;;;  5151))
 ;;; Generated autoloads from net/quickurl.el
 
 (defconst quickurl-reread-hook-postfix "\n;; Local Variables:\n;; eval: (progn (require 'quickurl) (add-hook 'local-write-file-hooks (lambda () (quickurl-read) nil)))\n;; End:\n" "\
@@ -22219,7 +22226,7 @@
 ;;;***
 
 ;;;### (autoloads (rcirc-track-minor-mode rcirc-connect rcirc) "rcirc"
-;;;;;;  "net/rcirc.el" (19277 34921))
+;;;;;;  "net/rcirc.el" (19279 5151))
 ;;; Generated autoloads from net/rcirc.el
 
 (autoload 'rcirc "rcirc" "\
@@ -22254,8 +22261,8 @@
 
 ;;;***
 
-;;;### (autoloads (remote-compile) "rcompile" "net/rcompile.el" (19277
-;;;;;;  34921))
+;;;### (autoloads (remote-compile) "rcompile" "net/rcompile.el" (19279
+;;;;;;  5151))
 ;;; Generated autoloads from net/rcompile.el
 
 (autoload 'remote-compile "rcompile" "\
@@ -22267,7 +22274,7 @@
 ;;;***
 
 ;;;### (autoloads (re-builder) "re-builder" "emacs-lisp/re-builder.el"
-;;;;;;  (19277 34919))
+;;;;;;  (19279 5149))
 ;;; Generated autoloads from emacs-lisp/re-builder.el
 
 (defalias 'regexp-builder 're-builder)
@@ -22279,7 +22286,7 @@
 
 ;;;***
 
-;;;### (autoloads (recentf-mode) "recentf" "recentf.el" (19277 34917))
+;;;### (autoloads (recentf-mode) "recentf" "recentf.el" (19279 5148))
 ;;; Generated autoloads from recentf.el
 
 (defvar recentf-mode nil "\
@@ -22306,8 +22313,8 @@
 ;;;### (autoloads (clear-rectangle string-insert-rectangle string-rectangle
 ;;;;;;  delete-whitespace-rectangle open-rectangle insert-rectangle
 ;;;;;;  yank-rectangle kill-rectangle extract-rectangle delete-extract-rectangle
-;;;;;;  delete-rectangle move-to-column-force) "rect" "rect.el" (19277
-;;;;;;  34917))
+;;;;;;  delete-rectangle move-to-column-force) "rect" "rect.el" (19279
+;;;;;;  5148))
 ;;; Generated autoloads from rect.el
  (define-key ctl-x-r-map "c" 'clear-rectangle)
  (define-key ctl-x-r-map "k" 'kill-rectangle)
@@ -22441,8 +22448,8 @@
 
 ;;;***
 
-;;;### (autoloads (refill-mode) "refill" "textmodes/refill.el" (19277
-;;;;;;  34923))
+;;;### (autoloads (refill-mode) "refill" "textmodes/refill.el" (19279
+;;;;;;  5152))
 ;;; Generated autoloads from textmodes/refill.el
 
 (autoload 'refill-mode "refill" "\
@@ -22458,7 +22465,7 @@
 ;;;***
 
 ;;;### (autoloads (reftex-reset-scanning-information reftex-mode
-;;;;;;  turn-on-reftex) "reftex" "textmodes/reftex.el" (19277 34923))
+;;;;;;  turn-on-reftex) "reftex" "textmodes/reftex.el" (19279 5152))
 ;;; Generated autoloads from textmodes/reftex.el
 
 (autoload 'turn-on-reftex "reftex" "\
@@ -22508,7 +22515,7 @@
 ;;;***
 
 ;;;### (autoloads (reftex-citation) "reftex-cite" "textmodes/reftex-cite.el"
-;;;;;;  (19277 34923))
+;;;;;;  (19279 5152))
 ;;; Generated autoloads from textmodes/reftex-cite.el
 
 (autoload 'reftex-citation "reftex-cite" "\
@@ -22538,7 +22545,7 @@
 ;;;***
 
 ;;;### (autoloads (reftex-isearch-minor-mode) "reftex-global" "textmodes/reftex-global.el"
-;;;;;;  (19277 34923))
+;;;;;;  (19279 5152))
 ;;; Generated autoloads from textmodes/reftex-global.el
 
 (autoload 'reftex-isearch-minor-mode "reftex-global" "\
@@ -22555,7 +22562,7 @@
 ;;;***
 
 ;;;### (autoloads (reftex-index-phrases-mode) "reftex-index" "textmodes/reftex-index.el"
-;;;;;;  (19277 34923))
+;;;;;;  (19279 5152))
 ;;; Generated autoloads from textmodes/reftex-index.el
 
 (autoload 'reftex-index-phrases-mode "reftex-index" "\
@@ -22588,7 +22595,7 @@
 ;;;***
 
 ;;;### (autoloads (reftex-all-document-files) "reftex-parse" "textmodes/reftex-parse.el"
-;;;;;;  (19277 34923))
+;;;;;;  (19279 5152))
 ;;; Generated autoloads from textmodes/reftex-parse.el
 
 (autoload 'reftex-all-document-files "reftex-parse" "\
@@ -22600,8 +22607,8 @@
 
 ;;;***
 
-;;;### (autoloads nil "reftex-vars" "textmodes/reftex-vars.el" (19277
-;;;;;;  34923))
+;;;### (autoloads nil "reftex-vars" "textmodes/reftex-vars.el" (19370
+;;;;;;  36541))
 ;;; Generated autoloads from textmodes/reftex-vars.el
 (put 'reftex-vref-is-default 'safe-local-variable (lambda (x) (or (stringp x) (symbolp x))))
 (put 'reftex-fref-is-default 'safe-local-variable (lambda (x) (or (stringp x) (symbolp x))))
@@ -22611,7 +22618,7 @@
 ;;;***
 
 ;;;### (autoloads (regexp-opt-depth regexp-opt) "regexp-opt" "emacs-lisp/regexp-opt.el"
-;;;;;;  (19277 34919))
+;;;;;;  (19279 5149))
 ;;; Generated autoloads from emacs-lisp/regexp-opt.el
 
 (autoload 'regexp-opt "regexp-opt" "\
@@ -22640,7 +22647,7 @@
 
 ;;;### (autoloads (remember-diary-extract-entries remember-clipboard
 ;;;;;;  remember-other-frame remember) "remember" "textmodes/remember.el"
-;;;;;;  (19277 34923))
+;;;;;;  (19279 5152))
 ;;; Generated autoloads from textmodes/remember.el
 
 (autoload 'remember "remember" "\
@@ -22671,7 +22678,7 @@
 
 ;;;***
 
-;;;### (autoloads (repeat) "repeat" "repeat.el" (19277 34917))
+;;;### (autoloads (repeat) "repeat" "repeat.el" (19279 5148))
 ;;; Generated autoloads from repeat.el
 
 (autoload 'repeat "repeat" "\
@@ -22694,7 +22701,7 @@
 ;;;***
 
 ;;;### (autoloads (reporter-submit-bug-report) "reporter" "mail/reporter.el"
-;;;;;;  (19277 34921))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from mail/reporter.el
 
 (autoload 'reporter-submit-bug-report "reporter" "\
@@ -22726,7 +22733,7 @@
 ;;;***
 
 ;;;### (autoloads (reposition-window) "reposition" "reposition.el"
-;;;;;;  (19277 34917))
+;;;;;;  (19279 5148))
 ;;; Generated autoloads from reposition.el
 
 (autoload 'reposition-window "reposition" "\
@@ -22753,7 +22760,7 @@
 ;;;***
 
 ;;;### (autoloads (global-reveal-mode reveal-mode) "reveal" "reveal.el"
-;;;;;;  (19354 34807))
+;;;;;;  (19356 10801))
 ;;; Generated autoloads from reveal.el
 
 (autoload 'reveal-mode "reveal" "\
@@ -22788,7 +22795,7 @@
 ;;;***
 
 ;;;### (autoloads (make-ring ring-p) "ring" "emacs-lisp/ring.el"
-;;;;;;  (19277 34919))
+;;;;;;  (19279 5149))
 ;;; Generated autoloads from emacs-lisp/ring.el
 
 (autoload 'ring-p "ring" "\
@@ -22803,7 +22810,7 @@
 
 ;;;***
 
-;;;### (autoloads (rlogin) "rlogin" "net/rlogin.el" (19277 34921))
+;;;### (autoloads (rlogin) "rlogin" "net/rlogin.el" (19279 5151))
 ;;; Generated autoloads from net/rlogin.el
  (add-hook 'same-window-regexps (purecopy "^\\*rlogin-.*\\*\\(\\|<[0-9]+>\\)"))
 
@@ -22853,8 +22860,8 @@
 ;;;;;;  rmail-secondary-file-directory rmail-primary-inbox-list rmail-highlighted-headers
 ;;;;;;  rmail-retry-ignored-headers rmail-displayed-headers rmail-ignored-headers
 ;;;;;;  rmail-dont-reply-to-names rmail-user-mail-address-regexp
-;;;;;;  rmail-movemail-variant-p) "rmail" "mail/rmail.el" (19306
-;;;;;;  22782))
+;;;;;;  rmail-movemail-variant-p) "rmail" "mail/rmail.el" (19370
+;;;;;;  36541))
 ;;; Generated autoloads from mail/rmail.el
 
 (autoload 'rmail-movemail-variant-p "rmail" "\
@@ -23048,7 +23055,7 @@
 ;;;***
 
 ;;;### (autoloads (rmail-output-body-to-file rmail-output-as-seen
-;;;;;;  rmail-output) "rmailout" "mail/rmailout.el" (19277 34921))
+;;;;;;  rmail-output) "rmailout" "mail/rmailout.el" (19279 5150))
 ;;; Generated autoloads from mail/rmailout.el
 (put 'rmail-output-file-alist 'risky-local-variable t)
 
@@ -23113,7 +23120,7 @@
 ;;;***
 
 ;;;### (autoloads (rng-c-load-schema) "rng-cmpct" "nxml/rng-cmpct.el"
-;;;;;;  (19277 34921))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from nxml/rng-cmpct.el
 
 (autoload 'rng-c-load-schema "rng-cmpct" "\
@@ -23125,7 +23132,7 @@
 ;;;***
 
 ;;;### (autoloads (rng-nxml-mode-init) "rng-nxml" "nxml/rng-nxml.el"
-;;;;;;  (19277 34921))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from nxml/rng-nxml.el
 
 (autoload 'rng-nxml-mode-init "rng-nxml" "\
@@ -23138,7 +23145,7 @@
 ;;;***
 
 ;;;### (autoloads (rng-validate-mode) "rng-valid" "nxml/rng-valid.el"
-;;;;;;  (19277 34921))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from nxml/rng-valid.el
 
 (autoload 'rng-validate-mode "rng-valid" "\
@@ -23168,8 +23175,8 @@
 
 ;;;***
 
-;;;### (autoloads (rng-xsd-compile) "rng-xsd" "nxml/rng-xsd.el" (19277
-;;;;;;  34921))
+;;;### (autoloads (rng-xsd-compile) "rng-xsd" "nxml/rng-xsd.el" (19279
+;;;;;;  5151))
 ;;; Generated autoloads from nxml/rng-xsd.el
 
 (put 'http://www\.w3\.org/2001/XMLSchema-datatypes 'rng-dt-compile 'rng-xsd-compile)
@@ -23197,7 +23204,7 @@
 ;;;***
 
 ;;;### (autoloads (robin-use-package robin-modify-package robin-define-package)
-;;;;;;  "robin" "international/robin.el" (19277 34920))
+;;;;;;  "robin" "international/robin.el" (19279 5150))
 ;;; Generated autoloads from international/robin.el
 
 (autoload 'robin-define-package "robin" "\
@@ -23230,7 +23237,7 @@
 ;;;***
 
 ;;;### (autoloads (toggle-rot13-mode rot13-other-window rot13-region
-;;;;;;  rot13-string rot13) "rot13" "rot13.el" (19277 34917))
+;;;;;;  rot13-string rot13) "rot13" "rot13.el" (19279 5148))
 ;;; Generated autoloads from rot13.el
 
 (autoload 'rot13 "rot13" "\
@@ -23268,7 +23275,7 @@
 ;;;***
 
 ;;;### (autoloads (rst-minor-mode rst-mode) "rst" "textmodes/rst.el"
-;;;;;;  (19277 34923))
+;;;;;;  (19365 25156))
 ;;; Generated autoloads from textmodes/rst.el
  (add-to-list 'auto-mode-alist (purecopy '("\\.re?st\\'" . rst-mode)))
 
@@ -23306,7 +23313,7 @@
 ;;;***
 
 ;;;### (autoloads (ruby-mode) "ruby-mode" "progmodes/ruby-mode.el"
-;;;;;;  (19277 34922))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from progmodes/ruby-mode.el
 
 (autoload 'ruby-mode "ruby-mode" "\
@@ -23327,8 +23334,8 @@
 
 ;;;***
 
-;;;### (autoloads (ruler-mode) "ruler-mode" "ruler-mode.el" (19277
-;;;;;;  34917))
+;;;### (autoloads (ruler-mode) "ruler-mode" "ruler-mode.el" (19279
+;;;;;;  5148))
 ;;; Generated autoloads from ruler-mode.el
 
 (autoload 'ruler-mode "ruler-mode" "\
@@ -23338,8 +23345,8 @@
 
 ;;;***
 
-;;;### (autoloads (rx rx-to-string) "rx" "emacs-lisp/rx.el" (19277
-;;;;;;  34919))
+;;;### (autoloads (rx rx-to-string) "rx" "emacs-lisp/rx.el" (19279
+;;;;;;  5149))
 ;;; Generated autoloads from emacs-lisp/rx.el
 
 (autoload 'rx-to-string "rx" "\
@@ -23649,7 +23656,7 @@
 ;;;***
 
 ;;;### (autoloads (savehist-mode savehist-mode) "savehist" "savehist.el"
-;;;;;;  (19277 34917))
+;;;;;;  (19279 5148))
 ;;; Generated autoloads from savehist.el
 
 (defvar savehist-mode nil "\
@@ -23675,7 +23682,7 @@
 ;;;***
 
 ;;;### (autoloads (dsssl-mode scheme-mode) "scheme" "progmodes/scheme.el"
-;;;;;;  (19277 34922))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from progmodes/scheme.el
 
 (autoload 'scheme-mode "scheme" "\
@@ -23717,7 +23724,7 @@
 ;;;***
 
 ;;;### (autoloads (gnus-score-mode) "score-mode" "gnus/score-mode.el"
-;;;;;;  (19277 34920))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from gnus/score-mode.el
 
 (autoload 'gnus-score-mode "score-mode" "\
@@ -23731,7 +23738,7 @@
 ;;;***
 
 ;;;### (autoloads (scroll-all-mode) "scroll-all" "scroll-all.el"
-;;;;;;  (19277 34917))
+;;;;;;  (19279 5148))
 ;;; Generated autoloads from scroll-all.el
 
 (defvar scroll-all-mode nil "\
@@ -23754,7 +23761,7 @@
 ;;;***
 
 ;;;### (autoloads (scroll-lock-mode) "scroll-lock" "scroll-lock.el"
-;;;;;;  (19277 34917))
+;;;;;;  (19279 5148))
 ;;; Generated autoloads from scroll-lock.el
 
 (autoload 'scroll-lock-mode "scroll-lock" "\
@@ -23769,7 +23776,7 @@
 ;;;***
 
 ;;;### (autoloads (semantic-mode semantic-default-submodes) "semantic"
-;;;;;;  "cedet/semantic.el" (19324 55755))
+;;;;;;  "cedet/semantic.el" (19323 49698))
 ;;; Generated autoloads from cedet/semantic.el
 
 (defvar semantic-default-submodes '(global-semantic-idle-scheduler-mode global-semanticdb-minor-mode) "\
@@ -23821,7 +23828,7 @@
 ;;;;;;  mail-alias-file mail-default-reply-to mail-archive-file-name
 ;;;;;;  mail-header-separator send-mail-function mail-interactive
 ;;;;;;  mail-self-blind mail-specify-envelope-from mail-from-style)
-;;;;;;  "sendmail" "mail/sendmail.el" (19335 12589))
+;;;;;;  "sendmail" "mail/sendmail.el" (19338 9841))
 ;;; Generated autoloads from mail/sendmail.el
 
 (defvar mail-from-style 'default "\
@@ -24118,8 +24125,8 @@
 ;;;***
 
 ;;;### (autoloads (server-save-buffers-kill-terminal server-mode
-;;;;;;  server-force-delete server-start) "server" "server.el" (19277
-;;;;;;  34917))
+;;;;;;  server-force-delete server-start) "server" "server.el" (19279
+;;;;;;  5148))
 ;;; Generated autoloads from server.el
 
 (autoload 'server-start "server" "\
@@ -24173,7 +24180,7 @@
 
 ;;;***
 
-;;;### (autoloads (ses-mode) "ses" "ses.el" (19277 34917))
+;;;### (autoloads (ses-mode) "ses" "ses.el" (19279 5148))
 ;;; Generated autoloads from ses.el
 
 (autoload 'ses-mode "ses" "\
@@ -24192,7 +24199,7 @@
 ;;;***
 
 ;;;### (autoloads (html-mode sgml-mode) "sgml-mode" "textmodes/sgml-mode.el"
-;;;;;;  (19294 23005))
+;;;;;;  (19292 15232))
 ;;; Generated autoloads from textmodes/sgml-mode.el
 
 (autoload 'sgml-mode "sgml-mode" "\
@@ -24258,7 +24265,7 @@
 ;;;***
 
 ;;;### (autoloads (sh-mode) "sh-script" "progmodes/sh-script.el"
-;;;;;;  (19339 10551))
+;;;;;;  (19345 41626))
 ;;; Generated autoloads from progmodes/sh-script.el
 (put 'sh-shell 'safe-local-variable 'symbolp)
 
@@ -24322,7 +24329,7 @@
 
 ;;;***
 
-;;;### (autoloads (sha1) "sha1" "sha1.el" (19277 34917))
+;;;### (autoloads (sha1) "sha1" "sha1.el" (19279 5148))
 ;;; Generated autoloads from sha1.el
 
 (autoload 'sha1 "sha1" "\
@@ -24337,7 +24344,7 @@
 ;;;***
 
 ;;;### (autoloads (list-load-path-shadows) "shadow" "emacs-lisp/shadow.el"
-;;;;;;  (19277 34919))
+;;;;;;  (19279 5149))
 ;;; Generated autoloads from emacs-lisp/shadow.el
 
 (autoload 'list-load-path-shadows "shadow" "\
@@ -24387,8 +24394,8 @@
 ;;;***
 
 ;;;### (autoloads (shadow-initialize shadow-define-regexp-group shadow-define-literal-group
-;;;;;;  shadow-define-cluster) "shadowfile" "shadowfile.el" (19277
-;;;;;;  34917))
+;;;;;;  shadow-define-cluster) "shadowfile" "shadowfile.el" (19279
+;;;;;;  5148))
 ;;; Generated autoloads from shadowfile.el
 
 (autoload 'shadow-define-cluster "shadowfile" "\
@@ -24427,7 +24434,7 @@
 ;;;***
 
 ;;;### (autoloads (shell shell-dumb-shell-regexp) "shell" "shell.el"
-;;;;;;  (19277 34917))
+;;;;;;  (19279 5148))
 ;;; Generated autoloads from shell.el
 
 (defvar shell-dumb-shell-regexp (purecopy "cmd\\(proxy\\)?\\.exe") "\
@@ -24477,7 +24484,7 @@
 ;;;***
 
 ;;;### (autoloads (sieve-upload-and-bury sieve-upload sieve-manage)
-;;;;;;  "sieve" "gnus/sieve.el" (19277 34920))
+;;;;;;  "sieve" "gnus/sieve.el" (19279 5150))
 ;;; Generated autoloads from gnus/sieve.el
 
 (autoload 'sieve-manage "sieve" "\
@@ -24498,7 +24505,7 @@
 ;;;***
 
 ;;;### (autoloads (sieve-mode) "sieve-mode" "gnus/sieve-mode.el"
-;;;;;;  (19362 59593))
+;;;;;;  (19365 25156))
 ;;; Generated autoloads from gnus/sieve-mode.el
 
 (autoload 'sieve-mode "sieve-mode" "\
@@ -24513,8 +24520,8 @@
 
 ;;;***
 
-;;;### (autoloads (simula-mode) "simula" "progmodes/simula.el" (19277
-;;;;;;  34922))
+;;;### (autoloads (simula-mode) "simula" "progmodes/simula.el" (19279
+;;;;;;  5151))
 ;;; Generated autoloads from progmodes/simula.el
 
 (autoload 'simula-mode "simula" "\
@@ -24563,7 +24570,7 @@
 ;;;***
 
 ;;;### (autoloads (skeleton-pair-insert-maybe skeleton-insert skeleton-proxy-new
-;;;;;;  define-skeleton) "skeleton" "skeleton.el" (19277 34917))
+;;;;;;  define-skeleton) "skeleton" "skeleton.el" (19279 5148))
 ;;; Generated autoloads from skeleton.el
 
 (defvar skeleton-filter-function 'identity "\
@@ -24673,7 +24680,7 @@
 ;;;***
 
 ;;;### (autoloads (smerge-start-session smerge-mode smerge-ediff)
-;;;;;;  "smerge-mode" "smerge-mode.el" (19277 34917))
+;;;;;;  "smerge-mode" "smerge-mode.el" (19279 5148))
 ;;; Generated autoloads from smerge-mode.el
 
 (autoload 'smerge-ediff "smerge-mode" "\
@@ -24698,7 +24705,7 @@
 ;;;***
 
 ;;;### (autoloads (smiley-buffer smiley-region) "smiley" "gnus/smiley.el"
-;;;;;;  (19277 34920))
+;;;;;;  (19370 36541))
 ;;; Generated autoloads from gnus/smiley.el
 
 (autoload 'smiley-region "smiley" "\
@@ -24708,15 +24715,15 @@
 \(fn START END)" t nil)
 
 (autoload 'smiley-buffer "smiley" "\
-Run `smiley-region' at the buffer, specified in the argument or
-interactively. If there's no argument, do it at the current buffer
+Run `smiley-region' at the BUFFER, specified in the argument or
+interactively.  If there's no argument, do it at the current buffer.
 
 \(fn &optional BUFFER)" t nil)
 
 ;;;***
 
 ;;;### (autoloads (smtpmail-send-queued-mail smtpmail-send-it) "smtpmail"
-;;;;;;  "mail/smtpmail.el" (19277 34921))
+;;;;;;  "mail/smtpmail.el" (19279 5150))
 ;;; Generated autoloads from mail/smtpmail.el
 
 (autoload 'smtpmail-send-it "smtpmail" "\
@@ -24731,7 +24738,7 @@
 
 ;;;***
 
-;;;### (autoloads (snake) "snake" "play/snake.el" (19277 34922))
+;;;### (autoloads (snake) "snake" "play/snake.el" (19279 5151))
 ;;; Generated autoloads from play/snake.el
 
 (autoload 'snake "snake" "\
@@ -24755,7 +24762,7 @@
 ;;;***
 
 ;;;### (autoloads (snmpv2-mode snmp-mode) "snmp-mode" "net/snmp-mode.el"
-;;;;;;  (19277 34921))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from net/snmp-mode.el
 
 (autoload 'snmp-mode "snmp-mode" "\
@@ -24784,8 +24791,8 @@
 
 ;;;***
 
-;;;### (autoloads (sunrise-sunset) "solar" "calendar/solar.el" (19277
-;;;;;;  34918))
+;;;### (autoloads (sunrise-sunset) "solar" "calendar/solar.el" (19279
+;;;;;;  5149))
 ;;; Generated autoloads from calendar/solar.el
 
 (autoload 'sunrise-sunset "solar" "\
@@ -24800,8 +24807,8 @@
 
 ;;;***
 
-;;;### (autoloads (solitaire) "solitaire" "play/solitaire.el" (19277
-;;;;;;  34922))
+;;;### (autoloads (solitaire) "solitaire" "play/solitaire.el" (19279
+;;;;;;  5151))
 ;;; Generated autoloads from play/solitaire.el
 
 (autoload 'solitaire "solitaire" "\
@@ -24878,7 +24885,7 @@
 
 ;;;### (autoloads (reverse-region sort-columns sort-regexp-fields
 ;;;;;;  sort-fields sort-numeric-fields sort-pages sort-paragraphs
-;;;;;;  sort-lines sort-subr) "sort" "sort.el" (19277 34917))
+;;;;;;  sort-lines sort-subr) "sort" "sort.el" (19279 5148))
 ;;; Generated autoloads from sort.el
 (put 'sort-fold-case 'safe-local-variable 'booleanp)
 
@@ -25022,8 +25029,8 @@
 
 ;;;***
 
-;;;### (autoloads (spam-initialize) "spam" "gnus/spam.el" (19277
-;;;;;;  34920))
+;;;### (autoloads (spam-initialize) "spam" "gnus/spam.el" (19279
+;;;;;;  5150))
 ;;; Generated autoloads from gnus/spam.el
 
 (autoload 'spam-initialize "spam" "\
@@ -25039,7 +25046,7 @@
 
 ;;;### (autoloads (spam-report-deagentize spam-report-agentize spam-report-url-to-file
 ;;;;;;  spam-report-url-ping-mm-url spam-report-process-queue) "spam-report"
-;;;;;;  "gnus/spam-report.el" (19277 34920))
+;;;;;;  "gnus/spam-report.el" (19279 5150))
 ;;; Generated autoloads from gnus/spam-report.el
 
 (autoload 'spam-report-process-queue "spam-report" "\
@@ -25082,7 +25089,7 @@
 ;;;***
 
 ;;;### (autoloads (speedbar-get-focus speedbar-frame-mode) "speedbar"
-;;;;;;  "speedbar.el" (19277 34917))
+;;;;;;  "speedbar.el" (19279 5148))
 ;;; Generated autoloads from speedbar.el
 
 (defalias 'speedbar 'speedbar-frame-mode)
@@ -25107,7 +25114,7 @@
 ;;;***
 
 ;;;### (autoloads (spell-string spell-region spell-word spell-buffer)
-;;;;;;  "spell" "textmodes/spell.el" (19277 34923))
+;;;;;;  "spell" "textmodes/spell.el" (19279 5152))
 ;;; Generated autoloads from textmodes/spell.el
 
 (put 'spell-filter 'risky-local-variable t)
@@ -25151,8 +25158,8 @@
 
 ;;;***
 
-;;;### (autoloads (snarf-spooks spook) "spook" "play/spook.el" (19277
-;;;;;;  34922))
+;;;### (autoloads (snarf-spooks spook) "spook" "play/spook.el" (19279
+;;;;;;  5151))
 ;;; Generated autoloads from play/spook.el
 
 (autoload 'spook "spook" "\
@@ -25170,8 +25177,8 @@
 ;;;### (autoloads (sql-linter sql-db2 sql-interbase sql-postgres
 ;;;;;;  sql-ms sql-ingres sql-solid sql-mysql sql-sqlite sql-informix
 ;;;;;;  sql-sybase sql-oracle sql-product-interactive sql-mode sql-help
-;;;;;;  sql-add-product-keywords) "sql" "progmodes/sql.el" (19277
-;;;;;;  34923))
+;;;;;;  sql-add-product-keywords) "sql" "progmodes/sql.el" (19279
+;;;;;;  5151))
 ;;; Generated autoloads from progmodes/sql.el
 
 (autoload 'sql-add-product-keywords "sql" "\
@@ -25598,7 +25605,7 @@
 ;;;***
 
 ;;;### (autoloads (srecode-template-mode) "srecode/srt-mode" "cedet/srecode/srt-mode.el"
-;;;;;;  (19277 34919))
+;;;;;;  (19279 5149))
 ;;; Generated autoloads from cedet/srecode/srt-mode.el
 
 (autoload 'srecode-template-mode "srecode/srt-mode" "\
@@ -25614,8 +25621,8 @@
 ;;;;;;  strokes-mode strokes-list-strokes strokes-load-user-strokes
 ;;;;;;  strokes-help strokes-describe-stroke strokes-do-complex-stroke
 ;;;;;;  strokes-do-stroke strokes-read-complex-stroke strokes-read-stroke
-;;;;;;  strokes-global-set-stroke) "strokes" "strokes.el" (19277
-;;;;;;  34917))
+;;;;;;  strokes-global-set-stroke) "strokes" "strokes.el" (19279
+;;;;;;  5148))
 ;;; Generated autoloads from strokes.el
 
 (autoload 'strokes-global-set-stroke "strokes" "\
@@ -25725,7 +25732,7 @@
 ;;;***
 
 ;;;### (autoloads (studlify-buffer studlify-word studlify-region)
-;;;;;;  "studly" "play/studly.el" (19267 61660))
+;;;;;;  "studly" "play/studly.el" (19256 49605))
 ;;; Generated autoloads from play/studly.el
 
 (autoload 'studlify-region "studly" "\
@@ -25746,7 +25753,7 @@
 ;;;***
 
 ;;;### (autoloads (global-subword-mode subword-mode) "subword" "progmodes/subword.el"
-;;;;;;  (19277 34923))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from progmodes/subword.el
 
 (autoload 'subword-mode "subword" "\
@@ -25794,7 +25801,7 @@
 ;;;***
 
 ;;;### (autoloads (sc-cite-original) "supercite" "mail/supercite.el"
-;;;;;;  (19361 52486))
+;;;;;;  (19365 25156))
 ;;; Generated autoloads from mail/supercite.el
 
 (autoload 'sc-cite-original "supercite" "\
@@ -25826,8 +25833,8 @@
 
 ;;;***
 
-;;;### (autoloads (gpm-mouse-mode) "t-mouse" "t-mouse.el" (19277
-;;;;;;  34917))
+;;;### (autoloads (gpm-mouse-mode) "t-mouse" "t-mouse.el" (19279
+;;;;;;  5148))
 ;;; Generated autoloads from t-mouse.el
 
 (define-obsolete-function-alias 't-mouse-mode 'gpm-mouse-mode "23.1")
@@ -25854,7 +25861,7 @@
 
 ;;;***
 
-;;;### (autoloads (tabify untabify) "tabify" "tabify.el" (19277 34917))
+;;;### (autoloads (tabify untabify) "tabify" "tabify.el" (19279 5148))
 ;;; Generated autoloads from tabify.el
 
 (autoload 'untabify "tabify" "\
@@ -25889,7 +25896,7 @@
 ;;;;;;  table-recognize table-insert-row-column table-insert-column
 ;;;;;;  table-insert-row table-insert table-point-left-cell-hook
 ;;;;;;  table-point-entered-cell-hook table-load-hook table-cell-map-hook)
-;;;;;;  "table" "textmodes/table.el" (19354 34807))
+;;;;;;  "table" "textmodes/table.el" (19356 10801))
 ;;; Generated autoloads from textmodes/table.el
 
 (defvar table-cell-map-hook nil "\
@@ -26477,7 +26484,7 @@
 
 ;;;***
 
-;;;### (autoloads (talk talk-connect) "talk" "talk.el" (19277 34917))
+;;;### (autoloads (talk talk-connect) "talk" "talk.el" (19279 5148))
 ;;; Generated autoloads from talk.el
 
 (autoload 'talk-connect "talk" "\
@@ -26492,7 +26499,7 @@
 
 ;;;***
 
-;;;### (autoloads (tar-mode) "tar-mode" "tar-mode.el" (19277 34917))
+;;;### (autoloads (tar-mode) "tar-mode" "tar-mode.el" (19279 5148))
 ;;; Generated autoloads from tar-mode.el
 
 (autoload 'tar-mode "tar-mode" "\
@@ -26516,7 +26523,7 @@
 ;;;***
 
 ;;;### (autoloads (tcl-help-on-word inferior-tcl tcl-mode) "tcl"
-;;;;;;  "progmodes/tcl.el" (19277 34923))
+;;;;;;  "progmodes/tcl.el" (19279 5151))
 ;;; Generated autoloads from progmodes/tcl.el
 
 (autoload 'tcl-mode "tcl" "\
@@ -26567,7 +26574,7 @@
 
 ;;;***
 
-;;;### (autoloads (rsh telnet) "telnet" "net/telnet.el" (19277 34921))
+;;;### (autoloads (rsh telnet) "telnet" "net/telnet.el" (19279 5151))
 ;;; Generated autoloads from net/telnet.el
  (add-hook 'same-window-regexps (purecopy "\\*telnet-.*\\*\\(\\|<[0-9]+>\\)"))
 
@@ -26595,7 +26602,7 @@
 ;;;***
 
 ;;;### (autoloads (serial-term ansi-term term make-term) "term" "term.el"
-;;;;;;  (19294 23005))
+;;;;;;  (19292 15231))
 ;;; Generated autoloads from term.el
 
 (autoload 'make-term "term" "\
@@ -26637,8 +26644,8 @@
 
 ;;;***
 
-;;;### (autoloads (terminal-emulator) "terminal" "terminal.el" (19277
-;;;;;;  34917))
+;;;### (autoloads (terminal-emulator) "terminal" "terminal.el" (19279
+;;;;;;  5148))
 ;;; Generated autoloads from terminal.el
 
 (autoload 'terminal-emulator "terminal" "\
@@ -26675,7 +26682,7 @@
 ;;;***
 
 ;;;### (autoloads (testcover-this-defun) "testcover" "emacs-lisp/testcover.el"
-;;;;;;  (19277 34919))
+;;;;;;  (19279 5149))
 ;;; Generated autoloads from emacs-lisp/testcover.el
 
 (autoload 'testcover-this-defun "testcover" "\
@@ -26685,7 +26692,7 @@
 
 ;;;***
 
-;;;### (autoloads (tetris) "tetris" "play/tetris.el" (19277 34922))
+;;;### (autoloads (tetris) "tetris" "play/tetris.el" (19279 5151))
 ;;; Generated autoloads from play/tetris.el
 
 (autoload 'tetris "tetris" "\
@@ -26716,7 +26723,7 @@
 ;;;;;;  tex-start-commands tex-start-options slitex-run-command latex-run-command
 ;;;;;;  tex-run-command tex-offer-save tex-main-file tex-first-line-header-regexp
 ;;;;;;  tex-directory tex-shell-file-name) "tex-mode" "textmodes/tex-mode.el"
-;;;;;;  (19321 40838))
+;;;;;;  (19323 49698))
 ;;; Generated autoloads from textmodes/tex-mode.el
 
 (defvar tex-shell-file-name nil "\
@@ -27018,7 +27025,7 @@
 ;;;***
 
 ;;;### (autoloads (texi2info texinfo-format-region texinfo-format-buffer)
-;;;;;;  "texinfmt" "textmodes/texinfmt.el" (19277 34923))
+;;;;;;  "texinfmt" "textmodes/texinfmt.el" (19279 5152))
 ;;; Generated autoloads from textmodes/texinfmt.el
 
 (autoload 'texinfo-format-buffer "texinfmt" "\
@@ -27058,7 +27065,7 @@
 ;;;***
 
 ;;;### (autoloads (texinfo-mode texinfo-close-quote texinfo-open-quote)
-;;;;;;  "texinfo" "textmodes/texinfo.el" (19277 34923))
+;;;;;;  "texinfo" "textmodes/texinfo.el" (19279 5152))
 ;;; Generated autoloads from textmodes/texinfo.el
 
 (defvar texinfo-open-quote (purecopy "``") "\
@@ -27144,7 +27151,7 @@
 
 ;;;### (autoloads (thai-composition-function thai-compose-buffer
 ;;;;;;  thai-compose-string thai-compose-region) "thai-util" "language/thai-util.el"
-;;;;;;  (19277 34921))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from language/thai-util.el
 
 (autoload 'thai-compose-region "thai-util" "\
@@ -27173,7 +27180,7 @@
 
 ;;;### (autoloads (list-at-point number-at-point symbol-at-point
 ;;;;;;  sexp-at-point thing-at-point bounds-of-thing-at-point forward-thing)
-;;;;;;  "thingatpt" "thingatpt.el" (19277 34917))
+;;;;;;  "thingatpt" "thingatpt.el" (19279 5148))
 ;;; Generated autoloads from thingatpt.el
 
 (autoload 'forward-thing "thingatpt" "\
@@ -27230,7 +27237,7 @@
 
 ;;;### (autoloads (thumbs-dired-setroot thumbs-dired-show thumbs-dired-show-marked
 ;;;;;;  thumbs-show-from-dir thumbs-find-thumb) "thumbs" "thumbs.el"
-;;;;;;  (19277 34917))
+;;;;;;  (19279 5148))
 ;;; Generated autoloads from thumbs.el
 
 (autoload 'thumbs-find-thumb "thumbs" "\
@@ -27268,8 +27275,8 @@
 ;;;;;;  tibetan-post-read-conversion tibetan-compose-buffer tibetan-decompose-buffer
 ;;;;;;  tibetan-decompose-string tibetan-decompose-region tibetan-compose-region
 ;;;;;;  tibetan-compose-string tibetan-transcription-to-tibetan tibetan-tibetan-to-transcription
-;;;;;;  tibetan-char-p) "tibet-util" "language/tibet-util.el" (19277
-;;;;;;  34921))
+;;;;;;  tibetan-char-p) "tibet-util" "language/tibet-util.el" (19279
+;;;;;;  5150))
 ;;; Generated autoloads from language/tibet-util.el
 
 (autoload 'tibetan-char-p "tibet-util" "\
@@ -27343,7 +27350,7 @@
 ;;;***
 
 ;;;### (autoloads (tildify-buffer tildify-region) "tildify" "textmodes/tildify.el"
-;;;;;;  (19277 34923))
+;;;;;;  (19279 5152))
 ;;; Generated autoloads from textmodes/tildify.el
 
 (autoload 'tildify-region "tildify" "\
@@ -27368,7 +27375,7 @@
 
 ;;;### (autoloads (emacs-init-time emacs-uptime display-time-world
 ;;;;;;  display-time-mode display-time display-time-day-and-date)
-;;;;;;  "time" "time.el" (19277 34917))
+;;;;;;  "time" "time.el" (19279 5148))
 ;;; Generated autoloads from time.el
 
 (defvar display-time-day-and-date nil "\
@@ -27431,7 +27438,7 @@
 ;;;;;;  time-to-day-in-year date-leap-year-p days-between date-to-day
 ;;;;;;  time-add time-subtract time-since days-to-time time-less-p
 ;;;;;;  seconds-to-time date-to-time) "time-date" "calendar/time-date.el"
-;;;;;;  (19286 4503))
+;;;;;;  (19292 15231))
 ;;; Generated autoloads from calendar/time-date.el
 
 (autoload 'date-to-time "time-date" "\
@@ -27544,7 +27551,7 @@
 ;;;***
 
 ;;;### (autoloads (time-stamp-toggle-active time-stamp) "time-stamp"
-;;;;;;  "time-stamp.el" (19277 34917))
+;;;;;;  "time-stamp.el" (19279 5148))
 ;;; Generated autoloads from time-stamp.el
 (put 'time-stamp-format 'safe-local-variable 'stringp)
 (put 'time-stamp-time-zone 'safe-local-variable 'string-or-null-p)
@@ -27588,7 +27595,7 @@
 ;;;;;;  timeclock-workday-remaining-string timeclock-reread-log timeclock-query-out
 ;;;;;;  timeclock-change timeclock-status-string timeclock-out timeclock-in
 ;;;;;;  timeclock-modeline-display) "timeclock" "calendar/timeclock.el"
-;;;;;;  (19277 34918))
+;;;;;;  (19279 5149))
 ;;; Generated autoloads from calendar/timeclock.el
 
 (autoload 'timeclock-modeline-display "timeclock" "\
@@ -27688,7 +27695,7 @@
 ;;;***
 
 ;;;### (autoloads (batch-titdic-convert titdic-convert) "titdic-cnv"
-;;;;;;  "international/titdic-cnv.el" (19277 34920))
+;;;;;;  "international/titdic-cnv.el" (19279 5150))
 ;;; Generated autoloads from international/titdic-cnv.el
 
 (autoload 'titdic-convert "titdic-cnv" "\
@@ -27711,7 +27718,7 @@
 ;;;***
 
 ;;;### (autoloads (tmm-prompt tmm-menubar-mouse tmm-menubar) "tmm"
-;;;;;;  "tmm.el" (19277 34917))
+;;;;;;  "tmm.el" (19279 5148))
 ;;; Generated autoloads from tmm.el
  (define-key global-map "\M-`" 'tmm-menubar)
  (define-key global-map [menu-bar mouse-1] 'tmm-menubar-mouse)
@@ -27751,7 +27758,7 @@
 
 ;;;### (autoloads (todo-show todo-cp todo-mode todo-print todo-top-priorities
 ;;;;;;  todo-insert-item todo-add-item-non-interactively todo-add-category)
-;;;;;;  "todo-mode" "calendar/todo-mode.el" (19277 34918))
+;;;;;;  "todo-mode" "calendar/todo-mode.el" (19279 5149))
 ;;; Generated autoloads from calendar/todo-mode.el
 
 (autoload 'todo-add-category "todo-mode" "\
@@ -27813,7 +27820,7 @@
 
 ;;;### (autoloads (tool-bar-local-item-from-menu tool-bar-add-item-from-menu
 ;;;;;;  tool-bar-local-item tool-bar-add-item toggle-tool-bar-mode-from-frame)
-;;;;;;  "tool-bar" "tool-bar.el" (19277 34917))
+;;;;;;  "tool-bar" "tool-bar.el" (19279 5148))
 ;;; Generated autoloads from tool-bar.el
 
 (autoload 'toggle-tool-bar-mode-from-frame "tool-bar" "\
@@ -27886,7 +27893,7 @@
 ;;;***
 
 ;;;### (autoloads (tpu-edt-on tpu-edt-mode) "tpu-edt" "emulation/tpu-edt.el"
-;;;;;;  (19279 53114))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from emulation/tpu-edt.el
 
 (defvar tpu-edt-mode nil "\
@@ -27913,7 +27920,7 @@
 ;;;***
 
 ;;;### (autoloads (tpu-mapper) "tpu-mapper" "emulation/tpu-mapper.el"
-;;;;;;  (19277 34919))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from emulation/tpu-mapper.el
 
 (autoload 'tpu-mapper "tpu-mapper" "\
@@ -27947,7 +27954,7 @@
 
 ;;;***
 
-;;;### (autoloads (tq-create) "tq" "emacs-lisp/tq.el" (19277 34919))
+;;;### (autoloads (tq-create) "tq" "emacs-lisp/tq.el" (19279 5149))
 ;;; Generated autoloads from emacs-lisp/tq.el
 
 (autoload 'tq-create "tq" "\
@@ -27961,7 +27968,7 @@
 ;;;***
 
 ;;;### (autoloads (trace-function-background trace-function trace-buffer)
-;;;;;;  "trace" "emacs-lisp/trace.el" (19277 34919))
+;;;;;;  "trace" "emacs-lisp/trace.el" (19370 36541))
 ;;; Generated autoloads from emacs-lisp/trace.el
 
 (defvar trace-buffer (purecopy "*trace-output*") "\
@@ -27974,7 +27981,7 @@
 For every call of FUNCTION Lisp-style trace messages that display argument
 and return values will be inserted into BUFFER.  This function generates the
 trace advice for FUNCTION and activates it together with any other advice
-there might be!! The trace BUFFER will popup whenever FUNCTION is called.
+there might be!!  The trace BUFFER will popup whenever FUNCTION is called.
 Do not use this to trace functions that switch buffers or do any other
 display oriented stuff, use `trace-function-background' instead.
 
@@ -27998,7 +28005,7 @@
 ;;;### (autoloads (tramp-unload-tramp tramp-completion-handle-file-name-completion
 ;;;;;;  tramp-completion-handle-file-name-all-completions tramp-unload-file-name-handlers
 ;;;;;;  tramp-file-name-handler tramp-syntax tramp-mode) "tramp"
-;;;;;;  "net/tramp.el" (19360 14173))
+;;;;;;  "net/tramp.el" (19370 36541))
 ;;; Generated autoloads from net/tramp.el
 
 (defvar tramp-mode t "\
@@ -28131,7 +28138,7 @@
 ;;;***
 
 ;;;### (autoloads (tramp-ftp-enable-ange-ftp) "tramp-ftp" "net/tramp-ftp.el"
-;;;;;;  (19277 34921))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from net/tramp-ftp.el
 
 (autoload 'tramp-ftp-enable-ange-ftp "tramp-ftp" "\
@@ -28141,8 +28148,8 @@
 
 ;;;***
 
-;;;### (autoloads (help-with-tutorial) "tutorial" "tutorial.el" (19277
-;;;;;;  34917))
+;;;### (autoloads (help-with-tutorial) "tutorial" "tutorial.el" (19279
+;;;;;;  5148))
 ;;; Generated autoloads from tutorial.el
 
 (autoload 'help-with-tutorial "tutorial" "\
@@ -28167,7 +28174,7 @@
 ;;;***
 
 ;;;### (autoloads (tai-viet-composition-function) "tv-util" "language/tv-util.el"
-;;;;;;  (19277 34921))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from language/tv-util.el
 
 (autoload 'tai-viet-composition-function "tv-util" "\
@@ -28178,7 +28185,7 @@
 ;;;***
 
 ;;;### (autoloads (2C-split 2C-associate-buffer 2C-two-columns) "two-column"
-;;;;;;  "textmodes/two-column.el" (19277 34923))
+;;;;;;  "textmodes/two-column.el" (19279 5152))
 ;;; Generated autoloads from textmodes/two-column.el
  (autoload '2C-command "two-column" () t 'keymap)
  (global-set-key "\C-x6" '2C-command)
@@ -28229,7 +28236,7 @@
 ;;;;;;  type-break type-break-mode type-break-keystroke-threshold
 ;;;;;;  type-break-good-break-interval type-break-good-rest-interval
 ;;;;;;  type-break-interval type-break-mode) "type-break" "type-break.el"
-;;;;;;  (19277 34917))
+;;;;;;  (19279 5148))
 ;;; Generated autoloads from type-break.el
 
 (defvar type-break-mode nil "\
@@ -28411,7 +28418,7 @@
 
 ;;;***
 
-;;;### (autoloads (uce-reply-to-uce) "uce" "mail/uce.el" (19277 34921))
+;;;### (autoloads (uce-reply-to-uce) "uce" "mail/uce.el" (19279 5150))
 ;;; Generated autoloads from mail/uce.el
 
 (autoload 'uce-reply-to-uce "uce" "\
@@ -28429,7 +28436,7 @@
 ;;;;;;  ucs-normalize-NFKC-string ucs-normalize-NFKC-region ucs-normalize-NFKD-string
 ;;;;;;  ucs-normalize-NFKD-region ucs-normalize-NFC-string ucs-normalize-NFC-region
 ;;;;;;  ucs-normalize-NFD-string ucs-normalize-NFD-region) "ucs-normalize"
-;;;;;;  "international/ucs-normalize.el" (19277 34920))
+;;;;;;  "international/ucs-normalize.el" (19279 5150))
 ;;; Generated autoloads from international/ucs-normalize.el
 
 (autoload 'ucs-normalize-NFD-region "ucs-normalize" "\
@@ -28495,7 +28502,7 @@
 ;;;***
 
 ;;;### (autoloads (ununderline-region underline-region) "underline"
-;;;;;;  "textmodes/underline.el" (19277 34923))
+;;;;;;  "textmodes/underline.el" (19279 5152))
 ;;; Generated autoloads from textmodes/underline.el
 
 (autoload 'underline-region "underline" "\
@@ -28516,7 +28523,7 @@
 ;;;***
 
 ;;;### (autoloads (unrmail batch-unrmail) "unrmail" "mail/unrmail.el"
-;;;;;;  (19277 34921))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from mail/unrmail.el
 
 (autoload 'batch-unrmail "unrmail" "\
@@ -28535,8 +28542,8 @@
 
 ;;;***
 
-;;;### (autoloads (unsafep) "unsafep" "emacs-lisp/unsafep.el" (19277
-;;;;;;  34919))
+;;;### (autoloads (unsafep) "unsafep" "emacs-lisp/unsafep.el" (19279
+;;;;;;  5150))
 ;;; Generated autoloads from emacs-lisp/unsafep.el
 
 (autoload 'unsafep "unsafep" "\
@@ -28549,7 +28556,7 @@
 ;;;***
 
 ;;;### (autoloads (url-retrieve-synchronously url-retrieve) "url"
-;;;;;;  "url/url.el" (19362 59593))
+;;;;;;  "url/url.el" (19365 25156))
 ;;; Generated autoloads from url/url.el
 
 (autoload 'url-retrieve "url" "\
@@ -28589,7 +28596,7 @@
 ;;;***
 
 ;;;### (autoloads (url-register-auth-scheme url-get-authentication)
-;;;;;;  "url-auth" "url/url-auth.el" (19277 34923))
+;;;;;;  "url-auth" "url/url-auth.el" (19279 5152))
 ;;; Generated autoloads from url/url-auth.el
 
 (autoload 'url-get-authentication "url-auth" "\
@@ -28631,8 +28638,8 @@
 ;;;***
 
 ;;;### (autoloads (url-cache-expired url-cache-extract url-is-cached
-;;;;;;  url-store-in-cache) "url-cache" "url/url-cache.el" (19277
-;;;;;;  34923))
+;;;;;;  url-store-in-cache) "url-cache" "url/url-cache.el" (19279
+;;;;;;  5152))
 ;;; Generated autoloads from url/url-cache.el
 
 (autoload 'url-store-in-cache "url-cache" "\
@@ -28657,7 +28664,7 @@
 
 ;;;***
 
-;;;### (autoloads (url-cid) "url-cid" "url/url-cid.el" (19277 34923))
+;;;### (autoloads (url-cid) "url-cid" "url/url-cid.el" (19279 5152))
 ;;; Generated autoloads from url/url-cid.el
 
 (autoload 'url-cid "url-cid" "\
@@ -28668,7 +28675,7 @@
 ;;;***
 
 ;;;### (autoloads (url-dav-vc-registered url-dav-supported-p) "url-dav"
-;;;;;;  "url/url-dav.el" (19277 34923))
+;;;;;;  "url/url-dav.el" (19279 5152))
 ;;; Generated autoloads from url/url-dav.el
 
 (autoload 'url-dav-supported-p "url-dav" "\
@@ -28683,8 +28690,8 @@
 
 ;;;***
 
-;;;### (autoloads (url-file) "url-file" "url/url-file.el" (19277
-;;;;;;  34923))
+;;;### (autoloads (url-file) "url-file" "url/url-file.el" (19279
+;;;;;;  5152))
 ;;; Generated autoloads from url/url-file.el
 
 (autoload 'url-file "url-file" "\
@@ -28695,7 +28702,7 @@
 ;;;***
 
 ;;;### (autoloads (url-open-stream url-gateway-nslookup-host) "url-gw"
-;;;;;;  "url/url-gw.el" (19277 34923))
+;;;;;;  "url/url-gw.el" (19279 5152))
 ;;; Generated autoloads from url/url-gw.el
 
 (autoload 'url-gateway-nslookup-host "url-gw" "\
@@ -28715,7 +28722,7 @@
 
 ;;;### (autoloads (url-insert-file-contents url-file-local-copy url-copy-file
 ;;;;;;  url-file-handler url-handler-mode) "url-handlers" "url/url-handlers.el"
-;;;;;;  (19277 34923))
+;;;;;;  (19279 5152))
 ;;; Generated autoloads from url/url-handlers.el
 
 (defvar url-handler-mode nil "\
@@ -28767,7 +28774,7 @@
 ;;;***
 
 ;;;### (autoloads (url-http-options url-http-file-attributes url-http-file-exists-p
-;;;;;;  url-http) "url-http" "url/url-http.el" (19277 34923))
+;;;;;;  url-http) "url-http" "url/url-http.el" (19372 27330))
 ;;; Generated autoloads from url/url-http.el
 
 (autoload 'url-http "url-http" "\
@@ -28833,7 +28840,7 @@
 
 ;;;***
 
-;;;### (autoloads (url-irc) "url-irc" "url/url-irc.el" (19277 34923))
+;;;### (autoloads (url-irc) "url-irc" "url/url-irc.el" (19279 5152))
 ;;; Generated autoloads from url/url-irc.el
 
 (autoload 'url-irc "url-irc" "\
@@ -28843,8 +28850,8 @@
 
 ;;;***
 
-;;;### (autoloads (url-ldap) "url-ldap" "url/url-ldap.el" (19277
-;;;;;;  34923))
+;;;### (autoloads (url-ldap) "url-ldap" "url/url-ldap.el" (19279
+;;;;;;  5152))
 ;;; Generated autoloads from url/url-ldap.el
 
 (autoload 'url-ldap "url-ldap" "\
@@ -28858,7 +28865,7 @@
 ;;;***
 
 ;;;### (autoloads (url-mailto url-mail) "url-mailto" "url/url-mailto.el"
-;;;;;;  (19277 34923))
+;;;;;;  (19279 5152))
 ;;; Generated autoloads from url/url-mailto.el
 
 (autoload 'url-mail "url-mailto" "\
@@ -28874,7 +28881,7 @@
 ;;;***
 
 ;;;### (autoloads (url-data url-generic-emulator-loader url-info
-;;;;;;  url-man) "url-misc" "url/url-misc.el" (19277 34923))
+;;;;;;  url-man) "url-misc" "url/url-misc.el" (19279 5152))
 ;;; Generated autoloads from url/url-misc.el
 
 (autoload 'url-man "url-misc" "\
@@ -28906,7 +28913,7 @@
 ;;;***
 
 ;;;### (autoloads (url-snews url-news) "url-news" "url/url-news.el"
-;;;;;;  (19277 34923))
+;;;;;;  (19279 5152))
 ;;; Generated autoloads from url/url-news.el
 
 (autoload 'url-news "url-news" "\
@@ -28923,7 +28930,7 @@
 
 ;;;### (autoloads (url-ns-user-pref url-ns-prefs isInNet isResolvable
 ;;;;;;  dnsResolve dnsDomainIs isPlainHostName) "url-ns" "url/url-ns.el"
-;;;;;;  (19277 34923))
+;;;;;;  (19279 5152))
 ;;; Generated autoloads from url/url-ns.el
 
 (autoload 'isPlainHostName "url-ns" "\
@@ -28964,7 +28971,7 @@
 ;;;***
 
 ;;;### (autoloads (url-generic-parse-url url-recreate-url) "url-parse"
-;;;;;;  "url/url-parse.el" (19277 34923))
+;;;;;;  "url/url-parse.el" (19279 5152))
 ;;; Generated autoloads from url/url-parse.el
 
 (autoload 'url-recreate-url "url-parse" "\
@@ -28982,7 +28989,7 @@
 ;;;***
 
 ;;;### (autoloads (url-setup-privacy-info) "url-privacy" "url/url-privacy.el"
-;;;;;;  (19277 34923))
+;;;;;;  (19279 5152))
 ;;; Generated autoloads from url/url-privacy.el
 
 (autoload 'url-setup-privacy-info "url-privacy" "\
@@ -28998,7 +29005,7 @@
 ;;;;;;  url-pretty-length url-strip-leading-spaces url-eat-trailing-space
 ;;;;;;  url-get-normalized-date url-lazy-message url-normalize-url
 ;;;;;;  url-insert-entities-in-string url-parse-args url-debug url-debug)
-;;;;;;  "url-util" "url/url-util.el" (19294 23005))
+;;;;;;  "url-util" "url/url-util.el" (19292 15232))
 ;;; Generated autoloads from url/url-util.el
 
 (defvar url-debug nil "\
@@ -29134,7 +29141,7 @@
 ;;;***
 
 ;;;### (autoloads (ask-user-about-supersession-threat ask-user-about-lock)
-;;;;;;  "userlock" "userlock.el" (19277 34917))
+;;;;;;  "userlock" "userlock.el" (19279 5148))
 ;;; Generated autoloads from userlock.el
 
 (autoload 'ask-user-about-lock "userlock" "\
@@ -29164,7 +29171,7 @@
 
 ;;;### (autoloads (utf-7-imap-pre-write-conversion utf-7-pre-write-conversion
 ;;;;;;  utf-7-imap-post-read-conversion utf-7-post-read-conversion)
-;;;;;;  "utf-7" "international/utf-7.el" (19277 34920))
+;;;;;;  "utf-7" "international/utf-7.el" (19279 5150))
 ;;; Generated autoloads from international/utf-7.el
 
 (autoload 'utf-7-post-read-conversion "utf-7" "\
@@ -29191,7 +29198,7 @@
 
 ;;;### (autoloads (uudecode-decode-region uudecode-decode-region-internal
 ;;;;;;  uudecode-decode-region-external) "uudecode" "mail/uudecode.el"
-;;;;;;  (19277 34921))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from mail/uudecode.el
 
 (autoload 'uudecode-decode-region-external "uudecode" "\
@@ -29221,7 +29228,7 @@
 ;;;;;;  vc-create-tag vc-merge vc-insert-headers vc-revision-other-window
 ;;;;;;  vc-root-diff vc-diff vc-version-diff vc-register vc-next-action
 ;;;;;;  vc-before-checkin-hook vc-checkin-hook vc-checkout-hook)
-;;;;;;  "vc" "vc.el" (19286 4503))
+;;;;;;  "vc" "vc.el" (19370 36540))
 ;;; Generated autoloads from vc.el
 
 (defvar vc-checkout-hook nil "\
@@ -29454,8 +29461,8 @@
 
 ;;;***
 
-;;;### (autoloads (vc-annotate) "vc-annotate" "vc-annotate.el" (19354
-;;;;;;  34807))
+;;;### (autoloads (vc-annotate) "vc-annotate" "vc-annotate.el" (19356
+;;;;;;  10801))
 ;;; Generated autoloads from vc-annotate.el
 
 (autoload 'vc-annotate "vc-annotate" "\
@@ -29490,7 +29497,7 @@
 
 ;;;***
 
-;;;### (autoloads nil "vc-arch" "vc-arch.el" (19279 53114))
+;;;### (autoloads nil "vc-arch" "vc-arch.el" (19365 25156))
 ;;; Generated autoloads from vc-arch.el
  (defun vc-arch-registered (file)
   (if (vc-find-root file "{arch}/=tagging-method")
@@ -29500,7 +29507,7 @@
 
 ;;;***
 
-;;;### (autoloads nil "vc-bzr" "vc-bzr.el" (19353 62839))
+;;;### (autoloads nil "vc-bzr" "vc-bzr.el" (19370 36540))
 ;;; Generated autoloads from vc-bzr.el
 
 (defconst vc-bzr-admin-dirname ".bzr" "\
@@ -29515,7 +29522,7 @@
 
 ;;;***
 
-;;;### (autoloads nil "vc-cvs" "vc-cvs.el" (19325 42040))
+;;;### (autoloads nil "vc-cvs" "vc-cvs.el" (19365 25156))
 ;;; Generated autoloads from vc-cvs.el
  (defun vc-cvs-registered (f)
   (when (file-readable-p (expand-file-name
@@ -29525,7 +29532,7 @@
 
 ;;;***
 
-;;;### (autoloads (vc-dir) "vc-dir" "vc-dir.el" (19354 34807))
+;;;### (autoloads (vc-dir) "vc-dir" "vc-dir.el" (19370 36540))
 ;;; Generated autoloads from vc-dir.el
 
 (autoload 'vc-dir "vc-dir" "\
@@ -29550,7 +29557,7 @@
 ;;;***
 
 ;;;### (autoloads (vc-do-command) "vc-dispatcher" "vc-dispatcher.el"
-;;;;;;  (19286 4503))
+;;;;;;  (19374 2442))
 ;;; Generated autoloads from vc-dispatcher.el
 
 (autoload 'vc-do-command "vc-dispatcher" "\
@@ -29573,7 +29580,7 @@
 
 ;;;***
 
-;;;### (autoloads nil "vc-git" "vc-git.el" (19351 60435))
+;;;### (autoloads nil "vc-git" "vc-git.el" (19365 25156))
 ;;; Generated autoloads from vc-git.el
  (defun vc-git-registered (file)
   "Return non-nil if FILE is registered with git."
@@ -29584,7 +29591,7 @@
 
 ;;;***
 
-;;;### (autoloads nil "vc-hg" "vc-hg.el" (19277 34917))
+;;;### (autoloads nil "vc-hg" "vc-hg.el" (19370 36540))
 ;;; Generated autoloads from vc-hg.el
  (defun vc-hg-registered (file)
   "Return non-nil if FILE is registered with hg."
@@ -29595,7 +29602,7 @@
 
 ;;;***
 
-;;;### (autoloads nil "vc-mtn" "vc-mtn.el" (19277 34917))
+;;;### (autoloads nil "vc-mtn" "vc-mtn.el" (19365 25156))
 ;;; Generated autoloads from vc-mtn.el
 
 (defconst vc-mtn-admin-dir "_MTN")
@@ -29610,7 +29617,7 @@
 ;;;***
 
 ;;;### (autoloads (vc-rcs-master-templates) "vc-rcs" "vc-rcs.el"
-;;;;;;  (19277 34917))
+;;;;;;  (19365 25156))
 ;;; Generated autoloads from vc-rcs.el
 
 (defvar vc-rcs-master-templates (purecopy '("%sRCS/%s,v" "%s%s,v" "%sRCS/%s")) "\
@@ -29624,7 +29631,7 @@
 ;;;***
 
 ;;;### (autoloads (vc-sccs-master-templates) "vc-sccs" "vc-sccs.el"
-;;;;;;  (19277 34917))
+;;;;;;  (19365 25156))
 ;;; Generated autoloads from vc-sccs.el
 
 (defvar vc-sccs-master-templates (purecopy '("%sSCCS/s.%s" "%ss.%s" vc-sccs-search-project-dir)) "\
@@ -29641,7 +29648,7 @@
 
 ;;;***
 
-;;;### (autoloads nil "vc-svn" "vc-svn.el" (19310 6402))
+;;;### (autoloads nil "vc-svn" "vc-svn.el" (19365 25156))
 ;;; Generated autoloads from vc-svn.el
  (defun vc-svn-registered (f)
   (let ((admin-dir (cond ((and (eq system-type 'windows-nt)
@@ -29657,7 +29664,7 @@
 ;;;***
 
 ;;;### (autoloads (vera-mode) "vera-mode" "progmodes/vera-mode.el"
-;;;;;;  (19277 34923))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from progmodes/vera-mode.el
  (add-to-list 'auto-mode-alist (cons (purecopy "\\.vr[hi]?\\'")  'vera-mode))
 
@@ -29715,7 +29722,7 @@
 ;;;***
 
 ;;;### (autoloads (verilog-mode) "verilog-mode" "progmodes/verilog-mode.el"
-;;;;;;  (19277 34923))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from progmodes/verilog-mode.el
 
 (autoload 'verilog-mode "verilog-mode" "\
@@ -29852,7 +29859,7 @@
 ;;;***
 
 ;;;### (autoloads (vhdl-mode) "vhdl-mode" "progmodes/vhdl-mode.el"
-;;;;;;  (19277 34923))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from progmodes/vhdl-mode.el
 
 (autoload 'vhdl-mode "vhdl-mode" "\
@@ -30393,7 +30400,7 @@
 
 ;;;***
 
-;;;### (autoloads (vi-mode) "vi" "emulation/vi.el" (19267 61660))
+;;;### (autoloads (vi-mode) "vi" "emulation/vi.el" (19256 49605))
 ;;; Generated autoloads from emulation/vi.el
 
 (autoload 'vi-mode "vi" "\
@@ -30448,7 +30455,7 @@
 ;;;### (autoloads (viqr-pre-write-conversion viqr-post-read-conversion
 ;;;;;;  viet-encode-viqr-buffer viet-encode-viqr-region viet-decode-viqr-buffer
 ;;;;;;  viet-decode-viqr-region viet-encode-viscii-char) "viet-util"
-;;;;;;  "language/viet-util.el" (19277 34921))
+;;;;;;  "language/viet-util.el" (19279 5150))
 ;;; Generated autoloads from language/viet-util.el
 
 (autoload 'viet-encode-viscii-char "viet-util" "\
@@ -30496,7 +30503,7 @@
 ;;;;;;  view-mode view-buffer-other-frame view-buffer-other-window
 ;;;;;;  view-buffer view-file-other-frame view-file-other-window
 ;;;;;;  view-file kill-buffer-if-not-modified view-remove-frame-by-deleting)
-;;;;;;  "view" "view.el" (19354 34807))
+;;;;;;  "view" "view.el" (19356 10801))
 ;;; Generated autoloads from view.el
 
 (defvar view-remove-frame-by-deleting t "\
@@ -30742,8 +30749,8 @@
 
 ;;;***
 
-;;;### (autoloads (vip-mode vip-setup) "vip" "emulation/vip.el" (19277
-;;;;;;  34919))
+;;;### (autoloads (vip-mode vip-setup) "vip" "emulation/vip.el" (19279
+;;;;;;  5150))
 ;;; Generated autoloads from emulation/vip.el
 
 (autoload 'vip-setup "vip" "\
@@ -30759,7 +30766,7 @@
 ;;;***
 
 ;;;### (autoloads (viper-mode toggle-viper-mode) "viper" "emulation/viper.el"
-;;;;;;  (19277 34919))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from emulation/viper.el
 
 (autoload 'toggle-viper-mode "viper" "\
@@ -30776,7 +30783,7 @@
 ;;;***
 
 ;;;### (autoloads (warn lwarn display-warning) "warnings" "emacs-lisp/warnings.el"
-;;;;;;  (19277 34919))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from emacs-lisp/warnings.el
 
 (defvar warning-prefix-function nil "\
@@ -30866,7 +30873,7 @@
 ;;;***
 
 ;;;### (autoloads (wdired-change-to-wdired-mode) "wdired" "wdired.el"
-;;;;;;  (19277 34917))
+;;;;;;  (19279 5149))
 ;;; Generated autoloads from wdired.el
 
 (autoload 'wdired-change-to-wdired-mode "wdired" "\
@@ -30882,7 +30889,7 @@
 
 ;;;***
 
-;;;### (autoloads (webjump) "webjump" "net/webjump.el" (19277 34921))
+;;;### (autoloads (webjump) "webjump" "net/webjump.el" (19279 5151))
 ;;; Generated autoloads from net/webjump.el
 
 (autoload 'webjump "webjump" "\
@@ -30899,7 +30906,7 @@
 ;;;***
 
 ;;;### (autoloads (which-function-mode) "which-func" "progmodes/which-func.el"
-;;;;;;  (19277 34923))
+;;;;;;  (19279 5151))
 ;;; Generated autoloads from progmodes/which-func.el
  (put 'which-func-format 'risky-local-variable t)
  (put 'which-func-current 'risky-local-variable t)
@@ -30930,7 +30937,7 @@
 ;;;### (autoloads (whitespace-report-region whitespace-report whitespace-cleanup-region
 ;;;;;;  whitespace-cleanup global-whitespace-toggle-options whitespace-toggle-options
 ;;;;;;  global-whitespace-newline-mode global-whitespace-mode whitespace-newline-mode
-;;;;;;  whitespace-mode) "whitespace" "whitespace.el" (19354 34807))
+;;;;;;  whitespace-mode) "whitespace" "whitespace.el" (19356 10801))
 ;;; Generated autoloads from whitespace.el
 
 (autoload 'whitespace-mode "whitespace" "\
@@ -31329,7 +31336,7 @@
 ;;;***
 
 ;;;### (autoloads (widget-minor-mode widget-browse-other-window widget-browse
-;;;;;;  widget-browse-at) "wid-browse" "wid-browse.el" (19277 34917))
+;;;;;;  widget-browse-at) "wid-browse" "wid-browse.el" (19279 5149))
 ;;; Generated autoloads from wid-browse.el
 
 (autoload 'widget-browse-at "wid-browse" "\
@@ -31356,8 +31363,8 @@
 ;;;***
 
 ;;;### (autoloads (widget-setup widget-insert widget-delete widget-create
-;;;;;;  widget-prompt-value widgetp) "wid-edit" "wid-edit.el" (19360
-;;;;;;  14173))
+;;;;;;  widget-prompt-value widgetp) "wid-edit" "wid-edit.el" (19356
+;;;;;;  10801))
 ;;; Generated autoloads from wid-edit.el
 
 (autoload 'widgetp "wid-edit" "\
@@ -31400,8 +31407,8 @@
 ;;;***
 
 ;;;### (autoloads (windmove-default-keybindings windmove-down windmove-right
-;;;;;;  windmove-up windmove-left) "windmove" "windmove.el" (19277
-;;;;;;  34917))
+;;;;;;  windmove-up windmove-left) "windmove" "windmove.el" (19279
+;;;;;;  5149))
 ;;; Generated autoloads from windmove.el
 
 (autoload 'windmove-left "windmove" "\
@@ -31454,7 +31461,7 @@
 ;;;***
 
 ;;;### (autoloads (winner-mode winner-mode) "winner" "winner.el"
-;;;;;;  (19277 34917))
+;;;;;;  (19279 5149))
 ;;; Generated autoloads from winner.el
 
 (defvar winner-mode nil "\
@@ -31473,7 +31480,7 @@
 ;;;***
 
 ;;;### (autoloads (woman-find-file woman-dired-find-file woman woman-locale)
-;;;;;;  "woman" "woman.el" (19277 34917))
+;;;;;;  "woman" "woman.el" (19370 36540))
 ;;; Generated autoloads from woman.el
 
 (defvar woman-locale nil "\
@@ -31517,7 +31524,7 @@
 ;;;***
 
 ;;;### (autoloads (wordstar-mode) "ws-mode" "emulation/ws-mode.el"
-;;;;;;  (19277 34919))
+;;;;;;  (19279 5150))
 ;;; Generated autoloads from emulation/ws-mode.el
 
 (autoload 'wordstar-mode "ws-mode" "\
@@ -31629,7 +31636,7 @@
 
 ;;;***
 
-;;;### (autoloads (xesam-search) "xesam" "net/xesam.el" (19360 14173))
+;;;### (autoloads (xesam-search) "xesam" "net/xesam.el" (19356 10801))
 ;;; Generated autoloads from net/xesam.el
 
 (autoload 'xesam-search "xesam" "\
@@ -31649,7 +31656,7 @@
 ;;;***
 
 ;;;### (autoloads (xml-parse-region xml-parse-file) "xml" "xml.el"
-;;;;;;  (19277 34917))
+;;;;;;  (19279 5149))
 ;;; Generated autoloads from xml.el
 
 (autoload 'xml-parse-file "xml" "\
@@ -31675,7 +31682,7 @@
 ;;;***
 
 ;;;### (autoloads (xmltok-get-declared-encoding-position) "xmltok"
-;;;;;;  "nxml/xmltok.el" (19277 34921))
+;;;;;;  "nxml/xmltok.el" (19279 5151))
 ;;; Generated autoloads from nxml/xmltok.el
 
 (autoload 'xmltok-get-declared-encoding-position "xmltok" "\
@@ -31693,8 +31700,8 @@
 
 ;;;***
 
-;;;### (autoloads (xterm-mouse-mode) "xt-mouse" "xt-mouse.el" (19277
-;;;;;;  34917))
+;;;### (autoloads (xterm-mouse-mode) "xt-mouse" "xt-mouse.el" (19279
+;;;;;;  5149))
 ;;; Generated autoloads from xt-mouse.el
 
 (defvar xterm-mouse-mode nil "\
@@ -31723,7 +31730,7 @@
 ;;;***
 
 ;;;### (autoloads (yenc-extract-filename yenc-decode-region) "yenc"
-;;;;;;  "gnus/yenc.el" (19277 34920))
+;;;;;;  "gnus/yenc.el" (19279 5150))
 ;;; Generated autoloads from gnus/yenc.el
 
 (autoload 'yenc-decode-region "yenc" "\
@@ -31739,7 +31746,7 @@
 ;;;***
 
 ;;;### (autoloads (psychoanalyze-pinhead apropos-zippy insert-zippyism
-;;;;;;  yow) "yow" "play/yow.el" (19277 34922))
+;;;;;;  yow) "yow" "play/yow.el" (19279 5151))
 ;;; Generated autoloads from play/yow.el
 
 (autoload 'yow "yow" "\
@@ -31765,7 +31772,7 @@
 
 ;;;***
 
-;;;### (autoloads (zone) "zone" "play/zone.el" (19277 34922))
+;;;### (autoloads (zone) "zone" "play/zone.el" (19279 5151))
 ;;; Generated autoloads from play/zone.el
 
 (autoload 'zone "zone" "\
@@ -31781,59 +31788,60 @@
 ;;;;;;  "calc/calc-fin.el" "calc/calc-forms.el" "calc/calc-frac.el"
 ;;;;;;  "calc/calc-funcs.el" "calc/calc-graph.el" "calc/calc-help.el"
 ;;;;;;  "calc/calc-incom.el" "calc/calc-keypd.el" "calc/calc-lang.el"
-;;;;;;  "calc/calc-macs.el" "calc/calc-map.el" "calc/calc-math.el"
-;;;;;;  "calc/calc-menu.el" "calc/calc-misc.el" "calc/calc-mode.el"
-;;;;;;  "calc/calc-mtx.el" "calc/calc-nlfit.el" "calc/calc-poly.el"
-;;;;;;  "calc/calc-prog.el" "calc/calc-rewr.el" "calc/calc-rules.el"
-;;;;;;  "calc/calc-sel.el" "calc/calc-stat.el" "calc/calc-store.el"
-;;;;;;  "calc/calc-stuff.el" "calc/calc-trail.el" "calc/calc-undo.el"
-;;;;;;  "calc/calc-units.el" "calc/calc-vec.el" "calc/calc-yank.el"
-;;;;;;  "calc/calcalg2.el" "calc/calcalg3.el" "calc/calccomp.el"
-;;;;;;  "calc/calcsel2.el" "calendar/cal-bahai.el" "calendar/cal-coptic.el"
-;;;;;;  "calendar/cal-french.el" "calendar/cal-html.el" "calendar/cal-islam.el"
-;;;;;;  "calendar/cal-iso.el" "calendar/cal-julian.el" "calendar/cal-loaddefs.el"
-;;;;;;  "calendar/cal-mayan.el" "calendar/cal-menu.el" "calendar/cal-move.el"
-;;;;;;  "calendar/cal-persia.el" "calendar/cal-tex.el" "calendar/cal-x.el"
-;;;;;;  "calendar/diary-loaddefs.el" "calendar/hol-loaddefs.el" "cdl.el"
-;;;;;;  "cedet/cedet-cscope.el" "cedet/cedet-files.el" "cedet/cedet-global.el"
+;;;;;;  "calc/calc-loaddefs.el" "calc/calc-macs.el" "calc/calc-map.el"
+;;;;;;  "calc/calc-math.el" "calc/calc-menu.el" "calc/calc-misc.el"
+;;;;;;  "calc/calc-mode.el" "calc/calc-mtx.el" "calc/calc-nlfit.el"
+;;;;;;  "calc/calc-poly.el" "calc/calc-prog.el" "calc/calc-rewr.el"
+;;;;;;  "calc/calc-rules.el" "calc/calc-sel.el" "calc/calc-stat.el"
+;;;;;;  "calc/calc-store.el" "calc/calc-stuff.el" "calc/calc-trail.el"
+;;;;;;  "calc/calc-undo.el" "calc/calc-units.el" "calc/calc-vec.el"
+;;;;;;  "calc/calc-yank.el" "calc/calcalg2.el" "calc/calcalg3.el"
+;;;;;;  "calc/calccomp.el" "calc/calcsel2.el" "calendar/cal-bahai.el"
+;;;;;;  "calendar/cal-coptic.el" "calendar/cal-french.el" "calendar/cal-html.el"
+;;;;;;  "calendar/cal-islam.el" "calendar/cal-iso.el" "calendar/cal-julian.el"
+;;;;;;  "calendar/cal-loaddefs.el" "calendar/cal-mayan.el" "calendar/cal-menu.el"
+;;;;;;  "calendar/cal-move.el" "calendar/cal-persia.el" "calendar/cal-tex.el"
+;;;;;;  "calendar/cal-x.el" "calendar/diary-loaddefs.el" "calendar/hol-loaddefs.el"
+;;;;;;  "cdl.el" "cedet/cedet-cscope.el" "cedet/cedet-files.el" "cedet/cedet-global.el"
 ;;;;;;  "cedet/cedet-idutils.el" "cedet/cedet.el" "cedet/ede/autoconf-edit.el"
 ;;;;;;  "cedet/ede/cpp-root.el" "cedet/ede/dired.el" "cedet/ede/emacs.el"
-;;;;;;  "cedet/ede/files.el" "cedet/ede/linux.el" "cedet/ede/locate.el"
-;;;;;;  "cedet/ede/make.el" "cedet/ede/makefile-edit.el" "cedet/ede/pconf.el"
-;;;;;;  "cedet/ede/pmake.el" "cedet/ede/proj-archive.el" "cedet/ede/proj-aux.el"
-;;;;;;  "cedet/ede/proj-comp.el" "cedet/ede/proj-elisp.el" "cedet/ede/proj-info.el"
-;;;;;;  "cedet/ede/proj-misc.el" "cedet/ede/proj-obj.el" "cedet/ede/proj-prog.el"
-;;;;;;  "cedet/ede/proj-scheme.el" "cedet/ede/proj-shared.el" "cedet/ede/proj.el"
-;;;;;;  "cedet/ede/project-am.el" "cedet/ede/shell.el" "cedet/ede/simple.el"
-;;;;;;  "cedet/ede/source.el" "cedet/ede/speedbar.el" "cedet/ede/srecode.el"
-;;;;;;  "cedet/ede/system.el" "cedet/ede/util.el" "cedet/inversion.el"
-;;;;;;  "cedet/mode-local.el" "cedet/pulse.el" "cedet/semantic/analyze.el"
-;;;;;;  "cedet/semantic/analyze/complete.el" "cedet/semantic/analyze/debug.el"
-;;;;;;  "cedet/semantic/analyze/fcn.el" "cedet/semantic/analyze/refs.el"
-;;;;;;  "cedet/semantic/bovine.el" "cedet/semantic/bovine/c-by.el"
-;;;;;;  "cedet/semantic/bovine/c.el" "cedet/semantic/bovine/debug.el"
-;;;;;;  "cedet/semantic/bovine/el.el" "cedet/semantic/bovine/gcc.el"
-;;;;;;  "cedet/semantic/bovine/make-by.el" "cedet/semantic/bovine/make.el"
-;;;;;;  "cedet/semantic/bovine/scm-by.el" "cedet/semantic/bovine/scm.el"
-;;;;;;  "cedet/semantic/chart.el" "cedet/semantic/complete.el" "cedet/semantic/ctxt.el"
-;;;;;;  "cedet/semantic/db-debug.el" "cedet/semantic/db-ebrowse.el"
-;;;;;;  "cedet/semantic/db-el.el" "cedet/semantic/db-file.el" "cedet/semantic/db-find.el"
-;;;;;;  "cedet/semantic/db-global.el" "cedet/semantic/db-javascript.el"
-;;;;;;  "cedet/semantic/db-mode.el" "cedet/semantic/db-ref.el" "cedet/semantic/db-typecache.el"
+;;;;;;  "cedet/ede/files.el" "cedet/ede/linux.el" "cedet/ede/loaddefs.el"
+;;;;;;  "cedet/ede/locate.el" "cedet/ede/make.el" "cedet/ede/makefile-edit.el"
+;;;;;;  "cedet/ede/pconf.el" "cedet/ede/pmake.el" "cedet/ede/proj-archive.el"
+;;;;;;  "cedet/ede/proj-aux.el" "cedet/ede/proj-comp.el" "cedet/ede/proj-elisp.el"
+;;;;;;  "cedet/ede/proj-info.el" "cedet/ede/proj-misc.el" "cedet/ede/proj-obj.el"
+;;;;;;  "cedet/ede/proj-prog.el" "cedet/ede/proj-scheme.el" "cedet/ede/proj-shared.el"
+;;;;;;  "cedet/ede/proj.el" "cedet/ede/project-am.el" "cedet/ede/shell.el"
+;;;;;;  "cedet/ede/simple.el" "cedet/ede/source.el" "cedet/ede/speedbar.el"
+;;;;;;  "cedet/ede/srecode.el" "cedet/ede/system.el" "cedet/ede/util.el"
+;;;;;;  "cedet/inversion.el" "cedet/mode-local.el" "cedet/pulse.el"
+;;;;;;  "cedet/semantic/analyze.el" "cedet/semantic/analyze/complete.el"
+;;;;;;  "cedet/semantic/analyze/debug.el" "cedet/semantic/analyze/fcn.el"
+;;;;;;  "cedet/semantic/analyze/refs.el" "cedet/semantic/bovine.el"
+;;;;;;  "cedet/semantic/bovine/c-by.el" "cedet/semantic/bovine/c.el"
+;;;;;;  "cedet/semantic/bovine/debug.el" "cedet/semantic/bovine/el.el"
+;;;;;;  "cedet/semantic/bovine/gcc.el" "cedet/semantic/bovine/make-by.el"
+;;;;;;  "cedet/semantic/bovine/make.el" "cedet/semantic/bovine/scm-by.el"
+;;;;;;  "cedet/semantic/bovine/scm.el" "cedet/semantic/chart.el"
+;;;;;;  "cedet/semantic/complete.el" "cedet/semantic/ctxt.el" "cedet/semantic/db-debug.el"
+;;;;;;  "cedet/semantic/db-ebrowse.el" "cedet/semantic/db-el.el"
+;;;;;;  "cedet/semantic/db-file.el" "cedet/semantic/db-find.el" "cedet/semantic/db-global.el"
+;;;;;;  "cedet/semantic/db-javascript.el" "cedet/semantic/db-mode.el"
+;;;;;;  "cedet/semantic/db-ref.el" "cedet/semantic/db-typecache.el"
 ;;;;;;  "cedet/semantic/db.el" "cedet/semantic/debug.el" "cedet/semantic/decorate.el"
 ;;;;;;  "cedet/semantic/decorate/include.el" "cedet/semantic/decorate/mode.el"
 ;;;;;;  "cedet/semantic/dep.el" "cedet/semantic/doc.el" "cedet/semantic/ede-grammar.el"
 ;;;;;;  "cedet/semantic/edit.el" "cedet/semantic/find.el" "cedet/semantic/format.el"
 ;;;;;;  "cedet/semantic/fw.el" "cedet/semantic/grammar-wy.el" "cedet/semantic/grammar.el"
 ;;;;;;  "cedet/semantic/html.el" "cedet/semantic/ia-sb.el" "cedet/semantic/ia.el"
-;;;;;;  "cedet/semantic/idle.el" "cedet/semantic/java.el" "cedet/semantic/lex-spp.el"
-;;;;;;  "cedet/semantic/lex.el" "cedet/semantic/mru-bookmark.el"
-;;;;;;  "cedet/semantic/sb.el" "cedet/semantic/scope.el" "cedet/semantic/senator.el"
-;;;;;;  "cedet/semantic/sort.el" "cedet/semantic/symref.el" "cedet/semantic/symref/cscope.el"
-;;;;;;  "cedet/semantic/symref/filter.el" "cedet/semantic/symref/global.el"
-;;;;;;  "cedet/semantic/symref/grep.el" "cedet/semantic/symref/idutils.el"
-;;;;;;  "cedet/semantic/symref/list.el" "cedet/semantic/tag-file.el"
-;;;;;;  "cedet/semantic/tag-ls.el" "cedet/semantic/tag-write.el"
+;;;;;;  "cedet/semantic/idle.el" "cedet/semantic/imenu.el" "cedet/semantic/java.el"
+;;;;;;  "cedet/semantic/lex-spp.el" "cedet/semantic/lex.el" "cedet/semantic/loaddefs.el"
+;;;;;;  "cedet/semantic/mru-bookmark.el" "cedet/semantic/sb.el" "cedet/semantic/scope.el"
+;;;;;;  "cedet/semantic/senator.el" "cedet/semantic/sort.el" "cedet/semantic/symref.el"
+;;;;;;  "cedet/semantic/symref/cscope.el" "cedet/semantic/symref/filter.el"
+;;;;;;  "cedet/semantic/symref/global.el" "cedet/semantic/symref/grep.el"
+;;;;;;  "cedet/semantic/symref/idutils.el" "cedet/semantic/symref/list.el"
+;;;;;;  "cedet/semantic/tag-file.el" "cedet/semantic/tag-ls.el" "cedet/semantic/tag-write.el"
 ;;;;;;  "cedet/semantic/tag.el" "cedet/semantic/texi.el" "cedet/semantic/util-modes.el"
 ;;;;;;  "cedet/semantic/util.el" "cedet/semantic/wisent.el" "cedet/semantic/wisent/comp.el"
 ;;;;;;  "cedet/semantic/wisent/java-tags.el" "cedet/semantic/wisent/javascript.el"
@@ -31845,18 +31853,18 @@
 ;;;;;;  "cedet/srecode/el.el" "cedet/srecode/expandproto.el" "cedet/srecode/extract.el"
 ;;;;;;  "cedet/srecode/fields.el" "cedet/srecode/filters.el" "cedet/srecode/find.el"
 ;;;;;;  "cedet/srecode/getset.el" "cedet/srecode/insert.el" "cedet/srecode/java.el"
-;;;;;;  "cedet/srecode/map.el" "cedet/srecode/mode.el" "cedet/srecode/semantic.el"
-;;;;;;  "cedet/srecode/srt-wy.el" "cedet/srecode/srt.el" "cedet/srecode/table.el"
-;;;;;;  "cedet/srecode/template.el" "cedet/srecode/texi.el" "cus-dep.el"
-;;;;;;  "dframe.el" "dired-aux.el" "dired-x.el" "dos-fns.el" "dos-vars.el"
-;;;;;;  "dos-w32.el" "ediff-diff.el" "ediff-init.el" "ediff-merg.el"
-;;;;;;  "ediff-ptch.el" "ediff-vers.el" "ediff-wind.el" "electric.el"
-;;;;;;  "emacs-lisp/assoc.el" "emacs-lisp/authors.el" "emacs-lisp/avl-tree.el"
-;;;;;;  "emacs-lisp/bindat.el" "emacs-lisp/byte-opt.el" "emacs-lisp/chart.el"
-;;;;;;  "emacs-lisp/cl-compat.el" "emacs-lisp/cl-extra.el" "emacs-lisp/cl-loaddefs.el"
-;;;;;;  "emacs-lisp/cl-macs.el" "emacs-lisp/cl-seq.el" "emacs-lisp/cl-specs.el"
-;;;;;;  "emacs-lisp/cust-print.el" "emacs-lisp/eieio-base.el" "emacs-lisp/eieio-comp.el"
-;;;;;;  "emacs-lisp/eieio-custom.el" "emacs-lisp/eieio-datadebug.el"
+;;;;;;  "cedet/srecode/loaddefs.el" "cedet/srecode/map.el" "cedet/srecode/mode.el"
+;;;;;;  "cedet/srecode/semantic.el" "cedet/srecode/srt-wy.el" "cedet/srecode/srt.el"
+;;;;;;  "cedet/srecode/table.el" "cedet/srecode/template.el" "cedet/srecode/texi.el"
+;;;;;;  "cus-dep.el" "cus-load.el" "dframe.el" "dired-aux.el" "dired-x.el"
+;;;;;;  "dos-fns.el" "dos-vars.el" "dos-w32.el" "ediff-diff.el" "ediff-init.el"
+;;;;;;  "ediff-merg.el" "ediff-ptch.el" "ediff-vers.el" "ediff-wind.el"
+;;;;;;  "electric.el" "emacs-lisp/assoc.el" "emacs-lisp/authors.el"
+;;;;;;  "emacs-lisp/avl-tree.el" "emacs-lisp/bindat.el" "emacs-lisp/byte-opt.el"
+;;;;;;  "emacs-lisp/chart.el" "emacs-lisp/cl-compat.el" "emacs-lisp/cl-extra.el"
+;;;;;;  "emacs-lisp/cl-loaddefs.el" "emacs-lisp/cl-macs.el" "emacs-lisp/cl-seq.el"
+;;;;;;  "emacs-lisp/cl-specs.el" "emacs-lisp/cust-print.el" "emacs-lisp/eieio-base.el"
+;;;;;;  "emacs-lisp/eieio-comp.el" "emacs-lisp/eieio-custom.el" "emacs-lisp/eieio-datadebug.el"
 ;;;;;;  "emacs-lisp/eieio-opt.el" "emacs-lisp/eieio-speedbar.el"
 ;;;;;;  "emacs-lisp/eieio.el" "emacs-lisp/find-gc.el" "emacs-lisp/gulp.el"
 ;;;;;;  "emacs-lisp/lisp-mnt.el" "emacs-lisp/lmenu.el" "emacs-lisp/regi.el"
@@ -31873,18 +31881,19 @@
 ;;;;;;  "eshell/em-pred.el" "eshell/em-prompt.el" "eshell/em-rebind.el"
 ;;;;;;  "eshell/em-script.el" "eshell/em-smart.el" "eshell/em-term.el"
 ;;;;;;  "eshell/em-unix.el" "eshell/em-xtra.el" "eshell/esh-arg.el"
-;;;;;;  "eshell/esh-cmd.el" "eshell/esh-ext.el" "eshell/esh-io.el"
-;;;;;;  "eshell/esh-module.el" "eshell/esh-opt.el" "eshell/esh-proc.el"
-;;;;;;  "eshell/esh-util.el" "eshell/esh-var.el" "ezimage.el" "foldout.el"
-;;;;;;  "font-setting.el" "format-spec.el" "forms-d2.el" "forms-pass.el"
-;;;;;;  "fringe.el" "generic-x.el" "gnus/auth-source.el" "gnus/compface.el"
-;;;;;;  "gnus/gnus-async.el" "gnus/gnus-bcklg.el" "gnus/gnus-cite.el"
-;;;;;;  "gnus/gnus-cus.el" "gnus/gnus-demon.el" "gnus/gnus-dup.el"
-;;;;;;  "gnus/gnus-eform.el" "gnus/gnus-ems.el" "gnus/gnus-int.el"
-;;;;;;  "gnus/gnus-logic.el" "gnus/gnus-mh.el" "gnus/gnus-salt.el"
-;;;;;;  "gnus/gnus-score.el" "gnus/gnus-setup.el" "gnus/gnus-srvr.el"
-;;;;;;  "gnus/gnus-sum.el" "gnus/gnus-topic.el" "gnus/gnus-undo.el"
-;;;;;;  "gnus/gnus-util.el" "gnus/gnus-uu.el" "gnus/gnus-vm.el" "gnus/ietf-drums.el"
+;;;;;;  "eshell/esh-cmd.el" "eshell/esh-ext.el" "eshell/esh-groups.el"
+;;;;;;  "eshell/esh-io.el" "eshell/esh-module.el" "eshell/esh-opt.el"
+;;;;;;  "eshell/esh-proc.el" "eshell/esh-util.el" "eshell/esh-var.el"
+;;;;;;  "ezimage.el" "finder-inf.el" "foldout.el" "font-setting.el"
+;;;;;;  "format-spec.el" "forms-d2.el" "forms-pass.el" "fringe.el"
+;;;;;;  "generic-x.el" "gnus/auth-source.el" "gnus/compface.el" "gnus/gnus-async.el"
+;;;;;;  "gnus/gnus-bcklg.el" "gnus/gnus-cite.el" "gnus/gnus-cus.el"
+;;;;;;  "gnus/gnus-demon.el" "gnus/gnus-dup.el" "gnus/gnus-eform.el"
+;;;;;;  "gnus/gnus-ems.el" "gnus/gnus-int.el" "gnus/gnus-logic.el"
+;;;;;;  "gnus/gnus-mh.el" "gnus/gnus-salt.el" "gnus/gnus-score.el"
+;;;;;;  "gnus/gnus-setup.el" "gnus/gnus-srvr.el" "gnus/gnus-sum.el"
+;;;;;;  "gnus/gnus-topic.el" "gnus/gnus-undo.el" "gnus/gnus-util.el"
+;;;;;;  "gnus/gnus-uu.el" "gnus/gnus-vm.el" "gnus/ietf-drums.el"
 ;;;;;;  "gnus/legacy-gnus-agent.el" "gnus/mail-parse.el" "gnus/mail-prsvr.el"
 ;;;;;;  "gnus/mail-source.el" "gnus/mailcap.el" "gnus/messcompat.el"
 ;;;;;;  "gnus/mm-bodies.el" "gnus/mm-decode.el" "gnus/mm-encode.el"
@@ -31956,19 +31965,18 @@
 ;;;;;;  "progmodes/ebnf-iso.el" "progmodes/ebnf-otz.el" "progmodes/ebnf-yac.el"
 ;;;;;;  "progmodes/idlw-complete-structtag.el" "progmodes/idlw-help.el"
 ;;;;;;  "progmodes/idlw-toolbar.el" "progmodes/mantemp.el" "progmodes/xscheme.el"
-;;;;;;  "ps-def.el" "ps-mule.el" "ps-samp.el" "s-region.el" "saveplace.el"
-;;;;;;  "sb-image.el" "scroll-bar.el" "select.el" "soundex.el" "subdirs.el"
-;;;;;;  "tempo.el" "textmodes/bib-mode.el" "textmodes/makeinfo.el"
-;;;;;;  "textmodes/page-ext.el" "textmodes/refbib.el" "textmodes/refer.el"
-;;;;;;  "textmodes/reftex-auc.el" "textmodes/reftex-dcr.el" "textmodes/reftex-ref.el"
-;;;;;;  "textmodes/reftex-sel.el" "textmodes/reftex-toc.el" "textmodes/texnfo-upd.el"
-;;;;;;  "timezone.el" "tooltip.el" "tree-widget.el" "uniquify.el"
-;;;;;;  "url/url-about.el" "url/url-cookie.el" "url/url-dired.el"
-;;;;;;  "url/url-expand.el" "url/url-ftp.el" "url/url-history.el"
-;;;;;;  "url/url-imap.el" "url/url-methods.el" "url/url-nfs.el" "url/url-proxy.el"
-;;;;;;  "url/url-vars.el" "vc-dav.el" "vcursor.el" "vt-control.el"
-;;;;;;  "vt100-led.el" "w32-fns.el" "w32-vars.el" "x-dnd.el") (19362
-;;;;;;  59828 549715))
+;;;;;;  "ps-def.el" "ps-mule.el" "ps-samp.el" "saveplace.el" "sb-image.el"
+;;;;;;  "scroll-bar.el" "select.el" "soundex.el" "subdirs.el" "tempo.el"
+;;;;;;  "textmodes/bib-mode.el" "textmodes/makeinfo.el" "textmodes/page-ext.el"
+;;;;;;  "textmodes/refbib.el" "textmodes/refer.el" "textmodes/reftex-auc.el"
+;;;;;;  "textmodes/reftex-dcr.el" "textmodes/reftex-ref.el" "textmodes/reftex-sel.el"
+;;;;;;  "textmodes/reftex-toc.el" "textmodes/texnfo-upd.el" "timezone.el"
+;;;;;;  "tooltip.el" "tree-widget.el" "uniquify.el" "url/url-about.el"
+;;;;;;  "url/url-cookie.el" "url/url-dired.el" "url/url-expand.el"
+;;;;;;  "url/url-ftp.el" "url/url-history.el" "url/url-imap.el" "url/url-methods.el"
+;;;;;;  "url/url-nfs.el" "url/url-proxy.el" "url/url-vars.el" "vc-dav.el"
+;;;;;;  "vcursor.el" "vt-control.el" "vt100-led.el" "w32-fns.el"
+;;;;;;  "w32-vars.el" "x-dnd.el") (19375 51700 955763))
 
 ;;;***
 
--- a/lisp/mail/sendmail.el	Fri Mar 26 08:01:19 2010 +0100
+++ b/lisp/mail/sendmail.el	Thu Apr 01 08:50:44 2010 +0200
@@ -417,9 +417,11 @@
 
 ;;;###autoload
 (defcustom mail-default-directory (purecopy "~/")
-  "Directory for mail buffers.
-Value of `default-directory' for mail buffers.
-This directory is used for auto-save files of mail buffers."
+  "Value of `default-directory' for Mail mode buffers.
+This directory is used for auto-save files of Mail mode buffers.
+
+Note that Message mode does not use this variable; it auto-saves
+in `message-auto-save-directory'."
   :type '(directory :tag "Directory")
   :group 'sendmail
   :version "22.1")
--- a/lisp/progmodes/compile.el	Fri Mar 26 08:01:19 2010 +0100
+++ b/lisp/progmodes/compile.el	Thu Apr 01 08:50:44 2010 +0200
@@ -1220,7 +1220,8 @@
 	;; Then evaluate a cd command if any, but don't perform it yet, else
 	;; start-command would do it again through the shell: (cd "..") AND
 	;; sh -c "cd ..; make"
-	(cd (if (string-match "^\\s *cd\\(?:\\s +\\(\\S +?\\)\\)?\\s *[;&\n]" command)
+	(cd (if (string-match "\\`\\s *cd\\(?:\\s +\\(\\S +?\\)\\)?\\s *[;&\n]"
+			      command)
 		(if (match-end 1)
 		    (substitute-env-vars (match-string 1 command))
 		  "~")
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lisp/progmodes/gdb-mi.el	Thu Apr 01 08:50:44 2010 +0200
@@ -0,0 +1,4192 @@
+;;; gdb-mi.el --- User Interface for running GDB
+
+;; Copyright (C) 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
+
+;; Author: Nick Roberts <nickrob@gnu.org>
+;; Maintainer: FSF
+;; Keywords: unix, tools
+
+;; This file is part of GNU Emacs.
+
+;; Homepage: http://www.emacswiki.org/emacs/GDB-MI
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
+
+;;; Credits:
+
+;; This file was written by by Nick Roberts following the general design
+;; used in gdb-ui.el for Emacs 22.1 - 23.1.  It is currently being developed
+;; by Dmitry Dzhus <dima@sphinx.net.ru> as part of the Google Summer
+;; of Code 2009 Project "Emacs GDB/MI migration".
+
+;;; Commentary:
+
+;; This mode acts as a graphical user interface to GDB.  You can interact with
+;; GDB through the GUD buffer in the usual way, but there are also further
+;; buffers which control the execution and describe the state of your program.
+;; It separates the input/output of your program from that of GDB and displays
+;; expressions and their current values in their own buffers.  It also uses
+;; features of Emacs 21 such as the fringe/display margin for breakpoints, and
+;; the toolbar (see the GDB Graphical Interface section in the Emacs info
+;; manual).
+
+;; M-x gdb will start the debugger.
+
+;; This file uses GDB/MI as the primary interface to GDB.  It is still under
+;; development and is part of a process to migrate Emacs from annotations (as
+;; used in gdb-ui.el) to GDB/MI.  It runs gdb with GDB/MI (-interp=mi) and
+;; access CLI using "-interpreter-exec console cli-command".  This code works
+;; without gdb-ui.el and uses MI tokens instead of queues. Eventually MI
+;; should be asynchronous.
+
+;; This mode will PARTLY WORK WITH RECENT GDB RELEASES (status in modeline
+;; doesn't update properly when execution commands are issued from GUD buffer)
+;; and WORKS BEST when GDB runs asynchronously: maint set linux-async on.
+;;
+;; You need development version of GDB 7.0 for the thread buffer to work.
+
+;; This file replaces gdb-ui.el and is for development with GDB.  Use the
+;; release branch of Emacs 22 for the latest version of gdb-ui.el.
+
+;; Windows Platforms:
+
+;; If you are using Emacs and GDB on Windows you will need to flush the buffer
+;; explicitly in your program if you want timely display of I/O in Emacs.
+;; Alternatively you can make the output stream unbuffered, for example, by
+;; using a macro:
+
+;;           #ifdef UNBUFFERED
+;;	     setvbuf (stdout, (char *) NULL, _IONBF, 0);
+;;	     #endif
+
+;; and compiling with -DUNBUFFERED while debugging.
+
+;; If you are using Cygwin GDB and find that the source is not being displayed
+;; in Emacs when you step through it, possible solutions are to:
+
+;;   1) Use Cygwin X Windows and Cygwin Emacs.
+;;        (Since 22.1 Emacs builds under Cygwin.)
+;;   2) Use MinGW GDB instead.
+;;   3) Use cygwin-mount.el
+
+;;; Mac OSX:
+
+;; GDB in Emacs on Mac OSX works best with FSF GDB as Apple have made
+;; some changes to the version that they include as part of Mac OSX.
+;; This requires GDB version 7.0 or later (estimated release date Aug 2009)
+;; as earlier versions don not compile on Mac OSX.
+
+;;; Known Bugs:
+
+;; 1) Stack buffer doesn't parse MI output if you stop in a routine without
+;;    line information, e.g., a routine in libc (just a TODO item).
+
+;; TODO:
+;; 2) Watch windows to work with threads.
+;; 3) Use treebuffer.el instead of the speedbar for watch-expressions?
+;; 4) Mark breakpoint locations on scroll-bar of source buffer?
+
+;;; Code:
+
+(require 'gud)
+(require 'json)
+(require 'bindat)
+(eval-when-compile (require 'cl))
+
+(defvar tool-bar-map)
+(defvar speedbar-initial-expansion-list-name)
+(defvar speedbar-frame)
+
+(defvar	gdb-memory-address "main")
+(defvar	gdb-memory-last-address nil
+  "Last successfully accessed memory address.")
+(defvar	gdb-memory-next-page nil
+  "Address of next memory page for program memory buffer.")
+(defvar	gdb-memory-prev-page nil
+  "Address of previous memory page for program memory buffer.")
+
+(defvar gdb-thread-number nil
+  "Main current thread.
+
+Invalidation triggers use this variable to query GDB for
+information on the specified thread by wrapping GDB/MI commands
+in `gdb-current-context-command'.
+
+This variable may be updated implicitly by GDB via `gdb-stopped'
+or explicitly by `gdb-select-thread'.
+
+Only `gdb-setq-thread-number' should be used to change this
+value.")
+
+(defvar gdb-frame-number nil
+  "Selected frame level for main current thread.
+
+Updated according to the following rules:
+
+When a thread is selected or current thread stops, set to \"0\".
+
+When current thread goes running (and possibly exits eventually),
+set to nil.
+
+May be manually changed by user with `gdb-select-frame'.")
+
+(defvar gdb-frame-address nil "Identity of frame for watch expression.")
+
+;; Used to show overlay arrow in source buffer. All set in
+;; gdb-get-main-selected-frame. Disassembly buffer should not use
+;; these but rely on buffer-local thread information instead.
+(defvar gdb-selected-frame nil
+  "Name of selected function for main current thread.")
+(defvar gdb-selected-file nil
+  "Name of selected file for main current thread.")
+(defvar gdb-selected-line nil
+  "Number of selected line for main current thread.")
+
+(defvar gdb-threads-list nil
+  "Associative list of threads provided by \"-thread-info\" MI command.
+
+Keys are thread numbers (in strings) and values are structures as
+returned from -thread-info by `gdb-json-partial-output'. Updated in
+`gdb-thread-list-handler-custom'.")
+
+(defvar gdb-running-threads-count nil
+  "Number of currently running threads.
+
+Nil means that no information is available.
+
+Updated in `gdb-thread-list-handler-custom'.")
+
+(defvar gdb-stopped-threads-count nil
+  "Number of currently stopped threads.
+
+See also `gdb-running-threads-count'.")
+
+(defvar gdb-breakpoints-list nil
+  "Associative list of breakpoints provided by \"-break-list\" MI command.
+
+Keys are breakpoint numbers (in string) and values are structures
+as returned from \"-break-list\" by `gdb-json-partial-output'
+\(\"body\" field is used). Updated in
+`gdb-breakpoints-list-handler-custom'.")
+
+(defvar gdb-current-language nil)
+(defvar gdb-var-list nil
+  "List of variables in watch window.
+Each element has the form (VARNUM EXPRESSION NUMCHILD TYPE VALUE STATUS HAS_MORE FP)
+where STATUS is nil (`unchanged'), `changed' or `out-of-scope', FP the frame
+address for root variables.")
+(defvar gdb-main-file nil "Source file from which program execution begins.")
+
+;; Overlay arrow markers
+(defvar gdb-stack-position nil)
+(defvar gdb-thread-position nil)
+(defvar gdb-disassembly-position nil)
+
+(defvar gdb-location-alist nil
+  "Alist of breakpoint numbers and full filenames.  Only used for files that
+Emacs can't find.")
+(defvar gdb-active-process nil
+  "GUD tooltips display variable values when t, and macro definitions otherwise.")
+(defvar gdb-error "Non-nil when GDB is reporting an error.")
+(defvar gdb-macro-info nil
+  "Non-nil if GDB knows that the inferior includes preprocessor macro info.")
+(defvar gdb-register-names nil "List of register names.")
+(defvar gdb-changed-registers nil
+  "List of changed register numbers (strings).")
+(defvar gdb-buffer-fringe-width nil)
+(defvar gdb-last-command nil)
+(defvar gdb-prompt-name nil)
+(defvar gdb-token-number 0)
+(defvar gdb-handler-alist '())
+(defvar gdb-handler-number nil)
+(defvar gdb-source-file-list nil
+  "List of source files for the current executable.")
+(defvar gdb-first-done-or-error t)
+(defvar gdb-source-window nil)
+(defvar gdb-inferior-status nil)
+(defvar gdb-continuation nil)
+(defvar gdb-version nil)
+(defvar gdb-filter-output nil
+  "Message to be shown in GUD console.
+
+This variable is updated in `gdb-done-or-error' and returned by
+`gud-gdbmi-marker-filter'.")
+
+(defvar gdb-non-stop nil
+  "Indicates whether current GDB session is using non-stop mode.
+
+It is initialized to `gdb-non-stop-setting' at the beginning of
+every GDB session.")
+
+(defvar gdb-buffer-type nil
+  "One of the symbols bound in `gdb-buffer-rules'.")
+(make-variable-buffer-local 'gdb-buffer-type)
+
+(defvar gdb-output-sink 'nil
+  "The disposition of the output of the current gdb command.
+Possible values are these symbols:
+
+    `user' -- gdb output should be copied to the GUD buffer
+              for the user to see.
+
+    `emacs' -- output should be collected in the partial-output-buffer
+	       for subsequent processing by a command.  This is the
+	       disposition of output generated by commands that
+	       gdb mode sends to gdb on its own behalf.")
+
+;; Pending triggers prevent congestion: Emacs won't send two similar
+;; consecutive requests.
+
+(defvar gdb-pending-triggers '()
+  "A list of trigger functions which have not yet been handled.
+
+Elements are either function names or pairs (buffer . function)")
+
+(defmacro gdb-add-pending (item)
+  `(push ,item gdb-pending-triggers))
+(defmacro gdb-pending-p (item)
+  `(member ,item gdb-pending-triggers))
+(defmacro gdb-delete-pending (item)
+  `(setq gdb-pending-triggers
+         (delete ,item gdb-pending-triggers)))
+
+(defmacro gdb-wait-for-pending (&rest body)
+  "Wait until `gdb-pending-triggers' is empty and evaluate FORM.
+
+This function checks `gdb-pending-triggers' value every
+`gdb-wait-for-pending' seconds."
+  (run-with-timer
+   0.5 nil
+   `(lambda ()
+      (if (not gdb-pending-triggers)
+          (progn ,@body)
+        (gdb-wait-for-pending ,@body)))))
+
+;; Publish-subscribe
+
+(defmacro gdb-add-subscriber (publisher subscriber)
+  "Register new PUBLISHER's SUBSCRIBER.
+
+SUBSCRIBER must be a pair, where cdr is a function of one
+argument (see `gdb-emit-signal')."
+  `(add-to-list ',publisher ,subscriber t))
+
+(defmacro gdb-delete-subscriber (publisher subscriber)
+  "Unregister SUBSCRIBER from PUBLISHER."
+  `(setq ,publisher (delete ,subscriber
+                            ,publisher)))
+
+(defun gdb-get-subscribers (publisher)
+  publisher)
+
+(defun gdb-emit-signal (publisher &optional signal)
+  "Call cdr for each subscriber of PUBLISHER with SIGNAL as argument."
+  (dolist (subscriber (gdb-get-subscribers publisher))
+    (funcall (cdr subscriber) signal)))
+
+(defvar gdb-buf-publisher '()
+  "Used to invalidate GDB buffers by emitting a signal in
+`gdb-update'.
+
+Must be a list of pairs with cars being buffers and cdr's being
+valid signal handlers.")
+
+(defgroup gdb nil
+  "GDB graphical interface"
+  :group 'tools
+  :link '(info-link "(emacs)GDB Graphical Interface")
+  :version "23.2")
+
+(defgroup gdb-non-stop nil
+  "GDB non-stop debugging settings"
+  :group 'gdb
+  :version "23.2")
+
+(defgroup gdb-buffers nil
+  "GDB buffers"
+  :group 'gdb
+  :version "23.2")
+
+(defcustom gdb-debug-log-max 128
+  "Maximum size of `gdb-debug-log'.  If nil, size is unlimited."
+  :group 'gdb
+  :type '(choice (integer :tag "Number of elements")
+		 (const   :tag "Unlimited" nil))
+  :version "22.1")
+
+(defcustom gdb-non-stop-setting t
+  "When in non-stop mode, stopped threads can be examined while
+other threads continue to execute.
+
+GDB session needs to be restarted for this setting to take
+effect."
+  :type 'boolean
+  :group 'gdb-non-stop
+  :version "23.2")
+
+;; TODO Some commands can't be called with --all (give a notice about
+;; it in setting doc)
+(defcustom gdb-gud-control-all-threads t
+  "When enabled, GUD execution commands affect all threads when
+in non-stop mode. Otherwise, only current thread is affected."
+  :type 'boolean
+  :group 'gdb-non-stop
+  :version "23.2")
+
+(defcustom gdb-switch-reasons t
+  "List of stop reasons which cause Emacs to switch to the thread
+which caused the stop. When t, switch to stopped thread no matter
+what the reason was. When nil, never switch to stopped thread
+automatically.
+
+This setting is used in non-stop mode only. In all-stop mode,
+Emacs always switches to the thread which caused the stop."
+  ;; exited, exited-normally and exited-signalled are not
+  ;; thread-specific stop reasons and therefore are not included in
+  ;; this list
+  :type '(choice
+          (const :tag "All reasons" t)
+          (set :tag "Selection of reasons..."
+               (const :tag "A breakpoint was reached." "breakpoint-hit")
+               (const :tag "A watchpoint was triggered." "watchpoint-trigger")
+               (const :tag "A read watchpoint was triggered." "read-watchpoint-trigger")
+               (const :tag "An access watchpoint was triggered." "access-watchpoint-trigger")
+               (const :tag "Function finished execution." "function-finished")
+               (const :tag "Location reached." "location-reached")
+               (const :tag "Watchpoint has gone out of scope" "watchpoint-scope")
+               (const :tag "End of stepping range reached." "end-stepping-range")
+               (const :tag "Signal received (like interruption)." "signal-received"))
+          (const :tag "None" nil))
+  :group 'gdb-non-stop
+  :version "23.2"
+  :link '(info-link "(gdb)GDB/MI Async Records"))
+
+(defcustom gdb-stopped-hooks nil
+  "This variable holds a list of functions to be called whenever
+GDB stops.
+
+Each function takes one argument, a parsed MI response, which
+contains fields of corresponding MI *stopped async record:
+
+    ((stopped-threads . \"all\")
+     (thread-id . \"1\")
+     (frame (line . \"38\")
+            (fullname . \"/home/sphinx/projects/gsoc/server.c\")
+            (file . \"server.c\")
+            (args ((value . \"0x804b038\")
+                   (name . \"arg\")))
+            (func . \"hello\")
+            (addr . \"0x0804869e\"))
+     (reason . \"end-stepping-range\"))
+
+Note that \"reason\" is only present in non-stop debugging mode.
+
+`bindat-get-field' may be used to access the fields of response.
+
+Each function is called after the new current thread was selected
+and GDB buffers were updated in `gdb-stopped'."
+  :type '(repeat function)
+  :group 'gdb
+  :version "23.2"
+  :link '(info-link "(gdb)GDB/MI Async Records"))
+
+(defcustom gdb-switch-when-another-stopped t
+  "When nil, Emacs won't switch to stopped thread if some other
+stopped thread is already selected."
+  :type 'boolean
+  :group 'gdb-non-stop
+  :version "23.2")
+
+(defcustom gdb-stack-buffer-locations t
+  "Show file information or library names in stack buffers."
+  :type 'boolean
+  :group 'gdb-buffers
+  :version "23.2")
+
+(defcustom gdb-stack-buffer-addresses nil
+  "Show frame addresses in stack buffers."
+  :type 'boolean
+  :group 'gdb-buffers
+  :version "23.2")
+
+(defcustom gdb-thread-buffer-verbose-names t
+  "Show long thread names in threads buffer."
+  :type 'boolean
+  :group 'gdb-buffers
+  :version "23.2")
+
+(defcustom gdb-thread-buffer-arguments t
+  "Show function arguments in threads buffer."
+  :type 'boolean
+  :group 'gdb-buffers
+  :version "23.2")
+
+(defcustom gdb-thread-buffer-locations t
+  "Show file information or library names in threads buffer."
+  :type 'boolean
+  :group 'gdb-buffers
+  :version "23.2")
+
+(defcustom gdb-thread-buffer-addresses nil
+  "Show addresses for thread frames in threads buffer."
+  :type 'boolean
+  :group 'gdb-buffers
+  :version "23.2")
+
+(defcustom gdb-show-threads-by-default nil
+  "Show threads list buffer instead of breakpoints list by
+default."
+  :type 'boolean
+  :group 'gdb-buffers
+  :version "23.2")
+
+(defvar gdb-debug-log nil
+  "List of commands sent to and replies received from GDB.
+Most recent commands are listed first.  This list stores only the last
+`gdb-debug-log-max' values.  This variable is used to debug GDB-MI.")
+
+;;;###autoload
+(defcustom gdb-enable-debug nil
+  "Non-nil means record the process input and output in `gdb-debug-log'."
+  :type 'boolean
+  :group 'gdb
+  :version "22.1")
+
+(defcustom gdb-cpp-define-alist-program "gcc -E -dM -"
+  "Shell command for generating a list of defined macros in a source file.
+This list is used to display the #define directive associated
+with an identifier as a tooltip.  It works in a debug session with
+GDB, when `gud-tooltip-mode' is t.
+
+Set `gdb-cpp-define-alist-flags' for any include paths or
+predefined macros."
+  :type 'string
+  :group 'gdb
+  :version "22.1")
+
+(defcustom gdb-cpp-define-alist-flags ""
+  "Preprocessor flags for `gdb-cpp-define-alist-program'."
+  :type 'string
+  :group 'gdb
+  :version "22.1")
+
+ (defcustom gdb-create-source-file-list t
+   "Non-nil means create a list of files from which the executable was built.
+ Set this to nil if the GUD buffer displays \"initializing...\" in the mode
+ line for a long time when starting, possibly because your executable was
+ built from a large number of files.  This allows quicker initialization
+ but means that these files are not automatically enabled for debugging,
+ e.g., you won't be able to click in the fringe to set a breakpoint until
+ execution has already stopped there."
+   :type 'boolean
+   :group 'gdb
+   :version "23.1")
+
+(defcustom gdb-show-main nil
+  "Non-nil means display source file containing the main routine at startup.
+Also display the main routine in the disassembly buffer if present."
+  :type 'boolean
+  :group 'gdb
+  :version "22.1")
+
+(defun gdb-force-mode-line-update (status)
+  (let ((buffer gud-comint-buffer))
+    (if (and buffer (buffer-name buffer))
+	(with-current-buffer buffer
+	  (setq mode-line-process
+		(format ":%s [%s]"
+			(process-status (get-buffer-process buffer)) status))
+	  ;; Force mode line redisplay soon.
+	  (force-mode-line-update)))))
+
+(defun gdb-enable-debug (arg)
+  "Toggle logging of transaction between Emacs and Gdb.
+The log is stored in `gdb-debug-log' as an alist with elements
+whose cons is send, send-item or recv and whose cdr is the string
+being transferred.  This list may grow up to a size of
+`gdb-debug-log-max' after which the oldest element (at the end of
+the list) is deleted every time a new one is added (at the front)."
+  (interactive "P")
+  (setq gdb-enable-debug
+	(if (null arg)
+	    (not gdb-enable-debug)
+	  (> (prefix-numeric-value arg) 0)))
+  (message (format "Logging of transaction %sabled"
+		   (if gdb-enable-debug "en" "dis"))))
+
+;; These two are used for menu and toolbar
+(defun gdb-control-all-threads ()
+  "Switch to non-stop/A mode."
+  (interactive)
+  (setq gdb-gud-control-all-threads t)
+  ;; Actually forcing the tool-bar to update.
+  (force-mode-line-update)
+  (message "Now in non-stop/A mode."))
+
+(defun gdb-control-current-thread ()
+  "Switch to non-stop/T mode."
+  (interactive)
+  (setq gdb-gud-control-all-threads nil)
+  ;; Actually forcing the tool-bar to update.
+  (force-mode-line-update)
+  (message "Now in non-stop/T mode."))
+
+(defun gdb-find-watch-expression ()
+  (let* ((var (nth (- (line-number-at-pos (point)) 2) gdb-var-list))
+	 (varnum (car var)) expr array)
+    (string-match "\\(var[0-9]+\\)\\.\\(.*\\)" varnum)
+    (let ((var1 (assoc (match-string 1 varnum) gdb-var-list)) var2 varnumlet
+	  (component-list (split-string (match-string 2 varnum) "\\." t)))
+      (setq expr (nth 1 var1))
+      (setq varnumlet (car var1))
+      (dolist (component component-list)
+	(setq var2 (assoc varnumlet gdb-var-list))
+	(setq expr (concat expr
+			   (if (string-match ".*\\[[0-9]+\\]$" (nth 3 var2))
+			       (concat "[" component "]")
+			     (concat "." component))))
+	(setq varnumlet (concat varnumlet "." component)))
+      expr)))
+
+;; noall is used for commands which don't take --all, but only
+;; --thread.
+(defun gdb-gud-context-command (command &optional noall)
+  "When `gdb-non-stop' is t, add --thread option to COMMAND if
+`gdb-gud-control-all-threads' is nil and --all option otherwise.
+If NOALL is t, always add --thread option no matter what
+`gdb-gud-control-all-threads' value is.
+
+When `gdb-non-stop' is nil, return COMMAND unchanged."
+  (if gdb-non-stop
+      (if (and gdb-gud-control-all-threads
+               (not noall)
+	       (string-equal gdb-version "7.0+"))
+          (concat command " --all ")
+        (gdb-current-context-command command))
+    command))
+
+(defmacro gdb-gud-context-call (cmd1 &optional cmd2 noall noarg)
+  "`gud-call' wrapper which adds --thread/--all options between
+CMD1 and CMD2. NOALL is the same as in `gdb-gud-context-command'.
+
+NOARG must be t when this macro is used outside `gud-def'"
+  `(gud-call
+    (concat (gdb-gud-context-command ,cmd1 ,noall) " " ,cmd2)
+    ,(when (not noarg) 'arg)))
+
+;;;###autoload
+(defun gdb (command-line)
+  "Run gdb on program FILE in buffer *gud-FILE*.
+The directory containing FILE becomes the initial working directory
+and source-file directory for your debugger.
+
+If `gdb-many-windows' is nil (the default value) then gdb just
+pops up the GUD buffer unless `gdb-show-main' is t.  In this case
+it starts with two windows: one displaying the GUD buffer and the
+other with the source file with the main routine of the inferior.
+
+If `gdb-many-windows' is t, regardless of the value of
+`gdb-show-main', the layout below will appear.  Keybindings are
+shown in some of the buffers.
+
+Watch expressions appear in the speedbar/slowbar.
+
+The following commands help control operation :
+
+`gdb-many-windows'    - Toggle the number of windows gdb uses.
+`gdb-restore-windows' - To restore the window layout.
+
+See Info node `(emacs)GDB Graphical Interface' for a more
+detailed description of this mode.
+
+
++----------------------------------------------------------------------+
+|                               GDB Toolbar                            |
++-----------------------------------+----------------------------------+
+| GUD buffer (I/O of GDB)           | Locals buffer                    |
+|                                   |                                  |
+|                                   |                                  |
+|                                   |                                  |
++-----------------------------------+----------------------------------+
+| Source buffer                     | I/O buffer (of debugged program) |
+|                                   | (comint-mode)                    |
+|                                   |                                  |
+|                                   |                                  |
+|                                   |                                  |
+|                                   |                                  |
+|                                   |                                  |
+|                                   |                                  |
++-----------------------------------+----------------------------------+
+| Stack buffer                      | Breakpoints buffer               |
+| RET      gdb-select-frame         | SPC    gdb-toggle-breakpoint     |
+|                                   | RET    gdb-goto-breakpoint       |
+|                                   | D      gdb-delete-breakpoint     |
++-----------------------------------+----------------------------------+"
+  ;;
+  (interactive (list (gud-query-cmdline 'gdb)))
+
+  (when (and gud-comint-buffer
+	   (buffer-name gud-comint-buffer)
+	   (get-buffer-process gud-comint-buffer)
+	   (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba)))
+	(gdb-restore-windows)
+	(error
+	 "Multiple debugging requires restarting in text command mode"))
+  ;;
+  (gud-common-init command-line nil 'gud-gdbmi-marker-filter)
+  (set (make-local-variable 'gud-minor-mode) 'gdbmi)
+  (setq comint-input-sender 'gdb-send)
+
+  (gud-def gud-tbreak "tbreak %f:%l" "\C-t"
+	   "Set temporary breakpoint at current line.")
+  (gud-def gud-jump
+	   (progn (gud-call "tbreak %f:%l") (gud-call "jump %f:%l"))
+	   "\C-j" "Set execution address to current line.")
+
+  (gud-def gud-up     "up %p"     "<" "Up N stack frames (numeric arg).")
+  (gud-def gud-down   "down %p"   ">" "Down N stack frames (numeric arg).")
+  (gud-def gud-print  "print %e"  "\C-p" "Evaluate C expression at point.")
+  (gud-def gud-pstar  "print* %e" nil
+	   "Evaluate C dereferenced pointer expression at point.")
+
+  (gud-def gud-step   (gdb-gud-context-call "-exec-step" "%p" t)
+           "\C-s"
+	   "Step one source line with display.")
+  (gud-def gud-stepi  (gdb-gud-context-call "-exec-step-instruction" "%p" t)
+           "\C-i"
+	   "Step one instruction with display.")
+  (gud-def gud-next   (gdb-gud-context-call "-exec-next" "%p" t)
+           "\C-n"
+	   "Step one line (skip functions).")
+  (gud-def gud-nexti  (gdb-gud-context-call "-exec-next-instruction" "%p" t)
+           nil
+	   "Step one instruction (skip functions).")
+  (gud-def gud-cont   (gdb-gud-context-call "-exec-continue")
+           "\C-r"
+	   "Continue with display.")
+  (gud-def gud-finish (gdb-gud-context-call "-exec-finish" nil t)
+           "\C-f"
+	   "Finish executing current function.")
+  (gud-def gud-run    "-exec-run"
+           nil
+           "Run the program.")
+
+  (gud-def gud-break (if (not (string-match "Disassembly" mode-name))
+			 (gud-call "break %f:%l" arg)
+		       (save-excursion
+			 (beginning-of-line)
+			 (forward-char 2)
+			 (gud-call "break *%a" arg)))
+	   "\C-b" "Set breakpoint at current line or address.")
+
+  (gud-def gud-remove (if (not (string-match "Disassembly" mode-name))
+			  (gud-call "clear %f:%l" arg)
+			(save-excursion
+			  (beginning-of-line)
+			  (forward-char 2)
+			  (gud-call "clear *%a" arg)))
+	   "\C-d" "Remove breakpoint at current line or address.")
+
+  ;; -exec-until doesn't support --all yet
+  (gud-def gud-until  (if (not (string-match "Disassembly" mode-name))
+			  (gud-call "-exec-until %f:%l" arg)
+			(save-excursion
+			  (beginning-of-line)
+			  (forward-char 2)
+			  (gud-call "-exec-until *%a" arg)))
+	   "\C-u" "Continue to current line or address.")
+  ;; TODO Why arg here?
+  (gud-def
+   gud-go (gud-call (if gdb-active-process
+                        (gdb-gud-context-command "-exec-continue")
+                      "-exec-run") arg)
+   nil "Start or continue execution.")
+
+  ;; For debugging Emacs only.
+  (gud-def gud-pp
+	   (gud-call
+	    (concat
+	     "pp1 " (if (eq (buffer-local-value
+			     'major-mode (window-buffer)) 'speedbar-mode)
+			(gdb-find-watch-expression) "%e")) arg)
+	   nil   "Print the Emacs s-expression.")
+
+  (define-key gud-minor-mode-map [left-margin mouse-1]
+    'gdb-mouse-set-clear-breakpoint)
+  (define-key gud-minor-mode-map [left-fringe mouse-1]
+    'gdb-mouse-set-clear-breakpoint)
+   (define-key gud-minor-mode-map [left-margin C-mouse-1]
+    'gdb-mouse-toggle-breakpoint-margin)
+  (define-key gud-minor-mode-map [left-fringe C-mouse-1]
+    'gdb-mouse-toggle-breakpoint-fringe)
+
+  (define-key gud-minor-mode-map [left-margin drag-mouse-1]
+    'gdb-mouse-until)
+  (define-key gud-minor-mode-map [left-fringe drag-mouse-1]
+    'gdb-mouse-until)
+  (define-key gud-minor-mode-map [left-margin mouse-3]
+    'gdb-mouse-until)
+  (define-key gud-minor-mode-map [left-fringe mouse-3]
+    'gdb-mouse-until)
+
+  (define-key gud-minor-mode-map [left-margin C-drag-mouse-1]
+    'gdb-mouse-jump)
+  (define-key gud-minor-mode-map [left-fringe C-drag-mouse-1]
+    'gdb-mouse-jump)
+  (define-key gud-minor-mode-map [left-fringe C-mouse-3]
+    'gdb-mouse-jump)
+  (define-key gud-minor-mode-map [left-margin C-mouse-3]
+    'gdb-mouse-jump)
+
+  (local-set-key "\C-i" 'gud-gdb-complete-command)
+  (setq gdb-first-prompt t)
+  (setq gud-running nil)
+
+  (gdb-update)
+
+  (run-hooks 'gdb-mode-hook))
+
+(defun gdb-init-1 ()
+  ;; (re-)initialise
+  (setq gdb-selected-frame nil
+	gdb-frame-number nil
+        gdb-thread-number nil
+	gdb-var-list nil
+	gdb-pending-triggers nil
+	gdb-output-sink 'user
+	gdb-location-alist nil
+	gdb-source-file-list nil
+	gdb-last-command nil
+	gdb-token-number 0
+	gdb-handler-alist '()
+	gdb-handler-number nil
+	gdb-prompt-name nil
+	gdb-first-done-or-error t
+	gdb-buffer-fringe-width (car (window-fringes))
+	gdb-debug-log nil
+	gdb-source-window nil
+	gdb-inferior-status nil
+	gdb-continuation nil
+        gdb-buf-publisher '()
+        gdb-threads-list '()
+        gdb-breakpoints-list '()
+        gdb-register-names '()
+        gdb-non-stop gdb-non-stop-setting)
+  ;;
+  (setq gdb-buffer-type 'gdbmi)
+  ;;
+  (gdb-force-mode-line-update
+   (propertize "initializing..." 'face font-lock-variable-name-face))
+
+  (gdb-get-buffer-create 'gdb-inferior-io)
+  (gdb-clear-inferior-io)
+  (set-process-filter (get-process "gdb-inferior") 'gdb-inferior-filter)
+  (gdb-input
+   ;; Needs GDB 6.4 onwards
+   (list (concat "-inferior-tty-set "
+		 (process-tty-name (get-process "gdb-inferior")))
+	 'ignore))
+  (if (eq window-system 'w32)
+      (gdb-input (list "-gdb-set new-console off" 'ignore)))
+  (gdb-input (list "-gdb-set height 0" 'ignore))
+
+  (when gdb-non-stop
+    (gdb-input (list "-gdb-set non-stop 1" 'gdb-non-stop-handler)))
+
+  ;; find source file and compilation directory here
+  (gdb-input
+   ; Needs GDB 6.2 onwards.
+   (list "-file-list-exec-source-files" 'gdb-get-source-file-list))
+  (if gdb-create-source-file-list
+      (gdb-input
+        ; Needs GDB 6.0 onwards.
+       (list "-file-list-exec-source-file" 'gdb-get-source-file)))
+  (gdb-input
+   (list "-gdb-show prompt" 'gdb-get-prompt)))
+
+(defun gdb-non-stop-handler ()
+  (goto-char (point-min))
+  (if (re-search-forward "No symbol" nil t)
+      (progn
+	(message "This version of GDB doesn't support non-stop mode.  Turning it off.")
+	(setq gdb-non-stop nil)
+	(setq gdb-version "pre-7.0"))
+    (setq gdb-version "7.0+")
+    (gdb-input (list "-gdb-set target-async 1" 'ignore))
+    (gdb-input (list "-enable-pretty-printing" 'ignore))))
+
+(defvar gdb-define-alist nil "Alist of #define directives for GUD tooltips.")
+
+(defun gdb-create-define-alist ()
+  "Create an alist of #define directives for GUD tooltips."
+  (let* ((file (buffer-file-name))
+	 (output
+	  (with-output-to-string
+	    (with-current-buffer standard-output
+ 	      (and file
+		   (file-exists-p file)
+ 		   ;; call-process doesn't work with remote file names.
+		   (not (file-remote-p default-directory))
+ 		   (call-process shell-file-name file
+				 (list t nil) nil "-c"
+				 (concat gdb-cpp-define-alist-program " "
+					 gdb-cpp-define-alist-flags))))))
+	(define-list (split-string output "\n" t))
+	(name))
+    (setq gdb-define-alist nil)
+    (dolist (define define-list)
+      (setq name (nth 1 (split-string define "[( ]")))
+      (push (cons name define) gdb-define-alist))))
+
+(declare-function tooltip-show "tooltip" (text &optional use-echo-area))
+(defvar tooltip-use-echo-area)
+
+(defun gdb-tooltip-print (expr)
+   (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer)
+     (goto-char (point-min))
+     (if (re-search-forward ".*value=\\(\".*\"\\)" nil t)
+	 (tooltip-show
+	  (concat expr " = " (read (match-string 1)))
+	  (or gud-tooltip-echo-area tooltip-use-echo-area
+	      (not (display-graphic-p)))))))
+
+;; If expr is a macro for a function don't print because of possible dangerous
+;; side-effects. Also printing a function within a tooltip generates an
+;; unexpected starting annotation (phase error).
+(defun gdb-tooltip-print-1 (expr)
+  (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer)
+    (goto-char (point-min))
+    (if (search-forward "expands to: " nil t)
+	(unless (looking-at "\\S-+.*(.*).*")
+	  (gdb-input
+	   (list  (concat "-data-evaluate-expression " expr)
+		  `(lambda () (gdb-tooltip-print ,expr))))))))
+
+(defun gdb-init-buffer ()
+  (set (make-local-variable 'gud-minor-mode) 'gdbmi)
+  (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
+  (when gud-tooltip-mode
+    (make-local-variable 'gdb-define-alist)
+    (gdb-create-define-alist)
+    (add-hook 'after-save-hook 'gdb-create-define-alist nil t)))
+
+(defmacro gdb-if-arrow (arrow-position &rest body)
+  `(if ,arrow-position
+      (let ((buffer (marker-buffer ,arrow-position)) (line))
+	(if (equal buffer (window-buffer (posn-window end)))
+	    (with-current-buffer buffer
+	      (when (or (equal start end)
+			(equal (posn-point start)
+			       (marker-position ,arrow-position)))
+		,@body))))))
+
+(defun gdb-mouse-until (event)
+  "Continue running until a source line past the current line.
+The destination source line can be selected either by clicking
+with mouse-3 on the fringe/margin or dragging the arrow
+with mouse-1 (default bindings)."
+  (interactive "e")
+  (let ((start (event-start event))
+	(end (event-end event)))
+    (gdb-if-arrow gud-overlay-arrow-position
+		  (setq line (line-number-at-pos (posn-point end)))
+		  (gud-call (concat "until " (number-to-string line))))
+    (gdb-if-arrow gdb-disassembly-position
+		  (save-excursion
+		    (goto-char (point-min))
+		    (forward-line (1- (line-number-at-pos (posn-point end))))
+		    (forward-char 2)
+		    (gud-call (concat "until *%a"))))))
+
+(defun gdb-mouse-jump (event)
+  "Set execution address/line.
+The destination source line can be selected either by clicking with C-mouse-3
+on the fringe/margin or dragging the arrow with C-mouse-1 (default bindings).
+Unlike `gdb-mouse-until' the destination address can be before the current
+line, and no execution takes place."
+  (interactive "e")
+  (let ((start (event-start event))
+	(end (event-end event)))
+    (gdb-if-arrow gud-overlay-arrow-position
+		  (setq line (line-number-at-pos (posn-point end)))
+		  (progn
+		    (gud-call (concat "tbreak " (number-to-string line)))
+		    (gud-call (concat "jump " (number-to-string line)))))
+    (gdb-if-arrow gdb-disassembly-position
+		  (save-excursion
+		    (goto-char (point-min))
+		    (forward-line (1- (line-number-at-pos (posn-point end))))
+		    (forward-char 2)
+		    (progn
+		      (gud-call (concat "tbreak *%a"))
+		      (gud-call (concat "jump *%a")))))))
+
+(defcustom gdb-show-changed-values t
+  "If non-nil change the face of out of scope variables and changed values.
+Out of scope variables are suppressed with `shadow' face.
+Changed values are highlighted with the face `font-lock-warning-face'."
+  :type 'boolean
+  :group 'gdb
+  :version "22.1")
+
+(defcustom gdb-max-children 40
+  "Maximum number of children before expansion requires confirmation."
+  :type 'integer
+  :group 'gdb
+  :version "22.1")
+
+(defcustom gdb-delete-out-of-scope t
+  "If non-nil delete watch expressions automatically when they go out of scope."
+  :type 'boolean
+  :group 'gdb
+  :version "22.2")
+
+(defcustom gdb-speedbar-auto-raise nil
+  "If non-nil raise speedbar every time display of watch expressions is\
+ updated."
+  :type 'boolean
+  :group 'gdb
+  :version "22.1")
+
+(defcustom gdb-use-colon-colon-notation nil
+  "If non-nil use FUN::VAR format to display variables in the speedbar."
+  :type 'boolean
+  :group 'gdb
+  :version "22.1")
+
+(defun gdb-speedbar-auto-raise (arg)
+  "Toggle automatic raising of the speedbar for watch expressions.
+With prefix argument ARG, automatically raise speedbar if ARG is
+positive, otherwise don't automatically raise it."
+  (interactive "P")
+  (setq gdb-speedbar-auto-raise
+	(if (null arg)
+	    (not gdb-speedbar-auto-raise)
+	  (> (prefix-numeric-value arg) 0)))
+  (message (format "Auto raising %sabled"
+		   (if gdb-speedbar-auto-raise "en" "dis"))))
+
+(define-key gud-minor-mode-map "\C-c\C-w" 'gud-watch)
+(define-key global-map (concat gud-key-prefix "\C-w") 'gud-watch)
+
+(declare-function tooltip-identifier-from-point "tooltip" (point))
+
+(defun gud-watch (&optional arg event)
+  "Watch expression at point.
+With arg, enter name of variable to be watched in the minibuffer."
+  (interactive (list current-prefix-arg last-input-event))
+  (let ((minor-mode (buffer-local-value 'gud-minor-mode gud-comint-buffer)))
+    (if (eq minor-mode 'gdbmi)
+	(progn
+	  (if event (posn-set-point (event-end event)))
+	  (require 'tooltip)
+	  (save-selected-window
+	    (let ((expr
+		   (if arg
+		       (completing-read "Name of variable: "
+					'gud-gdb-complete-command)
+		     (if (and transient-mark-mode mark-active)
+			 (buffer-substring (region-beginning) (region-end))
+		       (concat (if (eq major-mode 'gdb-registers-mode) "$")
+			       (tooltip-identifier-from-point (point)))))))
+	      (set-text-properties 0 (length expr) nil expr)
+	      (gdb-input
+	       (list (concat"-var-create - * "  expr "")
+		     `(lambda () (gdb-var-create-handler ,expr)))))))
+      (message "gud-watch is a no-op in this mode."))))
+
+(defun gdb-var-create-handler (expr)
+  (let* ((result (gdb-json-partial-output)))
+    (if (not (bindat-get-field result 'msg))
+        (let ((var
+	       (list (bindat-get-field result 'name)
+		     (if (and (string-equal gdb-current-language "c")
+			      gdb-use-colon-colon-notation gdb-selected-frame)
+			 (setq expr (concat gdb-selected-frame "::" expr))
+		       expr)
+		     (bindat-get-field result 'numchild)
+		     (bindat-get-field result 'type)
+		     (bindat-get-field result 'value)
+		     nil
+		     (bindat-get-field result 'has_more)
+		      gdb-frame-address)))
+	  (push var gdb-var-list)
+	  (speedbar 1)
+	  (unless (string-equal
+		   speedbar-initial-expansion-list-name "GUD")
+	    (speedbar-change-initial-expansion-list "GUD")))
+      (message-box "No symbol \"%s\" in current context." expr))))
+
+(defun gdb-speedbar-update ()
+  (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame)
+	     (not (gdb-pending-p 'gdb-speedbar-timer)))
+    ;; Dummy command to update speedbar even when idle.
+    (gdb-input (list "-environment-pwd" 'gdb-speedbar-timer-fn))
+    ;; Keep gdb-pending-triggers non-nil till end.
+    (gdb-add-pending 'gdb-speedbar-timer)))
+
+(defun gdb-speedbar-timer-fn ()
+  (if gdb-speedbar-auto-raise
+      (raise-frame speedbar-frame))
+  (gdb-delete-pending 'gdb-speedbar-timer)
+  (speedbar-timer-fn))
+
+(defun gdb-var-evaluate-expression-handler (varnum changed)
+  (goto-char (point-min))
+  (re-search-forward ".*value=\\(\".*\"\\)" nil t)
+  (let ((var (assoc varnum gdb-var-list)))
+    (when var
+      (if changed (setcar (nthcdr 5 var) 'changed))
+      (setcar (nthcdr 4 var) (read (match-string 1)))))
+  (gdb-speedbar-update))
+
+; Uses "-var-list-children --all-values".  Needs GDB 6.1 onwards.
+(defun gdb-var-list-children (varnum)
+  (gdb-input
+   (list (concat "-var-update " varnum) 'ignore))
+  (gdb-input
+   (list (concat "-var-list-children --all-values "
+		varnum)
+	     `(lambda () (gdb-var-list-children-handler ,varnum)))))
+
+(defun gdb-var-list-children-handler (varnum)
+  (let* ((var-list nil)
+	 (output (bindat-get-field (gdb-json-partial-output "child")))
+	 (children (bindat-get-field output 'children)))
+   (catch 'child-already-watched
+      (dolist (var gdb-var-list)
+	(if (string-equal varnum (car var))
+	    (progn
+	      ;; With dynamic varobjs numchild may have increased.
+	      (setcar (nthcdr 2 var) (bindat-get-field output 'numchild))
+	      (push var var-list)
+	      (dolist (child children)
+		(let ((varchild (list (bindat-get-field child 'name)
+				      (bindat-get-field child 'exp)
+				      (bindat-get-field child 'numchild)
+				      (bindat-get-field child 'type)
+				      (bindat-get-field child 'value)
+				      nil
+				      (bindat-get-field child 'has_more))))
+		  (if (assoc (car varchild) gdb-var-list)
+		      (throw 'child-already-watched nil))
+		  (push varchild var-list))))
+	  (push var var-list)))
+      (setq gdb-var-list (nreverse var-list))))
+  (gdb-speedbar-update))
+
+(defun gdb-var-set-format (format)
+  "Set the output format for a variable displayed in the speedbar."
+  (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list))
+	 (varnum (car var)))
+    (gdb-input
+     (list (concat "-var-set-format " varnum " " format) 'ignore))
+    (gdb-var-update)))
+
+(defun gdb-var-delete-1 (var varnum)
+  (gdb-input
+   (list (concat "-var-delete " varnum) 'ignore))
+  (setq gdb-var-list (delq var gdb-var-list))
+  (dolist (varchild gdb-var-list)
+    (if (string-match (concat (car var) "\\.") (car varchild))
+	(setq gdb-var-list (delq varchild gdb-var-list)))))
+
+(defun gdb-var-delete ()
+  "Delete watch expression at point from the speedbar."
+  (interactive)
+  (let ((text (speedbar-line-text)))
+    (string-match "\\(\\S-+\\)" text)
+       (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list))
+	      (varnum (car var)))
+	 (if (string-match "\\." (car var))
+	     (message-box "Can only delete a root expression")
+	   (gdb-var-delete-1 var varnum)))))
+
+(defun gdb-var-delete-children (varnum)
+  "Delete children of variable object at point from the speedbar."
+  (gdb-input
+   (list (concat "-var-delete -c " varnum) 'ignore)))
+
+(defun gdb-edit-value (text token indent)
+  "Assign a value to a variable displayed in the speedbar."
+  (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list))
+	 (varnum (car var)) (value))
+    (setq value (read-string "New value: "))
+    (gdb-input
+     (list (concat "-var-assign " varnum " " value)
+	   `(lambda () (gdb-edit-value-handler ,value))))))
+
+(defconst gdb-error-regexp "\\^error,msg=\\(\".+\"\\)")
+
+(defun gdb-edit-value-handler (value)
+  (goto-char (point-min))
+  (if (re-search-forward gdb-error-regexp nil t)
+      (message-box "Invalid number or expression (%s)" value)))
+
+; Uses "-var-update --all-values".  Needs GDB 6.4 onwards.
+(defun gdb-var-update ()
+  (if (not (gdb-pending-p 'gdb-var-update))
+      (gdb-input
+       (list "-var-update --all-values *" 'gdb-var-update-handler)))
+  (gdb-add-pending 'gdb-var-update))
+
+(defun gdb-var-update-handler ()
+  (let ((changelist (bindat-get-field (gdb-json-partial-output) 'changelist)))
+    (dolist (var gdb-var-list)
+      (setcar (nthcdr 5 var) nil))
+    (let ((temp-var-list gdb-var-list))
+      (dolist (change changelist)
+	(let* ((varnum (bindat-get-field change 'name))
+	       (var (assoc varnum gdb-var-list))
+	       (new-num (bindat-get-field change 'new_num_children)))
+	  (when var
+	    (let ((scope (bindat-get-field change 'in_scope))
+		  (has-more (bindat-get-field change 'has_more)))
+	      (cond ((string-equal scope "false")
+		     (if gdb-delete-out-of-scope
+			 (gdb-var-delete-1 var varnum)
+		       (setcar (nthcdr 5 var) 'out-of-scope)))
+		    ((string-equal scope "true")
+		     (setcar (nthcdr 6 var) has-more)
+		     (when (and (or (not has-more)
+				    (string-equal has-more "0"))
+				(not new-num)
+				(string-equal (nth 2 var) "0"))
+		       (setcar (nthcdr 4 var)
+			       (bindat-get-field change 'value))
+		       (setcar (nthcdr 5 var) 'changed)))
+		    ((string-equal scope "invalid")
+		     (gdb-var-delete-1 var varnum)))))
+	  (let ((var-list nil) var1
+		(children (bindat-get-field change 'new_children)))
+	    (if new-num
+		(progn
+		  (setq var1 (pop temp-var-list))
+		  (while var1
+		    (if (string-equal varnum (car var1))
+			(let ((new (string-to-number new-num))
+			      (previous (string-to-number (nth 2 var1))))
+			  (setcar (nthcdr 2 var1) new-num)
+			  (push var1 var-list)
+			  (cond ((> new previous)
+				 ;; Add new children to list.
+				 (dotimes (dummy previous)
+				   (push (pop temp-var-list) var-list))
+				 (dolist (child children)
+				   (let ((varchild
+					  (list (bindat-get-field child 'name)
+						(bindat-get-field child 'exp)
+						(bindat-get-field child 'numchild)
+						(bindat-get-field child 'type)
+						(bindat-get-field child 'value)
+						'changed
+						(bindat-get-field child 'has_more))))
+				     (push varchild var-list))))
+				;; Remove deleted children from list.
+				((< new previous)
+				 (dotimes (dummy new)
+				     (push (pop temp-var-list) var-list))
+				 (dotimes (dummy (- previous new))
+				     (pop temp-var-list)))))
+		      (push var1 var-list))
+		    (setq var1 (pop temp-var-list)))
+		  (setq gdb-var-list (nreverse var-list)))))))))
+  (setq gdb-pending-triggers
+	(delq 'gdb-var-update gdb-pending-triggers))
+  (gdb-speedbar-update))
+
+(defun gdb-speedbar-expand-node (text token indent)
+  "Expand the node the user clicked on.
+TEXT is the text of the button we clicked on, a + or - item.
+TOKEN is data related to this node.
+INDENT is the current indentation depth."
+  (cond ((string-match "+" text)        ;expand this node
+	 (let* ((var (assoc token gdb-var-list))
+		(expr (nth 1 var)) (children (nth 2 var)))
+	   (if (or (<= (string-to-number children) gdb-max-children)
+		   (y-or-n-p
+		    (format "%s has %s children. Continue? " expr children)))
+	       (gdb-var-list-children token))))
+	((string-match "-" text)	;contract this node
+	 (dolist (var gdb-var-list)
+	   (if (string-match (concat token "\\.") (car var))
+	       (setq gdb-var-list (delq var gdb-var-list))))
+	 (gdb-var-delete-children token)
+	 (speedbar-change-expand-button-char ?+)
+	 (speedbar-delete-subblock indent))
+	(t (error "Ooops...  not sure what to do")))
+  (speedbar-center-buffer-smartly))
+
+(defun gdb-get-target-string ()
+  (with-current-buffer gud-comint-buffer
+    gud-target-name))
+
+
+;;
+;; gdb buffers.
+;;
+;; Each buffer has a TYPE -- a symbol that identifies the function
+;; of that particular buffer.
+;;
+;; The usual gdb interaction buffer is given the type `gdbmi' and
+;; is constructed specially.
+;;
+;; Others are constructed by gdb-get-buffer-create and
+;; named according to the rules set forth in the gdb-buffer-rules
+
+(defvar gdb-buffer-rules '())
+
+(defun gdb-rules-name-maker (rules-entry)
+  (cadr rules-entry))
+(defun gdb-rules-buffer-mode (rules-entry)
+  (nth 2 rules-entry))
+(defun gdb-rules-update-trigger (rules-entry)
+  (nth 3 rules-entry))
+
+(defun gdb-update-buffer-name ()
+  "Rename current buffer according to name-maker associated with
+it in `gdb-buffer-rules'."
+  (let ((f (gdb-rules-name-maker (assoc gdb-buffer-type
+                                        gdb-buffer-rules))))
+    (when f (rename-buffer (funcall f)))))
+
+(defun gdb-current-buffer-rules ()
+  "Get `gdb-buffer-rules' entry for current buffer type."
+  (assoc gdb-buffer-type gdb-buffer-rules))
+
+(defun gdb-current-buffer-thread ()
+  "Get thread object of current buffer from `gdb-threads-list'.
+
+When current buffer is not bound to any thread, return main
+thread."
+  (cdr (assoc gdb-thread-number gdb-threads-list)))
+
+(defun gdb-current-buffer-frame ()
+  "Get current stack frame object for thread of current buffer."
+  (bindat-get-field (gdb-current-buffer-thread) 'frame))
+
+(defun gdb-buffer-type (buffer)
+  "Get value of `gdb-buffer-type' for BUFFER."
+  (with-current-buffer buffer
+    gdb-buffer-type))
+
+(defun gdb-buffer-shows-main-thread-p ()
+  "Return t if current GDB buffer shows main selected thread and
+is not bound to it."
+  (current-buffer)
+  (not (local-variable-p 'gdb-thread-number)))
+
+(defun gdb-get-buffer (buffer-type &optional thread)
+  "Get a specific GDB buffer.
+
+In that buffer, `gdb-buffer-type' must be equal to BUFFER-TYPE
+and `gdb-thread-number' (if provided) must be equal to THREAD."
+  (catch 'found
+    (dolist (buffer (buffer-list) nil)
+      (with-current-buffer buffer
+        (when (and (eq gdb-buffer-type buffer-type)
+                   (or (not thread)
+                       (equal gdb-thread-number thread)))
+          (throw 'found buffer))))))
+
+(defun gdb-get-buffer-create (buffer-type &optional thread)
+  "Create a new GDB buffer of the type specified by BUFFER-TYPE.
+The buffer-type should be one of the cars in `gdb-buffer-rules'.
+
+If THREAD is non-nil, it is assigned to `gdb-thread-number'
+buffer-local variable of the new buffer.
+
+Buffer mode and name are selected according to buffer type.
+
+If buffer has trigger associated with it in `gdb-buffer-rules',
+this trigger is subscribed to `gdb-buf-publisher' and called with
+'update argument."
+  (or (gdb-get-buffer buffer-type thread)
+      (let ((rules (assoc buffer-type gdb-buffer-rules))
+            (new (generate-new-buffer "limbo")))
+	(with-current-buffer new
+	  (let ((mode (gdb-rules-buffer-mode rules))
+                (trigger (gdb-rules-update-trigger rules)))
+	    (when mode (funcall mode))
+	    (setq gdb-buffer-type buffer-type)
+            (when thread
+              (set (make-local-variable 'gdb-thread-number) thread))
+	    (set (make-local-variable 'gud-minor-mode)
+		 (buffer-local-value 'gud-minor-mode gud-comint-buffer))
+	    (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
+            (rename-buffer (funcall (gdb-rules-name-maker rules)))
+	    (when trigger
+              (gdb-add-subscriber gdb-buf-publisher
+                                  (cons (current-buffer)
+                                        (gdb-bind-function-to-buffer trigger (current-buffer))))
+              (funcall trigger 'start))
+            (current-buffer))))))
+
+(defun gdb-bind-function-to-buffer (expr buffer)
+  "Return a function which will evaluate EXPR in BUFFER."
+  `(lambda (&rest args)
+     (with-current-buffer ,buffer
+       (apply ',expr args))))
+
+;; Used to define all gdb-frame-*-buffer functions except
+;; `gdb-frame-io-buffer'
+(defmacro def-gdb-frame-for-buffer (name buffer &optional doc)
+  "Define a function NAME which shows gdb BUFFER in a separate frame.
+
+DOC is an optional documentation string."
+  `(defun ,name (&optional thread)
+     ,(when doc doc)
+     (interactive)
+     (let ((special-display-regexps (append special-display-regexps '(".*")))
+           (special-display-frame-alist gdb-frame-parameters))
+       (display-buffer (gdb-get-buffer-create ,buffer thread)))))
+
+(defmacro def-gdb-display-buffer (name buffer &optional doc)
+  "Define a function NAME which shows gdb BUFFER.
+
+DOC is an optional documentation string."
+  `(defun ,name (&optional thread)
+     ,(when doc doc)
+     (interactive)
+     (gdb-display-buffer
+      (gdb-get-buffer-create ,buffer thread) t)))
+
+;; Used to display windows with thread-bound buffers
+(defmacro def-gdb-preempt-display-buffer (name buffer &optional doc
+					       split-horizontal)
+  `(defun ,name (&optional thread)
+     ,(when doc doc)
+     (message thread)
+     (gdb-preempt-existing-or-display-buffer
+      (gdb-get-buffer-create ,buffer thread)
+      ,split-horizontal)))
+
+;; This assoc maps buffer type symbols to rules.  Each rule is a list of
+;; at least one and possible more functions.  The functions have these
+;; roles in defining a buffer type:
+;;
+;;     NAME - Return a name for this  buffer type.
+;;
+;; The remaining function(s) are optional:
+;;
+;;     MODE - called in a new buffer with no arguments, should establish
+;;	      the proper mode for the buffer.
+;;
+
+(defun gdb-set-buffer-rules (buffer-type &rest rules)
+  (let ((binding (assoc buffer-type gdb-buffer-rules)))
+    (if binding
+	(setcdr binding rules)
+      (push (cons buffer-type rules)
+	    gdb-buffer-rules))))
+
+(defun gdb-parent-mode ()
+  "Generic mode to derive all other GDB buffer modes from."
+  (kill-all-local-variables)
+  (setq buffer-read-only t)
+  (buffer-disable-undo)
+  ;; Delete buffer from gdb-buf-publisher when it's killed
+  ;; (if it has an associated update trigger)
+  (add-hook
+   'kill-buffer-hook
+   (function
+    (lambda ()
+      (let ((trigger (gdb-rules-update-trigger
+                      (gdb-current-buffer-rules))))
+        (when trigger
+          (gdb-delete-subscriber
+           gdb-buf-publisher
+           ;; This should match gdb-add-subscriber done in
+           ;; gdb-get-buffer-create
+           (cons (current-buffer)
+                 (gdb-bind-function-to-buffer trigger (current-buffer))))))))
+   nil t))
+
+;; Partial-output buffer : This accumulates output from a command executed on
+;; behalf of emacs (rather than the user).
+;;
+(gdb-set-buffer-rules 'gdb-partial-output-buffer
+		      'gdb-partial-output-name)
+
+(defun gdb-partial-output-name ()
+  (concat " *partial-output-"
+	  (gdb-get-target-string)
+	  "*"))
+
+
+(gdb-set-buffer-rules 'gdb-inferior-io
+		      'gdb-inferior-io-name
+		      'gdb-inferior-io-mode)
+
+(defun gdb-inferior-io-name ()
+  (concat "*input/output of "
+	  (gdb-get-target-string)
+	  "*"))
+
+(defun gdb-display-io-buffer ()
+  "Display IO of debugged program in a separate window."
+  (interactive)
+  (gdb-display-buffer
+   (gdb-get-buffer-create 'gdb-inferior-io) t))
+
+(defconst gdb-frame-parameters
+  '((height . 14) (width . 80)
+    (unsplittable . t)
+    (tool-bar-lines . nil)
+    (menu-bar-lines . nil)
+    (minibuffer . nil)))
+
+(defun gdb-frame-io-buffer ()
+  "Display IO of debugged program in a new frame."
+  (interactive)
+  (let ((special-display-regexps (append special-display-regexps '(".*")))
+	(special-display-frame-alist gdb-frame-parameters))
+    (display-buffer (gdb-get-buffer-create 'gdb-inferior-io))))
+
+(defvar gdb-inferior-io-mode-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map "\C-c\C-c" 'gdb-io-interrupt)
+    (define-key map "\C-c\C-z" 'gdb-io-stop)
+    (define-key map "\C-c\C-\\" 'gdb-io-quit)
+    (define-key map "\C-c\C-d" 'gdb-io-eof)
+    (define-key map "\C-d" 'gdb-io-eof)
+    map))
+
+;; We want to use comint because it has various nifty and familiar features.
+(define-derived-mode gdb-inferior-io-mode comint-mode "Inferior I/O"
+  "Major mode for gdb inferior-io.
+
+The following commands are available:
+\\{gdb-inferior-io-mode-map}"
+
+  :syntax-table nil :abbrev-table nil
+
+(make-comint-in-buffer "gdb-inferior" (current-buffer)  nil))
+
+(defun gdb-inferior-filter (proc string)
+  (unless (string-equal string "")
+    (gdb-display-buffer (gdb-get-buffer-create 'gdb-inferior-io) t))
+  (with-current-buffer (gdb-get-buffer-create 'gdb-inferior-io)
+    (comint-output-filter proc string)))
+
+(defun gdb-io-interrupt ()
+  "Interrupt the program being debugged."
+  (interactive)
+  (interrupt-process
+   (get-buffer-process gud-comint-buffer) comint-ptyp))
+
+(defun gdb-io-quit ()
+  "Send quit signal to the program being debugged."
+  (interactive)
+  (quit-process
+   (get-buffer-process gud-comint-buffer) comint-ptyp))
+
+(defun gdb-io-stop ()
+  "Stop the program being debugged."
+  (interactive)
+  (stop-process
+   (get-buffer-process gud-comint-buffer) comint-ptyp))
+
+(defun gdb-io-eof ()
+  "Send end-of-file to the program being debugged."
+  (interactive)
+  (process-send-eof
+   (get-buffer-process gud-comint-buffer)))
+
+(defun gdb-clear-inferior-io ()
+  (with-current-buffer (gdb-get-buffer-create 'gdb-inferior-io)
+    (erase-buffer)))
+
+
+(defconst breakpoint-xpm-data
+  "/* XPM */
+static char *magick[] = {
+/* columns rows colors chars-per-pixel */
+\"10 10 2 1\",
+\"  c red\",
+\"+ c None\",
+/* pixels */
+\"+++    +++\",
+\"++      ++\",
+\"+        +\",
+\"          \",
+\"          \",
+\"          \",
+\"          \",
+\"+        +\",
+\"++      ++\",
+\"+++    +++\",
+};"
+  "XPM data used for breakpoint icon.")
+
+(defconst breakpoint-enabled-pbm-data
+  "P1
+10 10\",
+0 0 0 0 1 1 1 1 0 0 0 0
+0 0 0 1 1 1 1 1 1 0 0 0
+0 0 1 1 1 1 1 1 1 1 0 0
+0 1 1 1 1 1 1 1 1 1 1 0
+0 1 1 1 1 1 1 1 1 1 1 0
+0 1 1 1 1 1 1 1 1 1 1 0
+0 1 1 1 1 1 1 1 1 1 1 0
+0 0 1 1 1 1 1 1 1 1 0 0
+0 0 0 1 1 1 1 1 1 0 0 0
+0 0 0 0 1 1 1 1 0 0 0 0"
+  "PBM data used for enabled breakpoint icon.")
+
+(defconst breakpoint-disabled-pbm-data
+  "P1
+10 10\",
+0 0 1 0 1 0 1 0 0 0
+0 1 0 1 0 1 0 1 0 0
+1 0 1 0 1 0 1 0 1 0
+0 1 0 1 0 1 0 1 0 1
+1 0 1 0 1 0 1 0 1 0
+0 1 0 1 0 1 0 1 0 1
+1 0 1 0 1 0 1 0 1 0
+0 1 0 1 0 1 0 1 0 1
+0 0 1 0 1 0 1 0 1 0
+0 0 0 1 0 1 0 1 0 0"
+  "PBM data used for disabled breakpoint icon.")
+
+(defvar breakpoint-enabled-icon nil
+  "Icon for enabled breakpoint in display margin.")
+
+(defvar breakpoint-disabled-icon nil
+  "Icon for disabled breakpoint in display margin.")
+
+(declare-function define-fringe-bitmap "fringe.c"
+		  (bitmap bits &optional height width align))
+
+(and (display-images-p)
+     ;; Bitmap for breakpoint in fringe
+     (define-fringe-bitmap 'breakpoint
+       "\x3c\x7e\xff\xff\xff\xff\x7e\x3c")
+     ;; Bitmap for gud-overlay-arrow in fringe
+     (define-fringe-bitmap 'hollow-right-triangle
+       "\xe0\x90\x88\x84\x84\x88\x90\xe0"))
+
+(defface breakpoint-enabled
+  '((t
+     :foreground "red1"
+     :weight bold))
+  "Face for enabled breakpoint icon in fringe."
+  :group 'gdb)
+
+(defface breakpoint-disabled
+  '((((class color) (min-colors 88)) :foreground "grey70")
+    ;; Ensure that on low-color displays that we end up something visible.
+    (((class color) (min-colors 8) (background light))
+     :foreground "black")
+    (((class color) (min-colors 8) (background dark))
+     :foreground "white")
+    (((type tty) (class mono))
+     :inverse-video t)
+    (t :background "gray"))
+  "Face for disabled breakpoint icon in fringe."
+  :group 'gdb)
+
+
+(defun gdb-send (proc string)
+  "A comint send filter for gdb."
+  (with-current-buffer gud-comint-buffer
+    (let ((inhibit-read-only t))
+      (remove-text-properties (point-min) (point-max) '(face))))
+  ;; mimic <RET> key to repeat previous command in GDB
+  (if (not (string= "" string))
+      (setq gdb-last-command string)
+    (if gdb-last-command (setq string gdb-last-command)))
+  (if gdb-enable-debug
+      (push (cons 'mi-send (concat string "\n")) gdb-debug-log))
+  (if (string-match "^-" string)
+      ;; MI command
+      (progn
+	(setq gdb-first-done-or-error t)
+	(process-send-string proc (concat string "\n")))
+    ;; CLI command
+    (if (string-match "\\\\$" string)
+	(setq gdb-continuation (concat gdb-continuation string "\n"))
+      (setq gdb-first-done-or-error t)
+      (process-send-string proc (concat "-interpreter-exec console \""
+					gdb-continuation string "\"\n"))
+      (setq gdb-continuation nil))))
+
+(defun gdb-input (item)
+  (if gdb-enable-debug (push (cons 'send-item item) gdb-debug-log))
+  (setq gdb-token-number (1+ gdb-token-number))
+  (setcar item (concat (number-to-string gdb-token-number) (car item)))
+  (push (cons gdb-token-number (car (cdr item))) gdb-handler-alist)
+  (process-send-string (get-buffer-process gud-comint-buffer)
+		       (concat (car item) "\n")))
+
+;; NOFRAME is used for gud execution control commands
+(defun gdb-current-context-command (command)
+  "Add --thread to gdb COMMAND when needed."
+  (if (and gdb-thread-number
+	   (string-equal gdb-version "7.0+"))
+      (concat command " --thread " gdb-thread-number)
+    command))
+
+(defun gdb-current-context-buffer-name (name)
+  "Add thread information and asterisks to string NAME.
+
+If `gdb-thread-number' is nil, just wrap NAME in asterisks."
+  (concat "*" name
+          (if (local-variable-p 'gdb-thread-number)
+              (format " (bound to thread %s)" gdb-thread-number)
+            "")
+          "*"))
+
+(defun gdb-current-context-mode-name (mode)
+  "Add thread information to MODE which is to be used as
+`mode-name'."
+  (concat mode
+          (if gdb-thread-number
+              (format " [thread %s]" gdb-thread-number)
+            "")))
+
+
+(defcustom gud-gdb-command-name "gdb -i=mi"
+  "Default command to execute an executable under the GDB debugger."
+  :type 'string
+  :group 'gdb)
+
+(defun gdb-resync()
+  (setq gud-running nil)
+  (setq gdb-output-sink 'user)
+  (setq gdb-pending-triggers nil))
+
+(defun gdb-update ()
+  "Update buffers showing status of debug session."
+  (when gdb-first-prompt
+    (gdb-force-mode-line-update
+     (propertize "initializing..." 'face font-lock-variable-name-face))
+    (gdb-init-1)
+    (setq gdb-first-prompt nil))
+
+  (gdb-get-main-selected-frame)
+  ;; We may need to update gdb-threads-list so we can use
+  (gdb-get-buffer-create 'gdb-threads-buffer)
+  ;; gdb-break-list is maintained in breakpoints handler
+  (gdb-get-buffer-create 'gdb-breakpoints-buffer)
+
+  (gdb-emit-signal gdb-buf-publisher 'update)
+
+  (gdb-get-changed-registers)
+
+  (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame))
+    (dolist (var gdb-var-list)
+      (setcar (nthcdr 5 var) nil))
+    (gdb-var-update)))
+
+;; gdb-setq-thread-number and gdb-update-gud-running are decoupled
+;; because we may need to update current gud-running value without
+;; changing current thread (see gdb-running)
+(defun gdb-setq-thread-number (number)
+  "Only this function must be used to change `gdb-thread-number'
+value to NUMBER, because `gud-running' and `gdb-frame-number'
+need to be updated appropriately when current thread changes."
+  ;; GDB 6.8 and earlier always output thread-id="0" when stopping.
+  (unless (string-equal number "0") (setq gdb-thread-number number))
+  (setq gdb-frame-number "0")
+  (gdb-update-gud-running))
+
+(defun gdb-update-gud-running ()
+  "Set `gud-running' according to the state of current thread.
+
+`gdb-frame-number' is set to 0 if current thread is now stopped.
+
+Note that when `gdb-gud-control-all-threads' is t, `gud-running'
+cannot be reliably used to determine whether or not execution
+control buttons should be shown in menu or toolbar. Use
+`gdb-running-threads-count' and `gdb-stopped-threads-count'
+instead.
+
+For all-stop mode, thread information is unavailable while target
+is running."
+  (let ((old-value gud-running))
+    (setq gud-running
+          (string= (bindat-get-field (gdb-current-buffer-thread) 'state)
+                   "running"))
+    ;; Set frame number to "0" when _current_ threads stops
+    (when (and (gdb-current-buffer-thread)
+               (not (eq gud-running old-value)))
+      (setq gdb-frame-number "0"))))
+
+(defun gdb-show-run-p ()
+  "Return t if \"Run/continue\" should be shown on the toolbar."
+  (or (not gdb-active-process)
+      (and (or
+            (not gdb-gud-control-all-threads)
+            (not gdb-non-stop))
+           (not gud-running))
+      (and gdb-gud-control-all-threads
+           (> gdb-stopped-threads-count 0))))
+
+(defun gdb-show-stop-p ()
+  "Return t if \"Stop\" should be shown on the toolbar."
+  (or (and (or
+            (not gdb-gud-control-all-threads)
+            (not gdb-non-stop))
+           gud-running)
+      (and gdb-gud-control-all-threads
+           (> gdb-running-threads-count 0))))
+
+;; GUD displays the selected GDB frame.  This might might not be the current
+;; GDB frame (after up, down etc).  If no GDB frame is visible but the last
+;; visited breakpoint is, use that window.
+(defun gdb-display-source-buffer (buffer)
+  (let* ((last-window (if gud-last-last-frame
+			 (get-buffer-window
+			  (gud-find-file (car gud-last-last-frame)))))
+	 (source-window (or last-window
+			    (if (and gdb-source-window
+				     (window-live-p gdb-source-window))
+				gdb-source-window))))
+    (when source-window
+      (setq gdb-source-window source-window)
+      (set-window-buffer source-window buffer))
+    source-window))
+
+(defun gdb-car< (a b)
+  (< (car a) (car b)))
+
+(defvar gdbmi-record-list
+  '((gdb-gdb . "(gdb) \n")
+    (gdb-done . "\\([0-9]*\\)\\^done,?\\(.*?\\)\n")
+    (gdb-starting . "\\([0-9]*\\)\\^running\n")
+    (gdb-error . "\\([0-9]*\\)\\^error,\\(.*?\\)\n")
+    (gdb-console . "~\\(\".*?\"\\)\n")
+    (gdb-internals . "&\\(\".*?\"\\)\n")
+    (gdb-stopped . "\\*stopped,?\\(.*?\\)\n")
+    (gdb-running . "\\*running,\\(.*?\n\\)")
+    (gdb-thread-created . "=thread-created,\\(.*?\n\\)")
+    (gdb-thread-selected . "=thread-selected,\\(.*?\\)\n")
+    (gdb-thread-exited . "=thread-exited,\\(.*?\n\\)")
+    (gdb-ignored-notification . "=[-[:alpha:]]+,?\\(.*?\\)\n")
+    (gdb-shell . "\\(\\(?:^.+\n\\)+\\)")))
+
+(defun gud-gdbmi-marker-filter (string)
+  "Filter GDB/MI output."
+
+  ;; Record transactions if logging is enabled.
+  (when gdb-enable-debug
+    (push (cons 'recv string) gdb-debug-log)
+    (if (and gdb-debug-log-max
+	     (> (length gdb-debug-log) gdb-debug-log-max))
+	(setcdr (nthcdr (1- gdb-debug-log-max) gdb-debug-log) nil)))
+
+  ;; Recall the left over gud-marker-acc from last time
+  (setq gud-marker-acc (concat gud-marker-acc string))
+
+  ;; Start accumulating output for the GUD buffer
+  (setq gdb-filter-output "")
+  (let ((output-record) (output-record-list))
+
+    ;; Process all the complete markers in this chunk.
+    (dolist (gdbmi-record gdbmi-record-list)
+      (while (string-match (cdr gdbmi-record) gud-marker-acc)
+	(push (list (match-beginning 0)
+		    (car gdbmi-record)
+		    (match-string 1 gud-marker-acc)
+		    (match-string 2 gud-marker-acc)
+		    (match-end 0))
+	      output-record-list)
+	(setq gud-marker-acc
+	      (concat (substring gud-marker-acc 0 (match-beginning 0))
+		      ;; Pad with spaces to preserve position.
+		      (make-string (length (match-string 0 gud-marker-acc)) 32)
+		      (substring gud-marker-acc (match-end 0))))))
+
+    (setq output-record-list (sort output-record-list 'gdb-car<))
+
+    (dolist (output-record output-record-list)
+      (let ((record-type (cadr output-record))
+	    (arg1 (nth 2 output-record))
+	    (arg2 (nth 3 output-record)))
+	(if (eq record-type 'gdb-error)
+	    (gdb-done-or-error arg2 arg1 'error)
+	  (if (eq record-type 'gdb-done)
+	      (gdb-done-or-error arg2 arg1 'done)
+	    ;; Suppress "No registers." since GDB 6.8 and earlier duplicates MI
+	    ;; error message on internal stream.  Don't print to GUD buffer.
+	    (unless (and (eq record-type 'gdb-internals)
+		     (string-equal (read arg1) "No registers.\n"))
+	      (funcall record-type arg1))))))
+
+    (setq gdb-output-sink 'user)
+    ;; Remove padding.
+    (string-match "^ *" gud-marker-acc)
+    (setq gud-marker-acc (substring gud-marker-acc (match-end 0)))
+
+    gdb-filter-output))
+
+(defun gdb-gdb (output-field))
+
+(defun gdb-shell (output-field)
+  (let ((gdb-output-sink gdb-output-sink))
+    (setq gdb-filter-output
+          (concat output-field gdb-filter-output))))
+
+(defun gdb-ignored-notification (output-field))
+
+;; gdb-invalidate-threads is defined to accept 'update-threads signal
+(defun gdb-thread-created (output-field))
+(defun gdb-thread-exited (output-field)
+  "Handle =thread-exited async record: unset `gdb-thread-number'
+ if current thread exited and update threads list."
+   (let* ((thread-id (bindat-get-field (gdb-json-string output-field) 'id)))
+     (if (string= gdb-thread-number thread-id)
+         (gdb-setq-thread-number nil))
+     ;; When we continue current thread and it quickly exits,
+     ;; gdb-pending-triggers left after gdb-running disallow us to
+     ;; properly call -thread-info without --thread option. Thus we
+     ;; need to use gdb-wait-for-pending.
+     (gdb-wait-for-pending
+      (gdb-emit-signal gdb-buf-publisher 'update-threads))))
+
+(defun gdb-thread-selected (output-field)
+  "Handler for =thread-selected MI output record.
+
+Sets `gdb-thread-number' to new id."
+  (let* ((result (gdb-json-string output-field))
+         (thread-id (bindat-get-field result 'id)))
+    (gdb-setq-thread-number thread-id)
+    ;; Typing `thread N` in GUD buffer makes GDB emit `^done` followed
+    ;; by `=thread-selected` notification. `^done` causes `gdb-update`
+    ;; as usually. Things happen to fast and second call (from
+    ;; gdb-thread-selected handler) gets cut off by our beloved
+    ;; gdb-pending-triggers.
+    ;; Solution is `gdb-wait-for-pending` macro: it guarantees that its
+    ;; body will get executed when `gdb-pending-triggers` is empty.
+    (gdb-wait-for-pending
+     (gdb-update))))
+
+(defun gdb-running (output-field)
+  (let* ((thread-id (bindat-get-field (gdb-json-string output-field) 'thread-id)))
+    ;; We reset gdb-frame-number to nil if current thread has gone
+    ;; running. This can't be done in gdb-thread-list-handler-custom
+    ;; because we need correct gdb-frame-number by the time
+    ;; -thread-info command is sent.
+    (when (or (string-equal thread-id "all")
+              (string-equal thread-id gdb-thread-number))
+      (setq gdb-frame-number nil)))
+  (setq gdb-inferior-status "running")
+  (gdb-force-mode-line-update
+   (propertize gdb-inferior-status 'face font-lock-type-face))
+  (when (not gdb-non-stop)
+    (setq gud-running t))
+  (setq gdb-active-process t)
+  (gdb-emit-signal gdb-buf-publisher 'update-threads))
+
+(defun gdb-starting (output-field)
+  ;; CLI commands don't emit ^running at the moment so use gdb-running too.
+  (setq gdb-inferior-status "running")
+  (gdb-force-mode-line-update
+   (propertize gdb-inferior-status 'face font-lock-type-face))
+  (setq gdb-active-process t)
+  (setq gud-running t)
+  ;; GDB doesn't seem to respond to -thread-info before first stop or
+  ;; thread exit (even in non-stop mode), so this is useless.
+  ;; Behaviour may change in the future.
+  (gdb-emit-signal gdb-buf-publisher 'update-threads))
+
+;; -break-insert -t didn't give a reason before gdb 6.9
+
+(defun gdb-stopped (output-field)
+  "Given the contents of *stopped MI async record, select new
+current thread and update GDB buffers."
+  ;; Reason is available with target-async only
+  (let* ((result (gdb-json-string output-field))
+         (reason (bindat-get-field result 'reason))
+         (thread-id (bindat-get-field result 'thread-id)))
+
+    ;; -data-list-register-names needs to be issued for any stopped
+    ;; thread
+    (when (not gdb-register-names)
+      (gdb-input
+       (list (concat "-data-list-register-names"
+		     (if (string-equal gdb-version "7.0+")
+			 (concat" --thread " thread-id)))
+             'gdb-register-names-handler)))
+
+;;; Don't set gud-last-frame here as it's currently done in gdb-frame-handler
+;;; because synchronous GDB doesn't give these fields with CLI.
+;;;     (when file
+;;;       (setq
+;;;        ;; Extract the frame position from the marker.
+;;;        gud-last-frame (cons file
+;;; 			    (string-to-number
+;;; 			     (match-string 6 gud-marker-acc)))))
+
+    (setq gdb-inferior-status (or reason "unknown"))
+    (gdb-force-mode-line-update
+     (propertize gdb-inferior-status 'face font-lock-warning-face))
+    (if (string-equal reason "exited-normally")
+	(setq gdb-active-process nil))
+
+    ;; Select new current thread.
+
+    ;; Don't switch if we have no reasons selected
+    (when gdb-switch-reasons
+      ;; Switch from another stopped thread only if we have
+      ;; gdb-switch-when-another-stopped:
+      (when (or gdb-switch-when-another-stopped
+                (not (string= "stopped"
+                              (bindat-get-field (gdb-current-buffer-thread) 'state))))
+        ;; Switch if current reason has been selected or we have no
+        ;; reasons
+        (if (or (eq gdb-switch-reasons t)
+                (member reason gdb-switch-reasons))
+	      (when (not (string-equal gdb-thread-number thread-id))
+		(message (concat "Switched to thread " thread-id))
+		(gdb-setq-thread-number thread-id))
+          (message (format "Thread %s stopped" thread-id)))))
+
+  ;; Print "(gdb)" to GUD console
+  (when gdb-first-done-or-error
+    (setq gdb-filter-output (concat gdb-filter-output gdb-prompt-name)))
+
+  ;; In non-stop, we update information as soon as another thread gets
+  ;; stopped
+  (when (or gdb-first-done-or-error
+            gdb-non-stop)
+    ;; In all-stop this updates gud-running properly as well.
+    (gdb-update)
+    (setq gdb-first-done-or-error nil))
+  (run-hook-with-args 'gdb-stopped-hooks result)))
+
+;; Remove the trimmings from log stream containing debugging messages
+;; being produced by GDB's internals, use warning face and send to GUD
+;; buffer.
+(defun gdb-internals (output-field)
+  (setq gdb-filter-output
+	(gdb-concat-output
+	 gdb-filter-output
+	 (let ((error-message
+		(read output-field)))
+	   (put-text-property
+	    0 (length error-message)
+	    'face font-lock-warning-face
+	    error-message)
+	   error-message))))
+
+;; Remove the trimmings from the console stream and send to GUD buffer
+;; (frontend MI commands should not print to this stream)
+(defun gdb-console (output-field)
+   (setq gdb-filter-output
+	(gdb-concat-output
+	 gdb-filter-output
+	 (read output-field))))
+
+(defun gdb-done-or-error (output-field token-number type)
+  (if (string-equal token-number "")
+      ;; Output from command entered by user
+      (progn
+	(setq gdb-output-sink 'user)
+	(setq token-number nil)
+	;; MI error - send to minibuffer
+	(when (eq type 'error)
+            ;; Skip "msg=" from `output-field'
+	    (message (read (substring output-field 4)))
+	    ;; Don't send to the console twice.  (If it is a console error
+	    ;; it is also in the console stream.)
+	    (setq output-field nil)))
+    ;; Output from command from frontend.
+    (setq gdb-output-sink 'emacs))
+
+  (gdb-clear-partial-output)
+  (when gdb-first-done-or-error
+    (unless (or token-number gud-running)
+      (setq gdb-filter-output (concat gdb-filter-output gdb-prompt-name)))
+    (gdb-update)
+    (setq gdb-first-done-or-error nil))
+
+  (setq gdb-filter-output
+	(gdb-concat-output gdb-filter-output output-field))
+
+  (if token-number
+      (progn
+	(with-current-buffer
+	    (gdb-get-buffer-create 'gdb-partial-output-buffer)
+	  (funcall
+	   (cdr (assoc (string-to-number token-number) gdb-handler-alist))))
+	(setq gdb-handler-alist
+	      (assq-delete-all token-number gdb-handler-alist)))))
+
+(defun gdb-concat-output (so-far new)
+  (let ((sink gdb-output-sink))
+    (cond
+     ((eq sink 'user) (concat so-far new))
+     ((eq sink 'emacs)
+      (gdb-append-to-partial-output new)
+      so-far))))
+
+(defun gdb-append-to-partial-output (string)
+  (with-current-buffer (gdb-get-buffer-create 'gdb-partial-output-buffer)
+    (goto-char (point-max))
+    (insert string)))
+
+(defun gdb-clear-partial-output ()
+  (with-current-buffer (gdb-get-buffer-create 'gdb-partial-output-buffer)
+    (erase-buffer)))
+
+(defun gdb-jsonify-buffer (&optional fix-key fix-list)
+  "Prepare GDB/MI output in current buffer for parsing with `json-read'.
+
+Field names are wrapped in double quotes and equal signs are
+replaced with semicolons.
+
+If FIX-KEY is non-nil, strip all \"FIX-KEY=\" occurences from
+partial output. This is used to get rid of useless keys in lists
+in MI messages, e.g.: [key=.., key=..]. -stack-list-frames and
+-break-info are examples of MI commands which issue such
+responses.
+
+If FIX-LIST is non-nil, \"FIX-LIST={..}\" is replaced with
+\"FIX-LIST=[..]\" prior to parsing. This is used to fix broken
+-break-info output when it contains breakpoint script field
+incompatible with GDB/MI output syntax."
+  (save-excursion
+    (goto-char (point-min))
+    (when fix-key
+      (save-excursion
+        (while (re-search-forward (concat "[\\[,]\\(" fix-key "=\\)") nil t)
+          (replace-match "" nil nil nil 1))))
+    (when fix-list
+      (save-excursion
+        ;; Find positions of braces which enclose broken list
+        (while (re-search-forward (concat fix-list "={\"") nil t)
+          (let ((p1 (goto-char (- (point) 2)))
+                (p2 (progn (forward-sexp)
+                           (1- (point)))))
+            ;; Replace braces with brackets
+            (save-excursion
+              (goto-char p1)
+              (delete-char 1)
+              (insert "[")
+              (goto-char p2)
+              (delete-char 1)
+              (insert "]"))))))
+    (goto-char (point-min))
+    (insert "{")
+    (while (re-search-forward
+	    "\\([[:alnum:]-_]+\\)=\\({\\|\\[\\|\"\"\\|\".*?[^\\]\"\\)" nil t)
+      (replace-match "\"\\1\":\\2" nil nil))
+    (goto-char (point-max))
+    (insert "}")))
+
+(defun gdb-json-read-buffer (&optional fix-key fix-list)
+  "Prepare and parse GDB/MI output in current buffer with `json-read'.
+
+FIX-KEY and FIX-LIST work as in `gdb-jsonify-buffer'."
+  (gdb-jsonify-buffer fix-key fix-list)
+  (save-excursion
+    (goto-char (point-min))
+    (let ((json-array-type 'list))
+      (json-read))))
+
+(defun gdb-json-string (string &optional fix-key fix-list)
+  "Prepare and parse STRING containing GDB/MI output with `json-read'.
+
+FIX-KEY and FIX-LIST work as in `gdb-jsonify-buffer'."
+  (with-temp-buffer
+    (insert string)
+    (gdb-json-read-buffer fix-key fix-list)))
+
+(defun gdb-json-partial-output (&optional fix-key fix-list)
+  "Prepare and parse gdb-partial-output-buffer with `json-read'.
+
+FIX-KEY and FIX-KEY work as in `gdb-jsonify-buffer'."
+  (with-current-buffer (gdb-get-buffer-create 'gdb-partial-output-buffer)
+    (gdb-json-read-buffer fix-key fix-list)))
+
+(defun gdb-line-posns (line)
+  "Return a pair of LINE beginning and end positions."
+  (let ((offset (1+ (- line (line-number-at-pos)))))
+    (cons
+     (line-beginning-position offset)
+     (line-end-position offset))))
+
+(defmacro gdb-mark-line (line variable)
+  "Set VARIABLE marker to point at beginning of LINE.
+
+If current window has no fringes, inverse colors on LINE.
+
+Return position where LINE begins."
+  `(save-excursion
+     (let* ((posns (gdb-line-posns ,line))
+            (start-posn (car posns))
+            (end-posn (cdr posns)))
+       (set-marker ,variable (copy-marker start-posn))
+       (when (not (> (car (window-fringes)) 0))
+         (put-text-property start-posn end-posn
+                            'font-lock-face '(:inverse-video t)))
+       start-posn)))
+
+(defun gdb-pad-string (string padding)
+  (format (concat "%" (number-to-string padding) "s") string))
+
+;; gdb-table struct is a way to programmatically construct simple
+;; tables. It help to reliably align columns of data in GDB buffers
+;; and provides
+(defstruct
+  gdb-table
+  (column-sizes nil)
+  (rows nil)
+  (row-properties nil)
+  (right-align nil))
+
+(defun gdb-mapcar* (function &rest seqs)
+  "Apply FUNCTION to each element of SEQS, and make a list of the results.
+If there are several SEQS, FUNCTION is called with that many
+arugments, and mapping stops as sson as the shortest list runs
+out."
+  (let ((shortest (apply #'min (mapcar #'length seqs))))
+    (mapcar (lambda (i)
+              (apply function
+                     (mapcar
+                      (lambda (seq)
+                        (nth i seq))
+                      seqs)))
+            (number-sequence 0 (1- shortest)))))
+
+(defun gdb-table-add-row (table row &optional properties)
+  "Add ROW of string to TABLE and recalculate column sizes.
+
+When non-nil, PROPERTIES will be added to the whole row when
+calling `gdb-table-string'."
+  (let ((rows (gdb-table-rows table))
+        (row-properties (gdb-table-row-properties table))
+        (column-sizes (gdb-table-column-sizes table))
+        (right-align (gdb-table-right-align table)))
+    (when (not column-sizes)
+      (setf (gdb-table-column-sizes table)
+            (make-list (length row) 0)))
+    (setf (gdb-table-rows table)
+          (append rows (list row)))
+    (setf (gdb-table-row-properties table)
+          (append row-properties (list properties)))
+    (setf (gdb-table-column-sizes table)
+          (gdb-mapcar* (lambda (x s)
+                     (let ((new-x
+                            (max (abs x) (string-width (or s "")))))
+                       (if right-align new-x (- new-x))))
+                   (gdb-table-column-sizes table)
+                   row))
+    ;; Avoid trailing whitespace at eol
+    (if (not (gdb-table-right-align table))
+        (setcar (last (gdb-table-column-sizes table)) 0))))
+
+(defun gdb-table-string (table &optional sep)
+  "Return TABLE as a string with columns separated with SEP."
+  (let ((column-sizes (gdb-table-column-sizes table))
+        (res ""))
+    (mapconcat
+     'identity
+     (gdb-mapcar*
+      (lambda (row properties)
+        (apply 'propertize
+               (mapconcat 'identity
+                          (gdb-mapcar* (lambda (s x) (gdb-pad-string s x))
+                                       row column-sizes)
+                          sep)
+               properties))
+      (gdb-table-rows table)
+      (gdb-table-row-properties table))
+     "\n")))
+
+;; bindat-get-field goes deep, gdb-get-many-fields goes wide
+(defun gdb-get-many-fields (struct &rest fields)
+  "Return a list of FIELDS values from STRUCT."
+  (let ((values))
+    (dolist (field fields values)
+      (setq values (append values (list (bindat-get-field struct field)))))))
+
+(defmacro def-gdb-auto-update-trigger (trigger-name gdb-command
+                                                    handler-name
+                                                    &optional signal-list)
+  "Define a trigger TRIGGER-NAME which sends GDB-COMMAND and sets
+HANDLER-NAME as its handler. HANDLER-NAME is bound to current
+buffer with `gdb-bind-function-to-buffer'.
+
+If SIGNAL-LIST is non-nil, GDB-COMMAND is sent only when the
+defined trigger is called with an argument from SIGNAL-LIST. It's
+not recommended to define triggers with empty SIGNAL-LIST.
+Normally triggers should respond at least to 'update signal.
+
+Normally the trigger defined by this command must be called from
+the buffer where HANDLER-NAME must work. This should be done so
+that buffer-local thread number may be used in GDB-COMMAND (by
+calling `gdb-current-context-command').
+`gdb-bind-function-to-buffer' is used to achieve this, see
+`gdb-get-buffer-create'.
+
+Triggers defined by this command are meant to be used as a
+trigger argument when describing buffer types with
+`gdb-set-buffer-rules'."
+  `(defun ,trigger-name (&optional signal)
+     (when
+         (or (not ,signal-list)
+             (memq signal ,signal-list))
+       (when (not (gdb-pending-p
+                   (cons (current-buffer) ',trigger-name)))
+         (gdb-input
+          (list ,gdb-command
+                (gdb-bind-function-to-buffer ',handler-name (current-buffer))))
+         (gdb-add-pending (cons (current-buffer) ',trigger-name))))))
+
+;; Used by disassembly buffer only, the rest use
+;; def-gdb-trigger-and-handler
+(defmacro def-gdb-auto-update-handler (handler-name trigger-name custom-defun
+                                                    &optional nopreserve)
+  "Define a handler HANDLER-NAME for TRIGGER-NAME with CUSTOM-DEFUN.
+
+Handlers are normally called from the buffers they put output in.
+
+Delete ((current-buffer) . TRIGGER-NAME) from
+`gdb-pending-triggers', erase current buffer and evaluate
+CUSTOM-DEFUN. Then `gdb-update-buffer-name' is called.
+
+If NOPRESERVE is non-nil, window point is not restored after CUSTOM-DEFUN."
+  `(defun ,handler-name ()
+     (gdb-delete-pending (cons (current-buffer) ',trigger-name))
+     (let* ((buffer-read-only nil)
+            (window (get-buffer-window (current-buffer) 0))
+            (start (window-start window))
+            (p (window-point window)))
+       (erase-buffer)
+       (,custom-defun)
+       (gdb-update-buffer-name)
+       ,(when (not nopreserve)
+          '(set-window-start window start)
+          '(set-window-point window p)))))
+
+(defmacro def-gdb-trigger-and-handler (trigger-name gdb-command
+				       handler-name custom-defun
+                                       &optional signal-list)
+  "Define trigger and handler.
+
+TRIGGER-NAME trigger is defined to send GDB-COMMAND. See
+`def-gdb-auto-update-trigger'.
+
+HANDLER-NAME handler uses customization of CUSTOM-DEFUN. See
+`def-gdb-auto-update-handler'."
+  `(progn
+     (def-gdb-auto-update-trigger ,trigger-name
+       ,gdb-command
+       ,handler-name ,signal-list)
+     (def-gdb-auto-update-handler ,handler-name
+       ,trigger-name ,custom-defun)))
+
+
+
+;; Breakpoint buffer : This displays the output of `-break-list'.
+(def-gdb-trigger-and-handler
+  gdb-invalidate-breakpoints "-break-list"
+  gdb-breakpoints-list-handler gdb-breakpoints-list-handler-custom
+  '(start update))
+
+(gdb-set-buffer-rules
+ 'gdb-breakpoints-buffer
+ 'gdb-breakpoints-buffer-name
+ 'gdb-breakpoints-mode
+ 'gdb-invalidate-breakpoints)
+
+(defun gdb-breakpoints-list-handler-custom ()
+  (let ((breakpoints-list (bindat-get-field
+                           (gdb-json-partial-output "bkpt" "script")
+                           'BreakpointTable 'body))
+        (table (make-gdb-table)))
+    (setq gdb-breakpoints-list nil)
+    (gdb-table-add-row table '("Num" "Type" "Disp" "Enb" "Addr" "Hits" "What"))
+    (dolist (breakpoint breakpoints-list)
+      (add-to-list 'gdb-breakpoints-list
+                   (cons (bindat-get-field breakpoint 'number)
+                         breakpoint))
+      (let ((at (bindat-get-field breakpoint 'at))
+            (pending (bindat-get-field breakpoint 'pending))
+            (func (bindat-get-field breakpoint 'func))
+	    (type (bindat-get-field breakpoint 'type)))
+      (gdb-table-add-row table
+       (list
+        (bindat-get-field breakpoint 'number)
+        type
+        (bindat-get-field breakpoint 'disp)
+        (let ((flag (bindat-get-field breakpoint 'enabled)))
+          (if (string-equal flag "y")
+              (propertize "y" 'font-lock-face  font-lock-warning-face)
+            (propertize "n" 'font-lock-face  font-lock-comment-face)))
+        (bindat-get-field breakpoint 'addr)
+        (bindat-get-field breakpoint 'times)
+	(if (string-match ".*watchpoint" type)
+	    (bindat-get-field breakpoint 'what)
+	  (or pending at
+	      (concat "in "
+		      (propertize func 'font-lock-face font-lock-function-name-face)
+		      (gdb-frame-location breakpoint)))))
+       ;; Add clickable properties only for breakpoints with file:line
+       ;; information
+       (append (list 'gdb-breakpoint breakpoint)
+               (when func '(help-echo "mouse-2, RET: visit breakpoint"
+                            mouse-face highlight))))))
+    (insert (gdb-table-string table " "))
+    (gdb-place-breakpoints)))
+
+;; Put breakpoint icons in relevant margins (even those set in the GUD buffer).
+(defun gdb-place-breakpoints ()
+  (let ((flag) (bptno))
+    ;; Remove all breakpoint-icons in source buffers but not assembler buffer.
+    (dolist (buffer (buffer-list))
+      (with-current-buffer buffer
+	(if (and (eq gud-minor-mode 'gdbmi)
+		 (not (string-match "\\` ?\\*.+\\*\\'" (buffer-name))))
+	    (gdb-remove-breakpoint-icons (point-min) (point-max)))))
+    (dolist (breakpoint gdb-breakpoints-list)
+      (let* ((breakpoint (cdr breakpoint)) ; gdb-breakpoints-list is
+                                           ; an associative list
+             (line (bindat-get-field breakpoint 'line)))
+        (when line
+          (let ((file (bindat-get-field breakpoint 'fullname))
+                (flag (bindat-get-field breakpoint 'enabled))
+                (bptno (bindat-get-field breakpoint 'number)))
+            (unless (file-exists-p file)
+              (setq file (cdr (assoc bptno gdb-location-alist))))
+            (if (and file
+                     (not (string-equal file "File not found")))
+                (with-current-buffer
+                    (find-file-noselect file 'nowarn)
+                  (gdb-init-buffer)
+                  ;; Only want one breakpoint icon at each location.
+                  (gdb-put-breakpoint-icon (string-equal flag "y") bptno
+                                           (string-to-number line)))
+              (gdb-input
+               (list (concat "list " file ":1")
+                     'ignore))
+              (gdb-input
+               (list "-file-list-exec-source-file"
+                     `(lambda () (gdb-get-location
+                                  ,bptno ,line ,flag)))))))))))
+
+(defvar gdb-source-file-regexp "fullname=\"\\(.*?\\)\"")
+
+(defun gdb-get-location (bptno line flag)
+  "Find the directory containing the relevant source file.
+Put in buffer and place breakpoint icon."
+  (goto-char (point-min))
+  (catch 'file-not-found
+    (if (re-search-forward gdb-source-file-regexp nil t)
+	(delete (cons bptno "File not found") gdb-location-alist)
+	(push (cons bptno (match-string 1)) gdb-location-alist)
+      (gdb-resync)
+      (unless (assoc bptno gdb-location-alist)
+	(push (cons bptno "File not found") gdb-location-alist)
+	(message-box "Cannot find source file for breakpoint location.
+Add directory to search path for source files using the GDB command, dir."))
+      (throw 'file-not-found nil))
+    (with-current-buffer (find-file-noselect (match-string 1))
+      (gdb-init-buffer)
+      ;; only want one breakpoint icon at each location
+      (gdb-put-breakpoint-icon (eq flag ?y) bptno (string-to-number line)))))
+
+(add-hook 'find-file-hook 'gdb-find-file-hook)
+
+(defun gdb-find-file-hook ()
+  "Set up buffer for debugging if file is part of the source code
+of the current session."
+  (if (and (buffer-name gud-comint-buffer)
+	   ;; in case gud or gdb-ui is just loaded
+	   gud-comint-buffer
+	   (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
+	       'gdbmi))
+      (if (member buffer-file-name gdb-source-file-list)
+	  (with-current-buffer (find-buffer-visiting buffer-file-name)
+	    (gdb-init-buffer)))))
+
+(declare-function gud-remove "gdb-mi" t t) ; gud-def
+(declare-function gud-break  "gdb-mi" t t) ; gud-def
+(declare-function fringe-bitmaps-at-pos "fringe.c" (&optional pos window))
+
+(defun gdb-mouse-set-clear-breakpoint (event)
+  "Set/clear breakpoint in left fringe/margin at mouse click.
+If not in a source or disassembly buffer just set point."
+  (interactive "e")
+  (mouse-minibuffer-check event)
+  (let ((posn (event-end event)))
+    (with-selected-window (posn-window posn)
+      (if (or (buffer-file-name) (eq major-mode 'gdb-disassembly-mode))
+	  (if (numberp (posn-point posn))
+	      (save-excursion
+		(goto-char (posn-point posn))
+		(if (or (posn-object posn)
+			(eq (car (fringe-bitmaps-at-pos (posn-point posn)))
+			    'breakpoint))
+		    (gud-remove nil)
+		  (gud-break nil)))))
+      (posn-set-point posn))))
+
+(defun gdb-mouse-toggle-breakpoint-margin (event)
+  "Enable/disable breakpoint in left margin with mouse click."
+  (interactive "e")
+  (mouse-minibuffer-check event)
+  (let ((posn (event-end event)))
+    (if (numberp (posn-point posn))
+	(with-selected-window (posn-window posn)
+	  (save-excursion
+	    (goto-char (posn-point posn))
+	    (if	(posn-object posn)
+		(gud-basic-call
+		 (let ((bptno (get-text-property
+			       0 'gdb-bptno (car (posn-string posn)))))
+		   (concat
+		    (if (get-text-property
+			 0 'gdb-enabled (car (posn-string posn)))
+			"-break-disable "
+		      "-break-enable ")
+		    bptno)))))))))
+
+(defun gdb-mouse-toggle-breakpoint-fringe (event)
+  "Enable/disable breakpoint in left fringe with mouse click."
+  (interactive "e")
+  (mouse-minibuffer-check event)
+  (let* ((posn (event-end event))
+	 (pos (posn-point posn))
+	 obj)
+    (when (numberp pos)
+      (with-selected-window (posn-window posn)
+	(with-current-buffer (window-buffer (selected-window))
+	  (goto-char pos)
+	  (dolist (overlay (overlays-in pos pos))
+	    (when (overlay-get overlay 'put-break)
+	      (setq obj (overlay-get overlay 'before-string))))
+	  (when (stringp obj)
+	    (gud-basic-call
+	     (concat
+	      (if (get-text-property 0 'gdb-enabled obj)
+		  "-break-disable "
+		"-break-enable ")
+	       (get-text-property 0 'gdb-bptno obj)))))))))
+
+(defun gdb-breakpoints-buffer-name ()
+  (concat "*breakpoints of " (gdb-get-target-string) "*"))
+
+(def-gdb-display-buffer
+ gdb-display-breakpoints-buffer
+ 'gdb-breakpoints-buffer
+ "Display status of user-settable breakpoints.")
+
+(def-gdb-frame-for-buffer
+ gdb-frame-breakpoints-buffer
+ 'gdb-breakpoints-buffer
+ "Display status of user-settable breakpoints in a new frame.")
+
+(defvar gdb-breakpoints-mode-map
+  (let ((map (make-sparse-keymap))
+	(menu (make-sparse-keymap "Breakpoints")))
+    (define-key menu [quit] '("Quit"   . gdb-delete-frame-or-window))
+    (define-key menu [goto] '("Goto"   . gdb-goto-breakpoint))
+    (define-key menu [delete] '("Delete" . gdb-delete-breakpoint))
+    (define-key menu [toggle] '("Toggle" . gdb-toggle-breakpoint))
+    (suppress-keymap map)
+    (define-key map [menu-bar breakpoints] (cons "Breakpoints" menu))
+    (define-key map " " 'gdb-toggle-breakpoint)
+    (define-key map "D" 'gdb-delete-breakpoint)
+    ;; Don't bind "q" to kill-this-buffer as we need it for breakpoint icons.
+    (define-key map "q" 'gdb-delete-frame-or-window)
+    (define-key map "\r" 'gdb-goto-breakpoint)
+    (define-key map "\t" '(lambda ()
+                            (interactive)
+                            (gdb-set-window-buffer
+                             (gdb-get-buffer-create 'gdb-threads-buffer) t)))
+    (define-key map [mouse-2] 'gdb-goto-breakpoint)
+    (define-key map [follow-link] 'mouse-face)
+    map))
+
+(defun gdb-delete-frame-or-window ()
+  "Delete frame if there is only one window.  Otherwise delete the window."
+  (interactive)
+  (if (one-window-p) (delete-frame)
+    (delete-window)))
+
+;;from make-mode-line-mouse-map
+(defun gdb-make-header-line-mouse-map (mouse function) "\
+Return a keymap with single entry for mouse key MOUSE on the header line.
+MOUSE is defined to run function FUNCTION with no args in the buffer
+corresponding to the mode line clicked."
+  (let ((map (make-sparse-keymap)))
+    (define-key map (vector 'header-line mouse) function)
+    (define-key map (vector 'header-line 'down-mouse-1) 'ignore)
+    map))
+
+(defmacro gdb-propertize-header (name buffer help-echo mouse-face face)
+  `(propertize ,name
+	       'help-echo ,help-echo
+	       'mouse-face ',mouse-face
+	       'face ',face
+	       'local-map
+	       (gdb-make-header-line-mouse-map
+		'mouse-1
+		(lambda (event) (interactive "e")
+		  (save-selected-window
+		    (select-window (posn-window (event-start event)))
+                    (gdb-set-window-buffer
+                     (gdb-get-buffer-create ',buffer) t) )))))
+
+
+;; uses "-thread-info". Needs GDB 7.0 onwards.
+;;; Threads view
+
+(defun gdb-threads-buffer-name ()
+  (concat "*threads of " (gdb-get-target-string) "*"))
+
+(def-gdb-display-buffer
+ gdb-display-threads-buffer
+ 'gdb-threads-buffer
+ "Display GDB threads.")
+
+(def-gdb-frame-for-buffer
+ gdb-frame-threads-buffer
+ 'gdb-threads-buffer
+ "Display GDB threads in a new frame.")
+
+(def-gdb-trigger-and-handler
+  gdb-invalidate-threads (gdb-current-context-command "-thread-info")
+  gdb-thread-list-handler gdb-thread-list-handler-custom
+  '(start update update-threads))
+
+(gdb-set-buffer-rules
+ 'gdb-threads-buffer
+ 'gdb-threads-buffer-name
+ 'gdb-threads-mode
+ 'gdb-invalidate-threads)
+
+(defvar gdb-threads-font-lock-keywords
+  '(("in \\([^ ]+\\)"  (1 font-lock-function-name-face))
+    (" \\(stopped\\)"  (1 font-lock-warning-face))
+    (" \\(running\\)"  (1 font-lock-string-face))
+    ("\\(\\(\\sw\\|[_.]\\)+\\)="  (1 font-lock-variable-name-face)))
+  "Font lock keywords used in `gdb-threads-mode'.")
+
+(defvar gdb-threads-mode-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map "\r" 'gdb-select-thread)
+    (define-key map "f" 'gdb-display-stack-for-thread)
+    (define-key map "F" 'gdb-frame-stack-for-thread)
+    (define-key map "l" 'gdb-display-locals-for-thread)
+    (define-key map "L" 'gdb-frame-locals-for-thread)
+    (define-key map "r" 'gdb-display-registers-for-thread)
+    (define-key map "R" 'gdb-frame-registers-for-thread)
+    (define-key map "d" 'gdb-display-disassembly-for-thread)
+    (define-key map "D" 'gdb-frame-disassembly-for-thread)
+    (define-key map "i" 'gdb-interrupt-thread)
+    (define-key map "c" 'gdb-continue-thread)
+    (define-key map "s" 'gdb-step-thread)
+    (define-key map "\t" '(lambda ()
+                            (interactive)
+                            (gdb-set-window-buffer
+                             (gdb-get-buffer-create 'gdb-breakpoints-buffer) t)))
+    (define-key map [mouse-2] 'gdb-select-thread)
+    (define-key map [follow-link] 'mouse-face)
+    map))
+
+(defvar gdb-threads-header
+  (list
+   (gdb-propertize-header "Breakpoints" gdb-breakpoints-buffer
+			  "mouse-1: select" mode-line-highlight mode-line-inactive)
+   " "
+   (gdb-propertize-header "Threads" gdb-threads-buffer
+			  nil nil mode-line)))
+
+(define-derived-mode gdb-threads-mode gdb-parent-mode "Threads"
+  "Major mode for GDB threads.
+
+\\{gdb-threads-mode-map}"
+  (setq gdb-thread-position (make-marker))
+  (add-to-list 'overlay-arrow-variable-list 'gdb-thread-position)
+  (setq header-line-format gdb-threads-header)
+  (set (make-local-variable 'font-lock-defaults)
+       '(gdb-threads-font-lock-keywords))
+  (run-mode-hooks 'gdb-threads-mode-hook)
+  'gdb-invalidate-threads)
+
+(defun gdb-thread-list-handler-custom ()
+  (let ((threads-list (bindat-get-field (gdb-json-partial-output) 'threads))
+        (table (make-gdb-table))
+        (marked-line nil))
+    (setq gdb-threads-list nil)
+    (setq gdb-running-threads-count 0)
+    (setq gdb-stopped-threads-count 0)
+    (set-marker gdb-thread-position nil)
+
+    (dolist (thread (reverse threads-list))
+      (let ((running (string-equal (bindat-get-field thread 'state) "running")))
+      (add-to-list 'gdb-threads-list
+                   (cons (bindat-get-field thread 'id)
+                         thread))
+      (if running
+          (incf gdb-running-threads-count)
+        (incf gdb-stopped-threads-count))
+
+      (gdb-table-add-row table
+       (list
+        (bindat-get-field thread 'id)
+        (concat
+         (if gdb-thread-buffer-verbose-names
+             (concat (bindat-get-field thread 'target-id) " ") "")
+         (bindat-get-field thread 'state)
+         ;; Include frame information for stopped threads
+         (if (not running)
+             (concat
+              " in " (bindat-get-field thread 'frame 'func)
+              (if gdb-thread-buffer-arguments
+                  (concat
+                   " ("
+                   (let ((args (bindat-get-field thread 'frame 'args)))
+                     (mapconcat
+                      (lambda (arg)
+                        (apply 'format `("%s=%s" ,@(gdb-get-many-fields arg 'name 'value))))
+                      args ","))
+                   ")")
+                "")
+              (if gdb-thread-buffer-locations
+                  (gdb-frame-location (bindat-get-field thread 'frame)) "")
+              (if gdb-thread-buffer-addresses
+                  (concat " at " (bindat-get-field thread 'frame 'addr)) ""))
+           "")))
+       (list
+        'gdb-thread thread
+        'mouse-face 'highlight
+        'help-echo "mouse-2, RET: select thread")))
+      (when (string-equal gdb-thread-number
+                          (bindat-get-field thread 'id))
+        (setq marked-line (length gdb-threads-list))))
+    (insert (gdb-table-string table " "))
+    (when marked-line
+      (gdb-mark-line marked-line gdb-thread-position)))
+  ;; We update gud-running here because we need to make sure that
+  ;; gdb-threads-list is up-to-date
+  (gdb-update-gud-running)
+  (gdb-emit-signal gdb-buf-publisher 'update-disassembly))
+
+(defmacro def-gdb-thread-buffer-command (name custom-defun &optional doc)
+  "Define a NAME command which will act upon thread on the current line.
+
+CUSTOM-DEFUN may use locally bound `thread' variable, which will
+be the value of 'gdb-thread property of the current line. If
+'gdb-thread is nil, error is signaled."
+  `(defun ,name (&optional event)
+     ,(when doc doc)
+     (interactive (list last-input-event))
+     (if event (posn-set-point (event-end event)))
+     (save-excursion
+       (beginning-of-line)
+       (let ((thread (get-text-property (point) 'gdb-thread)))
+         (if thread
+             ,custom-defun
+           (error "Not recognized as thread line"))))))
+
+(defmacro def-gdb-thread-buffer-simple-command (name buffer-command &optional doc)
+  "Define a NAME which will call BUFFER-COMMAND with id of thread
+on the current line."
+  `(def-gdb-thread-buffer-command ,name
+     (,buffer-command (bindat-get-field thread 'id))
+     ,doc))
+
+(def-gdb-thread-buffer-command gdb-select-thread
+  (let ((new-id (bindat-get-field thread 'id)))
+    (gdb-setq-thread-number new-id)
+    (gdb-input (list (concat "-thread-select " new-id) 'ignore))
+    (gdb-update))
+  "Select the thread at current line of threads buffer.")
+
+(def-gdb-thread-buffer-simple-command
+  gdb-display-stack-for-thread
+  gdb-preemptively-display-stack-buffer
+  "Display stack buffer for the thread at current line.")
+
+(def-gdb-thread-buffer-simple-command
+  gdb-display-locals-for-thread
+  gdb-preemptively-display-locals-buffer
+  "Display locals buffer for the thread at current line.")
+
+(def-gdb-thread-buffer-simple-command
+  gdb-display-registers-for-thread
+  gdb-preemptively-display-registers-buffer
+  "Display registers buffer for the thread at current line.")
+
+(def-gdb-thread-buffer-simple-command
+  gdb-display-disassembly-for-thread
+  gdb-preemptively-display-disassembly-buffer
+  "Display disassembly buffer for the thread at current line.")
+
+(def-gdb-thread-buffer-simple-command
+  gdb-frame-stack-for-thread
+  gdb-frame-stack-buffer
+  "Display a new frame with stack buffer for the thread at
+current line.")
+
+(def-gdb-thread-buffer-simple-command
+  gdb-frame-locals-for-thread
+  gdb-frame-locals-buffer
+  "Display a new frame with locals buffer for the thread at
+current line.")
+
+(def-gdb-thread-buffer-simple-command
+  gdb-frame-registers-for-thread
+  gdb-frame-registers-buffer
+  "Display a new frame with registers buffer for the thread at
+current line.")
+
+(def-gdb-thread-buffer-simple-command
+  gdb-frame-disassembly-for-thread
+  gdb-frame-disassembly-buffer
+  "Display a new frame with disassembly buffer for the thread at
+current line.")
+
+(defmacro def-gdb-thread-buffer-gud-command (name gud-command &optional doc)
+  "Define a NAME which will execute GUD-COMMAND with
+`gdb-thread-number' locally bound to id of thread on the current
+line."
+  `(def-gdb-thread-buffer-command ,name
+     (if gdb-non-stop
+         (let ((gdb-thread-number (bindat-get-field thread 'id))
+               (gdb-gud-control-all-threads nil))
+           (call-interactively #',gud-command))
+       (error "Available in non-stop mode only, customize `gdb-non-stop-setting'"))
+     ,doc))
+
+(def-gdb-thread-buffer-gud-command
+  gdb-interrupt-thread
+  gud-stop-subjob
+  "Interrupt thread at current line.")
+
+(def-gdb-thread-buffer-gud-command
+  gdb-continue-thread
+  gud-cont
+  "Continue thread at current line.")
+
+(def-gdb-thread-buffer-gud-command
+  gdb-step-thread
+  gud-step
+  "Step thread at current line.")
+
+
+;;; Memory view
+
+(defcustom gdb-memory-rows 8
+  "Number of data rows in memory window."
+  :type 'integer
+  :group 'gud
+  :version "23.2")
+
+(defcustom gdb-memory-columns 4
+  "Number of data columns in memory window."
+  :type 'integer
+  :group 'gud
+  :version "23.2")
+
+(defcustom gdb-memory-format "x"
+  "Display format of data items in memory window."
+  :type '(choice (const :tag "Hexadecimal" "x")
+	 	 (const :tag "Signed decimal" "d")
+	 	 (const :tag "Unsigned decimal" "u")
+		 (const :tag "Octal" "o")
+		 (const :tag "Binary" "t"))
+  :group 'gud
+  :version "22.1")
+
+(defcustom gdb-memory-unit 4
+  "Unit size of data items in memory window."
+  :type '(choice (const :tag "Byte" 1)
+		 (const :tag "Halfword" 2)
+		 (const :tag "Word" 4)
+		 (const :tag "Giant word" 8))
+  :group 'gud
+  :version "23.2")
+
+(def-gdb-trigger-and-handler
+  gdb-invalidate-memory
+  (format "-data-read-memory %s %s %d %d %d"
+          gdb-memory-address
+          gdb-memory-format
+          gdb-memory-unit
+          gdb-memory-rows
+          gdb-memory-columns)
+  gdb-read-memory-handler
+  gdb-read-memory-custom
+  '(start update))
+
+(gdb-set-buffer-rules
+ 'gdb-memory-buffer
+ 'gdb-memory-buffer-name
+ 'gdb-memory-mode
+ 'gdb-invalidate-memory)
+
+(defun gdb-memory-column-width (size format)
+  "Return length of string with memory unit of SIZE in FORMAT.
+
+SIZE is in bytes, as in `gdb-memory-unit'. FORMAT is a string as
+in `gdb-memory-format'."
+  (let ((format-base (cdr (assoc format
+                                 '(("x" . 16)
+                                   ("d" . 10) ("u" . 10)
+                                   ("o" . 8)
+                                   ("t" . 2))))))
+    (if format-base
+        (let ((res (ceiling (log (expt 2.0 (* size 8)) format-base))))
+          (cond ((string-equal format "x")
+                 (+ 2 res)) ; hexadecimal numbers have 0x in front
+                ((or (string-equal format "d")
+                     (string-equal format "o"))
+                 (1+ res))
+                (t res)))
+      (error "Unknown format"))))
+
+(defun gdb-read-memory-custom ()
+  (let* ((res (gdb-json-partial-output))
+         (err-msg (bindat-get-field res 'msg)))
+    (if (not err-msg)
+        (let ((memory (bindat-get-field res 'memory)))
+          (setq gdb-memory-address (bindat-get-field res 'addr))
+          (setq gdb-memory-next-page (bindat-get-field res 'next-page))
+          (setq gdb-memory-prev-page (bindat-get-field res 'prev-page))
+          (setq gdb-memory-last-address gdb-memory-address)
+        (dolist (row memory)
+          (insert (concat (bindat-get-field row 'addr) ":"))
+          (dolist (column (bindat-get-field row 'data))
+            (insert (gdb-pad-string column
+                                    (+ 2 (gdb-memory-column-width
+                                          gdb-memory-unit
+                                          gdb-memory-format)))))
+          (newline)))
+      ;; Show last page instead of empty buffer when out of bounds
+      (progn
+        (let ((gdb-memory-address gdb-memory-last-address))
+          (gdb-invalidate-memory 'update)
+          (error err-msg))))))
+
+(defvar gdb-memory-mode-map
+  (let ((map (make-sparse-keymap)))
+    (suppress-keymap map t)
+    (define-key map "q" 'kill-this-buffer)
+    (define-key map "n" 'gdb-memory-show-next-page)
+    (define-key map "p" 'gdb-memory-show-previous-page)
+    (define-key map "a" 'gdb-memory-set-address)
+    (define-key map "t" 'gdb-memory-format-binary)
+    (define-key map "o" 'gdb-memory-format-octal)
+    (define-key map "u" 'gdb-memory-format-unsigned)
+    (define-key map "d" 'gdb-memory-format-signed)
+    (define-key map "x" 'gdb-memory-format-hexadecimal)
+    (define-key map "b" 'gdb-memory-unit-byte)
+    (define-key map "h" 'gdb-memory-unit-halfword)
+    (define-key map "w" 'gdb-memory-unit-word)
+    (define-key map "g" 'gdb-memory-unit-giant)
+    (define-key map "R" 'gdb-memory-set-rows)
+    (define-key map "C" 'gdb-memory-set-columns)
+     map))
+
+(defun gdb-memory-set-address-event (event)
+  "Handle a click on address field in memory buffer header."
+  (interactive "e")
+  (save-selected-window
+    (select-window (posn-window (event-start event)))
+    (gdb-memory-set-address)))
+
+;; Non-event version for use within keymap
+(defun gdb-memory-set-address ()
+  "Set the start memory address."
+  (interactive)
+  (let ((arg (read-from-minibuffer "Memory address: ")))
+    (setq gdb-memory-address arg))
+  (gdb-invalidate-memory 'update))
+
+(defmacro def-gdb-set-positive-number (name variable echo-string &optional doc)
+  "Define a function NAME which reads new VAR value from minibuffer."
+  `(defun ,name (event)
+     ,(when doc doc)
+     (interactive "e")
+     (save-selected-window
+       (select-window (posn-window (event-start event)))
+       (let* ((arg (read-from-minibuffer ,echo-string))
+              (count (string-to-number arg)))
+         (if (<= count 0)
+             (error "Positive number only")
+           (customize-set-variable ',variable count)
+           (gdb-invalidate-memory 'update))))))
+
+(def-gdb-set-positive-number
+  gdb-memory-set-rows
+  gdb-memory-rows
+  "Rows: "
+  "Set the number of data rows in memory window.")
+
+(def-gdb-set-positive-number
+  gdb-memory-set-columns
+  gdb-memory-columns
+  "Columns: "
+  "Set the number of data columns in memory window.")
+
+(defmacro def-gdb-memory-format (name format doc)
+  "Define a function NAME to switch memory buffer to use FORMAT.
+
+DOC is an optional documentation string."
+  `(defun ,name () ,(when doc doc)
+     (interactive)
+     (customize-set-variable 'gdb-memory-format ,format)
+     (gdb-invalidate-memory 'update)))
+
+(def-gdb-memory-format
+  gdb-memory-format-binary "t"
+  "Set the display format to binary.")
+
+(def-gdb-memory-format
+  gdb-memory-format-octal "o"
+  "Set the display format to octal.")
+
+(def-gdb-memory-format
+  gdb-memory-format-unsigned "u"
+  "Set the display format to unsigned decimal.")
+
+(def-gdb-memory-format
+  gdb-memory-format-signed "d"
+  "Set the display format to decimal.")
+
+(def-gdb-memory-format
+  gdb-memory-format-hexadecimal "x"
+  "Set the display format to hexadecimal.")
+
+(defvar gdb-memory-format-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map [header-line down-mouse-3] 'gdb-memory-format-menu-1)
+    map)
+  "Keymap to select format in the header line.")
+
+(defvar gdb-memory-format-menu (make-sparse-keymap "Format")
+  "Menu of display formats in the header line.")
+
+(define-key gdb-memory-format-menu [binary]
+  '(menu-item "Binary" gdb-memory-format-binary
+	      :button (:radio . (equal gdb-memory-format "t"))))
+(define-key gdb-memory-format-menu [octal]
+  '(menu-item "Octal" gdb-memory-format-octal
+	      :button (:radio . (equal gdb-memory-format "o"))))
+(define-key gdb-memory-format-menu [unsigned]
+  '(menu-item "Unsigned Decimal" gdb-memory-format-unsigned
+	      :button (:radio . (equal gdb-memory-format "u"))))
+(define-key gdb-memory-format-menu [signed]
+  '(menu-item "Signed Decimal" gdb-memory-format-signed
+	      :button (:radio . (equal gdb-memory-format "d"))))
+(define-key gdb-memory-format-menu [hexadecimal]
+  '(menu-item "Hexadecimal" gdb-memory-format-hexadecimal
+	      :button (:radio . (equal gdb-memory-format "x"))))
+
+(defun gdb-memory-format-menu (event)
+  (interactive "@e")
+  (x-popup-menu event gdb-memory-format-menu))
+
+(defun gdb-memory-format-menu-1 (event)
+  (interactive "e")
+  (save-selected-window
+    (select-window (posn-window (event-start event)))
+    (let* ((selection (gdb-memory-format-menu event))
+	   (binding (and selection (lookup-key gdb-memory-format-menu
+					       (vector (car selection))))))
+      (if binding (call-interactively binding)))))
+
+(defmacro def-gdb-memory-unit (name unit-size doc)
+  "Define a function NAME to switch memory unit size to UNIT-SIZE.
+
+DOC is an optional documentation string."
+  `(defun ,name () ,(when doc doc)
+     (interactive)
+     (customize-set-variable 'gdb-memory-unit ,unit-size)
+     (gdb-invalidate-memory 'update)))
+
+(def-gdb-memory-unit gdb-memory-unit-giant 8
+  "Set the unit size to giant words (eight bytes).")
+
+(def-gdb-memory-unit gdb-memory-unit-word 4
+  "Set the unit size to words (four bytes).")
+
+(def-gdb-memory-unit gdb-memory-unit-halfword 2
+  "Set the unit size to halfwords (two bytes).")
+
+(def-gdb-memory-unit gdb-memory-unit-byte 1
+  "Set the unit size to bytes.")
+
+(defmacro def-gdb-memory-show-page (name address-var &optional doc)
+  "Define a function NAME which show new address in memory buffer.
+
+The defined function switches Memory buffer to show address
+stored in ADDRESS-VAR variable.
+
+DOC is an optional documentation string."
+  `(defun ,name
+     ,(when doc doc)
+     (interactive)
+     (let ((gdb-memory-address ,address-var))
+       (gdb-invalidate-memory))))
+
+(def-gdb-memory-show-page gdb-memory-show-previous-page
+  gdb-memory-prev-page)
+
+(def-gdb-memory-show-page gdb-memory-show-next-page
+  gdb-memory-next-page)
+
+(defvar gdb-memory-unit-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map [header-line down-mouse-3] 'gdb-memory-unit-menu-1)
+    map)
+  "Keymap to select units in the header line.")
+
+(defvar gdb-memory-unit-menu (make-sparse-keymap "Unit")
+  "Menu of units in the header line.")
+
+(define-key gdb-memory-unit-menu [giantwords]
+  '(menu-item "Giant words" gdb-memory-unit-giant
+	      :button (:radio . (equal gdb-memory-unit 8))))
+(define-key gdb-memory-unit-menu [words]
+  '(menu-item "Words" gdb-memory-unit-word
+	      :button (:radio . (equal gdb-memory-unit 4))))
+(define-key gdb-memory-unit-menu [halfwords]
+  '(menu-item "Halfwords" gdb-memory-unit-halfword
+	      :button (:radio . (equal gdb-memory-unit 2))))
+(define-key gdb-memory-unit-menu [bytes]
+  '(menu-item "Bytes" gdb-memory-unit-byte
+	      :button (:radio . (equal gdb-memory-unit 1))))
+
+(defun gdb-memory-unit-menu (event)
+  (interactive "@e")
+  (x-popup-menu event gdb-memory-unit-menu))
+
+(defun gdb-memory-unit-menu-1 (event)
+  (interactive "e")
+  (save-selected-window
+    (select-window (posn-window (event-start event)))
+    (let* ((selection (gdb-memory-unit-menu event))
+	   (binding (and selection (lookup-key gdb-memory-unit-menu
+					       (vector (car selection))))))
+      (if binding (call-interactively binding)))))
+
+(defvar gdb-memory-font-lock-keywords
+  '(;; <__function.name+n>
+    ("<\\(\\(\\sw\\|[_.]\\)+\\)\\(\\+[0-9]+\\)?>" (1 font-lock-function-name-face))
+    )
+  "Font lock keywords used in `gdb-memory-mode'.")
+
+(defvar gdb-memory-header
+  '(:eval
+    (concat
+     "Start address["
+     (propertize "-"
+                  'face font-lock-warning-face
+                  'help-echo "mouse-1: decrement address"
+                  'mouse-face 'mode-line-highlight
+                  'local-map (gdb-make-header-line-mouse-map
+                              'mouse-1
+                              #'gdb-memory-show-previous-page))
+     "|"
+     (propertize "+"
+                  'face font-lock-warning-face
+                  'help-echo "mouse-1: increment address"
+                 'mouse-face 'mode-line-highlight
+                 'local-map (gdb-make-header-line-mouse-map
+                             'mouse-1
+                             #'gdb-memory-show-next-page))
+    "]: "
+    (propertize gdb-memory-address
+                 'face font-lock-warning-face
+                 'help-echo "mouse-1: set start address"
+                 'mouse-face 'mode-line-highlight
+                 'local-map (gdb-make-header-line-mouse-map
+                             'mouse-1
+                             #'gdb-memory-set-address-event))
+    "  Rows: "
+    (propertize (number-to-string gdb-memory-rows)
+                 'face font-lock-warning-face
+                 'help-echo "mouse-1: set number of columns"
+                 'mouse-face 'mode-line-highlight
+                 'local-map (gdb-make-header-line-mouse-map
+                             'mouse-1
+                             #'gdb-memory-set-rows))
+    "  Columns: "
+    (propertize (number-to-string gdb-memory-columns)
+                 'face font-lock-warning-face
+                 'help-echo "mouse-1: set number of columns"
+                 'mouse-face 'mode-line-highlight
+                 'local-map (gdb-make-header-line-mouse-map
+                             'mouse-1
+                             #'gdb-memory-set-columns))
+    "  Display Format: "
+    (propertize gdb-memory-format
+                 'face font-lock-warning-face
+                 'help-echo "mouse-3: select display format"
+                 'mouse-face 'mode-line-highlight
+                 'local-map gdb-memory-format-map)
+    "  Unit Size: "
+    (propertize (number-to-string gdb-memory-unit)
+                 'face font-lock-warning-face
+                 'help-echo "mouse-3: select unit size"
+                 'mouse-face 'mode-line-highlight
+                 'local-map gdb-memory-unit-map)))
+  "Header line used in `gdb-memory-mode'.")
+
+(define-derived-mode gdb-memory-mode gdb-parent-mode "Memory"
+  "Major mode for examining memory.
+
+\\{gdb-memory-mode-map}"
+  (setq header-line-format gdb-memory-header)
+  (set (make-local-variable 'font-lock-defaults)
+       '(gdb-memory-font-lock-keywords))
+  (run-mode-hooks 'gdb-memory-mode-hook)
+  'gdb-invalidate-memory)
+
+(defun gdb-memory-buffer-name ()
+  (concat "*memory of " (gdb-get-target-string) "*"))
+
+(def-gdb-display-buffer
+  gdb-display-memory-buffer
+  'gdb-memory-buffer
+  "Display memory contents.")
+
+(defun gdb-frame-memory-buffer ()
+  "Display memory contents in a new frame."
+  (interactive)
+  (let* ((special-display-regexps (append special-display-regexps '(".*")))
+	 (special-display-frame-alist
+	  `((left-fringe . 0)
+            (right-fringe . 0)
+            (width . 83)
+            ,@gdb-frame-parameters)))
+    (display-buffer (gdb-get-buffer-create 'gdb-memory-buffer))))
+
+
+;;; Disassembly view
+
+(defun gdb-disassembly-buffer-name ()
+  (gdb-current-context-buffer-name
+   (concat "disassembly of " (gdb-get-target-string))))
+
+(def-gdb-display-buffer
+ gdb-display-disassembly-buffer
+ 'gdb-disassembly-buffer
+ "Display disassembly for current stack frame.")
+
+(def-gdb-preempt-display-buffer
+  gdb-preemptively-display-disassembly-buffer
+  'gdb-disassembly-buffer)
+
+(def-gdb-frame-for-buffer
+ gdb-frame-disassembly-buffer
+ 'gdb-disassembly-buffer
+ "Display disassembly in a new frame.")
+
+(def-gdb-auto-update-trigger gdb-invalidate-disassembly
+  (let* ((frame (gdb-current-buffer-frame))
+         (file (bindat-get-field frame 'fullname))
+         (line (bindat-get-field frame 'line)))
+    (when file
+      (format "-data-disassemble -f %s -l %s -n -1 -- 0" file line)))
+  gdb-disassembly-handler
+  ;; We update disassembly only after we have actual frame information
+  ;; about all threads, so no there's `update' signal in this list
+  '(start update-disassembly))
+
+(def-gdb-auto-update-handler
+  gdb-disassembly-handler
+  gdb-invalidate-disassembly
+  gdb-disassembly-handler-custom
+  t)
+
+(gdb-set-buffer-rules
+ 'gdb-disassembly-buffer
+ 'gdb-disassembly-buffer-name
+ 'gdb-disassembly-mode
+ 'gdb-invalidate-disassembly)
+
+(defvar gdb-disassembly-font-lock-keywords
+  '(;; <__function.name+n>
+    ("<\\(\\(\\sw\\|[_.]\\)+\\)\\(\\+[0-9]+\\)?>"
+     (1 font-lock-function-name-face))
+    ;; 0xNNNNNNNN <__function.name+n>: opcode
+    ("^0x[0-9a-f]+ \\(<\\(\\(\\sw\\|[_.]\\)+\\)\\+[0-9]+>\\)?:[ \t]+\\(\\sw+\\)"
+     (4 font-lock-keyword-face))
+    ;; %register(at least i386)
+    ("%\\sw+" . font-lock-variable-name-face)
+    ("^\\(Dump of assembler code for function\\) \\(.+\\):"
+     (1 font-lock-comment-face)
+     (2 font-lock-function-name-face))
+    ("^\\(End of assembler dump\\.\\)" . font-lock-comment-face))
+  "Font lock keywords used in `gdb-disassembly-mode'.")
+
+(defvar gdb-disassembly-mode-map
+  ;; TODO
+  (let ((map (make-sparse-keymap)))
+    (suppress-keymap map)
+    (define-key map "q" 'kill-this-buffer)
+     map))
+
+(define-derived-mode gdb-disassembly-mode gdb-parent-mode "Disassembly"
+  "Major mode for GDB disassembly information.
+
+\\{gdb-disassembly-mode-map}"
+  ;; TODO Rename overlay variable for disassembly mode
+  (add-to-list 'overlay-arrow-variable-list 'gdb-disassembly-position)
+  (setq fringes-outside-margins t)
+  (set (make-local-variable 'gdb-disassembly-position) (make-marker))
+  (set (make-local-variable 'font-lock-defaults)
+       '(gdb-disassembly-font-lock-keywords))
+  (run-mode-hooks 'gdb-disassembly-mode-hook)
+  'gdb-invalidate-disassembly)
+
+(defun gdb-disassembly-handler-custom ()
+  (let* ((instructions (bindat-get-field (gdb-json-partial-output) 'asm_insns))
+         (address (bindat-get-field (gdb-current-buffer-frame) 'addr))
+         (pos 1)
+         (table (make-gdb-table))
+         (marked-line nil))
+      (dolist (instr instructions)
+      (gdb-table-add-row table
+       (list
+        (bindat-get-field instr 'address)
+        (apply 'format `("<%s+%s>:" ,@(gdb-get-many-fields instr 'func-name 'offset)))
+        (bindat-get-field instr 'inst)))
+      (when (string-equal (bindat-get-field instr 'address)
+                          address)
+        (progn
+          (setq marked-line (length (gdb-table-rows table)))
+          (setq fringe-indicator-alist
+                (if (string-equal gdb-frame-number "0")
+                    nil
+                  '((overlay-arrow . hollow-right-triangle)))))))
+      (insert (gdb-table-string table " "))
+      (gdb-disassembly-place-breakpoints)
+      ;; Mark current position with overlay arrow and scroll window to
+      ;; that point
+      (when marked-line
+        (let ((window (get-buffer-window (current-buffer) 0)))
+          (set-window-point window (gdb-mark-line marked-line gdb-disassembly-position))))
+      (setq mode-name
+            (gdb-current-context-mode-name
+            (concat "Disassembly: "
+                    (bindat-get-field (gdb-current-buffer-frame) 'func))))))
+
+(defun gdb-disassembly-place-breakpoints ()
+  (gdb-remove-breakpoint-icons (point-min) (point-max))
+  (dolist (breakpoint gdb-breakpoints-list)
+    (let* ((breakpoint (cdr breakpoint))
+           (bptno (bindat-get-field breakpoint 'number))
+           (flag (bindat-get-field breakpoint 'enabled))
+           (address (bindat-get-field breakpoint 'addr)))
+      (save-excursion
+        (goto-char (point-min))
+        (if (re-search-forward (concat "^" address) nil t)
+            (gdb-put-breakpoint-icon (string-equal flag "y") bptno))))))
+
+
+(defvar gdb-breakpoints-header
+  (list
+   (gdb-propertize-header "Breakpoints" gdb-breakpoints-buffer
+			  nil nil mode-line)
+   " "
+   (gdb-propertize-header "Threads" gdb-threads-buffer
+			  "mouse-1: select" mode-line-highlight mode-line-inactive)))
+
+;;; Breakpoints view
+(define-derived-mode gdb-breakpoints-mode gdb-parent-mode "Breakpoints"
+  "Major mode for gdb breakpoints.
+
+\\{gdb-breakpoints-mode-map}"
+  (setq header-line-format gdb-breakpoints-header)
+  (run-mode-hooks 'gdb-breakpoints-mode-hook)
+  'gdb-invalidate-breakpoints)
+
+(defun gdb-toggle-breakpoint ()
+  "Enable/disable breakpoint at current line of breakpoints buffer."
+  (interactive)
+  (save-excursion
+    (beginning-of-line)
+    (let ((breakpoint (get-text-property (point) 'gdb-breakpoint)))
+      (if breakpoint
+          (gud-basic-call
+           (concat (if (string-equal "y" (bindat-get-field breakpoint 'enabled))
+                       "-break-disable "
+                     "-break-enable ")
+                   (bindat-get-field breakpoint 'number)))
+        (error "Not recognized as break/watchpoint line")))))
+
+(defun gdb-delete-breakpoint ()
+  "Delete the breakpoint at current line of breakpoints buffer."
+  (interactive)
+  (save-excursion
+  (beginning-of-line)
+  (let ((breakpoint (get-text-property (point) 'gdb-breakpoint)))
+    (if breakpoint
+        (gud-basic-call (concat "-break-delete " (bindat-get-field breakpoint 'number)))
+      (error "Not recognized as break/watchpoint line")))))
+
+(defun gdb-goto-breakpoint (&optional event)
+  "Go to the location of breakpoint at current line of
+breakpoints buffer."
+  (interactive (list last-input-event))
+  (if event (posn-set-point (event-end event)))
+  ;; Hack to stop gdb-goto-breakpoint displaying in GUD buffer.
+  (let ((window (get-buffer-window gud-comint-buffer)))
+    (if window (save-selected-window  (select-window window))))
+  (save-excursion
+  (beginning-of-line)
+  (let ((breakpoint (get-text-property (point) 'gdb-breakpoint)))
+    (if breakpoint
+	(let ((bptno (bindat-get-field breakpoint 'number))
+	      (file  (bindat-get-field breakpoint 'fullname))
+	      (line  (bindat-get-field breakpoint 'line)))
+	  (save-selected-window
+	    (let* ((buffer (find-file-noselect
+			 (if (file-exists-p file) file
+			   (cdr (assoc bptno gdb-location-alist)))))
+		   (window (or (gdb-display-source-buffer buffer)
+			       (display-buffer buffer))))
+	      (setq gdb-source-window window)
+	      (with-current-buffer buffer
+		(goto-char (point-min))
+		(forward-line (1- (string-to-number line)))
+		(set-window-point window (point))))))
+      (error "Not recognized as break/watchpoint line")))))
+
+
+;; Frames buffer.  This displays a perpetually correct bactrack trace.
+;;
+(def-gdb-trigger-and-handler
+  gdb-invalidate-frames (gdb-current-context-command "-stack-list-frames")
+  gdb-stack-list-frames-handler gdb-stack-list-frames-custom
+  '(start update))
+
+(gdb-set-buffer-rules
+ 'gdb-stack-buffer
+ 'gdb-stack-buffer-name
+ 'gdb-frames-mode
+ 'gdb-invalidate-frames)
+
+(defun gdb-frame-location (frame)
+  "Return \" of file:line\" or \" of library\" for structure FRAME.
+
+FRAME must have either \"file\" and \"line\" members or \"from\"
+member."
+  (let ((file (bindat-get-field frame 'file))
+        (line (bindat-get-field frame 'line))
+        (from (bindat-get-field frame 'from)))
+    (let ((res (or (and file line (concat file ":" line))
+                   from)))
+      (if res (concat " of " res) ""))))
+
+(defun gdb-stack-list-frames-custom ()
+  (let ((stack (bindat-get-field (gdb-json-partial-output "frame") 'stack))
+        (table (make-gdb-table)))
+    (set-marker gdb-stack-position nil)
+         (dolist (frame stack)
+           (gdb-table-add-row table
+            (list
+             (bindat-get-field frame 'level)
+             "in"
+             (concat
+              (bindat-get-field frame 'func)
+              (if gdb-stack-buffer-locations
+                  (gdb-frame-location frame) "")
+              (if gdb-stack-buffer-addresses
+                  (concat " at " (bindat-get-field frame 'addr)) "")))
+            `(mouse-face highlight
+              help-echo "mouse-2, RET: Select frame"
+              gdb-frame ,frame)))
+         (insert (gdb-table-string table " ")))
+  (when (and gdb-frame-number
+             (gdb-buffer-shows-main-thread-p))
+    (gdb-mark-line (1+ (string-to-number gdb-frame-number))
+                   gdb-stack-position))
+  (setq mode-name
+        (gdb-current-context-mode-name "Frames")))
+
+(defun gdb-stack-buffer-name ()
+  (gdb-current-context-buffer-name
+   (concat "stack frames of " (gdb-get-target-string))))
+
+(def-gdb-display-buffer
+ gdb-display-stack-buffer
+ 'gdb-stack-buffer
+ "Display backtrace of current stack.")
+
+(def-gdb-preempt-display-buffer
+  gdb-preemptively-display-stack-buffer
+  'gdb-stack-buffer nil t)
+
+(def-gdb-frame-for-buffer
+ gdb-frame-stack-buffer
+ 'gdb-stack-buffer
+ "Display backtrace of current stack in a new frame.")
+
+(defvar gdb-frames-mode-map
+  (let ((map (make-sparse-keymap)))
+    (suppress-keymap map)
+    (define-key map "q" 'kill-this-buffer)
+    (define-key map "\r" 'gdb-select-frame)
+    (define-key map [mouse-2] 'gdb-select-frame)
+    (define-key map [follow-link] 'mouse-face)
+    map))
+
+(defvar gdb-frames-font-lock-keywords
+  '(("in \\([^ ]+\\)"  (1 font-lock-function-name-face)))
+  "Font lock keywords used in `gdb-frames-mode'.")
+
+(define-derived-mode gdb-frames-mode gdb-parent-mode "Frames"
+  "Major mode for gdb call stack.
+
+\\{gdb-frames-mode-map}"
+  (setq gdb-stack-position (make-marker))
+  (add-to-list 'overlay-arrow-variable-list 'gdb-stack-position)
+  (setq truncate-lines t)  ;; Make it easier to see overlay arrow.
+  (set (make-local-variable 'font-lock-defaults)
+       '(gdb-frames-font-lock-keywords))
+  (run-mode-hooks 'gdb-frames-mode-hook)
+  'gdb-invalidate-frames)
+
+(defun gdb-select-frame (&optional event)
+  "Select the frame and display the relevant source."
+  (interactive (list last-input-event))
+  (if event (posn-set-point (event-end event)))
+  (let ((frame (get-text-property (point) 'gdb-frame)))
+    (if frame
+        (if (gdb-buffer-shows-main-thread-p)
+            (let ((new-level (bindat-get-field frame 'level)))
+              (setq gdb-frame-number new-level)
+              (gdb-input (list (concat "-stack-select-frame " new-level) 'ignore))
+              (gdb-update))
+          (error "Could not select frame for non-current thread"))
+      (error "Not recognized as frame line"))))
+
+
+;; Locals buffer.
+;; uses "-stack-list-locals --simple-values". Needs GDB 6.1 onwards.
+(def-gdb-trigger-and-handler
+  gdb-invalidate-locals
+  (concat (gdb-current-context-command "-stack-list-locals") " --simple-values")
+  gdb-locals-handler gdb-locals-handler-custom
+  '(start update))
+
+(gdb-set-buffer-rules
+ 'gdb-locals-buffer
+ 'gdb-locals-buffer-name
+ 'gdb-locals-mode
+ 'gdb-invalidate-locals)
+
+(defvar gdb-locals-watch-map
+  (let ((map (make-sparse-keymap)))
+    (suppress-keymap map)
+    (define-key map "\r" 'gud-watch)
+    (define-key map [mouse-2] 'gud-watch)
+    map)
+ "Keymap to create watch expression of a complex data type local variable.")
+
+(defvar gdb-edit-locals-map-1
+  (let ((map (make-sparse-keymap)))
+    (suppress-keymap map)
+    (define-key map "\r" 'gdb-edit-locals-value)
+    (define-key map [mouse-2] 'gdb-edit-locals-value)
+    map)
+ "Keymap to edit value of a simple data type local variable.")
+
+(defun gdb-edit-locals-value (&optional event)
+  "Assign a value to a variable displayed in the locals buffer."
+  (interactive (list last-input-event))
+  (save-excursion
+    (if event (posn-set-point (event-end event)))
+    (beginning-of-line)
+    (let* ((var (bindat-get-field
+                 (get-text-property (point) 'gdb-local-variable) 'name))
+	   (value (read-string (format "New value (%s): " var))))
+      (gud-basic-call
+       (concat  "-gdb-set variable " var " = " value)))))
+
+;; Dont display values of arrays or structures.
+;; These can be expanded using gud-watch.
+(defun gdb-locals-handler-custom ()
+  (let ((locals-list (bindat-get-field (gdb-json-partial-output) 'locals))
+        (table (make-gdb-table)))
+    (dolist (local locals-list)
+      (let ((name (bindat-get-field local 'name))
+            (value (bindat-get-field local 'value))
+            (type (bindat-get-field local 'type)))
+        (if (or (not value)
+                (string-match "\\0x" value))
+            (add-text-properties 0 (length name)
+			    `(mouse-face highlight
+			      help-echo "mouse-2: create watch expression"
+			      local-map ,gdb-locals-watch-map)
+			    name)
+          (add-text-properties 0 (length value)
+                               `(mouse-face highlight
+			        help-echo "mouse-2: edit value"
+			        local-map ,gdb-edit-locals-map-1)
+                               value))
+        (gdb-table-add-row
+         table
+         (list
+          (propertize type 'font-lock-face font-lock-type-face)
+          (propertize name 'font-lock-face font-lock-variable-name-face)
+          value)
+         `(gdb-local-variable ,local))))
+    (insert (gdb-table-string table " "))
+    (setq mode-name
+          (gdb-current-context-mode-name
+          (concat "Locals: " (bindat-get-field (gdb-current-buffer-frame) 'func))))))
+
+(defvar gdb-locals-header
+  (list
+   (gdb-propertize-header "Locals" gdb-locals-buffer
+			  nil nil mode-line)
+   " "
+   (gdb-propertize-header "Registers" gdb-registers-buffer
+			  "mouse-1: select" mode-line-highlight mode-line-inactive)))
+
+(defvar gdb-locals-mode-map
+  (let ((map (make-sparse-keymap)))
+    (suppress-keymap map)
+    (define-key map "q" 'kill-this-buffer)
+    (define-key map "\t" '(lambda ()
+                            (interactive)
+                            (gdb-set-window-buffer
+                             (gdb-get-buffer-create
+                              'gdb-registers-buffer
+                              gdb-thread-number) t)))
+     map))
+
+(define-derived-mode gdb-locals-mode gdb-parent-mode "Locals"
+  "Major mode for gdb locals.
+
+\\{gdb-locals-mode-map}"
+  (setq header-line-format gdb-locals-header)
+  (run-mode-hooks 'gdb-locals-mode-hook)
+  'gdb-invalidate-locals)
+
+(defun gdb-locals-buffer-name ()
+  (gdb-current-context-buffer-name
+   (concat "locals of " (gdb-get-target-string))))
+
+(def-gdb-display-buffer
+ gdb-display-locals-buffer
+ 'gdb-locals-buffer
+ "Display local variables of current stack and their values.")
+
+(def-gdb-preempt-display-buffer
+ gdb-preemptively-display-locals-buffer
+ 'gdb-locals-buffer nil t)
+
+(def-gdb-frame-for-buffer
+ gdb-frame-locals-buffer
+ 'gdb-locals-buffer
+ "Display local variables of current stack and their values in a new frame.")
+
+
+;; Registers buffer.
+
+(def-gdb-trigger-and-handler
+  gdb-invalidate-registers
+  (concat (gdb-current-context-command "-data-list-register-values") " x")
+  gdb-registers-handler
+  gdb-registers-handler-custom
+  '(start update))
+
+(gdb-set-buffer-rules
+ 'gdb-registers-buffer
+ 'gdb-registers-buffer-name
+ 'gdb-registers-mode
+ 'gdb-invalidate-registers)
+
+(defun gdb-registers-handler-custom ()
+  (when gdb-register-names
+    (let ((register-values (bindat-get-field (gdb-json-partial-output) 'register-values))
+          (table (make-gdb-table)))
+      (dolist (register register-values)
+        (let* ((register-number (bindat-get-field register 'number))
+               (value (bindat-get-field register 'value))
+               (register-name (nth (string-to-number register-number)
+                                   gdb-register-names)))
+          (gdb-table-add-row
+           table
+           (list
+            (propertize register-name 'font-lock-face font-lock-variable-name-face)
+            (if (member register-number gdb-changed-registers)
+                (propertize value 'font-lock-face font-lock-warning-face)
+              value))
+           `(mouse-face highlight
+                        help-echo "mouse-2: edit value"
+                        gdb-register-name ,register-name))))
+      (insert (gdb-table-string table " ")))
+    (setq mode-name
+          (gdb-current-context-mode-name "Registers"))))
+
+(defun gdb-edit-register-value (&optional event)
+  "Assign a value to a register displayed in the registers buffer."
+  (interactive (list last-input-event))
+  (save-excursion
+    (if event (posn-set-point (event-end event)))
+    (beginning-of-line)
+    (let* ((var (bindat-get-field
+                 (get-text-property (point) 'gdb-register-name)))
+	   (value (read-string (format "New value (%s): " var))))
+      (gud-basic-call
+       (concat  "-gdb-set variable $" var " = " value)))))
+
+(defvar gdb-registers-mode-map
+  (let ((map (make-sparse-keymap)))
+    (suppress-keymap map)
+    (define-key map "\r" 'gdb-edit-register-value)
+    (define-key map [mouse-2] 'gdb-edit-register-value)
+    (define-key map "q" 'kill-this-buffer)
+    (define-key map "\t" '(lambda ()
+                            (interactive)
+                            (gdb-set-window-buffer
+                             (gdb-get-buffer-create
+                              'gdb-locals-buffer
+                              gdb-thread-number) t)))
+    map))
+
+(defvar gdb-registers-header
+  (list
+   (gdb-propertize-header "Locals" gdb-locals-buffer
+			  "mouse-1: select" mode-line-highlight mode-line-inactive)
+   " "
+   (gdb-propertize-header "Registers" gdb-registers-buffer
+			  nil nil mode-line)))
+
+(define-derived-mode gdb-registers-mode gdb-parent-mode "Registers"
+  "Major mode for gdb registers.
+
+\\{gdb-registers-mode-map}"
+  (setq header-line-format gdb-registers-header)
+  (run-mode-hooks 'gdb-registers-mode-hook)
+  'gdb-invalidate-registers)
+
+(defun gdb-registers-buffer-name ()
+  (gdb-current-context-buffer-name
+   (concat "registers of " (gdb-get-target-string))))
+
+(def-gdb-display-buffer
+ gdb-display-registers-buffer
+ 'gdb-registers-buffer
+ "Display integer register contents.")
+
+(def-gdb-preempt-display-buffer
+  gdb-preemptively-display-registers-buffer
+ 'gdb-registers-buffer nil t)
+
+(def-gdb-frame-for-buffer
+ gdb-frame-registers-buffer
+ 'gdb-registers-buffer
+  "Display integer register contents in a new frame.")
+
+;; Needs GDB 6.4 onwards (used to fail with no stack).
+(defun gdb-get-changed-registers ()
+  (if (and (gdb-get-buffer 'gdb-registers-buffer)
+	   (not (gdb-pending-p 'gdb-get-changed-registers)))
+      (progn
+	(gdb-input
+	 (list
+	  "-data-list-changed-registers"
+	  'gdb-changed-registers-handler))
+	(gdb-add-pending 'gdb-get-changed-registers))))
+
+(defun gdb-changed-registers-handler ()
+  (gdb-delete-pending 'gdb-get-changed-registers)
+  (setq gdb-changed-registers nil)
+  (dolist (register-number (bindat-get-field (gdb-json-partial-output) 'changed-registers))
+    (push register-number gdb-changed-registers)))
+
+(defun gdb-register-names-handler ()
+  ;; Don't use gdb-pending-triggers because this handler is called
+  ;; only once (in gdb-init-1)
+  (setq gdb-register-names nil)
+  (dolist (register-name (bindat-get-field (gdb-json-partial-output) 'register-names))
+    (push register-name gdb-register-names))
+  (setq gdb-register-names (reverse gdb-register-names)))
+
+
+(defun gdb-get-source-file-list ()
+  "Create list of source files for current GDB session.
+If buffers already exist for any of these files, gud-minor-mode
+is set in them."
+  (goto-char (point-min))
+  (while (re-search-forward gdb-source-file-regexp nil t)
+    (push (match-string 1) gdb-source-file-list))
+  (dolist (buffer (buffer-list))
+    (with-current-buffer buffer
+      (when (member buffer-file-name gdb-source-file-list)
+	(gdb-init-buffer))))
+  (gdb-force-mode-line-update
+   (propertize "ready" 'face font-lock-variable-name-face)))
+
+(defun gdb-get-main-selected-frame ()
+  "Trigger for `gdb-frame-handler' which uses main current
+thread. Called from `gdb-update'."
+  (if (not (gdb-pending-p 'gdb-get-main-selected-frame))
+      (progn
+	(gdb-input
+	 (list (gdb-current-context-command "-stack-info-frame") 'gdb-frame-handler))
+	(gdb-add-pending 'gdb-get-main-selected-frame))))
+
+(defun gdb-frame-handler ()
+  "Sets `gdb-selected-frame' and `gdb-selected-file' to show
+overlay arrow in source buffer."
+  (gdb-delete-pending 'gdb-get-main-selected-frame)
+  (let ((frame (bindat-get-field (gdb-json-partial-output) 'frame)))
+    (when frame
+      (setq gdb-selected-frame (bindat-get-field frame 'func))
+      (setq gdb-selected-file (bindat-get-field frame 'fullname))
+      (setq gdb-frame-number (bindat-get-field frame 'level))
+      (setq gdb-frame-address (bindat-get-field frame 'addr))
+      (let ((line (bindat-get-field frame 'line)))
+        (setq gdb-selected-line (and line (string-to-number line)))
+        (when (and gdb-selected-file gdb-selected-line)
+          (setq gud-last-frame (cons gdb-selected-file gdb-selected-line))
+          (gud-display-frame)))
+      (if gud-overlay-arrow-position
+          (let ((buffer (marker-buffer gud-overlay-arrow-position))
+                (position (marker-position gud-overlay-arrow-position)))
+            (when buffer
+              (with-current-buffer buffer
+                (setq fringe-indicator-alist
+                      (if (string-equal gdb-frame-number "0")
+                          nil
+                        '((overlay-arrow . hollow-right-triangle))))
+                (setq gud-overlay-arrow-position (make-marker))
+                (set-marker gud-overlay-arrow-position position))))))))
+
+(defvar gdb-prompt-name-regexp "value=\"\\(.*?\\)\"")
+
+(defun gdb-get-prompt ()
+  "Find prompt for GDB session."
+  (goto-char (point-min))
+  (setq gdb-prompt-name nil)
+  (re-search-forward gdb-prompt-name-regexp nil t)
+  (setq gdb-prompt-name (match-string 1))
+  ;; Insert first prompt.
+  (setq gdb-filter-output (concat gdb-filter-output gdb-prompt-name)))
+
+;;;; Window management
+(defun gdb-display-buffer (buf dedicated &optional frame)
+  "Show buffer BUF.
+
+If BUF is already displayed in some window, show it, deiconifying
+the frame if necessary. Otherwise, find least recently used
+window and show BUF there, if the window is not used for GDB
+already, in which case that window is splitted first."
+  (let ((answer (get-buffer-window buf (or frame 0))))
+    (if answer
+	(display-buffer buf nil (or frame 0)) ;Deiconify the frame if necessary.
+      (let ((window (get-lru-window)))
+	(if (eq (buffer-local-value 'gud-minor-mode (window-buffer window))
+		  'gdbmi)
+	    (let* ((largest (get-largest-window))
+		   (cur-size (window-height largest)))
+	      (setq answer (split-window largest))
+	      (set-window-buffer answer buf)
+	      (set-window-dedicated-p answer dedicated)
+	      answer)
+	  (set-window-buffer window buf)
+	  window)))))
+
+(defun gdb-preempt-existing-or-display-buffer (buf &optional split-horizontal)
+  "Find window displaying a buffer with the same
+`gdb-buffer-type' as BUF and show BUF there. If no such window
+exists, just call `gdb-display-buffer' for BUF. If the window
+found is already dedicated, split window according to
+SPLIT-HORIZONTAL and show BUF in the new window."
+  (if buf
+      (when (not (get-buffer-window buf))
+        (let* ((buf-type (gdb-buffer-type buf))
+               (existing-window
+                (get-window-with-predicate
+                 #'(lambda (w)
+                     (and (eq buf-type
+                              (gdb-buffer-type (window-buffer w)))
+                          (not (window-dedicated-p w)))))))
+          (if existing-window
+              (set-window-buffer existing-window buf)
+            (let ((dedicated-window
+                   (get-window-with-predicate
+                    #'(lambda (w)
+                        (eq buf-type
+                            (gdb-buffer-type (window-buffer w)))))))
+              (if dedicated-window
+                  (set-window-buffer
+                   (split-window dedicated-window nil split-horizontal) buf)
+                (gdb-display-buffer buf t))))))
+    (error "Null buffer")))
+
+;;; Shared keymap initialization:
+
+(let ((menu (make-sparse-keymap "GDB-Windows")))
+  (define-key gud-menu-map [displays]
+    `(menu-item "GDB-Windows" ,menu
+		:visible (eq gud-minor-mode 'gdbmi)))
+  (define-key menu [gdb] '("Gdb" . gdb-display-gdb-buffer))
+  (define-key menu [threads] '("Threads" . gdb-display-threads-buffer))
+  (define-key menu [memory] '("Memory" . gdb-display-memory-buffer))
+  (define-key menu [disassembly]
+    '("Disassembly" . gdb-display-disassembly-buffer))
+  (define-key menu [registers] '("Registers" . gdb-display-registers-buffer))
+  (define-key menu [inferior]
+    '("IO" . gdb-display-io-buffer))
+  (define-key menu [locals] '("Locals" . gdb-display-locals-buffer))
+  (define-key menu [frames] '("Stack" . gdb-display-stack-buffer))
+  (define-key menu [breakpoints]
+    '("Breakpoints" . gdb-display-breakpoints-buffer)))
+
+(let ((menu (make-sparse-keymap "GDB-Frames")))
+  (define-key gud-menu-map [frames]
+    `(menu-item "GDB-Frames" ,menu
+		:visible (eq gud-minor-mode 'gdbmi)))
+  (define-key menu [gdb] '("Gdb" . gdb-frame-gdb-buffer))
+  (define-key menu [threads] '("Threads" . gdb-frame-threads-buffer))
+  (define-key menu [memory] '("Memory" . gdb-frame-memory-buffer))
+  (define-key menu [disassembly] '("Disassembly" . gdb-frame-disassembly-buffer))
+  (define-key menu [registers] '("Registers" . gdb-frame-registers-buffer))
+  (define-key menu [inferior]
+    '("IO" . gdb-frame-io-buffer))
+  (define-key menu [locals] '("Locals" . gdb-frame-locals-buffer))
+  (define-key menu [frames] '("Stack" . gdb-frame-stack-buffer))
+  (define-key menu [breakpoints]
+    '("Breakpoints" . gdb-frame-breakpoints-buffer)))
+
+(let ((menu (make-sparse-keymap "GDB-MI")))
+  (define-key menu [gdb-customize]
+  '(menu-item "Customize" (lambda () (interactive) (customize-group 'gdb))
+	      :help "Customize Gdb Graphical Mode options."))
+  (define-key menu [gdb-many-windows]
+  '(menu-item "Display Other Windows" gdb-many-windows
+	      :help "Toggle display of locals, stack and breakpoint information"
+	      :button (:toggle . gdb-many-windows)))
+  (define-key menu [gdb-restore-windows]
+  '(menu-item "Restore Window Layout" gdb-restore-windows
+	      :help "Restore standard layout for debug session."))
+  (define-key menu [sep1]
+    '(menu-item "--"))
+  (define-key menu [all-threads]
+    '(menu-item "GUD controls all threads"
+                (lambda ()
+                  (interactive)
+                  (setq gdb-gud-control-all-threads t))
+                :help "GUD start/stop commands apply to all threads"
+                :button (:radio . gdb-gud-control-all-threads)))
+  (define-key menu [current-thread]
+    '(menu-item "GUD controls current thread"
+                (lambda ()
+                  (interactive)
+                  (setq gdb-gud-control-all-threads nil))
+                :help "GUD start/stop commands apply to current thread only"
+                :button (:radio . (not gdb-gud-control-all-threads))))
+  (define-key menu [sep2]
+    '(menu-item "--"))
+  (define-key menu [gdb-customize-reasons]
+    '(menu-item "Customize switching..."
+                (lambda ()
+                  (interactive)
+                  (customize-option 'gdb-switch-reasons))))
+  (define-key menu [gdb-switch-when-another-stopped]
+    (menu-bar-make-toggle gdb-toggle-switch-when-another-stopped gdb-switch-when-another-stopped
+                          "Automatically switch to stopped thread"
+                          "GDB thread switching %s"
+                          "Switch to stopped thread"))
+  (define-key gud-menu-map [mi]
+    `(menu-item "GDB-MI" ,menu :visible (eq gud-minor-mode 'gdbmi))))
+
+;; TODO Fit these into tool-bar-local-item-from-menu call in gud.el.
+;; GDB-MI menu will need to be moved to gud.el. We can't use
+;; tool-bar-local-item-from-menu here because it appends new buttons
+;; to toolbar from right to left while we want our A/T throttle to
+;; show up right before Run button.
+(define-key-after gud-tool-bar-map [all-threads]
+  '(menu-item "Switch to non-stop/A mode" gdb-control-all-threads
+              :image (find-image '((:type xpm :file "gud/thread.xpm")))
+              :visible (and (eq gud-minor-mode 'gdbmi)
+                            gdb-non-stop
+                            (not gdb-gud-control-all-threads)))
+  'run)
+
+(define-key-after gud-tool-bar-map [current-thread]
+  '(menu-item "Switch to non-stop/T mode" gdb-control-current-thread
+              :image (find-image '((:type xpm :file "gud/all.xpm")))
+              :visible (and (eq gud-minor-mode 'gdbmi)
+                            gdb-non-stop
+                            gdb-gud-control-all-threads))
+  'all-threads)
+
+(defun gdb-frame-gdb-buffer ()
+  "Display GUD buffer in a new frame."
+  (interactive)
+  (let ((special-display-regexps (append special-display-regexps '(".*")))
+	(special-display-frame-alist
+	 (remove '(menu-bar-lines) (remove '(tool-bar-lines)
+					   gdb-frame-parameters)))
+	(same-window-regexps nil))
+    (display-buffer gud-comint-buffer)))
+
+(defun gdb-display-gdb-buffer ()
+  "Display GUD buffer."
+  (interactive)
+  (let ((same-window-regexps nil))
+    (select-window (display-buffer gud-comint-buffer nil 0))))
+
+(defun gdb-set-window-buffer (name &optional ignore-dedicated)
+  "Set buffer of selected window to NAME and dedicate window.
+
+When IGNORE-DEDICATED is non-nil, buffer is set even if selected
+window is dedicated."
+  (when ignore-dedicated
+    (set-window-dedicated-p (selected-window) nil))
+  (set-window-buffer (selected-window) (get-buffer name))
+  (set-window-dedicated-p (selected-window) t))
+
+(defun gdb-setup-windows ()
+  "Layout the window pattern for `gdb-many-windows'."
+  (gdb-display-locals-buffer)
+  (gdb-display-stack-buffer)
+  (delete-other-windows)
+  (gdb-display-breakpoints-buffer)
+  (delete-other-windows)
+  ; Don't dedicate.
+  (pop-to-buffer gud-comint-buffer)
+  (split-window nil ( / ( * (window-height) 3) 4))
+  (split-window nil ( / (window-height) 3))
+  (split-window-horizontally)
+  (other-window 1)
+  (gdb-set-window-buffer (gdb-locals-buffer-name))
+  (other-window 1)
+  (switch-to-buffer
+       (if gud-last-last-frame
+	   (gud-find-file (car gud-last-last-frame))
+	 (if gdb-main-file
+	     (gud-find-file gdb-main-file)
+	   ;; Put buffer list in window if we
+	   ;; can't find a source file.
+	   (list-buffers-noselect))))
+  (setq gdb-source-window (selected-window))
+  (split-window-horizontally)
+  (other-window 1)
+  (gdb-set-window-buffer
+   (gdb-get-buffer-create 'gdb-inferior-io))
+  (other-window 1)
+  (gdb-set-window-buffer (gdb-stack-buffer-name))
+  (split-window-horizontally)
+  (other-window 1)
+  (gdb-set-window-buffer (if gdb-show-threads-by-default
+                             (gdb-threads-buffer-name)
+                           (gdb-breakpoints-buffer-name)))
+  (other-window 1))
+
+(defcustom gdb-many-windows nil
+  "If nil just pop up the GUD buffer unless `gdb-show-main' is t.
+In this case it starts with two windows: one displaying the GUD
+buffer and the other with the source file with the main routine
+of the debugged program.  Non-nil means display the layout shown for
+`gdb'."
+  :type 'boolean
+  :group 'gdb
+  :version "22.1")
+
+(defun gdb-many-windows (arg)
+  "Toggle the number of windows in the basic arrangement.
+With arg, display additional buffers iff arg is positive."
+  (interactive "P")
+  (setq gdb-many-windows
+	(if (null arg)
+	    (not gdb-many-windows)
+	  (> (prefix-numeric-value arg) 0)))
+  (message (format "Display of other windows %sabled"
+		   (if gdb-many-windows "en" "dis")))
+  (if (and gud-comint-buffer
+	   (buffer-name gud-comint-buffer))
+      (condition-case nil
+	  (gdb-restore-windows)
+	(error nil))))
+
+(defun gdb-restore-windows ()
+  "Restore the basic arrangement of windows used by gdb.
+This arrangement depends on the value of `gdb-many-windows'."
+  (interactive)
+  (pop-to-buffer gud-comint-buffer)	;Select the right window and frame.
+    (delete-other-windows)
+  (if gdb-many-windows
+      (gdb-setup-windows)
+    (when (or gud-last-last-frame gdb-show-main)
+      (split-window)
+      (other-window 1)
+      (switch-to-buffer
+       (if gud-last-last-frame
+	   (gud-find-file (car gud-last-last-frame))
+	 (gud-find-file gdb-main-file)))
+      (setq gdb-source-window (selected-window))
+      (other-window 1))))
+
+(defun gdb-reset ()
+  "Exit a debugging session cleanly.
+Kills the gdb buffers, and resets variables and the source buffers."
+  (dolist (buffer (buffer-list))
+    (unless (eq buffer gud-comint-buffer)
+      (with-current-buffer buffer
+	(if (eq gud-minor-mode 'gdbmi)
+ 	    (if (string-match "\\` ?\\*.+\\*\\'" (buffer-name))
+		(kill-buffer nil)
+	      (gdb-remove-breakpoint-icons (point-min) (point-max) t)
+	      (setq gud-minor-mode nil)
+	      (kill-local-variable 'tool-bar-map)
+	      (kill-local-variable 'gdb-define-alist))))))
+  (setq gdb-disassembly-position nil)
+  (setq overlay-arrow-variable-list
+	(delq 'gdb-disassembly-position overlay-arrow-variable-list))
+  (setq fringe-indicator-alist '((overlay-arrow . right-triangle)))
+  (setq gdb-stack-position nil)
+  (setq overlay-arrow-variable-list
+	(delq 'gdb-stack-position overlay-arrow-variable-list))
+  (setq gdb-thread-position nil)
+  (setq overlay-arrow-variable-list
+	(delq 'gdb-thread-position overlay-arrow-variable-list))
+  (if (boundp 'speedbar-frame) (speedbar-timer-fn))
+  (setq gud-running nil)
+  (setq gdb-active-process nil)
+  (remove-hook 'after-save-hook 'gdb-create-define-alist t))
+
+(defun gdb-get-source-file ()
+  "Find the source file where the program starts and display it with related
+buffers, if required."
+  (goto-char (point-min))
+  (if (re-search-forward gdb-source-file-regexp nil t)
+      (setq gdb-main-file (match-string 1)))
+ (if gdb-many-windows
+      (gdb-setup-windows)
+   (gdb-get-buffer-create 'gdb-breakpoints-buffer)
+   (if gdb-show-main
+       (let ((pop-up-windows t))
+	 (display-buffer (gud-find-file gdb-main-file))))))
+
+;;from put-image
+(defun gdb-put-string (putstring pos &optional dprop &rest sprops)
+  "Put string PUTSTRING in front of POS in the current buffer.
+PUTSTRING is displayed by putting an overlay into the current buffer with a
+`before-string' string that has a `display' property whose value is
+PUTSTRING."
+  (let ((string (make-string 1 ?x))
+	(buffer (current-buffer)))
+    (setq putstring (copy-sequence putstring))
+    (let ((overlay (make-overlay pos pos buffer))
+	  (prop (or dprop
+		    (list (list 'margin 'left-margin) putstring))))
+      (put-text-property 0 1 'display prop string)
+      (if sprops
+	  (add-text-properties 0 1 sprops string))
+      (overlay-put overlay 'put-break t)
+      (overlay-put overlay 'before-string string))))
+
+;;from remove-images
+(defun gdb-remove-strings (start end &optional buffer)
+  "Remove strings between START and END in BUFFER.
+Remove only strings that were put in BUFFER with calls to `gdb-put-string'.
+BUFFER nil or omitted means use the current buffer."
+  (unless buffer
+    (setq buffer (current-buffer)))
+  (dolist (overlay (overlays-in start end))
+    (when (overlay-get overlay 'put-break)
+	  (delete-overlay overlay))))
+
+(defun gdb-put-breakpoint-icon (enabled bptno &optional line)
+  (let* ((posns (gdb-line-posns (or line (line-number-at-pos))))
+         (start (- (car posns) 1))
+         (end (+ (cdr posns) 1))
+         (putstring (if enabled "B" "b"))
+         (source-window (get-buffer-window (current-buffer) 0)))
+    (add-text-properties
+     0 1 '(help-echo "mouse-1: clear bkpt, mouse-3: enable/disable bkpt")
+     putstring)
+    (if enabled
+	(add-text-properties
+	 0 1 `(gdb-bptno ,bptno gdb-enabled t) putstring)
+      (add-text-properties
+       0 1 `(gdb-bptno ,bptno gdb-enabled nil) putstring))
+    (gdb-remove-breakpoint-icons start end)
+    (if (display-images-p)
+	(if (>= (or left-fringe-width
+		    (if source-window (car (window-fringes source-window)))
+		    gdb-buffer-fringe-width) 8)
+	    (gdb-put-string
+	     nil (1+ start)
+	     `(left-fringe breakpoint
+			   ,(if enabled
+				'breakpoint-enabled
+			      'breakpoint-disabled))
+	     'gdb-bptno bptno
+	     'gdb-enabled enabled)
+	  (when (< left-margin-width 2)
+	    (save-current-buffer
+	      (setq left-margin-width 2)
+	      (if source-window
+		  (set-window-margins
+		   source-window
+		   left-margin-width right-margin-width))))
+	  (put-image
+	   (if enabled
+	       (or breakpoint-enabled-icon
+		   (setq breakpoint-enabled-icon
+			 (find-image `((:type xpm :data
+					      ,breakpoint-xpm-data
+					      :ascent 100 :pointer hand)
+				       (:type pbm :data
+					      ,breakpoint-enabled-pbm-data
+					      :ascent 100 :pointer hand)))))
+	     (or breakpoint-disabled-icon
+		 (setq breakpoint-disabled-icon
+		       (find-image `((:type xpm :data
+					    ,breakpoint-xpm-data
+					    :conversion disabled
+					    :ascent 100 :pointer hand)
+				     (:type pbm :data
+					    ,breakpoint-disabled-pbm-data
+					    :ascent 100 :pointer hand))))))
+	   (+ start 1)
+	   putstring
+	   'left-margin))
+      (when (< left-margin-width 2)
+	(save-current-buffer
+	  (setq left-margin-width 2)
+	  (let ((window (get-buffer-window (current-buffer) 0)))
+	    (if window
+	      (set-window-margins
+	       window left-margin-width right-margin-width)))))
+      (gdb-put-string
+       (propertize putstring
+		   'face (if enabled 'breakpoint-enabled 'breakpoint-disabled))
+       (1+ start)))))
+
+(defun gdb-remove-breakpoint-icons (start end &optional remove-margin)
+  (gdb-remove-strings start end)
+  (if (display-images-p)
+      (remove-images start end))
+  (when remove-margin
+    (setq left-margin-width 0)
+    (let ((window (get-buffer-window (current-buffer) 0)))
+      (if window
+	  (set-window-margins
+	   window left-margin-width right-margin-width)))))
+
+(provide 'gdb-mi)
+
+;; arch-tag: 1b41ea2b-f364-4cec-8f35-e02e4fe01912
+;;; gdb-mi.el ends here
--- a/lisp/progmodes/gdb-ui.el	Fri Mar 26 08:01:19 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,4143 +0,0 @@
-;;; gdb-ui.el --- User Interface for running GDB
-
-;; Author: Nick Roberts <nickrob@gnu.org>
-;; Maintainer: FSF
-;; Keywords: unix, tools
-
-;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;; Free Software Foundation, Inc.
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs 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.
-
-;; GNU Emacs 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 GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; This mode acts as a graphical user interface to GDB.  You can interact with
-;; GDB through the GUD buffer in the usual way, but there are also further
-;; buffers which control the execution and describe the state of your program.
-;; It separates the input/output of your program from that of GDB, if
-;; required, and watches expressions in the speedbar.  It also uses features of
-;; Emacs 21 such as the fringe/display margin for breakpoints, and the toolbar
-;; (see the GDB Graphical Interface section in the Emacs info manual).
-
-;; By default, M-x gdb will start the debugger.
-
-;; This file has evolved from gdba.el that was included with GDB 5.0 and
-;; written by Tom Lord and Jim Kingdon.  It uses GDB's annotation interface.
-;; You don't need to know about annotations to use this mode as a debugger,
-;; but if you are interested developing the mode itself, see the Annotations
-;; section in the GDB info manual.
-
-;; GDB developers plan to make the annotation interface obsolete.  A new
-;; interface called GDB/MI (machine interface) has been designed to replace it.
-;; Some GDB/MI commands are used in this file through the CLI command
-;; 'interpreter mi <mi-command>'.  To help with the process of fully migrating
-;; Emacs from annotations to GDB/MI, there is an experimental package called
-;; gdb-mi in the Emacs Lisp Package Archive ("http://tromey.com/elpa/").  It
-;; comprises of modified gud.el and a file called gdb-mi.el which replaces
-;; gdb-ui.el.  When installed, this overrides the current files and invoking
-;; M-x gdb will use GDB/MI directly (starts with "gdb -i=mi").  When deleted
-;; ('d' followed by 'x' in Package Menu mode), the files are deleted and old
-;; functionality restored.  This provides a convenient way to review the
-;; current status/contribute to its improvement.  For someone who just wants to
-;; use GDB, however, the current mode in Emacs 22 is a much better option.
-;; There is also a file, also called gdb-mi.el, a version of which is included
-;; the GDB distribution.  This will probably only work with versions
-;; distributed with GDB 6.5 or later.  Unlike the version in ELPA it works on
-;; top of gdb-ui.el and you can only start it with M-x gdbmi.
-
-;; This mode SHOULD WORK WITH GDB 5.0 or later but you will NEED AT LEAST
-;; GDB 6.0 to use watch expressions.  It works best with GDB 6.4 or later
-;; where watch expressions will update more quickly.
-
-;;; Windows Platforms:
-
-;; If you are using Emacs and GDB on Windows you will need to flush the buffer
-;; explicitly in your program if you want timely display of I/O in Emacs.
-;; Alternatively you can make the output stream unbuffered, for example, by
-;; using a macro:
-
-;;           #ifdef UNBUFFERED
-;;	     setvbuf (stdout, (char *) NULL, _IONBF, 0);
-;;	     #endif
-
-;; and compiling with -DUNBUFFERED while debugging.
-
-;; If you are using Cygwin GDB and find that the source is not being displayed
-;; in Emacs when you step through it, possible solutions are to:
-
-;;   1) Use Cygwin X Windows and Cygwin Emacs.
-;;        (Since 22.1 Emacs builds under Cygwin.)
-;;   2) Use MinGW GDB instead.
-;;   3) Use cygwin-mount.el
-
-;;; Mac OSX:
-
-;; GDB in Emacs on Mac OSX works best with FSF GDB as Apple have made
-;; some changes to the version that they include as part of Mac OSX.
-;; This requires GDB version 7.0 or later (estimated release date June 2009)
-;; as earlier versions don not compile on Mac OSX.
-
-;;; Known Bugs:
-
-;; 1) Cannot handle multiple debug sessions.
-;; 2) If you wish to call procedures from your program in GDB
-;;    e.g "call myproc ()", "p mysquare (5)" then use level 2 annotations
-;;    "gdb --annotate=2 myprog" to keep source buffer/selected frame fixed.
-;; 3) After detaching from a process, clicking on the "GO" icon on toolbar
-;;    (gud-go) sends "continue" to GDB (should be "run").
-
-;;; TODO:
-
-;; 1) Use MI command -data-read-memory for memory window.
-;; 2) Use tree-buffer.el (from ECB) instead of the speedbar for
-;;    watch-expressions?  Handling of watch-expressions needs to be
-;;    overhauled to work for large arrays/structures by creating variable
-;;    objects for visible watch-expressions only.
-;; 3) Mark breakpoint locations on scroll-bar of source buffer?
-
-;;; Code:
-
-(require 'gud)
-(require 'json)
-(require 'bindat)
-
-(defvar tool-bar-map)
-(defvar speedbar-initial-expansion-list-name)
-(defvar speedbar-frame)
-
-(defvar gdb-pc-address nil "Initialization for Assembler buffer.
-Set to \"main\" at start if `gdb-show-main' is t.")
-(defvar gdb-frame-address nil "Identity of frame for watch expression.")
-(defvar gdb-previous-frame-pc-address nil)
-(defvar gdb-memory-address "main")
-(defvar gdb-previous-frame nil)
-(defvar gdb-selected-frame nil)
-(defvar gdb-frame-number nil)
-(defvar gdb-current-language nil)
-(defvar gdb-var-list nil
-  "List of variables in watch window.
-Each element has the form (VARNUM EXPRESSION NUMCHILD TYPE VALUE STATUS HAS_MORE FP)
-where STATUS is nil (`unchanged'), `changed' or `out-of-scope', FP the frame
-address for root variables.")
-(defvar gdb-main-file nil "Source file from which program execution begins.")
-(defvar gud-old-arrow nil)
-(defvar gdb-thread-indicator nil)
-(defvar gdb-overlay-arrow-position nil)
-(defvar gdb-stack-position nil)
-(defvar gdb-server-prefix nil)
-(defvar gdb-flush-pending-output nil)
-(defvar gdb-location-alist nil
-  "Alist of breakpoint numbers and full filenames.
-Only used for files that Emacs can't find.")
-(defvar gdb-active-process nil
-  "GUD tooltips display variable values when t, and macro definitions otherwise.")
-(defvar gdb-recording nil
-  "If t, then record session for playback and reverse execution")
-(defvar gdb-error "Non-nil when GDB is reporting an error.")
-(defvar gdb-macro-info nil
-  "Non-nil if GDB knows that the inferior includes preprocessor macro info.")
-(defvar gdb-buffer-fringe-width nil)
-(defvar gdb-signalled nil)
-(defvar gdb-source-window nil)
-(defvar gdb-inferior-status nil)
-(defvar gdb-continuation nil)
-(defvar gdb-look-up-stack nil)
-(defvar gdb-frame-begin nil
-  "Non-nil when GDB generates frame-begin annotation.")
-(defvar gdb-printing t)
-(defvar gdb-parent-bptno-enabled nil)
-(defvar gdb-ready nil)
-(defvar gdb-stack-update nil)
-(defvar gdb-early-user-input nil)
-
-(defvar gdb-buffer-type nil
-  "One of the symbols bound in `gdb-buffer-rules'.")
-(make-variable-buffer-local 'gdb-buffer-type)
-
-(defvar gdb-input-queue ()
-  "A list of gdb command objects.")
-
-(defvar gdb-prompting nil
-  "True when gdb is idle with no pending input.")
-
-(defvar gdb-output-sink nil
-  "The disposition of the output of the current gdb command.
-Possible values are these symbols:
-
-    `user' -- gdb output should be copied to the GUD buffer
-              for the user to see.
-
-    `inferior' -- gdb output should be copied to the inferior-io buffer.
-
-    `pre-emacs' -- output should be ignored util the post-prompt
-                   annotation is received.  Then the output-sink
-		   becomes:...
-    `emacs' -- output should be collected in the partial-output-buffer
-	       for subsequent processing by a command.  This is the
-	       disposition of output generated by commands that
-	       gdb mode sends to gdb on its own behalf.
-    `post-emacs' -- ignore output until the prompt annotation is
-		    received, then go to USER disposition.
-
-gdba (gdb-ui.el) uses all five values, gdbmi (gdb-mi.el) only two
-\(`user' and `emacs').")
-
-(defvar gdb-current-item nil
-  "The most recent command item sent to gdb.")
-
-(defvar gdb-pending-triggers '()
-  "A list of trigger functions that have run later than their output handlers.")
-
-(defvar gdb-first-post-prompt nil)
-(defvar gdb-version nil)
-(defvar gdb-locals-font-lock-keywords nil)
-(defvar gdb-source-file-list nil
-  "List of source files for the current executable.")
-(defconst gdb-error-regexp "\\^error,msg=\"\\(.+\\)\"")
-
-(defvar gdb-locals-font-lock-keywords-1
-  '(;; var = (struct struct_tag) value
-    ( "\\(^\\(\\sw\\|[_.]\\)+\\) += +(\\(struct\\) \\(\\(\\sw\\|[_.]\\)+\\)"
-      (1 font-lock-variable-name-face)
-      (3 font-lock-keyword-face)
-      (4 font-lock-type-face))
-    ;; var = (type) value
-    ( "\\(^\\(\\sw\\|[_.]\\)+\\) += +(\\(\\(\\sw\\|[_.]\\)+\\)"
-      (1 font-lock-variable-name-face)
-      (3 font-lock-type-face))
-    ;; var = val
-    ( "\\(^\\(\\sw\\|[_.]\\)+\\) += +[^(]"
-      (1 font-lock-variable-name-face)))
-  "Font lock keywords used in `gdb-local-mode'.")
-
-(defvar gdb-locals-font-lock-keywords-2
-  '(;; var = type value
-    ( "\\(^\\(\\sw\\|[_.]\\)+\\)\t+\\(\\(\\sw\\|[_.]\\)+\\)"
-      (1 font-lock-variable-name-face)
-      (3 font-lock-type-face)))
-  "Font lock keywords used in `gdb-local-mode'.")
-
-;; Variables for GDB 6.4+
-(defvar gdb-register-names nil "List of register names.")
-(defvar gdb-changed-registers nil
-  "List of changed register numbers (strings).")
-
-;;;###autoload
-(defun gdb (command-line)
-  "Run gdb on program FILE in buffer *gud-FILE*.
-The directory containing FILE becomes the initial working
-directory and source-file directory for your debugger.
-
-If `gdb-many-windows' is nil (the default value) then gdb just
-pops up the GUD buffer unless `gdb-show-main' is t.  In this case
-it starts with two windows: one displaying the GUD buffer and the
-other with the source file with the main routine of the inferior.
-
-If `gdb-many-windows' is t, regardless of the value of
-`gdb-show-main', the layout below will appear unless
-`gdb-use-separate-io-buffer' is nil when the source buffer
-occupies the full width of the frame.  Keybindings are shown in
-some of the buffers.
-
-Watch expressions appear in the speedbar/slowbar.
-
-The following commands help control operation :
-
-`gdb-many-windows'    - Toggle the number of windows gdb uses.
-`gdb-restore-windows' - To restore the window layout.
-
-See Info node `(emacs)GDB Graphical Interface' for a more
-detailed description of this mode.
-
-+----------------------------------------------------------------------+
-|                               GDB Toolbar                            |
-+-----------------------------------+----------------------------------+
-|  GUD buffer (I/O of GDB)          |  Locals buffer                   |
-|-----------------------------------+----------------------------------+
-|                                   |                                  |
-|  Source buffer                    |  I/O buffer for debugged program |
-|                                   |                                  |
-|-----------------------------------+----------------------------------+
-|  Stack buffer                     |  Breakpoints/threads buffer      |
-+-----------------------------------+----------------------------------+
-
-The option \"--annotate=3\" must be included in this value.  To
-run GDB in text command mode, use `gud-gdb'.  You need to use
-text command mode to debug multiple programs within one Emacs
-session."
-  (interactive (list (gud-query-cmdline 'gdb)))
-
-  (when (and gud-comint-buffer
-	   (buffer-name gud-comint-buffer)
-	   (get-buffer-process gud-comint-buffer)
-	   (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba)))
-	(gdb-restore-windows)
-	(error
-	 "Multiple debugging requires restarting in text command mode"))
-
-  (gud-common-init command-line nil 'gud-gdba-marker-filter)
-  (set (make-local-variable 'gud-minor-mode) 'gdba)
-  (setq comint-input-sender 'gdb-send)
-
-  (gud-def gud-break  "break %f:%l"  "\C-b" "Set breakpoint at current line.")
-  (gud-def gud-tbreak "tbreak %f:%l" "\C-t"
-	   "Set temporary breakpoint at current line.")
-  (gud-def gud-remove "clear %f:%l" "\C-d" "Remove breakpoint at current line.")
-  (gud-def gud-step   "step %p"     "\C-s" "Step one source line with display.")
-  (gud-def gud-stepi  "stepi %p"    "\C-i" "Step one instruction with display.")
-  (gud-def gud-next   "next %p"     "\C-n" "Step one line (skip functions).")
-  (gud-def gud-nexti  "nexti %p" nil   "Step one instruction (skip functions).")
-  (gud-def gud-cont   "continue"     "\C-r" "Continue with display.")
-  (gud-def gud-finish "finish"   "\C-f" "Finish executing current function.")
-  (gud-def gud-jump
-	   (progn (gud-call "tbreak %f:%l") (gud-call "jump %f:%l"))
-	   "\C-j" "Set execution address to current line.")
-
-  (gud-def gud-rstep   "reverse-step %p"  nil "Reverse step one source line with display.")
-  (gud-def gud-rstepi  "reverse-stepi %p" nil "Reverse step one instruction with display.")
-  (gud-def gud-rnext   "reverse-next %p"  nil "Reverse step one line (skip functions).")
-  (gud-def gud-rnexti  "reverse-nexti %p" nil "Reverse step one instruction (skip functions).")
-  (gud-def gud-rcont   "reverse-continue" nil "Reverse continue with display.")
-  (gud-def gud-rfinish "reverse-finish"   nil "Reverse finish executing current function.")
-
-  (gud-def gud-up     "up %p"     "<" "Up N stack frames (numeric arg).")
-  (gud-def gud-down   "down %p"   ">" "Down N stack frames (numeric arg).")
-  (gud-def gud-print  "print %e"  "\C-p" "Evaluate C expression at point.")
-  (gud-def gud-pstar  "print* %e" nil
-	   "Evaluate C dereferenced pointer expression at point.")
-
-  ;; For debugging Emacs only.
-  (gud-def gud-pv "pv1 %e"      "\C-v" "Print the value of the lisp variable.")
-
-  (gud-def gud-until  "until %l" "\C-u" "Continue to current line.")
-  (gud-def gud-run    "run"	 nil    "Run the program.")
-
-  (local-set-key "\C-i" 'gud-gdb-complete-command)
-  (setq comint-prompt-regexp "^(.*gdb[+]?) *")
-  (setq paragraph-start comint-prompt-regexp)
-  (setq gdb-output-sink 'user)
-  (setq gdb-first-prompt t)
-  (setq gud-running nil)
-  (setq gdb-ready nil)
-  (setq gdb-stack-update nil)
-  (setq gdb-flush-pending-output nil)
-  (setq gdb-early-user-input nil)
-  (setq gud-filter-pending-text nil)
-  (gdb-thread-identification)
-  (run-hooks 'gdb-mode-hook))
-
-;; Keep as an alias for compatibility with Emacs 22.1.
-;;;###autoload
-(defalias 'gdba 'gdb)
-
-(defgroup gdb nil
-  "Gdb Graphical Mode options specifically for running Gdb in Emacs."
-  :group 'processes
-  :group 'tools)
-
-(defcustom gdb-debug-log-max 128
-  "Maximum size of `gdb-debug-log'.  If nil, size is unlimited."
-  :group 'gdb
-  :type '(choice (integer :tag "Number of elements")
-		 (const   :tag "Unlimited" nil))
-  :version "22.1")
-
-(defvar gdb-debug-log nil
-  "List of commands sent to and replies received from GDB.
-Most recent commands are listed first.  This list stores only the last
-`gdb-debug-log-max' values.  This variable is used to debug GDB-UI.")
-
-;;;###autoload
-(defcustom gdb-enable-debug nil
-  "Non-nil means record the process input and output in `gdb-debug-log'."
-  :type 'boolean
-  :group 'gdb
-  :version "22.1")
-
-(defcustom gdb-cpp-define-alist-program "gcc -E -dM -"
-  "Shell command for generating a list of defined macros in a source file.
-This list is used to display the #define directive associated
-with an identifier as a tooltip.  It works in a debug session with
-GDB, when `gud-tooltip-mode' is t.
-
-Set `gdb-cpp-define-alist-flags' for any include paths or
-predefined macros."
-  :type 'string
-  :group 'gdb
-  :version "22.1")
-
-(defcustom gdb-cpp-define-alist-flags ""
-  "Preprocessor flags for `gdb-cpp-define-alist-program'."
-  :type 'string
-  :group 'gdb
-  :version "22.1")
-
-(defcustom gdb-create-source-file-list t
-  "Non-nil means create a list of files from which the executable was built.
-Set this to nil if the GUD buffer displays \"initializing...\" in the mode
-line for a long time when starting, possibly because your executable was
-built from a large number of files.  This allows quicker initialization
-but means that these files are not automatically enabled for debugging,
-e.g., you won't be able to click in the fringe to set a breakpoint until
-execution has already stopped there."
-  :type 'boolean
-  :group 'gdb
-  :version "23.1")
-
-(defcustom gdb-show-main nil
-  "Non-nil means display source file containing the main routine at startup.
-Also display the main routine in the disassembly buffer if present."
-  :type 'boolean
-  :group 'gdb
-  :version "22.1")
-
-(defcustom gdb-many-windows nil
-  "If nil, just pop up the GUD buffer unless `gdb-show-main' is t.
-In this case start with two windows: one displaying the GUD
-buffer and the other with the source file with the main routine
-of the debugged program.  Non-nil means display the layout shown
-for `gdba'."
-  :type 'boolean
-  :group 'gdb
-  :version "22.1")
-
-(defcustom gdb-use-separate-io-buffer nil
-  "Non-nil means display output from the debugged program in a separate buffer."
-  :type 'boolean
-  :group 'gdb
-  :version "22.1")
-
-(defun gdb-force-mode-line-update (status)
-  (let ((buffer gud-comint-buffer))
-    (if (and buffer (buffer-name buffer))
-	(with-current-buffer buffer
-	  (setq mode-line-process
-		(format ":%s [%s]"
-			(process-status (get-buffer-process buffer)) status))
-	  ;; Force mode line redisplay soon.
-	  (force-mode-line-update)))))
-
-(defun gdb-enable-debug (arg)
-  "Toggle logging of transaction between Emacs and Gdb.
-The log is stored in `gdb-debug-log' as an alist with elements
-whose cons is send, send-item or recv and whose cdr is the string
-being transferred.  This list may grow up to a size of
-`gdb-debug-log-max' after which the oldest element (at the end of
-the list) is deleted every time a new one is added (at the front)."
-  (interactive "P")
-  (setq gdb-enable-debug
-	(if (null arg)
-	    (not gdb-enable-debug)
-	  (> (prefix-numeric-value arg) 0)))
-  (message (format "Logging of transaction %sabled"
-		   (if gdb-enable-debug "en" "dis"))))
-
-(defun gdb-many-windows (arg)
-  "Toggle the number of windows in the basic arrangement.
-With prefix argument ARG, display additional buffers if ARG is positive,
-otherwise use a single window."
-  (interactive "P")
-  (setq gdb-many-windows
-	(if (null arg)
-	    (not gdb-many-windows)
-	  (> (prefix-numeric-value arg) 0)))
-  (message (format "Display of other windows %sabled"
-		   (if gdb-many-windows "en" "dis")))
-  (if (and gud-comint-buffer
-	   (buffer-name gud-comint-buffer))
-      (condition-case nil
-	  (gdb-restore-windows)
-	(error nil))))
-
-(defun gdb-use-separate-io-buffer (arg)
-  "Toggle separate IO for debugged program.
-With prefix argument ARG, use separate IO if ARG is positive,
-otherwise do not."
-  (interactive "P")
-  (setq gdb-use-separate-io-buffer
-	(if (null arg)
-	    (not gdb-use-separate-io-buffer)
-	  (> (prefix-numeric-value arg) 0)))
-  (message (format "Separate IO %sabled"
-		   (if gdb-use-separate-io-buffer "en" "dis")))
-  (if (and gud-comint-buffer
-	   (buffer-name gud-comint-buffer))
-      (condition-case nil
-	  (if gdb-use-separate-io-buffer
-	      (if gdb-many-windows (gdb-restore-windows))
-	    (kill-buffer (gdb-inferior-io-name)))
-	(error nil))))
-
-(defvar gdb-define-alist nil "Alist of #define directives for GUD tooltips.")
-
-(defun gdb-create-define-alist ()
-  "Create an alist of #define directives for GUD tooltips."
-  (let* ((file (buffer-file-name))
-	 (output
-	  (with-output-to-string
-	    (with-current-buffer standard-output
-	      (and file
-		   (file-exists-p file)
-		   ;; call-process doesn't work with remote file names.
-		   (not (file-remote-p default-directory))
-		   (call-process shell-file-name file
-				 (list t nil) nil "-c"
-				 (concat gdb-cpp-define-alist-program " "
-					 gdb-cpp-define-alist-flags))))))
-	(define-list (split-string output "\n" t)) (name))
-    (setq gdb-define-alist nil)
-    (dolist (define define-list)
-      (setq name (nth 1 (split-string define "[( ]")))
-      (push (cons name define) gdb-define-alist))))
-
-(declare-function tooltip-show "tooltip" (text &optional use-echo-area))
-(defvar tooltip-use-echo-area)
-
-(defun gdb-tooltip-print (expr)
-  (tooltip-show
-   (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer)
-     (goto-char (point-min))
-     (let ((string
-	    (if (search-forward "=" nil t)
-		(concat expr (buffer-substring (- (point) 2) (point-max)))
-	      (buffer-string))))
-       ;; remove newline for gud-tooltip-echo-area
-       (substring string 0 (- (length string) 1))))
-   (or gud-tooltip-echo-area tooltip-use-echo-area
-   (not (display-graphic-p)))))
-
-;; If expr is a macro for a function don't print because of possible dangerous
-;; side-effects.  Also printing a function within a tooltip generates an
-;; unexpected starting annotation (phase error).
-(defun gdb-tooltip-print-1 (expr)
-  (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer)
-    (goto-char (point-min))
-    (if (search-forward "expands to: " nil t)
-	(unless (looking-at "\\S-+.*(.*).*")
-	  (gdb-enqueue-input
-	   (list  (concat gdb-server-prefix "print " expr "\n")
-		  `(lambda () (gdb-tooltip-print ,expr))))))))
-
-(defconst gdb-source-file-regexp "\\(.+?\\), \\|\\([^, \n].*$\\)")
-
-(defun gdb-init-buffer ()
-  (set (make-local-variable 'gud-minor-mode)
-       (buffer-local-value 'gud-minor-mode gud-comint-buffer))
-  (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
-  (when gud-tooltip-mode
-    (make-local-variable 'gdb-define-alist)
-    (gdb-create-define-alist)
-    (add-hook 'after-save-hook 'gdb-create-define-alist nil t)))
-
-(defun gdb-set-gud-minor-mode-existing-buffers ()
-  "Create list of source files for current GDB session."
-  (goto-char (point-min))
-  (when (search-forward "read in on demand:" nil t)
-    (while (re-search-forward gdb-source-file-regexp nil t)
-      (push (file-name-nondirectory (or (match-string 1) (match-string 2)))
-	    gdb-source-file-list))
-    (dolist (buffer (buffer-list))
-      (with-current-buffer buffer
-	(when (and buffer-file-name
-		   (member (file-name-nondirectory buffer-file-name)
-			   gdb-source-file-list))
-	  (gdb-init-buffer)))))
-  (gdb-force-mode-line-update
-   (propertize "ready" 'face font-lock-variable-name-face)))
-
-(defun gdb-find-watch-expression ()
-  (let* ((var (nth (- (line-number-at-pos (point)) 2) gdb-var-list))
-	 (varnum (car var)) expr array)
-    (string-match "\\(var[0-9]+\\)\\.\\(.*\\)" varnum)
-    (let ((var1 (assoc (match-string 1 varnum) gdb-var-list)) var2 varnumlet
-	  (component-list (split-string (match-string 2 varnum) "\\." t)))
-      (setq expr (nth 1 var1))
-      (setq varnumlet (car var1))
-      (dolist (component component-list)
-	(setq var2 (assoc varnumlet gdb-var-list))
-	(setq expr (concat expr
-			   (if (string-match ".*\\[[0-9]+\\]$" (nth 3 var2))
-			       (concat "[" component "]")
-			     (concat "." component))))
-	(setq varnumlet (concat varnumlet "." component)))
-      expr)))
-
-(defun gdb-toggle-recording ()
-"Start/stop recording of debug session."
-  (interactive)
-  (if gud-running
-      (message-box "Recording cannot be started or stopped while your program is still running")
-      (gdb-enqueue-input
-       (list (concat gdb-server-prefix
-		     (if gdb-recording "record stop\n" "target record\n"))
-	     'gdb-recording-handler))))
-
-;; Convenience function for tool bar.
-(defalias 'gdb-toggle-recording-1 'gdb-toggle-recording)
-
-(defun gdb-recording-handler ()
-  (goto-char (point-min))
-  (if (re-search-forward "current architecture doesn't support record function" nil t)
-      (message-box "Not enabled.  The current architecture doesn't support the process record function.")
-    (goto-char (point-min))
-    (if (re-search-forward "Undefined target command" nil t)
-	(message-box "Not enabled.  Process record requires GDB 7.0 onwards.")
-      (goto-char (point-min))
-      (if (re-search-forward "the program is not being run" nil t)
-	  (message-box "Not enabled.  Starting process recording requires an active target (running process).")
-	(setq gdb-recording (not gdb-recording))
-	;; Actually forcing the tool-bar to update.
-	(force-mode-line-update)))))
-
-(defun gdb-init-1 ()
-  (gud-def gud-break (if (not (string-match "Machine" mode-name))
-			 (gud-call "break %f:%l" arg)
-		       (save-excursion
-			 (beginning-of-line)
-			 (forward-char 2)
-			 (gud-call "break *%a" arg)))
-	   "\C-b" "Set breakpoint at current line or address.")
-  ;;
-  (gud-def gud-remove (if (not (string-match "Machine" mode-name))
-			  (gud-call "clear %f:%l" arg)
-			(save-excursion
-			  (beginning-of-line)
-			  (forward-char 2)
-			  (gud-call "clear *%a" arg)))
-	   "\C-d" "Remove breakpoint at current line or address.")
-  ;;
-  (gud-def gud-until (if (not (string-match "Machine" mode-name))
-			 (gud-call "until %f:%l" arg)
-		       (save-excursion
-			 (beginning-of-line)
-			 (forward-char 2)
-			 (gud-call "until *%a" arg)))
-	   "\C-u" "Continue to current line or address.")
-  ;;
-  (gud-def gud-go (gud-call (if gdb-active-process "continue" "run") arg)
-	   nil "Start or continue execution.")
-
-  ;; For debugging Emacs only.
-  (gud-def gud-pp
-	   (gud-call
-	    (concat
-	     "pp1 " (if (eq (buffer-local-value
-			     'major-mode (window-buffer)) 'speedbar-mode)
-			(gdb-find-watch-expression) "%e")) arg)
-	   nil   "Print the Emacs s-expression.")
-
-  (define-key gud-minor-mode-map [left-margin mouse-1]
-    'gdb-mouse-set-clear-breakpoint)
-  (define-key gud-minor-mode-map [left-fringe mouse-1]
-    'gdb-mouse-set-clear-breakpoint)
-   (define-key gud-minor-mode-map [left-margin C-mouse-1]
-    'gdb-mouse-toggle-breakpoint-margin)
-  (define-key gud-minor-mode-map [left-fringe C-mouse-1]
-    'gdb-mouse-toggle-breakpoint-fringe)
-
-  (define-key gud-minor-mode-map [left-margin drag-mouse-1]
-    'gdb-mouse-until)
-  (define-key gud-minor-mode-map [left-fringe drag-mouse-1]
-    'gdb-mouse-until)
-  (define-key gud-minor-mode-map [left-margin mouse-3]
-    'gdb-mouse-until)
-  (define-key gud-minor-mode-map [left-fringe mouse-3]
-    'gdb-mouse-until)
-
-  (define-key gud-minor-mode-map [left-margin C-drag-mouse-1]
-    'gdb-mouse-jump)
-  (define-key gud-minor-mode-map [left-fringe C-drag-mouse-1]
-    'gdb-mouse-jump)
-  (define-key gud-minor-mode-map [left-fringe C-mouse-3]
-    'gdb-mouse-jump)
-  (define-key gud-minor-mode-map [left-margin C-mouse-3]
-    'gdb-mouse-jump)
-
-  ;; (re-)initialize
-  (setq gdb-pc-address (if gdb-show-main "main" nil))
-  (setq gdb-previous-frame-pc-address nil
-	gdb-memory-address "main"
-	gdb-previous-frame nil
-	gdb-selected-frame nil
-	gdb-current-language nil
-	gdb-frame-number nil
-	gdb-var-list nil
-	gdb-main-file nil
-	gdb-first-post-prompt t
-	gdb-prompting nil
-	gdb-input-queue nil
-	gdb-current-item nil
-	gdb-pending-triggers nil
-	gdb-output-sink 'user
-	gdb-server-prefix "server "
-	gdb-location-alist nil
-	gdb-source-file-list nil
-	gdb-error nil
-	gdb-macro-info nil
-	gdb-buffer-fringe-width (car (window-fringes))
-	gdb-debug-log nil
-	gdb-signalled nil
-	gdb-source-window nil
-	gdb-inferior-status nil
-	gdb-continuation nil
-	gdb-look-up-stack nil
-        gdb-frame-begin nil
-	gdb-printing t
-	gud-old-arrow nil
-	gdb-thread-indicator nil
-	gdb-register-names nil
-	gdb-recording nil)
-
-  (setq gdb-buffer-type 'gdba)
-
-  (if gdb-use-separate-io-buffer (gdb-clear-inferior-io))
-
-  ;; Hack to see test for GDB 6.4+ (-stack-info-frame was implemented in 6.4)
-  (gdb-enqueue-input (list "server interpreter mi -stack-info-frame\n"
-			   'gdb-get-version)))
-
-(defun gdb-init-2 ()
-  (if (eq window-system 'w32)
-      (gdb-enqueue-input (list "set new-console off\n" 'ignore)))
-  (gdb-enqueue-input (list "set height 0\n" 'ignore))
-  (gdb-enqueue-input (list "set width 0\n" 'ignore))
-
-  (if (string-equal gdb-version "pre-6.4")
-      (if gdb-create-source-file-list
-	(gdb-enqueue-input (list (concat gdb-server-prefix "info sources\n")
-				 'gdb-set-gud-minor-mode-existing-buffers))
-	(setq gdb-locals-font-lock-keywords gdb-locals-font-lock-keywords-1))
-    ; Needs GDB 6.2 onwards.
-    (if gdb-create-source-file-list
-	(gdb-enqueue-input
-	 (list "server interpreter mi \"-file-list-exec-source-files\"\n"
-	       'gdb-set-gud-minor-mode-existing-buffers-1)))
-    (setq gdb-locals-font-lock-keywords gdb-locals-font-lock-keywords-2)
-    ; Needs GDB 7.0 onwards.
-    (gdb-enqueue-input
-     (list "server interpreter mi -enable-pretty-printing\n" 'ignore)))
-
-  ;; Find source file and compilation directory here.
-  ;; Works for C, C++, Fortran and Ada but not Java (GDB 6.4)
-  (gdb-enqueue-input (list "server list\n" 'ignore))
-  (gdb-enqueue-input (list "server list MAIN__\n" 'ignore))
-  (gdb-enqueue-input (list "server info source\n" 'gdb-source-info)))
-
-(defun gdb-get-version ()
-  (goto-char (point-min))
-  (if (re-search-forward "Undefined\\( mi\\)* command:" nil t)
-      (setq gdb-version "pre-6.4")
-    (setq gdb-version "6.4+"))
-  (gdb-init-2))
-
-(defmacro gdb-if-arrow (arrow-position &rest body)
-  `(if ,arrow-position
-      (let ((buffer (marker-buffer ,arrow-position)) (line))
-	(if (equal buffer (window-buffer (posn-window end)))
-	    (with-current-buffer buffer
-	      (when (or (equal start end)
-			(equal (posn-point start)
-			       (marker-position ,arrow-position)))
-		,@body))))))
-
-(defun gdb-mouse-until (event)
-  "Continue running until a source line past the current line.
-The destination source line can be selected either by clicking
-with mouse-3 on the fringe/margin or dragging the arrow
-with mouse-1 (default bindings)."
-  (interactive "e")
-  (let ((start (event-start event))
-	(end (event-end event)))
-    (gdb-if-arrow gud-overlay-arrow-position
-		  (setq line (line-number-at-pos (posn-point end)))
-		  (gud-call (concat "until " (number-to-string line))))
-    (gdb-if-arrow gdb-overlay-arrow-position
-		  (save-excursion
-		    (goto-char (point-min))
-		    (forward-line (1- (line-number-at-pos (posn-point end))))
-		    (forward-char 2)
-		    (gud-call (concat "until *%a"))))))
-
-(defun gdb-mouse-jump (event)
-  "Set execution address/line.
-The destination source line can be selected either by clicking with C-mouse-3
-on the fringe/margin or dragging the arrow with C-mouse-1 (default bindings).
-Unlike `gdb-mouse-until' the destination address can be before the current
-line, and no execution takes place."
-  (interactive "e")
-  (let ((start (event-start event))
-	(end (event-end event)))
-    (gdb-if-arrow gud-overlay-arrow-position
-		  (setq line (line-number-at-pos (posn-point end)))
-		  (progn
-		    (gud-call (concat "tbreak " (number-to-string line)))
-		    (gud-call (concat "jump " (number-to-string line)))))
-    (gdb-if-arrow gdb-overlay-arrow-position
-		  (save-excursion
-		    (goto-char (point-min))
-		    (forward-line (1- (line-number-at-pos (posn-point end))))
-		    (forward-char 2)
-		    (progn
-		      (gud-call (concat "tbreak *%a"))
-		      (gud-call (concat "jump *%a")))))))
-
-(defcustom gdb-speedbar-auto-raise nil
-  "If non-nil raise speedbar every time display of watch expressions is\
- updated."
-  :type 'boolean
-  :group 'gdb
-  :version "22.1")
-
-(defun gdb-speedbar-auto-raise (arg)
-  "Toggle automatic raising of the speedbar for watch expressions.
-With prefix argument ARG, automatically raise speedbar if ARG is
-positive, otherwise don't automatically raise it."
-  (interactive "P")
-  (setq gdb-speedbar-auto-raise
-	(if (null arg)
-	    (not gdb-speedbar-auto-raise)
-	  (> (prefix-numeric-value arg) 0)))
-  (message (format "Auto raising %sabled"
-		   (if gdb-speedbar-auto-raise "en" "dis"))))
-
-(defcustom gdb-use-colon-colon-notation nil
-  "If non-nil use FUN::VAR format to display variables in the speedbar."
-  :type 'boolean
-  :group 'gdb
-  :version "22.1")
-
-(define-key gud-minor-mode-map "\C-c\C-w" 'gud-watch)
-(define-key global-map (concat gud-key-prefix "\C-w") 'gud-watch)
-
-(declare-function tooltip-identifier-from-point "tooltip" (point))
-
-(defun gud-watch (&optional arg event)
-  "Watch expression at point.
-With arg, enter name of variable to be watched in the minibuffer."
-  (interactive (list current-prefix-arg last-input-event))
-  (let ((minor-mode (buffer-local-value 'gud-minor-mode gud-comint-buffer)))
-    (if (memq minor-mode '(gdbmi gdba))
-	(progn
-	  (if event (posn-set-point (event-end event)))
-	  (require 'tooltip)
-	  (save-selected-window
-	    (let ((expr
-		   (if arg
-		       (completing-read "Name of variable: "
-					'gud-gdb-complete-command)
-		     (if (and transient-mark-mode mark-active)
-			 (buffer-substring (region-beginning) (region-end))
-		       (concat (if (eq major-mode 'gdb-registers-mode) "$")
-			       (tooltip-identifier-from-point (point)))))))
-	      (set-text-properties 0 (length expr) nil expr)
-	      (gdb-enqueue-input
-	       (list
-		(if (eq minor-mode 'gdba)
-		    (concat
-		     "server interpreter mi \"-var-create - * "  expr "\"\n")
-		  (concat"-var-create - * "  expr "\n"))
-		`(lambda () (gdb-var-create-handler ,expr)))))))
-      (message "gud-watch is a no-op in this mode."))))
-
-(declare-function speedbar-change-initial-expansion-list "speedbar" (new-default))
-
-(defun gdb-var-create-handler (expr)
-  (let* ((result (gdb-json-partial-output)))
-    (if (not (bindat-get-field result 'msg))
-        (let ((var
-	       (list (bindat-get-field result 'name)
-		     (if (and (string-equal gdb-current-language "c")
-			      gdb-use-colon-colon-notation gdb-selected-frame)
-			 (setq expr (concat gdb-selected-frame "::" expr))
-		       expr)
-		     (bindat-get-field result 'numchild)
-		     (bindat-get-field result 'type)
-		     (bindat-get-field result 'value)
-		     nil
-		     (bindat-get-field result 'has_more)
-		      gdb-frame-address)))
-	  (push var gdb-var-list)
-	  (speedbar 1)
-	  (unless (string-equal
-		   speedbar-initial-expansion-list-name "GUD")
-	    (speedbar-change-initial-expansion-list "GUD")))
-      (message-box "No symbol \"%s\" in current context." expr))))
-
-(declare-function speedbar-timer-fn "speedbar" ())
-
-(defun gdb-speedbar-update ()
-  (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame)
-	     (not (member 'gdb-speedbar-timer gdb-pending-triggers)))
-    ;; Dummy command to update speedbar even when idle.
-    (gdb-enqueue-input (list "server pwd\n" 'gdb-speedbar-timer-fn))
-    ;; Keep gdb-pending-triggers non-nil till end.
-    (push 'gdb-speedbar-timer gdb-pending-triggers)))
-
-(defun gdb-speedbar-timer-fn ()
-  (if gdb-speedbar-auto-raise
-      (raise-frame speedbar-frame))
-  (setq gdb-pending-triggers
-	(delq 'gdb-speedbar-timer gdb-pending-triggers))
-  (speedbar-timer-fn))
-
-(defun gdb-var-evaluate-expression-handler (varnum changed)
-  (goto-char (point-min))
-  (re-search-forward "\\(.+\\)\\^done,value=\\(\".*\"\\)" nil t)
-  (setq gdb-pending-triggers
-	(delq (string-to-number (match-string 1)) gdb-pending-triggers))
-  (let ((var (assoc varnum gdb-var-list)))
-    (when var
-      (if changed (setcar (nthcdr 5 var) 'changed))
-      (setcar (nthcdr 4 var) (read (match-string 2)))))
-  (gdb-speedbar-update))
-
-(defun gdb-var-list-children (varnum)
-  (gdb-enqueue-input
-   (list (concat "server interpreter mi \"-var-list-children " varnum "\"\n")
-	 `(lambda () (gdb-var-list-children-handler ,varnum)))))
-
-(defconst gdb-var-list-children-regexp
-  "child={.*?name=\"\\(.*?\\)\".*?,exp=\"\\(.*?\\)\".*?,\
-numchild=\"\\(.*?\\)\"\\(}\\|.*?,\\(type=\"\\(.*?\\)\"\\)?.*?}\\)")
-
-(defun gdb-var-list-children-handler (varnum)
-  (goto-char (point-min))
-  (let ((var-list nil))
-    (catch 'child-already-watched
-      (dolist (var gdb-var-list)
-	(if (string-equal varnum (car var))
-	    (progn
-	      (push var var-list)
-	      (while (re-search-forward gdb-var-list-children-regexp nil t)
-		(let ((varchild (list (match-string 1)
-				      (match-string 2)
-				      (match-string 3)
-				      (match-string 6)
-				      nil nil)))
-		  (if (assoc (car varchild) gdb-var-list)
-		      (throw 'child-already-watched nil))
-		  (push varchild var-list)
-		  (gdb-enqueue-input
-		   (list
-		    (concat
-		     "server interpreter mi \"0-var-evaluate-expression "
-		     (car varchild) "\"\n")
-		    `(lambda () (gdb-var-evaluate-expression-handler
-				 ,(car varchild) nil)))))))
-	  (push var var-list)))
-      (setq gdb-var-list (nreverse var-list)))))
-
-(defun gdb-var-update ()
-  (when (not (member 'gdb-var-update gdb-pending-triggers))
-    (gdb-enqueue-input
-     (list "server interpreter mi \"-var-update *\"\n"
-	   'gdb-var-update-handler))
-    (push 'gdb-var-update gdb-pending-triggers)))
-
-(defconst gdb-var-update-regexp
-  "{.*?name=\"\\(.*?\\)\".*?,in_scope=\"\\(.*?\\)\".*?,\
-type_changed=\".*?\".*?}")
-
-(defun gdb-var-update-handler ()
-  (dolist (var gdb-var-list)
-    (setcar (nthcdr 5 var) nil))
-  (goto-char (point-min))
-  (let ((n 0))
-    (while (re-search-forward gdb-var-update-regexp nil t)
-      (let ((varnum (match-string 1)))
-	(if  (string-equal (match-string 2) "false")
-	    (let ((var (assoc varnum gdb-var-list)))
-	      (if var (setcar (nthcdr 5 var) 'out-of-scope)))
-	  (setq n (1+ n))
-	  (push n gdb-pending-triggers)
-	  (gdb-enqueue-input
-	   (list
-	    (concat "server interpreter mi \"" (number-to-string n)
-		    "-var-evaluate-expression " varnum "\"\n")
-	  `(lambda () (gdb-var-evaluate-expression-handler ,varnum t))))))))
-  (setq gdb-pending-triggers
-	(delq 'gdb-var-update gdb-pending-triggers)))
-
-(defun gdb-var-set-format (format)
-  "Set the output format for a variable displayed in the speedbar."
-  (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list))
-	 (varnum (car var)))
-    (gdb-enqueue-input
-     (list
-      (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
-	  (concat "server interpreter mi \"-var-set-format "
-		  varnum " " format "\"\n")
-	(concat "-var-set-format " varnum " " format "\n"))
-	   `(lambda () (gdb-var-set-format-handler ,varnum))))))
-
-(defconst gdb-var-set-format-regexp
-  "format=\"\\(.*?\\)\",.*value=\"\\(.*?\\)\"")
-
-(defun gdb-var-set-format-handler (varnum)
-  (goto-char (point-min))
-  (if (re-search-forward gdb-var-set-format-regexp nil t)
-      (let ((var (assoc varnum gdb-var-list)))
-	(setcar (nthcdr 4 var) (match-string 2))
-	(gdb-var-update-1))))
-
-(defun gdb-var-delete-1 (var varnum)
-  (gdb-enqueue-input
-   (list
-    (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
-	(concat "server interpreter mi \"-var-delete " varnum "\"\n")
-      (concat "-var-delete " varnum "\n"))
-    'ignore))
-  (setq gdb-var-list (delq var gdb-var-list))
-  (dolist (varchild gdb-var-list)
-    (if (string-match (concat (car var) "\\.") (car varchild))
-	(setq gdb-var-list (delq varchild gdb-var-list)))))
-
-(defun gdb-var-delete ()
-  "Delete watch expression at point from the speedbar."
-  (interactive)
-  (if (memq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
-	    '(gdbmi gdba))
-      (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list))
-	     (varnum (car var)))
-	(if (string-match "\\." (car var))
-	    (message-box "Can only delete a root expression")
-	  (gdb-var-delete-1 var varnum)))))
-
-(defun gdb-var-delete-children (varnum)
-  "Delete children of variable object at point from the speedbar."
-  (gdb-enqueue-input
-   (list
-    (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
-	(concat "server interpreter mi \"-var-delete -c " varnum "\"\n")
-      (concat "-var-delete -c " varnum "\n")) 'ignore)))
-
-(defun gdb-edit-value (text token indent)
-  "Assign a value to a variable displayed in the speedbar."
-  (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list))
-	 (varnum (car var)) (value))
-    (setq value (read-string "New value: "))
-    (gdb-enqueue-input
-     (list
-      (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
-	  (concat "server interpreter mi \"-var-assign "
-		  varnum " " value "\"\n")
-	(concat "-var-assign " varnum " " value "\n"))
-	   `(lambda () (gdb-edit-value-handler ,value))))))
-
-(defun gdb-edit-value-handler (value)
-  (goto-char (point-min))
-  (if (re-search-forward gdb-error-regexp nil t)
-      (message-box "Invalid number or expression (%s)" value)))
-
-(defcustom gdb-show-changed-values t
-  "If non-nil change the face of out of scope variables and changed values.
-Out of scope variables are suppressed with `shadow' face.
-Changed values are highlighted with the face `font-lock-warning-face'."
-  :type 'boolean
-  :group 'gdb
-  :version "22.1")
-
-(defcustom gdb-max-children 40
-  "Maximum number of children before expansion requires confirmation."
-  :type 'integer
-  :group 'gdb
-  :version "22.1")
-
-(defcustom gdb-delete-out-of-scope t
-  "If non-nil delete watch expressions automatically when they go out of scope."
-  :type 'boolean
-  :group 'gdb
-  :version "22.2")
-
-(declare-function speedbar-change-expand-button-char "speedbar" (char))
-(declare-function speedbar-delete-subblock "speedbar" (indent))
-(declare-function speedbar-center-buffer-smartly "speedbar" ())
-
-(defun gdb-speedbar-expand-node (text token indent)
-  "Expand the node the user clicked on.
-TEXT is the text of the button we clicked on, a + or - item.
-TOKEN is data related to this node.
-INDENT is the current indentation depth."
-  (if (and gud-comint-buffer (buffer-name gud-comint-buffer))
-      (progn
-	(cond ((string-match "+" text)	;expand this node
-	       (let* ((var (assoc token gdb-var-list))
-		      (expr (nth 1 var)) (children (nth 2 var)))
-		 (if (or (<= (string-to-number children) gdb-max-children)
-			  (y-or-n-p
-			   (format
-			    "%s has %s children.  Continue? " expr children)))
-		     (if (and (eq (buffer-local-value
-				   'gud-minor-mode gud-comint-buffer) 'gdba)
-			      (string-equal gdb-version "pre-6.4"))
-			 (gdb-var-list-children token)
-		       (gdb-var-list-children-1 token)))))
-	      ((string-match "-" text)	;contract this node
-	       (dolist (var gdb-var-list)
-		 (if (string-match (concat token "\\.") (car var))
-		     (setq gdb-var-list (delq var gdb-var-list))))
-	       (gdb-var-delete-children token)
-	       (speedbar-change-expand-button-char ?+)
-	       (speedbar-delete-subblock indent))
-	      (t (error "Ooops...  not sure what to do")))
-	(speedbar-center-buffer-smartly))
-    (message-box "GUD session has been killed")))
-
-(defun gdb-get-target-string ()
-  (with-current-buffer gud-comint-buffer
-    gud-target-name))
-
-
-;;
-;; gdb buffers.
-;;
-;; Each buffer has a TYPE -- a symbol that identifies the function
-;; of that particular buffer.
-;;
-;; The usual gdb interaction buffer is given the type `gdba' and
-;; is constructed specially.
-;;
-;; Others are constructed by gdb-get-buffer-create and
-;; named according to the rules set forth in the gdb-buffer-rules-assoc
-
-(defvar gdb-buffer-rules-assoc '())
-
-(defun gdb-get-buffer (key)
-  "Return the gdb buffer tagged with type KEY.
-The key should be one of the cars in `gdb-buffer-rules-assoc'."
-  (save-excursion
-    (gdb-look-for-tagged-buffer key (buffer-list))))
-
-(defun gdb-get-buffer-create (key)
-  "Create a new gdb buffer of the type specified by KEY.
-The key should be one of the cars in `gdb-buffer-rules-assoc'."
-  (or (gdb-get-buffer key)
-      (let* ((rules (assoc key gdb-buffer-rules-assoc))
-	     (name (funcall (gdb-rules-name-maker rules)))
-	     (new (get-buffer-create name)))
-	(with-current-buffer new
-	  (let ((trigger))
-	    (if (cdr (cdr rules))
-		(setq trigger (funcall (car (cdr (cdr rules))))))
-	    (setq gdb-buffer-type key)
-	    (set (make-local-variable 'gud-minor-mode)
-		 (buffer-local-value 'gud-minor-mode gud-comint-buffer))
-	    (set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
-	    (if trigger (funcall trigger)))
-	  new))))
-
-(defun gdb-rules-name-maker (rules) (car (cdr rules)))
-
-(defun gdb-look-for-tagged-buffer (key bufs)
-  (let ((retval nil))
-    (while (and (not retval) bufs)
-      (set-buffer (car bufs))
-      (if (eq gdb-buffer-type key)
-	  (setq retval (car bufs)))
-      (setq bufs (cdr bufs)))
-    retval))
-
-;;
-;; This assoc maps buffer type symbols to rules.  Each rule is a list of
-;; at least one and possible more functions.  The functions have these
-;; roles in defining a buffer type:
-;;
-;;     NAME - Return a name for this  buffer type.
-;;
-;; The remaining function(s) are optional:
-;;
-;;     MODE - called in a new buffer with no arguments, should establish
-;;	      the proper mode for the buffer.
-;;
-
-(defun gdb-set-buffer-rules (buffer-type &rest rules)
-  (let ((binding (assoc buffer-type gdb-buffer-rules-assoc)))
-    (if binding
-	(setcdr binding rules)
-      (push (cons buffer-type rules)
-	    gdb-buffer-rules-assoc))))
-
-;; GUD buffers are an exception to the rules
-(gdb-set-buffer-rules 'gdba 'error)
-
-;; Partial-output buffer : This accumulates output from a command executed on
-;; behalf of emacs (rather than the user).
-;;
-(gdb-set-buffer-rules 'gdb-partial-output-buffer
-		      'gdb-partial-output-name)
-
-(defun gdb-partial-output-name ()
-  (concat " *partial-output-"
-	  (gdb-get-target-string)
-	  "*"))
-
-
-(gdb-set-buffer-rules 'gdb-inferior-io
-		      'gdb-inferior-io-name
-		      'gdb-inferior-io-mode)
-
-(defun gdb-inferior-io-name ()
-  (concat "*input/output of "
-	  (gdb-get-target-string)
-	  "*"))
-
-(defun gdb-display-separate-io-buffer ()
-  "Display IO of debugged program in a separate window."
-  (interactive)
-  (if gdb-use-separate-io-buffer
-      (gdb-display-buffer
-       (gdb-get-buffer-create 'gdb-inferior-io) t)))
-
-(defconst gdb-frame-parameters
-  '((height . 14) (width . 80)
-    (unsplittable . t)
-    (tool-bar-lines . nil)
-    (menu-bar-lines . nil)
-    (minibuffer . nil)))
-
-(defun gdb-frame-separate-io-buffer ()
-  "Display IO of debugged program in a new frame."
-  (interactive)
-  (if gdb-use-separate-io-buffer
-      (let ((special-display-regexps (append special-display-regexps '(".*")))
-	    (special-display-frame-alist gdb-frame-parameters))
-	(display-buffer (gdb-get-buffer-create 'gdb-inferior-io)))))
-
-(defvar gdb-inferior-io-mode-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map "\C-c\C-c" 'gdb-separate-io-interrupt)
-    (define-key map "\C-c\C-z" 'gdb-separate-io-stop)
-    (define-key map "\C-c\C-\\" 'gdb-separate-io-quit)
-    (define-key map "\C-c\C-d" 'gdb-separate-io-eof)
-    (define-key map "\C-d" 'gdb-separate-io-eof)
-    map))
-
-(define-derived-mode gdb-inferior-io-mode comint-mode "Inferior I/O"
-  "Major mode for gdb inferior-io."
-  :syntax-table nil :abbrev-table nil
-  ;; We want to use comint because it has various nifty and familiar
-  ;; features.  We don't need a process, but comint wants one, so create
-  ;; a dummy one.
-  (make-comint-in-buffer
-   (substring (buffer-name) 1 (- (length (buffer-name)) 1))
-   (current-buffer) "hexl")
-  (setq comint-input-sender 'gdb-inferior-io-sender))
-
-(defun gdb-inferior-io-sender (proc string)
-  ;; PROC is the pseudo-process created to satisfy comint.
-  (with-current-buffer (process-buffer proc)
-    (setq proc (get-buffer-process gud-comint-buffer))
-    (process-send-string proc string)
-    (process-send-string proc "\n")))
-
-(defun gdb-separate-io-interrupt ()
-  "Interrupt the program being debugged."
-  (interactive)
-  (interrupt-process
-   (get-buffer-process gud-comint-buffer) comint-ptyp))
-
-(defun gdb-separate-io-quit ()
-  "Send quit signal to the program being debugged."
-  (interactive)
-  (quit-process
-   (get-buffer-process gud-comint-buffer) comint-ptyp))
-
-(defun gdb-separate-io-stop ()
-  "Stop the program being debugged."
-  (interactive)
-  (stop-process
-   (get-buffer-process gud-comint-buffer) comint-ptyp))
-
-(defun gdb-separate-io-eof ()
-  "Send end-of-file to the program being debugged."
-  (interactive)
-  (process-send-eof
-   (get-buffer-process gud-comint-buffer)))
-
-
-;; gdb communications
-;;
-
-;; INPUT: things sent to gdb
-;;
-;; The queues are lists.  Each element is either a string (indicating user or
-;; user-like input) or a list of the form:
-;;
-;;    (INPUT-STRING  HANDLER-FN)
-;;
-;; The handler function will be called from the partial-output buffer when the
-;; command completes.  This is the way to write commands which invoke gdb
-;; commands autonomously.
-;;
-;; These lists are consumed tail first.
-;;
-
-(defun gdb-send (proc string)
-  "A comint send filter for gdb.
-This filter may simply queue input for a later time."
-  (if gdb-ready
-      (progn
-	(with-current-buffer gud-comint-buffer
-	  (let ((inhibit-read-only t))
-	    (remove-text-properties (point-min) (point-max) '(face))))
-	(if gud-running
-	    (progn
-	      (let ((item (concat string "\n")))
-		(if gdb-enable-debug (push (cons 'send item) gdb-debug-log))
-		(process-send-string proc item)))
-	  (if (string-match "\\\\\\'" string)
-	      (setq gdb-continuation (concat gdb-continuation string "\n"))
-	    (let ((item (concat
-			 gdb-continuation string
-			 (if (not comint-input-sender-no-newline) "\n"))))
-	      (gdb-enqueue-input item)
-	      (setq gdb-continuation nil)))))
-    (push (concat string "\n")  gdb-early-user-input)))
-
-;; Note: Stuff enqueued here will be sent to the next prompt, even if it
-;; is a query, or other non-top-level prompt.
-
-(defun gdb-enqueue-input (item)
-  (if (not gud-running)
-      (if gdb-prompting
-	  (progn
-	    (gdb-send-item item)
-	    (setq gdb-prompting nil))
-	(push item gdb-input-queue))))
-
-(defun gdb-dequeue-input ()
-  (let ((queue gdb-input-queue))
-    (if queue
-	(let ((last (car (last queue))))
-	  (unless (nbutlast queue) (setq gdb-input-queue '()))
-	  last)
-      ;; This should be nil here anyway but set it just to make sure.
-      (setq gdb-pending-triggers nil))))
-
-(defun gdb-send-item (item)
-  (setq gdb-flush-pending-output nil)
-  (if gdb-enable-debug (push (cons 'send-item item) gdb-debug-log))
-  (setq gdb-current-item item)
-  (let ((process (get-buffer-process gud-comint-buffer)))
-    (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
-	(if (stringp item)
-	    (progn
-	      (setq gdb-output-sink 'user)
-	      (process-send-string process item))
-	  (progn
-	    (gdb-clear-partial-output)
-	    (setq gdb-output-sink 'pre-emacs)
-	    (process-send-string process
-				 (car item))))
-      ;; case: eq gud-minor-mode 'gdbmi
-      (gdb-clear-partial-output)
-      (setq gdb-output-sink 'emacs)
-      (process-send-string process (car item)))))
-
-;;
-;; output -- things gdb prints to emacs
-;;
-;; GDB output is a stream interrupted by annotations.
-;; Annotations can be recognized by their beginning
-;; with \C-j\C-z\C-z<tag><opt>\C-j
-;;
-;; The tag is a string obeying symbol syntax.
-;;
-;; The optional part `<opt>' can be either the empty string
-;; or a space followed by more data relating to the annotation.
-;; For example, the SOURCE annotation is followed by a filename,
-;; line number and various useless goo.  This data must not include
-;; any newlines.
-;;
-
-(defcustom gud-gdb-command-name "gdb --annotate=3"
-  "Default command to execute an executable under the GDB debugger.
-The option \"--annotate=3\" must be included in this value if you
-want the GDB Graphical Interface."
-  :type 'string
-  :group 'gud
-  :version "22.1")
-
-(defvar gdb-annotation-rules
-  '(("pre-prompt" gdb-pre-prompt)
-    ("prompt" gdb-prompt)
-    ("commands" gdb-subprompt)
-    ("overload-choice" gdb-subprompt)
-    ("query" gdb-subprompt)
-    ;; Need this prompt for GDB 6.1
-    ("nquery" gdb-subprompt)
-    ("prompt-for-continue" gdb-subprompt)
-    ("post-prompt" gdb-post-prompt)
-    ("source" gdb-source)
-    ("starting" gdb-starting)
-    ("exited" gdb-exited)
-    ("signalled" gdb-signalled)
-    ("signal" gdb-signal)
-    ("breakpoint" gdb-stopping)
-    ("watchpoint" gdb-stopping)
-    ("frame-begin" gdb-frame-begin)
-    ("stopped" gdb-stopped)
-    ("error-begin" gdb-error)
-    ("error" gdb-error)
-    ("new-thread" (lambda (ignored)
-		    (gdb-get-buffer-create 'gdb-threads-buffer)))
-    ("thread-changed" gdb-thread-changed))
-  "An assoc mapping annotation tags to functions which process them.")
-
-(defun gdb-resync()
-  (setq gdb-flush-pending-output t)
-  (setq gud-running nil)
-  (gdb-force-mode-line-update
-   (propertize "stopped" 'face font-lock-warning-face))
-  (setq gdb-output-sink 'user)
-  (setq gdb-input-queue nil)
-  (setq gdb-pending-triggers nil)
-  (setq gdb-prompting t))
-
-(defconst gdb-source-spec-regexp
-  "\\(.*\\):\\([0-9]*\\):[0-9]*:[a-z]*:0x0*\\([a-f0-9]*\\)")
-
-;; Do not use this except as an annotation handler.
-(defun gdb-source (args)
-  (string-match gdb-source-spec-regexp args)
-  ;; Extract the frame position from the marker.
-  (setq gud-last-frame
-	(cons
-	 (match-string 1 args)
-	 (string-to-number (match-string 2 args))))
-  (setq gdb-pc-address (match-string 3 args))
-  ;; cover for auto-display output which comes *before*
-  ;; stopped annotation
-  (if (eq gdb-output-sink 'inferior) (setq gdb-output-sink 'user)))
-
-(defun gdb-pre-prompt (ignored)
-  "An annotation handler for `pre-prompt'.
-This terminates the collection of output from a previous command if that
-happens to be in effect."
-  (setq gdb-error nil)
-  (let ((sink gdb-output-sink))
-    (cond
-     ((eq sink 'user) t)
-     ((eq sink 'emacs)
-      (setq gdb-output-sink 'post-emacs))
-     (t
-      (gdb-resync)
-      (error "Phase error in gdb-pre-prompt (got %s)" sink)))))
-
-(defun gdb-prompt (ignored)
-  "An annotation handler for `prompt'.
-This sends the next command (if any) to gdb."
-  (when gdb-first-prompt
-    (gdb-force-mode-line-update
-     (propertize "initializing..." 'face font-lock-variable-name-face))
-    (gdb-init-1)
-    (setq gdb-first-prompt nil))
-  (let ((sink gdb-output-sink))
-    (cond
-     ((eq sink 'user) t)
-     ((eq sink 'post-emacs)
-      (setq gdb-output-sink 'user)
-      (let ((handler
-	     (car (cdr gdb-current-item))))
-	(with-current-buffer (gdb-get-buffer-create 'gdb-partial-output-buffer)
-	  (funcall handler))))
-     (t
-      (gdb-resync)
-      (error "Phase error in gdb-prompt (got %s)" sink))))
-  (let ((input (gdb-dequeue-input)))
-    (if input
-	(gdb-send-item input)
-      (progn
-	(setq gdb-prompting t)
-	(gud-display-frame)
-	(setq gdb-early-user-input (nreverse gdb-early-user-input))
-	(while gdb-early-user-input
-	    (gdb-enqueue-input (car gdb-early-user-input))
-	    (setq gdb-early-user-input (cdr gdb-early-user-input)))))))
-
-(defun gdb-subprompt (ignored)
-  "An annotation handler for non-top-level prompts."
-  (setq gdb-prompting t))
-
-(defun gdb-starting (ignored)
-  "An annotation handler for `starting'.
-This says that I/O for the subprocess is now the program being debugged,
-not GDB."
-  (setq gdb-active-process t)
-  (setq gdb-printing t)
-  (let ((sink gdb-output-sink))
-    (cond
-     ((eq sink 'user)
-      (progn
-	(setq gud-running t)
-	(setq gdb-stack-update t)
-	;; Temporarily set gud-running to nil to force "info stack" onto queue.
-	(let ((gud-running nil))
-	  (gdb-invalidate-frames)
-	  (unless (or gdb-register-names
-		      (string-equal gdb-version "pre-6.4"))
-	    (gdb-enqueue-input
-	     (list "server interpreter mi -data-list-register-names\n"
-		   'gdb-get-register-names))))
-	(setq gdb-inferior-status "running")
-	(setq gdb-signalled nil)
-	(gdb-force-mode-line-update
-	 (propertize gdb-inferior-status 'face font-lock-type-face))
-	(gdb-remove-text-properties)
-	(setq gud-old-arrow gud-overlay-arrow-position)
-	(setq gud-overlay-arrow-position nil)
-	(setq gdb-overlay-arrow-position nil)
-	(setq gdb-stack-position nil)
-	(if gdb-use-separate-io-buffer
-	    (setq gdb-output-sink 'inferior))))
-     (t
-      (gdb-resync)
-      (error "Unexpected `starting' annotation")))))
-
-(defun gdb-signal (ignored)
-  (setq gdb-inferior-status "signal")
-  (gdb-force-mode-line-update
-   (propertize gdb-inferior-status 'face font-lock-warning-face))
-  (gdb-stopping ignored))
-
-(defun gdb-stopping (ignored)
-  "An annotation handler for `breakpoint' and other annotations.
-They say that I/O for the subprocess is now GDB, not the program
-being debugged."
-  (if gdb-use-separate-io-buffer
-      (let ((sink gdb-output-sink))
-	(cond
-	 ((eq sink 'inferior)
-	  (setq gdb-output-sink 'user))
-	 (t
-	  (gdb-resync)
-	  (error "Unexpected stopping annotation"))))))
-
-(defun gdb-exited (ignored)
-  "An annotation handler for `exited' and `signalled'.
-They say that I/O for the subprocess is now GDB, not the program
-being debugged and that the program is no longer running.  This
-function is used to change the focus of GUD tooltips to #define
-directives."
-  (setq gdb-active-process nil)
-  (setq gud-overlay-arrow-position nil)
-  (setq gdb-overlay-arrow-position nil)
-  (setq gdb-stack-position nil)
-  (setq gud-old-arrow nil)
-  (setq gdb-inferior-status "exited")
-  (gdb-force-mode-line-update
-   (propertize gdb-inferior-status 'face font-lock-warning-face))
-  (gdb-stopping ignored))
-
-(defun gdb-signalled (ignored)
-  (setq gdb-signalled t))
-
-(defun gdb-frame-begin (ignored)
-  (setq gdb-frame-begin t)
-  (setq gdb-printing nil)
-  (let ((sink gdb-output-sink))
-    (cond
-     ((eq sink 'inferior)
-      (setq gdb-output-sink 'user))
-     ((eq sink 'user) t)
-     ((eq sink 'emacs) t)
-     (t
-      (gdb-resync)
-      (error "Unexpected frame-begin annotation (%S)" sink)))))
-
-(defcustom gdb-same-frame (not focus-follows-mouse)
-  "Non-nil means pop up GUD buffer in same frame."
-  :group 'gdb
-  :type 'boolean
-  :version "22.1")
-
-(defcustom gdb-find-source-frame nil
-  "Non-nil means try to find a source frame further up stack e.g after signal."
-  :group 'gdb
-  :type 'boolean
-  :version "22.1")
-
-(defun gdb-find-source-frame (arg)
-  "Toggle looking for a source frame further up call stack.
-The code associated with current (innermost) frame may not have
-been compiled with debug information, e.g., C library routine.
-With prefix argument ARG, look for a source frame further up
-stack to display in the source buffer if ARG is positive,
-otherwise don't look further up."
-  (interactive "P")
-  (setq gdb-find-source-frame
-	(if (null arg)
-	    (not gdb-find-source-frame)
-	  (> (prefix-numeric-value arg) 0)))
-  (message (format "Looking for source frame %sabled"
-		   (if gdb-find-source-frame "en" "dis"))))
-
-(defun gdb-stopped (ignored)
-  "An annotation handler for `stopped'.
-It is just like `gdb-stopping', except that if we already set the output
-sink to `user' in `gdb-stopping', that is fine."
-  (setq gud-running nil)
-  (unless (or gud-overlay-arrow-position gud-last-frame)
-    (if (and gdb-frame-begin gdb-printing)
-	(setq gud-overlay-arrow-position gud-old-arrow)
-    ;;Pop up GUD buffer to display current frame when it doesn't have source
-    ;;information i.e if not compiled with -g as with libc routines generally.
-    (if gdb-same-frame
-	(gdb-display-gdb-buffer)
-      (gdb-frame-gdb-buffer))
-    (if gdb-find-source-frame
-    ;;Try to find source further up stack e.g after signal.
-	(setq gdb-look-up-stack
-	      (if (gdb-get-buffer 'gdb-stack-buffer)
-		  'keep
-		(progn
-		  (gdb-get-buffer-create 'gdb-stack-buffer)
-		  (gdb-invalidate-frames)
-		  'delete))))))
-  (unless (member gdb-inferior-status '("exited" "signal"))
-    (setq gdb-active-process t) ;Just for attaching case.
-    (setq gdb-inferior-status "stopped")
-    (gdb-force-mode-line-update
-     (propertize gdb-inferior-status 'face font-lock-warning-face)))
-  (let ((sink gdb-output-sink))
-    (cond
-     ((eq sink 'inferior)
-      (setq gdb-output-sink 'user))
-     ((eq sink 'user) t)
-     (t
-      (gdb-resync)
-      (error "Unexpected stopped annotation"))))
-  (if gdb-signalled (gdb-exited ignored)))
-
-(defun gdb-error (ignored)
-  (setq gdb-error (not gdb-error)))
-
-(defun gdb-thread-changed (ignored)
-  (gdb-frames-force-update))
-
-(defun gdb-post-prompt (ignored)
-  "An annotation handler for `post-prompt'.
-This begins the collection of output from the current command if that
-happens to be appropriate."
-  ;; Don't add to queue if there outstanding items or gdb-version is not known
-  ;; yet.
-  (unless (or gdb-pending-triggers gdb-first-post-prompt)
-    (gdb-get-selected-frame)
-    (gdb-invalidate-frames)
-    ;; Regenerate breakpoints buffer in case it has been inadvertantly deleted.
-    (gdb-get-buffer-create 'gdb-breakpoints-buffer)
-    (gdb-invalidate-breakpoints)
-    ;; Do this through gdb-get-selected-frame -> gdb-frame-handler
-    ;; so gdb-pc-address is updated.
-    ;; (gdb-invalidate-assembler)
-
-    (if (string-equal gdb-version "pre-6.4")
-	(gdb-invalidate-registers)
-      (gdb-get-changed-registers)
-      (gdb-invalidate-registers-1))
-
-    (gdb-invalidate-memory)
-    (if (string-equal gdb-version "pre-6.4")
-	(gdb-invalidate-locals)
-      (gdb-invalidate-locals-1))
-
-    (gdb-invalidate-threads)
-    (unless (or (null gdb-var-list)
-	     (eq system-type 'darwin)) ;Breaks on Darwin's GDB-5.3.
-      ;; FIXME: with GDB-6 on Darwin, this might very well work.
-      ;; Only needed/used with speedbar/watch expressions.
-      (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame))
-	(if (string-equal gdb-version "pre-6.4")
-	    (gdb-var-update)
-	  (gdb-var-update-1)))))
-  (setq gdb-first-post-prompt nil)
-  (let ((sink gdb-output-sink))
-    (cond
-     ((eq sink 'user) t)
-     ((eq sink 'pre-emacs)
-      (setq gdb-output-sink 'emacs))
-     (t
-      (gdb-resync)
-      (error "Phase error in gdb-post-prompt (got %s)" sink)))))
-
-(defconst gdb-buffer-list
-'(gdb-stack-buffer gdb-locals-buffer gdb-registers-buffer gdb-threads-buffer))
-
-(defun gdb-remove-text-properties ()
-  (dolist (buffertype gdb-buffer-list)
-    (let ((buffer (gdb-get-buffer buffertype)))
-      (if buffer
-	  (with-current-buffer buffer
-	    (let ((inhibit-read-only t))
-	      (remove-text-properties
-	       (point-min) (point-max) '(mouse-face nil help-echo nil))))))))
-
-;; GUD displays the selected GDB frame.  This might might not be the current
-;; GDB frame (after up, down etc).  If no GDB frame is visible but the last
-;; visited breakpoint is, use that window.
-(defun gdb-display-source-buffer (buffer)
-  (let* ((last-window (if gud-last-last-frame
-			 (get-buffer-window
-			  (gud-find-file (car gud-last-last-frame)))))
-	 (source-window (or last-window
-			    (if (and gdb-source-window
-				     (window-live-p gdb-source-window))
-				gdb-source-window))))
-    (when source-window
-      (setq gdb-source-window source-window)
-      (set-window-buffer source-window buffer))
-    source-window))
-
-;; Derived from gud-gdb-marker-regexp
-(defvar gdb-fullname-regexp
-  (concat "\\(.:?[^" ":" "\n]*\\)" ":" "\\([0-9]*\\)" ":" ".*"))
-
-(defun gud-gdba-marker-filter (string)
-  "A gud marker filter for gdb.  Handle a burst of output from GDB."
-  (if gdb-flush-pending-output
-      nil
-    (when gdb-enable-debug
-	(push (cons 'recv string) gdb-debug-log)
-	(if (and gdb-debug-log-max
-		 (> (length gdb-debug-log) gdb-debug-log-max))
-	    (setcdr (nthcdr (1- gdb-debug-log-max) gdb-debug-log) nil)))
-    ;; Recall the left over gud-marker-acc from last time.
-    (setq gud-marker-acc (concat gud-marker-acc string))
-    ;; Start accumulating output for the GUD buffer.
-    (let ((output ""))
-      ;;
-      ;; Process all the complete markers in this chunk.
-      (while (string-match "\n\032\032\\(.*\\)\n" gud-marker-acc)
-	(let ((annotation (match-string 1 gud-marker-acc))
-	      (before (substring gud-marker-acc 0 (match-beginning 0)))
-	      (after (substring gud-marker-acc (match-end 0))))
-	  ;;
-	  ;; Parse the tag from the annotation, and maybe its arguments.
-	  (string-match "\\(\\S-*\\) ?\\(.*\\)" annotation)
-	  (let* ((annotation-type (match-string 1 annotation))
-		 (annotation-arguments (match-string 2 annotation))
-		 (annotation-rule (assoc annotation-type
-					 gdb-annotation-rules)))
-
-	    ;; Stuff prior to the match is just ordinary output.
-	    ;; It is either concatenated to OUTPUT or directed
-	    ;; elsewhere.
-	    (setq output (gdb-concat-output output before))
-
-	    ;; Take that stuff off the gud-marker-acc.
-	    (setq gud-marker-acc after)
-
-	    ;; Call the handler for this annotation.
-	    (if annotation-rule
-		(funcall (car (cdr annotation-rule))
-			 annotation-arguments))
-
-	    ;; Else the annotation is not recognized.  Ignore it silently,
-	    ;; so that GDB can add new annotations without causing
-	    ;; us to blow up.
-	    )))
-
-      ;; Does the remaining text end in a partial line?
-      ;; If it does, then keep part of the gud-marker-acc until we get more.
-      (if (string-match "\n\\'\\|\n\032\\'\\|\n\032\032.*\\'"
-			gud-marker-acc)
-	  (progn
-	    ;; Everything before the potential marker start can be output.
-	    (setq output
-		  (gdb-concat-output output
-				     (substring gud-marker-acc 0
-						(match-beginning 0))))
-	    ;;
-	    ;; Everything after, we save, to combine with later input.
-	    (setq gud-marker-acc (substring gud-marker-acc
-					    (match-beginning 0))))
-	;;
-	;; In case we know the gud-marker-acc contains no partial annotations:
-	(progn
-	  (setq output (gdb-concat-output output gud-marker-acc))
-	  (setq gud-marker-acc "")))
-      output)))
-
-(defun gdb-concat-output (so-far new)
-  (if gdb-error
-      (put-text-property 0 (length new) 'face font-lock-warning-face new))
-  (let ((sink gdb-output-sink))
-    (cond
-     ((eq sink 'user) (concat so-far new))
-     ((or (eq sink 'pre-emacs) (eq sink 'post-emacs)) so-far)
-     ((eq sink 'emacs)
-      (gdb-append-to-partial-output new)
-      so-far)
-     ((eq sink 'inferior)
-      (gdb-append-to-inferior-io new)
-      so-far)
-     (t
-      (gdb-resync)
-      (error "Bogon output sink %S" sink)))))
-
-(defun gdb-append-to-partial-output (string)
-  (with-current-buffer (gdb-get-buffer-create 'gdb-partial-output-buffer)
-    (goto-char (point-max))
-    (insert string)))
-
-(defun gdb-clear-partial-output ()
-  (with-current-buffer (gdb-get-buffer-create 'gdb-partial-output-buffer)
-    (erase-buffer)))
-
-(defun gdb-append-to-inferior-io (string)
-  (with-current-buffer (gdb-get-buffer-create 'gdb-inferior-io)
-    (goto-char (point-max))
-    (insert-before-markers string))
-  (if (not (string-equal string ""))
-      (gdb-display-buffer (gdb-get-buffer-create 'gdb-inferior-io) t)))
-
-(defun gdb-clear-inferior-io ()
-  (with-current-buffer (gdb-get-buffer-create 'gdb-inferior-io)
-    (erase-buffer)))
-
-(defun gdb-jsonify-buffer (&optional fix-key fix-list)
-  "Prepare GDB/MI output in current buffer for parsing with `json-read'.
-
-Field names are wrapped in double quotes and equal signs are
-replaced with semicolons.
-
-If FIX-KEY is non-nil, strip all \"FIX-KEY=\" occurrences from
-partial output.  This is used to get rid of useless keys in lists
-in MI messages, e.g.: [key=.., key=..].  -stack-list-frames and
--break-info are examples of MI commands which issue such
-responses.
-
-If FIX-LIST is non-nil, \"FIX-LIST={..}\" is replaced with
-\"FIX-LIST=[..]\" prior to parsing.  This is used to fix broken
--break-info output when it contains breakpoint script field
-incompatible with GDB/MI output syntax."
-  (save-excursion
-    (goto-char (point-min))
-    ;; Sometimes missing symbol information precedes "^done" record.
-    (re-search-forward "[[:ascii:]]*?\\^done," nil t)
-    (replace-match "")
-    (re-search-forward "(gdb) \n" nil t)
-    (replace-match "")
-    (goto-char (point-min))
-    (when fix-key
-      (save-excursion
-        (while (re-search-forward (concat "[\\[,]\\(" fix-key "=\\)") nil t)
-          (replace-match "" nil nil nil 1))))
-    (when fix-list
-      (save-excursion
-        ;; Find positions of braces which enclose broken list
-        (while (re-search-forward (concat fix-list "={\"") nil t)
-          (let ((p1 (goto-char (- (point) 2)))
-                (p2 (progn (forward-sexp)
-                           (1- (point)))))
-            ;; Replace braces with brackets
-            (save-excursion
-              (goto-char p1)
-              (delete-char 1)
-              (insert "[")
-              (goto-char p2)
-              (delete-char 1)
-              (insert "]"))))))
-    (goto-char (point-min))
-    (insert "{")
-    (while (re-search-forward
-	    "\\([[:alnum:]-_]+\\)=\\({\\|\\[\\|\"\"\\|\".*?[^\\]\"\\)" nil t)
-      (replace-match "\"\\1\":\\2" nil nil))
-    (goto-char (point-max))
-    (insert "}")))
-
-(defun gdb-json-read-buffer (&optional fix-key fix-list)
-  "Prepare and parse GDB/MI output in current buffer with `json-read'.
-
-FIX-KEY and FIX-LIST work as in `gdb-jsonify-buffer'."
-  (gdb-jsonify-buffer fix-key fix-list)
-  (save-excursion
-    (goto-char (point-min))
-    (let ((json-array-type 'list))
-      (json-read))))
-
-(defun gdb-json-partial-output (&optional fix-key fix-list)
-  "Prepare and parse gdb-partial-output-buffer with `json-read'.
-
-FIX-KEY and FIX-KEY work as in `gdb-jsonify-buffer'."
-  (with-current-buffer (gdb-get-buffer-create 'gdb-partial-output-buffer)
-    (gdb-json-read-buffer fix-key fix-list)))
-
-
-;; One trick is to have a command who's output is always available in a buffer
-;; of it's own, and is always up to date.  We build several buffers of this
-;; type.
-;;
-;; There are two aspects to this: gdb has to tell us when the output for that
-;; command might have changed, and we have to be able to run the command
-;; behind the user's back.
-;;
-;; The output phasing associated with the variable gdb-output-sink
-;; help us to run commands behind the user's back.
-;;
-;; Below is the code for specificly managing buffers of output from one
-;; command.
-;;
-
-;; The trigger function is suitable for use in the assoc GDB-ANNOTATION-RULES
-;; It adds an input for the command we are tracking.  It should be the
-;; annotation rule binding of whatever gdb sends to tell us this command
-;; might have changed it's output.
-;;
-;; NAME is the function name.  DEMAND-PREDICATE tests if output is really needed.
-;; GDB-COMMAND is a string of such.  OUTPUT-HANDLER is the function bound to the
-;; input in the input queue (see comment about ``gdb communications'' above).
-
-(defmacro def-gdb-auto-update-trigger (name demand-predicate gdb-command
-					    output-handler)
-  `(defun ,name (&optional ignored)
-     (if (and ,demand-predicate
-	      (not (member ',name
-			   gdb-pending-triggers)))
-	 (progn
-	   (gdb-enqueue-input
-	    (list ,gdb-command ',output-handler))
-	   (push ',name gdb-pending-triggers)))))
-
-(defmacro def-gdb-auto-update-handler (name trigger buf-key custom-defun)
-  `(defun ,name ()
-     (setq gdb-pending-triggers
-      (delq ',trigger
-	    gdb-pending-triggers))
-     (let ((buf (gdb-get-buffer ',buf-key)))
-       (and buf
-	    (with-current-buffer buf
-	      (let* ((window (get-buffer-window buf 0))
-		     (start (window-start window))
-		     (p (if window (window-point window) (point)))
-		    (buffer-read-only nil))
-		(erase-buffer)
-		(insert-buffer-substring (gdb-get-buffer-create
-					  'gdb-partial-output-buffer))
-		(if window
-		    (progn
-		      (set-window-start window start)
-		      (set-window-point window p))
-		  (goto-char p))))))
-     ;; put customisation here
-     (,custom-defun)))
-
-(defmacro def-gdb-auto-updated-buffer (buffer-key
-				       trigger-name gdb-command
-				       output-handler-name custom-defun)
-  `(progn
-     (def-gdb-auto-update-trigger ,trigger-name
-       ;; The demand predicate:
-       (gdb-get-buffer ',buffer-key)
-       ,gdb-command
-       ,output-handler-name)
-     (def-gdb-auto-update-handler ,output-handler-name
-       ,trigger-name ,buffer-key ,custom-defun)))
-
-
-;;
-;; Breakpoint buffer : This displays the output of `info breakpoints'.
-;;
-(gdb-set-buffer-rules 'gdb-breakpoints-buffer
-		      'gdb-breakpoints-buffer-name
-		      'gdb-breakpoints-mode)
-
-(def-gdb-auto-updated-buffer gdb-breakpoints-buffer
-  ;; This defines the auto update rule for buffers of type
-  ;; `gdb-breakpoints-buffer'.
-  ;;
-  ;; It defines a function to serve as the annotation handler that
-  ;; handles the `foo-invalidated' message.  That function is called:
-  gdb-invalidate-breakpoints
-  ;;
-  ;; To update the buffer, this command is sent to gdb.
-  "server info breakpoints\n"
-  ;;
-  ;; This also defines a function to be the handler for the output
-  ;; from the command above.  That function will copy the output into
-  ;; the appropriately typed buffer.  That function will be called:
-  gdb-info-breakpoints-handler
-  ;; buffer specific functions
-  gdb-info-breakpoints-custom)
-
-(defconst breakpoint-xpm-data
-  "/* XPM */
-static char *magick[] = {
-/* columns rows colors chars-per-pixel */
-\"10 10 2 1\",
-\"  c red\",
-\"+ c None\",
-/* pixels */
-\"+++    +++\",
-\"++      ++\",
-\"+        +\",
-\"          \",
-\"          \",
-\"          \",
-\"          \",
-\"+        +\",
-\"++      ++\",
-\"+++    +++\",
-};"
-  "XPM data used for breakpoint icon.")
-
-(defconst breakpoint-enabled-pbm-data
-  "P1
-10 10\",
-0 0 0 0 1 1 1 1 0 0 0 0
-0 0 0 1 1 1 1 1 1 0 0 0
-0 0 1 1 1 1 1 1 1 1 0 0
-0 1 1 1 1 1 1 1 1 1 1 0
-0 1 1 1 1 1 1 1 1 1 1 0
-0 1 1 1 1 1 1 1 1 1 1 0
-0 1 1 1 1 1 1 1 1 1 1 0
-0 0 1 1 1 1 1 1 1 1 0 0
-0 0 0 1 1 1 1 1 1 0 0 0
-0 0 0 0 1 1 1 1 0 0 0 0"
-  "PBM data used for enabled breakpoint icon.")
-
-(defconst breakpoint-disabled-pbm-data
-  "P1
-10 10\",
-0 0 1 0 1 0 1 0 0 0
-0 1 0 1 0 1 0 1 0 0
-1 0 1 0 1 0 1 0 1 0
-0 1 0 1 0 1 0 1 0 1
-1 0 1 0 1 0 1 0 1 0
-0 1 0 1 0 1 0 1 0 1
-1 0 1 0 1 0 1 0 1 0
-0 1 0 1 0 1 0 1 0 1
-0 0 1 0 1 0 1 0 1 0
-0 0 0 1 0 1 0 1 0 0"
-  "PBM data used for disabled breakpoint icon.")
-
-(defvar breakpoint-enabled-icon nil
-  "Icon for enabled breakpoint in display margin.")
-
-(defvar breakpoint-disabled-icon nil
-  "Icon for disabled breakpoint in display margin.")
-
-(declare-function define-fringe-bitmap "fringe.c"
-		  (bitmap bits &optional height width align))
-
-(and (display-images-p)
-     ;; Bitmap for breakpoint in fringe
-     (define-fringe-bitmap 'breakpoint
-       "\x3c\x7e\xff\xff\xff\xff\x7e\x3c")
-     ;; Bitmap for gud-overlay-arrow in fringe
-     (define-fringe-bitmap 'hollow-right-triangle
-       "\xe0\x90\x88\x84\x84\x88\x90\xe0"))
-
-(defface breakpoint-enabled
-  '((t
-     :foreground "red1"
-     :weight bold))
-  "Face for enabled breakpoint icon in fringe."
-  :group 'gdb)
-
-(defface breakpoint-disabled
-  '((((class color) (min-colors 88)) :foreground "grey70")
-    ;; Ensure that on low-color displays that we end up something visible.
-    (((class color) (min-colors 8) (background light))
-     :foreground "black")
-    (((class color) (min-colors 8) (background dark))
-     :foreground "white")
-    (((type tty) (class mono))
-     :inverse-video t)
-    (t :background "gray"))
-  "Face for disabled breakpoint icon in fringe."
-  :group 'gdb)
-
-(defconst gdb-breakpoint-regexp
-  "\\(?:\\([0-9]+\\).*?\\(?:point\\|catch\\s-+\\S-+\\)\\s-+\\S-+\\|\\([0-9]+\\.[0-9]+\\)\\)\\s-+\\(.\\)\\s-+")
-
-;; Put breakpoint icons in relevant margins (even those set in the GUD buffer).
-(defun gdb-info-breakpoints-custom ()
-  (let ((flag) (bptno))
-    ;; Remove all breakpoint-icons in source buffers but not assembler buffer.
-    (dolist (buffer (buffer-list))
-      (with-current-buffer buffer
-	(if (and (memq gud-minor-mode '(gdba gdbmi))
-		 (not (string-match "\\` ?\\*.+\\*\\'" (buffer-name))))
-	    (gdb-remove-breakpoint-icons (point-min) (point-max)))))
-    (with-current-buffer (gdb-get-buffer 'gdb-breakpoints-buffer)
-      (save-excursion
-	(let ((buffer-read-only nil))
-	  (goto-char (point-min))
-	  (while (< (point) (- (point-max) 1))
-	    (forward-line 1)
-	    (if (looking-at gdb-breakpoint-regexp)
-		(progn
-		  (setq bptno (or (match-string 1) (match-string 2)))
-		  (setq flag (char-after (match-beginning 3)))
-		  (if (match-string 1)
-		      (setq gdb-parent-bptno-enabled (eq flag ?y)))
-		  (add-text-properties
-		   (match-beginning 3) (match-end 3)
-		   (if (eq flag ?y)
-		       '(face font-lock-warning-face)
-		     '(face font-lock-type-face)))
-		  (let ((bl (point))
-			(el (line-end-position)))
-		    (when (re-search-forward " in \\(.*\\) at" el t)
-		      (add-text-properties
-		       (match-beginning 1) (match-end 1)
-		       '(face font-lock-function-name-face)))
-		    (if (re-search-forward
-			 ".*\\s-+\\(\\S-+\\):\\([0-9]+\\)$" el t)
-			(let ((line (match-string 2))
-			      (file (match-string 1)))
-			  (add-text-properties bl el
-			       '(mouse-face highlight
-				 help-echo "mouse-2, RET: visit breakpoint"))
-			  (unless (file-exists-p file)
-			    (setq file (cdr (assoc bptno gdb-location-alist))))
-			  (if (and file
-				   (not (string-equal file "File not found")))
-			      (with-current-buffer
-				  (find-file-noselect file 'nowarn)
-				(gdb-init-buffer)
-				;; Only want one breakpoint icon at each
-				;; location.
-				(save-excursion
-				  (goto-char (point-min))
-				  (forward-line (1- (string-to-number line)))
-				  (gdb-put-breakpoint-icon (eq flag ?y) bptno)))
-			    (gdb-enqueue-input
-			     (list
-			      (concat gdb-server-prefix "list "
-				      (match-string-no-properties 1) ":1\n")
-			      'ignore))
-			    (gdb-enqueue-input
-			     (list (concat gdb-server-prefix "info source\n")
-				   `(lambda () (gdb-get-location
-						,bptno ,line ,flag))))))
-		      (if (re-search-forward
-			   "<\\(\\(\\sw\\|[_.]\\)+\\)\\(\\+[0-9]+\\)?>"
-			   el t)
-			  (add-text-properties
-			   (match-beginning 1) (match-end 1)
-			   '(face font-lock-function-name-face))
-			(end-of-line)
-			(re-search-backward "\\s-\\(\\S-*\\)"
-					    bl t)
-			(add-text-properties
-			 (match-beginning 1) (match-end 1)
-			 '(face font-lock-variable-name-face)))))))
-	    (end-of-line))))))
-  (if (gdb-get-buffer 'gdb-assembler-buffer) (gdb-assembler-custom))
-
-  ;; Breakpoints buffer is always present.  Hack to just update
-  ;; current frame if there's been no execution.
-  (if gdb-stack-update
-      (setq gdb-stack-update nil)
-    (if (gdb-get-buffer 'gdb-stack-buffer) (gdb-info-stack-custom))))
-
-(declare-function gud-remove "gdb-ui" t t) ; gud-def
-(declare-function gud-break  "gdb-ui" t t) ; gud-def
-(declare-function fringe-bitmaps-at-pos "fringe.c" (&optional pos window))
-
-(defun gdb-mouse-set-clear-breakpoint (event)
-  "Set/clear breakpoint in left fringe/margin at mouse click.
-If not in a source or disassembly buffer just set point."
-  (interactive "e")
-  (mouse-minibuffer-check event)
-  (let ((posn (event-end event)))
-    (with-selected-window (posn-window posn)
-      (if (or (buffer-file-name) (eq major-mode 'gdb-assembler-mode))
-	  (if (numberp (posn-point posn))
-	      (save-excursion
-		(goto-char (posn-point posn))
-		(if (or (posn-object posn)
-			(eq (car (fringe-bitmaps-at-pos (posn-point posn)))
-			    'breakpoint))
-		    (gud-remove nil)
-		  (gud-break nil)))))
-      (posn-set-point posn))))
-
-(defun gdb-mouse-toggle-breakpoint-margin (event)
-  "Enable/disable breakpoint in left margin with mouse click."
-  (interactive "e")
-  (mouse-minibuffer-check event)
-  (let ((posn (event-end event)))
-    (if (numberp (posn-point posn))
-	(with-selected-window (posn-window posn)
-	  (save-excursion
-	    (goto-char (posn-point posn))
-	    (if	(posn-object posn)
-		(let* ((bptno (get-text-property
-			       0 'gdb-bptno (car (posn-string posn)))))
-		  (string-match "\\([0-9+]\\)*" bptno)
-		  (gdb-enqueue-input
-		   (list
-		    (concat gdb-server-prefix
-			    (if (get-text-property
-				 0 'gdb-enabled (car (posn-string posn)))
-				"disable "
-			      "enable ")
-			    (match-string 1 bptno) "\n")
-		   'ignore)))))))))
-
-(defun gdb-mouse-toggle-breakpoint-fringe (event)
-  "Enable/disable breakpoint in left fringe with mouse click."
-  (interactive "e")
-  (mouse-minibuffer-check event)
-  (let* ((posn (event-end event))
-	 (pos (posn-point posn))
-	 obj)
-    (when (numberp pos)
-      (with-selected-window (posn-window posn)
-	(with-current-buffer (window-buffer (selected-window))
-	  (goto-char pos)
-	  (dolist (overlay (overlays-in pos pos))
-	    (when (overlay-get overlay 'put-break)
-	      (setq obj (overlay-get overlay 'before-string))))
-	  (when (stringp obj)
-	    (let* ((bptno (get-text-property 0 'gdb-bptno obj)))
-	      (string-match "\\([0-9+]\\)*" bptno)
-	      (gdb-enqueue-input
-	       (list
-		(concat gdb-server-prefix
-			(if (get-text-property 0 'gdb-enabled obj)
-			    "disable "
-			  "enable ")
-			(match-string 1 bptno) "\n")
-		'ignore)))))))))
-
-(defun gdb-breakpoints-buffer-name ()
-  (with-current-buffer gud-comint-buffer
-    (concat "*breakpoints of " (gdb-get-target-string) "*")))
-
-(defun gdb-display-breakpoints-buffer ()
-  "Display status of user-settable breakpoints."
-  (interactive)
-  (gdb-display-buffer
-   (gdb-get-buffer-create 'gdb-breakpoints-buffer) t))
-
-(defun gdb-frame-breakpoints-buffer ()
-  "Display status of user-settable breakpoints in a new frame."
-  (interactive)
-  (let ((special-display-regexps (append special-display-regexps '(".*")))
-	(special-display-frame-alist gdb-frame-parameters))
-    (display-buffer (gdb-get-buffer-create 'gdb-breakpoints-buffer))))
-
-(defvar gdb-breakpoints-mode-map
-  (let ((map (make-sparse-keymap))
-	(menu (make-sparse-keymap "Breakpoints")))
-    (define-key menu [quit] '("Quit"   . gdb-delete-frame-or-window))
-    (define-key menu [goto] '("Goto"   . gdb-goto-breakpoint))
-    (define-key menu [delete] '("Delete" . gdb-delete-breakpoint))
-    (define-key menu [toggle] '("Toggle" . gdb-toggle-breakpoint))
-    (suppress-keymap map)
-    (define-key map [menu-bar breakpoints] (cons "Breakpoints" menu))
-    (define-key map " " 'gdb-toggle-breakpoint)
-    (define-key map "D" 'gdb-delete-breakpoint)
-    ;; Don't bind "q" to kill-this-buffer as we need it for breakpoint icons.
-    (define-key map "q" 'gdb-delete-frame-or-window)
-    (define-key map "\r" 'gdb-goto-breakpoint)
-    (define-key map [mouse-2] 'gdb-goto-breakpoint)
-    (define-key map [follow-link] 'mouse-face)
-    map))
-
-(defun gdb-delete-frame-or-window ()
-  "Delete frame if there is only one window.  Otherwise delete the window."
-  (interactive)
-  (if (one-window-p) (delete-frame)
-    (delete-window)))
-
-;;from make-mode-line-mouse-map
-(defun gdb-make-header-line-mouse-map (mouse function) "\
-Return a keymap with single entry for mouse key MOUSE on the header line.
-MOUSE is defined to run function FUNCTION with no args in the buffer
-corresponding to the mode line clicked."
-  (let ((map (make-sparse-keymap)))
-    (define-key map (vector 'header-line mouse) function)
-    (define-key map (vector 'header-line 'down-mouse-1) 'ignore)
-    map))
-
-(defmacro gdb-propertize-header (name buffer help-echo mouse-face face)
-  `(propertize ,name
-	       'help-echo ,help-echo
-	       'mouse-face ',mouse-face
-	       'face ',face
-	       'local-map
-	       (gdb-make-header-line-mouse-map
-		'mouse-1
-		(lambda (event) (interactive "e")
-		  (save-selected-window
-		    (select-window (posn-window (event-start event)))
-		    (set-window-dedicated-p (selected-window) nil)
-		    (switch-to-buffer
-		     (gdb-get-buffer-create ',buffer))
-		    (setq header-line-format(gdb-set-header ',buffer))
-		    (set-window-dedicated-p (selected-window) t))))))
-
-(defun gdb-set-header (buffer)
-  (cond ((eq buffer 'gdb-locals-buffer)
-	 (list
-	  (gdb-propertize-header "Locals" gdb-locals-buffer
-				 nil nil mode-line)
-	  " "
-	  (gdb-propertize-header "Registers" gdb-registers-buffer
-				 "mouse-1: select" mode-line-highlight mode-line-inactive)))
-	((eq buffer 'gdb-registers-buffer)
-	 (list
-	  (gdb-propertize-header "Locals" gdb-locals-buffer
-				 "mouse-1: select" mode-line-highlight mode-line-inactive)
-	  " "
-	  (gdb-propertize-header "Registers" gdb-registers-buffer
-				 nil nil mode-line)))
-	((eq buffer 'gdb-breakpoints-buffer)
-	 (list
-	  (gdb-propertize-header "Breakpoints" gdb-breakpoints-buffer
-				 nil nil mode-line)
-	  " "
-	  (gdb-propertize-header "Threads" gdb-threads-buffer
-				 "mouse-1: select" mode-line-highlight mode-line-inactive)))
-	((eq buffer 'gdb-threads-buffer)
-	 (list
-	  (gdb-propertize-header "Breakpoints" gdb-breakpoints-buffer
-				 "mouse-1: select" mode-line-highlight mode-line-inactive)
-	  " "
-	  (gdb-propertize-header "Threads" gdb-threads-buffer
-				 nil nil mode-line)))))
-
-(defvar gdb-breakpoints-header
-  (list
-   (gdb-propertize-header "Breakpoints" gdb-breakpoints-buffer
-			  nil nil mode-line)
-   " "
-   (gdb-propertize-header "Threads" gdb-threads-buffer
-			  "mouse-1: select" mode-line-highlight mode-line-inactive)))
-
-(defun gdb-breakpoints-mode ()
-  "Major mode for gdb breakpoints.
-
-\\{gdb-breakpoints-mode-map}"
-  (kill-all-local-variables)
-  (setq major-mode 'gdb-breakpoints-mode)
-  (setq mode-name "Breakpoints")
-  (use-local-map gdb-breakpoints-mode-map)
-  (setq buffer-read-only t)
-  (buffer-disable-undo)
-  (setq header-line-format gdb-breakpoints-header)
-  (run-mode-hooks 'gdb-breakpoints-mode-hook)
-  (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
-      'gdb-invalidate-breakpoints
-    'gdbmi-invalidate-breakpoints))
-
-(defun gdb-toggle-breakpoint ()
-  "Enable/disable breakpoint at current line."
-  (interactive)
-  (save-excursion
-    (beginning-of-line 1)
-    (if (looking-at gdb-breakpoint-regexp)
-	(gdb-enqueue-input
-	 (list
-	  (concat gdb-server-prefix
-		  (if (eq ?y (char-after (match-beginning 3)))
-		      "disable "
-		    "enable ")
-		  (or (match-string 1) (match-string 2)) "\n") 'ignore))
-      (error "Not recognized as break/watchpoint line"))))
-
-(defun gdb-delete-breakpoint ()
-  "Delete the breakpoint at current line."
-  (interactive)
-  (save-excursion
-    (beginning-of-line 1)
-    (if (looking-at gdb-breakpoint-regexp)
-	(if (match-string 1)
-	    (gdb-enqueue-input
-	     (list
-	      (concat gdb-server-prefix "delete " (match-string 1) "\n")
-	      'ignore))
-	  (message-box "This breakpoint cannot be deleted on its own."))
-      (error "Not recognized as break/watchpoint line"))))
-
-(defun gdb-goto-breakpoint (&optional event)
-  "Display the breakpoint location specified at current line."
-  (interactive (list last-input-event))
-  (if event (posn-set-point (event-end event)))
-  (save-excursion
-    (beginning-of-line 1)
-    (if (looking-at "\\([0-9]+\\.?[0-9]*\\) .*\\s-+\\(\\S-+\\):\\([0-9]+\\)$")
-	(let ((bptno (match-string 1))
-	      (file  (match-string 2))
-	      (line  (match-string 3)))
-	  (save-selected-window
-	    (let* ((buffer (find-file-noselect
-			 (if (file-exists-p file) file
-			   (cdr (assoc bptno gdb-location-alist)))))
-		   (window (or (gdb-display-source-buffer buffer)
-			       (display-buffer buffer))))
-	      (setq gdb-source-window window)
-	      (with-current-buffer buffer
-		(goto-char (point-min))
-		(forward-line (1- (string-to-number line)))
-		(set-window-point window (point))))))
-      (error "No location specified"))))
-
-
-;; Frames buffer.  This displays a perpetually correct backtrace
-;; (from the command `where').
-;;
-;; Alas, if your stack is deep, it is costly.
-;;
-(defcustom gdb-max-frames 40
-  "Maximum number of frames displayed in call stack."
-  :type 'integer
-  :group 'gdb
-  :version "22.1")
-
-(gdb-set-buffer-rules 'gdb-stack-buffer
-		      'gdb-stack-buffer-name
-		      'gdb-frames-mode)
-
-(def-gdb-auto-updated-buffer gdb-stack-buffer
-  gdb-invalidate-frames
-  (concat "server info stack " (number-to-string gdb-max-frames) "\n")
-  gdb-info-stack-handler
-  gdb-info-stack-custom)
-
-;; This may be more important for embedded targets where unwinding the
-;; stack may take a long time.
-(defadvice gdb-invalidate-frames (around gdb-invalidate-frames-advice
-					 (&optional ignored) activate compile)
-  "Only queue \"info stack\" if execution has occurred."
-  (if gdb-stack-update ad-do-it))
-
-(defun gdb-info-stack-custom ()
-  (with-current-buffer (gdb-get-buffer 'gdb-stack-buffer)
-    (let (move-to)
-      (save-excursion
-	(unless (eq gdb-look-up-stack 'delete)
-	  (let ((buffer-read-only nil)
-		bl el)
-	    (goto-char (point-min))
-	    (while (< (point) (point-max))
-	      (setq bl (line-beginning-position)
-		    el (line-end-position))
-	      (when (looking-at "#")
-		(add-text-properties bl el
-		    '(mouse-face highlight
-				 help-echo "mouse-2, RET: Select frame")))
-	      (goto-char bl)
-	      (when (looking-at "^#\\([0-9]+\\)")
-		(when (string-equal (match-string 1) gdb-frame-number)
-		  (if (gud-tool-bar-item-visible-no-fringe)
-		      (progn
-			(put-text-property bl (+ bl 4)
-					   'face '(:inverse-video t))
-			(setq move-to bl))
-		    (or gdb-stack-position
-			(setq gdb-stack-position (make-marker)))
-		    (set-marker gdb-stack-position (point))
-		    (setq move-to gdb-stack-position)))
-		(when (re-search-forward "\\([^ ]+\\) (" el t)
-		  (put-text-property (match-beginning 1) (match-end 1)
-				     'face font-lock-function-name-face)
-		  (setq bl (match-end 0))
-		  (while (re-search-forward "<\\([^>]+\\)>" el t)
-		    (put-text-property (match-beginning 1) (match-end 1)
-				       'face font-lock-function-name-face))
-		  (goto-char bl)
-		  (while (re-search-forward "\\(\\(\\sw\\|[_.]\\)+\\)=" el t)
-		    (put-text-property (match-beginning 1) (match-end 1)
-				       'face font-lock-variable-name-face))))
-	      (forward-line 1))
-	    (forward-line -1)
-	    (when (looking-at "(More stack frames follow...)")
-	      (add-text-properties
-	       (match-beginning 0) (match-end 0)
-	       '(mouse-face highlight
-		 gdb-max-frames t
-		 help-echo
-		   "mouse-2, RET: customize gdb-max-frames to see more frames"
-		 )))))
-	(when gdb-look-up-stack
-	  (goto-char (point-min))
-	  (when (re-search-forward "\\(\\S-+?\\):\\([0-9]+\\)" nil t)
-	    (let ((start (line-beginning-position))
-		  (file (match-string 1))
-		  (line (match-string 2)))
-	      (re-search-backward "^#*\\([0-9]+\\)" start t)
-	      (gdb-enqueue-input
-	       (list (concat gdb-server-prefix "frame "
-			     (match-string 1) "\n") 'gdb-set-hollow))
-	      (gdb-enqueue-input
-	       (list (concat gdb-server-prefix "frame 0\n") 'ignore))))))
-      (when move-to
-	(let ((window (get-buffer-window (current-buffer) 0)))
-	  (when window
-	    (with-selected-window window
-	      (goto-char move-to)
-	      (unless (pos-visible-in-window-p)
-		(recenter '(center)))))))))
-  (if (eq gdb-look-up-stack 'delete)
-      (kill-buffer (gdb-get-buffer 'gdb-stack-buffer)))
-  (setq gdb-look-up-stack nil))
-
-(defun gdb-set-hollow ()
-  (if gud-last-last-frame
-      (with-current-buffer (gud-find-file (car gud-last-last-frame))
-	(setq fringe-indicator-alist
-	      '((overlay-arrow . hollow-right-triangle))))))
-
-(defun gdb-stack-buffer-name ()
-  (with-current-buffer gud-comint-buffer
-    (concat "*stack frames of " (gdb-get-target-string) "*")))
-
-(defun gdb-display-stack-buffer ()
-  "Display backtrace of current stack."
-  (interactive)
-  (gdb-display-buffer
-   (gdb-get-buffer-create 'gdb-stack-buffer) t))
-
-(defun gdb-frame-stack-buffer ()
-  "Display backtrace of current stack in a new frame."
-  (interactive)
-  (let ((special-display-regexps (append special-display-regexps '(".*")))
-	(special-display-frame-alist gdb-frame-parameters))
-    (display-buffer (gdb-get-buffer-create 'gdb-stack-buffer))))
-
-(defvar gdb-frames-mode-map
-  (let ((map (make-sparse-keymap)))
-    (suppress-keymap map)
-    (define-key map "q" 'kill-this-buffer)
-    (define-key map "\r" 'gdb-frames-select)
-    (define-key map "F" 'gdb-frames-force-update)
-    (define-key map [mouse-2] 'gdb-frames-select)
-    (define-key map [follow-link] 'mouse-face)
-    map))
-
-(declare-function gdbmi-invalidate-frames "ext:gdb-mi" nil t)
-
-(defun gdb-frames-force-update ()
-  "Force update of call stack.
-Use when the displayed call stack gets out of sync with the
-actual one, e.g after using the Gdb command \"return\" or setting
-$pc directly from the GUD buffer.  This command isn't normally needed."
-  (interactive)
-  (setq gdb-stack-update t)
-  (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
-      (gdb-invalidate-frames)
-    (gdbmi-invalidate-frames)))
-
-(defun gdb-frames-mode ()
-  "Major mode for gdb call stack.
-
-\\{gdb-frames-mode-map}"
-  (kill-all-local-variables)
-  (setq major-mode 'gdb-frames-mode)
-  (setq mode-name "Frames")
-  (setq gdb-stack-position nil)
-  (add-to-list 'overlay-arrow-variable-list 'gdb-stack-position)
-  (setq truncate-lines t)  ;; Make it easier to see overlay arrow.
-  (setq buffer-read-only t)
-  (buffer-disable-undo)
-  (gdb-thread-identification)
-  (use-local-map gdb-frames-mode-map)
-  (run-mode-hooks 'gdb-frames-mode-hook)
-  (setq gdb-stack-update t)
-  (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
-      'gdb-invalidate-frames
-    'gdbmi-invalidate-frames))
-
-(defun gdb-get-frame-number ()
-  (save-excursion
-    (end-of-line)
-    (let* ((start (line-beginning-position))
-	   (pos (re-search-backward "^#*\\([0-9]+\\)" start t))
-	   (n (or (and pos (match-string 1)) "0")))
-      n)))
-
-(defun gdb-frames-select (&optional event)
-  "Select the frame and display the relevant source."
-  (interactive (list last-input-event))
-  (if event (posn-set-point (event-end event)))
-  (if (get-text-property (point) 'gdb-max-frames)
-      (progn
-	(message-box "After setting gdb-max-frames, you need to enter\n\
-another GDB command e.g pwd, to see new frames")
-      (customize-variable-other-window 'gdb-max-frames))
-    (gdb-enqueue-input
-     (list (concat gdb-server-prefix "frame "
-		   (gdb-get-frame-number) "\n") 'ignore))))
-
-
-;; Threads buffer.  This displays a selectable thread list.
-;;
-(gdb-set-buffer-rules 'gdb-threads-buffer
-		      'gdb-threads-buffer-name
-		      'gdb-threads-mode)
-
-(def-gdb-auto-updated-buffer gdb-threads-buffer
-  gdb-invalidate-threads
-  (concat gdb-server-prefix "info threads\n")
-  gdb-info-threads-handler
-  gdb-info-threads-custom)
-
-(defun gdb-info-threads-custom ()
-  (with-current-buffer (gdb-get-buffer 'gdb-threads-buffer)
-    (let ((buffer-read-only nil))
-      (save-excursion
-	(goto-char (point-min))
-	(if (re-search-forward "\\* \\([0-9]+\\)" nil t)
-	    (setq gdb-thread-indicator
-		  (propertize (concat " [" (match-string 1) "]")
-			      ; FIXME: this help-echo doesn't work
-			      'help-echo "thread id")))
-	(goto-char (point-min))
-	(while (< (point) (point-max))
-	  (unless (looking-at "No ")
-	    (add-text-properties (line-beginning-position) (line-end-position)
-				 '(mouse-face highlight
-			         help-echo "mouse-2, RET: select thread")))
-	  (forward-line 1))))))
-
-(defun gdb-threads-buffer-name ()
-  (with-current-buffer gud-comint-buffer
-    (concat "*threads of " (gdb-get-target-string) "*")))
-
-(defun gdb-display-threads-buffer ()
-  "Display IDs of currently known threads."
-  (interactive)
-  (gdb-display-buffer
-   (gdb-get-buffer-create 'gdb-threads-buffer) t))
-
-(defun gdb-frame-threads-buffer ()
-  "Display IDs of currently known threads in a new frame."
-  (interactive)
-  (let ((special-display-regexps (append special-display-regexps '(".*")))
-	(special-display-frame-alist gdb-frame-parameters))
-    (display-buffer (gdb-get-buffer-create 'gdb-threads-buffer))))
-
-(defvar gdb-threads-mode-map
-  (let ((map (make-sparse-keymap)))
-    (suppress-keymap map)
-    (define-key map "q" 'kill-this-buffer)
-    (define-key map "\r" 'gdb-threads-select)
-    (define-key map [mouse-2] 'gdb-threads-select)
-    (define-key map [follow-link] 'mouse-face)
-    map))
-
-(defvar gdb-threads-font-lock-keywords
-  '((") +\\([^ ]+\\) ("  (1 font-lock-function-name-face))
-    ("in \\([^ ]+\\) ("  (1 font-lock-function-name-face))
-    ("\\(\\(\\sw\\|[_.]\\)+\\)="  (1 font-lock-variable-name-face)))
-  "Font lock keywords used in `gdb-threads-mode'.")
-
-(defun gdb-threads-mode ()
-  "Major mode for gdb threads.
-
-\\{gdb-threads-mode-map}"
-  (kill-all-local-variables)
-  (setq major-mode 'gdb-threads-mode)
-  (setq mode-name "Threads")
-  (setq buffer-read-only t)
-  (buffer-disable-undo)
-  (setq header-line-format gdb-breakpoints-header)
-  (use-local-map gdb-threads-mode-map)
-  (set (make-local-variable 'font-lock-defaults)
-       '(gdb-threads-font-lock-keywords))
-  (run-mode-hooks 'gdb-threads-mode-hook)
-  ;; Force "info threads" onto queue.
-  (lambda () (let ((gud-running nil)) (gdb-invalidate-threads))))
-
-(defun gdb-get-thread-number ()
-  (save-excursion
-    (re-search-backward "^\\s-*\\([0-9]*\\)" nil t)
-    (match-string-no-properties 1)))
-
-(defun gdb-threads-select (&optional event)
-  "Select the thread and display the relevant source."
-  (interactive (list last-input-event))
-  (if event (posn-set-point (event-end event)))
-  (setq gdb-stack-update t)
-  (gdb-enqueue-input
-   (list (concat gdb-server-prefix "thread "
-		 (gdb-get-thread-number) "\n") 'ignore))
-  (gud-display-frame))
-
-(defun gdb-thread-identification ()
-  (setq mode-line-buffer-identification
-	(list (car mode-line-buffer-identification)
-	      '(gdb-thread-indicator gdb-thread-indicator))))
-
-;; Registers buffer.
-;;
-(defcustom gdb-all-registers nil
-  "Non-nil means include floating-point registers."
-  :type 'boolean
-  :group 'gdb
-  :version "22.1")
-
-(gdb-set-buffer-rules 'gdb-registers-buffer
-		      'gdb-registers-buffer-name
-		      'gdb-registers-mode)
-
-(def-gdb-auto-updated-buffer gdb-registers-buffer
-  gdb-invalidate-registers
-  (concat
-   gdb-server-prefix "info " (if gdb-all-registers "all-") "registers\n")
-  gdb-info-registers-handler
-  gdb-info-registers-custom)
-
-(defun gdb-info-registers-custom ()
-  (with-current-buffer (gdb-get-buffer 'gdb-registers-buffer)
-    (save-excursion
-      (let ((buffer-read-only nil)
-	    start end)
-	(goto-char (point-min))
-	(while (< (point) (point-max))
-	  (setq start (line-beginning-position))
-	  (setq end (line-end-position))
-	  (when (looking-at "^[^ ]+")
-	    (unless (string-equal (match-string 0) "The")
-	      (put-text-property start (match-end 0)
-				 'face font-lock-variable-name-face)
-	      (add-text-properties start end
-		                   '(help-echo "mouse-2: edit value"
-				     mouse-face highlight))))
-	  (forward-line 1))))))
-
-(defun gdb-edit-register-value (&optional event)
-  (interactive (list last-input-event))
-  (save-excursion
-    (if event (posn-set-point (event-end event)))
-    (beginning-of-line)
-    (let* ((register (current-word))
-	  (value (read-string (format "New value (%s): " register))))
-      (gdb-enqueue-input
-       (list (concat gdb-server-prefix "set $" register "=" value "\n")
-	     'ignore)))))
-
-(defvar gdb-registers-mode-map
-  (let ((map (make-sparse-keymap)))
-    (suppress-keymap map)
-    (define-key map "\r" 'gdb-edit-register-value)
-    (define-key map [mouse-2] 'gdb-edit-register-value)
-    (define-key map " " 'gdb-all-registers)
-    (define-key map "q" 'kill-this-buffer)
-     map))
-
-(defvar gdb-locals-header
-  (list
-   (gdb-propertize-header "Locals" gdb-locals-buffer
-			  nil nil mode-line)
-   " "
-   (gdb-propertize-header "Registers" gdb-registers-buffer
-			  "mouse-1: select" mode-line-highlight mode-line-inactive)))
-
-
-(defun gdb-registers-mode ()
-  "Major mode for gdb registers.
-
-\\{gdb-registers-mode-map}"
-  (kill-all-local-variables)
-  (setq major-mode 'gdb-registers-mode)
-  (setq mode-name "Registers")
-  (setq header-line-format gdb-locals-header)
-  (setq buffer-read-only t)
-  (buffer-disable-undo)
-  (gdb-thread-identification)
-  (use-local-map gdb-registers-mode-map)
-  (run-mode-hooks 'gdb-registers-mode-hook)
-  (if (string-equal gdb-version "pre-6.4")
-      (progn
-	(if gdb-all-registers (setq mode-name "Registers:All"))
-	'gdb-invalidate-registers)
-    'gdb-invalidate-registers-1))
-
-(defun gdb-registers-buffer-name ()
-  (with-current-buffer gud-comint-buffer
-    (concat "*registers of " (gdb-get-target-string) "*")))
-
-(defun gdb-display-registers-buffer ()
-  "Display integer register contents."
-  (interactive)
-  (gdb-display-buffer
-   (gdb-get-buffer-create 'gdb-registers-buffer) t))
-
-(defun gdb-frame-registers-buffer ()
-  "Display integer register contents in a new frame."
-  (interactive)
-  (let ((special-display-regexps (append special-display-regexps '(".*")))
-	(special-display-frame-alist gdb-frame-parameters))
-    (display-buffer (gdb-get-buffer-create 'gdb-registers-buffer))))
-
-(defun gdb-all-registers ()
-  "Toggle the display of floating-point registers (pre GDB 6.4 only)."
-  (interactive)
-  (when (string-equal gdb-version "pre-6.4")
-    (if gdb-all-registers
-	(progn
-	  (setq gdb-all-registers nil)
-	  (with-current-buffer (gdb-get-buffer-create 'gdb-registers-buffer)
-	    (setq mode-name "Registers")))
-      (setq gdb-all-registers t)
-      (with-current-buffer (gdb-get-buffer-create 'gdb-registers-buffer)
-	(setq mode-name "Registers:All")))
-    (message (format "Display of floating-point registers %sabled"
-		     (if gdb-all-registers "en" "dis")))
-    (gdb-invalidate-registers)))
-
-
-;; Memory buffer.
-;;
-(defcustom gdb-memory-repeat-count 32
-  "Number of data items in memory window."
-  :type 'integer
-  :group 'gdb
-  :version "22.1")
-
-(defcustom gdb-memory-format "x"
-  "Display format of data items in memory window."
-  :type '(choice (const :tag "Hexadecimal" "x")
-	 	 (const :tag "Signed decimal" "d")
-	 	 (const :tag "Unsigned decimal" "u")
-		 (const :tag "Octal" "o")
-		 (const :tag "Binary" "t"))
-  :group 'gdb
-  :version "22.1")
-
-(defcustom gdb-memory-unit "w"
-  "Unit size of data items in memory window."
-  :type '(choice (const :tag "Byte" "b")
-		 (const :tag "Halfword" "h")
-		 (const :tag "Word" "w")
-		 (const :tag "Giant word" "g"))
-  :group 'gdb
-  :version "22.1")
-
-(gdb-set-buffer-rules 'gdb-memory-buffer
-		      'gdb-memory-buffer-name
-		      'gdb-memory-mode)
-
-(def-gdb-auto-updated-buffer gdb-memory-buffer
-  gdb-invalidate-memory
-  (concat gdb-server-prefix "x/" (number-to-string gdb-memory-repeat-count)
-	  gdb-memory-format gdb-memory-unit " " gdb-memory-address "\n")
-  gdb-read-memory-handler
-  gdb-read-memory-custom)
-
-(defun gdb-read-memory-custom ()
-  (save-excursion
-    (goto-char (point-min))
-    (if (looking-at "0x[[:xdigit:]]+")
-	(setq gdb-memory-address (match-string 0)))))
-
-(defvar gdb-memory-mode-map
-  (let ((map (make-sparse-keymap)))
-    (suppress-keymap map)
-    (define-key map "S" 'gdb-memory-set-address)
-    (define-key map "N" 'gdb-memory-set-repeat-count)
-    (define-key map "q" 'kill-this-buffer)
-     map))
-
-(defun gdb-memory-set-address (&optional event)
-  "Set the start memory address."
-  (interactive)
-  (let ((arg (read-from-minibuffer "Start address: ")))
-    (setq gdb-memory-address arg))
-    (gdb-invalidate-memory))
-
-(defun gdb-memory-set-repeat-count (&optional event)
-  "Set the number of data items in memory window."
-  (interactive)
-  (let* ((arg (read-from-minibuffer "Repeat count: "))
-	 (count (string-to-number arg)))
-    (if (<= count 0)
-	(error "Positive numbers only")
-      (customize-set-variable 'gdb-memory-repeat-count count)
-      (gdb-invalidate-memory))))
-
-(defun gdb-memory-format-binary ()
-  "Set the display format to binary."
-  (interactive)
-  (customize-set-variable 'gdb-memory-format "t")
-  (gdb-invalidate-memory))
-
-(defun gdb-memory-format-octal ()
-  "Set the display format to octal."
-  (interactive)
-  (customize-set-variable 'gdb-memory-format "o")
-  (gdb-invalidate-memory))
-
-(defun gdb-memory-format-unsigned ()
-  "Set the display format to unsigned decimal."
-  (interactive)
-  (customize-set-variable 'gdb-memory-format "u")
-  (gdb-invalidate-memory))
-
-(defun gdb-memory-format-signed ()
-  "Set the display format to decimal."
-  (interactive)
-  (customize-set-variable 'gdb-memory-format "d")
-  (gdb-invalidate-memory))
-
-(defun gdb-memory-format-hexadecimal ()
-  "Set the display format to hexadecimal."
-  (interactive)
-  (customize-set-variable 'gdb-memory-format "x")
-  (gdb-invalidate-memory))
-
-(defvar gdb-memory-format-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map [header-line down-mouse-3] 'gdb-memory-format-menu-1)
-    map)
-  "Keymap to select format in the header line.")
-
-(defvar gdb-memory-format-menu (make-sparse-keymap "Format")
-  "Menu of display formats in the header line.")
-
-(define-key gdb-memory-format-menu [binary]
-  '(menu-item "Binary" gdb-memory-format-binary
-	      :button (:radio . (equal gdb-memory-format "t"))))
-(define-key gdb-memory-format-menu [octal]
-  '(menu-item "Octal" gdb-memory-format-octal
-	      :button (:radio . (equal gdb-memory-format "o"))))
-(define-key gdb-memory-format-menu [unsigned]
-  '(menu-item "Unsigned Decimal" gdb-memory-format-unsigned
-	      :button (:radio . (equal gdb-memory-format "u"))))
-(define-key gdb-memory-format-menu [signed]
-  '(menu-item "Signed Decimal" gdb-memory-format-signed
-	      :button (:radio . (equal gdb-memory-format "d"))))
-(define-key gdb-memory-format-menu [hexadecimal]
-  '(menu-item "Hexadecimal" gdb-memory-format-hexadecimal
-	      :button (:radio . (equal gdb-memory-format "x"))))
-
-(defun gdb-memory-format-menu (event)
-  (interactive "@e")
-  (x-popup-menu event gdb-memory-format-menu))
-
-(defun gdb-memory-format-menu-1 (event)
-  (interactive "e")
-  (save-selected-window
-    (select-window (posn-window (event-start event)))
-    (let* ((selection (gdb-memory-format-menu event))
-	   (binding (and selection (lookup-key gdb-memory-format-menu
-					       (vector (car selection))))))
-      (if binding (call-interactively binding)))))
-
-(defun gdb-memory-unit-giant ()
-  "Set the unit size to giant words (eight bytes)."
-  (interactive)
-  (customize-set-variable 'gdb-memory-unit "g")
-  (gdb-invalidate-memory))
-
-(defun gdb-memory-unit-word ()
-  "Set the unit size to words (four bytes)."
-  (interactive)
-  (customize-set-variable 'gdb-memory-unit "w")
-  (gdb-invalidate-memory))
-
-(defun gdb-memory-unit-halfword ()
-  "Set the unit size to halfwords (two bytes)."
-  (interactive)
-  (customize-set-variable 'gdb-memory-unit "h")
-  (gdb-invalidate-memory))
-
-(defun gdb-memory-unit-byte ()
-  "Set the unit size to bytes."
-  (interactive)
-  (customize-set-variable 'gdb-memory-unit "b")
-  (gdb-invalidate-memory))
-
-(defvar gdb-memory-unit-map
-  (let ((map (make-sparse-keymap)))
-    (define-key map [header-line down-mouse-3] 'gdb-memory-unit-menu-1)
-    map)
-  "Keymap to select units in the header line.")
-
-(defvar gdb-memory-unit-menu (make-sparse-keymap "Unit")
-  "Menu of units in the header line.")
-
-(define-key gdb-memory-unit-menu [giantwords]
-  '(menu-item "Giant words" gdb-memory-unit-giant
-	      :button (:radio . (equal gdb-memory-unit "g"))))
-(define-key gdb-memory-unit-menu [words]
-  '(menu-item "Words" gdb-memory-unit-word
-	      :button (:radio . (equal gdb-memory-unit "w"))))
-(define-key gdb-memory-unit-menu [halfwords]
-  '(menu-item "Halfwords" gdb-memory-unit-halfword
-	      :button (:radio . (equal gdb-memory-unit "h"))))
-(define-key gdb-memory-unit-menu [bytes]
-  '(menu-item "Bytes" gdb-memory-unit-byte
-	      :button (:radio . (equal gdb-memory-unit "b"))))
-
-(defun gdb-memory-unit-menu (event)
-  (interactive "@e")
-  (x-popup-menu event gdb-memory-unit-menu))
-
-(defun gdb-memory-unit-menu-1 (event)
-  (interactive "e")
-  (save-selected-window
-    (select-window (posn-window (event-start event)))
-    (let* ((selection (gdb-memory-unit-menu event))
-	   (binding (and selection (lookup-key gdb-memory-unit-menu
-					       (vector (car selection))))))
-      (if binding (call-interactively binding)))))
-
-(defvar gdb-memory-font-lock-keywords
-  '(;; <__function.name+n>
-    ("<\\(\\(\\sw\\|[_.]\\)+\\)\\(\\+[0-9]+\\)?>" (1 font-lock-function-name-face))
-    )
-  "Font lock keywords used in `gdb-memory-mode'.")
-
-(defun gdb-memory-mode ()
-  "Major mode for examining memory.
-
-\\{gdb-memory-mode-map}"
-  (kill-all-local-variables)
-  (setq major-mode 'gdb-memory-mode)
-  (setq mode-name "Memory")
-  (setq buffer-read-only t)
-  (buffer-disable-undo)
-  (use-local-map gdb-memory-mode-map)
-  (setq header-line-format
-	'(:eval
-	  (concat
-	   "Start address["
-	   (propertize
-	    "-"
-	    'face font-lock-warning-face
-	    'help-echo "mouse-1: decrement address"
-	    'mouse-face 'mode-line-highlight
-	    'local-map
-	    (gdb-make-header-line-mouse-map
-	     'mouse-1
-	     (lambda () (interactive)
-	       (let ((gdb-memory-address
-		      ;; Let GDB do the arithmetic.
-		      (concat
-		       gdb-memory-address " - "
-		       (number-to-string
-			(* gdb-memory-repeat-count
-			   (cond ((string= gdb-memory-unit "b") 1)
-				 ((string= gdb-memory-unit "h") 2)
-				 ((string= gdb-memory-unit "w") 4)
-				 ((string= gdb-memory-unit "g") 8)))))))
-		 (gdb-invalidate-memory)))))
-	   "|"
-	   (propertize "+"
-		       'face font-lock-warning-face
-		       'help-echo "mouse-1: increment address"
-		       'mouse-face 'mode-line-highlight
-		       'local-map (gdb-make-header-line-mouse-map
-				   'mouse-1
-				   (lambda () (interactive)
-				     (let ((gdb-memory-address nil))
-				       (gdb-invalidate-memory)))))
-	   "]: "
-	   (propertize gdb-memory-address
-		       'face font-lock-warning-face
-		       'help-echo "mouse-1: set start address"
-		       'mouse-face 'mode-line-highlight
-		       'local-map (gdb-make-header-line-mouse-map
-				   'mouse-1
-				   #'gdb-memory-set-address))
-	   "  Repeat Count: "
-	   (propertize (number-to-string gdb-memory-repeat-count)
-		       'face font-lock-warning-face
-		       'help-echo "mouse-1: set repeat count"
-		       'mouse-face 'mode-line-highlight
-		       'local-map (gdb-make-header-line-mouse-map
-				   'mouse-1
-				   #'gdb-memory-set-repeat-count))
-	   "  Display Format: "
-	   (propertize gdb-memory-format
-		       'face font-lock-warning-face
-		       'help-echo "mouse-3: select display format"
-		       'mouse-face 'mode-line-highlight
-		       'local-map gdb-memory-format-map)
-	   "  Unit Size: "
-	   (propertize gdb-memory-unit
-		       'face font-lock-warning-face
-		       'help-echo "mouse-3: select unit size"
-		       'mouse-face 'mode-line-highlight
-		       'local-map gdb-memory-unit-map))))
-  (set (make-local-variable 'font-lock-defaults)
-       '(gdb-memory-font-lock-keywords))
-  (run-mode-hooks 'gdb-memory-mode-hook)
-  'gdb-invalidate-memory)
-
-(defun gdb-memory-buffer-name ()
-  (with-current-buffer gud-comint-buffer
-    (concat "*memory of " (gdb-get-target-string) "*")))
-
-(defun gdb-display-memory-buffer ()
-  "Display memory contents."
-  (interactive)
-  (gdb-display-buffer
-   (gdb-get-buffer-create 'gdb-memory-buffer) t))
-
-(defun gdb-frame-memory-buffer ()
-  "Display memory contents in a new frame."
-  (interactive)
-  (let* ((special-display-regexps (append special-display-regexps '(".*")))
-	 (special-display-frame-alist
-	  (cons '(left-fringe . 0)
-		(cons '(right-fringe . 0)
-		      (cons '(width . 83) gdb-frame-parameters)))))
-    (display-buffer (gdb-get-buffer-create 'gdb-memory-buffer))))
-
-
-;; Locals buffer.
-;;
-(gdb-set-buffer-rules 'gdb-locals-buffer
-		      'gdb-locals-buffer-name
-		      'gdb-locals-mode)
-
-(def-gdb-auto-update-trigger gdb-invalidate-locals
-  (gdb-get-buffer 'gdb-locals-buffer)
-  "server info locals\n"
-  gdb-info-locals-handler)
-
-(defvar gdb-locals-watch-map
-  (let ((map (make-sparse-keymap)))
-    (suppress-keymap map)
-    (define-key map "\r" (lambda () (interactive)
-			   (beginning-of-line)
-			   (gud-watch)))
-    (define-key map [mouse-2] (lambda (event) (interactive "e")
-				(mouse-set-point event)
-				(beginning-of-line)
-				(gud-watch)))
-    map)
-  "Keymap to create watch expression of a complex data type local variable.")
-
-(defconst gdb-struct-string
-  (concat (propertize "[struct/union]"
-		      'mouse-face 'highlight
-		      'help-echo "mouse-2: create watch expression"
-		      'local-map gdb-locals-watch-map) "\n"))
-
-(defconst gdb-array-string
-  (concat " " (propertize "[array]"
-			  'mouse-face 'highlight
-			  'help-echo "mouse-2: create watch expression"
-			  'local-map gdb-locals-watch-map) "\n"))
-
-;; Abbreviate for arrays and structures.
-;; These can be expanded using gud-display.
-(defun gdb-info-locals-handler ()
-  (setq gdb-pending-triggers (delq 'gdb-invalidate-locals
-				  gdb-pending-triggers))
-  (let ((buf (gdb-get-buffer 'gdb-partial-output-buffer)))
-    (with-current-buffer buf
-      (goto-char (point-min))
-      ;; Need this in case "set print pretty" is on.
-      (while (re-search-forward "^[ }].*\n" nil t)
-	(replace-match "" nil nil))
-      (goto-char (point-min))
-      (while (re-search-forward "{\\(.*=.*\n\\|\n\\)" nil t)
-	(replace-match gdb-struct-string nil nil))
-      (goto-char (point-min))
-      (while (re-search-forward "\\s-*{[^.].*\n" nil t)
-	(replace-match gdb-array-string nil nil))))
-  (let ((buf (gdb-get-buffer 'gdb-locals-buffer)))
-    (and buf
-	 (with-current-buffer buf
-	      (let* ((window (get-buffer-window buf 0))
-		     (start (window-start window))
-		     (p (window-point window))
-		     (buffer-read-only nil))
-		 (erase-buffer)
-		 (insert-buffer-substring (gdb-get-buffer-create
-					   'gdb-partial-output-buffer))
-		(set-window-start window start)
-		(set-window-point window p)))))
-  (run-hooks 'gdb-info-locals-hook))
-
-(defvar gdb-locals-mode-map
-  (let ((map (make-sparse-keymap)))
-    (suppress-keymap map)
-    (define-key map "q" 'kill-this-buffer)
-     map))
-
-(defun gdb-locals-mode ()
-  "Major mode for gdb locals.
-
-\\{gdb-locals-mode-map}"
-  (kill-all-local-variables)
-  (setq major-mode 'gdb-locals-mode)
-  (setq mode-name (concat "Locals:" gdb-selected-frame))
-  (use-local-map gdb-locals-mode-map)
-  (setq buffer-read-only t)
-  (buffer-disable-undo)
-  (setq header-line-format gdb-locals-header)
-  (gdb-thread-identification)
-  (set (make-local-variable 'font-lock-defaults)
-       '(gdb-locals-font-lock-keywords))
-  (run-mode-hooks 'gdb-locals-mode-hook)
-  (if (and (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
-	   (string-equal gdb-version "pre-6.4"))
-      'gdb-invalidate-locals
-    'gdb-invalidate-locals-1))
-
-(defun gdb-locals-buffer-name ()
-  (with-current-buffer gud-comint-buffer
-    (concat "*locals of " (gdb-get-target-string) "*")))
-
-(defun gdb-display-locals-buffer ()
-  "Display local variables of current stack and their values."
-  (interactive)
-  (gdb-display-buffer
-   (gdb-get-buffer-create 'gdb-locals-buffer) t))
-
-(defun gdb-frame-locals-buffer ()
-  "Display local variables of current stack and their values in a new frame."
-  (interactive)
-  (let ((special-display-regexps (append special-display-regexps '(".*")))
-	(special-display-frame-alist gdb-frame-parameters))
-    (display-buffer (gdb-get-buffer-create 'gdb-locals-buffer))))
-
-
-;;;; Window management
-(defun gdb-display-buffer (buf dedicated &optional frame)
-  (let ((answer (get-buffer-window buf (or frame 0))))
-    (if answer
-	(display-buffer buf nil (or frame 0)) ;Deiconify the frame if necessary.
-      (let ((window (get-lru-window)))
-	(if (memq (buffer-local-value 'gud-minor-mode (window-buffer window))
-		  '(gdba gdbmi))
-	    (let* ((largest (get-largest-window))
-		   (cur-size (window-height largest)))
-	      (setq answer (split-window largest))
-	      (set-window-buffer answer buf)
-	      (set-window-dedicated-p answer dedicated)
-	      answer)
-	  (set-window-buffer window buf)
-	  window)))))
-
-
-;;; Shared keymap initialization:
-
-(let ((menu (make-sparse-keymap "GDB-Windows")))
-  (define-key gud-menu-map [displays]
-    `(menu-item "GDB-Windows" ,menu
-		:help "Open a GDB-UI buffer in a new window."
-		:visible (memq gud-minor-mode '(gdbmi gdba))))
-  (define-key menu [gdb] '("Gdb" . gdb-display-gdb-buffer))
-  (define-key menu [threads] '("Threads" . gdb-display-threads-buffer))
-  (define-key menu [inferior]
-    '(menu-item "Separate IO" gdb-display-separate-io-buffer
-		:enable gdb-use-separate-io-buffer))
-  (define-key menu [memory] '("Memory" . gdb-display-memory-buffer))
-  (define-key menu [registers] '("Registers" . gdb-display-registers-buffer))
-  (define-key menu [disassembly]
-    '("Disassembly" . gdb-display-assembler-buffer))
-  (define-key menu [breakpoints]
-    '("Breakpoints" . gdb-display-breakpoints-buffer))
-  (define-key menu [locals] '("Locals" . gdb-display-locals-buffer))
-  (define-key menu [frames] '("Stack" . gdb-display-stack-buffer)))
-
-(let ((menu (make-sparse-keymap "GDB-Frames")))
-  (define-key gud-menu-map [frames]
-    `(menu-item "GDB-Frames" ,menu
-		:help "Open a GDB-UI buffer in a new frame."
-		:visible (memq gud-minor-mode '(gdbmi gdba))))
-  (define-key menu [gdb] '("Gdb" . gdb-frame-gdb-buffer))
-  (define-key menu [threads] '("Threads" . gdb-frame-threads-buffer))
-  (define-key menu [memory] '("Memory" . gdb-frame-memory-buffer))
-  (define-key menu [inferior]
-    '(menu-item "Separate IO" gdb-frame-separate-io-buffer
-		:enable gdb-use-separate-io-buffer))
-  (define-key menu [registers] '("Registers" . gdb-frame-registers-buffer))
-  (define-key menu [disassembly] '("Disassembly" . gdb-frame-assembler-buffer))
-  (define-key menu [breakpoints]
-    '("Breakpoints" . gdb-frame-breakpoints-buffer))
-  (define-key menu [locals] '("Locals" . gdb-frame-locals-buffer))
-  (define-key menu [frames] '("Stack" . gdb-frame-stack-buffer)))
-
-(let ((menu (make-sparse-keymap "GDB-UI/MI")))
-  (define-key gud-menu-map [ui]
-    `(menu-item (if (eq gud-minor-mode 'gdba) "GDB-UI" "GDB-MI")
-		,menu :visible (memq gud-minor-mode '(gdbmi gdba))))
-  (define-key menu [gdb-customize]
-  '(menu-item "Customize" (lambda () (interactive) (customize-group 'gdb))
-	      :help "Customize Gdb Graphical Mode options."))
-  (define-key menu [gdb-find-source-frame]
-  '(menu-item "Look For Source Frame" gdb-find-source-frame
-	      :visible (eq gud-minor-mode 'gdba)
-	      :help "Toggle looking for source frame further up call stack."
-	      :button (:toggle . gdb-find-source-frame)))
-  (define-key menu [gdb-use-separate-io]
-  '(menu-item "Separate IO" gdb-use-separate-io-buffer
-	      :visible (eq gud-minor-mode 'gdba)
-	      :help "Toggle separate IO for debugged program."
-	      :button (:toggle . gdb-use-separate-io-buffer)))
-  (define-key menu [gdb-many-windows]
-  '(menu-item "Display Other Windows" gdb-many-windows
-	      :help "Toggle display of locals, stack and breakpoint information."
-	      :button (:toggle . gdb-many-windows)))
-  (define-key menu [gdb-restore-windows]
-  '(menu-item "Restore Window Layout" gdb-restore-windows
-	      :help "Restore standard layout for debug session.")))
-
-(defun gdb-frame-gdb-buffer ()
-  "Display GUD buffer in a new frame."
-  (interactive)
-  (let ((special-display-regexps (append special-display-regexps '(".*")))
-	(special-display-frame-alist
-	 (remove '(menu-bar-lines) (remove '(tool-bar-lines)
-					   gdb-frame-parameters)))
-	(same-window-regexps nil))
-    (display-buffer gud-comint-buffer)))
-
-(defun gdb-display-gdb-buffer ()
-  "Display GUD buffer."
-  (interactive)
-  (let ((same-window-regexps nil))
-    (select-window (display-buffer gud-comint-buffer nil 0))))
-
-(defun gdb-set-window-buffer (name)
-  (set-window-buffer (selected-window) (get-buffer name))
-  (set-window-dedicated-p (selected-window) t))
-
-(defun gdb-setup-windows ()
-  "Layout the window pattern for `gdb-many-windows'."
-  (gdb-display-locals-buffer)
-  (gdb-display-stack-buffer)
-  (delete-other-windows)
-  (gdb-display-breakpoints-buffer)
-  (delete-other-windows)
-  ; Don't dedicate.
-  (pop-to-buffer gud-comint-buffer)
-  (split-window nil ( / ( * (window-height) 3) 4))
-  (split-window nil ( / (window-height) 3))
-  (split-window-horizontally)
-  (other-window 1)
-  (gdb-set-window-buffer (gdb-locals-buffer-name))
-  (other-window 1)
-  (switch-to-buffer
-       (if gud-last-last-frame
-	   (gud-find-file (car gud-last-last-frame))
-	 (if gdb-main-file
-	     (gud-find-file gdb-main-file)
-	   ;; Put buffer list in window if we
-	   ;; can't find a source file.
-	   (list-buffers-noselect))))
-  (setq gdb-source-window (selected-window))
-  (when gdb-use-separate-io-buffer
-    (split-window-horizontally)
-    (other-window 1)
-    (gdb-set-window-buffer
-     (gdb-get-buffer-create 'gdb-inferior-io)))
-  (other-window 1)
-  (gdb-set-window-buffer (gdb-stack-buffer-name))
-  (split-window-horizontally)
-  (other-window 1)
-  (gdb-set-window-buffer (gdb-breakpoints-buffer-name))
-  (other-window 1))
-
-(defun gdb-restore-windows ()
-  "Restore the basic arrangement of windows used by gdba.
-This arrangement depends on the value of `gdb-many-windows'."
-  (interactive)
-  (pop-to-buffer gud-comint-buffer)	;Select the right window and frame.
-    (delete-other-windows)
-  (if gdb-many-windows
-      (gdb-setup-windows)
-    (when (or gud-last-last-frame gdb-show-main)
-      (split-window)
-      (other-window 1)
-      (switch-to-buffer
-       (if gud-last-last-frame
-	   (gud-find-file (car gud-last-last-frame))
-	 (gud-find-file gdb-main-file)))
-      (setq gdb-source-window (selected-window))
-      (other-window 1))))
-
-(defun gdb-reset ()
-  "Exit a debugging session cleanly.
-Kills the gdb buffers, and resets variables and the source buffers."
-  (dolist (buffer (buffer-list))
-    (unless (eq buffer gud-comint-buffer)
-      (with-current-buffer buffer
-	(if (memq gud-minor-mode '(gdbmi gdba))
-	    (if (string-match "\\` ?\\*.+\\*\\'" (buffer-name))
-		(kill-buffer nil)
-	      (gdb-remove-breakpoint-icons (point-min) (point-max) t)
-	      (setq gud-minor-mode nil)
-	      (kill-local-variable 'tool-bar-map)
-	      (kill-local-variable 'gdb-define-alist))))))
-  (setq gdb-overlay-arrow-position nil)
-  (setq overlay-arrow-variable-list
-	(delq 'gdb-overlay-arrow-position overlay-arrow-variable-list))
-  (setq fringe-indicator-alist '((overlay-arrow . right-triangle)))
-  (setq gdb-stack-position nil)
-  (setq overlay-arrow-variable-list
-	(delq 'gdb-stack-position overlay-arrow-variable-list))
-  (if (boundp 'speedbar-frame) (speedbar-timer-fn))
-  (setq gud-running nil)
-  (setq gdb-active-process nil)
-  (setq gdb-var-list nil)
-  (remove-hook 'after-save-hook 'gdb-create-define-alist t))
-
-(defun gdb-source-info ()
-  "Find the source file where the program starts and display it with related
-buffers."
-  (goto-char (point-min))
-  (if (and (search-forward "Located in " nil t)
-	   (looking-at "\\S-+"))
-      (setq gdb-main-file (match-string 0)))
-  (goto-char (point-min))
-  (if (search-forward "Includes preprocessor macro info." nil t)
-      (setq gdb-macro-info t))
-  (if gdb-many-windows
-      (gdb-setup-windows)
-   (gdb-get-buffer-create 'gdb-breakpoints-buffer)
-   (if (and gdb-show-main gdb-main-file)
-       (let ((pop-up-windows t))
-	 (display-buffer (gud-find-file gdb-main-file)))))
- (setq gdb-ready t))
-
-(defun gdb-get-location (bptno line flag)
-  "Find the directory containing the relevant source file.
-Put in buffer and place breakpoint icon."
-  (goto-char (point-min))
-  (catch 'file-not-found
-    (if (search-forward "Located in " nil t)
-	(when (looking-at "\\S-+")
-	  (delete (cons bptno "File not found") gdb-location-alist)
-	  (push (cons bptno (match-string 0)) gdb-location-alist))
-      (gdb-resync)
-      (unless (assoc bptno gdb-location-alist)
-	(push (cons bptno "File not found") gdb-location-alist)
-	(message-box "Cannot find source file for breakpoint location.\n\
-Add directory to search path for source files using the GDB command, dir."))
-      (throw 'file-not-found nil))
-    (with-current-buffer
-	(find-file-noselect (match-string 0))
-      (gdb-init-buffer)
-      ;; only want one breakpoint icon at each location
-      (save-excursion
-	(goto-char (point-min))
-	(forward-line (1- (string-to-number line)))
-	(gdb-put-breakpoint-icon (eq flag ?y) bptno)))))
-
-(add-hook 'find-file-hook 'gdb-find-file-hook)
-
-(defun gdb-find-file-hook ()
-  "Set up buffer for debugging if file is part of the source code
-of the current session."
-  (if (and (buffer-name gud-comint-buffer)
-	   ;; in case gud or gdb-ui is just loaded
-	   gud-comint-buffer
-	   (memq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
-	       '(gdba gdbmi)))
-      ;;Pre GDB 6.3 "info sources" doesn't give absolute file name.
-      (if (member (if (string-equal gdb-version "pre-6.4")
-		      (file-name-nondirectory buffer-file-name)
-		    buffer-file-name)
-		  gdb-source-file-list)
-	  (with-current-buffer (find-buffer-visiting buffer-file-name)
-	    (gdb-init-buffer)))))
-
-;;from put-image
-(defun gdb-put-string (putstring pos &optional dprop &rest sprops)
-  "Put string PUTSTRING in front of POS in the current buffer.
-PUTSTRING is displayed by putting an overlay into the current buffer with a
-`before-string' string that has a `display' property whose value is
-PUTSTRING."
-  (let ((string (make-string 1 ?x))
-	(buffer (current-buffer)))
-    (setq putstring (copy-sequence putstring))
-    (let ((overlay (make-overlay pos pos buffer))
-	  (prop (or dprop
-		    (list (list 'margin 'left-margin) putstring))))
-      (put-text-property 0 1 'display prop string)
-      (if sprops
-	  (add-text-properties 0 1 sprops string))
-      (overlay-put overlay 'put-break t)
-      (overlay-put overlay 'before-string string))))
-
-;;from remove-images
-(defun gdb-remove-strings (start end &optional buffer)
-  "Remove strings between START and END in BUFFER.
-Remove only strings that were put in BUFFER with calls to `gdb-put-string'.
-BUFFER nil or omitted means use the current buffer."
-  (unless buffer
-    (setq buffer (current-buffer)))
-  (dolist (overlay (overlays-in start end))
-    (when (overlay-get overlay 'put-break)
-	  (delete-overlay overlay))))
-
-(defun gdb-put-breakpoint-icon (enabled bptno)
-  (if (string-match "[0-9+]+\\." bptno)
-      (setq enabled gdb-parent-bptno-enabled))
-  (let ((start (- (line-beginning-position) 1))
-	(end (+ (line-end-position) 1))
-	(putstring (if enabled "B" "b"))
-	(source-window (get-buffer-window (current-buffer) 0)))
-    (add-text-properties
-     0 1 '(help-echo "mouse-1: clear bkpt, mouse-3: enable/disable bkpt")
-     putstring)
-    (if enabled
-	(add-text-properties
-	 0 1 `(gdb-bptno ,bptno gdb-enabled t) putstring)
-      (add-text-properties
-       0 1 `(gdb-bptno ,bptno gdb-enabled nil) putstring))
-    (gdb-remove-breakpoint-icons start end)
-    (if (display-images-p)
-	(if (>= (or left-fringe-width
-		    (if source-window (car (window-fringes source-window)))
-		    gdb-buffer-fringe-width) 8)
-	    (gdb-put-string
-	     nil (1+ start)
-	     `(left-fringe breakpoint
-			   ,(if enabled
-				'breakpoint-enabled
-			      'breakpoint-disabled))
-	     'gdb-bptno bptno
-	     'gdb-enabled enabled)
-	  (when (< left-margin-width 2)
-	    (save-current-buffer
-	      (setq left-margin-width 2)
-	      (if source-window
-		  (set-window-margins
-		   source-window
-		   left-margin-width right-margin-width))))
-	  (put-image
-	   (if enabled
-	       (or breakpoint-enabled-icon
-		   (setq breakpoint-enabled-icon
-			 (find-image `((:type xpm :data
-					      ,breakpoint-xpm-data
-					      :ascent 100 :pointer hand)
-				       (:type pbm :data
-					      ,breakpoint-enabled-pbm-data
-					      :ascent 100 :pointer hand)))))
-	     (or breakpoint-disabled-icon
-		 (setq breakpoint-disabled-icon
-		       (find-image `((:type xpm :data
-					    ,breakpoint-xpm-data
-					    :conversion disabled
-					    :ascent 100 :pointer hand)
-				     (:type pbm :data
-					    ,breakpoint-disabled-pbm-data
-					    :ascent 100 :pointer hand))))))
-	   (+ start 1)
-	   putstring
-	   'left-margin))
-      (when (< left-margin-width 2)
-	(save-current-buffer
-	  (setq left-margin-width 2)
-	  (let ((window (get-buffer-window (current-buffer) 0)))
-	    (if window
-		(set-window-margins
-		 window left-margin-width right-margin-width)))))
-      (gdb-put-string
-       (propertize putstring
-		   'face (if enabled 'breakpoint-enabled 'breakpoint-disabled))
-       (1+ start)))))
-
-(defun gdb-remove-breakpoint-icons (start end &optional remove-margin)
-  (gdb-remove-strings start end)
-  (if (display-images-p)
-      (remove-images start end))
-  (when remove-margin
-    (setq left-margin-width 0)
-    (let ((window (get-buffer-window (current-buffer) 0)))
-      (if window
-	  (set-window-margins
-	   window left-margin-width right-margin-width)))))
-
-
-;;
-;; Assembler buffer.
-;;
-(gdb-set-buffer-rules 'gdb-assembler-buffer
-		      'gdb-assembler-buffer-name
-		      'gdb-assembler-mode)
-
-;; We can't use def-gdb-auto-update-handler because we don't want to use
-;; window-start but keep the overlay arrow/current line visible.
-(defun gdb-assembler-handler ()
-  (setq gdb-pending-triggers
-	(delq 'gdb-invalidate-assembler
-	      gdb-pending-triggers))
-  (let ((buf (gdb-get-buffer 'gdb-partial-output-buffer)))
-    (with-current-buffer buf
-      (goto-char (point-min))
-      ;; The disassemble command in GDB 7.1 onwards displays an overlay arrow.
-      (while (re-search-forward "\\(^   0x\\|=> 0x\\)" nil t)
-	(replace-match "0x" nil nil))))
-  (let ((buf (gdb-get-buffer 'gdb-assembler-buffer)))
-    (and buf
-	 (with-current-buffer buf
-	   (let* ((window (get-buffer-window buf 0))
-		  (p (window-point window))
-		  (buffer-read-only nil))
-	     (erase-buffer)
-	     (insert-buffer-substring (gdb-get-buffer-create
-					  'gdb-partial-output-buffer))
-	     (set-window-point window p)))))
-  ;; put customisation here
-  (gdb-assembler-custom))
-
-(defun gdb-assembler-custom ()
-  (let ((buffer (gdb-get-buffer 'gdb-assembler-buffer))
-	(pos 1) (address) (flag) (bptno))
-    (with-current-buffer buffer
-      (save-excursion
-	(if (not (equal gdb-pc-address "main"))
-	    (progn
-	      (goto-char (point-min))
-	      (if (and gdb-pc-address
-		       (search-forward gdb-pc-address nil t))
-		  (progn
-		    (setq pos (point))
-		    (beginning-of-line)
-		    (setq fringe-indicator-alist
-			  (if (string-equal gdb-frame-number "0")
-			      nil
-			    '((overlay-arrow . hollow-right-triangle))))
-		    (or gdb-overlay-arrow-position
-			(setq gdb-overlay-arrow-position (make-marker)))
-		    (set-marker gdb-overlay-arrow-position (point))))))
-	;; remove all breakpoint-icons in assembler buffer before updating.
-	(gdb-remove-breakpoint-icons (point-min) (point-max))))
-    (with-current-buffer (gdb-get-buffer 'gdb-breakpoints-buffer)
-      (goto-char (point-min))
-      (while (< (point) (- (point-max) 1))
-	(forward-line 1)
-	(when (looking-at
-	       "\\([0-9]+\\.?[0-9]*\\).*?\\s-+\\(.\\)\\s-+0x0*\\(\\S-+\\)")
-	  (setq bptno (match-string 1))
-	  (setq flag (char-after (match-beginning 2)))
-	  (setq address (match-string 3))
-	  (with-current-buffer buffer
-	    (save-excursion
-	      (goto-char (point-min))
-	      (if (re-search-forward (concat "^0x0*" address) nil t)
-		  (gdb-put-breakpoint-icon (eq flag ?y) bptno)))))))
-    (if (not (equal gdb-pc-address "main"))
-	(with-current-buffer buffer
-	  (set-window-point (get-buffer-window buffer 0) pos)))))
-
-(defvar gdb-assembler-mode-map
-  (let ((map (make-sparse-keymap)))
-    (suppress-keymap map)
-    (define-key map "q" 'kill-this-buffer)
-     map))
-
-(defvar gdb-assembler-font-lock-keywords
-  '(;; <__function.name+n>
-    ("<\\(\\(\\sw\\|[_.]\\)+\\)\\(\\+[0-9]+\\)?>"
-     (1 font-lock-function-name-face))
-    ;; 0xNNNNNNNN <__function.name+n>: opcode
-    ("^0x[0-9a-f]+ \\(<\\(\\(\\sw\\|[_.]\\)+\\)\\+[0-9]+>\\)?:[ \t]+\\(\\sw+\\)"
-     (4 font-lock-keyword-face))
-    ;; %register(at least i386)
-    ("%\\sw+" . font-lock-variable-name-face)
-    ("^\\(Dump of assembler code for function\\) \\(.+\\):"
-     (1 font-lock-comment-face)
-     (2 font-lock-function-name-face))
-    ("^\\(End of assembler dump\\.\\)" . font-lock-comment-face))
-  "Font lock keywords used in `gdb-assembler-mode'.")
-
-(defun gdb-assembler-mode ()
-  "Major mode for viewing code assembler.
-
-\\{gdb-assembler-mode-map}"
-  (kill-all-local-variables)
-  (setq major-mode 'gdb-assembler-mode)
-  (setq mode-name (concat "Machine:" gdb-selected-frame))
-  (setq gdb-overlay-arrow-position nil)
-  (add-to-list 'overlay-arrow-variable-list 'gdb-overlay-arrow-position)
-  (setq fringes-outside-margins t)
-  (setq buffer-read-only t)
-  (buffer-disable-undo)
-  (gdb-thread-identification)
-  (use-local-map gdb-assembler-mode-map)
-  (gdb-invalidate-assembler)
-  (set (make-local-variable 'font-lock-defaults)
-       '(gdb-assembler-font-lock-keywords))
-  (run-mode-hooks 'gdb-assembler-mode-hook)
-  'gdb-invalidate-assembler)
-
-(defun gdb-assembler-buffer-name ()
-  (with-current-buffer gud-comint-buffer
-    (concat "*disassembly of " (gdb-get-target-string) "*")))
-
-(defun gdb-display-assembler-buffer ()
-  "Display disassembly view."
-  (interactive)
-  (setq gdb-previous-frame nil)
-  (gdb-display-buffer
-   (gdb-get-buffer-create 'gdb-assembler-buffer) t))
-
-(defun gdb-frame-assembler-buffer ()
-  "Display disassembly view in a new frame."
-  (interactive)
-  (setq gdb-previous-frame nil)
-  (let ((special-display-regexps (append special-display-regexps '(".*")))
-	(special-display-frame-alist gdb-frame-parameters))
-    (display-buffer (gdb-get-buffer-create 'gdb-assembler-buffer))))
-
-;; modified because if gdb-pc-address has changed value a new command
-;; must be enqueued to update the buffer with the new output
-(defun gdb-invalidate-assembler (&optional ignored)
-  (if (gdb-get-buffer 'gdb-assembler-buffer)
-      (progn
-	(unless (and gdb-selected-frame
-		     (string-equal gdb-selected-frame gdb-previous-frame))
-	  (if (or (not (member 'gdb-invalidate-assembler
-			       gdb-pending-triggers))
-		  (not (equal (string-to-number gdb-pc-address)
-			      (string-to-number
-			       gdb-previous-frame-pc-address))))
-	  (progn
-	    ;; take previous disassemble command, if any, off the queue
-	    (with-current-buffer gud-comint-buffer
-	      (let ((queue gdb-input-queue))
-		(dolist (item queue)
-		  (if (equal (cdr item) '(gdb-assembler-handler))
-		      (setq gdb-input-queue
-			    (delete item gdb-input-queue))))))
-	    (gdb-enqueue-input
-	     (list
-	      (concat gdb-server-prefix "disassemble " gdb-pc-address "\n")
-		   'gdb-assembler-handler))
-	    (push 'gdb-invalidate-assembler gdb-pending-triggers)
-	    (setq gdb-previous-frame-pc-address gdb-pc-address)
-	    (setq gdb-previous-frame gdb-selected-frame)))))))
-
-(defun gdb-get-selected-frame ()
-  (if (not (member 'gdb-get-selected-frame gdb-pending-triggers))
-      (progn
-	(if (string-equal gdb-version "pre-6.4")
-	    (gdb-enqueue-input
-	     (list (concat gdb-server-prefix "info frame\n")
-		   'gdb-frame-handler))
-	  (gdb-enqueue-input
-	    (list "server interpreter mi -stack-info-frame\n"
-		  'gdb-frame-handler-1)))
-	(push 'gdb-get-selected-frame gdb-pending-triggers))))
-
-(defun gdb-frame-handler ()
-  (setq gdb-pending-triggers
-	(delq 'gdb-get-selected-frame gdb-pending-triggers))
-  (goto-char (point-min))
-  (when (re-search-forward
-       "Stack level \\([0-9]+\\), frame at \\(0x[[:xdigit:]]+\\)" nil t)
-    (setq gdb-frame-number (match-string 1))
-    (setq gdb-frame-address (match-string 2)))
-  (goto-char (point-min))
-  (when (re-search-forward ".*=\\s-+\\(\\S-*\\)\\s-+in\\s-+\\(.*?\\)\
-\\(?: (\\(\\S-+?\\):[0-9]+?)\\)*; "
-     nil t)
-    (setq gdb-selected-frame (match-string 2))
-    (if (gdb-get-buffer 'gdb-locals-buffer)
-	(with-current-buffer (gdb-get-buffer 'gdb-locals-buffer)
-	  (setq mode-name (concat "Locals:" gdb-selected-frame))))
-    (if (gdb-get-buffer 'gdb-assembler-buffer)
-	(with-current-buffer (gdb-get-buffer 'gdb-assembler-buffer)
-	  (setq mode-name (concat "Machine:" gdb-selected-frame))))
-    (setq gdb-pc-address (match-string 1))
-    (if (and (match-string 3) gud-overlay-arrow-position)
-      (let ((buffer (marker-buffer gud-overlay-arrow-position))
-	    (position (marker-position gud-overlay-arrow-position)))
-	(when (and buffer
-		   (string-equal (file-name-nondirectory
-				  (buffer-file-name buffer))
-				 (file-name-nondirectory (match-string 3))))
-	  (with-current-buffer buffer
-	    (setq fringe-indicator-alist
-		  (if (string-equal gdb-frame-number "0")
-		      nil
-		    '((overlay-arrow . hollow-right-triangle))))
-	    (set-marker gud-overlay-arrow-position position))))))
-  (goto-char (point-min))
-  (if (re-search-forward " source language \\(\\S-+\\)\." nil t)
-      (setq gdb-current-language (match-string 1)))
-  (gdb-invalidate-assembler))
-
-
-;; Code specific to GDB 6.4
-(defconst gdb-source-file-regexp-1 "fullname=\"\\(.*?\\)\"")
-
-(defun gdb-set-gud-minor-mode-existing-buffers-1 ()
-  "Create list of source files for current GDB session.
-If buffers already exist for any of these files, `gud-minor-mode'
-is set in them."
-  (goto-char (point-min))
-  (while (re-search-forward gdb-source-file-regexp-1 nil t)
-    (push (match-string 1) gdb-source-file-list))
-  (dolist (buffer (buffer-list))
-    (with-current-buffer buffer
-      (when (member buffer-file-name gdb-source-file-list)
-	(gdb-init-buffer))))
-  (gdb-force-mode-line-update
-   (propertize "ready" 'face font-lock-variable-name-face)))
-
-;; Used for -stack-info-frame but could be used for -stack-list-frames too.
-(defconst gdb-stack-list-frames-regexp
-".*?level=\"\\(.*?\\)\".*?,addr=\"\\(.*?\\)\".*?,func=\"\\(.*?\\)\",\
-\\(?:.*?file=\".*?\".*?,fullname=\"\\(.*?\\)\".*?,line=\"\\(.*?\\)\".*?}\\|\
-from=\"\\(.*?\\)\"\\)")
-
-(defun gdb-frame-handler-1 ()
-  (setq gdb-pending-triggers
-	(delq 'gdb-get-selected-frame gdb-pending-triggers))
-  (goto-char (point-min))
-    (when (re-search-forward gdb-stack-list-frames-regexp nil t)
-      (setq gdb-frame-number (match-string 1))
-      (setq gdb-pc-address (match-string 2))
-      (setq gdb-selected-frame (match-string 3))
-      (if (gdb-get-buffer 'gdb-locals-buffer)
-	  (with-current-buffer (gdb-get-buffer 'gdb-locals-buffer)
-	    (setq mode-name (concat "Locals:" gdb-selected-frame))))
-      (if (gdb-get-buffer 'gdb-assembler-buffer)
-	  (with-current-buffer (gdb-get-buffer 'gdb-assembler-buffer)
-	    (setq mode-name (concat "Machine:" gdb-selected-frame)))))
-    (if (and (match-string 4) (match-string 5) gud-overlay-arrow-position)
-	(let ((buffer (marker-buffer gud-overlay-arrow-position))
-	      (position (marker-position gud-overlay-arrow-position)))
-	  (when (and buffer
-		     (string-equal (file-name-nondirectory
-				    (buffer-file-name buffer))
-				   (file-name-nondirectory (match-string 4))))
-	    (with-current-buffer buffer
-	      (setq fringe-indicator-alist
-		    (if (string-equal gdb-frame-number "0")
-			nil
-		      '((overlay-arrow . hollow-right-triangle))))
-	      (set-marker gud-overlay-arrow-position position)))))
-  (gdb-invalidate-assembler))
-
-; Uses "-var-list-children --all-values".  Needs GDB 6.4 onwards.
-(defun gdb-var-list-children-1 (varnum)
-  (gdb-enqueue-input
-   (list
-    (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
-	(concat "server interpreter mi \"-var-list-children --all-values \\\""
-		varnum "\\\"\"\n")
-      (concat "-var-list-children --all-values \"" varnum "\"\n"))
-    `(lambda () (gdb-var-list-children-handler-1 ,varnum)))))
-
-(defun gdb-var-list-children-handler-1 (varnum)
-  (let* ((var-list nil)
-	 (output (bindat-get-field (gdb-json-partial-output "child")))
-	 (children (bindat-get-field output 'children)))
-   (catch 'child-already-watched
-      (dolist (var gdb-var-list)
-	(if (string-equal varnum (car var))
-	    (progn
-	      ;; With dynamic varobjs numchild may have increased.
-	      (setcar (nthcdr 2 var) (bindat-get-field output 'numchild))
-	      (push var var-list)
-	      (dolist (child children)
-		(let ((varchild (list (bindat-get-field child 'name)
-				      (bindat-get-field child 'exp)
-				      (bindat-get-field child 'numchild)
-				      (bindat-get-field child 'type)
-				      (bindat-get-field child 'value)
-				      nil
-				      (bindat-get-field child 'has_more))))
-		  (if (assoc (car varchild) gdb-var-list)
-		      (throw 'child-already-watched nil))
-		  (push varchild var-list))))
-	  (push var var-list)))
-      (setq gdb-var-list (nreverse var-list))))
-  (gdb-speedbar-update))
-
-; Uses "-var-update --all-values".  Needs GDB 6.4 onwards.
-(defun gdb-var-update-1 ()
-  (if (not (member 'gdb-var-update gdb-pending-triggers))
-      (progn
-	(gdb-enqueue-input
-	 (list
-	  (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
-	      "server interpreter mi \"-var-update --all-values *\"\n"
-	    "-var-update --all-values *\n")
-	  'gdb-var-update-handler-1))
-	(push 'gdb-var-update gdb-pending-triggers))))
-
-(defun gdb-var-update-handler-1 ()
-  (let ((changelist (bindat-get-field (gdb-json-partial-output) 'changelist)))
-    (dolist (var gdb-var-list)
-      (setcar (nthcdr 5 var) nil))
-    (let ((temp-var-list gdb-var-list))
-      (dolist (change changelist)
-	(let* ((varnum (bindat-get-field change 'name))
-	       (var (assoc varnum gdb-var-list))
-	       (new-num (bindat-get-field change 'new_num_children)))
-	  (when var
-	    (let ((scope (bindat-get-field change 'in_scope))
-		  (has-more (bindat-get-field change 'has_more)))
-	      (cond ((string-equal scope "false")
-		     (if gdb-delete-out-of-scope
-			 (gdb-var-delete-1 var varnum)
-		       (setcar (nthcdr 5 var) 'out-of-scope)))
-		    ((string-equal scope "true")
-		     (setcar (nthcdr 6 var) has-more)
-		     (when (and (or (not has-more)
-				    (string-equal has-more "0"))
-				(not new-num)
-				(string-equal (nth 2 var) "0"))
-		       (setcar (nthcdr 4 var)
-			       (bindat-get-field change 'value))
-		       (setcar (nthcdr 5 var) 'changed)))
-		    ((string-equal scope "invalid")
-		     (gdb-var-delete-1 var varnum)))))
-	  (let ((var-list nil) var1
-		(children (bindat-get-field change 'new_children)))
-	    (if new-num
-		(progn
-		  (setq var1 (pop temp-var-list))
-		  (while var1
-		    (if (string-equal varnum (car var1))
-			(let ((new (string-to-number new-num))
-			      (previous (string-to-number (nth 2 var1))))
-			  (setcar (nthcdr 2 var1) new-num)
-			  (push var1 var-list)
-			  (cond ((> new previous)
-				 ;; Add new children to list.
-				 (dotimes (dummy previous)
-				   (push (pop temp-var-list) var-list))
-				 (dolist (child children)
-				   (let ((varchild
-					  (list (bindat-get-field child 'name)
-						(bindat-get-field child 'exp)
-						(bindat-get-field child 'numchild)
-						(bindat-get-field child 'type)
-						(bindat-get-field child 'value)
-						'changed
-						(bindat-get-field child 'has_more))))
-				     (push varchild var-list))))
-				;; Remove deleted children from list.
-				((< new previous)
-				 (dotimes (dummy new)
-				     (push (pop temp-var-list) var-list))
-				 (dotimes (dummy (- previous new))
-				     (pop temp-var-list)))))
-		      (push var1 var-list))
-		    (setq var1 (pop temp-var-list)))
-		  (setq gdb-var-list (nreverse var-list)))))))))
-  (setq gdb-pending-triggers
-	(delq 'gdb-var-update gdb-pending-triggers))
-  (gdb-speedbar-update))
-
-;; Registers buffer.
-;;
-(gdb-set-buffer-rules 'gdb-registers-buffer
-		      'gdb-registers-buffer-name
-		      'gdb-registers-mode)
-
-(def-gdb-auto-update-trigger gdb-invalidate-registers-1
-  (gdb-get-buffer 'gdb-registers-buffer)
-  (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
-      "server interpreter mi \"-data-list-register-values x\"\n"
-    "-data-list-register-values x\n")
-    gdb-data-list-register-values-handler)
-
-(defconst gdb-data-list-register-values-regexp
-  "{.*?number=\"\\(.*?\\)\".*?,value=\"\\(.*?\\)\".*?}")
-
-(defun gdb-data-list-register-values-handler ()
-  (setq gdb-pending-triggers (delq 'gdb-invalidate-registers-1
-				   gdb-pending-triggers))
-  (goto-char (point-min))
-  (if (re-search-forward gdb-error-regexp nil t)
-      (let ((err (match-string 1)))
-	(with-current-buffer (gdb-get-buffer 'gdb-registers-buffer)
-	  (let ((buffer-read-only nil))
-	    (erase-buffer)
-	    (put-text-property 0 (length err) 'face font-lock-warning-face err)
-	    (insert err)
-	    (goto-char (point-min)))))
-    (let ((register-list (reverse gdb-register-names))
-	  (register nil) (register-string nil) (register-values nil))
-      (goto-char (point-min))
-      (while (re-search-forward gdb-data-list-register-values-regexp nil t)
-	(setq register (pop register-list))
-	(setq register-string (concat register "\t" (match-string 2) "\n"))
-	(if (member (match-string 1) gdb-changed-registers)
-	    (put-text-property 0 (length register-string)
-			       'face 'font-lock-warning-face
-			       register-string))
-	(setq register-values
-	      (concat register-values register-string)))
-      (let ((buf (gdb-get-buffer 'gdb-registers-buffer)))
-	(with-current-buffer buf
-	  (let* ((window (get-buffer-window buf 0))
-		 (start (window-start window))
-		 (p (if window (window-point window) (point)))
-		 (buffer-read-only nil))
-	    (erase-buffer)
-	    (insert register-values)
-	    (if window
-		(progn
-		  (set-window-start window start)
-		  (set-window-point window p))
-	      (goto-char p)))))))
-  (gdb-data-list-register-values-custom))
-
-(defun gdb-data-list-register-values-custom ()
-  (with-current-buffer (gdb-get-buffer 'gdb-registers-buffer)
-    (save-excursion
-      (let ((buffer-read-only nil)
-	    start end)
-	(goto-char (point-min))
-	(while (< (point) (point-max))
-	  (setq start (line-beginning-position))
-	  (setq end (line-end-position))
-	  (when (looking-at "^[^\t]+")
-	    (unless (string-equal (match-string 0) "No registers.")
-	      (put-text-property start (match-end 0)
-				 'face font-lock-variable-name-face)
-	      (add-text-properties start end
-		                   '(help-echo "mouse-2: edit value"
-				     mouse-face highlight))))
-	  (forward-line 1))))))
-
-;; Needs GDB 6.4 onwards (used to fail with no stack).
-(defun gdb-get-changed-registers ()
-  (if (and (gdb-get-buffer 'gdb-registers-buffer)
-	   (not (member 'gdb-get-changed-registers gdb-pending-triggers)))
-      (progn
-	(gdb-enqueue-input
-	 (list
-	  (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
-	      "server interpreter mi -data-list-changed-registers\n"
-	    "-data-list-changed-registers\n")
-	  'gdb-get-changed-registers-handler))
-	(push 'gdb-get-changed-registers gdb-pending-triggers))))
-
-(defconst gdb-data-list-register-names-regexp "\"\\(.*?\\)\"")
-
-(defun gdb-get-changed-registers-handler ()
-  (setq gdb-pending-triggers
-	(delq 'gdb-get-changed-registers gdb-pending-triggers))
-  (setq gdb-changed-registers nil)
-  (goto-char (point-min))
-  (while (re-search-forward gdb-data-list-register-names-regexp nil t)
-    (push (match-string 1) gdb-changed-registers)))
-
-
-;; Locals buffer.
-;;
-;; uses "-stack-list-locals --simple-values".  Needs GDB 6.1 onwards.
-(gdb-set-buffer-rules 'gdb-locals-buffer
-		      'gdb-locals-buffer-name
-		      'gdb-locals-mode)
-
-(def-gdb-auto-update-trigger gdb-invalidate-locals-1
-  (gdb-get-buffer 'gdb-locals-buffer)
-  (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
-      "server interpreter mi -\"stack-list-locals --simple-values\"\n"
-    "-stack-list-locals --simple-values\n")
-  gdb-stack-list-locals-handler)
-
-(defconst gdb-stack-list-locals-regexp
-  "{.*?name=\"\\(.*?\\)\".*?,type=\"\\(.*?\\)\"")
-
-(defvar gdb-locals-watch-map-1
-  (let ((map (make-sparse-keymap)))
-    (suppress-keymap map)
-    (define-key map "\r" 'gud-watch)
-    (define-key map [mouse-2] 'gud-watch)
-    map)
-  "Keymap to create watch expression of a complex data type local variable.")
-
-(defvar gdb-edit-locals-map-1
-  (let ((map (make-sparse-keymap)))
-    (suppress-keymap map)
-    (define-key map "\r" 'gdb-edit-locals-value)
-    (define-key map [mouse-2] 'gdb-edit-locals-value)
-    map)
-  "Keymap to edit value of a simple data type local variable.")
-
-(defun gdb-edit-locals-value (&optional event)
-  "Assign a value to a variable displayed in the locals buffer."
-  (interactive (list last-input-event))
-  (save-excursion
-    (if event (posn-set-point (event-end event)))
-    (beginning-of-line)
-    (let* ((var (current-word))
-	   (value (read-string (format "New value (%s): " var))))
-      (gdb-enqueue-input
-       (list (concat  gdb-server-prefix "set variable " var " = " value "\n")
-	     'ignore)))))
-
-;; Dont display values of arrays or structures.
-;; These can be expanded using gud-watch.
-(defun gdb-stack-list-locals-handler ()
-  (setq gdb-pending-triggers (delq 'gdb-invalidate-locals-1
-				  gdb-pending-triggers))
-  (goto-char (point-min))
-  (if (re-search-forward gdb-error-regexp nil t)
-      (let ((err (match-string 1)))
-	(with-current-buffer (gdb-get-buffer 'gdb-locals-buffer)
-	  (let ((buffer-read-only nil))
-	    (erase-buffer)
-	    (insert err)
-	    (goto-char (point-min)))))
-    (let (local locals-list)
-      (goto-char (point-min))
-      (while (re-search-forward gdb-stack-list-locals-regexp nil t)
-	(let ((local (list (match-string 1)
-			   (match-string 2)
-			   nil)))
-	  (if (looking-at ",value=\\(\".*\"\\).*?}")
-	      (setcar (nthcdr 2 local) (read (match-string 1))))
-	  (push local locals-list)))
-      (let ((buf (gdb-get-buffer 'gdb-locals-buffer)))
-	(and buf (with-current-buffer buf
-		   (let* ((window (get-buffer-window buf 0))
-			  (start (window-start window))
-			  (p (if window (window-point window) (point)))
-			  (buffer-read-only nil) (name) (value))
-		     (erase-buffer)
-		     (dolist (local locals-list)
-		       (setq name (car local))
-		       (setq value (nth 2 local))
-		       (if (or (not value)
-			       (string-match "^\\0x" value))
-			   (add-text-properties 0 (length name)
-			        `(mouse-face highlight
-			          help-echo "mouse-2: create watch expression"
-			          local-map ,gdb-locals-watch-map-1)
-				name)
-			 (add-text-properties 0 (length value)
-			      `(mouse-face highlight
-			        help-echo "mouse-2: edit value"
-			        local-map ,gdb-edit-locals-map-1)
-			      value))
-		       (insert
-			(concat name "\t" (nth 1 local)
-				"\t" value "\n")))
-		     (if window
-			 (progn
-			   (set-window-start window start)
-			   (set-window-point window p))
-		       (goto-char p)))))))))
-
-(defun gdb-get-register-names ()
-  "Create a list of register names."
-  (goto-char (point-min))
-  (while (re-search-forward gdb-data-list-register-names-regexp nil t)
-    (push (match-string 1) gdb-register-names)))
-
-(provide 'gdb-ui)
-
-;; arch-tag: e9fb00c5-74ef-469f-a088-37384caae352
-;;; gdb-ui.el ends here
--- a/lisp/progmodes/gud.el	Fri Mar 26 08:01:19 2010 +0100
+++ b/lisp/progmodes/gud.el	Thu Apr 01 08:50:44 2010 +0200
@@ -43,10 +43,8 @@
 (require 'comint)
 
 (defvar gdb-active-process)
-(defvar gdb-recording)
 (defvar gdb-define-alist)
 (defvar gdb-macro-info)
-(defvar gdb-server-prefix)
 (defvar gdb-show-changed-values)
 (defvar gdb-source-window)
 (defvar gdb-var-list)
@@ -126,77 +124,52 @@
 		(throw 'info-found nil))))
        nil 0)
       (select-frame (make-frame)))
-    (if (memq gud-minor-mode '(gdbmi gdba))
+    (if (eq gud-minor-mode 'gdbmi)
 	(info "(emacs)GDB Graphical Interface")
       (info "(emacs)Debuggers"))))
 
 (defun gud-tool-bar-item-visible-no-fringe ()
   (not (or (eq (buffer-local-value 'major-mode (window-buffer)) 'speedbar-mode)
-	   (and (memq gud-minor-mode '(gdbmi gdba))
+	   (eq (buffer-local-value 'major-mode (window-buffer)) 'gdb-memory-mode)
+	   (and (eq gud-minor-mode 'gdbmi)
 		(> (car (window-fringes)) 0)))))
 
+(declare-function gdb-gud-context-command "gdb-mi.el")
+
 (defun gud-stop-subjob ()
   (interactive)
   (with-current-buffer gud-comint-buffer
-    (if (string-equal gud-target-name "emacs")
-	(comint-stop-subjob)
-      (if (eq gud-minor-mode 'jdb)
-	  (gud-call "suspend")
-	(comint-interrupt-subjob)))))
+    (cond ((string-equal gud-target-name "emacs")
+           (comint-stop-subjob))
+          ((eq gud-minor-mode 'jdb)
+           (gud-call "suspend"))
+          ((eq gud-minor-mode 'gdbmi)
+           (gud-call (gdb-gud-context-command "-exec-interrupt")))
+          (t 
+           (comint-interrupt-subjob)))))
 
 (easy-mmode-defmap gud-menu-map
   '(([help]     "Info (debugger)" . gud-goto-info)
-    ([rfinish]	menu-item "Reverse Finish Function" gud-rfinish
-                  :enable (not gud-running)
-		  :visible (and gdb-recording
-				(eq gud-minor-mode 'gdba)))
-    ([rstepi]	menu-item "Reverse Step Instruction" gud-rstepi
-                  :enable (not gud-running)
-		  :visible (and gdb-recording
-				(eq gud-minor-mode 'gdba)))
-    ([rnexti]	menu-item "Reverse Next Instruction" gud-rnexti
-                  :enable (not gud-running)
-		  :visible (and gdb-recording
-				(eq gud-minor-mode 'gdba)))
-    ([rstep]	menu-item "Reverse Step Line" gud-rstep
-                  :enable (not gud-running)
-		  :visible (and gdb-recording
-				(eq gud-minor-mode 'gdba)))
-    ([rnext]	menu-item "Reverse Next Line" gud-rnext
-                  :enable (not gud-running)
-		  :visible (and gdb-recording
-				(eq gud-minor-mode 'gdba)))
-    ([rcont]	menu-item "Reverse Continue" gud-rcont
-                  :enable (not gud-running)
-		  :visible (and gdb-recording
-				(eq gud-minor-mode 'gdba)))
-    ([recstart] menu-item "Start Recording" gdb-toggle-recording-1
-		  :visible (and (not gdb-recording)
-				(eq gud-minor-mode 'gdba)))
-    ([recstop] menu-item "Stop Recording" gdb-toggle-recording
-		  :visible (and gdb-recording
-				(eq gud-minor-mode 'gdba)))
     ([tooltips] menu-item "Show GUD tooltips" gud-tooltip-mode
                   :enable (and (not emacs-basic-display)
 			       (display-graphic-p)
 			       (fboundp 'x-show-tip))
 		  :visible (memq gud-minor-mode
-				'(gdbmi gdba dbx sdb xdb pdb))
+				'(gdbmi dbx sdb xdb pdb))
 	          :button (:toggle . gud-tooltip-mode))
     ([refresh]	"Refresh" . gud-refresh)
     ([run]	menu-item "Run" gud-run
                   :enable (not gud-running)
 		  :visible (memq gud-minor-mode '(gdbmi gdb dbx jdb)))
     ([go]	menu-item (if gdb-active-process "Continue" "Run") gud-go
-		  :visible (and (not gud-running)
-				(eq gud-minor-mode 'gdba)))
+		  :visible (and (eq gud-minor-mode 'gdbmi)
+                                (gdb-show-run-p)))
     ([stop]	menu-item "Stop" gud-stop-subjob
-		  :visible (or (not (memq gud-minor-mode '(gdba pdb)))
-			       (and gud-running
-				    (eq gud-minor-mode 'gdba))))
+		  :visible (or (not (memq gud-minor-mode '(gdbmi pdb)))
+			       (gdb-show-stop-p)))
     ([until]	menu-item "Continue to selection" gud-until
                   :enable (not gud-running)
-		  :visible (and (memq gud-minor-mode '(gdbmi gdba gdb perldb))
+		  :visible (and (memq gud-minor-mode '(gdbmi gdb perldb))
 				(gud-tool-bar-item-visible-no-fringe)))
     ([remove]	menu-item "Remove Breakpoint" gud-remove
                   :enable (not gud-running)
@@ -204,50 +177,52 @@
     ([tbreak]	menu-item "Temporary Breakpoint" gud-tbreak
                   :enable (not gud-running)
 		  :visible (memq gud-minor-mode
-				'(gdbmi gdba gdb sdb xdb)))
+				'(gdbmi gdb sdb xdb)))
     ([break]	menu-item "Set Breakpoint" gud-break
                   :enable (not gud-running)
 		  :visible (gud-tool-bar-item-visible-no-fringe))
     ([up]	menu-item "Up Stack" gud-up
 		  :enable (not gud-running)
 		  :visible (memq gud-minor-mode
-				 '(gdbmi gdba gdb dbx xdb jdb pdb)))
+				 '(gdbmi gdb dbx xdb jdb pdb)))
     ([down]	menu-item "Down Stack" gud-down
 		  :enable (not gud-running)
 		  :visible (memq gud-minor-mode
-				 '(gdbmi gdba gdb dbx xdb jdb pdb)))
+				 '(gdbmi gdb dbx xdb jdb pdb)))
     ([pp]	menu-item "Print S-expression" gud-pp
                   :enable (and (not gud-running)
 				  gdb-active-process)
 		  :visible (and (string-equal
 				 (buffer-local-value
 				  'gud-target-name gud-comint-buffer) "emacs")
-				(eq gud-minor-mode 'gdba)))
-    ([print*]	menu-item "Print Dereference" gud-pstar
+				(eq gud-minor-mode 'gdbmi)))
+    ([print*]	menu-item (if (eq gud-minor-mode 'jdb)
+			      "Dump object"
+			    "Print Dereference") gud-pstar
                   :enable (not gud-running)
-		  :visible (memq gud-minor-mode '(gdbmi gdba gdb)))
+		  :visible (memq gud-minor-mode '(gdbmi gdb jdb)))
     ([print]	menu-item "Print Expression" gud-print
                   :enable (not gud-running))
     ([watch]	menu-item "Watch Expression" gud-watch
 		  :enable (not gud-running)
-	  	  :visible (memq gud-minor-mode '(gdbmi gdba)))
+	  	  :visible (eq gud-minor-mode 'gdbmi))
     ([finish]	menu-item "Finish Function" gud-finish
                   :enable (not gud-running)
 		  :visible (memq gud-minor-mode
-				 '(gdbmi gdba gdb xdb jdb pdb)))
+				 '(gdbmi gdb xdb jdb pdb)))
     ([stepi]	menu-item "Step Instruction" gud-stepi
                   :enable (not gud-running)
-		  :visible (memq gud-minor-mode '(gdbmi gdba gdb dbx)))
+		  :visible (memq gud-minor-mode '(gdbmi gdb dbx)))
     ([nexti]	menu-item "Next Instruction" gud-nexti
                   :enable (not gud-running)
-		  :visible (memq gud-minor-mode '(gdbmi gdba gdb dbx)))
+		  :visible (memq gud-minor-mode '(gdbmi gdb dbx)))
     ([step]	menu-item "Step Line" gud-step
                   :enable (not gud-running))
     ([next]	menu-item "Next Line" gud-next
                   :enable (not gud-running))
     ([cont]	menu-item "Continue" gud-cont
                   :enable (not gud-running)
-		  :visible (not (eq gud-minor-mode 'gdba))))
+		  :visible (not (eq gud-minor-mode 'gdbmi))))
   "Menu for `gud-mode'."
   :name "Gud")
 
@@ -269,21 +244,22 @@
 	. (,(propertize "next" 'face 'font-lock-doc-face) . gud-next))
        ([menu-bar until] menu-item
 	,(propertize "until" 'face 'font-lock-doc-face) gud-until
-		  :visible (memq gud-minor-mode '(gdbmi gdba gdb perldb)))
+		  :visible (memq gud-minor-mode '(gdbmi gdb perldb)))
        ([menu-bar cont] menu-item
 	,(propertize "cont" 'face 'font-lock-doc-face) gud-cont
-	:visible (not (eq gud-minor-mode 'gdba)))
+	:visible (not (eq gud-minor-mode 'gdbmi)))
        ([menu-bar run] menu-item
 	,(propertize "run" 'face 'font-lock-doc-face) gud-run
 	:visible (memq gud-minor-mode '(gdbmi gdb dbx jdb)))
        ([menu-bar go] menu-item
 	,(propertize " go " 'face 'font-lock-doc-face) gud-go
-	:visible (and (not gud-running)
-		      (eq gud-minor-mode 'gdba)))
+	:visible (and (eq gud-minor-mode 'gdbmi)
+                      (gdb-show-run-p)))
        ([menu-bar stop] menu-item
 	,(propertize "stop" 'face 'font-lock-doc-face) gud-stop-subjob
-	:visible (and gud-running
-		     (eq gud-minor-mode 'gdba)))
+	:visible (or (and (eq gud-minor-mode 'gdbmi)
+                          (gdb-show-stop-p))
+		     (not (eq gud-minor-mode 'gdbmi))))
        ([menu-bar print]
 	. (,(propertize "print" 'face 'font-lock-doc-face) . gud-print))
        ([menu-bar tools] . undefined)
@@ -322,14 +298,6 @@
 		 (gud-stepi . "gud/stepi")
 		 (gud-up . "gud/up")
 		 (gud-down . "gud/down")
-		 (gdb-toggle-recording-1 . "gud/recstart")
-		 (gdb-toggle-recording . "gud/recstop")
-		 (gud-rcont . "gud/rcont")
-		 (gud-rnext . "gud/rnext")
-		 (gud-rstep . "gud/rstep")
-		 (gud-rfinish . "gud/rfinish")
-		 (gud-rnexti . "gud/rnexti")
-		 (gud-rstepi . "gud/rstepi")
 		 (gud-goto-info . "info"))
 	       map)
       (tool-bar-local-item-from-menu
@@ -354,7 +322,7 @@
 	(setq directories (cdr directories)))
       result)))
 
-(declare-function gdb-create-define-alist "gdb-ui" ())
+(declare-function gdb-create-define-alist "gdb-mi" ())
 
 (defun gud-find-file (file)
   ;; Don't get confused by double slashes in the name that comes from GDB.
@@ -370,7 +338,7 @@
 	(set (make-local-variable 'gud-minor-mode) minor-mode)
 	(set (make-local-variable 'tool-bar-map) gud-tool-bar-map)
 	(when (and gud-tooltip-mode
-		   (memq gud-minor-mode '(gdbmi gdba)))
+		   (eq gud-minor-mode 'gdbmi))
 	  (make-local-variable 'gdb-define-alist)
 	  (unless  gdb-define-alist (gdb-create-define-alist))
 	  (add-hook 'after-save-hook 'gdb-create-define-alist nil t))
@@ -499,21 +467,21 @@
 
 (defvar gud-speedbar-menu-items
   '(["Jump to stack frame" speedbar-edit-line
-     :visible (not (memq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
-		    '(gdbmi gdba)))]
+     :visible (not (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
+		    'gdbmi))]
     ["Edit value" speedbar-edit-line
-     :visible (memq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
-		    '(gdbmi gdba))]
+     :visible (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
+		    'gdbmi)]
     ["Delete expression" gdb-var-delete
-     :visible (memq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
-		    '(gdbmi gdba))]
+     :visible (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
+		    'gdbmi)]
     ["Auto raise frame" gdb-speedbar-auto-raise
      :style toggle :selected gdb-speedbar-auto-raise
-     :visible (memq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
-		    '(gdbmi gdba))]
+     :visible (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
+		    'gdbmi)]
     ("Output Format"
-     :visible (memq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
-		    '(gdbmi gdba))
+     :visible (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
+		    'gdbmi)
      ["Binary" (gdb-var-set-format "binary") t]
      ["Natural" (gdb-var-set-format  "natural") t]
      ["Hexadecimal" (gdb-var-set-format "hexadecimal") t]))
@@ -542,7 +510,7 @@
 	  (start (window-start window))
 	  (p (window-point window)))
       (cond
-       ((memq minor-mode '(gdbmi gdba))
+       ((eq minor-mode 'gdbmi)
 	(erase-buffer)
 	(insert "Watch Expressions:\n")
 	(let ((var-list gdb-var-list) parent)
@@ -632,7 +600,7 @@
 		 (car frame)
 		 'speedbar-file-face
 		 'speedbar-highlight-face
-		 (cond ((memq minor-mode '(gdbmi gdba gdb))
+		 (cond ((memq minor-mode '(gdbmi gdb))
 			'gud-gdb-goto-stackframe)
 		       (t (error "Should never be here")))
 		 frame t))))
@@ -689,8 +657,6 @@
        ;; Set the accumulator to the remaining text.
        gud-marker-acc (substring gud-marker-acc (match-end 0))))
 
-    ;; Check for annotations and change gud-minor-mode to 'gdba if
-    ;; they are found.
     (while (string-match "\n\032\032\\(.*\\)\n" gud-marker-acc)
       (let ((match (match-string 1 gud-marker-acc)))
 
@@ -754,10 +720,10 @@
 (defvar gud-filter-pending-text nil
   "Non-nil means this is text that has been saved for later in `gud-filter'.")
 
-;; If in gdba mode, gdb-ui is loaded.
-(declare-function gdb-restore-windows "gdb-ui" ())
-
-;; The old gdb command (text command mode).  The new one is in gdb-ui.el.
+;; If in gdb mode, gdb-mi is loaded.
+(declare-function gdb-restore-windows "gdb-mi" ())
+
+;; The old gdb command (text command mode).  The new one is in gdb-mi.el.
 ;;;###autoload
 (defun gud-gdb (command-line)
   "Run gdb on program FILE in buffer *gud-FILE*.
@@ -768,10 +734,10 @@
   (when (and gud-comint-buffer
 	   (buffer-name gud-comint-buffer)
 	   (get-buffer-process gud-comint-buffer)
-	   (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba)))
-	(gdb-restore-windows)
-	(error
-	 "Multiple debugging requires restarting in text command mode"))
+	   (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdbmi)))
+    (gdb-restore-windows)
+    (error
+     "Multiple debugging requires restarting in text command mode"))
 
   (gud-common-init command-line nil 'gud-gdb-marker-filter)
   (set (make-local-variable 'gud-minor-mode) 'gdb)
@@ -2642,7 +2608,7 @@
 (defvar gud-overlay-arrow-position nil)
 (add-to-list 'overlay-arrow-variable-list 'gud-overlay-arrow-position)
 
-(declare-function gdb-reset "gdb-ui" ())
+(declare-function gdb-reset "gdb-mi" ())
 
 (defun gud-sentinel (proc msg)
   (cond ((null (buffer-name (process-buffer proc)))
@@ -2654,14 +2620,14 @@
 		  (string-equal speedbar-initial-expansion-list-name "GUD"))
 	     (speedbar-change-initial-expansion-list
 	      speedbar-previously-used-expansion-list-name))
-	 (if (memq gud-minor-mode-type '(gdbmi gdba))
+	 (if (eq gud-minor-mode-type 'gdbmi)
 	     (gdb-reset)
 	   (gud-reset)))
 	((memq (process-status proc) '(signal exit))
 	 ;; Stop displaying an arrow in a source file.
 	 (setq gud-overlay-arrow-position nil)
-	 (if (memq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
-		   '(gdba gdbmi))
+	 (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
+		   'gdbmi)
 	     (gdb-reset)
 	   (gud-reset))
 	 (let* ((obuf (current-buffer)))
@@ -2692,7 +2658,9 @@
 (defun gud-kill-buffer-hook ()
   (setq gud-minor-mode-type gud-minor-mode)
   (condition-case nil
-      (kill-process (get-buffer-process (current-buffer)))
+      (progn
+	(kill-process (get-buffer-process (current-buffer)))
+	(delete-process (get-process "gdb-inferior")))
     (error nil)))
 
 (defun gud-reset ()
@@ -2715,8 +2683,8 @@
 
 (declare-function global-hl-line-highlight  "hl-line" ())
 (declare-function hl-line-highlight         "hl-line" ())
-(declare-function gdb-display-source-buffer "gdb-ui"  (buffer))
-(declare-function gdb-display-buffer "gdb-ui" (buf dedicated &optional size))
+(declare-function gdb-display-source-buffer "gdb-mi"  (buffer))
+(declare-function gdb-display-buffer "gdb-mi" (buf dedicated &optional size))
 
 ;; Make sure the file named TRUE-FILE is in a buffer that appears on the screen
 ;; and that its line LINE is visible.
@@ -2732,7 +2700,7 @@
 	    (gud-find-file true-file)))
 	 (window (and buffer
 		      (or (get-buffer-window buffer)
-			  (if (memq gud-minor-mode '(gdbmi gdba))
+			  (if (eq gud-minor-mode 'gdbmi)
 			      (or (if (get-buffer-window buffer 'visible)
 				      (display-buffer buffer nil 'visible))
 				  (unless (gdb-display-source-buffer buffer)
@@ -2769,7 +2737,7 @@
 		   (goto-char pos))))
 	  (when window
 	    (set-window-point window gud-overlay-arrow-position)
-	    (if (memq gud-minor-mode '(gdbmi gdba))
+	    (if (eq gud-minor-mode 'gdbmi)
 		(setq gdb-source-window window)))))))
 
 ;; The gud-call function must do the right thing whether its invoking
@@ -2875,7 +2843,7 @@
             (forward-line 0))
           (if (looking-at comint-prompt-regexp)
               (set-marker gud-delete-prompt-marker (point)))
-          (if (memq gud-minor-mode '(gdbmi gdba))
+          (if (eq gud-minor-mode 'gdbmi)
               (apply comint-input-sender (list proc command))
             (process-send-string proc (concat command "\n"))))))))
 
@@ -3301,14 +3269,14 @@
   (gud-tooltip-activate-mouse-motions-if-enabled)
   (if (and gud-comint-buffer
 	   (buffer-name gud-comint-buffer); gud-comint-buffer might be killed
-	   (memq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
-		 '(gdbmi gdba)))
+	   (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
+		 'gdbmi))
       (if gud-tooltip-mode
 	  (progn
 	    (dolist (buffer (buffer-list))
 	      (unless (eq buffer gud-comint-buffer)
 		(with-current-buffer buffer
-		  (when (and (memq gud-minor-mode '(gdbmi gdba))
+		  (when (and (eq gud-minor-mode 'gdbmi)
 			     (not (string-match "\\`\\*.+\\*\\'"
 						(buffer-name))))
 		    (make-local-variable 'gdb-define-alist)
@@ -3433,8 +3401,8 @@
 ; Larger arrays (say 400 elements) are displayed in
 ; the tooltip incompletely and spill over into the gud buffer.
 ; Switching the process-filter creates timing problems and
-; it may be difficult to do better. Using annotations as in
-; gdb-ui.el gets round this problem.
+; it may be difficult to do better. Using GDB/MI as in
+; gdb-mi.el gets round this problem.
 (defun gud-tooltip-process-output (process output)
   "Process debugger output and show it in a tooltip window."
   (set-process-filter process gud-tooltip-original-filter)
@@ -3444,12 +3412,12 @@
 (defun gud-tooltip-print-command (expr)
   "Return a suitable command to print the expression EXPR."
   (case gud-minor-mode
-	(gdba (concat "server print " expr))
-	((dbx gdbmi) (concat "print " expr))
+	(gdbmi (concat "-data-evaluate-expression " expr))
+	(dbx (concat "print " expr))
 	((xdb pdb) (concat "p " expr))
 	(sdb (concat expr "/"))))
 
-(declare-function gdb-enqueue-input "gdb-ui" (item))
+(declare-function gdb-input "gdb-mi" (item))
 (declare-function tooltip-expr-to-print "tooltip" (event))
 (declare-function tooltip-event-buffer "tooltip" (event))
 
@@ -3469,12 +3437,12 @@
 	       (buffer-name gud-comint-buffer); might be killed
 	       (setq process (get-buffer-process gud-comint-buffer))
 	       (posn-point (event-end event))
-	       (or (and (eq gud-minor-mode 'gdba) (not gdb-active-process))
+	       (or (and (eq gud-minor-mode 'gdbmi) (not gdb-active-process))
 		   (progn (setq gud-tooltip-event event)
 			  (eval (cons 'and gud-tooltip-display)))))
       (let ((expr (tooltip-expr-to-print event)))
 	(when expr
-	  (if (and (eq gud-minor-mode 'gdba)
+	  (if (and (eq gud-minor-mode 'gdbmi)
 		   (not gdb-active-process))
 	      (progn
 		(with-current-buffer (tooltip-event-buffer event)
@@ -3492,13 +3460,13 @@
 		(message-box "Using GUD tooltips in this mode is unsafe\n\
 so they have been disabled."))
 	      (unless (null cmd) ; CMD can be nil if unknown debugger
-		(if (memq gud-minor-mode '(gdba gdbmi))
+		(if (eq gud-minor-mode 'gdbmi)
 		      (if gdb-macro-info
-			  (gdb-enqueue-input
+			  (gdb-input
 			   (list (concat
-				  gdb-server-prefix "macro expand " expr "\n")
+				  "server macro expand " expr "\n")
 				 `(lambda () (gdb-tooltip-print-1 ,expr))))
-			(gdb-enqueue-input
+			(gdb-input
 			 (list  (concat cmd "\n")
  				 `(lambda () (gdb-tooltip-print ,expr)))))
 		  (setq gud-tooltip-original-filter (process-filter process))
--- a/lisp/progmodes/js.el	Fri Mar 26 08:01:19 2010 +0100
+++ b/lisp/progmodes/js.el	Thu Apr 01 08:50:44 2010 +0200
@@ -436,6 +436,13 @@
   :type 'integer
   :group 'js)
 
+(defcustom js-auto-indent-flag t
+  "Whether to automatically indent when typing punctuation characters.
+If non-nil, the characters {}();,: also indent the current line
+in Javascript mode."
+  :type 'boolean
+  :group 'js)
+
 (defcustom js-flat-functions nil
   "Treat nested functions as top-level functions in `js-mode'.
 This applies to function movement, marking, and so on."
@@ -483,6 +490,9 @@
 
 (defvar js-mode-map
   (let ((keymap (make-sparse-keymap)))
+    (mapc (lambda (key)
+	    (define-key keymap key #'js-insert-and-indent))
+	  '("{" "}" "(" ")" ":" ";" ","))
     (define-key keymap [(control ?c) (meta ?:)] #'js-eval)
     (define-key keymap [(control ?c) (control ?j)] #'js-set-js-context)
     (define-key keymap [(control meta ?x)] #'js-eval-defun)
@@ -498,6 +508,21 @@
     keymap)
   "Keymap for `js-mode'.")
 
+(defun js-insert-and-indent (key)
+  "Run the command bound to KEY, and indent if necessary.
+Indentation does not take place if point is in a string or
+comment."
+  (interactive (list (this-command-keys)))
+  (call-interactively (lookup-key (current-global-map) key))
+  (let ((syntax (save-restriction (widen) (syntax-ppss))))
+    (when (or (and (not (nth 8 syntax))
+                   js-auto-indent-flag)
+              (and (nth 4 syntax)
+                   (eq (current-column)
+                       (1+ (current-indentation)))))
+      (indent-according-to-mode))))
+
+
 ;;; Syntax table and parsing
 
 (defvar js-mode-syntax-table
--- a/lisp/replace.el	Fri Mar 26 08:01:19 2010 +0100
+++ b/lisp/replace.el	Thu Apr 01 08:50:44 2010 +0200
@@ -1005,21 +1005,6 @@
   :group 'matching
   :version "22.1")
 
-(defun occur-accumulate-lines (count &optional keep-props)
-  (save-excursion
-    (let ((forwardp (> count 0))
-	  result beg end)
-      (while (not (or (zerop count)
-		      (if forwardp
-			  (eobp)
-			(bobp))))
-	(setq count (+ count (if forwardp -1 1)))
-	(setq beg (line-beginning-position)
-	      end (line-end-position))
-	(push (occur-engine-line beg end keep-props) result)
-	(forward-line (if forwardp 1 -1)))
-      (nreverse result))))
-
 (defun occur-read-primary-args ()
   (list (read-regexp "List lines matching regexp"
 		     (car regexp-history))
@@ -1028,7 +1013,7 @@
 
 (defun occur-rename-buffer (&optional unique-p interactive-p)
   "Rename the current *Occur* buffer to *Occur: original-buffer-name*.
-Here `original-buffer-name' is the buffer name were Occur was originally run.
+Here `original-buffer-name' is the buffer name where Occur was originally run.
 When given the prefix argument, or called non-interactively, the renaming
 will not clobber the existing buffer(s) of that name, but use
 `generate-new-buffer-name' instead.  You can add this to `occur-hook'
@@ -1173,12 +1158,6 @@
             (set-buffer-modified-p nil)
             (run-hooks 'occur-hook)))))))
 
-(defun occur-engine-add-prefix (lines)
-  (mapcar
-   #'(lambda (line)
-       (concat "       :" line "\n"))
-   lines))
-
 (defun occur-engine (regexp buffers out-buf nlines case-fold-search
 			    title-face prefix-face match-face keep-props)
   (with-current-buffer out-buf
@@ -1189,12 +1168,15 @@
 	(when (buffer-live-p buf)
 	  (let ((matches 0)	;; count of matched lines
 		(lines 1)	;; line count
+		(prev-after-lines nil)	;; context lines of prev match
+		(prev-lines nil)        ;; line number of prev match endpt
 		(matchbeg 0)
 		(origpt nil)
 		(begpt nil)
 		(endpt nil)
 		(marker nil)
 		(curstring "")
+		(ret nil)
 		(inhibit-field-text-motion t)
 		(headerpt (with-current-buffer out-buf (point))))
 	    (with-current-buffer buf
@@ -1271,14 +1253,17 @@
 				;; The simple display style
 				out-line
 			      ;; The complex multi-line display style.
-			      (occur-context-lines out-line nlines keep-props)
-			      )))
+			      (setq ret (occur-context-lines
+					 out-line nlines keep-props begpt endpt
+					 lines prev-lines prev-after-lines))
+			      ;; Set first elem of the returned list to `data',
+			      ;; and the second elem to `prev-after-lines'.
+			      (setq prev-after-lines (nth 1 ret))
+			      (nth 0 ret))))
 		      ;; Actually insert the match display data
 		      (with-current-buffer out-buf
 			(let ((beg (point))
-			      (end (progn (insert data) (point))))
-			  (unless (= nlines 0)
-			    (insert "-------\n")))))
+			      (end (progn (insert data) (point)))))))
 		    (goto-char endpt))
 		  (if endpt
 		      (progn
@@ -1289,7 +1274,13 @@
 				       (if (and (bolp) (eolp)) 1 0)))
 			;; On to the next match...
 			(forward-line 1))
-		    (goto-char (point-max))))))
+		    (goto-char (point-max)))
+		  (setq prev-lines (1- lines)))
+		;; Flush remaining context after-lines.
+		(when prev-after-lines
+		  (with-current-buffer out-buf
+		    (insert (apply #'concat (occur-engine-add-prefix
+					     prev-after-lines)))))))
 	    (when (not (zerop matches)) ;; is the count zero?
 	      (setq globalcount (+ globalcount matches))
 	      (with-current-buffer out-buf
@@ -1342,21 +1333,86 @@
 	str)
     (buffer-substring-no-properties beg end)))
 
+(defun occur-engine-add-prefix (lines)
+  (mapcar
+   #'(lambda (line)
+       (concat "       :" line "\n"))
+   lines))
+
+(defun occur-accumulate-lines (count &optional keep-props pt)
+  (save-excursion
+    (when pt
+      (goto-char pt))
+    (let ((forwardp (> count 0))
+	  result beg end moved)
+      (while (not (or (zerop count)
+		      (if forwardp
+			  (eobp)
+			(and (bobp) (not moved)))))
+	(setq count (+ count (if forwardp -1 1)))
+	(setq beg (line-beginning-position)
+	      end (line-end-position))
+	(push (occur-engine-line beg end keep-props) result)
+	(setq moved (= 0 (forward-line (if forwardp 1 -1)))))
+      (nreverse result))))
+
 ;; Generate context display for occur.
 ;; OUT-LINE is the line where the match is.
 ;; NLINES and KEEP-PROPS are args to occur-engine.
+;; LINES is line count of the current match,
+;; PREV-LINES is line count of the previous match,
+;; PREV-AFTER-LINES is a list of after-context lines of the previous match.
 ;; Generate a list of lines, add prefixes to all but OUT-LINE,
 ;; then concatenate them all together.
-(defun occur-context-lines (out-line nlines keep-props)
-  (apply #'concat
-	 (nconc
-	  (occur-engine-add-prefix
-	   (nreverse (cdr (occur-accumulate-lines
-			   (- (1+ (abs nlines))) keep-props))))
-	  (list out-line)
-	  (if (> nlines 0)
-	      (occur-engine-add-prefix
-	       (cdr (occur-accumulate-lines (1+ nlines) keep-props)))))))
+(defun occur-context-lines (out-line nlines keep-props begpt endpt
+				     lines prev-lines prev-after-lines)
+  ;; Find after- and before-context lines of the current match.
+  (let ((before-lines
+	 (nreverse (cdr (occur-accumulate-lines
+			 (- (1+ (abs nlines))) keep-props begpt))))
+	(after-lines
+	 (cdr (occur-accumulate-lines
+	       (1+ nlines) keep-props endpt)))
+	separator)
+
+    ;; Combine after-lines of the previous match
+    ;; with before-lines of the current match.
+
+    (when prev-after-lines
+      ;; Don't overlap prev after-lines with current before-lines.
+      (if (>= (+ prev-lines (length prev-after-lines))
+	      (- lines      (length before-lines)))
+	  (setq prev-after-lines
+		(butlast prev-after-lines
+			 (- (length prev-after-lines)
+			    (- lines prev-lines (length before-lines) 1))))
+	;; Separate non-overlapping context lines with a dashed line.
+	(setq separator "-------\n")))
+
+    (when prev-lines
+      ;; Don't overlap current before-lines with previous match line.
+      (if (<= (- lines (length before-lines))
+	      prev-lines)
+	  (setq before-lines
+		(nthcdr (- (length before-lines)
+			   (- lines prev-lines 1))
+			before-lines))
+	;; Separate non-overlapping before-context lines.
+	(unless (> nlines 0)
+	  (setq separator "-------\n"))))
+
+    (list
+     ;; Return a list where the first element is the output line.
+     (apply #'concat
+	    (append
+	     (and prev-after-lines
+		  (occur-engine-add-prefix prev-after-lines))
+	     (and separator (list separator))
+	     (occur-engine-add-prefix before-lines)
+	     (list out-line)))
+     ;; And the second element is the list of context after-lines.
+     (if (> nlines 0) after-lines))))
+
 
 ;; It would be nice to use \\[...], but there is no reasonable way
 ;; to make that display both SPC and Y.
--- a/lisp/simple.el	Fri Mar 26 08:01:19 2010 +0100
+++ b/lisp/simple.el	Thu Apr 01 08:50:44 2010 +0200
@@ -3468,17 +3468,18 @@
   (interactive
    (list (read-buffer "Append to buffer: " (other-buffer (current-buffer) t))
 	 (region-beginning) (region-end)))
-  (let ((oldbuf (current-buffer)))
-    (let* ((append-to (get-buffer-create buffer))
-           (windows (get-buffer-window-list append-to t t))
-           point)
+  (let* ((oldbuf (current-buffer))
+         (append-to (get-buffer-create buffer))
+         (windows (get-buffer-window-list append-to t t))
+         point)
+    (save-excursion
       (with-current-buffer append-to
-	(setq point (point))
-	(barf-if-buffer-read-only)
-	(insert-buffer-substring oldbuf start end)
-	(dolist (window windows)
-	  (when (= (window-point window) point)
-	    (set-window-point window (point))))))))
+        (setq point (point))
+        (barf-if-buffer-read-only)
+        (insert-buffer-substring oldbuf start end)
+        (dolist (window windows)
+          (when (= (window-point window) point)
+            (set-window-point window (point))))))))
 
 (defun prepend-to-buffer (buffer start end)
   "Prepend to specified buffer the text of the region.
@@ -4002,9 +4003,10 @@
 	    (insert (if use-hard-newlines hard-newline "\n")))
 	(line-move arg nil nil try-vscroll))
     (if (called-interactively-p 'interactive)
-	(condition-case nil
+	(condition-case err
 	    (line-move arg nil nil try-vscroll)
-	  ((beginning-of-buffer end-of-buffer) (ding)))
+	  ((beginning-of-buffer end-of-buffer)
+	   (signal (car err) (cdr err))))
       (line-move arg nil nil try-vscroll)))
   nil)
 
@@ -4032,9 +4034,10 @@
   (interactive "^p\np")
   (or arg (setq arg 1))
   (if (called-interactively-p 'interactive)
-      (condition-case nil
+      (condition-case err
 	  (line-move (- arg) nil nil try-vscroll)
-	((beginning-of-buffer end-of-buffer) (ding)))
+	((beginning-of-buffer end-of-buffer)
+	 (signal (car err) (cdr err))))
     (line-move (- arg) nil nil try-vscroll))
   nil)
 
@@ -5489,12 +5492,12 @@
 or go back to just one window (by deleting all but the selected window)."
   (interactive)
   (cond ((eq last-command 'mode-exited) nil)
+	((region-active-p)
+	 (deactivate-mark))
 	((> (minibuffer-depth) 0)
 	 (abort-recursive-edit))
 	(current-prefix-arg
 	 nil)
-	((region-active-p)
-	 (deactivate-mark))
 	((> (recursion-depth) 0)
 	 (exit-recursive-edit))
 	(buffer-quit-function
--- a/lisp/subr.el	Fri Mar 26 08:01:19 2010 +0100
+++ b/lisp/subr.el	Thu Apr 01 08:50:44 2010 +0200
@@ -3421,51 +3421,59 @@
 ;; digits of precision, it doesn't really matter here.  On the other
 ;; hand, it greatly simplifies the code.
 
-(defsubst progress-reporter-update (reporter value)
+(defsubst progress-reporter-update (reporter &optional value)
   "Report progress of an operation in the echo area.
-However, if the change since last echo area update is too small
-or not enough time has passed, then do nothing (see
-`make-progress-reporter' for details).
-
-First parameter, REPORTER, should be the result of a call to
-`make-progress-reporter'.  Second, VALUE, determines the actual
-progress of operation; it must be between MIN-VALUE and MAX-VALUE
-as passed to `make-progress-reporter'.
-
-This function is very inexpensive, you may not bother how often
-you call it."
-  (when (>= value (car reporter))
+REPORTER should be the result of a call to `make-progress-reporter'.
+
+If REPORTER is a numerical progress reporter---i.e. if it was
+ made using non-nil MIN-VALUE and MAX-VALUE arguments to
+ `make-progress-reporter'---then VALUE should be a number between
+ MIN-VALUE and MAX-VALUE.
+
+If REPORTER is a non-numerical reporter, VALUE should be nil.
+
+This function is relatively inexpensive.  If the change since
+last update is too small or insufficient time has passed, it does
+nothing."
+  (when (or (not (numberp value))      ; For pulsing reporter
+	    (>= value (car reporter))) ; For numerical reporter
     (progress-reporter-do-update reporter value)))
 
-(defun make-progress-reporter (message min-value max-value
-				       &optional current-value
-				       min-change min-time)
-  "Return progress reporter object to be used with `progress-reporter-update'.
-
-MESSAGE is shown in the echo area.  When at least 1% of operation
-is complete, the exact percentage will be appended to the
-MESSAGE.  When you call `progress-reporter-done', word \"done\"
-is printed after the MESSAGE.  You can change MESSAGE of an
-existing progress reporter with `progress-reporter-force-update'.
-
-MIN-VALUE and MAX-VALUE designate starting (0% complete) and
-final (100% complete) states of operation.  The latter should be
-larger; if this is not the case, then simply negate all values.
-Optional CURRENT-VALUE specifies the progress by the moment you
-call this function.  You should omit it or set it to nil in most
-cases since it defaults to MIN-VALUE.
-
-Optional MIN-CHANGE determines the minimal change in percents to
-report (default is 1%.)  Optional MIN-TIME specifies the minimal
-time before echo area updates (default is 0.2 seconds.)  If
-`float-time' function is not present, then time is not tracked
-at all.  If OS is not capable of measuring fractions of seconds,
-then this parameter is effectively rounded up."
-
+(defun make-progress-reporter (message &optional min-value max-value
+				       current-value min-change min-time)
+  "Return progress reporter object for use with `progress-reporter-update'.
+
+MESSAGE is shown in the echo area, with a status indicator
+appended to the end.  When you call `progress-reporter-done', the
+word \"done\" is printed after the MESSAGE.  You can change the
+MESSAGE of an existing progress reporter by calling
+`progress-reporter-force-update'.
+
+MIN-VALUE and MAX-VALUE, if non-nil, are starting (0% complete)
+and final (100% complete) states of operation; the latter should
+be larger.  In this case, the status message shows the percentage
+progress.
+
+If MIN-VALUE and/or MAX-VALUE is omitted or nil, the status
+message shows a \"spinning\", non-numeric indicator.
+
+Optional CURRENT-VALUE is the initial progress; the default is
+MIN-VALUE.
+Optional MIN-CHANGE is the minimal change in percents to report;
+the default is 1%.
+CURRENT-VALUE and MIN-CHANGE do not have any effect if MIN-VALUE
+and/or MAX-VALUE are nil.
+
+Optional MIN-TIME specifies the minimum interval time between
+echo area updates (default is 0.2 seconds.)  If the function
+`float-time' is not present, time is not tracked at all.  If the
+OS is not capable of measuring fractions of seconds, this
+parameter is effectively rounded up."
   (unless min-time
     (setq min-time 0.2))
   (let ((reporter
-	 (cons min-value ;; Force a call to `message' now
+	 ;; Force a call to `message' now
+	 (cons (or min-value 0)
 	       (vector (if (and (fboundp 'float-time)
 				(>= min-time 0.02))
 			   (float-time) nil)
@@ -3477,12 +3485,11 @@
     (progress-reporter-update reporter (or current-value min-value))
     reporter))
 
-(defun progress-reporter-force-update (reporter value &optional new-message)
+(defun progress-reporter-force-update (reporter &optional value new-message)
   "Report progress of an operation in the echo area unconditionally.
 
-First two parameters are the same as for
-`progress-reporter-update'.  Optional NEW-MESSAGE allows you to
-change the displayed message."
+The first two arguments are the same as in `progress-reporter-update'.
+NEW-MESSAGE, if non-nil, sets a new message for the reporter."
   (let ((parameters (cdr reporter)))
     (when new-message
       (aset parameters 3 new-message))
@@ -3490,15 +3497,15 @@
       (aset parameters 0 (float-time)))
     (progress-reporter-do-update reporter value)))
 
+(defvar progress-reporter--pulse-characters ["-" "\\" "|" "/"]
+  "Characters to use for pulsing progress reporters.")
+
 (defun progress-reporter-do-update (reporter value)
   (let* ((parameters   (cdr reporter))
+	 (update-time  (aref parameters 0))
 	 (min-value    (aref parameters 1))
 	 (max-value    (aref parameters 2))
-	 (one-percent  (/ (- max-value min-value) 100.0))
-	 (percentage   (if (= max-value min-value)
-			   0
-			 (truncate (/ (- value min-value) one-percent))))
-	 (update-time  (aref parameters 0))
+	 (text         (aref parameters 3))
 	 (current-time (float-time))
 	 (enough-time-passed
 	  ;; See if enough time has passed since the last update.
@@ -3506,26 +3513,41 @@
 	      (when (>= current-time update-time)
 		;; Calculate time for the next update
 		(aset parameters 0 (+ update-time (aref parameters 5)))))))
-    ;;
-    ;; Calculate NEXT-UPDATE-VALUE.  If we are not going to print
-    ;; message this time because not enough time has passed, then use
-    ;; 1 instead of MIN-CHANGE.  This makes delays between echo area
-    ;; updates closer to MIN-TIME.
-    (setcar reporter
-	    (min (+ min-value (* (+ percentage
-				    (if enough-time-passed
-					(aref parameters 4) ;; MIN-CHANGE
-				      1))
-				 one-percent))
-		 max-value))
-    (when (integerp value)
-      (setcar reporter (ceiling (car reporter))))
-    ;;
-    ;; Only print message if enough time has passed
-    (when enough-time-passed
-      (if (> percentage 0)
-	  (message "%s%d%%" (aref parameters 3) percentage)
-	(message "%s" (aref parameters 3))))))
+    (cond ((and min-value max-value)
+	   ;; Numerical indicator
+	   (let* ((one-percent (/ (- max-value min-value) 100.0))
+		  (percentage  (if (= max-value min-value)
+				   0
+				 (truncate (/ (- value min-value)
+					      one-percent)))))
+	     ;; Calculate NEXT-UPDATE-VALUE.  If we are not printing
+	     ;; message because not enough time has passed, use 1
+	     ;; instead of MIN-CHANGE.  This makes delays between echo
+	     ;; area updates closer to MIN-TIME.
+	     (setcar reporter
+		     (min (+ min-value (* (+ percentage
+					     (if enough-time-passed
+						 ;; MIN-CHANGE
+						 (aref parameters 4)
+					       1))
+					  one-percent))
+			  max-value))
+	     (when (integerp value)
+	       (setcar reporter (ceiling (car reporter))))
+	     ;; Only print message if enough time has passed
+	     (when enough-time-passed
+	       (if (> percentage 0)
+		   (message "%s%d%%" text percentage)
+		 (message "%s" text)))))
+	  ;; Pulsing indicator
+	  (enough-time-passed
+	   (let ((index (mod (1+ (car reporter)) 4))
+		 (message-log-max nil))
+	     (setcar reporter index)
+	     (message "%s %s"
+		      text
+		      (aref progress-reporter--pulse-characters
+			    index)))))))
 
 (defun progress-reporter-done (reporter)
   "Print reporter's message followed by word \"done\" in echo area."
@@ -3573,11 +3595,11 @@
     ("^[-_+ ]cvs$"             . -3)	; treat "1.2.3-CVS" as alpha release
     ("^[-_+ ]?b\\(eta\\)?$"    . -2)
     ("^[-_+ ]?\\(pre\\|rc\\)$" . -1))
-  "*Specify association between non-numeric version part and a priority.
+  "*Specify association between non-numeric version and its priority.
 
 This association is used to handle version string like \"1.0pre2\",
 \"0.9alpha1\", etc.  It's used by `version-to-list' (which see) to convert the
-non-numeric part to an integer.  For example:
+non-numeric part of a version string to an integer.  For example:
 
    String Version    Integer List Version
    \"1.0pre2\"         (1  0 -1 2)
@@ -3595,15 +3617,15 @@
 Where:
 
 REGEXP		regexp used to match non-numeric part of a version string.
-		It should begin with a `^' anchor and end with a `$' to
+		It should begin with the `^' anchor and end with a `$' to
 		prevent false hits.  Letter-case is ignored while matching
 		REGEXP.
 
-PRIORITY	negative integer which indicate the non-numeric priority.")
+PRIORITY	a negative integer specifying non-numeric priority of REGEXP.")
 
 
 (defun version-to-list (ver)
-  "Convert version string VER into an integer list.
+  "Convert version string VER into a list of integers.
 
 The version syntax is given by the following EBNF:
 
@@ -3617,17 +3639,17 @@
 The NUMBER part is optional if SEPARATOR is a match for an element
 in `version-regexp-alist'.
 
-As an example of valid version syntax:
+Examples of valid version syntax:
 
    1.0pre2   1.0.7.5   22.8beta3   0.9alpha1   6.9.30Beta
 
-As an example of invalid version syntax:
+Examples of invalid version syntax:
 
    1.0prepre2   1.0..7.5   22.8X3   alpha3.2   .5
 
-As an example of version convertion:
-
-   String Version    Integer List Version
+Examples of version conversion:
+
+   Version String    Version as a List of Integers
    \"1.0.7.5\"         (1  0  7 5)
    \"1.0pre2\"         (1  0 -1 2)
    \"1.0PRE2\"         (1  0 -1 2)
@@ -3673,12 +3695,12 @@
 
 
 (defun version-list-< (l1 l2)
-  "Return t if integer list L1 is lesser than L2.
-
-Note that integer list (1) is equal to (1 0), (1 0 0), (1 0 0 0),
-etc.  That is, the trailing zeroes are irrelevant.  Also, integer
-list (1) is greater than (1 -1) which is greater than (1 -2)
-which is greater than (1 -3)."
+  "Return t if L1, a list specification of a version, is lower than L2.
+
+Note that a version specified by the list (1) is equal to (1 0),
+\(1 0 0), (1 0 0 0), etc.  That is, the trailing zeros are insignificant.
+Also, a version given by the list (1) is higher than (1 -1), which in
+turn is higher than (1 -2), which is higher than (1 -3)."
   (while (and l1 l2 (= (car l1) (car l2)))
     (setq l1 (cdr l1)
 	  l2 (cdr l2)))
@@ -3694,12 +3716,12 @@
 
 
 (defun version-list-= (l1 l2)
-  "Return t if integer list L1 is equal to L2.
-
-Note that integer list (1) is equal to (1 0), (1 0 0), (1 0 0 0),
-etc.  That is, the trailing zeroes are irrelevant.  Also, integer
-list (1) is greater than (1 -1) which is greater than (1 -2)
-which is greater than (1 -3)."
+  "Return t if L1, a list specification of a version, is equal to L2.
+
+Note that a version specified by the list (1) is equal to (1 0),
+\(1 0 0), (1 0 0 0), etc.  That is, the trailing zeros are insignificant.
+Also, a version given by the list (1) is higher than (1 -1), which in
+turn is higher than (1 -2), which is higher than (1 -3)."
   (while (and l1 l2 (= (car l1) (car l2)))
     (setq l1 (cdr l1)
 	  l2 (cdr l2)))
@@ -3715,7 +3737,7 @@
 
 
 (defun version-list-<= (l1 l2)
-  "Return t if integer list L1 is lesser than or equal to L2.
+  "Return t if L1, a list specification of a version, is lower or equal to L2.
 
 Note that integer list (1) is equal to (1 0), (1 0 0), (1 0 0 0),
 etc.  That is, the trailing zeroes are irrelevant.  Also, integer
@@ -3735,9 +3757,9 @@
    (t  (<= 0 (version-list-not-zero l2)))))
 
 (defun version-list-not-zero (lst)
-  "Return the first non-zero element of integer list LST.
-
-If all LST elements are zeroes or LST is nil, return zero."
+  "Return the first non-zero element of LST, which is a list of integers.
+
+If all LST elements are zeros or LST is nil, return zero."
   (while (and lst (zerop (car lst)))
     (setq lst (cdr lst)))
   (if lst
@@ -3747,31 +3769,31 @@
 
 
 (defun version< (v1 v2)
-  "Return t if version V1 is lesser than V2.
+  "Return t if version V1 is lower (older) than V2.
 
 Note that version string \"1\" is equal to \"1.0\", \"1.0.0\", \"1.0.0.0\",
-etc.  That is, the trailing \".0\"s are irrelevant.  Also, version string \"1\"
-is greater than \"1pre\" which is greater than \"1beta\" which is greater than
-\"1alpha\"."
+etc.  That is, the trailing \".0\"s are insignificant.  Also, version
+string \"1\" is higher (newer) than \"1pre\", which is higher than \"1beta\",
+which is higher than \"1alpha\"."
   (version-list-< (version-to-list v1) (version-to-list v2)))
 
 
 (defun version<= (v1 v2)
-  "Return t if version V1 is lesser than or equal to V2.
+  "Return t if version V1 is lower (older) than or equal to V2.
 
 Note that version string \"1\" is equal to \"1.0\", \"1.0.0\", \"1.0.0.0\",
-etc.  That is, the trailing \".0\"s are irrelevant.  Also, version string \"1\"
-is greater than \"1pre\" which is greater than \"1beta\" which is greater than
-\"1alpha\"."
+etc.  That is, the trailing \".0\"s are insignificant..  Also, version
+string \"1\" is higher (newer) than \"1pre\", which is higher than \"1beta\",
+which is higher than \"1alpha\"."
   (version-list-<= (version-to-list v1) (version-to-list v2)))
 
 (defun version= (v1 v2)
   "Return t if version V1 is equal to V2.
 
 Note that version string \"1\" is equal to \"1.0\", \"1.0.0\", \"1.0.0.0\",
-etc.  That is, the trailing \".0\"s are irrelevant.  Also, version string \"1\"
-is greater than \"1pre\" which is greater than \"1beta\" which is greater than
-\"1alpha\"."
+etc.  That is, the trailing \".0\"s are insignificant..  Also, version
+string \"1\" is higher (newer) than \"1pre\", which is higher than \"1beta\",
+which is higher than \"1alpha\"."
   (version-list-= (version-to-list v1) (version-to-list v2)))
 
 
--- a/lisp/textmodes/artist.el	Fri Mar 26 08:01:19 2010 +0100
+++ b/lisp/textmodes/artist.el	Thu Apr 01 08:50:44 2010 +0200
@@ -1319,7 +1319,7 @@
 
 Variables
 
- This is a brief overview of the different varaibles. For more info,
+ This is a brief overview of the different variables.  For more info,
  see the documentation for the variables (type \\[describe-variable] <variable> RET).
 
  artist-rubber-banding		Interactively do rubber-banding or not
--- a/lisp/tmm.el	Fri Mar 26 08:01:19 2010 +0100
+++ b/lisp/tmm.el	Thu Apr 01 08:50:44 2010 +0200
@@ -170,7 +170,11 @@
     (mapc (lambda (elt)
 	    (if (stringp elt)
 		(setq gl-str elt)
-	      (and (listp elt) (tmm-get-keymap elt not-menu))))
+	      (cond
+	       ((listp elt) (tmm-get-keymap elt not-menu))
+	       ((vectorp elt)
+		(dotimes (i (length elt))
+		  (tmm-get-keymap (cons i (aref elt i)) not-menu))))))
 	    menu)
     ;; Choose an element of tmm-km-list; put it in choice.
     (if (and not-menu (= 1 (length tmm-km-list)))
--- a/lisp/vc.el	Fri Mar 26 08:01:19 2010 +0100
+++ b/lisp/vc.el	Thu Apr 01 08:50:44 2010 +0200
@@ -1618,9 +1618,10 @@
 
 ;;;###autoload
 (defun vc-root-diff (historic &optional not-urgent)
-  "Display diffs between file revisions.
-Normally this compares the currently selected fileset with their
-working revisions.  With a prefix argument HISTORIC, it reads two revision
+  "Display diffs between VC-controlled whole tree revisions.
+Normally, this compares the tree corresponding to the current
+fileset with the working revision.
+With a prefix argument HISTORIC, prompt for two revision
 designators specifying which revisions to compare.
 
 The optional argument NOT-URGENT non-nil means it is ok to say no to
@@ -1941,7 +1942,12 @@
 ;;;###autoload
 (defun vc-print-log (&optional working-revision limit)
   "List the change log of the current fileset in a window.
-If WORKING-REVISION is non-nil, leave the point at that revision."
+If WORKING-REVISION is non-nil, leave point at that revision.
+If LIMIT is non-nil, it should be a number specifying the maximum
+number of revisions to show; the default is `vc-log-show-limit'.
+
+When called interactively with a prefix argument, prompt for
+WORKING-REVISION and LIMIT."
   (interactive
    (cond
     (current-prefix-arg
@@ -1965,7 +1971,10 @@
 
 ;;;###autoload
 (defun vc-print-root-log (&optional limit)
-  "List the change log of for the current VC controlled tree in a window."
+  "List the change log for the current VC controlled tree in a window.
+If LIMIT is non-nil, it should be a number specifying the maximum
+number of revisions to show; the default is `vc-log-show-limit'.
+When called interactively with a prefix argument, prompt for LIMIT."
   (interactive
    (cond
     (current-prefix-arg
--- a/msdos/ChangeLog	Fri Mar 26 08:01:19 2010 +0100
+++ b/msdos/ChangeLog	Thu Apr 01 08:50:44 2010 +0200
@@ -1,3 +1,17 @@
+2010-03-27  Eli Zaretskii  <eliz@gnu.org>
+
+	* sedlisp.inp (VPATH): Don't edit, no longer needed.
+	(lisp, srcdir): Adapt to lisp/Makefile.in changes.
+	(abs_top_builddir): New edit.
+
+	* sed3v2.inp (KRB4LIB, DESLIB, KRB5LIB, CRYPTOLIB, COM_ERRLIB)
+	(LIBHESIOD, LIBRESOLV, LIBS_MAIL): Edit to empty values.
+
+	* sed3.inp (KRB4LIB, DESLIB, KRB5LIB, CRYPTOLIB, COM_ERRLIB)
+	(LIBHESIOD, LIBRESOLV, LIBS_MAIL): Edit to empty values.
+
+	* sed1v2.inp (abs_builddir): Edit into "../src".
+
 2010-03-10  Chong Yidong  <cyd@stupidchicken.com>
 
 	* Branch for 23.2.
--- a/msdos/sed1v2.inp	Fri Mar 26 08:01:19 2010 +0100
+++ b/msdos/sed1v2.inp	Thu Apr 01 08:50:44 2010 +0200
@@ -29,6 +29,7 @@
 /^MAKE *=/s/^/# /
 /^SHELL *=/s/^/# /
 /^srcdir *=/s/@[^@\n]*@/./
+/^abs_builddir *=/s|@abs_builddir@|../src|
 /^VPATH *=/s/@[^@\n]*@/./
 /^CC *=/s/@[^@\n]*@/gcc/
 /^CPP *=/s/@[^@\n]*@/gcc -e/
--- a/msdos/sed3.inp	Fri Mar 26 08:01:19 2010 +0100
+++ b/msdos/sed3.inp	Thu Apr 01 08:50:44 2010 +0200
@@ -28,6 +28,14 @@
 /^libdir *=/s!=.*$!=/emacs/bin!
 /^srcdir *=/s!=.*$!=.!
 /^VPATH *=/s!=.*$!=.!
+/^KRB4LIB *=/s/@[^@\n]*@//g
+/^DESLIB *=/s/@[^@\n]*@//g
+/^KRB5LIB *=/s/@[^@\n]*@//g
+/^CRYPTOLIB *=/s/@[^@\n]*@//g
+/^COM_ERRLIB *=/s/@[^@\n]*@//g
+/^LIBHESIOD *=/s/@[^@\n]*@//g
+/^LIBRESOLV *=/s/@[^@\n]*@//g
+/^LIBS_MAIL *=/s/@[^@\n]*@//g
 /^CFLAGS *=/s!=.*$!=-O2 -g!
 /^C_SWITCH_SYSTEM *=/s!=.*$!=-DMSDOS!
 /^LOADLIBES *=/s!=.*$!=!
--- a/msdos/sed3v2.inp	Fri Mar 26 08:01:19 2010 +0100
+++ b/msdos/sed3v2.inp	Thu Apr 01 08:50:44 2010 +0200
@@ -26,6 +26,14 @@
 /^libdir *=/s!=.*$!=/emacs/bin!
 /^srcdir=/s!srcdir=@srcdir@!srcdir := $(subst \\,/,$(shell command.com /c cd))!
 /^VPATH *=/s!=.*$!=.!
+/^KRB4LIB *=/s/@[^@\n]*@//g
+/^DESLIB *=/s/@[^@\n]*@//g
+/^KRB5LIB *=/s/@[^@\n]*@//g
+/^CRYPTOLIB *=/s/@[^@\n]*@//g
+/^COM_ERRLIB *=/s/@[^@\n]*@//g
+/^LIBHESIOD *=/s/@[^@\n]*@//g
+/^LIBRESOLV *=/s/@[^@\n]*@//g
+/^LIBS_MAIL *=/s/@[^@\n]*@//g
 /^CFLAGS *=/s!=.*$!=-O2 -g!
 /^C_SWITCH_SYSTEM *=/s!=.*$!=-DMSDOS!
 /^LOADLIBES *=/s!=.*$!=!
--- a/msdos/sedlisp.inp	Fri Mar 26 08:01:19 2010 +0100
+++ b/msdos/sedlisp.inp	Thu Apr 01 08:50:44 2010 +0200
@@ -20,8 +20,9 @@
 /^SHELL *=/i\
 export FNCASE=y
 
-/^lisp=/s|@srcdir@|$(CURDIR)|
-/^VPATH=/s|@srcdir@|.|
-/^srcdir=/s|@srcdir@|.|
+/^lisp *=/s|\$(srcdir)|$(CURDIR)|
+/^srcdir *=/s|@srcdir@|.|
+/^top_srcdir *=/s|@top_srcdir@|./..|
+/^abs_top_builddir *=/s|@abs_top_builddir@|$(CURDIR)/..|
 
 # arch-tag: da7a3cff-4839-4ad7-bbe3-e2b61c84c38e
--- a/src/.gdbinit	Fri Mar 26 08:01:19 2010 +0100
+++ b/src/.gdbinit	Thu Apr 01 08:50:44 2010 +0200
@@ -271,6 +271,9 @@
     end
   end
   printf "\n"
+  if ($it->bidi_p)
+    printf "BIDI: base_stop=%d prev_stop=%d level=%d\n", $it->base_level_stop, $it->prev_stop, $it->bidi_it.resolved_level
+  end
   if ($it->region_beg_charpos >= 0)
     printf "reg=%d-%d ", $it->region_beg_charpos, $it->region_end_charpos
   end
@@ -447,6 +450,36 @@
 Pretty print window structure w.
 end
 
+define pbiditype
+  if ($arg0 == 0)
+    printf "UNDEF"
+  end
+  if ($arg0 == 1)
+    printf "L"
+  end
+  if ($arg0 == 2)
+    printf "R"
+  end
+  if ($arg0 == 3)
+    printf "EN"
+  end
+  if ($arg0 == 4)
+    printf "AN"
+  end
+  if ($arg0 == 5)
+    printf "BN"
+  end
+  if ($arg0 == 6)
+    printf "B"
+  end
+  if ($arg0 < 0 || $arg0 > 6)
+    printf "%d??", $arg0
+  end
+end
+document pbiditype
+Print textual description of bidi type given as first argument.
+end
+
 define pgx
   set $g = $arg0
   # CHAR_GLYPH
@@ -475,6 +508,11 @@
   else
     printf " pos=%d", $g->charpos
   end
+  # For characters, print their resolved level and bidi type
+  if ($g->type == 0)
+    printf " blev=%d,btyp=", $g->resolved_level
+    pbiditype $g->bidi_type
+  end
   printf " w=%d a+d=%d+%d", $g->pixel_width, $g->ascent, $g->descent
   # If not DEFAULT_FACE_ID
   if ($g->face_id != 0)
@@ -575,6 +613,28 @@
 Pretty print all glyphs in it->glyph_row.
 end
 
+define prowlims
+  printf "start=%d,end=%d,reversed=%d,cont=%d,at_zv=%d\n", $arg0->start.pos.charpos, $arg0->end.pos.charpos, $arg0->reversed_p, $arg0->continued_p, $arg0->ends_at_zv_p
+end
+document prowlims
+Print important attributes of a glyph_row structure.
+Takes one argument, a pointer to a glyph_row structure.
+end
+
+define pmtxrows
+  set $mtx = $arg0
+  set $gl = $mtx->rows
+  set $glend = $mtx->rows + $mtx->nrows
+  while ($gl < $glend)
+    prowlims $gl
+    set $gl = $gl + 1
+  end
+end
+document pmtxrows
+Print data about glyph rows in a glyph matrix.
+Takes one argument, a pointer to a glyph_matrix structure.
+end
+
 define xtype
   xgettype $
   output $type
--- a/src/ChangeLog	Fri Mar 26 08:01:19 2010 +0100
+++ b/src/ChangeLog	Thu Apr 01 08:50:44 2010 +0200
@@ -1,3 +1,231 @@
+2010-03-31  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	Clean up BSD_SYSTEM use.
+	* xterm.c:
+	* process.c:
+	* emacs.c: Use HAVE_SYS_IOCTL_H instead of BSD_SYSTEM as a guard
+	for including <sys/ioctl.h>.
+	* sysdep.c (wait_without_blocking): Remove BSD_SYSTEM case, this
+	code is only used for MSDOS.
+
+2010-03-31  Juri Linkov  <juri@jurta.org>
+
+	* image.c: Add `Qextension_data'.
+	(syms_of_image): Initialize and staticpro `Qextension_data'.
+	(Fimage_metadata): Rename from `Fimage_extension_data'.
+	(gif_load): Put GIF extension data to the property
+	`Qextension_data'.
+
+2010-03-31  Chong Yidong  <cyd@stupidchicken.com>
+
+	* nsfns.m (ns_set_doc_edited): Remove unused arg OLDVAL.
+	* nsterm.h: Fix prototype.
+
+2010-03-31  Eli Zaretskii  <eliz@gnu.org>
+
+	* xdisp.c (highlight_trailing_whitespace): Support highlight of
+	trailing whitespace in right-to-left rows.
+
+2010-03-31  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	Get rid of the direct_output optimizations.
+	* keyboard.c (nonundocount): Remove extern declaration.
+	(command_loop_1): Remove brittle optimisation for cheap and
+	common operations.
+	* xdisp.c (redisplay_internal): Don't bother checking
+	redisplay_performed_directly_p any more.
+	* sysdep.c (init_sys_modes): Don't call direct_output_forward_char
+	any more.
+	* dispnew.c (redisplay_performed_directly_p)
+	(direct_output_for_insert, direct_output_forward_char):
+	* dispextern.h (redisplay_performed_directly_p)
+	(direct_output_for_insert, direct_output_forward_char): Remove.
+	* cmds.c (nonundocount): Make it static.
+
+2010-03-31  Bernhard Herzog  <bh@intevation.de>  (tiny change)
+
+	* menu.c (Fx_popup_menu): Use last_event_timestamp (Bug#4930).
+
+2010-03-31  Jan Djärv  <jan.h.d@swipnet.se>
+
+	* xdisp.c (note_mouse_highlight): Don't do highlight if pointer is
+	invisible (Bug#5766).
+
+2010-03-31  Adrian Robert  <adrian.b.robert@gmail.com>
+
+	* xdisp.c (x_consider_frame_title, update_window_cursor):
+	Remove HAVE_NS conditionals.
+	(prepare_menu_bars)[HAVE_NS]: Call ns_set_doc_edited.
+
+	* nsfns.m (x_implicitly_set_name): If frame-title-format is t, use
+	filename for the title.
+	(ns_set_doc_edited): Do nothing if the selected window is a
+	minibuffer window.
+
+	* nsterm.h: Add prototypes for ns_set_name_as_filename and
+	ns_set_doc_edited.
+
+	* nsterm.m: Remove unneeded prototype.
+
+2010-03-31  Glenn Morris  <rgm@gnu.org>
+
+	* Makefile.in (SOME_MACHINE_OBJECTS): Ensure dbus stuff is always
+	in the DOC file.  (Bug#5336)
+
+2010-03-31  Chong Yidong  <cyd@stupidchicken.com>
+
+	* xdisp.c (pos_visible_p): Revert 2008-01-25 change (Bug#5730).
+
+2010-03-31  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* window.c (keys_of_window): Remove redundant/overridden bindings.
+
+2010-03-30  Eli Zaretskii  <eliz@gnu.org>
+
+	* xdisp.c (BUFFER_POS_REACHED_P, move_it_in_display_line_to):
+	Restore original behavior when the iterator is not bidi_p.
+
+2010-03-30  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* xdisp.c (syms_of_xdisp): Use intern_c_string instead of intern.
+
+2010-03-30  Eli Zaretskii  <eliz@gnu.org>
+
+	* bidi.c (bidi_cache_iterator_state): Invalidate the cache if we
+	are outside the range of cached character positions.
+
+2010-03-30  Juanma Barranquero  <lekktu@gmail.com>
+
+	* makefile.w32-in ($(BLD)/bidi.$(O)): Add dependency on w32gui.h.
+
+2010-03-30  Eli Zaretskii  <eliz@gnu.org>
+
+	Initial support for bidirectional editing.
+
+	* Makefile.in (obj): Include bidi.o.
+	(bidi.o): New target.
+
+	* makefile.w32-in (OBJ1): Add $(BLD)/bidi.$(O).
+	($(BLD)/bidi.$(O)): New target.
+
+	* bidi.c: New file.
+
+	* buffer.h (struct buffer): New members bidi_display_reordering
+	and bidi_paragraph_direction.
+
+	* buffer.c (init_buffer_once): Initialize bidi_display_reordering
+	and bidi_paragraph_direction.
+	(syms_of_buffer): Declare Lisp variables bidi-display-reordering
+	and bidi-paragraph-direction.
+	(Fbuffer_swap_text): Swap the values of
+	bidi_display_reordering and bidi_paragraph_direction.
+
+	* dispextern.h (BIDI_MAXLEVEL, BIDI_AT_BASE_LEVEL): New macros.
+	(bidi_type_t, bidi_dir_t): New types.
+	(bidi_saved_info, bidi_stack, bidi_it): New structures.
+	(struct it): New members bidi_p, bidi_it, paragraph_embedding,
+	prev_stop, base_level_stop, and eol_pos.
+	(bidi_init_it, bidi_get_next_char_visually): New prototypes.
+	(IT_STACK_SIZE): Enlarge to 5.
+	(struct glyph_row): New member reversed_p.
+	<string_buffer_position>: Update prototype.
+	(PRODUCE_GLYPHS): Set the reversed_p flag in the iterator's
+	glyph_row if bidi_it.paragraph_dir == R2L.
+	(struct glyph): New members resolved_level and bidi_type.
+
+	* dispnew.c (direct_output_forward_char): Give up if we need bidi
+	processing or buffer's direction is right-to-left.
+	(prepare_desired_row): Preserve the reversed_p flag.
+	(row_equal_p): Compare the reversed_p attributes as well.
+
+	* xdisp.c (init_iterator): Initialize it->bidi_p.  Call
+	bidi_init_it and set it->paragraph_embedding from the current
+	buffer's value of bidi_paragraph_direction.
+	(reseat_1): Initialize bidi_it.first_elt.
+	(set_iterator_to_next, next_element_from_buffer): Use the value of
+	paragraph_embedding to determine the paragraph direction.
+	(set_iterator_to_next): Under bidi reordering, call
+	bidi_get_next_char_visually.  Call bidi_paragraph_init if the
+	new_paragraph flag is set in the bidi iterator.
+	(next_element_from_buffer): If bidi_it.first_elt is set,
+	initialize paragraph direction and find the first character to
+	display in the visual order.  If reseated to a middle of a line,
+	prime the bidi iterator starting at the line's beginning.  Handle
+	the situation where we overstepped stop_charpos due to
+	non-linearity of the bidi iteration.  Likewise for when we back up
+	beyond the previous stop_charpos.  When moving across stop_charpos,
+	record it in prev_stop.
+	(display_line): Set row->end and it->start for the next row to the
+	next character in logical order.  Always extend reversed_p rows to
+	the end of line, even if they end at ZV.  Copy the reversed_p flag
+	to the next glyph row.  Keep calling set_cursor_from_row for
+	bidi-reordered rows even if we already have a possible candidate
+	for cursor position.  Set row_end after all the row's glyphs have
+	been produced, by looping over the glyphs.  Record the position
+	after EOL in it->eol_pos, and use it to set end_pos of the last
+	row produced for a continued line.
+	<Qright_to_left, Qleft_to_right>: New variables.
+	(syms_of_xdisp): Initialize and staticpro them.
+	(string_buffer_position_lim): New function.
+	(string_buffer_position): Most of code moved to
+	string_buffer_position_lim.  Last argument and return value are
+	now EMACS_INT; all callers changed.
+	(set_cursor_from_row): Rewritten to support bidirectional text and
+	reversed glyph rows.
+	(text_outside_line_unchanged_p, try_window_id): Disable
+	optimizations if we are reordering bidirectional text and the
+	paragraph direction can be affected by the change.
+	(append_glyph, append_composite_glyph)
+	(produce_image_glyph, append_stretch_glyph): Set the
+	resolved_level and bidi_type members of each glyph.
+	(append_glyph): If the glyph row is reversed, prepend the glyph
+	rather than appending it.
+	(handle_stop_backwards): New function.
+	(reseat_1, pop_it, push_it): Set prev_stop and base_level_stop.
+	(reseat): call handle_stop_backwards to recompute prev_stop and
+	base_level_stop for the new position.
+	(handle_invisible_prop): Under bidi iteration, skip invisible text
+	using bidi_get_next_char_visually.  If we are `reseat'ed, init the
+	paragraph direction.  Update IT->prev_stop after skipping
+	invisible text.
+	(move_it_in_display_line_to): New variables prev_method
+	and prev_pos.  Compare for strict equality in
+	BUFFER_POS_REACHED_P.
+	(try_cursor_movement): Examine all the candidate rows that occlude
+	point, to return the best match.  If rows are bidi-reordered
+	and point moved backwards, back up to the row that is not a
+	continuation line, and start looking for a suitable row from
+	there.
+
+	* term.c (append_glyph): Reverse glyphs by pre-pending them,
+	rather than appending, if the glyph_row's reversed_p flag is set.
+	Set the resolved_level and bidi_type members of each glyph.
+
+	* .gdbinit (pbiditype): New command.
+	(pgx): Use it to display bidi level and type of the glyph.
+	(pitx): Display some bidi information about the iterator.
+	(prowlims, pmtxrows): New commands.
+
+2010-03-30  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	Remove all uses of C_DEBUG_SWITCH and LIBS_DEBUG.
+	* s/usg5-4.h (LIBS_DEBUG):
+	* s/irix6-5.h (C_DEBUG_SWITCH):
+	* s/gnu-linux.h (LIBS_DEBUG):
+	* s/darwin.h (LIBS_DEBUG):
+	* s/bsd-common.h (LIBS_DEBUG):
+	* s/aix4-2.h (LIBS_DEBUG, C_DEBUG_SWITCH):
+	* m/iris4d.h (LIBS_DEBUG):
+	* m/hp800.h (LIBS_DEBUG): Remove definitions.
+
+	* Makefile.in (LIBES): Remove reference to LIBS_DEBUG.
+	(LIBS_DEBUG): Remove definition.
+
+2010-03-27  Chong Yidong  <cyd@stupidchicken.com>
+
+	* process.c (Fmake_network_process): Don't apply Bug#5173 fix for
+	Windows.
+
 2010-03-25  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
 	* process.c (Fmake_network_process): Don't call turn_on_atimers around
--- a/src/Makefile.in	Fri Mar 26 08:01:19 2010 +0100
+++ b/src/Makefile.in	Thu Apr 01 08:50:44 2010 +0200
@@ -127,11 +127,6 @@
 #define LIB_STANDARD
 #endif
 
-/* Unless inhibited or changed, use -lg to link for debugging.  */
-#ifndef LIBS_DEBUG
-#define LIBS_DEBUG -lg
-#endif
-
 /* Some s/SYSTEM.h files define this to request special libraries.  */
 #ifndef LIBS_SYSTEM
 #define LIBS_SYSTEM
@@ -501,7 +496,7 @@
 /* lastfile must follow all files
    whose initialized data areas should be dumped as pure by dump-emacs.  */
 obj=    dispnew.o frame.o scroll.o xdisp.o menu.o $(XMENU_OBJ) window.o \
-	charset.o coding.o category.o ccl.o character.o chartab.o \
+	charset.o coding.o category.o ccl.o character.o chartab.o bidi.o \
 	cm.o term.o terminal.o xfaces.o $(XOBJ) $(GTK_OBJ) $(DBUS_OBJ) \
 	emacs.o keyboard.o macros.o keymap.o sysdep.o \
 	buffer.o filelock.o insdel.o marker.o \
@@ -520,7 +515,7 @@
    in case they are needed there.  */
 SOME_MACHINE_OBJECTS = dosfns.o msdos.o \
   xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \
-  fontset.o \
+  fontset.o dbusbind.o \
   nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o \
   w32.o w32console.o w32fns.o w32heap.o w32inevt.o \
   w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o $(FONT_DRIVERS)
@@ -850,7 +845,7 @@
 
 LIBES = $(LOADLIBES) $(LIBS) $(LIBX) $(LIBSOUND) $(RSVG_LIBS) $(DBUS_LIBS) \
    @LIBGPM@ @LIBRESOLV@ LIBS_SYSTEM LIBS_MACHINE LIBS_TERMCAP \
-   LIBS_DEBUG $(GETLOADAVG_LIBS) ${GCONF_LIBS} \
+   $(GETLOADAVG_LIBS) ${GCONF_LIBS} \
    @FREETYPE_LIBS@ @FONTCONFIG_LIBS@ @LIBOTF_LIBS@ @M17N_FLT_LIBS@ \
    $(GNULIB_VAR) LIB_MATH LIB_STANDARD $(GNULIB_VAR)
 
@@ -987,6 +982,7 @@
 
 atimer.o: atimer.c atimer.h syssignal.h systime.h lisp.h blockinput.h \
  $(config_h)
+bidi.o: bidi.c buffer.h character.h dispextern.h lisp.h $(config_h)
 buffer.o: buffer.c buffer.h region-cache.h commands.h window.h \
    $(INTERVALS_H) blockinput.h atimer.h systime.h character.h \
    indent.h keyboard.h coding.h keymap.h frame.h lisp.h $(config_h)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/bidi.c	Thu Apr 01 08:50:44 2010 +0200
@@ -0,0 +1,2032 @@
+/* Low-level bidirectional buffer-scanning functions for GNU Emacs.
+   Copyright (C) 2000, 2001, 2004, 2005, 2009, 2010
+   Free Software Foundation, Inc.
+
+This file is part of GNU Emacs.
+
+GNU Emacs 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.
+
+GNU Emacs 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 GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* Written by Eli Zaretskii <eliz@gnu.org>.
+
+   A sequential implementation of the Unicode Bidirectional algorithm,
+   as per UAX#9, a part of the Unicode Standard.
+
+   Unlike the reference and most other implementations, this one is
+   designed to be called once for every character in the buffer.
+
+   The main entry point is bidi_get_next_char_visually.  Each time it
+   is called, it finds the next character in the visual order, and
+   returns its information in a special structure.  The caller is then
+   expected to process this character for display or any other
+   purposes, and call bidi_get_next_char_visually for the next
+   character.  See the comments in bidi_get_next_char_visually for
+   more details about its algorithm that finds the next visual-order
+   character by resolving their levels on the fly.
+
+   If you want to understand the code, you will have to read it
+   together with the relevant portions of UAX#9.  The comments include
+   references to UAX#9 rules, for that very reason.
+
+   A note about references to UAX#9 rules: if the reference says
+   something like "X9/Retaining", it means that you need to refer to
+   rule X9 and to its modifications decribed in the "Implementation
+   Notes" section of UAX#9, under "Retaining Format Codes".  */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include <setjmp.h>
+
+#include "lisp.h"
+#include "buffer.h"
+#include "character.h"
+#include "dispextern.h"
+
+static int bidi_initialized = 0;
+
+static Lisp_Object bidi_type_table;
+
+/* FIXME: Remove these when bidi_explicit_dir_char uses a lookup table.  */
+#define LRM_CHAR   0x200E
+#define RLM_CHAR   0x200F
+#define LRE_CHAR   0x202A
+#define RLE_CHAR   0x202B
+#define PDF_CHAR   0x202C
+#define LRO_CHAR   0x202D
+#define RLO_CHAR   0x202E
+
+#define BIDI_EOB   -1
+#define BIDI_BOB   -2		/* FIXME: Is this needed? */
+
+/* Local data structures.  (Look in dispextern.h for the rest.)  */
+
+/* What we need to know about the current paragraph.  */
+struct bidi_paragraph_info {
+  int start_bytepos;	/* byte position where it begins */
+  int end_bytepos;	/* byte position where it ends */
+  int embedding_level;	/* its basic embedding level */
+  bidi_dir_t base_dir;	/* its base direction */
+};
+
+/* Data type for describing the bidirectional character categories.  */
+typedef enum {
+  UNKNOWN_BC,
+  NEUTRAL,
+  WEAK,
+  STRONG
+} bidi_category_t;
+
+int bidi_ignore_explicit_marks_for_paragraph_level = 1;
+
+static Lisp_Object fallback_paragraph_start_re, fallback_paragraph_separate_re;
+static Lisp_Object Qparagraph_start, Qparagraph_separate;
+
+static void
+bidi_initialize ()
+{
+  /* FIXME: This should come from the Unicode Database.  */
+  struct {
+    int from, to;
+    bidi_type_t type;
+  } bidi_type[] =
+      { { 0x0000, 0x0008, WEAK_BN },
+	{ 0x0009, 0x0000, NEUTRAL_S },
+	{ 0x000A, 0x0000, NEUTRAL_B },
+	{ 0x000B, 0x0000, NEUTRAL_S },
+	{ 0x000C, 0x0000, NEUTRAL_WS },
+	{ 0x000D, 0x0000, NEUTRAL_B },
+	{ 0x000E, 0x001B, WEAK_BN },
+	{ 0x001C, 0x001E, NEUTRAL_B },
+	{ 0x001F, 0x0000, NEUTRAL_S },
+	{ 0x0020, 0x0000, NEUTRAL_WS },
+	{ 0x0021, 0x0022, NEUTRAL_ON },
+	{ 0x0023, 0x0025, WEAK_ET },
+	{ 0x0026, 0x002A, NEUTRAL_ON },
+	{ 0x002B, 0x0000, WEAK_ES },
+	{ 0x002C, 0x0000, WEAK_CS },
+	{ 0x002D, 0x0000, WEAK_ES },
+	{ 0x002E, 0x002F, WEAK_CS },
+	{ 0x0030, 0x0039, WEAK_EN },
+	{ 0x003A, 0x0000, WEAK_CS },
+	{ 0x003B, 0x0040, NEUTRAL_ON },
+	{ 0x005B, 0x0060, NEUTRAL_ON },
+	{ 0x007B, 0x007E, NEUTRAL_ON },
+	{ 0x007F, 0x0084, WEAK_BN },
+	{ 0x0085, 0x0000, NEUTRAL_B },
+	{ 0x0086, 0x009F, WEAK_BN },
+	{ 0x00A0, 0x0000, WEAK_CS },
+	{ 0x00A1, 0x0000, NEUTRAL_ON },
+	{ 0x00A2, 0x00A5, WEAK_ET },
+	{ 0x00A6, 0x00A9, NEUTRAL_ON },
+	{ 0x00AB, 0x00AC, NEUTRAL_ON },
+	{ 0x00AD, 0x0000, WEAK_BN },
+	{ 0x00AE, 0x00Af, NEUTRAL_ON },
+	{ 0x00B0, 0x00B1, WEAK_ET },
+	{ 0x00B2, 0x00B3, WEAK_EN },
+	{ 0x00B4, 0x0000, NEUTRAL_ON },
+	{ 0x00B6, 0x00B8, NEUTRAL_ON },
+	{ 0x00B9, 0x0000, WEAK_EN },
+	{ 0x00BB, 0x00BF, NEUTRAL_ON },
+	{ 0x00D7, 0x0000, NEUTRAL_ON },
+	{ 0x00F7, 0x0000, NEUTRAL_ON },
+	{ 0x02B9, 0x02BA, NEUTRAL_ON },
+	{ 0x02C2, 0x02CF, NEUTRAL_ON },
+	{ 0x02D2, 0x02DF, NEUTRAL_ON },
+	{ 0x02E5, 0x02ED, NEUTRAL_ON },
+	{ 0x0300, 0x036F, WEAK_NSM },
+	{ 0x0374, 0x0375, NEUTRAL_ON },
+	{ 0x037E, 0x0385, NEUTRAL_ON },
+	{ 0x0387, 0x0000, NEUTRAL_ON },
+	{ 0x03F6, 0x0000, NEUTRAL_ON },
+	{ 0x0483, 0x0489, WEAK_NSM },
+	{ 0x058A, 0x0000, NEUTRAL_ON },
+	{ 0x0591, 0x05BD, WEAK_NSM },
+	{ 0x05BE, 0x0000, STRONG_R },
+	{ 0x05BF, 0x0000, WEAK_NSM },
+	{ 0x05C0, 0x0000, STRONG_R },
+	{ 0x05C1, 0x05C2, WEAK_NSM },
+	{ 0x05C3, 0x0000, STRONG_R },
+	{ 0x05C4, 0x05C5, WEAK_NSM },
+	{ 0x05C6, 0x0000, STRONG_R },
+	{ 0x05C7, 0x0000, WEAK_NSM },
+	{ 0x05D0, 0x05F4, STRONG_R },
+	{ 0x060C, 0x0000, WEAK_CS },
+	{ 0x061B, 0x064A, STRONG_AL },
+	{ 0x064B, 0x0655, WEAK_NSM },
+	{ 0x0660, 0x0669, WEAK_AN },
+	{ 0x066A, 0x0000, WEAK_ET },
+	{ 0x066B, 0x066C, WEAK_AN },
+	{ 0x066D, 0x066F, STRONG_AL },
+	{ 0x0670, 0x0000, WEAK_NSM },
+	{ 0x0671, 0x06D5, STRONG_AL },
+	{ 0x06D6, 0x06DC, WEAK_NSM },
+	{ 0x06DD, 0x0000, STRONG_AL },
+	{ 0x06DE, 0x06E4, WEAK_NSM },
+	{ 0x06E5, 0x06E6, STRONG_AL },
+	{ 0x06E7, 0x06E8, WEAK_NSM },
+	{ 0x06E9, 0x0000, NEUTRAL_ON },
+	{ 0x06EA, 0x06ED, WEAK_NSM },
+	{ 0x06F0, 0x06F9, WEAK_EN },
+	{ 0x06FA, 0x070D, STRONG_AL },
+	{ 0x070F, 0x0000, WEAK_BN },
+	{ 0x0710, 0x0000, STRONG_AL },
+	{ 0x0711, 0x0000, WEAK_NSM },
+	{ 0x0712, 0x072C, STRONG_AL },
+	{ 0x0730, 0x074A, WEAK_NSM },
+	{ 0x0780, 0x07A5, STRONG_AL },
+	{ 0x07A6, 0x07B0, WEAK_NSM },
+	{ 0x07B1, 0x0000, STRONG_AL },
+	{ 0x0901, 0x0902, WEAK_NSM },
+	{ 0x093C, 0x0000, WEAK_NSM },
+	{ 0x0941, 0x0948, WEAK_NSM },
+	{ 0x094D, 0x0000, WEAK_NSM },
+	{ 0x0951, 0x0954, WEAK_NSM },
+	{ 0x0962, 0x0963, WEAK_NSM },
+	{ 0x0981, 0x0000, WEAK_NSM },
+	{ 0x09BC, 0x0000, WEAK_NSM },
+	{ 0x09C1, 0x09C4, WEAK_NSM },
+	{ 0x09CD, 0x0000, WEAK_NSM },
+	{ 0x09E2, 0x09E3, WEAK_NSM },
+	{ 0x09F2, 0x09F3, WEAK_ET },
+	{ 0x0A02, 0x0000, WEAK_NSM },
+	{ 0x0A3C, 0x0000, WEAK_NSM },
+	{ 0x0A41, 0x0A4D, WEAK_NSM },
+	{ 0x0A70, 0x0A71, WEAK_NSM },
+	{ 0x0A81, 0x0A82, WEAK_NSM },
+	{ 0x0ABC, 0x0000, WEAK_NSM },
+	{ 0x0AC1, 0x0AC8, WEAK_NSM },
+	{ 0x0ACD, 0x0000, WEAK_NSM },
+	{ 0x0B01, 0x0000, WEAK_NSM },
+	{ 0x0B3C, 0x0000, WEAK_NSM },
+	{ 0x0B3F, 0x0000, WEAK_NSM },
+	{ 0x0B41, 0x0B43, WEAK_NSM },
+	{ 0x0B4D, 0x0B56, WEAK_NSM },
+	{ 0x0B82, 0x0000, WEAK_NSM },
+	{ 0x0BC0, 0x0000, WEAK_NSM },
+	{ 0x0BCD, 0x0000, WEAK_NSM },
+	{ 0x0C3E, 0x0C40, WEAK_NSM },
+	{ 0x0C46, 0x0C56, WEAK_NSM },
+	{ 0x0CBF, 0x0000, WEAK_NSM },
+	{ 0x0CC6, 0x0000, WEAK_NSM },
+	{ 0x0CCC, 0x0CCD, WEAK_NSM },
+	{ 0x0D41, 0x0D43, WEAK_NSM },
+	{ 0x0D4D, 0x0000, WEAK_NSM },
+	{ 0x0DCA, 0x0000, WEAK_NSM },
+	{ 0x0DD2, 0x0DD6, WEAK_NSM },
+	{ 0x0E31, 0x0000, WEAK_NSM },
+	{ 0x0E34, 0x0E3A, WEAK_NSM },
+	{ 0x0E3F, 0x0000, WEAK_ET },
+	{ 0x0E47, 0x0E4E, WEAK_NSM },
+	{ 0x0EB1, 0x0000, WEAK_NSM },
+	{ 0x0EB4, 0x0EBC, WEAK_NSM },
+	{ 0x0EC8, 0x0ECD, WEAK_NSM },
+	{ 0x0F18, 0x0F19, WEAK_NSM },
+	{ 0x0F35, 0x0000, WEAK_NSM },
+	{ 0x0F37, 0x0000, WEAK_NSM },
+	{ 0x0F39, 0x0000, WEAK_NSM },
+	{ 0x0F3A, 0x0F3D, NEUTRAL_ON },
+	{ 0x0F71, 0x0F7E, WEAK_NSM },
+	{ 0x0F80, 0x0F84, WEAK_NSM },
+	{ 0x0F86, 0x0F87, WEAK_NSM },
+	{ 0x0F90, 0x0FBC, WEAK_NSM },
+	{ 0x0FC6, 0x0000, WEAK_NSM },
+	{ 0x102D, 0x1030, WEAK_NSM },
+	{ 0x1032, 0x1037, WEAK_NSM },
+	{ 0x1039, 0x0000, WEAK_NSM },
+	{ 0x1058, 0x1059, WEAK_NSM },
+	{ 0x1680, 0x0000, NEUTRAL_WS },
+	{ 0x169B, 0x169C, NEUTRAL_ON },
+	{ 0x1712, 0x1714, WEAK_NSM },
+	{ 0x1732, 0x1734, WEAK_NSM },
+	{ 0x1752, 0x1753, WEAK_NSM },
+	{ 0x1772, 0x1773, WEAK_NSM },
+	{ 0x17B7, 0x17BD, WEAK_NSM },
+	{ 0x17C6, 0x0000, WEAK_NSM },
+	{ 0x17C9, 0x17D3, WEAK_NSM },
+	{ 0x17DB, 0x0000, WEAK_ET },
+	{ 0x1800, 0x180A, NEUTRAL_ON },
+	{ 0x180B, 0x180D, WEAK_NSM },
+	{ 0x180E, 0x0000, WEAK_BN },
+	{ 0x18A9, 0x0000, WEAK_NSM },
+	{ 0x1FBD, 0x0000, NEUTRAL_ON },
+	{ 0x1FBF, 0x1FC1, NEUTRAL_ON },
+	{ 0x1FCD, 0x1FCF, NEUTRAL_ON },
+	{ 0x1FDD, 0x1FDF, NEUTRAL_ON },
+	{ 0x1FED, 0x1FEF, NEUTRAL_ON },
+	{ 0x1FFD, 0x1FFE, NEUTRAL_ON },
+	{ 0x2000, 0x200A, NEUTRAL_WS },
+	{ 0x200B, 0x200D, WEAK_BN },
+	{ 0x200F, 0x0000, STRONG_R },
+	{ 0x2010, 0x2027, NEUTRAL_ON },
+	{ 0x2028, 0x0000, NEUTRAL_WS },
+	{ 0x2029, 0x0000, NEUTRAL_B },
+	{ 0x202A, 0x0000, LRE },
+	{ 0x202B, 0x0000, RLE },
+	{ 0x202C, 0x0000, PDF },
+	{ 0x202D, 0x0000, LRO },
+	{ 0x202E, 0x0000, RLO },
+	{ 0x202F, 0x0000, NEUTRAL_WS },
+	{ 0x2030, 0x2034, WEAK_ET },
+	{ 0x2035, 0x2057, NEUTRAL_ON },
+	{ 0x205F, 0x0000, NEUTRAL_WS },
+	{ 0x2060, 0x206F, WEAK_BN },
+	{ 0x2070, 0x0000, WEAK_EN },
+	{ 0x2074, 0x2079, WEAK_EN },
+	{ 0x207A, 0x207B, WEAK_ET },
+	{ 0x207C, 0x207E, NEUTRAL_ON },
+	{ 0x2080, 0x2089, WEAK_EN },
+	{ 0x208A, 0x208B, WEAK_ET },
+	{ 0x208C, 0x208E, NEUTRAL_ON },
+	{ 0x20A0, 0x20B1, WEAK_ET },
+	{ 0x20D0, 0x20EA, WEAK_NSM },
+	{ 0x2100, 0x2101, NEUTRAL_ON },
+	{ 0x2103, 0x2106, NEUTRAL_ON },
+	{ 0x2108, 0x2109, NEUTRAL_ON },
+	{ 0x2114, 0x0000, NEUTRAL_ON },
+	{ 0x2116, 0x2118, NEUTRAL_ON },
+	{ 0x211E, 0x2123, NEUTRAL_ON },
+	{ 0x2125, 0x0000, NEUTRAL_ON },
+	{ 0x2127, 0x0000, NEUTRAL_ON },
+	{ 0x2129, 0x0000, NEUTRAL_ON },
+	{ 0x212E, 0x0000, WEAK_ET },
+	{ 0x2132, 0x0000, NEUTRAL_ON },
+	{ 0x213A, 0x0000, NEUTRAL_ON },
+	{ 0x2140, 0x2144, NEUTRAL_ON },
+	{ 0x214A, 0x215F, NEUTRAL_ON },
+	{ 0x2190, 0x2211, NEUTRAL_ON },
+	{ 0x2212, 0x2213, WEAK_ET },
+	{ 0x2214, 0x2335, NEUTRAL_ON },
+	{ 0x237B, 0x2394, NEUTRAL_ON },
+	{ 0x2396, 0x244A, NEUTRAL_ON },
+	{ 0x2460, 0x249B, WEAK_EN },
+	{ 0x24EA, 0x0000, WEAK_EN },
+	{ 0x24EB, 0x2FFB, NEUTRAL_ON },
+	{ 0x3000, 0x0000, NEUTRAL_WS },
+	{ 0x3001, 0x3004, NEUTRAL_ON },
+	{ 0x3008, 0x3020, NEUTRAL_ON },
+	{ 0x302A, 0x302F, WEAK_NSM },
+	{ 0x3030, 0x0000, NEUTRAL_ON },
+	{ 0x3036, 0x3037, NEUTRAL_ON },
+	{ 0x303D, 0x303F, NEUTRAL_ON },
+	{ 0x3099, 0x309A, WEAK_NSM },
+	{ 0x309B, 0x309C, NEUTRAL_ON },
+	{ 0x30A0, 0x0000, NEUTRAL_ON },
+	{ 0x30FB, 0x0000, NEUTRAL_ON },
+	{ 0x3251, 0x325F, NEUTRAL_ON },
+	{ 0x32B1, 0x32BF, NEUTRAL_ON },
+	{ 0xA490, 0xA4C6, NEUTRAL_ON },
+	{ 0xFB1D, 0x0000, STRONG_R },
+	{ 0xFB1E, 0x0000, WEAK_NSM },
+	{ 0xFB1F, 0xFB28, STRONG_R },
+	{ 0xFB29, 0x0000, WEAK_ET },
+	{ 0xFB2A, 0xFB4F, STRONG_R },
+	{ 0xFB50, 0xFD3D, STRONG_AL },
+	{ 0xFD3E, 0xFD3F, NEUTRAL_ON },
+	{ 0xFD50, 0xFDFC, STRONG_AL },
+	{ 0xFE00, 0xFE23, WEAK_NSM },
+	{ 0xFE30, 0xFE4F, NEUTRAL_ON },
+	{ 0xFE50, 0x0000, WEAK_CS },
+	{ 0xFE51, 0x0000, NEUTRAL_ON },
+	{ 0xFE52, 0x0000, WEAK_CS },
+	{ 0xFE54, 0x0000, NEUTRAL_ON },
+	{ 0xFE55, 0x0000, WEAK_CS },
+	{ 0xFE56, 0xFE5E, NEUTRAL_ON },
+	{ 0xFE5F, 0x0000, WEAK_ET },
+	{ 0xFE60, 0xFE61, NEUTRAL_ON },
+	{ 0xFE62, 0xFE63, WEAK_ET },
+	{ 0xFE64, 0xFE68, NEUTRAL_ON },
+	{ 0xFE69, 0xFE6A, WEAK_ET },
+	{ 0xFE6B, 0x0000, NEUTRAL_ON },
+	{ 0xFE70, 0xFEFC, STRONG_AL },
+	{ 0xFEFF, 0x0000, WEAK_BN },
+	{ 0xFF01, 0xFF02, NEUTRAL_ON },
+	{ 0xFF03, 0xFF05, WEAK_ET },
+	{ 0xFF06, 0xFF0A, NEUTRAL_ON },
+	{ 0xFF0B, 0x0000, WEAK_ET },
+	{ 0xFF0C, 0x0000, WEAK_CS },
+	{ 0xFF0D, 0x0000, WEAK_ET },
+	{ 0xFF0E, 0x0000, WEAK_CS },
+	{ 0xFF0F, 0x0000, WEAK_ES },
+	{ 0xFF10, 0xFF19, WEAK_EN },
+	{ 0xFF1A, 0x0000, WEAK_CS },
+	{ 0xFF1B, 0xFF20, NEUTRAL_ON },
+	{ 0xFF3B, 0xFF40, NEUTRAL_ON },
+	{ 0xFF5B, 0xFF65, NEUTRAL_ON },
+	{ 0xFFE0, 0xFFE1, WEAK_ET },
+	{ 0xFFE2, 0xFFE4, NEUTRAL_ON },
+	{ 0xFFE5, 0xFFE6, WEAK_ET },
+	{ 0xFFE8, 0xFFEE, NEUTRAL_ON },
+	{ 0xFFF9, 0xFFFB, WEAK_BN },
+	{ 0xFFFC, 0xFFFD, NEUTRAL_ON },
+	{ 0x1D167, 0x1D169, WEAK_NSM },
+	{ 0x1D173, 0x1D17A, WEAK_BN },
+	{ 0x1D17B, 0x1D182, WEAK_NSM },
+	{ 0x1D185, 0x1D18B, WEAK_NSM },
+	{ 0x1D1AA, 0x1D1AD, WEAK_NSM },
+	{ 0x1D7CE, 0x1D7FF, WEAK_EN },
+	{ 0xE0001, 0xE007F, WEAK_BN } };
+  int i;
+
+  bidi_type_table = Fmake_char_table (Qnil, make_number (STRONG_L));
+  staticpro (&bidi_type_table);
+
+  for (i = 0; i < sizeof bidi_type / sizeof bidi_type[0]; i++)
+    char_table_set_range (bidi_type_table, bidi_type[i].from,
+			  bidi_type[i].to ? bidi_type[i].to : bidi_type[i].from,
+			  make_number (bidi_type[i].type));
+
+  fallback_paragraph_start_re =
+    XSYMBOL (Fintern_soft (build_string ("paragraph-start"), Qnil))->value;
+  if (!STRINGP (fallback_paragraph_start_re))
+    fallback_paragraph_start_re = build_string ("\f\\|[ \t]*$");
+  staticpro (&fallback_paragraph_start_re);
+  Qparagraph_start = intern ("paragraph-start");
+  staticpro (&Qparagraph_start);
+  fallback_paragraph_separate_re =
+    XSYMBOL (Fintern_soft (build_string ("paragraph-separate"), Qnil))->value;
+  if (!STRINGP (fallback_paragraph_separate_re))
+    fallback_paragraph_separate_re = build_string ("[ \t\f]*$");
+  staticpro (&fallback_paragraph_separate_re);
+  Qparagraph_separate = intern ("paragraph-separate");
+  staticpro (&Qparagraph_separate);
+  bidi_initialized = 1;
+}
+
+/* Return the bidi type of a character CH, subject to the current
+   directional OVERRIDE.  */
+bidi_type_t
+bidi_get_type (int ch, bidi_dir_t override)
+{
+  bidi_type_t default_type;
+
+  if (ch == BIDI_EOB)
+    return NEUTRAL_B;
+  if (ch < 0 || ch > MAX_CHAR)
+    abort ();
+
+  default_type = (bidi_type_t) XINT (CHAR_TABLE_REF (bidi_type_table, ch));
+
+  if (override == NEUTRAL_DIR)
+    return default_type;
+
+  switch (default_type)
+    {
+      /* Although UAX#9 does not tell, it doesn't make sense to
+	 override NEUTRAL_B and LRM/RLM characters.  */
+      case NEUTRAL_B:
+      case LRE:
+      case LRO:
+      case RLE:
+      case RLO:
+      case PDF:
+	return default_type;
+      default:
+	switch (ch)
+	  {
+	    case LRM_CHAR:
+	    case RLM_CHAR:
+	      return default_type;
+	    default:
+	      if (override == L2R) /* X6 */
+		return STRONG_L;
+	      else if (override == R2L)
+		return STRONG_R;
+	      else
+		abort ();	/* can't happen: handled above */
+	  }
+    }
+}
+
+void
+bidi_check_type (bidi_type_t type)
+{
+  if (type < UNKNOWN_BT || type > NEUTRAL_ON)
+    abort ();
+}
+
+/* Given a bidi TYPE of a character, return its category.  */
+bidi_category_t
+bidi_get_category (bidi_type_t type)
+{
+  switch (type)
+    {
+      case UNKNOWN_BT:
+	return UNKNOWN_BC;
+      case STRONG_L:
+      case STRONG_R:
+      case STRONG_AL:
+      case LRE:
+      case LRO:
+      case RLE:
+      case RLO:
+	return STRONG;
+      case PDF:		/* ??? really?? */
+      case WEAK_EN:
+      case WEAK_ES:
+      case WEAK_ET:
+      case WEAK_AN:
+      case WEAK_CS:
+      case WEAK_NSM:
+      case WEAK_BN:
+	return WEAK;
+      case NEUTRAL_B:
+      case NEUTRAL_S:
+      case NEUTRAL_WS:
+      case NEUTRAL_ON:
+	return NEUTRAL;
+      default:
+	abort ();
+    }
+}
+
+/* Return the mirrored character of C, if any.
+
+   Note: The conditions in UAX#9 clause L4 must be tested by the
+   caller.  */
+/* FIXME: exceedingly temporary!  Should consult the Unicode database
+   of character properties.  */
+int
+bidi_mirror_char (int c)
+{
+  static const char mirrored_pairs[] = "()<>[]{}";
+  const char *p = c > 0 && c < 128 ? strchr (mirrored_pairs, c) : NULL;
+
+  if (p)
+    {
+      size_t i = p - mirrored_pairs;
+
+      return mirrored_pairs [(i ^ 1)];
+    }
+  return c;
+}
+
+/* Copy the bidi iterator from FROM to TO.  To save cycles, this only
+   copies the part of the level stack that is actually in use.  */
+static inline void
+bidi_copy_it (struct bidi_it *to, struct bidi_it *from)
+{
+  int i;
+
+  /* Copy everything except the level stack and beyond.  */
+  memcpy (to, from, ((size_t)&((struct bidi_it *)0)->level_stack[0]));
+
+  /* Copy the active part of the level stack.  */
+  to->level_stack[0] = from->level_stack[0]; /* level zero is always in use */
+  for (i = 1; i <= from->stack_idx; i++)
+    to->level_stack[i] = from->level_stack[i];
+}
+
+/* Caching the bidi iterator states.  */
+
+static struct bidi_it bidi_cache[1000]; /* FIXME: make this dynamically allocated! */
+static int bidi_cache_idx;
+static int bidi_cache_last_idx;
+
+static inline void
+bidi_cache_reset (void)
+{
+  bidi_cache_idx = 0;
+  bidi_cache_last_idx = -1;
+}
+
+static inline void
+bidi_cache_fetch_state (int idx, struct bidi_it *bidi_it)
+{
+  int current_scan_dir = bidi_it->scan_dir;
+
+  if (idx < 0 || idx >= bidi_cache_idx)
+    abort ();
+
+  bidi_copy_it (bidi_it, &bidi_cache[idx]);
+  bidi_it->scan_dir = current_scan_dir;
+  bidi_cache_last_idx = idx;
+}
+
+/* Find a cached state with a given CHARPOS and resolved embedding
+   level less or equal to LEVEL.  if LEVEL is -1, disregard the
+   resolved levels in cached states.  DIR, if non-zero, means search
+   in that direction from the last cache hit.  */
+static inline int
+bidi_cache_search (int charpos, int level, int dir)
+{
+  int i, i_start;
+
+  if (bidi_cache_idx)
+    {
+      if (charpos < bidi_cache[bidi_cache_last_idx].charpos)
+	dir = -1;
+      else if (charpos > bidi_cache[bidi_cache_last_idx].charpos)
+	dir = 1;
+      if (dir)
+	i_start = bidi_cache_last_idx;
+      else
+	{
+	  dir = -1;
+	  i_start = bidi_cache_idx - 1;
+	}
+
+      if (dir < 0)
+	{
+	  /* Linear search for now; FIXME!  */
+	  for (i = i_start; i >= 0; i--)
+	    if (bidi_cache[i].charpos == charpos
+		&& (level == -1 || bidi_cache[i].resolved_level <= level))
+	      return i;
+	}
+      else
+	{
+	  for (i = i_start; i < bidi_cache_idx; i++)
+	    if (bidi_cache[i].charpos == charpos
+		&& (level == -1 || bidi_cache[i].resolved_level <= level))
+	      return i;
+	}
+    }
+
+  return -1;
+}
+
+/* Find a cached state where the resolved level changes to a value
+   that is lower than LEVEL, and return its cache slot index.  DIR is
+   the direction to search, starting with the last used cache slot.
+   BEFORE, if non-zero, means return the index of the slot that is
+   ``before'' the level change in the search direction.  That is,
+   given the cached levels like this:
+
+	 1122333442211
+	  AB        C
+
+   and assuming we are at the position cached at the slot marked with
+   C, searching backwards (DIR = -1) for LEVEL = 2 will return the
+   index of slot B or A, depending whether BEFORE is, respectively,
+   non-zero or zero.  */
+static int
+bidi_cache_find_level_change (int level, int dir, int before)
+{
+  if (bidi_cache_idx)
+    {
+      int i = dir ? bidi_cache_last_idx : bidi_cache_idx - 1;
+      int incr = before ? 1 : 0;
+
+      if (!dir)
+	dir = -1;
+      else if (!incr)
+	i += dir;
+
+      if (dir < 0)
+	{
+	  while (i >= incr)
+	    {
+	      if (bidi_cache[i - incr].resolved_level >= 0
+		  && bidi_cache[i - incr].resolved_level < level)
+		return i;
+	      i--;
+	    }
+	}
+      else
+	{
+	  while (i < bidi_cache_idx - incr)
+	    {
+	      if (bidi_cache[i + incr].resolved_level >= 0
+		  && bidi_cache[i + incr].resolved_level < level)
+		return i;
+	      i++;
+	    }
+	}
+    }
+
+  return -1;
+}
+
+static inline void
+bidi_cache_iterator_state (struct bidi_it *bidi_it, int resolved)
+{
+  int idx;
+
+  /* We should never cache on backward scans.  */
+  if (bidi_it->scan_dir == -1)
+    abort ();
+  idx = bidi_cache_search (bidi_it->charpos, -1, 1);
+
+  if (idx < 0)
+    {
+      idx = bidi_cache_idx;
+      /* Don't overrun the cache limit.  */
+      if (idx > sizeof (bidi_cache) / sizeof (bidi_cache[0]) - 1)
+	abort ();
+      /* Character positions should correspond to cache positions 1:1.
+	 If we are outside the range of cached positions, the cache is
+	 useless and must be reset.  */
+      if (idx > 0 &&
+	  (bidi_it->charpos > bidi_cache[idx - 1].charpos + 1
+	   || bidi_it->charpos < bidi_cache[0].charpos))
+	{
+	  bidi_cache_reset ();
+	  idx = 0;
+	}
+      bidi_copy_it (&bidi_cache[idx], bidi_it);
+      if (!resolved)
+	bidi_cache[idx].resolved_level = -1;
+      bidi_cache[idx].new_paragraph = 0;
+    }
+  else
+    {
+      /* Copy only the members which could have changed, to avoid
+	 costly copying of the entire struct.  */
+      bidi_cache[idx].type = bidi_it->type;
+      bidi_check_type (bidi_it->type);
+      bidi_cache[idx].type_after_w1 = bidi_it->type_after_w1;
+      bidi_check_type (bidi_it->type_after_w1);
+      if (resolved)
+	bidi_cache[idx].resolved_level = bidi_it->resolved_level;
+      else
+	bidi_cache[idx].resolved_level = -1;
+      bidi_cache[idx].invalid_levels = bidi_it->invalid_levels;
+      bidi_cache[idx].invalid_rl_levels = bidi_it->invalid_rl_levels;
+      bidi_cache[idx].next_for_neutral = bidi_it->next_for_neutral;
+      bidi_cache[idx].next_for_ws = bidi_it->next_for_ws;
+      bidi_cache[idx].ignore_bn_limit = bidi_it->ignore_bn_limit;
+    }
+
+  bidi_cache_last_idx = idx;
+  if (idx >= bidi_cache_idx)
+    bidi_cache_idx = idx + 1;
+}
+
+static inline bidi_type_t
+bidi_cache_find (int charpos, int level, struct bidi_it *bidi_it)
+{
+  int i = bidi_cache_search (charpos, level, bidi_it->scan_dir);
+
+  if (i >= 0)
+    {
+      bidi_dir_t current_scan_dir = bidi_it->scan_dir;
+
+      bidi_copy_it (bidi_it, &bidi_cache[i]);
+      bidi_cache_last_idx = i;
+      /* Don't let scan direction from from the cached state override
+	 the current scan direction.  */
+      bidi_it->scan_dir = current_scan_dir;
+      return bidi_it->type;
+    }
+
+  return UNKNOWN_BT;
+}
+
+static inline int
+bidi_peek_at_next_level (struct bidi_it *bidi_it)
+{
+  if (bidi_cache_idx == 0 || bidi_cache_last_idx == -1)
+    abort ();
+  return bidi_cache[bidi_cache_last_idx + bidi_it->scan_dir].resolved_level;
+}
+
+/* Check if buffer position CHARPOS/BYTEPOS is the end of a paragraph.
+   Value is the non-negative length of the paragraph separator
+   following the buffer position, -1 if position is at the beginning
+   of a new paragraph, or -2 if position is neither at beginning nor
+   at end of a paragraph.  */
+EMACS_INT
+bidi_at_paragraph_end (EMACS_INT charpos, EMACS_INT bytepos)
+{
+  Lisp_Object sep_re = Fbuffer_local_value (Qparagraph_separate,
+					    Fcurrent_buffer ());
+  Lisp_Object start_re = Fbuffer_local_value (Qparagraph_start,
+					      Fcurrent_buffer ());
+  EMACS_INT val;
+
+  if (!STRINGP (sep_re))
+    sep_re = fallback_paragraph_separate_re;
+  if (!STRINGP (start_re))
+    start_re = fallback_paragraph_start_re;
+
+  val = fast_looking_at (sep_re, charpos, bytepos, ZV, ZV_BYTE, Qnil);
+  if (val < 0)
+    {
+      if (fast_looking_at (start_re, charpos, bytepos, ZV, ZV_BYTE, Qnil) >= 0)
+	val = -1;
+      else
+	val = -2;
+    }
+
+  return val;
+}
+
+/* Determine the start-of-run (sor) directional type given the two
+   embedding levels on either side of the run boundary.  Also, update
+   the saved info about previously seen characters, since that info is
+   generally valid for a single level run.  */
+static inline void
+bidi_set_sor_type (struct bidi_it *bidi_it, int level_before, int level_after)
+{
+  int higher_level = level_before > level_after ? level_before : level_after;
+
+  /* The prev_was_pdf gork is required for when we have several PDFs
+     in a row.  In that case, we want to compute the sor type for the
+     next level run only once: when we see the first PDF.  That's
+     because the sor type depends only on the higher of the two levels
+     that we find on the two sides of the level boundary (see UAX#9,
+     clause X10), and so we don't need to know the final embedding
+     level to which we descend after processing all the PDFs.  */
+  if (!bidi_it->prev_was_pdf || level_before < level_after)
+    /* FIXME: should the default sor direction be user selectable?  */
+    bidi_it->sor = (higher_level & 1) != 0 ? R2L : L2R;
+  if (level_before > level_after)
+    bidi_it->prev_was_pdf = 1;
+
+  bidi_it->prev.type = UNKNOWN_BT;
+  bidi_it->last_strong.type = bidi_it->last_strong.type_after_w1 =
+    bidi_it->last_strong.orig_type = UNKNOWN_BT;
+  bidi_it->prev_for_neutral.type = bidi_it->sor == R2L ? STRONG_R : STRONG_L;
+  bidi_it->prev_for_neutral.charpos = bidi_it->charpos;
+  bidi_it->prev_for_neutral.bytepos = bidi_it->bytepos;
+  bidi_it->next_for_neutral.type = bidi_it->next_for_neutral.type_after_w1 =
+    bidi_it->next_for_neutral.orig_type = UNKNOWN_BT;
+  bidi_it->ignore_bn_limit = 0; /* meaning it's unknown */
+}
+
+static void
+bidi_line_init (struct bidi_it *bidi_it)
+{
+  bidi_it->scan_dir = 1; /* FIXME: do we need to have control on this? */
+  bidi_it->resolved_level = bidi_it->level_stack[0].level;
+  bidi_it->level_stack[0].override = NEUTRAL_DIR; /* X1 */
+  bidi_it->invalid_levels = 0;
+  bidi_it->invalid_rl_levels = -1;
+  bidi_it->next_en_pos = -1;
+  bidi_it->next_for_ws.type = UNKNOWN_BT;
+  bidi_set_sor_type (bidi_it,
+		     bidi_it->paragraph_dir == R2L ? 1 : 0,
+		     bidi_it->level_stack[0].level); /* X10 */
+
+  bidi_cache_reset ();
+}
+
+/* Find the beginning of this paragraph by looking back in the buffer.
+   Value is the byte position of the paragraph's beginning.  */
+static EMACS_INT
+bidi_find_paragraph_start (EMACS_INT pos, EMACS_INT pos_byte)
+{
+  Lisp_Object re = Fbuffer_local_value (Qparagraph_start, Fcurrent_buffer ());
+  EMACS_INT limit = ZV, limit_byte = ZV_BYTE;
+
+  if (!STRINGP (re))
+    re = fallback_paragraph_start_re;
+  while (pos_byte > BEGV_BYTE
+	 && fast_looking_at (re, pos, pos_byte, limit, limit_byte, Qnil) < 0)
+    {
+      pos = find_next_newline_no_quit (pos - 1, -1);
+      pos_byte = CHAR_TO_BYTE (pos);
+    }
+  return pos_byte;
+}
+
+/* Determine the direction, a.k.a. base embedding level, of the
+   paragraph we are about to iterate through.  If DIR is either L2R or
+   R2L, just use that.  Otherwise, determine the paragraph direction
+   from the first strong character of the paragraph.
+
+   Note that this gives the paragraph separator the same direction as
+   the preceding paragraph, even though Emacs generally views the
+   separartor as not belonging to any paragraph.  */
+void
+bidi_paragraph_init (bidi_dir_t dir, struct bidi_it *bidi_it)
+{
+  EMACS_INT bytepos = bidi_it->bytepos;
+
+  /* Special case for an empty buffer. */
+  if (bytepos == BEGV_BYTE && bytepos == ZV_BYTE)
+    dir = L2R;
+  /* We should never be called at EOB or before BEGV.  */
+  else if (bytepos >= ZV_BYTE || bytepos < BEGV_BYTE)
+    abort ();
+
+  if (dir == L2R)
+    {
+      bidi_it->paragraph_dir = L2R;
+      bidi_it->new_paragraph = 0;
+    }
+  else if (dir == R2L)
+    {
+      bidi_it->paragraph_dir = R2L;
+      bidi_it->new_paragraph = 0;
+    }
+  else if (dir == NEUTRAL_DIR)	/* P2 */
+    {
+      int ch, ch_len;
+      EMACS_INT pos;
+      bidi_type_t type;
+      EMACS_INT sep_len;
+
+      /* If we are inside a paragraph separator, we are just waiting
+	 for the separator to be exhausted; use the previous paragraph
+	 direction.  But don't do that if we have been just reseated,
+	 because we need to reinitialize below in that case.  */
+      if (!bidi_it->first_elt
+	  && bidi_it->charpos < bidi_it->separator_limit)
+	return;
+
+      /* If we are on a newline, get past it to where the next
+	 paragraph might start.  But don't do that at BEGV since then
+	 we are potentially in a new paragraph that doesn't yet
+	 exist.  */
+      pos = bidi_it->charpos;
+      if (bytepos > BEGV_BYTE && FETCH_CHAR (bytepos) == '\n')
+	{
+	  bytepos++;
+	  pos++;
+	}
+
+      /* We are either at the beginning of a paragraph or in the
+	 middle of it.  Find where this paragraph starts.  */
+      bytepos = bidi_find_paragraph_start (pos, bytepos);
+
+      /* We should always be at the beginning of a new line at this
+	 point.  */
+      if (!(bytepos == BEGV_BYTE || FETCH_CHAR (bytepos - 1) == '\n'))
+	abort ();
+
+      bidi_it->separator_limit = -1;
+      bidi_it->new_paragraph = 0;
+      ch = FETCH_CHAR (bytepos);
+      ch_len = CHAR_BYTES (ch);
+      pos = BYTE_TO_CHAR (bytepos);
+      type = bidi_get_type (ch, NEUTRAL_DIR);
+
+      for (pos++, bytepos += ch_len;
+	   /* NOTE: UAX#9 says to search only for L, AL, or R types of
+	      characters, and ignore RLE, RLO, LRE, and LRO.  However,
+	      I'm not sure it makes sense to omit those 4; should try
+	      with and without that to see the effect.  */
+	   (bidi_get_category (type) != STRONG)
+	     || (bidi_ignore_explicit_marks_for_paragraph_level
+		 && (type == RLE || type == RLO
+		     || type == LRE || type == LRO));
+	   type = bidi_get_type (ch, NEUTRAL_DIR))
+	{
+	  if (type == NEUTRAL_B && bidi_at_paragraph_end (pos, bytepos) >= -1)
+	    break;
+	  if (bytepos >= ZV_BYTE)
+	    {
+	      /* Pretend there's a paragraph separator at end of buffer.  */
+	      type = NEUTRAL_B;
+	      break;
+	    }
+	  FETCH_CHAR_ADVANCE (ch, pos, bytepos);
+	}
+      if (type == STRONG_R || type == STRONG_AL) /* P3 */
+	bidi_it->paragraph_dir = R2L;
+      else if (type == STRONG_L)
+	bidi_it->paragraph_dir = L2R;
+    }
+  else
+    abort ();
+
+  /* Contrary to UAX#9 clause P3, we only default the paragraph
+     direction to L2R if we have no previous usable paragraph
+     direction.  */
+  if (bidi_it->paragraph_dir == NEUTRAL_DIR)
+    bidi_it->paragraph_dir = L2R; /* P3 and ``higher protocols'' */
+  if (bidi_it->paragraph_dir == R2L)
+    bidi_it->level_stack[0].level = 1;
+  else
+    bidi_it->level_stack[0].level = 0;
+
+  bidi_line_init (bidi_it);
+}
+
+/* Do whatever UAX#9 clause X8 says should be done at paragraph's
+   end.  */
+static inline void
+bidi_set_paragraph_end (struct bidi_it *bidi_it)
+{
+  bidi_it->invalid_levels = 0;
+  bidi_it->invalid_rl_levels = -1;
+  bidi_it->stack_idx = 0;
+  bidi_it->resolved_level = bidi_it->level_stack[0].level;
+}
+
+/* Initialize the bidi iterator from buffer position CHARPOS.  */
+void
+bidi_init_it (EMACS_INT charpos, EMACS_INT bytepos, struct bidi_it *bidi_it)
+{
+  if (! bidi_initialized)
+    bidi_initialize ();
+  bidi_it->charpos = charpos;
+  bidi_it->bytepos = bytepos;
+  bidi_it->first_elt = 1;
+  bidi_set_paragraph_end (bidi_it);
+  bidi_it->new_paragraph = 1;
+  bidi_it->separator_limit = -1;
+  bidi_it->type = NEUTRAL_B;
+  bidi_it->type_after_w1 = UNKNOWN_BT;
+  bidi_it->orig_type = UNKNOWN_BT;
+  bidi_it->prev_was_pdf = 0;
+  bidi_it->prev.type = bidi_it->prev.type_after_w1 = UNKNOWN_BT;
+  bidi_it->last_strong.type = bidi_it->last_strong.type_after_w1 =
+    bidi_it->last_strong.orig_type = UNKNOWN_BT;
+  bidi_it->next_for_neutral.charpos = -1;
+  bidi_it->next_for_neutral.type =
+    bidi_it->next_for_neutral.type_after_w1 =
+    bidi_it->next_for_neutral.orig_type = UNKNOWN_BT;
+  bidi_it->prev_for_neutral.charpos = -1;
+  bidi_it->prev_for_neutral.type =
+    bidi_it->prev_for_neutral.type_after_w1 =
+    bidi_it->prev_for_neutral.orig_type = UNKNOWN_BT;
+  bidi_it->sor = L2R;	 /* FIXME: should it be user-selectable? */
+}
+
+/* Push the current embedding level and override status; reset the
+   current level to LEVEL and the current override status to OVERRIDE.  */
+static inline void
+bidi_push_embedding_level (struct bidi_it *bidi_it,
+			   int level, bidi_dir_t override)
+{
+  bidi_it->stack_idx++;
+  if (bidi_it->stack_idx >= BIDI_MAXLEVEL)
+    abort ();
+  bidi_it->level_stack[bidi_it->stack_idx].level = level;
+  bidi_it->level_stack[bidi_it->stack_idx].override = override;
+}
+
+/* Pop the embedding level and directional override status from the
+   stack, and return the new level.  */
+static inline int
+bidi_pop_embedding_level (struct bidi_it *bidi_it)
+{
+  /* UAX#9 says to ignore invalid PDFs.  */
+  if (bidi_it->stack_idx > 0)
+    bidi_it->stack_idx--;
+  return bidi_it->level_stack[bidi_it->stack_idx].level;
+}
+
+/* Record in SAVED_INFO the information about the current character.  */
+static inline void
+bidi_remember_char (struct bidi_saved_info *saved_info,
+		    struct bidi_it *bidi_it)
+{
+  saved_info->charpos = bidi_it->charpos;
+  saved_info->bytepos = bidi_it->bytepos;
+  saved_info->type = bidi_it->type;
+  bidi_check_type (bidi_it->type);
+  saved_info->type_after_w1 = bidi_it->type_after_w1;
+  bidi_check_type (bidi_it->type_after_w1);
+  saved_info->orig_type = bidi_it->orig_type;
+  bidi_check_type (bidi_it->orig_type);
+}
+
+/* Resolve the type of a neutral character according to the type of
+   surrounding strong text and the current embedding level.  */
+static inline bidi_type_t
+bidi_resolve_neutral_1 (bidi_type_t prev_type, bidi_type_t next_type, int lev)
+{
+  /* N1: European and Arabic numbers are treated as though they were R.  */
+  if (next_type == WEAK_EN || next_type == WEAK_AN)
+    next_type = STRONG_R;
+  if (prev_type == WEAK_EN || prev_type == WEAK_AN)
+    prev_type = STRONG_R;
+
+  if (next_type == prev_type)	/* N1 */
+    return next_type;
+  else if ((lev & 1) == 0)	/* N2 */
+    return STRONG_L;
+  else
+    return STRONG_R;
+}
+
+static inline int
+bidi_explicit_dir_char (int c)
+{
+  /* FIXME: this should be replaced with a lookup table with suitable
+     bits set, like standard C ctype macros do.  */
+  return (c == LRE_CHAR || c == LRO_CHAR
+	  || c == RLE_CHAR || c == RLO_CHAR || c == PDF_CHAR);
+}
+
+/* A helper function for bidi_resolve_explicit.  It advances to the
+   next character in logical order and determines the new embedding
+   level and directional override, but does not take into account
+   empty embeddings.  */
+static int
+bidi_resolve_explicit_1 (struct bidi_it *bidi_it)
+{
+  int curchar;
+  bidi_type_t type;
+  int current_level;
+  int new_level;
+  bidi_dir_t override;
+
+  if (bidi_it->bytepos < BEGV_BYTE	/* after reseat to BEGV? */
+      || bidi_it->first_elt)
+    {
+      bidi_it->first_elt = 0;
+      if (bidi_it->charpos < BEGV)
+	bidi_it->charpos = BEGV;
+      bidi_it->bytepos = CHAR_TO_BYTE (bidi_it->charpos);
+    }
+  else if (bidi_it->bytepos < ZV_BYTE)	/* don't move at ZV */
+    {
+      bidi_it->charpos++;
+      if (bidi_it->ch_len == 0)
+	abort ();
+      bidi_it->bytepos += bidi_it->ch_len;
+    }
+
+  current_level = bidi_it->level_stack[bidi_it->stack_idx].level; /* X1 */
+  override = bidi_it->level_stack[bidi_it->stack_idx].override;
+  new_level = current_level;
+
+  /* in case it is a unibyte character (not yet implemented) */
+  /* _fetch_multibyte_char_len = 1; */
+  if (bidi_it->bytepos >= ZV_BYTE)
+    {
+      curchar = BIDI_EOB;
+      bidi_it->ch_len = 1;
+    }
+  else
+    {
+      curchar = FETCH_CHAR (bidi_it->bytepos);
+      bidi_it->ch_len = CHAR_BYTES (curchar);
+    }
+  bidi_it->ch = curchar;
+
+  /* Don't apply directional override here, as all the types we handle
+     below will not be affected by the override anyway, and we need
+     the original type unaltered.  The override will be applied in
+     bidi_resolve_weak.  */
+  type = bidi_get_type (curchar, NEUTRAL_DIR);
+  bidi_it->orig_type = type;
+  bidi_check_type (bidi_it->orig_type);
+
+  if (type != PDF)
+    bidi_it->prev_was_pdf = 0;
+
+  bidi_it->type_after_w1 = UNKNOWN_BT;
+
+  switch (type)
+    {
+      case RLE:	/* X2 */
+      case RLO:	/* X4 */
+	bidi_it->type_after_w1 = type;
+	bidi_check_type (bidi_it->type_after_w1);
+	type = WEAK_BN; /* X9/Retaining */
+	if (bidi_it->ignore_bn_limit <= 0)
+	  {
+	    if (current_level <= BIDI_MAXLEVEL - 4)
+	      {
+		/* Compute the least odd embedding level greater than
+		   the current level.  */
+		new_level = ((current_level + 1) & ~1) + 1;
+		if (bidi_it->type_after_w1 == RLE)
+		  override = NEUTRAL_DIR;
+		else
+		  override = R2L;
+		if (current_level == BIDI_MAXLEVEL - 4)
+		  bidi_it->invalid_rl_levels = 0;
+		bidi_push_embedding_level (bidi_it, new_level, override);
+	      }
+	    else
+	      {
+		bidi_it->invalid_levels++;
+		/* See the commentary about invalid_rl_levels below.  */
+		if (bidi_it->invalid_rl_levels < 0)
+		  bidi_it->invalid_rl_levels = 0;
+		bidi_it->invalid_rl_levels++;
+	      }
+	  }
+	else if (bidi_it->prev.type_after_w1 == WEAK_EN /* W5/Retaining */
+		 || bidi_it->next_en_pos > bidi_it->charpos)
+	  type = WEAK_EN;
+	break;
+      case LRE:	/* X3 */
+      case LRO:	/* X5 */
+	bidi_it->type_after_w1 = type;
+	bidi_check_type (bidi_it->type_after_w1);
+	type = WEAK_BN; /* X9/Retaining */
+	if (bidi_it->ignore_bn_limit <= 0)
+	  {
+	    if (current_level <= BIDI_MAXLEVEL - 5)
+	      {
+		/* Compute the least even embedding level greater than
+		   the current level.  */
+		new_level = ((current_level + 2) & ~1);
+		if (bidi_it->type_after_w1 == LRE)
+		  override = NEUTRAL_DIR;
+		else
+		  override = L2R;
+		bidi_push_embedding_level (bidi_it, new_level, override);
+	      }
+	    else
+	      {
+		bidi_it->invalid_levels++;
+		/* invalid_rl_levels counts invalid levels encountered
+		   while the embedding level was already too high for
+		   LRE/LRO, but not for RLE/RLO.  That is because
+		   there may be exactly one PDF which we should not
+		   ignore even though invalid_levels is non-zero.
+		   invalid_rl_levels helps to know what PDF is
+		   that.  */
+		if (bidi_it->invalid_rl_levels >= 0)
+		  bidi_it->invalid_rl_levels++;
+	      }
+	  }
+	else if (bidi_it->prev.type_after_w1 == WEAK_EN /* W5/Retaining */
+		 || bidi_it->next_en_pos > bidi_it->charpos)
+	  type = WEAK_EN;
+	break;
+      case PDF:	/* X7 */
+	bidi_it->type_after_w1 = type;
+	bidi_check_type (bidi_it->type_after_w1);
+	type = WEAK_BN; /* X9/Retaining */
+	if (bidi_it->ignore_bn_limit <= 0)
+	  {
+	    if (!bidi_it->invalid_rl_levels)
+	      {
+		new_level = bidi_pop_embedding_level (bidi_it);
+		bidi_it->invalid_rl_levels = -1;
+		if (bidi_it->invalid_levels)
+		  bidi_it->invalid_levels--;
+		/* else nothing: UAX#9 says to ignore invalid PDFs */
+	      }
+	    if (!bidi_it->invalid_levels)
+	      new_level = bidi_pop_embedding_level (bidi_it);
+	    else
+	      {
+		bidi_it->invalid_levels--;
+		bidi_it->invalid_rl_levels--;
+	      }
+	  }
+	else if (bidi_it->prev.type_after_w1 == WEAK_EN /* W5/Retaining */
+		 || bidi_it->next_en_pos > bidi_it->charpos)
+	  type = WEAK_EN;
+	break;
+      default:
+	/* Nothing.  */
+	break;
+    }
+
+  bidi_it->type = type;
+  bidi_check_type (bidi_it->type);
+
+  return new_level;
+}
+
+/* Given an iterator state in BIDI_IT, advance one character position
+   in the buffer to the next character (in the logical order), resolve
+   any explicit embeddings and directional overrides, and return the
+   embedding level of the character after resolving explicit
+   directives and ignoring empty embeddings.  */
+static int
+bidi_resolve_explicit (struct bidi_it *bidi_it)
+{
+  int prev_level = bidi_it->level_stack[bidi_it->stack_idx].level;
+  int new_level  = bidi_resolve_explicit_1 (bidi_it);
+
+  if (prev_level < new_level
+      && bidi_it->type == WEAK_BN
+      && bidi_it->ignore_bn_limit == 0 /* only if not already known */
+      && bidi_it->ch != BIDI_EOB       /* not already at EOB */
+      && bidi_explicit_dir_char (FETCH_CHAR (bidi_it->bytepos
+					     + bidi_it->ch_len)))
+    {
+      /* Avoid pushing and popping embedding levels if the level run
+	 is empty, as this breaks level runs where it shouldn't.
+	 UAX#9 removes all the explicit embedding and override codes,
+	 so empty embeddings disappear without a trace.  We need to
+	 behave as if we did the same.  */
+      struct bidi_it saved_it;
+      int level = prev_level;
+
+      bidi_copy_it (&saved_it, bidi_it);
+
+      while (bidi_explicit_dir_char (FETCH_CHAR (bidi_it->bytepos
+						 + bidi_it->ch_len)))
+	{
+	  level = bidi_resolve_explicit_1 (bidi_it);
+	}
+
+      if (level == prev_level)	/* empty embedding */
+	saved_it.ignore_bn_limit = bidi_it->charpos + 1;
+      else			/* this embedding is non-empty */
+	saved_it.ignore_bn_limit = -1;
+
+      bidi_copy_it (bidi_it, &saved_it);
+      if (bidi_it->ignore_bn_limit > 0)
+	{
+	  /* We pushed a level, but we shouldn't have.  Undo that. */
+	  if (!bidi_it->invalid_rl_levels)
+	    {
+	      new_level = bidi_pop_embedding_level (bidi_it);
+	      bidi_it->invalid_rl_levels = -1;
+	      if (bidi_it->invalid_levels)
+		bidi_it->invalid_levels--;
+	    }
+	  if (!bidi_it->invalid_levels)
+	    new_level = bidi_pop_embedding_level (bidi_it);
+	  else
+	    {
+	      bidi_it->invalid_levels--;
+	      bidi_it->invalid_rl_levels--;
+	    }
+	}
+    }
+
+  if (bidi_it->type == NEUTRAL_B)	/* X8 */
+    {
+      bidi_set_paragraph_end (bidi_it);
+      /* This is needed by bidi_resolve_weak below, and in L1.  */
+      bidi_it->type_after_w1 = bidi_it->type;
+      bidi_check_type (bidi_it->type_after_w1);
+    }
+
+  return new_level;
+}
+
+/* Advance in the buffer, resolve weak types and return the type of
+   the next character after weak type resolution.  */
+bidi_type_t
+bidi_resolve_weak (struct bidi_it *bidi_it)
+{
+  bidi_type_t type;
+  bidi_dir_t override;
+  int prev_level = bidi_it->level_stack[bidi_it->stack_idx].level;
+  int new_level  = bidi_resolve_explicit (bidi_it);
+  int next_char;
+  bidi_type_t type_of_next;
+  struct bidi_it saved_it;
+
+  type = bidi_it->type;
+  override = bidi_it->level_stack[bidi_it->stack_idx].override;
+
+  if (type == UNKNOWN_BT
+      || type == LRE
+      || type == LRO
+      || type == RLE
+      || type == RLO
+      || type == PDF)
+    abort ();
+
+  if (new_level != prev_level
+      || bidi_it->type == NEUTRAL_B)
+    {
+      /* We've got a new embedding level run, compute the directional
+         type of sor and initialize per-run variables (UAX#9, clause
+         X10).  */
+      bidi_set_sor_type (bidi_it, prev_level, new_level);
+    }
+  else if (type == NEUTRAL_S || type == NEUTRAL_WS
+	   || type == WEAK_BN || type == STRONG_AL)
+    bidi_it->type_after_w1 = type;	/* needed in L1 */
+  bidi_check_type (bidi_it->type_after_w1);
+
+  /* Level and directional override status are already recorded in
+     bidi_it, and do not need any change; see X6.  */
+  if (override == R2L)		/* X6 */
+    type = STRONG_R;
+  else if (override == L2R)
+    type = STRONG_L;
+  else
+    {
+      if (type == WEAK_NSM)	/* W1 */
+	{
+	  /* Note that we don't need to consider the case where the
+	     prev character has its type overridden by an RLO or LRO:
+	     such characters are outside the current level run, and
+	     thus not relevant to this NSM.  Thus, NSM gets the
+	     orig_type of the previous character.  */
+	  if (bidi_it->prev.type != UNKNOWN_BT)
+	    type = bidi_it->prev.orig_type;
+	  else if (bidi_it->sor == R2L)
+	    type = STRONG_R;
+	  else if (bidi_it->sor == L2R)
+	    type = STRONG_L;
+	  else /* shouldn't happen! */
+	    abort ();
+	}
+      if (type == WEAK_EN	/* W2 */
+	  && bidi_it->last_strong.type_after_w1 == STRONG_AL)
+	type = WEAK_AN;
+      else if (type == STRONG_AL) /* W3 */
+	type = STRONG_R;
+      else if ((type == WEAK_ES	/* W4 */
+		&& bidi_it->prev.type_after_w1 == WEAK_EN
+		&& bidi_it->prev.orig_type == WEAK_EN)
+	       || (type == WEAK_CS
+		   && ((bidi_it->prev.type_after_w1 == WEAK_EN
+			&& bidi_it->prev.orig_type == WEAK_EN)
+		       || bidi_it->prev.type_after_w1 == WEAK_AN)))
+	{
+	  next_char =
+	    bidi_it->bytepos + bidi_it->ch_len >= ZV_BYTE
+	    ? BIDI_EOB : FETCH_CHAR (bidi_it->bytepos + bidi_it->ch_len);
+	  type_of_next = bidi_get_type (next_char, override);
+
+	  if (type_of_next == WEAK_BN
+	      || bidi_explicit_dir_char (next_char))
+	    {
+	      bidi_copy_it (&saved_it, bidi_it);
+	      while (bidi_resolve_explicit (bidi_it) == new_level
+		     && bidi_it->type == WEAK_BN)
+		;
+	      type_of_next = bidi_it->type;
+	      bidi_copy_it (bidi_it, &saved_it);
+	    }
+
+	  /* If the next character is EN, but the last strong-type
+	     character is AL, that next EN will be changed to AN when
+	     we process it in W2 above.  So in that case, this ES
+	     should not be changed into EN.  */
+	  if (type == WEAK_ES
+	      && type_of_next == WEAK_EN
+	      && bidi_it->last_strong.type_after_w1 != STRONG_AL)
+	    type = WEAK_EN;
+	  else if (type == WEAK_CS)
+	    {
+	      if (bidi_it->prev.type_after_w1 == WEAK_AN
+		  && (type_of_next == WEAK_AN
+		      /* If the next character is EN, but the last
+			 strong-type character is AL, EN will be later
+			 changed to AN when we process it in W2 above.
+			 So in that case, this ES should not be
+			 changed into EN.  */
+		      || (type_of_next == WEAK_EN
+			  && bidi_it->last_strong.type_after_w1 == STRONG_AL)))
+		type = WEAK_AN;
+	      else if (bidi_it->prev.type_after_w1 == WEAK_EN
+		       && type_of_next == WEAK_EN
+		       && bidi_it->last_strong.type_after_w1 != STRONG_AL)
+		type = WEAK_EN;
+	    }
+	}
+      else if (type == WEAK_ET	/* W5: ET with EN before or after it */
+	       || type == WEAK_BN)	/* W5/Retaining */
+	{
+	  if (bidi_it->prev.type_after_w1 == WEAK_EN /* ET/BN w/EN before it */
+	      || bidi_it->next_en_pos > bidi_it->charpos)
+	    type = WEAK_EN;
+	  else			/* W5: ET/BN with EN after it.  */
+	    {
+	      EMACS_INT en_pos = bidi_it->charpos + 1;
+
+	      next_char =
+		bidi_it->bytepos + bidi_it->ch_len >= ZV_BYTE
+		? BIDI_EOB : FETCH_CHAR (bidi_it->bytepos + bidi_it->ch_len);
+	      type_of_next = bidi_get_type (next_char, override);
+
+	      if (type_of_next == WEAK_ET
+		  || type_of_next == WEAK_BN
+		  || bidi_explicit_dir_char (next_char))
+		{
+		  bidi_copy_it (&saved_it, bidi_it);
+		  while (bidi_resolve_explicit (bidi_it) == new_level
+			 && (bidi_it->type == WEAK_BN
+			     || bidi_it->type == WEAK_ET))
+		    ;
+		  type_of_next = bidi_it->type;
+		  en_pos = bidi_it->charpos;
+		  bidi_copy_it (bidi_it, &saved_it);
+		}
+	      if (type_of_next == WEAK_EN)
+		{
+		  /* If the last strong character is AL, the EN we've
+		     found will become AN when we get to it (W2). */
+		  if (bidi_it->last_strong.type_after_w1 != STRONG_AL)
+		    {
+		      type = WEAK_EN;
+		      /* Remember this EN position, to speed up processing
+			 of the next ETs.  */
+		      bidi_it->next_en_pos = en_pos;
+		    }
+		  else if (type == WEAK_BN)
+		    type = NEUTRAL_ON; /* W6/Retaining */
+		}
+	    }
+	}
+    }
+
+  if (type == WEAK_ES || type == WEAK_ET || type == WEAK_CS /* W6 */
+      || (type == WEAK_BN
+	  && (bidi_it->prev.type_after_w1 == WEAK_CS	    /* W6/Retaining */
+	      || bidi_it->prev.type_after_w1 == WEAK_ES
+	      || bidi_it->prev.type_after_w1 == WEAK_ET)))
+    type = NEUTRAL_ON;
+
+  /* Store the type we've got so far, before we clobber it with strong
+     types in W7 and while resolving neutral types.  But leave alone
+     the original types that were recorded above, because we will need
+     them for the L1 clause.  */
+  if (bidi_it->type_after_w1 == UNKNOWN_BT)
+    bidi_it->type_after_w1 = type;
+  bidi_check_type (bidi_it->type_after_w1);
+
+  if (type == WEAK_EN)	/* W7 */
+    {
+      if ((bidi_it->last_strong.type_after_w1 == STRONG_L)
+	  || (bidi_it->last_strong.type == UNKNOWN_BT && bidi_it->sor == L2R))
+	type = STRONG_L;
+    }
+
+  bidi_it->type = type;
+  bidi_check_type (bidi_it->type);
+  return type;
+}
+
+bidi_type_t
+bidi_resolve_neutral (struct bidi_it *bidi_it)
+{
+  int prev_level = bidi_it->level_stack[bidi_it->stack_idx].level;
+  bidi_type_t type = bidi_resolve_weak (bidi_it);
+  int current_level = bidi_it->level_stack[bidi_it->stack_idx].level;
+
+  if (!(type == STRONG_R
+	|| type == STRONG_L
+	|| type == WEAK_BN
+	|| type == WEAK_EN
+	|| type == WEAK_AN
+	|| type == NEUTRAL_B
+	|| type == NEUTRAL_S
+	|| type == NEUTRAL_WS
+	|| type == NEUTRAL_ON))
+    abort ();
+
+  if (bidi_get_category (type) == NEUTRAL
+      || (type == WEAK_BN && prev_level == current_level))
+    {
+      if (bidi_it->next_for_neutral.type != UNKNOWN_BT)
+	type = bidi_resolve_neutral_1 (bidi_it->prev_for_neutral.type,
+				       bidi_it->next_for_neutral.type,
+				       current_level);
+      else
+	{
+	  /* Arrrgh!!  The UAX#9 algorithm is too deeply entrenched in
+	     the assumption of batch-style processing; see clauses W4,
+	     W5, and especially N1, which require to look far forward
+	     (as well as back) in the buffer.  May the fleas of a
+	     thousand camels infest the armpits of those who design
+	     supposedly general-purpose algorithms by looking at their
+	     own implementations, and fail to consider other possible
+	     implementations!  */
+	  struct bidi_it saved_it;
+	  bidi_type_t next_type;
+
+	  if (bidi_it->scan_dir == -1)
+	    abort ();
+
+	  bidi_copy_it (&saved_it, bidi_it);
+	  /* Scan the text forward until we find the first non-neutral
+	     character, and then use that to resolve the neutral we
+	     are dealing with now.  We also cache the scanned iterator
+	     states, to salvage some of the effort later.  */
+	  bidi_cache_iterator_state (bidi_it, 0);
+	  do {
+	    /* Record the info about the previous character, so that
+	       it will be cached below with this state.  */
+	    if (bidi_it->type_after_w1 != WEAK_BN /* W1/Retaining */
+		&& bidi_it->type != WEAK_BN)
+	      bidi_remember_char (&bidi_it->prev, bidi_it);
+	    type = bidi_resolve_weak (bidi_it);
+	    /* Paragraph separators have their levels fully resolved
+	       at this point, so cache them as resolved.  */
+	    bidi_cache_iterator_state (bidi_it, type == NEUTRAL_B);
+	    /* FIXME: implement L1 here, by testing for a newline and
+	       resetting the level for any sequence of whitespace
+	       characters adjacent to it.  */
+	  } while (!(type == NEUTRAL_B
+		     || (type != WEAK_BN
+			 && bidi_get_category (type) != NEUTRAL)
+		     /* This is all per level run, so stop when we
+			reach the end of this level run.  */
+		     || bidi_it->level_stack[bidi_it->stack_idx].level !=
+		     current_level));
+
+	  bidi_remember_char (&saved_it.next_for_neutral, bidi_it);
+
+	  switch (type)
+	    {
+	      case STRONG_L:
+	      case STRONG_R:
+	      case STRONG_AL:
+		next_type = type;
+		break;
+	      case WEAK_EN:
+	      case WEAK_AN:
+		/* N1: ``European and Arabic numbers are treated as
+		   though they were R.''  */
+		next_type = STRONG_R;
+		saved_it.next_for_neutral.type = STRONG_R;
+		break;
+	      case WEAK_BN:
+		if (!bidi_explicit_dir_char (bidi_it->ch))
+		  abort ();		/* can't happen: BNs are skipped */
+		/* FALLTHROUGH */
+	      case NEUTRAL_B:
+		/* Marched all the way to the end of this level run.
+		   We need to use the eor type, whose information is
+		   stored by bidi_set_sor_type in the prev_for_neutral
+		   member.  */
+		if (saved_it.type != WEAK_BN
+		    || bidi_get_category (bidi_it->prev.type_after_w1) == NEUTRAL)
+		  {
+		    next_type = bidi_it->prev_for_neutral.type;
+		    saved_it.next_for_neutral.type = next_type;
+		    bidi_check_type (next_type);
+		  }
+		else
+		  {
+		    /* This is a BN which does not adjoin neutrals.
+		       Leave its type alone.  */
+		    bidi_copy_it (bidi_it, &saved_it);
+		    return bidi_it->type;
+		  }
+		break;
+	      default:
+		abort ();
+	    }
+	  type = bidi_resolve_neutral_1 (saved_it.prev_for_neutral.type,
+					 next_type, current_level);
+	  saved_it.type = type;
+	  bidi_check_type (type);
+	  bidi_copy_it (bidi_it, &saved_it);
+	}
+    }
+  return type;
+}
+
+/* Given an iterator state in BIDI_IT, advance one character position
+   in the buffer to the next character (in the logical order), resolve
+   the bidi type of that next character, and return that type.  */
+bidi_type_t
+bidi_type_of_next_char (struct bidi_it *bidi_it)
+{
+  bidi_type_t type;
+
+  /* This should always be called during a forward scan.  */
+  if (bidi_it->scan_dir != 1)
+    abort ();
+
+  /* Reset the limit until which to ignore BNs if we step out of the
+     area where we found only empty levels.  */
+  if ((bidi_it->ignore_bn_limit > 0
+       && bidi_it->ignore_bn_limit <= bidi_it->charpos)
+      || (bidi_it->ignore_bn_limit == -1
+	  && !bidi_explicit_dir_char (bidi_it->ch)))
+    bidi_it->ignore_bn_limit = 0;
+
+  type = bidi_resolve_neutral (bidi_it);
+
+  return type;
+}
+
+/* Given an iterator state BIDI_IT, advance one character position in
+   the buffer to the next character (in the logical order), resolve
+   the embedding and implicit levels of that next character, and
+   return the resulting level.  */
+int
+bidi_level_of_next_char (struct bidi_it *bidi_it)
+{
+  bidi_type_t type;
+  int level, prev_level = -1;
+  struct bidi_saved_info next_for_neutral;
+
+  if (bidi_it->scan_dir == 1)
+    {
+      /* There's no sense in trying to advance if we hit end of text.  */
+      if (bidi_it->ch == BIDI_EOB)
+	return bidi_it->resolved_level;
+
+      /* Record the info about the previous character.  */
+      if (bidi_it->type_after_w1 != WEAK_BN /* W1/Retaining */
+	  && bidi_it->type != WEAK_BN)
+	bidi_remember_char (&bidi_it->prev, bidi_it);
+      if (bidi_it->type_after_w1 == STRONG_R
+	  || bidi_it->type_after_w1 == STRONG_L
+	  || bidi_it->type_after_w1 == STRONG_AL)
+	bidi_remember_char (&bidi_it->last_strong, bidi_it);
+      /* FIXME: it sounds like we don't need both prev and
+	 prev_for_neutral members, but I'm leaving them both for now.  */
+      if (bidi_it->type == STRONG_R || bidi_it->type == STRONG_L
+	  || bidi_it->type == WEAK_EN || bidi_it->type == WEAK_AN)
+	bidi_remember_char (&bidi_it->prev_for_neutral, bidi_it);
+
+      /* If we overstepped the characters used for resolving neutrals
+	 and whitespace, invalidate their info in the iterator.  */
+      if (bidi_it->charpos >= bidi_it->next_for_neutral.charpos)
+	bidi_it->next_for_neutral.type = UNKNOWN_BT;
+      if (bidi_it->next_en_pos >= 0
+	  && bidi_it->charpos >= bidi_it->next_en_pos)
+	bidi_it->next_en_pos = -1;
+      if (bidi_it->next_for_ws.type != UNKNOWN_BT
+	  && bidi_it->charpos >= bidi_it->next_for_ws.charpos)
+	bidi_it->next_for_ws.type = UNKNOWN_BT;
+
+      /* This must be taken before we fill the iterator with the info
+	 about the next char.  If we scan backwards, the iterator
+	 state must be already cached, so there's no need to know the
+	 embedding level of the previous character, since we will be
+	 returning to our caller shortly.  */
+      prev_level = bidi_it->level_stack[bidi_it->stack_idx].level;
+    }
+  next_for_neutral = bidi_it->next_for_neutral;
+
+  /* Perhaps it is already cached.  */
+  type = bidi_cache_find (bidi_it->charpos + bidi_it->scan_dir, -1, bidi_it);
+  if (type != UNKNOWN_BT)
+    {
+      /* Don't lose the information for resolving neutrals!  The
+	 cached states could have been cached before their
+	 next_for_neutral member was computed.  If we are on our way
+	 forward, we can simply take the info from the previous
+	 state.  */
+      if (bidi_it->scan_dir == 1
+	  && bidi_it->next_for_neutral.type == UNKNOWN_BT)
+	bidi_it->next_for_neutral = next_for_neutral;
+
+      /* If resolved_level is -1, it means this state was cached
+	 before it was completely resolved, so we cannot return
+	 it.  */
+      if (bidi_it->resolved_level != -1)
+	return bidi_it->resolved_level;
+    }
+  if (bidi_it->scan_dir == -1)
+    /* If we are going backwards, the iterator state is already cached
+       from previous scans, and should be fully resolved.  */
+    abort ();
+
+  if (type == UNKNOWN_BT)
+    type = bidi_type_of_next_char (bidi_it);
+
+  if (type == NEUTRAL_B)
+    return bidi_it->resolved_level;
+
+  level = bidi_it->level_stack[bidi_it->stack_idx].level;
+  if ((bidi_get_category (type) == NEUTRAL /* && type != NEUTRAL_B */)
+      || (type == WEAK_BN && prev_level == level))
+    {
+      if (bidi_it->next_for_neutral.type == UNKNOWN_BT)
+	abort ();
+
+      /* If the cached state shows a neutral character, it was not
+	 resolved by bidi_resolve_neutral, so do it now.  */
+      type = bidi_resolve_neutral_1 (bidi_it->prev_for_neutral.type,
+				     bidi_it->next_for_neutral.type,
+				     level);
+    }
+
+  if (!(type == STRONG_R
+	|| type == STRONG_L
+	|| type == WEAK_BN
+	|| type == WEAK_EN
+	|| type == WEAK_AN))
+    abort ();
+  bidi_it->type = type;
+  bidi_check_type (bidi_it->type);
+
+  /* For L1 below, we need to know, for each WS character, whether
+     it belongs to a sequence of WS characters preceeding a newline
+     or a TAB or a paragraph separator.  */
+  if (bidi_it->orig_type == NEUTRAL_WS
+      && bidi_it->next_for_ws.type == UNKNOWN_BT)
+    {
+      int ch;
+      int clen = bidi_it->ch_len;
+      EMACS_INT bpos = bidi_it->bytepos;
+      EMACS_INT cpos = bidi_it->charpos;
+      bidi_type_t chtype;
+
+      do {
+	/*_fetch_multibyte_char_len = 1;*/
+	ch = bpos + clen >= ZV_BYTE ? BIDI_EOB : FETCH_CHAR (bpos + clen);
+	bpos += clen;
+	cpos++;
+	clen = (ch == BIDI_EOB ? 1 : CHAR_BYTES (ch));
+	if (ch == '\n' || ch == BIDI_EOB /* || ch == LINESEP_CHAR */)
+	  chtype = NEUTRAL_B;
+	else
+	  chtype = bidi_get_type (ch, NEUTRAL_DIR);
+      } while (chtype == NEUTRAL_WS || chtype == WEAK_BN
+	       || bidi_explicit_dir_char (ch)); /* L1/Retaining */
+      bidi_it->next_for_ws.type = chtype;
+      bidi_check_type (bidi_it->next_for_ws.type);
+      bidi_it->next_for_ws.charpos = cpos;
+      bidi_it->next_for_ws.bytepos = bpos;
+    }
+
+  /* Resolve implicit levels, with a twist: PDFs get the embedding
+     level of the enbedding they terminate.  See below for the
+     reason.  */
+  if (bidi_it->orig_type == PDF
+      /* Don't do this if this formatting code didn't change the
+	 embedding level due to invalid or empty embeddings.  */
+      && prev_level != level)
+    {
+      /* Don't look in UAX#9 for the reason for this: it's our own
+	 private quirk.  The reason is that we want the formatting
+	 codes to be delivered so that they bracket the text of their
+	 embedding.  For example, given the text
+
+	     {RLO}teST{PDF}
+
+	 we want it to be displayed as
+
+	     {RLO}STet{PDF}
+
+	 not as
+
+	     STet{RLO}{PDF}
+
+	 which will result because we bump up the embedding level as
+	 soon as we see the RLO and pop it as soon as we see the PDF,
+	 so RLO itself has the same embedding level as "teST", and
+	 thus would be normally delivered last, just before the PDF.
+	 The switch below fiddles with the level of PDF so that this
+	 ugly side effect does not happen.
+
+	 (This is, of course, only important if the formatting codes
+	 are actually displayed, but Emacs does need to display them
+	 if the user wants to.)  */
+      level = prev_level;
+    }
+  else if (bidi_it->orig_type == NEUTRAL_B /* L1 */
+	   || bidi_it->orig_type == NEUTRAL_S
+	   || bidi_it->ch == '\n' || bidi_it->ch == BIDI_EOB
+	   /* || bidi_it->ch == LINESEP_CHAR */
+	   || (bidi_it->orig_type == NEUTRAL_WS
+	       && (bidi_it->next_for_ws.type == NEUTRAL_B
+		   || bidi_it->next_for_ws.type == NEUTRAL_S)))
+    level = bidi_it->level_stack[0].level;
+  else if ((level & 1) == 0) /* I1 */
+    {
+      if (type == STRONG_R)
+	level++;
+      else if (type == WEAK_EN || type == WEAK_AN)
+	level += 2;
+    }
+  else			/* I2 */
+    {
+      if (type == STRONG_L || type == WEAK_EN || type == WEAK_AN)
+	level++;
+    }
+
+  bidi_it->resolved_level = level;
+  return level;
+}
+
+/* Move to the other edge of a level given by LEVEL.  If END_FLAG is
+   non-zero, we are at the end of a level, and we need to prepare to
+   resume the scan of the lower level.
+
+   If this level's other edge is cached, we simply jump to it, filling
+   the iterator structure with the iterator state on the other edge.
+   Otherwise, we walk the buffer until we come back to the same level
+   as LEVEL.
+
+   Note: we are not talking here about a ``level run'' in the UAX#9
+   sense of the term, but rather about a ``level'' which includes
+   all the levels higher than it.  In other words, given the levels
+   like this:
+
+         11111112222222333333334443343222222111111112223322111
+                A      B                    C
+
+   and assuming we are at point A scanning left to right, this
+   function moves to point C, whereas the UAX#9 ``level 2 run'' ends
+   at point B.  */
+static void
+bidi_find_other_level_edge (struct bidi_it *bidi_it, int level, int end_flag)
+{
+  int dir = end_flag ? -bidi_it->scan_dir : bidi_it->scan_dir;
+  int idx;
+
+  /* Try the cache first.  */
+  if ((idx = bidi_cache_find_level_change (level, dir, end_flag)) >= 0)
+    bidi_cache_fetch_state (idx, bidi_it);
+  else
+    {
+      int new_level;
+
+      if (end_flag)
+	abort (); /* if we are at end of level, its edges must be cached */
+
+      bidi_cache_iterator_state (bidi_it, 1);
+      do {
+	new_level = bidi_level_of_next_char (bidi_it);
+	bidi_cache_iterator_state (bidi_it, 1);
+      } while (new_level >= level);
+    }
+}
+
+void
+bidi_get_next_char_visually (struct bidi_it *bidi_it)
+{
+  int old_level, new_level, next_level;
+  struct bidi_it sentinel;
+
+  if (bidi_it->scan_dir == 0)
+    {
+      bidi_it->scan_dir = 1;	/* default to logical order */
+    }
+
+  /* If we just passed a newline, initialize for the next line.  */
+  if (!bidi_it->first_elt && bidi_it->orig_type == NEUTRAL_B)
+    bidi_line_init (bidi_it);
+
+  /* Prepare the sentinel iterator state.  */
+  if (bidi_cache_idx == 0)
+    {
+      bidi_copy_it (&sentinel, bidi_it);
+      if (bidi_it->first_elt)
+	{
+	  sentinel.charpos--;	/* cached charpos needs to be monotonic */
+	  sentinel.bytepos--;
+	  sentinel.ch = '\n';	/* doesn't matter, but why not? */
+	  sentinel.ch_len = 1;
+	}
+    }
+
+  old_level = bidi_it->resolved_level;
+  new_level = bidi_level_of_next_char (bidi_it);
+
+  /* Reordering of resolved levels (clause L2) is implemented by
+     jumping to the other edge of the level and flipping direction of
+     scanning the text whenever we find a level change.  */
+  if (new_level != old_level)
+    {
+      int ascending = new_level > old_level;
+      int level_to_search = ascending ? old_level + 1 : old_level;
+      int incr = ascending ? 1 : -1;
+      int expected_next_level = old_level + incr;
+
+      /* If we don't have anything cached yet, we need to cache the
+	 sentinel state, since we'll need it to record where to jump
+	 when the last non-base level is exhausted.  */
+      if (bidi_cache_idx == 0)
+	bidi_cache_iterator_state (&sentinel, 1);
+      /* Jump (or walk) to the other edge of this level.  */
+      bidi_find_other_level_edge (bidi_it, level_to_search, !ascending);
+      /* Switch scan direction and peek at the next character in the
+	 new direction.  */
+      bidi_it->scan_dir = -bidi_it->scan_dir;
+
+      /* The following loop handles the case where the resolved level
+	 jumps by more than one.  This is typical for numbers inside a
+	 run of text with left-to-right embedding direction, but can
+	 also happen in other situations.  In those cases the decision
+	 where to continue after a level change, and in what direction,
+	 is tricky.  For example, given a text like below:
+
+	          abcdefgh
+	          11336622
+
+	 (where the numbers below the text show the resolved levels),
+	 the result of reordering according to UAX#9 should be this:
+
+		  efdcghba
+
+	 This is implemented by the loop below which flips direction
+	 and jumps to the other edge of the level each time it finds
+	 the new level not to be the expected one.  The expected level
+	 is always one more or one less than the previous one.  */
+      next_level = bidi_peek_at_next_level (bidi_it);
+      while (next_level != expected_next_level)
+	{
+	  expected_next_level += incr;
+	  level_to_search += incr;
+	  bidi_find_other_level_edge (bidi_it, level_to_search, !ascending);
+	  bidi_it->scan_dir = -bidi_it->scan_dir;
+	  next_level = bidi_peek_at_next_level (bidi_it);
+	}
+
+      /* Finally, deliver the next character in the new direction.  */
+      next_level = bidi_level_of_next_char (bidi_it);
+    }
+
+  /* Take note when we have just processed the newline that precedes
+     the end of the paragraph.  The next time we are about to be
+     called, set_iterator_to_next will automatically reinit the
+     paragraph direction, if needed.  We do this at the newline before
+     the paragraph separator, because the next character might not be
+     the first character of the next paragraph, due to the bidi
+     reordering, whereas we _must_ know the paragraph base direction
+     _before_ we process the paragraph's text, since the base
+     direction affects the reordering.  */
+  if (bidi_it->scan_dir == 1
+      && bidi_it->orig_type == NEUTRAL_B
+      && bidi_it->bytepos < ZV_BYTE)
+    {
+      EMACS_INT sep_len =
+	bidi_at_paragraph_end (bidi_it->charpos + 1,
+			       bidi_it->bytepos + bidi_it->ch_len);
+      if (sep_len >= 0)
+	{
+	  bidi_it->new_paragraph = 1;
+	  /* Record the buffer position of the last character of the
+	     paragraph separator.  */
+	  bidi_it->separator_limit = bidi_it->charpos + 1 + sep_len;
+	}
+    }
+
+  if (bidi_it->scan_dir == 1 && bidi_cache_idx)
+    {
+      /* If we are at paragraph's base embedding level and beyond the
+	 last cached position, the cache's job is done and we can
+	 discard it.  */
+      if (bidi_it->resolved_level == bidi_it->level_stack[0].level
+	  && bidi_it->charpos > bidi_cache[bidi_cache_idx - 1].charpos)
+	bidi_cache_reset ();
+	/* But as long as we are caching during forward scan, we must
+	   cache each state, or else the cache integrity will be
+	   compromised: it assumes cached states correspond to buffer
+	   positions 1:1.  */
+      else
+	bidi_cache_iterator_state (bidi_it, 1);
+    }
+}
+
+/* This is meant to be called from within the debugger, whenever you
+   wish to examine the cache contents.  */
+void
+bidi_dump_cached_states (void)
+{
+  int i;
+  int ndigits = 1;
+
+  if (bidi_cache_idx == 0)
+    {
+      fprintf (stderr, "The cache is empty.\n");
+      return;
+    }
+  fprintf (stderr, "Total of %d state%s in cache:\n",
+	   bidi_cache_idx, bidi_cache_idx == 1 ? "" : "s");
+
+  for (i = bidi_cache[bidi_cache_idx - 1].charpos; i > 0; i /= 10)
+    ndigits++;
+  fputs ("ch  ", stderr);
+  for (i = 0; i < bidi_cache_idx; i++)
+    fprintf (stderr, "%*c", ndigits, bidi_cache[i].ch);
+  fputs ("\n", stderr);
+  fputs ("lvl ", stderr);
+  for (i = 0; i < bidi_cache_idx; i++)
+    fprintf (stderr, "%*d", ndigits, bidi_cache[i].resolved_level);
+  fputs ("\n", stderr);
+  fputs ("pos ", stderr);
+  for (i = 0; i < bidi_cache_idx; i++)
+    fprintf (stderr, "%*d", ndigits, bidi_cache[i].charpos);
+  fputs ("\n", stderr);
+}
--- a/src/buffer.c	Fri Mar 26 08:01:19 2010 +0100
+++ b/src/buffer.c	Thu Apr 01 08:50:44 2010 +0200
@@ -2279,6 +2279,8 @@
   swapfield (undo_list, Lisp_Object);
   swapfield (mark, Lisp_Object);
   swapfield (enable_multibyte_characters, Lisp_Object);
+  swapfield (bidi_display_reordering, Lisp_Object);
+  swapfield (bidi_paragraph_direction, Lisp_Object);
   /* FIXME: Not sure what we should do with these *_marker fields.
      Hopefully they're just nil anyway.  */
   swapfield (pt_marker, Lisp_Object);
@@ -5206,7 +5208,9 @@
   buffer_defaults.truncate_lines = Qnil;
   buffer_defaults.word_wrap = Qnil;
   buffer_defaults.ctl_arrow = Qt;
+  buffer_defaults.bidi_display_reordering = Qnil;
   buffer_defaults.direction_reversed = Qnil;
+  buffer_defaults.bidi_paragraph_direction = Qnil;
   buffer_defaults.cursor_type = Qt;
   buffer_defaults.extra_line_spacing = Qnil;
   buffer_defaults.cursor_in_non_selected_windows = Qt;
@@ -5291,7 +5295,9 @@
   XSETFASTINT (buffer_local_flags.syntax_table, idx); ++idx;
   XSETFASTINT (buffer_local_flags.cache_long_line_scans, idx); ++idx;
   XSETFASTINT (buffer_local_flags.category_table, idx); ++idx;
+  XSETFASTINT (buffer_local_flags.bidi_display_reordering, idx); ++idx;
   XSETFASTINT (buffer_local_flags.direction_reversed, idx); ++idx;
+  XSETFASTINT (buffer_local_flags.bidi_paragraph_direction, idx); ++idx;
   XSETFASTINT (buffer_local_flags.buffer_file_coding_system, idx);
   /* Make this one a permanent local.  */
   buffer_permanent_local_flags[idx++] = 1;
@@ -5548,11 +5554,6 @@
 		     doc: /* Default value of `ctl-arrow' for buffers that do not override it.
 This is the same as (default-value 'ctl-arrow).  */);
 
-  DEFVAR_LISP_NOPRO ("default-direction-reversed",
-                     &buffer_defaults.direction_reversed,
-                     doc: /* Default value of `direction-reversed' for buffers that do not override it.
-This is the same as (default-value 'direction-reversed).  */);
-
   DEFVAR_LISP_NOPRO ("default-enable-multibyte-characters",
                      &buffer_defaults.enable_multibyte_characters,
                      doc: /* *Default value of `enable-multibyte-characters' for buffers not overriding it.
@@ -5809,11 +5810,29 @@
 
 This variable is never applied to a way of decoding a file while reading it.  */);
 
-  DEFVAR_PER_BUFFER ("direction-reversed", &current_buffer->direction_reversed,
-		     Qnil,
-		     doc: /* *Non-nil means lines in the buffer are displayed right to left.  */);
-
-  DEFVAR_PER_BUFFER ("truncate-lines", &current_buffer->truncate_lines, Qnil,
+  DEFVAR_PER_BUFFER ("direction-reversed",
+		     &current_buffer->direction_reversed, Qnil,
+		     doc: /* Non-nil means set beginning of lines at the right edge of the window.
+See also the variable `bidi-display-reordering'.  */);
+
+  DEFVAR_PER_BUFFER ("bidi-display-reordering",
+		     &current_buffer->bidi_display_reordering, Qnil,
+		     doc: /* Non-nil means reorder bidirectional text for display in the visual order.
+See also the variable `direction-reversed'.  */);
+
+  DEFVAR_PER_BUFFER ("bidi-paragraph-direction",
+		     &current_buffer->bidi_paragraph_direction, Qnil,
+		     doc: /* *If non-nil, forces directionality of text paragraphs in the buffer.
+			     
+If this is nil (the default), the direction of each paragraph is
+determined by the first strong directional character of its text.
+The values of `right-to-left' and `left-to-right' override that.
+Any other value is treated as nil.
+			     
+This variable has no effect unless the buffer's value of
+\`bidi-display-reordering' is non-nil.  */);
+
+ DEFVAR_PER_BUFFER ("truncate-lines", &current_buffer->truncate_lines, Qnil,
 		     doc: /* *Non-nil means do not display continuation lines.
 Instead, give each line of text just one screen line.
 
--- a/src/buffer.h	Fri Mar 26 08:01:19 2010 +0100
+++ b/src/buffer.h	Thu Apr 01 08:50:44 2010 +0200
@@ -662,8 +662,16 @@
   Lisp_Object word_wrap;
   /* Non-nil means display ctl chars with uparrow.  */
   Lisp_Object ctl_arrow;
-  /* Non-nil means display text from right to left.  */
+  /* Non-nil means reorder bidirectional text for display in the
+     visual order.  */
+  Lisp_Object bidi_display_reordering;
+  /* Non-nil means set beginning of lines at the right edge of
+     windows.  */
   Lisp_Object direction_reversed;
+  /* If non-nil, specifies which direction of text to force in all the
+     paragraphs of the buffer.  Nil means determine paragraph
+     direction dynamically for each paragraph.  */
+  Lisp_Object bidi_paragraph_direction;
   /* Non-nil means do selective display;
      see doc string in syms_of_buffer (buffer.c) for details.  */
   Lisp_Object selective_display;
--- a/src/cmds.c	Fri Mar 26 08:01:19 2010 +0100
+++ b/src/cmds.c	Thu Apr 01 08:50:44 2010 +0200
@@ -317,7 +317,7 @@
   return value;
 }
 
-int nonundocount;
+static int nonundocount;
 
 /* Note that there's code in command_loop_1 which typically avoids
    calling this.  */
--- a/src/dispextern.h	Fri Mar 26 08:01:19 2010 +0100
+++ b/src/dispextern.h	Thu Apr 01 08:50:44 2010 +0200
@@ -370,6 +370,16 @@
   /* Non-zero means don't display cursor here.  */
   unsigned avoid_cursor_p : 1;
 
+  /* Resolved bidirectional level of this character [0..63].  */
+  unsigned resolved_level : 5;
+
+  /* Resolved bidirectional type of this character, see enum
+     bidi_type_t below.  Note that according to UAX#9, only some
+     values (STRONG_L, STRONG_R, WEAK_AN, WEAK_EN, WEAK_BN, and
+     NEUTRAL_B) can appear in the resolved type, so we only reserve
+     space for those that can.  */
+  unsigned bidi_type : 3;
+
 #define FACE_ID_BITS	20
 
   /* Face of the glyph.  This is a realized face ID,
@@ -739,14 +749,18 @@
   /* First position in this row.  This is the text position, including
      overlay position information etc, where the display of this row
      started, and can thus be less the position of the first glyph
-     (e.g. due to invisible text or horizontal scrolling).  */
+     (e.g. due to invisible text or horizontal scrolling).  BIDI Note:
+     This is the smallest character position in the row, but not
+     necessarily the character that is the leftmost on the display.  */
   struct display_pos start;
 
   /* Text position at the end of this row.  This is the position after
      the last glyph on this row.  It can be greater than the last
      glyph position + 1, due to truncation, invisible text etc.  In an
      up-to-date display, this should always be equal to the start
-     position of the next row.  */
+     position of the next row.  BIDI Note: this is the character whose
+     buffer position is the largest, but not necessarily the rightmost
+     one on the display.  */
   struct display_pos end;
 
   /* Non-zero means the overlay arrow bitmap is on this line.
@@ -872,6 +886,10 @@
      the bottom line of the window, but not end of the buffer.  */
   unsigned indicate_bottom_line_p : 1;
 
+  /* Non-zero means the row was reversed to display text in a
+     right-to-left paragraph.  */
+  unsigned reversed_p : 1;
+
   /* Continuation lines width at the start of the row.  */
   int continuation_lines_width;
 
@@ -924,12 +942,18 @@
      (MATRIX_ROW ((MATRIX), (ROW))->used[TEXT_AREA])
 
 /* Return the character/ byte position at which the display of ROW
-   starts.  */
+   starts.  BIDI Note: this is the smallest character/byte position
+   among characters in ROW, i.e. the first logical-order character
+   displayed by ROW, which is not necessarily the smallest horizontal
+   position.  */
 
 #define MATRIX_ROW_START_CHARPOS(ROW) ((ROW)->start.pos.charpos)
 #define MATRIX_ROW_START_BYTEPOS(ROW) ((ROW)->start.pos.bytepos)
 
-/* Return the character/ byte position at which ROW ends.  */
+/* Return the character/ byte position at which ROW ends.  BIDI Note:
+   this is the largest character/byte position among characters in
+   ROW, i.e. the last logical-order character displayed by ROW, which
+   is not necessarily the largest horizontal position.  */
 
 #define MATRIX_ROW_END_CHARPOS(ROW) ((ROW)->end.pos.charpos)
 #define MATRIX_ROW_END_BYTEPOS(ROW) ((ROW)->end.pos.bytepos)
@@ -1078,17 +1102,9 @@
 
 extern int display_completed;
 
-/* Non-zero means redisplay has been performed directly (see also
-   direct_output_for_insert and direct_output_forward_char), so that
-   no further updating has to be performed.  The function
-   redisplay_internal checks this flag, and does nothing but reset it
-   to zero if it is non-zero.  */
-
-extern int redisplay_performed_directly_p;
-
 /* A temporary storage area, including a row of glyphs.  Initialized
    in xdisp.c.  Used for various purposes, as an example see
-   direct_output_for_insert.  */
+   get_overlay_arrow_glyph_row.  */
 
 extern struct glyph_row scratch_glyph_row;
 
@@ -1702,7 +1718,93 @@
 
 extern int face_change_count;
 
-
+/* For reordering of bidirectional text.  */
+#define BIDI_MAXLEVEL 64
+
+/* Data type for describing the bidirectional character types.  The
+   first 7 must be at the beginning, because they are the only values
+   valid in the `bidi_type' member of `struct glyph'; we only reserve
+   3 bits for it, so we cannot use there values larger than 7.  */
+typedef enum {
+  UNKNOWN_BT = 0,
+  STRONG_L,	/* strong left-to-right */
+  STRONG_R,	/* strong right-to-left */
+  WEAK_EN,	/* european number */
+  WEAK_AN,	/* arabic number */
+  WEAK_BN,	/* boundary neutral */
+  NEUTRAL_B,	/* paragraph separator */
+  STRONG_AL,	/* arabic right-to-left letter */
+  LRE,		/* left-to-right embedding */
+  LRO,		/* left-to-right override */
+  RLE,		/* right-to-left embedding */
+  RLO,		/* right-to-left override */
+  PDF,		/* pop directional format */
+  WEAK_ES,	/* european number separator */
+  WEAK_ET,	/* european number terminator */
+  WEAK_CS,	/* common separator */
+  WEAK_NSM,	/* non-spacing mark */
+  NEUTRAL_S,	/* segment separator */
+  NEUTRAL_WS,	/* whitespace */
+  NEUTRAL_ON	/* other neutrals */
+} bidi_type_t;
+
+/* The basic directionality data type.  */
+typedef enum { NEUTRAL_DIR, L2R, R2L } bidi_dir_t;
+
+/* Data type for storing information about characters we need to
+   remember.  */
+struct bidi_saved_info {
+  int bytepos, charpos;		/* character's buffer position */
+  bidi_type_t type;		/* character's resolved bidi type */
+  bidi_type_t type_after_w1;	/* original type of the character, after W1 */
+  bidi_type_t orig_type;	/* type as we found it in the buffer */
+};
+
+/* Data type for keeping track of saved embedding levels and override
+   status information.  */
+struct bidi_stack {
+  int level;
+  bidi_dir_t override;
+};
+
+/* Data type for iterating over bidi text.  */
+struct bidi_it {
+  EMACS_INT bytepos;		/* iterator's position in buffer */
+  EMACS_INT charpos;
+  int ch;			/* character itself */
+  int ch_len;			/* length of its multibyte sequence */
+  bidi_type_t type;		/* bidi type of this character, after
+				   resolving weak and neutral types */
+  bidi_type_t type_after_w1;	/* original type, after overrides and W1 */
+  bidi_type_t orig_type;	/* original type, as found in the buffer */
+  int resolved_level;		/* final resolved level of this character */
+  int invalid_levels;		/* how many PDFs to ignore */
+  int invalid_rl_levels;	/* how many PDFs from RLE/RLO to ignore */
+  int prev_was_pdf;		/* if non-zero, previous char was PDF */
+  struct bidi_saved_info prev;	/* info about previous character */
+  struct bidi_saved_info last_strong; /* last-seen strong directional char */
+  struct bidi_saved_info next_for_neutral; /* surrounding characters for... */
+  struct bidi_saved_info prev_for_neutral; /* ...resolving neutrals */
+  struct bidi_saved_info next_for_ws; /* character after sequence of ws */
+  EMACS_INT next_en_pos;	/* position of next EN char for ET */
+  EMACS_INT ignore_bn_limit;	/* position until which to ignore BNs */
+  bidi_dir_t sor;		/* direction of start-of-run in effect */
+  int scan_dir;			/* direction of text scan */
+  int stack_idx;		/* index of current data on the stack */
+  /* Note: Everything from here on is not copied/saved when the bidi
+     iterator state is saved, pushed, or popped.  So only put here
+     stuff that is not part of the bidi iterator's state!  */
+  struct bidi_stack level_stack[BIDI_MAXLEVEL]; /* stack of embedding levels */
+  int first_elt;		/* if non-zero, examine current char first */
+  bidi_dir_t paragraph_dir;	/* current paragraph direction */
+  int new_paragraph;		/* if non-zero, we expect a new paragraph */
+  EMACS_INT separator_limit;	/* where paragraph separator should end */
+};
+
+/* Value is non-zero when the bidi iterator is at base paragraph
+   embedding level.  */
+#define BIDI_AT_BASE_LEVEL(BIDI_IT) \
+  ((BIDI_IT).resolved_level == (BIDI_IT).level_stack[0].level)
 
 
 /***********************************************************************
@@ -1854,7 +1956,7 @@
   NUM_IT_METHODS
 };
 
-#define IT_STACK_SIZE 4
+#define IT_STACK_SIZE 5
 
 /* Iterator for composition (both for static and automatic).  */
 struct composition_it
@@ -1902,6 +2004,14 @@
      text, overlay strings, end of text etc., which see.  */
   EMACS_INT stop_charpos;
 
+  /* Previous stop position, i.e. the last one before the current
+     iterator position in `current'.  */
+  EMACS_INT prev_stop;
+
+  /* Last stop position iterated across whose bidi embedding level is
+     equal to the current paragraph's base embedding level.  */
+  EMACS_INT base_level_stop;
+
   /* Maximum string or buffer position + 1.  ZV when iterating over
      current_buffer.  */
   EMACS_INT end_charpos;
@@ -2008,6 +2118,8 @@
     int string_nchars;
     EMACS_INT end_charpos;
     EMACS_INT stop_charpos;
+    EMACS_INT prev_stop;
+    EMACS_INT base_level_stop;
     struct composition_it cmp_it;
     int face_id;
 
@@ -2207,6 +2319,14 @@
      incremented/reset by display_line, move_it_to etc.  */
   int continuation_lines_width;
 
+  /* Buffer position that ends the buffer text line being iterated.
+     This is normally the position after the newline at EOL.  If this
+     is the last line of the buffer and it doesn't have a newline,
+     value is ZV/ZV_BYTE.  Set and used only if IT->bidi_p, for
+     setting the end position of glyph rows produced for continuation
+     lines, see display_line.  */
+  struct text_pos eol_pos;
+
   /* Current y-position.  Automatically incremented by the height of
      glyph_row in move_it_to and display_line.  */
   int current_y;
@@ -2233,6 +2353,14 @@
 
   /* Face of the right fringe glyph.  */
   unsigned right_user_fringe_face_id : FACE_ID_BITS;
+
+  /* Non-zero means we need to reorder bidirectional text for display
+     in the visual order.  */
+  int bidi_p;
+
+  /* For iterating over bidirectional text.  */
+  struct bidi_it bidi_it;
+  bidi_dir_t paragraph_embedding;
 };
 
 
@@ -2263,6 +2391,13 @@
 #define PRODUCE_GLYPHS(IT)                              \
   do {                                                  \
     extern int inhibit_free_realized_faces;             \
+    if ((IT)->glyph_row != NULL && (IT)->bidi_p)	\
+      {							\
+        if ((IT)->bidi_it.paragraph_dir == R2L)		\
+	  (IT)->glyph_row->reversed_p = 1;		\
+	else						\
+	  (IT)->glyph_row->reversed_p = 0;		\
+      }							\
     if (FRAME_RIF ((IT)->f) != NULL)                    \
       FRAME_RIF ((IT)->f)->produce_glyphs ((IT));       \
     else                                                \
@@ -2704,12 +2839,20 @@
 			  Function Prototypes
  ***********************************************************************/
 
+/* Defined in bidi.c */
+
+extern void bidi_init_it P_ ((EMACS_INT, EMACS_INT, struct bidi_it *));
+extern void bidi_get_next_char_visually P_ ((struct bidi_it *));
+extern void bidi_paragraph_init P_ ((bidi_dir_t, struct bidi_it *));
+extern int  bidi_mirror_char P_ ((int));
+
 /* Defined in xdisp.c */
 
 struct glyph_row *row_containing_pos P_ ((struct window *, int,
 					  struct glyph_row *,
 					  struct glyph_row *, int));
-int string_buffer_position P_ ((struct window *, Lisp_Object, int));
+EMACS_INT string_buffer_position P_ ((struct window *, Lisp_Object,
+				      EMACS_INT));
 int line_bottom_y P_ ((struct it *));
 int display_prop_intangible_p P_ ((Lisp_Object));
 void resize_echo_area_exactly P_ ((void));
@@ -3021,8 +3164,6 @@
 extern void cancel_line P_ ((int, struct frame *));
 extern void init_desired_glyphs P_ ((struct frame *));
 extern int scroll_frame_lines P_ ((struct frame *, int, int, int, int));
-extern int direct_output_for_insert P_ ((int));
-extern int direct_output_forward_char P_ ((int));
 extern int update_frame P_ ((struct frame *, int, int));
 extern int scrolling P_ ((struct frame *));
 extern void bitch_at_user P_ ((void));
@@ -3049,8 +3190,6 @@
 void redraw_frame P_ ((struct frame *));
 void redraw_garbaged_frames P_ ((void));
 int scroll_cost P_ ((struct frame *, int, int, int));
-int direct_output_for_insert P_ ((int));
-int direct_output_forward_char P_ ((int));
 int update_frame P_ ((struct frame *, int, int));
 void update_single_window P_ ((struct window *, int));
 int scrolling P_ ((struct frame *));
--- a/src/dispnew.c	Fri Mar 26 08:01:19 2010 +0100
+++ b/src/dispnew.c	Thu Apr 01 08:50:44 2010 +0200
@@ -302,12 +302,6 @@
 
 struct glyph space_glyph;
 
-/* Non-zero means update has been performed directly, so that there's
-   no need for redisplay_internal to do much work.  Set by
-   direct_output_for_insert.  */
-
-int redisplay_performed_directly_p;
-
 /* Counts of allocated structures.  These counts serve to diagnose
    memory leaks and double frees.  */
 
@@ -1388,8 +1382,11 @@
 {
   if (!row->enabled_p)
     {
+      unsigned rp = row->reversed_p;
+
       clear_glyph_row (row);
       row->enabled_p = 1;
+      row->reversed_p = rp;
     }
 }
 
@@ -1540,6 +1537,7 @@
 	  || a->overlapped_p != b->overlapped_p
 	  || (MATRIX_ROW_CONTINUATION_LINE_P (a)
 	      != MATRIX_ROW_CONTINUATION_LINE_P (b))
+	  || a->reversed_p != b->reversed_p
 	  /* Different partially visible characters on left margin.  */
 	  || a->x != b->x
 	  /* Different height.  */
@@ -3452,395 +3450,6 @@
 
 
 /***********************************************************************
-			  Direct Operations
- ***********************************************************************/
-
-/* Try to update display and current glyph matrix directly.
-
-   This function is called after a character G has been inserted into
-   current_buffer.  It tries to update the current glyph matrix and
-   perform appropriate screen output to reflect the insertion.  If it
-   succeeds, the global flag redisplay_performed_directly_p will be
-   set to 1, and thereby prevent the more costly general redisplay
-   from running (see redisplay_internal).
-
-   This function is not called for `hairy' character insertions.
-   In particular, it is not called when after or before change
-   functions exist, like they are used by font-lock.  See keyboard.c
-   for details where this function is called.  */
-
-int
-direct_output_for_insert (g)
-     int g;
-{
-  register struct frame *f = SELECTED_FRAME ();
-  struct window *w = XWINDOW (selected_window);
-  struct it it, it2;
-  struct glyph_row *glyph_row;
-  struct glyph *glyphs, *glyph, *end;
-  int n;
-  /* Non-null means that redisplay of W is based on window matrices.  */
-  int window_redisplay_p = FRAME_WINDOW_P (f);
-  /* Non-null means we are in overwrite mode.  */
-  int overwrite_p = !NILP (current_buffer->overwrite_mode);
-  int added_width;
-  struct text_pos pos;
-  int delta, delta_bytes;
-
-  /* Not done directly.  */
-  redisplay_performed_directly_p = 0;
-
-  /* Quickly give up for some common cases.  */
-  if (cursor_in_echo_area
-      /* Give up if fonts have changed.  */
-      || fonts_changed_p
-      /* Give up if face attributes have been changed.  */
-      || face_change_count
-      /* Give up if cursor position not really known.  */
-      || !display_completed
-      /* Give up if buffer appears in two places.  */
-      || buffer_shared > 1
-      /* Give up if currently displaying a message instead of the
-	 minibuffer contents.  */
-      || (EQ (selected_window, minibuf_window)
-	  && EQ (minibuf_window, echo_area_window))
-      /* Give up for hscrolled mini-buffer because display of the prompt
-	 is handled specially there (see display_line).  */
-      || (MINI_WINDOW_P (w) && XFASTINT (w->hscroll))
-      /* Give up if overwriting in the middle of a line.  */
-      || (overwrite_p
-	  && PT != ZV
-	  && FETCH_BYTE (PT) != '\n')
-      /* Give up for tabs and line ends.  */
-      || g == '\t'
-      || g == '\n'
-      || g == '\r'
-      || (g == ' ' && !NILP (current_buffer->word_wrap))
-      /* Give up if unable to display the cursor in the window.  */
-      || w->cursor.vpos < 0
-      /* Give up if we are showing a message or just cleared the message
-	 because we might need to resize the echo area window.  */
-      || !NILP (echo_area_buffer[0])
-      || !NILP (echo_area_buffer[1])
-      || (glyph_row = MATRIX_ROW (w->current_matrix, w->cursor.vpos),
-	  /* Can't do it in a continued line because continuation
-	     lines would change.  */
-	  (glyph_row->continued_p
-	   || glyph_row->exact_window_width_line_p
-	   /* Can't use this method if the line overlaps others or is
-	      overlapped by others because these other lines would
-	      have to be redisplayed.  */
-	   || glyph_row->overlapping_p
-	   || glyph_row->overlapped_p))
-      /* Can't do it for partial width windows on terminal frames
-	 because we can't clear to eol in such a window.  */
-      || (!window_redisplay_p && !WINDOW_FULL_WIDTH_P (w)))
-    return 0;
-
-  /* If we can't insert glyphs, we can use this method only
-     at the end of a line.  */
-  if (!FRAME_CHAR_INS_DEL_OK (f))
-    if (PT != ZV && FETCH_BYTE (PT_BYTE) != '\n')
-      return 0;
-
-  /* Set up a display iterator structure for W.  Glyphs will be
-     produced in scratch_glyph_row.  Current position is W's cursor
-     position.  */
-  clear_glyph_row (&scratch_glyph_row);
-  SET_TEXT_POS (pos, PT, PT_BYTE);
-  DEC_TEXT_POS (pos, !NILP (current_buffer->enable_multibyte_characters));
-  init_iterator (&it, w, CHARPOS (pos), BYTEPOS (pos), &scratch_glyph_row,
-		 DEFAULT_FACE_ID);
-
-  glyph_row = MATRIX_ROW (w->current_matrix, w->cursor.vpos);
-  if (glyph_row->mouse_face_p)
-    return 0;
-
-  /* Give up if highlighting trailing whitespace and we have trailing
-     whitespace in glyph_row.  We would have to remove the trailing
-     whitespace face in that case.  */
-  if (!NILP (Vshow_trailing_whitespace)
-      && glyph_row->used[TEXT_AREA])
-    {
-      struct glyph *last;
-
-      last = glyph_row->glyphs[TEXT_AREA] + glyph_row->used[TEXT_AREA] - 1;
-      if (last->type == STRETCH_GLYPH
-	  || (last->type == CHAR_GLYPH
-	      && last->u.ch == ' '))
-	return 0;
-    }
-
-  /* Give up if there are overlay strings at pos.  This would fail
-     if the overlay string has newlines in it.  */
-  if (STRINGP (it.string))
-    return 0;
-
-  it.hpos = w->cursor.hpos;
-  it.vpos = w->cursor.vpos;
-  it.current_x = w->cursor.x + it.first_visible_x;
-  it.current_y = w->cursor.y;
-  it.end_charpos = PT;
-  it.stop_charpos = min (PT, it.stop_charpos);
-  it.stop_charpos = max (IT_CHARPOS (it), it.stop_charpos);
-
-  /* More than one display element may be returned for PT - 1 if
-     (i) it's a control character which is translated into `\003' or
-     `^C', or (ii) it has a display table entry, or (iii) it's a
-     combination of both.  */
-  delta = delta_bytes = 0;
-  while (get_next_display_element (&it))
-    {
-      PRODUCE_GLYPHS (&it);
-
-      /* Give up if glyph doesn't fit completely on the line.  */
-      if (it.current_x >= it.last_visible_x)
-	return 0;
-
-      /* Give up if new glyph has different ascent or descent than
-	 the original row, or if it is not a character glyph.  */
-      if (glyph_row->ascent != it.ascent
-	  || glyph_row->height != it.ascent + it.descent
-	  || glyph_row->phys_ascent != it.phys_ascent
-	  || glyph_row->phys_height != it.phys_ascent + it.phys_descent
-	  || it.what != IT_CHARACTER)
-	return 0;
-
-      delta += 1;
-      delta_bytes += it.len;
-      set_iterator_to_next (&it, 1);
-    }
-
-  /* Give up if we hit the right edge of the window.  We would have
-     to insert truncation or continuation glyphs.  */
-  added_width = it.current_x - (w->cursor.x + it.first_visible_x);
-  if (glyph_row->pixel_width + added_width >= it.last_visible_x)
-    return 0;
-
-  /* Give up if there is a \t following in the line.  */
-  it2 = it;
-  it2.end_charpos = ZV;
-  it2.stop_charpos = min (it2.stop_charpos, ZV);
-  while (get_next_display_element (&it2)
-	 && !ITERATOR_AT_END_OF_LINE_P (&it2))
-    {
-      if (it2.c == '\t')
-	return 0;
-      set_iterator_to_next (&it2, 1);
-    }
-
-  /* Number of new glyphs produced.  */
-  n = it.glyph_row->used[TEXT_AREA];
-
-  /* Start and end of glyphs in original row.  */
-  glyphs = glyph_row->glyphs[TEXT_AREA] + w->cursor.hpos;
-  end = glyph_row->glyphs[1 + TEXT_AREA];
-
-  /* Make room for new glyphs, then insert them.  */
-  xassert (end - glyphs - n >= 0);
-  safe_bcopy ((char *) glyphs, (char *) (glyphs + n),
-	      (end - glyphs - n) * sizeof (*end));
-  bcopy (it.glyph_row->glyphs[TEXT_AREA], glyphs, n * sizeof *glyphs);
-  glyph_row->used[TEXT_AREA] = min (glyph_row->used[TEXT_AREA] + n,
-				    end - glyph_row->glyphs[TEXT_AREA]);
-
-  /* Compute new line width.  */
-  glyph = glyph_row->glyphs[TEXT_AREA];
-  end = glyph + glyph_row->used[TEXT_AREA];
-  glyph_row->pixel_width = glyph_row->x;
-  while (glyph < end)
-    {
-      glyph_row->pixel_width += glyph->pixel_width;
-      ++glyph;
-    }
-
-  /* Increment buffer positions for glyphs following the newly
-     inserted ones.  */
-  for (glyph = glyphs + n; glyph < end; ++glyph)
-    if (glyph->charpos > 0 && BUFFERP (glyph->object))
-      glyph->charpos += delta;
-
-  if (MATRIX_ROW_END_CHARPOS (glyph_row) > 0)
-    {
-      MATRIX_ROW_END_CHARPOS (glyph_row) += delta;
-      MATRIX_ROW_END_BYTEPOS (glyph_row) += delta_bytes;
-    }
-
-  /* Adjust positions in lines following the one we are in.  */
-  increment_matrix_positions (w->current_matrix,
-			      w->cursor.vpos + 1,
-			      w->current_matrix->nrows,
-			      delta, delta_bytes);
-
-  glyph_row->contains_overlapping_glyphs_p
-    |= it.glyph_row->contains_overlapping_glyphs_p;
-
-  glyph_row->displays_text_p = 1;
-  w->window_end_vpos = make_number (max (w->cursor.vpos,
-					 XFASTINT (w->window_end_vpos)));
-
-  if (!NILP (Vshow_trailing_whitespace))
-    highlight_trailing_whitespace (it.f, glyph_row);
-
-  /* Write glyphs.  If at end of row, we can simply call write_glyphs.
-     In the middle, we have to insert glyphs.  Note that this is now
-     implemented for X frames.  The implementation uses updated_window
-     and updated_row.  */
-  updated_row = glyph_row;
-  updated_area = TEXT_AREA;
-  update_begin (f);
-  if (FRAME_RIF (f))
-    {
-      FRAME_RIF (f)->update_window_begin_hook (w);
-
-      if (glyphs == end - n
-	  /* In front of a space added by append_space.  */
-	  || (glyphs == end - n - 1
-	      && (end - n)->charpos <= 0))
-	FRAME_RIF (f)->write_glyphs (glyphs, n);
-      else
-	FRAME_RIF (f)->insert_glyphs (glyphs, n);
-    }
-  else
-    {
-      if (glyphs == end - n)
-	write_glyphs (f, glyphs, n);
-      else
-	insert_glyphs (f, glyphs, n);
-    }
-
-  w->cursor.hpos += n;
-  w->cursor.x = it.current_x - it.first_visible_x;
-  xassert (w->cursor.hpos >= 0
-	   && w->cursor.hpos < w->desired_matrix->matrix_w);
-
-  /* How to set the cursor differs depending on whether we are
-     using a frame matrix or a window matrix.   Note that when
-     a frame matrix is used, cursor_to expects frame coordinates,
-     and the X and Y parameters are not used.  */
-  if (window_redisplay_p)
-    FRAME_RIF (f)->cursor_to (w->cursor.vpos, w->cursor.hpos,
-                              w->cursor.y, w->cursor.x);
-  else
-    {
-      int x, y;
-      x = (WINDOW_TO_FRAME_HPOS (w, w->cursor.hpos)
-	   + (INTEGERP (w->left_margin_cols)
-	      ? XFASTINT (w->left_margin_cols)
-	      : 0));
-      y = WINDOW_TO_FRAME_VPOS (w, w->cursor.vpos);
-      cursor_to (f, y, x);
-    }
-
-#ifdef HAVE_WINDOW_SYSTEM
-  update_window_fringes (w, 0);
-#endif
-
-  if (FRAME_RIF (f))
-    FRAME_RIF (f)->update_window_end_hook (w, 1, 0);
-  update_end (f);
-  updated_row = NULL;
-  if (FRAME_TERMCAP_P (f))
-    fflush (FRAME_TTY (f)->output);
-
-  TRACE ((stderr, "direct output for insert\n"));
-  mark_window_display_accurate (it.window, 1);
-  redisplay_performed_directly_p = 1;
-  return 1;
-}
-
-
-/* Perform a direct display update for moving PT by N positions
-   left or right.  N < 0 means a movement backwards.  This function
-   is currently only called for N == 1 or N == -1.  */
-
-int
-direct_output_forward_char (n)
-     int n;
-{
-  struct frame *f = SELECTED_FRAME ();
-  struct window *w = XWINDOW (selected_window);
-  struct glyph_row *row;
-
-  /* Give up if point moved out of or into a composition.  */
-  if (check_point_in_composition (current_buffer, XINT (w->last_point),
-				  current_buffer, PT))
-    return 0;
-
-  /* Give up if face attributes have been changed.  */
-  if (face_change_count)
-    return 0;
-
-  /* Give up if current matrix is not up to date or we are
-     displaying a message.  */
-  if (!display_completed || cursor_in_echo_area)
-    return 0;
-
-  /* Give up if the buffer's direction is reversed.  */
-  if (!NILP (XBUFFER (w->buffer)->direction_reversed))
-    return 0;
-
-  /* Can't use direct output if highlighting a region.  */
-  if (!NILP (Vtransient_mark_mode) && !NILP (current_buffer->mark_active))
-    return 0;
-
-  /* Can't use direct output if highlighting trailing whitespace.  */
-  if (!NILP (Vshow_trailing_whitespace))
-    return 0;
-
-  /* Give up if we are showing a message or just cleared the message
-     because we might need to resize the echo area window.  */
-  if (!NILP (echo_area_buffer[0]) || !NILP (echo_area_buffer[1]))
-    return 0;
-
-  /* Give up if currently displaying a message instead of the
-     minibuffer contents.  */
-  if (XWINDOW (minibuf_window) == w
-      && EQ (minibuf_window, echo_area_window))
-    return 0;
-
-  /* Give up if we don't know where the cursor is.  */
-  if (w->cursor.vpos < 0)
-    return 0;
-
-  row = MATRIX_ROW (w->current_matrix, w->cursor.vpos);
-
-  /* Give up if PT is outside of the last known cursor row.  */
-  if (PT <= MATRIX_ROW_START_CHARPOS (row)
-      || PT >= MATRIX_ROW_END_CHARPOS (row))
-    return 0;
-
-  set_cursor_from_row (w, row, w->current_matrix, 0, 0, 0, 0);
-
-  w->last_cursor = w->cursor;
-  XSETFASTINT (w->last_point, PT);
-
-  xassert (w->cursor.hpos >= 0
-	   && w->cursor.hpos < w->desired_matrix->matrix_w);
-
-  if (FRAME_WINDOW_P (f))
-    FRAME_RIF (f)->cursor_to (w->cursor.vpos, w->cursor.hpos,
-                              w->cursor.y, w->cursor.x);
-  else
-    {
-      int x, y;
-      x = (WINDOW_TO_FRAME_HPOS (w, w->cursor.hpos)
-	   + (INTEGERP (w->left_margin_cols)
-	      ? XFASTINT (w->left_margin_cols)
-	      : 0));
-      y = WINDOW_TO_FRAME_VPOS (w, w->cursor.vpos);
-      cursor_to (f, y, x);
-    }
-
-  if (FRAME_TERMCAP_P (f))
-    fflush (FRAME_TTY (f)->output);
-  redisplay_performed_directly_p = 1;
-  return 1;
-}
-
-
-
-/***********************************************************************
 			     Frame Update
  ***********************************************************************/
 
--- a/src/emacs.c	Fri Mar 26 08:01:19 2010 +0100
+++ b/src/emacs.c	Thu Apr 01 08:50:44 2010 +0200
@@ -32,7 +32,7 @@
 #include <unistd.h>
 #endif
 
-#ifdef BSD_SYSTEM
+#ifdef HAVE_SYS_IOCTL_H
 #include <sys/ioctl.h>
 #endif
 
--- a/src/image.c	Fri Mar 26 08:01:19 2010 +0100
+++ b/src/image.c	Thu Apr 01 08:50:44 2010 +0200
@@ -604,7 +604,7 @@
 extern Lisp_Object QCwidth, QCheight, QCforeground, QCbackground, QCfile;
 extern Lisp_Object QCdata, QCtype;
 extern Lisp_Object Qcenter;
-Lisp_Object QCascent, QCmargin, QCrelief, Qcount;
+Lisp_Object QCascent, QCmargin, QCrelief, Qcount, Qextension_data;
 Lisp_Object QCconversion, QCcolor_symbols, QCheuristic_mask;
 Lisp_Object QCindex, QCmatrix, QCcolor_adjustment, QCmask;
 
@@ -1011,8 +1011,8 @@
   return mask;
 }
 
-DEFUN ("image-extension-data", Fimage_extension_data, Simage_extension_data, 1, 2, 0,
-       doc: /* Return extension data for image SPEC.
+DEFUN ("image-metadata", Fimage_metadata, Simage_metadata, 1, 2, 0,
+       doc: /* Return metadata for image SPEC.
 FRAME is the frame on which the image will be displayed.  FRAME nil
 or omitted means use the selected frame.  */)
      (spec, frame)
@@ -7169,7 +7169,7 @@
      struct frame *f;
      struct image *img;
 {
-  /* IMG->data.ptr_val may contain extension data.  */
+  /* IMG->data.ptr_val may contain metadata with extension data.  */
   img->data.lisp_val = Qnil;
   x_clear_image (f, img);
 }
@@ -7488,8 +7488,8 @@
 	  }
     }
 
-  /* Save GIF image extension data for `image-extension-data'.
-     Format is (count IMAGES FUNCTION "BYTES" ...).  */
+  /* Save GIF image extension data for `image-metadata'.
+     Format is (count IMAGES extension-data (FUNCTION "BYTES" ...)).  */
   img->data.lisp_val = Qnil;
   if (gif->SavedImages[ino].ExtensionBlockCount > 0)
     {
@@ -7499,7 +7499,9 @@
 	img->data.lisp_val = Fcons (make_unibyte_string (ext->Bytes, ext->ByteCount),
 				    Fcons (make_number (ext->Function),
 					   img->data.lisp_val));
-      img->data.lisp_val = Fnreverse (img->data.lisp_val);
+      img->data.lisp_val = Fcons (Qextension_data,
+				  Fcons (Fnreverse (img->data.lisp_val),
+					 Qnil));
     }
   if (gif->ImageCount > 1)
     img->data.lisp_val = Fcons (Qcount,
@@ -8403,6 +8405,8 @@
 
   Qcount = intern_c_string ("count");
   staticpro (&Qcount);
+  Qextension_data = intern_c_string ("extension-data");
+  staticpro (&Qextension_data);
 
   QCascent = intern_c_string (":ascent");
   staticpro (&QCascent);
@@ -8498,7 +8502,7 @@
   defsubr (&Simage_refresh);
   defsubr (&Simage_size);
   defsubr (&Simage_mask_p);
-  defsubr (&Simage_extension_data);
+  defsubr (&Simage_metadata);
 
 #if GLYPH_DEBUG
   defsubr (&Simagep);
--- a/src/keyboard.c	Fri Mar 26 08:01:19 2010 +0100
+++ b/src/keyboard.c	Thu Apr 01 08:50:44 2010 +0200
@@ -1520,8 +1520,6 @@
 }
 #endif
 
-extern int nonundocount;	/* Declared in cmds.c.  */
-
 Lisp_Object
 command_loop_1 ()
 {
@@ -1744,149 +1742,8 @@
 	}
       else
 	{
-	  if (NILP (current_kboard->Vprefix_arg))
-	    {
-	      /* In case we jump to directly_done.  */
-	      Vcurrent_prefix_arg = current_kboard->Vprefix_arg;
-
-	      /* Recognize some common commands in common situations and
-		 do them directly.  */
-	      if (EQ (Vthis_command, Qforward_char) && PT < ZV
-		  && NILP (Vthis_command_keys_shift_translated)
-		  && !CONSP (Vtransient_mark_mode))
-		{
-                  struct Lisp_Char_Table *dp
-		    = window_display_table (XWINDOW (selected_window));
-		  lose = FETCH_CHAR (PT_BYTE);
-		  SET_PT (PT + 1);
-		  if (! NILP (Vpost_command_hook))
-		    /* Put this before calling adjust_point_for_property
-		       so it will only get called once in any case.  */
-		    goto directly_done;
-		  if (current_buffer == prev_buffer
-		      && last_point_position != PT
-		      && NILP (Vdisable_point_adjustment)
-		      && NILP (Vglobal_disable_point_adjustment))
-		    adjust_point_for_property (last_point_position, 0);
-		  already_adjusted = 1;
-		  if (PT == last_point_position + 1
-		      && (dp
-			  ? (VECTORP (DISP_CHAR_VECTOR (dp, lose))
-			     ? XVECTOR (DISP_CHAR_VECTOR (dp, lose))->size == 1
-			     : (NILP (DISP_CHAR_VECTOR (dp, lose))
-				&& (lose >= 0x20 && lose < 0x7f)))
-			  : (lose >= 0x20 && lose < 0x7f))
-		      /* To extract the case of continuation on
-                         wide-column characters.  */
-		      && ASCII_BYTE_P (lose)
-		      && (XFASTINT (XWINDOW (selected_window)->last_modified)
-			  >= MODIFF)
-		      && (XFASTINT (XWINDOW (selected_window)->last_overlay_modified)
-			  >= OVERLAY_MODIFF)
-		      && (XFASTINT (XWINDOW (selected_window)->last_point)
-			  == PT - 1)
-		      && !windows_or_buffers_changed
-		      && EQ (current_buffer->selective_display, Qnil)
-		      && !detect_input_pending ()
-		      && NILP (XWINDOW (selected_window)->column_number_displayed)
-		      && NILP (Vexecuting_kbd_macro))
-		    direct_output_forward_char (1);
-		  goto directly_done;
-		}
-	      else if (EQ (Vthis_command, Qbackward_char) && PT > BEGV
-		       && NILP (Vthis_command_keys_shift_translated)
-		       && !CONSP (Vtransient_mark_mode))
-		{
-                  struct Lisp_Char_Table *dp
-		    = window_display_table (XWINDOW (selected_window));
-		  SET_PT (PT - 1);
-		  lose = FETCH_CHAR (PT_BYTE);
-		  if (! NILP (Vpost_command_hook))
-		    goto directly_done;
-		  if (current_buffer == prev_buffer
-		      && last_point_position != PT
-		      && NILP (Vdisable_point_adjustment)
-		      && NILP (Vglobal_disable_point_adjustment))
-		    adjust_point_for_property (last_point_position, 0);
-		  already_adjusted = 1;
-		  if (PT == last_point_position - 1
-		      && (dp
-			  ? (VECTORP (DISP_CHAR_VECTOR (dp, lose))
-			     ? XVECTOR (DISP_CHAR_VECTOR (dp, lose))->size == 1
-			     : (NILP (DISP_CHAR_VECTOR (dp, lose))
-				&& (lose >= 0x20 && lose < 0x7f)))
-			  : (lose >= 0x20 && lose < 0x7f))
-		      && (XFASTINT (XWINDOW (selected_window)->last_modified)
-			  >= MODIFF)
-		      && (XFASTINT (XWINDOW (selected_window)->last_overlay_modified)
-			  >= OVERLAY_MODIFF)
-		      && (XFASTINT (XWINDOW (selected_window)->last_point)
-			  == PT + 1)
-		      && !windows_or_buffers_changed
-		      && EQ (current_buffer->selective_display, Qnil)
-		      && !detect_input_pending ()
-		      && NILP (XWINDOW (selected_window)->column_number_displayed)
-		      && NILP (Vexecuting_kbd_macro))
-		    direct_output_forward_char (-1);
-		  goto directly_done;
-		}
-	      else if (EQ (Vthis_command, Qself_insert_command)
-		       /* Try this optimization only on char keystrokes.  */
-		       && NATNUMP (last_command_event)
-		       && CHAR_VALID_P (XFASTINT (last_command_event), 0))
-		{
-		  unsigned int c
-		    = translate_char (Vtranslation_table_for_input,
-				      XFASTINT (last_command_event));
-		  int value;
-		  if (NILP (Vexecuting_kbd_macro)
-		      && !EQ (minibuf_window, selected_window))
-		    {
-		      if (!nonundocount || nonundocount >= 20)
-			{
-			  Fundo_boundary ();
-			  nonundocount = 0;
-			}
-		      nonundocount++;
-		    }
-
-		  lose = ((XFASTINT (XWINDOW (selected_window)->last_modified)
-			   < MODIFF)
-			  || (XFASTINT (XWINDOW (selected_window)->last_overlay_modified)
-			      < OVERLAY_MODIFF)
-			  || (XFASTINT (XWINDOW (selected_window)->last_point)
-			      != PT)
-			  || MODIFF <= SAVE_MODIFF
-			  || windows_or_buffers_changed
-			  || !EQ (current_buffer->selective_display, Qnil)
-			  || detect_input_pending ()
-			  || !NILP (XWINDOW (selected_window)->column_number_displayed)
-			  || !NILP (Vexecuting_kbd_macro));
-
-		  value = internal_self_insert (c, 0);
-
-		  if (value == 2)
-		    nonundocount = 0;
-
-                  frame_make_pointer_invisible ();
-
-		  if (! NILP (Vpost_command_hook))
-		    /* Put this before calling adjust_point_for_property
-		       so it will only get called once in any case.  */
-		    goto directly_done;
-
-		  /* VALUE == 1 when AFTER-CHANGE functions are
-		     installed which is the case most of the time
-		     because FONT-LOCK installs one.  */
-		  if (!lose && !value)
-		    direct_output_for_insert (c);
-		  goto directly_done;
-		}
-	    }
-
 	  /* Here for a command that isn't executed directly */
 
-          {
 #ifdef HAVE_WINDOW_SYSTEM
             int scount = SPECPDL_INDEX ();
 
@@ -1898,7 +1755,6 @@
               }
 #endif
 
-            nonundocount = 0;
             if (NILP (current_kboard->Vprefix_arg)) /* FIXME: Why?  --Stef  */
               Fundo_boundary ();
             Fcommand_execute (Vthis_command, Qnil, Qnil, Qnil);
@@ -1913,8 +1769,6 @@
             unbind_to (scount, Qnil);
 #endif
           }
-	}
-    directly_done: ;
       current_kboard->Vlast_prefix_arg = Vcurrent_prefix_arg;
 
       /* Note that the value cell will never directly contain nil
--- a/src/m/hp800.h	Fri Mar 26 08:01:19 2010 +0100
+++ b/src/m/hp800.h	Thu Apr 01 08:50:44 2010 +0200
@@ -93,8 +93,6 @@
 
 #define UNEXEC unexhp9k800.o
 
-#define LIBS_DEBUG
-
 /* Include the file bsdtty.h, since this machine has job control.  */
 #define NEED_BSDTTY
 
--- a/src/m/iris4d.h	Fri Mar 26 08:01:19 2010 +0100
+++ b/src/m/iris4d.h	Thu Apr 01 08:50:44 2010 +0200
@@ -53,8 +53,6 @@
 #define DATA_START 0x10000000
 #define DATA_SEG_BITS	0x10000000
 
-#define LIBS_DEBUG
-
 /* Use terminfo instead of termcap.  */
 
 #define TERMINFO
--- a/src/makefile.w32-in	Fri Mar 26 08:01:19 2010 +0100
+++ b/src/makefile.w32-in	Thu Apr 01 08:50:44 2010 +0200
@@ -115,6 +115,7 @@
 	$(BLD)/vm-limit.$(O)		\
 	$(BLD)/region-cache.$(O)	\
 	$(BLD)/strftime.$(O)		\
+	$(BLD)/bidi.$(O)		\
 	$(BLD)/charset.$(O)		\
 	$(BLD)/character.$(O)		\
 	$(BLD)/chartab.$(O)		\
@@ -338,6 +339,15 @@
 	$(SRC)/syssignal.h \
 	$(SRC)/systime.h
 
+$(BLD)/bidi.$(O) : \
+	$(SRC)/bidi.c \
+	$(CONFIG_H) \
+	$(SRC)/lisp.h \
+	$(SRC)/buffer.h \
+	$(SRC)/character.h \
+	$(SRC)/dispextern.h \
+	$(SRC)/w32gui.h
+
 $(BLD)/buffer.$(O) : \
 	$(SRC)/buffer.c \
 	$(CONFIG_H) \
--- a/src/menu.c	Fri Mar 26 08:01:19 2010 +0100
+++ b/src/menu.c	Thu Apr 01 08:50:44 2010 +0200
@@ -61,6 +61,10 @@
 #define HAVE_BOXES 1
 #endif
 
+/* The timestamp of the last input event Emacs received from the X server.  */
+/* Defined in keyboard.c.  */
+extern unsigned long last_event_timestamp;
+
 extern Lisp_Object QCtoggle, QCradio;
 
 Lisp_Object menu_items;
@@ -1073,7 +1077,6 @@
   int keymaps = 0;
   int for_click = 0;
   int specpdl_count = SPECPDL_INDEX ();
-  Lisp_Object timestamp = Qnil;
   struct gcpro gcpro1;
 
   if (NILP (position))
@@ -1107,10 +1110,9 @@
 	    for_click = 1;
 	    tem = Fcar (Fcdr (position));  /* EVENT_START (position) */
 	    window = Fcar (tem);	     /* POSN_WINDOW (tem) */
-	    tem = Fcdr (Fcdr (tem));
-	    x = Fcar (Fcar (tem));
-	    y = Fcdr (Fcar (tem));
-	    timestamp = Fcar (Fcdr (tem));
+	    tem = Fcar (Fcdr (Fcdr (tem))); /* POSN_WINDOW_POSN (tem) */
+	    x = Fcar (tem);
+	    y = Fcdr (tem);
 	  }
 
 	/* If a click happens in an external tool bar or a detached
@@ -1318,9 +1320,13 @@
   selection = ns_menu_show (f, xpos, ypos, for_click,
 			    keymaps, title, &error_name);
 #else /* MSDOS and X11 */
+  /* Assume last_event_timestamp is the timestamp of the button event.
+     Is this assumption ever violated?  We can't use the timestamp
+     stored within POSITION because there the top bits from the actual
+     timestamp may be truncated away (Bug#4930).  */
   selection = xmenu_show (f, xpos, ypos, for_click,
 			  keymaps, title, &error_name,
-			  INTEGERP (timestamp) ? XUINT (timestamp) : 0);
+			  last_event_timestamp);
 #endif
 
   UNBLOCK_INPUT;
--- a/src/nsfns.m	Fri Mar 26 08:01:19 2010 +0100
+++ b/src/nsfns.m	Thu Apr 01 08:50:44 2010 +0200
@@ -81,6 +81,7 @@
 extern Lisp_Object Qheight, Qminibuffer, Qname, Qonly, Qwidth;
 extern Lisp_Object Qunsplittable, Qmenu_bar_lines, Qbuffer_predicate, Qtitle;
 extern Lisp_Object Qnone;
+extern Lisp_Object Vframe_title_format;
 
 Lisp_Object Qbuffered;
 Lisp_Object Qfontsize;
@@ -583,6 +584,8 @@
   NSTRACE (x_implicitly_set_name);
   if (FRAME_ICONIFIED_P (f))
     ns_set_name_iconic (f, arg, 0);
+  else if (FRAME_NS_P (f) && EQ (Vframe_title_format, Qt))
+    ns_set_name_as_filename (f);
   else
     ns_set_name (f, arg, 0);
 }
@@ -627,14 +630,14 @@
 
   BLOCK_INPUT;
   pool = [[NSAutoreleasePool alloc] init];
-  name =XBUFFER (buf)->filename;
+  name = XBUFFER (buf)->filename;
   if (NILP (name) || FRAME_ICONIFIED_P (f)) name =XBUFFER (buf)->name;
 
   if (FRAME_ICONIFIED_P (f) && !NILP (f->icon_name))
     name = f->icon_name;
 
   if (NILP (name))
-    name = build_string([ns_app_name UTF8String]);
+    name = build_string ([ns_app_name UTF8String]);
   else
     CHECK_STRING (name);
 
@@ -683,15 +686,18 @@
 
 
 void
-ns_set_doc_edited (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
+ns_set_doc_edited (struct frame *f, Lisp_Object arg)
 {
   NSView *view = FRAME_NS_VIEW (f);
   NSAutoreleasePool *pool;
-  BLOCK_INPUT;
-  pool = [[NSAutoreleasePool alloc] init];
-  [[view window] setDocumentEdited: !NILP (arg)];
-  [pool release];
-  UNBLOCK_INPUT;
+  if (!MINI_WINDOW_P (XWINDOW (f->selected_window)))
+    {
+      BLOCK_INPUT;
+      pool = [[NSAutoreleasePool alloc] init];
+      [[view window] setDocumentEdited: !NILP (arg)];
+      [pool release];
+      UNBLOCK_INPUT;
+    }
 }
 
 
--- a/src/nsterm.h	Fri Mar 26 08:01:19 2010 +0100
+++ b/src/nsterm.h	Thu Apr 01 08:50:44 2010 +0200
@@ -708,6 +708,8 @@
 extern int ns_lisp_to_cursor_type ();
 extern Lisp_Object ns_cursor_type_to_lisp (int arg);
 extern Lisp_Object Qnone;
+extern void ns_set_name_as_filename (struct frame *f);
+extern void ns_set_doc_edited (struct frame *f, Lisp_Object arg);
 
 extern int
 ns_defined_color (struct frame *f, char *name, XColor *color_def, int alloc,
--- a/src/nsterm.m	Fri Mar 26 08:01:19 2010 +0100
+++ b/src/nsterm.m	Thu Apr 01 08:50:44 2010 +0200
@@ -4173,8 +4173,6 @@
   ns_send_appdefined (-2);
 }
 
-extern void update_window_cursor (struct window *w, int on);
-
 - (void)fd_handler: (NSTimer *) fdEntry
 /* --------------------------------------------------------------------------
      Check data waiting on file descriptors and terminate if so
--- a/src/process.c	Fri Mar 26 08:01:19 2010 +0100
+++ b/src/process.c	Thu Apr 01 08:50:44 2010 +0200
@@ -69,12 +69,12 @@
 #endif
 #endif /* HAVE_SOCKETS */
 
-#if defined(BSD_SYSTEM)
+#if defined(HAVE_SYS_IOCTL_H)
 #include <sys/ioctl.h>
 #if !defined (O_NDELAY) && defined (HAVE_PTYS) && !defined(USG5)
 #include <fcntl.h>
 #endif /* HAVE_PTYS and no O_NDELAY */
-#endif /* BSD_SYSTEM */
+#endif /* HAVE_SYS_IOCTL_H */
 
 #ifdef NEED_BSDTTY
 #include <bsdtty.h>
@@ -3534,6 +3534,8 @@
     {
       int optn, optbits;
 
+    retry_connect:
+
       s = socket (lres->ai_family, lres->ai_socktype, lres->ai_protocol);
       if (s < 0)
 	{
@@ -3636,12 +3638,14 @@
 #endif
 #endif
 #endif
+
+#ifndef WINDOWSNT
       if (xerrno == EINTR)
 	{
 	  /* Unlike most other syscalls connect() cannot be called
 	     again.  (That would return EALREADY.)  The proper way to
 	     wait for completion is select(). */
-	  int sc;
+	  int sc, len;
 	  SELECT_TYPE fdset;
 	retry_select:
 	  FD_ZERO (&fdset);
@@ -3651,23 +3655,23 @@
 		       (EMACS_TIME *)0);
 	  if (sc == -1)
 	    {
-	      if (errno == EINTR) 
+	      if (errno == EINTR)
 		goto retry_select;
-	      else 
+	      else
 		report_file_error ("select failed", Qnil);
 	    }
 	  eassert (sc > 0);
-	  {
-	    int len = sizeof xerrno;
-	    eassert (FD_ISSET (s, &fdset));
-	    if (getsockopt (s, SOL_SOCKET, SO_ERROR, &xerrno, &len) == -1)
-	      report_file_error ("getsockopt failed", Qnil);
-	    if (xerrno != 0)
-	      errno = xerrno, report_file_error ("error during connect", Qnil);
-	    else
-	      break;
-	  }
+
+	  len = sizeof xerrno;
+	  eassert (FD_ISSET (s, &fdset));
+	  if (getsockopt (s, SOL_SOCKET, SO_ERROR, &xerrno, &len) == -1)
+	    report_file_error ("getsockopt failed", Qnil);
+	  if (xerrno)
+	    errno = xerrno, report_file_error ("error during connect", Qnil);
+	  else
+	    break;
 	}
+#endif /* !WINDOWSNT */
 
       immediate_quit = 0;
 
@@ -3675,6 +3679,11 @@
       specpdl_ptr = specpdl + count1;
       emacs_close (s);
       s = -1;
+
+#ifdef WINDOWSNT
+      if (xerrno == EINTR)
+	goto retry_connect;
+#endif
     }
 
   if (s >= 0)
--- a/src/s/aix4-2.h	Fri Mar 26 08:01:19 2010 +0100
+++ b/src/s/aix4-2.h	Thu Apr 01 08:50:44 2010 +0200
@@ -87,10 +87,6 @@
 #define LINKER cc
 #endif
 
-/* Prevent -lg from being used for debugging.  Not needed.  */
-
-#define LIBS_DEBUG
-
 /* No need to specify -lc when linking.  */
 
 #define LIB_STANDARD
@@ -130,16 +126,6 @@
    It is just a guess which versions of AIX need this definition.  */
 #undef HAVE_STRING_H
 
-/* For AIX, it turns out compiling emacs under AIX 3.2.4 REQUIRES "cc -g"
-   because "cc -O" crashes. Under AIX 3.2.5, "cc -O" is required because
-   "cc -g" crashes. Go figure.  --floppy@merlin.mit.edu */
-/* The above isn't generally true.  If it occurs with some compiler
-   release, seek a fixed version, be it XLC or GCC.  The XLC version
-   isn't tied to the OS version on AIX any more than elsewhere.  XLC
-   (the IBM compiler) can use -g with -O.  (-O3 is also a possibility
-   for the optimization level.)  -- fx, after David Edelsohn.  */
-#define C_DEBUG_SWITCH -g -O
-
 /* Perry Smith <pedz@ddivt1.austin.ibm.com> says these are correct.  */
 #define SIGNALS_VIA_CHARACTERS
 #define MAIL_USE_LOCKF
--- a/src/s/bsd-common.h	Fri Mar 26 08:01:19 2010 +0100
+++ b/src/s/bsd-common.h	Thu Apr 01 08:50:44 2010 +0200
@@ -46,8 +46,6 @@
 #define HAVE_TERMIOS
 #define NO_TERMIO
 
-#define LIBS_DEBUG
-
 #define SYSV_SYSTEM_DIR
 
 /* POSIX-style pgrp behavior.  */
--- a/src/s/darwin.h	Fri Mar 26 08:01:19 2010 +0100
+++ b/src/s/darwin.h	Thu Apr 01 08:50:44 2010 +0200
@@ -189,9 +189,6 @@
 /* Link this program just by running cc.  */
 #define ORDINARY_LINK
 
-/* We don't have a g library, so override the -lg LIBS_DEBUG switch.  */
-#define LIBS_DEBUG
-
 /* Adding -lm confuses the dynamic linker, so omit it.  */
 #define LIB_MATH
 
--- a/src/s/gnu-linux.h	Fri Mar 26 08:01:19 2010 +0100
+++ b/src/s/gnu-linux.h	Thu Apr 01 08:50:44 2010 +0200
@@ -194,19 +194,10 @@
 #define POSIX                 /* affects getpagesize.h and systty.h */
 #define POSIX_SIGNALS
 
-/* Best not to include -lg, unless it is last on the command line */
-#define LIBS_DEBUG
 #undef LIB_GCC
 #define LIB_GCC
 #define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtn.o
 
-/* Don't use -g in test compiles in configure.
-   This is so we will use the same shared libs for that linking
-   that are used when linking temacs.  */
-#ifdef THIS_IS_CONFIGURE
-#define C_DEBUG_SWITCH
-#endif
-
 /* _BSD_SOURCE is redundant, at least in glibc2, since we define
    _GNU_SOURCE.  Left in in case it's relevant to libc5 systems and
    anyone's still using Emacs on those.  --fx 2002-12-14  */
--- a/src/s/irix6-5.h	Fri Mar 26 08:01:19 2010 +0100
+++ b/src/s/irix6-5.h	Thu Apr 01 08:50:44 2010 +0200
@@ -101,19 +101,6 @@
 #define _LP64			/* lisp.h takes care of the rest */
 #endif /* _MIPS_SZLONG */
 
-/* The only supported 32-bit configuration of GCC under IRIX6.x produces
-   n32 MIPS ABI binaries and also supports -g. */
-#ifdef __GNUC__
-#define C_DEBUG_SWITCH -g
-#else
-/* Optimize, inaccurate debugging, increase limit on size of what's
-   optimized.
-
-   This should also be applicable other than on Irix 6.5, but I don't
-   know for which compiler versions.  -- fx */
-#define C_DEBUG_SWITCH -g3 -O -OPT:Olimit=3500
-#endif
-
 #undef SA_RESTART
 
 #undef TIOCSIGSEND		/* defined in usg5-4.h */
--- a/src/s/sol2-6.h	Fri Mar 26 08:01:19 2010 +0100
+++ b/src/s/sol2-6.h	Thu Apr 01 08:50:44 2010 +0200
@@ -48,11 +48,6 @@
 #define LIBS_TERMCAP -ltermcap
 #endif
 
-#ifndef __GNUC__
-/* eggert thinks all versions of SunPro C allowed this.  */
-#define C_DEBUG_SWITCH -g -O
-#endif /* GCC */
-
 /* This is the same definition as in usg5-4.h, but with sigblock/sigunblock
    rather than sighold/sigrelse, which appear to be BSD4.1 specific and won't
    work if POSIX_SIGNALS is defined.  It may also be appropriate for SVR4.x
--- a/src/s/usg5-4.h	Fri Mar 26 08:01:19 2010 +0100
+++ b/src/s/usg5-4.h	Thu Apr 01 08:50:44 2010 +0200
@@ -103,10 +103,6 @@
 
 #define LIB_STANDARD
 
-/* there are no -lg libraries on this system, and no libPW */
-
-#define LIBS_DEBUG
-
 /* Undump with ELF */
 
 #undef COFF
--- a/src/sysdep.c	Fri Mar 26 08:01:19 2010 +0100
+++ b/src/sysdep.c	Thu Apr 01 08:50:44 2010 +0200
@@ -384,11 +384,7 @@
 
 wait_without_blocking ()
 {
-#ifdef BSD_SYSTEM
-  wait3 (0, WNOHANG | WUNTRACED, 0);
-#else
   croak ("wait_without_blocking");
-#endif
   synch_process_alive = 0;
 }
 
@@ -1401,9 +1397,8 @@
 
   if (tty_out->term_initted && no_redraw_on_reenter)
     {
-      /* XXX This seems wrong on multi-tty. */
-      if (display_completed)
-	direct_output_forward_char (0);
+      /* We used to call "direct_output_forward_char(0)" here,
+	 but it's not clear why, since it may not do anything anyway.  */
     }
   else
     {
--- a/src/term.c	Fri Mar 26 08:01:19 2010 +0100
+++ b/src/term.c	Thu Apr 01 08:50:44 2010 +0200
@@ -1540,6 +1540,26 @@
 	   + it->glyph_row->used[it->area]);
   end = it->glyph_row->glyphs[1 + it->area];
 
+  /* If the glyph row is reversed, we need to prepend the glyph rather
+     than append it.  */
+  if (it->glyph_row->reversed_p && it->area == TEXT_AREA)
+    {
+      struct glyph *g;
+      int move_by = it->pixel_width;
+
+      /* Make room for the new glyphs.  */
+      if (move_by > end - glyph) /* don't overstep end of this area */
+	move_by = end - glyph;
+      for (g = glyph - 1; g >= it->glyph_row->glyphs[it->area]; g--)
+	g[move_by] = *g;
+      glyph = it->glyph_row->glyphs[it->area];
+      end = glyph + move_by;
+    }
+
+  /* BIDI Note: we put the glyphs of a "multi-pixel" character left to
+     right, even in the REVERSED_P case, since (a) all of its u.ch are
+     identical, and (b) the PADDING_P flag needs to be set for the
+     leftmost one, because we write to the terminal left-to-right.  */
   for (i = 0;
        i < it->pixel_width && glyph < end;
        ++i)
@@ -1551,6 +1571,18 @@
       glyph->padding_p = i > 0;
       glyph->charpos = CHARPOS (it->position);
       glyph->object = it->object;
+      if (it->bidi_p)
+	{
+	  glyph->resolved_level = it->bidi_it.resolved_level;
+	  if ((it->bidi_it.type & 7) != it->bidi_it.type)
+	    abort ();
+	  glyph->bidi_type = it->bidi_it.type;
+	}
+      else
+	{
+	  glyph->resolved_level = 0;
+	  glyph->bidi_type = UNKNOWN_BT;
+	}
 
       ++it->glyph_row->used[it->area];
       ++glyph;
--- a/src/window.c	Fri Mar 26 08:01:19 2010 +0100
+++ b/src/window.c	Thu Apr 01 08:50:44 2010 +0200
@@ -7380,9 +7380,6 @@
   initial_define_key (global_map, Ctl ('V'), "scroll-up");
   initial_define_key (meta_map, Ctl ('V'), "scroll-other-window");
   initial_define_key (meta_map, 'v', "scroll-down");
-
-  initial_define_key (global_map, Ctl('L'), "recenter");
-  initial_define_key (meta_map, 'r', "move-to-window-line");
 }
 
 /* arch-tag: 90a9c576-0590-48f1-a5f1-6c96a0452d9f
--- a/src/window.h	Fri Mar 26 08:01:19 2010 +0100
+++ b/src/window.h	Thu Apr 01 08:50:44 2010 +0200
@@ -117,7 +117,10 @@
     /* The buffer displayed in this window */
     /* Of the fields vchild, hchild and buffer, only one is non-nil.  */
     Lisp_Object buffer;
-    /* A marker pointing to where in the text to start displaying */
+    /* A marker pointing to where in the text to start displaying.
+       BIDI Note: This is the _logical-order_ start, i.e. the smallest
+       buffer position visible in the window, not necessarily the
+       character displayed in the top left corner of the window.  */
     Lisp_Object start;
     /* A marker pointing to where in the text point is in this window,
        used only when the window is not selected.
--- a/src/xdisp.c	Fri Mar 26 08:01:19 2010 +0100
+++ b/src/xdisp.c	Thu Apr 01 08:50:44 2010 +0200
@@ -32,9 +32,7 @@
    decides it's time to do it.  This is done either automatically for
    you as part of the interpreter's command loop or as the result of
    calling Lisp functions like `sit-for'.  The C function `redisplay'
-   in xdisp.c is the only entry into the inner redisplay code.  (Or,
-   let's say almost---see the description of direct update
-   operations, below.)
+   in xdisp.c is the only entry into the inner redisplay code.
 
    The following diagram shows how redisplay code is invoked.  As you
    can see, Lisp calls redisplay and vice versa.  Under window systems
@@ -46,12 +44,6 @@
    change the interpreter's state.  If you don't follow these rules,
    you will encounter bugs which are very hard to explain.
 
-	     (Direct functions, see below)
-             direct_output_for_insert,
-             direct_forward_char (dispnew.c)
-   	  +---------------------------------+
-          |                                 |
-	  |                                 V
    +--------------+   redisplay     +----------------+
    | Lisp machine |---------------->| Redisplay code |<--+
    +--------------+   (xdisp.c)     +----------------+   |
@@ -85,28 +77,11 @@
    then compared to find a cheap way to update the display, e.g. by
    reusing part of the display by scrolling lines.
 
-
-   Direct operations.
-
    You will find a lot of redisplay optimizations when you start
    looking at the innards of redisplay.  The overall goal of all these
    optimizations is to make redisplay fast because it is done
    frequently.
 
-   Two optimizations are not found in xdisp.c.  These are the direct
-   operations mentioned above.  As the name suggests they follow a
-   different principle than the rest of redisplay.  Instead of
-   building a desired matrix and then comparing it with the current
-   display, they perform their actions directly on the display and on
-   the current matrix.
-
-   One direct operation updates the display after one character has
-   been entered.  The other one moves the cursor by one position
-   forward or backward.  You find these functions under the names
-   `direct_output_for_insert' and `direct_output_forward_char' in
-   dispnew.c.
-
-
    Desired matrices.
 
    Desired matrices are always built per Emacs window.  The function
@@ -249,6 +224,7 @@
 Lisp_Object Qgrow_only;
 Lisp_Object Qinhibit_eval_during_redisplay;
 Lisp_Object Qbuffer_position, Qposition, Qobject;
+Lisp_Object Qright_to_left, Qleft_to_right;
 
 /* Cursor shapes */
 Lisp_Object Qbar, Qhbar, Qbox, Qhollow;
@@ -904,6 +880,7 @@
 static int store_mode_line_noprop P_ ((const unsigned char *, int, int));
 static void x_consider_frame_title P_ ((Lisp_Object));
 static void handle_stop P_ ((struct it *));
+static void handle_stop_backwards P_ ((struct it *, EMACS_INT));
 static int tool_bar_lines_needed P_ ((struct frame *, int *));
 static int single_display_spec_intangible_p P_ ((Lisp_Object));
 static void ensure_echo_area_buffers P_ ((void));
@@ -1375,33 +1352,7 @@
 	visible_p = 1;
       if (visible_p)
 	{
-	  if (it_method == GET_FROM_BUFFER)
-	    {
-	      Lisp_Object window, prop;
-
-	      XSETWINDOW (window, w);
-	      prop = Fget_char_property (make_number (charpos),
-					 Qinvisible, window);
-
-	      /* If charpos coincides with invisible text covered with an
-		 ellipsis, use the first glyph of the ellipsis to compute
-		 the pixel positions.  */
-	      if (TEXT_PROP_MEANS_INVISIBLE (prop) == 2)
-		{
-		  struct glyph_row *row = it.glyph_row;
-		  struct glyph *glyph = row->glyphs[TEXT_AREA];
-		  struct glyph *end = glyph + row->used[TEXT_AREA];
-		  int x = row->x;
-
-		  for (; glyph < end
-			 && (!BUFFERP (glyph->object)
-			     || glyph->charpos < charpos);
-		       glyph++)
-		    x += glyph->pixel_width;
-		  top_x = x;
-		}
-	    }
-	  else if (it_method == GET_FROM_DISPLAY_VECTOR)
+	  if (it_method == GET_FROM_DISPLAY_VECTOR)
 	    {
 	      /* We stopped on the last glyph of a display vector.
 		 Try and recompute.  Hack alert!  */
@@ -2654,6 +2605,9 @@
   /* Are multibyte characters enabled in current_buffer?  */
   it->multibyte_p = !NILP (current_buffer->enable_multibyte_characters);
 
+  /* Do we need to reorder bidirectional text?  */
+  it->bidi_p = !NILP (current_buffer->bidi_display_reordering);
+
   /* Non-zero if we should highlight the region.  */
   highlight_region_p
     = (!NILP (Vtransient_mark_mode)
@@ -2744,6 +2698,10 @@
   it->glyph_row = row;
   it->area = TEXT_AREA;
 
+  /* Forget any previous info about this row being reversed.  */
+  if (it->glyph_row)
+    it->glyph_row->reversed_p = 0;
+
   /* Get the dimensions of the display area.  The display area
      consists of the visible window area plus a horizontally scrolled
      part to the left of the window.  All x-values are relative to the
@@ -2799,6 +2757,21 @@
 	it->start_of_box_run_p = 1;
     }
 
+  /* If we are to reorder bidirectional text, init the bidi
+     iterator.  */
+  if (it->bidi_p)
+    {
+      /* Note the paragraph direction that this buffer wants to
+	 use.  */
+      if (EQ (current_buffer->bidi_paragraph_direction, Qleft_to_right))
+	it->paragraph_embedding = L2R;
+      else if (EQ (current_buffer->bidi_paragraph_direction, Qright_to_left))
+	it->paragraph_embedding = R2L;
+      else
+	it->paragraph_embedding = NEUTRAL_DIR;
+      bidi_init_it (charpos, bytepos, &it->bidi_it);
+    }
+
   /* If a buffer position was specified, set the iterator there,
      getting overlays and face properties from that position.  */
   if (charpos >= BUF_BEG (current_buffer))
@@ -3764,18 +3737,18 @@
   else
     {
       int invis_p;
-      EMACS_INT newpos, next_stop, start_charpos;
+      EMACS_INT newpos, next_stop, start_charpos, tem;
       Lisp_Object pos, prop, overlay;
 
       /* First of all, is there invisible text at this position?  */
-      start_charpos = IT_CHARPOS (*it);
-      pos = make_number (IT_CHARPOS (*it));
+      tem = start_charpos = IT_CHARPOS (*it);
+      pos = make_number (tem);
       prop = get_char_property_and_overlay (pos, Qinvisible, it->window,
 					    &overlay);
       invis_p = TEXT_PROP_MEANS_INVISIBLE (prop);
 
       /* If we are on invisible text, skip over it.  */
-      if (invis_p && IT_CHARPOS (*it) < it->end_charpos)
+      if (invis_p && start_charpos < it->end_charpos)
 	{
 	  /* Record whether we have to display an ellipsis for the
 	     invisible text.  */
@@ -3788,17 +3761,16 @@
 	  do
 	    {
 	      /* Try to skip some invisible text.  Return value is the
-		 position reached which can be equal to IT's position
-		 if there is nothing invisible here.  This skips both
+		 position reached which can be equal to where we start
+		 if there is nothing invisible there.  This skips both
 		 over invisible text properties and overlays with
 		 invisible property.  */
-	      newpos = skip_invisible (IT_CHARPOS (*it),
-				       &next_stop, ZV, it->window);
+	      newpos = skip_invisible (tem, &next_stop, ZV, it->window);
 
 	      /* If we skipped nothing at all we weren't at invisible
 		 text in the first place.  If everything to the end of
 		 the buffer was skipped, end the loop.  */
-	      if (newpos == IT_CHARPOS (*it) || newpos >= ZV)
+	      if (newpos == tem || newpos >= ZV)
 		invis_p = 0;
 	      else
 		{
@@ -3816,7 +3788,7 @@
 	      /* If we ended up on invisible text, proceed to
 		 skip starting with next_stop.  */
 	      if (invis_p)
-		IT_CHARPOS (*it) = next_stop;
+		tem = next_stop;
 
               /* If there are adjacent invisible texts, don't lose the
                  second one's ellipsis. */
@@ -3826,8 +3798,47 @@
 	  while (invis_p);
 
 	  /* The position newpos is now either ZV or on visible text.  */
-	  IT_CHARPOS (*it) = newpos;
-	  IT_BYTEPOS (*it) = CHAR_TO_BYTE (newpos);
+	  if (it->bidi_p && newpos < ZV)
+	    {
+	      /* With bidi iteration, the region of invisible text
+		 could start and/or end in the middle of a non-base
+		 embedding level.  Therefore, we need to skip
+		 invisible text using the bidi iterator, starting at
+		 IT's current position, until we find ourselves
+		 outside the invisible text.  Skipping invisible text
+		 _after_ bidi iteration avoids affecting the visual
+		 order of the displayed text when invisible properties
+		 are added or removed.  */
+	      if (it->bidi_it.first_elt)
+		{
+		  /* If we were `reseat'ed to a new paragraph,
+		     determine the paragraph base direction.  We need
+		     to do it now because next_element_from_buffer may
+		     not have a chance to do it, if we are going to
+		     skip any text at the beginning, which resets the
+		     FIRST_ELT flag.  */
+		  bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it);
+		}
+	      do
+		{
+		  bidi_get_next_char_visually (&it->bidi_it);
+		}
+	      while (it->stop_charpos <= it->bidi_it.charpos
+		     && it->bidi_it.charpos < newpos);
+	      IT_CHARPOS (*it) = it->bidi_it.charpos;
+	      IT_BYTEPOS (*it) = it->bidi_it.bytepos;
+	      /* If we overstepped NEWPOS, record its position in the
+		 iterator, so that we skip invisible text if later the
+		 bidi iteration lands us in the invisible region
+		 again. */
+	      if (IT_CHARPOS (*it) >= newpos)
+		it->prev_stop = newpos;
+	    }
+	  else
+	    {
+	      IT_CHARPOS (*it) = newpos;
+	      IT_BYTEPOS (*it) = CHAR_TO_BYTE (newpos);
+	    }
 
 	  /* If there are before-strings at the start of invisible
 	     text, and the text is invisible because of a text
@@ -3836,7 +3847,7 @@
 	     overlay property instead of a text property, this is
 	     already handled in the overlay code.)  */
 	  if (NILP (overlay)
-	      && get_overlay_strings (it, start_charpos))
+	      && get_overlay_strings (it, it->stop_charpos))
 	    {
 	      handled = HANDLED_RECOMPUTE_PROPS;
 	      it->stack[it->sp - 1].display_ellipsis_p = display_ellipsis_p;
@@ -3857,7 +3868,7 @@
                  first invisible character.  */
 	      if (!STRINGP (it->object))
 		{
-		  it->position.charpos = IT_CHARPOS (*it) - 1;
+		  it->position.charpos = newpos - 1;
 		  it->position.bytepos = CHAR_TO_BYTE (it->position.charpos);
 		}
 	      it->ellipsis_p = 1;
@@ -4571,43 +4582,46 @@
   return 0;
 }
 
-
-/* Determine which buffer position in W's buffer STRING comes from.
-   AROUND_CHARPOS is an approximate position where it could come from.
-   Value is the buffer position or 0 if it couldn't be determined.
+/* Look for STRING in overlays and text properties in W's buffer,
+   between character positions FROM and TO (excluding TO).
+   BACK_P non-zero means look back (in this case, TO is supposed to be
+   less than FROM).
+   Value is the first character position where STRING was found, or
+   zero if it wasn't found before hitting TO.
 
    W's buffer must be current.
 
-   This function is necessary because we don't record buffer positions
-   in glyphs generated from strings (to keep struct glyph small).
    This function may only use code that doesn't eval because it is
    called asynchronously from note_mouse_highlight.  */
 
-int
-string_buffer_position (w, string, around_charpos)
+static EMACS_INT
+string_buffer_position_lim (w, string, from, to, back_p)
      struct window *w;
      Lisp_Object string;
-     int around_charpos;
+     EMACS_INT from, to;
+     int back_p;
 {
   Lisp_Object limit, prop, pos;
-  const int MAX_DISTANCE = 1000;
   int found = 0;
 
-  pos = make_number (around_charpos);
-  limit = make_number (min (XINT (pos) + MAX_DISTANCE, ZV));
-  while (!found && !EQ (pos, limit))
-    {
-      prop = Fget_char_property (pos, Qdisplay, Qnil);
-      if (!NILP (prop) && display_prop_string_p (prop, string))
-	found = 1;
-      else
-	pos = Fnext_single_char_property_change (pos, Qdisplay, Qnil, limit);
-    }
-
-  if (!found)
-    {
-      pos = make_number (around_charpos);
-      limit = make_number (max (XINT (pos) - MAX_DISTANCE, BEGV));
+  pos = make_number (from);
+
+  if (!back_p)	/* looking forward */
+    {
+      limit = make_number (min (to, ZV));
+      while (!found && !EQ (pos, limit))
+	{
+	  prop = Fget_char_property (pos, Qdisplay, Qnil);
+	  if (!NILP (prop) && display_prop_string_p (prop, string))
+	    found = 1;
+	  else
+	    pos = Fnext_single_char_property_change (pos, Qdisplay, Qnil,
+						     limit);
+	}
+    }
+  else		/* looking back */
+    {
+      limit = make_number (max (to, BEGV));
       while (!found && !EQ (pos, limit))
 	{
 	  prop = Fget_char_property (pos, Qdisplay, Qnil);
@@ -4622,6 +4636,35 @@
   return found ? XINT (pos) : 0;
 }
 
+/* Determine which buffer position in W's buffer STRING comes from.
+   AROUND_CHARPOS is an approximate position where it could come from.
+   Value is the buffer position or 0 if it couldn't be determined.
+
+   W's buffer must be current.
+
+   This function is necessary because we don't record buffer positions
+   in glyphs generated from strings (to keep struct glyph small).
+   This function may only use code that doesn't eval because it is
+   called asynchronously from note_mouse_highlight.  */
+
+EMACS_INT
+string_buffer_position (w, string, around_charpos)
+     struct window *w;
+     Lisp_Object string;
+     EMACS_INT around_charpos;
+{
+  Lisp_Object limit, prop, pos;
+  const int MAX_DISTANCE = 1000;
+  EMACS_INT found = string_buffer_position_lim (w, string, around_charpos,
+						around_charpos + MAX_DISTANCE,
+						0);
+
+  if (!found)
+    found = string_buffer_position_lim (w, string, around_charpos,
+					around_charpos - MAX_DISTANCE, 1);
+  return found;
+}
+
 
 
 /***********************************************************************
@@ -5088,6 +5131,8 @@
   p = it->stack + it->sp;
 
   p->stop_charpos = it->stop_charpos;
+  p->prev_stop = it->prev_stop;
+  p->base_level_stop = it->base_level_stop;
   p->cmp_it = it->cmp_it;
   xassert (it->face_id >= 0);
   p->face_id = it->face_id;
@@ -5138,6 +5183,8 @@
   --it->sp;
   p = it->stack + it->sp;
   it->stop_charpos = p->stop_charpos;
+  it->prev_stop = p->prev_stop;
+  it->base_level_stop = p->base_level_stop;
   it->cmp_it = p->cmp_it;
   it->face_id = p->face_id;
   it->current = p->current;
@@ -5315,8 +5362,8 @@
       if (IT_CHARPOS (*it) <= BEGV)
 	break;
 
-      /* If selective > 0, then lines indented more than that values
-	 are invisible.  */
+      /* If selective > 0, then lines indented more than its value are
+	 invisible.  */
       if (it->selective > 0
 	  && indented_beyond_p (IT_CHARPOS (*it), IT_BYTEPOS (*it),
 				(double) it->selective)) /* iftc */
@@ -5473,7 +5520,30 @@
   if (force_p
       || CHARPOS (pos) > it->stop_charpos
       || CHARPOS (pos) < original_pos)
-    handle_stop (it);
+    {
+      if (it->bidi_p)
+	{
+	  /* For bidi iteration, we need to prime prev_stop and
+	     base_level_stop with our best estimations.  */
+	  if (CHARPOS (pos) < it->prev_stop)
+	    {
+	      handle_stop_backwards (it, BEGV);
+	      if (CHARPOS (pos) < it->base_level_stop)
+		it->base_level_stop = 0;
+	    }
+	  else if (CHARPOS (pos) > it->stop_charpos
+		   && it->stop_charpos >= BEGV)
+	    handle_stop_backwards (it, it->stop_charpos);
+	  else	/* force_p */
+	    handle_stop (it);
+	}
+      else
+	{
+	  handle_stop (it);
+	  it->prev_stop = it->base_level_stop = 0;
+	}
+
+    }
 
   CHECK_IT (it);
 }
@@ -5510,9 +5580,14 @@
   it->sp = 0;
   it->string_from_display_prop_p = 0;
   it->face_before_selective_p = 0;
+  if (it->bidi_p)
+    it->bidi_it.first_elt = 1;
 
   if (set_stop_p)
-    it->stop_charpos = CHARPOS (pos);
+    {
+      it->stop_charpos = CHARPOS (pos);
+      it->base_level_stop = CHARPOS (pos);
+    }
 }
 
 
@@ -5624,7 +5699,7 @@
 
 /***********************************************************************
 			      Iteration
- ***********************************************************************/
+***********************************************************************/
 
 /* Map enum it_method value to corresponding next_element_from_* function.  */
 
@@ -5676,6 +5751,13 @@
 
   if (it->what == IT_CHARACTER)
     {
+      /* UAX#9, L4: "A character is depicted by a mirrored glyph if
+	 and only if (a) the resolved directionality of that character
+	 is R..."  */
+      /* FIXME: Do we need an exception for characters from display
+	 tables?  */
+      if (it->bidi_p && it->bidi_it.type == STRONG_R)
+	it->c = bidi_mirror_char (it->c);
       /* Map via display table or translate control characters.
 	 IT->c, IT->len etc. have been set to the next character by
 	 the function call above.  If we have a display table, and it
@@ -5690,7 +5772,7 @@
 	  Lisp_Object dv;
 	  struct charset *unibyte = CHARSET_FROM_ID (charset_unibyte);
 	  enum { char_is_other = 0, char_is_nbsp, char_is_soft_hyphen }
-	       nbsp_or_shy = char_is_other;
+	  nbsp_or_shy = char_is_other;
 	  int decoded = it->c;
 
 	  if (it->dp
@@ -5908,12 +5990,12 @@
 		       happen actually, but due to bugs it may
 		       happen.  Let's print the char as is, there's
 		       not much meaningful we can do with it.  */
-		      str[0] = it->c;
-		      str[1] = it->c >> 8;
-		      str[2] = it->c >> 16;
-		      str[3] = it->c >> 24;
-		      len = 4;
-		    }
+		    str[0] = it->c;
+		    str[1] = it->c >> 8;
+		    str[2] = it->c >> 16;
+		    str[3] = it->c >> 24;
+		    len = 4;
+		  }
 
 		for (i = 0; i < len; i++)
 		  {
@@ -6082,8 +6164,22 @@
       else
 	{
 	  xassert (it->len != 0);
-	  IT_BYTEPOS (*it) += it->len;
-	  IT_CHARPOS (*it) += 1;
+
+	  if (!it->bidi_p)
+	    {
+	      IT_BYTEPOS (*it) += it->len;
+	      IT_CHARPOS (*it) += 1;
+	    }
+	  else
+	    {
+	      /* If this is a new paragraph, determine its base
+		 direction (a.k.a. its base embedding level).  */
+	      if (it->bidi_it.new_paragraph)
+		bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it);
+	      bidi_get_next_char_visually (&it->bidi_it);
+	      IT_BYTEPOS (*it) = it->bidi_it.bytepos;
+	      IT_CHARPOS (*it) = it->bidi_it.charpos;
+	    }
 	  xassert (IT_BYTEPOS (*it) == CHAR_TO_BYTE (IT_CHARPOS (*it)));
 	}
       break;
@@ -6236,7 +6332,7 @@
   it->face_id = it->saved_face_id;
 
   /* KFS: This code used to check ip->dpvec[0] instead of the current element.
-          That seemed totally bogus - so I changed it...  */
+     That seemed totally bogus - so I changed it...  */
   gc = it->dpvec[it->current.dpvec_index];
 
   if (GLYPH_CODE_P (gc) && GLYPH_CODE_CHAR_VALID_P (gc))
@@ -6471,6 +6567,45 @@
   return 1;
 }
 
+/* Scan forward from CHARPOS in the current buffer, until we find a
+   stop position > current IT's position.  Then handle the stop
+   position before that.  This is called when we bump into a stop
+   position while reordering bidirectional text.  */
+
+static void
+handle_stop_backwards (it, charpos)
+     struct it *it;
+     EMACS_INT charpos;
+{
+  EMACS_INT where_we_are = IT_CHARPOS (*it);
+  struct display_pos save_current = it->current;
+  struct text_pos save_position = it->position;
+  struct text_pos pos1;
+  EMACS_INT next_stop;
+
+  /* Scan in strict logical order.  */
+  it->bidi_p = 0;
+  do
+    {
+      it->prev_stop = charpos;
+      SET_TEXT_POS (pos1, charpos, CHAR_TO_BYTE (charpos));
+      reseat_1 (it, pos1, 0);
+      compute_stop_pos (it);
+      /* We must advance forward, right?  */
+      if (it->stop_charpos <= it->prev_stop)
+	abort ();
+      charpos = it->stop_charpos;
+    }
+  while (charpos <= where_we_are);
+
+  next_stop = it->stop_charpos;
+  it->stop_charpos = it->prev_stop;
+  it->bidi_p = 1;
+  it->current = save_current;
+  it->position = save_position;
+  handle_stop (it);
+  it->stop_charpos = next_stop;
+}
 
 /* Load IT with the next display element from current_buffer.  Value
    is zero if end of buffer reached.  IT->stop_charpos is the next
@@ -6485,6 +6620,53 @@
 
   xassert (IT_CHARPOS (*it) >= BEGV);
 
+  /* With bidi reordering, the character to display might not be the
+     character at IT_CHARPOS.  BIDI_IT.FIRST_ELT non-zero means that
+     we were reseat()ed to a new buffer position, which is potentially
+     a different paragraph.  */
+  if (it->bidi_p && it->bidi_it.first_elt)
+    {
+      it->bidi_it.charpos = IT_CHARPOS (*it);
+      it->bidi_it.bytepos = IT_BYTEPOS (*it);
+      /* If we are at the beginning of a line, we can produce the next
+	 element right away.  */
+      if (it->bidi_it.bytepos == BEGV_BYTE
+	  /* FIXME: Should support all Unicode line separators.  */
+	  || FETCH_CHAR (it->bidi_it.bytepos - 1) == '\n'
+	  || FETCH_CHAR (it->bidi_it.bytepos) == '\n')
+	{
+	  bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it);
+	  bidi_get_next_char_visually (&it->bidi_it);
+	}
+      else
+	{
+	  int orig_bytepos = IT_BYTEPOS (*it);
+
+	  /* We need to prime the bidi iterator starting at the line's
+	     beginning, before we will be able to produce the next
+	     element.  */
+	  IT_CHARPOS (*it) = find_next_newline_no_quit (IT_CHARPOS (*it), -1);
+	  IT_BYTEPOS (*it) = CHAR_TO_BYTE (IT_CHARPOS (*it));
+	  it->bidi_it.charpos = IT_CHARPOS (*it);
+	  it->bidi_it.bytepos = IT_BYTEPOS (*it);
+	  bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it);
+	  do
+	    {
+	      /* Now return to buffer position where we were asked to
+		 get the next display element, and produce that.  */
+	      bidi_get_next_char_visually (&it->bidi_it);
+	    }
+	  while (it->bidi_it.bytepos != orig_bytepos
+		 && it->bidi_it.bytepos < ZV_BYTE);
+	}
+
+      it->bidi_it.first_elt = 0; /* paranoia: bidi.c does this */
+      /*  Adjust IT's position information to where we ended up.  */
+      IT_CHARPOS (*it) = it->bidi_it.charpos;
+      IT_BYTEPOS (*it) = it->bidi_it.bytepos;
+      SET_TEXT_POS (it->position, IT_CHARPOS (*it), IT_BYTEPOS (*it));
+    }
+
   if (IT_CHARPOS (*it) >= it->stop_charpos)
     {
       if (IT_CHARPOS (*it) >= it->end_charpos)
@@ -6510,12 +6692,51 @@
 	      success_p = 0;
 	    }
 	}
-      else
-	{
+      else if (!(!it->bidi_p
+		 || BIDI_AT_BASE_LEVEL (it->bidi_it)
+		 || IT_CHARPOS (*it) == it->stop_charpos))
+	{
+	  /* With bidi non-linear iteration, we could find ourselves
+	     far beyond the last computed stop_charpos, with several
+	     other stop positions in between that we missed.  Scan
+	     them all now, in buffer's logical order, until we find
+	     and handle the last stop_charpos that precedes our
+	     current position.  */
+	  handle_stop_backwards (it, it->stop_charpos);
+	  return GET_NEXT_DISPLAY_ELEMENT (it);
+	}
+      else
+	{
+	  if (it->bidi_p)
+	    {
+	      /* Take note of the stop position we just moved across,
+		 for when we will move back across it.  */
+	      it->prev_stop = it->stop_charpos;
+	      /* If we are at base paragraph embedding level, take
+		 note of the last stop position seen at this
+		 level.  */
+	      if (BIDI_AT_BASE_LEVEL (it->bidi_it))
+		it->base_level_stop = it->stop_charpos;
+	    }
 	  handle_stop (it);
 	  return GET_NEXT_DISPLAY_ELEMENT (it);
 	}
     }
+  else if (it->bidi_p
+	   /* We can sometimes back up for reasons that have nothing
+	      to do with bidi reordering.  E.g., compositions.  The
+	      code below is only needed when we are above the base
+	      embedding level, so test for that explicitly.  */
+	   && !BIDI_AT_BASE_LEVEL (it->bidi_it)
+	   && IT_CHARPOS (*it) < it->prev_stop)
+    {
+      if (it->base_level_stop <= 0)
+	it->base_level_stop = BEGV;
+      if (IT_CHARPOS (*it) < it->base_level_stop)
+	abort ();
+      handle_stop_backwards (it, it->base_level_stop);
+      return GET_NEXT_DISPLAY_ELEMENT (it);
+    }
   else
     {
       /* No face changes, overlays etc. in sight, so just return a
@@ -6670,9 +6891,9 @@
    line on the display without producing glyphs.
 
    OP should be a bit mask including some or all of these bits:
-    MOVE_TO_X: Stop on reaching x-position TO_X.
-    MOVE_TO_POS: Stop on reaching buffer or string position TO_CHARPOS.
-   Regardless of OP's value, stop in reaching the end of the display line.
+    MOVE_TO_X: Stop upon reaching x-position TO_X.
+    MOVE_TO_POS: Stop upon reaching buffer or string position TO_CHARPOS.
+   Regardless of OP's value, stop upon reaching the end of the display line.
 
    TO_X is normally a value 0 <= TO_X <= IT->last_visible_x.
    This means, in particular, that TO_X includes window's horizontal
@@ -6708,6 +6929,8 @@
   struct glyph_row *saved_glyph_row;
   struct it wrap_it, atpos_it, atx_it;
   int may_wrap = 0;
+  enum it_method prev_method = it->method;
+  EMACS_INT prev_pos = IT_CHARPOS (*it);
 
   /* Don't produce glyphs in produce_glyphs.  */
   saved_glyph_row = it->glyph_row;
@@ -6725,7 +6948,8 @@
 #define BUFFER_POS_REACHED_P()					\
   ((op & MOVE_TO_POS) != 0					\
    && BUFFERP (it->object)					\
-   && IT_CHARPOS (*it) >= to_charpos				\
+   && (IT_CHARPOS (*it) == to_charpos				\
+       || (!it->bidi_p && IT_CHARPOS (*it) > to_charpos))	\
    && (it->method == GET_FROM_BUFFER				\
        || (it->method == GET_FROM_DISPLAY_VECTOR		\
 	   && it->dpvec + it->current.dpvec_index + 1 >= it->dpend)))
@@ -6749,7 +6973,16 @@
       if ((op & MOVE_TO_POS) != 0
 	  && BUFFERP (it->object)
 	  && it->method == GET_FROM_BUFFER
-	  && IT_CHARPOS (*it) > to_charpos)
+	  && ((!it->bidi_p && IT_CHARPOS (*it) > to_charpos)
+	      || (it->bidi_p
+		  && (prev_method == GET_FROM_IMAGE
+		      || prev_method == GET_FROM_STRETCH)
+		  /* Passed TO_CHARPOS from left to right.  */
+		  && ((prev_pos < to_charpos
+		       && IT_CHARPOS (*it) > to_charpos)
+		      /* Passed TO_CHARPOS from right to left.  */
+		      || (prev_pos > to_charpos
+			  && IT_CHARPOS (*it) < to_charpos)))))
 	{
 	  if (it->line_wrap != WORD_WRAP || wrap_it.sp < 0)
 	    {
@@ -6763,6 +6996,9 @@
 	    atpos_it = *it;
 	}
 
+      prev_method = it->method;
+      if (it->method == GET_FROM_BUFFER)
+	prev_pos = IT_CHARPOS (*it);
       /* Stop when ZV reached.
          We used to stop here when TO_CHARPOS reached as well, but that is
          too soon if this glyph does not fit on this line.  So we handle it
@@ -7028,6 +7264,8 @@
 	  break;
 	}
 
+      if (it->method == GET_FROM_BUFFER)
+	prev_pos = IT_CHARPOS (*it);
       /* The current display element has been consumed.  Advance
 	 to the next.  */
       set_iterator_to_next (it, 1);
@@ -9498,32 +9736,7 @@
       if (! STRINGP (f->name)
 	  || SBYTES (f->name) != len
 	  || bcmp (title, SDATA (f->name), len) != 0)
-        {
-#ifdef HAVE_NS
-          if (FRAME_NS_P (f))
-            {
-              if (!MINI_WINDOW_P(XWINDOW(f->selected_window)))
-                {
-                  if (EQ (fmt, Qt))
-                    ns_set_name_as_filename (f);
-                  else
-                    x_implicitly_set_name (f, make_string(title, len),
-                                           Qnil);
-                }
-            }
-          else
-#endif
-	    x_implicitly_set_name (f, make_string (title, len), Qnil);
-        }
-#ifdef HAVE_NS
-      if (FRAME_NS_P (f))
-        {
-          /* do this also for frames with explicit names */
-          ns_implicitly_set_icon_type(f);
-          ns_set_doc_edited(f, Fbuffer_modified_p
-                            (XWINDOW (f->selected_window)->buffer), Qnil);
-        }
-#endif
+	x_implicitly_set_name (f, make_string (title, len), Qnil);
     }
 }
 
@@ -9620,6 +9833,11 @@
 #ifdef HAVE_WINDOW_SYSTEM
 	  update_tool_bar (f, 0);
 #endif
+#ifdef HAVE_NS
+          if (windows_or_buffers_changed)
+            ns_set_doc_edited (f, Fbuffer_modified_p
+			       (XWINDOW (f->selected_window)->buffer));
+#endif
 	  UNGCPRO;
 	}
 
@@ -11033,6 +11251,17 @@
 	      && overlay_touches_p (Z - end))
 	    unchanged_p = 0;
 	}
+
+      /* Under bidi reordering, adding or deleting a character in the
+	 beginning of a paragraph, before the first strong directional
+	 character, can change the base direction of the paragraph (unless
+	 the buffer specifies a fixed paragraph direction), which will
+	 require to redisplay the whole paragraph.  It might be worthwhile
+	 to find the paragraph limits and widen the range of redisplayed
+	 lines to that, but for now just give up this optimization.  */
+      if (!NILP (XBUFFER (w->buffer)->bidi_display_reordering)
+	  && NILP (XBUFFER (w->buffer)->bidi_paragraph_direction))
+	unchanged_p = 0;
     }
 
   return unchanged_p;
@@ -11364,16 +11593,6 @@
   if (!f->glyphs_initialized_p)
     return;
 
-  /* The flag redisplay_performed_directly_p is set by
-     direct_output_for_insert when it already did the whole screen
-     update necessary.  */
-  if (redisplay_performed_directly_p)
-    {
-      redisplay_performed_directly_p = 0;
-      if (!hscroll_windows (selected_window))
-	return;
-    }
-
 #if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NS)
   if (popup_activated ())
     return;
@@ -12323,162 +12542,400 @@
   struct glyph *glyph = row->glyphs[TEXT_AREA];
   struct glyph *end = glyph + row->used[TEXT_AREA];
   struct glyph *cursor = NULL;
-  /* The first glyph that starts a sequence of glyphs from a string
-     that is a value of a display property.  */
-  struct glyph *string_start;
-  /* The X coordinate of string_start.  */
-  int string_start_x;
   /* The last known character position in row.  */
   int last_pos = MATRIX_ROW_START_CHARPOS (row) + delta;
-  /* The last known character position before string_start.  */
-  int string_before_pos;
   int x = row->x;
   int cursor_x = x;
-  /* Last buffer position covered by an overlay.  */
-  int cursor_from_overlay_pos = 0;
-  int pt_old = PT - delta;
-
-  /* Skip over glyphs not having an object at the start of the row.
-     These are special glyphs like truncation marks on terminal
-     frames.  */
+  EMACS_INT pt_old = PT - delta;
+  EMACS_INT pos_before = MATRIX_ROW_START_CHARPOS (row) + delta;
+  EMACS_INT pos_after = MATRIX_ROW_END_CHARPOS (row) + delta;
+  struct glyph *glyph_before = glyph - 1, *glyph_after = end;
+  /* Non-zero means we've found a match for cursor position, but that
+     glyph has the avoid_cursor_p flag set.  */
+  int match_with_avoid_cursor = 0;
+  /* Non-zero means we've seen at least one glyph that came from a
+     display string.  */
+  int string_seen = 0;
+  /* Largest buffer position seen so far during scan of glyph row.  */
+  EMACS_INT bpos_max = last_pos;
+  /* Last buffer position covered by an overlay string with an integer
+     `cursor' property.  */
+  EMACS_INT bpos_covered = 0;
+
+  /* Skip over glyphs not having an object at the start and the end of
+     the row.  These are special glyphs like truncation marks on
+     terminal frames.  */
   if (row->displays_text_p)
-    while (glyph < end
-	   && INTEGERP (glyph->object)
-	   && glyph->charpos < 0)
+    {
+      if (!row->reversed_p)
+	{
+	  while (glyph < end
+		 && INTEGERP (glyph->object)
+		 && glyph->charpos < 0)
+	    {
+	      x += glyph->pixel_width;
+	      ++glyph;
+	    }
+	  while (end > glyph
+		 && INTEGERP ((end - 1)->object)
+		 /* CHARPOS is zero for blanks inserted by
+		    extend_face_to_end_of_line.  */
+		 && (end - 1)->charpos <= 0)
+	    --end;
+	  glyph_before = glyph - 1;
+	  glyph_after = end;
+	}
+      else
+	{
+	  struct glyph *g;
+
+	  /* If the glyph row is reversed, we need to process it from back
+	     to front, so swap the edge pointers.  */
+	  end = glyph - 1;
+	  glyph += row->used[TEXT_AREA] - 1;
+	  /* Reverse the known positions in the row.  */
+	  last_pos = pos_after = MATRIX_ROW_START_CHARPOS (row) + delta;
+	  pos_before = MATRIX_ROW_END_CHARPOS (row) + delta;
+
+	  while (glyph > end + 1
+		 && INTEGERP (glyph->object)
+		 && glyph->charpos < 0)
+	    {
+	      --glyph;
+	      x -= glyph->pixel_width;
+	    }
+	  if (INTEGERP (glyph->object) && glyph->charpos < 0)
+	    --glyph;
+	  /* By default, put the cursor on the rightmost glyph.  */
+	  for (g = end + 1; g < glyph; g++)
+	    x += g->pixel_width;
+	  cursor_x = x;
+	  while (end < glyph
+		 && INTEGERP ((end + 1)->object)
+		 && (end + 1)->charpos <= 0)
+	    ++end;
+	  glyph_before = glyph + 1;
+	  glyph_after = end;
+	}
+    }
+  else if (row->reversed_p)
+    {
+      /* In R2L rows that don't display text, put the cursor on the
+	 rightmost glyph.  Case in point: an empty last line that is
+	 part of an R2L paragraph.  */
+      cursor = end - 1;
+      x = -1;	/* will be computed below, at lable compute_x */
+    }
+
+  /* Step 1: Try to find the glyph whose character position
+     corresponds to point.  If that's not possible, find 2 glyphs
+     whose character positions are the closest to point, one before
+     point, the other after it.  */
+  if (!row->reversed_p)
+    while (/* not marched to end of glyph row */
+	   glyph < end
+	   /* glyph was not inserted by redisplay for internal purposes */
+	   && !INTEGERP (glyph->object))
       {
+	if (BUFFERP (glyph->object))
+	  {
+	    EMACS_INT dpos = glyph->charpos - pt_old;
+
+	    if (glyph->charpos > bpos_max)
+	      bpos_max = glyph->charpos;
+	    if (!glyph->avoid_cursor_p)
+	      {
+		/* If we hit point, we've found the glyph on which to
+		   display the cursor.  */
+		if (dpos == 0)
+		  {
+		    match_with_avoid_cursor = 0;
+		    break;
+		  }
+		/* See if we've found a better approximation to
+		   POS_BEFORE or to POS_AFTER.  Note that we want the
+		   first (leftmost) glyph of all those that are the
+		   closest from below, and the last (rightmost) of all
+		   those from above.  */
+		if (0 > dpos && dpos > pos_before - pt_old)
+		  {
+		    pos_before = glyph->charpos;
+		    glyph_before = glyph;
+		  }
+		else if (0 < dpos && dpos <= pos_after - pt_old)
+		  {
+		    pos_after = glyph->charpos;
+		    glyph_after = glyph;
+		  }
+	      }
+	    else if (dpos == 0)
+	      match_with_avoid_cursor = 1;
+	  }
+	else if (STRINGP (glyph->object))
+	  {
+	    Lisp_Object chprop;
+	    int glyph_pos = glyph->charpos;
+
+	    chprop = Fget_char_property (make_number (glyph_pos), Qcursor,
+					 glyph->object);
+	    if (INTEGERP (chprop))
+	      {
+		bpos_covered = bpos_max + XINT (chprop);
+		/* If the `cursor' property covers buffer positions up
+		   to and including point, we should display cursor on
+		   this glyph.  */
+		/* Implementation note: bpos_max == pt_old when, e.g.,
+		   we are in an empty line, where bpos_max is set to
+		   MATRIX_ROW_START_CHARPOS, see above.  */
+		if (bpos_max <= pt_old && bpos_covered >= pt_old)
+		  {
+		    cursor = glyph;
+		    break;
+		  }
+	      }
+
+	    string_seen = 1;
+	  }
 	x += glyph->pixel_width;
 	++glyph;
       }
-
-  string_start = NULL;
-  while (glyph < end
-	 && !INTEGERP (glyph->object)
-	 && (!BUFFERP (glyph->object)
-	     || (last_pos = glyph->charpos) < pt_old
-	     || glyph->avoid_cursor_p))
-    {
-      if (! STRINGP (glyph->object))
-	{
-	  string_start = NULL;
-	  x += glyph->pixel_width;
-	  ++glyph;
-	  /* If we are beyond the cursor position computed from the
-	     last overlay seen, that overlay is not in effect for
-	     current cursor position.  Reset the cursor information
-	     computed from that overlay.  */
-	  if (cursor_from_overlay_pos
-	      && last_pos >= cursor_from_overlay_pos)
-	    {
-	      cursor_from_overlay_pos = 0;
-	      cursor = NULL;
-	    }
-	}
-      else
-	{
-	  if (string_start == NULL)
-	    {
-	      string_before_pos = last_pos;
-	      string_start = glyph;
-	      string_start_x = x;
-	    }
-	  /* Skip all glyphs from a string.  */
-	  do
-	    {
-	      Lisp_Object cprop;
-	      int pos;
-	      if ((cursor == NULL || glyph > cursor)
-		  && (cprop = Fget_char_property (make_number ((glyph)->charpos),
-						  Qcursor, (glyph)->object),
-		      !NILP (cprop))
-		  && (pos = string_buffer_position (w, glyph->object,
-						    string_before_pos),
-		      (pos == 0	  /* from overlay */
-		       || pos == pt_old)))
-		{
-		  /* Compute the first buffer position after the overlay.
-		     If the `cursor' property tells us how  many positions
-		     are associated with the overlay, use that.  Otherwise,
-		     estimate from the buffer positions of the glyphs
-		     before and after the overlay.  */
-		  cursor_from_overlay_pos = (pos ? 0 : last_pos
-					     + (INTEGERP (cprop) ? XINT (cprop) : 0));
-		  cursor = glyph;
-		  cursor_x = x;
-		}
+  else if (glyph > end)	/* row is reversed */
+    while (!INTEGERP (glyph->object))
+      {
+	if (BUFFERP (glyph->object))
+	  {
+	    EMACS_INT dpos = glyph->charpos - pt_old;
+
+	    if (glyph->charpos > bpos_max)
+	      bpos_max = glyph->charpos;
+	    if (!glyph->avoid_cursor_p)
+	      {
+		if (dpos == 0)
+		  {
+		    match_with_avoid_cursor = 0;
+		    break;
+		  }
+		if (0 > dpos && dpos > pos_before - pt_old)
+		  {
+		    pos_before = glyph->charpos;
+		    glyph_before = glyph;
+		  }
+		else if (0 < dpos && dpos <= pos_after - pt_old)
+		  {
+		    pos_after = glyph->charpos;
+		    glyph_after = glyph;
+		  }
+	      }
+	    else if (dpos == 0)
+	      match_with_avoid_cursor = 1;
+	  }
+	else if (STRINGP (glyph->object))
+	  {
+	    Lisp_Object chprop;
+	    int glyph_pos = glyph->charpos;
+
+	    chprop = Fget_char_property (make_number (glyph_pos), Qcursor,
+					 glyph->object);
+	    if (INTEGERP (chprop))
+	      {
+		bpos_covered = bpos_max + XINT (chprop);
+		/* If the `cursor' property covers buffer positions up
+		   to and including point, we should display cursor on
+		   this glyph.  */
+		if (bpos_max <= pt_old && bpos_covered >= pt_old)
+		  {
+		    cursor = glyph;
+		    break;
+		  }
+	      }
+	    string_seen = 1;
+	  }
+	--glyph;
+	if (glyph == end)
+	  break;
+	x -= glyph->pixel_width;
+    }
+
+  /* Step 2: If we didn't find an exact match for point, we need to
+     look for a proper place to put the cursor among glyphs between
+     GLYPH_BEFORE and GLYPH_AFTER.  */
+  if (!(BUFFERP (glyph->object) && glyph->charpos == pt_old)
+      && bpos_covered < pt_old)
+    {
+      if (row->ends_in_ellipsis_p && pos_after == last_pos)
+	{
+	  EMACS_INT ellipsis_pos;
+
+	  /* Scan back over the ellipsis glyphs.  */
+	  if (!row->reversed_p)
+	    {
+	      ellipsis_pos = (glyph - 1)->charpos;
+	      while (glyph > row->glyphs[TEXT_AREA]
+		     && (glyph - 1)->charpos == ellipsis_pos)
+		glyph--, x -= glyph->pixel_width;
+	      /* That loop always goes one position too far, including
+		 the glyph before the ellipsis.  So scan forward over
+		 that one.  */
 	      x += glyph->pixel_width;
-	      ++glyph;
-	    }
-	  while (glyph < end && EQ (glyph->object, string_start->object));
-	}
-    }
-
+	      glyph++;
+	    }
+	  else	/* row is reversed */
+	    {
+	      ellipsis_pos = (glyph + 1)->charpos;
+	      while (glyph < row->glyphs[TEXT_AREA] + row->used[TEXT_AREA] - 1
+		     && (glyph + 1)->charpos == ellipsis_pos)
+		glyph++, x += glyph->pixel_width;
+	      x -= glyph->pixel_width;
+	      glyph--;
+	    }
+	}
+      else if (match_with_avoid_cursor
+	       /* zero-width characters produce no glyphs */
+	       || eabs (glyph_after - glyph_before) == 1)
+	{
+	  cursor = glyph_after;
+	  x = -1;
+	}
+      else if (string_seen)
+	{
+	  int incr = row->reversed_p ? -1 : +1;
+
+	  /* Need to find the glyph that came out of a string which is
+	     present at point.  That glyph is somewhere between
+	     GLYPH_BEFORE and GLYPH_AFTER, and it came from a string
+	     positioned between POS_BEFORE and POS_AFTER in the
+	     buffer.  */
+	  struct glyph *stop = glyph_after;
+	  EMACS_INT pos = pos_before;
+
+	  x = -1;
+	  for (glyph = glyph_before + incr;
+	       row->reversed_p ? glyph > stop : glyph < stop; )
+	    {
+
+	      /* Any glyphs that come from the buffer are here because
+		 of bidi reordering.  Skip them, and only pay
+		 attention to glyphs that came from some string.  */
+	      if (STRINGP (glyph->object))
+		{
+		  Lisp_Object str;
+		  EMACS_INT tem;
+
+		  str = glyph->object;
+		  tem = string_buffer_position_lim (w, str, pos, pos_after, 0);
+		  if (pos <= tem)
+		    {
+		      /* If the string from which this glyph came is
+			 found in the buffer at point, then we've
+			 found the glyph we've been looking for.  */
+		      if (tem == pt_old)
+			{
+			  /* The glyphs from this string could have
+			     been reordered.  Find the one with the
+			     smallest string position.  Or there could
+			     be a character in the string with the
+			     `cursor' property, which means display
+			     cursor on that character's glyph.  */
+			  int strpos = glyph->charpos;
+
+			  cursor = glyph;
+			  for (glyph += incr;
+			       EQ (glyph->object, str);
+			       glyph += incr)
+			    {
+			      Lisp_Object cprop;
+			      int gpos = glyph->charpos;
+
+			      cprop = Fget_char_property (make_number (gpos),
+							  Qcursor,
+							  glyph->object);
+			      if (!NILP (cprop))
+				{
+				  cursor = glyph;
+				  break;
+				}
+			      if (glyph->charpos < strpos)
+				{
+				  strpos = glyph->charpos;
+				  cursor = glyph;
+				}
+			    }
+
+			  goto compute_x;
+			}
+		      pos = tem + 1; /* don't find previous instances */
+		    }
+		  /* This string is not what we want; skip all of the
+		     glyphs that came from it.  */
+		  do
+		    glyph += incr;
+		  while ((row->reversed_p ? glyph > stop : glyph < stop)
+			 && EQ (glyph->object, str));
+		}
+	      else
+		glyph += incr;
+	    }
+
+	  /* If we reached the end of the line, and END was from a string,
+	     the cursor is not on this line.  */
+	  if (glyph == end
+	      && STRINGP ((glyph - incr)->object)
+	      && row->continued_p)
+	    return 0;
+	}
+    }
+
+ compute_x:
   if (cursor != NULL)
-    {
-      glyph = cursor;
-      x = cursor_x;
-    }
-  else if (row->ends_in_ellipsis_p && glyph == end)
-    {
-      /* Scan back over the ellipsis glyphs, decrementing positions.  */
-      while (glyph > row->glyphs[TEXT_AREA]
-	     && (glyph - 1)->charpos == last_pos)
-	glyph--, x -= glyph->pixel_width;
-      /* That loop always goes one position too far, including the
-	 glyph before the ellipsis.  So scan forward over that one.  */
-      x += glyph->pixel_width;
-      glyph++;
-    }
-  else if (string_start
-	   && (glyph == end || !BUFFERP (glyph->object) || last_pos > pt_old))
-    {
-      /* We may have skipped over point because the previous glyphs
-	 are from string.  As there's no easy way to know the
-	 character position of the current glyph, find the correct
-	 glyph on point by scanning from string_start again.  */
-      Lisp_Object limit;
-      Lisp_Object string;
-      struct glyph *stop = glyph;
-      int pos;
-
-      limit = make_number (pt_old + 1);
-      glyph = string_start;
-      x = string_start_x;
-      string = glyph->object;
-      pos = string_buffer_position (w, string, string_before_pos);
-      /* If POS == 0, STRING is from overlay.  We skip such glyphs
-	 because we always put the cursor after overlay strings.  */
-      while (pos == 0 && glyph < stop)
-	{
-	  string = glyph->object;
-	  SKIP_GLYPHS (glyph, stop, x, EQ (glyph->object, string));
-	  if (glyph < stop)
-	    pos = string_buffer_position (w, glyph->object, string_before_pos);
-	}
-
-      while (glyph < stop)
-	{
-	  pos = XINT (Fnext_single_char_property_change
-		      (make_number (pos), Qdisplay, Qnil, limit));
-	  if (pos > pt_old)
-	    break;
-	  /* Skip glyphs from the same string.  */
-	  string = glyph->object;
-	  SKIP_GLYPHS (glyph, stop, x, EQ (glyph->object, string));
-	  /* Skip glyphs from an overlay.  */
-	  while (glyph < stop
-		 && ! string_buffer_position (w, glyph->object, pos))
-	    {
-	      string = glyph->object;
-	      SKIP_GLYPHS (glyph, stop, x, EQ (glyph->object, string));
-	    }
-	}
-
-      /* If we reached the end of the line, and END was from a string,
-	 the cursor is not on this line.  */
-      if (glyph == end && row->continued_p)
+    glyph = cursor;
+  if (x < 0)
+    {
+      struct glyph *g;
+
+      /* Need to compute x that corresponds to GLYPH.  */
+      for (g = row->glyphs[TEXT_AREA], x = row->x; g < glyph; g++)
+	{
+	  if (g >= row->glyphs[TEXT_AREA] + row->used[TEXT_AREA])
+	    abort ();
+	  x += g->pixel_width;
+	}
+    }
+
+  /* ROW could be part of a continued line, which might have other
+     rows whose start and end charpos occlude point.  Only set
+     w->cursor if we found a better approximation to the cursor
+     position than we have from previously examined rows.  */
+  if (w->cursor.vpos >= 0
+      /* Make sure cursor.vpos specifies a row whose start and end
+	 charpos occlude point.  This is because some callers of this
+	 function leave cursor.vpos at the row where the cursor was
+	 displayed during the last redisplay cycle.  */
+      && MATRIX_ROW_START_CHARPOS (MATRIX_ROW (matrix, w->cursor.vpos)) <= pt_old
+      && pt_old < MATRIX_ROW_END_CHARPOS (MATRIX_ROW (matrix, w->cursor.vpos)))
+    {
+      struct glyph *g1 =
+	MATRIX_ROW_GLYPH_START (matrix, w->cursor.vpos) + w->cursor.hpos;
+
+      /* Keep the candidate whose buffer position is the closest to
+	 point.  */
+      if (BUFFERP (g1->object)
+	  && (g1->charpos == pt_old /* an exact match always wins */
+	      || (BUFFERP (glyph->object)
+		  && eabs (g1->charpos - pt_old)
+		   < eabs (glyph->charpos - pt_old))))
 	return 0;
-    }
-
+      /* If this candidate gives an exact match, use that.  */
+      if (!(BUFFERP (glyph->object) && glyph->charpos == pt_old)
+	  /* Otherwise, keep the candidate that comes from a row
+	     spanning less buffer positions.  This may win when one or
+	     both candidate positions are on glyphs that came from
+	     display strings, for which we cannot compare buffer
+	     positions.  */
+	  && MATRIX_ROW_END_CHARPOS (MATRIX_ROW (matrix, w->cursor.vpos))
+	     - MATRIX_ROW_START_CHARPOS (MATRIX_ROW (matrix, w->cursor.vpos))
+	     < MATRIX_ROW_END_CHARPOS (row) - MATRIX_ROW_START_CHARPOS (row))
+	return 0;
+    }
   w->cursor.hpos = glyph - row->glyphs[TEXT_AREA];
   w->cursor.x = x;
   w->cursor.vpos = MATRIX_ROW_VPOS (row, matrix) + dvpos;
@@ -13025,6 +13482,32 @@
 	    ++row;
 	  if (!row->enabled_p)
 	    rc = CURSOR_MOVEMENT_MUST_SCROLL;
+	  /* If rows are bidi-reordered, back up until we find a row
+	     that does not belong to a continuation line.  This is
+	     because we must consider all rows of a continued line as
+	     candidates for cursor positioning, since row start and
+	     end positions change non-linearly with vertical position
+	     in such rows.  */
+	  /* FIXME: Revisit this when glyph ``spilling'' in
+	     continuation lines' rows is implemented for
+	     bidi-reordered rows.  */
+	  if (!NILP (XBUFFER (w->buffer)->bidi_display_reordering))
+	    {
+	      while (MATRIX_ROW_CONTINUATION_LINE_P (row))
+		{
+		  xassert (row->enabled_p);
+		  --row;
+		  /* If we hit the beginning of the displayed portion
+		     without finding the first row of a continued
+		     line, give up.  */
+		  if (row <= w->current_matrix->rows)
+		    {
+		      rc = CURSOR_MOVEMENT_MUST_SCROLL;
+		      break;
+		    }
+
+		}
+	    }
 	}
 
       if (rc == CURSOR_MOVEMENT_CANNOT_BE_USED)
@@ -13148,6 +13631,46 @@
 	    }
 	  else if (scroll_p)
 	    rc = CURSOR_MOVEMENT_MUST_SCROLL;
+	  else if (!NILP (XBUFFER (w->buffer)->bidi_display_reordering))
+	    {
+	      /* With bidi-reordered rows, there could be more than
+		 one candidate row whose start and end positions
+		 occlude point.  We need to let set_cursor_from_row
+		 find the best candidate.  */
+	      /* FIXME: Revisit this when glyph ``spilling'' in
+		 continuation lines' rows is implemented for
+		 bidi-reordered rows.  */
+	      int rv = 0;
+
+	      do
+		{
+		  rv |= set_cursor_from_row (w, row, w->current_matrix,
+					     0, 0, 0, 0);
+		  /* As soon as we've found the first suitable row
+		     whose ends_at_zv_p flag is set, we are done.  */
+		  if (rv
+		      && MATRIX_ROW (w->current_matrix, w->cursor.vpos)->ends_at_zv_p)
+		    {
+		      rc = CURSOR_MOVEMENT_SUCCESS;
+		      break;
+		    }
+		  ++row;
+		}
+	      while (MATRIX_ROW_BOTTOM_Y (row) < last_y
+		     && MATRIX_ROW_START_CHARPOS (row) <= PT
+		     && PT <= MATRIX_ROW_END_CHARPOS (row)
+		     && cursor_row_p (w, row));
+	      /* If we didn't find any candidate rows, or exited the
+		 loop before all the candidates were examined, signal
+		 to the caller that this method failed.  */
+	      if (rc != CURSOR_MOVEMENT_SUCCESS
+		  && (!rv
+		      || (MATRIX_ROW_START_CHARPOS (row) <= PT
+			  && PT <= MATRIX_ROW_END_CHARPOS (row))))
+		rc = CURSOR_MOVEMENT_CANNOT_BE_USED;
+	      else
+		rc = CURSOR_MOVEMENT_SUCCESS;
+	    }
 	  else
 	    {
 	      do
@@ -14474,15 +14997,39 @@
 	    {
 	      struct glyph *glyph = row->glyphs[TEXT_AREA] + w->cursor.hpos;
 	      struct glyph *end = glyph + row->used[TEXT_AREA];
+	      struct glyph *orig_glyph = glyph;
+	      struct cursor_pos orig_cursor = w->cursor;
 
 	      for (; glyph < end
 		     && (!BUFFERP (glyph->object)
-			 || glyph->charpos < PT);
+			 || glyph->charpos != PT);
 		   glyph++)
 		{
 		  w->cursor.hpos++;
 		  w->cursor.x += glyph->pixel_width;
 		}
+	      /* With bidi reordering, charpos changes non-linearly
+		 with hpos, so the right glyph could be to the
+		 left.  */
+	      if (!NILP (XBUFFER (w->buffer)->bidi_display_reordering)
+		  && (!BUFFERP (glyph->object) || glyph->charpos != PT))
+		{
+		  struct glyph *start_glyph = row->glyphs[TEXT_AREA];
+
+		  glyph = orig_glyph - 1;
+		  orig_cursor.hpos--;
+		  orig_cursor.x -= glyph->pixel_width;
+		  for (; glyph >= start_glyph
+			 && (!BUFFERP (glyph->object)
+			     || glyph->charpos != PT);
+		       glyph--)
+		    {
+		      w->cursor.hpos--;
+		      w->cursor.x -= glyph->pixel_width;
+		    }
+		  if (BUFFERP (glyph->object) && glyph->charpos == PT)
+		    w->cursor = orig_cursor;
+		}
 	    }
 	}
 
@@ -14749,6 +15296,8 @@
      int dy;
 {
   struct glyph_row *row = start;
+  struct glyph_row *best_row = NULL;
+  EMACS_INT mindif = BUF_ZV (XBUFFER (w->buffer)) + 1;
   int last_y;
 
   /* If we happen to start on a header-line, skip that.  */
@@ -14781,7 +15330,30 @@
 		 && !row->ends_at_zv_p
 		 && !MATRIX_ROW_ENDS_IN_MIDDLE_OF_CHAR_P (row)))
 	  && charpos >= MATRIX_ROW_START_CHARPOS (row))
-	return row;
+	{
+	  struct glyph *g;
+
+	  if (NILP (XBUFFER (w->buffer)->bidi_display_reordering))
+	    return row;
+	  /* In bidi-reordered rows, there could be several rows
+	     occluding point.  We need to find the one which fits
+	     CHARPOS the best.  */
+	  for (g = row->glyphs[TEXT_AREA];
+	       g < row->glyphs[TEXT_AREA] + row->used[TEXT_AREA];
+	       g++)
+	    {
+	      if (!STRINGP (g->object))
+		{
+		  if (g->charpos > 0 && eabs (g->charpos - charpos) < mindif)
+		    {
+		      mindif = eabs (g->charpos - charpos);
+		      best_row = row;
+		    }
+		}
+	    }
+	}
+      else if (best_row)
+	return best_row;
       ++row;
     }
 }
@@ -14926,6 +15498,18 @@
   if (!NILP (XBUFFER (w->buffer)->word_wrap))
     GIVE_UP (21);
 
+  /* Under bidi reordering, adding or deleting a character in the
+     beginning of a paragraph, before the first strong directional
+     character, can change the base direction of the paragraph (unless
+     the buffer specifies a fixed paragraph direction), which will
+     require to redisplay the whole paragraph.  It might be worthwhile
+     to find the paragraph limits and widen the range of redisplayed
+     lines to that, but for now just give up this optimization and
+     redisplay from scratch.  */
+  if (!NILP (XBUFFER (w->buffer)->bidi_display_reordering)
+      && NILP (XBUFFER (w->buffer)->bidi_paragraph_direction))
+    GIVE_UP (22);
+
   /* Make sure beg_unchanged and end_unchanged are up to date.  Do it
      only if buffer has really changed.  The reason is that the gap is
      initially at Z for freshly visited files.  The code below would
@@ -16284,19 +16868,37 @@
       struct glyph *start = row->glyphs[TEXT_AREA];
       struct glyph *glyph = start + used - 1;
 
+      if (row->reversed_p)
+	{
+	  /* Right-to-left rows need to be processed in the opposite
+	     direction, so swap the edge pointers. */
+	  glyph = start;
+	  start = row->glyphs[TEXT_AREA] + used - 1;
+	}
+
       /* Skip over glyphs inserted to display the cursor at the
 	 end of a line, for extending the face of the last glyph
 	 to the end of the line on terminals, and for truncation
 	 and continuation glyphs.  */
-      while (glyph >= start
-	     && glyph->type == CHAR_GLYPH
-	     && INTEGERP (glyph->object))
-	--glyph;
+      if (!row->reversed_p)
+	{
+	  while (glyph >= start
+		 && glyph->type == CHAR_GLYPH
+		 && INTEGERP (glyph->object))
+	    --glyph;
+	}
+      else
+	{
+	  while (glyph <= start
+		 && glyph->type == CHAR_GLYPH
+		 && INTEGERP (glyph->object))
+	    ++glyph;
+	}
 
       /* If last glyph is a space or stretch, and it's trailing
 	 whitespace, set the face of all trailing whitespace glyphs in
 	 IT->glyph_row to `trailing-whitespace'.  */
-      if (glyph >= start
+      if ((row->reversed_p ? glyph <= start : glyph >= start)
 	  && BUFFERP (glyph->object)
 	  && (glyph->type == STRETCH_GLYPH
 	      || (glyph->type == CHAR_GLYPH
@@ -16307,12 +16909,24 @@
 	  if (face_id < 0)
 	    return;
 
-	  while (glyph >= start
-		 && BUFFERP (glyph->object)
-		 && (glyph->type == STRETCH_GLYPH
-		     || (glyph->type == CHAR_GLYPH
-			 && glyph->u.ch == ' ')))
-	    (glyph--)->face_id = face_id;
+	  if (!row->reversed_p)
+	    {
+	      while (glyph >= start
+		     && BUFFERP (glyph->object)
+		     && (glyph->type == STRETCH_GLYPH
+			 || (glyph->type == CHAR_GLYPH
+			     && glyph->u.ch == ' ')))
+		(glyph--)->face_id = face_id;
+	    }
+	  else
+	    {
+	      while (glyph <= start
+		     && BUFFERP (glyph->object)
+		     && (glyph->type == STRETCH_GLYPH
+			 || (glyph->type == CHAR_GLYPH
+			     && glyph->u.ch == ' ')))
+		(glyph++)->face_id = face_id;
+	    }
 	}
     }
 }
@@ -16501,6 +17115,8 @@
   int wrap_row_used = -1, wrap_row_ascent, wrap_row_height;
   int wrap_row_phys_ascent, wrap_row_phys_height;
   int wrap_row_extra_line_spacing;
+  struct display_pos row_end;
+  int cvpos;
 
   /* We always start displaying at hpos zero even if hscrolled.  */
   xassert (it->hpos == 0 && it->current_x == 0);
@@ -16589,6 +17205,11 @@
 
 	  it->continuation_lines_width = 0;
 	  row->ends_at_zv_p = 1;
+	  /* A row that displays right-to-left text must always have
+	     its last face extended all the way to the end of line,
+	     even if this row ends in ZV.  */
+	  if (row->reversed_p)
+	    extend_face_to_end_of_line (it);
 	  break;
 	}
 
@@ -16996,7 +17617,116 @@
   compute_line_metrics (it);
 
   /* Remember the position at which this line ends.  */
-  row->end = it->current;
+  row->end = row_end = it->current;
+  if (it->bidi_p)
+    {
+      /* ROW->start and ROW->end must be the smallest and largest
+	 buffer positions in ROW.  But if ROW was bidi-reordered,
+	 these two positions can be anywhere in the row, so we must
+	 rescan all of the ROW's glyphs to find them.  */
+      /* FIXME: Revisit this when glyph ``spilling'' in continuation
+	 lines' rows is implemented for bidi-reordered rows.  */
+      EMACS_INT min_pos = ZV + 1, max_pos = 0;
+      struct glyph *g;
+      struct it save_it;
+      struct text_pos tpos;
+
+      for (g = row->glyphs[TEXT_AREA];
+	   g < row->glyphs[TEXT_AREA] + row->used[TEXT_AREA];
+	   g++)
+	{
+	  if (BUFFERP (g->object))
+	    {
+	      if (g->charpos > 0 && g->charpos < min_pos)
+		min_pos = g->charpos;
+	      if (g->charpos > max_pos)
+		max_pos = g->charpos;
+	    }
+	}
+      /* Empty lines have a valid buffer position at their first
+	 glyph, but that glyph's OBJECT is zero, as if it didn't come
+	 from a buffer.  If we didn't find any valid buffer positions
+	 in this row, maybe we have such an empty line.  */
+      if (min_pos == ZV + 1 && row->used[TEXT_AREA])
+	{
+	  for (g = row->glyphs[TEXT_AREA];
+	       g < row->glyphs[TEXT_AREA] + row->used[TEXT_AREA];
+	       g++)
+	    {
+	      if (INTEGERP (g->object))
+		{
+		  if (g->charpos > 0 && g->charpos < min_pos)
+		    min_pos = g->charpos;
+		  if (g->charpos > max_pos)
+		    max_pos = g->charpos;
+		}
+	    }
+	}
+      if (min_pos <= ZV)
+	{
+	  if (min_pos != row->start.pos.charpos)
+	    {
+	      row->start.pos.charpos = min_pos;
+	      row->start.pos.bytepos = CHAR_TO_BYTE (min_pos);
+	    }
+	  if (max_pos == 0)
+	    max_pos = min_pos;
+	}
+      /* For ROW->end, we need the position that is _after_ max_pos,
+	 in the logical order, unless we are at ZV.  */
+      if (row->ends_at_zv_p)
+	{
+	  row_end = row->end = it->current;
+	  if (!row->used[TEXT_AREA])
+	    {
+	      row->start.pos.charpos = row_end.pos.charpos;
+	      row->start.pos.bytepos = row_end.pos.bytepos;
+	    }
+	}
+      else if (row->used[TEXT_AREA] && max_pos)
+	{
+	  SET_TEXT_POS (tpos, max_pos + 1, CHAR_TO_BYTE (max_pos + 1));
+	  row_end = it->current;
+	  row_end.pos = tpos;
+	  /* If the character at max_pos+1 is a newline, skip that as
+	     well.  Note that this may skip some invisible text.  */
+	  if (FETCH_CHAR (tpos.bytepos) == '\n'
+	      || (FETCH_CHAR (tpos.bytepos) == '\r' && it->selective))
+	    {
+	      save_it = *it;
+	      it->bidi_p = 0;
+	      reseat_1 (it, tpos, 0);
+	      set_iterator_to_next (it, 1);
+	      /* Record the position after the newline of a continued
+		 row.  We will need that to set ROW->end of the last
+		 row produced for a continued line.  */
+	      if (row->continued_p)
+		{
+		  save_it.eol_pos.charpos = IT_CHARPOS (*it);
+		  save_it.eol_pos.bytepos = IT_BYTEPOS (*it);
+		}
+	      else
+		{
+		  row_end = it->current;
+		  save_it.eol_pos.charpos = save_it.eol_pos.bytepos = 0;
+		}
+	      *it = save_it;
+	    }
+	  else if (!row->continued_p
+		   && row->continuation_lines_width
+		   && it->eol_pos.charpos > 0)
+	    {
+	      /* Last row of a continued line.  Use the position
+		 recorded in ROW->eol_pos, to the effect that the
+		 newline belongs to this row, not to the row which
+		 displays the character with the largest buffer
+		 position.  */
+	      row_end.pos = it->eol_pos;
+	      it->eol_pos.charpos = it->eol_pos.bytepos = 0;
+	    }
+	  row->end = row_end;
+	}
+    }
 
   /* Record whether this row ends inside an ellipsis.  */
   row->ends_in_ellipsis_p
@@ -17015,7 +17745,18 @@
   it->right_user_fringe_face_id = 0;
 
   /* Maybe set the cursor.  */
-  if (it->w->cursor.vpos < 0
+  cvpos = it->w->cursor.vpos;
+  if ((cvpos < 0
+       /* In bidi-reordered rows, keep checking for proper cursor
+	  position even if one has been found already, because buffer
+	  positions in such rows change non-linearly with ROW->VPOS,
+	  when a line is continued.  One exception: when we are at ZV,
+	  display cursor on the first suitable glyph row, since all
+	  the empty rows after that also have their position set to ZV.  */
+       /* FIXME: Revisit this when glyph ``spilling'' in continuation
+	  lines' rows is implemented for bidi-reordered rows.  */
+       || (it->bidi_p
+	   && !MATRIX_ROW (it->w->desired_matrix, cvpos)->ends_at_zv_p))
       && PT >= MATRIX_ROW_START_CHARPOS (row)
       && PT <= MATRIX_ROW_END_CHARPOS (row)
       && cursor_row_p (it->w, row))
@@ -17033,7 +17774,11 @@
   it->current_y += row->height;
   ++it->vpos;
   ++it->glyph_row;
-  it->start = it->current;
+  /* The next row should use same value of the reversed_p flag as this
+     one.  set_iterator_to_next decides when it's a new paragraph, and
+     PRODUCE_GLYPHS recomputes the value of the flag accordingly.  */
+  it->glyph_row->reversed_p = row->reversed_p;
+  it->start = row_end;
   return row->displays_text_p;
 }
 
@@ -20562,6 +21307,17 @@
   glyph = it->glyph_row->glyphs[area] + it->glyph_row->used[area];
   if (glyph < it->glyph_row->glyphs[area + 1])
     {
+      /* If the glyph row is reversed, we need to prepend the glyph
+	 rather than append it.  */
+      if (it->glyph_row->reversed_p && area == TEXT_AREA)
+	{
+	  struct glyph *g;
+
+	  /* Make room for the additional glyph.  */
+	  for (g = glyph - 1; g >= it->glyph_row->glyphs[area]; g--)
+	    g[1] = *g;
+	  glyph = it->glyph_row->glyphs[area];
+	}
       glyph->charpos = CHARPOS (it->position);
       glyph->object = it->object;
       if (it->pixel_width > 0)
@@ -20591,6 +21347,18 @@
       glyph->u.ch = it->char_to_display;
       glyph->slice = null_glyph_slice;
       glyph->font_type = FONT_TYPE_UNKNOWN;
+      if (it->bidi_p)
+	{
+	  glyph->resolved_level = it->bidi_it.resolved_level;
+	  if ((it->bidi_it.type & 7) != it->bidi_it.type)
+	    abort ();
+	  glyph->bidi_type = it->bidi_it.type;
+	}
+      else
+	{
+	  glyph->resolved_level = 0;
+	  glyph->bidi_type = UNKNOWN_BT;
+	}
       ++it->glyph_row->used[area];
     }
   else
@@ -20643,6 +21411,13 @@
       glyph->face_id = it->face_id;
       glyph->slice = null_glyph_slice;
       glyph->font_type = FONT_TYPE_UNKNOWN;
+      if (it->bidi_p)
+	{
+	  glyph->resolved_level = it->bidi_it.resolved_level;
+	  if ((it->bidi_it.type & 7) != it->bidi_it.type)
+	    abort ();
+	  glyph->bidi_type = it->bidi_it.type;
+	}
       ++it->glyph_row->used[area];
     }
   else
@@ -20817,6 +21592,13 @@
 	  glyph->u.img_id = img->id;
 	  glyph->slice = slice;
 	  glyph->font_type = FONT_TYPE_UNKNOWN;
+	  if (it->bidi_p)
+	    {
+	      glyph->resolved_level = it->bidi_it.resolved_level;
+	      if ((it->bidi_it.type & 7) != it->bidi_it.type)
+		abort ();
+	      glyph->bidi_type = it->bidi_it.type;
+	    }
 	  ++it->glyph_row->used[area];
 	}
       else
@@ -20863,6 +21645,13 @@
       glyph->u.stretch.height = height;
       glyph->slice = null_glyph_slice;
       glyph->font_type = FONT_TYPE_UNKNOWN;
+      if (it->bidi_p)
+	{
+	  glyph->resolved_level = it->bidi_it.resolved_level;
+	  if ((it->bidi_it.type & 7) != it->bidi_it.type)
+	    abort ();
+	  glyph->bidi_type = it->bidi_it.type;
+	}
       ++it->glyph_row->used[area];
     }
   else
@@ -22679,9 +23468,6 @@
 /* Switch the display of W's cursor on or off, according to the value
    of ON.  */
 
-#ifndef HAVE_NS
-static
-#endif
 void
 update_window_cursor (w, on)
      struct window *w;
@@ -23040,7 +23826,7 @@
 	 associated with the end position, which must not be
 	 highlighted.  */
       Lisp_Object prev_object;
-      int pos;
+      EMACS_INT pos;
 
       while (glyph > row->glyphs[TEXT_AREA])
 	{
@@ -23600,7 +24386,8 @@
 #endif
 
   if (NILP (Vmouse_highlight)
-      || !f->glyphs_initialized_p)
+      || !f->glyphs_initialized_p
+      || f->pointer_invisible)
     return;
 
   dpyinfo->mouse_face_mouse_x = x;
@@ -23672,7 +24459,8 @@
       && XFASTINT (w->last_modified) == BUF_MODIFF (b)
       && XFASTINT (w->last_overlay_modified) == BUF_OVERLAY_MODIFF (b))
     {
-      int hpos, vpos, pos, i, dx, dy, area;
+      int hpos, vpos, i, dx, dy, area;
+      EMACS_INT pos;
       struct glyph *glyph;
       Lisp_Object object;
       Lisp_Object mouse_face = Qnil, overlay = Qnil, position;
@@ -23960,7 +24748,7 @@
 		    struct glyph_row *r
 		      = MATRIX_ROW (w->current_matrix, vpos);
 		    int start = MATRIX_ROW_START_CHARPOS (r);
-		    int pos = string_buffer_position (w, object, start);
+		    EMACS_INT pos = string_buffer_position (w, object, start);
 		    if (pos > 0)
 		      {
 			help = Fget_char_property (make_number (pos),
@@ -24015,7 +24803,8 @@
 		      struct glyph_row *r
 			= MATRIX_ROW (w->current_matrix, vpos);
 		      int start = MATRIX_ROW_START_CHARPOS (r);
-		      int pos = string_buffer_position (w, object, start);
+		      EMACS_INT pos = string_buffer_position (w, object,
+							      start);
 		      if (pos > 0)
 			pointer = Fget_char_property (make_number (pos),
 						      Qpointer, w->buffer);
@@ -24824,6 +25613,11 @@
   staticpro (&previous_help_echo_string);
   help_echo_pos = -1;
 
+  Qright_to_left = intern_c_string ("right-to-left");
+  staticpro (&Qright_to_left);
+  Qleft_to_right = intern_c_string ("left-to-right");
+  staticpro (&Qleft_to_right);
+
 #ifdef HAVE_WINDOW_SYSTEM
   DEFVAR_BOOL ("x-stretch-cursor", &x_stretch_cursor_p,
     doc: /* *Non-nil means draw block cursor as wide as the glyph under it.
--- a/src/xterm.c	Fri Mar 26 08:01:19 2010 +0100
+++ b/src/xterm.c	Thu Apr 01 08:50:44 2010 +0200
@@ -50,9 +50,9 @@
 #include <sys/types.h>
 #endif /* makedev */
 
-#ifdef BSD_SYSTEM
+#ifdef HAVE_SYS_IOCTL_H
 #include <sys/ioctl.h>
-#endif /* ! defined (BSD_SYSTEM) */
+#endif /* ! defined (HAVE_SYS_IOCTL_H) */
 
 #include "systime.h"
 
--- a/test/ChangeLog	Fri Mar 26 08:01:19 2010 +0100
+++ b/test/ChangeLog	Thu Apr 01 08:50:44 2010 +0200
@@ -1,3 +1,38 @@
+2010-03-29  Chong Yidong  <cyd@stupidchicken.com>
+
+	* cedet/semantic-ia-utest.el
+	(semantic-symref-test-count-hits-in-tag): Add function, from
+	semantic-test.el.
+
+	* cedet/tests/test.cpp:
+	* cedet/tests/test.py:
+	* cedet/tests/teststruct.cpp:
+	* cedet/tests/testtemplates.cpp:
+	* cedet/tests/testusing.cpp:
+	* cedet/tests/scopetest.cpp:
+	* cedet/tests/scopetest.java: Files deleted.
+
+	* cedet/tests/test.make:
+	* cedet/tests/test.c:
+	* cedet/tests/testjavacomp.java:
+	* cedet/tests/testspp.c:
+	* cedet/tests/testsppreplace.c:
+	* cedet/tests/testsppreplaced.c:
+	* cedet/tests/testsubclass.cpp:
+	* cedet/tests/testsubclass.hh:
+	* cedet/tests/testtypedefs.cpp:
+	* cedet/tests/testvarnames.c:
+	* cedet/tests/test.el:
+	* cedet/tests/testdoublens.cpp:
+	* cedet/tests/testdoublens.hpp: Add copyright header.
+
+	* cedet/semantic-tests.el (semanticdb-test-gnu-global):
+	Remove reference to deleted files.
+
+2010-03-30  Juri Linkov  <juri@jurta.org>
+
+	* occur-testsuite.el (occur-tests): Add tests for context lines.
+
 2010-03-23  Juri Linkov  <juri@jurta.org>
 
 	* occur-testsuite.el: New file.
--- a/test/cedet/semantic-ia-utest.el	Fri Mar 26 08:01:19 2010 +0100
+++ b/test/cedet/semantic-ia-utest.el	Thu Apr 01 08:50:44 2010 +0200
@@ -42,10 +42,7 @@
     "tests/testdoublens.cpp"
     "tests/testsubclass.cpp"
     "tests/testtypedefs.cpp"
-    "tests/teststruct.cpp"
-    "tests/testtemplates.cpp"
     "tests/testfriends.cpp"
-    "tests/testusing.cpp"
     "tests/testnsp.cpp"
     "tests/testsppcomplete.c"
     "tests/testvarnames.c"
@@ -419,6 +416,27 @@
 
     ))
 
+(defun semantic-symref-test-count-hits-in-tag ()
+  "Lookup in the current tag the symbol under point.
+Then count all the other references to the same symbol within the
+tag that contains point, and return that."
+  (interactive)
+  (let* ((ctxt (semantic-analyze-current-context))
+	 (target (car (reverse (oref ctxt prefix))))
+	 (tag (semantic-current-tag))
+	 (start (current-time))
+	 (Lcount 0))
+    (when (semantic-tag-p target)
+      (semantic-symref-hits-in-region
+       target (lambda (start end prefix) (setq Lcount (1+ Lcount)))
+       (semantic-tag-start tag)
+       (semantic-tag-end tag))
+      (when (interactive-p)
+	(message "Found %d occurrences of %s in %.2f seconds"
+		 Lcount (semantic-tag-name target)
+		 (semantic-elapsed-time start (current-time))))
+      Lcount)))
+
 (defun semantic-src-utest-buffer-refs ()
   "Run a sym-ref counting unit-test pass in the current buffer."
 
--- a/test/cedet/semantic-tests.el	Fri Mar 26 08:01:19 2010 +0100
+++ b/test/cedet/semantic-tests.el	Thu Apr 01 08:50:44 2010 +0200
@@ -107,53 +107,6 @@
       (data-debug-new-buffer "*SemanticDB Gnu Global Result*")
       (data-debug-insert-thing result "?" ""))))
 
-;;; From semantic-find
-
-(require 'semantic/find)
-
-(defun semantic-find-benchmark ()
-  "Run some simple benchmarks to see how we are doing.
-Optional argument ARG is the number of iterations to run."
-  (interactive)
-  (require 'benchmark)
-  (let ((f-name nil)
-	(b-name nil)
-	(f-comp)
-	(b-comp)
-	(f-regex)
-	)
-    (garbage-collect)
-    (setq f-name
-	  (benchmark-run-compiled
-	      1000 (semantic-find-first-tag-by-name "class3"
-						    "test/test.cpp")))
-    (garbage-collect)
-    (setq b-name
-	  (benchmark-run-compiled
-	      1000 (semantic-brute-find-first-tag-by-name "class3"
-							  "test/test.cpp")))
-    (garbage-collect)
-    (setq f-comp
-	  (benchmark-run-compiled
-	      1000 (semantic-find-tags-for-completion "method"
-						      "test/test.cpp")))
-    (garbage-collect)
-    (setq b-comp
-	  (benchmark-run-compiled
-	      1000 (semantic-brute-find-tag-by-name-regexp "^method"
-							   "test/test.cpp")))
-    (garbage-collect)
-    (setq f-regex
-	  (benchmark-run-compiled
-	      1000 (semantic-find-tags-by-name-regexp "^method"
-						      "test/test.cpp")))
-
-    (message "Name [new old] [ %.3f %.3f ] Complete [newc/new old] [ %.3f/%.3f %.3f ]"
-	     (car f-name) (car b-name)
-	     (car f-comp) (car f-regex)
-	     (car b-comp))
-  ))
-
 ;;; From semantic-format
 
 (require 'semantic/format)
--- a/test/cedet/tests/scopetest.cpp	Fri Mar 26 08:01:19 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/* Test scoping rules for c++ in the analyzer. */
-
-namespace {
-
-  class aclass2;  // Forward reference.
-
-  class aclass1 {
-  private:
-    int attrp1;
-    int amethodp1(int argp1);
-    aclass2 areference;
-  protected:
-    int attrpr1;
-  public:
-    int attr1;
-    int amethod1(int arg1);
-  };
-}
-
-namespace {
-  class aclass2 : public aclass1
-  {
-  private:
-    int attrp2;
-    int amethodp2(int argp1);
-  public:
-    aclass2(int aninitvalue);
-    ~aclass2();
-    int attr2;
-    int amethod2(int arg2);
-  };
-}
-
-aclass2::aclass2(init aninitvalue)
-{
-  /* This is a comment that talks about aclass1 */
-  aclass1;
-}
-
-int aclass2::amethod2(int arg2)
-{
-  int alocalvar;
-  float q;
-
-  ac;
-}
-
-// arch-tag: 9336063c-6b2e-4677-a390-d2dd091a2474
--- a/test/cedet/tests/scopetest.java	Fri Mar 26 08:01:19 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-class Foo {
-
-   public void a1() {}
-
-   class Bar {
-
-     public int a2() {}
-
-     public void b() {
-	 a   // -1-
-     }
-
-     class Baz {
-
-       public int a3() {}
-
-       public Baz(int a4) {
-	   a  // -2-
-       }
-
-     }
-
-   }
-
-}
\ No newline at end of file
--- a/test/cedet/tests/templates.cpp	Fri Mar 26 08:01:19 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,130 +0,0 @@
-// C++ examples and requests from Klaus Berndl
-
-// template in a unnamed namespace
-namespace
-{
-  template<typename Target, typename Source>
-  Target lexical_cast(Source arg)
-  {
-    std::stringstream interpreter;
-    Target result;
-
-    if(!(interpreter << arg) || !(interpreter >> result) ||
-       !(interpreter >> std::ws).eof())
-      throw bad_lexical_cast();
-    
-    return result;
-  }
-}
-
-
-template <class T, FOO> class Vector
-{
-private:
-  static T* v;
-  int sz;
-
-public:
-  T& elem(int i) {return v[i];}
-  virtual ~Vector ();
-
-protected:
-  Vector ();
-};
-
-template <> class Vector <void*>
-{
-private:
-  void** v;
-  int sz;
-
-public:
-  Vector ();
-  virtual int func1(int i);
-  virtual int func2(int i) = 0;
-  static virtual int func3(int i) = 0;
-  void*& elem(int i) {return v[i];}
-  //...
-};
-
-// template contains namespace
-typedef vector<CzkUtilities::Action*> ActionList;
-
-// declaration of some template-types
-map<XXX, Test::YYY>** map_var;
-
-map_with_size<XXX, Test::YYY, size> map_size_var;
-typedef map_with_size<XXX, Test::YYY, size> SizedMap;
-
-map_with_10_size<XXX, Test::YYY, 10>* pMap_size10_var;
-typedef map_with_10_size<XXX, Test::YYY, 10> Size10Map;
-
-// a function which such a template-argument
-void* test_function(map<ClassX, Test::ClassY, 10>* pMap);
-
-
-template <class T> class Vector <T*> : private Vector <void*>
-{
-public:
-	typedef Vector <void*> Base;
-
-	Vector () : Base() {}
-
-	T*& elem(int i) {return static_cast<T*&>(Base::elem(i));}
-	//...
-};
-
-// outside method implementation of a template-class
-template<class T> T& Vector<T*>::elem(int i)
-{
-  return C;
-}
-
-// same but qualified with a namespace Testnamespace
-template<class T> T& Testnamespace::Vector<T*>::elem(int i)
-{
-  return C;
-}
-
-// function templates with keyword typename
-template<typename Target, typename Source>
-Target lexical_cast(Source arg)
-{
-  std::stringstream interpreter;
-  Target result;
-
-  if(!(interpreter << arg) || !(interpreter >> result) ||
-     !(interpreter >> std::ws).eof())
-    throw bad_lexical_cast();
-    
-  return result;
-}
-
-template<class T>
-static
-typename T::_ptr_type
-getService(const std::string& pServiceName, const int pRetries=20)
-{
-  return T::_narrow(getServiceObject(pServiceName, pRetries));
-}
-
-// function template declaration
-template<class T> void sort(vector<T>&);
-// complex function template definition
-template<class T, class S, const NamespaceY::ClassX<TestClass, &s> volatile ***&i>
-map<ClassY, ClassX, 10>
-sort(const vector<T>& v)
-{
-  return;
-}
-
-// variable declarations of template-types
-foo<TClass, Testnamespace::XClass, i> *bar1;
-foo<TClass, Testnamespace::XClass, **&i> *bar2;
-foo<TClass, Testnamespace::XClass, *Namespace::ClassX::i> bar3;
-foo<0> bar0;
-
-class SomeName;
-class OtherName;
-
-// arch-tag: 55ff74de-74dc-44ad-8252-50dc5f3492c3
--- a/test/cedet/tests/test.c	Fri Mar 26 08:01:19 2010 +0100
+++ b/test/cedet/tests/test.c	Thu Apr 01 08:50:44 2010 +0200
@@ -1,6 +1,29 @@
-/* Test file for C language.
- * Attempt to include as many aspects of the C language as possible.
+/* test.c --- Semantic unit test for C.
+
+   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+   2010 Free Software Foundation, Inc.
+
+   Author: Eric M. Ludlam <eric@siege-engine.com>
+
+   This file is part of GNU Emacs.
+
+   GNU Emacs 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.
+
+   GNU Emacs 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 GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+/* Attempt to include as many aspects of the C language as possible.
  */
+
 /* types of include files */
 #include "includeme1.h"
 #include <includeme2.h>
--- a/test/cedet/tests/test.cpp	Fri Mar 26 08:01:19 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,592 +0,0 @@
-/* Test file for C++ language.
- * Attempt to include as many aspects of the C++ language as possible.
- * Do not include things tested in test.c since that shares the
- * same language.
- */
-
-/* An include test */
-#include <stdio.h>
-
-#include <cmath>
-
-#include "c++-test.hh"
-
-#include <c++-test.hh>
-
-double var1 = 1.2;
-
-int simple1(int a) {
-
-}
-
-struct foo1 {
-  int test;
-};
-
-struct foo2 : public foo1 {
-  const int foo21(int a, int b);
-  const int foo22(int a, int b) { return 1 }
-};
-
-/* Classes */
-class class1 {
-private:
-  int var11;
-  struct foo1 var12;
-public:
-  int p_var11;
-  struct foo p_var12;
-};
-
-class i_class1 : public class1 {
-private:
-  int var11;
-  struct foo var12;
-public:
-  int p_var11;
-  struct foo p_var12;
-};
-
-class class2 {
-private:
-  int var21;
-  struct foo var22;
-public:
-  int p_var21;
-  struct foo p_var22;
-};
-
-class i_class2 : public class1, public class2 {
-private:
-  int var21;
-  struct foo var22;
-protected:
-  int pt_var21;
-public:
-  int p_var21;
-  struct foo p_var22;
-};
-
-class class3 {
-  /* A class with strange things in it */
-public:
-  class3(); /* A constructor */
-  enum embedded_foo_enum {
-    a, b, c
-  } embed1;
-  struct embedded_bar_struct {
-    int a;
-    int b;
-  } embed2;
-  class embedded_baz_class {
-    embedded_baz_class();
-    ~embedded_baz_class();
-  } embed3;
-  ~class3(); /* destructor */
-  
-  /* Methods */
-  int method_for_class3(int a, char b);
-
-  int inline_method(int c) { return c; }
-
-  /* Operators */
-  class3& operator^= (const class3& something);
-
-  /* Funny declmods */
-  const class3 * const method_const_ptr_ptr(const int * const argconst) const = 0;
-};
-
-class3::class3()
-{
-  /* Constructor outside the definition. */
-}
-
-int class3::method_for_class3(int a, char b)
-{
-}
-
-int class3::method1_for_class3( int a, int &b)
-{
-  int cvariablename;
-  class3 fooy[];
-  class3 moose = new class3;
-
-  // Complktion testing line should find external members.
-  a = fooy[1].me ;
-  b = cv ;
-
-  if (fooy.emb) {
-    simple1(c);
-  }
-
-  cos(10);
-  abs(10);
-
-  return 1;
-}
-
-char class3::method2_for_class3( int a, int b) throw ( exception1 )
-{
-  return 'a';
-}
-
-void *class3::method3_for_class3( int a, int b) throw ( exception1, exception2 )
-{
-  int q = a;
-  return "Moose";
-}
-
-void *class3::method31_for_class3( int a, int b) throw ( )
-{
-  int q = a;
-  return "Moose";
-}
-
-void *class3::method4_for_class3( int a, int b) reentrant
-{
-  class3 ct;
-
-  ct.method5_for_class3(1,a);
-
-  pritf();
-}
-
-/*
- * A method on class3.
- */
-void *class3::method5_for_class3( int a, int b) const
-{
-}
-
-/*
- * Namespace parsing tests
- */
-namespace NS {
-  class class_in_namespace {
-    int equiv(const NS::class_in_namespace *) const;
-  };
-}
-
-int NS::class_in_namespace::equiv(const NS::class_in_namespace *cin) const
-{
-  return 0;
-}
-
-// Stuff Klaus found.
-// Inheritance w/out a specifying for public.
-class class4 : class1 {
-  // Pure virtual methods.
-  void virtual print () const = 0;
-
-public:
-  // The whacky constructor type
-  class4()
-    try : class1(args)
-  {
-    // constructor body	
-  }
-  catch ()
-    {
-      
-    }
-  
-
-};
-
-class class5 : public virtual class4 {
-  // Virtual inheritance
-};
-
-class class6 : class1 {
-  // Mutable
-  mutable int i;
-};
-
-/* Namespaces */
-namespace namespace1 {
-  void ns_method1() { }
-
-  class n_class1 {
-  public:
-    void method11(int a) { }
-  };
-
-  /* This shouldn't parse due to missing semicolon. */
-  class _n_class2 : public n_class1 {
-    void n_c2_method1(int a, int b) { }
-  };
-
-  // Macros in the namespace
-#define NSMACRO 1
-
-  // Template in the namespace
-  template<class T> T nsti1(const Foo& foo);
-  template<> int nsti1<int>(const Foo& foo);
-    
-}
-
-namespace namespace2 {
-
-  using namespace1::n_class1;
-
-}
-
-/* Initializers */
-void tinitializers1(): inita1(False),
-		       inita2(False)
-{
-  inita1= 1;
-}
-
-/* How about Extern C type things. */
-int funny_prototype(int ,int b,float c)
-{
-
-}
-
-extern "C"
-int extern_c_1(int a, int b)
-{
-
-  funny_prototype(1,2,3.4);
-
-  printf("Moose", );
-
-  return 1;
-}
-
-extern "C" {
-
-  int extern_c_2(int a, int b)
-  {
-    return 1;
-  }
-
-}
-
-// Some operator stuff
-class Action
-{
-  // Problems!! operator() and operator[] can not be parsed with semantic
-  // 1.4.2 but with latest c.by
-  virtual void operator()(int i, char *p ) = 0;
-  virtual String& operator[]() = 0;
-  virtual void operator!() = 0;
-  virtual void operator->() = 0;
-  virtual T& operator+=();
-  virtual T& operator*();
-  virtual T& operator*=();
-};
-
-// class with namespace qualified parents
-class Multiinherit : public virtual POA::Parent,
-                     public virtual POA::Parent1,
-                     Parent
-{
-private:
-  int i;
-
-public:
-  Multiinherit();
-  ~Multiinherit();
-
-  // method with a list of qualified exceptions
-  void* throwtest()
-    throw(Exception0,
-          Testnamespace::Exception1,
-          Testnamespace::Excpetion2,
-          Testnamespace::testnamespace1::Exception3);
-  
-};
-
-void*
-Multiinherit::throwtest()
-  throw (Exception0,
-         Testnamespace::Exception1,
-         Testnamespace::Excpetion2,
-         Testnamespace::testnamespace1::Exception3)
-{
-  return;
-}
-
-// Jens Rock <jens.rock@asamnet.de>: Nested classes or structs defined
-// outside of the containing class/struct.
-class container
-{
- public:
-  struct contained;
-  container();
-  ~container();
-};
-
-struct container::contained
-{
-  public:
-  contained();
-  ~contained();
-};
-
-/*
- * Ok, how about some template stuff.
- */
-template <class CT, class container = vector<CT> >
-const CT& max (const CT& a, const CT& b)
-{
-  return a < b ? b : a;
-}
-
-// Arne Schmitz found this one
-std::vector<int> &a, &b, &c;
-
-class TemplateUsingClass
-{
-  typedef TestClassMap::iterator iterator;
-  typedef map<long, long> TestClassMap;
-
-  // typedefs with const and volatile
-  typedef const map<long, long> const_TestClassMap;
-  typedef TestClassMap<string>::iterator volatile volatile_iterator;
-
-  map<int, int> mapclassvarthingy;
-};
-
-template<class T> T ti1(const Foo& foo);
-template<> int ti1<int>(const Foo& foo);
-
-
-// -----------------------------------
-// Now some namespace and related stuff
-// -----------------------------------
-
-using CORBA::LEX::get_token;
-using Namespace1;
-
-using namespace POA::std;
-using namespace Test;
-
-
-
-namespace Parser
-{
-  namespace
-  {
-    using Lexer::get_test;
-    string str = "";
-  }
-  
-  namespace XXX
-  {
-    
-    class Foobar : public virtual POA::Parent,
-                   public virtual POA::Parent1,
-                   private POA::list<fact>,
-                   private map<string>
-    {
-      ini i;
-      list <shared_ptr<item> >::const_iterator l;
-    public:
-      
-      Foobar();
-      ~Foobar();
-    };
-  }
-  
-
-  void test_function(int i);
-    
-};
-
-// unnamed namespaces - even nested
-namespace
-{
-  namespace
-  {
-    using Lexer::get_test;
-    string str = "";
-  }
-
-  // some builtin types
-  long long ll = 0;
-  long double d = 0.0;
-  unsigned test;
-  unsigned long int **uli = 0;
-  signed si = 0;
-  signed short ss = 0;
-  short int i = 0;
-  long int li = 0;
-  
-  // expressions with namespace/class-qualifyiers
-  ORB_var cGlobalOrb = ORB::_nil();
-  ORB_var1 cGlobalOrb1 = ORB::_test;
-
-  class Testclass
-  {
-    #define TEST 0
-    ini i;
-
-  public:
-
-    Testclass();
-    ~Testclass();
-  };
-
-  static void test_function(unsigned int i);
-
-};
-
-
-// outside method implementations which should be grouped to type Test
-XXX&
-Test::waiting()
-{
-  return;
-}
-
-void
-Test::print()
-{
-  return;
-}
-
-// outside method implementations with namespaces which should be grouped to
-// their complete (incl. namespace) types
-void*
-Parser::XXX::Foobar::wait(int i, const char const * const * p)
-{
-  return;
-}
-
-void*
-Namespace1::Test::wait1(int i)
-{
-  return;
-}
-
-int
-Namespace1::Test::waiting(int i)
-{
-  return;
-}
-
-// a class with some outside implementations which should all be grouped to
-// this class declaration
-class ClassWithExternals
-{
-private:
-  int i;
-
-public:
-  ClassWithExternals();
-  ~ClassWithExternals();
-  void non_nil();
-};
-
-
-// Foobar is not displayed; seems that semantic tries to add this to the class
-// Foobar but can not find/display it, because contained in the namespace above.
-void
-Foobar::non_nil()
-{
-  return;
-}
-
-// are correctly grouped to the ClassWithExternals class
-void
-ClassWithExternals::non_nil()
-{
-  String s = "lödfjg dlfgkdlfkgjdl";
-  return;
-}
-
-ClassWithExternals::ClassWithExternals()
-{
-  return;
-}
-
-void
-ClassWithExternals::~ClassWithExternals()
-{
-  return;
-}
-
-
-// -------------------------------
-// Now some macro and define stuff
-// -------------------------------
-
-#define TEST 0
-#define TEST1 "String"
-
-// The first backslash makes this macro unmatched syntax with semantic 1.4.2!
-// With flexing \+newline as nothing all is working fine!
-#define MZK_ENTER(METHOD) \
-{ \
-  CzkMethodLog lMethodLog(METHOD,"Framework");\
-}
-
-#define ZK_ASSERTM(METHOD,ASSERTION,MESSAGE) \
-   { if(!(ASSERTION))\
-      {\
-	std::ostringstream lMesgStream; \
-        lMesgStream << "Assertion failed: " \
-	<< MESSAGE; \
-        CzkLogManager::doLog(CzkLogManager::FATAL,"",METHOD, \
-        "Assert",lMesgStream); \
-        assert(ASSERTION);\
-      }\
-   }
-
-// Test if not newline-backslashes are handled correctly
-string s = "My \"quoted\" string";
-
-// parsed fine as macro
-#define FOO (arg) method(arg, "foo");
-
-// With semantic 1.4.2 this parsed as macro BAR *and* function method.
-// With latest c.bnf at least one-liner macros can be parsed correctly.
-#define BAR (arg) CzkMessageLog method(arg, "bar");
-
-// some const and volatile stuff
-char * p1 = "Hello"; // 1. variable Pointer, variable Data
-const char * p2 = "Hello"; // 2. variable pointer, constant data
-char * const p3 = "Hello"; // 3. constant pointer, variable data
-const char * const p4 = "Hello"; // 4. constant pointer, constant data
-
-// Case 2 and 4 can exchange first "const" and "char"
-char const * p21 = "Hello"; // variable pointer, constant data
-char const * const p41 = "Hello"; // constant pointer, constant data
-
-char volatile a = 0; // a volatile char
-void foo(bar const &arg); // a reference to a const bar
-int foobar(bar const * const p); // a const pointer to a const bar
-int foobar(bar const volatile * const p); // a const pointer to a const bar
-int foobar3(char* p); // a const pointer to a const bar
-
-// Should not be parsed because this is invalid code
-int const & const r3 = i;
-
-boolean i = 0;
-boolean & r1 = i;
-boolean const & r2 = i;
-
-// const * sequences can be very long in C++ ;-)
-char const * const * const * const * ppp;
-
-// complex function declarationen with named pointer-arguments
-const char** foobar1(volatile char const * const **p);
-const char** foobar11(volatile Test::Namespace::Char<char*> const * const **p);
-
-// complex function declarationen with unnamed pointer-arguments
-const char* foobar2(const char***);
-const char* foobar21(const Test::Namespace::Char<char>***);
-
-// string literal parsing even with wchar_t
-char const *p = "string1";
-char const *q = "string1" "str\"ing2" "string3";
-wchar_t testc = L'a';
-
-wchar_t const *wp = L"string with a \" in it";
-wchar_t const *wq = L"string \n\t\"test" L"string2";
-wchar_t const *wr = L"string L";
-
-// arch-tag: 59828880-d72f-4059-922f-89579edf9e58
--- a/test/cedet/tests/test.el	Fri Mar 26 08:01:19 2010 +0100
+++ b/test/cedet/tests/test.el	Thu Apr 01 08:50:44 2010 +0200
@@ -1,6 +1,24 @@
-;; Test file for Emacs Lisp.
-;; Attempt to include as many aspects of Emacs Lisp as possible.
-;;
+;;; test.el --- Unit test file for Semantic Emacs Lisp support.
+
+;; Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010
+;;   Free Software Foundation, Inc.
+
+;; Author: Eric M. Ludlam <eric@siege-engine.com>
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs 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.
+
+;; GNU Emacs 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 GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Require
 ;;
@@ -88,7 +106,7 @@
 (autoload (quote a-autoload) "somefile"
   "Non-interactive autoload." nil nil)
 
-(autoload (quote a-autoload-interactive) "somefile" 
+(autoload (quote a-autoload-interactive) "somefile"
 "Interactive autoload." t nil)
 
 
@@ -116,7 +134,7 @@
   (slot-1 :equal 'eq)
   slot-2)
 
-(defstruct test-struct-2 
+(defstruct test-struct-2
   slot-1
   slot-2)
 
--- a/test/cedet/tests/test.make	Fri Mar 26 08:01:19 2010 +0100
+++ b/test/cedet/tests/test.make	Thu Apr 01 08:50:44 2010 +0200
@@ -1,4 +1,23 @@
-# Test makefile -*- makefile -*-
+# test.make --- Semantic unit test for Make -*- makefile -*-
+
+# Copyright (C) 2001, 2002, 2010 Free Software Foundation, Inc.
+
+# Author: Eric M. Ludlam <eric@siege-engine.com>
+
+# This file is part of GNU Emacs.
+
+# GNU Emacs 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.
+
+# GNU Emacs 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 GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 top=
 ede_FILES=Project.ede Makefile
--- a/test/cedet/tests/test.py	Fri Mar 26 08:01:19 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,580 +0,0 @@
-# Test file for Python language.
-#
-
-# Simle class compount statement with blank lines sprinkled.
-class Foo(Bar):
-
-    x = 1
-
-    y = 2
-
-# Simple def statement with no argument
-def sss():
-    i = 1
-
-# Simple def statement with arguments
-def ttt(x,y,z):
-    i = 1
-
-import foo
-
-for x in y:
-    print x
-
-while y > 0:
-    y = y - 1
-
-a=b=c=d=e=f=i=j=k=l=m=n=o=p=q=r=s=t=x=y=1
-
-if x:
-    x = 2
-    y = 3
-
-x = 2
-y = 3
-s and t
-q | r
-o ^ p
-m & n
-k << l
-z = 4
-i >> j
-e / f
-c * d
-a + b
-2 ** 5
-x
-s = "a" "b" "c"
-1
-
-# implicit continuation lines, see
-# http://docs.python.org/ref/implicit-joining.html
-
-a_list = [ 1, 2, 3,
-           4, 5,
-                 6 ]
-
-a_tuple = (1, 2, 3,
-
-           4, 5, 6)
-
-a_hash = { 'a':1, "b":2,
-           'c' : 3,
-           "d" : 4 }
-
-
-def longarglist(a,
-                b,
-                c,
-                d):
-    a=1;
-    b=1;
-    c=1;
-    d=1;
-
-class longclasslist(xx.yyy,
-                    zz.aa):
-    foo=1
-                    
-
-# wisent-python.wy chokes on this! -ryk 6/17/02
-
-class HTTPServer(xxx.yyy):
-    allow_reuse_address = 1    # Seems to make sense in testing environment
-    def server_bind(self):
-        SocketServer.TCPServer.server_bind(self)
-        host, port = self.socket.getsockname()
-        self.server_name = socket.getfqdn(host)
-        self.server_port = port
-
-
-#########################################################################
-### /usr/lib/python2.2/BaseHTTPServer.py
-#########################################################################
-
-"""HTTP server base class.
-
-Note: the class in this module doesn't implement any HTTP request; see
-SimpleHTTPServer for simple implementations of GET, HEAD and POST
-(including CGI scripts).
-
-Contents:
-
-- BaseHTTPRequestHandler: HTTP request handler base class
-- test: test function
-
-XXX To do:
-
-- send server version
-- log requests even later (to capture byte count)
-- log user-agent header and other interesting goodies
-- send error log to separate file
-- are request names really case sensitive?
-
-"""
-
-
-# See also:
-#
-# HTTP Working Group                                        T. Berners-Lee
-# INTERNET-DRAFT                                            R. T. Fielding
-# <draft-ietf-http-v10-spec-00.txt>                     H. Frystyk Nielsen
-# Expires September 8, 1995                                  March 8, 1995
-#
-# URL: http://www.ics.uci.edu/pub/ietf/http/draft-ietf-http-v10-spec-00.txt
-
-
-# Log files
-# ---------
-#
-# Here's a quote from the NCSA httpd docs about log file format.
-#
-# | The logfile format is as follows. Each line consists of:
-# |
-# | host rfc931 authuser [DD/Mon/YYYY:hh:mm:ss] "request" ddd bbbb
-# |
-# |        host: Either the DNS name or the IP number of the remote client
-# |        rfc931: Any information returned by identd for this person,
-# |                - otherwise.
-# |        authuser: If user sent a userid for authentication, the user name,
-# |                  - otherwise.
-# |        DD: Day
-# |        Mon: Month (calendar name)
-# |        YYYY: Year
-# |        hh: hour (24-hour format, the machine's timezone)
-# |        mm: minutes
-# |        ss: seconds
-# |        request: The first line of the HTTP request as sent by the client.
-# |        ddd: the status code returned by the server, - if not available.
-# |        bbbb: the total number of bytes sent,
-# |              *not including the HTTP/1.0 header*, - if not available
-# |
-# | You can determine the name of the file accessed through request.
-#
-# (Actually, the latter is only true if you know the server configuration
-# at the time the request was made!)
-
-
-__version__ = "0.2"
-
-__all__ = ["HTTPServer", "BaseHTTPRequestHandler"]
-
-import sys
-import time
-import socket # For gethostbyaddr()
-import mimetools
-import SocketServer
-
-# Default error message
-DEFAULT_ERROR_MESSAGE = """\
-<head>
-<title>Error response</title>
-</head>
-<body>
-<h1>Error response</h1>
-<p>Error code %(code)d.
-<p>Message: %(message)s.
-<p>Error code explanation: %(code)s = %(explain)s.
-</body>
-"""
-
-
-class HTTPServer(SocketServer.TCPServer):
-
-    allow_reuse_address = 1    # Seems to make sense in testing environment
-
-    def server_bind(self):
-        """Override server_bind to store the server name."""
-        SocketServer.TCPServer.server_bind(self)
-        host, port = self.socket.getsockname()
-        self.server_name = socket.getfqdn(host)
-        self.server_port = port
-
-
-class BaseHTTPRequestHandler(SocketServer.StreamRequestHandler):
-
-    """HTTP request handler base class.
-
-    The following explanation of HTTP serves to guide you through the
-    code as well as to expose any misunderstandings I may have about
-    HTTP (so you don't need to read the code to figure out I'm wrong
-    :-).
-
-    HTTP (HyperText Transfer Protocol) is an extensible protocol on
-    top of a reliable stream transport (e.g. TCP/IP).  The protocol
-    recognizes three parts to a request:
-
-    1. One line identifying the request type and path
-    2. An optional set of RFC-822-style headers
-    3. An optional data part
-
-    The headers and data are separated by a blank line.
-
-    The first line of the request has the form
-
-    <command> <path> <version>
-
-    where <command> is a (case-sensitive) keyword such as GET or POST,
-    <path> is a string containing path information for the request,
-    and <version> should be the string "HTTP/1.0".  <path> is encoded
-    using the URL encoding scheme (using %xx to signify the ASCII
-    character with hex code xx).
-
-    The protocol is vague about whether lines are separated by LF
-    characters or by CRLF pairs -- for compatibility with the widest
-    range of clients, both should be accepted.  Similarly, whitespace
-    in the request line should be treated sensibly (allowing multiple
-    spaces between components and allowing trailing whitespace).
-
-    Similarly, for output, lines ought to be separated by CRLF pairs
-    but most clients grok LF characters just fine.
-
-    If the first line of the request has the form
-
-    <command> <path>
-
-    (i.e. <version> is left out) then this is assumed to be an HTTP
-    0.9 request; this form has no optional headers and data part and
-    the reply consists of just the data.
-
-    The reply form of the HTTP 1.0 protocol again has three parts:
-
-    1. One line giving the response code
-    2. An optional set of RFC-822-style headers
-    3. The data
-
-    Again, the headers and data are separated by a blank line.
-
-    The response code line has the form
-
-    <version> <responsecode> <responsestring>
-
-    where <version> is the protocol version (always "HTTP/1.0"),
-    <responsecode> is a 3-digit response code indicating success or
-    failure of the request, and <responsestring> is an optional
-    human-readable string explaining what the response code means.
-
-    This server parses the request and the headers, and then calls a
-    function specific to the request type (<command>).  Specifically,
-    a request SPAM will be handled by a method do_SPAM().  If no
-    such method exists the server sends an error response to the
-    client.  If it exists, it is called with no arguments:
-
-    do_SPAM()
-
-    Note that the request name is case sensitive (i.e. SPAM and spam
-    are different requests).
-
-    The various request details are stored in instance variables:
-
-    - client_address is the client IP address in the form (host,
-    port);
-
-    - command, path and version are the broken-down request line;
-
-    - headers is an instance of mimetools.Message (or a derived
-    class) containing the header information;
-
-    - rfile is a file object open for reading positioned at the
-    start of the optional input data part;
-
-    - wfile is a file object open for writing.
-
-    IT IS IMPORTANT TO ADHERE TO THE PROTOCOL FOR WRITING!
-
-    The first thing to be written must be the response line.  Then
-    follow 0 or more header lines, then a blank line, and then the
-    actual data (if any).  The meaning of the header lines depends on
-    the command executed by the server; in most cases, when data is
-    returned, there should be at least one header line of the form
-
-    Content-type: <type>/<subtype>
-
-    where <type> and <subtype> should be registered MIME types,
-    e.g. "text/html" or "text/plain".
-
-    """
-
-    # The Python system version, truncated to its first component.
-    sys_version = "Python/" + sys.version.split()[0]
-
-    # The server software version.  You may want to override this.
-    # The format is multiple whitespace-separated strings,
-    # where each string is of the form name[/version].
-    server_version = "BaseHTTP/" + __version__
-
-    def parse_request(self):
-        """Parse a request (internal).
-
-        The request should be stored in self.raw_request; the results
-        are in self.command, self.path, self.request_version and
-        self.headers.
-
-        Return value is 1 for success, 0 for failure; on failure, an
-        error is sent back.
-
-        """
-        self.request_version = version = "HTTP/0.9" # Default
-        requestline = self.raw_requestline
-        if requestline[-2:] == '\r\n':
-            requestline = requestline[:-2]
-        elif requestline[-1:] == '\n':
-            requestline = requestline[:-1]
-        self.requestline = requestline
-        words = requestline.split()
-        if len(words) == 3:
-            [command, path, version] = words
-            if version[:5] != 'HTTP/':
-                self.send_error(400, "Bad request version (%s)" % `version`)
-                return 0
-        elif len(words) == 2:
-            [command, path] = words
-            if command != 'GET':
-                self.send_error(400,
-                                "Bad HTTP/0.9 request type (%s)" % `command`)
-                return 0
-        else:
-            self.send_error(400, "Bad request syntax (%s)" % `requestline`)
-            return 0
-        self.command, self.path, self.request_version = command, path, version
-        self.headers = self.MessageClass(self.rfile, 0)
-        return 1
-
-    def handle(self):
-        """Handle a single HTTP request.
-
-        You normally don't need to override this method; see the class
-        __doc__ string for information on how to handle specific HTTP
-        commands such as GET and POST.
-
-        """
-
-        self.raw_requestline = self.rfile.readline()
-        if not self.parse_request(): # An error code has been sent, just exit
-            return
-        mname = 'do_' + self.command
-        if not hasattr(self, mname):
-            self.send_error(501, "Unsupported method (%s)" % `self.command`)
-            return
-        method = getattr(self, mname)
-        method()
-
-    def send_error(self, code, message=None):
-        """Send and log an error reply.
-
-        Arguments are the error code, and a detailed message.
-        The detailed message defaults to the short entry matching the
-        response code.
-
-        This sends an error response (so it must be called before any
-        output has been generated), logs the error, and finally sends
-        a piece of HTML explaining the error to the user.
-
-        """
-
-        try:
-            short, long = self.responses[code]
-        except KeyError:
-            short, long = '???', '???'
-        if not message:
-            message = short
-        explain = long
-        self.log_error("code %d, message %s", code, message)
-        self.send_response(code, message)
-        self.send_header("Content-Type", "text/html")
-        self.end_headers()
-        self.wfile.write(self.error_message_format %
-                         {'code': code,
-                          'message': message,
-                          'explain': explain})
-
-    error_message_format = DEFAULT_ERROR_MESSAGE
-
-    def send_response(self, code, message=None):
-        """Send the response header and log the response code.
-
-        Also send two standard headers with the server software
-        version and the current date.
-
-        """
-        self.log_request(code)
-        if message is None:
-            if self.responses.has_key(code):
-                message = self.responses[code][0]
-            else:
-                message = ''
-        if self.request_version != 'HTTP/0.9':
-            self.wfile.write("%s %s %s\r\n" %
-                             (self.protocol_version, str(code), message))
-        self.send_header('Server', self.version_string())
-        self.send_header('Date', self.date_time_string())
-
-    def send_header(self, keyword, value):
-        """Send a MIME header."""
-        if self.request_version != 'HTTP/0.9':
-            self.wfile.write("%s: %s\r\n" % (keyword, value))
-
-    def end_headers(self):
-        """Send the blank line ending the MIME headers."""
-        if self.request_version != 'HTTP/0.9':
-            self.wfile.write("\r\n")
-
-    def log_request(self, code='-', size='-'):
-        """Log an accepted request.
-
-        This is called by send_reponse().
-
-        """
-
-        self.log_message('"%s" %s %s',
-                         self.requestline, str(code), str(size))
-
-    def log_error(self, *args):
-        """Log an error.
-
-        This is called when a request cannot be fulfilled.  By
-        default it passes the message on to log_message().
-
-        Arguments are the same as for log_message().
-
-        XXX This should go to the separate error log.
-
-        """
-
-        apply(self.log_message, args)
-
-    def log_message(self, format, *args):
-        """Log an arbitrary message.
-
-        This is used by all other logging functions.  Override
-        it if you have specific logging wishes.
-
-        The first argument, FORMAT, is a format string for the
-        message to be logged.  If the format string contains
-        any % escapes requiring parameters, they should be
-        specified as subsequent arguments (it's just like
-        printf!).
-
-        The client host and current date/time are prefixed to
-        every message.
-
-        """
-
-        sys.stderr.write("%s - - [%s] %s\n" %
-                         (self.address_string(),
-                          self.log_date_time_string(),
-                          format%args))
-
-    def version_string(self):
-        """Return the server software version string."""
-        return self.server_version + ' ' + self.sys_version
-
-    def date_time_string(self):
-        """Return the current date and time formatted for a message header."""
-        now = time.time()
-        year, month, day, hh, mm, ss, wd, y, z = time.gmtime(now)
-        s = "%s, %02d %3s %4d %02d:%02d:%02d GMT" % (
-                self.weekdayname[wd],
-                day, self.monthname[month], year,
-                hh, mm, ss)
-        return s
-
-    def log_date_time_string(self):
-        """Return the current time formatted for logging."""
-        now = time.time()
-        year, month, day, hh, mm, ss, x, y, z = time.localtime(now)
-        s = "%02d/%3s/%04d %02d:%02d:%02d" % (
-                day, self.monthname[month], year, hh, mm, ss)
-        return s
-
-    weekdayname = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
-
-    monthname = [None,
-                 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
-                 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
-
-    def address_string(self):
-        """Return the client address formatted for logging.
-
-        This version looks up the full hostname using gethostbyaddr(),
-        and tries to find a name that contains at least one dot.
-
-        """
-
-        host, port = self.client_address
-        return socket.getfqdn(host)
-
-    # Essentially static class variables
-
-    # The version of the HTTP protocol we support.
-    # Don't override unless you know what you're doing (hint: incoming
-    # requests are required to have exactly this version string).
-    protocol_version = "HTTP/1.0"
-
-    # The Message-like class used to parse headers
-    MessageClass = mimetools.Message
-
-    # Table mapping response codes to messages; entries have the
-    # form {code: (shortmessage, longmessage)}.
-    # See http://www.w3.org/hypertext/WWW/Protocols/HTTP/HTRESP.html
-    responses = {
-        200: ('OK', 'Request fulfilled, document follows'),
-        201: ('Created', 'Document created, URL follows'),
-        202: ('Accepted',
-              'Request accepted, processing continues off-line'),
-        203: ('Partial information', 'Request fulfilled from cache'),
-        204: ('No response', 'Request fulfilled, nothing follows'),
-
-        301: ('Moved', 'Object moved permanently -- see URI list'),
-        302: ('Found', 'Object moved temporarily -- see URI list'),
-        303: ('Method', 'Object moved -- see Method and URL list'),
-        304: ('Not modified',
-              'Document has not changed singe given time'),
-
-        400: ('Bad request',
-              'Bad request syntax or unsupported method'),
-        401: ('Unauthorized',
-              'No permission -- see authorization schemes'),
-        402: ('Payment required',
-              'No payment -- see charging schemes'),
-        403: ('Forbidden',
-              'Request forbidden -- authorization will not help'),
-        404: ('Not found', 'Nothing matches the given URI'),
-
-        500: ('Internal error', 'Server got itself in trouble'),
-        501: ('Not implemented',
-              'Server does not support this operation'),
-        502: ('Service temporarily overloaded',
-              'The server cannot process the request due to a high load'),
-        503: ('Gateway timeout',
-              'The gateway server did not receive a timely response'),
-
-        }
-
-
-def test(HandlerClass = BaseHTTPRequestHandler,
-         ServerClass = HTTPServer):
-    """Test the HTTP request handler class.
-
-    This runs an HTTP server on port 8000 (or the first command line
-    argument).
-
-    """
-
-    if sys.argv[1:]:
-        port = int(sys.argv[1])
-    else:
-        port = 8000
-    server_address = ('', port)
-
-    httpd = ServerClass(server_address, HandlerClass)
-
-    sa = httpd.socket.getsockname()
-    print "Serving HTTP on", sa[0], "port", sa[1], "..."
-    httpd.serve_forever()
-
-
-if __name__ == '__main__':
-    test()
-
-# arch-tag: 567449b3-cc90-45b6-bbe3-1e113995bdae
--- a/test/cedet/tests/testdoublens.cpp	Fri Mar 26 08:01:19 2010 +0100
+++ b/test/cedet/tests/testdoublens.cpp	Thu Apr 01 08:50:44 2010 +0200
@@ -1,7 +1,24 @@
-//
-// CPP file for semantic-ia-utest
-// completion engine unit tests.
-//
+// testdoublens.cpp --- semantic-ia-utest completion engine unit tests
+
+// Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+
+// Author: Eric M. Ludlam <eric@siege-engine.com>
+
+// This file is part of GNU Emacs.
+
+// GNU Emacs 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.
+
+// GNU Emacs 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 GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
+
 #include "testdoublens.hpp"
 
 namespace Name1 {
@@ -29,7 +46,7 @@
     void Foo::sendStuff(int /* a */, int /* b */) // ^3^
     {
     }
-    
+
   } // namespace Name2
 } // namespace Name1
 
@@ -44,7 +61,7 @@
   Name1::Name2::F//-4-
     // #4# ( "Foo" )
     ;
-  
+
   // @TODO - get this working...
   Name1::stage2_Foo::M//-5-
     /// #5# ( "Mumble" )
@@ -58,15 +75,15 @@
 
 // Second test from Ravikiran Rajagopal
 
-namespace A { 
+namespace A {
   class foo {
   public:
     void aa();
     void bb();
   };
 }
-namespace A { 
-  class bar { 
+namespace A {
+  class bar {
   public:
     void xx();
   public:
@@ -96,7 +113,7 @@
 
     int Bar::baz()
     {
-      return dum// -7- 
+      return dum// -7-
 	// #7# ( "dumdum" )
 	;
     }
--- a/test/cedet/tests/testdoublens.hpp	Fri Mar 26 08:01:19 2010 +0100
+++ b/test/cedet/tests/testdoublens.hpp	Thu Apr 01 08:50:44 2010 +0200
@@ -1,6 +1,24 @@
-//
-// Header file used in one of the ia-utest tests.
-//
+// testdoublens.hpp --- Header file used in one of the Semantic tests
+
+// Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+
+// Author: Eric M. Ludlam <eric@siege-engine.com>
+
+// This file is part of GNU Emacs.
+
+// GNU Emacs 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.
+
+// GNU Emacs 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 GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
+
 namespace Name1 {
   namespace Name2 {
 
--- a/test/cedet/tests/testjavacomp.java	Fri Mar 26 08:01:19 2010 +0100
+++ b/test/cedet/tests/testjavacomp.java	Thu Apr 01 08:50:44 2010 +0200
@@ -1,24 +1,23 @@
-/** testjavacomp.java --- 
- *
- * Copyright (C) 2009, 2010  Free Software Foundation, Inc.
- *
- * Author: Eric M. Ludlam <eric@siege-engine.com>
- *
- * This file is part of GNU Emacs.
- *
- * GNU Emacs 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.
- *
- * GNU Emacs 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 GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
- */
+//  testjavacomp.java --- Semantic unit test for Java
+
+//  Copyright (C) 2009, 2010  Free Software Foundation, Inc.
+
+//  Author: Eric M. Ludlam <eric@siege-engine.com>
+
+//  This file is part of GNU Emacs.
+
+//  GNU Emacs 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.
+
+//  GNU Emacs 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 GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 package tests.testjavacomp;
 
--- a/test/cedet/tests/testspp.c	Fri Mar 26 08:01:19 2010 +0100
+++ b/test/cedet/tests/testspp.c	Thu Apr 01 08:50:44 2010 +0200
@@ -1,6 +1,24 @@
-/* Attempt to test the C preprocessor
- *
- */
+/* testspp.cpp --- Semantic unit test for the C preprocessor
+
+   Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+
+   Author: Eric M. Ludlam <eric@siege-engine.com>
+
+   This file is part of GNU Emacs.
+
+   GNU Emacs 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.
+
+   GNU Emacs 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 GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
+*/
 
 int some_fcn (){}
 
--- a/test/cedet/tests/testsppreplace.c	Fri Mar 26 08:01:19 2010 +0100
+++ b/test/cedet/tests/testsppreplace.c	Thu Apr 01 08:50:44 2010 +0200
@@ -1,5 +1,23 @@
-/* Test CPP/SPP Replacement
- */
+/* testsppreplace.c --- unit test for CPP/SPP Replacement
+   Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+
+   Author: Eric M. Ludlam <eric@siege-engine.com>
+
+   This file is part of GNU Emacs.
+
+   GNU Emacs 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.
+
+   GNU Emacs 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 GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
+*/
 
 /* TEST: The EMU keyword doesn't screw up the function defn. */
 #define EMU
--- a/test/cedet/tests/testsppreplaced.c	Fri Mar 26 08:01:19 2010 +0100
+++ b/test/cedet/tests/testsppreplaced.c	Thu Apr 01 08:50:44 2010 +0200
@@ -1,5 +1,25 @@
-/* What the SPP replace file would looklike with MACROS replaced.
- */
+/* testsppreplaced.c --- unit test for CPP/SPP Replacement
+   Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+
+   Author: Eric M. Ludlam <eric@siege-engine.com>
+
+   This file is part of GNU Emacs.
+
+   GNU Emacs 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.
+
+   GNU Emacs 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 GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+/* What the SPP replace file would looklike with MACROS replaced: */
 
 /* TEST: The EMU keyword doesn't screw up the function defn. */
 char parse_around_emu ()
--- a/test/cedet/tests/teststruct.cpp	Fri Mar 26 08:01:19 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-// Combinations of templates and structure inheritance.
-//
-// Created by Alex Ott.
-
-template <typename DerivedT>
-struct grammar {
-public:
-  typedef grammar<DerivedT> self_t;
-  typedef DerivedT const& embed_t;
-  grammar() {}
-  ~grammar() { }
-  void use_parser() const { }
-  void test1() { }
-};
-
-struct PDFbool_parser : public grammar<PDFbool_parser> {
-  PDFbool_parser() {}
-  template <typename scannerT> struct definition {
-    typedef typename scannerT::iterator_t iterator_t;
-    int top;
-    definition(const PDFbool_parser& /*self*/) {
-      return ;
-    }
-    const int start() const {
-      return top;
-    }
-  };
-};
-
-int main(void) {
-  PDFbool_parser PDFbool_p = PDFbool_parser();
-  PDFbool_p.//-1-
-    ;
-  // #1# ("definition" "embed_t" "self_t" "test1" "use_parser")
-}
-
-// ----------------------------------------------------------------------
-
-template <class Derived> struct Base {
-public:
-  void interface()
-  {
-    // ...
-    static_cast<Derived*>(this)->implementation();
-    // ...
-  }
-
-  static void static_func()
-  {
-    // ...
-    Derived::static_sub_func();
-    // ...
-  }
-};
-
-struct Derived : Base<Derived> {
-  void implementation() { }
-  static void static_sub_func() { }
-};
-
-int foo () {
-  Derived d;
-  d.//-2-
-    ;
-  // #2# ("implementation" "interface" "static_func" "static_sub_func")
-}
-
-// arch-tag: d6e39f96-525e-44af-8cd1-d03e1829acd3
--- a/test/cedet/tests/testsubclass.cpp	Fri Mar 26 08:01:19 2010 +0100
+++ b/test/cedet/tests/testsubclass.cpp	Thu Apr 01 08:50:44 2010 +0200
@@ -1,5 +1,23 @@
-/* Special test file for Semantic Analyzer and complex C++ inheritance.
- */
+// testsubclass.cpp --- unit test for analyzer and complex C++ inheritance
+
+// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+
+// Author: Eric M. Ludlam <eric@siege-engine.com>
+
+// This file is part of GNU Emacs.
+
+// GNU Emacs 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.
+
+// GNU Emacs 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 GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 //#include <iostream>
 #include "testsubclass.hh"
@@ -94,7 +112,7 @@
   MooseVariableName = createMoose();
 
   doLatinStuff(MooseVariableName);
-  
+
   tmp = this.f// -1-
     // #1# ( "fAlcesBool" "fIsValid" "fLatin" )
     ;
@@ -125,7 +143,7 @@
 int someFunction(int mPickle)
 {
   moose mMoose = deer::alces::createMoose();
-  
+
   if (mPickle == 1) {
 
     int mOption1 = 2;
@@ -152,7 +170,7 @@
   class A{
   private:
     void private_a(){}
-  public: 
+  public:
     void public_a();
   };
 
--- a/test/cedet/tests/testsubclass.hh	Fri Mar 26 08:01:19 2010 +0100
+++ b/test/cedet/tests/testsubclass.hh	Thu Apr 01 08:50:44 2010 +0200
@@ -1,8 +1,23 @@
-/* Special test file for Semantic Analyzer and complex C++ inheritance.
- *
- * Header file for testsubclass.cpp with class defns but no
- * implementations.
- */
+// testsubclass.hh --- unit test for analyzer and complex C++ inheritance
+
+// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+
+// Author: Eric M. Ludlam <eric@siege-engine.com>
+
+// This file is part of GNU Emacs.
+
+// GNU Emacs 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.
+
+// GNU Emacs 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 GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 //#include <cmath>
 // #include <stdio.h>
--- a/test/cedet/tests/testtemplates.cpp	Fri Mar 26 08:01:19 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-// Templates Test file:
-// Written by 'Raf'
-
-template <class T, int U, class V>
-class read_ref {
-public:
-  const T* read_ref_member_one( T);
-  const V* read_ref_member_two();
-};
-
-namespace NS {
-  template <class T, int U, class V>
-  class ref {
-  public:  
-    read_ref<T,10,V> operator->() {
-      m_// -1-
-	;
-      // #1# ( "m_datas" )
-    }  
-
-  private:
-    T m_datas[U];
-  };
-
-}
-
-class FooOne {
-public:
-  int fooOneMember();
-};
-
-class FooTwo {
-public:
-  int fooTwoMember();
-};
-
-class FooThree {
-public:
-  int fooThreeMember();
-
-  FooOne * operator->();
-};
-
-typedef ref<FooOne, 10,FooTwo> Test;
-
-using NS;
-
-void
-main(void) {
-  ref<FooOne, 10, FooTwo> v;
-  
-  v->read_ref_member_one()-> // -2-
-    ;
-  // #2# ( "fooOneMember" )
-
-  v->read_ref_member_two()-> // -3-
-    ;
-  // #3# ( "fooTwoMember" )
-
-  v-> // -4-
-    ;
-  // #4# ( "read_ref_member_one" "read_ref_member_two" )
-
-  Test t;
-
-  t->read_ref_member_two()-> // -5-
-    ;
-  // #5# ( "fooTwoMember" )
-
-  ref<FooOne, 10, FooThree> v2;
-  
-  v2->read_ref_member_two()-> // -6- 
-    ;
-  // #6# ( "fooOneMember" )
-
-  /* Try all these things by also specifying the namespace in the name. */
-  NS::ref<FooOne, 10, FooTwo> v3;
-  
-  v3->read_ref_member_one()-> // -7-
-    ;
-  // #7# ( "fooOneMember" )
-
-  v3->read_ref_member_two()-> // -8-
-    ;
-  // #8# ( "fooTwoMember" )
-
-  v3->read_ref_member_two// @1@ 5
-    ;
-
-}
-
-// arch-tag: 03cbb8c3-3d01-42ab-b416-42a08ea7b896
--- a/test/cedet/tests/testtypedefs.cpp	Fri Mar 26 08:01:19 2010 +0100
+++ b/test/cedet/tests/testtypedefs.cpp	Thu Apr 01 08:50:44 2010 +0200
@@ -1,16 +1,31 @@
-// Sample with some fake bits out of std::string
-//
+// testtypedefs.cpp --- Sample with some fake bits out of std::string
+
+// Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+
+// Author: Eric M. Ludlam <eric@siege-engine.com>
+
+// This file is part of GNU Emacs.
+
+// GNU Emacs 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.
+
+// GNU Emacs 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 GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
+
 // Thanks Ming-Wei Chang for these examples.
 
 namespace std {
-
   template <T>class basic_string {
-
   public:
     void resize(int);
-  
   };
-
 }
 
 typedef std::basic_string<char> mstring;
@@ -18,41 +33,34 @@
 using namespace std;
 typedef basic_string<char> bstring;
 
-
 int main(){
   mstring a;
-
   a.// -1-
     ;
   // #1# ( "resize" )
-  
   bstring b;
   // It doesn't work here.
   b.// -2-
     ;
   // #2# ( "resize" )
-  
   return 0;
 }
 
-
 // ------------------
 
-class Bar 
+class Bar
 {
 public:
      void someFunc() {}
-
 };
 
 typedef Bar new_Bar;
 
 template <class mytype>
-class TBar 
+class TBar
 {
 public:
      void otherFunc() {}
-
 };
 
 typedef TBar<char> new_TBar;
@@ -65,11 +73,9 @@
   nb.// -3-
     ;
   // #3# ("someFunc")
-
   ntb.// -4-
     ;
   // #4# ("otherFunc")
-
   return 0;
 }
 
--- a/test/cedet/tests/testusing.cpp	Fri Mar 26 08:01:19 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,134 +0,0 @@
-// Test using statements in C++
-
-#include <adstdio.h>
-
-#include <testusing.hh>
-
-namespace moose {
-  
-  class MyClass;
-  class Point;
-
-  typedef MyClass snerk;
-}
-
-namespace moose {
-
-  class Point;
-  class MyClass;
-
-}
-
-namespace {
-  
-  int global_variable = 0;
-
-};
-
-using moose::MyClass;
-
-void someFcn() {
-
-  MyClass f;
-
-  f.//-1-
-    ; //#1# ( "getVal" "setVal" )
-
-}
-
-// Code from Zhiqiu Kong
-
-namespace panda {
-
-  using namespace bread_name;
-
-  int func()
-  {
-    bread test;
-    test.//-2-
-      ;// #2# ( "geta" )
-    return 0;
-  }
-}
-
-// Local using statements and aliased types
-// Code from David Engster
-
-void func2()
-{
-  using namespace somestuff;
-  OneClass f;
-  f.//-3-
-    ; //#3# ( "aFunc" "anInt" )
-}
-
-void func3()
-{
-  using somestuff::OneClass;
-  OneClass f;
-  f.//-4-
-    ; //#4# ( "aFunc" "anInt" )
-}
-
-// Dereferencing alias types created through 'using' statements
-
-// Alias with fully qualified name
-void func4()
-{
-  otherstuff::OneClass f;
-  f. //-5-
-    ; //#5# ( "aFunc" "anInt" )
-}
-
-// Alias through namespace directive
-void func5()
-{
-  using namespace otherstuff;
-  OneClass f;
-  f. //-6-
-    ; //#6# ( "aFunc" "anInt" )
-}
-
-// Check name hiding
-void func6()
-{
-  using namespace morestuff;
-  OneClass f;		// Alias for somestuff::OneClass
-  f.  //-7-
-    ; //#7# ( "aFunc" "anInt" )
-  aStruct g;	// This however is morestuff::aStruct !
-  g. //-8-
-    ; //#8# ( "anotherBar" "anotherFoo" )
-}
-
-// Alias of an alias
-// Currently doesn't work interactively for some reason.
-void func6()
-{
-  using namespace evenmorestuff;
-  OneClass f;
-  f. //-7-
-    ; //#7# ( "aFunc" "anInt" )
-}
-
-// Alias for struct in nested namespace, fully qualified
-void func7()
-{
-  outer::StructNested f;
-  f.//-8-
-    ; //#8# ( "one" "two" )
-}
-
-// Alias for nested namespace
-void func8()
-{
-  using namespace outerinner;
-  StructNested f;
-  AnotherStruct g;
-  f.//-9-
-    ; //#9# ( "one" "two" )
-  g.//-10-
-    ; //#10# ( "four" "three" )
-}
-
-// arch-tag: 8e68d5d1-4d48-47c6-a910-d8d6b66b2768
--- a/test/cedet/tests/testusing.hh	Fri Mar 26 08:01:19 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,127 +0,0 @@
-// test usings header file.
-
-namespace moose {
-
-  class Point;
-
-  class MyClass;
-
-}
-
-
-namespace moose {
-
-  class Point;
-
-  class MyClass {
-  public:
-    MyClass() : fVal(0) {
-    }
-
-    ~MyClass() {};
-
-    /**
-     * fVal Accessors
-     * @{
-     */
-    int getVal() const {
-      return fVal;
-    }
-    void setVal(int Val) const {
-      fVal = Val;
-    }
-    /**
-     * @}
-     */
-  private:
-    int fVal;
-  };
-
-}
-
-namespace deer {
-
-  class Pickle;
-
-};
-
-// Code from Zhiqiu Kong
-
-#ifndef BREAD_H
-#define BREAD_H
-
-namespace bread_name {
-  class bread
-  {
-  public:
-    void geta();
-  private:
-    int m_a;
-    int m_b;
-  };
-}
-
-#endif
-
-// Code from David Engster
-// Creating alias types through 'using' trickery
-
-namespace somestuff {
-  class OneClass {
-  public:
-    void aFunc();
-    int anInt;
-  };
-  struct aStruct {
-    int foo;
-    int bar;
-  };
-}
-
-namespace otherstuff {
-  // make otherstuff::OneClass an alias for somestuff::OneClass
-  using somestuff::OneClass;
-}
-
-namespace morestuff {
-  // make morestuff an alias namespace for somestuff
-  using namespace somestuff;
-  // but hide aStruct with own type
-  struct aStruct {
-    int anotherFoo;
-    int anotherBar;
-  };
-}
-
-// We can also create an alias for an alias
-namespace evenmorestuff {
-  using otherstuff::OneClass;
-}
-
-// Now with nested namespaces
-namespace outer {
-  namespace inner {
-    struct StructNested {
-      int one;
-      int two;
-    };
-    struct AnotherStruct {
-      int three;
-      int four;
-    };
-  }
-}
-
-// Elevate the first struct into 'outer'
-// so that we can access it via 'outer::StructNested'
-namespace outer {
-  using outer::inner::StructNested;
-}
-
-// Create an alias for a nested namespace
-namespace outerinner {
-  // equivalent to 'namespace outerinner = outer::inner;'
-  using namespace outer::inner;
-}
-
-// arch-tag: f7e59fad-100b-47d3-ae8b-a8390a026ade
--- a/test/cedet/tests/testvarnames.c	Fri Mar 26 08:01:19 2010 +0100
+++ b/test/cedet/tests/testvarnames.c	Thu Apr 01 08:50:44 2010 +0200
@@ -1,6 +1,25 @@
-/*
- * Test variable and function names, lists of variables on one line, etc.
- */
+/* testvarnames.cpp
+   Test variable and function names, lists of variables on one line, etc.
+
+   Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+
+   Author: Eric M. Ludlam <eric@siege-engine.com>
+
+   This file is part of GNU Emacs.
+
+   GNU Emacs 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.
+
+   GNU Emacs 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 GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
+*/
 
 struct independent {
   int indep_1;
--- a/test/occur-testsuite.el	Fri Mar 26 08:01:19 2010 +0100
+++ b/test/occur-testsuite.el	Thu Apr 01 08:50:44 2010 +0200
@@ -107,7 +107,214 @@
        :fx
        :
 ")
-    )
+    ;; * Test non-overlapping context lines with matches at bob/eob.
+    ("x" 1 "\
+ax
+b
+c
+d
+ex
+f
+g
+hx
+" "\
+3 matches for \"x\" in buffer:  *temp*
+      1:ax
+       :b
+-------
+       :d
+      5:ex
+       :f
+-------
+       :g
+      8:hx
+")
+    ;; * Test non-overlapping context lines with matches not at bob/eob.
+    ("x" 1 "\
+a
+bx
+c
+d
+ex
+f
+" "\
+2 matches for \"x\" in buffer:  *temp*
+       :a
+      2:bx
+       :c
+-------
+       :d
+      5:ex
+       :f
+")
+    ;; * Test overlapping context lines with matches at bob/eob.
+    ("x" 2 "\
+ax
+bx
+c
+dx
+e
+f
+gx
+h
+i
+j
+kx
+" "\
+5 matches for \"x\" in buffer:  *temp*
+      1:ax
+      2:bx
+       :c
+      4:dx
+       :e
+       :f
+      7:gx
+       :h
+       :i
+       :j
+     11:kx
+")
+    ;; * Test overlapping context lines with matches not at bob/eob.
+    ("x" 2 "\
+a
+b
+cx
+d
+e
+f
+gx
+h
+i
+" "\
+2 matches for \"x\" in buffer:  *temp*
+       :a
+       :b
+      3:cx
+       :d
+       :e
+       :f
+      7:gx
+       :h
+       :i
+")
+    ;; * Test overlapping context lines with empty first and last line..
+    ("x" 2 "\
+
+b
+cx
+d
+e
+f
+gx
+h
+
+" "\
+2 matches for \"x\" in buffer:  *temp*
+       :
+       :b
+      3:cx
+       :d
+       :e
+       :f
+      7:gx
+       :h
+       :
+")
+    ;; * Test multi-line overlapping context lines.
+    ("x\n.x" 2 "\
+ax
+bx
+c
+d
+ex
+fx
+g
+h
+i
+jx
+kx
+" "\
+3 matches for \"x^J.x\" in buffer:  *temp*
+      1:ax
+       :bx
+       :c
+       :d
+      5:ex
+       :fx
+       :g
+       :h
+       :i
+     10:jx
+       :kx
+")
+    ;; * Test multi-line non-overlapping context lines.
+    ("x\n.x" 2 "\
+ax
+bx
+c
+d
+e
+f
+gx
+hx
+" "\
+2 matches for \"x^J.x\" in buffer:  *temp*
+      1:ax
+       :bx
+       :c
+       :d
+-------
+       :e
+       :f
+      7:gx
+       :hx
+")
+    ;; * Test non-overlapping negative (before-context) lines.
+    ("x" -2 "\
+a
+bx
+c
+d
+e
+fx
+g
+h
+ix
+" "\
+3 matches for \"x\" in buffer:  *temp*
+       :a
+      2:bx
+-------
+       :d
+       :e
+      6:fx
+-------
+       :g
+       :h
+      9:ix
+")
+    ;; * Test overlapping negative (before-context) lines.
+    ("x" -3 "\
+a
+bx
+c
+dx
+e
+f
+gx
+h
+" "\
+3 matches for \"x\" in buffer:  *temp*
+       :a
+      2:bx
+       :c
+      4:dx
+       :e
+       :f
+      7:gx
+")
+
+)
   "List of tests for `occur'.
 Each element has the format:
 \(REGEXP NLINES INPUT-BUFFER-STRING OUTPUT-BUFFER-STRING).")