changeset 107120:f9eab02425f0

Merge from trunk
author Jan D. <jan.h.d@swipnet.se>
date Wed, 10 Feb 2010 08:47:34 +0100
parents e90c20914c19 (current diff) 8839cd62c3d2 (diff)
children c7c70f9fa3d7
files
diffstat 52 files changed, 933 insertions(+), 318 deletions(-) [+]
line wrap: on
line diff
--- a/admin/notes/bugtracker	Mon Feb 01 14:09:07 2010 +0100
+++ b/admin/notes/bugtracker	Wed Feb 10 08:47:34 2010 +0100
@@ -403,6 +403,17 @@
     maintainers (ie, bug-gnu-emacs).  These have some changed headers
     (Resent-*, Subject, etc).
 
+** What do the pkgreport.cgi sort options mean?
+
+"normal" = by open/closed status, then severity, then tag, then bug number
+
+"oldview" = as above, but without the tag part
+
+"age" = as normal, but sort in decreasing order of last modification
+time, rather than by increasing bug number
+
+"raw" = ?
+
 ** ChangeLog issues
 
 *** When you fix a bug, it can be helpful to put the bug number in the
@@ -527,6 +538,15 @@
 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.
 
+** Recovering from moderation mistakes
+
+All discarded messages are stored in /var/lib/mailman/spam.
+If a non-spam message accidentally gets discarded, just do:
+
+cat /var/lib/mailman/spam/not-really-spam.msg | /usr/lib/debbugs/receive
+... check it works ...
+mv /var/lib/mailman/spam/not-really-spam.msg /var/lib/mailman/not-spam/
+
 ** Administrivia
 
 The debbugs-submit list should have the administrivia option off,
--- a/doc/emacs/ChangeLog	Mon Feb 01 14:09:07 2010 +0100
+++ b/doc/emacs/ChangeLog	Wed Feb 10 08:47:34 2010 +0100
@@ -1,3 +1,13 @@
+2010-02-08  Glenn Morris  <rgm@gnu.org>
+
+	* buffers.texi (Uniquify): Must explicitly load library.  (Bug#5529)
+
+2010-02-01  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* display.texi (Useless Whitespace, Text Display):
+	* custom.texi (Init Examples): Avoid obsolete special default variables
+	like default-major-mode.
+
 2010-01-24  Mark A. Hershberger  <mah@everybody.org>
 
 	* programs.texi (Other C Commands): Replace reference to obsolete
--- a/doc/emacs/buffers.texi	Mon Feb 01 14:09:07 2010 +0100
+++ b/doc/emacs/buffers.texi	Wed Feb 10 08:47:34 2010 +0100
@@ -583,7 +583,8 @@
 
 @vindex uniquify-buffer-name-style
   Other methods work by adding parts of each file's directory to the
-buffer name.  To select one, customize the variable
+buffer name.  To select one, load the library @file{uniquify} (e.g.
+using @code{(require 'uniquify)}), and customize the variable
 @code{uniquify-buffer-name-style} (@pxref{Easy Customization}).
 
   To begin with, the @code{forward} naming method includes part of the
--- a/doc/emacs/custom.texi	Mon Feb 01 14:09:07 2010 +0100
+++ b/doc/emacs/custom.texi	Wed Feb 10 08:47:34 2010 +0100
@@ -2275,7 +2275,7 @@
 Make Text mode the default mode for new buffers.
 
 @example
-(setq default-major-mode 'text-mode)
+(setq-default major-mode 'text-mode)
 @end example
 
 Note that @code{text-mode} is used because it is the command for
--- a/doc/emacs/display.texi	Mon Feb 01 14:09:07 2010 +0100
+++ b/doc/emacs/display.texi	Wed Feb 10 08:47:34 2010 +0100
@@ -877,7 +877,6 @@
 @key{RET}}.  This command does not remove newline characters.
 
 @vindex indicate-empty-lines
-@vindex default-indicate-empty-lines
 @cindex unused lines
 @cindex fringes, and unused line indication
   Emacs can indicate unused lines at the end of the window with a
@@ -887,11 +886,11 @@
 this image in the fringe.
 
   To enable this feature, set the buffer-local variable
-@code{indicate-empty-lines} to a non-@code{nil} value.  The default
-value of this variable is controlled by the variable
-@code{default-indicate-empty-lines}; by setting that variable, you
-can enable or disable this feature for all new buffers.  (This feature
-currently doesn't work on text-only terminals.)
+@code{indicate-empty-lines} to a non-@code{nil} value.  You can enable
+or disable this feature for all new buffers by setting the default
+value of this variable, e.g.@: @code{(setq-default
+indicate-empty-lines t)};.  (This feature currently doesn't work on
+text-only terminals.)
 
 @node Selective Display
 @section Selective Display
@@ -1083,17 +1082,15 @@
 printing characters (octal codes above 0400).
 
 @vindex tab-width
-@vindex default-tab-width
   Some @acronym{ASCII} control characters are displayed in special
 ways.  The newline character (octal code 012) is displayed by starting
 a new line.  The tab character (octal code 011) is displayed by moving
 to the next tab stop column (normally every 8 columns).  The number of
 spaces per tab is controlled by the variable @code{tab-width}, which
 must have an integer value between 1 and 1000, inclusive, and is made
-local by changing it.  Note that how the tab character in the buffer
+buffer-local by changing it.  Note that how the tab character in the buffer
 is displayed has nothing to do with the definition of @key{TAB} as a
-command.  The variable @code{default-tab-width} controls the default
-value of this variable for buffers where you have not set it locally.
+command.
 
   Other @acronym{ASCII} control characters are normally displayed as a caret
 (@samp{^}) followed by the non-control version of the character; thus,
--- a/doc/lispintro/ChangeLog	Mon Feb 01 14:09:07 2010 +0100
+++ b/doc/lispintro/ChangeLog	Wed Feb 10 08:47:34 2010 +0100
@@ -1,3 +1,8 @@
+2010-02-01  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* emacs-lisp-intro.texi (Text and Auto-fill, Mode Line):
+	Avoid obsolete special default variables like default-major-mode.
+
 2009-12-09  David Robinow  <drobinow@gmail.com>  (tiny change)
 
 	* makefile.w32-in: Use parenthesis for macros for nmake
--- a/doc/lispintro/emacs-lisp-intro.texi	Mon Feb 01 14:09:07 2010 +0100
+++ b/doc/lispintro/emacs-lisp-intro.texi	Wed Feb 10 08:47:34 2010 +0100
@@ -17346,10 +17346,10 @@
 @smallexample
 @group
 ;;; Text mode and Auto Fill mode
-; The next two lines put Emacs into Text mode
-; and Auto Fill mode, and are for writers who
-; want to start writing prose rather than code.
-(setq default-major-mode 'text-mode)
+;; The next two lines put Emacs into Text mode
+;; and Auto Fill mode, and are for writers who
+;; want to start writing prose rather than code.
+(setq-default major-mode 'text-mode)
 (add-hook 'text-mode-hook 'turn-on-auto-fill)
 @end group
 @end smallexample
@@ -18257,7 +18257,7 @@
 @need 1700
 @node Mode Line,  , Miscellaneous, Emacs Initialization
 @section A Modified Mode Line
-@vindex default-mode-line-format
+@vindex mode-line-format
 @cindex Mode line format
 
 Finally, a feature I really like: a modified mode line.
@@ -18282,7 +18282,7 @@
 @group
 ;; Set a Mode Line that tells me which machine, which directory,
 ;; and which line I am on, plus the other customary information.
-(setq default-mode-line-format
+(setq-default mode-line-format
  (quote
   (#("-" 0 1
      (help-echo
--- a/doc/lispref/ChangeLog	Mon Feb 01 14:09:07 2010 +0100
+++ b/doc/lispref/ChangeLog	Wed Feb 10 08:47:34 2010 +0100
@@ -1,3 +1,8 @@
+2010-02-01  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* display.texi (Line Height): Avoid obsolete special default variables
+	like default-major-mode.
+
 2010-01-28  Alan Mackenzie  <acm@muc.de>
 
 	* display.texi (Auto Faces): Say fontification-functions is called
--- a/doc/lispref/display.texi	Mon Feb 01 14:09:07 2010 +0100
+++ b/doc/lispref/display.texi	Wed Feb 10 08:47:34 2010 +0100
@@ -1768,7 +1768,6 @@
 There are several ways to specify the line spacing for different
 parts of Emacs text.
 
-@vindex default-line-spacing
   On graphical terminals, you can specify the line spacing for all
 lines in a frame, using the @code{line-spacing} frame parameter
 (@pxref{Layout Parameters}).  However, if the default value of
--- a/doc/misc/ChangeLog	Mon Feb 01 14:09:07 2010 +0100
+++ b/doc/misc/ChangeLog	Wed Feb 10 08:47:34 2010 +0100
@@ -1,3 +1,7 @@
+2010-02-05  Mark A. Hershberger  <mah@everybody.org>
+
+	* ede.texi, eieio.texi, semantic.texi: Use standard direntry format.
+
 2010-01-21  Katsumi Yamaoka  <yamaoka@jpl.org>
 
 	* gnus.texi (Score File Format): Fix typo.
--- a/doc/misc/ede.texi	Mon Feb 01 14:09:07 2010 +0100
+++ b/doc/misc/ede.texi	Wed Feb 10 08:47:34 2010 +0100
@@ -22,13 +22,10 @@
 @end quotation
 @end copying
 
-@ifinfo
-@format
-START-INFO-DIR-ENTRY
+@dircategory Emacs
+@direntry
 * ede: (ede).       Project management for Emacs
-END-INFO-DIR-ENTRY
-@end format
-@end ifinfo
+@end direntry
 
 @titlepage
 @center @titlefont{EDE (The Emacs Development Environment)}
--- a/doc/misc/eieio.texi	Mon Feb 01 14:09:07 2010 +0100
+++ b/doc/misc/eieio.texi	Wed Feb 10 08:47:34 2010 +0100
@@ -27,13 +27,10 @@
 @end quotation
 @end copying
 
-@ifinfo
-@format
-START-INFO-DIR-ENTRY
+@dircategory Emacs
+@direntry
 * eieio: (eieio).       Objects for Emacs
-END-INFO-DIR-ENTRY
-@end format
-@end ifinfo
+@end direntry
 
 @titlepage
 @center @titlefont{@value{TITLE}}
--- a/doc/misc/semantic.texi	Mon Feb 01 14:09:07 2010 +0100
+++ b/doc/misc/semantic.texi	Wed Feb 10 08:47:34 2010 +0100
@@ -41,13 +41,10 @@
 @end quotation
 @end copying
 
-@ifinfo
-@format
-START-INFO-DIR-ENTRY
+@dircategory Emacs
+@direntry
 * Semantic: (semantic).      Source code parser library and utilities.
-END-INFO-DIR-ENTRY
-@end format
-@end ifinfo
+@end direntry
 
 @titlepage
 @center @titlefont{Semantic}
--- a/lisp/ChangeLog	Mon Feb 01 14:09:07 2010 +0100
+++ b/lisp/ChangeLog	Wed Feb 10 08:47:34 2010 +0100
@@ -1,3 +1,204 @@
+2010-02-10  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* term/xterm.el (xterm-maybe-set-dark-background-mode): Remove
+	dead code.  (Bug#5546)
+
+2010-02-09  Chong Yidong  <cyd@stupidchicken.com>
+
+	* eshell/em-ls.el (eshell-ls-applicable): Frob file attributes
+	correctly (Bug#5548).
+
+2010-02-08  Jose E. Marchesi  <jemarch@gnu.org>
+
+	* progmodes/ada-mode.el (ada-in-numeric-literal-p): New function.
+	(ada-adjust-case): Don't adjust case in hexadecimal number
+	literals.
+
+2010-02-08  Kenichi Handa  <handa@m17n.org>
+
+	* international/mule-util.el (with-coding-priority): Add autoload
+	cookie for putting `lisp-indent-funciton'.
+
+2010-02-07  Glenn Morris  <rgm@gnu.org>
+
+	* progmodes/f90.el (f90-font-lock-keywords-1, f90-font-lock-keywords-2):
+	Move F2003 named interfaces from keywords-2 to keywords-1, and
+	use function-name-face rather than constant-face.
+	Simplify "abstract interface" regexp.
+
+2010-02-07  Chong Yidong  <cyd@stupidchicken.com>
+
+	* eshell/esh-util.el (eshell-file-attributes): New optional arg
+	ID-FORMAT.  Pass it to `file-attributes'.
+
+	* eshell/em-ls.el (eshell-do-ls): Use it (Bug#5528).
+
+2010-02-07  sj  <prime.wizard+emacs@gmail.com>  (tiny change)
+
+	* faces.el (set-face-attribute): Allow calling
+	internal-set-lisp-face-attribute with 'unspecified family and
+	foundry argument (Bug#5536).
+
+2010-02-07  Glenn Morris  <rgm@gnu.org>
+
+	* progmodes/f90.el (f90-font-lock-keywords-2)
+	(f90-looking-at-type-like, f90-looking-at-program-block-end):
+	Handle F2003 named interfaces.
+
+2010-02-06  Chong Yidong  <cyd@stupidchicken.com>
+
+	* progmodes/cc-mode.el (c-common-init): Bind temporary variables
+	beg and end before calling c-get-state-before-change-functions.
+
+2010-02-06  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* vc-bzr.el (vc-bzr-dir-extra-headers): Disable the pending merges header.
+
+2010-02-05  Juri Linkov  <juri@jurta.org>
+
+	* doc-view.el (doc-view-mode):
+	* image-mode.el (image-mode): Put property mode-class=special.
+	(Bug#4896)
+
+2010-02-05  Mark A. Hershberger  <mah@everybody.org>
+
+	* vc-svn.el (vc-svn-revision-table): New function.
+
+2010-02-05  Michael Albinus  <michael.albinus@gmx.de>
+
+	* net/ange-ftp.el (ange-ftp-insert-directory):
+	* net/tramp-imap.el (tramp-imap-handle-insert-directory):
+	* net/tramp-smb.el (tramp-smb-handle-insert-directory):
+	Handle also directories.  (Bug#5478)
+
+2010-02-05  Glenn Morris  <rgm@gnu.org>
+
+	* progmodes/f90.el (f90-font-lock-keywords-2): Fix `enum'.
+
+2010-02-05  Chong Yidong  <cyd@stupidchicken.com>
+
+	* startup.el (command-line-1): Convert options beginning with a
+	single dash as well (Bug#5519).
+
+2010-02-05  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	Make `initials' completion work for /hh -> /home/horn again (bug#5524).
+	* minibuffer.el (completion-initials-expand): Only check the presence
+	of delims *within* the boundaries, since otherwise the / delim is
+	always found for files.
+
+	Fix up various corner case problems.
+	* doc-view.el (doc-view-last-page-number): New function.
+	(doc-view-mode, doc-view-last-page, doc-view-goto-page): Use it.
+	(doc-view-goto-page): Avoid inf-loops when the conversion fails.
+	(doc-view-kill-proc): Avoid inf-loop in freak cases.
+	(doc-view-reconvert-doc): Use the new recursive delete-directory.
+	(doc-view-convert-current-doc): Don't create the resolution.el file
+	here any more.
+	(doc-view-pdf/ps->png): Do it here instead.
+	(doc-view-already-converted-p): Check that resolution.el is present.
+	(doc-view-pdf->png): Don't rely on doc-view-pdf/ps->png for the few
+	windows that are not yet showing images.
+
+2010-02-04  Alan Mackenzie  <acm@muc.de>
+
+	Change strategy for marking < and > as template delimiters: mark
+	them strictly in matching pairs.
+
+	* cc-mode.el (c-before-change):
+	Use c-get-state-before-change-functions.
+	(c-common-init): Adapt to use
+	c-get-state-before-change-functions (note plural).
+
+	* cc-langs.el (c-no-parens-syntax-table): New syntax table, used
+	for searching syntactically for matching <s and >s.
+	(c-get-state-before-change-functions): New language variable (note
+	the plural) which supersedes c-get-state-before-change-function.
+
+	* cc-engine.el (c-clear-<-pair-props, c-clear->-pair-props)
+	(c-clear-<>-pair-props, c-clear-<-pair-props-if-match-after)
+	(c-clear->-pair-props-if-match-before)
+	(c-before-change-check-<>-operators): New functions.
+	(c-after-change-check-<>-operators): Use macro
+	c-unmark-<->-as-paren.
+
+	* cc-defs.el (c-search-backward-char-property): New macro.
+
+	* cc-cmds.el (c-electric-lt-gt): Do not set text properties on <
+	and > any more.  (These will be handled by font locking.)
+
+2010-02-04  Michael Albinus  <michael.albinus@gmx.de>
+
+	* dired.el (dired-revert): If DIRED-DIRECTORY is a cons cell, call
+	`dired-uncache' for every elemnt which is an absolute file name.
+
+	* net/tramp.el (tramp-handle-dired-uncache): When DIR is not a
+	directory, handle its directory component.
+	(tramp-handle-file-remote-p): Let-bind `tramp-verbose' to 3; this
+	function is called permanently and creates noise, otherwise.
+
+	* net/tramp-imap.el (tramp-imap-handle-insert-directory):
+	* net/tramp-smb.el (tramp-smb-handle-insert-directory):
+	Handle the case, FILENAME is not in `default-directory'.  (Bug#5478)
+
+2010-02-04  David Burger  <dburger@google.com>  (tiny change)
+
+	* macros.el (apply-macro-to-region-lines):
+	Minor simplification.  (Bug#5485)
+
+2010-02-04  Glenn Morris  <rgm@gnu.org>
+
+	* mail/rmail.el (rmail-show-message-1): Handle malformed
+	quoted-printable text.  (Bug#5441)
+
+	* mail/mail-utils.el (mail-unquote-printable-region): Doc fix.
+
+	* simple.el (visual-line-mode): Capitalize lighter.
+
+2010-02-03  John Wiegley  <jwiegley@gmail.com>
+
+	* iswitchb.el (iswitchb-completions): Add bookmark files to the
+	list of files considered for "virtual buffer" completions.
+
+2010-02-03  Michael Albinus  <michael.albinus@gmx.de>
+
+	* net/ange-ftp.el (ange-ftp-insert-directory): Parse directory
+	also in case of (and (not full) (not wildcard)). This is needed,
+	when dired is called with a list of files, which are not in
+	`default-directory'.  (Bug#5478)
+
+2010-02-03  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* vc-hooks.el (vc-path): Make it an obsolete var, rather than function.
+
+2010-02-02  Juri Linkov  <juri@jurta.org>
+
+	* textmodes/ispell.el (ispell-message-text-end): Remove final newline
+	from unidiff to allow function-line after @@.
+
+2010-02-02  Juri Linkov  <juri@jurta.org>
+
+	* ediff-util.el (ediff-file-checked-in-p): Replace '(nil CVS) by
+	'(RCS SCCS) with inverted condition.
+
+2010-02-02  Michael Albinus  <michael.albinus@gmx.de>
+
+	* net/ange-ftp.el (ange-ftp-skip-msgs): Ignore all ""^500 .*AUTH"
+	messages.
+
+2010-02-01  Juri Linkov  <juri@jurta.org>
+
+	* arc-mode.el (archive-zip-extract): Use `member-ignore-case' to
+	compare with "pkunzip" and "pkzip" instead of only "pkzip".
+	In the `archive-extract-by-stdout' branch use `shell-quote-argument'
+	only when (car archive-zip-extract) is "unzip".  (Bug#5475)
+
+2010-02-01  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* doc-view.el (doc-view-new-window-function): Be a bit more defensive.
+	(doc-view-revert-buffer): New command.
+	(doc-view-mode-map): Use it.
+
 2010-02-01  Dan Nicolaescu  <dann@ics.uci.edu>
 
 	* vc-bzr.el (vc-bzr-dir-extra-headers): Add a header when a
--- a/lisp/arc-mode.el	Mon Feb 01 14:09:07 2010 +0100
+++ b/lisp/arc-mode.el	Wed Feb 10 08:47:34 2010 +0100
@@ -1782,12 +1782,16 @@
     (apply 'vector (nreverse files))))
 
 (defun archive-zip-extract (archive name)
-  (if (equal (car archive-zip-extract) "pkzip")
+  (if (member-ignore-case (car archive-zip-extract) '("pkunzip" "pkzip"))
       (archive-*-extract 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)))
+    (archive-extract-by-stdout
+     archive
+     ;; unzip expands wildcards in NAME, so we need to quote it.
+     ;; FIXME: Does pkunzip need similar treatment?
+     (if (equal (car archive-zip-extract) "unzip")
+	 (shell-quote-argument name)
+       name)
+     archive-zip-extract)))
 
 (defun archive-zip-write-file-member (archive descr)
   (archive-*-write-file-member
--- a/lisp/dired.el	Mon Feb 01 14:09:07 2010 +0100
+++ b/lisp/dired.el	Wed Feb 10 08:47:34 2010 +0100
@@ -1144,8 +1144,12 @@
     (setq mark-alist;; only after dired-remember-hidden since this unhides:
 	  (dired-remember-marks (point-min) (point-max)))
     ;; treat top level dir extra (it may contain wildcards)
-    (dired-uncache
-     (if (consp dired-directory) (car dired-directory) dired-directory))
+    (if (not (consp dired-directory))
+	(dired-uncache dired-directory)
+      (dired-uncache (car dired-directory))
+      (dolist (dir (cdr dired-directory))
+	(if (file-name-absolute-p dir)
+	    (dired-uncache dir))))
     ;; Run dired-after-readin-hook just once, below.
     (let ((dired-after-readin-hook nil))
       (dired-readin)
--- a/lisp/doc-view.el	Mon Feb 01 14:09:07 2010 +0100
+++ b/lisp/doc-view.el	Wed Feb 10 08:47:34 2010 +0100
@@ -235,8 +235,15 @@
 
 (defun doc-view-new-window-function (winprops)
   (let ((ol (image-mode-window-get 'overlay winprops)))
+    (when (and ol (not (overlay-buffer ol)))
+      ;; I've seen `ol' be a dead overlay.  I do not yet know how this
+      ;; happened, so maybe the bug is elsewhere, but in the mean time,
+      ;; this seems like a safe approach.
+      (setq ol nil))
     (if ol
-        (setq ol (copy-overlay ol))
+        (progn
+          (assert (eq (overlay-buffer ol) (current-buffer)))
+          (setq ol (copy-overlay ol)))
       (assert (not (get-char-property (point-min) 'display)))
       (setq ol (make-overlay (point-min) (point-max) nil t))
       (overlay-put ol 'doc-view t))
@@ -323,12 +330,21 @@
     (define-key map (kbd "C-c C-c")   'doc-view-toggle-display)
     ;; Open a new buffer with doc's text contents
     (define-key map (kbd "C-c C-t")   'doc-view-open-text)
-    ;; Reconvert the current document
-    (define-key map (kbd "g")         'revert-buffer)
-    (define-key map (kbd "r")         'revert-buffer)
+    ;; Reconvert the current document.  Don't just use revert-buffer
+    ;; because that resets the scale factor, the page number, ...
+    (define-key map (kbd "g")         'doc-view-revert-buffer)
+    (define-key map (kbd "r")         'doc-view-revert-buffer)
     map)
   "Keymap used by `doc-view-mode' when displaying a doc as a set of images.")
 
+(defun doc-view-revert-buffer (&optional ignore-auto noconfirm)
+  "Like `revert-buffer', but preserves the buffer's current modes."
+  ;; FIXME: this should probably be moved to files.el and used for
+  ;; most/all "g" bindings to revert-buffer.
+  (interactive (list (not current-prefix-arg)))
+  (revert-buffer ignore-auto noconfirm 'preserve-modes))
+
+
 (easy-menu-define doc-view-menu doc-view-mode-map
   "Menu for Doc View mode."
   '("DocView"
@@ -367,10 +383,13 @@
 (defmacro doc-view-current-image () `(image-mode-window-get 'image))
 (defmacro doc-view-current-slice () `(image-mode-window-get 'slice))
 
+(defun doc-view-last-page-number ()
+  (length doc-view-current-files))
+
 (defun doc-view-goto-page (page)
   "View the page given by PAGE."
   (interactive "nPage: ")
-  (let ((len (length doc-view-current-files))
+  (let ((len (doc-view-last-page-number))
 	(hscroll (window-hscroll)))
     (if (< page 1)
 	(setq page 1)
@@ -410,12 +429,15 @@
         ;; The PNG file hasn't been generated yet.
         (doc-view-pdf->png-1 doc-view-buffer-file-name file page
                              (lexical-let ((page page)
-                                           (win (selected-window)))
+                                           (win (selected-window))
+                                           (file file))
                                (lambda ()
                                  (and (eq (current-buffer) (window-buffer win))
                                       ;; If we changed page in the mean
                                       ;; time, don't mess things up.
                                       (eq (doc-view-current-page win) page)
+                                      ;; Make sure we don't infloop.
+                                      (file-readable-p file)
                                       (with-selected-window win
                                         (doc-view-goto-page page))))))))
     (overlay-put (doc-view-current-overlay)
@@ -439,7 +461,7 @@
 (defun doc-view-last-page ()
   "View the last page."
   (interactive)
-  (doc-view-goto-page (length doc-view-current-files)))
+  (doc-view-goto-page (doc-view-last-page-number)))
 
 (defun doc-view-scroll-up-or-next-page (&optional arg)
   "Scroll page up ARG lines if possible, else goto next page.
@@ -512,7 +534,7 @@
 (defun doc-view-kill-proc ()
   "Kill the current converter process(es)."
   (interactive)
-  (while doc-view-current-converter-processes
+  (while (consp doc-view-current-converter-processes)
     (ignore-errors ;; Maybe it's dead already?
       (kill-process (pop doc-view-current-converter-processes))))
   (when doc-view-current-timer
@@ -622,7 +644,7 @@
   (doc-view-kill-proc)
   ;; Clear the old cached files
   (when (file-exists-p (doc-view-current-cache-dir))
-    (dired-delete-file (doc-view-current-cache-dir) 'always))
+    (delete-directory (doc-view-current-cache-dir) 'recursive))
   (doc-view-initiate-display))
 
 (defun doc-view-sentinel (proc event)
@@ -678,11 +700,18 @@
            (list (format "-r%d" (round doc-view-resolution))
                  (concat "-sOutputFile=" png)
                  pdf-ps))
-   (lambda ()
-     (when doc-view-current-timer
-       (cancel-timer doc-view-current-timer)
-       (setq doc-view-current-timer nil))
-     (doc-view-display (current-buffer) 'force)))
+   (lexical-let ((resolution doc-view-resolution))
+     (lambda ()
+       ;; Only create the resolution file when it's all done, so it also
+       ;; serves as a witness that the conversion is complete.
+       (write-region (prin1-to-string resolution) nil
+                     (expand-file-name "resolution.el"
+                                       (doc-view-current-cache-dir))
+                     nil 'silently)
+       (when doc-view-current-timer
+         (cancel-timer doc-view-current-timer)
+         (setq doc-view-current-timer nil))
+       (doc-view-display (current-buffer) 'force))))
   ;; Update the displayed pages as soon as they're done generating.
   (when doc-view-conversion-refresh-interval
     (setq doc-view-current-timer
@@ -724,6 +753,13 @@
              (doc-view-pdf->png pdf png rest)
            ;; Yippie, the important pages are done, update the display.
            (clear-image-cache)
+           ;; For the windows that have a message (like "Welcome to
+           ;; DocView") display property, clearing the image cache is
+           ;; not sufficient.
+           (dolist (win (get-buffer-window-list (current-buffer) nil 'visible))
+             (with-selected-window win
+               (when (stringp (get-char-property (point-min) 'display))
+                 (doc-view-goto-page (doc-view-current-page)))))
            ;; Convert the rest of the pages.
            (doc-view-pdf/ps->png pdf png)))))))
 
@@ -790,18 +826,8 @@
   ;; resets during the redisplay).
   (setq doc-view-pending-cache-flush t)
   (let ((png-file (expand-file-name "page-%d.png"
-                                    (doc-view-current-cache-dir)))
-	(res-file (expand-file-name "resolution.el"
                                     (doc-view-current-cache-dir))))
     (make-directory (doc-view-current-cache-dir) t)
-    ;; Save the used resolution so that it can be restored when
-    ;; reading the cached files.
-    (let ((res doc-view-resolution))
-      (with-temp-buffer
-	(princ res (current-buffer))
-        ;; Don't use write-file, so as to avoid prompts for `require-newline',
-        ;; or for pre-existing buffers with the same name, ...
-	(write-region nil nil res-file nil 'silently)))
     (case doc-view-doc-type
       (dvi
        ;; DVI files have to be converted to PDF before Ghostscript can process
@@ -811,10 +837,10 @@
             (png-file png-file))
          (doc-view-dvi->pdf doc-view-buffer-file-name pdf
                             (lambda () (doc-view-pdf/ps->png pdf png-file)))))
-     (pdf
-      (let ((pages (doc-view-active-pages)))
-        ;; Convert PDF to PNG images starting with the active pages.
-        (doc-view-pdf->png doc-view-buffer-file-name png-file pages)))
+      (pdf
+       (let ((pages (doc-view-active-pages)))
+         ;; Convert PDF to PNG images starting with the active pages.
+         (doc-view-pdf->png doc-view-buffer-file-name png-file pages)))
       (t
        ;; Convert to PNG images.
        (doc-view-pdf/ps->png doc-view-buffer-file-name png-file)))))
@@ -1108,12 +1134,18 @@
 
 ;;;; User interface commands and the mode
 
-;; (put 'doc-view-mode 'mode-class 'special)
+(put 'doc-view-mode 'mode-class 'special)
 
 (defun doc-view-already-converted-p ()
   "Return non-nil if the current doc was already converted."
   (and (file-exists-p (doc-view-current-cache-dir))
-       (> (length (directory-files (doc-view-current-cache-dir) nil "\\.png$")) 0)))
+       ;; Check that the resolution info is there, otherwise it means
+       ;; the conversion is incomplete.
+       (file-readable-p (expand-file-name "resolution.el"
+                                          (doc-view-current-cache-dir)))
+       (> (length (directory-files (doc-view-current-cache-dir)
+                                   nil "\\.png\\'"))
+          0)))
 
 (defun doc-view-initiate-display ()
   ;; Switch to image display if possible
@@ -1125,14 +1157,14 @@
 	    (progn
 	      (message "DocView: using cached files!")
 	      ;; Load the saved resolution
-	      (let ((res-file (expand-file-name "resolution.el"
-						(doc-view-current-cache-dir)))
-		    (res doc-view-resolution))
-		(with-temp-buffer
-		  (when (file-exists-p res-file)
-		    (insert-file-contents res-file)
-		    (setq res (read (current-buffer)))))
-		(when (numberp res)
+	      (let* ((res-file (expand-file-name "resolution.el"
+                                                 (doc-view-current-cache-dir)))
+                     (res
+                      (with-temp-buffer
+                        (when (file-readable-p res-file)
+                          (insert-file-contents res-file)
+                          (read (current-buffer))))))
+                (when (numberp res)
 		  (set (make-local-variable 'doc-view-resolution) res)))
 	      (doc-view-display (current-buffer) 'force))
 	  (doc-view-convert-current-doc))
@@ -1266,7 +1298,7 @@
 
     (set (make-local-variable 'mode-line-position)
 	 '(" P" (:eval (number-to-string (doc-view-current-page)))
-	   "/" (:eval (number-to-string (length doc-view-current-files)))))
+	   "/" (:eval (number-to-string (doc-view-last-page-number)))))
     ;; Don't scroll unless the user specifically asked for it.
     (set (make-local-variable 'auto-hscroll-mode) nil)
     (set (make-local-variable 'mwheel-scroll-up-function)
--- a/lisp/ediff-util.el	Mon Feb 01 14:09:07 2010 +0100
+++ b/lisp/ediff-util.el	Wed Feb 10 08:47:34 2010 +0100
@@ -1126,8 +1126,8 @@
 
 (defun ediff-file-checked-in-p (file)
   (and (featurep 'vc-hooks)
-       ;; CVS files are considered not checked in
-       (not (memq (vc-backend file) '(nil CVS)))
+       ;; Only RCS and SCCS files are considered checked in
+       (memq (vc-backend file) '(RCS SCCS))
        (if (fboundp 'vc-state)
 	   (and
 	    (not (memq (vc-state file) '(edited needs-merge)))
--- a/lisp/erc/ChangeLog	Mon Feb 01 14:09:07 2010 +0100
+++ b/lisp/erc/ChangeLog	Wed Feb 10 08:47:34 2010 +0100
@@ -1,3 +1,7 @@
+2010-02-07  Vivek Dasmohapatra  <vivek@etla.org>
+
+	* erc-services.el (erc-nickserv-alist): Fix defcustom type (Bug#5520).
+
 2010-01-25  Vivek Dasmohapatra  <vivek@etla.org>
 
 	* erc-backend.el (erc-session-connector): New var.
--- a/lisp/erc/erc-services.el	Mon Feb 01 14:09:07 2010 +0100
+++ b/lisp/erc/erc-services.el	Wed Feb 10 08:47:34 2010 +0100
@@ -303,7 +303,11 @@
 		 (boolean :tag "Use current nick in identify message?")
 		 (choice :tag "Command to use (optional)"
 		  (string :tag "Command")
-		  (const :tag "No special command necessary" nil)))))
+		  (const :tag "No special command necessary" nil))
+		 (choice :tag "Detect Success"
+			 (regexp :tag "Pattern to match")
+			 (const :tag "Do not try to detect success" nil)))))
+
 
 (defsubst erc-nickserv-alist-sender (network &optional entry)
   (nth 1 (or entry (assoc network erc-nickserv-alist))))
--- a/lisp/eshell/em-ls.el	Mon Feb 01 14:09:07 2010 +0100
+++ b/lisp/eshell/em-ls.el	Wed Feb 10 08:47:34 2010 +0100
@@ -225,18 +225,28 @@
       (eq (aref (nth 8 attrs) 0) type)))
 
 (defmacro eshell-ls-applicable (attrs index func file)
-  "Test whether, for ATTRS, the user UID can do what corresponds to INDEX.
-This is really just for efficiency, to avoid having to stat the file
-yet again."
-  `(if (numberp (nth 2 ,attrs))
-       (if (= (user-uid) (nth 2 ,attrs))
-	   (not (eq (aref (nth 8 ,attrs) ,index) ?-))
-	 (,(eval func) ,file))
-     (not (eq (aref (nth 8 ,attrs)
-		    (+ ,index (if (member (nth 2 ,attrs)
-					  (eshell-current-ange-uids))
-				  0 6)))
-	      ?-))))
+  "Test whether, for ATTRS, the user can do what corresponds to INDEX.
+ATTRS is a string of file modes.  See `file-attributes'.
+If we cannot determine the answer using ATTRS (e.g., if we need
+to know what group the user is in), compute the return value by
+calling FUNC with FILE as an argument."
+  `(let ((owner (nth 2 ,attrs))
+	 (modes (nth 8 ,attrs)))
+     (cond ((cond ((numberp owner)
+		   (= owner (user-uid)))
+		  ((stringp owner)
+		   (or (string-equal owner (user-login-name))
+		       (member owner (eshell-current-ange-uids)))))
+	    ;; The user owns this file.
+	    (not (eq (aref modes ,index) ?-)))
+	   ((eq (aref modes (+ ,index 3))
+		(aref modes (+ ,index 6)))
+	    ;; If the "group" and "other" fields give identical
+	    ;; results, use that.
+	    (not (eq (aref modes (+ ,index 3)) ?-)))
+	   (t
+	    ;; Otherwise call FUNC.
+	    (,(eval func) ,file)))))
 
 (defcustom eshell-ls-highlight-alist nil
   "*This alist correlates test functions to color.
@@ -393,13 +403,13 @@
 	       (eshell-glob-regexp ignore-pattern))))
      ;; list the files!
      (eshell-ls-entries
-      (mapcar (function
-	       (lambda (arg)
-		 (cons (if (and (eshell-under-windows-p)
-				(file-name-absolute-p arg))
-			   (expand-file-name arg)
-			 arg)
-		       (eshell-file-attributes arg))))
+      (mapcar (lambda (arg)
+		(cons (if (and (eshell-under-windows-p)
+			       (file-name-absolute-p arg))
+			  (expand-file-name arg)
+			arg)
+		      (eshell-file-attributes
+		       arg (if numeric-uid-gid 'integer 'string))))
 	      args)
       t (expand-file-name default-directory)))
    (funcall flush-func)))
@@ -710,7 +720,7 @@
 	    (funcall insert-func need-return "\n"))))))
 
 (defun eshell-ls-entries (entries &optional separate root-dir)
-  "Output PATH's directory ENTRIES, formatted according to OPTIONS.
+  "Output PATH's directory ENTRIES.
 Each member of ENTRIES may either be a string or a cons cell, the car
 of which is the file name, and the cdr of which is the list of
 attributes.
--- a/lisp/eshell/esh-util.el	Mon Feb 01 14:09:07 2010 +0100
+++ b/lisp/eshell/esh-util.el	Wed Feb 10 08:47:34 2010 +0100
@@ -701,8 +701,11 @@
 	(forward-line)))
     entry))
 
-(defun eshell-file-attributes (file)
-  "Return the attributes of FILE, playing tricks if it's over ange-ftp."
+(defun eshell-file-attributes (file &optional id-format)
+  "Return the attributes of FILE, playing tricks if it's over ange-ftp.
+The optional argument ID-FORMAT specifies the preferred uid and
+gid format.  Valid values are 'string and 'integer, defaulting to
+'integer.  See `file-attributes'."
   (let* ((file (expand-file-name file))
 	 entry)
     (if (string-equal (file-remote-p file 'method) "ftp")
@@ -723,7 +726,7 @@
 		      (setq entry (cdr fentry))
 		    (setq entry nil)))))
 	  entry)
-      (file-attributes file))))
+      (file-attributes file id-format))))
 
 (defalias 'eshell-copy-tree 'copy-tree)
 
--- a/lisp/faces.el	Mon Feb 01 14:09:07 2010 +0100
+++ b/lisp/faces.el	Wed Feb 10 08:47:34 2010 +0100
@@ -735,10 +735,10 @@
 	(unless foundry
 	  (setq foundry (match-string 1 family)))
 	(setq family (match-string 2 family)))
-      (when (stringp family)
+      (when (or (stringp family) (eq family 'unspecified))
 	(internal-set-lisp-face-attribute face :family (purecopy family)
 					  where))
-      (when (stringp foundry)
+      (when (or (stringp foundry) (eq foundry 'unspecified))
 	(internal-set-lisp-face-attribute face :foundry (purecopy foundry)
 					  where)))
     (while args
--- a/lisp/image-mode.el	Mon Feb 01 14:09:07 2010 +0100
+++ b/lisp/image-mode.el	Wed Feb 10 08:47:34 2010 +0100
@@ -317,6 +317,8 @@
 
 (defvar bookmark-make-record-function)
 
+(put 'image-mode 'mode-class 'special)
+
 ;;;###autoload
 (defun image-mode ()
   "Major mode for image files.
--- a/lisp/international/mule-util.el	Mon Feb 01 14:09:07 2010 +0100
+++ b/lisp/international/mule-util.el	Wed Feb 10 08:47:34 2010 +0100
@@ -323,7 +323,7 @@
      (unwind-protect
 	 (progn ,@body)
        (apply #'set-coding-system-priority ,current)))))
-(put 'with-coding-priority 'lisp-indent-function 1)
+;;;###autoload(put 'with-coding-priority 'lisp-indent-function 1)
 (put 'with-coding-priority 'edebug-form-spec t)
 
 ;;;###autoload
--- a/lisp/iswitchb.el	Mon Feb 01 14:09:07 2010 +0100
+++ b/lisp/iswitchb.el	Wed Feb 10 08:47:34 2010 +0100
@@ -1274,7 +1274,7 @@
     ;; consult the list of past visited files, to see if we can find
     ;; the file which the user might thought was still open.
     (when (and iswitchb-use-virtual-buffers (null comps)
-	       recentf-list)
+	       (or recentf-list bookmark-alist))
       (setq iswitchb-virtual-buffers nil)
       (let ((head recentf-list) name)
 	(while head
@@ -1289,15 +1289,30 @@
 	      (setq iswitchb-virtual-buffers
 		    (cons (cons name (car head))
 			  iswitchb-virtual-buffers)))
-	  (setq head (cdr head)))
-	(setq iswitchb-virtual-buffers (nreverse iswitchb-virtual-buffers)
-	      comps (mapcar 'car iswitchb-virtual-buffers))
+	  (setq head (cdr head))))
+      (let ((head bookmark-alist) name path)
+	(while head
+	  (if (and (setq path (cdr (assq 'filename (cdar head))))
+		   (setq name (file-name-nondirectory path))
+		   (string-match (if iswitchb-regexp
+				     iswitchb-text
+				   (regexp-quote iswitchb-text)) name)
+		   (null (get-file-buffer path))
+		   (not (assoc name iswitchb-virtual-buffers))
+		   (not (iswitchb-ignore-buffername-p name))
+		   (file-exists-p path))
+	      (setq iswitchb-virtual-buffers
+		    (cons (cons name path)
+			  iswitchb-virtual-buffers)))
+	  (setq head (cdr head))))
+      (setq iswitchb-virtual-buffers (nreverse iswitchb-virtual-buffers)
+	    comps (mapcar 'car iswitchb-virtual-buffers))
 	(let ((comp comps))
 	  (while comp
 	    (put-text-property 0 (length (car comp))
 			       'face 'iswitchb-virtual-matches
 			       (car comp))
-	    (setq comp (cdr comp))))))
+	    (setq comp (cdr comp)))))
 
     (cond ((null comps) (format " %sNo match%s"
 				open-bracket-determined
--- a/lisp/macros.el	Mon Feb 01 14:09:07 2010 +0100
+++ b/lisp/macros.el	Wed Feb 10 08:47:34 2010 +0100
@@ -273,7 +273,7 @@
 	  (set-marker next-line-marker (point)))
 	(save-excursion
 	  (let ((mark-active nil))
-	    (execute-kbd-macro (or macro last-kbd-macro)))))
+	    (execute-kbd-macro macro))))
       (set-marker end-marker nil)
       (set-marker next-line-marker nil))))
 
--- a/lisp/mail/mail-utils.el	Mon Feb 01 14:09:07 2010 +0100
+++ b/lisp/mail/mail-utils.el	Wed Feb 10 08:47:34 2010 +0100
@@ -123,13 +123,16 @@
 	(setq i (match-end 0)))
       (apply 'concat (nreverse (cons (substring string i) strings))))))
 
+;; FIXME Gnus for some reason has `quoted-printable-decode-region' in qp.el.
 ;;;###autoload
 (defun mail-unquote-printable-region (beg end &optional wrapper noerror
 					  unibyte)
   "Undo the \"quoted printable\" encoding in buffer from BEG to END.
 If the optional argument WRAPPER is non-nil,
 we expect to find and remove the wrapper characters =?ISO-8859-1?Q?....?=.
-If NOERROR is non-nil, return t if successful.
+On encountering malformed quoted-printable text, exits with an error,
+unless NOERROR is non-nil, in which case it continues, and returns nil
+when finished.  Returns non-nil on successful completion.
 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."
@@ -246,6 +249,10 @@
   "Prune addresses from DESTINATIONS, a list of recipient addresses.
 All addresses matching `rmail-dont-reply-to-names' are removed from
 the comma-separated list.  The pruned list is returned."
+  ;; FIXME this (setting a user option the first time a command is used)
+  ;; is somewhat strange.  Normally one would never set the option,
+  ;; but instead fall back to the default so long as it was nil.
+  ;; Or just set the default directly in the defcustom.
   (if (null rmail-dont-reply-to-names)
       (setq rmail-dont-reply-to-names
 	    (concat (if rmail-default-dont-reply-to-names
--- a/lisp/mail/rmail.el	Mon Feb 01 14:09:07 2010 +0100
+++ b/lisp/mail/rmail.el	Wed Feb 10 08:47:34 2010 +0100
@@ -2727,8 +2727,10 @@
 	    (insert-buffer-substring mbox-buf body-start end)
 	    (cond
 	     ((string= character-coding "quoted-printable")
-	      (mail-unquote-printable-region (point-min) (point-max)
-                                             nil nil 'unibyte))
+	      ;; See bug#5441.
+	      (or (mail-unquote-printable-region (point-min) (point-max)
+						 nil t 'unibyte)
+		  (message "Malformed MIME quoted-printable message")))
 	     ((and (string= character-coding "base64") is-text-message)
 	      (base64-decode-region (point-min) (point-max)))
 	     ((eq character-coding 'uuencode)
--- a/lisp/minibuffer.el	Mon Feb 01 14:09:07 2010 +0100
+++ b/lisp/minibuffer.el	Wed Feb 10 08:47:34 2010 +0100
@@ -2063,9 +2063,12 @@
 ;; Complete /ums to /usr/monnier/src or lch to list-command-history.
 
 (defun completion-initials-expand (str table pred)
-  (unless (or (zerop (length str))
-              (string-match completion-pcm--delim-wild-regex str))
-    (let ((bounds (completion-boundaries str table pred "")))
+  (let ((bounds (completion-boundaries str table pred "")))
+    (unless (or (zerop (length str))
+                ;; Only check within the boundaries, since the
+                ;; boundary char (e.g. /) might be in delim-regexp.
+                (string-match completion-pcm--delim-wild-regex str
+                              (car bounds)))
       (if (zerop (car bounds))
           (mapconcat 'string str "-")
         ;; If there's a boundary, it's trickier.  The main use-case
--- a/lisp/net/ange-ftp.el	Mon Feb 01 14:09:07 2010 +0100
+++ b/lisp/net/ange-ftp.el	Wed Feb 10 08:47:34 2010 +0100
@@ -720,7 +720,7 @@
 	  "^Connected \\|^$\\|^Remote system\\|^Using\\|^ \\|Password:\\|"
 	  "^Data connection \\|"
 	  "^local:\\|^Trying\\|^125 \\|^550-\\|^221 .*oodbye\\|"
-          "^500 .*AUTH \\(KERBEROS\\|GSSAPI\\)\\|^KERBEROS\\|"
+          "^500 .*AUTH\\|^KERBEROS\\|"
 	  "^530 Please login with USER and PASS\\|" ; non kerberised vsFTPd
 	  "^534 Kerberos Authentication not enabled\\|"
 	  "^22[789] .*[Pp]assive\\|^200 EPRT\\|^500 .*EPRT")
@@ -4533,9 +4533,10 @@
        (when (string-match "-?d\\'" switches)
          ;; Remove "d" which dired added to `switches'.
          (setq switches (substring switches 0 (match-beginning 0))))
+       (setq file (directory-file-name file))
        (let* ((dirlist (ange-ftp-ls (or (file-name-directory file) ".")
-                                    switches nil))
-              (filename (file-name-nondirectory (directory-file-name file)))
+                                    switches 'parse))
+              (filename (file-name-nondirectory file))
               (case-fold-search nil))
          ;; FIXME: This presumes a particular output format, which is
          ;; basically Unix.
--- a/lisp/net/tramp-imap.el	Mon Feb 01 14:09:07 2010 +0100
+++ b/lisp/net/tramp-imap.el	Wed Feb 10 08:47:34 2010 +0100
@@ -395,9 +395,10 @@
   (filename switches &optional wildcard full-directory-p)
   "Like `insert-directory' for Tramp files."
   (setq filename (expand-file-name filename))
-  (when full-directory-p
-    ;; Called from `dired-add-entry'.
-    (setq filename (file-name-as-directory filename)))
+  (if full-directory-p
+      ;; Called from `dired-add-entry'.
+      (setq filename (file-name-as-directory filename))
+    (setq filename (directory-file-name filename)))
   (with-parsed-tramp-file-name filename nil
     (save-match-data
       (let ((base (file-name-nondirectory localname))
@@ -472,14 +473,19 @@
 		(nth 6 x)))) ; date
 	     ;; For the file name, we set the `dired-filename'
 	     ;; property.  This allows to handle file names with
-	     ;; leading or trailing spaces as well.
+	     ;; leading or trailing spaces as well.  The inserted name
+	     ;; could be from somewhere else, so we use the relative
+	     ;; file name of `default-directory'.
 	     (let ((pos (point)))
-	       (insert (format "%s" (nth 0 x))) ; file name
-	       (put-text-property pos (point) 'dired-filename t))
-	     (insert "\n")
+	       (insert
+		(format
+		 "%s\n"
+		 (file-relative-name
+		  (expand-file-name (nth 0 x) (file-name-directory filename)))))
+	       (put-text-property pos (1- (point)) 'dired-filename t))
 	     (forward-line)
 	     (beginning-of-line)))
-	   entries)))))
+	 entries)))))
 
 (defun tramp-imap-handle-insert-file-contents
   (filename &optional visit beg end replace)
--- a/lisp/net/tramp-smb.el	Mon Feb 01 14:09:07 2010 +0100
+++ b/lisp/net/tramp-smb.el	Wed Feb 10 08:47:34 2010 +0100
@@ -651,9 +651,10 @@
   (filename switches &optional wildcard full-directory-p)
   "Like `insert-directory' for Tramp files."
   (setq filename (expand-file-name filename))
-  (when full-directory-p
-    ;; Called from `dired-add-entry'.
-    (setq filename (file-name-as-directory filename)))
+  (if full-directory-p
+      ;; Called from `dired-add-entry'.
+      (setq filename (file-name-as-directory filename))
+    (setq filename (directory-file-name filename)))
   (with-parsed-tramp-file-name filename nil
     (save-match-data
       (let ((base (file-name-nondirectory filename))
@@ -715,8 +716,7 @@
 	     (let ((attr
 		    (when (tramp-smb-get-stat-capability v)
 		      (ignore-errors
-			(file-attributes
-			 (expand-file-name (nth 0 x)) 'string)))))
+			(file-attributes filename 'string)))))
 	       (insert
 		(format
 		 "%10s %3d %-8s %-8s %8s %s "
@@ -732,9 +732,16 @@
 		      "%b %e %R"
 		    "%b %e  %Y")
 		  (nth 3 x)))) ; date
-	       ;; We mark the filename.
+	       ;; We mark the file name.  The inserted name could be
+	       ;; from somewhere else, so we use the relative file
+	       ;; name of `default-directory'.
 	       (let ((start (point)))
-		 (insert (format "%s\n" (nth 0 x))) ; file name
+		 (insert
+		  (format
+		   "%s\n"
+		   (file-relative-name
+		    (expand-file-name
+		     (nth 0 x) (file-name-directory filename)))))
 		 (put-text-property start (1- (point)) 'dired-filename t))
 	       (forward-line)
 	       (beginning-of-line))))
--- a/lisp/net/tramp.el	Mon Feb 01 14:09:07 2010 +0100
+++ b/lisp/net/tramp.el	Wed Feb 10 08:47:34 2010 +0100
@@ -4035,9 +4035,11 @@
 			(concat file ".z"))
 		       (t nil)))))))))
 
-(defun tramp-handle-dired-uncache (dir)
+(defun tramp-handle-dired-uncache (dir &optional dir-p)
   "Like `dired-uncache' for Tramp files."
-  (with-parsed-tramp-file-name dir nil
+  ;; DIR-P is valid for XEmacs only.
+  (with-parsed-tramp-file-name
+      (if (or dir-p (file-directory-p dir)) dir (file-name-directory dir)) nil
     (tramp-flush-file-property v localname)))
 
 ;; Pacify byte-compiler.  The function is needed on XEmacs only.  I'm
@@ -4663,20 +4665,21 @@
 
 (defun tramp-handle-file-remote-p (filename &optional identification connected)
   "Like `file-remote-p' for Tramp files."
-  (when (tramp-tramp-file-p filename)
-    (let* ((v (tramp-dissect-file-name filename))
-	   (p (tramp-get-connection-process v))
-	   (c (and p (processp p) (memq (process-status p) '(run open)))))
-      ;; We expand the file name only, if there is already a connection.
-      (with-parsed-tramp-file-name
-	  (if c (expand-file-name filename) filename) nil
-	(and (or (not connected) c)
-	     (cond
-	      ((eq identification 'method) method)
-	      ((eq identification 'user) user)
-	      ((eq identification 'host) host)
-	      ((eq identification 'localname) localname)
-	      (t (tramp-make-tramp-file-name method user host ""))))))))
+  (let ((tramp-verbose 3))
+    (when (tramp-tramp-file-p filename)
+      (let* ((v (tramp-dissect-file-name filename))
+	     (p (tramp-get-connection-process v))
+	     (c (and p (processp p) (memq (process-status p) '(run open)))))
+	;; We expand the file name only, if there is already a connection.
+	(with-parsed-tramp-file-name
+	    (if c (expand-file-name filename) filename) nil
+	  (and (or (not connected) c)
+	       (cond
+		((eq identification 'method) method)
+		((eq identification 'user) user)
+		((eq identification 'host) host)
+		((eq identification 'localname) localname)
+		(t (tramp-make-tramp-file-name method user host "")))))))))
 
 (defun tramp-find-file-name-coding-system-alist (filename tmpname)
   "Like `find-operation-coding-system' for Tramp filenames.
--- a/lisp/progmodes/ada-mode.el	Mon Feb 01 14:09:07 2010 +0100
+++ b/lisp/progmodes/ada-mode.el	Wed Feb 10 08:47:34 2010 +0100
@@ -1017,6 +1017,9 @@
 			  (line-beginning-position) (point))))
   (or (ada-in-string-p parse-result) (ada-in-comment-p parse-result)))
 
+(defsubst ada-in-numeric-literal-p ()
+  "Return t if point is after a prefix of a numeric literal."
+  (looking-back "\\([0-9]+#[0-9a-fA-F_]+\\)"))
 
 ;;------------------------------------------------------------------
 ;; Contextual menus
@@ -1606,6 +1609,8 @@
 		 (eq (char-syntax (char-before)) ?w)
 		 ;;  if in a string or a comment
 		 (not (ada-in-string-or-comment-p))
+		 ;;  if in a numeric literal
+		 (not (ada-in-numeric-literal-p))
 		 )
 	    (if (save-excursion
 		  (forward-word -1)
--- a/lisp/progmodes/cc-cmds.el	Mon Feb 01 14:09:07 2010 +0100
+++ b/lisp/progmodes/cc-cmds.el	Wed Feb 10 08:47:34 2010 +0100
@@ -1086,104 +1086,76 @@
 
   (interactive "*P")
   (let ((c-echo-syntactic-information-p nil)
-	final-pos close-paren-inserted)
+	final-pos close-paren-inserted found-delim)
 
     (self-insert-command (prefix-numeric-value arg))
     (setq final-pos (point))
 
-    (c-save-buffer-state (c-parse-and-markup-<>-arglists
-			  c-restricted-<>-arglists
-			  <-pos)
-
-      (when c-recognize-<>-arglists
-	(if (eq last-command-event ?<)
-	    (when (and (progn
-			 (backward-char)
-			 (= (point)
-			    (progn
-			      (c-beginning-of-current-token)
-			      (point))))
-		       (progn
-			 (c-backward-token-2)
-			 (looking-at c-opt-<>-sexp-key)))
-	      (c-mark-<-as-paren (1- final-pos)))
-
-	  ;; It's a ">".  Check if there's an earlier "<" which either has
-	  ;; open paren syntax already or that can be recognized as an arglist
-	  ;; together with this ">".  Note that this won't work in cases like
-	  ;; "template <x, a < b, y>" but they ought to be rare.
-
-	  (save-restriction
-	    ;; Narrow to avoid that `c-forward-<>-arglist' below searches past
-	    ;; our position.
-	    (narrow-to-region (point-min) final-pos)
-
-	    (while (and
-		    (progn
-		      (goto-char final-pos)
-		      (c-syntactic-skip-backward "^<;}" nil t)
-		      (eq (char-before) ?<))
-		    (progn
-		      (backward-char)
-		      ;; If the "<" already got open paren syntax we know we
-		      ;; have the matching closer.  Handle it and exit the
-		      ;; loop.
-		      (if (looking-at "\\s\(")
-			  (progn
-			    (c-mark->-as-paren (1- final-pos))
-			    (setq close-paren-inserted t)
-			    nil)
-			t))
-
-		    (progn
-		      (setq <-pos (point))
-		      (c-backward-syntactic-ws)
-		      (c-simple-skip-symbol-backward))
-		    (or (looking-at c-opt-<>-sexp-key)
-			(not (looking-at c-keywords-regexp)))
-
-		    (let ((c-parse-and-markup-<>-arglists t)
-			  c-restricted-<>-arglists
-			  (containing-sexp
-			   (c-most-enclosing-brace (c-parse-state))))
-		      (when (and containing-sexp
-				 (progn (goto-char containing-sexp)
-					(eq (char-after) ?\())
-				 (not (eq (get-text-property (point) 'c-type)
-					  'c-decl-arg-start)))
-			(setq c-restricted-<>-arglists t))
-		      (goto-char <-pos)
-		      (c-forward-<>-arglist nil))
-
-		    ;; Loop here if the "<" we found above belongs to a nested
-		    ;; angle bracket sexp.  When we start over we'll find the
-		    ;; previous or surrounding sexp.
-		    (if (< (point) final-pos)
-			t
-		      (setq close-paren-inserted t)
-		      nil)))))))
-    (goto-char final-pos)
+;;;; 2010-01-31: There used to be code here to put a syntax-table text
+;;;; property on the new < or > and its mate (if any) when they are template
+;;;; parens.  This is now done in an after-change function.
 
     ;; Indent the line if appropriate.
-    (when (and c-electric-flag c-syntactic-indentation)
-      (backward-char)
-      (when (prog1 (or (looking-at "\\s\(\\|\\s\)")
-		       (and (c-major-mode-is 'c++-mode)
-			    (progn
-			      (c-beginning-of-current-token)
-			      (looking-at "<<\\|>>"))
-			    (= (match-end 0) final-pos)))
-	      (goto-char final-pos))
-	(indent-according-to-mode)))
-
-    (when (and close-paren-inserted
-	       (not executing-kbd-macro)
-	       blink-paren-function)
-      ;; Note: Most paren blink functions, such as the standard
-      ;; `blink-matching-open', currently doesn't handle paren chars
-      ;; marked with text properties very well.  Maybe we should avoid
-      ;; this call for the time being?
-      (funcall blink-paren-function))))
+    (when (and c-electric-flag c-syntactic-indentation c-recognize-<>-arglists)
+      (setq found-delim
+	    (if (eq last-command-event ?<)
+		;; If a <, basically see if it's got "template" before it .....
+		(or (and (progn
+			   (backward-char)
+			   (= (point)
+			      (progn (c-beginning-of-current-token) (point))))
+			 (progn
+			   (c-backward-token-2)
+			   (looking-at c-opt-<>-sexp-key)))
+		    ;; ..... or is a C++ << operator.
+		    (and (c-major-mode-is 'c++-mode)
+			 (progn
+			   (goto-char (1- final-pos))
+			   (c-beginning-of-current-token)
+			   (looking-at "<<"))
+			 (>= (match-end 0) final-pos)))
+
+	      ;; It's a >.  Either a C++ >> operator. ......
+	      (or (and (c-major-mode-is 'c++-mode)
+		       (progn
+			 (goto-char (1- final-pos))
+			 (c-beginning-of-current-token)
+			 (looking-at ">>"))
+		       (>= (match-end 0) final-pos))
+		  ;; ...., or search back for a < which isn't already marked as an
+		  ;; opening template delimiter.
+		  (save-restriction
+		    (widen)
+		    ;; Narrow to avoid `c-forward-<>-arglist' below searching past
+		    ;; our position.
+		    (narrow-to-region (point-min) final-pos)
+		    (goto-char final-pos)
+		    (while
+			(and
+			 (progn
+			   (c-syntactic-skip-backward "^<;}" nil t)
+			   (eq (char-before) ?<))
+			 (progn
+			   (backward-char)
+			   (looking-at "\\s\("))))
+		    (and (eq (char-after) ?<)
+			 (not (looking-at "\\s\("))
+			 (progn (c-backward-syntactic-ws)
+				(c-simple-skip-symbol-backward))
+			 (or (looking-at c-opt-<>-sexp-key)
+			     (not (looking-at c-keywords-regexp)))))))))
+
+    (goto-char final-pos)
+    (when found-delim
+      (indent-according-to-mode)
+      (when (and (eq (char-before) ?>)
+		 (not executing-kbd-macro)
+		 blink-paren-function)
+	    ;; Note: Most paren blink functions, such as the standard
+	    ;; `blink-matching-open', currently doesn't handle paren chars
+	    ;; marked with text properties very well.  Maybe we should avoid
+	    ;; this call for the time being?
+	    (funcall blink-paren-function)))))
 
 (defun c-electric-paren (arg)
   "Insert a parenthesis.
--- a/lisp/progmodes/cc-defs.el	Mon Feb 01 14:09:07 2010 +0100
+++ b/lisp/progmodes/cc-defs.el	Wed Feb 10 08:47:34 2010 +0100
@@ -1029,6 +1029,44 @@
     ;; Emacs.
     `(remove-text-properties ,from ,to '(,property nil))))
 
+(defmacro c-search-forward-char-property (property value &optional limit)
+  "Search forward for a text-property PROPERTY having value VALUE.
+LIMIT bounds the search.  The comparison is done with `equal'.
+
+Leave point just after the character, and set the match data on
+this character, and return point.  If VALUE isn't found, Return
+nil; point is then left undefined."
+  `(let ((place (point)))
+     (while
+	 (and
+	  (< place ,(or limit '(point-max)))
+	  (not (equal (get-text-property place ,property) ,value)))
+       (setq place (next-single-property-change
+		    place ,property nil ,(or limit '(point-max)))))
+     (when (< place ,(or limit '(point-max)))
+       (goto-char place)
+       (search-forward-regexp ".")	; to set the match-data.
+       (point))))
+
+(defmacro c-search-backward-char-property (property value &optional limit)
+  "Search backward for a text-property PROPERTY having value VALUE.
+LIMIT bounds the search.  The comparison is done with `equal'.
+
+Leave point just before the character, set the match data on this
+character, and return point.  If VALUE isn't found, Return nil;
+point is then left undefined."
+  `(let ((place (point)))
+     (while
+	 (and
+	  (> place ,(or limit '(point-min)))
+	  (not (equal (get-text-property (1- place) ,property) ,value)))
+       (setq place (previous-single-property-change
+		    place ,property nil ,(or limit '(point-min)))))
+     (when (> place ,(or limit '(point-max)))
+       (goto-char place)
+       (search-backward-regexp ".")	; to set the match-data.
+       (point))))
+
 (defun c-clear-char-property-with-value-function (from to property value)
   "Remove all text-properties PROPERTY from the region (FROM, TO)
 which have the value VALUE, as tested by `equal'.  These
--- a/lisp/progmodes/cc-engine.el	Mon Feb 01 14:09:07 2010 +0100
+++ b/lisp/progmodes/cc-engine.el	Wed Feb 10 08:47:34 2010 +0100
@@ -4880,7 +4880,168 @@
 	)))
 
 
-;; Handling of small scale constructs like types and names.
+;; Setting and removing syntax properties on < and > in languages (C++
+;; and Java) where they can be template/generic delimiters as well as
+;; their normal meaning of "less/greater than".
+
+;; Normally, < and > have syntax 'punctuation'.  When they are found to
+;; be delimiters, they are marked as such with the category properties
+;; c-<-as-paren-syntax, c->-as-paren-syntax respectively.
+
+;; STRATEGY:
+;;
+;; It is impossible to determine with certainty whether a <..> pair in
+;; C++ is two comparison operators or is template delimiters, unless
+;; one duplicates a lot of a C++ compiler.  For example, the following
+;; code fragment:
+;;
+;;     foo (a < b, c > d) ;
+;;
+;; could be a function call with two integer parameters (each a
+;; relational expression), or it could be a constructor for class foo
+;; taking one parameter d of templated type "a < b, c >".  They are
+;; somewhat easier to distinguish in Java.
+;;
+;; The strategy now (2010-01) adopted is to mark and unmark < and
+;; > IN MATCHING PAIRS ONLY.  [Previously, they were marked
+;; individually when their context so indicated.  This gave rise to
+;; intractible problems when one of a matching pair was deleted, or
+;; pulled into a literal.]
+;;
+;; At each buffer change, the syntax-table properties are removed in a
+;; before-change function and reapplied, when needed, in an
+;; after-change function.  It is far more important that the
+;; properties get removed when they they are spurious than that they
+;; be present when wanted.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(defun c-clear-<-pair-props (&optional pos)
+  ;; POS (default point) is at a < character.  If it is marked with
+  ;; open paren syntax-table text property, remove the property,
+  ;; together with the close paren property on the matching > (if
+  ;; any).
+  (save-excursion
+    (if pos
+	(goto-char pos)
+      (setq pos (point)))
+    (when (equal (c-get-char-property (point) 'syntax-table)
+		 c-<-as-paren-syntax)
+      (with-syntax-table c-no-parens-syntax-table ; ignore unbalanced [,{,(,..
+	(c-go-list-forward))
+      (when (equal (c-get-char-property (1- (point)) 'syntax-table)
+		   c->-as-paren-syntax) ; should always be true.
+	(c-clear-char-property (1- (point)) 'syntax-table))
+      (c-clear-char-property pos 'syntax-table))))
+
+(defun c-clear->-pair-props (&optional pos)
+  ;; POS (default point) is at a > character.  If it is marked with
+  ;; close paren syntax-table property, remove the property, together
+  ;; with the open paren property on the matching < (if any).
+  (save-excursion
+    (if pos
+	(goto-char pos)
+      (setq pos (point)))
+    (when (equal (c-get-char-property (point) 'syntax-table)
+		 c->-as-paren-syntax)
+      (with-syntax-table c-no-parens-syntax-table ; ignore unbalanced [,{,(,..
+	(c-go-up-list-backward))
+      (when (equal (c-get-char-property (point) 'syntax-table)
+			c-<-as-paren-syntax) ; should always be true.
+	(c-clear-char-property (point) 'syntax-table))
+      (c-clear-char-property pos 'syntax-table))))
+
+(defun c-clear-<>-pair-props (&optional pos)
+  ;; POS (default point) is at a < or > character.  If it has an
+  ;; open/close paren syntax-table property, remove this property both
+  ;; from the current character and its partner (which will also be
+  ;; thusly marked).
+  (cond
+   ((eq (char-after) ?\<)
+    (c-clear-<-pair-props pos))
+   ((eq (char-after) ?\>)
+    (c-clear->-pair-props pos))
+   (t (c-benign-error
+       "c-clear-<>-pair-props called from wrong position"))))
+
+(defun c-clear-<-pair-props-if-match-after (lim &optional pos)
+  ;; POS (default point) is at a < character.  If it is both marked
+  ;; with open/close paren syntax-table property, and has a matching >
+  ;; (also marked) which is after LIM, remove the property both from
+  ;; the current > and its partner.
+  (save-excursion
+    (if pos
+	(goto-char pos)
+      (setq pos (point)))
+    (when (equal (c-get-char-property (point) 'syntax-table)
+		 c-<-as-paren-syntax)
+      (with-syntax-table c-no-parens-syntax-table ; ignore unbalanced [,{,(,..
+	(c-go-list-forward))
+      (when (and (>= (point) lim)
+		 (equal (c-get-char-property (1- (point)) 'syntax-table)
+			c->-as-paren-syntax)) ; should always be true.
+	(c-unmark-<->-as-paren (1- (point)))
+	(c-unmark-<->-as-paren pos)))))
+
+(defun c-clear->-pair-props-if-match-before (lim &optional pos)
+  ;; POS (default point) is at a > character.  If it is both marked
+  ;; with open/close paren syntax-table property, and has a matching <
+  ;; (also marked) which is before LIM, remove the property both from
+  ;; the current < and its partner.
+  (save-excursion
+    (if pos
+	(goto-char pos)
+      (setq pos (point)))
+    (when (equal (c-get-char-property (point) 'syntax-table)
+		 c->-as-paren-syntax)
+      (with-syntax-table c-no-parens-syntax-table ; ignore unbalanced [,{,(,..
+	(c-go-up-list-backward))
+      (when (and (<= (point) lim)
+		 (equal (c-get-char-property (point) 'syntax-table)
+			c-<-as-paren-syntax)) ; should always be true.
+	(c-unmark-<->-as-paren (point))
+	(c-unmark-<->-as-paren pos)))))
+
+(defun c-before-change-check-<>-operators (beg end)
+  ;; Unmark certain pairs of "< .... >" which are currently marked as
+  ;; template/generic delimiters.  (This marking is via syntax-table
+  ;; text properties).
+  ;;
+  ;; These pairs are those which are in the current "statement" (i.e.,
+  ;; the region between the {, }, or ; before BEG and the one after
+  ;; END), and which enclose any part of the interval (BEG END).
+  ;;
+  ;; Note that in C++ (?and Java), template/generic parens cannot
+  ;; enclose a brace or semicolon, so we use these as bounds on the
+  ;; region we must work on.
+  ;;
+  ;; This function is called from before-change-functions (via
+  ;; c-get-state-before-change-functions).  Thus the buffer is widened,
+  ;; and point is undefined, both at entry and exit.
+  ;;
+  ;; FIXME!!!  This routine ignores the possibility of macros entirely.
+  ;; 2010-01-29.
+  (save-excursion
+    (let ((beg-lit-limits (progn (goto-char beg) (c-literal-limits)))
+	  (end-lit-limits (progn (goto-char end) (c-literal-limits))))
+      ;; Locate the barrier before the changed region
+      (goto-char  (if beg-lit-limits (car beg-lit-limits) beg))
+      (c-syntactic-skip-backward "^;{}" (max (- beg 2048) (point-min)))
+
+      ;; Remove the syntax-table properties from each pertinent <...> pair.
+      ;; Firsly, the ones with the < before beg and > after beg.
+      (while (c-search-forward-char-property 'category 'c-<-as-paren-syntax beg)
+	(c-clear-<-pair-props-if-match-after beg (1- (point))))
+
+      ;; Locate the barrier after END.
+      (goto-char (if end-lit-limits (cdr end-lit-limits) end))
+      (c-syntactic-re-search-forward "[;{}]"
+				     (min (+ end 2048) (point-max)) 'end)
+
+      ;; Remove syntax-table properties from the remaining pertinent <...>
+      ;; pairs, those with a > after end and < before end.
+      (while (c-search-backward-char-property 'category 'c->-as-paren-syntax end)
+	(c-clear->-pair-props-if-match-before end)))))
+
+
 
 (defun c-after-change-check-<>-operators (beg end)
   ;; This is called from `after-change-functions' when
@@ -4902,7 +5063,7 @@
 		 (< beg (setq beg (match-end 0))))
 	(while (progn (skip-chars-forward "^<>" beg)
 		      (< (point) beg))
-	  (c-clear-char-property (point) 'syntax-table)
+	  (c-clear-<>-pair-props)
 	  (forward-char))))
 
     (when (< beg end)
@@ -4917,9 +5078,13 @@
 		   (< end (setq end (match-end 0))))
 	  (while (progn (skip-chars-forward "^<>" end)
 			(< (point) end))
-	    (c-clear-char-property (point) 'syntax-table)
+	    (c-clear-<>-pair-props)
 	    (forward-char)))))))
 
+
+
+;; Handling of small scale constructs like types and names.
+
 ;; Dynamically bound variable that instructs `c-forward-type' to also
 ;; treat possible types (i.e. those that it normally returns 'maybe or
 ;; 'found for) as actual types (and always return 'found for them).
--- a/lisp/progmodes/cc-langs.el	Mon Feb 01 14:09:07 2010 +0100
+++ b/lisp/progmodes/cc-langs.el	Wed Feb 10 08:47:34 2010 +0100
@@ -391,6 +391,27 @@
   (and (c-lang-const c++-make-template-syntax-table)
        (funcall (c-lang-const c++-make-template-syntax-table))))
 
+(c-lang-defconst c-no-parens-syntax-table
+  ;; A variant of the standard syntax table which is used to find matching
+  ;; "<"s and ">"s which have been marked as parens using syntax table
+  ;; properties.  The other paren characters (e.g. "{", ")" "]") are given a
+  ;; non-paren syntax here. so that the list commands will work on "< ... >"
+  ;; even when there's unbalanced other parens inside them.
+  ;;
+  ;; This variable is nil for languages which don't have template stuff.
+  t  `(lambda ()
+	(if (c-lang-const c-recognize-<>-arglists)
+	    (let ((table (funcall ,(c-lang-const c-make-mode-syntax-table))))
+	      (modify-syntax-entry ?\( "." table)
+	      (modify-syntax-entry ?\) "." table)
+	      (modify-syntax-entry ?\[ "." table)
+	      (modify-syntax-entry ?\] "." table)
+	      (modify-syntax-entry ?\{ "." table)
+	      (modify-syntax-entry ?\} "." table)
+	      table))))
+(c-lang-defvar c-no-parens-syntax-table
+	       (funcall (c-lang-const c-no-parens-syntax-table)))
+
 (c-lang-defconst c-identifier-syntax-modifications
   "A list that describes the modifications that should be done to the
 mode syntax table to get a syntax table that matches all identifiers
@@ -423,26 +444,36 @@
 classifies symbol constituents like '_' and '$' as word constituents,
 so that all identifiers are recognized as words.")
 
-(c-lang-defconst c-get-state-before-change-function
-  "If non-nil, a function called from c-before-change-hook.
-Typically it will record enough state to allow
+(c-lang-defconst c-get-state-before-change-functions
+  ;; For documentation see the following c-lang-defvar of the same name.
+  ;; The value here may be a list of functions or a single function.
+  t nil
+  c++ '(c-extend-region-for-CPP c-before-change-check-<>-operators)
+  (c objc) 'c-extend-region-for-CPP
+  ;; java 'c-before-change-check-<>-operators
+  awk 'c-awk-record-region-clear-NL)
+(c-lang-defvar c-get-state-before-change-functions
+	       (let ((fs (c-lang-const c-get-state-before-change-functions)))
+		  (if (listp fs)
+		      fs
+		    (list fs)))
+  "If non-nil, a list of functions called from c-before-change-hook.
+Typically these will record enough state to allow
 `c-before-font-lock-function' to extend the region to fontify,
 and may do such things as removing text-properties which must be
 recalculated.
 
-It takes 2 parameters, the BEG and END supplied to every
+These functions will be run in the order given.  Each of them
+takes 2 parameters, the BEG and END supplied to every
 before-change function; on entry, the buffer will have been
 widened and match-data will have been saved; point is undefined
 on both entry and exit; the return value is ignored.
 
-When the mode is initialized, this function is called with
-parameters \(point-min) and \(point-max)."
-  t nil
-  (c c++ objc) 'c-extend-region-for-CPP
-  awk 'c-awk-record-region-clear-NL)
-(c-lang-defvar c-get-state-before-change-function
-	       (c-lang-const c-get-state-before-change-function))
-  
+The functions are called even when font locking isn't enabled.
+
+When the mode is initialized, the functions are called with
+parameters \(point-min) and \(point-max).")
+
 (c-lang-defconst c-before-font-lock-function
   "If non-nil, a function called just before font locking.
 Typically it will extend the region about to be fontified \(see
--- a/lisp/progmodes/cc-mode.el	Mon Feb 01 14:09:07 2010 +0100
+++ b/lisp/progmodes/cc-mode.el	Wed Feb 10 08:47:34 2010 +0100
@@ -641,8 +641,12 @@
   (save-restriction
     (widen)
     (save-excursion
-      (if c-get-state-before-change-function
-	  (funcall c-get-state-before-change-function (point-min) (point-max)))
+      (if c-get-state-before-change-functions
+	  (let ((beg (point-min))
+		(end (point-max)))
+	    (mapc (lambda (fn)
+		    (funcall fn beg end))
+		  c-get-state-before-change-functions)))
       (if c-before-font-lock-function
 	  (funcall c-before-font-lock-function (point-min) (point-max)
 		   (- (point-max) (point-min))))))
@@ -775,7 +779,7 @@
 
 (defmacro c-run-mode-hooks (&rest hooks)
   ;; Emacs 21.1 has introduced a system with delayed mode hooks that
-  ;; require the use of the new function `run-mode-hooks'.
+  ;; requires the use of the new function `run-mode-hooks'.
   (if (cc-bytecomp-fboundp 'run-mode-hooks)
       `(run-mode-hooks ,@hooks)
     `(progn ,@(mapcar (lambda (hook) `(run-hooks ,hook)) hooks))))
@@ -808,8 +812,8 @@
   ;; has already been widened, and match-data saved.  The return value is
   ;; meaningless.
   ;;
-  ;; This function is the C/C++/ObjC value of
-  ;; `c-get-state-before-change-function' and is called exclusively as a
+  ;; This function is in the C/C++/ObjC values of
+  ;; `c-get-state-before-change-functions' and is called exclusively as a
   ;; before change function.
   (goto-char beg)
   (c-beginning-of-macro)
@@ -922,8 +926,8 @@
 	  )))))
 
 (defun c-before-change (beg end)
-  ;; Function to be put on `before-change-function'.  Primarily, this calls
-  ;; the language dependent `c-get-state-before-change-function'.  It is
+  ;; Function to be put on `before-change-functions'.  Primarily, this calls
+  ;; the language dependent `c-get-state-before-change-functions'.  It is
   ;; otherwise used only to remove stale entries from the `c-found-types'
   ;; cache, and to record entries which a `c-after-change' function might
   ;; confirm as stale.
@@ -1001,8 +1005,10 @@
 	;; larger than (beg end).
 	(setq c-new-BEG beg
 	      c-new-END end)
-	(if c-get-state-before-change-function
-	    (funcall c-get-state-before-change-function beg end))
+	(if c-get-state-before-change-functions
+	    (mapc (lambda (fn)
+		    (funcall fn beg end))
+		  c-get-state-before-change-functions))
 	))))
 
 (defun c-after-change (beg end old-len)
--- a/lisp/progmodes/f90.el	Mon Feb 01 14:09:07 2010 +0100
+++ b/lisp/progmodes/f90.el	Wed Feb 10 08:47:34 2010 +0100
@@ -158,10 +158,8 @@
 ;; 3. Support for align.
 ;; Font-locking:
 ;; 1. OpenMP, OpenMPI?, preprocessor highlighting.
-;; 2. interface blah - Highlight "blah" in function-name face?
-;; Need to avoid "interface operator (+)" etc.
-;; 3. integer_name = 1
-;; 4. Labels for "else" statements (F2003)?
+;; 2. integer_name = 1
+;; 3. Labels for "else" statements (F2003)?
 
 (defvar comment-auto-fill-only-comments)
 (defvar font-lock-keywords)
@@ -467,22 +465,21 @@
 ;;;      (1 font-lock-keyword-face) (3 font-lock-function-name-face))
    '(f90-typedef-matcher
      (1 font-lock-keyword-face) (2 font-lock-function-name-face))
-   ;; Other functions and declarations.
+    ;; F2003.  Prevent operators being highlighted as functions.
+    '("\\<\\(\\(?:end[ \t]*\\)?interface[ \t]*\\(?:assignment\\|operator\\|\
+read\\|write\\)\\)[ \t]*(" (1 font-lock-keyword-face t))
+   ;; Other functions and declarations.  Named interfaces = F2003.
    '("\\<\\(\\(?:end[ \t]*\\)?\\(program\\|module\\|function\\|associate\\|\
-subroutine\\)\\|use\\|call\\)\\>[ \t]*\\(\\sw+\\)?"
+subroutine\\|interface\\)\\|use\\|call\\)\\>[ \t]*\\(\\sw+\\)?"
      (1 font-lock-keyword-face) (3 font-lock-function-name-face nil t))
    ;; F2003.
    '("\\<\\(use\\)[ \t]*,[ \t]*\\(\\(?:non_\\)?intrinsic\\)[ \t]*::[ \t]*\
 \\(\\sw+\\)"
      (1 font-lock-keyword-face) (2 font-lock-keyword-face)
      (3 font-lock-function-name-face))
-   "\\<\\(\\(end[ \t]*\\)?block[ \t]*data\\|contains\\|\
-end[ \t]*interface\\)\\>"
-   ;; "abstract interface" is F2003. Must come after previous entry.
-   '("\\<\\(\\(?:abstract[ \t]*\\)?interface\\)\\>"
-     ;; [ \t]*\\(\\(\\sw+\\)[ \t]*[^(]\\)?"
-     ;; (2) messes up "interface operator ()", etc.
-     (1 font-lock-keyword-face))) ;(2 font-lock-function-name-face nil t)))
+   "\\<\\(\\(end[ \t]*\\)?block[ \t]*data\\|contains\\)\\>"
+   ;; "abstract interface" is F2003.
+   '("\\<abstract[ \t]*interface\\>" (0 font-lock-keyword-face t)))
   "This does fairly subdued highlighting of comments and function calls.")
 
 ;; NB not explicitly handling this, yet it seems to work.
@@ -558,9 +555,8 @@
 \\(function\\)\\>[ \t]*\\(\\sw+\\)[ \t]*\\(([^&!\n]*)\\)"
       (1 font-lock-type-face t) (4 font-lock-keyword-face t)
       (5 font-lock-function-name-face t) (6 'default t))
-    ;; enum (F2003; cf type in -1).
-    '("\\<\\(enum\\)\\>\\([^()\n]*::\\)?[ \t]*\\(\\sw+\\)"
-      (1 font-lock-keyword-face) (3 font-lock-function-name-face))
+    ;; enum (F2003; must be followed by ", bind(C)").
+    '("\\<\\(enum\\)[ \t]*," (1 font-lock-keyword-face))
     ;; end do, enum (F2003), if, select, where, and forall constructs.
     '("\\<\\(end[ \t]*\\(do\\|if\\|enum\\|select\\|forall\\|where\\)\\)\\>\
 \\([ \t]+\\(\\sw+\\)\\)?"
@@ -1230,7 +1226,7 @@
 
 (defsubst f90-looking-at-type-like ()
   "Return (KIND NAME) if a type/enum/interface/block-data starts after point.
-NAME is non-nil only for type."
+NAME is non-nil only for type and certain interfaces."
   (cond
    ((save-excursion
       (and (looking-at "\\<type\\>[ \t]*")
@@ -1243,7 +1239,15 @@
 ;;;    ((and (not (looking-at f90-typeis-re))
 ;;;          (looking-at f90-type-def-re))
 ;;;     (list (match-string 1) (match-string 2)))
-   ((looking-at "\\(enum\\|interface\\|block[ \t]*data\\)\\>")
+   ((looking-at "\\<\\(interface\\)\\>[ \t]*")
+    (list (match-string 1)
+          (save-excursion
+            (goto-char (match-end 0))
+            (if (or (looking-at "\\(operator\\|assignment\\|read\\|\
+write\\)[ \t]*([^)\n]*)")
+                    (looking-at "\\sw+"))
+                (match-string 0)))))
+   ((looking-at "\\(enum\\|block[ \t]*data\\)\\>")
     (list (match-string 1) nil))
    ((looking-at "abstract[ \t]*\\(interface\\)\\>")
     (list (match-string 1) nil))))
@@ -1271,9 +1275,12 @@
 
 (defsubst f90-looking-at-program-block-end ()
   "Return (KIND NAME) if a block with name NAME ends after point."
-  (if (looking-at (concat "end[ \t]*" f90-blocks-re
-                          "?\\([ \t]+\\(\\sw+\\)\\)?\\>"))
-      (list (match-string 1) (match-string 3))))
+  (cond ((looking-at "end[ \t]*\\(interface\\)[ \t]*\\(\
+\\(?:assignment\\|operator\\|read\\|write\\)[ \t]*([^)\n]*)\\)")
+         (list (match-string 1) (match-string 2)))
+        ((looking-at (concat "end[ \t]*" f90-blocks-re
+                             "?\\([ \t]+\\(\\sw+\\)\\)?\\>"))
+        (list (match-string 1) (match-string 3)))))
 
 (defsubst f90-comment-indent ()
   "Return the indentation to be used for a comment starting at point.
--- a/lisp/simple.el	Mon Feb 01 14:09:07 2010 +0100
+++ b/lisp/simple.el	Wed Feb 10 08:47:34 2010 +0100
@@ -4700,7 +4700,7 @@
 This also turns on `word-wrap' in the buffer."
   :keymap visual-line-mode-map
   :group 'visual-line
-  :lighter " wrap"
+  :lighter " Wrap"
   (if visual-line-mode
       (progn
 	(set (make-local-variable 'visual-line--saved-state) nil)
--- a/lisp/startup.el	Mon Feb 01 14:09:07 2010 +0100
+++ b/lisp/startup.el	Wed Feb 10 08:47:34 2010 +0100
@@ -2103,7 +2103,7 @@
 	      (when (string-match "\\`\\(--[^=]*\\)=" argi)
 		(setq argval (substring argi (match-end 0))
 		      argi (match-string 1 argi)))
-	      (when (string-match "\\`--." orig-argi)
+	      (when (string-match "\\`--?[^-]" orig-argi)
 		(setq completion (try-completion argi longopts))
 		(if (eq completion t)
 		    (setq argi (substring argi 1))
--- a/lisp/term/xterm.el	Mon Feb 01 14:09:07 2010 +0100
+++ b/lisp/term/xterm.el	Wed Feb 10 08:47:34 2010 +0100
@@ -679,7 +679,6 @@
   ;; Use the heuristic in `frame-set-background-mode' to decide if a
   ;; frame is dark.
   (when (< (+ redc greenc bluec) (* .6 (+ 65535 65535 65535)))
-    (setq xterm-background-mode-changed t)
     (set-terminal-parameter nil 'background-mode 'dark)
     t))
 
--- a/lisp/textmodes/ispell.el	Mon Feb 01 14:09:07 2010 +0100
+++ b/lisp/textmodes/ispell.el	Wed Feb 10 08:47:34 2010 +0100
@@ -3459,7 +3459,7 @@
 	       ;; Matches context difference listing
 	       "\\(\\(^cd .*\n\\)?diff -c .*\\)?\n\\*\\*\\* .*\n--- .*\n\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*"
 	       ;; Matches unidiff difference listing
-	       "\\(diff -u .*\\)?\n--- .*\n\\+\\+\\+ .*\n@@ [-+][0-9]+,[0-9]+ [-+][0-9]+,[0-9]+ @@\n"
+	       "\\(diff -u .*\\)?\n--- .*\n\\+\\+\\+ .*\n@@ [-+][0-9]+,[0-9]+ [-+][0-9]+,[0-9]+ @@"
 	       ;; Matches reporter.el bug report
 	       "^current state:\n==============\n"
 	       ;; Matches commonly used "cut" boundaries
--- a/lisp/vc-bzr.el	Mon Feb 01 14:09:07 2010 +0100
+++ b/lisp/vc-bzr.el	Wed Feb 10 08:47:34 2010 +0100
@@ -796,8 +796,12 @@
        (shelve-help-echo "Use M-x vc-bzr-shelve to create shelves")
        (root-dir (vc-bzr-root dir))
        (pending-merge
-	(file-exists-p
-	 (expand-file-name ".bzr/checkout/merge-hashes" root-dir)))
+	;; FIXME: looking for .bzr/checkout/merge-hashes is not a
+	;; reliable method to detect pending merges, disable this
+	;; until a proper solution is implemented.
+	(and nil
+	 (file-exists-p
+	 (expand-file-name ".bzr/checkout/merge-hashes" root-dir))))
        (pending-merge-help-echo
 	(format "A merge has been performed.\nA commit from the top-level directory (%s)\nis required before being able to check in anything else" root-dir))
        (light-checkout
--- a/lisp/vc-hooks.el	Mon Feb 01 14:09:07 2010 +0100
+++ b/lisp/vc-hooks.el	Wed Feb 10 08:47:34 2010 +0100
@@ -89,7 +89,7 @@
   :type '(repeat directory)
   :group 'vc)
 
-(make-obsolete 'vc-path "should not be necessary anymore." "23.2")
+(make-obsolete-variable '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.
--- a/lisp/vc-svn.el	Mon Feb 01 14:09:07 2010 +0100
+++ b/lisp/vc-svn.el	Wed Feb 10 08:47:34 2010 +0100
@@ -31,6 +31,10 @@
 (eval-when-compile
   (require 'vc))
 
+;; Clear up the cache to force vc-call to check again and discover
+;; new functions when we reload this file.
+(put 'SVN 'vc-functions nil)
+
 ;;;
 ;;; Customization options
 ;;;
@@ -722,6 +726,21 @@
     (beginning-of-line)
     (if (looking-at vc-svn-annotate-re) (match-string 1))))
 
+(defun vc-svn-revision-table (files)
+  (let ((vc-svn-revisions '()))
+    (with-current-buffer "*vc*"
+      (vc-svn-command nil 0 files "log" "-q")
+      (goto-char (point-min))
+      (forward-line)
+      (let ((start (point-min))
+            (loglines (buffer-substring-no-properties (point-min)
+                                                      (point-max))))
+        (while (string-match "^r\\([0-9]+\\) " loglines)
+          (push (match-string 1 loglines) vc-svn-revisions)
+          (setq start (+ start (match-end 0)))
+          (setq loglines (buffer-substring-no-properties start (point-max)))))
+    vc-svn-revisions)))
+
 (provide 'vc-svn)
 
 ;; arch-tag: 02f10c68-2b4d-453a-90fc-1eee6cfb268d
--- a/lwlib/README	Mon Feb 01 14:09:07 2010 +0100
+++ b/lwlib/README	Wed Feb 10 08:47:34 2010 +0100
@@ -4,6 +4,4 @@
 GPL version 1 (or later).  It is not considered part of GNU Emacs.
 
 This version of the library differs from the original as described in
-the ChangeLog file.  For example, the file "lwlib-int.h" was renamed
-from "lwlib-internal.h" in order to fit in 14 characters, and the
-makefile adjusted to fit in with Emacs's configure script.
+the ChangeLog file.
--- a/src/ChangeLog	Mon Feb 01 14:09:07 2010 +0100
+++ b/src/ChangeLog	Wed Feb 10 08:47:34 2010 +0100
@@ -1,3 +1,20 @@
+2010-02-08  Francis Devereux  <francis@devrx.org>  (tiny change)
+
+	* nsfont.m (nsfont_open): The system's value for the font descent
+	is negative, so round it down to avoid clipping.
+
+2010-02-06  Chong Yidong  <cyd@stupidchicken.com>
+
+	* charset.c (load_charset_map_from_file)
+	(load_charset_map_from_vector): Fix last change to use SAFE_ALLOCA
+	instead of xmalloc (Bug#5526).  Suggested by Vivek Dasmohapatra.
+
+2010-02-05  Chong Yidong  <cyd@stupidchicken.com>
+
+	* charset.c (load_charset_map_from_file): Allocate large
+	charset_map_entries structure on the heap rather than the stack.
+	(Bug#5526).
+
 2010-01-31  Kenichi Handa  <handa@m17n.org>
 
 	* font.c (font_parse_xlfd): If FONT is a font-entity and pixel
--- a/src/charset.c	Mon Feb 01 14:09:07 2010 +0100
+++ b/src/charset.c	Wed Feb 10 08:47:34 2010 +0100
@@ -512,12 +512,13 @@
   int eof;
   Lisp_Object suffixes;
   struct charset_map_entries *head, *entries;
-  int n_entries;
-  int count = SPECPDL_INDEX ();
+  int n_entries, count;
+  USE_SAFE_ALLOCA;
 
   suffixes = Fcons (build_string (".map"),
 		    Fcons (build_string (".TXT"), Qnil));
 
+  count = SPECPDL_INDEX ();
   specbind (Qfile_name_handler_alist, Qnil);
   fd = openp (Vcharset_map_path, mapfile, suffixes, NULL, Qnil);
   unbind_to (count, Qnil);
@@ -525,8 +526,12 @@
       || ! (fp = fdopen (fd, "r")))
     error ("Failure in loading charset map: %S", SDATA (mapfile));
 
-  head = entries = ((struct charset_map_entries *)
-		    alloca (sizeof (struct charset_map_entries)));
+  /* Use SAFE_ALLOCA instead of alloca, as `charset_map_entries' is
+     large (larger than MAX_ALLOCA).  */
+  SAFE_ALLOCA (head, struct charset_map_entries *,
+	       sizeof (struct charset_map_entries));
+  entries = head;
+
   n_entries = 0;
   eof = 0;
   while (1)
@@ -549,8 +554,8 @@
 
       if (n_entries > 0 && (n_entries % 0x10000) == 0)
 	{
-	  entries->next = ((struct charset_map_entries *)
-			   alloca (sizeof (struct charset_map_entries)));
+	  SAFE_ALLOCA (entries->next, struct charset_map_entries *,
+		       sizeof (struct charset_map_entries));
 	  entries = entries->next;
 	}
       idx = n_entries % 0x10000;
@@ -563,6 +568,7 @@
   close (fd);
 
   load_charset_map (charset, head, n_entries, control_flag);
+  SAFE_FREE ();
 }
 
 static void
@@ -577,6 +583,7 @@
   int n_entries;
   int len = ASIZE (vec);
   int i;
+  USE_SAFE_ALLOCA;
 
   if (len % 2 == 1)
     {
@@ -584,8 +591,12 @@
       return;
     }
 
-  head = entries = ((struct charset_map_entries *)
-		    alloca (sizeof (struct charset_map_entries)));
+  /* Use SAFE_ALLOCA instead of alloca, as `charset_map_entries' is
+     large (larger than MAX_ALLOCA).  */
+  SAFE_ALLOCA (head, struct charset_map_entries *,
+	       sizeof (struct charset_map_entries));
+  entries = head;
+
   n_entries = 0;
   for (i = 0; i < len; i += 2)
     {
@@ -618,8 +629,8 @@
 
       if (n_entries > 0 && (n_entries % 0x10000) == 0)
 	{
-	  entries->next = ((struct charset_map_entries *)
-			   alloca (sizeof (struct charset_map_entries)));
+	  SAFE_ALLOCA (entries->next, struct charset_map_entries *,
+		       sizeof (struct charset_map_entries));
 	  entries = entries->next;
 	}
       idx = n_entries % 0x10000;
@@ -630,6 +641,7 @@
     }
 
   load_charset_map (charset, head, n_entries, control_flag);
+  SAFE_FREE ();
 }
 
 
--- a/src/nsfont.m	Mon Feb 01 14:09:07 2010 +0100
+++ b/src/nsfont.m	Wed Feb 10 08:47:34 2010 +0100
@@ -844,8 +844,10 @@
     /* max bounds */
     font_info->max_bounds.ascent =
       lrint (hshrink * [sfont ascender] + expand * hd/2);
+    /* [sfont descender] is usually negative.  Use floor to avoid
+       clipping descenders. */
     font_info->max_bounds.descent =
-      -lrint (hshrink* [sfont descender] - expand*hd/2);
+      -lrint (floor(hshrink* [sfont descender] - expand*hd/2));
     font_info->height =
       font_info->max_bounds.ascent + font_info->max_bounds.descent;
     font_info->max_bounds.width = lrint (font_info->width);
@@ -880,8 +882,8 @@
 #endif
 
     /* set up metrics portion of font struct */
-    font->ascent = [sfont ascender];
-    font->descent = -[sfont descender];
+    font->ascent = lrint([sfont ascender]);
+    font->descent = -lrint(floor([sfont descender]));
     font->min_width = ns_char_width(sfont, '|');
     font->space_width = lrint (ns_char_width (sfont, ' '));
     font->average_width = lrint (font_info->width);