changeset 106905:1f446f261ed0

no message
author Alan Mackenzie <acm@muc.de>
date Tue, 19 Jan 2010 11:43:25 +0000
parents 943a92f3710b (current diff) 0865d6c0506d (diff)
children 51a1add37c3f
files src/ChangeLog
diffstat 54 files changed, 1203 insertions(+), 603 deletions(-) [+]
line wrap: on
line diff
--- a/.bzrignore	Fri Jan 08 13:41:42 2010 +0000
+++ b/.bzrignore	Tue Jan 19 11:43:25 2010 +0000
@@ -1,24 +1,53 @@
 ./bin
+./BIN
 ./data
 ./etc/icons
 ./lock
 ./site-lisp
+./_dir-locals.el
+./config.log
+./config.status
 oo
 oo-spd
 autom4te.cache
 *.elc
 DOC
-DOC-X
+DOC-*
 makefile
+Makefile
+Makefile.c
 stamp_BLD
 subdirs.el
 TAGS
 info/*
 leim/leim-list.el
 leim/quail/*.el
+leim/changed.misc
+leim/changed.tit
 lib-src/ctags.c
 lib-src/echolisp.tmp
 lib-src/getopt.h
+lib-src/b2m
+lib-src/ctags
+lib-src/digest-doc
+lib-src/digest-doc.exe
+lib-src/ebrowse
+lib-src/emacsclient
+lib-src/etags
+lib-src/fakemail
+lib-src/fakemail.exe
+lib-src/hexl
+lib-src/make-docfile
+lib-src/make-docfile.exe
+lib-src/movemail
+lib-src/profile
+lib-src/profile.exe
+lib-src/sorted-doc
+lib-src/sorted-doc.exe
+lib-src/test-distrib
+lib-src/test-distrib.exe
+lib-src/update-game-score
+lib-src/update-game-score.exe
 lisp/**/*-loaddefs.el
 lisp/**/loaddefs.el
 lisp/cus-load.el
@@ -28,3 +57,15 @@
 src/buildobj.h
 src/config.h
 src/epaths.h
+src/_dbxinit
+src/_gdbinit
+src/gdb.ini
+src/bootstrap-emacs
+src/b-emacs.exe
+src/emacs
+src/emacs-*
+src/prefix-args*
+src/stamp-oldxmenu
+src/temacs
+src/temacs.exe
+src/deps
--- a/ChangeLog	Fri Jan 08 13:41:42 2010 +0000
+++ b/ChangeLog	Tue Jan 19 11:43:25 2010 +0000
@@ -1,3 +1,8 @@
+2010-01-02  Eli Zaretskii  <eliz@gnu.org>
+
+	* .bzrignore: Add more ignored patterns, including for the MS-DOS
+	build.
+
 2009-12-27  Karl Fogel  <kfogel@red-bean>
 
 	* INSTALL.BZR: Rename from INSTALL.CVS; edit to talk about Bazaar.
--- a/doc/lispref/ChangeLog	Fri Jan 08 13:41:42 2010 +0000
+++ b/doc/lispref/ChangeLog	Tue Jan 19 11:43:25 2010 +0000
@@ -1,3 +1,27 @@
+2010-01-04  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	Avoid dubious uses of save-excursions.
+	* positions.texi (Excursions): Recommend the use of
+	save-current-buffer if applicable.
+	* text.texi (Clickable Text): Fix the example code which used
+	save-excursion in a naive way which sometimes preserves point and
+	sometimes not.
+	* variables.texi (Creating Buffer-Local):
+	* os.texi (Session Management):
+	* display.texi (GIF Images):
+	* control.texi (Cleanups): Use (save|with)-current-buffer.
+
+2010-01-02  Eli Zaretskii  <eliz@gnu.org>
+
+	* modes.texi (Example Major Modes): Fix indentation.  (Bug#5195)
+
+2010-01-02  Chong Yidong  <cyd@stupidchicken.com>
+
+	* nonascii.texi (Text Representations, Character Codes)
+	(Converting Representations, Explicit Encoding)
+	(Translation of Characters): Use hex notation consistently.
+	(Character Sets): Fix map-charset-chars doc (Bug#5197).
+
 2010-01-01  Chong Yidong  <cyd@stupidchicken.com>
 
 	* loading.texi (Where Defined): Make it clearer that these are
@@ -8364,7 +8388,7 @@
 ;; End:
 
     Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-      2007, 2008, 2009  Free Software Foundation, Inc.
+      2007, 2008, 2009, 2010  Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
--- a/doc/lispref/control.texi	Fri Jan 08 13:41:42 2010 +0000
+++ b/doc/lispref/control.texi	Tue Jan 19 11:43:25 2010 +0000
@@ -1255,9 +1255,8 @@
 
 @smallexample
 @group
-(save-excursion
-  (let ((buffer (get-buffer-create " *temp*")))
-    (set-buffer buffer)
+(let ((buffer (get-buffer-create " *temp*")))
+  (with-current-buffer buffer
     (unwind-protect
         @var{body-form}
       (kill-buffer buffer))))
@@ -1269,7 +1268,7 @@
 (current-buffer))} and dispense with the variable @code{buffer}.
 However, the way shown above is safer, if @var{body-form} happens to
 get an error after switching to a different buffer!  (Alternatively,
-you could write another @code{save-excursion} around @var{body-form},
+you could write a @code{save-current-buffer} around @var{body-form},
 to ensure that the temporary buffer becomes current again in time to
 kill it.)
 
--- a/doc/lispref/display.texi	Fri Jan 08 13:41:42 2010 +0000
+++ b/doc/lispref/display.texi	Tue Jan 19 11:43:25 2010 +0000
@@ -4394,8 +4394,7 @@
   (when (= idx max)
     (setq idx 0))
   (let ((img (create-image file nil :image idx)))
-    (save-excursion
-      (set-buffer buffer)
+    (with-current-buffer buffer
       (goto-char (point-min))
       (unless first-time (delete-char 1))
       (insert-image img))
--- a/doc/lispref/modes.texi	Fri Jan 08 13:41:42 2010 +0000
+++ b/doc/lispref/modes.texi	Tue Jan 19 11:43:25 2010 +0000
@@ -1062,8 +1062,8 @@
       ;;   @r{part of symbol names but not words.}
       ;;   @r{(The digit @samp{0} is @code{48} in the @acronym{ASCII} character set.)}
       (while (< i ?0)
-	(modify-syntax-entry i "_   " table)
-	(setq i (1+ i)))
+        (modify-syntax-entry i "_   " table)
+        (setq i (1+ i)))
       ;; @r{@dots{} similar code follows for other character ranges.}
 @end group
 @group
--- a/doc/lispref/nonascii.texi	Fri Jan 08 13:41:42 2010 +0000
+++ b/doc/lispref/nonascii.texi	Tue Jan 19 11:43:25 2010 +0000
@@ -46,12 +46,12 @@
 follows the @dfn{Unicode Standard}.  The Unicode Standard assigns a
 unique number, called a @dfn{codepoint}, to each and every character.
 The range of codepoints defined by Unicode, or the Unicode
-@dfn{codespace}, is @code{0..10FFFF} (in hex), inclusive.  Emacs
-extends this range with codepoints in the range @code{110000..3FFFFF},
-which it uses for representing characters that are not unified with
-Unicode and raw 8-bit bytes that cannot be interpreted as characters
-(the latter occupy the range @code{3FFF80..3FFFFF}).  Thus, a
-character codepoint in Emacs is a 22-bit integer number.
+@dfn{codespace}, is @code{0..#x10FFFF} (in hexadecimal notation),
+inclusive.  Emacs extends this range with codepoints in the range
+@code{#x110000..#x3FFFFF}, which it uses for representing characters
+that are not unified with Unicode and @dfn{raw 8-bit bytes} that
+cannot be interpreted as characters.  Thus, a character codepoint in
+Emacs is a 22-bit integer number.
 
 @cindex internal representation of characters
 @cindex characters, representation in buffers and strings
@@ -189,8 +189,8 @@
 it is returned unchanged.  The function assumes that @var{string}
 includes only @acronym{ASCII} characters and raw 8-bit bytes; the
 latter are converted to their multibyte representation corresponding
-to the codepoints in the @code{3FFF80..3FFFFF} area (@pxref{Text
-Representations, codepoints}).
+to the codepoints @code{#x3FFF80} through @code{#x3FFFFF}, inclusive
+(@pxref{Text Representations, codepoints}).
 @end defun
 
 @defun string-to-unibyte string
@@ -271,15 +271,19 @@
 
   The unibyte and multibyte text representations use different
 character codes.  The valid character codes for unibyte representation
-range from 0 to 255---the values that can fit in one byte.  The valid
-character codes for multibyte representation range from 0 to 4194303
-(#x3FFFFF).  In this code space, values 0 through 127 are for
-@acronym{ASCII} characters, and values 128 through 4194175 (#x3FFF7F)
-are for non-@acronym{ASCII} characters.  Values 0 through 1114111
-(#10FFFF) correspond to Unicode characters of the same codepoint;
-values 1114112 (#110000) through 4194175 (#x3FFF7F) represent
-characters that are not unified with Unicode; and values 4194176
-(#x3FFF80) through 4194303 (#x3FFFFF) represent eight-bit raw bytes.
+range from 0 to @code{#xFF} (255)---the values that can fit in one
+byte.  The valid character codes for multibyte representation range
+from 0 to @code{#x3FFFFF}.  In this code space, values 0 through
+@code{#x7F} (127) are for @acronym{ASCII} characters, and values
+@code{#x80} (128) through @code{#x3FFF7F} (4194175) are for
+non-@acronym{ASCII} characters.
+
+  Emacs character codes are a superset of the Unicode standard.
+Values 0 through @code{#x10FFFF} (1114111) correspond to Unicode
+characters of the same codepoint; values @code{#x110000} (1114112)
+through @code{#x3FFF7F} (4194175) represent characters that are not
+unified with Unicode; and values @code{#x3FFF80} (4194176) through
+@code{#x3FFFFF} (4194303) represent eight-bit raw bytes.
 
 @defun characterp charcode
 This returns @code{t} if @var{charcode} is a valid character, and
@@ -540,7 +544,7 @@
 @cindex @code{eight-bit}, a charset
   Emacs defines several special character sets.  The character set
 @code{unicode} includes all the characters whose Emacs code points are
-in the range @code{0..10FFFF}.  The character set @code{emacs}
+in the range @code{0..#x10FFFF}.  The character set @code{emacs}
 includes all @acronym{ASCII} and non-@acronym{ASCII} characters.
 Finally, the @code{eight-bit} charset includes the 8-bit raw bytes;
 Emacs uses it to represent raw bytes encountered in text.
@@ -628,12 +632,12 @@
   The following function comes in handy for applying a certain
 function to all or part of the characters in a charset:
 
-@defun map-charset-chars function charset &optional arg from to
+@defun map-charset-chars function charset &optional arg from-code to-code
 Call @var{function} for characters in @var{charset}.  @var{function}
 is called with two arguments.  The first one is a cons cell
 @code{(@var{from} .  @var{to})}, where @var{from} and @var{to}
 indicate a range of characters contained in charset.  The second
-argument is the optional argument @var{arg}.
+argument passed to @var{function} is @var{arg}.
 
 By default, the range of codepoints passed to @var{function} includes
 all the characters in @var{charset}, but optional arguments
@@ -751,7 +755,7 @@
 
 @defun make-translation-table-from-vector vec
 This function returns a translation table made from @var{vec} that is
-an array of 256 elements to map byte values 0 through 255 to
+an array of 256 elements to map bytes (values 0 through #xFF) to
 characters.  Elements may be @code{nil} for untranslated bytes.  The
 returned table has a translation table for reverse mapping in the
 first extra slot, and the value @code{1} in the second extra slot.
@@ -1562,10 +1566,10 @@
 text.  They logically consist of a series of byte values; that is, a
 series of @acronym{ASCII} and eight-bit characters.  In unibyte
 buffers and strings, these characters have codes in the range 0
-through 255.  In a multibyte buffer or string, eight-bit characters
-have character codes higher than 255 (@pxref{Text Representations}),
-but Emacs transparently converts them to their single-byte values when
-you encode or decode such text.
+through #xFF (255).  In a multibyte buffer or string, eight-bit
+characters have character codes higher than #xFF (@pxref{Text
+Representations}), but Emacs transparently converts them to their
+single-byte values when you encode or decode such text.
 
   The usual way to read a file into a buffer as a sequence of bytes, so
 you can decode the contents explicitly, is with
--- a/doc/lispref/os.texi	Fri Jan 08 13:41:42 2010 +0000
+++ b/doc/lispref/os.texi	Tue Jan 19 11:43:25 2010 +0000
@@ -2182,7 +2182,7 @@
 
 @group
 (defun save-yourself-test ()
-  (insert "(save-excursion
+  (insert "(save-current-buffer
   (switch-to-buffer \"*scratch*\")
   (insert \"I am restored\"))")
   nil)
--- a/doc/lispref/positions.texi	Fri Jan 08 13:41:42 2010 +0000
+++ b/doc/lispref/positions.texi	Tue Jan 19 11:43:25 2010 +0000
@@ -806,7 +806,9 @@
 
   The forms for saving and restoring the configuration of windows are
 described elsewhere (see @ref{Window Configurations}, and @pxref{Frame
-Configurations}).
+Configurations}).  When only the identity of the current buffer needs
+to be saved and restored, it is preferable to use
+@code{save-current-buffer} instead.
 
 @defspec save-excursion body@dots{}
 @cindex mark excursion
@@ -817,10 +819,10 @@
 point and the mark.  All three saved values are restored even in case of
 an abnormal exit via @code{throw} or error (@pxref{Nonlocal Exits}).
 
-The @code{save-excursion} special form is the standard way to switch
-buffers or move point within one part of a program and avoid affecting
-the rest of the program.  It is used more than 4000 times in the Lisp
-sources of Emacs.
+The @code{save-excursion} special form is the standard way to move
+point within one part of a program and avoid affecting the rest of the
+program.  It is used more than 4000 times in the Lisp sources
+of Emacs.
 
 @code{save-excursion} does not save the values of point and the mark for
 other buffers, so changes in other buffers remain in effect after
--- a/doc/lispref/text.texi	Fri Jan 08 13:41:42 2010 +0000
+++ b/doc/lispref/text.texi	Tue Jan 19 11:43:25 2010 +0000
@@ -3524,13 +3524,12 @@
 (defun dired-mouse-find-file-other-window (event)
   "In Dired, visit the file or directory name you click on."
   (interactive "e")
-  (let (window pos file)
-    (save-excursion
-      (setq window (posn-window (event-end event))
-            pos (posn-point (event-end event)))
-      (if (not (windowp window))
-          (error "No file chosen"))
-      (set-buffer (window-buffer window))
+  (let ((window (posn-window (event-end event)))
+        (pos (posn-point (event-end event)))
+        file)
+    (if (not (windowp window))
+        (error "No file chosen"))
+    (with-current-buffer (window-buffer window)
       (goto-char pos)
       (setq file (dired-get-file-for-visit)))
     (if (file-directory-p file)
--- a/doc/lispref/variables.texi	Fri Jan 08 13:41:42 2010 +0000
+++ b/doc/lispref/variables.texi	Tue Jan 19 11:43:25 2010 +0000
@@ -1240,8 +1240,7 @@
 
 @group
 ;; @r{In buffer @samp{b2}, the value hasn't changed.}
-(save-excursion
-  (set-buffer "b2")
+(with-current-buffer "b2"
   foo)
      @result{} 5
 @end group
--- a/doc/misc/ChangeLog	Fri Jan 08 13:41:42 2010 +0000
+++ b/doc/misc/ChangeLog	Tue Jan 19 11:43:25 2010 +0000
@@ -1,3 +1,13 @@
+2010-01-04  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* gnus.texi (Posting Styles): Use with-current-buffer.
+	* calc.texi (Defining Simple Commands): Prefer save-current-buffer.
+
+2010-01-02  Kevin Ryde  <user42@zip.com.au>
+
+	* eieio.texi (Naming Conventions): Correction to xref on elisp
+	coding conventions, is "Tips" node not "Standards".
+
 2009-12-24  Chong Yidong  <cyd@stupidchicken.com>
 
 	* calc.texi (General Mode Commands): Calc file should be in .emacs.d.
@@ -6507,7 +6517,7 @@
 ;; End:
 
     Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002,
-      2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
+      2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
--- a/doc/misc/calc.texi	Fri Jan 08 13:41:42 2010 +0000
+++ b/doc/misc/calc.texi	Tue Jan 19 11:43:25 2010 +0000
@@ -31968,7 +31968,7 @@
 @smallexample
 (let ((calc-command-flags nil))
   (unwind-protect
-      (save-excursion
+      (save-current-buffer
         (calc-select-buffer)
         @emph{body of function}
         @emph{renumber stack}
--- a/doc/misc/eieio.texi	Fri Jan 08 13:41:42 2010 +0000
+++ b/doc/misc/eieio.texi	Tue Jan 19 11:43:25 2010 +0000
@@ -11,7 +11,7 @@
 @copying
 This manual documents EIEIO, an object framework for Emacs Lisp.
 
-Copyright @copyright{} 2007, 2008, 2009 Free Software Foundation, Inc.
+Copyright @copyright{} 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
@@ -1776,11 +1776,11 @@
 @comment  node-name,  next,  previous,  up
 @chapter Naming Conventions
 
-@pxref{Standards,,,elisp,GNU Emacs Lisp Reference Manual}, for a
-description of Emacs Lisp programming conventions.  These conventions
-help ensure that Emacs packages work nicely one another, so an
-@eieio{}-based program should follow them.  Here are some conventions
-that apply specifically to @eieio{}-based programs:
+@xref{Tips,,Tips and Conventions,elisp,GNU Emacs Lisp Reference
+Manual}, for a description of Emacs Lisp programming conventions.
+These conventions help ensure that Emacs packages work nicely one
+another, so an @eieio{}-based program should follow them.  Here are
+some conventions that apply specifically to @eieio{}-based programs:
 
 @itemize
 
--- a/doc/misc/gnus.texi	Fri Jan 08 13:41:42 2010 +0000
+++ b/doc/misc/gnus.texi	Tue Jan 19 11:43:25 2010 +0000
@@ -10,7 +10,7 @@
 
 @copying
 Copyright @copyright{} 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
@@ -13449,8 +13449,7 @@
          (body "You are fired.\n\nSincerely, your boss.")
          (organization "Important Work, Inc"))
         ("nnml:.*"
-         (From (save-excursion
-                 (set-buffer gnus-article-buffer)
+         (From (with-current-buffer gnus-article-buffer
                  (message-fetch-field "to"))))
         ("^nn.+:"
          (signature-file "~/.mail-signature"))))
--- a/etc/ChangeLog	Fri Jan 08 13:41:42 2010 +0000
+++ b/etc/ChangeLog	Tue Jan 19 11:43:25 2010 +0000
@@ -1,3 +1,7 @@
+2010-01-01  Juanma Barranquero  <lekktu@gmail.com>
+
+	* NEWS: Fix typos.
+
 2009-12-15  Glenn Morris  <rgm@gnu.org>
 
 	* CONTRIBUTE (Coding Standards): Update URL.
@@ -301,8 +305,8 @@
 
 2009-05-15  Sven Joachim  <svenjoac@gmx.de>
 
-        * refcards/de-refcard.tex: Merge changes from refcard.tex.
-        Change `Paragraph' to `Absatz'.
+	* refcards/de-refcard.tex: Merge changes from refcard.tex.
+	Change `Paragraph' to `Absatz'.
 
 2009-04-09  Glenn Morris  <rgm@gnu.org>
 
--- a/etc/NEWS	Fri Jan 08 13:41:42 2010 +0000
+++ b/etc/NEWS	Tue Jan 19 11:43:25 2010 +0000
@@ -182,7 +182,7 @@
 
 ** The bookmark menu has a narrowing search via bookmark-bmenu-search.
 
-** LaTeX mode now provides completion (via completion-at-point)
+** LaTeX mode now provides completion (via completion-at-point).
 
 ** sym-comp.el is now declared obsolete, superceded by completion-at-point.
 
@@ -235,8 +235,9 @@
 
 ** GDB-UI
 
-*** Toolbar functionality for reverse debugging. Display of STL collections as
-    watch expressions.  These features require GDB 7.0 or later.
+*** Toolbar functionality for reverse debugging.  Display of STL
+collections as watch expressions.  These features require GDB 7.0
+or later.
 
 ** Grep
 +++
@@ -586,7 +587,7 @@
 
 *** Emacs now supports multi-page TIFF images.
 
-** New NeXTSTEP-based port
+** New NeXTSTEP-based port.
 This provides support for GNUstep (via the GNUstep libraries) and Mac
 OS X (via the Cocoa libraries).
 
@@ -617,7 +618,7 @@
 *** Old GNU/Linux systems based on libc version 5.
 
 *** Old FreeBSD, NetBSD, and OpenBSD systems based on the COFF
-    executable format.
+executable format.
 
 *** Solaris versions 2.6 and below.
 
@@ -1187,23 +1188,23 @@
 ** Abbrev has been rewritten in Elisp and extended with more flexibility.
 
 *** New functions: abbrev-get, abbrev-put, abbrev-table-get, abbrev-table-put,
-    abbrev-table-p, abbrev-insert, abbrev-table-menu.
+abbrev-table-p, abbrev-insert, abbrev-table-menu.
 
 *** Special hook `abbrev-expand-functions' obsoletes `pre-abbrev-expand-hook'.
 
 *** `make-abbrev-table', `define-abbrev', `define-abbrev-table' all take
-    extra arguments for arbitrary properties.
+extra arguments for arbitrary properties.
 
 *** New variable `abbrev-minor-mode-table-alist'.
 
 *** `local-abbrev-table' can hold a list of abbrev-tables.
 
 *** Abbrevs have now the following special properties:
-    `:count', `:system', `:enable-function', `:case-fixed'.
+`:count', `:system', `:enable-function', `:case-fixed'.
 
 *** Abbrev-tables have now the following special properties:
-    `:parents', `:case-fixed', `:enable-function', `:regexp',
-    `abbrev-table-modiff'.
+`:parents', `:case-fixed', `:enable-function', `:regexp',
+`abbrev-table-modiff'.
 
 ** Apropos
 
--- a/lisp/ChangeLog	Fri Jan 08 13:41:42 2010 +0000
+++ b/lisp/ChangeLog	Tue Jan 19 11:43:25 2010 +0000
@@ -1,3 +1,190 @@
+2010-01-06  Jan Djärv  <jan.h.d@swipnet.se>
+
+	* font-setting.el (font-setting-change-default-font): Use user-spec
+	instead of name.
+
+2010-01-06  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* vc-bzr.el (vc-bzr-after-dir-status): Ignore pending merges.
+
+2010-01-05  Tom Tromey  <tromey@redhat.com>
+
+	* progmodes/python.el (python-font-lock-keywords): Handle
+	qualified decorators (Bug#881).
+
+2010-01-05  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* vc-bzr.el (vc-bzr-working-revision): Fix looking for a revision
+	in a lightweight checkout.
+
+2010-01-05  Kenichi Handa  <handa@m17n.org>
+
+	* language/indian.el (malayalam-composable-pattern): Fix ZWNJ and
+	ZWJ.
+
+2010-01-05  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* vc-bzr.el (vc-bzr-diff): Obey vc-disable-async-diff.
+
+2010-01-04  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* vc-bzr.el (vc-bzr-state-heuristic): Make it work for lightweight
+	checkouts.  (Bug#618)
+	(vc-bzr-log-view-mode): Also highlight the author.
+	(vc-bzr-shelve-map): Change binding for vc-bzr-shelve-apply-at-point.
+	(vc-bzr-shelve-menu-map):
+	(vc-bzr-dir-extra-headers): Improve menu and tooltip text.
+	(vc-bzr-shelve-apply): Make prompt more explicit.
+
+2010-01-02  Chong Yidong  <cyd@stupidchicken.com>
+
+	* net/browse-url.el (browse-url-encode-url): Don't escape commas.
+	They are valid characters in URL paths (rfc3986), and at least
+	Firefox does not understand the encoded version (Bug#3166).
+
+2010-01-02  Daniel Elliott  <danelliottster@gmail.com>  (tiny change)
+
+	* progmodes/octave-mod.el (octave-end-keywords)
+	(octave-block-begin-or-end-regexp, octave-block-match-alist): Add
+	"end" keyword (Bug#3061).
+	(octave-end-as-array-index-p): New function.
+	(calculate-octave-indent): Use it.
+
+2010-01-02  Karl Fogel  <kfogel@red-bean.com>
+
+	* bookmark.el: Consistently put the text property on the bookmark name.
+	(bookmark-bmenu-marks-width): Bump back to 2, to include
+	annotation marks.
+	(bookmark-bmenu-hide-filenames): Adjust for above, and put the text
+	property on the bookmark name, instead of not putting it at all.
+	(bookmark-bmenu-list): Fix where we put the text property.
+
+2010-01-02  Karl Fogel  <kfogel@red-bean.com>
+
+	* bookmark.el (bookmark-bmenu-save): Just depend on the new logic
+	for showing buffer modified state (as added in the previous change).
+
+2010-01-02  Karl Fogel  <kfogel@red-bean.com>
+
+	* bookmark.el: Show modified state of bookmark buffer more accurately.
+	(bookmark-bmenu-list): Initialize buffer-modified-p properly.
+	(bookmark-send-edited-annotation): Mark bookmark-alist as modified.
+	(with-buffer-modified-unmodified): New macro.
+	(bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames)
+	(bookmark-bmenu-mark, bookmark-bmenu-unmark, bookmark-bmenu-delete):
+	Use new macro to preserve the buffer modified state.
+
+2010-01-02  Karl Fogel  <kfogel@red-bean.com>
+
+	* bookmark.el (bookmark-bmenu-select, bookmark-bmenu-1-window,
+	(bookmark-bmenu-2-window, bookmark-bmenu-this-window)
+	(bookmark-bmenu-other-window, bookmark-bmenu-switch-other-window)
+	(bookmark-bmenu-show-annotation, bookmark-bmenu-edit-annotation)
+	(bookmark-bmenu-rename, bookmark-bmenu-locate)
+	(bookmark-bmenu-relocate, bookmark-bmenu-goto-bookmark): Remove
+	unnecessary calls to `bookmark-bmenu-ensure-position'.
+
+2010-01-02  Eli Zaretskii  <eliz@gnu.org>
+
+	* emacs-lisp/easy-mmode.el (define-globalized-minor-mode): Make
+	the lines in the generated doc string shorter.  (Bug#4668)
+
+2010-01-02  Ryan Yeske  <rcyeske@gmail.com>
+
+	* net/rcirc.el: Add follow-link binding (Bug#4738).
+
+2010-01-02  Eli Zaretskii  <eliz@gnu.org>
+
+	* Makefile.in (bzr-update): Renamed from cvs-update.
+	(cvs-update): New target for backward compatibility.
+
+	* makefile.w32-in (bzr-update): Renamed from cvs-update.
+	(cvs-update): New target for backward compatibility.
+
+2010-01-02  Karl Fogel  <kfogel@red-bean.com>
+
+	* bookmark.el: Remove gratuitous gratitude.
+
+2010-01-02  Karl Fogel  <kfogel@red-bean.com>
+
+	* bookmark.el (bookmark-bmenu-any-marks): New function
+	(bookmark-bmenu-save): Clear buffer modification if no marks.
+
+2010-01-02  Karl Fogel  <kfogel@red-bean.com>
+
+	* bookmark.el (bookmark-bmenu-marks-width): Define to 1, not 2.
+	(bookmark-bmenu-list, bookmark-bmenu-bookmark): Calculate property
+	positions by using `bookmark-bmenu-marks-width', instead of hardcoding.
+	This fixes the `bookmark-bmenu-execute-deletions' bug reported here:
+
+	http://lists.gnu.org/archive/html/emacs-devel/2009-12/msg00819.html
+	From: Sun Yijiang <sunyijiang {_AT_} gmail.com>
+	To: emacs-devel {_AT_} gnu.org
+	Subject: bookmark.el bug report
+	Date: Mon, 28 Dec 2009 14:19:16 +0800
+	Message-ID: 5065e2900912272219y3734fc9fsdaee41167ef99ad7@mail.gmail.com
+
+2010-01-02  Karl Fogel  <kfogel@red-bean.com>
+
+	* bookmark.el: Improvements suggested by Drew Adams:
+	(bookmark-bmenu-ensure-position): New name for
+	`bookmark-bmenu-check-position'.  Just ensure the position,
+	don't return any meaningful value.
+	(bookmark-bmenu-header-height, bookmark-bmenu-marks-width):
+	New constants.
+
+2010-01-02  Juanma Barranquero  <lekktu@gmail.com>
+
+	* bookmark.el (bookmarks-already-loaded): Doc fix (don't use `iff').
+	(bookmark-yank-point, bookmark-bmenu-check-position):
+	Fix typos in docstrings.
+	(bookmark-save-flag, bookmark-bmenu-toggle-filenames)
+	(bookmark-name-from-full-record, bookmark-get-position)
+	(bookmark-set-position, bookmark-set, bookmark-handle-bookmark)
+	(bookmark-delete, bookmark-save, bookmark-save, bookmark-bmenu-mode):
+	Remove useless quoting of parenthesis, etc. in docstrings.
+
+	* ediff-mult.el (ediff-prepare-meta-buffer): Fix typo in help message.
+	(ediff-append-custom-diff): Fix typo in error message.
+	(ediff-meta-mark-equal-files): Fix typos in messages.
+
+	* mpc.el (mpc-playlist-delete): Fix typo in error messages.
+
+	* cedet/semantic/db-typecache.el (semanticdb-typecache-find-default):
+	Fix typo in docstring.
+
+	* net/imap-hash.el (imap-hash-make): Doc fix.
+	(imap-hash-test): Fix typo in error message; reflow docstring.
+	(imap-hash-p, imap-hash-get, imap-hash-put, imap-hash-make-message)
+	(imap-hash-count, imap-hash-server, imap-hash-port, imap-hash-ssl)
+	(imap-hash-mailbox, imap-hash-user, imap-hash-password):
+	Fix typos in docstrings.
+	(imap-hash-open-connection): Fix typo in error message.
+
+	* play/gomoku.el (gomoku): Fix typos in docstring.
+
+	* progmodes/gdb-ui.el (gdb-location-alist): Reflow docstring.
+	(gdb-jsonify-buffer): Fix typos in docstring.
+	(gdb-goto-breakpoint): Fix typo in error message.
+	("Display Other Windows"): Fix typo in help message.
+	(gdb-speedbar-expand-node): Fix typo in question.
+
+	* progmodes/idlw-help.el (idlwave-help-browse-url-available)
+	(idlwave-html-system-help-location, idlwave-html-help-location)
+	(idlwave-help-browser-function, idlwave-help-browser-generic-program)
+	(idlwave-help-browser-generic-args, idlwave-help-directory)
+	(idlwave-html-help-is-available, idlwave-help-mode-line-indicator)
+	(idlwave-help-mode-map, idlwave-help-mode, idlwave-do-context-help)
+	(idlwave-online-help, idlwave-help-html-link)
+	(idlwave-help-show-help-frame, idlwave-help-assistant-command):
+	Fix typos in docstrings.
+	(idlwave-help-with-source, idlwave-help-find-routine-definition):
+	Reflow docstrings.
+	(idlwave-help-assistant-start): Fix typo in error message.
+
+	* progmodes/octave-mod.el (octave-mode, octave-electric-semi)
+	(octave-electric-space): Fix typos in docstrings.
+
 2010-01-01  Chong Yidong  <cyd@stupidchicken.com>
 
 	* files.el (minibuffer-with-setup-hook): Doc fix (Bug#5149).
@@ -17,7 +204,7 @@
 
 	Show working revision correctly for mercurial.
 	* vc-hg.el (vc-hg-working-revision): Use hg parent instead of
-	hg log as suggested by Alex Harsanyi <alexharsanyi@gmail.com>,
+	hg log as suggested by Alex Harsanyi <alexharsanyi@gmail.com>.
 
 2009-12-29  Juanma Barranquero  <lekktu@gmail.com>
 
@@ -70,8 +257,7 @@
 	been a secret.  (Further to bug#3717.)
 	(Man-bgproc-sentinel): When "-k foo" produces no output show error
 	"no matches" rather than "Can't find manpage", as the latter reads
-	like -k was interpreted as a page name, which is not so.  (My
-	bug#5431.)
+	like -k was interpreted as a page name, which is not so.  (Bug#5431)
 
 2009-12-26  Michael Albinus  <michael.albinus@gmx.de>
 
--- a/lisp/Makefile.in	Fri Jan 08 13:41:42 2010 +0000
+++ b/lisp/Makefile.in	Tue Jan 19 11:43:25 2010 +0000
@@ -165,8 +165,11 @@
 
 updates: update-subdirs autoloads finder-data custom-deps
 
-# This is useful after "cvs up".
-cvs-update: recompile autoloads finder-data custom-deps
+# This is useful after "bzr up".
+bzr-update: recompile autoloads finder-data custom-deps
+
+# For backwards compatibility:
+cvs-update: bzr-update
 
 # Update the AUTHORS file.
 
--- a/lisp/bookmark.el	Fri Jan 08 13:41:42 2010 +0000
+++ b/lisp/bookmark.el	Tue Jan 19 11:43:25 2010 +0000
@@ -30,51 +30,6 @@
 ;; can navigate your way to that location by providing the string.
 ;; See the "User Variables" section for customizations.
 
-;; Thanks to David Bremner <bremner@cs.sfu.ca> for thinking of and
-;; then implementing the bookmark-current-bookmark idea.  He even
-;; sent *patches*, bless his soul...
-
-;; Thanks to Gregory M. Saunders <saunders@cis.ohio-state.edu> for
-;; fixing and improving bookmark-time-to-save-p.
-
-;; Thanks go to Andrew V. Klein <avk@cig.mot.com> for the code that
-;; sorts the alist before presenting it to the user (in bookmark-bmenu-list
-;; and the menu-bar).
-
-;; And much thanks to David Hughes <djh@harston.cv.com> for many small
-;; suggestions and the code to implement them (like
-;; bookmark-bmenu-check-position, and some of the Lucid compatibility
-;; stuff).
-
-;; Kudos (whatever they are) go to Jim Blandy <jimb@red-bean.com>
-;; for his eminently sensible suggestion to separate bookmark-jump
-;; into bookmark-jump and bookmark-jump-noselect, which made many
-;; other things cleaner as well.
-
-;; Thanks to Roland McGrath for encouragement and help with defining
-;; autoloads on the menu-bar.
-
-;; Jonathan Stigelman <stig@hackvan.com> gave patches for default
-;; values in bookmark-jump and bookmark-set.  Everybody please keep
-;; all the keystrokes they save thereby and send them to him at the
-;; end of each year :-)  (No, seriously, thanks Jonathan!)
-
-;; Buckets of gratitude to John Grabowski <johng@media.mit.edu> for
-;; thinking up the annotations feature and implementing it so well.
-
-;; Based on info-bookmark.el, by Karl Fogel and Ken Olstad
-;; <olstad@msc.edu>.
-
-;; Thanks to Mikio Nakajima <PBC01764@niftyserve.or.jp> for many bugs
-;; reported and fixed.
-
-;; Thank you, Michael Kifer, for contributing the XEmacs support.
-
-;; Enough with the credits already, get on to the good stuff:
-
-;; FAVORITE CHINESE RESTAURANT:
-;; Boy, that's a tough one.  Probably Hong Min, or maybe Emperor's
-;; Choice (both in Chicago's Chinatown).  Well, both.  How about you?
 
 ;;; Code:
 
@@ -107,17 +62,17 @@
 (defcustom bookmark-save-flag t
   "Controls when Emacs saves bookmarks to a file.
 --> nil means never save bookmarks, except when `bookmark-save' is
-    explicitly called \(\\[bookmark-save]\).
+    explicitly called (\\[bookmark-save]).
 --> t means save bookmarks when Emacs is killed.
 --> Otherwise, it should be a number that is the frequency with which
-    the bookmark list is saved \(i.e.: the number of times which
+    the bookmark list is saved (i.e.: the number of times which
     Emacs' bookmark list may be modified before it is automatically
-    saved.\).  If it is a number, Emacs will also automatically save
+    saved.).  If it is a number, Emacs will also automatically save
     bookmarks when it is killed.
 
 Therefore, the way to get it to save every time you make or delete a
-bookmark is to set this variable to 1 \(or 0, which produces the same
-behavior.\)
+bookmark is to set this variable to 1 (or 0, which produces the same
+behavior.)
 
 To specify the file in which to save them, modify the variable
 `bookmark-default-file', which is `~/.emacs.bmk' by default."
@@ -174,6 +129,13 @@
   :group 'bookmark)
 
 
+(defconst bookmark-bmenu-header-height 2
+  "Number of lines used for the *Bookmark List* header.")
+
+(defconst bookmark-bmenu-marks-width 2
+  "Number of columns (chars) used for the *Bookmark List* marks column,
+including the annotations column.")
+
 (defcustom bookmark-bmenu-file-column 30
   "Column at which to display filenames in a buffer listing bookmarks.
 You can toggle whether files are shown with \\<bookmark-bmenu-mode-map>\\[bookmark-bmenu-toggle-filenames]."
@@ -186,7 +148,7 @@
 This may result in truncated bookmark names.  To disable this, put the
 following in your `.emacs' file:
 
-\(setq bookmark-bmenu-toggle-filenames nil\)"
+\(setq bookmark-bmenu-toggle-filenames nil)"
   :type 'boolean
   :group 'bookmark)
 
@@ -292,7 +254,7 @@
  for instance.  HANDLER must accept a bookmark as argument.")
 
 (defvar bookmarks-already-loaded nil
-  "Non-nil iff bookmarks have been loaded from `bookmark-default-file'.")
+  "Non-nil if and only if bookmarks have been loaded from `bookmark-default-file'.")
 
 
 ;; more stuff added by db.
@@ -322,21 +284,28 @@
 
 (defvar bookmark-yank-point 0
   "The next point from which to pull source text for `bookmark-yank-word'.
-This point is in `bookmark-curent-buffer'.")
+This point is in `bookmark-current-buffer'.")
 
 
 (defvar bookmark-quit-flag nil
   "Non nil make `bookmark-bmenu-search' quit immediately.")
 
-;; Helper functions.
+;; Helper functions and macros.
 
-;; Only functions on this page and the next one (file formats) need to
-;; know anything about the format of bookmark-alist entries.
+(defmacro with-buffer-modified-unmodified (&rest body)
+  "Run BODY while preserving the buffer's `buffer-modified-p' state."
+  (let ((was-modified (make-symbol "was-modified")))
+    `(let ((,was-modified (buffer-modified-p)))
+       (unwind-protect
+           (progn ,@body)
+         (set-buffer-modified-p ,was-modified)))))
+
+;; Only functions below, in this page and the next one (file formats),
+;; need to know anything about the format of bookmark-alist entries.
 ;; Everyone else should go through them.
 
-
 (defun bookmark-name-from-full-record (full-record)
-  "Return name of FULL-RECORD \(an alist element instead of a string\)."
+  "Return name of FULL-RECORD (an alist element instead of a string)."
   (car full-record))
 
 
@@ -414,13 +383,13 @@
 
 
 (defun bookmark-get-position (bookmark)
-  "Return the position \(i.e.: point\) of BOOKMARK, or nil if none.
+  "Return the position (i.e.: point) of BOOKMARK, or nil if none.
 BOOKMARK may be a bookmark name (a string) or a bookmark record."
   (bookmark-prop-get bookmark 'position))
 
 
 (defun bookmark-set-position (bookmark position)
-  "Set the position \(i.e.: point\) of BOOKMARK to POSITION.
+  "Set the position (i.e.: point) of BOOKMARK to POSITION.
 BOOKMARK may be a bookmark name (a string) or a bookmark record."
   (bookmark-prop-set bookmark 'position position))
 
@@ -800,9 +769,9 @@
 large document.  If there is no prior bookmark for this document, then
 C-u inserts an appropriate name based on the buffer or file.
 
-Use \\[bookmark-delete] to remove bookmarks \(you give it a name and
+Use \\[bookmark-delete] to remove bookmarks (you give it a name and
 it removes only the first instance of a bookmark with that name from
-the list of bookmarks.\)"
+the list of bookmarks.)"
   (interactive (list nil current-prefix-arg))
   (let* ((record (bookmark-make-record))
          (default (car record)))
@@ -905,6 +874,8 @@
   (let ((annotation (buffer-substring-no-properties (point-min) (point-max)))
 	(bookmark bookmark-annotation-name))
     (bookmark-set-annotation bookmark annotation)
+    (setq bookmark-alist-modification-count
+          (1+ bookmark-alist-modification-count))
     (bookmark-bmenu-surreptitiously-rebuild-list))
   (kill-buffer (current-buffer)))
 
@@ -953,7 +924,7 @@
 (defun bookmark-yank-word ()
   "Get the next word from buffer `bookmark-current-buffer' and append
 it to the name of the bookmark currently being set, advancing
-`bookmark-yank-point' by one word." 
+`bookmark-yank-point' by one word."
   (interactive)
   (let ((string (with-current-buffer bookmark-current-buffer
                   (goto-char bookmark-yank-point)
@@ -1125,7 +1096,7 @@
                                   'bookmark-default-handler)
                               (bookmark-get-bookmark bookmark)))
                  (message
-                  "Bookmark not relocated; consider removing it \(%s\)."
+                  "Bookmark not relocated; consider removing it (%s)."
                   bookmark)
                  (signal (car err) (cdr err))))))))))
   ;; Added by db.
@@ -1248,7 +1219,7 @@
               "New name: "
               nil
               (let ((now-map (copy-keymap minibuffer-local-map)))
-                (define-key now-map  "\C-w" 'bookmark-yank-word)
+                (define-key now-map "\C-w" 'bookmark-yank-word)
                 now-map)
               nil
               'bookmark-history))))
@@ -1290,8 +1261,8 @@
 
 Removes only the first instance of a bookmark with that name.  If
 there are one or more other bookmarks with the same name, they will
-not be deleted.  Defaults to the \"current\" bookmark \(that is, the
-one most recently used in this file, if any\).
+not be deleted.  Defaults to the \"current\" bookmark (that is, the
+one most recently used in this file, if any).
 Optional second arg BATCH means don't update the bookmark list buffer,
 probably because we were called from there."
   (interactive
@@ -1342,7 +1313,7 @@
   "Save currently defined bookmarks.
 Saves by default in the file defined by the variable
 `bookmark-default-file'.  With a prefix arg, save it in file FILE
-\(second argument\).
+\(second argument).
 
 If you are calling this from Lisp, the two arguments are PARG and
 FILE, and if you just want it to write to the default file, then
@@ -1351,7 +1322,7 @@
 user will be interactively queried for a file to save in.
 
 When you want to load in the bookmarks from a file, use
-\`bookmark-load\', \\[bookmark-load].  That function will prompt you
+`bookmark-load', \\[bookmark-load].  That function will prompt you
 for a file, defaulting to the file defined by variable
 `bookmark-default-file'."
   (interactive "P")
@@ -1389,7 +1360,7 @@
       ;; Rather than a single call to `pp' we make one per bookmark.
       ;; Apparently `pp' has a poor algorithmic complexity, so this
       ;; scales a lot better.  bug#4485.
-      (dolist (i  bookmark-alist) (pp i (current-buffer)))
+      (dolist (i bookmark-alist) (pp i (current-buffer)))
       (insert ")")
       (let ((version-control
              (cond
@@ -1586,14 +1557,16 @@
                     " *" "  ")
                 name)
         (setq end (point))
-        (put-text-property start (+ 2 start) 'bookmark-name-prop name)
+        (put-text-property
+         (+ bookmark-bmenu-marks-width start) end 'bookmark-name-prop name)
         (when (display-mouse-p)
           (add-text-properties
-           (+ 2 start) end
+           (+ bookmark-bmenu-marks-width start) end
            '(mouse-face highlight
              follow-link t
              help-echo "mouse-2: go to this bookmark in other window")))
         (insert "\n")))
+    (set-buffer-modified-p (not (= bookmark-alist-modification-count 0)))
     (goto-char (point-min))
     (forward-line 2)
     (bookmark-bmenu-mode)
@@ -1625,8 +1598,8 @@
 \\[bookmark-bmenu-other-window] -- select this bookmark in another window,
   so the bookmark menu bookmark remains visible in its window.
 \\[bookmark-bmenu-switch-other-window] -- switch the other window to this bookmark.
-\\[bookmark-bmenu-rename] -- rename this bookmark \(prompts for new name\).
-\\[bookmark-bmenu-relocate] -- relocate this bookmark's file \(prompts for new file\).
+\\[bookmark-bmenu-rename] -- rename this bookmark (prompts for new name).
+\\[bookmark-bmenu-relocate] -- relocate this bookmark's file (prompts for new file).
 \\[bookmark-bmenu-delete] -- mark this bookmark to be deleted, and move down.
 \\[bookmark-bmenu-delete-backwards] -- mark this bookmark to be deleted, and move up.
 \\[bookmark-bmenu-execute-deletions] -- delete bookmarks marked with `\\[bookmark-bmenu-delete]'.
@@ -1672,26 +1645,27 @@
 mainly for debugging, and should not be necessary in normal use."
   (if (and (not force) bookmark-bmenu-toggle-filenames)
       nil ;already shown, so do nothing
-    (save-excursion
-      (save-window-excursion
-        (goto-char (point-min))
-        (forward-line 2)
-        (setq bookmark-bmenu-hidden-bookmarks ())
-        (let ((inhibit-read-only t))
-          (while (< (point) (point-max))
-            (let ((bmrk (bookmark-bmenu-bookmark)))
-              (push bmrk bookmark-bmenu-hidden-bookmarks)
-	      (let ((start (save-excursion (end-of-line) (point))))
-		(move-to-column bookmark-bmenu-file-column t)
-		;; Strip off `mouse-face' from the white spaces region.
-		(if (display-mouse-p)
-		    (remove-text-properties start (point)
-					    '(mouse-face nil help-echo nil))))
-	      (delete-region (point) (progn (end-of-line) (point)))
-              (insert "  ")
-              ;; Pass the NO-HISTORY arg:
-              (bookmark-insert-location bmrk t)
-              (forward-line 1))))))))
+    (with-buffer-modified-unmodified
+     (save-excursion
+       (save-window-excursion
+         (goto-char (point-min))
+         (forward-line 2)
+         (setq bookmark-bmenu-hidden-bookmarks ())
+         (let ((inhibit-read-only t))
+           (while (< (point) (point-max))
+             (let ((bmrk (bookmark-bmenu-bookmark)))
+               (push bmrk bookmark-bmenu-hidden-bookmarks)
+               (let ((start (save-excursion (end-of-line) (point))))
+                 (move-to-column bookmark-bmenu-file-column t)
+                 ;; Strip off `mouse-face' from the white spaces region.
+                 (if (display-mouse-p)
+                     (remove-text-properties start (point)
+                                             '(mouse-face nil help-echo nil))))
+               (delete-region (point) (progn (end-of-line) (point)))
+               (insert "  ")
+               ;; Pass the NO-HISTORY arg:
+               (bookmark-insert-location bmrk t)
+               (forward-line 1)))))))))
 
 
 (defun bookmark-bmenu-hide-filenames (&optional force)
@@ -1700,59 +1674,47 @@
 mainly for debugging, and should not be necessary in normal use."
   (when (and (not force) bookmark-bmenu-toggle-filenames)
     ;; nothing to hide if above is nil
-    (save-excursion
-      (goto-char (point-min))
-      (forward-line 2)
-      (setq bookmark-bmenu-hidden-bookmarks
-            (nreverse bookmark-bmenu-hidden-bookmarks))
-      (let ((inhibit-read-only t)
-            (column (save-excursion
-                      (goto-char (point-min))
-                      (search-forward "Bookmark")
-                      (backward-word 1)
-                      (current-column))))
-        (while bookmark-bmenu-hidden-bookmarks
-          (move-to-column column t)
-          (bookmark-kill-line)
-          (let ((name  (pop bookmark-bmenu-hidden-bookmarks))
-                (start (point)))
-            (insert name)
-            (if (display-mouse-p)
-                (add-text-properties
-                 start (point)
-                 '(mouse-face highlight
-                   follow-link t
-                   help-echo
-                   "mouse-2: go to this bookmark in other window"))))
-          (forward-line 1))))))
+    (with-buffer-modified-unmodified
+     (save-excursion
+       (goto-char (point-min))
+       (forward-line 2)
+       (setq bookmark-bmenu-hidden-bookmarks
+             (nreverse bookmark-bmenu-hidden-bookmarks))
+       (let ((inhibit-read-only t))
+         (while bookmark-bmenu-hidden-bookmarks
+           (move-to-column bookmark-bmenu-marks-width t)
+           (bookmark-kill-line)
+           (let ((name  (pop bookmark-bmenu-hidden-bookmarks))
+                 (start (point)))
+             (insert name)
+             (put-text-property start (point) 'bookmark-name-prop name)
+             (if (display-mouse-p)
+                 (add-text-properties
+                  start (point)
+                  '(mouse-face
+                    highlight follow-link t help-echo
+                    "mouse-2: go to this bookmark in other window"))))
+           (forward-line 1)))))))
 
 
-(defun bookmark-bmenu-check-position ()
+(defun bookmark-bmenu-ensure-position ()
   "If point is not on a bookmark line, move it to one.
-If before the first bookmark line, move it to the first.
-If after the last, move it to the last.
-Return `bookmark-alist'"
-  ;; FIXME: The doc string originally implied that this returns nil if
-  ;; not on a bookmark, which is false.  Is there any real reason to
-  ;; return `bookmark-alist'?  This seems to be called in a few places
-  ;; as a check of whether point is on a bookmark line.  Those
-  ;; "checks" are in fact no-ops, since this never returns nil.
-  ;; -dadams, 2009-10-10
-  (cond ((< (count-lines (point-min) (point)) 2)
+If before the first bookmark line, move to the first; if after the
+last full line, move to the last full line.  The return value is undefined."
+  (cond ((< (count-lines (point-min) (point)) bookmark-bmenu-header-height)
          (goto-char (point-min))
-         (forward-line 2)
-         bookmark-alist)
+         (forward-line bookmark-bmenu-header-height))
         ((and (bolp) (eobp))
-         (beginning-of-line 0)
-         bookmark-alist)
-        (t
-         bookmark-alist)))
+         (beginning-of-line 0))))
 
 
 (defun bookmark-bmenu-bookmark ()
   "Return the bookmark for this line in an interactive bookmark list buffer."
-  (when (bookmark-bmenu-check-position)
-    (get-text-property (line-beginning-position) 'bookmark-name-prop)))
+  (bookmark-bmenu-ensure-position)
+  (save-excursion
+    (beginning-of-line)
+    (forward-char bookmark-bmenu-marks-width)
+    (get-text-property (point) 'bookmark-name-prop)))
 
 
 (defun bookmark-show-annotation (bookmark)
@@ -1796,44 +1758,58 @@
   "Mark bookmark on this line to be displayed by \\<bookmark-bmenu-mode-map>\\[bookmark-bmenu-select]."
   (interactive)
   (beginning-of-line)
-  (if (bookmark-bmenu-check-position)
-      (let ((inhibit-read-only t))
-        (delete-char 1)
-        (insert ?>)
-        (forward-line 1)
-        (bookmark-bmenu-check-position))))
+  (bookmark-bmenu-ensure-position)
+  (with-buffer-modified-unmodified
+   (let ((inhibit-read-only t))
+     (delete-char 1)
+     (insert ?>)
+     (forward-line 1)
+     (bookmark-bmenu-ensure-position))))
 
 
 (defun bookmark-bmenu-select ()
   "Select this line's bookmark; also display bookmarks marked with `>'.
 You can mark bookmarks with the \\<bookmark-bmenu-mode-map>\\[bookmark-bmenu-mark] command."
   (interactive)
-  (if (bookmark-bmenu-check-position)
-      (let ((bmrk (bookmark-bmenu-bookmark))
-            (menu (current-buffer))
-            (others ())
-            tem)
-        (goto-char (point-min))
-        (while (re-search-forward "^>" nil t)
-          (setq tem (bookmark-bmenu-bookmark))
-          (let ((inhibit-read-only t))
-            (delete-char -1)
-            (insert ?\s))
-          (or (string-equal tem bmrk)
-              (member tem others)
-              (setq others (cons tem others))))
-        (setq others (nreverse others)
-              tem (/ (1- (frame-height)) (1+ (length others))))
-        (delete-other-windows)
-        (bookmark-jump bmrk)
-        (bury-buffer menu)
-        (if others
-            (while others
-              (split-window nil tem)
-              (other-window 1)
-              (bookmark-jump (car others))
-              (setq others (cdr others)))
-          (other-window 1)))))
+  (let ((bmrk (bookmark-bmenu-bookmark))
+        (menu (current-buffer))
+        (others ())
+        tem)
+    (goto-char (point-min))
+    (while (re-search-forward "^>" nil t)
+      (setq tem (bookmark-bmenu-bookmark))
+      (let ((inhibit-read-only t))
+        (delete-char -1)
+        (insert ?\s))
+      (or (string-equal tem bmrk)
+          (member tem others)
+          (setq others (cons tem others))))
+    (setq others (nreverse others)
+          tem (/ (1- (frame-height)) (1+ (length others))))
+    (delete-other-windows)
+    (bookmark-jump bmrk)
+    (bury-buffer menu)
+    (if others
+        (while others
+          (split-window nil tem)
+          (other-window 1)
+          (bookmark-jump (car others))
+          (setq others (cdr others)))
+      (other-window 1))))
+
+
+(defun bookmark-bmenu-any-marks ()
+  "Return non-nil if any bookmarks are marked in the marks column."
+  (save-excursion
+    (goto-char (point-min))
+    (bookmark-bmenu-ensure-position)
+    (catch 'found-mark
+      (while (not (eobp))
+        (beginning-of-line)
+        (if (looking-at "^\\S-")
+            (throw 'found-mark t)
+          (forward-line 1)))
+      nil)))
 
 
 (defun bookmark-bmenu-save (parg)
@@ -1842,57 +1818,53 @@
   (interactive "P")
   (save-excursion
     (save-window-excursion
-      (bookmark-save parg))))
+      (bookmark-save parg)
+      (set-buffer-modified-p nil))))
 
 
 (defun bookmark-bmenu-load ()
   "Load the bookmark file and rebuild the bookmark menu-buffer."
   (interactive)
-  (if (bookmark-bmenu-check-position)
-      (save-excursion
-        (save-window-excursion
-          ;; This will call `bookmark-bmenu-list'
-          (call-interactively 'bookmark-load)))))
+  (bookmark-bmenu-ensure-position)
+  (save-excursion
+    (save-window-excursion
+      ;; This will call `bookmark-bmenu-list'
+      (call-interactively 'bookmark-load))))
 
 
 (defun bookmark-bmenu-1-window ()
   "Select this line's bookmark, alone, in full frame."
   (interactive)
-  (if (bookmark-bmenu-check-position)
-      (progn
-        (bookmark-jump (bookmark-bmenu-bookmark))
-        (bury-buffer (other-buffer))
-        (delete-other-windows))))
+  (bookmark-jump (bookmark-bmenu-bookmark))
+  (bury-buffer (other-buffer))
+  (delete-other-windows))
 
 
 (defun bookmark-bmenu-2-window ()
   "Select this line's bookmark, with previous buffer in second window."
   (interactive)
-  (if (bookmark-bmenu-check-position)
-      (let ((bmrk (bookmark-bmenu-bookmark))
-            (menu (current-buffer))
-            (pop-up-windows t))
-        (delete-other-windows)
-        (switch-to-buffer (other-buffer))
-        (let ((bookmark-automatically-show-annotations nil)) ;FIXME: needed?
-          (bookmark--jump-via bmrk 'pop-to-buffer))
-        (bury-buffer menu))))
+  (let ((bmrk (bookmark-bmenu-bookmark))
+        (menu (current-buffer))
+        (pop-up-windows t))
+    (delete-other-windows)
+    (switch-to-buffer (other-buffer))
+    (let ((bookmark-automatically-show-annotations nil)) ;FIXME: needed?
+      (bookmark--jump-via bmrk 'pop-to-buffer))
+    (bury-buffer menu)))
 
 
 (defun bookmark-bmenu-this-window ()
   "Select this line's bookmark in this window."
   (interactive)
-  (if (bookmark-bmenu-check-position)
-      (bookmark-jump (bookmark-bmenu-bookmark))))
+  (bookmark-jump (bookmark-bmenu-bookmark)))
 
 
 (defun bookmark-bmenu-other-window ()
   "Select this line's bookmark in other window, leaving bookmark menu visible."
   (interactive)
   (let ((bookmark (bookmark-bmenu-bookmark)))
-    (if (bookmark-bmenu-check-position)
-        (let ((bookmark-automatically-show-annotations t)) ;FIXME: needed?
-          (bookmark--jump-via bookmark 'switch-to-buffer-other-window)))))
+    (let ((bookmark-automatically-show-annotations t)) ;FIXME: needed?
+      (bookmark--jump-via bookmark 'switch-to-buffer-other-window))))
 
 
 (defun bookmark-bmenu-switch-other-window ()
@@ -1903,9 +1875,8 @@
         (pop-up-windows t)
         same-window-buffer-names
         same-window-regexps)
-    (if (bookmark-bmenu-check-position)
-        (let ((bookmark-automatically-show-annotations t)) ;FIXME: needed?
-          (bookmark--jump-via bookmark 'display-buffer)))))
+    (let ((bookmark-automatically-show-annotations t)) ;FIXME: needed?
+      (bookmark--jump-via bookmark 'display-buffer))))
 
 (defun bookmark-bmenu-other-window-with-mouse (event)
   "Select bookmark at the mouse pointer in other window, leaving bookmark menu visible."
@@ -1920,8 +1891,7 @@
   "Show the annotation for the current bookmark in another window."
   (interactive)
   (let ((bookmark (bookmark-bmenu-bookmark)))
-    (if (bookmark-bmenu-check-position)
-	(bookmark-show-annotation bookmark))))
+    (bookmark-show-annotation bookmark)))
 
 
 (defun bookmark-bmenu-show-all-annotations ()
@@ -1934,8 +1904,7 @@
   "Edit the annotation for the current bookmark in another window."
   (interactive)
   (let ((bookmark (bookmark-bmenu-bookmark)))
-    (if (bookmark-bmenu-check-position)
-	(bookmark-edit-annotation bookmark))))
+    (bookmark-edit-annotation bookmark)))
 
 
 (defun bookmark-bmenu-unmark (&optional backup)
@@ -1943,27 +1912,26 @@
 Optional BACKUP means move up."
   (interactive "P")
   (beginning-of-line)
-  (if (bookmark-bmenu-check-position)
-      (progn
-        (let ((inhibit-read-only t))
-          (delete-char 1)
-          ;; any flags to reset according to circumstances?  How about a
-          ;; flag indicating whether this bookmark is being visited?
-          ;; well, we don't have this now, so maybe later.
-          (insert " "))
-        (forward-line (if backup -1 1))
-        (bookmark-bmenu-check-position))))
+  (bookmark-bmenu-ensure-position)
+  (with-buffer-modified-unmodified
+   (let ((inhibit-read-only t))
+     (delete-char 1)
+     ;; any flags to reset according to circumstances?  How about a
+     ;; flag indicating whether this bookmark is being visited?
+     ;; well, we don't have this now, so maybe later.
+     (insert " "))
+   (forward-line (if backup -1 1))
+   (bookmark-bmenu-ensure-position)))
 
 
 (defun bookmark-bmenu-backup-unmark ()
   "Move up and cancel all requested operations on bookmark on line above."
   (interactive)
   (forward-line -1)
-  (if (bookmark-bmenu-check-position)
-      (progn
-        (bookmark-bmenu-unmark)
-        (forward-line -1)
-        (bookmark-bmenu-check-position))))
+  (bookmark-bmenu-ensure-position)
+  (bookmark-bmenu-unmark)
+  (forward-line -1)
+  (bookmark-bmenu-ensure-position))
 
 
 (defun bookmark-bmenu-delete ()
@@ -1971,12 +1939,13 @@
 To carry out the deletions that you've marked, use \\<bookmark-bmenu-mode-map>\\[bookmark-bmenu-execute-deletions]."
   (interactive)
   (beginning-of-line)
-  (if (bookmark-bmenu-check-position)
-      (let ((inhibit-read-only t))
-        (delete-char 1)
-        (insert ?D)
-        (forward-line 1)
-        (bookmark-bmenu-check-position))))
+  (bookmark-bmenu-ensure-position)
+  (with-buffer-modified-unmodified
+   (let ((inhibit-read-only t))
+     (delete-char 1)
+     (insert ?D)
+     (forward-line 1)
+     (bookmark-bmenu-ensure-position))))
 
 
 (defun bookmark-bmenu-delete-backwards ()
@@ -1985,9 +1954,9 @@
   (interactive)
   (bookmark-bmenu-delete)
   (forward-line -2)
-  (if (bookmark-bmenu-check-position)
-      (forward-line 1))
-  (bookmark-bmenu-check-position))
+  (bookmark-bmenu-ensure-position)
+  (forward-line 1)
+  (bookmark-bmenu-ensure-position))
 
 
 (defun bookmark-bmenu-execute-deletions ()
@@ -2022,29 +1991,26 @@
 (defun bookmark-bmenu-rename ()
   "Rename bookmark on current line.  Prompts for a new name."
   (interactive)
-  (if (bookmark-bmenu-check-position)
-      (let ((bmrk (bookmark-bmenu-bookmark))
-            (thispoint (point)))
-        (bookmark-rename bmrk)
-        (goto-char thispoint))))
+  (let ((bmrk (bookmark-bmenu-bookmark))
+        (thispoint (point)))
+    (bookmark-rename bmrk)
+    (goto-char thispoint)))
 
 
 (defun bookmark-bmenu-locate ()
   "Display location of this bookmark.  Displays in the minibuffer."
   (interactive)
-  (if (bookmark-bmenu-check-position)
-      (let ((bmrk (bookmark-bmenu-bookmark)))
-        (message "%s" (bookmark-location bmrk)))))
+  (let ((bmrk (bookmark-bmenu-bookmark)))
+    (message "%s" (bookmark-location bmrk))))
 
 (defun bookmark-bmenu-relocate ()
   "Change the file path of the bookmark on the current line,
   prompting with completion for the new path."
   (interactive)
-  (if (bookmark-bmenu-check-position)
-      (let ((bmrk (bookmark-bmenu-bookmark))
-            (thispoint (point)))
-        (bookmark-relocate bmrk)
-        (goto-char thispoint))))
+  (let ((bmrk (bookmark-bmenu-bookmark))
+        (thispoint (point)))
+    (bookmark-relocate bmrk)
+    (goto-char thispoint)))
 
 ;;; Bookmark-bmenu search
 
@@ -2101,15 +2067,14 @@
       (when bookmark-quit-flag        ; C-g hit restore menu list.
         (bookmark-bmenu-list) (bookmark-bmenu-goto-bookmark bmk))
       (setq bookmark-quit-flag nil))))
-      
+
 (defun bookmark-bmenu-goto-bookmark (name)
   "Move point to bookmark with name NAME."
   (goto-char (point-min))
-  (bookmark-bmenu-check-position)
   (while (not (equal name (bookmark-bmenu-bookmark)))
     (forward-line 1))
   (forward-line 0))
-          
+
 
 
 ;;; Menu bar stuff.  Prefix is "bookmark-menu".
--- a/lisp/cedet/semantic/db-typecache.el	Fri Jan 08 13:41:42 2010 +0000
+++ b/lisp/cedet/semantic/db-typecache.el	Tue Jan 19 11:43:25 2010 +0000
@@ -111,7 +111,7 @@
 	 )
     (object-add-to-list cache 'dependants dep)))
 
-(defun semanticdb-typecache-length(thing)
+(defun semanticdb-typecache-length (thing)
   "How long is THING?
 Debugging function."
   (cond ((semanticdb-typecache-child-p thing)
@@ -383,7 +383,7 @@
 (defun semanticdb-typecache-find-default (type &optional path find-file-match)
   "Default implementation of `semanticdb-typecache-find'.
 TYPE is the datatype to find.
-PATH is the search path.. which should be one table object.
+PATH is the search path, which should be one table object.
 If FIND-FILE-MATCH is non-nil, then force the file belonging to the
 found tag to be loaded."
   (semanticdb-typecache-find-method (or path semanticdb-current-table)
--- a/lisp/ediff-mult.el	Fri Jan 08 13:41:42 2010 +0000
+++ b/lisp/ediff-mult.el	Tue Jan 19 11:43:25 2010 +0000
@@ -330,7 +330,7 @@
 ;; This nil is a placeholder for eq-indicator. It is either nil or =.
 ;; If it is discovered that this file is = to some other
 ;; file in the same session, eq-indicator is changed to `='.
-;; Curently, the eq-indicator is used only for 2 and 3-file jobs.
+;; Currently, the eq-indicator is used only for 2 and 3-file jobs.
 (defun ediff-make-new-meta-list-element (obj1 obj2 obj3)
   (list nil nil (list obj1 nil) (list obj2 nil) (list obj3 nil)))
 
@@ -879,7 +879,7 @@
 	    (define-key ediff-meta-buffer-map
 	      [menu-bar ediff-meta-mode ediff-mark-for-operation-at-pos]
 	      '(menu-item "Mark for group operation" ediff-mark-for-operation-at-pos
-		  :help "Mark session for a group operation.  With prefix arg, unmark."))
+		  :help "Mark session for a group operation.  With prefix arg, unmark"))
 
 	    (define-key ediff-meta-buffer-map
 	      [menu-bar ediff-meta-mode ediff-unmark-all-for-hiding]
@@ -1739,7 +1739,7 @@
 	     (insert "\n")))
 	  (t
 	   (ediff-kill-buffer-carefully meta-diff-buff)
-	   (error "Session %d compares versions of file. Such session must be active to enable multifile patch collection" sessionNum )))
+	   (error "Session %d compares versions of file.  Such session must be active to enable multifile patch collection" sessionNum )))
     ))
 
 (defun ediff-collect-custom-diffs ()
@@ -2421,7 +2421,7 @@
   (let ((list (cdr ediff-meta-list))
 	marked1 marked2 marked3
 	fileinfo1 fileinfo2 fileinfo3 elt)
-    (message "Comparing files ...")
+    (message "Comparing files...")
     (while (setq elt (car list))
       (setq fileinfo1 (ediff-get-session-objA elt)
 	    fileinfo2 (ediff-get-session-objB elt)
@@ -2448,7 +2448,7 @@
 		 (ediff-mark-session-for-operation elt 'mark))
 		))
       (setq list (cdr list)))
-    (message "Comparing files ... Done"))
+    (message "Comparing files... Done"))
   (setq ediff-recurse-to-subdirectories nil)
   (ediff-update-meta-buffer (current-buffer) 'must-redraw))
 
--- a/lisp/emacs-lisp/easy-mmode.el	Fri Jan 08 13:41:42 2010 +0000
+++ b/lisp/emacs-lisp/easy-mmode.el	Tue Jan 19 11:43:25 2010 +0000
@@ -326,9 +326,13 @@
        (make-variable-buffer-local ',MODE-major-mode)
        ;; The actual global minor-mode
        (define-minor-mode ,global-mode
+	 ;; Very short lines to avoid too long lines in the generated
+	 ;; doc string.
 	 ,(format "Toggle %s in every possible buffer.
-With prefix ARG, turn %s on if and only if ARG is positive.
-%s is enabled in all buffers where `%s' would do it.
+With prefix ARG, turn %s on if and only if
+ARG is positive.
+%s is enabled in all buffers where
+\`%s' would do it.
 See `%s' for more information on %s."
 		  pretty-name pretty-global-name pretty-name turn-on
 		  mode pretty-name)
--- a/lisp/font-setting.el	Fri Jan 08 13:41:42 2010 +0000
+++ b/lisp/font-setting.el	Tue Jan 19 11:43:25 2010 +0000
@@ -57,7 +57,7 @@
 	(if (display-graphic-p f)
 	    (let* ((frame-font
 		    (or (font-get (face-attribute 'default :font f
-						  'default) :name)
+						  'default) :user-spec)
 			(frame-parameter f 'font-parameter)))
 		   (font-to-set
 		    (if set-font new-font
--- a/lisp/gnus/ChangeLog	Fri Jan 08 13:41:42 2010 +0000
+++ b/lisp/gnus/ChangeLog	Tue Jan 19 11:43:25 2010 +0000
@@ -1,3 +1,34 @@
+2010-01-06  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* gnus-art.el (gnus-article-describe-bindings): Work for prefix keys.
+
+	* message.el (message-check-news-header-syntax): Protect against a
+	string that `rfc822-addresses' returns when parsing fails.
+
+2010-01-06  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* gnus-util.el (gnus-invisible-p, gnus-next-char-property-change)
+	(gnus-previous-char-property-change): New functions.
+
+	* gnus-sum.el (gnus-forward-line-ignore-invisible): Use them.
+
+2010-01-05  Andreas Schwab  <schwab@linux-m68k.org>
+
+	* gnus-sum.el (gnus-forward-line-ignore-invisible): New function.
+	(gnus-summary-recenter): Use it instead of forward-line.  (Bug#5257)
+
+2010-01-02  Chong Yidong  <cyd@stupidchicken.com>
+
+	* message.el (message-exchange-point-and-mark): Rework last change to
+	avoid using optional arg of exchange-point-and-mark, for backward
+	compatibility.
+
+2010-01-01  Chong Yidong  <cyd@stupidchicken.com>
+
+	* message.el (message-exchange-point-and-mark): Call
+	exchange-point-and-mark with an argument rather than setting
+	mark-active by hand (Bug#5175).
+
 2009-12-18  Katsumi Yamaoka  <yamaoka@jpl.org>
 
 	* nntp.el (nntp-service-to-port): Work for service expressed with
@@ -13776,7 +13807,7 @@
 
 See ChangeLog.2 for earlier changes.
 
-    Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+    Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
--- a/lisp/gnus/gnus-art.el	Fri Jan 08 13:41:42 2010 +0000
+++ b/lisp/gnus/gnus-art.el	Tue Jan 19 11:43:25 2010 +0000
@@ -6477,10 +6477,17 @@
   (let ((keymap (copy-keymap gnus-article-mode-map))
 	(map (copy-keymap gnus-article-send-map))
 	(sumkeys (where-is-internal 'gnus-article-read-summary-keys))
-	agent draft)
+	parent agent draft)
     (define-key keymap "S" map)
     (define-key map [t] nil)
     (with-current-buffer gnus-article-current-summary
+      (set-keymap-parent
+       keymap
+       (if (setq parent (keymap-parent gnus-article-mode-map))
+	   (prog1
+	       (setq parent (copy-keymap parent))
+	     (set-keymap-parent parent (current-local-map)))
+	 (current-local-map)))
       (set-keymap-parent map (key-binding "S"))
       (let (key def gnus-pick-mode)
 	(while sumkeys
--- a/lisp/gnus/gnus-sum.el	Fri Jan 08 13:41:42 2010 +0000
+++ b/lisp/gnus/gnus-sum.el	Tue Jan 19 11:43:25 2010 +0000
@@ -6727,6 +6727,26 @@
 
 (put 'gnus-recenter 'isearch-scroll t)
 
+(defun gnus-forward-line-ignore-invisible (n)
+  "Move N lines forward (backward if N is negative).
+Like forward-line, but skip over (and don't count) invisible lines."
+  (let (done)
+    (while (and (> n 0) (not done))
+      ;; If the following character is currently invisible,
+      ;; skip all characters with that same `invisible' property value.
+      (while (gnus-invisible-p (point))
+	(goto-char (gnus-next-char-property-change (point))))
+      (forward-line 1)
+      (if (eobp)
+	  (setq done t)
+	(setq n (1- n))))
+    (while (and (< n 0) (not done))
+      (forward-line -1)
+      (if (bobp) (setq done t)
+	(setq n (1+ n))
+	(while (and (not (bobp)) (gnus-invisible-p (1- (point))))
+	  (goto-char (gnus-previous-char-property-change (point))))))))
+
 (defun gnus-summary-recenter ()
   "Center point in the summary window.
 If `gnus-auto-center-summary' is nil, or the article buffer isn't
@@ -6742,16 +6762,19 @@
 			     gnus-auto-center-summary
                            (/ (1- (window-height)) 2)))))
 	   (height (1- (window-height)))
-	   (bottom (save-excursion (goto-char (point-max))
-				   (forward-line (- height))
-				   (point)))
+	   (bottom (save-excursion
+		     (goto-char (point-max))
+		     (gnus-forward-line-ignore-invisible (- height))
+		     (point)))
 	   (window (get-buffer-window (current-buffer))))
       (when (get-buffer-window gnus-article-buffer)
 	;; Only do recentering when the article buffer is displayed,
 	;; Set the window start to either `bottom', which is the biggest
 	;; possible valid number, or the second line from the top,
 	;; whichever is the least.
-	(let ((top-pos (save-excursion (forward-line (- top)) (point))))
+	(let ((top-pos (save-excursion
+			 (gnus-forward-line-ignore-invisible (- top))
+			 (point))))
 	  (if (> bottom top-pos)
 	      ;; Keep the second line from the top visible
 	      (set-window-start window top-pos)
@@ -6760,12 +6783,12 @@
 	    ;; visible, or revert to using TOP-POS.
 	    (save-excursion
 	      (goto-char (point-max))
-	      (forward-line -1)
+	      (gnus-forward-line-ignore-invisible -1)
 	      (let ((last-line-start (point)))
 		(goto-char bottom)
 		(set-window-start window (point) t)
 		(when (not (pos-visible-in-window-p last-line-start window))
-		  (forward-line 1)
+		  (gnus-forward-line-ignore-invisible 1)
 		  (set-window-start window (min (point) top-pos) t)))))))
       ;; Do horizontal recentering while we're at it.
       (when (and (get-buffer-window (current-buffer) t)
--- a/lisp/gnus/gnus-util.el	Fri Jan 08 13:41:42 2010 +0000
+++ b/lisp/gnus/gnus-util.el	Tue Jan 19 11:43:25 2010 +0000
@@ -969,6 +969,29 @@
 			  (overlay-get overlay 'face))
 			(overlays-at pos)))))))
 
+(if (fboundp 'invisible-p)
+    (defalias 'gnus-invisible-p 'invisible-p)
+  ;; for Emacs < 22.2, and XEmacs.
+  (defun gnus-invisible-p (pos)
+    "Return non-nil if the character after POS is currently invisible."
+    (let ((prop (get-char-property pos 'invisible)))
+      (if (eq buffer-invisibility-spec t)
+	  prop
+	(or (memq prop buffer-invisibility-spec)
+	    (assq prop buffer-invisibility-spec))))))
+
+;; Note: the optional 2nd argument has a different meaning between
+;; Emacs and XEmacs.
+;; (next-char-property-change POSITION &optional LIMIT)
+;; (next-extent-change        POS      &optional OBJECT)
+(defalias 'gnus-next-char-property-change
+  (if (fboundp 'next-extent-change)
+      'next-extent-change 'next-char-property-change))
+
+(defalias 'gnus-previous-char-property-change
+  (if (fboundp 'previous-extent-change)
+      'previous-extent-change 'previous-char-property-change))
+
 ;;; Protected and atomic operations.  dmoore@ucsd.edu 21.11.1996
 ;; The primary idea here is to try to protect internal datastructures
 ;; from becoming corrupted when the user hits C-g, or if a hook or
--- a/lisp/gnus/message.el	Fri Jan 08 13:41:42 2010 +0000
+++ b/lisp/gnus/message.el	Tue Jan 19 11:43:25 2010 +0000
@@ -5077,7 +5077,8 @@
 	  "Denied posting -- the From looks strange: \"%s\"." from)
 	 nil)
 	((let ((addresses (rfc822-addresses from)))
-	   (while (and addresses
+	   ;; `rfc822-addresses' returns a string if parsing fails.
+	   (while (and (consp addresses)
 		       (not (eq (string-to-char (car addresses)) ?\()))
 	     (setq addresses (cdr addresses)))
 	   addresses)
@@ -7505,10 +7506,8 @@
 
 (defun message-exchange-point-and-mark ()
   "Exchange point and mark, but don't activate region if it was inactive."
-  (unless (prog1
-	      (message-mark-active-p)
-	    (exchange-point-and-mark))
-    (setq mark-active nil)))
+  (goto-char (prog1 (mark t)
+	       (set-marker (mark-marker) (point)))))
 
 (defalias 'message-make-overlay 'make-overlay)
 (defalias 'message-delete-overlay 'delete-overlay)
--- a/lisp/language/indian.el	Fri Jan 08 13:41:42 2010 +0000
+++ b/lisp/language/indian.el	Tue Jan 19 11:43:25 2010 +0000
@@ -153,8 +153,8 @@
 	   ("a" . "\u0903")			 ; vowel modifier (post) 
 	   ("S" . "\u0951")			 ; stress sign (above)
 	   ("s" . "\u0952")			 ; stress sign (below)
+	   ("N" . "\u200C")			 ; ZWNJ
 	   ("J" . "\u200D")			 ; ZWJ
-	   ("N" . "\u200C")			 ; ZWNJ
 	   ("X" . "[\u0900-\u097F]"))))		 ; all coverage
     (indian-compose-regexp
      (concat
@@ -195,8 +195,8 @@
 	   ("b" . "[\u0D62-\u0D63]")		  ; belowbase matra
 	   ("a" . "[\u0D02-\u0D03]")		  ; abovebase sign
 	   ("H" . "\u0D4D")			  ; virama sign 
-	   ("N" . "\u200D")			  ; ZWJ
-	   ("J" . "\u200C")			  ; ZWNJ
+	   ("N" . "\u200C")			  ; ZWNJ
+	   ("J" . "\u200D")			  ; ZWJ
 	   ("X" . "[\u0D00-\u0D7F]"))))		  ; all coverage
     (indian-compose-regexp
      (concat
--- a/lisp/makefile.w32-in	Fri Jan 08 13:41:42 2010 +0000
+++ b/lisp/makefile.w32-in	Tue Jan 19 11:43:25 2010 +0000
@@ -233,8 +233,11 @@
 
 updates: update-subdirs autoloads mh-autoloads finder-data custom-deps
 
-# This is useful after "cvs up".
-cvs-update: recompile autoloads finder-data custom-deps
+# This is useful after "bzr up".
+bzr-update: recompile autoloads finder-data custom-deps
+
+# For backwards compatibility:
+cvs-update: bzr-update
 
 # Update the AUTHORS file.
 
--- a/lisp/mpc.el	Fri Jan 08 13:41:42 2010 +0000
+++ b/lisp/mpc.el	Tue Jan 19 11:43:25 2010 +0000
@@ -1728,7 +1728,7 @@
   "Remove the selected songs from the playlist."
   (interactive)
   (unless mpc-songs-playlist
-    (error "The selected songs aren't part of a playlist."))
+    (error "The selected songs aren't part of a playlist"))
   (let ((song-poss (mapcar #'cdr (mpc-songs-selection))))
     (mpc-cmd-delete song-poss mpc-songs-playlist)
     (mpc-songs-refresh)
--- a/lisp/net/browse-url.el	Fri Jan 08 13:41:42 2010 +0000
+++ b/lisp/net/browse-url.el	Tue Jan 19 11:43:25 2010 +0000
@@ -613,7 +613,7 @@
 
 (defun browse-url-url-encode-chars (text chars)
   "URL-encode the chars in TEXT that match CHARS.
-CHARS is a regexp-like character alternative (e.g., \"[,)$]\")."
+CHARS is a regexp-like character alternative (e.g., \"[)$]\")."
   (let ((encoded-text (copy-sequence text))
 	(s 0))
     (while (setq s (string-match chars encoded-text s))
@@ -626,10 +626,12 @@
 
 (defun browse-url-encode-url (url)
   "Escape annoying characters in URL.
-The annoying characters are those that can mislead a webbrowser
-regarding its parameter treatment.  For instance, `,' can
-be misleading because it could be used to separate URLs."
-  (browse-url-url-encode-chars url "[,)$]"))
+The annoying characters are those that can mislead a web browser
+regarding its parameter treatment."
+  ;; FIXME: Is there an actual example of a web browser getting
+  ;; confused?  (This used to encode commas, but at least Firefox
+  ;; handles commas correctly and doesn't accept encoded commas.)
+  (browse-url-url-encode-chars url "[)$]"))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; URL input
--- a/lisp/net/imap-hash.el	Fri Jan 08 13:41:42 2010 +0000
+++ b/lisp/net/imap-hash.el	Tue Jan 19 11:43:25 2010 +0000
@@ -67,16 +67,16 @@
       (imap-hash-remove-cr-followed-by-lf))))
 
 (defun imap-hash-make (server port mailbox &optional user password ssl)
-  "Makes a new imap-hash object using SERVER, PORT, and MAILBOX.  
-SSL, USER, PASSWORD are optional.
+  "Make a new imap-hash object using SERVER, PORT, and MAILBOX.
+USER, PASSWORD and SSL are optional.
 The test is set to t, meaning all messages are considered."
   (when (and server port mailbox)
-    (list :server server :port port :mailbox mailbox 
-	  :ssl ssl :user user :password password 
+    (list :server server :port port :mailbox mailbox
+	  :ssl ssl :user user :password password
 	  :test t)))
 
 (defun imap-hash-p (iht)
-  "Checks whether IHT is a valid imap-hash."
+  "Check whether IHT is a valid imap-hash."
   (and
    (imap-hash-server iht)
    (imap-hash-port iht)
@@ -95,7 +95,7 @@
 (defun imap-hash-get (key iht &optional refetch)
   "Get the value for KEY in the imap-hash IHT.
 Requires either `imap-hash-fetch' to be called beforehand
-(e.g. by `imap-hash-map'), or REFETCH to be t.
+\(e.g. by `imap-hash-map'), or REFETCH to be t.
 Returns a list of the headers (an alist, see `imap-hash-map') and
 the body of the message as a string.
 Also see `imap-hash-test'."
@@ -106,13 +106,13 @@
       (list
        (imap-hash-get-headers
 	(imap-hash-data-headers details))
-       (imap-hash-get-body 
+       (imap-hash-get-body
 	(imap-hash-data-body details))))))
 
 (defun imap-hash-put (value iht &optional key)
-  "Put VALUE in the imap-hash IHT.  Returns the new key.
+  "Put VALUE in the imap-hash IHT.  Return the new key.
 If KEY is given, removes it.
-VALUE can be a list of the headers (an alist, see `imap-hash-map') 
+VALUE can be a list of the headers (an alist, see `imap-hash-map')
 and the body of the message as a string.  It can also be a uid,
 in which case `imap-hash-get' will be called to get the value.
 Also see `imap-hash-test'."
@@ -121,19 +121,19 @@
 	newuid)
       (when value
 	(with-temp-buffer
-	  (funcall 'imap-hash-make-message 
-		   (nth 0 value) 
+	  (funcall 'imap-hash-make-message
+		   (nth 0 value)
 		   (nth 1 value)
 		   nil)
 	  (setq newuid (nth 1 (imap-message-append
-			       (imap-hash-mailbox iht) 
+			       (imap-hash-mailbox iht)
 			       (current-buffer) nil nil server-buffer)))
 	  (when key (imap-hash-rem key iht))))
       newuid))
 
 (defun imap-hash-make-message (headers body &optional overrides)
   "Make a message with HEADERS and BODY suitable for `imap-append',
-using `message-setup'..
+using `message-setup'.
 Look in the alist OVERRIDES for header overrides as per `imap-hash-headers'."
   ;; don't insert a signature no matter what
   (let (message-signature)
@@ -154,7 +154,7 @@
 (defun imap-hash-rem (key iht)
   "Remove KEY in the imap-hash IHT.
 Also see `imap-hash-test'.  Requires `imap-hash-fetch' to have
-been called and the imap-hash server buffer to be current, 
+been called and the imap-hash server buffer to be current,
 so it's best to use it inside `imap-hash-map'.
 The key will not be found on the next `imap-hash-map' call."
   (with-current-buffer (imap-hash-get-buffer iht)
@@ -172,7 +172,7 @@
   (with-temp-buffer
     (insert (or text-headers ""))
     (imap-hash-remove-cr-followed-by-lf)
-    (mapcar (lambda (header) 
+    (mapcar (lambda (header)
 	      (cons header
 		    (message-fetch-field (format "%s" header))))
 	    imap-hash-headers)))
@@ -199,11 +199,11 @@
 				       (headers (imap-hash-data-headers details))
 				       (hlist (imap-hash-get-headers headers))
 				       (runit (cond
-					       ((stringp test) 
+					       ((stringp test)
 						(string-match
-						 test 
+						 test
 						 (format "%s" (aget hlist 'Subject))))
-					       ((functionp test) 
+					       ((functionp test)
 						(funcall test hlist))
 					       ;; otherwise, return test itself
 					       (t test))))
@@ -218,7 +218,7 @@
 			      "UID")))))
 
 (defun imap-hash-count (iht)
-  "Counts the number of messages in the imap-hash IHT.
+  "Count the number of messages in the imap-hash IHT.
 Also see `imap-hash-test'.  It uses `imap-hash-map' so just use that
 function if you want to do more than count the elements."
   (length (imap-hash-map (lambda (a b c)) iht t)))
@@ -226,36 +226,36 @@
 (defalias 'imap-hash-size 'imap-hash-count)
 
 (defun imap-hash-test (iht)
-  "Returns the test used by `imap-hash-map' for IHT.
+  "Return the test used by `imap-hash-map' for IHT.
 When the test is t, any key will be a candidate.
-When the test is a string, messages will be filtered on that string as a regexp
-against the subject.
-When the test is a function, messages will be filtered with it.  
+When the test is a string, messages will be filtered on that string as a
+regexp against the subject.
+When the test is a function, messages will be filtered with it.
 The function is passed the message headers (see `imap-hash-get-headers')."
   (plist-get iht :test))
 
-(defun imap-hash-server (iht) 
-  "Returns the server used by the imap-hash IHT."
+(defun imap-hash-server (iht)
+  "Return the server used by the imap-hash IHT."
   (plist-get iht :server))
 
-(defun imap-hash-port (iht) 
-  "Returns the port used by the imap-hash IHT."
+(defun imap-hash-port (iht)
+  "Return the port used by the imap-hash IHT."
   (plist-get iht :port))
 
-(defun imap-hash-ssl (iht) 
-  "Returns the SSL need for the imap-hash IHT."
+(defun imap-hash-ssl (iht)
+  "Return the SSL need for the imap-hash IHT."
   (plist-get iht :ssl))
 
 (defun imap-hash-mailbox (iht)
-  "Returns the mailbox used by the imap-hash IHT."
+  "Return the mailbox used by the imap-hash IHT."
   (plist-get iht :mailbox))
 
-(defun imap-hash-user (iht) 
-  "Returns the username used by the imap-hash IHT."
+(defun imap-hash-user (iht)
+  "Return the username used by the imap-hash IHT."
   (plist-get iht :user))
 
-(defun imap-hash-password (iht) 
-  "Returns the password used by the imap-hash IHT."
+(defun imap-hash-password (iht)
+  "Return the password used by the imap-hash IHT."
   (plist-get iht :password))
 
 (defun imap-hash-open-connection (iht)
@@ -263,16 +263,16 @@
   (let* ((server (imap-hash-server iht))
 	 (port (imap-hash-port iht))
 	 (ssl-need (imap-hash-ssl iht))
-	 (auth-need (not (and (imap-hash-user iht) 
+	 (auth-need (not (and (imap-hash-user iht)
 			      (imap-hash-password iht))))
 	 ;; this will not be needed if auth-need is t
 	 (auth-info (when auth-need
-		      (auth-source-user-or-password 
-		       '("login" "password") 
+		      (auth-source-user-or-password
+		       '("login" "password")
 		       server port)))
-	 (auth-user (or (imap-hash-user iht) 
+	 (auth-user (or (imap-hash-user iht)
 			(nth 0 auth-info)))
-	 (auth-passwd (or (imap-hash-password iht) 
+	 (auth-passwd (or (imap-hash-password iht)
 			  (nth 1 auth-info)))
 	 (imap-logout-timeout nil))
 
@@ -283,7 +283,7 @@
 	      ;; (debug "after opening server: opened+state" (imap-opened (current-buffer)) imap-state)
 	      ;; (debug "authenticating" auth-user auth-passwd)
 	      (if (not (imap-capability 'IMAP4rev1))
-		  (error "IMAP server does not support IMAP4r1, it won't work, sorry.")
+		  (error "IMAP server does not support IMAP4r1, it won't work, sorry")
 		(imap-authenticate auth-user auth-passwd)
 		(imap-id)
 		;; (debug "after authenticating: opened+state" (imap-opened (current-buffer)) imap-state)
@@ -314,8 +314,8 @@
   "Fetch all the messages for imap-hash IHT.
 Get only the headers if HEADERS-ONLY is not nil."
   (with-current-buffer (imap-hash-get-buffer iht)
-    (let ((range (if messages 
-		     (list 
+    (let ((range (if messages
+		     (list
 		      (imap-range-to-message-set messages)
 		      (imap-range-to-message-set messages))
 		   '("1:*" . "1,*:*"))))
@@ -329,9 +329,9 @@
       (imap-fetch-safe range
 		       (concat (format "(UID RFC822.SIZE BODY %s "
 				       (if headers-only "" "BODY.PEEK[TEXT]"))
-			       (format "BODY.PEEK[HEADER.FIELDS %s])" 
+			       (format "BODY.PEEK[HEADER.FIELDS %s])"
 				     imap-hash-headers))))))
-  
+
 (provide 'imap-hash)
 ;;; imap-hash.el ends here
 
--- a/lisp/net/rcirc.el	Fri Jan 08 13:41:42 2010 +0000
+++ b/lisp/net/rcirc.el	Tue Jan 19 11:43:25 2010 +0000
@@ -836,6 +836,7 @@
 
 (define-key rcirc-browse-url-map (kbd "RET") 'rcirc-browse-url-at-point)
 (define-key rcirc-browse-url-map (kbd "<mouse-2>") 'rcirc-browse-url-at-mouse)
+(define-key rcirc-browse-url-map [follow-link] 'mouse-face)
 
 (defvar rcirc-short-buffer-name nil
   "Generated abbreviation to use to indicate buffer activity.")
--- a/lisp/org/ChangeLog	Fri Jan 08 13:41:42 2010 +0000
+++ b/lisp/org/ChangeLog	Tue Jan 19 11:43:25 2010 +0000
@@ -1,3 +1,8 @@
+2010-01-01  Juanma Barranquero  <lekktu@gmail.com>
+
+	* org.el (org-get-outline-path, org-speed-command-help):
+	Fix typos in error messages.
+
 2009-12-14  Juri Linkov  <juri@jurta.org>
 
 	* org-html.el (org-export-html-style-include-default):
--- a/lisp/org/org.el	Fri Jan 08 13:41:42 2010 +0000
+++ b/lisp/org/org.el	Tue Jan 19 11:43:25 2010 +0000
@@ -9019,7 +9019,7 @@
   (if fastp
       (progn
 	(if (> level 19)
-	    (error "Outline path failure, more than 19 levels."))
+	    (error "Outline path failure, more than 19 levels"))
 	(loop for i from level upto 19 do
 	      (aset org-olpa i nil))
 	(prog1
@@ -10502,7 +10502,7 @@
 	  (org-add-log-setup 'redeadline nil old-date 'findpos
 			     org-log-redeadline))
 	(message "Deadline on %s" org-last-inserted-timestamp)))))
-	
+
 (defun org-schedule (&optional remove time)
   "Insert the SCHEDULED: string with a timestamp to schedule a TODO item.
 With argument REMOVE, remove any scheduling date from the item.
@@ -14985,7 +14985,7 @@
   "Show the available speed commands."
   (interactive)
   (if (not org-use-speed-commands)
-      (error "Speed commands are not activated, customize `org-use-speed-commands'.")
+      (error "Speed commands are not activated, customize `org-use-speed-commands'")
     (with-output-to-temp-buffer "*Help*"
       (princ "User-defined Speed commands\n===========================\n")
       (mapc 'org-print-speed-command org-speed-commands-user)
@@ -15028,7 +15028,7 @@
       (setq this-command org-speed-command)
       (call-interactively org-speed-command))
      ((functionp org-speed-command)
-      (funcall org-speed-command))     
+      (funcall org-speed-command))
      ((and org-speed-command (listp org-speed-command))
       (eval org-speed-command))
      (t (let (org-use-speed-commands)
@@ -16188,7 +16188,7 @@
     (save-excursion
       (if (re-search-backward "^\\(Subject: \\)Org-mode version \\(.*?\\);[ \t]*\\(.*\\)" nil t)
 	  (replace-match "\\1Bug: \\3 [\\2]")))))
-    
+
 
 (defun org-install-agenda-files-menu ()
   (let ((bl (buffer-list)))
--- a/lisp/play/gomoku.el	Fri Jan 08 13:41:42 2010 +0000
+++ b/lisp/play/gomoku.el	Tue Jan 19 11:43:25 2010 +0000
@@ -730,12 +730,12 @@
 (defun gomoku (&optional n m)
   "Start a Gomoku game between you and Emacs.
 
-If a game is in progress, this command allow you to resume it.
+If a game is in progress, this command allows you to resume it.
 If optional arguments N and M are given, an N by M board is used.
 If prefix arg is given for N, M is prompted for.
 
 You and Emacs play in turn by marking a free square.  You mark it with X
-and Emacs marks it with O. The winner is the first to get five contiguous
+and Emacs marks it with O.  The winner is the first to get five contiguous
 marks horizontally, vertically or in diagonal.
 
 You play by moving the cursor over the square you choose and hitting
--- a/lisp/progmodes/gdb-ui.el	Fri Jan 08 13:41:42 2010 +0000
+++ b/lisp/progmodes/gdb-ui.el	Tue Jan 19 11:43:25 2010 +0000
@@ -140,8 +140,8 @@
 (defvar gdb-server-prefix nil)
 (defvar gdb-flush-pending-output nil)
 (defvar gdb-location-alist nil
-  "Alist of breakpoint numbers and full filenames.  Only used for files that
-Emacs can't find.")
+  "Alist of breakpoint numbers and full filenames.
+Only used for files that Emacs can't find.")
 (defvar gdb-active-process nil
   "GUD tooltips display variable values when t, and macro definitions otherwise.")
 (defvar gdb-recording nil
@@ -520,7 +520,7 @@
    (not (display-graphic-p)))))
 
 ;; If expr is a macro for a function don't print because of possible dangerous
-;; side-effects. Also printing a function within a tooltip generates an
+;; side-effects.  Also printing a function within a tooltip generates an
 ;; unexpected starting annotation (phase error).
 (defun gdb-tooltip-print-1 (expr)
   (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer)
@@ -1079,7 +1079,7 @@
 		 (if (or (<= (string-to-number children) gdb-max-children)
 			  (y-or-n-p
 			   (format
-			    "%s has %s children. Continue? " expr children)))
+			    "%s has %s children.  Continue? " expr children)))
 		     (if (and (eq (buffer-local-value
 				   'gud-minor-mode gud-comint-buffer) 'gdba)
 			      (string-equal gdb-version "pre-6.4"))
@@ -1488,7 +1488,7 @@
 	(let ((gud-running nil))
 	  (gdb-invalidate-frames)
 	  (unless (or gdb-register-names
-		      (string-equal gdb-version "pre-6.4"))		      
+		      (string-equal gdb-version "pre-6.4"))
 	    (gdb-enqueue-input
 	     (list "server interpreter mi -data-list-register-names\n"
 		   'gdb-get-register-names))))
@@ -1815,13 +1815,13 @@
 replaced with semicolons.
 
 If FIX-KEY is non-nil, strip all \"FIX-KEY=\" occurences from
-partial output. This is used to get rid of useless keys in lists
-in MI messages, e.g.: [key=.., key=..]. -stack-list-frames and
+partial output.  This is used to get rid of useless keys in lists
+in MI messages, e.g.: [key=.., key=..].  -stack-list-frames and
 -break-info are examples of MI commands which issue such
 responses.
 
 If FIX-LIST is non-nil, \"FIX-LIST={..}\" is replaced with
-\"FIX-LIST=[..]\" prior to parsing. This is used to fix broken
+\"FIX-LIST=[..]\" prior to parsing.  This is used to fix broken
 -break-info output when it contains breakpoint script field
 incompatible with GDB/MI output syntax."
   (save-excursion
@@ -1897,7 +1897,7 @@
 ;; annotation rule binding of whatever gdb sends to tell us this command
 ;; might have changed it's output.
 ;;
-;; NAME is the function name. DEMAND-PREDICATE tests if output is really needed.
+;; NAME is the function name.  DEMAND-PREDICATE tests if output is really needed.
 ;; GDB-COMMAND is a string of such.  OUTPUT-HANDLER is the function bound to the
 ;; input in the input queue (see comment about ``gdb communications'' above).
 
@@ -2270,7 +2270,7 @@
 
 (defmacro gdb-propertize-header (name buffer help-echo mouse-face face)
   `(propertize ,name
-	       'help-echo ,help-echo 
+	       'help-echo ,help-echo
 	       'mouse-face ',mouse-face
 	       'face ',face
 	       'local-map
@@ -2389,7 +2389,7 @@
 		(goto-char (point-min))
 		(forward-line (1- (string-to-number line)))
 		(set-window-point window (point))))))
-      (error "No location specified."))))
+      (error "No location specified"))))
 
 
 ;; Frames buffer.  This displays a perpetually correct backtrace
@@ -3284,7 +3284,7 @@
 	      :button (:toggle . gdb-use-separate-io-buffer)))
   (define-key menu [gdb-many-windows]
   '(menu-item "Display Other Windows" gdb-many-windows
-	      :help "Toggle display of locals, stack and breakpoint information"
+	      :help "Toggle display of locals, stack and breakpoint information."
 	      :button (:toggle . gdb-many-windows)))
   (define-key menu [gdb-restore-windows]
   '(menu-item "Restore Window Layout" gdb-restore-windows
@@ -4029,7 +4029,7 @@
 
 ;; Locals buffer.
 ;;
-;; uses "-stack-list-locals --simple-values". Needs GDB 6.1 onwards.
+;; uses "-stack-list-locals --simple-values".  Needs GDB 6.1 onwards.
 (gdb-set-buffer-rules 'gdb-locals-buffer
 		      'gdb-locals-buffer-name
 		      'gdb-locals-mode)
--- a/lisp/progmodes/idlw-help.el	Fri Jan 08 13:41:42 2010 +0000
+++ b/lisp/progmodes/idlw-help.el	Tue Jan 19 11:43:25 2010 +0000
@@ -41,7 +41,7 @@
 
 ;;; Code:
 (defvar idlwave-help-browse-url-available t
-  "Whether browse-url is available")
+  "Whether browse-url is available.")
 
 (require 'browse-url)
 
@@ -58,9 +58,9 @@
   (if idlwave-html-help-pre-v6 "#" "#wp"))
 
 (defcustom idlwave-html-system-help-location   "help/online_help/"
-  "The directory, relative to idlwave-system-directory, where the idl
+  "The directory, relative to `idlwave-system-directory', where the IDL
 HTML help files live, for IDL 6.2 and later.  This location, if found,
-is used in preference to the old idlwave-html-help-location."
+is used in preference to the old `idlwave-html-help-location'."
   :group 'idlwave-online-help
   :type 'directory)
 
@@ -69,7 +69,7 @@
       nil
     "/usr/local/etc/")
   "The directory where the idl_html_help/ dir lives.  Obsolete for IDL
-6.2 or later (see idlwave-html-system-help-location)."
+6.2 or later (see `idlwave-html-system-help-location')."
   :group 'idlwave-online-help
   :type 'directory)
 
@@ -82,13 +82,13 @@
   :type 'boolean)
 
 (defcustom idlwave-help-browser-function browse-url-browser-function
-  "Function to use to display html help.
+  "Function to use to display HTML help.
 Defaults to `browse-url-browser-function', which see."
   :group 'idlwave-online-help
   :type 'function)
 
 (defcustom idlwave-help-browser-generic-program browse-url-generic-program
-  "Program to run if using browse-url-generic-program."
+  "Program to run if using `browse-url-generic-program'."
   :group 'idlwave-online-help
   :type 'string)
 
@@ -97,7 +97,7 @@
 (defcustom idlwave-help-browser-generic-args
   (if (boundp 'browse-url-generic-args)
       browse-url-generic-args "")
-  "Program args to use if using browse-url-generic-program."
+  "Program args to use if using `browse-url-generic-program'."
   :group 'idlwave-online-help
   :type 'string)
 
@@ -112,7 +112,7 @@
   :type 'boolean)
 
 (defvar idlwave-help-directory ""
-  "Obsolete variable.  See idlwave-html-help-location.")
+  "Obsolete variable.  See `idlwave-html-help-location'.")
 
 (defcustom idlwave-help-use-dedicated-frame t
   "*Non-nil means, use a separate frame for Online Help if possible."
@@ -210,10 +210,10 @@
   "The default width of the help frame.")
 
 (defvar idlwave-html-help-is-available nil
-  "Is the system online help text avaiable?")
+  "Is the system online help text available?")
 
 (defvar idlwave-help-mode-line-indicator ""
-  "Used for the special mode line in the idlwave-help-mode.")
+  "Used for the special mode line in the `idlwave-help-mode'.")
 
 (defvar idlwave-help-window-configuration nil)
 (defvar idlwave-help-special-topic-words nil) ; defined by get_rinfo
@@ -221,7 +221,7 @@
 ;; Define the key bindings for the Help application
 
 (defvar idlwave-help-mode-map (make-sparse-keymap)
-  "The keymap used in idlwave-help-mode.")
+  "The keymap used in `idlwave-help-mode'.")
 
 (define-key idlwave-help-mode-map "q" 'idlwave-help-quit)
 (define-key idlwave-help-mode-map "w" 'widen)
@@ -303,7 +303,7 @@
 Fontification:      [F]ontify the buffer like source code
 Jump:               [h] to function doclib header
                     [H] to file doclib header
-                    [.] back and forward between header and definition
+                    [.] back and forth between header and definition
 
 Here are all keybindings.
 \\{idlwave-help-mode-map}"
@@ -367,7 +367,7 @@
 (defvar idlwave-experimental)
 (defvar idlwave-last-context-help-pos)
 (defun idlwave-do-context-help (&optional arg)
-  "Wrapper around the call to idlwave-context-help1.
+  "Wrapper around the call to `idlwave-do-context-help1'.
 It collects and prints the diagnostics messages."
   (let ((marker (list (current-buffer) (point)))
 	(idlwave-help-diagnostics nil))
@@ -766,7 +766,7 @@
   "Display HTML or other special help on a certain topic.
 Either loads an HTML link, if LINK is non-nil, or gets special-help on
 the optional arguments, if any special help is defined.  If LINK is
-`t', first look up the optional arguments in the routine info list to
+t, first look up the optional arguments in the routine info list to
 see if a link is set for it.  Try extra help functions if necessary."
   ;; Lookup link
   (if (eq link t)
@@ -817,7 +817,7 @@
     (select-window cw)))
 
 (defun idlwave-help-html-link (link)
-  "Get html help on a given LINK."
+  "Get HTML help on a given LINK."
   (let ((browse-url-browser-function idlwave-help-browser-function)
 	(help-loc (idlwave-html-help-location))
 	(browse-url-generic-program idlwave-help-browser-generic-program)
@@ -847,14 +847,14 @@
 (defvar idlwave-current-tags-buffer)
 (defvar idlwave-current-tags-class)
 (defun idlwave-help-with-source (name type class keyword)
-  "Provide help for routines not documented in the IDL manuals.  Works
-by loading the routine source file into the help buffer.  Depending on
-the value of `idlwave-help-source-try-header', it attempts to show the
-routine definition or the header description.  If
-`idlwave-help-do-class-struct-tag' is non-nil, keyword is a tag to
-show help on from the class definition structure.  If
-`idlwave-help-do-struct-tag' is non-nil, show help from the matching
-structure tag definition.
+  "Provide help for routines not documented in the IDL manuals.
+Works by loading the routine source file into the help buffer.
+Depending on the value of `idlwave-help-source-try-header', it
+attempts to show the routine definition or the header description.
+If `idlwave-help-do-class-struct-tag' is non-nil, keyword is a tag
+to show help on from the class definition structure.
+If `idlwave-help-do-struct-tag' is non-nil, show help from the
+matching structure tag definition.
 
 This function can be used as `idlwave-extra-help-function'."
   (let* ((class-struct-tag idlwave-help-do-class-struct-tag)
@@ -953,7 +953,8 @@
 
 (defun idlwave-help-find-routine-definition (name type class keyword)
   "Find the definition of routine CLASS::NAME in current buffer.
-KEYWORD is ignored. Returns the point of match if successful, nil otherwise."
+Returns the point of match if successful, nil otherwise.
+KEYWORD is ignored."
   (save-excursion
     (goto-char (point-max))
     (if (re-search-backward
@@ -1199,7 +1200,7 @@
 	   "(help location unknown)")))
 
 (defun idlwave-help-show-help-frame ()
-  "Show the help frame, creating it if necessary"
+  "Show the help frame, creating it if necessary."
   ;; Use a special frame for this
   (unless (frame-live-p idlwave-help-frame)
     (setq idlwave-help-frame
@@ -1254,7 +1255,7 @@
   (if (memq system-type '(ms-dos windows-nt))
       "bin/bin.x86/idl_assistant.exe"
     "bin/idl_assistant")
-  "The command, rooted at idlwave-system-directory, which invokes the
+  "The command, rooted at `idlwave-system-directory', which invokes the
 IDL assistant.")
 
 (defun idlwave-help-assistant-available ()
@@ -1293,7 +1294,7 @@
       (unless (accept-process-output idlwave-help-assistant-process 15)
 	(error "Failed binding IDL_ASSISTANT socket"))
       (if (not port)
-	  (error "Unable to open IDL_ASSISTANT.")
+	  (error "Unable to open IDL_ASSISTANT")
 	(set-process-filter idlwave-help-assistant-process nil)
 	(setq idlwave-help-assistant-socket
 	      (open-network-stream "IDL_ASSISTANT_SOCK"
--- a/lisp/progmodes/octave-mod.el	Fri Jan 08 13:41:42 2010 +0000
+++ b/lisp/progmodes/octave-mod.el	Tue Jan 19 11:43:25 2010 +0000
@@ -101,11 +101,9 @@
   '("do" "for" "function" "if" "switch" "try" "unwind_protect" "while"))
 (defvar octave-else-keywords
   '("case" "catch" "else" "elseif" "otherwise" "unwind_protect_cleanup"))
-;; FIXME: only use specific "end" tokens here to avoid confusion when "end"
-;; is used in indexing (the real fix is much more complex).
 (defvar octave-end-keywords
   '("endfor" "endfunction" "endif" "endswitch" "end_try_catch"
-    "end_unwind_protect" "endwhile" "until"))
+    "end_unwind_protect" "endwhile" "until" "end"))
 
 (defvar octave-reserved-words
   (append octave-begin-keywords
@@ -342,17 +340,15 @@
   (concat octave-block-begin-regexp "\\|" octave-block-end-regexp))
 (defvar octave-block-else-or-end-regexp
   (concat octave-block-else-regexp "\\|" octave-block-end-regexp))
-;; FIXME: only use specific "end" tokens here to avoid confusion when "end"
-;; is used in indexing (the real fix is much more complex).
 (defvar octave-block-match-alist
   '(("do" . ("until"))
-    ("for" . ("endfor"))
+    ("for" . ("endfor" "end"))
     ("function" . ("endfunction"))
-    ("if" . ("else" "elseif" "endif"))
-    ("switch" . ("case" "otherwise" "endswitch"))
+    ("if" . ("else" "elseif" "endif" "end"))
+    ("switch" . ("case" "otherwise" "endswitch" "end"))
     ("try" . ("catch" "end_try_catch"))
     ("unwind_protect" . ("unwind_protect_cleanup" "end_unwind_protect"))
-    ("while" . ("endwhile")))
+    ("while" . ("endwhile" "end")))
   "Alist with Octave's matching block keywords.
 Has Octave's begin keywords as keys and a list of the matching else or
 end keywords as associated values.")
@@ -410,7 +406,7 @@
 
 This mode makes it easier to write Octave code by helping with
 indentation, doing some of the typing for you (with Abbrev mode) and by
-showing keywords, comments, strings, etc.. in different faces (with
+showing keywords, comments, strings, etc. in different faces (with
 Font Lock mode on terminals that support it).
 
 Octave itself is a high-level language, primarily intended for numerical
@@ -680,7 +676,10 @@
 			(if (= bot (point))
 			    (setq icol (+ icol octave-block-offset))))
 		       ((octave-looking-at-kw octave-block-end-regexp)
-			(if (not (= bot (point)))
+			(if (and (not (= bot (point)))
+				 ;; special case for `end' keyword,
+				 ;; applied to all keywords
+				 (not (octave-end-as-array-index-p)))
 			    (setq icol (- icol
 					  (octave-block-end-offset)))))))
 		  (forward-char)))
@@ -702,6 +701,15 @@
 	(setq icol (list comment-column icol)))))
     icol))
 
+;; FIXME: this should probably also make sure we are actually looking
+;; at the "end" keyword.
+(defun octave-end-as-array-index-p ()
+  (save-excursion
+    (condition-case nil
+	;; Check if point is between parens
+	(progn (up-list 1) t)
+      (error nil))))
+
 (defun octave-block-end-offset ()
   (save-excursion
     (octave-backward-up-block 1)
@@ -1260,7 +1268,7 @@
 (defun octave-electric-semi ()
   "Insert a semicolon in Octave mode.
 Maybe expand abbrevs and blink matching block open keywords.
-Reindent the line of `octave-auto-indent' is non-nil.
+Reindent the line if `octave-auto-indent' is non-nil.
 Insert a newline if `octave-auto-newline' is non-nil."
   (interactive)
   (if (not (octave-not-in-string-or-comment-p))
@@ -1277,7 +1285,7 @@
 (defun octave-electric-space ()
   "Insert a space in Octave mode.
 Maybe expand abbrevs and blink matching block open keywords.
-Reindent the line of `octave-auto-indent' is non-nil."
+Reindent the line if `octave-auto-indent' is non-nil."
   (interactive)
   (setq last-command-event ? )
   (if (and octave-auto-indent
--- a/lisp/progmodes/python.el	Fri Jan 08 13:41:42 2010 +0000
+++ b/lisp/progmodes/python.el	Tue Jan 19 11:43:25 2010 +0000
@@ -1,6 +1,6 @@
 ;;; python.el --- silly walks for Python  -*- coding: iso-8859-1 -*-
 
-;; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
+;; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
 ;;   Free Software Foundation, Inc.
 
 ;; Author: Dave Love <fx@gnu.org>
@@ -112,7 +112,9 @@
     ;; Top-level assignments are worth highlighting.
     (,(rx line-start (group (1+ (or word ?_))) (0+ space) "=")
      (1 font-lock-variable-name-face))
-    (,(rx line-start (* (any " \t")) (group "@" (1+ (or word ?_)))) ; decorators
+    ;; Decorators.
+    (,(rx line-start (* (any " \t")) (group "@" (1+ (or word ?_))
+					    (0+ "." (1+ (or word ?_)))))
      (1 font-lock-type-face))
     ;; Built-ins.  (The next three blocks are from
     ;; `__builtin__.__dict__.keys()' in Python 2.5.1.)  These patterns
--- a/lisp/vc-bzr.el	Fri Jan 08 13:41:42 2010 +0000
+++ b/lisp/vc-bzr.el	Tue Jan 19 11:43:25 2010 +0000
@@ -176,13 +176,13 @@
                                "\0"
                                "[^\0]*\0"     ;id?
                                "\\([^\0]*\\)\0" ;"a/f/d", a=removed?
-                               "[^\0]*\0" ;sha1 (empty if conflicted)?
-                               "\\([^\0]*\\)\0" ;size?
+                               "\\([^\0]*\\)\0" ;sha1 (empty if conflicted)?
+                               "\\([^\0]*\\)\0" ;size?p
                                "[^\0]*\0"       ;"y/n", executable?
                                "[^\0]*\0"       ;?
                                "\\([^\0]*\\)\0" ;"a/f/d" a=added?
                                "\\([^\0]*\\)\0" ;sha1 again?
-                               "[^\0]*\0"       ;size again?
+                               "\\([^\0]*\\)\0" ;size again?
                                "[^\0]*\0" ;"y/n", executable again?
                                "[^\0]*\0" ;last revid?
                                ;; There are more fields when merges are pending.
@@ -194,11 +194,20 @@
                       ;; conflict markers).
                       (cond
                        ((eq (char-after (match-beginning 1)) ?a) 'removed)
-                       ((eq (char-after (match-beginning 3)) ?a) 'added)
-                       ((and (eq (string-to-number (match-string 2))
+                       ((eq (char-after (match-beginning 4)) ?a) 'added)
+                       ((or (and (eq (string-to-number (match-string 3))
                                  (nth 7 (file-attributes file)))
-                             (equal (match-string 4)
+                             (equal (match-string 5)
                                     (vc-bzr-sha1 file)))
+			    (and
+			     ;; It looks like for lightweight
+			     ;; checkouts \2 is empty and we need to
+			     ;; look for size in \6.
+			     (eq (match-beginning 2) (match-end 2))
+			     (eq (string-to-number (match-string 6))
+				 (nth 7 (file-attributes file)))
+			     (equal (match-string 5)
+				    (vc-bzr-sha1 file))))
                         'up-to-date)
                        (t 'edited))
                     'unregistered))))
@@ -347,9 +356,19 @@
 	       (if (file-exists-p location-fname)
 		   (with-temp-buffer
 		     (insert-file-contents location-fname)
-		     (when (re-search-forward "file://\(.+\)" nil t)
-		       (setq branch-format-file (match-string 1))
-		       (file-exists-p branch-format-file)))
+		     ;; If the lightweight checkout points to a
+		     ;; location in the local file system, then we can
+		     ;; look there for the version information.
+		     (when (re-search-forward "file://\\(.+\\)" nil t)
+		       (let ((l-c-parent-dir (match-string 1)))
+			 (setq branch-format-file
+			       (expand-file-name vc-bzr-admin-branch-format-file
+						 l-c-parent-dir))
+			 (setq lastrev-file
+			       (expand-file-name vc-bzr-admin-lastrev l-c-parent-dir))
+			 ;; FIXME: maybe it's overkill to check if both these files exist.
+			 (and (file-exists-p branch-format-file)
+			      (file-exists-p lastrev-file)))))
 		 t)))
         (with-temp-buffer
           (insert-file-contents branch-format-file)
@@ -475,7 +494,7 @@
 		    (4 'change-log-list nil lax))))
 	 (append `((,log-view-message-re . 'log-view-message-face))
 		 ;; log-view-font-lock-keywords
-		 '(("^ *committer: \
+		 '(("^ *\\(?:committer\\|author\\): \
 \\([^<(]+?\\)[  ]*[(<]\\([[:alnum:]_.+-]+@[[:alnum:]_.-]+\\)[>)]"
 		    (1 'change-log-name)
 		    (2 'change-log-email))
@@ -523,7 +542,8 @@
 (defun vc-bzr-diff (files &optional rev1 rev2 buffer)
   "VC bzr backend for diff."
   ;; `bzr diff' exits with code 1 if diff is non-empty.
-  (apply #'vc-bzr-command "diff" (or buffer "*vc-diff*") 'async files
+  (apply #'vc-bzr-command "diff" (or buffer "*vc-diff*")
+	 (if vc-disable-async-diff 1 'async) files
          "--diff-options" (mapconcat 'identity
                                      (vc-switches 'bzr 'diff)
 				     " ")
@@ -651,7 +671,6 @@
                        ;; For conflicts, should we list the .THIS/.BASE/.OTHER?
 		       ("C  " . conflict)
 		       ("?  " . unregistered)
-		       ("?  " . unregistered)
 		       ;; No such state, but we need to distinguish this case.
 		       ("R  " . renamed)
 		       ;; For a non existent file FOO, the output is:
@@ -663,6 +682,8 @@
 		       ;; FIXME: maybe this warning can be put in the vc-dir header...
 		       ("wor" . not-found)
                        ;; Ignore "P " and "P." for pending patches.
+		       ("P  " . not-found)
+		       ("P. " . not-found)
                        ))
 	(translated nil)
 	(result nil))
@@ -732,7 +753,7 @@
     (define-key map "\C-k" 'vc-bzr-shelve-delete-at-point)
     ;; (define-key map "=" 'vc-bzr-shelve-show-at-point)
     ;; (define-key map "\C-m" 'vc-bzr-shelve-show-at-point)
-    (define-key map "A" 'vc-bzr-shelve-apply-at-point)
+    (define-key map "P" 'vc-bzr-shelve-apply-at-point)
     map))
 
 (defvar vc-bzr-shelve-menu-map
@@ -740,9 +761,9 @@
     (define-key map [de]
       '(menu-item "Delete shelf" vc-bzr-shelve-delete-at-point
 		  :help "Delete the current shelf"))
-    (define-key map [ap]
-      '(menu-item "Apply shelf" vc-bzr-shelve-apply-at-point
-		  :help "Apply the current shelf"))
+    (define-key map [po]
+      '(menu-item "Apply and remove shelf (pop)" vc-bzr-shelve-apply-at-point
+		  :help "Apply the current shelf and remove it"))
     ;; (define-key map [sh]
     ;;   '(menu-item "Show shelve" vc-bzr-shelve-show-at-point
     ;; 		  :help "Show the contents of the current shelve"))
@@ -800,7 +821,7 @@
 	     (propertize x
 			 'face 'font-lock-variable-name-face
 			 'mouse-face 'highlight
-			 'help-echo "mouse-3: Show shelve menu\nA: Apply shelf\nC-k: Delete shelf"
+			 'help-echo "mouse-3: Show shelve menu\nP: Apply and remove shelf (pop)\nC-k: Delete shelf"
 			 'keymap vc-bzr-shelve-map))
 	   shelve "\n"))
        (concat
@@ -830,8 +851,8 @@
 ;;   (pop-to-buffer (current-buffer)))
 
 (defun vc-bzr-shelve-apply (name)
-  "Apply shelve NAME."
-  (interactive "sApply shelf: ")
+  "Apply shelve NAME and remove it afterwards."
+  (interactive "sApply (and remove) shelf: ")
   (vc-bzr-command "unshelve" "*vc-bzr-shelve*" 0 nil "--apply" name)
   (vc-resynch-buffer (vc-bzr-root default-directory) t t))
 
--- a/src/ChangeLog	Fri Jan 08 13:41:42 2010 +0000
+++ b/src/ChangeLog	Tue Jan 19 11:43:25 2010 +0000
@@ -5,8 +5,68 @@
 	`signal_after_change_p' to `coherent_change_p', and make the
 	invocation of `modify_region' conditional on it.
 
+2010-01-06  David Reitter  <david.reitter@gmail.com>
+
+	* nsfns.m (ns_get_screen): Rewrite, returning NULL for non-NS.
+	(Fns_display_usable_bounds): Rewrite, computing bounds properly
+	(Bug#3233).
+
+2010-01-06  Jan Djärv  <jan.h.d@swipnet.se>
+
+	* font.c (font_open_entity): Enable chache and call cached_font_ok
+	for the driver if defined.
+	(QCuser_spec): New symbol.
+	(font_spec_from_name): Save name as user-spec.
+	(font_load_for_lface): Keep user-spec instead of name.
+	(font_open_by_name): Save name as user-spec.
+	(syms_of_font): Initialize QCuser_spec.
+	(font_clear_prop): Clear name if it exists in font (bug#5157).
+
+	* xftfont.c (xftfont_open): Call xftfont_add_rendering_parameters.
+	(xftfont_add_rendering_parameters, xftfont_cached_font_ok): New.
+	(syms_of_xftfont): Initialize xftfont_driver.cached_font_ok.
+
+	* font.h (struct font_driver): Add cached_font_ok.
+
+	* xterm.c (x_clear_frame): Queue draw for scroll bars.
+
+2010-01-05  Jan Djärv  <jan.h.d@swipnet.se>
+
+	* xterm.c (x_new_font): Move code for setting rows/cols before
+	resizing ...
+	(x_set_window_size): ... to here. bug #2568.
+
+	* gtkutil.c (xg_clear_under_internal_border): New function.
+	(xg_frame_resized, xg_frame_set_char_size): Call
+	xg_clear_under_internal_border.
+	(xg_update_scrollbar_pos): Clear under old scroll bar position.
+2010-01-05  Chong Yidong  <cyd@stupidchicken.com>
+
+	* keyboard.c (read_key_sequence): Catch keyboard switch after
+	making a new tty frame (Bug#5095).
+
+2010-01-05  Kenichi Handa  <handa@m17n.org>
+
+	* fontset.c (fontset_find_font): Fix getting the frame pointer.
+
+2010-01-04  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* dbusbind.c (xd_remove_watch): Avoid trying to convert a void* to
+	Lisp_Object, preferring to convert a lisp_Object to a void* instead.
+	(Fdbus_init_bus): Use XHASH to get a scalar value from a Lisp_Object.
+
+2010-01-03  Michael Albinus  <michael.albinus@gmx.de>
+
+	* dbusbind.c (xd_add_watch): Improve debug message.
+	(xd_remove_watch): Improve debug message.  If DATA is the session
+	bus, unset D-Bus session environment.
+	(Fdbus_init_bus): Pass the bus as argument to
+	dbus_connection_set_watch_functions.  (Bug#5283)
+
 2010-01-01  Chong Yidong  <cyd@stupidchicken.com>
 
+	* nsterm.m (ns_get_color): Fix buffer overflow (Bug#4763).
+
 	* lread.c (syms_of_lread): Make it clearer that these are the
 	names of loaded files (Bug#5068).
 
@@ -149,7 +209,7 @@
 2009-12-15  Michael Albinus  <michael.albinus@gmx.de>
 
 	* dbusbind.c (xd_retrieve_arg): Reorder declarations in order to
-	avoid compiler warnings.  (Bug #5217).
+	avoid compiler warnings.  (Bug #5217)
 
 2009-12-14  Kenichi Handa  <handa@m17n.org>
 
@@ -5324,7 +5384,7 @@
 	(XD_SIGNAL1, XD_SIGNAL2, XD_SIGNAL3): New macros.  Throw Qdbus_error.
 	(xd_read_queued_messages): Catch Qdbus_error from the macros.
 	(all): Replace xsignal1, xsignal2, xsignal3 by the respective
-	macro.  (Bug#1186).
+	macro.  (Bug#1186)
 
 2008-10-23  Ali Bahrami  <ali_gnu@emvision.com>  (tiny change)
 
@@ -21218,7 +21278,7 @@
 ;; add-log-time-zone-rule: t
 ;; End:
 
-    Copyright (C) 2007, 2008, 2009  Free Software Foundation, Inc.
+    Copyright (C) 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
 
   This file is part of GNU Emacs.
 
--- a/src/dbusbind.c	Fri Jan 08 13:41:42 2010 +0000
+++ b/src/dbusbind.c	Tue Jan 19 11:43:25 2010 +0000
@@ -761,14 +761,14 @@
   if (dbus_watch_get_flags (watch) & DBUS_WATCH_READABLE)
     {
 #if HAVE_DBUS_WATCH_GET_UNIX_FD
-      /* TODO: Reverse these on Win32, which prefers the opposite. */
+      /* TODO: Reverse these on Win32, which prefers the opposite.  */
       int fd = dbus_watch_get_unix_fd(watch);
       if (fd == -1)
 	fd = dbus_watch_get_socket(watch);
 #else
       int fd = dbus_watch_get_fd(watch);
 #endif
-      XD_DEBUG_MESSAGE ("%d", fd);
+      XD_DEBUG_MESSAGE ("fd %d", fd);
 
       if (fd == -1)
 	return FALSE;
@@ -781,7 +781,8 @@
   return TRUE;
 }
 
-/* Remove connection file descriptor from input_wait_mask.  */
+/* Remove connection file descriptor from input_wait_mask.  DATA is
+   the used bus, either QCdbus_system_bus or QCdbus_session_bus.  */
 void
 xd_remove_watch (watch, data)
      DBusWatch *watch;
@@ -791,18 +792,25 @@
   if (dbus_watch_get_flags (watch) & DBUS_WATCH_READABLE)
     {
 #if HAVE_DBUS_WATCH_GET_UNIX_FD
-      /* TODO: Reverse these on Win32, which prefers the opposite. */
+      /* TODO: Reverse these on Win32, which prefers the opposite.  */
       int fd = dbus_watch_get_unix_fd(watch);
       if (fd == -1)
 	fd = dbus_watch_get_socket(watch);
 #else
       int fd = dbus_watch_get_fd(watch);
 #endif
-      XD_DEBUG_MESSAGE ("%d", fd);
+      XD_DEBUG_MESSAGE ("fd %d", fd);
 
       if (fd == -1)
 	return;
 
+      /* Unset session environment.  */
+      if ((data != NULL) && (data == (void*) XHASH (QCdbus_session_bus)))
+	{
+	  XD_DEBUG_MESSAGE ("unsetenv DBUS_SESSION_BUS_ADDRESS");
+	  unsetenv ("DBUS_SESSION_BUS_ADDRESS");
+	}
+
       /* Remove the file descriptor from input_wait_mask.  */
       delete_keyboard_wait_descriptor (fd);
     }
@@ -825,11 +833,12 @@
   /* Open a connection to the bus.  */
   connection = xd_initialize (bus);
 
-  /* Add the watch functions.  */
+  /* Add the watch functions.  We pass also the bus as data, in order
+     to distinguish between the busses in xd_remove_watch.  */
   if (!dbus_connection_set_watch_functions (connection,
 					    xd_add_watch,
 					    xd_remove_watch,
-					    NULL, NULL, NULL))
+					    NULL, (void*) XHASH (bus), NULL))
     XD_SIGNAL1 (build_string ("Cannot add watch functions"));
 
   /* Return.  */
--- a/src/font.c	Fri Jan 08 13:41:42 2010 +0000
+++ b/src/font.c	Tue Jan 19 11:43:25 2010 +0000
@@ -143,6 +143,8 @@
    characters; used in xfont.c and ftfont.c.  */
 Lisp_Object Qja, Qko;
 
+Lisp_Object QCuser_spec;
+
 Lisp_Object Vfont_encoding_alist;
 
 /* Alist of font registry symbol and the corresponding charsets
@@ -2989,16 +2991,6 @@
   else if (CONSP (Vface_font_rescale_alist))
     scaled_pixel_size = pixel_size * font_rescale_ratio (entity);
 
-#if 0
-  /* This doesn't work if you have changed hinting or any other parameter.
-     We need to make a new object in every case to be sure. */
-  for (objlist = AREF (entity, FONT_OBJLIST_INDEX); CONSP (objlist);
-       objlist = XCDR (objlist))
-    if (! NILP (AREF (XCAR (objlist), FONT_TYPE_INDEX))
-	&& XFONT_OBJECT (XCAR (objlist))->pixel_size == pixel_size)
-      return  XCAR (objlist);
-#endif
-
   val = AREF (entity, FONT_TYPE_INDEX);
   for (driver_list = f->font_driver_list;
        driver_list && ! EQ (driver_list->driver->type, val);
@@ -3006,6 +2998,19 @@
   if (! driver_list)
     return Qnil;
 
+  for (objlist = AREF (entity, FONT_OBJLIST_INDEX); CONSP (objlist);
+       objlist = XCDR (objlist))
+    {
+      Lisp_Object fn = XCAR (objlist);
+      if (! NILP (AREF (fn, FONT_TYPE_INDEX))
+          && XFONT_OBJECT (fn)->pixel_size == pixel_size)
+        {
+          if (driver_list->driver->cached_font_ok == NULL
+              || driver_list->driver->cached_font_ok (f, fn, entity))
+            return fn;
+        }
+    }
+
   font_object = driver_list->driver->open (f, entity, scaled_pixel_size);
   if (!NILP (font_object))
     ASET (font_object, FONT_SIZE_INDEX, make_number (pixel_size));
@@ -3161,6 +3166,7 @@
   if (font_parse_name ((char *) SDATA (font_name), spec) == -1)
     return Qnil;
   font_put_extra (spec, QCname, font_name);
+  font_put_extra (spec, QCuser_spec, font_name);
   return spec;
 }
 
@@ -3174,14 +3180,13 @@
 
   if (! FONTP (font))
     return;
-#if 0
+
   if (! NILP (Ffont_get (font, QCname)))
     {
       font = Fcopy_font_spec (font);
       font_put_extra (font, QCname, Qnil);
     }
 
-#endif
   if (NILP (AREF (font, prop))
       && prop != FONT_FAMILY_INDEX
       && prop != FONT_FOUNDRY_INDEX
@@ -3539,8 +3544,8 @@
   entity = font_open_for_lface (f, entity, attrs, spec);
   if (!NILP (entity))
     {
-      name = Ffont_get (spec, QCname);
-      if (STRINGP (name)) font_put_extra (entity, QCname, name);
+      name = Ffont_get (spec, QCuser_spec);
+      if (STRINGP (name)) font_put_extra (entity, QCuser_spec, name);
     }
   return entity;
 }
@@ -3614,7 +3619,7 @@
   ret = font_open_by_spec (f, spec);
   /* Do not loose name originally put in.  */
   if (!NILP (ret))
-    font_put_extra (ret, QCname, args[1]);
+    font_put_extra (ret, QCuser_spec, args[1]);
 
   return ret;
 }
@@ -5269,6 +5274,8 @@
   DEFSYM (Qja, "ja");
   DEFSYM (Qko, "ko");
 
+  DEFSYM (QCuser_spec, "user-spec");
+
   staticpro (&null_vector);
   null_vector = Fmake_vector (make_number (0), Qnil);
 
--- a/src/font.h	Fri Jan 08 13:41:42 2010 +0000
+++ b/src/font.h	Tue Jan 19 11:43:25 2010 +0000
@@ -689,6 +689,14 @@
 				   int c, unsigned variations[256]));
 
   void (*filter_properties) P_ ((Lisp_Object font, Lisp_Object properties));
+
+  /* Optional.
+
+     Return non-zero if FONT_OBJECT can be used as a (cached) font
+     for ENTITY on frame F.  */
+  int (*cached_font_ok) P_ ((struct frame *f,
+                             Lisp_Object font_object,
+                             Lisp_Object entity));
 };
 
 
--- a/src/fontset.c	Fri Jan 08 13:41:42 2010 +0000
+++ b/src/fontset.c	Tue Jan 19 11:43:25 2010 +0000
@@ -533,8 +533,8 @@
 {
   Lisp_Object vec, font_group;
   int i, charset_matched = 0, found_index;
-  FRAME_PTR f = (FRAMEP (FONTSET_FRAME (fontset)))
-    ? XFRAME (selected_frame) : XFRAME (FONTSET_FRAME (fontset));
+  FRAME_PTR f = (FRAMEP (FONTSET_FRAME (fontset))
+		 ? XFRAME (FONTSET_FRAME (fontset)) : XFRAME (selected_frame));
   Lisp_Object rfont_def;
 
   font_group = fontset_get_font_group (fontset, fallback ? -1 : c);
--- a/src/gtkutil.c	Fri Jan 08 13:41:42 2010 +0000
+++ b/src/gtkutil.c	Tue Jan 19 11:43:25 2010 +0000
@@ -568,6 +568,42 @@
                      f->left_pos, f->top_pos);
 }
 
+/* Clear under internal border if any.  As we use a mix of Gtk+ and X calls
+   and use a GtkFixed widget, this doesn't happen automatically.  */
+
+static void
+xg_clear_under_internal_border (f)
+     FRAME_PTR f;
+{
+  if (FRAME_INTERNAL_BORDER_WIDTH (f) > 0)
+    {
+      GtkWidget *wfixed = f->output_data.x->edit_widget;
+      gtk_widget_queue_draw (wfixed);
+      gdk_window_process_all_updates ();
+      x_clear_area (FRAME_X_DISPLAY (f),
+                    FRAME_X_WINDOW (f),
+                    0, 0,
+                    FRAME_PIXEL_WIDTH (f),
+                    FRAME_INTERNAL_BORDER_WIDTH (f), 0);
+      x_clear_area (FRAME_X_DISPLAY (f),
+                    FRAME_X_WINDOW (f),
+                    0, 0,
+                    FRAME_INTERNAL_BORDER_WIDTH (f),
+                    FRAME_PIXEL_HEIGHT (f), 0);
+      x_clear_area (FRAME_X_DISPLAY (f),
+                    FRAME_X_WINDOW (f),
+                    0, FRAME_PIXEL_HEIGHT (f) - FRAME_INTERNAL_BORDER_WIDTH (f),
+                    FRAME_PIXEL_WIDTH (f),
+                    FRAME_INTERNAL_BORDER_WIDTH (f), 0);
+      x_clear_area (FRAME_X_DISPLAY (f),
+                    FRAME_X_WINDOW (f),
+                    FRAME_PIXEL_WIDTH (f) - FRAME_INTERNAL_BORDER_WIDTH (f),
+                    0,
+                    FRAME_INTERNAL_BORDER_WIDTH (f),
+                    FRAME_PIXEL_HEIGHT (f), 0);
+    }
+}
+
 /* Function to handle resize of our frame.  As we have a Gtk+ tool bar
    and a Gtk+ menu bar, we get resize events for the edit part of the
    frame only.  We let Gtk+ deal with the Gtk+ parts.
@@ -584,8 +620,8 @@
   if (pixelwidth == -1 && pixelheight == -1)
     {
       if (FRAME_GTK_WIDGET (f) && GTK_WIDGET_MAPPED (FRAME_GTK_WIDGET (f)))
-          gdk_window_get_geometry(FRAME_GTK_WIDGET (f)->window, 0, 0,
-                                  &pixelwidth, &pixelheight, 0);
+          gdk_window_get_geometry (FRAME_GTK_WIDGET (f)->window, 0, 0,
+                                   &pixelwidth, &pixelheight, 0);
       else return;
     }
   
@@ -601,6 +637,7 @@
       FRAME_PIXEL_WIDTH (f) = pixelwidth;
       FRAME_PIXEL_HEIGHT (f) = pixelheight;
 
+      xg_clear_under_internal_border (f);
       change_frame_size (f, rows, columns, 0, 1, 0);
       SET_FRAME_GARBAGED (f);
       cancel_mouse_face (f);
@@ -637,6 +674,10 @@
      after calculating that value.  */
   pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, cols);
 
+
+  /* Do this before resize, as we don't know yet if we will be resized.  */
+  xg_clear_under_internal_border (f);
+
   /* Must resize our top level widget.  Font size may have changed,
      but not rows/cols.  */
   gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
@@ -3201,15 +3242,43 @@
     {
       GtkWidget *wfixed = f->output_data.x->edit_widget;
       GtkWidget *wparent = gtk_widget_get_parent (wscroll);
+      GtkFixed *wf = GTK_FIXED (wfixed);
+
+      /* Clear out old position.  */
+      GList *iter;
+      int oldx = -1, oldy = -1, oldw, oldh;
+      for (iter = wf->children; iter; iter = iter->next)
+        if (((GtkFixedChild *)iter->data)->widget == wparent)
+          {
+            GtkFixedChild *ch = (GtkFixedChild *)iter->data;
+            if (ch->x != left || ch->y != top)
+              {
+                oldx = ch->x;
+                oldy = ch->y;
+                gtk_widget_get_size_request (wscroll, &oldw, &oldh);
+              }
+            break;
+          }
 
       /* Move and resize to new values.  */
       gtk_fixed_move (GTK_FIXED (wfixed), wparent, left, top);
       gtk_widget_set_size_request (wscroll, width, height);
-      gtk_widget_queue_draw (wparent);
+      gtk_widget_queue_draw (wfixed);
       gdk_window_process_all_updates ();
+      if (oldx != -1) 
+        {
+          /* Clear under old scroll bar position.  This must be done after
+             the gtk_widget_queue_draw and gdk_window_process_all_updates
+             above.  */
+          x_clear_area (FRAME_X_DISPLAY (f),
+                        FRAME_X_WINDOW (f),
+                        oldx, oldy, oldw, oldh, 0);
+        }
+      
       /* GTK does not redraw until the main loop is entered again, but
          if there are no X events pending we will not enter it.  So we sync
          here to get some events.  */
+            
       x_sync (f);
       SET_FRAME_GARBAGED (f);
       cancel_mouse_face (f);
--- a/src/keyboard.c	Fri Jan 08 13:41:42 2010 +0000
+++ b/src/keyboard.c	Tue Jan 19 11:43:25 2010 +0000
@@ -9502,7 +9502,13 @@
 	    key = read_char (NILP (prompt), nmaps,
 			     (Lisp_Object *) submaps, last_nonmenu_event,
 			     &used_mouse_menu, NULL);
-	    if (INTEGERP (key) && XINT (key) == -2) /* wrong_kboard_jmpbuf */
+	    if ((INTEGERP (key) && XINT (key) == -2) /* wrong_kboard_jmpbuf */
+		/* When switching to a new tty (with a new keyboard),
+		   read_char returns the new buffer, rather than -2
+		   (Bug#5095).  This is because `terminal-init-xterm'
+		   calls read-char, which eats the wrong_kboard_jmpbuf
+		   return.  Any better way to fix this? -- cyd  */
+		|| (interrupted_kboard != current_kboard))
 	      {
 		int found = 0;
 		struct kboard *k;
--- a/src/nsfns.m	Fri Jan 08 13:41:42 2010 +0000
+++ b/src/nsfns.m	Tue Jan 19 11:43:25 2010 +0000
@@ -206,30 +206,28 @@
 static NSScreen *
 ns_get_screen (Lisp_Object screen)
 {
-  struct terminal *terminal = get_terminal (screen, 1);
+  struct frame *f;
+  struct terminal *terminal;
+
+  if (EQ (Qt, screen)) /* not documented */
+    return [NSScreen mainScreen];
+
+  terminal = get_terminal (screen, 1);
   if (terminal->type != output_ns)
-    // Not sure if this special case for nil is needed.  It does seem to be
-    // important in xfns.c for the make-frame call in frame-initialize,
-    // so let's keep it here for now.
-    return (NILP (screen) ? [NSScreen mainScreen] : NULL);
+    return NULL;
+
+  if (NILP (screen))
+    f = SELECTED_FRAME ();
+  else if (FRAMEP (screen))
+    f = XFRAME (screen);
   else
     {
       struct ns_display_info *dpyinfo = terminal->display_info.ns;
-      struct frame *f = dpyinfo->x_focus_frame;
-      if (!f)
-	f = dpyinfo->x_highlight_frame;
-      if (!f)
-	return NULL;
-      else
-	{
-	  id window = nil;
-	  Lisp_Object frame;
-	  eassert (FRAME_NS_P (f));
-	  XSETFRAME (frame, f);
-	  window = ns_get_window (frame);
-	  return window ? [window screen] : NULL;
-	}
+      f = (dpyinfo->x_focus_frame || dpyinfo->x_highlight_frame);
     }
+
+  return ((f && FRAME_NS_P (f)) ? [[FRAME_NS_VIEW (f) window] screen]
+	  : NULL);
 }
 
 
@@ -2325,15 +2323,21 @@
      Lisp_Object display;
 {
   int top;
+  NSScreen *screen;
   NSRect vScreen;
 
   check_ns ();
-  vScreen = [ns_get_screen (display) visibleFrame];
-  top = vScreen.origin.y == 0.0 ?
-    (int) [ns_get_screen (display) frame].size.height - vScreen.size.height : 0;
-
+  screen = ns_get_screen (display);
+  if (!screen)
+    return Qnil;
+
+  vScreen = [screen visibleFrame];
+
+  /* NS coordinate system is upside-down.
+     Transform to screen-specific coordinates. */
   return list4 (make_number ((int) vScreen.origin.x),
-                make_number (top),
+		make_number ((int) [screen frame].size.height
+			     - vScreen.size.height - vScreen.origin.y),
                 make_number ((int) vScreen.size.width),
                 make_number ((int) vScreen.size.height));
 }
--- a/src/nsterm.m	Fri Jan 08 13:41:42 2010 +0000
+++ b/src/nsterm.m	Tue Jan 19 11:43:25 2010 +0000
@@ -1346,7 +1346,8 @@
     }
   else if (!strncmp(name, "rgb:", 4))  /* A newer X11 format -- rgb:r/g/b */
     {
-      strcpy(hex, name + 4);
+      strncpy (hex, name + 4, 19);
+      hex[19] = '\0';
       scaling = (strlen(hex) - 2) / 3;
     }
   else if (name[0] == '#')        /* An old X11 format; convert to newer */
--- a/src/xftfont.c	Fri Jan 08 13:41:42 2010 +0000
+++ b/src/xftfont.c	Tue Jan 19 11:43:25 2010 +0000
@@ -237,6 +237,56 @@
     }
 }
 
+static void
+xftfont_add_rendering_parameters (pat, entity)
+     FcPattern *pat;
+     Lisp_Object entity;
+{
+  Lisp_Object tail;
+  int ival;
+
+  for (tail = AREF (entity, FONT_EXTRA_INDEX); CONSP (tail); tail = XCDR (tail))
+    {
+      Lisp_Object key = XCAR (XCAR (tail));
+      Lisp_Object val = XCDR (XCAR (tail));
+
+      if (EQ (key, QCantialias))
+          FcPatternAddBool (pat, FC_ANTIALIAS, NILP (val) ? FcFalse : FcTrue);
+      else if (EQ (key, QChinting))
+	FcPatternAddBool (pat, FC_HINTING, NILP (val) ? FcFalse : FcTrue);
+      else if (EQ (key, QCautohint))
+	FcPatternAddBool (pat, FC_AUTOHINT, NILP (val) ? FcFalse : FcTrue);
+      else if (EQ (key, QChintstyle))
+	{
+	  if (INTEGERP (val))
+	    FcPatternAddInteger (pat, FC_HINT_STYLE, XINT (val));
+          else if (SYMBOLP (val)
+                   && FcNameConstant (SDATA (SYMBOL_NAME (val)), &ival))
+	    FcPatternAddInteger (pat, FC_HINT_STYLE, ival);
+	}
+      else if (EQ (key, QCrgba))
+	{
+	  if (INTEGERP (val))
+	    FcPatternAddInteger (pat, FC_RGBA, XINT (val));
+          else if (SYMBOLP (val)
+                   && FcNameConstant (SDATA (SYMBOL_NAME (val)), &ival))
+	    FcPatternAddInteger (pat, FC_RGBA, ival);
+	}
+      else if (EQ (key, QClcdfilter))
+	{
+	  if (INTEGERP (val))
+	    FcPatternAddInteger (pat, FC_LCD_FILTER, ival = XINT (val));
+          else if (SYMBOLP (val)
+                   && FcNameConstant (SDATA (SYMBOL_NAME (val)), &ival))
+	    FcPatternAddInteger (pat, FC_LCD_FILTER, ival);
+	}
+#ifdef FC_EMBOLDEN
+      else if (EQ (key, QCembolden))
+	FcPatternAddBool (pat, FC_EMBOLDEN, NILP (val) ? FcFalse : FcTrue);
+#endif
+    }
+}
+
 static Lisp_Object
 xftfont_open (f, entity, pixel_size)
      FRAME_PTR f;
@@ -245,7 +295,7 @@
 {
   FcResult result;
   Display *display = FRAME_X_DISPLAY (f);
-  Lisp_Object val, filename, index, tail, font_object;
+  Lisp_Object val, filename, index, font_object;
   FcPattern *pat = NULL, *match;
   struct xftfont_info *xftfont_info = NULL;
   struct font *font;
@@ -253,7 +303,7 @@
   XftFont *xftfont = NULL;
   int spacing;
   char name[256];
-  int len, i, ival;
+  int len, i;
   XGlyphInfo extents;
   FT_Face ft_face;
   FcMatrix *matrix;
@@ -297,46 +347,7 @@
      over 10x20-ISO8859-1.pcf.gz).  */
   FcPatternAddCharSet (pat, FC_CHARSET, ftfont_get_fc_charset (entity));
 
-  for (tail = AREF (entity, FONT_EXTRA_INDEX); CONSP (tail); tail = XCDR (tail))
-    {
-      Lisp_Object key, val;
-
-      key = XCAR (XCAR (tail)), val = XCDR (XCAR (tail));
-      if (EQ (key, QCantialias))
-          FcPatternAddBool (pat, FC_ANTIALIAS, NILP (val) ? FcFalse : FcTrue);
-      else if (EQ (key, QChinting))
-	FcPatternAddBool (pat, FC_HINTING, NILP (val) ? FcFalse : FcTrue);
-      else if (EQ (key, QCautohint))
-	FcPatternAddBool (pat, FC_AUTOHINT, NILP (val) ? FcFalse : FcTrue);
-      else if (EQ (key, QChintstyle))
-	{
-	  if (INTEGERP (val))
-	    FcPatternAddInteger (pat, FC_HINT_STYLE, XINT (val));
-          else if (SYMBOLP (val)
-                   && FcNameConstant (SDATA (SYMBOL_NAME (val)), &ival))
-	    FcPatternAddInteger (pat, FC_HINT_STYLE, ival);
-	}
-      else if (EQ (key, QCrgba))
-	{
-	  if (INTEGERP (val))
-	    FcPatternAddInteger (pat, FC_RGBA, XINT (val));
-          else if (SYMBOLP (val)
-                   && FcNameConstant (SDATA (SYMBOL_NAME (val)), &ival))
-	    FcPatternAddInteger (pat, FC_RGBA, ival);
-	}
-      else if (EQ (key, QClcdfilter))
-	{
-	  if (INTEGERP (val))
-	    FcPatternAddInteger (pat, FC_LCD_FILTER, ival = XINT (val));
-          else if (SYMBOLP (val)
-                   && FcNameConstant (SDATA (SYMBOL_NAME (val)), &ival))
-	    FcPatternAddInteger (pat, FC_LCD_FILTER, ival);
-	}
-#ifdef FC_EMBOLDEN
-      else if (EQ (key, QCembolden))
-	FcPatternAddBool (pat, FC_EMBOLDEN, NILP (val) ? FcFalse : FcTrue);
-#endif
-    }
+  xftfont_add_rendering_parameters (pat, entity);
 
   FcPatternAddString (pat, FC_FILE, (FcChar8 *) SDATA (filename));
   FcPatternAddInteger (pat, FC_INDEX, XINT (index));
@@ -712,6 +723,53 @@
   return 0;
 }
 
+static int
+xftfont_cached_font_ok (f, font_object, entity)
+     struct frame *f;
+     Lisp_Object font_object;
+     Lisp_Object entity;
+
+{
+  struct xftfont_info *info = (struct xftfont_info *) XFONT_OBJECT (font_object);
+  FcPattern *oldpat = info->xftfont->pattern;
+  Display *display = FRAME_X_DISPLAY (f);
+  FcPattern *pat = FcPatternCreate ();
+  FcBool b1, b2;
+  int ok = 0, i1, i2, r1, r2;
+
+  xftfont_add_rendering_parameters (pat, entity);
+  XftDefaultSubstitute (display, FRAME_X_SCREEN_NUMBER (f), pat);
+
+  r1 = FcPatternGetBool (pat, FC_ANTIALIAS, 0, &b1);
+  r2 = FcPatternGetBool (oldpat, FC_ANTIALIAS, 0, &b2);
+  if (r1 != r2 || b1 != b2) goto out;
+  r1 = FcPatternGetBool (pat, FC_HINTING, 0, &b1);
+  r2 = FcPatternGetBool (oldpat, FC_HINTING, 0, &b2);
+  if (r1 != r2 || b1 != b2) goto out;
+  r1 = FcPatternGetBool (pat, FC_AUTOHINT, 0, &b1);
+  r2 = FcPatternGetBool (oldpat, FC_AUTOHINT, 0, &b2);
+  if (r1 != r2 || b1 != b2) goto out;
+#ifdef FC_EMBOLDEN
+  r1 = FcPatternGetBool (pat, FC_EMBOLDEN, 0, &b1);
+  r2 = FcPatternGetBool (oldpat, FC_EMBOLDEN, 0, &b2);
+  if (r1 != r2 || b1 != b2) goto out;
+#endif
+  r1 = FcPatternGetInteger (pat, FC_HINT_STYLE, 0, &i1);
+  r2 = FcPatternGetInteger (oldpat, FC_HINT_STYLE, 0, &i2);
+  if (r1 != r2 || i1 != i2) goto out;
+  r1 = FcPatternGetInteger (pat, FC_LCD_FILTER, 0, &i1);
+  r2 = FcPatternGetInteger (oldpat, FC_LCD_FILTER, 0, &i2);
+  if (r1 != r2 || i1 != i2) goto out;
+  r1 = FcPatternGetInteger (pat, FC_RGBA, 0, &i1);
+  r2 = FcPatternGetInteger (oldpat, FC_RGBA, 0, &i2);
+  if (r1 != r2 || i1 != i2) goto out;
+
+  ok = 1;
+ out:
+  FcPatternDestroy (pat);
+  return ok;
+}
+
 void
 syms_of_xftfont ()
 {
@@ -737,6 +795,7 @@
   xftfont_driver.text_extents = xftfont_text_extents;
   xftfont_driver.draw = xftfont_draw;
   xftfont_driver.end_for_frame = xftfont_end_for_frame;
+  xftfont_driver.cached_font_ok = xftfont_cached_font_ok;
 
   register_font_driver (&xftfont_driver, NULL);
 }
--- a/src/xterm.c	Fri Jan 08 13:41:42 2010 +0000
+++ b/src/xterm.c	Tue Jan 19 11:43:25 2010 +0000
@@ -2951,6 +2951,12 @@
      colors or something like that, then they should be notified.  */
   x_scroll_bar_clear (f);
 
+#if defined (USE_GTK) && defined (USE_TOOLKIT_SCROLL_BARS)
+  /* Make sure scroll bars are redrawn.  As they aren't redrawn by
+     redisplay, do it here.  */
+  gtk_widget_queue_draw (FRAME_GTK_WIDGET (f));
+#endif
+  
   XFlush (FRAME_X_DISPLAY (f));
 
   UNBLOCK_INPUT;
@@ -8064,32 +8070,7 @@
 	 doing it because it's done in Fx_show_tip, and it leads to
 	 problems because the tip frame has no widget.  */
       if (NILP (tip_frame) || XFRAME (tip_frame) != f)
-        {
-	  int rows, cols;
-	  
-	  /* When the frame is maximized/fullscreen or running under for
-             example Xmonad, x_set_window_size will be a no-op.
-             In that case, the right thing to do is extend rows/cols to
-             the current frame size.  We do that first if x_set_window_size
-             turns out to not be a no-op (there is no way to know).
-             The size will be adjusted again if the frame gets a
-             ConfigureNotify event as a result of x_set_window_size.  */
-          int pixelh = FRAME_PIXEL_HEIGHT (f);
-#ifdef USE_X_TOOLKIT
-          /* The menu bar is not part of text lines.  The tool bar
-             is however.  */
-          pixelh -= FRAME_MENUBAR_HEIGHT (f);
-#endif
-          rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixelh);
-	  /* Update f->scroll_bar_actual_width because it is used in
-	     FRAME_PIXEL_WIDTH_TO_TEXT_COLS.  */
-	  f->scroll_bar_actual_width
-	    = FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f);
-          cols = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, FRAME_PIXEL_WIDTH (f));
-          
-          change_frame_size (f, rows, cols, 0, 1, 0);
-          x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f));
-        }
+        x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f));
     }
 
 #ifdef HAVE_X_I18N
@@ -8977,6 +8958,32 @@
 {
   BLOCK_INPUT;
 
+  if (NILP (tip_frame) || XFRAME (tip_frame) != f)
+    {
+      int r, c;
+	  
+      /* When the frame is maximized/fullscreen or running under for
+         example Xmonad, x_set_window_size_1 will be a no-op.
+         In that case, the right thing to do is extend rows/cols to
+         the current frame size.  We do that first if x_set_window_size_1
+         turns out to not be a no-op (there is no way to know).
+         The size will be adjusted again if the frame gets a
+         ConfigureNotify event as a result of x_set_window_size.  */
+      int pixelh = FRAME_PIXEL_HEIGHT (f);
+#ifdef USE_X_TOOLKIT
+      /* The menu bar is not part of text lines.  The tool bar
+         is however.  */
+      pixelh -= FRAME_MENUBAR_HEIGHT (f);
+#endif
+      r = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixelh);
+      /* Update f->scroll_bar_actual_width because it is used in
+         FRAME_PIXEL_WIDTH_TO_TEXT_COLS.  */
+      f->scroll_bar_actual_width
+        = FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f);
+      c = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, FRAME_PIXEL_WIDTH (f));
+      change_frame_size (f, r, c, 0, 1, 0);
+    }
+
 #ifdef USE_GTK
   if (FRAME_GTK_WIDGET (f))
     xg_frame_set_char_size (f, cols, rows);