changeset 109194:e0b7f217b35a

Merge from mainline.
author Katsumi Yamaoka <katsumi@flagship2>
date Sun, 16 May 2010 00:18:09 +0000
parents a0ac80ce32db (current diff) f710179e77ab (diff)
children 1bbf35fc0d68
files
diffstat 56 files changed, 852 insertions(+), 426 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri May 14 11:34:53 2010 +0000
+++ b/ChangeLog	Sun May 16 00:18:09 2010 +0000
@@ -1,3 +1,26 @@
+2010-05-15  Glenn Morris  <rgm@gnu.org>
+
+	* configure.in (LIBXMENU): Set to empty if !HAVE_X_WINDOWS.
+
+	* configure.in (FONT_OBJ): Set to empty if !HAVE_X_WINDOWS.
+
+2010-05-15  Ken Raeburn  <raeburn@raeburn.org>
+
+	* configure.in: Look for version string in its new location.
+
+2010-05-15  Eli Zaretskii  <eliz@gnu.org>
+
+	* config.bat: Remove support for DJGPP v1.x.
+
+2010-05-15  Glenn Morris  <rgm@gnu.org>
+
+	* configure.in (OLDXMENU_TARGET): New output variable.
+
+	* Makefile.in (install-arch-dep): Update odd NS rule for Emacs version.
+
+	* Makefile.in (install-arch-indep): Remove references to RCS, CVS,
+	and other files that no longer exist.
+
 2010-05-14  Glenn Morris  <rgm@gnu.org>
 
 	* configure.in (cpp_undefs): Add mktime, register, X11.
--- a/Makefile.in	Fri May 14 11:34:53 2010 +0000
+++ b/Makefile.in	Sun May 16 00:18:09 2010 +0000
@@ -425,10 +425,15 @@
 	    rm -fr share ) ; \
 	  ( cd ${ns_appbindir}/libexec ; dir=emacs/*/*/* ; $(MV_DIRS); \
 	    rm -fr emacs ) ; \
-	  ( cd ${ns_appbindir}/bin ; rm -f emacs emacs-23* ; \
+	  ( cd ${ns_appbindir}/bin ; rm -f emacs emacs-24* ; \
 	    ln -sf ../libexec/* .) ; \
 	else true ; fi
 
+## FIXME is the emacs-24* bit above really necessary and correct?
+## What if I have 24.1 and 24.2 installed at the same time?
+## In any case, it should use something like echo $version | sed 's/\..*//'
+## instead of hard-coding a version.
+
 ## http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg01672.html
 ## Needs to be the user running install, so configure can't set it.
 set_installuser=for installuser in $${LOGNAME} $${USERNAME} $${USER} \
@@ -476,11 +481,8 @@
 		| (cd $${dest}; umask 022; \
                    tar -xvf - && cat > /dev/null) || exit 1; \
 	      find $${dest} -exec chown $${installuser} {} ';' ;\
-	      for subdir in `find $${dest} -type d ! -name RCS ! -name CVS -print` ; do \
+	      for subdir in `find $${dest} -type d -print` ; do \
 		chmod a+rx $${subdir} ; \
-		rm -rf $${subdir}/RCS ; \
-		rm -rf $${subdir}/CVS ; \
-		rm -f  $${subdir}/.cvsignore ; \
 		rm -f  $${subdir}/.gitignore ; \
 		rm -f  $${subdir}/.arch-inventory ; \
 		rm -f  $${subdir}/.DS_Store ; \
@@ -492,7 +494,6 @@
 		 rm -f $${subdir}/[mM]akefile*.c $${subdir}/[mM]akefile*[.-]in \
 		   $${subdir}/[mM]akefile ; \
 		rm -f  $${subdir}/ChangeLog* ; \
-		rm -f  $${subdir}/dired.todo ; \
 	      done) ; \
 	done
 	-rm -f $(DESTDIR)${lispdir}/subdirs.el
--- a/admin/CPP-DEFINES	Fri May 14 11:34:53 2010 +0000
+++ b/admin/CPP-DEFINES	Sun May 16 00:18:09 2010 +0000
@@ -22,6 +22,9 @@
 NS_IMPL_COCOA	Compile support for Cocoa (Apple) implementation of NS GUI API.
 HAVE_X11	Compile support for the X11 GUI.
 HAVE_X_WINDOWS	Compile support for X Window system
+  (It looks like, nowadays, if HAVE_X11 is set, HAVE_X_WINDOWS must
+   be, and vice versa.  At least, this is true for configure, and
+   msdos; not sure about nt.)
 USE_LUCID	Use the Lucid toolkit for menus&scrollbars.  Requires HAVE_X11.
 USE_MOTIF	Use the Motif toolkit for menus&scrollbars.  Requires HAVE_X11.
 USE_GTK		Use the Gtk   toolkit for menus&scrollbars.  Requires HAVE_X11.
--- a/admin/ChangeLog	Fri May 14 11:34:53 2010 +0000
+++ b/admin/ChangeLog	Sun May 16 00:18:09 2010 +0000
@@ -1,3 +1,13 @@
+2010-05-15  Ken Raeburn  <raeburn@raeburn.org>
+
+	* admin.el (set-version, set-copyright): Update emacs.c instead of
+	version.el.
+
+	* make-tarball.txt: Update filename list in step 6.
+
+	* quick-install-emacs: Scan emacs.c instead of version.el for
+	version string.
+
 2010-05-07  Chong Yidong  <cyd@stupidchicken.com>
 
 	* Version 23.2 released.
--- a/admin/admin.el	Fri May 14 11:34:53 2010 +0000
+++ b/admin/admin.el	Sun May 16 00:18:09 2010 +0000
@@ -60,8 +60,8 @@
   (interactive "DEmacs root directory: \nsVersion number: ")
   (unless (file-exists-p (expand-file-name "src/emacs.c" root))
     (error "%s doesn't seem to be the root of an Emacs source tree" root))
-  (set-version-in-file root "lisp/version.el" version
-		       (rx (and "emacs-version" (0+ space)
+  (set-version-in-file root "src/emacs.c" version
+		       (rx (and "emacs_version" (0+ (not (in ?\")))
 				?\" (submatch (1+ (not (in ?\")))) ?\")))
   (set-version-in-file root "README" version
 		       (rx (and "version" (1+ space)
@@ -184,8 +184,8 @@
                          (format-time-string "%Y")))))
   (unless (file-exists-p (expand-file-name "src/emacs.c" root))
     (error "%s doesn't seem to be the root of an Emacs source tree" root))
-  (set-version-in-file root "lisp/version.el" copyright
-		       (rx (and "emacs-copyright" (0+ space)
+  (set-version-in-file root "src/emacs.c" copyright
+		       (rx (and "emacs_copyright" (0+ (not (in ?\")))
 				?\" (submatch (1+ (not (in ?\")))) ?\")))
   (set-version-in-file root "lib-src/ebrowse.c" copyright
                        (rx (and "emacs_copyright" (0+ (not (in ?\")))
--- a/admin/make-tarball.txt	Fri May 14 11:34:53 2010 +0000
+++ b/admin/make-tarball.txt	Sun May 16 00:18:09 2010 +0000
@@ -31,7 +31,7 @@
      make bootstrap
 
 6.  Commit configure, README, doc/emacs/emacs.texi,
-    doc/lispref/elisp.texi, etc/AUTHORS, lisp/version.el, nt/emacs.rc,
+    doc/lispref/elisp.texi, etc/AUTHORS, src/emacs.c, nt/emacs.rc,
     and lisp/cus-edit.el (if modified).  Copy lisp/loaddefs.el to
     lisp/ldefs-boot.el and commit lisp/ldefs-boot.el.  For a release,
     also commit the ChangeLog files in all directories.
--- a/admin/quick-install-emacs	Fri May 14 11:34:53 2010 +0000
+++ b/admin/quick-install-emacs	Sun May 16 00:18:09 2010 +0000
@@ -171,7 +171,7 @@
 test x"$prefix" = x && { prefix="`get_config_var prefix`" || exit 4 ; }
 test x"$ARCH" = x && { ARCH="`get_config_var host`" || exit 4 ; }
 
-VERSION=`grep 'defconst[	 ]*emacs-version' $SRC/lisp/version.el \
+VERSION=`grep 'char emacs_version' $SRC/src/emacs.c \
          | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`
 
 DST_SHARE="$prefix/share/emacs/$VERSION"
--- a/config.bat	Fri May 14 11:34:53 2010 +0000
+++ b/config.bat	Sun May 16 00:18:09 2010 +0000
@@ -23,7 +23,7 @@
 rem   YOU'LL NEED THE FOLLOWING UTILITIES TO MAKE EMACS:
 rem
 rem   + msdos version 3 or better.
-rem   + DJGPP version 1.12maint1 or later (version 2.03 or later recommended).
+rem   + DJGPP version 2.0 or later (version 2.03 or later recommended).
 rem   + make utility that allows breaking of the 128 chars limit on
 rem     command lines.  ndmake (as of version 4.5) won't work due to a
 rem     line length limit.  The make that comes with DJGPP does work (and is
@@ -125,11 +125,10 @@
 Echo To compile 'Emacs' under MS-DOS you MUST have DJGPP installed!
 Goto End
 :go32Ok
-set djgpp_ver=1
-If ErrorLevel 20 set djgpp_ver=2
+set djgpp_ver=2
+If Not ErrorLevel 20 Echo To build 'Emacs' you need DJGPP v2.0 or later!
+If Not ErrorLevel 20 Goto End
 rm -f junk.c junk junk.exe
-rem The v1.x build does not need djecho
-if "%DJGPP_VER%" == "1" Goto djechoOk
 rem DJECHO is used by the top-level Makefile in the v2.x build
 Echo Checking whether 'djecho' is available...
 redir -o Nul -eo djecho -o junk.$$$ foo
@@ -159,12 +158,7 @@
 if "%X11%" == "" goto src4
 sed -f ../msdos/sed2x.inp <config.in >config.tmp
 :src4
-if "%DJGPP_VER%" == "2" Goto src41
-sed -f ../msdos/sed2.inp <config.tmp >config.h2
-goto src42
-:src41
 sed -f ../msdos/sed2v2.inp <config.tmp >config.h2
-:src42
 Rem See if DECL_ALIGN can be supported with this GCC
 rm -f junk.c junk.o junk junk.exe
 echo struct { int i; char *p; } __attribute__((__aligned__(8))) foo;  >junk.c
@@ -198,12 +192,7 @@
 rem   Create "makefile" from "makefile.in".
 rm -f Makefile junk.c
 sed -e "1,/== start of cpp stuff ==/s@^##*[ 	].*$@@" <Makefile.in >junk.c
-If "%DJGPP_VER%" == "1" Goto mfV1
 gcc -E -traditional junk.c | sed -f ../msdos/sed1v2.inp >Makefile
-goto mfDone
-:mfV1
-gcc -E -traditional junk.c | sed -f ../msdos/sed1.inp >Makefile
-:mfDone
 rm -f junk.c
 
 if "%X11%" == "" goto src5
@@ -221,12 +210,7 @@
 rem   ----------------------------------------------------------------------
 Echo Configuring the library source directory...
 cd lib-src
-If "%DJGPP_VER%" == "2" goto libsrc-v2
-sed -f ../msdos/sed3.inp <Makefile.in >Makefile
-Goto libsrc2
-:libsrc-v2
 sed -f ../msdos/sed3v2.inp <Makefile.in >Makefile
-:libsrc2
 if "%X11%" == "" goto libsrc2a
 mv Makefile makefile.tmp
 sed -f ../msdos/sed3x.inp <makefile.tmp >Makefile
@@ -272,7 +256,6 @@
 Echo Configuring the main directory...
 If Exist .dir-locals.el update .dir-locals.el _dir-locals.el
 If Exist src\.dbxinit update src/.dbxinit src/_dbxinit
-If "%DJGPP_VER%" == "1" goto mainv1
 Echo Looking for the GDB init file...
 If Exist src\.gdbinit update src/.gdbinit src/_gdbinit
 If Exist src\_gdbinit goto gdbinitOk
@@ -287,8 +270,6 @@
 :gdbinitOk
 Echo Looking for the GDB init file...found
 copy msdos\mainmake.v2 Makefile >nul
-:mainv1
-If "%DJGPP_VER%" == "1" copy msdos\mainmake Makefile >nul
 rem   ----------------------------------------------------------------------
 goto End
 :SmallEnv
--- a/configure	Fri May 14 11:34:53 2010 +0000
+++ b/configure	Sun May 16 00:18:09 2010 +0000
@@ -743,7 +743,6 @@
 LIBOTF_LIBS
 M17N_FLT_CFLAGS
 M17N_FLT_LIBS
-FONT_OBJ
 FREETYPE_CFLAGS
 FREETYPE_LIBS
 LIBXPM
@@ -800,11 +799,13 @@
 GNUSTEP_SYSTEM_LIBRARIES
 GNU_OBJC_CFLAGS
 OTHER_FILES
+FONT_OBJ
 XMENU_OBJ
 XOBJ
 WIDGET_OBJ
 TOOLKIT_LIBW
 LIBXT_OTHER
+OLDXMENU_TARGET
 OLDXMENU
 LIBXMENU
 LIBX_OTHER
@@ -14701,14 +14702,6 @@
     HAVE_M17N_FLT=no
 fi
 
-FONT_OBJ=xfont.o
-if test "$HAVE_XFT" = "yes"; then
-  FONT_OBJ="$FONT_OBJ ftfont.o xftfont.o ftxfont.o"
-elif test "$HAVE_FREETYPE" = "yes"; then
-  FONT_OBJ="$FONT_OBJ ftfont.o ftxfont.o"
-fi
-
-
 ### End of font-backend (under X11) section.
 
 
@@ -26308,16 +26301,16 @@
 fi
 
 #### Find out which version of Emacs this is.
-version=`grep 'defconst[	 ]*emacs-version' ${srcdir}/lisp/version.el \
+version=`grep 'const char emacs_version' ${srcdir}/src/emacs.c \
 	 | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`
 if test x"${version}" = x; then
-  { { $as_echo "$as_me:$LINENO: error: can't find current emacs version in \`${srcdir}/lisp/version.el'." >&5
-$as_echo "$as_me: error: can't find current emacs version in \`${srcdir}/lisp/version.el'." >&2;}
+  { { $as_echo "$as_me:$LINENO: error: can't find current emacs version in \`${srcdir}/src/emacs.c'." >&5
+$as_echo "$as_me: error: can't find current emacs version in \`${srcdir}/src/emacs.c'." >&2;}
    { (exit 1); exit 1; }; }
 fi
 if test x"${version}" != x"$PACKAGE_VERSION"; then
-  { $as_echo "$as_me:$LINENO: WARNING: version mismatch between \`${srcdir}/configure.in' and \`${srcdir}/lisp/version.el'." >&5
-$as_echo "$as_me: WARNING: version mismatch between \`${srcdir}/configure.in' and \`${srcdir}/lisp/version.el'." >&2;}
+  { $as_echo "$as_me:$LINENO: WARNING: version mismatch between \`${srcdir}/configure.in' and \`${srcdir}/src/emacs.c'." >&5
+$as_echo "$as_me: WARNING: version mismatch between \`${srcdir}/configure.in' and \`${srcdir}/src/emacs.c'." >&2;}
 fi
 
 ### Specify what sort of things we'll be editing into Makefile and config.h.
@@ -26390,6 +26383,7 @@
 
 XMENU_OBJ=
 XOBJ=
+FONT_OBJ=
 if test "${HAVE_X_WINDOWS}" = "yes" ; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -26398,7 +26392,15 @@
 
   XMENU_OBJ=xmenu.o
   XOBJ="xterm.o xfns.o xselect.o xrdb.o fontset.o xsmfns.o fringe.o image.o xsettings.o xgselect.o"
-fi
+  FONT_OBJ=xfont.o
+  if test "$HAVE_XFT" = "yes"; then
+    FONT_OBJ="$FONT_OBJ ftfont.o xftfont.o ftxfont.o"
+  elif test "$HAVE_FREETYPE" = "yes"; then
+    FONT_OBJ="$FONT_OBJ ftfont.o ftxfont.o"
+  fi
+
+fi
+
 
 
 
@@ -26456,9 +26458,12 @@
 
 if test "$USE_X_TOOLKIT" = "none"; then
   LIBXT_OTHER="\$(LIBXSM)"
+  OLDXMENU_TARGET="really-oldXMenu"
 else
   LIBXT_OTHER="\$(LIBXMU) -lXt \$(LIBXTR6) -lXext"
-fi
+  OLDXMENU_TARGET="really-lwlib"
+fi
+
 
 
 ## The X Menu stuff is present in the X10 distribution, but missing
@@ -26480,7 +26485,12 @@
   LIBX_OTHER="\$(LIBXT) \$(LIBX_EXTRA)"
 else
   OLDXMENU=
-  LIBXMENU="-lXMenu"
+  ## FIXME This case (!HAVE_X11 && HAVE_X_WINDOWS) is no longer possible(?).
+  if test "${HAVE_X_WINDOWS}" = "yes"; then
+    LIBXMENU="-lXMenu"
+  else
+    LIBXMENU=
+  fi
   LIBX_OTHER=
 fi
 
@@ -26722,6 +26732,9 @@
 # the C preprocessor to some helpful value like 1, or maybe the empty
 # string.  Needless to say consequent macro substitutions are less
 # than conducive to the makefile finding the correct directory.
+# src/Makefile.in used to treat X11 as equivalent to HAVE_X11.
+# But nothing in Emacs defines X11, and everywhere else uses HAVE_X11,
+# so that cannot have been doing anything.
 cpp_undefs="`echo $srcdir $configuration $canonical unix mktime register X11 |
   sed -e 's/[^a-zA-Z0-9_]/ /g' -e 's/^/ /' -e 's/  *$//' \
   -e 's/  */ -U/g' -e 's/-U[0-9][^ ]*//g'`"
--- a/configure.in	Fri May 14 11:34:53 2010 +0000
+++ b/configure.in	Sun May 16 00:18:09 2010 +0000
@@ -2231,14 +2231,6 @@
     HAVE_M17N_FLT=no
 fi
 
-FONT_OBJ=xfont.o
-if test "$HAVE_XFT" = "yes"; then
-  FONT_OBJ="$FONT_OBJ ftfont.o xftfont.o ftxfont.o"
-elif test "$HAVE_FREETYPE" = "yes"; then
-  FONT_OBJ="$FONT_OBJ ftfont.o ftxfont.o"
-fi
-AC_SUBST(FONT_OBJ)
-
 ### End of font-backend (under X11) section.
 
 AC_SUBST(FREETYPE_CFLAGS)
@@ -3008,13 +3000,13 @@
 fi
 
 #### Find out which version of Emacs this is.
-[version=`grep 'defconst[	 ]*emacs-version' ${srcdir}/lisp/version.el \
+[version=`grep 'const char emacs_version' ${srcdir}/src/emacs.c \
 	 | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`]
 if test x"${version}" = x; then
-  AC_MSG_ERROR([can't find current emacs version in `${srcdir}/lisp/version.el'.])
+  AC_MSG_ERROR([can't find current emacs version in `${srcdir}/src/emacs.c'.])
 fi
 if test x"${version}" != x"$PACKAGE_VERSION"; then
-  AC_MSG_WARN([version mismatch between `${srcdir}/configure.in' and `${srcdir}/lisp/version.el'.])
+  AC_MSG_WARN([version mismatch between `${srcdir}/configure.in' and `${srcdir}/src/emacs.c'.])
 fi
 
 ### Specify what sort of things we'll be editing into Makefile and config.h.
@@ -3075,14 +3067,23 @@
 
 XMENU_OBJ=
 XOBJ=
+FONT_OBJ=
 if test "${HAVE_X_WINDOWS}" = "yes" ; then
   AC_DEFINE(HAVE_X_WINDOWS, 1,
 	    [Define to 1 if you want to use the X window system.])
   XMENU_OBJ=xmenu.o
   XOBJ="xterm.o xfns.o xselect.o xrdb.o fontset.o xsmfns.o fringe.o image.o xsettings.o xgselect.o"
+  FONT_OBJ=xfont.o
+  if test "$HAVE_XFT" = "yes"; then
+    FONT_OBJ="$FONT_OBJ ftfont.o xftfont.o ftxfont.o"
+  elif test "$HAVE_FREETYPE" = "yes"; then
+    FONT_OBJ="$FONT_OBJ ftfont.o ftxfont.o"
+  fi
+  AC_SUBST(FONT_OBJ)
 fi
 AC_SUBST(XMENU_OBJ)
 AC_SUBST(XOBJ)
+AC_SUBST(FONT_OBJ)
 
 WIDGET_OBJ=
 MOTIF_LIBW=
@@ -3126,10 +3127,13 @@
 
 if test "$USE_X_TOOLKIT" = "none"; then
   LIBXT_OTHER="\$(LIBXSM)"
+  OLDXMENU_TARGET="really-oldXMenu"
 else
   LIBXT_OTHER="\$(LIBXMU) -lXt \$(LIBXTR6) -lXext"
+  OLDXMENU_TARGET="really-lwlib"
 fi
 AC_SUBST(LIBXT_OTHER)
+AC_SUBST(OLDXMENU_TARGET)
 
 ## The X Menu stuff is present in the X10 distribution, but missing
 ## from X11.  If we have X10, just use the installed library;
@@ -3148,7 +3152,12 @@
   LIBX_OTHER="\$(LIBXT) \$(LIBX_EXTRA)"
 else
   OLDXMENU=
-  LIBXMENU="-lXMenu"
+  ## FIXME This case (!HAVE_X11 && HAVE_X_WINDOWS) is no longer possible(?).
+  if test "${HAVE_X_WINDOWS}" = "yes"; then
+    LIBXMENU="-lXMenu"
+  else
+    LIBXMENU=
+  fi
   LIBX_OTHER=
 fi
 
--- a/etc/NEWS	Fri May 14 11:34:53 2010 +0000
+++ b/etc/NEWS	Sun May 16 00:18:09 2010 +0000
@@ -63,6 +63,9 @@
 default), Emacs determines the base direction of each paragraph from
 its text, as specified by the Unicode Bidirectional Algorithm.
 
+The function `current-bidi-paragraph-direction' returns the actual
+value of paragraph base direction at point.
+
 Reordering of bidirectional text for display in Emacs is a "Full
 bidirectionality" class implementation of the Unicode Bidirectional
 Algorithm.
@@ -221,6 +224,8 @@
 
 * Lisp changes in Emacs 24.1
 
+** frame-local variables cannot be let-bound any more.
+** prog-mode is a new major-mode meant to be the parent of programming mode.
 ** define-minor-mode accepts a new keyword :variable.
 
 ** delete-file now accepts an optional second arg, FORCE, which says
--- a/leim/ChangeLog	Fri May 14 11:34:53 2010 +0000
+++ b/leim/ChangeLog	Sun May 16 00:18:09 2010 +0000
@@ -1,3 +1,7 @@
+2010-05-15  Glenn Morris  <rgm@gnu.org>
+
+	* Makefile.in (install): Remove references to CVS-related files.
+
 2010-05-07  Chong Yidong  <cyd@stupidchicken.com>
 
 	* Version 23.2 released.
--- a/leim/Makefile.in	Fri May 14 11:34:53 2010 +0000
+++ b/leim/Makefile.in	Sun May 16 00:18:09 2010 +0000
@@ -237,8 +237,6 @@
 	    tar -chf - quail/* ja-dic \
 		| (cd ${INSTALLDIR}; umask 0; tar -xvf - && cat > /dev/null) ;\
 	  fi; \
-	  rm -rf ${INSTALLDIR}/CVS        ${INSTALLDIR}/*/CVS; \
-	  rm -f  ${INSTALLDIR}/.cvsignore ${INSTALLDIR}/*/.cvsignore; \
 	  rm -f  ${INSTALLDIR}/.gitignore ${INSTALLDIR}/*/.gitignore; \
 	  rm -f  ${INSTALLDIR}/.arch-inventory ${INSTALLDIR}/*/.arch-inventory; \
 	  rm -f  ${INSTALLDIR}/\#*        ${INSTALLDIR}/*/\#* ; \
--- a/lib-src/Makefile.in	Fri May 14 11:34:53 2010 +0000
+++ b/lib-src/Makefile.in	Sun May 16 00:18:09 2010 +0000
@@ -106,14 +106,15 @@
 
 # ========================== Lists of Files ===========================
 
-# Things that a user might actually run,
-# which should be installed in bindir.
-INSTALLABLES = etags${EXEEXT} ctags${EXEEXT} emacsclient${EXEEXT} b2m${EXEEXT} ebrowse${EXEEXT}
+# Things that a user might actually run, which should be installed in bindir.
+INSTALLABLES = etags${EXEEXT} ctags${EXEEXT} emacsclient${EXEEXT} \
+               b2m${EXEEXT} ebrowse${EXEEXT}
+
 INSTALLABLE_SCRIPTS = rcs-checkin grep-changelog
 
 # Things that Emacs runs internally, or during the build process,
 #  which should not be installed in bindir.
-UTILITIES=  profile${EXEEXT} digest-doc${EXEEXT} sorted-doc${EXEEXT} \
+UTILITIES = profile${EXEEXT} digest-doc${EXEEXT} sorted-doc${EXEEXT} \
             movemail${EXEEXT} fakemail${EXEEXT} \
             hexl${EXEEXT} update-game-score${EXEEXT}
 
@@ -153,7 +154,8 @@
 LIBS_MAIL=@LIBS_MAIL@
 
 ## Extra libraries to use when linking movemail.
-LIBS_MOVE = $(LIBS_MAIL) $(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) $(COM_ERRLIB) $(LIBHESIOD) $(LIBRESOLV)
+LIBS_MOVE = $(LIBS_MAIL) $(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) \
+            $(COM_ERRLIB) $(LIBHESIOD) $(LIBRESOLV)
 
 ## Some systems define this to request special libraries.
 LIBS_SYSTEM = @LIBS_SYSTEM@
@@ -161,7 +163,8 @@
 # Those files shared with other GNU utilities need HAVE_CONFIG_H
 # defined before they know they can take advantage of the information
 # in ../src/config.h.
-BASE_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) -DHAVE_CONFIG_H -I. -I../src -I${srcdir} -I${srcdir}/../src
+BASE_CFLAGS = $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) -DHAVE_CONFIG_H \
+              -I. -I../src -I${srcdir} -I${srcdir}/../src
 
 ALL_CFLAGS = ${BASE_CFLAGS} ${LDFLAGS} ${CPPFLAGS} ${CFLAGS}
 LINK_CFLAGS = ${BASE_CFLAGS} ${LDFLAGS} ${CFLAGS}
@@ -316,24 +319,31 @@
 REGEXPDEPS = $(REGEXPOBJ) $(srcdir)/../src/regex.h
 
 regex.o: $(srcdir)/../src/regex.c $(srcdir)/../src/regex.h ../src/config.h
-	${CC} -c ${CPP_CFLAGS} -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER ${srcdir}/../src/regex.c
+	${CC} -c ${CPP_CFLAGS} -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER \
+	  ${srcdir}/../src/regex.c
 
 etags${EXEEXT}: ${srcdir}/etags.c $(GETOPTDEPS) $(REGEXPDEPS) ../src/config.h
-	$(CC) ${ALL_CFLAGS} -DEMACS_NAME="\"GNU Emacs\"" -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXPOBJ) $(LOADLIBES) -o etags
+	$(CC) ${ALL_CFLAGS} -DEMACS_NAME="\"GNU Emacs\"" \
+	  -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) \
+	  $(REGEXPOBJ) $(LOADLIBES) -o etags
 
 ebrowse${EXEEXT}: ${srcdir}/ebrowse.c $(GETOPTDEPS) ../src/config.h
-	$(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" ${srcdir}/ebrowse.c $(GETOPTOBJS) $(LOADLIBES) -o ebrowse
+	$(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" \
+	  ${srcdir}/ebrowse.c $(GETOPTOBJS) $(LOADLIBES) -o ebrowse
 
 ## We depend on etags to assure that parallel makes do not write two
 ## etags.o files on top of each other.
 ctags${EXEEXT}: etags${EXEEXT}
-	$(CC) ${ALL_CFLAGS} -DCTAGS -DEMACS_NAME="\"GNU Emacs\"" -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) $(REGEXPOBJ) $(LOADLIBES) -o ctags
+	$(CC) ${ALL_CFLAGS} -DCTAGS -DEMACS_NAME="\"GNU Emacs\"" \
+	  -DVERSION="\"${version}\"" ${srcdir}/etags.c $(GETOPTOBJS) \
+	  $(REGEXPOBJ) $(LOADLIBES) -o ctags
 
 profile${EXEEXT}: ${srcdir}/profile.c ../src/config.h
 	$(CC) ${ALL_CFLAGS} ${srcdir}/profile.c $(LOADLIBES) -o profile
 
 make-docfile${EXEEXT}: ${srcdir}/make-docfile.c ../src/config.h
-	$(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) -o make-docfile
+	$(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) \
+	  -o make-docfile
 
 digest-doc${EXEEXT}: ${srcdir}/digest-doc.c
 	$(CC) ${ALL_CFLAGS} ${srcdir}/digest-doc.c $(LOADLIBES) -o digest-doc
@@ -346,9 +356,9 @@
 	   $(GETOPTOBJS) $(LOADLIBES) -o b2m
 
 movemail${EXEEXT}: movemail.o pop.o $(GETOPTDEPS)
-	$(CC) ${LINK_CFLAGS} ${MOVE_FLAGS} movemail.o pop.o $(GETOPTOBJS) $(LOADLIBES) $(LIBS_MOVE) -o movemail
+	$(CC) ${LINK_CFLAGS} ${MOVE_FLAGS} movemail.o pop.o \
+	  $(GETOPTOBJS) $(LOADLIBES) $(LIBS_MOVE) -o movemail
 
-## We need to define emacs to get the right version of something (what?).
 movemail.o: ${srcdir}/movemail.c ../src/config.h $(GETOPT_H)
 	$(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/movemail.c
 
@@ -367,7 +377,8 @@
 	$(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl
 
 update-game-score${EXEEXT}: update-game-score.o $(GETOPTDEPS)
-	$(CC) ${LINK_CFLAGS} update-game-score.o $(GETOPTOBJS) $(LOADLIBES) -o update-game-score
+	$(CC) ${LINK_CFLAGS} update-game-score.o $(GETOPTOBJS) \
+	  $(LOADLIBES) -o update-game-score
 
 update-game-score.o: ${srcdir}/update-game-score.c ../src/config.h $(GETOPT_H)
 	$(CC) -c ${CPP_CFLAGS} ${srcdir}/update-game-score.c \
--- a/lisp/ChangeLog	Fri May 14 11:34:53 2010 +0000
+++ b/lisp/ChangeLog	Sun May 16 00:18:09 2010 +0000
@@ -1,3 +1,91 @@
+2010-05-15  Ken Raeburn  <raeburn@raeburn.org>
+
+	* version.el (emacs-copyright, emacs-version): Don't define here,
+	now that emacs.c defines it.
+
+2010-05-15  Eli Zaretskii  <eliz@gnu.org>
+
+	* international/mule-cmds.el (mule-menu-keymap): Fix definition of
+	"Describe Language Environment" menu item.
+
+	* language/hebrew.el ("Hebrew", "Windows-1255"): Doc fix.
+
+	Bidi-sensitive movement with arrow keys.
+	* subr.el (right-arrow-command, left-arrow-command): New functions.
+
+	* bindings.el (global-map): Bind them to right and left arrow keys.
+
+	Don't override standard definition of convert-standard-filename.
+	* files.el (convert-standard-filename): Call
+	w32-convert-standard-filename and dos-convert-standard-filename on
+	the corresponding systems.
+
+	* w32-fns.el (w32-convert-standard-filename): Rename from
+	convert-standard-filename.  Doc fix.
+
+	* dos-fns.el (dos-convert-standard-filename): Doc fix.
+	(convert-standard-filename): Don't defalias.
+	(register-name-alist, make-register, register-value)
+	(set-register-value, intdos): Obsolete aliases for the
+	corresponding dos-* functions and variables.
+	(dos-intdos): Add a doc string.
+
+2010-05-15  Jay Belanger  <jay.p.belanger@gmail.com>
+
+	* calc/calc-aent.el (math-read-token, math-find-user-tokens):
+	* calc/calc-lang.el (math-read-big-rec, math-lang-read-symbol):
+	(math-compose-tex-func):
+	* calc/calccomp.el (math-compose-expr):
+	* calc/calc-ext.el (math-format-flat-expr-fancy):
+	* calc/calc-store.el (calc-read-var-name):
+	* calc/calc-units.el (calc-explain-units-rec): Allow Greek letters.
+
+	* calc/calc.el (var-π, var-φ, var-γ): New variables.
+	* calc/calc-aent.el (math-read-replacement-list):  Add "micro" symbol.
+	* calc/calc-units.el (math-unit-prefixes): Add mu for micro.
+	(math-standard-units):  Add units.
+
+2010-05-15  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* progmodes/asm-mode.el (asm-mode):
+	* progmodes/prolog.el (prolog-mode): Use define-derived-mode.
+
+	* pcomplete.el (pcomplete-completions-at-point): New function,
+	extracted from pcomplete-std-complete.
+	(pcomplete-std-complete): Use it.
+
+2010-05-15  Glenn Morris  <rgm@gnu.org>
+
+	* Makefile.in (setwins, setwins_almost, setwins_for_subdirs):
+	Remove references to CVS, RCS and Old directories.
+
+2010-05-14  Jay Belanger  <jay.p.belanger@gmail.com>
+
+	* calc/calc-bin.el (math-format-twos-complement): Group digits when
+	appropriate.
+
+2010-05-14  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* progmodes/sh-script.el (sh-mode-default-syntax-table): Remove.
+	(sh-mode-syntax-table): Give it a default value instead.
+	(sh-header-marker): Make buffer-local.
+	(sh-mode): Move make-local-variable to the corresponding setq.
+	(sh-add-completer): Avoid gratuitously let-binding a buffer-local var.
+	Use complete-with-action.
+
+	* simple.el (prog-mode): New (abstract) major mode.
+	* emacs-lisp/lisp-mode.el (emacs-lisp-mode, lisp-mode): Use it.
+	* progmodes/sh-script.el (sh-mode): Remove redundant var assignment.
+
+2010-05-14  Juanma Barranquero  <lekktu@gmail.com>
+
+	* progmodes/sql.el (sql-oracle-program): Reflow docstring.
+	(sql-oracle-scan-on, sql-sybase-program, sql-product-font-lock)
+	(sql-add-product-keywords, sql-highlight-product, sql-set-product)
+	(sql-make-alternate-buffer-name, sql-placeholders-filter)
+	(sql-escape-newlines-filter, sql-input-sender)
+	(sql-send-magic-terminator, sql-sybase): Fix typos in docstrings.
+
 2010-05-13  Chong Yidong  <cyd@stupidchicken.com>
 
 	Add TeX open-block and close-block keybindings to SGML, and vice
@@ -15,8 +103,8 @@
 	only when the message would be displayed.  Handled nested calls.
 	(tramp-handle-load, tramp-handle-file-local-copy)
 	(tramp-handle-insert-file-contents, tramp-handle-write-region)
-	(tramp-maybe-send-script, tramp-find-shell): Use
-	`with-progress-reporter'.
+	(tramp-maybe-send-script, tramp-find-shell):
+	Use `with-progress-reporter'.
 	(tramp-handle-dired-compress-file, tramp-maybe-open-connection):
 	Fix message text.
 
--- a/lisp/Makefile.in	Fri May 14 11:34:53 2010 +0000
+++ b/lisp/Makefile.in	Sun May 16 00:18:09 2010 +0000
@@ -84,28 +84,25 @@
 emacs = EMACSLOADPATH=$(lisp) LC_ALL=C $(EMACS) $(EMACSOPT)
 
 # Common command to find subdirectories
-
 setwins=subdirs=`(find . -type d -print)`; \
 	for file in $$subdirs; do \
-	   case $$file in */Old | */RCS | */CVS | */CVS/* | */.* | */.*/* | */=* ) ;; \
+	   case $$file in */.* | */.*/* | */=* ) ;; \
 		*) wins="$$wins $$file" ;; \
 	   esac; \
         done
 
 # Find all subdirectories except `obsolete' and `term'.
-
 setwins_almost=subdirs=`(find . -type d -print)`; \
 	for file in $$subdirs; do \
-	   case $$file in */Old | */RCS | */CVS | */CVS/* | */.* | */.*/* | */=* | */obsolete | */term ) ;; \
+	   case $$file in */.* | */.*/* | */=* | */obsolete | */term ) ;; \
 		*) wins="$$wins $$file" ;; \
 	   esac; \
         done
 
 # Find all subdirectories in which we might want to create subdirs.el
-
 setwins_for_subdirs=subdirs=`(find . -type d -print)`; \
 	for file in $$subdirs; do \
-	   case $$file in */Old | */RCS | */CVS | */CVS/* | */.* | */.*/* | */=* | */cedet* ) ;; \
+	   case $$file in */.* | */.*/* | */=* | */cedet* ) ;; \
 		*) wins="$$wins $$file" ;; \
 	   esac; \
         done
--- a/lisp/bindings.el	Fri May 14 11:34:53 2010 +0000
+++ b/lisp/bindings.el	Sun May 16 00:18:09 2010 +0000
@@ -828,9 +828,9 @@
 (define-key global-map [C-home]		'beginning-of-buffer)
 (define-key global-map [M-home]		'beginning-of-buffer-other-window)
 (define-key esc-map    [home]		'beginning-of-buffer-other-window)
-(define-key global-map [left]		'backward-char)
+(define-key global-map [left]		'left-arrow-command)
 (define-key global-map [up]		'previous-line)
-(define-key global-map [right]		'forward-char)
+(define-key global-map [right]		'right-arrow-command)
 (define-key global-map [down]		'next-line)
 (define-key global-map [prior]		'scroll-down-command)
 (define-key global-map [next]		'scroll-up-command)
--- a/lisp/calc/calc-aent.el	Fri May 14 11:34:53 2010 +0000
+++ b/lisp/calc/calc-aent.el	Sun May 16 00:18:09 2010 +0000
@@ -510,6 +510,7 @@
     ("≥" ">=")
     ("≦" "<=")
     ("≧" ">=")
+    ("µ" "μ")
     ;; fractions
     ("¼" "(1:4)") ; 1/4
     ("½" "(1:2)") ; 1/2
@@ -675,11 +676,11 @@
     (cond ((and (stringp (car p))
 		(or (> (length (car p)) 1) (equal (car p) "$")
 		    (equal (car p) "\""))
-		(string-match "[^a-zA-Z0-9]" (car p)))
+		(string-match "[^a-zA-Zα-ωΑ-Ω0-9]" (car p)))
 	   (let ((s (regexp-quote (car p))))
-	     (if (string-match "\\`[a-zA-Z0-9]" s)
+	     (if (string-match "\\`[a-zA-Zα-ωΑ-Ω0-9]" s)
 		 (setq s (concat "\\<" s)))
-	     (if (string-match "[a-zA-Z0-9]\\'" s)
+	     (if (string-match "[a-zA-Zα-ωΑ-Ω0-9]\\'" s)
 		 (setq s (concat s "\\>")))
 	     (or (assoc s math-toks)
 		 (progn
@@ -718,15 +719,17 @@
 		   math-expr-data (math-match-substring math-exp-str 0)
 		   math-exp-pos (match-end 0)))
 	    ((or (and (>= ch ?a) (<= ch ?z))
-		 (and (>= ch ?A) (<= ch ?Z)))
+		 (and (>= ch ?A) (<= ch ?Z))
+		 (and (>= ch ?α) (<= ch ?ω))
+		 (and (>= ch ?Α) (<= ch ?Ω)))
 	     (string-match 
               (cond
                ((and (memq calc-language calc-lang-allow-underscores)
                      (memq calc-language calc-lang-allow-percentsigns))
-                "[a-zA-Z0-9_'#]*")
+                "[a-zA-Zα-ωΑ-Ω0-9_'#]*")
                ((memq calc-language calc-lang-allow-underscores)
-			       "[a-zA-Z0-9_#]*")
-               (t "[a-zA-Z0-9'#]*"))
+			       "[a-zA-Zα-ωΑ-Ω0-9_#]*")
+               (t "[a-zA-Zα-ωΑ-Ω0-9'#]*"))
               math-exp-str math-exp-pos)
 	     (setq math-exp-token 'symbol
 		   math-exp-pos (match-end 0)
@@ -744,12 +747,12 @@
 		      (or (eq math-exp-pos 0)
 			  (and (not (memq calc-language 
                                           calc-lang-allow-underscores))
-			       (eq (string-match "[^])}\"a-zA-Z0-9'$]_"
+			       (eq (string-match "[^])}\"a-zA-Zα-ωΑ-Ω0-9'$]_"
 						 math-exp-str (1- math-exp-pos))
 				   (1- math-exp-pos))))))
 	     (or (and (memq calc-language calc-lang-c-type-hex)
 		      (string-match "0[xX][0-9a-fA-F]+" math-exp-str math-exp-pos))
-		 (string-match "_?\\([0-9]+.?0*@ *\\)?\\([0-9]+.?0*' *\\)?\\(0*\\([2-9]\\|1[0-4]\\)\\(#[#]?\\|\\^\\^\\)[0-9a-dA-D.]+[eE][-+_]?[0-9]+\\|0*\\([2-9]\\|[0-2][0-9]\\|3[0-6]\\)\\(#[#]?\\|\\^\\^\\)[0-9a-zA-Z:.]+\\|[0-9]+:[0-9:]+\\|[0-9.]+\\([eE][-+_]?[0-9]+\\)?\"?\\)?"
+		 (string-match "_?\\([0-9]+.?0*@ *\\)?\\([0-9]+.?0*' *\\)?\\(0*\\([2-9]\\|1[0-4]\\)\\(#[#]?\\|\\^\\^\\)[0-9a-dA-D.]+[eE][-+_]?[0-9]+\\|0*\\([2-9]\\|[0-2][0-9]\\|3[0-6]\\)\\(#[#]?\\|\\^\\^\\)[0-9a-zA-Zα-ωΑ-Ω:.]+\\|[0-9]+:[0-9:]+\\|[0-9.]+\\([eE][-+_]?[0-9]+\\)?\"?\\)?"
                                math-exp-str math-exp-pos))
 	     (setq math-exp-token 'number
 		   math-expr-data (math-match-substring math-exp-str 0)
--- a/lisp/calc/calc-bin.el	Fri May 14 11:34:53 2010 +0000
+++ b/lisp/calc/calc-bin.el	Sun May 16 00:18:09 2010 +0000
@@ -845,6 +845,8 @@
            (len (length num)))
       (if (< len digs)
           (setq num (concat (make-string (- digs len) ?0) num))))
+    (when calc-group-digits
+      (setq num (math-group-float num)))
     (concat 
      (number-to-string calc-number-radix)
      "##"
--- a/lisp/calc/calc-ext.el	Fri May 14 11:34:53 2010 +0000
+++ b/lisp/calc/calc-ext.el	Sun May 16 00:18:09 2010 +0000
@@ -3283,7 +3283,7 @@
 	     (concat "-" (math-format-flat-expr (nth 1 a) 1000)))
 	    (t
 	     (concat (math-remove-dashes
-		      (if (string-match "\\`calcFunc-\\([a-zA-Z0-9']+\\)\\'"
+		      (if (string-match "\\`calcFunc-\\([a-zA-Zα-ωΑ-Ω0-9']+\\)\\'"
 					(symbol-name (car a)))
 			  (math-match-substring (symbol-name (car a)) 1)
 			(symbol-name (car a))))
--- a/lisp/calc/calc-lang.el	Fri May 14 11:34:53 2010 +0000
+++ b/lisp/calc/calc-lang.el	Sun May 16 00:18:09 2010 +0000
@@ -214,7 +214,7 @@
 (put 'pascal 'math-lang-read-symbol
      '((?\$
         (eq (string-match
-             "\\(\\$[0-9a-fA-F]+\\)\\($\\|[^0-9a-zA-Z]\\)"
+             "\\(\\$[0-9a-fA-F]+\\)\\($\\|[^0-9a-zA-Zα-ωΑ-Ω]\\)"
              math-exp-str math-exp-pos)
             math-exp-pos)
         (setq math-exp-token 'number
@@ -312,7 +312,7 @@
 
 (put 'fortran 'math-lang-read-symbol
      '((?\.
-        (eq (string-match "\\.[a-zA-Z][a-zA-Z][a-zA-Z]?\\."
+        (eq (string-match "\\.[a-zA-Zα-ωΑ-Ω][a-zA-Zα-ωΑ-Ω][a-zA-Zα-ωΑ-Ω]?\\."
                           math-exp-str math-exp-pos) math-exp-pos)
         (setq math-exp-token 'punc
               math-expr-data (upcase (math-match-substring math-exp-str 0))
@@ -603,9 +603,9 @@
      '((?\\
         (< math-exp-pos (1- (length math-exp-str)))
         (progn
-          (or (string-match "\\\\hbox *{\\([a-zA-Z0-9]+\\)}"
+          (or (string-match "\\\\hbox *{\\([a-zA-Zα-ωΑ-Ω0-9]+\\)}"
                             math-exp-str math-exp-pos)
-              (string-match "\\(\\\\\\([a-zA-Z]+\\|[^a-zA-Z]\\)\\)"
+              (string-match "\\(\\\\\\([a-zA-Zα-ωΑ-Ω]+\\|[^a-zA-Zα-ωΑ-Ω]\\)\\)"
                             math-exp-str math-exp-pos))
           (setq math-exp-token 'symbol
                 math-exp-pos (match-end 0)
@@ -691,7 +691,7 @@
 (defun math-compose-tex-var (a prec)
   (if (and calc-language-option
            (not (= calc-language-option 0))
-           (string-match "\\`[a-zA-Z][a-zA-Z0-9]+\\'"
+           (string-match "\\`[a-zA-Zα-ωΑ-Ω][a-zA-Zα-ωΑ-Ω0-9]+\\'"
                          (symbol-name (nth 1 a))))
       (if (eq calc-language 'latex)
           (format "\\text{%s}" (symbol-name (nth 1 a)))
@@ -702,7 +702,7 @@
   (let (left right)
     (if (and calc-language-option
              (not (= calc-language-option 0))
-             (string-match "\\`[a-zA-Z][a-zA-Z0-9]+\\'" func))
+             (string-match "\\`[a-zA-Zα-ωΑ-Ω][a-zA-Zα-ωΑ-Ω0-9]+\\'" func))
         (if (< (prefix-numeric-value calc-language-option) 0)
             (setq func (format "\\%s" func))
           (setq func (if (eq calc-language 'latex)
@@ -824,11 +824,11 @@
      '((?\\
         (< math-exp-pos (1- (length math-exp-str)))
         (progn
-          (or (string-match "\\\\hbox *{\\([a-zA-Z0-9]+\\)}"
+          (or (string-match "\\\\hbox *{\\([a-zA-Zα-ωΑ-Ω0-9]+\\)}"
                             math-exp-str math-exp-pos)
-              (string-match "\\\\text *{\\([a-zA-Z0-9]+\\)}"
+              (string-match "\\\\text *{\\([a-zA-Zα-ωΑ-Ω0-9]+\\)}"
                             math-exp-str math-exp-pos)
-              (string-match "\\(\\\\\\([a-zA-Z]+\\|[^a-zA-Z]\\)\\)"
+              (string-match "\\(\\\\\\([a-zA-Zα-ωΑ-Ω]+\\|[^a-zA-Zα-ωΑ-Ω]\\)\\)"
                             math-exp-str math-exp-pos))
           (setq math-exp-token 'symbol
                 math-exp-pos (match-end 0)
@@ -2301,9 +2301,11 @@
 
 	    ;; Variable name or function call.
 	    ((or (and (>= other-char ?a) (<= other-char ?z))
-		 (and (>= other-char ?A) (<= other-char ?Z)))
+		 (and (>= other-char ?A) (<= other-char ?Z))
+		 (and (>= other-char ?α) (<= other-char ?ω))
+		 (and (>= other-char ?Α) (<= other-char ?Ω)))
 	     (setq line (nth v math-read-big-lines))
-	     (string-match "\\([a-zA-Z'_]+\\) *" line math-rb-h1)
+	     (string-match "\\([a-zA-Zα-ωΑ-Ω'_]+\\) *" line math-rb-h1)
 	     (setq h (match-end 1)
 		   widest (match-end 0)
 		   p (math-match-substring line 1))
--- a/lisp/calc/calc-store.el	Fri May 14 11:34:53 2010 +0000
+++ b/lisp/calc/calc-store.el	Sun May 16 00:18:09 2010 +0000
@@ -202,7 +202,7 @@
                  'calc-read-var-name-history)))))
     (setq calc-aborted-prefix "")
     (and (not (equal var "var-"))
-	 (if (string-match "\\`\\([-a-zA-Z0-9]+\\) *:?=" var)
+	 (if (string-match "\\`\\([-a-zA-Zα-ωΑ-Ω0-9]+\\) *:?=" var)
 	     (if (null calc-given-value-flag)
 		 (error "Assignment is not allowed in this command")
 	       (let ((svar (intern (substring var 0 (match-end 1)))))
--- a/lisp/calc/calc-units.el	Fri May 14 11:34:53 2010 +0000
+++ b/lisp/calc/calc-units.el	Sun May 16 00:18:09 2010 +0000
@@ -36,13 +36,13 @@
 
 ;;; Units table last updated 9-Jan-91 by Ulrich Mueller (ulm@vsnhd1.cern.ch)
 ;;; with some additions by Przemek Klosowski (przemek@rrdstrad.nist.gov)
-;;; Updated April 2002 by Jochen Küpper
+;;; Updated April 2002 by Jochen Küpper
 
 ;;; Updated August 2007, using
 ;;;     CODATA (http://physics.nist.gov/cuu/Constants/index.html)
 ;;;     NIST   (http://physics.nist.gov/Pubs/SP811/appenB9.html)
 ;;;     ESUWM  (Encyclopaedia of Scientific Units, Weights and
-;;;             Measures, by François Cardarelli)
+;;;             Measures, by François Cardarelli)
 ;;; All conversions are exact unless otherwise noted.
 
 (defvar math-standard-units
@@ -210,6 +210,7 @@
               "1.602176487 10^-19 C (*)") ;;(approx) CODATA
     ( V       "W/A"                   "Volt" )
     ( ohm     "V/A"                   "Ohm" )
+    ( Ω       "ohm"                   "Ohm" )
     ( mho     "A/V"                   "Mho" )
     ( S       "A/V"                   "Siemens" )
     ( F       "C/V"                   "Farad" )
@@ -259,7 +260,9 @@
               "6.62606896 10^-34 J s (*)")
     ( hbar    "h / (2 pi)"                  "Planck's constant" ) ;; Exact
     ( mu0     "4 pi 10^(-7) H/m"            "Permeability of vacuum") ;; Exact
+    ( μ0      "mu0"                         "Permeability of vacuum") ;; Exact
     ( eps0    "1 / (mu0 c^2)"               "Permittivity of vacuum" )
+    ( ε0      "eps0"                        "Permittivity of vacuum" )
     ( G       "6.67428*10^(-11) m^3/(kg s^2)"    "Gravitational constant" nil
               "6.67428 10^-11 m^3/(kg s^2) (*)")
     ( Nav     "6.02214179*10^(23) / mol"    "Avogadro's constant" nil
@@ -272,12 +275,16 @@
               "1.674927211 10^-27 kg (*)")
     ( mmu     "1.88353130*10^(-28) kg"      "Muon rest mass" nil
               "1.88353130 10^-28 kg (*)")
+    ( mμ      "mmu"                         "Muon rest mass" nil
+              "1.88353130 10^-28 kg (*)")
     ( Ryd     "10973731.568527 /m"          "Rydberg's constant" nil
               "10973731.568527 /m (*)")
     ( k       "1.3806504*10^(-23) J/K"      "Boltzmann's constant" nil
               "1.3806504 10^-23 J/K (*)")
     ( alpha   "7.2973525376*10^(-3)"        "Fine structure constant" nil
               "7.2973525376 10^-3 (*)")
+    ( α       "alpha"                        "Fine structure constant" nil
+              "7.2973525376 10^-3 (*)")
     ( muB     "927.400915*10^(-26) J/T"     "Bohr magneton" nil
               "927.400915 10^-26 J/T (*)")
     ( muN     "5.05078324*10^(-27) J/T"     "Nuclear magneton" nil
@@ -316,6 +323,7 @@
      ( ?c  (^ 10 -2)  "Centi"  )
      ( ?m  (^ 10 -3)  "Milli"  )
      ( ?u  (^ 10 -6)  "Micro"  )
+     ( ?μ  (^ 10 -6)  "Micro"  )     
      ( ?n  (^ 10 -9)  "Nano"   )
      ( ?p  (^ 10 -12) "Pico"   )
      ( ?f  (^ 10 -15) "Femto"  )
@@ -581,8 +589,8 @@
 	(let ((name (or (nth 2 u) (symbol-name (car u)))))
 	  (if (eq (aref name 0) ?\*)
 	      (setq name (substring name 1)))
-	  (if (string-match "[^a-zA-Z0-9']" name)
-	      (if (string-match "^[a-zA-Z0-9' ()]*$" name)
+	  (if (string-match "[^a-zA-Zα-ωΑ-Ω0-9']" name)
+	      (if (string-match "^[a-zA-Zα-ωΑ-Ω0-9' ()]*$" name)
 		  (while (setq pos (string-match "[ ()]" name))
 		    (setq name (concat (substring name 0 pos)
 				       (if (eq (aref name pos) 32) "-" "")
@@ -592,7 +600,7 @@
 	      (setq name (concat (nth 2 (assq (aref (symbol-name
 						     (nth 1 expr)) 0)
 					      math-unit-prefixes))
-				 (if (and (string-match "[^a-zA-Z0-9']" name)
+				 (if (and (string-match "[^a-zA-Zα-ωΑ-Ω0-9']" name)
 					  (not (memq (car u) '(mHg gf))))
 				     (concat "-" name)
 				   (downcase name)))))
@@ -1540,9 +1548,5 @@
 
 (provide 'calc-units)
 
-;; Local Variables:
-;; coding: iso-latin-1
-;; End:
-
 ;; arch-tag: e993314f-3adc-4191-be61-4ef8874881c4
 ;;; calc-units.el ends here
--- a/lisp/calc/calc.el	Fri May 14 11:34:53 2010 +0000
+++ b/lisp/calc/calc.el	Sun May 16 00:18:09 2010 +0000
@@ -999,9 +999,12 @@
 (defvar math-working-step-2 nil)
 (defvar var-i '(special-const (math-imaginary 1)))
 (defvar var-pi '(special-const (math-pi)))
+(defvar var-Ï€ '(special-const (math-pi)))
 (defvar var-e '(special-const (math-e)))
 (defvar var-phi '(special-const (math-phi)))
+(defvar var-φ '(special-const (math-phi)))
 (defvar var-gamma '(special-const (math-gamma-const)))
+(defvar var-γ '(special-const (math-gamma-const)))
 (defvar var-Modes '(special-const (math-get-modes-vec)))
 
 (mapc (lambda (v) (or (boundp v) (set v nil)))
--- a/lisp/calc/calccomp.el	Fri May 14 11:34:53 2010 +0000
+++ b/lisp/calc/calccomp.el	Sun May 16 00:18:09 2010 +0000
@@ -663,6 +663,8 @@
 			      (and prevc nextc
 				   (or (and (>= nextc ?a) (<= nextc ?z))
 				       (and (>= nextc ?A) (<= nextc ?Z))
+				       (and (>= nextc ?α) (<= nextc ?ω))
+				       (and (>= nextc ?Α) (<= nextc ?Ω))
 				       (and (>= nextc ?0) (<= nextc ?9))
 				       (memq nextc '(?. ?_ ?#
 							?\( ?\[ ?\{))
@@ -732,7 +734,7 @@
 				(not (math-tex-expr-is-flat (nth 1 a))))))
 		   (list 'horiz
 			 (if lr "\\left" "")
-			 (if (string-match "\\`u\\([^a-zA-Z]\\)\\'" (car op))
+			 (if (string-match "\\`u\\([^a-zA-Zα-ωΑ-Ω]\\)\\'" (car op))
 			     (substring (car op) 1)
 			   (car op))
 			 (if (or lr (> (length (car op)) 2)) " " "")
@@ -758,7 +760,7 @@
 		(t
 		 (let ((rhs (math-compose-expr (nth 1 a) (nth 3 op))))
 		   (list 'horiz
-			 (let ((ops (if (string-match "\\`u\\([^a-zA-Z]\\)\\'"
+			 (let ((ops (if (string-match "\\`u\\([^a-zA-Zα-ωΑ-Ω]\\)\\'"
 						      (car op))
 					(substring (car op) 1)
 				      (car op))))
@@ -806,7 +808,7 @@
 		     (setq func (car func2)))
 		 (setq func (math-remove-dashes
 			     (if (string-match
-				  "\\`calcFunc-\\([a-zA-Z0-9']+\\)\\'"
+				  "\\`calcFunc-\\([a-zA-Zα-ωΑ-Ω0-9']+\\)\\'"
 				  (symbol-name func))
 				 (math-match-substring (symbol-name func) 1)
 			       (symbol-name func))))
--- a/lisp/dos-fns.el	Fri May 14 11:34:53 2010 +0000
+++ b/lisp/dos-fns.el	Sun May 16 00:18:09 2010 +0000
@@ -30,16 +30,16 @@
 (declare-function int86 "dosfns.c")
 (declare-function msdos-long-file-names "msdos.c")
 
-;; This overrides a trivial definition in files.el.
+;; See convert-standard-filename in files.el.
 (defun dos-convert-standard-filename (filename)
-  "Convert a standard file's name to something suitable for the current OS.
+  "Convert a standard file's name to something suitable for MS-DOS.
 This means to guarantee valid names and perhaps to canonicalize
 certain patterns.
 
+This function is called by `convert-standard-filename'.
+
 On Windows and DOS, replace invalid characters.  On DOS, make
-sure to obey the 8.3 limitations.  On Windows, turn Cygwin names
-into native names, and also turn slashes into backslashes if the
-shell requires it (see `w32-shell-dos-semantics')."
+sure to obey the 8.3 limitations."
   (if (or (not (stringp filename))
 	  ;; This catches the case where FILENAME is "x:" or "x:/" or
 	  ;; "/", thus preventing infinite recursion.
@@ -128,11 +128,6 @@
 		    (dos-convert-standard-filename dir))
 		  string))))))
 
-;; Only redirect convert-standard-filename if it has a chance of working,
-;; otherwise loading dos-fns.el might make your non-DOS Emacs misbehave.
-(when (fboundp 'msdos-long-file-names)
-  (defalias 'convert-standard-filename 'dos-convert-standard-filename))
-
 (defun dos-8+3-filename (filename)
   "Truncate FILENAME to DOS 8+3 limits."
   (if (or (not (stringp filename))
@@ -243,9 +238,14 @@
     (al . (0 . 0)) (bl . (1 . 0)) (cl . (2 . 0)) (dl . (3 . 0))
     (ah . (0 . 1)) (bh . (1 . 1)) (ch . (2 . 1)) (dh . (3 . 1))))
 
+(define-obsolete-variable-alias
+  'register-name-alist 'dos-register-name-alist "24.1")
+
 (defun dos-make-register ()
   (make-vector 8 0))
 
+(define-obsolete-function-alias 'make-register 'dos-make-register "24.1")
+
 (defun dos-register-value (regs name)
   (let ((where (cdr (assoc name dos-register-name-alist))))
     (cond ((consp where)
@@ -257,6 +257,8 @@
 	   (aref regs where))
 	  (t nil))))
 
+(define-obsolete-function-alias 'register-value 'dos-register-value "24.1")
+
 (defun dos-set-register-value (regs name value)
   (and (numberp value)
        (>= value 0)
@@ -273,9 +275,18 @@
 		(aset regs where (logand value 65535))))))
   regs)
 
+(define-obsolete-function-alias
+  'set-register-value 'dos-set-register-value "24.1")
+
 (defsubst dos-intdos (regs)
+  "Issue the DOS Int 21h with registers REGS.
+
+REGS should be a vector produced by `dos-make-register'
+and `dos-set-register-value', which see."
   (int86 33 regs))
 
+(define-obsolete-function-alias 'intdos 'dos-intdos "24.1")
+
 ;; Backward compatibility for obsolescent functions which
 ;; set screen size.
 
@@ -284,6 +295,8 @@
   (interactive)
   (set-frame-size (selected-frame) 80 25))
 
+(define-obsolete-function-alias 'mode25 'dos-mode25 "24.1")
+
 (defun dos-mode4350 ()
   "Changes the number of rows to 43 or 50.
 Emacs always tries to set the screen height to 50 rows first.
@@ -295,6 +308,8 @@
       nil  ; the original built-in function returned nil
     (set-frame-size (selected-frame) 80 43)))
 
+(define-obsolete-function-alias 'mode4350 'dos-mode4350 "24.1")
+
 (provide 'dos-fns)
 
 ;; arch-tag: 00b03579-8ebb-4a02-8762-5c5a929774ad
--- a/lisp/emacs-lisp/lisp-mode.el	Fri May 14 11:34:53 2010 +0000
+++ b/lisp/emacs-lisp/lisp-mode.el	Sun May 16 00:18:09 2010 +0000
@@ -221,8 +221,6 @@
   ;;(set (make-local-variable 'adaptive-fill-mode) nil)
   (make-local-variable 'indent-line-function)
   (setq indent-line-function 'lisp-indent-line)
-  (make-local-variable 'parse-sexp-ignore-comments)
-  (setq parse-sexp-ignore-comments t)
   (make-local-variable 'outline-regexp)
   (setq outline-regexp ";;;\\(;* [^ \t\n]\\|###autoload\\)\\|(")
   (make-local-variable 'outline-level)
@@ -431,7 +429,7 @@
   :type 'hook
   :group 'lisp)
 
-(define-derived-mode emacs-lisp-mode nil "Emacs-Lisp"
+(define-derived-mode emacs-lisp-mode prog-mode "Emacs-Lisp"
   "Major mode for editing Lisp code to run in Emacs.
 Commands:
 Delete converts tabs to spaces as it moves back.
@@ -466,7 +464,7 @@
   "Keymap for ordinary Lisp mode.
 All commands in `lisp-mode-shared-map' are inherited by this map.")
 
-(define-derived-mode lisp-mode nil "Lisp"
+(define-derived-mode lisp-mode prog-mode "Lisp"
   "Major mode for editing Lisp code for Lisps other than GNU Emacs Lisp.
 Commands:
 Delete converts tabs to spaces as it moves back.
--- a/lisp/files.el	Fri May 14 11:34:53 2010 +0000
+++ b/lisp/files.el	Sun May 16 00:18:09 2010 +0000
@@ -574,6 +574,9 @@
 	  (inhibit-file-name-operation op))
       (apply op args))))
 
+(declare-function dos-convert-standard-filename "dos-fns.el" (filename))
+(declare-function w32-convert-standard-filename "w32-fns.el" (filename))
+
 (defun convert-standard-filename (filename)
   "Convert a standard file's name to something suitable for the OS.
 This means to guarantee valid names and perhaps to canonicalize
@@ -591,15 +594,20 @@
 `w32-shell-dos-semantics').
 
 See Info node `(elisp)Standard File Names' for more details."
-  (if (eq system-type 'cygwin)
-      (let ((name (copy-sequence filename))
-	    (start 0))
-	;; Replace invalid filename characters with !
-	(while (string-match "[?*:<>|\"\000-\037]" name start)
-	       (aset name (match-beginning 0) ?!)
-	  (setq start (match-end 0)))
-	name)
-    filename))
+  (cond
+   ((eq system-type 'cygwin)
+    (let ((name (copy-sequence filename))
+	  (start 0))
+      ;; Replace invalid filename characters with !
+      (while (string-match "[?*:<>|\"\000-\037]" name start)
+	(aset name (match-beginning 0) ?!)
+	(setq start (match-end 0)))
+      name))
+   ((eq system-type 'windows-nt)
+    (w32-convert-standard-filename filename))
+   ((eq system-type 'ms-dos)
+    (dos-convert-standard-filename filename))
+   (t filename)))
 
 (defun read-directory-name (prompt &optional dir default-dirname mustmatch initial)
   "Read directory name, prompting with PROMPT and completing in directory DIR.
--- a/lisp/international/mule-cmds.el	Fri May 14 11:34:53 2010 +0000
+++ b/lisp/international/mule-cmds.el	Sun May 16 00:18:09 2010 +0000
@@ -140,7 +140,7 @@
 
     (define-key-after map [describe-language-environment]
       `(menu-item ,(purecopy "Describe Language Environment")
-            describe-language-environment-map
+            ,describe-language-environment-map
             :help ,(purecopy "Show multilingual settings for a specific language")))
     (define-key-after map [describe-input-method]
       `(menu-item ,(purecopy "Describe Input Method...") describe-input-method
--- a/lisp/language/hebrew.el	Fri May 14 11:34:53 2010 +0000
+++ b/lisp/language/hebrew.el	Sun May 16 00:18:09 2010 +0000
@@ -60,14 +60,14 @@
 	    (input-method . "hebrew")
 	    (unibyte-display . hebrew-iso-8bit)
 	    (sample-text . "Hebrew	,Hylem(B")
-	    (documentation . "Right-to-left writing is not yet supported.")))
+	    (documentation . "Bidirectional editing is supported.")))
 
 (set-language-info-alist
  "Windows-1255" '((coding-priority windows-1255)
 		  (coding-system windows-1255)
 		  (documentation . "\
 Support for Windows-1255 encoding, e.g. for Yiddish.
-Right-to-left writing is not yet supported.")))
+Bidirectional editing is supported.")))
 
 (define-coding-system 'windows-1255
   "windows-1255 (Hebrew) encoding (MIME: WINDOWS-1255)"
--- a/lisp/org/org-docview.el	Fri May 14 11:34:53 2010 +0000
+++ b/lisp/org/org-docview.el	Sun May 16 00:18:09 2010 +0000
@@ -1,9 +1,8 @@
 ;;; org-docview.el --- support for links to doc-view-mode buffers
 
-;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;;   Free Software Foundation, Inc.
+;; Copyright (C) 2009, 2010  Free Software Foundation, Inc.
 
-;; Author: Jan Böcker <jan.boecker at jboecker dot de>
+;; Author: Jan Böcker <jan.boecker at jboecker dot de>
 ;; Keywords: outlines, hypermedia, calendar, wp
 ;; Homepage: http://orgmode.org
 ;; Version: 6.35i
--- a/lisp/pcomplete.el	Fri May 14 11:34:53 2010 +0000
+++ b/lisp/pcomplete.el	Sun May 16 00:18:09 2010 +0000
@@ -444,12 +444,14 @@
 ;; I don't think such commands are usable before first setting up buffer-local
 ;; variables to parse args, so there's no point autoloading it.
 ;; ;;;###autoload
-(defun pcomplete-std-complete ()
+(defun pcomplete-completions-at-point ()
   "Provide standard completion using pcomplete's completion tables.
 Same as `pcomplete' but using the standard completion UI."
-  (interactive)
   ;; FIXME: it only completes the text before point, whereas the
   ;; standard UI may also consider text after point.
+  ;; FIXME: the `pcomplete' UI may be used internally during
+  ;; pcomplete-completions and then throw to `pcompleted', thus
+  ;; imposing the pcomplete UI over the standard UI.
   (catch 'pcompleted
     (let* ((pcomplete-stub)
            pcomplete-seen pcomplete-norm-func
@@ -516,7 +518,7 @@
                                (directory-file-name f))
                       pcomplete-seen))))))
 
-      (completion-in-region
+      (list
        beg (point)
        ;; Add a space at the end of completion.  Use a terminator-regexp
        ;; that never matches since the terminator cannot appear
@@ -527,7 +529,14 @@
                           (cons pcomplete-termination-string
                                 "\\`a\\`")
                           table))
-       pred))))
+       :predicate pred))))
+
+ ;; I don't think such commands are usable before first setting up buffer-local
+ ;; variables to parse args, so there's no point autoloading it.
+ ;; ;;;###autoload
+(defun pcomplete-std-complete ()
+  (let ((completion-at-point-functions '(pcomplete-completions-at-point)))
+    (completion-at-point)))
 
 ;;; Pcomplete's native UI.
 
--- a/lisp/progmodes/asm-mode.el	Fri May 14 11:34:53 2010 +0000
+++ b/lisp/progmodes/asm-mode.el	Sun May 16 00:18:09 2010 +0000
@@ -109,7 +109,7 @@
   "Additional expressions to highlight in Assembler mode.")
 
 ;;;###autoload
-(defun asm-mode ()
+(define-derived-mode asm-mode prog-mode "Assembler"
   "Major mode for editing typical assembler code.
 Features a private abbrev table and the following bindings:
 
@@ -128,13 +128,8 @@
 
 Special commands:
 \\{asm-mode-map}"
-  (interactive)
-  (kill-all-local-variables)
-  (setq mode-name "Assembler")
-  (setq major-mode 'asm-mode)
   (setq local-abbrev-table asm-mode-abbrev-table)
-  (make-local-variable 'font-lock-defaults)
-  (setq font-lock-defaults '(asm-font-lock-keywords))
+  (set (make-local-variable 'font-lock-defaults) '(asm-font-lock-keywords))
   (set (make-local-variable 'indent-line-function) 'asm-indent-line)
   ;; Stay closer to the old TAB behavior (was tab-to-tab-stop).
   (set (make-local-variable 'tab-always-indent) nil)
@@ -157,8 +152,7 @@
   (setq comment-end-skip "[ \t]*\\(\\s>\\|\\*+/\\)")
   (make-local-variable 'comment-end)
   (setq comment-end "")
-  (setq fill-prefix "\t")
-  (run-mode-hooks 'asm-mode-hook))
+  (setq fill-prefix "\t"))
 
 (defun asm-indent-line ()
   "Auto-indent the current line."
--- a/lisp/progmodes/prolog.el	Fri May 14 11:34:53 2010 +0000
+++ b/lisp/progmodes/prolog.el	Sun May 16 00:18:09 2010 +0000
@@ -136,26 +136,18 @@
     ))
 
 ;;;###autoload
-(defun prolog-mode ()
+(define-derived-mode prolog-mode prog-mode "Prolog"
   "Major mode for editing Prolog code for Prologs.
 Blank lines and `%%...' separate paragraphs.  `%'s start comments.
 Commands:
 \\{prolog-mode-map}
 Entry to this mode calls the value of `prolog-mode-hook'
 if that value is non-nil."
-  (interactive)
-  (kill-all-local-variables)
-  (use-local-map prolog-mode-map)
-  (set-syntax-table prolog-mode-syntax-table)
-  (setq major-mode 'prolog-mode)
-  (setq mode-name "Prolog")
   (prolog-mode-variables)
   (set (make-local-variable 'comment-add) 1)
-  ;; font lock
   (setq font-lock-defaults '(prolog-font-lock-keywords
                              nil nil nil
-                             beginning-of-line))
-  (run-mode-hooks 'prolog-mode-hook))
+                             beginning-of-line)))
 
 (defun prolog-indent-line ()
   "Indent current line as Prolog code.
--- a/lisp/progmodes/sh-script.el	Fri May 14 11:34:53 2010 +0000
+++ b/lisp/progmodes/sh-script.el	Sun May 16 00:18:09 2010 +0000
@@ -411,11 +411,7 @@
     (modify-syntax-entry (pop list) (pop list) table))
   table)
 
-(defvar sh-mode-syntax-table nil
-  "The syntax table to use for Shell-Script mode.
-This is buffer-local in every such buffer.")
-
-(defvar sh-mode-default-syntax-table
+(defvar sh-mode-syntax-table
   (sh-mode-syntax-table ()
 	?\# "<"
 	?\n ">#"
@@ -436,7 +432,8 @@
 	?= "."
 	?< "."
 	?> ".")
-  "Default syntax table for shell mode.")
+  "The syntax table to use for Shell-Script mode.
+This is buffer-local in every such buffer.")
 
 (defvar sh-mode-syntax-table-input
   '((sh . nil))
@@ -611,7 +608,7 @@
 (defvar sh-header-marker nil
   "When non-nil is the end of header for prepending by \\[sh-execute-region].
 That command is also used for setting this variable.")
-
+(make-variable-buffer-local 'sh-header-marker)
 
 (defcustom sh-beginning-of-command
   "\\([;({`|&]\\|\\`\\|[^\\]\n\\)[ \t]*\\([/~[:alnum:]:]\\)"
@@ -1533,57 +1530,41 @@
 
 If your shell gives error messages with line numbers, you can use \\[executable-interpret]
 with your script for an edit-interpret-debug cycle."
-  (make-local-variable 'skeleton-end-hook)
-  (make-local-variable 'paragraph-start)
-  (make-local-variable 'paragraph-separate)
-  (make-local-variable 'comment-start)
-  (make-local-variable 'comment-start-skip)
-  (make-local-variable 'require-final-newline)
-  (make-local-variable 'sh-header-marker)
   (make-local-variable 'sh-shell-file)
   (make-local-variable 'sh-shell)
-  (make-local-variable 'skeleton-pair-alist)
-  (make-local-variable 'skeleton-pair-filter-function)
-  (make-local-variable 'comint-dynamic-complete-functions)
-  (make-local-variable 'comint-prompt-regexp)
-  (make-local-variable 'font-lock-defaults)
-  (make-local-variable 'skeleton-filter-function)
-  (make-local-variable 'skeleton-newline-indent-rigidly)
-  (make-local-variable 'sh-shell-variables)
-  (make-local-variable 'sh-shell-variables-initialized)
-  (make-local-variable 'imenu-generic-expression)
-  (make-local-variable 'sh-indent-supported-here)
-  (make-local-variable 'skeleton-pair-default-alist)
-  (setq skeleton-pair-default-alist sh-skeleton-pair-default-alist)
-  (setq skeleton-end-hook (lambda ()
-			    (or (eolp) (newline) (indent-relative)))
-	paragraph-start (concat page-delimiter "\\|$")
-	paragraph-separate paragraph-start
-	comment-start "# "
-	comment-start-skip "#+[\t ]*"
-	local-abbrev-table sh-mode-abbrev-table
-	comint-dynamic-complete-functions sh-dynamic-complete-functions
-	;; we can't look if previous line ended with `\'
-	comint-prompt-regexp "^[ \t]*"
-	imenu-case-fold-search nil
-	font-lock-defaults
-	`((sh-font-lock-keywords
-	   sh-font-lock-keywords-1 sh-font-lock-keywords-2)
-	  nil nil
-	  ((?/ . "w") (?~ . "w") (?. . "w") (?- . "w") (?_ . "w")) nil
-	  (font-lock-syntactic-keywords . sh-font-lock-syntactic-keywords)
-	  (font-lock-syntactic-face-function
-	   . sh-font-lock-syntactic-face-function))
-	skeleton-pair-alist '((?` _ ?`))
-	skeleton-pair-filter-function 'sh-quoted-p
-	skeleton-further-elements '((< '(- (min sh-indentation
-						(current-column)))))
-	skeleton-filter-function 'sh-feature
-	skeleton-newline-indent-rigidly t
-	sh-indent-supported-here nil)
+
+  (set (make-local-variable 'skeleton-pair-default-alist)
+       sh-skeleton-pair-default-alist)
+  (set (make-local-variable 'skeleton-end-hook)
+       (lambda () (or (eolp) (newline) (indent-relative))))
+
+  (set (make-local-variable 'paragraph-start) (concat page-delimiter "\\|$"))
+  (set (make-local-variable 'paragraph-separate) paragraph-start)
+  (set (make-local-variable 'comment-start) "# ")
+  (set (make-local-variable 'comment-start-skip) "#+[\t ]*")
+  (set (make-local-variable 'local-abbrev-table) sh-mode-abbrev-table)
+  (set (make-local-variable 'comint-dynamic-complete-functions)
+       sh-dynamic-complete-functions)
+  ;; we can't look if previous line ended with `\'
+  (set (make-local-variable 'comint-prompt-regexp) "^[ \t]*")
+  (set (make-local-variable 'imenu-case-fold-search) nil)
+  (set (make-local-variable 'font-lock-defaults)
+       `((sh-font-lock-keywords
+          sh-font-lock-keywords-1 sh-font-lock-keywords-2)
+         nil nil
+         ((?/ . "w") (?~ . "w") (?. . "w") (?- . "w") (?_ . "w")) nil
+         (font-lock-syntactic-keywords . sh-font-lock-syntactic-keywords)
+         (font-lock-syntactic-face-function
+          . sh-font-lock-syntactic-face-function)))
+  (set (make-local-variable 'skeleton-pair-alist) '((?` _ ?`)))
+  (set (make-local-variable 'skeleton-pair-filter-function) 'sh-quoted-p)
+  (set (make-local-variable 'skeleton-further-elements)
+       '((< '(- (min sh-indentation (current-column))))))
+  (set (make-local-variable 'skeleton-filter-function) 'sh-feature)
+  (set (make-local-variable 'skeleton-newline-indent-rigidly) t)
+  (set (make-local-variable 'sh-indent-supported-here) nil)
   (set (make-local-variable 'defun-prompt-regexp)
        (concat "^\\(function[ \t]\\|[[:alnum:]]+[ \t]+()[ \t]+\\)"))
-  (set (make-local-variable 'parse-sexp-ignore-comments) t)
   ;; Parse or insert magic number for exec, and set all variables depending
   ;; on the shell thus determined.
   (sh-set-shell
@@ -1737,21 +1718,20 @@
 				  no-query-flag insert-flag)))
   (let ((tem (sh-feature sh-require-final-newline)))
     (if (eq tem t)
-	(setq require-final-newline mode-require-final-newline)))
-  (setq
-	mode-line-process (format "[%s]" sh-shell)
-	sh-shell-variables nil
-	sh-shell-variables-initialized nil
-	imenu-generic-expression (sh-feature sh-imenu-generic-expression))
-  (make-local-variable 'sh-mode-syntax-table)
+	(set (make-local-variable 'require-final-newline)
+             mode-require-final-newline)))
+  (setq mode-line-process (format "[%s]" sh-shell))
+  (set (make-local-variable 'sh-shell-variables) nil)
+  (set (make-local-variable 'sh-shell-variables-initialized) nil)
+  (set (make-local-variable 'imenu-generic-expression)
+       (sh-feature sh-imenu-generic-expression))
   (let ((tem (sh-feature sh-mode-syntax-table-input)))
-    (setq sh-mode-syntax-table
-	  (if tem (apply 'sh-mode-syntax-table tem)
-	    sh-mode-default-syntax-table)))
-  (set-syntax-table sh-mode-syntax-table)
+    (when tem
+      (set (make-local-variable 'sh-mode-syntax-table)
+           (apply 'sh-mode-syntax-table tem))
+      (set-syntax-table sh-mode-syntax-table)))
   (dolist (var (sh-feature sh-variables))
     (sh-remember-variable var))
-  (make-local-variable 'indent-line-function)
   (if (setq sh-indent-supported-here (sh-feature sh-indent-supported))
       (progn
 	(message "Setting up indent for shell type %s" sh-shell)
@@ -1764,7 +1744,7 @@
 	(message "setting up indent stuff")
 	;; sh-mode has already made indent-line-function local
 	;; but do it in case this is called before that.
-	(setq indent-line-function 'sh-indent-line)
+	(set (make-local-variable 'indent-line-function) 'sh-indent-line)
 	(if sh-make-vars-local
 	    (sh-make-vars-local))
 	(message "Indentation setup for shell type %s" sh-shell))
@@ -3463,20 +3443,15 @@
 nil means to return the best completion of STRING, or nil if there is none.
 t means to return a list of all possible completions of STRING.
 `lambda' means to return t if STRING is a valid completion as it stands."
-  (let ((sh-shell-variables
+  (let ((vars
 	 (with-current-buffer sh-add-buffer
 	   (or sh-shell-variables-initialized
 	       (sh-shell-initialize-variables))
 	   (nconc (mapcar (lambda (var)
-			    (let ((name
-				   (substring var 0 (string-match "=" var))))
-			      (cons name name)))
+                            (substring var 0 (string-match "=" var)))
 			  process-environment)
 		  sh-shell-variables))))
-    (case code
-      ((nil) (try-completion string sh-shell-variables predicate))
-      (lambda (test-completion string sh-shell-variables predicate))
-      (t (all-completions string sh-shell-variables predicate)))))
+    (complete-with-action code vars string predicate)))
 
 (defun sh-add (var delta)
   "Insert an addition of VAR and prefix DELTA for Bourne (type) shell."
--- a/lisp/progmodes/sql.el	Fri May 14 11:34:53 2010 +0000
+++ b/lisp/progmodes/sql.el	Sun May 16 00:18:09 2010 +0000
@@ -663,9 +663,9 @@
 
 Starts `sql-interactive-mode' after doing some setup.
 
-On Windows, \"sqlplus\" usually starts the sqlplus \"GUI\".  In order to
-start the sqlplus console, use \"plus33\" or something similar.  You
-will find the file in your Orant\\bin directory."
+On Windows, \"sqlplus\" usually starts the sqlplus \"GUI\".  In order
+to start the sqlplus console, use \"plus33\" or something similar.
+You will find the file in your Orant\\bin directory."
   :type 'file
   :group 'SQL)
 
@@ -690,7 +690,7 @@
 
 When non-nil, Emacs will scan text sent to sqlplus and prompt
 for replacement text for & placeholders as sqlplus does.  This
-is needed on Windows where sqlplus output is buffer and the
+is needed on Windows where sqlplus output is buffered and the
 prompts are not shown until after the text is entered.
 
 You will probably want to issue the following command in sqlplus
@@ -772,10 +772,10 @@
   :version "24.1"
   :group 'SQL)
 
-;; Customization for SyBase
+;; Customization for Sybase
 
 (defcustom sql-sybase-program "isql"
-  "Command to start isql by SyBase.
+  "Command to start isql by Sybase.
 
 Starts `sql-interactive-mode' after doing some setup."
   :type 'file
@@ -2042,7 +2042,7 @@
       (message "`%s' is not a known product; use `sql-add-product' to add it first." product))))
 
 (defun sql-product-font-lock (keywords-only imenu)
-  "Configures font-lock and imenu with product-specific settings.
+  "Configure font-lock and imenu with product-specific settings.
 
 The KEYWORDS-ONLY flag is passed to font-lock to specify whether
 only keywords should be hilighted and syntactic hilighting
@@ -2098,7 +2098,7 @@
 (defun sql-add-product-keywords (product keywords &optional append)
   "Add highlighting KEYWORDS for SQL PRODUCT.
 
-PRODUCT should be a symbol, the name of a sql product, such as
+PRODUCT should be a symbol, the name of a SQL product, such as
 `oracle'.  KEYWORDS should be a list; see the variable
 `font-lock-keywords'.  By default they are added at the beginning
 of the current highlighting list.  If optional argument APPEND is
@@ -2131,7 +2131,7 @@
 ;;; Functions to switch highlighting
 
 (defun sql-highlight-product ()
-  "Turns on the font highlighting for the SQL product selected."
+  "Turn on the font highlighting for the SQL product selected."
   (when (derived-mode-p 'sql-mode)
     ;; Setup font-lock
     (sql-product-font-lock nil t)
@@ -2141,7 +2141,7 @@
 				       (symbol-name sql-product)) "]"))))
 
 (defun sql-set-product (product)
-  "Set `sql-product' to product and enable appropriate highlighting."
+  "Set `sql-product' to PRODUCT and enable appropriate highlighting."
   (interactive
    (list (completing-read "SQL product: "
                           (mapcar (lambda (info) (symbol-name (car info)))
@@ -2416,7 +2416,7 @@
       (message "Current SQLi buffer is %s." (buffer-name sql-buffer)))))
 
 (defun sql-make-alternate-buffer-name ()
-  "Returns a string that can be used to rename a SQLi buffer.
+  "Return a string that can be used to rename a SQLi buffer.
 
 This is used to set `sql-alternate-buffer-name' within
 `sql-interactive-mode'."
@@ -2475,7 +2475,7 @@
 
 (defun sql-placeholders-filter (string)
   "Replace placeholders in STRING.
-Placeholders are words starting with and ampersand like &this."
+Placeholders are words starting with an ampersand like &this."
 
   (when sql-oracle-scan-on
     (while (string-match "&\\(\\sw+\\)" string)
@@ -2489,7 +2489,7 @@
 ;; Using DB2 interactively, newlines must be escaped with " \".
 ;; The space before the backslash is relevant.
 (defun sql-escape-newlines-filter (string)
-  "Escapes newlines in STRING.
+  "Escape newlines in STRING.
 Every newline in STRING will be preceded with a space and a backslash."
   (let ((result "") (start 0) mb me)
     (while (string-match "\n" string start)
@@ -2508,7 +2508,7 @@
 ;;; Input sender for SQLi buffers
 
 (defun sql-input-sender (proc string)
-  "Sends STRING to PROC after applying filters."
+  "Send STRING to PROC after applying filters."
 
   (let* ((product (with-current-buffer (process-buffer proc) sql-product))
 	 (filter  (sql-get-product-feature product :input-filter)))
@@ -2575,7 +2575,7 @@
   (sql-send-region (point-min) (point-max)))
 
 (defun sql-send-magic-terminator (buf str terminator)
-  "Sends TERMINATOR to buffer BUF if its not present in STR."
+  "Send TERMINATOR to buffer BUF if its not present in STR."
   (let (pat term)
     ;; If flag is merely on(t), get product-specific terminator
     (if (eq terminator t)
@@ -2961,7 +2961,7 @@
 
 ;;;###autoload
 (defun sql-sybase ()
-  "Run isql by SyBase as an inferior process.
+  "Run isql by Sybase as an inferior process.
 
 If buffer `*SQL*' exists but no process is running, make a new process.
 If buffer exists and a process is running, just switch to buffer
--- a/lisp/simple.el	Fri May 14 11:34:53 2010 +0000
+++ b/lisp/simple.el	Sun May 16 00:18:09 2010 +0000
@@ -422,6 +422,13 @@
   "Parent major mode from which special major modes should inherit."
   (setq buffer-read-only t))
 
+;; Major mode meant to be the parent of programming modes.
+
+(define-derived-mode prog-mode fundamental-mode "Prog"
+  "Major mode for editing programming language source code."
+  (set (make-local-variable 'require-final-newline) mode-require-final-newline)
+  (set (make-local-variable 'parse-sexp-ignore-comments) t))
+
 ;; Making and deleting lines.
 
 (defvar hard-newline (propertize "\n" 'hard t 'rear-nonsticky '(hard))
--- a/lisp/subr.el	Fri May 14 11:34:53 2010 +0000
+++ b/lisp/subr.el	Sun May 16 00:18:09 2010 +0000
@@ -3804,5 +3804,30 @@
 			  (prin1-to-string (make-hash-table)))))
   (provide 'hashtable-print-readable))
 
+;; Moving with arrows in bidi-sensitive direction.
+(defun right-arrow-command (&optional n)
+  "Move point N characters to the right (to the left if N is negative).
+On reaching beginning or end of buffer, stop and signal error.
+
+Depending on the bidirectional context, this may move either forward
+or backward in the buffer.  This is in contrast with \\[forward-char]
+and \\[backward-char], which see."
+  (interactive "^p")
+  (if (eq (current-bidi-paragraph-direction) 'left-to-right)
+      (forward-char n)
+    (backward-char n)))
+
+(defun left-arrow-command ( &optional n)
+  "Move point N characters to the left (to the right if N is negative).
+On reaching beginning or end of buffer, stop and signal error.
+
+Depending on the bidirectional context, this may move either backward
+or forward in the buffer.  This is in contrast with \\[backward-char]
+and \\[forward-char], which see."
+  (interactive "^p")
+  (if (eq (current-bidi-paragraph-direction) 'left-to-right)
+      (backward-char n)
+    (forward-char n)))
+
 ;; arch-tag: f7e0e6e5-70aa-4897-ae72-7a3511ec40bc
 ;;; subr.el ends here
--- a/lisp/version.el	Fri May 14 11:34:53 2010 +0000
+++ b/lisp/version.el	Sun May 16 00:18:09 2010 +0000
@@ -29,12 +29,6 @@
 
 ;;; Code:
 
-(defconst emacs-copyright "Copyright (C) 2010 Free Software Foundation, Inc." "\
-Short copyright string for this version of Emacs.")
-
-(defconst emacs-version "24.0.50" "\
-Version numbers of this version of Emacs.")
-
 (defconst emacs-major-version (progn (string-match "^[0-9]+" emacs-version) (string-to-number (match-string 0 emacs-version))) "\
 Major version number of this version of Emacs.
 This variable first existed in version 19.23.")
--- a/lisp/w32-fns.el	Fri May 14 11:34:53 2010 +0000
+++ b/lisp/w32-fns.el	Sun May 16 00:18:09 2010 +0000
@@ -253,15 +253,16 @@
 ;;	    (setq source-directory (file-name-as-directory
 ;;				     (expand-file-name ".." exec-directory)))))
 
-(defun convert-standard-filename (filename)
-  "Convert a standard file's name to something suitable for the current OS.
+(defun w32-convert-standard-filename (filename)
+  "Convert a standard file's name to something suitable for the MS-Windows.
 This means to guarantee valid names and perhaps to canonicalize
 certain patterns.
 
-On Windows and DOS, replace invalid characters.  On DOS, make
-sure to obey the 8.3 limitations.  On Windows, turn Cygwin names
-into native names, and also turn slashes into backslashes if the
-shell requires it (see `w32-shell-dos-semantics')."
+This function is called by `convert-standard-filename'.
+
+Replace invalid characters and turn Cygwin names into native
+names, and also turn slashes into backslashes if the shell
+requires it (see `w32-shell-dos-semantics')."
   (save-match-data
     (let ((name
 	   (if (string-match "\\`/cygdrive/\\([a-zA-Z]\\)/" filename)
--- a/lwlib/ChangeLog	Fri May 14 11:34:53 2010 +0000
+++ b/lwlib/ChangeLog	Sun May 16 00:18:09 2010 +0000
@@ -1,3 +1,7 @@
+2010-05-15  Glenn Morris  <rgm@gnu.org>
+
+	* Makefile.in (mostlyclean): Remove references to non-existent files.
+
 2010-05-13  Jan Djärv  <jan.h.d@swipnet.se>
 
 	* lwlib-Xaw.c (make_dialog): Remove extra arg to XtVaGetSubresources.
--- a/lwlib/Makefile.in	Fri May 14 11:34:53 2010 +0000
+++ b/lwlib/Makefile.in	Sun May 16 00:18:09 2010 +0000
@@ -75,7 +75,7 @@
 xlwmenu.o: xlwmenu.c xlwmenu.h lwlib.h xlwmenuP.h
 
 mostlyclean:
-	$(RM) *.o core errs ,* *.a .emacs_* make.log MakeOut \#*
+	$(RM) *.o core liblw.a \#*
 
 clean: mostlyclean
 distclean: clean
--- a/msdos/ChangeLog	Fri May 14 11:34:53 2010 +0000
+++ b/msdos/ChangeLog	Sun May 16 00:18:09 2010 +0000
@@ -1,3 +1,33 @@
+2010-05-15  Glenn Morris  <rgm@gnu.org>
+
+	* sed1v2.inp (LIBXMENU): Edit to empty.
+	* sed1x.inp (LIBXMENU): Expect empty initial value.
+
+	* sed1v2.inp (OLDXMENU): Edit to empty.
+	* sed1x.inp (OLDXMENU): Expect empty initial value.
+
+	* sed1v2.inp (LIBX_OTHER): Edit to empty.
+	* sed1x.inp (LIBX_OTHER): Expect empty initial value.
+
+	* sed1v2.inp (FONT_OBJ): Edit to empty for non-X case.
+	* sed1x.inp (FONT_OBJ): Edit to xfont.o for X case.
+
+2010-05-15  Eli Zaretskii  <eliz@gnu.org>
+
+	* sed3v2.inp (INSTALLABLES): Edit out extra ${EXEEXT} after
+	"emacsclient".
+	(emacsserver, timer, wakeup): Remove edit-out commands.
+
+	* sed1v2.inp (MSDOS_OBJ): Add w16select.o.
+	(TERMCAP_OBJ): Add termcap.o.
+
+2010-05-15  Glenn Morris  <rgm@gnu.org>
+
+	* sed1v2.inp (OLDXMENU_TARGET): Edit to empty.
+	* sed1x.inp (OLDXMENU_TARGET): Edit to really-oldxmenu.
+
+	* sed1v2.inp (LIBXT_OTHER): Edit to empty.
+
 2010-05-14  Glenn Morris  <rgm@gnu.org>
 
 	* sed1v2.inp (ns_appdir, ns_appbindir, ns_appsrc): Edit to empty.
--- a/msdos/sed1v2.inp	Fri May 14 11:34:53 2010 +0000
+++ b/msdos/sed1v2.inp	Sun May 16 00:18:09 2010 +0000
@@ -77,10 +77,12 @@
 /^GCONF_LIBS *=/s/@GCONF_LIBS@//
 /^GTK_OBJ *=/s/@GTK_OBJ@//
 /^LIBS_TERMCAP *=/s/@LIBS_TERMCAP@//
-/^TERMCAP_OBJ *=/s/@TERMCAP_OBJ@/tparam.o/
+/^TERMCAP_OBJ *=/s/@TERMCAP_OBJ@/termcap.o tparam.o/
 /^LIBXMU *=/s/@LIBXMU@//
 /^LIBXSM *=/s/@LIBXSM@//
 /^LIBXTR6 *=/s/@LIBXTR6@//
+/^LIBXT_OTHER *=/s/@LIBXT_OTHER@//
+/^OLDXMENU_TARGET *=/s/@OLDXMENU_TARGET@//
 /^XOBJ *=/s/@XOBJ@//
 /^TOOLKIT_LIBW *=/s/@TOOLKIT_LIBW@//
 /^LIBSOUND *=/s/@LIBSOUND@//
@@ -89,7 +91,7 @@
 /^RSVG_CFLAGS *=/s/@RSVG_CFLAGS@//
 /^WIDGET_OBJ *=/s/@WIDGET_OBJ@//
 /^CYGWIN_OBJ *=/s/@CYGWIN_OBJ@//
-/^MSDOS_OBJ *=/s/= */= dosfns.o msdos.o/
+/^MSDOS_OBJ *=/s/= */= dosfns.o msdos.o w16select.o/
 /^MSDOS_SUPPORT *=/s/= */= $(MSDOS_SUPPORT_REAL)/
 /^ns_appdir *=/s/@ns_appdir@//
 /^ns_appbindir *=/s/@ns_appbindir@//
@@ -104,12 +106,15 @@
 /^START_FILES *=/s/@START_FILES@//
 /^OTHER_FILES *=/s/@OTHER_FILES@//
 /^XMENU_OBJ *=/s/@XMENU_OBJ@/xmenu.o/
-/^FONT_OBJ *=/s/@FONT_OBJ@/xfont.o/
+/^FONT_OBJ *=/s/@FONT_OBJ@//
 /^MOUSE_SUPPORT *=/s/@MOUSE_SUPPORT@/$(REAL_MOUSE_SUPPORT)/
 /^TOOLTIP_SUPPORT *=/s/@TOOLTIP_SUPPORT@//
 /^WINDOW_SUPPORT *=/s/@WINDOW_SUPPORT@//
 /^LIBGPM *=/s/@LIBGPM@//
 /^EXEEXT *=/s/@EXEEXT@/.exe/
+/^OLDXMENU *=/s/@OLDXMENU@//
+/^LIBXMENU *=/s/@LIBXMENU@//
+/^LIBX_OTHER *=/s/@LIBX_OTHER@//
 /^PRE_ALLOC_OBJ *=/s/@PRE_ALLOC_OBJ@/lastfile.o/
 /^POST_ALLOC_OBJ *=/s/@POST_ALLOC_OBJ@/$(vmlimitobj)/
 /^UNEXEC_OBJ *=/s/@unexec@/unexec.o/
--- a/msdos/sed1x.inp	Fri May 14 11:34:53 2010 +0000
+++ b/msdos/sed1x.inp	Sun May 16 00:18:09 2010 +0000
@@ -4,11 +4,13 @@
 s!^	cd \${oldXMenudir}; \${MAKE}.*$!	${MAKE} -C ${oldXMenudir}.!
 s!^	@true *$!	@rem!
 s/DOC/DOC-X/g
-/^OLDXMENU *=/s!@OLDXMENU@!${oldXMenudir}libXMenu11.a!
-/^LIBXMENU *=/s!@LIBXMENU@!${OLDXMENU}!
-/^LIBX_OTHER *=/s!@LIBX_OTHER@!${LIBXT} ${LIBX_EXTRA}!
+/^OLDXMENU *=/s!= *!= ${oldXMenudir}libXMenu11.a!
+/^LIBXMENU *=/s!= *!= ${OLDXMENU}!
+/^LIBX_OTHER *=/s!= *!= ${LIBXT} ${LIBX_EXTRA}!
+/^OLDXMENU_TARGET *=/s!= *!= really-oldxmenu!
 /^LIBS_SYSTEM *=/s!= *!= -lxext -lsys!
 /^MSDOS_X_OBJ *=/s!= *!= w16select.o termcap.o!
+/^FONT_OBJ *=/s!= *!= xfont.o!
 /^TOOLTIP_SUPPORT *=/s!= *!= ${lispsource}tooltip.elc!
 /^WINDOW_SUPPORT *=/s!= *!= $(BASE_WINDOW_SUPPORT) $(X_WINDOW_SUPPORT)!
 /^temacs *:/s!OLDXMENU!LIBXMENU!
--- a/msdos/sed3v2.inp	Fri May 14 11:34:53 2010 +0000
+++ b/msdos/sed3v2.inp	Sun May 16 00:18:09 2010 +0000
@@ -44,11 +44,10 @@
 /^EXEEXT *=/s!@EXEEXT@!!
 /^GETOPT_H *=/s!@GETOPT_H@!getopt.h!
 /^GETOPTOBJS *=/s!@GETOPTOBJS@!getopt.o getopt1.o!
-/^INSTALLABLES/s/emacsclient *//
+/^INSTALLABLES/s/emacsclient[^ ]* *//
 s!^	\./!	!
-/^UTILITIES=/s/ wakeup//
-/^UTILITIES=/s/ movemail//
-/^UTILITIES=/s/ emacsserver//
-/^UTILITIES=/s/ timer//
+/^UTILITIES *=/,/^$/{
+  s/movemail[^ ]* *//
+}
 
 # arch-tag: 16f3be18-a45b-496c-b19c-e43840359de8
--- a/src/ChangeLog	Fri May 14 11:34:53 2010 +0000
+++ b/src/ChangeLog	Sun May 16 00:18:09 2010 +0000
@@ -1,3 +1,70 @@
+2010-05-16  Glenn Morris  <rgm@gnu.org>
+
+	* Makefile.in (LIBXT): Always define.
+
+2010-05-15  Glenn Morris  <rgm@gnu.org>
+
+	* Makefile.in (OLDXMENU, LIBXMENU, LIBX_OTHER): Always define.
+
+	* Makefile.in (FONT_DRIVERS): Remove, replace with $FONT_OBJ.
+	(obj, SOME_MACHINE_OBJECTS): Use $FONT_OBJ.
+
+2010-05-15  Ken Raeburn  <raeburn@raeburn.org>
+
+	* lisp.h (XFLOAT_DATA): Use "0?x:x" to generate an
+	rvalue. (bug#5916)
+	(LISP_MAKE_RVALUE) [!USE_LISP_UNION_TYPE && !__GNUC__]: Likewise.
+
+	* emacs.c (main): Initialize initial-environment and
+	process-environment before generating from env, not after.
+
+	Handle --version reasonably in CANNOT_DUMP configuration.
+	* emacs.c (emacs_version, emacs_copyright): New string variables.
+	(Vemacs_version, Vemacs_copyright): New Lisp_Object variables.
+	(syms_of_emacs): Defvar them, and initialize them from the C
+	string variables.
+	(main): If initialization hasn't been done, print initial version
+	info from the C strings, instead of starting an interactive session.
+
+2010-05-15  Eli Zaretskii  <eliz@gnu.org>
+
+	* bidi.c (bidi_paragraph_init): Don't leave alone garbage values
+	of bidi_it->paragraph_dir.  Call bidi_initialize if needed.
+	(bidi_paragraph_init): Remove redundant assertion that we are at
+	the beginning of a line after call to bidi_find_paragraph_start.
+
+	* xdisp.c (Fcurrent_bidi_paragraph_direction): New function.
+	(syms_of_xdisp): Defsubr it.
+
+	* Makefile.in: Fix MSDOS-related comments.
+
+2010-05-15  Glenn Morris  <rgm@gnu.org>
+
+	* Makefile.in (OLDXMENU_TARGET): New, set by configure.
+	(really-lwlib, really-oldXMenu): Always define.
+	($OLDXMENU): Depend on $OLDXMENU_TARGET.
+
+	* Makefile.in: Simplify cpp conditional.
+
+	* Makefile.in (${ns_appdir}): Simplify using umask.
+
+	* Makefile.in (${ns_appdir}): Remove references to CVS-related files.
+
+2010-05-14  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* eval.c (specbind): Remove left-over duplicate test.
+	Disallow let-binding frame-local vars.  Add comment.
+
+2010-05-14  Eli Zaretskii  <eliz@gnu.org>
+
+	Make the cache of bidi iterator states dynamically allocated.
+	* bidi.c (bidi_cache_shrink): New function.
+	(bidi_init_it): Call it.
+	(bidi_cache_iterator_state): Enlarge the cache if needed.
+
+	* bidi.c (bidi_move_to_visually_next): Rename from
+	bidi_get_next_char_visually.  All callers changed.
+
 2010-05-14  Kenichi Handa  <handa@m17n.org>
 
 	* dispextern.h (struct composition_it): New member reversed_p.
@@ -8,8 +75,8 @@
 	Set CMP_IT->reversed_p.
 	(composition_update_it): Pay attention to CMP_IT->reversed_p.
 
-	* xdisp.c (set_iterator_to_next): Call
-	composition_compute_stop_pos with negative ENDPOS if we are
+	* xdisp.c (set_iterator_to_next):
+	Call composition_compute_stop_pos with negative ENDPOS if we are
 	scanning backward.  Call composition_compute_stop_pos if scan
 	direction is changed.
 	(next_element_from_buffer): Call composition_compute_stop_pos with
--- a/src/Makefile.in	Fri May 14 11:34:53 2010 +0000
+++ b/src/Makefile.in	Sun May 16 00:18:09 2010 +0000
@@ -65,6 +65,7 @@
 
 bootstrap_exe = ${abs_builddir}/bootstrap-emacs${EXEEXT}
 
+## ns-app if HAVE_NS, else empty.
 OTHER_FILES = @OTHER_FILES@
 
 CRT_DIR=@CRT_DIR@
@@ -167,11 +168,28 @@
 ## Only used if HAVE_X_WINDOWS.
 LIBXT_OTHER=@LIBXT_OTHER@
 
+## Only used if HAVE_X11 && !USE_GTK.
+## really-lwlib if USE_X_TOOLKIT, else really-oldxmenu.
+OLDXMENU_TARGET=@OLDXMENU_TARGET@
+
+## If !HAVE_X11 || USE_GTK, empty.
+## Else if USE_X_TOOLKIT, ${lwlibdir}liblw.a.
+## Else ${oldXMenudir}libXMenu11.a.
+OLDXMENU=@OLDXMENU@
+
+## If !HAVE_X11 && HAVE_X_WINDOWS, -lXMenu (this case no longer possible).
+## Else if !HAVE_X11 || USE_GTK, empty.
+## Else $(OLDXMENU).
+LIBXMENU=@LIBXMENU@
+
 XMENU_OBJ=@XMENU_OBJ@
 XOBJ=@XOBJ@
 
 TOOLKIT_LIBW=@TOOLKIT_LIBW@
 
+## Only used if HAVE_X11, in LIBX_OTHER.
+LIBXT=$(TOOLKIT_LIBW) $(LIBXT_OTHER)
+
 LIBSOUND= @LIBSOUND@
 CFLAGS_SOUND= @CFLAGS_SOUND@
 
@@ -184,7 +202,7 @@
 ## sheap.o if CYGWIN, otherwise empty.
 CYGWIN_OBJ=@CYGWIN_OBJ@
 
-## dosfns.o msdos.o if MSDOS.
+## dosfns.o msdos.o w16select.o if MSDOS.
 MSDOS_OBJ =
 ## w16select.o termcap.o if MSDOS && HAVE_X_WINDOWS.
 MSDOS_X_OBJ =
@@ -203,7 +221,10 @@
 GNU_OBJC_CFLAGS=@GNU_OBJC_CFLAGS@
 GNUSTEP_SYSTEM_LIBRARIES=@GNUSTEP_SYSTEM_LIBRARIES@
 
-## Only used if HAVE_X_WINDOWS.
+## Empty if !HAVE_X_WINDOWS
+## xfont.o ftfont.o xftfont.o ftxfont.o if HAVE_XFT
+## xfont.o ftfont.o ftxfont.o if HAVE_FREETYPE
+## else xfont.o
 FONT_OBJ=@FONT_OBJ@
 
 ## Used if HAVE_MOUSE.
@@ -287,14 +308,11 @@
 	$(CC) -c $(CPPFLAGS) $(ALL_OBJC_CFLAGS) $<
 
 #ifdef HAVE_X_WINDOWS
-OLDXMENU=@OLDXMENU@
-LIBXMENU=@LIBXMENU@
-LIBXT=$(TOOLKIT_LIBW) $(LIBXT_OTHER)
 LIBX_BASE=$(LIBXMENU) $(LD_SWITCH_X_SITE)
-LIBX_OTHER=@LIBX_OTHER@
-FONT_DRIVERS=$(FONT_OBJ)
 #endif /* HAVE_X_WINDOWS */
 
+/* If HAVE_X11, $(LIBXT) $(LIBX_EXTRA), else empty.  */
+LIBX_OTHER=@LIBX_OTHER@
 
 /* A macro which other sections of Makefile can redefine to munge the
    flags before they are passed to LD.  This is helpful if you have
@@ -351,7 +369,7 @@
 	process.o callproc.o \
 	region-cache.o sound.o atimer.o \
 	doprnt.o strftime.o intervals.o textprop.o composite.o md5.o \
-	$(MSDOS_OBJ) $(MSDOS_X_OBJ) $(NS_OBJ) $(CYGWIN_OBJ) $(FONT_DRIVERS)
+	$(MSDOS_OBJ) $(MSDOS_X_OBJ) $(NS_OBJ) $(CYGWIN_OBJ) $(FONT_OBJ)
 
 /* Object files used on some machine or other.
    These go in the DOC file on all machines in case they are needed.  */
@@ -360,7 +378,7 @@
   fontset.o dbusbind.o \
   nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o \
   w32.o w32console.o w32fns.o w32heap.o w32inevt.o \
-  w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o $(FONT_DRIVERS)
+  w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o $(FONT_OBJ)
 
 gmallocobj =
 rallocobj =
@@ -611,6 +629,7 @@
 
 all: emacs${EXEEXT} $(OTHER_FILES)
 
+/* Does anyone ever pay attention to the load-path-shadows output here?  */
 emacs${EXEEXT}: temacs${EXEEXT} ${etc}DOC ${lisp}
 #ifdef CANNOT_DUMP
 	rm -f emacs${EXEEXT}
@@ -664,8 +683,23 @@
 prefix-args${EXEEXT}: prefix-args.o $(config_h)
 	$(CC) $(LDFLAGS) prefix-args.o -o prefix-args
 
-#if defined (HAVE_X_WINDOWS) && defined (HAVE_X11) && defined (HAVE_MENUS) && ! defined (USE_GTK)
+
+/* Only (possibly) used if HAVE_X11 && !USE_GTK, but no harm in always
+   defining.  */
+really-lwlib:
+	cd ${lwlibdir}; ${MAKE} ${MFLAGS} \
+    CC='${CC}' CFLAGS='${CFLAGS}' MAKE='${MAKE}'
+	@true  /* make -t should not create really-lwlib.  */
+.PHONY: really-lwlib
 
+really-oldXMenu:
+	cd ${oldXMenudir}; ${MAKE} ${MFLAGS} \
+    CC='${CC}' CFLAGS='${CFLAGS}' MAKE='${MAKE}'
+	@true  /* make -t should not create really-oldXMenu.  */
+.PHONY: really-oldXMenu
+
+/* HAVE_X11 implies HAVE_X_WINDOWS and HAVE_MENUS.  */
+#if defined (HAVE_X11) && ! defined (USE_GTK)
 /* We use stamp-xmenu with these two deps to both ensure that lwlib
    gets remade based on its dependencies in its own makefile,
    and remake temacs if lwlib gets changed by this.  */
@@ -674,29 +708,13 @@
 /* Supply an ordering for parallel make.  */
 ../src/$(OLDXMENU): ${OLDXMENU}
 
-#ifdef USE_X_TOOLKIT
-$(OLDXMENU): really-lwlib
+$(OLDXMENU): $(OLDXMENU_TARGET)
 
-really-lwlib:
-	cd ${lwlibdir}; ${MAKE} ${MFLAGS} \
-    CC='${CC}' CFLAGS='${CFLAGS}' MAKE='${MAKE}'
-	@true  /* make -t should not create really-lwlib.  */
-.PHONY: really-lwlib
-#else /* not USE_X_TOOLKIT */
-$(OLDXMENU): really-oldXMenu
-
-really-oldXMenu:
-	cd ${oldXMenudir}; ${MAKE} ${MFLAGS} \
-    CC='${CC}' CFLAGS='${CFLAGS}' MAKE='${MAKE}'
-	@true  /* make -t should not create really-oldXMenu.  */
-.PHONY: really-oldXMenu
-#endif /* not USE_X_TOOLKIT */
-#else /* not (HAVE_X_WINDOWS && HAVE_X11 && HAVE_MENUS && ! USE_GTK) */
-
+#else /* !HAVE_X11 || USE_GTK */ 
 /* We don''t really need this, but satisfy the dependency.  */
 stamp-oldxmenu:
 	touch stamp-oldxmenu
-#endif /* not (HAVE_X_WINDOWS && HAVE_X11 && HAVE_MENUS && ! USE_GTK) */
+#endif /* HAVE_X11 && !USE_GTK */
 
 ../config.status:: epaths.in
 	@echo "The file epaths.h needs to be set up from epaths.in."
@@ -972,18 +990,13 @@
 ${ns_appdir}: ${ns_appsrc}
 	rm -fr ${ns_appdir}
 	mkdir -p ${ns_appdir}
-	( cd ${ns_appsrc} ; tar cfh - . ) | ( cd ${ns_appdir} ; tar xf - )
-	( cd ${ns_appdir} ; for subdir in `find . -type d ! -name CVS -print` ; do \
-		chmod a+rx $${subdir} ; \
-		rm -rf $${subdir}/CVS ; \
-		rm -f  $${subdir}/.cvsignore ; done ; )
+	( cd ${ns_appsrc} ; tar cfh - . ) | ( cd ${ns_appdir} ; umask 022; tar xf - )
 
 ${ns_appbindir}Emacs: emacs${EXEEXT}
 	mkdir -p ${ns_appbindir}
 	cp -f emacs${EXEEXT} ${ns_appbindir}Emacs
 
 ns-app: ${ns_appdir} ${ns_appbindir}Emacs
-
 #endif /* HAVE_NS */
 
 mostlyclean:
--- a/src/bidi.c	Fri May 14 11:34:53 2010 +0000
+++ b/src/bidi.c	Sun May 16 00:18:09 2010 +0000
@@ -26,13 +26,13 @@
    designed to be called once for every character in the buffer or
    string.
 
-   The main entry point is bidi_get_next_char_visually.  Each time it
+   The main entry point is bidi_move_to_visually_next.  Each time it
    is called, it finds the next character in the visual order, and
    returns its information in a special structure.  The caller is then
    expected to process this character for display or any other
-   purposes, and call bidi_get_next_char_visually for the next
-   character.  See the comments in bidi_get_next_char_visually for
-   more details about its algorithm that finds the next visual-order
+   purposes, and call bidi_move_to_visually_next for the next
+   character.  See the comments in bidi_move_to_visually_next for more
+   details about its algorithm that finds the next visual-order
    character by resolving their levels on the fly.
 
    The two other entry points are bidi_paragraph_init and
@@ -540,9 +540,11 @@
 
 /* Caching the bidi iterator states.  */
 
-static struct bidi_it bidi_cache[1000]; /* FIXME: make this dynamically allocated! */
-static int bidi_cache_idx;
-static int bidi_cache_last_idx;
+#define BIDI_CACHE_CHUNK 200
+static struct bidi_it *bidi_cache;
+static size_t bidi_cache_size = 0;
+static int bidi_cache_idx;	/* next unused cache slot */
+static int bidi_cache_last_idx;	/* slot of last cache hit */
 
 static INLINE void
 bidi_cache_reset (void)
@@ -552,6 +554,17 @@
 }
 
 static INLINE void
+bidi_cache_shrink (void)
+{
+  if (bidi_cache_size > BIDI_CACHE_CHUNK)
+    {
+      bidi_cache_size = BIDI_CACHE_CHUNK * sizeof (struct bidi_it);
+      bidi_cache = (struct bidi_it *) xrealloc (bidi_cache, bidi_cache_size);
+    }
+  bidi_cache_reset ();
+}
+
+static INLINE void
 bidi_cache_fetch_state (int idx, struct bidi_it *bidi_it)
 {
   int current_scan_dir = bidi_it->scan_dir;
@@ -672,9 +685,13 @@
   if (idx < 0)
     {
       idx = bidi_cache_idx;
-      /* Don't overrun the cache limit.  */
-      if (idx > sizeof (bidi_cache) / sizeof (bidi_cache[0]) - 1)
-	abort ();
+      /* Enlarge the cache as needed.  */
+      if (idx >= bidi_cache_size)
+	{
+	  bidi_cache_size += BIDI_CACHE_CHUNK * sizeof (struct bidi_it);
+	  bidi_cache =
+	    (struct bidi_it *) xrealloc (bidi_cache, bidi_cache_size);
+	}
       /* Character positions should correspond to cache positions 1:1.
 	 If we are outside the range of cached positions, the cache is
 	 useless and must be reset.  */
@@ -873,6 +890,9 @@
       EMACS_INT pos;
       bidi_type_t type;
 
+      if (!bidi_initialized)
+	bidi_initialize ();
+
       /* If we are inside a paragraph separator, we are just waiting
 	 for the separator to be exhausted; use the previous paragraph
 	 direction.  But don't do that if we have been just reseated,
@@ -896,11 +916,6 @@
 	 middle of it.  Find where this paragraph starts.  */
       bytepos = bidi_find_paragraph_start (pos, bytepos);
 
-      /* We should always be at the beginning of a new line at this
-	 point.  */
-      if (!(bytepos == BEGV_BYTE || FETCH_CHAR (bytepos - 1) == '\n'))
-	abort ();
-
       bidi_it->separator_limit = -1;
       bidi_it->new_paragraph = 0;
       ch = FETCH_CHAR (bytepos);
@@ -940,7 +955,7 @@
   /* Contrary to UAX#9 clause P3, we only default the paragraph
      direction to L2R if we have no previous usable paragraph
      direction.  */
-  if (bidi_it->paragraph_dir == NEUTRAL_DIR)
+  if (bidi_it->paragraph_dir != L2R && bidi_it->paragraph_dir != R2L)
     bidi_it->paragraph_dir = L2R; /* P3 and ``higher protocols'' */
   if (bidi_it->paragraph_dir == R2L)
     bidi_it->level_stack[0].level = 1;
@@ -990,6 +1005,7 @@
     bidi_it->prev_for_neutral.type_after_w1 =
     bidi_it->prev_for_neutral.orig_type = UNKNOWN_BT;
   bidi_it->sor = L2R;	 /* FIXME: should it be user-selectable? */
+  bidi_cache_shrink ();
 }
 
 /* Push the current embedding level and override status; reset the
@@ -1876,7 +1892,7 @@
 }
 
 void
-bidi_get_next_char_visually (struct bidi_it *bidi_it)
+bidi_move_to_visually_next (struct bidi_it *bidi_it)
 {
   int old_level, new_level, next_level;
   struct bidi_it sentinel;
--- a/src/cmds.c	Fri May 14 11:34:53 2010 +0000
+++ b/src/cmds.c	Sun May 16 00:18:09 2010 +0000
@@ -57,8 +57,12 @@
 }
 
 DEFUN ("forward-char", Fforward_char, Sforward_char, 0, 1, "^p",
-       doc: /* Move point right N characters (left if N is negative).
-On reaching end of buffer, stop and signal error.  */)
+       doc: /* Move point N characters forward (backward if N is negative).
+On reaching end or beginning of buffer, stop and signal error.
+
+Depending on the bidirectional context, the movement may be to the
+right or to the left on the screen.  This is in contrast with
+\\[right-arrow-command], which see.  */)
      (n)
      Lisp_Object n;
 {
@@ -93,8 +97,12 @@
 }
 
 DEFUN ("backward-char", Fbackward_char, Sbackward_char, 0, 1, "^p",
-       doc: /* Move point left N characters (right if N is negative).
-On attempt to pass beginning or end of buffer, stop and signal error.  */)
+       doc: /* Move point N characters backward (forward if N is negative).
+On attempt to pass beginning or end of buffer, stop and signal error.
+
+Depending on the bidirectional context, the movement may be to the
+right or to the left on the screen.  This is in contrast with
+\\[left-arrow-command], which see.  */)
      (n)
      Lisp_Object n;
 {
--- a/src/composite.c	Fri May 14 11:34:53 2010 +0000
+++ b/src/composite.c	Sun May 16 00:18:09 2010 +0000
@@ -1150,13 +1150,13 @@
       /* Search backward for a pattern that may be composed and the
 	 position of (possibly) the last character of the match is
 	 closest to (but not after) START.  The reason for the last
-	 character is that set_iterator_to_next works in reverse order
-	 and, thus we must stop at the last character for composition
+	 character is that set_iterator_to_next works in reverse order,
+	 and thus we must stop at the last character for composition
 	 check.  */
       unsigned char *p;
       int len;
-      /* limit byte position used in fast_looking_at.  This is the
-	 byte position of the next character of START. */
+      /* Limit byte position used in fast_looking_at.  This is the
+	 byte position of the character after START. */
       EMACS_INT limit;
 
       if (NILP (string))
@@ -1191,7 +1191,7 @@
 		    len = 1;
 		  if (len > 0)
 		    {
-		      /* Make CPOS points the last character of match.
+		      /* Make CPOS point to the last character of match.
 			 Note that LEN is byte-length.  */
 		      bpos += len;
 		      if (NILP (string))
--- a/src/dispextern.h	Fri May 14 11:34:53 2010 +0000
+++ b/src/dispextern.h	Sun May 16 00:18:09 2010 +0000
@@ -2868,7 +2868,7 @@
 /* Defined in bidi.c */
 
 extern void bidi_init_it P_ ((EMACS_INT, EMACS_INT, struct bidi_it *));
-extern void bidi_get_next_char_visually P_ ((struct bidi_it *));
+extern void bidi_move_to_visually_next P_ ((struct bidi_it *));
 extern void bidi_paragraph_init P_ ((bidi_dir_t, struct bidi_it *));
 extern int  bidi_mirror_char P_ ((int));
 
--- a/src/emacs.c	Fri May 14 11:34:53 2010 +0000
+++ b/src/emacs.c	Sun May 16 00:18:09 2010 +0000
@@ -87,6 +87,9 @@
 #endif
 #endif
 
+const char emacs_copyright[] = "Copyright (C) 2010 Free Software Foundation, Inc.";
+const char emacs_version[] = "24.0.50";
+
 extern void malloc_warning P_ ((char *));
 extern void set_time_zone_rule P_ ((char *));
 #ifdef HAVE_INDEX
@@ -180,6 +183,10 @@
 Lisp_Object Vsystem_time_locale;
 Lisp_Object Vprevious_system_time_locale;
 
+/* Copyright and version info.  The version number may be updated by
+   Lisp code.  */
+Lisp_Object Vemacs_copyright, Vemacs_version;
+
 /* If non-zero, emacs should not attempt to use a window-specific code,
    but instead should use the virtual terminal under which it was started.  */
 int inhibit_window_system;
@@ -802,35 +809,43 @@
   argc = 0;
   while (argv[argc]) argc++;
 
-  if (argmatch (argv, argc, "-version", "--version", 3, NULL, &skip_args)
-      /* We don't know the version number unless this is a dumped Emacs.
-         So ignore --version otherwise.  */
-      && initialized)
+  if (argmatch (argv, argc, "-version", "--version", 3, NULL, &skip_args))
     {
-      Lisp_Object tem, tem2;
-      tem = Fsymbol_value (intern_c_string ("emacs-version"));
-      tem2 = Fsymbol_value (intern_c_string ("emacs-copyright"));
-      if (!STRINGP (tem))
+      const char *version, *copyright;
+      if (initialized)
 	{
-	  fprintf (stderr, "Invalid value of `emacs-version'\n");
-	  exit (1);
-	}
-      if (!STRINGP (tem2))
-	{
-	  fprintf (stderr, "Invalid value of `emacs-copyright'\n");
-	  exit (1);
+	  Lisp_Object tem, tem2;
+	  tem = Fsymbol_value (intern_c_string ("emacs-version"));
+	  tem2 = Fsymbol_value (intern_c_string ("emacs-copyright"));
+	  if (!STRINGP (tem))
+	    {
+	      fprintf (stderr, "Invalid value of `emacs-version'\n");
+	      exit (1);
+	    }
+	  if (!STRINGP (tem2))
+	    {
+	      fprintf (stderr, "Invalid value of `emacs-copyright'\n");
+	      exit (1);
+	    }
+	  else
+	    {
+	      version = SDATA (tem);
+	      copyright = SDATA (tem2);
+	    }
 	}
       else
 	{
-	  printf ("GNU Emacs %s\n", SDATA (tem));
-	  printf ("%s\n", SDATA(tem2));
-	  printf ("GNU Emacs comes with ABSOLUTELY NO WARRANTY.\n");
-	  printf ("You may redistribute copies of Emacs\n");
-	  printf ("under the terms of the GNU General Public License.\n");
-	  printf ("For more information about these matters, ");
-	  printf ("see the file named COPYING.\n");
-	  exit (0);
+	  version = emacs_version;
+	  copyright = emacs_copyright;
 	}
+      printf ("GNU Emacs %s\n", version);
+      printf ("%s\n", copyright);
+      printf ("GNU Emacs comes with ABSOLUTELY NO WARRANTY.\n");
+      printf ("You may redistribute copies of Emacs\n");
+      printf ("under the terms of the GNU General Public License.\n");
+      printf ("For more information about these matters, ");
+      printf ("see the file named COPYING.\n");
+      exit (0);
     }
   if (argmatch (argv, argc, "-chdir", "--chdir", 2, &ch_to_dir, &skip_args))
       if (chdir (ch_to_dir) == -1)
@@ -1528,6 +1543,11 @@
     ns_init_paths ();
 #endif
 
+  /* Initialize and GC-protect Vinitial_environment and
+     Vprocess_environment before set_initial_environment fills them
+     in.  */
+  if (!initialized)
+    syms_of_callproc ();
   /* egetenv is a pretty low-level facility, which may get called in
      many circumstances; it seems flimsy to put off initializing it
      until calling init_callproc.  */
@@ -1577,7 +1597,6 @@
       syms_of_callint ();
       syms_of_casefiddle ();
       syms_of_casetab ();
-      syms_of_callproc ();
       syms_of_category ();
       syms_of_ccl ();
       syms_of_character ();
@@ -2577,6 +2596,14 @@
 	       doc: /* If non-nil, X resources, Windows Registry settings, and NS defaults are not used.  */);
   inhibit_x_resources = 0;
 
+  DEFVAR_LISP ("emacs-copyright", &Vemacs_copyright,
+	       doc: /* Short copyright string for this version of Emacs.  */);
+  Vemacs_copyright = build_string (emacs_copyright);
+
+  DEFVAR_LISP ("emacs-version", &Vemacs_version,
+	       doc: /* Version numbers of this version of Emacs.  */);
+  Vemacs_version = build_string (emacs_version);
+
   /* Make sure IS_DAEMON starts up as false.  */
   daemon_pipe[1] = 0;
 }
--- a/src/eval.c	Fri May 14 11:34:53 2010 +0000
+++ b/src/eval.c	Sun May 16 00:18:09 2010 +0000
@@ -3308,6 +3308,21 @@
   specpdl_ptr = specpdl + count;
 }
 
+/* specpdl_ptr->symbol is a field which describes which variable is
+   let-bound, so it can be properly undone when we unbind_to.
+   It can have the following two shapes:
+   - SYMBOL : if it's a plain symbol, it means that we have let-bound
+     a symbol that is not buffer-local (at least at the time
+     the let binding started).  Note also that it should not be
+     aliased (i.e. when let-binding V1 that's aliased to V2, we want
+     to record V2 here).
+   - (SYMBOL WHERE . BUFFER) : this means that it is a let-binding for
+     variable SYMBOL which can be buffer-local.  WHERE tells us
+     which buffer is affected (or nil if the let-binding affects the
+     global value of the variable) and BUFFER tells us which buffer was
+     current (i.e. if WHERE is non-nil, then BUFFER==WHERE, otherwise
+     BUFFER did not yet have a buffer-local value).  */
+
 void
 specbind (symbol, value)
      Lisp_Object symbol, value;
@@ -3339,7 +3354,10 @@
 	    set_internal (symbol, value, Qnil, 1);
 	  break;
 	}
-    case SYMBOL_LOCALIZED: case SYMBOL_FORWARDED:
+    case SYMBOL_LOCALIZED:
+      if (SYMBOL_BLV (sym)->frame_local)
+	error ("Frame-local vars cannot be let-bound");
+    case SYMBOL_FORWARDED:
       {
 	Lisp_Object ovalue = find_symbol_value (symbol);
 	specpdl_ptr->func = 0;
@@ -3376,6 +3394,7 @@
 	    /* FIXME: The third value `current_buffer' is only used in
 	       let_shadows_buffer_binding_p which is itself only used
 	       in set_internal for local_if_set.  */
+	    eassert (NILP (where) || EQ (where, cur_buf));
 	    specpdl_ptr->symbol = Fcons (symbol, Fcons (where, cur_buf));
 
 	    /* If SYMBOL is a per-buffer variable which doesn't have a
@@ -3460,13 +3479,10 @@
 	    Fset_default (symbol, this_binding.old_value);
 	  /* If `where' is non-nil, reset the value in the appropriate
 	     local binding, but only if that binding still exists.  */
-	  else if (BUFFERP (where))
-	    {
-	      if (BUFFERP (where)
-		  ? !NILP (Flocal_variable_p (symbol, where))
-		  : !NILP (Fassq (symbol, XFRAME (where)->param_alist)))
-		set_internal (symbol, this_binding.old_value, where, 1);
-	    }
+	  else if (BUFFERP (where)
+		   ? !NILP (Flocal_variable_p (symbol, where))
+		   : !NILP (Fassq (symbol, XFRAME (where)->param_alist)))
+	    set_internal (symbol, this_binding.old_value, where, 1);
 	}
       /* If variable has a trivial value (no forwarding), we can
 	 just set it.  No need to check for constant symbols here,
--- a/src/lisp.h	Fri May 14 11:34:53 2010 +0000
+++ b/src/lisp.h	Sun May 16 00:18:09 2010 +0000
@@ -310,11 +310,10 @@
     return o;
 }
 #else
-/* This isn't quite right - it keeps the argument as an lvalue.
-   Making it const via casting would help avoid code actually
-   modifying the location in question, but the casting could cover
-   other type-related bugs.  */
-#define LISP_MAKE_RVALUE(o) (o)
+/* This is more portable to pre-C99 non-GCC compilers, but for
+   backwards compatibility GCC still accepts an old GNU extension
+   which caused this to only generate a warning.  */
+#define LISP_MAKE_RVALUE(o) (0 ? (o) : (o))
 #endif
 
 #else /* USE_LISP_UNION_TYPE */
@@ -1461,9 +1460,9 @@
   };
 
 #ifdef HIDE_LISP_IMPLEMENTATION
-#define XFLOAT_DATA(f)	(XFLOAT (f)->u.data_ + 0)
+#define XFLOAT_DATA(f)	(0 ? XFLOAT (f)->u.data_ : XFLOAT (f)->u.data_)
 #else
-#define XFLOAT_DATA(f)	(XFLOAT (f)->u.data + 0)
+#define XFLOAT_DATA(f)	(0 ? XFLOAT (f)->u.data :  XFLOAT (f)->u.data)
 /* This should be used only in alloc.c, which always disables
    HIDE_LISP_IMPLEMENTATION.  */
 #define XFLOAT_INIT(f,n) (XFLOAT (f)->u.data = (n))
--- a/src/xdisp.c	Fri May 14 11:34:53 2010 +0000
+++ b/src/xdisp.c	Sun May 16 00:18:09 2010 +0000
@@ -184,7 +184,7 @@
    reordering engine which is called by set_iterator_to_next and
    returns the next character to display in the visual order.  See
    commentary on bidi.c for more details.  As far as redisplay is
-   concerned, the effect of calling bidi_get_next_char_visually, the
+   concerned, the effect of calling bidi_move_to_visually_next, the
    main interface of the reordering engine, is that the iterator gets
    magically placed on the buffer or string position that is to be
    displayed next.  In other words, a linear iteration through the
@@ -3918,7 +3918,7 @@
 		}
 	      do
 		{
-		  bidi_get_next_char_visually (&it->bidi_it);
+		  bidi_move_to_visually_next (&it->bidi_it);
 		}
 	      while (it->stop_charpos <= it->bidi_it.charpos
 		     && it->bidi_it.charpos < newpos);
@@ -5276,7 +5276,7 @@
   while (it->bidi_it.charpos >= BEGV
 	 && it->prev_stop <= it->bidi_it.charpos
 	 && it->bidi_it.charpos < CHARPOS (it->position))
-    bidi_get_next_char_visually (&it->bidi_it);
+    bidi_move_to_visually_next (&it->bidi_it);
   /* Record the stop_pos we just crossed, for when we cross it
      back, maybe.  */
   if (it->bidi_it.charpos > CHARPOS (it->position))
@@ -6307,29 +6307,14 @@
 	  else if (! it->cmp_it.reversed_p)
 	    {
 	      /* Composition created while scanning forward.  */
-	      /* Update IT's char/byte positions to point the first
+	      /* Update IT's char/byte positions to point to the first
 		 character of the next grapheme cluster, or to the
 		 character visually after the current composition.  */
-#if 0
-	      /* Is it ok to do this directly? */
-	      IT_CHARPOS (*it) += it->cmp_it.nchars;
-	      IT_BYTEPOS (*it) += it->cmp_it.nbytes;
-#else
-	      /* Or do we have to call bidi_get_next_char_visually
-		 repeatedly (perhaps not to confuse some internal
-		 state of bidi_it)?  At least we must do this if we
-		 have consumed all grapheme clusters in the current
-		 composition because the next character will be in the
-		 different bidi level.  */
 	      for (i = 0; i < it->cmp_it.nchars; i++)
-		bidi_get_next_char_visually (&it->bidi_it);
-	      /* BTW, it seems that the name
-		 bidi_get_next_char_visually is confusing because
-		 it sounds like not advancing character position.
-		 How about bidi_set_iterator_to_next? */
+		bidi_move_to_visually_next (&it->bidi_it);
 	      IT_BYTEPOS (*it) = it->bidi_it.bytepos;
 	      IT_CHARPOS (*it) = it->bidi_it.charpos;
-#endif
+
 	      if (it->cmp_it.to < it->cmp_it.nglyphs)
 		{
 		  /* Proceed to the next grapheme cluster.  */
@@ -6337,7 +6322,7 @@
 		}
 	      else
 		{
-		  /* No more grapheme cluster in this composition.
+		  /* No more grapheme clusters in this composition.
 		     Find the next stop position.  */
 		  EMACS_INT stop = it->stop_charpos;
 		  if (it->bidi_it.scan_dir < 0)
@@ -6351,10 +6336,10 @@
 	  else
 	    {
 	      /* Composition created while scanning backward.  */
-	      /* Update IT's char/byte positions to point the last
+	      /* Update IT's char/byte positions to point to the last
 		 character of the previous grapheme cluster, or the
 		 character visually after the current composition.  */
-	      bidi_get_next_char_visually (&it->bidi_it);
+	      bidi_move_to_visually_next (&it->bidi_it);
 	      IT_BYTEPOS (*it) = it->bidi_it.bytepos;
 	      IT_CHARPOS (*it) = it->bidi_it.charpos;
 
@@ -6365,7 +6350,7 @@
 		}
 	      else
 		{
-		  /* No more grapheme cluster in this composition.
+		  /* No more grapheme clusters in this composition.
 		     Find the next stop position.  */
 		  EMACS_INT stop = it->stop_charpos;
 		  if (it->bidi_it.scan_dir < 0)
@@ -6393,13 +6378,13 @@
 		 direction (a.k.a. its base embedding level).  */
 	      if (it->bidi_it.new_paragraph)
 		bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it);
-	      bidi_get_next_char_visually (&it->bidi_it);
+	      bidi_move_to_visually_next (&it->bidi_it);
 	      IT_BYTEPOS (*it) = it->bidi_it.bytepos;
 	      IT_CHARPOS (*it) = it->bidi_it.charpos;
 	      if (prev_scan_dir != it->bidi_it.scan_dir)
 		{
-		  /* As scan direction was changed, we must re-compute
-		     the stop position for composition.  */
+		  /* As the scan direction was changed, we must
+		     re-compute the stop position for composition.  */
 		  EMACS_INT stop = it->stop_charpos;
 		  if (it->bidi_it.scan_dir < 0)
 		    stop = -1;
@@ -6873,7 +6858,7 @@
 	  /* If we are at the beginning of a line, we can produce the
 	     next element right away.  */
 	  bidi_paragraph_init (it->paragraph_embedding, &it->bidi_it);
-	  bidi_get_next_char_visually (&it->bidi_it);
+	  bidi_move_to_visually_next (&it->bidi_it);
 	}
       else
 	{
@@ -6891,7 +6876,7 @@
 	    {
 	      /* Now return to buffer position where we were asked to
 		 get the next display element, and produce that.  */
-	      bidi_get_next_char_visually (&it->bidi_it);
+	      bidi_move_to_visually_next (&it->bidi_it);
 	    }
 	  while (it->bidi_it.bytepos != orig_bytepos
 		 && it->bidi_it.bytepos < ZV_BYTE);
@@ -7115,7 +7100,7 @@
 	      /* Resync the bidi iterator with IT's new position.
 		 FIXME: this doesn't support bidirectional text.  */
 	      while (it->bidi_it.charpos < IT_CHARPOS (*it))
-		bidi_get_next_char_visually (&it->bidi_it);
+		bidi_move_to_visually_next (&it->bidi_it);
 	    }
 	  return 0;
 	}
@@ -7131,7 +7116,7 @@
 	     correct (struct glyph)->charpos.  */
 	  int i;
 	  for (i = 0; i < it->cmp_it.nchars - 1; i++)
-	    bidi_get_next_char_visually (&it->bidi_it);
+	    bidi_move_to_visually_next (&it->bidi_it);
 	  IT_CHARPOS (*it) = it->bidi_it.charpos;
 	  IT_BYTEPOS (*it) = it->bidi_it.bytepos;
 	  it->position = it->current.pos;
@@ -18256,6 +18241,84 @@
   return row->displays_text_p;
 }
 
+DEFUN ("current-bidi-paragraph-direction", Fcurrent_bidi_paragraph_direction,
+       Scurrent_bidi_paragraph_direction, 0, 1, 0,
+       doc: /* Return paragraph direction at point in BUFFER.
+Value is either `left-to-right' or `right-to-left'.
+If BUFFER is omitted or nil, it defaults to the current buffer.
+
+Paragraph direction determines how the text in the paragraph is displayed.
+In left-to-right paragraphs, text begins at the left margin of the window
+and the reading direction is generally left to right.  In right-to-left
+paragraphs, text begins at the right margin and is read from right to left.
+
+See also `bidi-paragraph-direction'.  */)
+     (buffer)
+     Lisp_Object buffer;
+{
+  struct buffer *buf;
+  struct buffer *old;
+
+  if (NILP (buffer))
+    buf = current_buffer;
+  else
+    {
+      CHECK_BUFFER (buffer);
+      buf = XBUFFER (buffer);
+      old = current_buffer;
+    }
+
+  if (NILP (buf->bidi_display_reordering))
+    return Qleft_to_right;
+  else if (!NILP (buf->bidi_paragraph_direction))
+    return buf->bidi_paragraph_direction;
+  else
+    {
+      /* Determine the direction from buffer text.  We could try to
+	 use current_matrix if it is up to date, but this seems fast
+	 enough as it is.  */
+      struct bidi_it itb;
+      EMACS_INT pos = BUF_PT (buf);
+      EMACS_INT bytepos = BUF_PT_BYTE (buf);
+
+      if (buf != current_buffer)
+	set_buffer_temp (buf);
+      /* Find previous non-empty line.  */
+      if (pos >= ZV && pos > BEGV)
+	{
+	  pos--;
+	  bytepos = CHAR_TO_BYTE (pos);
+	}
+      while (FETCH_BYTE (bytepos) == '\n')
+	{
+	  if (bytepos <= BEGV_BYTE)
+	    break;
+	  bytepos--;
+	  pos--;
+	}
+      while (!CHAR_HEAD_P (FETCH_BYTE (bytepos)))
+	bytepos--;
+      itb.charpos = pos;
+      itb.bytepos = bytepos;
+      itb.first_elt = 1;
+
+      bidi_paragraph_init (NEUTRAL_DIR, &itb);
+      if (buf != current_buffer)
+	set_buffer_temp (old);
+      switch (itb.paragraph_dir)
+	{
+	case L2R:
+	  return Qleft_to_right;
+	  break;
+	case R2L:
+	  return Qright_to_left;
+	  break;
+	default:
+	  abort ();
+	}
+    }
+}
+
 
 
 /***********************************************************************
@@ -25955,6 +26018,7 @@
 #endif
   defsubr (&Sformat_mode_line);
   defsubr (&Sinvisible_p);
+  defsubr (&Scurrent_bidi_paragraph_direction);
 
   staticpro (&Qmenu_bar_update_hook);
   Qmenu_bar_update_hook = intern_c_string ("menu-bar-update-hook");