changeset 109850:242a8b343421

merge from trunk
author Joakim <joakim@localhost.localdomain>
date Sat, 03 Apr 2010 22:21:58 +0200
parents 28a8c62b8ee7 (current diff) cdab6ddd22d0 (diff)
children e01fea458062
files configure configure.in src/Makefile.in
diffstat 57 files changed, 449 insertions(+), 380 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Apr 02 23:09:13 2010 +0200
+++ b/ChangeLog	Sat Apr 03 22:21:58 2010 +0200
@@ -1,3 +1,7 @@
+2010-04-01  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* configure.in: Remove all references to LIBX11_SYSTEM.
+
 2010-03-30  Dan Nicolaescu  <dann@ics.uci.edu>
 
 	* configure.in: Remove all references to C_DEBUG_SWITCH.
@@ -3627,8 +3631,8 @@
 
 1999-10-09  Stefan Monnier  <monnier@cs.yale.edu>
 
-	* make-dist (dontcompile): look for the DONTCOMPILE variable rather
-	  than the obsolete dontcompilefiles pseudo-rule in lisp/Makefile.
+	* make-dist (dontcompile): Look for the DONTCOMPILE variable rather
+	than the obsolete dontcompilefiles pseudo-rule in lisp/Makefile.
 
 1999-10-09  Richard M. Stallman  <rms@gnu.org>
 
@@ -3637,7 +3641,7 @@
 
 1999-10-08  Stefan Monnier  <monnier@cs.yale.edu>
 
-	* update-subdirs: also ignore CVS subdirs.
+	* update-subdirs: Also ignore CVS subdirs.
 
 1999-10-07  Gerd Moellmann  <gerd@gnu.org>
 
@@ -6197,8 +6201,8 @@
 	src/Makefile.in is built from src/Makefile.
 
 	* Makefile.in (src/Makefile, lib-src/Makefile, oldXMenu/Makefile):
-	  If these files are out of date, simply have config.status
-	  rebuild them; don't rebuild them explicitly.
+	If these files are out of date, simply have config.status
+	rebuild them; don't rebuild them explicitly.
 
 1993-09-25  Brian J. Fox  (bfox@ai.mit.edu)
 
@@ -6393,7 +6397,7 @@
 
 1993-07-12  Frederic Pierresteguy  (F.Pierresteguy@frcl.bull.fr)
 
-	* configure.in (m68k-bull-sysv3): new config.
+	* configure.in (m68k-bull-sysv3): New config.
 
 1993-07-10  Jim Blandy  (jimb@geech.gnu.ai.mit.edu)
 
@@ -6616,7 +6620,7 @@
 
 	* make-dist: Rebuild configure if configure.in is newer.
 
-	* Makefile.in (src:, lib-src:, FRC:): force the src and lib-src
+	* Makefile.in (src:, lib-src:, FRC:): Force the src and lib-src
 	targets to be executed even if make remembers that it has already
 	satisfied FRC.
 
@@ -7116,7 +7120,7 @@
 	* make-dist: Don't distribute etc/Old files.
 
 	* GETTING.GNU.SOFTWARE, PROBLEMS: Registered into RCS with their
-	  backups.
+	backups.
 
 1993-03-20  Jim Blandy  (jimb@geech.gnu.ai.mit.edu)
 
@@ -7146,7 +7150,7 @@
 1993-03-17  Eric S. Raymond  (eric@mole.gnu.ai.mit.edu)
 
 	* Makefile.in: Add commented-out variable settings for developer's
-	  configuration.
+	configuration.
 
 1993-03-14  Jim Blandy  (jimb@wookumz.gnu.ai.mit.edu)
 
@@ -7761,7 +7765,7 @@
 	the script.
 	* INSTALL: Doc fix.
 
-	* Makefile: brought the Makefile up to the GNU coding
+	* Makefile: Brought the Makefile up to the GNU coding
 	standards, as described in standards.text:
 	(TAGS): New name for the target which rebuilds the tags table.
 	(check): New target; doesn't do anything yet.
--- a/admin/CPP-DEFINES	Fri Apr 02 23:09:13 2010 +0200
+++ b/admin/CPP-DEFINES	Sat Apr 03 22:21:58 2010 +0200
@@ -234,7 +234,6 @@
 LIBS_MACHINE
 LIBS_SYSTEM
 LIBS_TERMCAP
-LIBX11_SYSTEM
 LIBXMU
 LIB_GCC
 LIB_MATH
--- a/admin/ChangeLog	Fri Apr 02 23:09:13 2010 +0200
+++ b/admin/ChangeLog	Sat Apr 03 22:21:58 2010 +0200
@@ -1,6 +1,6 @@
 2010-04-01  Eli Zaretskii  <eliz@gnu.org>
 
-	* CPP-DEFINES (__DJGPP__, __GO32__): Remove, o longer used.
+	* CPP-DEFINES (__DJGPP__, __GO32__): Remove, no longer used.
 
 2010-03-10  Chong Yidong  <cyd@stupidchicken.com>
 
--- a/configure	Fri Apr 02 23:09:13 2010 +0200
+++ b/configure	Sat Apr 03 22:21:58 2010 +0200
@@ -5772,10 +5772,7 @@
 #define LIB_X11_LIB -lX11
 #endif
 
-#ifndef LIBX11_SYSTEM
-#define LIBX11_SYSTEM
-#endif
-configure___ LIBX=LIB_X11_LIB LIBX11_SYSTEM
+configure___ LIBX=LIB_X11_LIB
 
 #ifdef UNEXEC
 configure___ unexec=UNEXEC
--- a/configure.in	Fri Apr 02 23:09:13 2010 +0200
+++ b/configure.in	Sat Apr 03 22:21:58 2010 +0200
@@ -866,10 +866,7 @@
 #define LIB_X11_LIB -lX11
 #endif
 
-#ifndef LIBX11_SYSTEM
-#define LIBX11_SYSTEM
-#endif
-configure___ LIBX=LIB_X11_LIB LIBX11_SYSTEM
+configure___ LIBX=LIB_X11_LIB
 
 #ifdef UNEXEC
 configure___ unexec=UNEXEC
--- a/doc/lispref/ChangeLog	Fri Apr 02 23:09:13 2010 +0200
+++ b/doc/lispref/ChangeLog	Sat Apr 03 22:21:58 2010 +0200
@@ -1,3 +1,13 @@
+2010-04-01  Chong Yidong  <cyd@stupidchicken.com>
+
+	* nonascii.texi (Text Representations): Don't mark
+	enable-multibyte-characters as a user option.
+
+2010-03-31  Eli Zaretskii  <eliz@gnu.org>
+
+	* control.texi (Handling Errors): How to re-throw a signal caught
+	by condition-case.
+
 2010-03-26  Chong Yidong  <cyd@stupidchicken.com>
 
 	* loading.texi (Hooks for Loading): Document after-load-functions.
--- a/doc/lispref/control.texi	Fri Apr 02 23:09:13 2010 +0200
+++ b/doc/lispref/control.texi	Sat Apr 03 22:21:58 2010 +0200
@@ -1023,6 +1023,20 @@
 
 If @var{var} is @code{nil}, that means no variable is bound.  Then the
 error symbol and associated data are not available to the handler.
+
+@cindex rethrow a signal
+Sometimes it is necessary to re-throw a signal caught by
+@code{condition-case}, for some outer-level handler to catch.  Here's
+how to do that:
+
+@smallexample
+  (signal (car err) (cdr err))
+@end smallexample
+
+@noindent
+where @code{err} is the error description variable, the first argument
+to @code{condition-case} whose error condition you want to re-throw.
+@xref{Definition of signal}.
 @end defspec
 
 @defun error-message-string error-description
@@ -1109,6 +1123,7 @@
 @end smallexample
 @end defmac
 
+
 @node Error Symbols
 @subsubsection Error Symbols and Condition Names
 @cindex error symbol
--- a/doc/lispref/nonascii.texi	Fri Apr 02 23:09:13 2010 +0200
+++ b/doc/lispref/nonascii.texi	Sat Apr 03 22:21:58 2010 +0200
@@ -37,7 +37,7 @@
 
   Emacs buffers and strings support a large repertoire of characters
 from many different scripts, allowing users to type and display text
-in most any known written language.
+in almost any known written language.
 
 @cindex character codepoint
 @cindex codespace
@@ -95,7 +95,7 @@
 The representation for a string is determined and recorded in the string
 when the string is constructed.
 
-@defopt enable-multibyte-characters
+@defvar enable-multibyte-characters
 This variable specifies the current buffer's text representation.
 If it is non-@code{nil}, the buffer contains multibyte text; otherwise,
 it contains unibyte encoded text or binary non-text data.
@@ -105,7 +105,7 @@
 
 The @samp{--unibyte} command line option does its job by setting the
 default value to @code{nil} early in startup.
-@end defopt
+@end defvar
 
 @defun position-bytes position
 Buffer positions are measured in character units.  This function
--- a/etc/AUTHORS	Fri Apr 02 23:09:13 2010 +0200
+++ b/etc/AUTHORS	Sat Apr 03 22:21:58 2010 +0200
@@ -33,8 +33,8 @@
 
 Adrian Robert: co-wrote ns-win.el
 and changed nsterm.m nsfns.m nsfont.m nsterm.h Makefile.in nsmenu.m
-  configure.in README config.in emacs.c font.c keyboard.c nsgui.h image.c
-  lisp.h macos.texi menu.c nsimage.m xdisp.c Info-gnustep.plist darwin.h
+  configure.in README config.in emacs.c font.c keyboard.c nsgui.h xdisp.c
+  image.c lisp.h macos.texi menu.c nsimage.m Info-gnustep.plist darwin.h
   and 83 other files
 
 Ævar Arnfjörð Bjarmason: changed rcirc.el
@@ -164,12 +164,12 @@
 
 Andreas Luik: changed xfns.c xterm.c
 
-Andreas Politz: changed elp.el ido.el term.el
+Andreas Politz: changed editfns.c elp.el ido.el term.el
 
 Andreas Schwab: changed Makefile.in configure.in lisp.h xdisp.c files.el
   coding.c alloc.c process.c print.c editfns.c fileio.c fns.c dired.el
   xterm.c keyboard.c simple.el eval.c info.el buffer.c sysdep.c emacs.c
-  and 480 other files
+  and 483 other files
 
 Andreas Seltenreich: changed nnweb.el gnus.texi message.el gnus.el
   nnslashdot.el gnus-util.el mm-url.el mm-uu.el url-http.el xterm.c
@@ -230,7 +230,7 @@
   ldap.el message.el mm-decode.el mml-sec.el mml.el mule-conf.el
   nnimap.el nnrss.el wid-edit.el
 
-Arni Magnusson: changed ada-mode.texi
+Arni Magnusson: changed ada-mode.texi frames.texi
 
 Artem Chuprina: changed message.el
 
@@ -282,7 +282,7 @@
 and changed vc.el gnus-msg.el message.el diff-mode.el ffap.el nnimap.el
   nnmbox.el simple.el vc-cvs.el
 
-Bernhard Herzog: changed vc-hg.el
+Bernhard Herzog: changed vc-hg.el menu.c
 
 Bernt Hansen: changed org-clock.el
 
@@ -433,10 +433,10 @@
 
 Chong Yidong: wrote redisplay-testsuite.el
 and co-wrote longlines.el
-and changed xdisp.c simple.el files.el display.texi files.texi
-  frames.texi keyboard.c cus-edit.el faces.el xterm.c Makefile.in
-  emacs.texi xfaces.c font.c startup.el xfns.c image.c misc.texi
-  compile.el configure.in custom.texi and 608 other files
+and changed xdisp.c simple.el files.el display.texi frames.texi
+  files.texi emacs.texi keyboard.c cus-edit.el faces.el xterm.c
+  Makefile.in xfaces.c font.c startup.el xfns.c misc.texi image.c
+  compile.el custom.texi text.texi and 633 other files
 
 Chris Chase: co-wrote idlw-shell.el idlwave.el
 
@@ -557,6 +557,8 @@
   emacs.c files.el term.c process.c vc-rcs.el bindings.el diff-mode.el
   lisp-mode.el and 840 other files
 
+Dan Rosenberg: changed movemail.c
+
 Daniel Brockman: changed cus-start.el format-spec.el ibuffer.el rcirc.el
 
 Daniel Colascione: co-wrote js.el
@@ -905,25 +907,26 @@
 
 Eric M. Ludlam: wrote analyze.el args.el autoconf-edit.el bovine.el c.el
   cedet-cscope.el cedet-files.el cedet-global.el cedet-idutils.el
-  cedet-utests.el chart.el checkdoc.el compile.el cpp-root.el
+  cedet-utests.el chart.el checkdoc.el compile.el complete.el cpp-root.el
   cscope.el ctxt.el data-debug.el db-debug.el db-el.el db-file.el
   db-find.el db-global.el db-mode.el db-ref.el db-typecache.el db.el
   debug.el decorate.el dep.el dframe.el dictionary.el dired.el doc.el
-  document.el ede-grammar.el ede.el edit.el eieio-base.el eieio-comp.el
-  eieio-custom.el eieio-datadebug.el eieio-opt.el eieio-speedbar.el
-  eieio.el el.el expandproto.el extract.el ezimage.el fcn.el
-  fields.el filter.el filters.el find.el format.el fw.el gcc.el
-  getset.el global.el grep.el html.el ia-sb.el ia.el idle.el idutils.el
-  include.el insert.el inversion.el java.el javascript.el lex-spp.el
-  lex.el linux.el list.el locate.el make.el makefile-edit.el map.el
-  mode.el mru-bookmark.el pconf.el pmake.el proj-archive.el proj-aux.el
-  proj-comp.el proj-elisp.el proj-info.el proj-misc.el proj-obj.el
-  proj-prog.el proj-scheme.el proj-shared.el proj.el project-am.el
-  pulse.el refs.el sb-image.el sb.el scm.el scope.el semantic-ia-utest.el
-  semantic-tests.el semantic-utest-c.el semantic-utest.el semantic.el
-  shell.el simple.el sort.el source.el speedbar.el srecode.el srt.el
+  document.el ede-grammar.el ede-tests.el ede.el edit.el eieio-base.el
+  eieio-comp.el eieio-custom.el eieio-datadebug.el eieio-opt.el
+  eieio-speedbar.el eieio.el el.el emacs.el expandproto.el extract.el
+  ezimage.el fcn.el fields.el files.el filter.el filters.el find.el
+  format.el fw.el gcc.el getset.el global.el grep.el html.el ia-sb.el
+  ia.el idle.el idutils.el imenu.el include.el insert.el inversion.el
+  java.el javascript.el lex-spp.el lex.el linux.el list.el locate.el
+  make.el makefile-edit.el map.el mode.el mru-bookmark.el pconf.el
+  pmake.el proj-archive.el proj-aux.el proj-comp.el proj-elisp.el
+  proj-info.el proj-misc.el proj-obj.el proj-prog.el proj-scheme.el
+  proj-shared.el proj.el project-am.el pulse.el refs.el sb-image.el sb.el
+  scm.el scope.el semantic-ia-utest.el semantic-tests.el
+  semantic-utest-c.el semantic-utest.el semantic.el shell.el simple.el
+  sort.el source.el speedbar.el srecode-tests.el srecode.el srt.el
   symref.el system.el table.el tag-file.el tag-ls.el tag-write.el tag.el
-  texi.el util.el
+  test.el texi.el util.el
 and co-wrote cpp.el db-ebrowse.el util-modes.el
 and changed *.el info.el rmail.el speedbspec.el gud.el sb-dir-minus.xpm
   sb-dir-plus.xpm sb-dir.xpm sb-mail.xpm sb-pg-minus.xpm sb-pg-plus.xpm
@@ -999,9 +1002,9 @@
 Florian Weimer: changed message.el gnus.el coding.c gnus-sum.el gnus.texi
   mm-decode.el mm-util.el
 
-Francesc Rocher: changed startup.el cus-start.el gnus.el gnus.png
-  gnus.svg macterm.c splash.png splash.svg splash8.xpm w32term.c xdisp.c
-  xterm.c
+Francesc Rocher: changed startup.el MORE.STUFF cus-start.el gnus.el
+  gnus.png gnus.svg macterm.c splash.png splash.svg splash8.xpm w32term.c
+  xdisp.c xterm.c
 
 Francesco Potortì: wrote cmacexp.el
 and changed etags.c man.el delta.h etags.1 undigest.el Makefile.in
@@ -1130,7 +1133,7 @@
   cal-menu.el cal-hebrew.el fortran.el holidays.el configure.in
   cal-islam.el bytecomp.el calendar.texi cal-bahai.el files.el appt.el
   cal-china.el emacs.texi rmailsum.el simple.el startup.el
-  and 972 other files
+  and 975 other files
 
 Glynn Clements: wrote gamegrid.el snake.el tetris.el
 
@@ -1342,7 +1345,7 @@
 Jan Djärv: wrote dnd.el font-setting.el x-dnd.el
 and changed gtkutil.c xterm.c xfns.c configure.in xterm.h xmenu.c
   x-win.el Makefile.in gtkutil.h keyboard.c frame.c frames.texi config.in
-  emacs.c xselect.c startup.el xresources.texi alloc.c cus-start.el
+  emacs.c xselect.c xresources.texi startup.el alloc.c cus-start.el
   xlwmenu.c process.c and 203 other files
 
 Jan Moringen: co-wrote cpp.el
@@ -1629,10 +1632,10 @@
 Juan León Lahoz García: wrote wdired.el
 and changed files.el perl-mode.el
 
-Juanma Barranquero: changed makefile.w32-in subr.el files.el bs.el
-  faces.el help-fns.el w32fns.c org.el server.el simple.el emacsclient.c
+Juanma Barranquero: changed makefile.w32-in subr.el files.el faces.el
+  bs.el help-fns.el w32fns.c org.el server.el simple.el emacsclient.c
   desktop.el buffer.c mule-cmds.el ido.el window.c xdisp.c allout.el
-  keyboard.c replace.el eval.c and 924 other files
+  keyboard.c replace.el eval.c and 930 other files
 
 Juergen Hoetzel: changed url-handlers.el
 
@@ -1729,7 +1732,7 @@
 and changed gnus-art.el message.el gnus-sum.el gnus.texi mm-decode.el
   mm-util.el mm-view.el rfc2047.el mml.el gnus-group.el gnus-msg.el
   gnus-util.el gnus-start.el gnus.el nntp.el gnus-agent.el nnrss.el
-  mm-uu.el nnmail.el emacs-mime.texi nnheader.el and 107 other files
+  mm-uu.el nnmail.el emacs-mime.texi nnheader.el and 108 other files
 
 Kaveh R. Ghazi: changed delta88k.h xterm.c
 
@@ -2948,6 +2951,8 @@
 
 Steinar Bang: changed imap.el
 
+Štěpán Němec: changed subr.el vc-git.el
+
 Stephan Stahl: changed which-func.el buff-menu.el buffer.c dired-x.texi
   ediff-mult.el
 
@@ -3083,7 +3088,7 @@
 
 Terry Jones: wrote shadow.el
 
-Tetsurou Okazaki: changed byte-opt.el log-edit.el xterm.c
+Tetsurou Okazaki: changed Makefile.in byte-opt.el log-edit.el xterm.c
 
 Thamer Mahmoud: changed arabic.el
 
@@ -3311,7 +3316,7 @@
 
 Wilson H. Tien: changed unexelf.c
 
-Wilson Snyder: changed verilog-mode.el
+Wilson Snyder: changed verilog-mode.el files.el
 
 Wim Nieuwenhuizen: changed TUTORIAL.nl
 
@@ -3343,7 +3348,7 @@
 Yamamoto Mitsuharu: changed macterm.c macfns.c mac-win.el mac.c macterm.h
   macmenu.c macgui.h image.c macselect.c xdisp.c keyboard.c xterm.c
   Makefile.in emacs.c darwin.h macos.texi unexmacosx.c w32term.c alloc.c
-  configure.in dispnew.c and 82 other files
+  configure.in dispnew.c and 83 other files
 
 Yann Dirson: changed imenu.el
 
--- a/etc/NEWS.23	Fri Apr 02 23:09:13 2010 +0200
+++ b/etc/NEWS.23	Sat Apr 03 22:21:58 2010 +0200
@@ -268,6 +268,7 @@
 
 To disable this check, set compose-mail-user-agent-warnings to nil.
 
+---
 ** The default value of mail-interactive is t, since Emacs 23.1.
 (This was not announced at the time.)  It means that when sending mail,
 Emacs will wait for the process sending mail to return.  If you
@@ -464,7 +465,7 @@
 
 
 * Lisp changes in Emacs 23.2
-
+---
 ** All the default-FOO variables that hold the default value of the FOO
 variable, are now declared obsolete.
 
--- a/lib-src/ChangeLog	Fri Apr 02 23:09:13 2010 +0200
+++ b/lib-src/ChangeLog	Sat Apr 03 22:21:58 2010 +0200
@@ -1,3 +1,22 @@
+2010-04-03  Juanma Barranquero  <lekktu@gmail.com>
+
+	Add stubs for Windows, required after CVE-2010-0825 change.
+	* ntlib.c (getgid, getegid, setegid): New stubs.
+	* ntlib.h (getgid, getegid, setegid): Declare them.
+
+2010-04-02  Dan Rosenberg  <dan.j.rosenberg@gmail.com>  (tiny change)
+
+	* movemail.c (main): Check return values of setuid.  Avoid
+	possibility of symlink attack when movemail is setgid mail
+	(CVE-2010-0825).
+
+2010-04-02  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	Remove extern errno declarations.
+	* movemail.c:
+	* etags.c:
+	* emacsclient.c: Remove extern errno declarations.
+
 2010-03-20  Glenn Morris  <rgm@gnu.org>
 
 	* Makefile.in (KRB4LIB, DESLIB, KRB5LIB, CRYPTOLIB, COM_ERRLIB)
@@ -3960,7 +3979,7 @@
 	(xmalloc, fatal, error): New functions.
 	(delete_socket, handle_signals): New functions.
 	(progname, socket_name): New variables.
-	 [HAVE_SOCKETS] (main): Call handle_signals; set the new variables.
+	[HAVE_SOCKETS] (main): Call handle_signals; set the new variables.
 
 1996-09-01  Richard Stallman  <rms@ethanol.gnu.ai.mit.edu>
 
@@ -4733,9 +4752,9 @@
 1995-01-12  Francesco Potortì  (pot@cnuce.cnr.it)
 
 	* etags.c (FILEPOS, GET_CHARNO, GET_FILEPOS, max, LINENO): Deleted.
-	(append_to_tagfile, typedefs, typedefs_and_cplusplus,
-	 constantypedefs, update, vgrind_style, no_warnings,
-	 cxref_style, cplusplus, noindentypedefs): Were int, now logical.
+	(append_to_tagfile, typedefs, typedefs_and_cplusplus)
+	(constantypedefs, update, vgrind_style, no_warnings)
+	(cxref_style, cplusplus, noindentypedefs): Were int, now logical.
 	(permit_duplicates): Was a var, now a #define.
 	(filename_lb): Was global, now local to main.
 	(main): Open the tag file when in cxref mode.
@@ -4754,8 +4773,8 @@
 	(TOKEN_SAVED_P, SAVE_TOKEN, RESTORE_TOKEN): Deleted.
 	(C_entries): nameb and savenameb deleted.  Use dinamic allocation.
 	(pfcnt): Deleted.  Users updated.
-	(getit, Asm_labels, Pascal_functions, L_getit, get_scheme,
-	 TEX_getit, prolog_getit): Use dinamic allocation for storing
+	(getit, Asm_labels, Pascal_functions, L_getit, get_scheme)
+	(TEX_getit, prolog_getit): Use dinamic allocation for storing
 	the tag instead of a fixed size buffer.
 
 1995-01-10  Richard Stallman  <rms@mole.gnu.ai.mit.edu>
@@ -6680,8 +6699,8 @@
 1990-01-19  David Lawrence  (tale@cocoa-puffs)
 
 	* timer.c, getdate.y (new files) and Makefile:
-	  Sub-process support for run-at-time in timer.el.
-	  Doesn't yet work correctly for USG.
+	Sub-process support for run-at-time in timer.el.
+	Doesn't yet work correctly for USG.
 
 1990-01-10  Jim Kingdon  (kingdon@pogo)
 
--- a/lib-src/emacsclient.c	Fri Apr 02 23:09:13 2010 +0200
+++ b/lib-src/emacsclient.c	Sat Apr 03 22:21:58 2010 +0200
@@ -723,7 +723,6 @@
 #define SEND_BUFFER_SIZE   4096
 
 extern char *strerror ();
-extern int errno;
 
 /* Buffer to accumulate data to send in TCP connections.  */
 char send_buffer[SEND_BUFFER_SIZE + 1];
--- a/lib-src/etags.c	Fri Apr 02 23:09:13 2010 +0200
+++ b/lib-src/etags.c	Sat Apr 03 22:21:58 2010 +0200
@@ -188,9 +188,6 @@
 #include <stdio.h>
 #include <ctype.h>
 #include <errno.h>
-#ifndef errno
-  extern int errno;
-#endif
 #include <sys/types.h>
 #include <sys/stat.h>
 
--- a/lib-src/movemail.c	Fri Apr 02 23:09:13 2010 +0200
+++ b/lib-src/movemail.c	Sat Apr 03 22:21:58 2010 +0200
@@ -140,9 +140,6 @@
 #endif
 #endif
 
-#ifndef errno
-extern int errno;
-#endif
 char *strerror ();
 #ifdef HAVE_INDEX
 extern char *index __P ((const char *, int));
@@ -197,6 +194,9 @@
 # define ARGSTR "p"
 #endif /* MAIL_USE_POP */
 
+  uid_t real_gid = getgid();
+  uid_t priv_gid = getegid();
+
 #ifdef WINDOWSNT
   /* Ensure all file i/o is in binary mode. */
   _fmode = _O_BINARY;
@@ -247,25 +247,6 @@
   if (*outname == 0)
     fatal ("Destination file name is empty", 0, 0);
 
-  /* Check access to output file.  */
-  if (access (outname, F_OK) == 0 && access (outname, W_OK) != 0)
-    pfatal_with_name (outname);
-
-  /* Also check that outname's directory is writable to the real uid.  */
-  {
-    char *buf = (char *) xmalloc (strlen (outname) + 1);
-    char *p;
-    strcpy (buf, outname);
-    p = buf + strlen (buf);
-    while (p > buf && !IS_DIRECTORY_SEP (p[-1]))
-      *--p = 0;
-    if (p == buf)
-      *p++ = '.';
-    if (access (buf, W_OK) != 0)
-      pfatal_with_name (buf);
-    free (buf);
-  }
-
 #ifdef MAIL_USE_POP
   if (!strncmp (inname, "po:", 3))
     {
@@ -277,15 +258,12 @@
       exit (status);
     }
 
-  setuid (getuid ());
+  if (setuid (getuid ()) < 0)
+    fatal ("Failed to drop privileges", 0, 0);
+
 #endif /* MAIL_USE_POP */
 
 #ifndef DISABLE_DIRECT_ACCESS
-
-  /* Check access to input file.  */
-  if (access (inname, R_OK | W_OK) != 0)
-    pfatal_with_name (inname);
-
 #ifndef MAIL_USE_MMDF
 #ifndef MAIL_USE_SYSTEM_LOCK
 #ifdef MAIL_USE_MAILLOCK
@@ -379,7 +357,8 @@
       time_t touched_lock, now;
 #endif
 
-      setuid (getuid ());
+      if (setuid (getuid ()) < 0 || setegid (real_gid) < 0)
+	fatal ("Failed to drop privileges", 0, 0);
 
 #ifndef MAIL_USE_MMDF
 #ifdef MAIL_USE_SYSTEM_LOCK
@@ -405,6 +384,9 @@
       if (outdesc < 0)
 	pfatal_with_name (outname);
 
+      if (setegid (priv_gid) < 0)
+	fatal ("Failed to regain privileges", 0, 0);
+
       /* This label exists so we can retry locking
 	 after a delay, if it got EAGAIN or EBUSY.  */
     retry_lock:
@@ -498,6 +480,10 @@
 	pfatal_and_delete (outname);
 #endif
 
+      /* Prevent symlink attacks truncating other users' mailboxes */
+      if (setegid (real_gid) < 0)
+	fatal ("Failed to drop privileges", 0, 0);
+
       /* Check to make sure no errors before we zap the inbox.  */
       if (close (outdesc) != 0)
 	pfatal_and_delete (outname);
@@ -529,6 +515,10 @@
 	}
 #endif /* not MAIL_USE_SYSTEM_LOCK */
 
+      /* End of mailbox truncation */
+      if (setegid (priv_gid) < 0)
+	fatal ("Failed to regain privileges", 0, 0);
+
 #ifdef MAIL_USE_MAILLOCK
       /* This has to occur in the child, i.e., in the process that
          acquired the lock! */
--- a/lib-src/ntlib.c	Fri Apr 02 23:09:13 2010 +0200
+++ b/lib-src/ntlib.c	Sat Apr 03 22:21:58 2010 +0200
@@ -125,12 +125,30 @@
   return 0;
 }
 
+unsigned
+getgid ()
+{
+  return 0;
+}
+
+unsigned
+getegid ()
+{
+  return 0;
+}
+
 int
 setuid (unsigned uid)
 {
   return 0;
 }
 
+int
+setegid (unsigned gid)
+{
+  return 0;
+}
+
 struct passwd *
 getpwuid (unsigned uid)
 {
--- a/lib-src/ntlib.h	Fri Apr 02 23:09:13 2010 +0200
+++ b/lib-src/ntlib.h	Sat Apr 03 22:21:58 2010 +0200
@@ -36,7 +36,10 @@
 char * getlogin ();
 char * cuserid (char * s);
 unsigned getuid ();
+unsigned getegid ();
+unsigned getgid ();
 int setuid (unsigned uid);
+int setegid (unsigned gid);
 char * getpass (const char * prompt);
 int fchown (int fd, unsigned uid, unsigned gid);
 
--- a/lisp/ChangeLog	Fri Apr 02 23:09:13 2010 +0200
+++ b/lisp/ChangeLog	Sat Apr 03 22:21:58 2010 +0200
@@ -1,7 +1,47 @@
+2010-04-03  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* font-lock.el: Require CL when compiling.
+	(font-lock-turn-on-thing-lock): Use `case'.
+
+2010-04-03  Eli Zaretskii  <eliz@gnu.org>
+
+	* emacs-lisp/authors.el (authors-fixed-entries): Add entry for Eli
+	Zaretskii.
+
+2010-04-02  Juanma Barranquero  <lekktu@gmail.com>
+
+	* cedet/semantic/imenu.el (semantic-imenu-bucketize-type-members)
+	(semantic-create-imenu-directory-index): Fix typos in docstrings.
+	(semantic-imenu-goto-function): Reflow docstring.
+
+2010-04-02  Juri Linkov  <juri@jurta.org>
+
+	* ehelp.el (electric-help-orig-major-mode):
+	New buffer-local variable.
+	(electric-help-mode): Set it to original major-mode.  Doc fix.
+	(with-electric-help): Use `electric-help-orig-major-mode' instead
+	of (default-value 'major-mode).  Doc fix.
+	http://lists.gnu.org/archive/html/emacs-devel/2010-04/msg00069.html
+
+2010-04-02  Sam Steingold  <sds@gnu.org>
+
+	* vc-hg.el (vc-hg-push, vc-hg-pull): Use `apply' when calling
+	`vc-hg-command' with a list of flags.
+
+	* progmodes/bug-reference.el (bug-reference-bug-regexp):
+	Also accept "patch" and "RFE".
+	(bug-reference-fontify): `bug-reference-url-format' can also be a
+	function to be able to handle the bug kind.
+	(turn-on-bug-reference-mode, turn-on-bug-reference-prog-mode): Add.
+
+2010-04-02  Jan Djärv  <jan.h.d@swipnet.se>
+
+	* tmm.el (tmm-get-keymap): Check with symbolp before passing
+	value to fboundp, it may not be a symbol.
+
 2010-03-31  Chong Yidong  <cyd@stupidchicken.com>
 
-	* cus-edit.el (custom-buffer-sort-alphabetically): Update
-	:version.
+	* cus-edit.el (custom-buffer-sort-alphabetically): Update :version.
 
 2010-03-31  Juri Linkov  <juri@jurta.org>
 
@@ -3856,7 +3896,7 @@
 	* bookmark.el: Formatting and doc fixes only:
 	(bookmark-search-delay): Shorten doc string to fit in 80 columns.
 	(bookmark-bmenu-search): Wrap to fit within 80 columns.
-	  Minor grammar and punctuation fixes in doc string.
+	Minor grammar and punctuation fixes in doc string.
 	(bookmark-read-search-input): Adjust to fit within 80 columns.
 
 2009-11-20  Tassilo Horn  <tassilo@member.fsf.org>
@@ -6611,12 +6651,12 @@
 2009-10-05  Karl Fogel  <kfogel@red-bean.com>
 
 	* bookmark.el (bookmark-handle-bookmark): If bookmark has no file,
-	  don't do anything related to relocating, just return nil.
+	don't do anything related to relocating, just return nil.
 	(bookmark-error-no-filename): New error.
 	(bookmark-default-handler): Signal `bookmark-error-no-filename' if
-	  bookmark has no file.  Don't even attempt to handle things that
-	  are not files; the whole point of custom handlers is to keep that
-	  knowledge elsewhere anyway.  Tighten some comments.
+	bookmark has no file.  Don't even attempt to handle things that
+	are not files; the whole point of custom handlers is to keep that
+	knowledge elsewhere anyway.  Tighten some comments.
 	(bookmark-file-or-variation-thereof): Remove now-unused function.
 	(bookmark-location): Doc string fix.
 	(Bug#4250)
@@ -6646,8 +6686,8 @@
 	(bookmark-relocate, bookmark-insert-location, bookmark-rename)
 	(bookmark-insert, bookmark-delete, bookmark-time-to-save-p)
 	(bookmark-edit-annotation-mode, bookmark-edit-annotation):
-	   Improve doc strings to say whether bookmark can be a string or
-	   a record or both, and make other consistency and clarity fixes.
+	Improve doc strings to say whether bookmark can be a string or
+	a record or both, and make other consistency and clarity fixes.
 	(bookmark-get-handler, bookmark--jump-via, bookmark-write-file)
 	(bookmark-default-annotation-text, bookmark-yank-word)
 	(bookmark-maybe-load-default-file, bookmark-maybe-sort-alist)
@@ -6655,12 +6695,12 @@
 	(bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames)
 	(bookmark-bmenu-bookmark): Give these doc strings.
 	(bookmark-bmenu-check-position): Give this a doc string, but also
-	   add a FIXME comment about how the function may be pointless.
+	add a FIXME comment about how the function may be pointless.
 	(bookmark-default-handler): Rework doc string and change a
-	   parameter name, to clarify that this takes a bookmark record
-	   not a bookmark name.
+	parameter name, to clarify that this takes a bookmark record
+	not a bookmark name.
 	(bookmark-set): Change a parameter name to indicate its meaning,
-	   and improve the doc string a bit.
+	and improve the doc string a bit.
 	(Bug#4188)
 
 2009-10-04  Karl Fogel  <kfogel@red-bean.com>
--- a/lisp/cedet/semantic/db-find.el	Fri Apr 02 23:09:13 2010 +0200
+++ b/lisp/cedet/semantic/db-find.el	Sat Apr 03 22:21:58 2010 +0200
@@ -774,7 +774,7 @@
 		 (buffer-name))
 
       (data-debug-new-buffer "*SEMANTICDB lost-includes ADEBUG*")
-      (data-debug-insert-tag-list lost "*")
+      ;; (data-debug-insert-tag-list lost "*")
       )))
 
 (defun semanticdb-find-adebug-insert-scanned-tag-cons (consdata prefix prebuttontext)
--- a/lisp/cedet/semantic/imenu.el	Fri Apr 02 23:09:13 2010 +0200
+++ b/lisp/cedet/semantic/imenu.el	Sat Apr 03 22:21:58 2010 +0200
@@ -95,7 +95,7 @@
 
 (defcustom semantic-imenu-bucketize-type-members t
   "*Non-nil if members of a type should be grouped into buckets.
-nil means to keep them in the same order.
+A nil value means to keep them in the same order.
 Overriden to nil if `semantic-imenu-bucketize-file' is nil."
   :group 'semantic-imenu
   :type 'boolean)
@@ -167,8 +167,8 @@
 
 (defun semantic-imenu-goto-function (name position &optional rest)
   "Move point associated with NAME to POSITION.
-Used to override function `imenu-default-goto-function' so that we can continue
-to use overlays to maintain the current position.
+Used to override function `imenu-default-goto-function' so that
+we can continue to use overlays to maintain the current position.
 Optional argument REST is some extra stuff."
   (require 'pulse)
   (if (semantic-overlay-p position)
@@ -249,7 +249,7 @@
               'semantic-imenu-flush-fcn nil t)))
 
 (defun semantic-create-imenu-directory-index (&optional stream)
-  "Create an IMENU tag index based on all files active in semanticdb.
+  "Create an imenu tag index based on all files active in semanticdb.
 Optional argument STREAM is the stream of tags for the current buffer."
   (if (not semanticdb-current-database)
       (semantic-create-imenu-index-1 stream nil)
--- a/lisp/ehelp.el	Fri Apr 02 23:09:13 2010 +0200
+++ b/lisp/ehelp.el	Sat Apr 03 22:21:58 2010 +0200
@@ -94,10 +94,14 @@
     map)
   "Keymap defining commands available in `electric-help-mode'.")
 
+(defvar electric-help-orig-major-mode nil)
+(make-variable-buffer-local 'electric-help-orig-major-mode)
+
 (defun electric-help-mode ()
   "`with-electric-help' temporarily places its buffer in this mode.
-\(On exit from `with-electric-help', the buffer is put in default `major-mode'.)"
+\(On exit from `with-electric-help', the original `major-mode' is restored.)"
   (setq buffer-read-only t)
+  (setq electric-help-orig-major-mode major-mode)
   (setq mode-name "Help")
   (setq major-mode 'help)
   (setq mode-line-buffer-identification '(" Help:  %b"))
@@ -131,7 +135,7 @@
 
 When the user exits (with `electric-help-exit', or otherwise), the help
 buffer's window disappears (i.e., we use `save-window-excursion'), and
-BUFFER is put into default `major-mode' (or `fundamental-mode')."
+BUFFER is put back into its original major mode."
   (setq buffer (get-buffer-create (or buffer "*Help*")))
   (let ((one (one-window-p t))
 	(config (current-window-configuration))
@@ -170,13 +174,17 @@
       (set-buffer buffer)
       (setq buffer-read-only nil)
 
+      ;; Restore the original major mode saved by `electric-help-mode'.
       ;; We should really get a usable *Help* buffer when retaining
       ;; the electric one with `r'.  The problem is that a simple
-      ;; call to help-mode won't cut it; at least RET is bound wrong
-      ;; afterwards.  It's also not clear that `help-mode' is always
-      ;; the right thing, maybe we should add an optional parameter.
+      ;; call to `help-mode' won't cut it; e.g. RET is bound wrong
+      ;; afterwards (`View-scroll-line-forward' instead of `help-follow').
+      ;; That's because Help mode should be set with `with-help-window'
+      ;; instead of the direct call to `help-mode'. But at least
+      ;; RET works correctly on links after using `help-mode'.
+      ;; This is satisfactory enough.
       (condition-case ()
-          (funcall (or (default-value 'major-mode) 'fundamental-mode))
+          (funcall (or electric-help-orig-major-mode 'fundamental-mode))
         (error nil))
 
       (set-window-configuration config)
--- a/lisp/emacs-lisp/authors.el	Fri Apr 02 23:09:13 2010 +0200
+++ b/lisp/emacs-lisp/authors.el	Sat Apr 03 22:21:58 2010 +0200
@@ -427,6 +427,7 @@
     ("Geoff Voelker" :wrote "w32-fns.el" "w32.c" "w32.h" "w32heap.c"
      "w32heap.h" "w32inevt.c" "w32proc.c" "w32term.c" "ms-w32.h")
     ("Morten Welinder" :wrote "dosfns.c" "[many MS-DOS files]" "msdos.h")
+    ("Eli Zaretskii" :wrote "bidi.c" "[bidirectional display in xdisp.c]")
     ;; Not using this version any more.
 ;;;    ("Pace Willisson" :wrote "ispell.el")
     ;; FIXME overwritten by Author:.
--- a/lisp/font-lock.el	Fri Apr 02 23:09:13 2010 +0200
+++ b/lisp/font-lock.el	Sat Apr 03 22:21:58 2010 +0200
@@ -209,6 +209,7 @@
 ;;; Code:
 
 (require 'syntax)
+(eval-when-compile (require 'cl))
 
 ;; Define core `font-lock' group.
 (defgroup font-lock '((jit-lock custom-group))
@@ -902,26 +903,24 @@
 (declare-function lazy-lock-mode "lazy-lock")
 
 (defun font-lock-turn-on-thing-lock ()
-  (let ((thing-mode (font-lock-value-in-major-mode font-lock-support-mode)))
-    (cond ((eq thing-mode 'fast-lock-mode)
-	   (fast-lock-mode t))
-	  ((eq thing-mode 'lazy-lock-mode)
-	   (lazy-lock-mode t))
-	  ((eq thing-mode 'jit-lock-mode)
-	   ;; Prepare for jit-lock
-	   (remove-hook 'after-change-functions
-			'font-lock-after-change-function t)
-	   (set (make-local-variable 'font-lock-fontify-buffer-function)
-		'jit-lock-refontify)
-	   ;; Don't fontify eagerly (and don't abort if the buffer is large).
-	   (set (make-local-variable 'font-lock-fontified) t)
-	   ;; Use jit-lock.
-	   (jit-lock-register 'font-lock-fontify-region
-			      (not font-lock-keywords-only))
-           ;; Tell jit-lock how we extend the region to refontify.
-           (add-hook 'jit-lock-after-change-extend-region-functions
-                     'font-lock-extend-jit-lock-region-after-change
-                     nil t)))))
+  (case (font-lock-value-in-major-mode font-lock-support-mode)
+    (fast-lock-mode (fast-lock-mode t))
+    (lazy-lock-mode (lazy-lock-mode t))
+    (jit-lock-mode
+     ;; Prepare for jit-lock
+     (remove-hook 'after-change-functions
+                  'font-lock-after-change-function t)
+     (set (make-local-variable 'font-lock-fontify-buffer-function)
+          'jit-lock-refontify)
+     ;; Don't fontify eagerly (and don't abort if the buffer is large).
+     (set (make-local-variable 'font-lock-fontified) t)
+     ;; Use jit-lock.
+     (jit-lock-register 'font-lock-fontify-region
+                        (not font-lock-keywords-only))
+     ;; Tell jit-lock how we extend the region to refontify.
+     (add-hook 'jit-lock-after-change-extend-region-functions
+               'font-lock-extend-jit-lock-region-after-change
+               nil t))))
 
 (defun font-lock-turn-off-thing-lock ()
   (cond ((bound-and-true-p fast-lock-mode)
--- a/lisp/gnus/ChangeLog	Fri Apr 02 23:09:13 2010 +0200
+++ b/lisp/gnus/ChangeLog	Sat Apr 03 22:21:58 2010 +0200
@@ -1,3 +1,8 @@
+2010-04-01  Andreas Schwab  <schwab@linux-m68k.org>
+
+	* mm-uu.el (mm-uu-pgp-signed-extract-1): Use buffer-file-coding-system
+	if set.
+
 2010-03-31  Katsumi Yamaoka  <yamaoka@jpl.org>
 
 	* gnus-art.el (gnus-article-browse-html-save-cid-content): Rename from
--- a/lisp/gnus/mm-uu.el	Fri Apr 02 23:09:13 2010 +0200
+++ b/lisp/gnus/mm-uu.el	Sat Apr 03 22:21:58 2010 +0200
@@ -486,9 +486,11 @@
       (if (mm-uu-pgp-signed-test)
 	  (progn
 	    (mml2015-clean-buffer)
-	    (let ((coding-system-for-write (or gnus-newsgroup-charset
+	    (let ((coding-system-for-write (or buffer-file-coding-system
+					       gnus-newsgroup-charset
 					       'iso-8859-1))
-		  (coding-system-for-read (or gnus-newsgroup-charset
+		  (coding-system-for-read (or buffer-file-coding-system
+					      gnus-newsgroup-charset
 					      'iso-8859-1)))
 	      (funcall (mml2015-clear-verify-function))))
 	(when (and mml2015-use (null (mml2015-clear-verify-function)))
--- a/lisp/ldefs-boot.el	Fri Apr 02 23:09:13 2010 +0200
+++ b/lisp/ldefs-boot.el	Sat Apr 03 22:21:58 2010 +0200
@@ -1319,7 +1319,7 @@
 
 Variables
 
- This is a brief overview of the different varaibles. For more info,
+ This is a brief overview of the different variables.  For more info,
  see the documentation for the variables (type \\[describe-variable] <variable> RET).
 
  artist-rubber-banding		Interactively do rubber-banding or not
@@ -23982,9 +23982,11 @@
 (custom-autoload 'mail-signature-file "sendmail" t)
 
 (defvar mail-default-directory (purecopy "~/") "\
-Directory for mail buffers.
-Value of `default-directory' for mail buffers.
-This directory is used for auto-save files of mail buffers.")
+Value of `default-directory' for Mail mode buffers.
+This directory is used for auto-save files of Mail mode buffers.
+
+Note that Message mode does not use this variable; it auto-saves
+in `message-auto-save-directory'.")
 
 (custom-autoload 'mail-default-directory "sendmail" t)
 
@@ -29315,9 +29317,10 @@
 \(fn HISTORIC &optional NOT-URGENT)" t nil)
 
 (autoload 'vc-root-diff "vc" "\
-Display diffs between file revisions.
-Normally this compares the currently selected fileset with their
-working revisions.  With a prefix argument HISTORIC, it reads two revision
+Display diffs between VC-controlled whole tree revisions.
+Normally, this compares the tree corresponding to the current
+fileset with the working revision.
+With a prefix argument HISTORIC, prompt for two revision
 designators specifying which revisions to compare.
 
 The optional argument NOT-URGENT non-nil means it is ok to say no to
@@ -29372,12 +29375,20 @@
 
 (autoload 'vc-print-log "vc" "\
 List the change log of the current fileset in a window.
-If WORKING-REVISION is non-nil, leave the point at that revision.
+If WORKING-REVISION is non-nil, leave point at that revision.
+If LIMIT is non-nil, it should be a number specifying the maximum
+number of revisions to show; the default is `vc-log-show-limit'.
+
+When called interactively with a prefix argument, prompt for
+WORKING-REVISION and LIMIT.
 
 \(fn &optional WORKING-REVISION LIMIT)" t nil)
 
 (autoload 'vc-print-root-log "vc" "\
-List the change log of for the current VC controlled tree in a window.
+List the change log for the current VC controlled tree in a window.
+If LIMIT is non-nil, it should be a number specifying the maximum
+number of revisions to show; the default is `vc-log-show-limit'.
+When called interactively with a prefix argument, prompt for LIMIT.
 
 \(fn &optional LIMIT)" t nil)
 
--- a/lisp/progmodes/bug-reference.el	Fri Apr 02 23:09:13 2010 +0200
+++ b/lisp/progmodes/bug-reference.el	Sat Apr 03 22:21:58 2010 +0200
@@ -41,13 +41,20 @@
 (defvar bug-reference-url-format nil
   "Format used to turn a bug number into a URL.
 The bug number is supplied as a string, so this should have a single %s.
+This can also be a function designator; it is called without arguments
+ and should return a string.
+It can use `match-string' to get parts matched against
+`bug-reference-bug-regexp', specifically:
+ 1. issue kind (bug, patch, rfe &c)
+ 2. issue number.
+
 There is no default setting for this, it must be set per file.")
 
 ;;;###autoload
 (put 'bug-reference-url-format 'safe-local-variable 'stringp)
 
 (defconst bug-reference-bug-regexp
-  "\\(?:[Bb]ug ?#\\|PR [a-z-+]+/\\)\\([0-9]+\\)"
+  "\\([Bb]ug ?#\\|[Pp]atch ?#\\|RFE ?#\\|PR [a-z-+]+/\\)\\([0-9]+\\)"
   "Regular expression which matches bug references.")
 
 (defun bug-reference-set-overlay-properties ()
@@ -87,9 +94,11 @@
 	    (overlay-put overlay 'category 'bug-reference)
 	    ;; Don't put a link if format is undefined
 	    (when bug-reference-url-format
-	      (overlay-put overlay 'bug-reference-url
-			   (format bug-reference-url-format
-				   (match-string-no-properties 1))))))))))
+              (overlay-put overlay 'bug-reference-url
+                           (if (stringp bug-reference-url-format)
+                               (format bug-reference-url-format
+                                       (match-string-no-properties 2))
+                             (funcall bug-reference-url-format))))))))))
 
 ;; Taken from button.el.
 (defun bug-reference-push-button (&optional pos use-mouse-action)
@@ -121,6 +130,11 @@
       (widen)
       (bug-reference-unfontify (point-min) (point-max)))))
 
+(defun turn-on-bug-reference-mode ()
+  "Unconditionally turn bug reference mode on."
+  (unless bug-reference-mode
+    (bug-reference-mode)))
+
 ;;;###autoload
 (define-minor-mode bug-reference-prog-mode
   "Like `bug-reference-mode', but only buttonize in comments and strings."
@@ -134,5 +148,10 @@
       (widen)
       (bug-reference-unfontify (point-min) (point-max)))))
 
+(defun turn-on-bug-reference-prog-mode ()
+  "Unconditionally turn bug reference prog mode on."
+  (unless bug-reference-prog-mode
+    (bug-reference-prog-mode)))
+
 ;; arch-tag: b138abce-e5c3-475e-bd58-7afba40387ea
 ;;; bug-reference.el ends here
--- a/lisp/tmm.el	Fri Apr 02 23:09:13 2010 +0200
+++ b/lisp/tmm.el	Sat Apr 03 22:21:58 2010 +0200
@@ -452,20 +452,21 @@
       (unless (assoc event tmm-table-undef)
 	(cond ((if (listp elt)
 		   (or (keymapp elt) (eq (car elt) 'lambda))
-		 (fboundp elt))
+		 (and (symbolp elt) (fboundp elt)))
 	       (setq km elt))
 
 	      ((if (listp (cdr-safe elt))
 		   (or (keymapp (cdr-safe elt))
 		       (eq (car (cdr-safe elt)) 'lambda))
-		 (fboundp (cdr-safe elt)))
+		 (and (symbolp (cdr-safe elt)) (fboundp (cdr-safe elt))))
 	       (setq km (cdr elt))
 	       (and (stringp (car elt)) (setq str (car elt))))
 
 	      ((if (listp (cdr-safe (cdr-safe elt)))
 		   (or (keymapp (cdr-safe (cdr-safe elt)))
 		       (eq (car (cdr-safe (cdr-safe elt))) 'lambda))
-		 (fboundp (cdr-safe (cdr-safe elt))))
+		 (and (symbolp (cdr-safe (cdr-safe elt)))
+			       (fboundp (cdr-safe (cdr-safe elt)))))
 	       (setq km (cddr elt))
 	       (and (stringp (car elt)) (setq str (car elt)))
 	       (and str
@@ -499,7 +500,8 @@
 	      ((if (listp (cdr-safe (cdr-safe (cdr-safe elt))))
 		   (or (keymapp (cdr-safe (cdr-safe (cdr-safe elt))))
 		       (eq (car (cdr-safe (cdr-safe (cdr-safe elt)))) 'lambda))
-		 (fboundp (cdr-safe (cdr-safe (cdr-safe elt)))))
+		 (and (symbolp (cdr-safe (cdr-safe (cdr-safe elt))))
+		      (fboundp (cdr-safe (cdr-safe (cdr-safe elt))))))
 					 ; New style of easy-menu
 	       (setq km (cdr (cddr elt)))
 	       (and (stringp (car elt)) (setq str (car elt)))
--- a/lisp/vc-hg.el	Fri Apr 02 23:09:13 2010 +0200
+++ b/lisp/vc-hg.el	Sat Apr 03 22:21:58 2010 +0200
@@ -235,10 +235,10 @@
     (with-current-buffer
 	buffer
       (apply 'vc-hg-command buffer 0 files "log"
-	     (append
+	     (nconc
 	      (when start-revision (list (format "-r%s:" start-revision)))
 	      (when limit (list "-l" (format "%s" limit)))
-	      (when shortlog '("--style" "compact"))
+	      (when shortlog (list "--style" "compact"))
 	      vc-hg-log-switches)))))
 
 (defvar log-view-message-re)
@@ -419,7 +419,8 @@
 (defun vc-hg-checkin (files rev comment &optional extra-args)
   "Hg-specific version of `vc-backend-checkin'.
 REV is ignored."
-  (apply 'vc-hg-command nil 0 files  (append (list "commit" "-m" comment) extra-args)))
+  (apply 'vc-hg-command nil 0 files
+         (nconc (list "commit" "-m" comment) extra-args)))
 
 (defun vc-hg-find-revision (file rev buffer)
   (let ((coding-system-for-read 'binary)
@@ -611,22 +612,22 @@
   (interactive)
   (let ((marked-list (log-view-get-marked)))
     (if marked-list
-        (vc-hg-command
-         nil 0 nil
-         (cons "push"
+        (apply #'vc-hg-command
+               nil 0 nil
+               "push"
                (apply 'nconc
-                      (mapcar (lambda (arg) (list "-r" arg)) marked-list))))
-         (error "No log entries selected for push"))))
+                      (mapcar (lambda (arg) (list "-r" arg)) marked-list)))
+      (error "No log entries selected for push"))))
 
 (defun vc-hg-pull ()
   (interactive)
   (let ((marked-list (log-view-get-marked)))
     (if marked-list
-        (vc-hg-command
-         nil 0 nil
-         (cons "pull"
+        (apply #'vc-hg-command
+               nil 0 nil
+               "pull"
                (apply 'nconc
-                      (mapcar (lambda (arg) (list "-r" arg)) marked-list))))
+                      (mapcar (lambda (arg) (list "-r" arg)) marked-list)))
       (error "No log entries selected for pull"))))
 
 ;;; Internal functions
--- a/msdos/ChangeLog	Fri Apr 02 23:09:13 2010 +0200
+++ b/msdos/ChangeLog	Sat Apr 03 22:21:58 2010 +0200
@@ -735,7 +735,7 @@
 
 1994-04-30  Morten Welinder  (terra@diku.dk)
 
-	* sed1.inp: don't comment out the inc-vers run as that
+	* sed1.inp: Don't comment out the inc-vers run as that
 	does not exist anymore.
 	Don't reset DEBUG_MOLE as that no longer is used.
 	Identify the file being patched as src/...
@@ -758,7 +758,7 @@
 
 1994-01-08  Morten Welinder  (terra@diku.dk)
 
-	* sed3.inp: improve make-compatibility by not using drive
+	* sed3.inp: Improve make-compatibility by not using drive
 	specifications and by not specifying an explicit shell.
 
 1994-01-07  Morten Welinder  (terra@diku.dk)
--- a/src/ChangeLog	Fri Apr 02 23:09:13 2010 +0200
+++ b/src/ChangeLog	Sat Apr 03 22:21:58 2010 +0200
@@ -1,26 +1,79 @@
+2010-04-03  Eli Zaretskii  <eliz@gnu.org>
+
+	* bidi.c (bidi_resolve_explicit, bidi_level_of_next_char): Check
+	bidi_it->bytepos against ZV_BYTE instead of bidi_it->ch against
+	BIDI_EOB.  Fixes infloop with vertical cursor motion at ZV.
+
+	* w32fns.c (x_create_tip_frame): Copy `parms' before we modify it
+	in this function.  (Bug#5703)
+
+2010-04-03  Chong Yidong  <cyd@stupidchicken.com>
+
+	* nsterm.h: Fix last change.
+
+2010-04-03  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* m/intel386.h (NO_REMAP): Move definition ...
+	* s/msdos.h (NO_REMAP): ... here.
+
+	* m/vax.h (CRT0_DUMMIES): Remove, unused.
+
+	* ecrt0.c: Remove MSDOS, m68k and __sparc__ conditionals, file not
+	used on those platforms.
+
+2010-04-02  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	Remove extern errno declarations.
+	* xterm.c:
+	* xrdb.c:
+	* w32term.c:
+	* unexec.c:
+	* unexaix.c:
+	* sysdep.c:
+	* process.c:
+	* lread.c:
+	* keyboard.c:
+	* floatfns.c:
+	* filelock.c:
+	* fileio.c:
+	* emacs.c (main):
+	* ecrt0.c:
+	* dispnew.c:
+	* callproc.c:
+	* buffer.c: Remove errno extern declarations.
+	* s/netbsd.h (NEED_ERRNO): Remove.
+
+2010-04-01  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	Remove all uses of LIBX11_SYSTEM.
+	* Makefile.in (LIBX11_SYSTEM): Remove.
+	* s/msdos.h (LIBX11_SYSTEM): Do not define, define LIBS_SYSTEM
+	instead.
+
 2010-04-01  Eli Zaretskii  <eliz@gnu.org>
 
 	Remove support for DJGPP v1.x (bug#5813).
 
 	* w16select.c (__dpmi_int): Remove DJGPP v1.x compatibility.
-	* s/msdos.h: 
-	* unexec.c (make_hdr, copy_text_and_data): 
-	* sysdep.c (wait_for_termination, sys_subshell): 
+	* s/msdos.h:
+	* unexec.c (make_hdr, copy_text_and_data):
+	* sysdep.c (wait_for_termination, sys_subshell):
 	* msdos.c (dos_set_window_size, msdos_set_cursor_shape)
-	(IT_set_terminal_modes): 
-	(__write, _rename, gethostname, gettimeofday, alarm, fork, kill)
-	(dos_ttraw, dos_ttcooked, run_msdos_command, abort): Remove DJGPP
-	v1.x code and tests of the value of __DJGPP__.
+	(IT_set_terminal_modes, __write, _rename, gethostname)
+	(gettimeofday, alarm, fork, kill, dos_ttraw, dos_ttcooked)
+	(run_msdos_command, abort): Remove DJGPP v1.x code and tests of
+	the value of __DJGPP__.
 	(nice, pause, sigsetmask, sigblock): Remove DJGPP v1.x
 	compatibility code.
-
-	* lread.c: 
-	* gmalloc.c (memalign): 
-	* fileio.c (Fcopy_file, check_executable, Ffile_modes): 
-	* emacs.c (main): 
-	* dosfns.c (init_dosfns): 
+	* lread.c:
+	* gmalloc.c (memalign):
+	* fileio.c (Fcopy_file, check_executable, Ffile_modes):
+	* emacs.c (main):
+	* dosfns.c (init_dosfns):
 	* dired.c (file_name_completion_stat): Remove tests of __DJGPP__.
 
+2010-04-01  Eli Zaretskii  <eliz@gnu.org>
+
 	* xdisp.c (set_cursor_from_row): Fix cursor positioning when the
 	string with `cursor' property comes from an `after-string'
 	overlay.  (Bug#5816)
@@ -88,7 +141,7 @@
 
 	* xdisp.c (x_consider_frame_title, update_window_cursor):
 	Remove HAVE_NS conditionals.
-	(prepare_menu_bars)[HAVE_NS]: Call ns_set_doc_edited.
+	(prepare_menu_bars) [HAVE_NS]: Call ns_set_doc_edited.
 
 	* nsfns.m (x_implicitly_set_name): If frame-title-format is t, use
 	filename for the title.
@@ -445,7 +498,7 @@
 2010-03-12  Eli Zaretskii  <eliz@gnu.org>
 
 	These changes remove termcap.c from the build on Posix platforms.
-	* Makefilie.in (termcapobj): Move termcap.o from here...
+	* Makefile.in (termcapobj): Move termcap.o from here...
 	(MSDOS_OBJ): ...to here.
 	(termcapobj) [!LIBS_TERMCAP]: Remove specialized value, as it is
 	now identical to when LIBS_TERMCAP is defined.
@@ -730,7 +783,7 @@
 2010-01-19  Alan Mackenzie  <acm@muc.de>
 
 	Fix spurious before-change-functions invocation from (insert ?\n).
-	* textprop.c (set_text_properties): rename parameter
+	* textprop.c (set_text_properties): Rename parameter
 	`signal_after_change_p' to `coherent_change_p', and make the
 	invocation of `modify_region' conditional on it.
 
@@ -10752,7 +10805,7 @@
 
 	* font.c (Vfont_encoding_alist, find_font_encoding): Move from
 	fontset.c.
-	(font_pixel_size)[! HAVE_WINDOW_SYSTEM]: Return 1.
+	(font_pixel_size) [! HAVE_WINDOW_SYSTEM]: Return 1.
 	(font_open_entity): Update FRAME_X_DISPLAY_INFO (f)->n_fonts,
 	FRAME_SMALLEST_CHAR_WIDTH (f), and FRAME_SMALLEST_FONT_HEIGHT (f)
 	only when HAVE_WINDOW_SYSTEM is defined.
@@ -20586,7 +20639,7 @@
 
 2007-08-29  ARISAWA Akihiro  <ari@mbf.ocn.ne.jp>  (tiny change)
 
-	* term.c (dissociate_if_controlling_tty)[USG]: Fix parse error.
+	* term.c (dissociate_if_controlling_tty) [USG]: Fix parse error.
 
 2007-08-29  Yoshiaki Kasahara  <kasahara@nc.kyushu-u.ac.jp>  (tiny change)
 
--- a/src/ChangeLog.10	Fri Apr 02 23:09:13 2010 +0200
+++ b/src/ChangeLog.10	Sat Apr 03 22:21:58 2010 +0200
@@ -2137,7 +2137,7 @@
 
 	* Makefile.in (keymap.o): Add "keymap.h" and "window.h" dependencies.
 
-	* keymap.c: include "window.h".
+	* keymap.c: Include "window.h".
 	(Fcommand_remapping): New optional POSITION argument.
 	(Fkey_binding): New optional POSITION argument.  Completely rework
 	handling of mouse clicks to get the same order of keymaps as
@@ -5867,9 +5867,9 @@
 
 2005-12-26  Luc Teirlinck  <teirllm@auburn.edu>
 
-	* keyboard.h: extern last_point_position_window.
-
-	* undo.c: include keyboard.h.
+	* keyboard.h: Extern last_point_position_window.
+
+	* undo.c: Include keyboard.h.
 
 	* Makefile.in (undo.o): Depend on keyboard.h.
 
@@ -8276,7 +8276,7 @@
 	* xdisp.c (syms_of_xdisp) <nobreak-char-display>: Doc fix.
 	(syms_of_xdisp) <void-text-area-pointer>: Doc fix.
 
-	* fileio.c (Frename_file)[!DOS_NT]: Don't call chown on MSDOS/Windows.
+	* fileio.c (Frename_file) [!DOS_NT]: Don't call chown on MSDOS/Windows.
 
 2005-06-23  Richard M. Stallman  <rms@gnu.org>
 
@@ -12611,7 +12611,7 @@
 	* macterm.c (mac_check_for_quit_char): Remove warning for using
 	NULL where 0 should be used.
 	* unexmacosx.c: Use malloc/malloc.h on Tiger instead of
-	objc/malloc.h
+	objc/malloc.h.
 	* mac.c: Include time.h for Tiger compatibility.
 
 2004-10-07  Kim F. Storm  <storm@cua.dk>
@@ -12843,7 +12843,7 @@
 	* Makefile.in (msdos.o): Depend on buffer.h, commands.h, and
 	blockinput.h.
 	(dosfns.o): Depend on blockinput.h, window.h, dispextern.h,
-	charset.h, and coding.h
+	charset.h, and coding.h.
 	(w16select.o): Depend on buffer.h, charset.h, coding.h, and composite.h.
 	(term.o): Depend on window.h and keymap.h.
 	(abbrev.o): Depend on syntax.h.
@@ -17222,7 +17222,7 @@
 2003-09-01  Jason Rumney  <jasonr@gnu.org>
 
 	* makefile.w32-in (alloca.o): Remove.
-	(coding.o): Depend on intervals.h
+	(coding.o): Depend on intervals.h.
 	(emacs.o, bytecode.o): Depend on window.h.
 
 2003-09-01  Dave Love  <fx@gnu.org>
@@ -22643,7 +22643,7 @@
 	(Fx_popup_menu): Don't show pop up menu until preceding one is
 	actually cleaned up.  Moved UNGCPRO outside #ifdef HAVE_MENUS block.
 
-	* w32menu.c: Changes adapted from xmenu.c
+	* w32menu.c: Changes adapted from xmenu.c.
 	(set_frame_menubar): First parse all submenus,
 	then make widget_value trees from them.
 	Don't allocate any widget_value objects
@@ -24232,7 +24232,7 @@
 	m/ibmps2-aix.h, m/ibmrs6000.h, m/ibmrt-aix.h, m/ibmrt.h,
 	m/ibms390.h, m/intel386.h, m/iris4d.h, m/irist.h, m/isi-ov.h,
 	m/m68k.h, m/macppc.h, m/masscomp.h, m/mg1.h, m/mips-siemens.h,
-	m/mips.h, m/news-r6.h, m/news.h, m/next.h, m/nh3000.h, m/nh4000.h
+	m/mips.h, m/news-r6.h, m/news.h, m/next.h, m/nh3000.h, m/nh4000.h,
 	m/ns32000.h, m/orion.h, m/pfa50.h, m/plexus.h, m/pmax.h,
 	m/powerpcle.h, m/pyrmips.h, m/sequent-ptx.h, m/sequent.h,
 	m/sparc.h, m/sr2k.h, m/symmetry.h, m/tad68k.h, m/tahoe.h,
--- a/src/ChangeLog.8	Fri Apr 02 23:09:13 2010 +0200
+++ b/src/ChangeLog.8	Sat Apr 03 22:21:58 2010 +0200
@@ -2886,10 +2886,10 @@
 
 	* sysdep.c: Define numerous routines to emulate Unix system calls.
 
-	* xfaces.c: on MacOS, define the set of colors listed in rgb.txt
+	* xfaces.c: On MacOS, define the set of colors listed in rgb.txt
 	file of an X Window environment.
 
-	* xfaces.c: on MacOS, define the Lisp functions x-display-color-p,
+	* xfaces.c: On MacOS, define the Lisp functions x-display-color-p,
 	x-display-grayscale, x-color-defined-p, and x-color-values.
 
 	* sysdep.c [macintosh] (stat, fstat, mkdir, rmdir, utime, access)
@@ -3160,7 +3160,7 @@
 
 1999-08-25  Alexandre Oliva  <oliva@dcc.unicamp.br>
 
-	* unexelf.c: Merge IRIX debugging info patch from unexsgi.c
+	* unexelf.c: Merge IRIX debugging info patch from unexsgi.c.
 	* m/iris4d.h: Use unexelf for IRIX 5.*.
 	* m/iris5d.h: Use unexelf for IRIX 6.*.
 	* unexsgi.c: Deleted.
@@ -3767,8 +3767,8 @@
 1999-08-06  Gerd Moellmann  <gerd@gnu.org>
 
 	* xdisp.c (compute_line_metrics): If first line's physical ascent
-	 is larger than its logical ascent, use the physical ascent, and
-	 make the row taller.  Set row's overlapping_p flag.
+	is larger than its logical ascent, use the physical ascent, and
+	make the row taller.  Set row's overlapping_p flag.
 
 	* dispnew.c (redraw_overlapping_rows): Use flag overlapping_p.
 	(direct_output_for_insert): Ditto.
@@ -4675,7 +4675,7 @@
 
 1999-06-04  Gerd Moellmann  <gerd@gnu.org>
 
-	* xfaces.c (recompute_basic_faces)[GLYPH_DEBUG]: Check return
+	* xfaces.c (recompute_basic_faces) [GLYPH_DEBUG]: Check return
 	value of realize_basic_faces.
 	(load_face_font_or_fontset): Store full font name in face.
 	(realize_default_face): Use full font name.
@@ -5601,9 +5601,9 @@
 	* window.c (coordinates_in_window): Use CURRENT_MODE_LINE_HEIGHT.
 
 	* xdisp.c (redisplay_window): If mode line height has changed,
-	 arrange for a thorough immediate redisplay using the correct mode
-	 line height.
-	 (window_box_height): Use CURRENT_MODE_LINE_HEIGHT.
+	arrange for a thorough immediate redisplay using the correct mode
+	line height.
+	(window_box_height): Use CURRENT_MODE_LINE_HEIGHT.
 
 	* dispextern.h (MATRIX_MODE_LINE_HEIGHT): New.
 	(CURRENT_MODE_LINE_HEIGHT): New.
@@ -7062,7 +7062,7 @@
 1998-05-04  Gerd Moellmann  <gerd@gnu.org>
 
 	* Makefile.in (LIBXPM): If not already defined, define to -lXpm.
-	(LIBX)[HAVE_X11]: Add LIBXPM.
+	(LIBX) [HAVE_X11]: Add LIBXPM.
 
 	* xfns.c (xpm_image_p): Implementation of image type functions
 	for XPM.
@@ -10052,7 +10052,7 @@
 
 	* xterm.h (WINDOW_COL_PIXEL_X etc.) Removed.
 
-	* dispextern.h (WINDOW_TO_FRAME_HPOS/VPOS): Moved to dispnew.c
+	* dispextern.h (WINDOW_TO_FRAME_HPOS/VPOS): Moved to dispnew.c.
 
 	* xfns.c (x_contour_region): Use pixel coordinates from window
 	cursor instead of WINDOW_TO_FRAME_H/VPOS.
@@ -10897,7 +10897,7 @@
 	(MATRIX_ROW_INVERSE_P): Former MATRIX_ROW_HIGHLIGHT_P.
 	(struct glyph_row): HIGHLIGHT_P -> INVERSE_P
 
-	* all files: use above new names.
+	* all files: Use above new names.
 
 	* dispnew.c (scroll_frame_lines): Simplified.  Use
 	SCROLL_GLYPH_MATRIX.
@@ -10961,7 +10961,7 @@
 	(init_display): Ditto.
 	(syms_of_display): Ditto.
 
-	* dispextern.h: add prototypes for REDRAW_FRAME,
+	* dispextern.h: Add prototypes for REDRAW_FRAME,
 	REDRAW_GARBAGED_FRAMES, CANCEL_LINE, CLEAR_FRAME_RECORDS,
 	INIT_DESIRED_GLYPHS, SCROLL_FRAME_LINES, PRESERVE_OTHER_COLUMNS,
 	ADJUST_WINDOW_CHARSTARTS, CANCEL_MY_COLUMNS,
@@ -11108,9 +11108,9 @@
 	(make_window): Initialize DESIRED_MATRIX and CURRENT_MATRIX.
 	(replace_window): Reset DESIRED_MATRIX and CURRENT_MATRIX
 
-	* Makefile.in (window.o): Add dependency window.c -> dispextern.h
-
-	* window.c: Include dispextern.h
+	* Makefile.in (window.o): Add dependency window.c -> dispextern.h.
+
+	* window.c: Include dispextern.h.
 
 	* scroll.c (do_scrolling): Use new glyphs.
 	(do_direct_scrolling): Ditto.
@@ -11141,9 +11141,9 @@
 	(write_glyphs): Ditto.
 	(insert_glyphs): Ditto.
 
-	* Makefile.in (term.o): term.c depends on dispextern.h
-
-	* term.c: Include dispextern.h
+	* Makefile.in (term.o): term.c depends on dispextern.h.
+
+	* term.c: Include dispextern.h.
 
 	* dispnew.c (direct_output_forward_char): Old glyph functions
 	removed, new inserted.
@@ -11560,8 +11560,8 @@
 1999-05-02  Andrew Innes  <andrewi@gnu.org>
 
 	* s/ms-w32.h (HAVE_FSYNC): New macro.
-	 (fsync): Map to _commit.
-	 (ftruncate): Map to _chsize.
+	(fsync): Map to _commit.
+	(ftruncate): Map to _chsize.
 
 	* w32term.c (dumpglyphs): On Windows NT, do output in Unicode even
 	for ASCII, if enabled, to avoid memory allocation overhead for
@@ -11666,7 +11666,7 @@
 
 	* fontset.c (Fquery_fontset): Don't check for fontset aliases here.
 	(Fnew_fontset, Fset_fontset_font): Check for them here.
-	 (Ffontset_info, Fnew_fontset, Fset_fontset_font):
+	(Ffontset_info, Fnew_fontset, Fset_fontset_font):
 	Fix error message syntax.
 
 	* buffer.c (Fmake_indirect_buffer): Copy multibyte status
@@ -12775,7 +12775,7 @@
 1998-12-06  Eli Zaretskii  <eliz@mescaline.gnu.org>
 
 	* Makefile.in (msdos.o): Depend on termchar.h, charset.h,
-	coding.h, and disptab.h
+	coding.h, and disptab.h.
 
 	* msdos.c (Vdos_unsupported_char_glyph): New variable.
 	(syms_of_msdos): DEFVAR_LISP it.
--- a/src/Makefile.in	Fri Apr 02 23:09:13 2010 +0200
+++ b/src/Makefile.in	Sat Apr 03 22:21:58 2010 +0200
@@ -287,10 +287,6 @@
 #endif
 	$(CC) -c $(CPPFLAGS) $(ALL_OBJC_CFLAGS) $<
 
-#ifndef LIBX11_SYSTEM
-#define LIBX11_SYSTEM
-#endif
-
 #ifndef LIB_X11_LIB
 #define LIB_X11_LIB -lX11
 #endif
@@ -379,7 +375,7 @@
 /* LD_SWITCH_X_DEFAULT comes after everything else that specifies
    options for where to find X libraries, but before those libraries.  */
 X11_LDFLAGS = LD_SWITCH_X_SITE LD_SWITCH_X_DEFAULT
-LIBX= $(LIBXMENU) $(X11_LDFLAGS) $(LIBXT) $(LIBTIFF) $(LIBJPEG) $(LIBPNG) $(LIBGIF) $(LIBXPM) LIB_X11_LIB LIBX11_SYSTEM $(XFT_LIBS)
+LIBX= $(LIBXMENU) $(X11_LDFLAGS) $(LIBXT) $(LIBTIFF) $(LIBJPEG) $(LIBPNG) $(LIBGIF) $(LIBXPM) LIB_X11_LIB $(XFT_LIBS)
 #else /* not HAVE_X11 */
 LIBX= $(LIBXMENU) LD_SWITCH_X_SITE
 #endif /* not HAVE_X11 */
--- a/src/bidi.c	Fri Apr 02 23:09:13 2010 +0200
+++ b/src/bidi.c	Sat Apr 03 22:21:58 2010 +0200
@@ -1242,7 +1242,7 @@
   if (prev_level < new_level
       && bidi_it->type == WEAK_BN
       && bidi_it->ignore_bn_limit == 0 /* only if not already known */
-      && bidi_it->ch != BIDI_EOB       /* not already at EOB */
+      && bidi_it->bytepos < ZV_BYTE    /* not already at EOB */
       && bidi_explicit_dir_char (FETCH_CHAR (bidi_it->bytepos
 					     + bidi_it->ch_len)))
     {
@@ -1648,7 +1648,7 @@
   if (bidi_it->scan_dir == 1)
     {
       /* There's no sense in trying to advance if we hit end of text.  */
-      if (bidi_it->ch == BIDI_EOB)
+      if (bidi_it->bytepos >= ZV_BYTE)
 	return bidi_it->resolved_level;
 
       /* Record the info about the previous character.  */
--- a/src/buffer.c	Fri Apr 02 23:09:13 2010 +0200
+++ b/src/buffer.c	Sat Apr 03 22:21:58 2010 +0200
@@ -28,11 +28,6 @@
 #include <stdio.h>
 #include <setjmp.h>
 
-#ifndef USE_CRT_DLL
-extern int errno;
-#endif
-
-
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
@@ -4627,7 +4622,6 @@
 #endif
 
 #include <stdio.h>
-#include <errno.h>
 
 #if MAP_ANON == 0
 #include <fcntl.h>
--- a/src/callproc.c	Fri Apr 02 23:09:13 2010 +0200
+++ b/src/callproc.c	Sat Apr 03 22:21:58 2010 +0200
@@ -25,10 +25,6 @@
 #include <stdio.h>
 #include <setjmp.h>
 
-#ifndef USE_CRT_DLL
-extern int errno;
-#endif
-
 /* Define SIGCHLD as an alias for SIGCLD.  */
 
 #if !defined (SIGCHLD) && defined (SIGCLD)
@@ -61,7 +57,6 @@
 #include <fcntl.h>
 #include <sys/stat.h>
 #include <sys/param.h>
-#include <errno.h>
 #endif /* MSDOS */
 
 #ifndef O_RDONLY
--- a/src/dispnew.c	Fri Apr 02 23:09:13 2010 +0200
+++ b/src/dispnew.c	Sat Apr 03 22:21:58 2010 +0200
@@ -5809,9 +5809,6 @@
      int signalnum;		/* some compilers complain in signal calls.  */
 {
   int width, height;
-#ifndef USE_CRT_DLL
-  extern int errno;
-#endif
   int old_errno = errno;
 
   struct tty_display_info *tty;
--- a/src/ecrt0.c	Fri Apr 02 23:09:13 2010 +0200
+++ b/src/ecrt0.c	Sat Apr 03 22:21:58 2010 +0200
@@ -59,13 +59,7 @@
 
 int data_start = 0;
 
-#ifdef NEED_ERRNO
-int errno;
-#endif
-
-#ifndef MSDOS
 char **environ;
-#endif
 
 #ifndef static
 /* On systems where the static storage class is usable, this function
@@ -104,70 +98,7 @@
      and optimize it out.  */
   (void) &start1;
 }
-#else /* not CRT0_DUMMIES */
-
-/* This is a kludge.  Now that the CRT0_DUMMIES mechanism above exists,
-   most of these machines could use the vax code above
-   with some suitable definition of CRT0_DUMMIES.
-   Then the symbol m68k could be flushed.
-   But I don't want to risk breaking these machines
-   in a version 17 patch release, so that change is being put off.  */
-
-#ifdef m68k			/* Can't do it all from C */
-	asm ("	global	_start");
-	asm ("	text");
-	asm ("_start:");
-	asm ("  comm	splimit%,4");
-	asm ("	global	exit");
-	asm ("	text");
-  	asm ("	mov.l	%d0,splimit%");
-	asm ("	jsr	start1");
-	asm ("	mov.l	%d0,(%sp)");
-	asm ("	jsr	exit");
-	asm ("	mov.l	&1,%d0");	/* d0 = 1 => exit */
-	asm ("	trap	&0");
-
-/* ignore takes care of skipping the a6 value pushed in start.  */
-static
-start1 (argc, xargv)
-     int argc;
-     char *xargv;
-{
-  register char **argv = &xargv;
-  environ = argv + argc + 1;
-
-  if ((char *)environ == xargv)
-    environ--;
-  exit (main (argc, argv, environ));
-}
-
-#endif /* m68k */
-
-#endif /* not CRT0_DUMMIES */
-
-#ifdef __sparc__
-asm (".global __start");
-asm (".text");
-asm ("__start:");
-asm ("	mov	0, %fp");
-asm ("	ld	[%sp + 64], %o0");
-asm ("	add	%sp, 68, %o1");
-asm ("	sll	%o0, 2,	%o2");
-asm ("	add	%o2, 4,	%o2");
-asm ("	add	%o1, %o2, %o2");
-asm ("	sethi	%hi(_environ), %o3");
-asm ("	st	%o2, [%o3+%lo(_environ)]");
-asm ("	andn	%sp, 7,	%sp");
-asm ("	call	_main");
-asm ("	sub	%sp, 24, %sp");
-asm ("	call	__exit");
-asm ("	nop");
-
-#endif /* __sparc__ */
-
-#if __FreeBSD__ == 2
-char *__progname;
-#endif
+#endif /* CRT0_DUMMIES */
 
 /* arch-tag: 4025c2fb-d6b1-4d29-b1b6-8100b6bd1e74
    (do not change this comment) */
--- a/src/emacs.c	Fri Apr 02 23:09:13 2010 +0200
+++ b/src/emacs.c	Sat Apr 03 22:21:58 2010 +0200
@@ -756,9 +756,6 @@
   char stack_bottom_variable;
   int do_initial_setlocale;
   int skip_args = 0;
-#ifndef USE_CRT_DLL
-  extern int errno;
-#endif
 #ifdef HAVE_SETRLIMIT
   struct rlimit rlim;
 #endif
--- a/src/fileio.c	Fri Apr 02 23:09:13 2010 +0200
+++ b/src/fileio.c	Sat Apr 03 22:21:58 2010 +0200
@@ -53,12 +53,6 @@
 #include <ctype.h>
 #include <errno.h>
 
-#ifndef vax11c
-#ifndef USE_CRT_DLL
-extern int errno;
-#endif
-#endif
-
 #include "lisp.h"
 #include "intervals.h"
 #include "buffer.h"
--- a/src/filelock.c	Fri Apr 02 23:09:13 2010 +0200
+++ b/src/filelock.c	Sat Apr 03 22:21:58 2010 +0200
@@ -47,9 +47,6 @@
 #endif /* __FreeBSD__ */
 
 #include <errno.h>
-#ifndef errno
-extern int errno;
-#endif
 
 #include "lisp.h"
 #include "buffer.h"
--- a/src/floatfns.c	Fri Apr 02 23:09:13 2010 +0200
+++ b/src/floatfns.c	Sat Apr 03 22:21:58 2010 +0200
@@ -99,10 +99,6 @@
 
 #ifdef FLOAT_CHECK_ERRNO
 # include <errno.h>
-
-#ifndef USE_CRT_DLL
-extern int errno;
-#endif
 #endif
 
 #ifdef FLOAT_CATCH_SIGILL
--- a/src/keyboard.c	Fri Apr 02 23:09:13 2010 +0200
+++ b/src/keyboard.c	Sat Apr 03 22:21:58 2010 +0200
@@ -79,10 +79,6 @@
 #include "nsterm.h"
 #endif
 
-#ifndef USE_CRT_DLL
-extern int errno;
-#endif
-
 /* Variables for blockinput.h: */
 
 /* Non-zero if interrupt input is blocked right now.  */
--- a/src/lread.c	Fri Apr 02 23:09:13 2010 +0200
+++ b/src/lread.c	Sat Apr 03 22:21:58 2010 +0200
@@ -73,10 +73,6 @@
 #define file_tell ftell
 #endif
 
-#ifndef USE_CRT_DLL
-extern int errno;
-#endif
-
 /* hash table read constants */
 Lisp_Object Qhash_table, Qdata;
 Lisp_Object Qtest, Qsize;
--- a/src/m/intel386.h	Fri Apr 02 23:09:13 2010 +0200
+++ b/src/m/intel386.h	Sat Apr 03 22:21:58 2010 +0200
@@ -85,10 +85,6 @@
 #define TEXT_START 0
 #endif /* USG */
 
-#ifdef MSDOS
-#define NO_REMAP
-#endif
-
 #ifdef WINDOWSNT
 #define VIRT_ADDR_VARIES
 #define DATA_START 	get_data_start ()
--- a/src/m/vax.h	Fri Apr 02 23:09:13 2010 +0200
+++ b/src/m/vax.h	Sat Apr 03 22:21:58 2010 +0200
@@ -34,10 +34,6 @@
 
 /* #define vax    -- appears to be done automatically  */
 
-/* crt0.c should use the vax-bsd style of entry, with no dummy args.  */
-
-#define CRT0_DUMMIES
-
 /* USG systems I know of running on Vaxes do not actually
    support the load average, so disable it for them.  */
 
--- a/src/process.c	Fri Apr 02 23:09:13 2010 +0200
+++ b/src/process.c	Sat Apr 03 22:21:58 2010 +0200
@@ -195,10 +195,6 @@
 extern void serial_configure (struct Lisp_Process *p, Lisp_Object contact);
 #endif
 
-#ifndef USE_CRT_DLL
-extern int errno;
-#endif
-
 #ifndef HAVE_H_ERRNO
 extern int h_errno;
 #endif
--- a/src/s/msdos.h	Fri Apr 02 23:09:13 2010 +0200
+++ b/src/s/msdos.h	Sat Apr 03 22:21:58 2010 +0200
@@ -149,7 +149,7 @@
    commentary below, in the non-X branch.  The 140KB number was
    measured on GNU/Linux and on MS-WIndows.  */
 #define SYSTEM_PURESIZE_EXTRA (-170000+140000)
-#define LIBX11_SYSTEM -lxext -lsys
+#define LIBS_SYSTEM -lxext -lsys
 #else
 /* We need a little extra space, see ../../lisp/loadup.el.
    As of 20091024, DOS-specific files use up 62KB of pure space.  But
@@ -170,5 +170,7 @@
 #define GC_SETJMP_WORKS 1
 #define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS
 
+#define NO_REMAP
+
 /* arch-tag: d184f860-815d-4ff4-8187-d05c0f3c37d0
    (do not change this comment) */
--- a/src/s/netbsd.h	Fri Apr 02 23:09:13 2010 +0200
+++ b/src/s/netbsd.h	Sat Apr 03 22:21:58 2010 +0200
@@ -28,8 +28,6 @@
 
 #define LIBS_TERMCAP -ltermcap
 
-#define NEED_ERRNO
-
 #define START_FILES pre-crt0.o /usr/lib/crt0.o START_FILES_1 /usr/lib/crtbegin.o
 #define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtend.o END_FILES_1
 #undef LIB_GCC
--- a/src/sysdep.c	Fri Apr 02 23:09:13 2010 +0200
+++ b/src/sysdep.c	Sat Apr 03 22:21:58 2010 +0200
@@ -94,12 +94,6 @@
 extern unsigned start __asm__ ("start");
 #endif
 
-#ifndef USE_CRT_DLL
-#ifndef errno
-extern int errno;
-#endif
-#endif
-
 #include <sys/file.h>
 
 #ifdef HAVE_FCNTL_H
--- a/src/unexaix.c	Fri Apr 02 23:09:13 2010 +0200
+++ b/src/unexaix.c	Sat Apr 03 22:21:58 2010 +0200
@@ -435,7 +435,6 @@
 {
   int i, nwrite, ret;
   char buf[80];
-  extern int errno;
   char zeros[UnexBlockSz];
 
   for (i = 0; ptr < end;)
--- a/src/unexec.c	Fri Apr 02 23:09:13 2010 +0200
+++ b/src/unexec.c	Sat Apr 03 22:21:58 2010 +0200
@@ -466,9 +466,6 @@
 {
   register int i, nwrite, ret;
   char buf[80];
-#ifndef USE_CRT_DLL
-  extern int errno;
-#endif
   /* This is the normal amount to write at once.
      It is the size of block that NFS uses.  */
   int writesize = 1 << 13;
--- a/src/w32fns.c	Fri Apr 02 23:09:13 2010 +0200
+++ b/src/w32fns.c	Sat Apr 03 22:21:58 2010 +0200
@@ -5427,6 +5427,10 @@
 
   kb = dpyinfo->terminal->kboard;
 
+  /* The calls to x_get_arg remove elements from PARMS, so copy it to
+     avoid destructive changes behind our caller's back.  */
+  parms = Fcopy_alist (parms);
+
   /* Get the name of the frame to use for resource lookup.  */
   name = x_get_arg (dpyinfo, parms, Qname, "name", "Name", RES_TYPE_STRING);
   if (!STRINGP (name)
--- a/src/w32term.c	Fri Apr 02 23:09:13 2010 +0200
+++ b/src/w32term.c	Sat Apr 03 22:21:58 2010 +0200
@@ -228,10 +228,6 @@
 
 extern Lisp_Object Vcommand_line_args, Vsystem_name;
 
-#ifndef USE_CRT_DLL
-extern int errno;
-#endif
-
 /* A mask of extra modifier bits to put into every keyboard char.  */
 extern EMACS_INT extra_keyboard_modifiers;
 
--- a/src/xdisp.c	Fri Apr 02 23:09:13 2010 +0200
+++ b/src/xdisp.c	Sat Apr 03 22:21:58 2010 +0200
@@ -12606,7 +12606,8 @@
 	    }
 	  if (INTEGERP (glyph->object) && glyph->charpos < 0)
 	    --glyph;
-	  /* By default, put the cursor on the rightmost glyph.  */
+	  /* By default, in reversed rows we put the cursor on the
+	     rightmost (first in the reading order) glyph.  */
 	  for (g = end + 1; g < glyph; g++)
 	    x += g->pixel_width;
 	  cursor_x = x;
@@ -12683,7 +12684,16 @@
 		bpos_covered = bpos_max + XINT (chprop);
 		/* If the `cursor' property covers buffer positions up
 		   to and including point, we should display cursor on
-		   this glyph.  */
+		   this glyph.  Note that overlays and text properties
+		   with string values stop bidi reordering, so every
+		   buffer position to the left of the string is always
+		   smaller than any position to the right of the
+		   string.  Therefore, if a `cursor' property on one
+		   of the string's characters has an integer value, we
+		   will break out of the loop below _before_ we get to
+		   the position match above.  IOW, integer values of
+		   the `cursor' property override the "exact match for
+		   point" strategy of positioning the cursor.  */
 		/* Implementation note: bpos_max == pt_old when, e.g.,
 		   we are in an empty line, where bpos_max is set to
 		   MATRIX_ROW_START_CHARPOS, see above.  */
--- a/src/xrdb.c	Fri Apr 02 23:09:13 2010 +0200
+++ b/src/xrdb.c	Sat Apr 03 22:21:58 2010 +0200
@@ -28,6 +28,7 @@
 #include <unistd.h>
 #endif
 
+#include <errno.h>
 #include <epaths.h>
 
 #include <stdio.h>
@@ -734,8 +735,6 @@
     char *msg, *prog;
     int x1, x2, x3, x4, x5;
 {
-    extern int errno;
-
     if (errno)
       perror (prog);
 
--- a/src/xterm.c	Fri Apr 02 23:09:13 2010 +0200
+++ b/src/xterm.c	Sat Apr 03 22:21:58 2010 +0200
@@ -309,8 +309,6 @@
 
 extern Lisp_Object Qeql;
 
-extern int errno;
-
 /* A mask of extra modifier bits to put into every keyboard char.  */
 
 extern EMACS_INT extra_keyboard_modifiers;