changeset 108404:369f92442260

Merge from mainline.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Fri, 29 Jan 2010 15:20:05 +0000
parents 365134ccde58 (current diff) 3809515a97b5 (diff)
children ec8c8b1202c6
files
diffstat 46 files changed, 677 insertions(+), 343 deletions(-) [+]
line wrap: on
line diff
--- a/.bzrignore	Sat Jan 23 11:46:15 2010 +0000
+++ b/.bzrignore	Fri Jan 29 15:20:05 2010 +0000
@@ -61,3 +61,4 @@
 src/stamp-oldxmenu
 src/temacs
 src/deps
+configure.lineno
--- a/ChangeLog	Sat Jan 23 11:46:15 2010 +0000
+++ b/ChangeLog	Fri Jan 29 15:20:05 2010 +0000
@@ -1,3 +1,8 @@
+2010-01-23  Giorgos Keramidas  <keramida@ceid.upatras.gr>  (tiny change)
+
+	* configure.in: Check for utmp.h availability (FreeBSD 9.x lacks
+	this header file).
+
 2010-01-12  Juanma Barranquero  <lekktu@gmail.com>
 
 	* .bzrignore: Ignore all .exe, instead of individual files.
--- a/admin/notes/bugtracker	Sat Jan 23 11:46:15 2010 +0000
+++ b/admin/notes/bugtracker	Fri Jan 29 15:20:05 2010 +0000
@@ -2,6 +2,36 @@
 
 The Emacs Bug Tracker can be found at http://debbugs.gnu.org/
 
+* Quick-start guide
+
+This is 95% of all you will ever need.
+
+** How do I report a bug?
+Use M-x report-emacs-bug, or send mail to bug-gnu-emacs@gnu.org.
+If you want to Cc someone, use an "X-Debbugs-CC" header instead.
+
+** How do I comment on a bug?
+Reply to a mail on the bug-gnu-emacs list in the normal way.
+Or send a mail to 123@debbugs.gnu.org.
+
+If the bug is old and closed, you may have to unarchive it first.
+Send a mail to control@debbugs.gnu.org with
+unarchive 123
+on the first line of the body.
+
+** How do I close a bug?
+Send a mail to 123-done@debbugs.gnu.org.  In the body, explain
+why the bug is being closed.
+
+** How do I set bug meta-data?
+By mailing commands to control@debbugs.gnu.org.  Place commands at the
+start of the message body, one per line.
+
+severity 123 serious|important|normal|minor|wishlist
+tags 123 moreinfo|unreproducible|wontfix|patch
+
+* More detailed information
+
 For a list of all bugs, see http://debbugs.gnu.org/db/pa/lemacs.html
 This is a static page, updated once a day.  There is also a dynamic
 list, generated on request, but since there are many bug reports this
@@ -35,15 +65,16 @@
 (Many people think the submitter SHOULD be automatically subscribed
 to subsequent discussion, but this does not seem to be implemented.
 See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=37078)
+See also http://debbugs.gnu.org/5439
 
-Do NOT send a separate copy to the bug list, since this may generate a
-new report. The only time to send mail to the bug list is to create a
-new report.
+Do NOT send a separate copy to the bug list address, since this may
+generate a new report.  The only time to send mail to the bug list
+address is to create a new report.
 
 Gnus users can add the following to message-dont-reply-to-names;
 similarly with Rmail and rmail-dont-reply-to-names:
 
-"\\(emacs-pretest-bug\\|bug-gnu-emacs\\)@gnu\\.org\\|\
+"\\(emacs-pretest-bug\\|bug-gnu-emacs\\|bug-\\(e\\|gnu\\)macs\\)@gnu\\.org\\|\
 \\(submit\\|control\\|owner\\)@debbugs\\.gnu\\.org"
 
 The "owner@debbugs.gnu.org" entry is there because it appears in the
@@ -58,27 +89,23 @@
 (e.g. bug-cc-mode@gnu.org), do NOT just use a Cc: header.
 Instead, use "X-Debbugs-CC:".  This ensures the Cc address will get a
 mail with the bug report number in.  If you do not do this, each reply
-in the subsequent discussion will end up creating a new bug.  This is
-annoying.
+in the subsequent discussion will end up creating a new bug.
+This is annoying.
 
-Note that the way this feature works is perhaps not ideal (Bug#1720).
-If X-Debbugs-CC: was specifed by a real header, that header is removed
-in the mail sent out to the bug list, and the addresses merged into
-the Resent-CC header (see below).  They don't appear as an explicit CC:
-header, nor do they appear in the Reply-To: header.  So people you
-X-Debbugs-CC are not included in any following discussion unless they are
-manually cc'd.  So this feature really only serves to notify them that
-a bug has been filed.  It's then up to them to follow any subsequent
-discussion.
-
-If X-Debbugs-CC were merged into the Reply-To header, this might work
-more the way people expect.
+If a new report contains X-Debbugs-CC in the input, this is
+converted to a real Cc header in the output.  (See Bug#1720).
+It is also merged into the Resent-CC header (see below).
 
 ** How does Debbugs send out mails?
 
-The mails are sent out to the bug list with From: and To: unchanged.
-Eg if you file a bug with "submit@debbugs.gnu.org", that
-remains in the To: address.  They reach the bug list by being resent.
+The mails are sent out to the bug list by being resent.  The From:
+header is unchanged.  In new reports only (at present), the To:
+address is altered as follows.  Any "bug-gnu-emacs",
+"emacs-pretest-bug", or "submit@debbugs" address is replaced by
+123@debbugs in the mail that gets sent out.  (This also applies to any
+Cc: header, though you should be using X-Debbugs-CC instead in new
+reports).  The original header is stored as X-Debbugs-Original-To, if
+it was changed.  Any X-Debbugs-CC is merged into the Cc.
 
 Mails arriving at the bug list have the following Resent-* headers:
 
@@ -88,10 +115,6 @@
 
 The "maintainer email address" is "bug-gnu-emacs@gnu.org" in most cases.
 
-A new report also has:
-
-Mail-Followup-To: bug submitter, 123@debbugs.gnu.org
-
 ** To not get acknowledgement mail from the tracker,
 add an "X-Debbugs-No-Ack:" header (with any value).  If you use Gnus,
 you can add an element to gnus-posting-styles to do this automatically, eg:
@@ -117,17 +140,13 @@
 ** Not interested in tracker control messages (tags being set, etc)?
 Discard mails matching:
 
-^X-Emacs-PR-Message: transcript
-
-When you close a bug, you get a message matching:
-
-^X-Emacs-PR-Message: closed
+^X-Emacs-PR-Message: (transcript|closed)
 
 ** How to avoid multiple copies of mails.
-When you reply to a bug, respect the Reply-To address, ie send mail
-only to the submitter address and the numbered bug address.  Do not
-send mail direct to bug-gnu-emacs or emacs-pretest-bug unless you are
-reporting a new bug.
+If you reply to reports in the normal way, this should work fine.
+Basically, reply only to the numbered bug address (and any individual
+people's addresses). Do not send mail direct to bug-gnu-emacs or
+emacs-pretest-bug unless you are reporting a new bug.
 
 ** To close bug #123 (for example), send mail
 
@@ -138,6 +157,31 @@
 submitter; they get copies anyway so this will just result in more
 duplicate mail.
 
+** Details of closing a bug.
+(For information only)
+Sending a mail to 123-done does the following:
+
+1) Mark the bug as closed in the database.
+
+2) Send a mail to the original submitter telling them that their bug
+has been closed.  This mail has a header:
+
+X-Emacs-PR-Message: they-closed 123
+
+3) Send a mail to you and to the emacs-bug-tracker list confirming
+that the bug has been closed.  This mail has a header:
+
+X-Emacs-PR-Message: closed 123
+
+4) Send a copy of your mail to the bug-gnu-emacs list in exactly the
+same way as if you had sent mail to "123" (sans -done). This mail has
+headers:
+
+X-Emacs-PR-Message: cc-closed 123
+Mail-Followup-To: 123@debbugs.gnu.org, person-who-closed
+
+(This is Emacs-specific.  Normally the bug list gets the same mail as in 3).
+
 ** Setting bug parameters.
 There are two ways to set the parameters of bugs in the database
 (tags, severity level, etc).  When you report a new bug, you can
@@ -195,8 +239,7 @@
 See <http://wiki.debian.org/bugs.debian.org/usertags>
 
 "Usertags" are very similar to tags: a set of labels that can be added
-to a bug.  There are two differences between normal tags and user
-tags:
+to a bug.  There are two differences between normal tags and user tags:
 
 1) Anyone can define any valid usertag they like.  In contrast, only a
 limited, predefined set of normal tags are available (see above).
@@ -349,6 +392,17 @@
 Or use the static index:
 http://debbugs.gnu.org/db/ix/full.html
 
+** What are those "mbox folder" links on the bug report pages?
+
+"mbox folder" = messages as they arrived at the tracker
+
+"status mbox" = as above, but with a fake message at the start
+    summarizing the bug status
+
+"maintainer mbox" = messages as sent out from the tracker to the
+    maintainers (ie, bug-gnu-emacs).  These have some changed headers
+    (Resent-*, Subject, etc).
+
 ** ChangeLog issues
 
 *** When you fix a bug, it can be helpful to put the bug number in the
@@ -362,7 +416,7 @@
 
 Similarly, when you close a bug, it can be helpful to include the
 relevant ChangeLog entry in the message to the bug tracker, so people
-can see eaxctly what the fix was.
+can see exactly what the fix was.
 
 *** bug-reference-mode
 
@@ -373,6 +427,19 @@
 
 http://lists.gnu.org/archive/html/emacs-devel/2009-11/msg00440.html
 
+** Bazaar stuff
+
+*** You can use `bzr commit --fixes emacs:123' to mark that a commit fixes
+Emacs bug 123.  You will first need to add a line to your bazaar.conf:
+
+bugtracker_emacs_url = http://debbugs.gnu.org/{id}
+
+Note that all this does is add some metadata to the commit, it doesn't
+actually mark the bug as closed in the tracker.  There seems to be no
+way to see this "metadata" with `bzr log', which is rather poor, but
+it will show up as a link in a recent loggerhead installation, or with
+some of the graphical frontends to bzr log.
+
 ** Gnus-specific voodoo
 
 *** Put point on a bug-number and try: M-x gnus-read-ephemeral-emacs-bug-group
@@ -448,7 +515,10 @@
 *** debbugs-submit
 (quiet|control|submit)@(debbugs\.gnu\.org|emacsbugs\.donarmstrong\.com)
 [0-9]+(-done|-quiet|-subscribe)?@(debbugs\.gnu\.org|emacsbugs\.donarmstrong\.com)
-(bug-gnu-emacs|emacs-pretest-bug)@gnu\.org
+(bug-gnu-emacs|emacs-pretest-bug|bug-(e|gnu)macs)@gnu\.org
+
+bug-emacs and bug-gnumacs are lesser-used aliases from fencepost's
+/etc/aliases file.
 
 *** emacs-bug-tracker
 sender: bug-gnu-emacs AT gnu.org
@@ -456,3 +526,18 @@
 
 The latter is because that is the address that debbugs actually sends to.
 An /etc/aliases entry redirects it to the real emacs-bug-tracker address.
+
+** Administrivia
+
+The debbugs-submit list should have the administrivia option off,
+else it can by mistake filter out requests to subscribe to bugs.
+But, this feature doesn't work anyway (see bug#5439).
+
+** How to test changes
+
+Add an entry to /etc/debbugs/Maintainers like:
+
+mytest       my.email.address
+
+Then if you do all your testing with 'Package: mytest', the resulting
+mails should only go to your email address.
--- a/configure	Sat Jan 23 11:46:15 2010 +0000
+++ b/configure	Fri Jan 29 15:20:05 2010 +0000
@@ -6665,11 +6665,12 @@
 
 
 
+
 for ac_header in sys/select.h sys/timeb.h sys/time.h unistd.h utime.h \
   linux/version.h sys/systeminfo.h termios.h limits.h string.h stdlib.h \
   termcap.h stdio_ext.h fcntl.h strings.h coff.h pty.h sys/mman.h \
   sys/param.h sys/vlimit.h sys/resource.h locale.h sys/_mbstate_t.h \
-  sys/utsname.h pwd.h
+  sys/utsname.h pwd.h utmp.h
 do
 as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
--- a/configure.in	Sat Jan 23 11:46:15 2010 +0000
+++ b/configure.in	Fri Jan 29 15:20:05 2010 +0000
@@ -1106,7 +1106,7 @@
   linux/version.h sys/systeminfo.h termios.h limits.h string.h stdlib.h \
   termcap.h stdio_ext.h fcntl.h strings.h coff.h pty.h sys/mman.h \
   sys/param.h sys/vlimit.h sys/resource.h locale.h sys/_mbstate_t.h \
-  sys/utsname.h pwd.h)
+  sys/utsname.h pwd.h utmp.h)
 
 AC_MSG_CHECKING(if personality LINUX32 can be set)
 AC_TRY_COMPILE([#include <sys/personality.h>], [personality (PER_LINUX32)],
--- a/doc/emacs/ChangeLog	Sat Jan 23 11:46:15 2010 +0000
+++ b/doc/emacs/ChangeLog	Fri Jan 29 15:20:05 2010 +0000
@@ -1,3 +1,8 @@
+2010-01-24  Mark A. Hershberger  <mah@everybody.org>
+
+	* programs.texi (Other C Commands): Replace reference to obsolete
+	c-subword-mode.
+
 2010-01-21  Glenn Morris  <rgm@gnu.org>
 
 	* trouble.texi (Bugs): Fix PROBLEMS keybinding.
--- a/doc/emacs/programs.texi	Sat Jan 23 11:46:15 2010 +0000
+++ b/doc/emacs/programs.texi	Fri Jan 29 15:20:05 2010 +0000
@@ -1609,13 +1609,13 @@
 
 @table @kbd
 @item C-c C-w
-@itemx M-x c-subword-mode
-@findex c-subword-mode
+@itemx M-x subword-mode
+@findex subword-mode
 Enable (or disable) @dfn{subword mode}.  In subword mode, Emacs's word
 commands recognize upper case letters in
 @samp{StudlyCapsIdentifiers} as word boundaries.  This is indicated by
 the flag @samp{/w} on the mode line after the mode name
-(e.g. @samp{C/law}).  You can even use @kbd{M-x c-subword-mode} in
+(e.g. @samp{C/law}).  You can even use @kbd{M-x subword-mode} in
 non-CC Mode buffers.
 
 In the GNU project, we recommend using underscores to separate words
--- a/doc/lispref/ChangeLog	Sat Jan 23 11:46:15 2010 +0000
+++ b/doc/lispref/ChangeLog	Fri Jan 29 15:20:05 2010 +0000
@@ -1,3 +1,8 @@
+2010-01-28  Alan Mackenzie  <acm@muc.de>
+
+	* display.texi (Auto Faces): Say fontification-functions is called
+	whether or not Font Lock is enabled.  Tidy up the wording a bit.
+
 2010-01-17  Chong Yidong  <cyd@stupidchicken.com>
 
 	* elisp.texi: Remove duplicate edition information (Bug#5407).
--- a/doc/lispref/display.texi	Sat Jan 23 11:46:15 2010 +0000
+++ b/doc/lispref/display.texi	Fri Jan 29 15:20:05 2010 +0000
@@ -2654,23 +2654,25 @@
 
 @defvar fontification-functions
 This variable holds a list of functions that are called by Emacs
-redisplay as needed to assign faces automatically to text in the buffer.
+redisplay as needed, just before doing redisplay.  They are called even
+when Font Lock Mode isn't enabled.  When Font Lock Mode is enabled, this
+variable usually holds just one function, @code{jit-lock-function}.
 
 The functions are called in the order listed, with one argument, a
-buffer position @var{pos}.  Each function should attempt to assign faces
-to the text in the current buffer starting at @var{pos}.
-
-Each function should record the faces they assign by setting the
-@code{face} property.  It should also add a non-@code{nil}
-@code{fontified} property for all the text it has assigned faces to.
+buffer position @var{pos}.  Collectively they should attempt to assign
+faces to the text in the current buffer starting at @var{pos}.
+
+The functions should record the faces they assign by setting the
+@code{face} property.  They should also add a non-@code{nil}
+@code{fontified} property to all the text they have assigned faces to.
 That property tells redisplay that faces have been assigned to that text
 already.
 
-It is probably a good idea for each function to do nothing if the
+It is probably a good idea for the functions to do nothing if the
 character after @var{pos} already has a non-@code{nil} @code{fontified}
 property, but this is not required.  If one function overrides the
-assignments made by a previous one, the properties as they are
-after the last function finishes are the ones that really matter.
+assignments made by a previous one, the properties after the last
+function finishes are the ones that really matter.
 
 For efficiency, we recommend writing these functions so that they
 usually assign faces to around 400 to 600 characters at each call.
--- a/doc/misc/ChangeLog	Sat Jan 23 11:46:15 2010 +0000
+++ b/doc/misc/ChangeLog	Fri Jan 29 15:20:05 2010 +0000
@@ -2,6 +2,10 @@
 
 	* gnus.texi (Score File Format): Fix typo.
 
+2010-01-19  Mark A. Hershberger  <mah@everybody.org>
+
+	* cc-mode.texi: Replace references to obsolete c-subword-mode.
+
 2010-01-18  Juanma Barranquero  <lekktu@gmail.com>
 
 	* ada-mode.texi (Project File Overview): Fix typo.
--- a/doc/misc/cc-mode.texi	Sat Jan 23 11:46:15 2010 +0000
+++ b/doc/misc/cc-mode.texi	Fri Jan 29 15:20:05 2010 +0000
@@ -1012,7 +1012,7 @@
 If @var{n} is negative, move in the opposite direction.
 
 Note that these two commands have been superseded by
-@code{c-subword-mode}, which you should use instead.  @xref{Subword
+@code{subword-mode}, which you should use instead.  @xref{Subword
 Movement}.  They might be removed from a future release of @ccmode{}.
 @end table
 
@@ -1194,10 +1194,9 @@
 @findex toggle-auto-hungry-state (c-)
 Toggle both auto-newline and hungry delete minor modes.
 
-@item @kbd{C-c C-w} (@code{M-x c-subword-mode})
+@item @kbd{C-c C-w} (@code{M-x subword-mode})
 @kindex C-c C-w
-@findex c-subword-mode
-@findex subword-mode (c-)
+@findex subword-mode
 Toggle subword mode.
 
 @item @kbd{M-x c-toggle-syntactic-indentation}
@@ -1694,11 +1693,11 @@
 
 @example
 (add-hook 'c-mode-common-hook
-          (lambda () (c-subword-mode 1)))
+          (lambda () (subword-mode 1)))
 @end example
 
-As a bonus, you can also use @code{c-subword-mode} in non-@ccmode{}
-buffers by typing @kbd{M-x c-subword-mode}.
+As a bonus, you can also use @code{subword-mode} in non-@ccmode{}
+buffers by typing @kbd{M-x subword-mode}.
 
 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 @node    Other Commands,  , Subword Movement, Commands
--- a/etc/NEWS	Sat Jan 23 11:46:15 2010 +0000
+++ b/etc/NEWS	Fri Jan 29 15:20:05 2010 +0000
@@ -322,15 +322,14 @@
 **** The short log format for git makes use of the graph display, so
 it's not supported on git versions earlier than 1.5.
 
-**** The new variable vc-git-add-signoff can be used to add a
-Signed-off-by line when committing.
-
 **** Support for operating with stashes has been added to vc-dir: the stash list is
 displayed in the *vc-dir* header, stashes can be created, removed, applied and
 their content displayed.
 
 **** vc-dir displays the stash status
 
+**** vc-dir requires at least git-1.5.5.
+
 *** vc-bzr supports operating with shelves: the shelve list is
 displayed in the *vc-dir* header, shelves can be created, removed and applied.
 
--- a/lisp/ChangeLog	Sat Jan 23 11:46:15 2010 +0000
+++ b/lisp/ChangeLog	Fri Jan 29 15:20:05 2010 +0000
@@ -1,3 +1,111 @@
+2010-01-28  Michael Albinus  <michael.albinus@gmx.de>
+
+	* net/ange-ftp.el (ange-ftp-insert-directory): Handle the case,
+	FILENAME is not in `default-directory'.  (Bug#5478)
+
+	* net/tramp.el (tramp-handle-insert-directory): Simplify handling
+	of SWITCHES.  Handle the case, FILENAME is not in
+	`default-directory'.  (Bug#5478)
+	(tramp-register-file-name-handlers): Add safe-magic property.
+
+2010-01-28  Chong Yidong  <cyd@stupidchicken.com>
+
+	* arc-mode.el (archive-zip-extract): Quote the argument passed to
+	unzip (Bug#5475).
+
+2010-01-28  Nil Geisweiller  <ngeiswei@googlemail.com>  (tiny change)
+
+	* progmodes/flymake.el (flymake-allowed-file-name-masks)
+	(flymake-master-make-header-init): Add other C++ filename masks.
+	(flymake-find-possible-master-files)
+	(flymake-check-patch-master-file-buffer): Doc fixes (Bug#5488).
+
+2010-01-28  Michael Albinus  <michael.albinus@gmx.de>
+
+	Fix some busybox annoyances.
+
+	* net/tramp.el (tramp-wrong-passwd-regexp): Add "Timeout, server
+	not responding." string.
+	(tramp-open-connection-setup-interactive-shell): Dump stty
+	settings.  Enable "neveropen" arg for all `tramp-send-command'
+	calls.  Handle "=" in variable values properly.
+	(tramp-find-inline-encoding): Raise an error, when no encoding is
+	found.
+	(tramp-wait-for-output): Check, whether PROC buffer is available.
+	Remove spurious " ^H" sequences, sent by busybox.
+	(tramp-get-ls-command): Suppress coloring, if possible.
+
+2010-01-28  Glenn Morris  <rgm@gnu.org>
+
+	* vc-svn.el (vc-svn-update): Use "svn --non-interactive".  (Bug#4280)
+
+	* log-edit.el (log-edit-strip-single-file-name): Add missing
+	:safe, :group, and :version tags.
+
+2010-01-27  Stephen Berman  <stephen.berman@gmx.net>
+
+	* calendar/diary-lib.el (diary-unhide-everything): Handle narrowed
+	buffers.  (Bug#5477)
+
+2010-01-27  David De La Harpe Golden  <david@harpegolden.net>
+
+	* files.el (delete-directory): Handle moving to trash without
+	first doing recursion (Bug#5436).
+
+2010-01-26  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* vc-hooks.el (vc-path): Mark as obsolete.
+
+2010-01-25  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* vc-annotate.el (vc-annotate-revision-at-line): Compare file
+	names too.
+
+	* vc-bzr.el (vc-bzr-print-log): Use the more compact --line option
+	for the short log.
+	(vc-bzr-log-view-mode): Adjust regexp for the above change.
+
+2010-01-25  Mark A. Hershberger  <mah@everybody.org>
+
+	* progmodes/python.el: Replace reference to obsolete
+	c-subward-mode.
+
+	* vc-bzr.el: (vc-bzr-revision-table) New function.
+
+2010-01-25  Eric Hanchrow  <eric.hanchrow@gmail.com>  (tiny change)
+
+	* vc-git.el (vc-git-dir-status-goto-stage): Pass --relative to the
+	diff-index command.  This requires at least git-1.5.5.  (Bug#1589).
+
+2010-01-24  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	Remove support for adding --signoff on commit.
+	Future support will use an incompatible generic mechanism.
+	* vc-git.el (vc-git-add-signoff): Remove variable.
+	(vc-git-toggle-signoff): Remove function.
+	(vc-git-extra-menu-map): Do not bind vc-git-toggle-signoff.
+
+	* term/xterm.el (xterm-maybe-set-dark-background-mode): Rename
+	from xterm-set-background-mode.  Return t if the background mode
+	was set.
+	(terminal-init-xterm): Move tty-set-up-initial-frame-faces
+	earlier, call it again in case the background mode has changed.
+
+2010-01-23  Dmitri Paduchikh  <dpaduch@k66.ru>  (tiny change)
+
+	* emacs-lisp/advice.el (ad-set-orig-definition): Fix typo
+	(Bug#3541).
+
+2010-01-23  Chong Yidong  <cyd@stupidchicken.com>
+
+	* emacs-lisp/assoc.el (aelement): Doc fix.
+	(aput, adelete, amake): Use lexical-let (Bug#5450).
+
+2010-01-23  Stephen Leake  <stephen_leake@member.fsf.org>
+
+        * progmodes/ada-mode.el (ada-in-paramlist-p): Pragma syntax
+	is the same as subprogram call, not declaration.  (Bug#5435).
+
 2010-01-23  Michael Albinus  <michael.albinus@gmx.de>
 
 	* net/tramp-smb.el (tramp-smb-conf): New defcustom.
--- a/lisp/arc-mode.el	Sat Jan 23 11:46:15 2010 +0000
+++ b/lisp/arc-mode.el	Fri Jan 29 15:20:05 2010 +0000
@@ -1784,7 +1784,10 @@
 (defun archive-zip-extract (archive name)
   (if (equal (car archive-zip-extract) "pkzip")
       (archive-*-extract archive name archive-zip-extract)
-    (archive-extract-by-stdout archive name archive-zip-extract)))
+    ;; unzip expands wildcards in NAME, so we need to quote it.
+    ;; FIXME: Does pkzip need similar treatment?
+    (archive-extract-by-stdout archive (shell-quote-argument name)
+			       archive-zip-extract)))
 
 (defun archive-zip-write-file-member (archive descr)
   (archive-*-write-file-member
--- a/lisp/calendar/diary-lib.el	Sat Jan 23 11:46:15 2010 +0000
+++ b/lisp/calendar/diary-lib.el	Fri Jan 29 15:20:05 2010 +0000
@@ -804,7 +804,9 @@
 (defun diary-unhide-everything ()
   "Show all invisible text in the diary."
   (kill-local-variable 'diary-selective-display)
-  (remove-overlays (point-min) (point-max) 'invisible 'diary)
+  (save-restriction                     ; bug#5477
+    (widen)
+    (remove-overlays (point-min) (point-max) 'invisible 'diary))
   (kill-local-variable 'mode-line-format))
 
 (defvar original-date)                  ; bound in diary-list-entries
--- a/lisp/emacs-lisp/advice.el	Sat Jan 23 11:46:15 2010 +0000
+++ b/lisp/emacs-lisp/advice.el	Fri Jan 29 15:20:05 2010 +0000
@@ -2191,7 +2191,7 @@
 
 (defmacro ad-set-orig-definition (function definition)
   `(ad-safe-fset
-    (ad-get-advice-info-field function 'origname) ,definition))
+    (ad-get-advice-info-field ,function 'origname) ,definition))
 
 (defmacro ad-clear-orig-definition (function)
   `(fmakunbound (ad-get-advice-info-field ,function 'origname)))
--- a/lisp/emacs-lisp/assoc.el	Sat Jan 23 11:46:15 2010 +0000
+++ b/lisp/emacs-lisp/assoc.el	Fri Jan 29 15:20:05 2010 +0000
@@ -1,7 +1,7 @@
 ;;; assoc.el --- insert/delete/sort functions on association lists
 
-;; Copyright (C) 1996, 2001, 2002, 2003, 2004, 2005,
-;;   2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+;;   2009, 2010  Free Software Foundation, Inc.
 
 ;; Author: Barry A. Warsaw <bwarsaw@cen.com>
 ;; Keywords: extensions
@@ -27,6 +27,7 @@
 ;; fetching off key-value pairs in association lists.
 
 ;;; Code:
+(eval-when-compile (require 'cl))
 
 (defun asort (alist-symbol key)
   "Move a specified key-value pair to the head of an alist.
@@ -41,7 +42,8 @@
 
 (defun aelement (key value)
   "Make a list of a cons cell containing car of KEY and cdr of VALUE.
-The returned list is suitable as an element of an alist."
+The returned list is suitable for concatenating with an existing
+alist, via `nconc'."
   (list (cons key value)))
 
 
@@ -71,8 +73,8 @@
 modified, but will be moved to the head of the alist.  If the key-value
 pair cannot be found in the alist, it will be inserted into the head
 of the alist (with value nil if VALUE is nil or not supplied)."
-  (let ((elem (aelement key value))
-	alist)
+  (lexical-let ((elem (aelement key value))
+		alist)
     (asort alist-symbol key)
     (setq alist (eval alist-symbol))
     (cond ((null alist) (set alist-symbol elem))
@@ -86,7 +88,7 @@
 Alist is referenced by ALIST-SYMBOL and the key-value pair to remove
 is pair matching KEY.  Returns the altered alist."
   (asort alist-symbol key)
-  (let ((alist (eval alist-symbol)))
+  (lexical-let ((alist (eval alist-symbol)))
     (cond ((null alist) nil)
 	  ((anot-head-p alist key) alist)
 	  (t (set alist-symbol (cdr alist))))))
@@ -123,10 +125,10 @@
 this isn't enforced.  If VALUELIST is smaller than KEYLIST, remaining
 keys are associated with nil.  If VALUELIST is larger than KEYLIST,
 extra values are ignored.  Returns the created alist."
-  (let ((keycar (car keylist))
-	(keycdr (cdr keylist))
-	(valcar (car valuelist))
-	(valcdr (cdr valuelist)))
+  (lexical-let ((keycar (car keylist))
+		(keycdr (cdr keylist))
+		(valcar (car valuelist))
+		(valcdr (cdr valuelist)))
     (cond ((null keycdr)
 	   (aput alist-symbol keycar valcar))
 	  (t
--- a/lisp/erc/ChangeLog	Sat Jan 23 11:46:15 2010 +0000
+++ b/lisp/erc/ChangeLog	Fri Jan 29 15:20:05 2010 +0000
@@ -1,3 +1,12 @@
+2010-01-25  Vivek Dasmohapatra  <vivek@etla.org>
+
+	* erc-backend.el (erc-session-connector): New var.
+	(erc-server-reconnect): Use it to reconnect via old
+	connector (Bug#4958).
+
+	* erc.el (erc-determine-parameters): Save
+	erc-server-connect-function to erc-session-connector.
+
 2009-11-03  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* erc.el (erc-display-line-1, erc-process-away):
--- a/lisp/erc/erc-backend.el	Sat Jan 23 11:46:15 2010 +0000
+++ b/lisp/erc/erc-backend.el	Fri Jan 29 15:20:05 2010 +0000
@@ -130,6 +130,10 @@
   "The server name used to connect to for this session.")
 (make-variable-buffer-local 'erc-session-server)
 
+(defvar erc-session-connector nil
+  "The function used to connect to this session (nil for the default).")
+(make-variable-buffer-local 'erc-session-connector)
+
 (defvar erc-session-port nil
   "The port used to connect to.")
 (make-variable-buffer-local 'erc-session-port)
@@ -538,8 +542,10 @@
       (erc-set-active-buffer (current-buffer))
       (setq erc-server-last-sent-time 0)
       (setq erc-server-lines-sent 0)
-      (erc-open erc-session-server erc-session-port erc-server-current-nick
-                erc-session-user-full-name t erc-session-password))))
+      (let ((erc-server-connect-function (or erc-session-connector
+                                             'open-network-stream)))
+        (erc-open erc-session-server erc-session-port erc-server-current-nick
+                  erc-session-user-full-name t erc-session-password)))))
 
 (defun erc-server-filter-function (process string)
   "The process filter for the ERC server."
--- a/lisp/erc/erc.el	Sat Jan 23 11:46:15 2010 +0000
+++ b/lisp/erc/erc.el	Fri Jan 29 15:20:05 2010 +0000
@@ -5654,11 +5654,13 @@
   "Determine the connection and authentication parameters.
 Sets the buffer local variables:
 
+- `erc-session-connector'
 - `erc-session-server'
 - `erc-session-port'
 - `erc-session-full-name'
 - `erc-server-current-nick'"
-  (setq erc-session-server (erc-compute-server server)
+  (setq erc-session-connector erc-server-connect-function
+        erc-session-server (erc-compute-server server)
 	erc-session-port (or port erc-default-port)
 	erc-session-user-full-name (erc-compute-full-name name))
   (erc-set-current-nick (erc-compute-nick nick)))
--- a/lisp/files.el	Sat Jan 23 11:46:15 2010 +0000
+++ b/lisp/files.el	Fri Jan 29 15:20:05 2010 +0000
@@ -4665,21 +4665,35 @@
   ;; delete-directory handler.
   (setq directory (directory-file-name (expand-file-name directory)))
   (let ((handler (find-file-name-handler directory 'delete-directory)))
-    (if handler
-	(funcall handler 'delete-directory directory recursive)
+    (cond
+     (handler
+      (funcall handler 'delete-directory directory recursive))
+     (delete-by-moving-to-trash
+      ;; Only move non-empty dir to trash if recursive deletion was
+      ;; requested.  This mimics the non-`delete-by-moving-to-trash'
+      ;; case, where the operation fails in delete-directory-internal.
+      ;; As `move-file-to-trash' trashes directories (empty or
+      ;; otherwise) as a unit, we do not need to recurse here.
+      (if (and (not recursive)
+	       ;; Check if directory is empty apart from "." and "..".
+	       (directory-files
+		directory 'full directory-files-no-dot-files-regexp))
+	  (error "Directory is not empty, not moving to trash")
+	(move-file-to-trash directory)))
+     ;; Otherwise, call outselves recursively if needed.
+     (t
       (if (and recursive (not (file-symlink-p directory)))
-	  (mapc
-	   (lambda (file)
-	     ;; This test is equivalent to
-	     ;; (and (file-directory-p fn) (not (file-symlink-p fn)))
-	     ;; but more efficient
-	     (if (eq t (car (file-attributes file)))
-		 (delete-directory file recursive)
-	       (delete-file file)))
-	   ;; We do not want to delete "." and "..".
-	   (directory-files
-	    directory 'full directory-files-no-dot-files-regexp)))
-      (delete-directory-internal directory))))
+	  (mapc (lambda (file)
+		  ;; This test is equivalent to
+		  ;; (and (file-directory-p fn) (not (file-symlink-p fn)))
+		  ;; but more efficient
+		  (if (eq t (car (file-attributes file)))
+		      (delete-directory file recursive)
+		    (delete-file file)))
+		;; We do not want to delete "." and "..".
+		(directory-files
+		 directory 'full directory-files-no-dot-files-regexp)))
+      (delete-directory-internal directory)))))
 
 (defun copy-directory (directory newname &optional keep-time parents)
   "Copy DIRECTORY to NEWNAME.  Both args must be strings.
--- a/lisp/log-edit.el	Sat Jan 23 11:46:15 2010 +0000
+++ b/lisp/log-edit.el	Fri Jan 29 15:20:05 2010 +0000
@@ -1,7 +1,7 @@
 ;;; log-edit.el --- Major mode for editing CVS commit messages
 
-;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+;;   2008, 2009, 2010  Free Software Foundation, Inc.
 
 ;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
 ;; Keywords: pcl-cvs cvs commit log
@@ -150,7 +150,10 @@
 
 (defcustom log-edit-strip-single-file-name t
   "If non-nil, remove file name from single-file log entries."
-  :type 'boolean)
+  :type 'boolean
+  :safe 'booleanp
+  :group 'log-edit
+  :version "23.2")
 
 (defvar cvs-changelog-full-paragraphs t)
 (make-obsolete-variable 'cvs-changelog-full-paragraphs
--- a/lisp/mail/rmail.el	Sat Jan 23 11:46:15 2010 +0000
+++ b/lisp/mail/rmail.el	Fri Jan 29 15:20:05 2010 +0000
@@ -4270,7 +4270,7 @@
 
 ;;;***
 
-;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "d196de6dfb74fe87a3d02189096b795f")
+;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "93033f2136fcd111e2b52a116ff4cf29")
 ;;; Generated autoloads from rmailmm.el
 
 (autoload 'rmail-mime "rmailmm" "\
--- a/lisp/net/ange-ftp.el	Sat Jan 23 11:46:15 2010 +0000
+++ b/lisp/net/ange-ftp.el	Fri Jan 29 15:20:05 2010 +0000
@@ -4542,7 +4542,18 @@
          (if (string-match (concat "^.+[^ ] " (regexp-quote filename)
                                    "\\( -> .*\\)?[@/*=]?\n") dirlist)
              (match-string 0 dirlist)
-           "")))))))
+           "")))))
+
+    ;; The inserted file could be from somewhere else.
+    (when (and (not wildcard) (not full)
+	       (search-backward
+		(if (zerop (length (file-name-nondirectory
+				    (expand-file-name file))))
+		    "."
+		  (file-name-nondirectory file))
+		nil 'noerror))
+      (replace-match (file-relative-name (expand-file-name file)) t)
+      (goto-char (point-max)))))
 
 (defun ange-ftp-dired-uncache (dir)
   (if (ange-ftp-ftp-name (expand-file-name dir))
--- a/lisp/net/tramp.el	Sat Jan 23 11:46:15 2010 +0000
+++ b/lisp/net/tramp.el	Fri Jan 29 15:20:05 2010 +0000
@@ -1085,6 +1085,7 @@
 			"Login Incorrect"
 			"Connection refused"
 			"Connection closed"
+			"Timeout, server not responding."
 			"Sorry, try again."
 			"Name or service not known"
 			"Host key verification failed."
@@ -4061,26 +4062,25 @@
 	     (not (symbol-value 'ls-lisp-use-insert-directory-program)))
 	(tramp-run-real-handler
 	 'insert-directory (list filename switches wildcard full-directory-p))
-      (when (and (string-match "^--dired\\s-+" switches)
+      (when (stringp switches)
+        (setq switches (split-string switches)))
+      (when (and (member "--dired" switches)
 		 (not (tramp-get-ls-command-with-dired v)))
-	(setq switches (replace-match "" nil t switches)))
-      (tramp-message
-       v 4 "Inserting directory `ls %s %s', wildcard %s, fulldir %s"
-       switches filename (if wildcard "yes" "no")
-       (if full-directory-p "yes" "no"))
+	(setq switches (delete "--dired" switches)))
       (when wildcard
         (setq wildcard (tramp-run-real-handler
 			'file-name-nondirectory (list localname)))
         (setq localname (tramp-run-real-handler
 			 'file-name-directory (list localname))))
-      (when (listp switches)
-        (setq switches (mapconcat 'identity switches " ")))
       (unless full-directory-p
-        (setq switches (concat "-d " switches)))
+        (setq switches (add-to-list 'switches "-d" 'append)))
+      (setq switches (mapconcat 'tramp-shell-quote-argument switches " "))
       (when wildcard
-        (setq switches (concat switches " " wildcard)))
-      (when (string-match "'" switches)
-	(setq switches (replace-match "\\\\'" nil nil switches)))
+	(setq switches (concat switches " " wildcard)))
+      (tramp-message
+       v 4 "Inserting directory `ls %s %s', wildcard %s, fulldir %s"
+       switches filename (if wildcard "yes" "no")
+       (if full-directory-p "yes" "no"))
       ;; If `full-directory-p', we just say `ls -l FILENAME'.
       ;; Else we chdir to the parent directory, then say `ls -ld BASENAME'.
       (if full-directory-p
@@ -4143,6 +4143,17 @@
 	(while (looking-at "//")
 	  (forward-line 1)
 	  (delete-region (match-beginning 0) (point)))
+
+	;; The inserted file could be from somewhere else.
+	(when (and (not wildcard) (not full-directory-p))
+	  (goto-char (point-max))
+	  (search-backward
+	   (if (zerop (length (file-name-nondirectory filename)))
+	       "."
+	     (file-name-nondirectory filename))
+	   beg 'noerror)
+	  (replace-match (file-relative-name filename) t))
+
 	(goto-char (point-max))))))
 
 (defun tramp-handle-unhandled-file-name-directory (filename)
@@ -5480,6 +5491,7 @@
   ;; Add the handlers.
   (add-to-list 'file-name-handler-alist
 	       (cons tramp-file-name-regexp 'tramp-file-name-handler))
+  (put 'tramp-file-name-handler 'safe-magic t)
   (add-to-list 'file-name-handler-alist
 	       (cons tramp-completion-file-name-regexp
 		     'tramp-completion-file-name-handler))
@@ -6732,6 +6744,9 @@
 	;; because we're running on a non-MULE Emacs.  Let's try
 	;; stty, instead.
 	(tramp-send-command vec "stty -onlcr" t))))
+  ;; Dump stty settings in the traces.
+  (when (>= tramp-verbose 10)
+    (tramp-send-command vec "stty -a" t))
   (tramp-send-command vec "set +o vi +o emacs" t)
 
   ;; Check whether the output of "uname -sr" has been changed.  If
@@ -6801,15 +6816,16 @@
   ;; <http://bugs.opensolaris.org/view_bug.do?bug_id=6834184>.  We
   ;; apply the workaround.
   (if (string-equal (tramp-get-connection-property vec "uname" "") "SunOS 5.11")
-      (tramp-send-command vec "unset HISTFILE"))
+      (tramp-send-command vec "unset HISTFILE" t))
 
   (let ((env (copy-sequence tramp-remote-process-environment))
 	unset item)
     (while env
       (setq item (tramp-compat-split-string (car env) "="))
-      (if (and (stringp (cadr item)) (not (string-equal (cadr item) "")))
+      (setcdr item (mapconcat 'identity (cdr item) "="))
+      (if (and (stringp (cdr item)) (not (string-equal (cdr item) "")))
 	  (tramp-send-command
-	   vec (format "%s=%s; export %s" (car item) (cadr item) (car item)) t)
+	   vec (format "%s=%s; export %s" (car item) (cdr item) (car item)) t)
 	(push (car item) unset))
       (setq env (cdr env)))
     (when unset
@@ -6981,7 +6997,8 @@
 
       ;; Did we find something?
       (unless found
-	(tramp-message vec 2 "Couldn't find an inline transfer encoding"))
+	(tramp-error
+	 vec 'file-error "Couldn't find an inline transfer encoding"))
 
       ;; Set connection properties.
       (tramp-message vec 5 "Using local encoding `%s'" loc-enc)
@@ -7301,7 +7318,10 @@
     (unless nooutput (tramp-wait-for-output p))))
 
 (defun tramp-wait-for-output (proc &optional timeout)
-  "Wait for output from remote rsh command."
+  "Wait for output from remote command."
+  (unless (buffer-live-p (process-buffer proc))
+    (delete-process proc)
+    (tramp-error proc 'file-error "Process `%s' not available, try again" proc))
   (with-current-buffer (process-buffer proc)
     (let* (;; Initially, `tramp-end-of-output' is "#$ ".  There might
 	   ;; be leading escape sequences, which must be ignored.
@@ -7313,6 +7333,14 @@
 	   (found (tramp-wait-for-regexp proc timeout regexp1)))
       (if found
 	  (let (buffer-read-only)
+	    ;; A simple-minded busybox has sent " ^H" sequences.
+	    ;; Delete them.
+	    (goto-char (point-min))
+	    (when (re-search-forward
+		   "^\\(.\b\\)+$" (tramp-compat-line-end-position) t)
+	      (forward-line 1)
+	      (delete-region (point-min) (point)))
+	    ;; Delete the prompt.
 	    (goto-char (point-max))
 	    (re-search-backward regexp nil t)
 	    (delete-region (point) (point-max)))
@@ -8002,9 +8030,14 @@
 	 (let ((dl (tramp-get-remote-path vec))
 	       result)
 	   (while (and dl (setq result (tramp-find-executable vec cmd dl t t)))
-	     ;; Check parameter.
+	     ;; Check parameters.  On busybox, "ls" output coloring is
+	     ;; enabled by default sometimes.  So we try to disable it
+	     ;; when possible.  $LS_COLORING is not supported there.
 	     (when (zerop (tramp-send-command-and-check
 			   vec (format "%s -lnd /" result)))
+	       (when (zerop (tramp-send-command-and-check
+			     vec (format "%s --color=never /" result)))
+		 (setq result (concat result " --color=never")))
 	       (throw 'ls-found result))
 	     (setq dl (cdr dl))))))
      (tramp-error vec 'file-error "Couldn't find a proper `ls' command"))))
@@ -8481,8 +8514,6 @@
 ;; * Don't use globbing for directories with many files, as this is
 ;;   likely to produce long command lines, and some shells choke on
 ;;   long command lines.
-;; * `vc-directory' does not work.  It never displays any files, even
-;;   if it does show files when run locally.
 ;; * How to deal with MULE in `insert-file-contents' and `write-region'?
 ;; * Test remote ksh or bash for tilde expansion in `tramp-find-shell'?
 ;; * abbreviate-file-name
@@ -8529,8 +8560,6 @@
 ;; * Reconnect directly to a compliant shell without first going
 ;;   through the user's default shell. (Pete Forman)
 ;; * Make `tramp-default-user' obsolete.
-;; * Tramp shall reconnect automatically to its ssh connection when it
-;;   detects that the process "has died". (David Reitter)
 ;; * How can I interrupt the remote process with a signal
 ;;   (interrupt-process seems not to work)? (Markus Triska)
 ;; * Avoid the local shell entirely for starting remote processes.  If
@@ -8552,6 +8581,16 @@
 ;; * Keep a second connection open for out-of-band methods like scp or
 ;;   rsync.
 ;; * Support ptys in `tramp-handle-start-file-process'.
+;; * IMHO, it's a drawback that currently Tramp doesn't support
+;;   Unicode in Dired file names by default.  Is it possible to
+;;   improve Tramp to set LC_ALL to "C" only for commands where Tramp
+;;   expects English?  Or just to set LC_MESSAGES to "C" if Tramp
+;;   expects only English messages? (Juri Linkov)
+;; * Make shadowfile.el grok Tramp filenames.  (Bug#4526, Bug#4846)
+;; * Do not handle files with drive letter as remote.  (Bug#5447)
+;; * Load Tramp subpackages only when needed.  (Bug#1529, Bug#5448)
+;; * Try telnet+curl as new method.  It might be useful for busybox,
+;;   without built-in uuencode/uudecode.
 
 ;; Functions for file-name-handler-alist:
 ;; diff-latest-backup-file -- in diff.el
--- a/lisp/progmodes/ada-mode.el	Sat Jan 23 11:46:15 2010 +0000
+++ b/lisp/progmodes/ada-mode.el	Fri Jan 29 15:20:05 2010 +0000
@@ -257,7 +257,7 @@
 
 For instance:
     A := 1;   --  A multi-line comment
-	      --  aligned if ada-indent-align-comments is t"
+	      --  aligned if `ada-indent-align-comments' is t"
   :type 'boolean :group 'ada)
 
 (defcustom ada-indent-comment-as-code t
@@ -4163,7 +4163,7 @@
 
 
 (defun ada-in-paramlist-p ()
-  "Return t if point is inside a parameter-list."
+  "Return t if point is inside the parameter-list of a declaration, but not a subprogram call or aggregate."
   (save-excursion
     (and
      (ada-search-ignore-string-comment "(\\|)" t nil t)
@@ -4194,13 +4194,13 @@
 
      ;; right keyword two words before parenthesis ?
      ;; Type is in this list because of discriminants
+     ;; pragma is not, because the syntax is that of a subprogram call.
      (looking-at (eval-when-compile
 		   (concat "\\<\\("
 			   "procedure\\|function\\|body\\|"
 			   "task\\|entry\\|accept\\|"
 			   "access[ \t]+procedure\\|"
 			   "access[ \t]+function\\|"
-			   "pragma\\|"
 			   "type\\)\\>"))))))
 
 (defun ada-search-ignore-complex-boolean (regexp backwardp)
--- a/lisp/progmodes/flymake.el	Sat Jan 23 11:46:15 2010 +0000
+++ b/lisp/progmodes/flymake.el	Fri Jan 29 15:20:05 2010 +0000
@@ -269,8 +269,7 @@
   :group 'tools)
 
 (defcustom flymake-allowed-file-name-masks
-  '(("\\.c\\'" flymake-simple-make-init)
-    ("\\.cpp\\'" flymake-simple-make-init)
+  '(("\\.\\(?:c\\(?:pp\\|xx\\|\\+\\+\\)?\\|CC\\)\\'" flymake-simple-make-init)
     ("\\.xml\\'" flymake-xml-init)
     ("\\.html?\\'" flymake-xml-init)
     ("\\.cs\\'" flymake-simple-make-init)
@@ -291,7 +290,7 @@
     ;; ("[ \t]*\\input[ \t]*{\\(.*\\)\\(%s\\)}" 1 2 ))
     ;; ("\\.tex\\'" 1)
     )
-  "*Files syntax checking is allowed for."
+  "Files syntax checking is allowed for."
   :group 'flymake
   :type '(repeat (string symbol symbol symbol)))
 
@@ -384,7 +383,7 @@
 
 (defun flymake-find-possible-master-files (file-name master-file-dirs masks)
   "Find (by name and location) all possible master files.
-Master files are .cpp and .c for and .h.  Files are searched for
+Master files include .cpp and .c for .h.  Files are searched for
 starting from the .h directory and max max-level parent dirs.
 File contents are not checked."
   (let* ((dirs master-file-dirs)
@@ -434,9 +433,11 @@
         source-file-name patched-source-file-name
         include-dirs regexp)
   "Check if MASTER-FILE-NAME is a master file for SOURCE-FILE-NAME.
-For .cpp master file this means it includes SOURCE-FILE-NAME (.h).
 If yes, patch a copy of MASTER-FILE-NAME to include PATCHED-SOURCE-FILE-NAME
 instead of SOURCE-FILE-NAME.
+
+For example, foo.cpp is a master file if it includes foo.h.
+
 Whether a buffer for MATER-FILE-NAME exists, use it as a source
 instead of reading master file from disk."
   (let* ((source-file-nondir (file-name-nondirectory source-file-name))
@@ -1700,9 +1701,10 @@
 
 ;;;; .h/make specific
 (defun flymake-master-make-header-init ()
-  (flymake-master-make-init 'flymake-get-include-dirs
-			    '("\\.cpp\\'" "\\.c\\'")
-			    "[ \t]*#[ \t]*include[ \t]*\"\\([[:word:]0-9/\\_.]*%s\\)\""))
+  (flymake-master-make-init
+   'flymake-get-include-dirs
+   '("\\.\\(?:c\\(?:pp\\|xx\\|\\+\\+\\)?\\|CC\\)\\'")
+   "[ \t]*#[ \t]*include[ \t]*\"\\([[:word:]0-9/\\_.]*%s\\)\""))
 
 ;;;; .java/make specific
 (defun flymake-simple-make-java-init ()
--- a/lisp/progmodes/python.el	Sat Jan 23 11:46:15 2010 +0000
+++ b/lisp/progmodes/python.el	Fri Jan 29 15:20:05 2010 +0000
@@ -45,7 +45,7 @@
 ;; `forward-into-nomenclature' should be done separately, since it's
 ;; not specific to Python, and I've installed a minor mode to do the
 ;; job properly in Emacs 23.  [CC mode 5.31 contains an incompatible
-;; feature, `c-subword-mode' which is intended to have a similar
+;; feature, `subword-mode' which is intended to have a similar
 ;; effect, but actually only affects word-oriented keybindings.]
 
 ;; Other things seem more natural or canonical here, e.g. the
--- a/lisp/term/xterm.el	Sat Jan 23 11:46:15 2010 +0000
+++ b/lisp/term/xterm.el	Fri Jan 29 15:20:05 2010 +0000
@@ -462,6 +462,7 @@
       (set-keymap-parent input-decode-map map)))
 
     (xterm-register-default-colors)
+    (tty-set-up-initial-frame-faces)
 
     ;; Try to turn on the modifyOtherKeys feature on modern xterms.
     ;; When it is turned on many more key bindings work: things like
@@ -471,6 +472,7 @@
     (let ((coding-system-for-read 'binary)
 	  (chr nil)
 	  (str nil)
+	  (recompute-faces nil)
 	  version)
       ;; Pending input can be mistakenly returned by the calls to
       ;; read-event below.  Discard it.
@@ -502,10 +504,11 @@
 		  (while (not (equal (setq chr (read-event nil nil 2)) ?\\))
 		    (setq str (concat str (string chr))))
 		  (when (string-match "11;rgb:\\([a-f0-9]+\\)/\\([a-f0-9]+\\)/\\([a-f0-9]+\\)" str)
-		    (xterm-set-background-mode
-		     (string-to-number (match-string 1 str) 16)
-		     (string-to-number (match-string 2 str) 16)
-		     (string-to-number (match-string 3 str) 16))))))
+		    (setq recompute-faces
+			  (xterm-maybe-set-dark-background-mode
+			   (string-to-number (match-string 1 str) 16)
+			   (string-to-number (match-string 2 str) 16)
+			   (string-to-number (match-string 3 str) 16)))))))
 	    ;; NUMBER2 is the xterm version number, look for something
 	    ;; greater than 216, the version when modifyOtherKeys was
 	    ;; introduced.
@@ -520,10 +523,16 @@
 	      ;; need to deal with modify-other-keys.
 	      (push (frame-terminal (selected-frame))
 		    xterm-modify-other-keys-terminal-list)
-	      (xterm-turn-on-modify-other-keys))))))
+	      (xterm-turn-on-modify-other-keys))
 
-    ;; This recomputes all the default faces given the colors we've just set up.
-    (tty-set-up-initial-frame-faces)
+	    ;; Recompute faces here in case the background mode was
+	    ;; set to dark.  We used to call
+	    ;; `tty-set-up-initial-frame-faces' only once, but that
+	    ;; caused the light background faces to be computed
+	    ;; incorrectly.  See:
+	    ;; http://permalink.gmane.org/gmane.emacs.devel/119627
+	    (when recompute-faces
+	      (tty-set-up-initial-frame-faces))))))
 
     (run-hooks 'terminal-init-xterm-hook))
 
@@ -666,11 +675,13 @@
 	  (delq terminal xterm-modify-other-keys-terminal-list))
     (send-string-to-terminal "\e[>4m" terminal)))
 
-(defun xterm-set-background-mode (redc greenc bluec)
+(defun xterm-maybe-set-dark-background-mode (redc greenc bluec)
   ;; Use the heuristic in `frame-set-background-mode' to decide if a
   ;; frame is dark.
   (when (< (+ redc greenc bluec) (* .6 (+ 65535 65535 65535)))
-    (set-terminal-parameter nil 'background-mode 'dark)))
+    (setq xterm-background-mode-changed t)
+    (set-terminal-parameter nil 'background-mode 'dark)
+    t))
 
 ;; arch-tag: 12e7ebdd-1e6c-4b25-b0f9-35ace25e855a
 ;;; xterm.el ends here
--- a/lisp/url/ChangeLog	Sat Jan 23 11:46:15 2010 +0000
+++ b/lisp/url/ChangeLog	Fri Jan 29 15:20:05 2010 +0000
@@ -1,3 +1,7 @@
+2010-01-23  Chong Yidong  <cyd@stupidchicken.com>
+
+	* url-util.el: Require url-vars (Bug#5459).
+
 2009-11-27  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* url-parse.el (url-generic-parse-url): Bind deactivate-mark.
--- a/lisp/url/url-util.el	Sat Jan 23 11:46:15 2010 +0000
+++ b/lisp/url/url-util.el	Fri Jan 29 15:20:05 2010 +0000
@@ -26,6 +26,7 @@
 ;;; Code:
 
 (require 'url-parse)
+(require 'url-vars)
 (eval-when-compile (require 'cl))
 (autoload 'timezone-parse-date "timezone")
 (autoload 'timezone-make-date-arpa-standard "timezone")
--- a/lisp/vc-annotate.el	Sat Jan 23 11:46:15 2010 +0000
+++ b/lisp/vc-annotate.el	Fri Jan 29 15:20:05 2010 +0000
@@ -447,7 +447,8 @@
     (let ((rev-at-line (vc-annotate-extract-revision-at-line)))
       (if (not rev-at-line)
 	  (message "Cannot extract revision number from the current line")
-	(if (equal (car rev-at-line) vc-annotate-parent-rev)
+	(if (and (equal (car rev-at-line) vc-annotate-parent-rev)
+		 (string= (cdr rev-at-line) vc-annotate-parent-file))
 	    (message "Already at revision %s" rev-at-line)
 	  (vc-annotate-warp-revision (car rev-at-line) (cdr rev-at-line)))))))
 
--- a/lisp/vc-bzr.el	Sat Jan 23 11:46:15 2010 +0000
+++ b/lisp/vc-bzr.el	Fri Jan 29 15:20:05 2010 +0000
@@ -487,7 +487,7 @@
   (set (make-local-variable 'log-view-file-re) "\\`a\\`")
   (set (make-local-variable 'log-view-message-re)
        (if vc-short-log
-	   "^ *\\([0-9.]+\\) \\(.*?\\)[ \t]+\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}\\)\\( \\[merge\\]\\)?"
+	   "^ *\\([0-9.]+\\): \\(.*?\\)[ \t]+\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}\\)\\( \\[merge\\]\\)?"
 	 "^ *\\(?:revno: \\([0-9.]+\\)\\|merged: .+\\)"))
   (set (make-local-variable 'log-view-font-lock-keywords)
        ;; log-view-font-lock-keywords is careful to use the buffer-local
@@ -519,7 +519,7 @@
   (with-current-buffer buffer
     (apply 'vc-bzr-command "log" buffer 'async files
 	   (append
-	    (when shortlog '("--short"))
+	    (when shortlog '("--line"))
 	    (when start-revision (list (format "-r..%s" start-revision)))
 	    (when limit (list "-l" (format "%s" limit)))
 	    (if (stringp vc-bzr-log-switches)
@@ -898,6 +898,19 @@
   (interactive "e")
   (vc-dir-at-event e (popup-menu vc-bzr-shelve-menu-map e)))
 
+(defun vc-bzr-revision-table (files)
+  (let ((vc-bzr-revisions '())
+        (default-directory (file-name-directory (car files))))
+    (with-temp-buffer
+      (vc-bzr-command "log" t 0 files "--line")
+      (let ((start (point-min))
+            (loglines (buffer-substring-no-properties (point-min) (point-max))))
+        (while (string-match "^\\([0-9]+\\):" loglines)
+          (push (match-string 1 loglines) vc-bzr-revisions)
+          (setq start (+ start (match-end 0)))
+          (setq loglines (buffer-substring-no-properties start (point-max))))))
+    vc-bzr-revisions))
+
 ;;; Revision completion
 
 (eval-and-compile
--- a/lisp/vc-git.el	Sat Jan 23 11:46:15 2010 +0000
+++ b/lisp/vc-git.el	Fri Jan 29 15:20:05 2010 +0000
@@ -118,13 +118,6 @@
   :version "23.1"
   :group 'vc)
 
-(defcustom vc-git-add-signoff nil
-  "Add a Signed-off-by line when committing."
-  :type 'boolean
-  :version "23.2"
-  :group 'vc)
-
-
 (defvar git-commits-coding-system 'utf-8
   "Default coding system for git commits.")
 
@@ -388,7 +381,7 @@
      (vc-git-command (current-buffer) 'async files "ls-files" "-z" "-o" "-i"
                      "--directory" "--no-empty-directory" "--exclude-standard" "--"))
     ('diff-index
-     (vc-git-command (current-buffer) 'async files "diff-index" "-z" "-M" "HEAD" "--")))
+     (vc-git-command (current-buffer) 'async files "diff-index" "--relative" "-z" "-M" "HEAD" "--")))
   (vc-exec-after
    `(vc-git-after-dir-status-stage (quote ,stage) (quote ,files) (quote ,update-function))))
 
@@ -515,7 +508,7 @@
 (defun vc-git-checkin (files rev comment)
   (let ((coding-system-for-write git-commits-coding-system))
     (vc-git-command nil 0 files "commit"
-		    (if vc-git-add-signoff "-s") "-m" comment "--only" "--")))
+		    "-m" comment "--only" "--")))
 
 (defun vc-git-find-revision (file rev buffer)
   (let* (process-file-side-effects
@@ -766,10 +759,6 @@
     (define-key map [git-ss]
       '(menu-item "Show Stash..." vc-git-stash-show
 		  :help "Show stash contents"))
-    (define-key map [git-sig]
-      '(menu-item "Add Signed-off-by on commit" vc-git-toggle-signoff
-	      :help "Add Add Signed-off-by when commiting (i.e. add the -s flag)"
-	      :button (:toggle . vc-git-add-signoff)))
     map))
 
 (defun vc-git-extra-menu () vc-git-extra-menu-map)
@@ -779,10 +768,6 @@
 (defun vc-git-root (file)
   (vc-find-root file ".git"))
 
-(defun vc-git-toggle-signoff ()
-  (interactive)
-  (setq vc-git-add-signoff (not vc-git-add-signoff)))
-
 ;; Derived from `lgrep'.
 (defun vc-git-grep (regexp &optional files dir)
   "Run git grep, searching for REGEXP in FILES in directory DIR.
--- a/lisp/vc-hooks.el	Sat Jan 23 11:46:15 2010 +0000
+++ b/lisp/vc-hooks.el	Fri Jan 29 15:20:05 2010 +0000
@@ -89,6 +89,8 @@
   :type '(repeat directory)
   :group 'vc)
 
+(make-obsolete 'vc-path "should not be necessary anymore." "23.2")
+
 (defcustom vc-make-backup-files nil
   "If non-nil, backups of registered files are made as with other files.
 If nil (the default), files covered by version control don't get backups."
--- a/lisp/vc-svn.el	Sat Jan 23 11:46:15 2010 +0000
+++ b/lisp/vc-svn.el	Fri Jan 29 15:20:05 2010 +0000
@@ -330,6 +330,7 @@
     ;; Check out a particular version (or recreate the file).
     (vc-file-setprop file 'vc-working-revision nil)
     (apply 'vc-svn-command nil 0 file
+	   "--non-interactive"		; bug#4280
 	   "update"
 	   (cond
 	    ((null rev) "-rBASE")
--- a/src/ChangeLog	Sat Jan 23 11:46:15 2010 +0000
+++ b/src/ChangeLog	Fri Jan 29 15:20:05 2010 +0000
@@ -1,3 +1,62 @@
+2010-01-29  Eli Zaretskii  <eliz@gnu.org>
+
+	* w32inevt.c (key_event): Remove unnecessary comparison of
+	event->uChar.AsciiChar with 128.
+
+2010-01-28  Chong Yidong  <cyd@stupidchicken.com>
+
+	* fileio.c (Frename_file): Fix last change (Bug#5487).
+
+	* m/mips.h: Remove DATA_START.  Suggested by Dan Nicolaescu.
+
+	* m/alpha.h: Don't define DATA_START on NetBSD (Bug#4629).
+
+2010-01-28  Jan Djärv  <jan.h.d@swipnet.se>
+
+	* xfns.c (Fx_create_frame): Remove window size matching code from
+	2010-01-15.
+	(x_get_current_desktop, x_get_desktop_workarea): Remove
+
+2010-01-27  Jason Rumney  <jasonr@gnu.org>
+
+	* w32inevt.c (w32_kbd_patch_key): Save the unicode character.
+	(key_event): Use unicode for characters 128 and higher (Bug#4567).
+
+2010-01-27  Kenichi Handa  <handa@m17n.org>
+
+	* regex.c (analyse_first): Fix setting of fastmap for unibyte
+	pattern string (Bug#4209).
+
+2010-01-27  David De La Harpe Golden  <david@harpegolden.net>
+
+	* fileio.c (Frename_file): Call copy-directory and
+	delete-directory for directories, in order to handle cross-device
+	renaming (Bug#3353).
+
+2010-01-25  Jan Djärv  <jan.h.d@swipnet.se>
+
+	* xfns.c (Fx_create_frame): If frame height is too big, try
+	sizes 24 and 10. Bug #3643.
+
+2010-01-24  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	Try and fix bug#788, hopefully for real this time.
+	* keymap.c (shadow_lookup): Add `remap' arg.
+	(describe_map, describe_vector): Update calls to shadow_lookup.
+	(Fwhere_is_internal): Fix up handling of `remapped_sequences' and
+	`remapped' so this flag is applicable to `sequence'.  Be careful to
+	perform remapping during shadow_lookup check of remapped_sequences.
+
+2010-01-24  Eric Bélanger  <snowmaniscool@gmail.com>  (tiny change)
+
+	* image.c (png_load): Use png_sig_cmp instead of the obsolete
+	png_check_sig, which has been removed in libpng 1.4.
+
+2010-01-23  Giorgos Keramidas  <keramida@ceid.upatras.gr>  (tiny change)
+
+	* filelock.c: Include utmp.h only when HAVE_UTMP_H (FreeBSD 9.x
+	lacks this header file).
+
 2010-01-23  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
 	* xdisp.c (draw_glyphs): Update `start' for left_overwritten case
@@ -9299,7 +9358,7 @@
 	(syms_of_xterm): Don't declare it any more.
 	(x_draw_glyph_string): Adjust to the new name.
 
-2008-06-10  David De La Harpe Golden  <david@harpegolden.net>  (tiny change)
+2008-06-10  David De La Harpe Golden  <david@harpegolden.net>
 
 	* xterm.c (x_underline_minimum_display_offset): New var.
 	(x_draw_glyph_string): Use it.
--- a/src/fileio.c	Sat Jan 23 11:46:15 2010 +0000
+++ b/src/fileio.c	Fri Jan 29 15:20:05 2010 +0000
@@ -215,6 +215,12 @@
 /* Lisp function for moving files to trash.  */
 Lisp_Object Qmove_file_to_trash;
 
+/* Lisp function for recursively copying directories.  */
+Lisp_Object Qcopy_directory;
+
+/* Lisp function for recursively deleting directories.  */
+Lisp_Object Qdelete_directory;
+
 extern Lisp_Object Vuser_login_name;
 
 #ifdef WINDOWSNT
@@ -2241,7 +2247,11 @@
       && (NILP (Fstring_equal (Fdowncase (file), Fdowncase (newname))))
 #endif
       )
-    newname = Fexpand_file_name (Ffile_name_nondirectory (file), newname);
+    {
+      Lisp_Object fname = NILP (Ffile_directory_p (file))
+	? file : Fdirectory_file_name (file);
+      newname = Fexpand_file_name (Ffile_name_nondirectory (fname), newname);
+    }
   else
     newname = Fexpand_file_name (newname, Qnil);
 
@@ -2279,15 +2289,21 @@
                                  NILP (ok_if_already_exists) ? Qnil : Qt);
           else
 #endif
+	  if (!NILP (Ffile_directory_p (file)))
+	    call4 (Qcopy_directory, file, newname, Qt, Qnil);
+	  else
+	    /* We have already prompted if it was an integer, so don't
+	       have copy-file prompt again.  */
 	    Fcopy_file (file, newname,
-			/* We have already prompted if it was an integer,
-			   so don't have copy-file prompt again.  */
 			NILP (ok_if_already_exists) ? Qnil : Qt,
 			Qt, Qt);
 
 	  count = SPECPDL_INDEX ();
 	  specbind (Qdelete_by_moving_to_trash, Qnil);
-	  Fdelete_file (file);
+	  if (!NILP (Ffile_directory_p (file)))
+	    call2 (Qdelete_directory, file, Qt);
+	  else
+	    Fdelete_file (file);
 	  unbind_to (count, Qnil);
 	}
       else
@@ -5727,6 +5743,10 @@
   Qdelete_by_moving_to_trash = intern_c_string ("delete-by-moving-to-trash");
   Qmove_file_to_trash = intern_c_string ("move-file-to-trash");
   staticpro (&Qmove_file_to_trash);
+  Qcopy_directory = intern_c_string ("copy-directory");
+  staticpro (&Qcopy_directory);
+  Qdelete_directory = intern_c_string ("delete-directory");
+  staticpro (&Qdelete_directory);
 
   defsubr (&Sfind_file_name_handler);
   defsubr (&Sfile_name_directory);
--- a/src/filelock.c	Sat Jan 23 11:46:15 2010 +0000
+++ b/src/filelock.c	Fri Jan 29 15:20:05 2010 +0000
@@ -63,7 +63,9 @@
 
 #ifdef CLASH_DETECTION
 
+#ifdef HAVE_UTMP_H
 #include <utmp.h>
+#endif
 
 #if !defined (S_ISLNK) && defined (S_IFLNK)
 #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
--- a/src/image.c	Sat Jan 23 11:46:15 2010 +0000
+++ b/src/image.c	Fri Jan 29 15:20:05 2010 +0000
@@ -33,7 +33,7 @@
 #else
 # include <png.h>
 #endif
-#endif 
+#endif
 
 #include <setjmp.h>
 
@@ -3051,7 +3051,7 @@
             int nbytes, i;
             /* Windows mono bitmaps are reversed compared with X.  */
             invertedBits = bits;
-            nbytes = (img->width + BITS_PER_CHAR - 1) / BITS_PER_CHAR 
+            nbytes = (img->width + BITS_PER_CHAR - 1) / BITS_PER_CHAR
               * img->height;
             bits = (char *) alloca(nbytes);
             for (i = 0; i < nbytes; i++)
@@ -5559,7 +5559,7 @@
 /* PNG library details.  */
 
 DEF_IMGLIB_FN (png_get_io_ptr);
-DEF_IMGLIB_FN (png_check_sig);
+DEF_IMGLIB_FN (png_sig_cmp);
 DEF_IMGLIB_FN (png_create_read_struct);
 DEF_IMGLIB_FN (png_create_info_struct);
 DEF_IMGLIB_FN (png_destroy_read_struct);
@@ -5590,7 +5590,7 @@
     return 0;
 
   LOAD_IMGLIB_FN (library, png_get_io_ptr);
-  LOAD_IMGLIB_FN (library, png_check_sig);
+  LOAD_IMGLIB_FN (library, png_sig_cmp);
   LOAD_IMGLIB_FN (library, png_create_read_struct);
   LOAD_IMGLIB_FN (library, png_create_info_struct);
   LOAD_IMGLIB_FN (library, png_destroy_read_struct);
@@ -5615,7 +5615,7 @@
 #else
 
 #define fn_png_get_io_ptr		png_get_io_ptr
-#define fn_png_check_sig		png_check_sig
+#define fn_png_sig_cmp			png_sig_cmp
 #define fn_png_create_read_struct	png_create_read_struct
 #define fn_png_create_info_struct	png_create_info_struct
 #define fn_png_destroy_read_struct	png_destroy_read_struct
@@ -5762,7 +5762,7 @@
 
       /* Check PNG signature.  */
       if (fread (sig, 1, sizeof sig, fp) != sizeof sig
-	  || !fn_png_check_sig (sig, sizeof sig))
+	  || fn_png_sig_cmp (sig, 0, sizeof sig))
 	{
 	  image_error ("Not a PNG file: `%s'", file, Qnil);
 	  UNGCPRO;
@@ -5779,7 +5779,7 @@
 
       /* Check PNG signature.  */
       if (tbr.len < sizeof sig
-	  || !fn_png_check_sig (tbr.bytes, sizeof sig))
+	  || fn_png_sig_cmp (tbr.bytes, 0, sizeof sig))
 	{
 	  image_error ("Not a PNG image: `%s'", img->spec, Qnil);
 	  UNGCPRO;
--- a/src/keymap.c	Sat Jan 23 11:46:15 2010 +0000
+++ b/src/keymap.c	Fri Jan 29 15:20:05 2010 +0000
@@ -2650,11 +2650,13 @@
 				     Lisp_Object args, void *data));
 
 /* Like Flookup_key, but uses a list of keymaps SHADOW instead of a single map.
-   Returns the first non-nil binding found in any of those maps.  */
+   Returns the first non-nil binding found in any of those maps.
+   If REMAP is true, pass the result of the lookup through command
+   remapping before returning it.  */
 
 static Lisp_Object
-shadow_lookup (shadow, key, flag)
-     Lisp_Object shadow, key, flag;
+shadow_lookup (Lisp_Object shadow, Lisp_Object key, Lisp_Object flag,
+	       int remap)
 {
   Lisp_Object tail, value;
 
@@ -2669,7 +2671,15 @@
 	    return Qnil;
 	}
       else if (!NILP (value))
-	return value;
+	{
+	  Lisp_Object remapping;
+	  if (remap && SYMBOLP (value)
+	      && (remapping = Fcommand_remapping (value, Qnil, shadow),
+		  !NILP (remapping)))
+	    return remapping;
+	  else
+	    return value;
+	}
     }
   return Qnil;
 }
@@ -2860,30 +2870,30 @@
     {
       /* We have a list of advertized bindings.  */
       while (CONSP (tem))
-	if (EQ (shadow_lookup (keymaps, XCAR (tem), Qnil), definition))
+	if (EQ (shadow_lookup (keymaps, XCAR (tem), Qnil, 0), definition))
 	  return XCAR (tem);
 	else
 	  tem = XCDR (tem);
-      if (EQ (shadow_lookup (keymaps, tem, Qnil), definition))
+      if (EQ (shadow_lookup (keymaps, tem, Qnil, 0), definition))
 	return tem;
     }
 
   sequences = Freverse (where_is_internal (definition, keymaps,
 					   !NILP (noindirect), nomenus));
 
-  while (CONSP (sequences))
+  while (CONSP (sequences)
+	 /* If we're at the end of the `sequences' list and we haven't
+	    considered remapped sequences yet, copy them over and
+	    process them.  */
+	 || (!remapped && (sequences = remapped_sequences,
+			   remapped = 1),
+	     CONSP (sequences)))
     {
       Lisp_Object sequence, function;
 	  
       sequence = XCAR (sequences);
       sequences = XCDR (sequences);
 
-      if (NILP (sequences) && !remapped)
-	{
-	  sequences = remapped_sequences;
-	  remapped = 1;
-	}
-
       /* Verify that this key binding is not shadowed by another
 	 binding for the same key, before we say it exists.
 
@@ -2893,7 +2903,8 @@
 
 	 Either nil or number as value from Flookup_key
 	 means undefined.  */
-      if (!EQ (shadow_lookup (keymaps, sequence, Qnil), definition))
+      if (!EQ (shadow_lookup (keymaps, sequence, Qnil, remapped),
+	       definition))
 	continue;
 
       /* If the current sequence is a command remapping with
@@ -3506,7 +3517,7 @@
 	  ASET (kludge, 0, event);
 	  if (!NILP (shadow))
 	    {
-	      tem = shadow_lookup (shadow, kludge, Qt);
+	      tem = shadow_lookup (shadow, kludge, Qt, 0);
 	      if (!NILP (tem))
 		{
 		  /* If both bindings are keymaps, this key is a prefix key,
@@ -3776,7 +3787,7 @@
 	{
 	  Lisp_Object tem;
 
-	  tem = shadow_lookup (shadow, kludge, Qt);
+	  tem = shadow_lookup (shadow, kludge, Qt, 0);
 
 	  if (!NILP (tem))
 	    {
--- a/src/m/alpha.h	Sat Jan 23 11:46:15 2010 +0000
+++ b/src/m/alpha.h	Fri Jan 29 15:20:05 2010 +0000
@@ -95,7 +95,7 @@
 
 #undef UNEXEC
 #define UNEXEC unexelf.o
-#ifndef GNU_LINUX
+#if !defined(GNU_LINUX) && !defined(__NetBSD__)
 #define DATA_START    0x140000000
 #endif
 
--- a/src/m/mips.h	Sat Jan 23 11:46:15 2010 +0000
+++ b/src/m/mips.h	Fri Jan 29 15:20:05 2010 +0000
@@ -50,10 +50,6 @@
 
 #define TEXT_START      0x00400000
 
-#ifndef GNU_LINUX
-#define DATA_START      0x10000000
-#endif
-
 
 #if 0 /* These definitions were advantageous when not using
 	 USE_LSB_TAG.  With that, they get ignored but cause errors.  */
--- a/src/regex.c	Sat Jan 23 11:46:15 2010 +0000
+++ b/src/regex.c	Fri Jan 29 15:20:05 2010 +0000
@@ -4083,8 +4083,7 @@
 		     the corresponding multibyte character.  */
 		  int c = RE_CHAR_TO_MULTIBYTE (p[1]);
 
-		  if (! CHAR_BYTE8_P (c))
-		    fastmap[CHAR_LEADING_CODE (c)] = 1;
+		  fastmap[CHAR_LEADING_CODE (c)] = 1;
 		}
 	    }
 	  break;
--- a/src/w32inevt.c	Sat Jan 23 11:46:15 2010 +0000
+++ b/src/w32inevt.c	Fri Jan 29 15:20:05 2010 +0000
@@ -81,6 +81,9 @@
 static INPUT_RECORD event_queue[EVENT_QUEUE_SIZE];
 static INPUT_RECORD *queue_ptr = event_queue, *queue_end = event_queue;
 
+/* Temporarily store lead byte of DBCS input sequences.  */
+static char dbcs_lead = 0;
+
 static int
 fill_queue (BOOL block)
 {
@@ -253,13 +256,15 @@
 			  keystate, buf, 128, 0);
       if (isdead > 0)
 	{
-          char cp[20];
-          int cpId;
+	  char cp[20];
+	  int cpId;
+
+	  event->uChar.UnicodeChar = buf[isdead - 1];
 
-          GetLocaleInfo (GetThreadLocale (),
+	  GetLocaleInfo (GetThreadLocale (),
 			 LOCALE_IDEFAULTANSICODEPAGE, cp, 20);
-          cpId = atoi (cp);
-          isdead = WideCharToMultiByte (cpId, 0, buf, isdead,
+	  cpId = atoi (cp);
+	  isdead = WideCharToMultiByte (cpId, 0, buf, isdead,
 					ansi_code, 4, NULL, NULL);
 	}
       else
@@ -425,8 +430,6 @@
 
   if (lispy_function_keys[event->wVirtualKeyCode] == 0)
     {
-      emacs_ev->kind = ASCII_KEYSTROKE_EVENT;
-
       if (!NILP (Vw32_recognize_altgr)
 	  && (event->dwControlKeyState & LEFT_CTRL_PRESSED)
 	  && (event->dwControlKeyState & RIGHT_ALT_PRESSED))
@@ -461,9 +464,65 @@
 	  else if (event->uChar.AsciiChar == 0)
 	    w32_kbd_patch_key (event);
 	}
+
       if (event->uChar.AsciiChar == 0)
-	return 0;
-      emacs_ev->code = event->uChar.AsciiChar;
+	{
+	  emacs_ev->kind = NO_EVENT;
+	  return 0;
+	}
+      else if (event->uChar.AsciiChar > 0)
+	{
+	  emacs_ev->kind = ASCII_KEYSTROKE_EVENT;
+	  emacs_ev->code = event->uChar.AsciiChar;
+	}
+      else if (event->uChar.UnicodeChar > 0)
+	{
+	  emacs_ev->kind = MULTIBYTE_CHAR_KEYSTROKE_EVENT;
+	  emacs_ev->code = event->uChar.UnicodeChar;
+	}
+      else
+	{
+	  /* Fallback for non-Unicode versions of Windows.  */
+	  wchar_t code;
+	  char dbcs[2];
+          char cp[20];
+          int cpId;
+
+	  /* Get the codepage to interpret this key with.  */
+          GetLocaleInfo (GetThreadLocale (),
+			 LOCALE_IDEFAULTANSICODEPAGE, cp, 20);
+          cpId = atoi (cp);
+
+	  dbcs[0] = dbcs_lead;
+	  dbcs[1] = event->uChar.AsciiChar;
+	  if (dbcs_lead)
+	    {
+	      dbcs_lead = 0;
+	      if (!MultiByteToWideChar (cpId, 0, dbcs, 2, &code, 1))
+		{
+		  /* Garbage  */
+		  DebPrint (("Invalid DBCS sequence: %d %d\n",
+			     dbcs[0], dbcs[1]));
+		  emacs_ev->kind = NO_EVENT;
+		}
+	    }
+	  else if (IsDBCSLeadByteEx (cpId, dbcs[1]))
+	    {
+	      dbcs_lead = dbcs[1];
+	      emacs_ev->kind = NO_EVENT;
+	    }
+	  else
+	    {
+	      if (!MultiByteToWideChar (cpId, 0, &dbcs[1], 1, &code, 1))
+		{
+		  /* Garbage  */
+		  DebPrint (("Invalid character: %d\n", dbcs[1]));
+		  emacs_ev->kind = NO_EVENT;
+		}
+	    }
+	  emacs_ev->kind = MULTIBYTE_CHAR_KEYSTROKE_EVENT;
+	  emacs_ev->code = code;
+	}
     }
   else
     {
--- a/src/xfns.c	Sat Jan 23 11:46:15 2010 +0000
+++ b/src/xfns.c	Fri Jan 29 15:20:05 2010 +0000
@@ -3145,91 +3145,6 @@
   return Qnil;
 }
 
-/* Return current desktop index for the display where frame F is.
-   If we can't find out the current desktop, return 0.  */
-
-static int
-x_get_current_desktop (f)
-     struct frame *f;
-{
-  Atom actual_type;
-  unsigned long actual_size, bytes_remaining;
-  int rc, actual_format;
-  struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
-  long max_len = 10;
-  Display *dpy = FRAME_X_DISPLAY (f);
-  long *data = NULL;
-  int current_desktop;
-
-  BLOCK_INPUT;
-  x_catch_errors (dpy);
-  rc = XGetWindowProperty (dpy, dpyinfo->root_window,
-                           XInternAtom (dpy, "_NET_CURRENT_DESKTOP", False),
-                           0, max_len, False, XA_CARDINAL,
-                           &actual_type, &actual_format, &actual_size,
-                           &bytes_remaining, (unsigned char **)&data);
-
-  if (rc != Success || actual_type != XA_CARDINAL || x_had_errors_p (dpy)
-      || actual_size == 0 || actual_format != 32)
-    current_desktop = 0;
-  else
-    current_desktop = (int)*data;
-
-  if (data) XFree (data);
-  x_uncatch_errors ();
-  UNBLOCK_INPUT;
-  return current_desktop;
-}
-
-/* Return current size for DESKTOP_INDEX on the display where frame F is.
-   If we can't find out the size, return 0, otherwise 1.  */
-
-static int
-x_get_desktop_workarea (f, desktop_index, deskw, deskh)
-     struct frame *f;
-     int desktop_index;
-     int *deskw, *deskh;
-{
-  Atom actual_type;
-  unsigned long actual_size, bytes_remaining;
-  int rc, actual_format;
-  struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
-  long max_len = 1000; /* This handles 250 desktops, who has that many?  */
-  Display *dpy = FRAME_X_DISPLAY (f);
-  long *data = NULL;
-  int retval;
-
-  BLOCK_INPUT;
-  x_catch_errors (dpy);
-  rc = XGetWindowProperty (dpy, dpyinfo->root_window,
-                           XInternAtom (dpy, "_NET_WORKAREA", False),
-                           0, max_len, False, XA_CARDINAL,
-                           &actual_type, &actual_format, &actual_size,
-                           &bytes_remaining, (unsigned char **)&data);
-
-  if (rc != Success || actual_type != XA_CARDINAL || x_had_errors_p (dpy)
-      || actual_size < 3 || actual_format != 32)
-    retval = 0;
-  else
-    {
-      int idx;
-      
-      if (actual_size == 4 /* Only one info for all desktops.  */
-          || desktop_index*4 > actual_size) /* destop_index out of range.  */
-        desktop_index = 0;
-
-      idx = desktop_index*4;
-      *deskw = data[idx+2] - data[idx];
-      *deskh = data[idx+3] - data[idx+1];
-      retval = 1;
-    }
-  
-  if (data) XFree (data);
-  x_uncatch_errors ();
-  UNBLOCK_INPUT;
-  return retval;
-}
-
 DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame,
        1, 1, 0,
        doc: /* Make a new X window, which is called a "frame" in Emacs terms.
@@ -3249,7 +3164,7 @@
   Lisp_Object name;
   int minibuffer_only = 0;
   long window_prompting = 0;
-  int width, height, deskw = -1, deskh = -1, current_desktop = -1;
+  int width, height;
   int count = SPECPDL_INDEX ();
   struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
   Lisp_Object display;
@@ -3517,58 +3432,6 @@
   /* Compute the size of the X window.  */
   window_prompting = x_figure_window_size (f, parms, 1);
 
-  /* Don't make height higher than display height unless the user asked
-     for it.  */
-  height = FRAME_LINES (f);
-  tem = x_get_arg (dpyinfo, parms, Qheight, 0, 0, RES_TYPE_NUMBER);
-  if (EQ (tem, Qunbound))
-    {
-      int ph = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, FRAME_LINES (f));
-      int dph = DisplayHeight (FRAME_X_DISPLAY (f), FRAME_X_SCREEN_NUMBER (f));
-      /* Some desktops have fixed menus above and/or panels below.  Try to
-         figure out the usable size we have for emacs.  */
-      current_desktop = x_get_current_desktop (f);
-      x_get_desktop_workarea (f, current_desktop, &deskw, &deskh);
-      if (deskh > 0 && deskh < dph) dph = deskh;
-      
-      if (ph > dph)
-        {
-          height = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, dph) -
-            FRAME_TOOL_BAR_LINES (f) - FRAME_MENU_BAR_LINES (f);
-          if (FRAME_EXTERNAL_TOOL_BAR (f))
-            height -= 2; /* We can't know how big it will be.  */
-          if (FRAME_EXTERNAL_MENU_BAR (f))
-            height -= 2; /* We can't know how big it will be.  */
-        }
-    }
-
-  /* Don't make width wider than display width unless the user asked
-     for it.  */
-  width = FRAME_COLS (f);
-  tem = x_get_arg (dpyinfo, parms, Qwidth, 0, 0, RES_TYPE_NUMBER);
-  if (EQ (tem, Qunbound))
-    {
-      int pw = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, FRAME_COLS (f));
-      int dpw = DisplayWidth (FRAME_X_DISPLAY (f), FRAME_X_SCREEN_NUMBER (f));
-      if (deskw == -1)
-        {
-          current_desktop = x_get_current_desktop (f);
-          x_get_desktop_workarea (f, current_desktop, &deskw, &deskh);
-        }
-      if (deskw > 0 && deskw < dpw) dpw = deskw;
-      
-      if (pw > dpw)
-        width = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, dpw);
-    }
-
-  if (height != FRAME_LINES (f) || width != FRAME_COLS (f))
-    {
-      check_frame_size (f, &height, &width);
-      FRAME_LINES (f) = height;
-      SET_FRAME_COLS (f, width);
-    }
-  
-
   tem = x_get_arg (dpyinfo, parms, Qunsplittable, 0, 0, RES_TYPE_BOOLEAN);
   f->no_split = minibuffer_only || EQ (tem, Qt);