changeset 106998:de2044ac357c

from trunk
author Kenichi Handa <handa@m17n.org>
date Mon, 25 Jan 2010 17:22:45 +0900
parents 1b97672e92c5 (current diff) 7362dc093e43 (diff)
children eb7555fbea3b
files
diffstat 40 files changed, 395 insertions(+), 152 deletions(-) [+]
line wrap: on
line diff
--- a/.bzrignore	Thu Jan 21 13:14:47 2010 +0900
+++ b/.bzrignore	Mon Jan 25 17:22:45 2010 +0900
@@ -61,3 +61,4 @@
 src/stamp-oldxmenu
 src/temacs
 src/deps
+configure.lineno
--- a/ChangeLog	Thu Jan 21 13:14:47 2010 +0900
+++ b/ChangeLog	Mon Jan 25 17:22:45 2010 +0900
@@ -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	Thu Jan 21 13:14:47 2010 +0900
+++ b/admin/notes/bugtracker	Mon Jan 25 17:22:45 2010 +0900
@@ -35,15 +35,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 +59,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 +85,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:
@@ -124,10 +117,10 @@
 ^X-Emacs-PR-Message: 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
 
@@ -195,8 +188,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).
@@ -362,7 +354,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 +365,17 @@
 
 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
+(untested):
+
+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.
+
 ** Gnus-specific voodoo
 
 *** Put point on a bug-number and try: M-x gnus-read-ephemeral-emacs-bug-group
@@ -448,7 +451,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 +462,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	Thu Jan 21 13:14:47 2010 +0900
+++ b/configure	Mon Jan 25 17:22:45 2010 +0900
@@ -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	Thu Jan 21 13:14:47 2010 +0900
+++ b/configure.in	Mon Jan 25 17:22:45 2010 +0900
@@ -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	Thu Jan 21 13:14:47 2010 +0900
+++ b/doc/emacs/ChangeLog	Mon Jan 25 17:22:45 2010 +0900
@@ -1,3 +1,12 @@
+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.
+
 2010-01-12  Glenn Morris  <rgm@gnu.org>
 
 	* trouble.texi (Checklist): Use bug-gnu-emacs rather than
--- a/doc/emacs/programs.texi	Thu Jan 21 13:14:47 2010 +0900
+++ b/doc/emacs/programs.texi	Mon Jan 25 17:22:45 2010 +0900
@@ -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/emacs/trouble.texi	Thu Jan 21 13:14:47 2010 +0900
+++ b/doc/emacs/trouble.texi	Mon Jan 25 17:22:45 2010 +0900
@@ -419,7 +419,7 @@
 
   Before reporting a bug, it is a good idea to see if it is already
 known.  You can find the list of known problems in the file
-@file{etc/PROBLEMS} in the Emacs distribution; type @kbd{C-h C-e} to read
+@file{etc/PROBLEMS} in the Emacs distribution; type @kbd{C-h C-p} to read
 it.  Some additional user-level problems can be found in @ref{Bugs and
 problems, , Bugs and problems, efaq, GNU Emacs FAQ}.  Looking up your
 problem in these two documents might provide you with a solution or a
--- a/doc/misc/ChangeLog	Thu Jan 21 13:14:47 2010 +0900
+++ b/doc/misc/ChangeLog	Mon Jan 25 17:22:45 2010 +0900
@@ -1,3 +1,11 @@
+2010-01-24  Mark A. Hershberger  <mah@everybody.org>
+
+	* gnus.texi (Score File Format): Fix typo.
+
+2010-01-21  Katsumi Yamaoka  <yamaoka@jpl.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	Thu Jan 21 13:14:47 2010 +0900
+++ b/doc/misc/cc-mode.texi	Mon Jan 25 17:22:45 2010 +0900
@@ -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/doc/misc/gnus.texi	Thu Jan 21 13:14:47 2010 +0900
+++ b/doc/misc/gnus.texi	Mon Jan 25 17:22:45 2010 +0900
@@ -21803,7 +21803,7 @@
 other.
 
 @item eval
-The value of this entry will be @code{eval}el.  This element will be
+The value of this entry will be @code{eval}ed.  This element will be
 ignored when handling global score files.
 
 @item read-only
--- a/etc/NEWS	Thu Jan 21 13:14:47 2010 +0900
+++ b/etc/NEWS	Mon Jan 25 17:22:45 2010 +0900
@@ -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	Thu Jan 21 13:14:47 2010 +0900
+++ b/lisp/ChangeLog	Mon Jan 25 17:22:45 2010 +0900
@@ -1,3 +1,87 @@
+2010-01-25  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* 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.
+	(tramp-smb-maybe-open-connection): Use it.
+
+2010-01-22  Michael Albinus  <michael.albinus@gmx.de>
+
+	* net/tramp-imap.el (top): Autoload needed packages.  (Bug#5448)
+
+2010-01-22  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* mail/rmailmm.el (rmail-mime-handle): Don't set the buffer to unibyte
+	just because we see "encoding: 8bit".
+	* mail/rmail.el (rmail-show-message-1): Decode the body's QP into bytes.
+
+2010-01-22  Chong Yidong  <cyd@stupidchicken.com>
+
+	* isearch.el (isearch-allow-scroll): Doc fix (Bug#5446).
+
+2010-01-22  Eli Zaretskii  <eliz@gnu.org>
+
+	* jka-compr.el (jka-compr-load): If load-file is not in
+	load-history, try its file-truename version.  (bug#5447)
+
+2010-01-21  Alan Mackenzie  <acm@muc.de>
+
+	Fix a situation where deletion of a cpp construct throws an error.
+	* progmodes/cc-engine.el (c-invalidate-state-cache): Before
+	invoking c-with-all-but-one-cpps-commented-out, check that the
+	special cpp construct is still in the buffer.
+	(c-parse-state): Record the special cpp with markers, not numbers.
+
+2010-01-21  Kenichi Handa  <handa@m17n.org>
+
+	* textmodes/sgml-mode.el (sgml-maybe-name-self): No need to
+	process last-command-event, as it is now decoded first (Bug#5380).
+
 2010-01-20  Chong Yidong  <cyd@stupidchicken.com>
 
 	* term.el (term-send-raw-meta): Revert 2009-12-04 change (Bug#5330).
--- a/lisp/emacs-lisp/advice.el	Thu Jan 21 13:14:47 2010 +0900
+++ b/lisp/emacs-lisp/advice.el	Mon Jan 25 17:22:45 2010 +0900
@@ -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	Thu Jan 21 13:14:47 2010 +0900
+++ b/lisp/emacs-lisp/assoc.el	Mon Jan 25 17:22:45 2010 +0900
@@ -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/isearch.el	Thu Jan 21 13:14:47 2010 +0900
+++ b/lisp/isearch.el	Mon Jan 25 17:22:45 2010 +0900
@@ -1754,7 +1754,10 @@
 (put 'digit-argument 'isearch-scroll t)
 
 (defcustom isearch-allow-scroll nil
-  "If non-nil, scrolling commands are allowed during incremental search."
+  "Whether scrolling is allowed during incremental search.
+If non-nil, scrolling commands can be used in Isearch mode.
+However, the current match will never scroll offscreen.
+If nil, scolling commands will first cancel Isearch mode."
   :type 'boolean
   :group 'isearch)
 
--- a/lisp/jka-compr.el	Thu Jan 21 13:14:47 2010 +0900
+++ b/lisp/jka-compr.el	Mon Jan 25 17:22:45 2010 +0900
@@ -590,7 +590,14 @@
 	  (or nomessage
 	      (message "Loading %s...done." file))
 	  ;; Fix up the load history to point at the right library.
-	  (let ((l (assoc load-file load-history)))
+	  (let ((l (or (assoc load-file load-history)
+		       ;; On MS-Windows, if load-file is in
+		       ;; temporary-file-directory, it will look like
+		       ;; "c:/DOCUME~1/USER/LOCALS~1/foo", whereas
+		       ;; readevalloop will record its truename in
+		       ;; load-history.  Therefore try truename if the
+		       ;; original name is not in load-history.
+		       (assoc (file-truename load-file) load-history))))
 	    ;; Remove .gz and .elc?.
 	    (while (file-name-extension file)
 	      (setq file (file-name-sans-extension file)))
--- a/lisp/mail/mail-utils.el	Thu Jan 21 13:14:47 2010 +0900
+++ b/lisp/mail/mail-utils.el	Mon Jan 25 17:22:45 2010 +0900
@@ -133,6 +133,8 @@
 If UNIBYTE is non-nil, insert converted characters as unibyte.
 That is useful if you are going to character code decoding afterward,
 as Rmail does."
+  ;; FIXME: `unibyte' should always be non-nil, and the iso-latin-1
+  ;; specific handling should be removed (or moved elsewhere and generalized).
   (interactive "r\nP")
   (let (failed)
     (save-match-data
--- a/lisp/mail/rmail.el	Thu Jan 21 13:14:47 2010 +0900
+++ b/lisp/mail/rmail.el	Mon Jan 25 17:22:45 2010 +0900
@@ -2727,7 +2727,8 @@
 	    (insert-buffer-substring mbox-buf body-start end)
 	    (cond
 	     ((string= character-coding "quoted-printable")
-	      (mail-unquote-printable-region (point-min) (point-max)))
+	      (mail-unquote-printable-region (point-min) (point-max)
+                                             nil nil 'unibyte))
 	     ((and (string= character-coding "base64") is-text-message)
 	      (base64-decode-region (point-min) (point-max)))
 	     ((eq character-coding 'uuencode)
@@ -4269,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/mail/rmailmm.el	Thu Jan 21 13:14:47 2010 +0900
+++ b/lisp/mail/rmailmm.el	Mon Jan 25 17:22:45 2010 +0900
@@ -361,7 +361,10 @@
 	 (setq content-transfer-encoding nil))
 	((string= content-transfer-encoding "8bit")
 	 ;; FIXME: Is this the correct way?
-	 (set-buffer-multibyte nil)))
+         ;; No, of course not, it just means there's no decoding to do.
+	 ;; (set-buffer-multibyte nil)
+         (setq content-transfer-encoding nil)
+         ))
   ;; Inline stuff requires work.  Attachments are handled by the bulk
   ;; handler.
   (if (string= "inline" (car content-disposition))
--- a/lisp/net/tramp-imap.el	Thu Jan 21 13:14:47 2010 +0900
+++ b/lisp/net/tramp-imap.el	Mon Jan 25 17:22:45 2010 +0900
@@ -55,13 +55,23 @@
 (require 'assoc)
 (require 'tramp)
 (require 'tramp-compat)
-(require 'message)
-(require 'imap-hash)
-(require 'epa)
+
 (autoload 'auth-source-user-or-password "auth-source")
+(autoload 'epg-context-operation "epg")
+(autoload 'epg-context-set-armor "epg")
+(autoload 'epg-context-set-passphrase-callback "epg")
+(autoload 'epg-context-set-progress-callback "epg")
+(autoload 'epg-decrypt-string "epg")
+(autoload 'epg-encrypt-string "epg")
+(autoload 'imap-hash-get "imap-hash")
+(autoload 'imap-hash-make "imap-hash")
+(autoload 'imap-hash-map "imap-hash")
+(autoload 'imap-hash-put "imap-hash")
+(autoload 'imap-hash-rem "imap-hash")
 
 ;; We use the additional header "X-Size" for encoding the size of a file.
-(add-to-list 'imap-hash-headers 'X-Size 'append)
+(eval-after-load "imap-hash"
+  '(add-to-list 'imap-hash-headers 'X-Size 'append))
 
 ;; Define Tramp IMAP method ...
 (defconst tramp-imap-method "imap"
@@ -662,7 +672,8 @@
 		  (read-passwd
 		   (if (eq key-id 'PIN)
 		       "Tramp-IMAP passphrase for PIN: "
-		     (let ((entry (assoc key-id epg-user-id-alist)))
+		     (let ((entry (assoc key-id
+					 (symbol-value 'epg-user-id-alist))))
 		       (if entry
 			   (format "Tramp-IMAP passphrase for %s %s: "
 				   key-id (cdr entry))
--- a/lisp/net/tramp-smb.el	Thu Jan 21 13:14:47 2010 +0900
+++ b/lisp/net/tramp-smb.el	Mon Jan 25 17:22:45 2010 +0900
@@ -61,6 +61,13 @@
   :group 'tramp
   :type 'string)
 
+(defcustom tramp-smb-conf "/dev/null"
+  "*Path of the smb.conf file.
+If it is nil, no smb.conf will be added to the `tramp-smb-program'
+call, letting the SMB client use the default one."
+  :group 'tramp
+  :type '(choice (const nil) (file :must-match t)))
+
 (defvar tramp-smb-version nil
   "*Version string of the SMB client.")
 
@@ -1281,7 +1288,8 @@
 
 	  (when domain (setq args (append args (list "-W" domain))))
 	  (when port   (setq args (append args (list "-p" port))))
-	  (setq args (append args (list "-s" "/dev/null")))
+	  (when tramp-smb-conf
+	    (setq args (append args (list "-s" tramp-smb-conf))))
 
 	  ;; OK, let's go.
 	  (tramp-message
--- a/lisp/progmodes/ada-mode.el	Thu Jan 21 13:14:47 2010 +0900
+++ b/lisp/progmodes/ada-mode.el	Mon Jan 25 17:22:45 2010 +0900
@@ -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/cc-engine.el	Thu Jan 21 13:14:47 2010 +0900
+++ b/lisp/progmodes/cc-engine.el	Mon Jan 25 17:22:45 2010 +0900
@@ -2996,9 +2996,11 @@
   ;; containing point.  We can then call `c-invalidate-state-cache-1' without
   ;; worrying further about macros and template delimiters.
   (c-with-<->-as-parens-suppressed
-   (if c-state-old-cpp-beg
+   (if (and c-state-old-cpp-beg
+	    (< c-state-old-cpp-beg here))
        (c-with-all-but-one-cpps-commented-out
-	c-state-old-cpp-beg c-state-old-cpp-end
+	c-state-old-cpp-beg
+	(min c-state-old-cpp-end here)
 	(c-invalidate-state-cache-1 here))
      (c-with-cpps-commented-out
       (c-invalidate-state-cache-1 here)))))
@@ -3029,8 +3031,9 @@
 	      (c-parse-state-1))
 	   (c-with-cpps-commented-out
 	    (c-parse-state-1))))
-      (setq c-state-old-cpp-beg here-cpp-beg
-	    c-state-old-cpp-end here-cpp-end))))
+      (setq c-state-old-cpp-beg (and here-cpp-beg (copy-marker here-cpp-beg t))
+	    c-state-old-cpp-end (and here-cpp-end (copy-marker here-cpp-end t)))
+      )))
 
 ;; Debug tool to catch cache inconsistencies.  This is called from
 ;; 000tests.el.
--- a/lisp/progmodes/python.el	Thu Jan 21 13:14:47 2010 +0900
+++ b/lisp/progmodes/python.el	Mon Jan 25 17:22:45 2010 +0900
@@ -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	Thu Jan 21 13:14:47 2010 +0900
+++ b/lisp/term/xterm.el	Mon Jan 25 17:22:45 2010 +0900
@@ -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/textmodes/sgml-mode.el	Thu Jan 21 13:14:47 2010 +0900
+++ b/lisp/textmodes/sgml-mode.el	Mon Jan 25 17:22:45 2010 +0900
@@ -608,11 +608,7 @@
   "Insert a symbolic character name according to `sgml-char-names'."
   (interactive "*")
   (if sgml-name-8bit-mode
-      (let ((mc last-command-event))
-	(if (< mc 256)
-	    (setq mc (unibyte-char-to-multibyte mc)))
-	(or mc (setq mc last-command-event))
-	(sgml-name-char mc))
+      (sgml-name-char last-command-event)
     (self-insert-command 1)))
 
 (defun sgml-name-8bit-mode ()
--- a/lisp/url/ChangeLog	Thu Jan 21 13:14:47 2010 +0900
+++ b/lisp/url/ChangeLog	Mon Jan 25 17:22:45 2010 +0900
@@ -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	Thu Jan 21 13:14:47 2010 +0900
+++ b/lisp/url/url-util.el	Mon Jan 25 17:22:45 2010 +0900
@@ -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-bzr.el	Thu Jan 21 13:14:47 2010 +0900
+++ b/lisp/vc-bzr.el	Mon Jan 25 17:22:45 2010 +0900
@@ -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	Thu Jan 21 13:14:47 2010 +0900
+++ b/lisp/vc-git.el	Mon Jan 25 17:22:45 2010 +0900
@@ -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/src/ChangeLog	Thu Jan 21 13:14:47 2010 +0900
+++ b/src/ChangeLog	Mon Jan 25 17:22:45 2010 +0900
@@ -1,3 +1,45 @@
+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
+	as in Emacs 22.
+
+2010-01-22  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+	* lisp.h (make_pure_string): String pointer arg now points to const.
+
+	* alloc.c (find_string_data_in_pure, make_pure_string): String pointer
+	args now point to const.
+
+2010-01-22  Eli Zaretskii  <eliz@gnu.org>
+
+	* lread.c (Fload): Don't treat files without .elc extension as
+	byte-compiled if they are ``magic'', i.e. `openp' returned -2 for
+	them.  (bug#5303)
+
 2010-01-20  Kenichi Handa  <handa@m17n.org>
 
 	* coding.c (consume_chars): If ! multibyte and the encoder is ccl,
--- a/src/alloc.c	Thu Jan 21 13:14:47 2010 +0900
+++ b/src/alloc.c	Mon Jan 25 17:22:45 2010 +0900
@@ -4725,11 +4725,11 @@
 
 static char *
 find_string_data_in_pure (data, nbytes)
-     char *data;
+     const char *data;
      int nbytes;
 {
   int i, skip, bm_skip[256], last_char_skip, infinity, start, start_max;
-  unsigned char *p;
+  const unsigned char *p;
   char *non_lisp_beg;
 
   if (pure_bytes_used_non_lisp < nbytes + 1)
@@ -4740,7 +4740,7 @@
   for (i = 0; i < 256; i++)
     bm_skip[i] = skip;
 
-  p = (unsigned char *) data;
+  p = (const unsigned char *) data;
   while (--skip > 0)
     bm_skip[*p++] = skip;
 
@@ -4754,7 +4754,7 @@
   infinity = pure_bytes_used_non_lisp + 1;
   bm_skip['\0'] = infinity;
 
-  p = (unsigned char *) non_lisp_beg + nbytes;
+  p = (const unsigned char *) non_lisp_beg + nbytes;
   start = 0;
   do
     {
@@ -4796,7 +4796,7 @@
 
 Lisp_Object
 make_pure_string (data, nchars, nbytes, multibyte)
-     char *data;
+     const char *data;
      int nchars, nbytes;
      int multibyte;
 {
--- a/src/filelock.c	Thu Jan 21 13:14:47 2010 +0900
+++ b/src/filelock.c	Mon Jan 25 17:22:45 2010 +0900
@@ -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	Thu Jan 21 13:14:47 2010 +0900
+++ b/src/image.c	Mon Jan 25 17:22:45 2010 +0900
@@ -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	Thu Jan 21 13:14:47 2010 +0900
+++ b/src/keymap.c	Mon Jan 25 17:22:45 2010 +0900
@@ -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/lisp.h	Thu Jan 21 13:14:47 2010 +0900
+++ b/src/lisp.h	Mon Jan 25 17:22:45 2010 +0900
@@ -2686,7 +2686,7 @@
 extern Lisp_Object make_string_from_bytes P_ ((const char *, int, int));
 extern Lisp_Object make_specified_string P_ ((const char *, int, int, int));
 EXFUN (Fpurecopy, 1);
-extern Lisp_Object make_pure_string P_ ((char *, int, int, int));
+extern Lisp_Object make_pure_string P_ ((const char *, int, int, int));
 extern Lisp_Object make_pure_c_string (const char *data);
 extern Lisp_Object pure_cons P_ ((Lisp_Object, Lisp_Object));
 extern Lisp_Object make_pure_vector P_ ((EMACS_INT));
--- a/src/lread.c	Thu Jan 21 13:14:47 2010 +0900
+++ b/src/lread.c	Mon Jan 25 17:22:45 2010 +0900
@@ -1155,7 +1155,7 @@
 
   if (!bcmp (SDATA (found) + SBYTES (found) - 4,
 	     ".elc", 4)
-      || (version = safe_to_load_p (fd)) > 0)
+      || (fd >= 0 && (version = safe_to_load_p (fd)) > 0))
     /* Load .elc files directly, but not when they are
        remote and have no handler!  */
     {
--- a/src/xdisp.c	Thu Jan 21 13:14:47 2010 +0900
+++ b/src/xdisp.c	Mon Jan 25 17:22:45 2010 +0900
@@ -20401,6 +20401,7 @@
 	  j = i;
 	  BUILD_GLYPH_STRINGS (j, start, h, t,
 			       overlap_hl, dummy_x, last_x);
+	  start = i;
 	  compute_overhangs_and_x (t, head->x, 1);
 	  prepend_glyph_string_lists (&head, &tail, h, t);
 	  clip_head = head;
@@ -20450,6 +20451,8 @@
 
 	  BUILD_GLYPH_STRINGS (end, i, h, t,
 			       overlap_hl, x, last_x);
+	  /* Because BUILD_GLYPH_STRINGS updates the first argument,
+	     we don't have `end = i;' here.  */
 	  compute_overhangs_and_x (h, tail->x + tail->width, 0);
 	  append_glyph_string_lists (&head, &tail, h, t);
 	  clip_tail = tail;
--- a/src/xfns.c	Thu Jan 21 13:14:47 2010 +0900
+++ b/src/xfns.c	Mon Jan 25 17:22:45 2010 +0900
@@ -3518,27 +3518,35 @@
   window_prompting = x_figure_window_size (f, parms, 1);
 
   /* Don't make height higher than display height unless the user asked
-     for it.  */
+     for it.  Try sizes 24 and 10 if current is too large.  */
   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 h = FRAME_LINES (f) + FRAME_TOOL_BAR_LINES (f)
+        + FRAME_MENU_BAR_LINES (f) + 2;
+      int ph = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, h);
       int dph = DisplayHeight (FRAME_X_DISPLAY (f), FRAME_X_SCREEN_NUMBER (f));
+      static int tryheight[] = { 24, 10, 0 } ;
+      int i;
+
+      ph += (FRAME_EXTERNAL_TOOL_BAR (f) ? 32 : 0) /* Gtk toolbar size */
+        + (FRAME_EXTERNAL_MENU_BAR (f) ? 24 : 0); /* Arbitrary */
+
       /* 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)
+      /* Allow 40 pixels for manager decorations.  */
+      for (i = 0; ph+40 > dph && tryheight[i] != 0; ++i)
         {
-          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.  */
+          height = tryheight[i];
+          h = height + FRAME_TOOL_BAR_LINES (f) + FRAME_MENU_BAR_LINES (f) + 2;
+          ph = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, h)
+            + (FRAME_EXTERNAL_TOOL_BAR (f) ? 32 : 0)
+            + (FRAME_EXTERNAL_MENU_BAR (f) ? 24 : 0);
         }
     }