changeset 108551:d4c436ea51f4

merge trunk
author Kenichi Handa <handa@etlken>
date Mon, 10 May 2010 12:37:03 +0900
parents 339bb0f23bf9 (current diff) 0ce7b05a8161 (diff)
children 03ab6621f67d
files etc/NEWS.23
diffstat 162 files changed, 4260 insertions(+), 2095 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu May 06 09:50:39 2010 +0900
+++ b/ChangeLog	Mon May 10 12:37:03 2010 +0900
@@ -1,3 +1,58 @@
+2010-05-10  Glenn Morris  <rgm@gnu.org>
+
+	* configure.in (LIBS_SYSTEM): New output variable, replacing cpp.
+
+	* configure.in (MAIL_USE_FLOCK, MAIL_USE_LOCKF): New AC_DEFINEs.
+	(BLESSMAIL_TARGET): New output variable.
+
+2010-05-08  Štěpán Němec  <stepnem@gmail.com>  (tiny change)
+
+	* INSTALL: Fix typos.
+
+2010-05-08  Chong Yidong  <cyd@stupidchicken.com>
+
+	* configure.in: Add check for buggy version of GCC (Bug#6031).
+
+2010-05-08  Glenn Morris  <rgm@gnu.org>
+
+	* configure.in (HAVE_LIBNCURSES): New local variable.
+	(TERMINFO, LIBS_TERMCAP, TERMCAP_OBJ): New output variables,
+	replacing cpp in src/s/*.h and src/Makefile.in.
+
+2010-05-07  Chong Yidong  <cyd@stupidchicken.com>
+
+	* Version 23.2 released.
+
+2010-05-07  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* configure.in: Add tests for `isnan' and `copysign'.
+
+2010-05-07  Eli Zaretskii  <eliz@gnu.org>
+
+	* config.bat: Allow for 2 leading `#'s in comments in
+	src/Makefile.in.
+
+2010-05-07  Glenn Morris  <rgm@gnu.org>
+
+	* configure.in (LD_SWITCH_SYSTEM): Set with configure, not cpp.
+	Merges logic from src/s/* and src/Makefile.in.
+	(LD_SWITCH_SYSTEM_TEMACS): New output variable.
+
+2010-05-07  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	Define START_FILES and LIB_STANDARD using autoconf.
+	* configure.in (START_FILES, LIB_STANDARD): New definitions, moved
+	here from src/s/*.h.
+	(HAVE_CRTIN): Remove, inline logic in the netbsd
+	START_FILES/LIB_STANDARD computation.
+
+2010-05-06  Glenn Morris  <rgm@gnu.org>
+
+	* configure.in (AC_PROG_LN_S): Remove test, nothing uses @LN_S@.
+
+	* Makefile.in (CPP, C_SWITCH_SYSTEM, ALLOCA, LN_S, C_SWITCH_X_SITE)
+	(LD_SWITCH_X_SITE): Remove unused variables.
+
 2010-05-04  Glenn Morris  <rgm@gnu.org>
 
 	* configure.in (LD_SWITCH_X_SITE_AUX): Use AC_SUBST only, not AC_DEFINE
@@ -102,7 +157,7 @@
 
 	* configure.in (REAL_CFLAGS, CFLAGS): Restore -g for gcc.
 
-2010-04-22  Miles Bader <miles@gnu.org>
+2010-04-22  Miles Bader  <miles@gnu.org>
 
 	* configure.in: Get rid of "unix" pre-defined macro when
 	preprocessing Makefile.  (Bug#5857)
--- a/INSTALL	Thu May 06 09:50:39 2010 +0900
+++ b/INSTALL	Mon May 10 12:37:03 2010 +0900
@@ -408,7 +408,7 @@
 switch to the compiler, and link against libfoo.a and libbar.a
 libraries in addition to the standard ones.
 
-For some libraries, like Gtk+, fontconfig and ALSA, `configure' use
+For some libraries, like Gtk+, fontconfig and ALSA, `configure' uses
 pkg-config to find where those libraries are installed.
 If you want pkg-config to look in special directories, you have to set
 the environment variable PKG_CONFIG_PATH to point to the directories
@@ -466,7 +466,7 @@
 documentation strings to be in the etc/DOC file (see
 src/Makefile.in if you wish to figure out how to do that).  For all
 else, use site-init.el.  Do not load byte-compiled code which
-was build with a non-nil value of `byte-compile-dynamic'.
+was built with a non-nil value of `byte-compile-dynamic'.
 
 If you set load-path to a different value in site-init.el or
 site-load.el, Emacs will use *precisely* that value when it starts up
@@ -491,7 +491,7 @@
 copying it, if you wish; then it automatically uses the sibling
 directories ../lisp, ../lib-src, ../info.
 
-Or you can "install" the executable and the other Emacs into their
+Or you can "install" the executable and the other files into their
 installed locations, with `make install'.  By default, Emacs's files
 are installed in the following directories:
 
--- a/Makefile.in	Thu May 06 09:50:39 2010 +0900
+++ b/Makefile.in	Mon May 10 12:37:03 2010 +0900
@@ -69,15 +69,9 @@
 # ==================== Things `configure' Might Edit ====================
 
 CC=@CC@
-CPP=@CPP@
-C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@
-ALLOCA=@ALLOCA@
-LN_S=@LN_S@
 CFLAGS=@CFLAGS@
 LDFLAGS=@LDFLAGS@
 CPPFLAGS=@CPPFLAGS@
-C_SWITCH_X_SITE=@C_SWITCH_X_SITE@
-LD_SWITCH_X_SITE=@LD_SWITCH_X_SITE@
 EXEEXT=@EXEEXT@
 MAKEINFO=@MAKEINFO@
 
--- a/admin/CPP-DEFINES	Thu May 06 09:50:39 2010 +0900
+++ b/admin/CPP-DEFINES	Mon May 10 12:37:03 2010 +0900
@@ -99,7 +99,6 @@
 BSD4_3
 BSD_SYSTEM
 CLASH_DETECTION
-COFF_BSD_SYMBOLS
 C_SWITCH_X_SYSTEM
 DATA_SEG_BITS
 DATA_START
@@ -155,7 +154,6 @@
 HAVE_INDEX
 HAVE_INET_SOCKETS
 HAVE_INVERSE_HYPERBOLIC
-HAVE_LIB64_DIR
 HAVE_LIBKSTAT
 HAVE_LIBNCURSES
 HAVE_LIBPTHREADS
@@ -217,15 +215,6 @@
 IS_DIRECTORY_SEP
 KERNEL_FILE
 LDAV_SYMBOL
-LD_SWITCH_SYSTEM
-LD_SWITCH_SYSTEM_tmp
-LD_SWITCH_X_DEFAULT
-LIBS_SYSTEM
-LIBS_TERMCAP
-LIBXMU
-LIB_GCC
-LIB_MATH
-LIB_STANDARD
 LINKER
 LINUX_VERSION_CODE
 LISP_FLOAT_TYPE
@@ -238,32 +227,20 @@
 MIN_PTY_KERNEL_VERSION -- only used on Mac
 MODE_LINE_BINARY_TEXT
 MUST_UNDEF__STDC__
-NEED_BSDTTY
-NEED_ERRNO
-NEED_UNISTD_H
 NLIST_STRUCT
 NOT_C_CODE
 NO_ABORT
-NO_DIR_LIBRARY
 NO_EDITRES
 NO_MATHERR
-NO_SHARED_LIBS
 NO_TERMIO
 NSIG
 NSIG_MINIMUM
 NULL
 NULL_DEVICE
 ORDINARY_LINK
-OTHER_FILES
 O_APPEND
-O_BINARY
-O_CREAT
-O_EXCL
 O_RDONLY
 O_RDWR
-O_TEXT
-O_TRUNC
-O_WRONLY
 PAGESIZE
 PENDING_OUTPUT_COUNT
 POSIX
@@ -296,14 +273,11 @@
 SYSTEM_PURESIZE_EXTRA
 SYSTEM_MALLOC
 SYSV_SYSTEM_DIR
-Srandom
 TAB3
 TABDLY
 TERM
-TERMINFO
 TEXT_START
 THIS_IS_CONFIGURE
-THIS_IS_MAKEFILE
 TIME_WITH_SYS_TIME
 TIOCSIGSEND
 TM_IN_SYS_TIME
@@ -311,7 +285,6 @@
 UNEXEC
 UNIX98_PTYS
 USE_CRT_DLL
-USE_MAC_IMAGE_IO
 USE_TOOLKIT_SCROLL_BARS
 USG
 USG5
--- a/admin/ChangeLog	Thu May 06 09:50:39 2010 +0900
+++ b/admin/ChangeLog	Mon May 10 12:37:03 2010 +0900
@@ -1,3 +1,7 @@
+2010-05-07  Chong Yidong  <cyd@stupidchicken.com>
+
+	* Version 23.2 released.
+
 2010-04-01  Eli Zaretskii  <eliz@gnu.org>
 
 	* CPP-DEFINES (__DJGPP__, __GO32__): Remove, no longer used.
--- a/config.bat	Thu May 06 09:50:39 2010 +0900
+++ b/config.bat	Mon May 10 12:37:03 2010 +0900
@@ -197,7 +197,7 @@
 
 rem   Create "makefile" from "makefile.in".
 rm -f Makefile junk.c
-sed -e "1,/== start of cpp stuff ==/s@^# .*$@@" <Makefile.in >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
--- a/configure	Thu May 06 09:50:39 2010 +0900
+++ b/configure	Mon May 10 12:37:03 2010 +0900
@@ -694,7 +694,6 @@
 CPP
 GREP
 EGREP
-LN_S
 INSTALL_PROGRAM
 INSTALL_SCRIPT
 INSTALL_DATA
@@ -702,10 +701,13 @@
 INSTALL_INFO
 GZIP_PROG
 MAKEINFO
-LIB_MATH
+LD_SWITCH_SYSTEM
 C_SWITCH_MACHINE
 C_SWITCH_SYSTEM
+LIBS_SYSTEM
 CRT_DIR
+LIB_MATH
+START_FILES
 LIBSOUND
 PKG_CONFIG
 ALSA_CFLAGS
@@ -717,6 +719,7 @@
 LD_SWITCH_X_SITE_AUX_RPATH
 NS_OBJ
 NS_SUPPORT
+LIB_STANDARD
 HAVE_XSERVER
 RSVG_CFLAGS
 RSVG_LIBS
@@ -753,12 +756,15 @@
 ALLOCA
 liblockfile
 LIBS_MAIL
+BLESSMAIL_TARGET
 LIBOBJS
 NEED_SETGID
 KMEM_GROUP
 GETLOADAVG_LIBS
 GETOPT_H
 GETOPTOBJS
+LIBS_TERMCAP
+TERMCAP_OBJ
 LIBHESIOD
 LIBRESOLV
 COM_ERRLIB
@@ -808,6 +814,7 @@
 PRE_ALLOC_OBJ
 POST_ALLOC_OBJ
 LD_SWITCH_SYSTEM_TEMACS
+LD_SWITCH_SYSTEM_EXTRA
 LTLIBOBJS'
 ac_subst_files=''
 ac_user_opts='
@@ -2783,14 +2790,6 @@
   ## NetBSD ports
   *-*-netbsd* )
     opsys=netbsd
-    if test -f /usr/lib/crti.o; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_CRTIN /**/
-_ACEOF
-
-   fi
-
     case "${canonical}" in
       alpha*-*-netbsd*)	machine=alpha ;;
       i[3456]86-*-netbsd*) machine=intel386 ;;
@@ -5026,17 +5025,6 @@
 
 #### Some other nice autoconf tests.
 
-{ $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5
-$as_echo_n "checking whether ln -s works... " >&6; }
-LN_S=$as_ln_s
-if test "$LN_S" = "ln -s"; then
-  { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5
-$as_echo "no, using $LN_S" >&6; }
-fi
-
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -5824,20 +5812,6 @@
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 
-LIB_MATH=-lm
-
-case $opsys in
-  cygwin )
-    LIB_MATH=
-    ;;
-  darwin )
-    ## Adding -lm confuses the dynamic linker, so omit it.
-    LIB_MATH=
-    ;;
-esac
-
-
-
 #### Extract some information from the operating system and machine files.
 
 { $as_echo "$as_me:$LINENO: checking the machine- and system-dependent files to find out
@@ -5865,10 +5839,6 @@
 echo '
 #include "'${srcdir}'/src/'${opsysfile}'"
 #include "'${srcdir}'/src/'${machfile}'"
-#ifndef LIBS_SYSTEM
-#define LIBS_SYSTEM
-#endif
-configure___ libsrc_libs=LIBS_SYSTEM
 
 configure___ LIBX=-lX11
 
@@ -5898,12 +5868,6 @@
 #define C_WARNINGS_SWITCH ${C_WARNINGS_SWITCH}
 #endif
 
-#ifndef LD_SWITCH_SYSTEM
-#define LD_SWITCH_SYSTEM
-#endif
-
-configure___ ld_switch_system=LD_SWITCH_SYSTEM
-
 #ifdef THIS_IS_CONFIGURE
 
 /* Get the CFLAGS for tests in configure.  */
@@ -5940,7 +5904,49 @@
 fi
 rm ${tempcname}
 
-ac_link="$ac_link $ld_switch_system"
+
+LD_SWITCH_SYSTEM=
+case "$opsys" in
+  freebsd)
+   ## Let `ld' find image libs and similar things in /usr/local/lib.
+   ## The system compiler, GCC, has apparently been modified to not
+   ## look there, contrary to what a stock GCC would do.
+   LD_SWITCH_SYSTEM=-L/usr/local/lib
+   ;;
+
+  gnu-linux)
+   ## cpp test was "ifdef __mips__", but presumably this is equivalent...
+   test "$machine" = "mips" && LD_SWITCH_SYSTEM="-G 0"
+   ;;
+
+  netbsd)
+   LD_SWITCH_SYSTEM="-Wl,-rpath,/usr/pkg/lib -L/usr/pkg/lib -Wl,-rpath,/usr/local/lib -L/usr/local/lib"
+   ;;
+
+  openbsd)
+   ## Han Boetes <han@mijncomputer.nl> says this is necessary,
+   ## otherwise Emacs dumps core on elf systems.
+   LD_SWITCH_SYSTEM="-Z"
+   ;;
+esac
+
+
+ac_link="$ac_link $LD_SWITCH_SYSTEM"
+
+## This is fun.  Some settings of LD_SWITCH_SYSTEM reference
+## LD_SWITCH_X_SITE_AUX, which has not been defined yet.  When using
+## cpp, it was expanded to null.  Thus LD_SWITCH_SYSTEM had different
+## values in configure and the Makefiles.  How helpful.
+## FIXME why not use LD_SWITCH_SYSTEM_TEMACS (or somesuch) instead?
+case "$opsys" in
+  gnu-linux)
+   ## LD_SWITCH_X_SITE_AUX is a -R option saying where to find X at run-time.
+   LD_SWITCH_SYSTEM="$LD_SWITCH_SYSTEM \$(LD_SWITCH_X_SITE_AUX)" ;;
+
+  netbsd|openbsd)
+   ## _AUX_RPATH is like _AUX, but uses -rpath instead of -R.
+   LD_SWITCH_SYSTEM="\$(LD_SWITCH_X_SITE_AUX_RPATH) $LD_SWITCH_SYSTEM" ;;
+esac
 
 
 C_SWITCH_MACHINE=
@@ -6021,13 +6027,30 @@
 ## Some programs in src produce warnings saying certain subprograms
 ## are too complex and need a MAXMEM value greater than 2000 for
 ## additional optimization.  --nils@exp-math.uni-essen.de
-test "$opsys" = "aix4.2" && test "x$GCC" = "xyes" && \
+test "$opsys" = "aix4.2" && test "x$GCC" != "xyes" && \
   C_SWITCH_SYSTEM="-ma -qmaxmem=4000"
 ## gnu-linux might need -D_BSD_SOURCE on old libc5 systems.
 ## It is redundant in glibc2, since we define _GNU_SOURCE.
 
 
 
+LIBS_SYSTEM=
+case "$opsys" in
+  ## IBM's X11R5 uses -lIM and -liconv in AIX 3.2.2.
+  aix4-2) LIBS_SYSTEM="-lrts -lIM -liconv" ;;
+
+  freebsd) LIBS_SYSTEM="-lutil" ;;
+
+  hpux*) LIBS_SYSTEM="-l:libdld.sl" ;;
+
+  sol2*) LIBS_SYSTEM="-lsocket -lnsl -lkstat" ;;
+
+  ## Motif needs -lgen.
+  unixware) LIBS_SYSTEM="-lsocket -lnsl -lelf -lgen" ;;
+esac
+
+
+
 ### Make sure subsequent tests use flags consistent with the build flags.
 
 if test x"${OVERRIDE_CPPFLAGS}" != x; then
@@ -6434,6 +6457,45 @@
 
 
 
+LIB_MATH=-lm
+LIB_STANDARD=
+START_FILES=
+
+case $opsys in
+  cygwin )
+    LIB_MATH=
+    START_FILES='ecrt0.o'
+    ;;
+  darwin )
+    ## Adding -lm confuses the dynamic linker, so omit it.
+    LIB_MATH=
+    START_FILES='pre-crt0.o'
+    ;;
+  freebsd )
+    LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o $(CRT_DIR)/crtn.o'
+    START_FILES='pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o $(CRT_DIR)/crtbegin.o'
+    ;;
+  gnu-linux | gnu-kfreebsd )
+    LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtn.o'
+    START_FILES='pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o'
+    ;;
+  hpux10-20 | hpux11 )
+    LIB_STANDARD=-lc
+    START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o'
+    ;;
+  netbsd | openbsd )
+    if test -f $(CRT_DIR)/crti.o; then
+	LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o $(CRT_DIR)/crtn.o'
+        START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o $(CRT_DIR)/crti.o $(CRT_DIR)/crtbegin.o'
+    else
+	LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o'
+	START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o $(CRT_DIR)/crtbegin.o'
+    fi
+    ;;
+esac
+
+
+
 
 
 
@@ -9891,6 +9953,7 @@
      CFLAGS="$CFLAGS -I${GNUSTEP_SYSTEM_HEADERS}"
      REAL_CFLAGS="$REAL_CFLAGS -I${GNUSTEP_SYSTEM_HEADERS}"
      LDFLAGS="$LDFLAGS -L${GNUSTEP_SYSTEM_LIBRARIES}"
+     LIB_STANDARD=
   fi
   if test "${ac_cv_header_AppKit_AppKit_h+set}" = set; then
   { $as_echo "$as_me:$LINENO: checking for AppKit/AppKit.h" >&5
@@ -10097,6 +10160,7 @@
 
 
 
+
 case "${window_system}" in
   x11 )
     HAVE_X_WINDOWS=yes
@@ -10890,7 +10954,7 @@
   REL_ALLOC=no
 fi
 
-LIBS="$libsrc_libs $LIBS"
+LIBS="$LIBS_SYSTEM $LIBS"
 
 
 { $as_echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5
@@ -11108,6 +11172,18 @@
 fi
 
 
+## Note: when using cpp in s/aix4.2.h, this definition depended on
+## HAVE_LIBPTHREADS.  That was not defined earlier in configure when
+## the system file was sourced.  Hence the value of LIBS_SYSTEM
+## added to LIBS in configure would never contain the pthreads part,
+## but the value used in Makefiles might.  FIXME?
+##
+## -lpthreads seems to be necessary for Xlib in X11R6, and should
+## be harmless on older versions of X where it happens to exist.
+test "$opsys" = "aix4-2" && \
+  test $ac_cv_lib_pthreads_cma_open = yes && \
+  LIBS_SYSTEM="$LIBS_SYSTEM -lpthreads"
+
 
 case ${host_os} in
 aix*)
@@ -17516,6 +17592,58 @@
 
 
 
+## Define MAIL_USE_FLOCK (or LOCKF) if the mailer uses flock (or lockf) to
+## interlock access to the mail spool.  The alternative is a lock file named
+## /usr/spool/mail/$USER.lock.
+mail_lock=no
+case "$opsys" in
+  aix4-2) mail_lock="lockf" ;;
+
+  gnu|freebsd|netbsd|openbsd|darwin|irix6-5) mail_lock="flock" ;;
+
+  ## On GNU/Linux systems, both methods are used by various mail programs.
+  ## I assume most people are using newer mailers that have heard of flock.
+  ## Change this if you need to.
+  ## Debian contains a patch which says: ``On Debian/GNU/Linux systems,
+  ## configure gets the right answers, and that means *NOT* using flock.
+  ## Using flock is guaranteed to be the wrong thing. See Debian Policy
+  ## for details.'' and then uses `#ifdef DEBIAN'.  Unfortunately the
+  ## Debian maintainer hasn't provided a clean fix for Emacs.
+  ## movemail.c will use `maillock' when MAILDIR, HAVE_LIBMAIL and
+  ## HAVE_MAILLOCK_H are defined, so the following appears to be the
+  ## correct logic.  -- fx
+  ## We must check for HAVE_LIBLOCKFILE too, as movemail does.
+  ## liblockfile is a Free Software replacement for libmail, used on
+  ## Debian systems and elsewhere. -rfr.
+  gnu-*)
+    mail_lock="flock"
+    if test $have_mail = yes || test $have_lockfile = yes; then
+      test $ac_cv_header_maillock_h = yes && mail_lock=no
+    fi
+    ;;
+esac
+
+BLESSMAIL_TARGET=
+case "$mail_lock" in
+  flock)
+cat >>confdefs.h <<\_ACEOF
+#define MAIL_USE_FLOCK 1
+_ACEOF
+ ;;
+
+  lockf)
+cat >>confdefs.h <<\_ACEOF
+#define MAIL_USE_LOCKF 1
+_ACEOF
+ ;;
+
+  *) BLESSMAIL_TARGET="need-blessmail" ;;
+esac
+
+
+
+
+
 
 
 
@@ -17596,7 +17724,7 @@
 sendto recvfrom getsockopt setsockopt getsockname getpeername \
 gai_strerror mkstemp getline getdelim mremap memmove fsync sync bzero \
 memset memcmp difftime memcpy mempcpy mblen mbrlen posix_memalign \
-cfmakeraw cfsetspeed
+cfmakeraw cfsetspeed isnan copysign
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -21350,7 +21478,7 @@
 # That is because we have not set up to link ncurses in lib-src.
 # It's better to believe a function is not available
 # than to expect to find it in ncurses.
-# Also we need tputs and frieds to be able to build at all.
+# Also we need tputs and friends to be able to build at all.
 have_tputs_et_al=true
 { $as_echo "$as_me:$LINENO: checking for library containing tputs" >&5
 $as_echo_n "checking for library containing tputs... " >&6; }
@@ -21456,9 +21584,137 @@
 #define HAVE_LIBNCURSES 1
 _ACEOF
 
+## FIXME This was the cpp logic, but I am not sure it is right.
+## The above test has not necessarily found libncurses.
+HAVE_LIBNCURSES=yes
+
+## Use terminfo instead of termcap?
+## Note only system files NOT using terminfo are:
+## bsd-common, freebsd < 40000, ms-w32, msdos, netbsd, and
+## darwin|gnu without ncurses.
+TERMINFO=no
+LIBS_TERMCAP=
+case "$opsys" in
+  ## cygwin: Fewer environment variables to go wrong, more terminal types.
+  ## hpux10-20: Use the system provided termcap(3) library.
+  ## openbsd: David Mazieres <dm@reeducation-labor.lcs.mit.edu> says this
+  ##  is necessary.  Otherwise Emacs dumps core when run -nw.
+  aix4-2|cygwin|hpux*|irix6-5|openbsd|usg5-4|sol2*|unixware) TERMINFO=yes ;;
+
+  ## darwin: Prevents crashes when running Emacs in Terminal.app under 10.2.
+  ##  The ncurses library has been moved out of the System framework in
+  ##  Mac OS X 10.2.  So if configure detects it, set the command-line
+  ##  option to use it.
+  darwin|gnu*)
+    ## (HAVE_LIBNCURSES was not always true, but is since 2010-03-18.)
+    if test "x$HAVE_LIBNCURSES" = "xyes"; then
+      TERMINFO=yes
+      LIBS_TERMCAP="-lncurses"
+    fi
+    ;;
+
+  freebsd)
+    { $as_echo "$as_me:$LINENO: checking whether FreeBSD is new enough to use terminfo" >&5
+$as_echo_n "checking whether FreeBSD is new enough to use terminfo... " >&6; }
+    if test "${emacs_cv_freebsd_terminfo+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <osreldate.h>
+int
+main ()
+{
+#if __FreeBSD_version < 400000
+fail;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then
+  emacs_cv_freebsd_terminfo=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	emacs_cv_freebsd_terminfo=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+
+
+    { $as_echo "$as_me:$LINENO: result: $emacs_cv_freebsd_terminfo" >&5
+$as_echo "$emacs_cv_freebsd_terminfo" >&6; }
+
+    if test $emacs_cv_freebsd_terminfo = yes; then
+      TERMINFO=yes
+      LIBS_TERMCAP="-lncurses"
+    else
+      LIBS_TERMCAP="-ltermcap"
+    fi
+    ;;
+
+esac
+
+case "$opsys" in
+  ## hpux: Make sure we get select from libc rather than from libcurses
+  ##  because libcurses on HPUX 10.10 has a broken version of select.
+  ##  We used to use -lc -lcurses, but this may be cleaner.
+  hpux*|netbsd) LIBS_TERMCAP="-ltermcap" ;;
+
+  openbsd) LIBS_TERMCAP="-lncurses" ;;
+
+  ## Must use system termcap, if we use any termcap.  It does special things.
+  sol2*) test "$TERMINFO" != yes && LIBS_TERMCAP="-ltermcap" ;;
+esac
+
+TERMCAP_OBJ=tparam.o
+if test $TERMINFO = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define TERMINFO 1
+_ACEOF
+
+
+  ## Default used to be -ltermcap.  Add a case above if need something else.
+  test "x$LIBS_TERMCAP" = "x" && LIBS_TERMCAP="-lcurses"
+
+  TERMCAP_OBJ=terminfo.o
+fi
+
+
+
 
 # Do we have res_init, for detecting changes in /etc/resolv.conf?
-
 resolv=no
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -26030,6 +26286,16 @@
 CFLAGS="$REAL_CFLAGS"
 CPPFLAGS="$REAL_CPPFLAGS"
 
+## Hack to detect a buggy GCC version.
+if test "x$GCC" = xyes \
+   && test x"`$CC --version 2> /dev/null | grep 'gcc.* 4.5.0'`" != x \
+   && test x"`echo $CFLAGS | grep '\-O[23]'`" != x \
+   && test x"`echo $CFLAGS | grep '\-fno-optimize-sibling-calls'`" = x; then
+   { { $as_echo "$as_me:$LINENO: error: GCC 4.5.0 has problems compiling Emacs; see etc/PROBLEMS'." >&5
+$as_echo "$as_me: error: GCC 4.5.0 has problems compiling Emacs; see etc/PROBLEMS'." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
 #### Find out which version of Emacs this is.
 version=`grep 'defconst[	 ]*emacs-version' ${srcdir}/lisp/version.el \
 	 | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`
@@ -26285,6 +26551,23 @@
 
 
 
+## This exists because src/Makefile.in did some extra fiddling around
+## with LD_SWITCH_SYSTEM.  The cpp logic was:
+##   #ifndef LD_SWITCH_SYSTEM
+##   #if !defined (__GNUC__) && ((defined (BSD_SYSTEM) && !defined (COFF)))
+## Since all the *bsds define LD_SWITCH_SYSTEM, this simplifies to:
+## not using gcc, darwin system not on an alpha (ie darwin, since
+## darwin + alpha does not occur).
+## Note that unlike L_S_S, this is not used in ac_link.
+if test "x$LD_SWITCH_SYSTEM" = "x" && test "x$GCC" != "xyes" && \
+   test "$opsys" = "darwin"; then
+  LD_SWITCH_SYSTEM_EXTRA="-X"
+else
+  LD_SWITCH_SYSTEM_EXTRA=
+fi
+
+
+
 
 
 
--- a/configure.in	Thu May 06 09:50:39 2010 +0900
+++ b/configure.in	Mon May 10 12:37:03 2010 +0900
@@ -428,12 +428,6 @@
   ## NetBSD ports
   *-*-netbsd* )
     opsys=netbsd
-    if test -f /usr/lib/crti.o; then]
-dnl The close and open brackets here are because this section is quoted --
-dnl see the `changequote' comment above.
-      AC_DEFINE(HAVE_CRTIN, [], [Define to 1 if you have /usr/lib/crti.o.])
-[   fi
-
     case "${canonical}" in
       alpha*-*-netbsd*)	machine=alpha ;;
       i[3456]86-*-netbsd*) machine=intel386 ;;
@@ -755,7 +749,6 @@
 #### Some other nice autoconf tests.
 
 dnl checks for programs
-AC_PROG_LN_S
 AC_PROG_CPP
 AC_PROG_INSTALL
 if test "x$RANLIB" = x; then
@@ -842,20 +835,6 @@
   LDFLAGS=$late_LDFLAGS
   [AC_MSG_RESULT(no)])
 
-LIB_MATH=-lm
-
-case $opsys in
-  cygwin )
-    LIB_MATH=
-    ;;
-  darwin )
-    ## Adding -lm confuses the dynamic linker, so omit it.
-    LIB_MATH=
-    ;;
-esac
-
-AC_SUBST(LIB_MATH)
-
 #### Extract some information from the operating system and machine files.
 
 AC_CHECKING([the machine- and system-dependent files to find out
@@ -880,10 +859,6 @@
 echo '
 #include "'${srcdir}'/src/'${opsysfile}'"
 #include "'${srcdir}'/src/'${machfile}'"
-#ifndef LIBS_SYSTEM
-#define LIBS_SYSTEM
-#endif
-configure___ libsrc_libs=LIBS_SYSTEM
 
 configure___ LIBX=-lX11
 
@@ -913,12 +888,6 @@
 #define C_WARNINGS_SWITCH ${C_WARNINGS_SWITCH}
 #endif
 
-#ifndef LD_SWITCH_SYSTEM
-#define LD_SWITCH_SYSTEM
-#endif
-
-configure___ ld_switch_system=LD_SWITCH_SYSTEM
-
 #ifdef THIS_IS_CONFIGURE
 
 /* Get the CFLAGS for tests in configure.  */
@@ -955,7 +924,49 @@
 fi]
 rm ${tempcname}
 
-ac_link="$ac_link $ld_switch_system"
+
+LD_SWITCH_SYSTEM=
+case "$opsys" in
+  freebsd)
+   ## Let `ld' find image libs and similar things in /usr/local/lib.
+   ## The system compiler, GCC, has apparently been modified to not
+   ## look there, contrary to what a stock GCC would do.
+   LD_SWITCH_SYSTEM=-L/usr/local/lib
+   ;;
+
+  gnu-linux)
+   ## cpp test was "ifdef __mips__", but presumably this is equivalent...
+   test "$machine" = "mips" && LD_SWITCH_SYSTEM="-G 0"
+   ;;
+
+  netbsd)
+   LD_SWITCH_SYSTEM="-Wl,-rpath,/usr/pkg/lib -L/usr/pkg/lib -Wl,-rpath,/usr/local/lib -L/usr/local/lib"
+   ;;
+
+  openbsd)
+   ## Han Boetes <han@mijncomputer.nl> says this is necessary,
+   ## otherwise Emacs dumps core on elf systems.
+   LD_SWITCH_SYSTEM="-Z"
+   ;;
+esac
+AC_SUBST(LD_SWITCH_SYSTEM)
+
+ac_link="$ac_link $LD_SWITCH_SYSTEM"
+
+## This is fun.  Some settings of LD_SWITCH_SYSTEM reference
+## LD_SWITCH_X_SITE_AUX, which has not been defined yet.  When using
+## cpp, it was expanded to null.  Thus LD_SWITCH_SYSTEM had different
+## values in configure and the Makefiles.  How helpful.
+## FIXME why not use LD_SWITCH_SYSTEM_TEMACS (or somesuch) instead?
+case "$opsys" in
+  gnu-linux)
+   ## LD_SWITCH_X_SITE_AUX is a -R option saying where to find X at run-time.
+   LD_SWITCH_SYSTEM="$LD_SWITCH_SYSTEM \$(LD_SWITCH_X_SITE_AUX)" ;;
+
+  netbsd|openbsd)
+   ## _AUX_RPATH is like _AUX, but uses -rpath instead of -R.
+   LD_SWITCH_SYSTEM="\$(LD_SWITCH_X_SITE_AUX_RPATH) $LD_SWITCH_SYSTEM" ;;
+esac
 
 
 C_SWITCH_MACHINE=
@@ -988,6 +999,23 @@
 AC_SUBST(C_SWITCH_SYSTEM)
 
 
+LIBS_SYSTEM=
+case "$opsys" in
+  ## IBM's X11R5 uses -lIM and -liconv in AIX 3.2.2.
+  aix4-2) LIBS_SYSTEM="-lrts -lIM -liconv" ;;
+
+  freebsd) LIBS_SYSTEM="-lutil" ;;
+
+  hpux*) LIBS_SYSTEM="-l:libdld.sl" ;;
+
+  sol2*) LIBS_SYSTEM="-lsocket -lnsl -lkstat" ;;
+
+  ## Motif needs -lgen.
+  unixware) LIBS_SYSTEM="-lsocket -lnsl -lelf -lgen" ;;
+esac
+AC_SUBST(LIBS_SYSTEM)
+
+
 ### Make sure subsequent tests use flags consistent with the build flags.
 
 if test x"${OVERRIDE_CPPFLAGS}" != x; then
@@ -1039,8 +1067,47 @@
 
 AC_SUBST(CRT_DIR)
 
-
-dnl This function defintion taken from Gnome 2.0
+LIB_MATH=-lm
+LIB_STANDARD=
+START_FILES=
+
+case $opsys in
+  cygwin )
+    LIB_MATH=
+    START_FILES='ecrt0.o'
+    ;;
+  darwin )
+    ## Adding -lm confuses the dynamic linker, so omit it.
+    LIB_MATH=
+    START_FILES='pre-crt0.o'
+    ;;
+  freebsd )
+    LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o $(CRT_DIR)/crtn.o'
+    START_FILES='pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o $(CRT_DIR)/crtbegin.o'
+    ;;
+  gnu-linux | gnu-kfreebsd )
+    LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtn.o'
+    START_FILES='pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o'
+    ;;
+  hpux10-20 | hpux11 )
+    LIB_STANDARD=-lc
+    START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o'
+    ;;
+  netbsd | openbsd )
+    if test -f $(CRT_DIR)/crti.o; then
+	LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o $(CRT_DIR)/crtn.o'
+        START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o $(CRT_DIR)/crti.o $(CRT_DIR)/crtbegin.o'
+    else
+	LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o'
+	START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o $(CRT_DIR)/crtbegin.o'
+    fi
+    ;;
+esac
+
+AC_SUBST(LIB_MATH)
+AC_SUBST(START_FILES)
+
+dnl This function definition taken from Gnome 2.0
 dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
 dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
 dnl also defines GSTUFF_PKG_ERRORS on error
@@ -1410,6 +1477,7 @@
      CFLAGS="$CFLAGS -I${GNUSTEP_SYSTEM_HEADERS}"
      REAL_CFLAGS="$REAL_CFLAGS -I${GNUSTEP_SYSTEM_HEADERS}"
      LDFLAGS="$LDFLAGS -L${GNUSTEP_SYSTEM_LIBRARIES}"
+     LIB_STANDARD=
   fi
   AC_CHECK_HEADER([AppKit/AppKit.h], [HAVE_NS=yes],
   		  [AC_MSG_ERROR([`--with-ns' was specified, but the include
@@ -1442,6 +1510,7 @@
 CPPFLAGS="$tmp_CPPFLAGS"
 AC_SUBST(NS_OBJ)
 AC_SUBST(NS_SUPPORT)
+AC_SUBST(LIB_STANDARD)
 
 case "${window_system}" in
   x11 )
@@ -1530,7 +1599,7 @@
   REL_ALLOC=no
 fi
 
-LIBS="$libsrc_libs $LIBS"
+LIBS="$LIBS_SYSTEM $LIBS"
 
 dnl If found, this defines HAVE_LIBDNET, which m/pmax.h checks,
 dnl and also adds -ldnet to LIBS, which Autoconf uses for checks.
@@ -1544,6 +1613,18 @@
 
 AC_CHECK_LIB(pthreads, cma_open)
 
+## Note: when using cpp in s/aix4.2.h, this definition depended on
+## HAVE_LIBPTHREADS.  That was not defined earlier in configure when
+## the system file was sourced.  Hence the value of LIBS_SYSTEM
+## added to LIBS in configure would never contain the pthreads part,
+## but the value used in Makefiles might.  FIXME?
+##
+## -lpthreads seems to be necessary for Xlib in X11R6, and should
+## be harmless on older versions of X where it happens to exist.
+test "$opsys" = "aix4-2" && \
+  test $ac_cv_lib_pthreads_cma_open = yes && \
+  LIBS_SYSTEM="$LIBS_SYSTEM -lpthreads"
+
 dnl Check for need for bigtoc support on IBM AIX
 
 case ${host_os} in
@@ -2426,6 +2507,48 @@
 AC_CHECK_HEADERS(maillock.h)
 AC_SUBST(LIBS_MAIL)
 
+## Define MAIL_USE_FLOCK (or LOCKF) if the mailer uses flock (or lockf) to
+## interlock access to the mail spool.  The alternative is a lock file named
+## /usr/spool/mail/$USER.lock.
+mail_lock=no
+case "$opsys" in
+  aix4-2) mail_lock="lockf" ;;
+
+  gnu|freebsd|netbsd|openbsd|darwin|irix6-5) mail_lock="flock" ;;
+
+  ## On GNU/Linux systems, both methods are used by various mail programs.
+  ## I assume most people are using newer mailers that have heard of flock.
+  ## Change this if you need to.
+  ## Debian contains a patch which says: ``On Debian/GNU/Linux systems,
+  ## configure gets the right answers, and that means *NOT* using flock.
+  ## Using flock is guaranteed to be the wrong thing. See Debian Policy
+  ## for details.'' and then uses `#ifdef DEBIAN'.  Unfortunately the
+  ## Debian maintainer hasn't provided a clean fix for Emacs.
+  ## movemail.c will use `maillock' when MAILDIR, HAVE_LIBMAIL and
+  ## HAVE_MAILLOCK_H are defined, so the following appears to be the
+  ## correct logic.  -- fx
+  ## We must check for HAVE_LIBLOCKFILE too, as movemail does.
+  ## liblockfile is a Free Software replacement for libmail, used on
+  ## Debian systems and elsewhere. -rfr.
+  gnu-*)
+    mail_lock="flock"
+    if test $have_mail = yes || test $have_lockfile = yes; then
+      test $ac_cv_header_maillock_h = yes && mail_lock=no
+    fi
+    ;;
+esac
+
+BLESSMAIL_TARGET=
+case "$mail_lock" in
+  flock) AC_DEFINE(MAIL_USE_FLOCK, 1, [Define if the mailer uses flock to interlock the mail spool.]) ;;
+
+  lockf) AC_DEFINE(MAIL_USE_LOCKF, 1, [Define if the mailer uses lockf to interlock the mail spool.]) ;;
+
+  *) BLESSMAIL_TARGET="need-blessmail" ;;
+esac
+AC_SUBST(BLESSMAIL_TARGET)
+
+
 AC_CHECK_FUNCS(gethostname getdomainname dup2 \
 rename closedir mkdir rmdir sysinfo getrusage get_current_dir_name \
 random lrand48 bcopy bcmp logb frexp fmod rint cbrt ftime setsid \
@@ -2435,7 +2558,7 @@
 sendto recvfrom getsockopt setsockopt getsockname getpeername \
 gai_strerror mkstemp getline getdelim mremap memmove fsync sync bzero \
 memset memcmp difftime memcpy mempcpy mblen mbrlen posix_memalign \
-cfmakeraw cfsetspeed)
+cfmakeraw cfsetspeed isnan copysign)
 
 AC_CHECK_HEADERS(sys/un.h)
 
@@ -2471,7 +2594,7 @@
 # That is because we have not set up to link ncurses in lib-src.
 # It's better to believe a function is not available
 # than to expect to find it in ncurses.
-# Also we need tputs and frieds to be able to build at all.
+# Also we need tputs and friends to be able to build at all.
 have_tputs_et_al=true
 AC_SEARCH_LIBS(tputs, [ncurses terminfo termcap], , have_tputs_et_al=false)
 if test "$have_tputs_et_al" != true; then
@@ -2482,9 +2605,82 @@
 # Must define this when any termcap library is found.
 AC_DEFINE(HAVE_LIBNCURSES, 1,
           [Define to 1 if you have the `ncurses' library (-lncurses).])
+## FIXME This was the cpp logic, but I am not sure it is right.
+## The above test has not necessarily found libncurses.
+HAVE_LIBNCURSES=yes
+
+## Use terminfo instead of termcap?
+## Note only system files NOT using terminfo are:
+## bsd-common, freebsd < 40000, ms-w32, msdos, netbsd, and
+## darwin|gnu without ncurses.
+TERMINFO=no
+LIBS_TERMCAP=
+case "$opsys" in
+  ## cygwin: Fewer environment variables to go wrong, more terminal types.
+  ## hpux10-20: Use the system provided termcap(3) library.
+  ## openbsd: David Mazieres <dm@reeducation-labor.lcs.mit.edu> says this
+  ##  is necessary.  Otherwise Emacs dumps core when run -nw.
+  aix4-2|cygwin|hpux*|irix6-5|openbsd|usg5-4|sol2*|unixware) TERMINFO=yes ;;
+
+  ## darwin: Prevents crashes when running Emacs in Terminal.app under 10.2.
+  ##  The ncurses library has been moved out of the System framework in
+  ##  Mac OS X 10.2.  So if configure detects it, set the command-line
+  ##  option to use it.
+  darwin|gnu*)
+    ## (HAVE_LIBNCURSES was not always true, but is since 2010-03-18.)
+    if test "x$HAVE_LIBNCURSES" = "xyes"; then
+      TERMINFO=yes
+      LIBS_TERMCAP="-lncurses"
+    fi
+    ;;
+
+  freebsd)
+    AC_MSG_CHECKING([whether FreeBSD is new enough to use terminfo])
+    AC_CACHE_VAL(emacs_cv_freebsd_terminfo,
+    [AC_TRY_LINK([#include <osreldate.h>],
+[#if __FreeBSD_version < 400000
+fail;
+#endif
+], emacs_cv_freebsd_terminfo=yes, emacs_cv_freebsd_terminfo=no)])
+
+    AC_MSG_RESULT($emacs_cv_freebsd_terminfo)
+
+    if test $emacs_cv_freebsd_terminfo = yes; then
+      TERMINFO=yes
+      LIBS_TERMCAP="-lncurses"
+    else
+      LIBS_TERMCAP="-ltermcap"
+    fi
+    ;;
+
+esac
+
+case "$opsys" in
+  ## hpux: Make sure we get select from libc rather than from libcurses
+  ##  because libcurses on HPUX 10.10 has a broken version of select.
+  ##  We used to use -lc -lcurses, but this may be cleaner.
+  hpux*|netbsd) LIBS_TERMCAP="-ltermcap" ;;
+
+  openbsd) LIBS_TERMCAP="-lncurses" ;;
+
+  ## Must use system termcap, if we use any termcap.  It does special things.
+  sol2*) test "$TERMINFO" != yes && LIBS_TERMCAP="-ltermcap" ;;
+esac
+
+TERMCAP_OBJ=tparam.o
+if test $TERMINFO = yes; then
+  AC_DEFINE(TERMINFO, 1, [Define to 1 if you use terminfo instead of termcap.])
+
+  ## Default used to be -ltermcap.  Add a case above if need something else.
+  test "x$LIBS_TERMCAP" = "x" && LIBS_TERMCAP="-lcurses"
+
+  TERMCAP_OBJ=terminfo.o
+fi
+AC_SUBST(LIBS_TERMCAP)
+AC_SUBST(TERMCAP_OBJ)
+
 
 # Do we have res_init, for detecting changes in /etc/resolv.conf?
-
 resolv=no
 AC_TRY_LINK([#include <netinet/in.h>
 #include <arpa/nameser.h>
@@ -2794,6 +2990,14 @@
 CFLAGS="$REAL_CFLAGS"
 CPPFLAGS="$REAL_CPPFLAGS"
 
+## Hack to detect a buggy GCC version.
+if test "x$GCC" = xyes \
+   && test x"`$CC --version 2> /dev/null | grep 'gcc.* 4.5.0'`" != x \
+   && test x"`echo $CFLAGS | grep '\-O@<:@23@:>@'`" != x \
+   && test x"`echo $CFLAGS | grep '\-fno-optimize-sibling-calls'`" = x; then
+   AC_MSG_ERROR([GCC 4.5.0 has problems compiling Emacs; see etc/PROBLEMS'.])
+fi
+
 #### Find out which version of Emacs this is.
 [version=`grep 'defconst[	 ]*emacs-version' ${srcdir}/lisp/version.el \
 	 | sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`]
@@ -3013,6 +3217,23 @@
 AC_SUBST(LD_SWITCH_SYSTEM_TEMACS)
 
 
+## This exists because src/Makefile.in did some extra fiddling around
+## with LD_SWITCH_SYSTEM.  The cpp logic was:
+##   #ifndef LD_SWITCH_SYSTEM
+##   #if !defined (__GNUC__) && ((defined (BSD_SYSTEM) && !defined (COFF)))
+## Since all the *bsds define LD_SWITCH_SYSTEM, this simplifies to:
+## not using gcc, darwin system not on an alpha (ie darwin, since
+## darwin + alpha does not occur).
+## Note that unlike L_S_S, this is not used in ac_link.
+if test "x$LD_SWITCH_SYSTEM" = "x" && test "x$GCC" != "xyes" && \
+   test "$opsys" = "darwin"; then
+  LD_SWITCH_SYSTEM_EXTRA="-X"
+else
+  LD_SWITCH_SYSTEM_EXTRA=
+fi
+AC_SUBST(LD_SWITCH_SYSTEM_EXTRA)
+
+
 AH_TOP([/* GNU Emacs site configuration template file.
    Copyright (C) 1988, 1993, 1994, 1999, 2000, 2001, 2002, 2004, 2005,
      2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
--- a/doc/emacs/ChangeLog	Thu May 06 09:50:39 2010 +0900
+++ b/doc/emacs/ChangeLog	Mon May 10 12:37:03 2010 +0900
@@ -1,3 +1,28 @@
+2010-05-08  Chong Yidong  <cyd@stupidchicken.com>
+
+	* building.texi (GDB Graphical Interface): Remove misleading comparison
+	to an IDE (Bug#6128).
+
+2010-05-08  Štěpán Němec  <stepnem@gmail.com>  (tiny change)
+
+	* programs.texi (Man Page):
+	* misc.texi (Invoking emacsclient):
+	* mini.texi (Repetition):
+	* mark.texi (Setting Mark): Fix typos.
+
+2010-05-08  Chong Yidong  <cyd@stupidchicken.com>
+
+	* misc.texi (Printing): Document htmlfontify-buffer.
+
+2010-05-08  Glenn Morris  <rgm@gnu.org>
+
+	* calendar.texi (Displaying the Diary, Format of Diary File):
+	Fix external cross-references for TeX format output.
+
+2010-05-07  Chong Yidong  <cyd@stupidchicken.com>
+
+	* Version 23.2 released.
+
 2010-05-02  Jan Djärv  <jan.h.d@swipnet.se>
 
 	* cmdargs.texi (Initial Options): Mention --chdir.
--- a/doc/emacs/building.texi	Thu May 06 09:50:39 2010 +0900
+++ b/doc/emacs/building.texi	Mon May 10 12:37:03 2010 +0900
@@ -836,12 +836,11 @@
 @subsection GDB Graphical Interface
 
   The command @code{gdb} starts GDB in a graphical interface, using
-Emacs windows for display program state information.  In effect, this
-makes Emacs into an IDE (interactive development environment).  With
-it, you do not need to use textual GDB commands; you can control the
-debugging session with the mouse.  For example, you can click in the
-fringe of a source buffer to set a breakpoint there, or on a stack
-frame in the stack buffer to select that frame.
+Emacs windows for display program state information.  With it, you do
+not need to use textual GDB commands; you can control the debugging
+session with the mouse.  For example, you can click in the fringe of a
+source buffer to set a breakpoint there, or on a stack frame in the
+stack buffer to select that frame.
 
   This mode requires telling GDB that its ``screen size'' is
 unlimited, so it sets the height and width accordingly.  For correct
--- a/doc/emacs/calendar.texi	Thu May 06 09:50:39 2010 +0900
+++ b/doc/emacs/calendar.texi	Mon May 10 12:37:03 2010 +0900
@@ -1082,7 +1082,7 @@
 shown either in the buffer or in the mode line, depending on the display
 method you choose
 @iftex
-(@pxref{Diary Display,, emacs-xtra}).
+(@pxref{Diary Display,,, emacs-xtra, Specialized Emacs Features}).
 @end iftex
 @ifnottex
 (@pxref{Diary Display}).
@@ -1186,7 +1186,7 @@
 This entry will have a different appearance if you use the simple diary
 display
 @iftex
-(@pxref{Diary Display,, emacs-xtra}).
+(@pxref{Diary Display,,, emacs-xtra, Specialized Emacs Features}).
 @end iftex
 @ifnottex
 (@pxref{Diary Display}).
--- a/doc/emacs/mark.texi	Thu May 06 09:50:39 2010 +0900
+++ b/doc/emacs/mark.texi	Mon May 10 12:37:03 2010 +0900
@@ -80,7 +80,7 @@
 character in @acronym{ASCII}; usually, typing @kbd{C-@key{SPC}} on a
 text terminal gives the character @kbd{C-@@}.  This key is also bound
 to @code{set-mark-command}, so unless you are unlucky enough to have
-an text terminal that behaves differently, you might as well think of
+a text terminal that behaves differently, you might as well think of
 @kbd{C-@@} as @kbd{C-@key{SPC}}.}.  This sets the mark where point is,
 and activates it.  You can then move point away, leaving the mark
 behind.
--- a/doc/emacs/mini.texi	Thu May 06 09:50:39 2010 +0900
+++ b/doc/emacs/mini.texi	Mon May 10 12:37:03 2010 +0900
@@ -601,7 +601,7 @@
 unchanged.  You can also change the command by editing the Lisp
 expression before you execute it.  The repeated command is added to
 the front of the command history unless it is identical to the most
-recently item.
+recent item.
 
   Once inside the minibuffer for @kbd{C-x @key{ESC} @key{ESC}}, you can
 use the minibuffer history commands (@kbd{M-p}, @kbd{M-n}, @kbd{M-r},
--- a/doc/emacs/misc.texi	Thu May 06 09:50:39 2010 +0900
+++ b/doc/emacs/misc.texi	Mon May 10 12:37:03 2010 +0900
@@ -1528,7 +1528,7 @@
 @kbd{C-x #} (@code{server-edit}) in its buffer.  This saves the file
 and sends a message back to the @command{emacsclient} program, telling
 it to exit.  Programs that use @env{EDITOR} usually wait for the
-``editor''---in the case @command{emacsclient}---to exit before doing
+``editor''---in this case @command{emacsclient}---to exit before doing
 something else.
 
   You can also call @command{emacsclient} with multiple file name
@@ -1701,8 +1701,14 @@
   Emacs provides commands for printing hard copies of either an entire
 buffer or just part of one, with or without page headers.  You can
 invoke the printing commands directly, as detailed in the following
-section, or using the @samp{File} menu on the menu bar.  See also the
-hardcopy commands of Dired (@pxref{Misc File Ops}) and the diary
+section, or using the @samp{File} menu on the menu bar.
+
+@findex htmlfontify-buffer
+  Aside from the commands described in this section, you can also
+``print'' an Emacs buffer to HTML with @kbd{M-x htmlfontify-buffer}.
+This command converts the current buffer to a HTML file, replacing
+Emacs faces with CSS-based markup.  In addition, see the hardcopy
+commands of Dired (@pxref{Misc File Ops}) and the diary
 (@pxref{Displaying the Diary}).
 
 @table @kbd
--- a/doc/emacs/programs.texi	Thu May 06 09:50:39 2010 +0900
+++ b/doc/emacs/programs.texi	Mon May 10 12:37:03 2010 +0900
@@ -1202,7 +1202,7 @@
 your machine; the list of available manual pages is computed
 automatically the first time you invoke @code{woman}.  The word at
 point in the current buffer is used to suggest the default for the
-name the manual page.
+name of the manual page.
 
   With a numeric argument, @kbd{M-x woman} recomputes the list of the
 manual pages used for completion.  This is useful if you add or delete
--- a/doc/lispintro/ChangeLog	Thu May 06 09:50:39 2010 +0900
+++ b/doc/lispintro/ChangeLog	Mon May 10 12:37:03 2010 +0900
@@ -1,3 +1,7 @@
+2010-05-07  Chong Yidong  <cyd@stupidchicken.com>
+
+	* Version 23.2 released.
+
 2010-03-10  Chong Yidong  <cyd@stupidchicken.com>
 
 	* Branch for 23.2.
@@ -13,8 +17,7 @@
 
 2009-12-09  David Robinow  <drobinow@gmail.com>  (tiny change)
 
-	* makefile.w32-in: Use parenthesis for macros for nmake
-	compatibility.
+	* makefile.w32-in: Use parenthesis for macros for nmake compatibility.
 
 2009-12-03  Glenn Morris  <rgm@gnu.org>
 
@@ -72,7 +75,7 @@
 
 2009-02-22  Karl Berry  <karl@gnu.org>
 
-	* emacs-lisp-intro.texi (Default Configuration): fix dup word "by by".
+	* emacs-lisp-intro.texi (Default Configuration): Fix dup word "by by".
 
 2009-02-20  Juanma Barranquero  <lekktu@gmail.com>
 
--- a/doc/lispref/ChangeLog	Thu May 06 09:50:39 2010 +0900
+++ b/doc/lispref/ChangeLog	Mon May 10 12:37:03 2010 +0900
@@ -1,3 +1,38 @@
+2010-05-08  Štěpán Němec  <stepnem@gmail.com>  (tiny change)
+
+	* windows.texi (Textual Scrolling):
+	* tips.texi (Coding Conventions):
+	* minibuf.texi (Minibuffer History):
+	* maps.texi (Standard Keymaps):
+	* loading.texi (Where Defined):
+	* edebug.texi (Instrumenting): Fix typos.
+
+2010-05-08  Chong Yidong  <cyd@stupidchicken.com>
+
+	* keymaps.texi (Menu Bar): Document :advertised-binding property.
+
+	* functions.texi (Obsolete Functions):
+	Document set-advertised-calling-convention.
+
+	* minibuf.texi (Basic Completion): Document completion-in-region.
+	(Programmed Completion): Document completion-annotate-function.
+
+	* commands.texi (Reading One Event): Document read-key.
+	(Distinguish Interactive): Document KIND arg to
+	called-interactively-p.  Delete obsolete interactive-p.
+
+	* elisp.texi (Top): Update node description.
+
+2010-05-08  Eli Zaretskii  <eliz@gnu.org>
+
+	* nonascii.texi (Character Properties):
+	Document unicode-category-table.  Add an index entry for Unicode
+	general category.
+
+2010-05-07  Chong Yidong  <cyd@stupidchicken.com>
+
+	* Version 23.2 released.
+
 2010-04-20  Juanma Barranquero  <lekktu@gmail.com>
 
 	* locals.texi (Standard Buffer-Local Variables):
--- a/doc/lispref/commands.texi	Thu May 06 09:50:39 2010 +0900
+++ b/doc/lispref/commands.texi	Mon May 10 12:37:03 2010 +0900
@@ -696,71 +696,67 @@
 because it allows callers to say ``treat this call as interactive.''
 But you can also do the job by testing @code{called-interactively-p}.
 
-@defun called-interactively-p
+@defun called-interactively-p kind
 This function returns @code{t} when the calling function was called
 using @code{call-interactively}.
 
-If the containing function was called by Lisp evaluation (or with
-@code{apply} or @code{funcall}), then it was not called interactively.
+The argument @var{kind} should be either the symbol @code{interactive}
+or the symbol @code{any}.  If it is @code{interactive}, then
+@code{called-interactively-p} returns @code{t} only if the call was
+made directly by the user---e.g., if the user typed a key sequence
+bound to the calling function, but @emph{not} if the user ran a
+keyboard macro that called the function (@pxref{Keyboard Macros}).  If
+@var{kind} is @code{any}, @code{called-interactively-p} returns
+@code{t} for any kind of interactive call, including keyboard macros.
+
+If in doubt, use @code{any}; the only known proper use of
+@code{interactive} is if you need to decide whether to display a
+helpful message while a function is running.
+
+A function is never considered to be called interactively if it was
+called via Lisp evaluation (or with @code{apply} or @code{funcall}).
 @end defun
 
-   Here's an example of using @code{called-interactively-p}:
+@noindent
+Here is an example of using @code{called-interactively-p}:
 
 @example
 @group
 (defun foo ()
   (interactive)
-  (when (called-interactively-p)
-    (message "foo"))
-  'haha)
-     @result{} foo
+  (when (called-interactively-p 'any)
+    (message "Interactive!")
+    'foo-called-interactively))
 @end group
 
 @group
 ;; @r{Type @kbd{M-x foo}.}
-     @print{} foo
+     @print{} Interactive!
 @end group
 
 @group
 (foo)
-     @result{} haha
+     @result{} nil
 @end group
 @end example
 
-  Here is another example that contrasts direct and indirect
-calls to @code{called-interactively-p}.
+@noindent
+Here is another example that contrasts direct and indirect calls to
+@code{called-interactively-p}.
 
 @example
 @group
 (defun bar ()
   (interactive)
-  (setq foobar (list (foo) (called-interactively-p))))
-     @result{} bar
+  (message "%s" (list (foo) (called-interactively-p 'any))))
 @end group
 
 @group
 ;; @r{Type @kbd{M-x bar}.}
-;; @r{This does not display a message.}
-@end group
-
-@group
-foobar
-     @result{} (nil t)
+     @print{} (nil t)
 @end group
 @end example
 
-  If you want to treat commands run in keyboard macros just like calls
-from Lisp programs, test @code{interactive-p} instead of
-@code{called-interactively-p}.
-
-@defun interactive-p
-This function returns @code{t} if the containing function (the one
-whose code includes the call to @code{interactive-p}) was called in
-direct response to user input.  This means that it was called with the
-function @code{call-interactively}, and that a keyboard macro is
-not running, and that Emacs is not running in batch mode.
-@end defun
-
 @node Command Loop Info
 @comment  node-name,  next,  previous,  up
 @section Information from the Command Loop
@@ -2309,10 +2305,8 @@
 @cindex reading a single event
 @cindex event, reading only one
 
-  The lowest level functions for command input are those that read a
-single event.
-
-None of the three functions below suppresses quitting.
+  The lowest level functions for command input are @code{read-event},
+@code{read-char}, and @code{read-char-exclusive}.
 
 @defun read-event &optional prompt inherit-input-method seconds
 This function reads and returns the next event of command input, waiting
@@ -2409,11 +2403,31 @@
 gets a character.  The arguments work as in @code{read-event}.
 @end defun
 
+  None of the above functions suppress quitting.
+
 @defvar num-nonmacro-input-events
 This variable holds the total number of input events received so far
 from the terminal---not counting those generated by keyboard macros.
 @end defvar
 
+  We emphasize that, unlike @code{read-key-sequence}, the functions
+@code{read-event}, @code{read-char}, and @code{read-char-exclusive} do
+not perform the translations described in @ref{Translation Keymaps}.
+If you wish to read a single key taking these translations into
+account, use the function @code{read-key}:
+
+@defun read-key &optional prompt
+This function reads a single key.  It is ``intermediate'' between
+@code{read-key-sequence} and @code{read-event}.  Unlike the former, it
+reads a single key, not a key sequence.  Unlike the latter, it does
+not return a raw event, but decodes and translates the user input
+according to @code{input-decode-map}, @code{local-function-key-map},
+and @code{key-translation-map} (@pxref{Translation Keymaps}).
+
+The argument @var{prompt} is either a string to be displayed in the
+echo area as a prompt, or @code{nil}, meaning not to display a prompt.
+@end defun
+
 @node Event Mod
 @subsection Modifying and Translating Input Events
 
--- a/doc/lispref/edebug.texi	Thu May 06 09:50:39 2010 +0900
+++ b/doc/lispref/edebug.texi	Mon May 10 12:37:03 2010 +0900
@@ -186,7 +186,7 @@
 
   While Edebug is active, the command @kbd{I}
 (@code{edebug-instrument-callee}) instruments the definition of the
-function or macro called by the list form after point, if is not already
+function or macro called by the list form after point, if it is not already
 instrumented.  This is possible only if Edebug knows where to find the
 source for that function; for this reason, after loading Edebug,
 @code{eval-region} records the position of every definition it
--- a/doc/lispref/elisp.texi	Thu May 06 09:50:39 2010 +0900
+++ b/doc/lispref/elisp.texi	Mon May 10 12:37:03 2010 +0900
@@ -649,7 +649,6 @@
 Completion
 
 * Basic Completion::        Low-level functions for completing strings.
-                              (These are too low level to use the minibuffer.)
 * Minibuffer Completion::   Invoking the minibuffer with completion.
 * Completion Commands::     Minibuffer commands that do completion.
 * High-Level Completion::   Convenient special cases of completion
--- a/doc/lispref/functions.texi	Thu May 06 09:50:39 2010 +0900
+++ b/doc/lispref/functions.texi	Mon May 10 12:37:03 2010 +0900
@@ -1197,7 +1197,7 @@
 @end defun
 
 You can define a function as an alias and declare it obsolete at the
-same time using the macro @code{define-obsolete-function-alias}.
+same time using the macro @code{define-obsolete-function-alias}:
 
 @defmac define-obsolete-function-alias obsolete-name current-name &optional when docstring
 This macro marks the function @var{obsolete-name} obsolete and also
@@ -1210,6 +1210,33 @@
 @end example
 @end defmac
 
+In addition, you can mark a certain a particular calling convention
+for a function as obsolete:
+
+@defun set-advertised-calling-convention function signature
+This function specifies the argument list @var{signature} as the
+correct way to call @var{function}.  This causes the Emacs byte
+compiler to issue a warning whenever it comes across an Emacs Lisp
+program that calls @var{function} any other way (however, it will
+still allow the code to be byte compiled).
+
+For instance, in old versions of Emacs the @code{sit-for} function
+accepted three arguments, like this
+
+@smallexample
+  (sit-for seconds milliseconds nodisp)
+@end smallexample
+
+However, calling @code{sit-for} this way is considered obsolete
+(@pxref{Waiting}).  The old calling convention is deprecated like
+this:
+
+@smallexample
+(set-advertised-calling-convention
+  'sit-for '(seconds &optional nodisp))
+@end smallexample
+@end defun
+
 @node Inline Functions
 @section Inline Functions
 @cindex inline functions
--- a/doc/lispref/keymaps.texi	Thu May 06 09:50:39 2010 +0900
+++ b/doc/lispref/keymaps.texi	Mon May 10 12:37:03 2010 +0900
@@ -2470,9 +2470,13 @@
 @cindex menu bar
 
   Most window systems allow each frame to have a @dfn{menu bar}---a
-permanently displayed menu stretching horizontally across the top of the
-frame.  The items of the menu bar are the subcommands of the fake
-``function key'' @code{menu-bar}, as defined in the active keymaps.
+permanently displayed menu stretching horizontally across the top of
+the frame.  (In order for a frame to display a menu bar, its
+@code{menu-bar-lines} parameter must be greater than zero.
+@xref{Layout Parameters}.)
+
+  The items of the menu bar are the subcommands of the fake ``function
+key'' @code{menu-bar}, as defined in the active keymaps.
 
   To add an item to the menu bar, invent a fake ``function key'' of your
 own (let's call it @var{key}), and make a binding for the key sequence
@@ -2490,13 +2494,6 @@
 from the keymaps that would be active if @code{overriding-local-map}
 were @code{nil}.  @xref{Active Keymaps}.
 
-  In order for a frame to display a menu bar, its @code{menu-bar-lines}
-parameter must be greater than zero.  Emacs uses just one line for the
-menu bar itself; if you specify more than one line, the other lines
-serve to separate the menu bar from the windows in the frame.  We
-recommend 1 or 2 as the value of @code{menu-bar-lines}.  @xref{Layout
-Parameters}.
-
   Here's an example of setting up a menu bar item:
 
 @example
@@ -2535,8 +2532,8 @@
 @end example
 
 @noindent
-@code{edit} is the fake function key used by the global map for the
-@samp{Edit} menu bar item.  The main reason to suppress a global
+Here, @code{edit} is the fake function key used by the global map for
+the @samp{Edit} menu bar item.  The main reason to suppress a global
 menu bar item is to regain space for mode-specific items.
 
 @defvar menu-bar-final-items
@@ -2557,6 +2554,23 @@
 in the usual case.
 @end defvar
 
+Next to every menu bar item, Emacs displays a key binding that runs
+the same command (if such a key binding exists).  This serves as a
+convenient hint for users who do not know the key binding.  If a
+command has multiple bindings, Emacs normally displays the first one
+it finds.  You can specify one particular key binding by assigning an
+@code{:advertised-binding} symbol property to the command.  For
+instance, the following tells Emacs to show @kbd{C-/} for the
+@code{undo} menu item:
+
+@smallexample
+(put 'undo :advertised-binding [?\C-/])
+@end smallexample
+
+@noindent
+If the @code{:advertised-binding} property specifies a key binding
+that the command does not actually have, it is ignored.
+
 @node Tool Bar
 @subsection Tool bars
 @cindex tool bar
--- a/doc/lispref/loading.texi	Thu May 06 09:50:39 2010 +0900
+++ b/doc/lispref/loading.texi	Mon May 10 12:37:03 2010 +0900
@@ -823,7 +823,7 @@
 @code{load-history}.
 
 @defvar load-history
-This value of this variable is an alist that associates the names of
+The value of this variable is an alist that associates the names of
 loaded library files with the names of the functions and variables
 they defined, as well as the features they provided or required.
 
--- a/doc/lispref/locals.texi	Thu May 06 09:50:39 2010 +0900
+++ b/doc/lispref/locals.texi	Mon May 10 12:37:03 2010 +0900
@@ -85,6 +85,9 @@
 @item case-fold-search
 @xref{Searching and Case}.
 
+@item comment-column
+@xref{Comments,,, emacs, The GNU Emacs Manual}.
+
 @item ctl-arrow
 @xref{Usual Display}.
 
@@ -94,9 +97,6 @@
 @item cursor-type
 @xref{Cursor Parameters}.
 
-@item comment-column
-@xref{Comments,,, emacs, The GNU Emacs Manual}.
-
 @item default-directory
 @xref{File Name Expansion}.
 
--- a/doc/lispref/maps.texi	Thu May 06 09:50:39 2010 +0900
+++ b/doc/lispref/maps.texi	Mon May 10 12:37:03 2010 +0900
@@ -163,7 +163,7 @@
 
 @item key-translation-map
 A keymap for translating keys.  This one overrides ordinary key
-bindings, unlike @code{local- function-key-map}.  @xref{Translation
+bindings, unlike @code{local-function-key-map}.  @xref{Translation
 Keymaps}.
 
 @item kmacro-map
--- a/doc/lispref/minibuf.texi	Thu May 06 09:50:39 2010 +0900
+++ b/doc/lispref/minibuf.texi	Mon May 10 12:37:03 2010 +0900
@@ -511,7 +511,7 @@
 @defopt history-length
 The value of this variable specifies the maximum length for all
 history lists that don't specify their own maximum lengths.  If the
-value is @code{t}, that means there no maximum (don't delete old
+value is @code{t}, that means there is no maximum (don't delete old
 elements).  The value of @code{history-length} property of the history
 list variable's symbol, if set, overrides this variable for that
 particular history list.
@@ -626,7 +626,6 @@
 
 @menu
 * Basic Completion::       Low-level functions for completing strings.
-                             (These are too low level to use the minibuffer.)
 * Minibuffer Completion::  Invoking the minibuffer with completion.
 * Completion Commands::    Minibuffer commands that do completion.
 * High-Level Completion::  Convenient special cases of completion
@@ -640,31 +639,23 @@
 @node Basic Completion
 @subsection Basic Completion Functions
 
-  The completion functions @code{try-completion},
-@code{all-completions} and @code{test-completion} have nothing in
-themselves to do with minibuffers.  We describe them in this chapter
-so as to keep them near the higher-level completion features that do
-use the minibuffer.
-
-  If you store a completion alist in a variable, you should mark the
-variable as ``risky'' with a non-@code{nil}
-@code{risky-local-variable} property.
+  The following completion functions have nothing in themselves to do
+with minibuffers.  We describe them here to keep them near the
+higher-level completion features that do use the minibuffer.
 
 @defun try-completion string collection &optional predicate
 This function returns the longest common substring of all possible
 completions of @var{string} in @var{collection}.  The value of
 @var{collection} must be a list of strings or symbols, an alist, an
-obarray, a hash table, or a function that implements a virtual set of
-strings (see below).
+obarray, a hash table, or a completion function (@pxref{Programmed
+Completion}).
 
 Completion compares @var{string} against each of the permissible
-completions specified by @var{collection}; if the beginning of the
-permissible completion equals @var{string}, it matches.  If no permissible
-completions match, @code{try-completion} returns @code{nil}.  If only
-one permissible completion matches, and the match is exact, then
-@code{try-completion} returns @code{t}.  Otherwise, the value is the
-longest initial sequence common to all the permissible completions that
-match.
+completions specified by @var{collection}.  If no permissible
+completions match, @code{try-completion} returns @code{nil}.  If there
+is just one matching completion, and the match is exact, it returns
+@code{t}.  Otherwise, it returns the longest initial sequence common
+to all possible matching completions.
 
 If @var{collection} is an alist (@pxref{Association Lists}), the
 permissible completions are the elements of the alist that are either
@@ -688,13 +679,13 @@
 If @var{collection} is a hash table, then the keys that are strings
 are the possible completions.  Other keys are ignored.
 
-You can also use a symbol that is a function as @var{collection}.  Then
-the function is solely responsible for performing completion;
+You can also use a symbol that is a function as @var{collection}.
+Then the function is solely responsible for performing completion;
 @code{try-completion} returns whatever this function returns.  The
 function is called with three arguments: @var{string}, @var{predicate}
-and @code{nil}.  (The reason for the third argument is so that the same
+and @code{nil} (the reason for the third argument is so that the same
 function can be used in @code{all-completions} and do the appropriate
-thing in either case.)  @xref{Programmed Completion}.
+thing in either case).  @xref{Programmed Completion}.
 
 If the argument @var{predicate} is non-@code{nil}, then it must be a
 function of one argument, unless @var{collection} is a hash table, in
@@ -823,6 +814,10 @@
 it returns, @code{test-completion} returns in turn.
 @end defun
 
+If you store a completion alist in a variable, you should mark the
+variable as ``risky'' with a non-@code{nil}
+@code{risky-local-variable} property.  @xref{File Local Variables}.
+
 @defvar completion-ignore-case
 If the value of this variable is non-@code{nil}, Emacs does not
 consider case significant in completion.  Note, however, that this
@@ -855,6 +850,23 @@
 @end smallexample
 @end defmac
 
+The function @code{completion-in-region} provides a convenient way to
+perform completion on an arbitrary stretch of text in an Emacs buffer:
+
+@defun completion-in-region start end collection &optional predicate
+This function completes the text in the current buffer between the
+positions @var{start} and @var{end}, using @var{collection}.  The
+argument @var{collection} has the same meaning as in
+@code{try-completion} (@pxref{Basic Completion}).
+
+This function inserts the completion text directly into the current
+buffer.  Unlike @code{completing-read} (@pxref{Minibuffer
+Completion}), it does not activate the minibuffer.
+
+For this function to work, point must be somewhere between @var{start}
+and @var{end}.
+@end defun
+
 @node Minibuffer Completion
 @subsection Completion and the Minibuffer
 @cindex minibuffer completion
@@ -869,12 +881,12 @@
 @var{prompt}, which must be a string.
 
 The actual completion is done by passing @var{collection} and
-@var{predicate} to the function @code{try-completion}.  This happens
-in certain commands bound in the local keymaps used for completion.
-Some of these commands also call @code{test-completion}.  Thus, if
-@var{predicate} is non-@code{nil}, it should be compatible with
-@var{collection} and @code{completion-ignore-case}.  @xref{Definition
-of test-completion}.
+@var{predicate} to the function @code{try-completion} (@pxref{Basic
+Completion}).  This happens in certain commands bound in the local
+keymaps used for completion.  Some of these commands also call
+@code{test-completion}.  Thus, if @var{predicate} is non-@code{nil},
+it should be compatible with @var{collection} and
+@code{completion-ignore-case}.  @xref{Definition of test-completion}.
 
 The value of the optional argument @var{require-match} determines how
 the user may exit the minibuffer:
@@ -1603,8 +1615,10 @@
 
   Sometimes it is not possible to create an alist or an obarray
 containing all the intended possible completions.  In such a case, you
-can supply your own function to compute the completion of a given string.
-This is called @dfn{programmed completion}.
+can supply your own function to compute the completion of a given
+string.  This is called @dfn{programmed completion}.  Emacs uses
+programmed completion when completing file names (@pxref{File Name
+Completion}).
 
   To use this feature, pass a symbol with a function definition as the
 @var{collection} argument to @code{completing-read}.  The function
@@ -1659,9 +1673,6 @@
 function.  So you must arrange for any function you wish to use for
 completion to be encapsulated in a symbol.
 
-  Emacs uses programmed completion when completing file names.
-@xref{File Name Completion}.
-
 @defun completion-table-dynamic function
 This function is a convenient way to write a function that can act as
 programmed completion function.  The argument @var{function} should be
@@ -1671,6 +1682,19 @@
 and the interface for programmed completion functions.
 @end defun
 
+@defvar completion-annotate-function
+The value of this variable, if non-@code{nil}, should be a function
+for ``annotating'' the entries in the @samp{*Completions*} buffer.
+The function should accept a single argument, the completion string
+for an entry.  It should return an additional string to display next
+to that entry in the @samp{*Completions*} buffer, or @code{nil} if no
+additional string is to be displayed.
+
+The function can determine the collection used for the current
+completion via the variable @code{minibuffer-completion-table}
+(@pxref{Completion Commands}).
+@end defvar
+
 @node Yes-or-No Queries
 @section Yes-or-No Queries
 @cindex asking the user questions
--- a/doc/lispref/nonascii.texi	Thu May 06 09:50:39 2010 +0900
+++ b/doc/lispref/nonascii.texi	Mon May 10 12:37:03 2010 +0900
@@ -375,6 +375,7 @@
 value is a string consisting of upper-case Latin letters A to Z,
 digits, spaces, and hyphen @samp{-} characters.
 
+@cindex unicode general category
 @item general-category
 This property corresponds to the Unicode @code{General_Category}
 property.  The value is a symbol whose name is a 2-letter abbreviation
@@ -501,13 +502,18 @@
 @var{propname} for the character @var{char}.
 @end defun
 
-@defvar char-script-table
+@defvar unicode-category-table
 The value of this variable is a char-table (@pxref{Char-Tables}) that
-specifies, for each character, a symbol whose name is the script to
-which the character belongs, according to the Unicode Standard
-classification of the Unicode code space into script-specific blocks.
-This char-table has a single extra slot whose value is the list of all
-script symbols.
+specifies, for each character, its Unicode @code{General_Category}
+property as a symbol.
+@end defvar
+
+@defvar char-script-table
+The value of this variable is a char-table that specifies, for each
+character, a symbol whose name is the script to which the character
+belongs, according to the Unicode Standard classification of the
+Unicode code space into script-specific blocks.  This char-table has a
+single extra slot whose value is the list of all script symbols.
 @end defvar
 
 @defvar char-width-table
--- a/doc/lispref/tips.texi	Thu May 06 09:50:39 2010 +0900
+++ b/doc/lispref/tips.texi	Mon May 10 12:37:03 2010 +0900
@@ -90,7 +90,7 @@
 If a file requires certain other Lisp programs to be loaded
 beforehand, then the comments at the beginning of the file should say
 so.  Also, use @code{require} to make sure they are loaded.
-x@xref{Named Features}.
+@xref{Named Features}.
 
 @item
 If a file @var{foo} uses a macro defined in another file @var{bar},
--- a/doc/lispref/windows.texi	Thu May 06 09:50:39 2010 +0900
+++ b/doc/lispref/windows.texi	Mon May 10 12:37:03 2010 +0900
@@ -1661,8 +1661,8 @@
 @end defopt
 
 @defopt scroll-step
-This variable is an older variant of @code{scroll-conservatively}.  The
-difference is that it if its value is @var{n}, that permits scrolling
+This variable is an older variant of @code{scroll-conservatively}.
+The difference is that if its value is @var{n}, that permits scrolling
 only by precisely @var{n} lines, not a smaller number.  This feature
 does not work with @code{scroll-margin}.  The default value is zero.
 @end defopt
--- a/doc/man/ChangeLog	Thu May 06 09:50:39 2010 +0900
+++ b/doc/man/ChangeLog	Mon May 10 12:37:03 2010 +0900
@@ -1,11 +1,15 @@
+2010-05-07  Chong Yidong  <cyd@stupidchicken.com>
+
+	* Version 23.2 released.
+
 2010-03-10  Chong Yidong  <cyd@stupidchicken.com>
 
 	* Branch for 23.2.
 
 2010-01-09  Chong Yidong  <cyd@stupidchicken.com>
 
-	* emacs.1: Copyedits.  Update options -Q, -mm and --daemon.  Remove
-	deprecated --unibyte option.
+	* emacs.1: Copyedits.  Update options -Q, -mm and --daemon.
+	Remove deprecated --unibyte option.
 
 2009-06-21  Chong Yidong  <cyd@stupidchicken.com>
 
--- a/doc/misc/ChangeLog	Thu May 06 09:50:39 2010 +0900
+++ b/doc/misc/ChangeLog	Mon May 10 12:37:03 2010 +0900
@@ -1,11 +1,28 @@
+2010-05-08  Štěpán Němec  <stepnem@gmail.com>  (tiny change)
+
+	* url.texi (HTTP language/coding, Customization):
+	* message.texi (Header Commands, Responses):
+	* cl.texi (Argument Lists): Fix typos.
+
+2010-05-08  Chong Yidong  <cyd@stupidchicken.com>
+
+	* ede.texi (EDE Mode): Refer to init file rather than `.emacs'.
+	Note that Development menu is always available.
+	(Creating a project): Fix terminology.
+	(Add/Remove files): Fix typo.
+
+2010-05-07  Chong Yidong  <cyd@stupidchicken.com>
+
+	* Version 23.2 released.
+
 2010-05-01  Daniel E. Doherty <ddoherty03@gmail.com> (tiny change)
 
 	* calc.texi (Tutorial): Use "^{\prime}" to indicate primes.
 
 2010-05-01  Michael Albinus  <michael.albinus@gmx.de>
 
-	* tramp.texi (Inline methods, Default Method): Mention
-	`tramp-inline-compress-start-size'.
+	* tramp.texi (Inline methods, Default Method):
+	Mention `tramp-inline-compress-start-size'.
 
 2010-04-18  Teodor Zlatanov  <tzz@lifelogs.com>
 
--- a/doc/misc/cl.texi	Thu May 06 09:50:39 2010 +0900
+++ b/doc/misc/cl.texi	Mon May 10 12:37:03 2010 +0900
@@ -356,7 +356,7 @@
 calls to it may be expanded into in-line code by the byte compiler.
 This is analogous to the @code{defsubst} form;
 @code{defsubst*} uses a different method (compiler macros) which
-works in all version of Emacs, and also generates somewhat more
+works in all versions of Emacs, and also generates somewhat more
 efficient inline expansions.  In particular, @code{defsubst*}
 arranges for the processing of keyword arguments, default values,
 etc., to be done at compile-time whenever possible.
--- a/doc/misc/ede.texi	Thu May 06 09:50:39 2010 +0900
+++ b/doc/misc/ede.texi	Mon May 10 12:37:03 2010 +0900
@@ -129,27 +129,26 @@
 @node EDE Mode, Creating a project, EDE Project Concepts, top
 @chapter @ede{} Mode
 
-@ede{} is implemented as a minor-mode, which augments other modes such
+@ede{} is implemented as a minor mode, which augments other modes such
 as C mode, and Texinfo mode.  You can enable @ede{} for all buffers by
 running the command @code{global-ede-mode}, or by putting this in your
-@file{~/.emacs} file:
+init file:
 
 @example
 (global-ede-mode t)
 @end example
 
-When @ede{} is active for a given buffer, the menu item
-``Development'' appears.  This menu provides several menu items for
-high-level @ede{} commands.  These menu items, and their corresponding
-keybindings, are independent of the type of project you are actually
-working on.
+Activating @ede{} adds a menu named @samp{Development} to the menu
+bar.  This menu provides several menu items for high-level @ede{}
+commands.  These menu items, and their corresponding keybindings, are
+independent of the type of project you are actually working on.
 
 @node Creating a project, Modifying your project, EDE Mode, top
 @chapter Creating a project
 
 To create a new project, first visit a file that you want to include
-in that project.  If you have a hierarchy of directories, choose a
-file in the topmost directory first.  From this buffer, type @kbd{M-x
+in that project.  If you have a hierarchy of directories, first visit
+a file in the topmost directory.  From this buffer, type @kbd{M-x
 ede-new}, or click on the @samp{Create Project} item in the
 @samp{Development} menu.
 
@@ -220,8 +219,8 @@
 @node Add/Remove target, Add/Remove files, Modifying your project, Modifying your project
 @section Add/Remove target
 
-To create a new target, type @kbd{C-c . t} (@code{M-x ede-new-target})
-or use the @samp{Add Target} menu item in the @samp{Project Options}
+To create a new target, type @kbd{C-c . t} (@code{ede-new-target}) or
+use the @samp{Add Target} menu item in the @samp{Project Options}
 submenu.  This prompts for a target name, and adds the current buffer
 to that target.
 
@@ -237,7 +236,7 @@
 @section Add/Remove files
 
 To add the current file to an existing target, type @kbd{C-c . a}
-(@code{ede-add-file}), or or use the @samp{Add File} menu item in the
+(@code{ede-add-file}), or use the @samp{Add File} menu item in the
 @samp{Target Options} submenu.
 
 You can add a file to more than one target; this is OK.
--- a/doc/misc/message.texi	Thu May 06 09:50:39 2010 +0900
+++ b/doc/misc/message.texi	Mon May 10 12:37:03 2010 +0900
@@ -659,7 +659,7 @@
 @findex message-insert-disposition-notification-to
 Insert a request for a disposition
 notification.  (@code{message-insert-disposition-notification-to}).
-This means that if the recipient support RFC 2298 she might send you a
+This means that if the recipient supports RFC 2298 she might send you a
 notification that she received the message.
 
 @item M-x message-insert-importance-high
@@ -2387,7 +2387,7 @@
 
 @item wide reply
 A @dfn{wide reply} is a mail response that includes @emph{all} entities
-mentioned in the message you are responded to.  All mailboxes from the
+mentioned in the message you are responding to.  All mailboxes from the
 following headers will be concatenated to form the outgoing
 @code{To}/@code{Cc} headers:
 
--- a/doc/misc/url.texi	Thu May 06 09:50:39 2010 +0900
+++ b/doc/misc/url.texi	Mon May 10 12:37:03 2010 +0900
@@ -313,7 +313,7 @@
 variables, the value is a string; it can specify a single choice, or
 it can be a comma-separated list.
 
-Normally this list ordered by descending preference.  However, each
+Normally, this list is ordered by descending preference.  However, each
 element can be followed by @samp{;q=@var{priority}} to specify its
 preference level, a decimal number from 0 to 1; e.g., for
 @code{url-mime-language-string}, @w{@code{"de, en-gb;q=0.8,
@@ -1120,11 +1120,11 @@
 
 @defopt url-debug
 @cindex debugging
-Specifies the types of debug messages the library which are logged to
+Specifies the types of debug messages which are logged to
 the @code{*URL-DEBUG*} buffer.
 @code{t} means log all messages.
 A number means log all messages and show them with @code{message}.
-If may also be a list of the types of messages to be logged.
+It may also be a list of the types of messages to be logged.
 @end defopt
 @defopt url-personal-mail-address
 @end defopt
--- a/etc/AUTHORS	Thu May 06 09:50:39 2010 +0900
+++ b/etc/AUTHORS	Mon May 10 12:37:03 2010 +0900
@@ -92,7 +92,7 @@
 
 Alexander Becher: changed vc-annotate.el
 
-Alexander Klimov: changed man.el
+Alexander Klimov: changed calc-graph.el man.el
 
 Alexander Kreuzer: changed nnrss.el
 
@@ -167,9 +167,9 @@
 Andreas Politz: changed editfns.c elp.el ido.el term.el
 
 Andreas Schwab: changed Makefile.in configure.in lisp.h xdisp.c files.el
-  coding.c alloc.c process.c print.c editfns.c fileio.c fns.c dired.el
+  coding.c alloc.c process.c fileio.c print.c editfns.c fns.c dired.el
   xterm.c keyboard.c simple.el eval.c info.el buffer.c sysdep.c emacs.c
-  and 483 other files
+  and 485 other files
 
 Andreas Seltenreich: changed nnweb.el gnus.texi message.el gnus.el
   nnslashdot.el gnus-util.el mm-url.el mm-uu.el url-http.el xterm.c
@@ -435,8 +435,8 @@
 and co-wrote longlines.el
 and changed xdisp.c simple.el files.el display.texi frames.texi
   files.texi emacs.texi keyboard.c cus-edit.el faces.el xterm.c
-  Makefile.in xfaces.c font.c startup.el xfns.c misc.texi image.c
-  compile.el custom.texi text.texi and 633 other files
+  Makefile.in misc.texi xfaces.c font.c startup.el xfns.c compile.el
+  image.c custom.texi configure.in and 635 other files
 
 Chris Chase: co-wrote idlw-shell.el idlwave.el
 
@@ -868,7 +868,7 @@
 and changed msdos.c makefile.w32-in Makefile.in files.el info.el rmail.el
   fileio.c mainmake.v2 pc-win.el startup.el config.bat simple.el msdos.h
   dired.c w32.c frame.c internal.el menu-bar.el process.c INSTALL
-  xfaces.c and 602 other files
+  xfaces.c and 603 other files
 
 Elias Oltmanns: changed tls.el gnus-agent.el gnus-int.el gnus-srvr.el
   gnus.el
@@ -1002,7 +1002,7 @@
 Florian Weimer: changed message.el gnus.el coding.c gnus-sum.el gnus.texi
   mm-decode.el mm-util.el
 
-Francesc Rocher: changed startup.el MORE.STUFF cus-start.el gnus.el
+Francesc Rocher: changed MORE.STUFF startup.el cus-start.el gnus.el
   gnus.png gnus.svg macterm.c splash.png splash.svg splash8.xpm w32term.c
   xdisp.c xterm.c
 
@@ -1131,9 +1131,9 @@
 Glenn Morris: wrote check-declare.el
 and changed Makefile.in calendar.el diary-lib.el rmail.el f90.el
   cal-menu.el cal-hebrew.el fortran.el holidays.el configure.in
-  cal-islam.el bytecomp.el calendar.texi cal-bahai.el files.el appt.el
-  cal-china.el emacs.texi rmailsum.el simple.el startup.el
-  and 975 other files
+  cal-islam.el bytecomp.el calendar.texi cal-bahai.el emacs.texi files.el
+  appt.el cal-china.el rmailsum.el simple.el startup.el
+  and 976 other files
 
 Glynn Clements: wrote gamegrid.el snake.el tetris.el
 
@@ -1346,7 +1346,7 @@
 and changed gtkutil.c xterm.c xfns.c configure.in xterm.h xmenu.c
   x-win.el Makefile.in gtkutil.h keyboard.c frame.c frames.texi config.in
   emacs.c xselect.c xresources.texi startup.el alloc.c cus-start.el
-  xlwmenu.c process.c and 203 other files
+  xlwmenu.c frame.h and 203 other files
 
 Jan Moringen: co-wrote cpp.el
 
@@ -1635,7 +1635,7 @@
 Juanma Barranquero: changed makefile.w32-in subr.el files.el faces.el
   bs.el help-fns.el w32fns.c org.el server.el simple.el emacsclient.c
   desktop.el buffer.c mule-cmds.el ido.el window.c xdisp.c allout.el
-  keyboard.c replace.el eval.c and 930 other files
+  keyboard.c replace.el eval.c and 932 other files
 
 Juergen Hoetzel: changed url-handlers.el
 
@@ -1657,7 +1657,7 @@
 and changed info.el isearch.el simple.el replace.el dired-aux.el
   startup.el grep.el compile.el dired.el files.el faces.el display.texi
   menu-bar.el descr-text.el cus-edit.el bindings.el man.el image-mode.el
-  ispell.el text.texi dired-x.el and 280 other files
+  ispell.el text.texi dired-x.el and 281 other files
 
 Justin Bogner: changed fortune.el
 
@@ -1770,7 +1770,7 @@
 and co-wrote ps-def.el ps-mule.el ps-print.el ps-samp.el quail.el
 and changed coding.c mule-cmds.el mule.el fontset.c charset.c fontset.el
   xdisp.c xterm.c font.c fileio.c Makefile.in mule-conf.el characters.el
-  fns.c mule-diag.el ccl.c charset.h ftfont.c xfaces.c coding.h
+  fns.c mule-diag.el ftfont.c ccl.c charset.h xfaces.c coding.h
   japanese.el and 377 other files
 
 Kenichi Okada: co-wrote sasl-cram.el sasl-digest.el
@@ -1969,7 +1969,7 @@
 Magnus Henoch: changed url-http.el ispell.el url.el dbusbind.c dns.el
   url-gw.el url-parse.el url-proxy.el autoinsert.el cl.texi configure.in
   cyrillic.el dbus.el gnus.texi hashcash.el log-edit.el message.el
-  org-latex.el org-table.el process.c rcirc.el and 7 other files
+  org-latex.el org-table.el process.c rcirc.el and 8 other files
 
 Malcolm Purvis: changed spam-stat.el
 
@@ -2432,7 +2432,7 @@
   eudc-vars.el eudc.el eudcb-bbdb.el eudcb-ldap.el eudcb-ph.el ldap.el
 and changed ph.el
 
-Óscar Fuentes: changed emacsclient.c ido.el vc-bzr.el
+Óscar Fuentes: changed ido.el emacsclient.c vc-bzr.el
 
 P. E. Jareth Hein: changed gnus-util.el
 
@@ -2951,7 +2951,9 @@
 
 Steinar Bang: changed imap.el
 
-Štěpán Němec: changed subr.el vc-git.el
+Štěpán Němec: changed INSTALL cl.texi edebug.texi loading.texi maps.texi
+  mark.texi message.texi mini.texi minibuf.texi misc.texi programs.texi
+  subr.el tips.texi url.texi vc-git.el windows.texi
 
 Stephan Stahl: changed which-func.el buff-menu.el buffer.c dired-x.texi
   ediff-mult.el
@@ -3080,7 +3082,7 @@
 and changed spam.el gnus.el gnus-sum.el gnus.texi nnimap.el netrc.el
   spam-stat.el gnus-start.el gnus-util.el nnmail.el encrypt.el message.el
   gnus-encrypt.el mail-source.el assistant.el auth.texi imap.el
-  nnbabyl.el nnfolder.el nnmbox.el nnmh.el and 48 other files
+  nnbabyl.el nnfolder.el nnmbox.el nnmh.el and 51 other files
 
 Terje Rosten: changed xfns.c version.el xterm.c xterm.h
 
--- a/etc/ChangeLog	Thu May 06 09:50:39 2010 +0900
+++ b/etc/ChangeLog	Mon May 10 12:37:03 2010 +0900
@@ -1,3 +1,20 @@
+2010-05-08  Chong Yidong  <cyd@stupidchicken.com>
+
+	* PROBLEMS: Document gcc-4.5 bug (Bug#6031).
+
+2010-05-08  Kenichi Handa  <handa@m17n.org>
+
+	* HELLO: Adjust Burmese for Unicode 5.2 encoding.
+
+2010-05-07  Chong Yidong  <cyd@stupidchicken.com>
+
+	* Version 23.2 released.
+
+2010-05-07  Eli Zaretskii  <eliz@gnu.org>
+
+	* HELLO: Reorder Arabic greetings into logical order (they were
+	mistakenly changed to visual order by the 2010-03-28 change).
+
 2010-04-18  Francesc Rocher  <rocher@member.fsf.org>
 
 	* MORE.STUFF: Add a new entry for QWE.
--- a/etc/HELLO	Thu May 06 09:50:39 2010 +0900
+++ b/etc/HELLO	Mon May 10 12:37:03 2010 +0900
@@ -4,10 +4,10 @@
   Europe: ,A!(BHola!, Gr,A|_(B Gott, Hyv,Add(B p,Ad(Biv,Add(B, Tere ,Au(Bhtust, Bon,Cu(Bu
           Cze,B6f(B!, Dobr,B}(B den, ,L7T`PRabRcYbU(B!, ,FCei\(B ,Fsar(B, $,1J2J0J;J0J@JOJ=J1J0(B
   Africa: $(3!A!,!>(B
-  Middle/Near East: ,Hylem(B, ,GecjdY(B ,GeGdqSdG(B
+  Middle/Near East: ,Hylem(B, ,GGdSqdGe(B ,GYdjce(B
   South Asia: $,19h9n9x:-9d:'(B, $,15h5n5x6-5d6'(B, $,1?(?.?8?M>u?>?0(B, $,1@H@N@X@m@5@^@P@"(B, $,1;6;A;#;?;,;G(B,
               $,1AFAzB4AvB=B AqB*(B, $,1<U<C<5<m<5<N<m(B, $,1=h=n=x>-=U=~=p=B(B, $(7"7"!#C!;"E"S"G!;"7"2"[!;"D"["#"G!>(B
-  South East Asia: $,1\'\f\:\V\4\?\]\:(B, (1JP:R-4U(B, $,1H9H$HYrmH"H<HLH5HL(B, ,TJGQJ4U$CQ:(B, Ch,1`(Bo b,1U(Bn
+  South East Asia: $,1\'\f\:\V\4\?\]\:(B, (1JP:R-4U(B, $,1H9H$HZHYH"H<HLH5HK(B, ,TJGQJ4U$CQ:(B, Ch,1`(Bo b,1U(Bn
   East Asia: $ADc:C(B, $(0*/=((B, $B$3$s$K$A$O(B, $(C>H3gGO<<?d(B
   Misc: E,C6(Bo,C~(Ban,Cx(Bo ,Cf(Biu,C<(Ba,C}(Bde, $,2(3(1('('(5(B, $,1x (B p $,1x((B world $,1s"(B hello p  $,2!a(B
   CJK variety: GB($AT*Fx(B,$A?*7"(B), BIG5($(0&x86(B,$(0DeBv(B), JIS($B855$(B,$B3+H/(B), KSC($(Cj*Q((B,$(CKR[!(B)
@@ -16,10 +16,10 @@
 LANGUAGE (NATIVE NAME)	HELLO
 ----------------------	-----
 Amharic ($,1O M[MmN{(B)	$,1M`MKM](B
-Arabic $,1ro(B(,GGdYQHjqI(B)	,GecjdY(B ,GeGdqSdG(B
+Arabic $,1ro(B(,GGdYQHjqI(B)	,GGdSqdGe(B ,GYdjce(B
 Bengali ($,17,7>6b727>(B)	$,17(7.787M6u7>70(B
 Braille	$,2(3(1('('(5(B
-Burmese ($,1H9HYH;H4HYrlH9HL(B)	$,1H9H$HYrmH"H<HLH5HL(B
+Burmese ($,1H9H\H4HZH9HL(B)	$,1H9H$HZHYH"H<HLH5HK(B
 C	printf ("Hello, world!\n");
 Czech (,Bh(Be,B9(Btina)	Dobr,A}(B den
 Danish (dansk)	Hej / Goddag / Hall,Ax(Bj
--- a/etc/NEWS	Thu May 06 09:50:39 2010 +0900
+++ b/etc/NEWS	Mon May 10 12:37:03 2010 +0900
@@ -47,10 +47,6 @@
 
 +++
 ** Emacs now supports display and editing of bidirectional text.
-Warning: This is still very much experimental!  The existing support
-is minimal, and when it's turned on (see below), many features are
-likely to give unexpected results, or break, or even crash!  Use at
-your own risk!
 
 See the node "Bidirectional Editing" in the Emacs Manual for some
 initial documentation.
@@ -69,6 +65,10 @@
 bidirectionality" class implementation of the Unicode Bidirectional
 Algorithm.
 
+Note that some advanced display features, such as overlay strings and
+`display' text properties, do not yet work correctly when
+bidirectional text is reordered for display.
+
 ** GTK scroll-bars are now placed on the right by default.
 Use `set-scroll-bar-mode' to change this.
 
@@ -123,8 +123,9 @@
 The reason is that this interferes with cua-mode.
 
 ** partial-completion-mode is now obsolete.
-You can get the same behavior with
-(setq completion-styles '(partial-completion initials)).
+You can get a comparable behavior with:
+(setq completion-styles '(partial-completion initials))
+(setq completion-pcm-complete-word-inserts-delimiters t)
 
 ** mpc.el: Can use pseudo tags of the form tag1|tag2 as a union of two tags.
 ** Customize
@@ -160,6 +161,38 @@
 For example, adding "(diff-mode . ((mode . whitespace)))" to your
 .dir-locals.el file, will turn on `whitespace-mode' for *vc-diff* buffers.
 
+** SQL Mode enhancements.
+
+*** Several variables have been marked as safe local variables.
+The variables `sql-product', `sql-user', `sql-server', and
+`sql-database' can now be safely used as local variables.
+
+*** Added ability to login with a port on MySQL.
+The custom variable `sql-port' can be specified for connection to
+MySQL servers.
+
+*** Custom variables control prompting for login parameters.
+Each supported product has a custom variable `sql-*-login-params'
+which is a list of the parameters to be prompted for before a
+connection is established.
+
+*** Added option `sql-send-terminator'.
+When set makes sure that each command sent with `sql-send-*' commands
+are properly terminated and submitted to the SQL processor.
+
+*** Added option `sql-oracle-scan-on'.
+When set commands sent to Oracle's SQL*Plus are scanned for strings
+starting with an ampersand and the user is asked for replacement
+text.  In general, the SQL*Plus option SCAN should be set OFF under
+SQL interactive mode.
+
+*** SQL interactive mode will replace tabs with spaces.
+This prevents the comand interpretter for MySQL and Postgres from
+listing object name completions when being sent text via
+`sql-send-*' functions.
+
+*** An API for manipulating SQL product definitions has been added.
+
 ** s-region.el is now declared obsolete, superceded by shift-select-mode
 enabled by default in 23.1.
 
--- a/etc/NEWS.23	Thu May 06 09:50:39 2010 +0900
+++ b/etc/NEWS.23	Mon May 10 12:37:03 2010 +0900
@@ -14,97 +14,80 @@
 You can narrow news to a specific version by calling `view-emacs-news'
 with a prefix argument or by typing C-u C-h C-n.
 
-
-Temporary note:
- +++ indicates that the appropriate manual has already been updated.
- --- means no change in the manuals is called for.
-When you add a new item, please add it without either +++ or ---
-so we will look at it and add it to the manual.
-
 
 * Installation Changes in Emacs 23.2
 
----
-** New configure options for Emacs developers
+** New configure options for Emacs developers.
 These are not new features; only the configure flags are new.
----
+
 *** --enable-profiling builds Emacs with profiling enabled.
 This might not work on all platforms.
----
+
 *** --enable-checking[=OPTIONS] builds emacs with extra runtime checks.
 
----
 ** `make install' now consistently ignores umask, creating a
 world-readable install.
 
-+++
 ** Emacs compiles with Gconf support, if it is detected.
 Use the configure option --without-gconf to disable this.
 This is used by the `font-use-system-font' feature (see below).
 
 * Startup Changes in Emacs 23.2
-+++
+
 ** The command-line option -Q (--quick) also inhibits loading X resources.
 However, if Emacs is compiled with the Lucid or Motif toolkit, X
 resource settings for the graphical widgets are still applied.
 On Windows, the -Q option causes Emacs to ignore Registry settings,
 but environment variables set on the Registry are still honored.
-+++
+
 *** The new variable `inhibit-x-resources' shows whether X resources
 were loaded.
 
-+++
 ** New command-line option -mm (--maximized) maximizes the initial frame.
 
 * Changes in Emacs 23.2
 
-+++
 ** The maximum size of buffers (and the largest fixnum) is doubled.
 On typical 32bit systems, buffers can now be up to 512MB.
 
----
 ** The default value of `trash-directory' is now nil.
 This means that `move-file-to-trash' trashes files according to
 freedesktop.org specifications, the same method used by the Gnome,
 KDE, and XFCE desktops.  (This change has no effect on Windows, which
 uses `system-move-file-to-trash' for trashing.)
 
-+++
 ** The pointer now becomes invisible when typing.
 Customize `make-pointer-invisible' to disable this feature.
 
 ** Font changes
-+++
+
 *** Emacs can use the system default monospaced font in Gnome.
 To enable this feature, set `font-use-system-font' to non-nil (it is
 nil by default).  If the system default changes, Emacs changes also.
 This feature requires Gconf support, which is automatically included
 at compile-time if configure detects the gconf libraries (you can
 disable this with the configure option --without-gconf).
----
+
 *** On X11, Emacs reacts to Xft changes made by configuration tools,
 via the XSETTINGS mechanism.  This includes antialias, hinting,
 hintstyle, RGBA, DPI and lcdfilter changes.
 
-+++
 ** Killing a buffer with a running process now asks for confirmation.
 To remove this query, remove `process-kill-buffer-query-function' from
 `kill-buffer-query-functions', or set the appropriate process flag
 with `set-process-query-on-exit-flag'.
 
 ** File-local variable changes
-+++
+
 *** Specifying a minor mode as a local variables enables that mode,
 unconditionally.  The previous behavior, toggling the mode, was
 neither reliable nor generally desirable.
 
-+++
 *** There are new commands for adding and removing file-local variables:
 `add-file-local-variable', `delete-file-local-variable',
 `add-file-local-variable-prop-line', and
 `delete-file-local-variable-prop-line'.
 
-+++
 *** There are new commands for adding and removing directory-local variables,
 and copying them to and from file-local variable lists:
 `add-dir-local-variable', `delete-dir-local-variable',
@@ -113,55 +96,63 @@
 `copy-file-locals-to-dir-locals'.
 
 ** Internationalization changes
-+++
+
 *** Unibyte sessions are now considered obsolete.
 This refers to the EMACS_UNIBYTE environment variable as well as the
 --unibyte, --multibyte, --no-multibyte, and --no-unibyte command line
 arguments.  Customizing enable-multibyte-characters and setting
 default-enable-multibyte-characters are also deprecated.
----
+
 *** New coding system `utf-8-hfs'.
 This is suitable for default-file-name-coding-system on Mac OS X; see
 international/ucs-normalize.el.
 
----
 ** Function arguments in *Help* buffers are now shown in upper-case.
 Customize `help-downcase-arguments' to t to show them in lower-case.
 
+** New command `async-shell-command', bound globally to `M-&'.
+This executes the command asynchronously, similar to calling `M-!' and
+manually adding an ampersand to the end of the command.  With `M-&',
+you don't need the ampersand.  The output appears in the buffer
+`*Async Shell Command*'.
+
+** When running in a new enough xterm (newer than version 242), Emacs
+asks xterm what the background color is and it sets up faces
+accordingly for a dark background if needed (the current default is to
+consider the background light).
+
 
 * Editing Changes in Emacs 23.2
 
 ** Kill-ring and selection changes
-+++
+
 *** If `select-active-regions' is t, any active region automatically
 becomes the primary selection (for interaction with other window
 applications).  If you enable this, you might want to bind
 `mouse-yank-primary' to Mouse-2.
-+++
+
 *** When `save-interprogram-paste-before-kill' is non-nil, the kill
 commands save the interprogram-paste selection into the kill ring
 before doing anything else.  This avoids losing the selection.
-+++
+
 *** When `kill-do-not-save-duplicates' is non-nil, identical
 subsequent kills are not duplicated in the `kill-ring'.
 
 ** Completion changes
 
 *** The new command `completion-at-point' provides mode-sensitive completion.
-+++
+
 *** tab-always-indent set to `complete' lets TAB do completion as well.
-+++
+
 *** The new completion-style `initials' is available.
 For instance, this can complete M-x lch to list-command-history.
----
+
 *** The new variable `completions-format' determines how completions
 are displayed in the *Completions* buffer.  If you set it to
 `vertical', completions are sorted vertically in columns.
 
-+++
 ** The default value of `blink-matching-paren-distance' is increased.
 
----
 ** M-n provides more default values in the minibuffer for commands
 that read file names.  These include the file name at point (when ffap
 is loaded without ffap-bindings), the file name on the current line
@@ -169,59 +160,44 @@
 (for Dired commands that operate on several directories, such as copy,
 rename, or diff).
 
-+++
 ** M-r is bound to the new `move-to-window-line-top-bottom'.
 This moves point to the window center, top and bottom on successive
 invocations, in the same spirit as the C-l (recenter-top-bottom)
 command.
 
-+++
 ** The new variable `recenter-positions' determines the default
 cycling order of C-l (`recenter-top-bottom').
 
-+++
 ** The abbrevs file is now a file named abbrev_defs in
 user-emacs-directory; but the old location, ~/.abbrev_defs, is used if
 that file exists.
+
 
 * Changes in Specialized Modes and Packages in Emacs 23.2
 
----
 ** The bookmark menu has a narrowing search via bookmark-bmenu-search.
 
-** LaTeX mode now provides completion (via completion-at-point).
-
----
-** sym-comp.el is now declared obsolete, superseded by completion-at-point.
-
----
-** lucid.el and levents.el are now declared obsolete.
-
----
-** pcomplete provides a new command `pcomplete-std-completion' which
-is similar to `pcomplete' but using the standard completion UI code.
-
 ** Calc
-+++
+
 *** The Calc settings file is now a file named calc.el in
 user-emacs-directory; but the old location, ~/.calc.el, is used if
 that file exists.
----
+
 *** Graphing commands (`g f' etc.) now work on MS-Windows, if you have
 the native Windows port of Gnuplot version 3.8 or later installed.
 
 ** Calendar and diary
-+++
+
 *** Fancy diary display is now the default.
 If you prefer the simple display, customize `diary-display-function'.
-+++
+
 *** The diary's fancy display now enables view-mode.
----
+
 *** The command `calendar-current-date' accepts an optional argument
 giving an offset from today.
 
 ** Desktop
----
+
 *** The default value for `desktop-buffers-not-to-save' is nil.
 This means Desktop will try restoring all buffers, when you restart
 your Emacs session.  Also, `desktop-buffers-not-to-save' is only
@@ -230,37 +206,50 @@
 `desktop-files-not-to-save' instead.
 
 ** Dired
-+++
+
 *** The new variable `dired-auto-revert-buffer', if non-nil, causes
 Dired buffers to be reverted automatically on revisiting them.
 
 ** DocView
-+++
+
 *** When `doc-view-continuous' is non-nil, scrolling a line
 on the page edge advances to the next/previous page.
 
+** Elint
+
+*** Elint now uses compilation-mode.
+
+*** Elint can now scan individual files and whole directories,
+and can be run in batch mode.
+
+*** Elint does a more thorough initialization, and recognizes more built-in
+functions and variables.  Customize `elint-scan-preloaded' if you want
+to sacrifice some accuracy for a faster startup.
+
+*** Elint attempts some basic understanding of featurep and (f)boundp tests.
+
+*** Customize `elint-ignored-warnings' to suppress some warnings.
+
 ** GDB-UI
 
-+++
 *** Toolbar functionality for reverse debugging.  Display of STL
 collections as watch expressions.  These features require GDB 7.0 or later.
 
 ** Grep
-+++
+
 *** A new command `zrgrep' searches recursively in gzipped files.
 
 ** Info
 
-+++
 *** The new command `Info-virtual-index' bound to "I" displays a menu of
 matched topics found in the index.
 
-+++
 *** The new command `info-finder' replaces finder.el with a virtual Info
 manual that generates an Info file which gives the same information
 through a menu structure.
 
-+++
+** LaTeX mode now provides completion (via completion-at-point).
+
 ** Message mode is now the default mode for composing mail.
 
 The default for `mail-user-agent' is now message-user-agent, so the
@@ -270,7 +259,6 @@
 for several years.  It provides several features that are absent in
 Mail mode, such as MIME handling.
 
----
 *** If the user has not customized mail-user-agent, `compose-mail'
 checks for Mail mode customizations, and issues a warning if these
 customizations are found.  This alerts users who may otherwise be
@@ -278,110 +266,87 @@
 
 To disable this check, set compose-mail-user-agent-warnings to nil.
 
----
 ** The default value of mail-interactive is t, since Emacs 23.1.
 (This was not announced at the time.)  It means that when sending mail,
 Emacs will wait for the process sending mail to return.  If you
 experience delays when sending mail, you may wish to set this to nil.
 
-+++
 ** nXML mode is now the default for editing XML files.
 
+** pcomplete provides a new command `pcomplete-std-completion' which
+is similar to `pcomplete' but using the standard completion UI code.
+
 ** Shell (and other comint modes)
-+++
+
 *** M-s is no longer bound to `comint-next-matching-input'.
-+++
+
 *** M-r is now bound to `comint-history-isearch-backward-regexp'.
 This starts an incremental search of the comint/shell input history.
-+++
+
 *** ansi-color is now enabled by default in Shell mode.
 To disable it, set ansi-color-for-comint-mode to nil.
 
 ** Tramp
-+++
+
 *** New connection methods "rsyncc", "imap" and "imaps".
 On systems which support GVFS-Fuse, Tramp offers also the new
 connection methods "dav", "davs", "obex" and "synce".
 
 ** VC and related modes
-+++
+
 *** When using C-x v v or C-x v i on a unregistered file that is in a
 directory not controlled by any VCS, ask the user what VC backend to
 use to create a repository, create a new repository and register the
 file.
-+++
+
 *** New command `vc-root-print-log', bound to `C-x v L'.
 This displays a `*vc-change-log*' buffer showing the history of the
 version-controlled directory tree as a whole.
-+++
+
 *** New command `vc-root-diff', bound to `C-x v D'.
 This is similar to `vc-diff', but compares the entire directory tree
 of the current VC directory with its working revision.
-+++
+
 *** `C-x v l' and `C-x v L' do not show the full log by default.
 The number of entries shown can be chosen interactively with a prefix
 argument, or by customizing vc-log-show-limit.  The `*vc-change-log*'
 buffer now contains buttons at the end of the buffer, which can be
 used to increase the number of entries shown.  RCS, SCCS, and CVS do
 not support this feature.
----
+
 *** vc-annotate supports annotations through file copies and renames,
 it displays the old names for the files and it can show logs/diffs for
 the corresponding lines.  Currently only Git and Mercurial take
 advantage of this feature.
----
+
 *** The log command in vc-annotate can display a single log entry
 instead of redisplaying the full log.  The RCS, CVS and SCCS VC
 backends do not support this.
----
+
 *** When a file is not found, VC will not try to check it out of RCS anymore.
-+++
+
 *** Diff and log operations can be used from Dired buffers.
 
 *** vc-git changes
 
----
 **** The short log format for git makes use of the graph display,
 so it's not supported on git versions earlier than 1.5.6.
 
----
 **** vc-dir uses the --relative option of git, and so requires at least
 git version 1.5.5.
 
-+++
 **** Support for operating with stashes has been added to vc-dir:
 the stash list is displayed in the *vc-dir* header, stashes can be
 created, removed, applied and their content displayed.
 
-+++
 *** vc-bzr supports operating with shelves: the shelve list is
 displayed in the *vc-dir* header, shelves can be created, removed and applied.
----
+
 *** log-edit-strip-single-file-name controls whether or not single filenames
 are stripped when copying text from the ChangeLog to the *VC-Log* buffer.
 
-** Elint
----
-*** Elint now uses compilation-mode.
----
-*** Elint can now scan individual files and whole directories,
-and can be run in batch mode.
----
-*** Elint does a more thorough initialization, and recognizes more built-in
-functions and variables.  Customize `elint-scan-preloaded' if you want
-to sacrifice some accuracy for a faster startup.
----
-*** Elint attempts some basic understanding of featurep and (f)boundp tests.
----
-*** Customize `elint-ignored-warnings' to suppress some warnings.
-
 ** Miscellaneous
-+++
-*** The new command `async-shell-command' bound globally to `M-&' executes
-the command asynchronously without the need to manually add ampersand to
-the end of the command.  Its output appears in the buffer `*Async Shell
-Command*'.
-+++
+
 *** Interactively `multi-isearch-buffers' and `multi-isearch-buffers-regexp'
 read buffer names to search, one by one, ended with RET.  With a prefix
 argument, they ask for a regexp, and search in buffers whose names match
@@ -389,19 +354,20 @@
 `multi-isearch-files-regexp' read file names to search, one by one,
 ended with RET.  With a prefix argument, they ask for a wildcard, and
 search in file buffers whose file names match the specified wildcard.
-+++
+
 *** Autorevert Tail mode now works also for remote files.
-+++
-*** The new built-in commands `su' and `sudo' support Tramp.
-That means, they change `default-directory' to the new users value,
-and let commands run under that user permissions.  It works even when
+
+*** The new eshell built-in commands `su' and `sudo' support Tramp.
+Thus, they change `default-directory' to reflect the new user id, and
+let commands run under that user's permissions.  This works even when
 `default-directory' is already remote.  Calling the external commands
-is possible by `*su' or `*sudo', respectively.
----
-*** When running in a new enough xterm (newer than version 242), Emacs
-asks xterm what the background color is and it sets up faces
-accordingly for a dark background if needed (the current default is to
-consider the background light).
+is possible via `*su' or `*sudo', respectively.
+
+** Obsolete packages
+
+*** sym-comp.el is now obsolete, superseded by completion-at-point.
+
+*** lucid.el and levents.el are now obsolete.
 
 
 * New Modes and Packages in Emacs 23.2
@@ -410,7 +376,6 @@
 This is a collection of packages to aid with using Emacs as an IDE
 (integrated development environment):
 
-+++
 *** The Semantic package allows the use of parsers to intelligently
 edit and navigate source code.  Parsers for C/C++, Java, Javascript,
 and several other languages are included by default, and Semantic can
@@ -419,7 +384,6 @@
 To enable Semantic, use the global minor mode `semantic-mode'.
 See the Semantic manual for details.
 
-+++
 *** EDE (Emacs Development Environment) is a package for managing code
 projects, including features such as automatic Makefile generation.
 
@@ -430,25 +394,20 @@
 code.  It is currently used by some parts of Semantic and EDE; in the
 future, it may be used for code generation features.
 
-+++
 *** The EIEIO library implements a subset of the Common Lisp Object
 System (CLOS).  It is used by the other CEDET packages.
 
----
 ** mpc.el is a front end for the Music Player Daemon.  Run it with M-x mpc.
 
 ** htmlfontify.el turns a fontified Emacs buffer into an HTML page.
 
-+++
 ** js.el is a new major mode for JavaScript files.
 
----
 ** imap-hash.el is a new library to address IMAP mailboxes as hashtables.
 
 
 * Incompatible Lisp Changes in Emacs 23.2
 
-+++
 ** The Lisp reader turns integers that are too large/small into floats.
 For instance, on machines where `536870911' is the largest integer,
 reading `536870912' gives the floating-point object `536870912.0'.
@@ -456,7 +415,6 @@
 This change only concerns the Lisp reader; it does not affect how
 actual integer objects overflow.
 
----
 ** Several obsolete functions removed.
 The functions have been obsolete since Emacs 19, and are unlikely to
 be in use:
@@ -466,11 +424,9 @@
   time-stamp-yyyy-mm-dd, time-stamp-yymmdd, time-stamp-hh:mm:ss,
   time-stamp-hhmm, baud-rate
 
----
 ** Support for generating Emacs 18 compatible bytecode (by setting
 the variable `byte-compile-compatibility') has been removed.
 
----
 ** In image-mode.el `image-mode-maybe' is obsolete.
 Instead, you can either use `image-mode' (which displays an image file
 as the actual image initially), or `image-mode-as-text' (when you want
@@ -484,7 +440,7 @@
 
 
 * Lisp changes in Emacs 23.2
----
+
 ** All the default-FOO variables that hold the default value of the FOO
 variable, are now declared obsolete.
 
@@ -492,10 +448,10 @@
 It reads a single key, but obeys input and escape sequence decoding.
 
 ** Frame parameter changes
-+++
+
 *** You can give the `fullscreen' frame parameter the value `maximized'.
 This maximizes the frame.
-+++
+
 *** The new frame parameter `sticky' makes Emacs frames sticky in
 virtual desktops.
 
@@ -509,23 +465,23 @@
 
 *** New function `completion-in-region' to use the standard completion
 facilities on a particular region of text.
-+++
+
 *** The 4th arg to all-completions (aka hide-spaces) is declared obsolete.
 
 *** completion-annotate-function specifies how to compute annotations
 for completions displayed in *Completions*.
 
 ** Minibuffer changes
----
+
 *** read-file-name-predicate is obsolete.  It was used to pass the predicate
 to read-file-name-internal because read-file-name-internal abused its `pred'
 argument to pass the current directory, but this hack is not needed
 any more.
 
 ** Changes to file-manipulation functions
-+++
+
 *** `delete-directory' has an optional parameter RECURSIVE.
-+++
+
 *** New function `copy-directory', which copies a directory recursively.
 
 ** called-interactively-p now takes one argument and replaces interactive-p
@@ -540,34 +496,33 @@
 of bindings.
 
 ** Network and process changes
-+++
+
 *** start-process-shell-command and start-file-process-shell-command
 now only take a single `command' argument.
-+++
+
 *** The new variable `process-file-side-effects' should be set to nil
 if a `process-file' call does not change a remote file.  This allows
 file name handlers such as Tramp to optimizations.
-+++
+
 *** make-network-process can now also create `seqpacket' Unix sockets.
 
 ** Loading changes
----
+
 *** eval-next-after-load is obsolete.
-+++
+
 *** New hook `after-load-functions' run after loading an Elisp file.
 
 ** Byte compilation changes
----
+
 *** Changing the file-names generated by byte-compilation by redefining
 the function `byte-compile-dest-file' before loading bytecomp.el is obsolete.
 Instead, customize byte-compile-dest-file-function.
----
+
 *** `byte-compile-warnings' has new members, `constants' and `suspicious'.
 
 ** New macro with-silent-modifications to tweak text properties without
 affecting the buffer's modification state.
 
-+++
 ** Hash tables have a new printed representation that is readable.
 The feature `hashtable-print-readable' identifies this new
 functionality.
@@ -580,17 +535,14 @@
 ucs-normalize-HFS-NFD-region, ucs-normalize-HFS-NFD-string,
 ucs-normalize-HFS-NFC-region, ucs-normalize-HFS-NFC-string.
 
-+++
 ** Face aliases can now be marked as obsolete, using the macro
 `define-obsolete-face-alias'.
 
-+++
 ** New function `window-full-height-p', analogous to the full-width version.
 
 
 * Changes in Emacs 23.2 on non-free operating systems
 
----
 ** On MS-Windows, `display-time' now displays the system load average
 as well as the time, as it does on GNU and Unix.
 
@@ -1398,11 +1350,11 @@
 ** Gnus
 
 *** The Gnus package has been updated
-There are many news features, bug fixes and improvements; see the file
+There are many new features, bug fixes and improvements; see the file
 GNUS-NEWS or the node "No Gnus" in the Gnus manual for details.
 
 *** In Emacs 23, Gnus uses Emacs' new internal coding system `utf-8-emacs' for
-saving articles drafts and ~/.newsrc.eld.  These file may not be read
+saving articles, drafts, and ~/.newsrc.eld.  These file may not be read
 correctly in Emacs 22 and below.  If you want to Gnus across different Emacs
 versions, you may set `mm-auto-save-coding-system' to `emacs-mule'.
 
@@ -1455,8 +1407,8 @@
 *** `C-h C-h' in Isearch mode displays isearch-specific Help screen,
 `C-h b' displays all Isearch key bindings, `C-h k' displays the full
 documentation of the given Isearch key sequence, `C-h m' displays
-documentation of Isearch mode.  All the rest Help commands exit Isearch mode
-and execute their global definitions.
+documentation for Isearch mode.  All the other Help commands exit
+Isearch mode and execute their global definitions.
 
 *** When started in the minibuffer, Isearch searches in the minibuffer
 history.  See `Minibuffer changes', above.
--- a/etc/PROBLEMS	Thu May 06 09:50:39 2010 +0900
+++ b/etc/PROBLEMS	Mon May 10 12:37:03 2010 +0900
@@ -167,6 +167,17 @@
 
 * Crash bugs
 
+** Emacs crashes when running in a terminal, if compiled with GCC 4.5.0
+This version of GCC is buggy: see
+
+  http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6031
+  http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43904
+
+You can work around this error in gcc-4.5 by omitting sibling call
+optimization.  To do this, configure Emacs with
+
+ CFLAGS="-g -O2 -fno-optimize-sibling-calls" ./configure
+
 ** Emacs crashes in x-popup-dialog.
 
 This can happen if the dialog widget cannot find the font it wants to
--- a/etc/enriched.doc	Thu May 06 09:50:39 2010 +0900
+++ b/etc/enriched.doc	Mon May 10 12:37:03 2010 +0900
@@ -219,7 +219,7 @@
 paragraph properly filled all the time, without slowing down
 editing too much.  Refill mode is a start at this, but needs
 
-</indent></indent>	<indent>improvment.
+</indent></indent>	<indent>improvement.
 
 + Refill after yank.  [Refill mode does that.]
 
@@ -272,4 +272,4 @@
     GNU General Public License for more details.
 
     You should have received a copy of the GNU General Public License
-    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+    along with this program.  If not, see <<http://www.gnu.org/licenses/>.
--- a/leim/ChangeLog	Thu May 06 09:50:39 2010 +0900
+++ b/leim/ChangeLog	Mon May 10 12:37:03 2010 +0900
@@ -1,3 +1,7 @@
+2010-05-07  Chong Yidong  <cyd@stupidchicken.com>
+
+	* Version 23.2 released.
+
 2010-04-06  Chong Yidong  <cyd@stupidchicken.com>
 
 	* quail/vntelex.el: Fix "af" rule (Bug#5836).
--- a/lib-src/ChangeLog	Thu May 06 09:50:39 2010 +0900
+++ b/lib-src/ChangeLog	Mon May 10 12:37:03 2010 +0900
@@ -1,3 +1,35 @@
+2010-05-10  Glenn Morris  <rgm@gnu.org>
+
+	* Makefile.in (LIBS_SYSTEM): Set with configure, not cpp.
+	(LIBS_SYSTEM) [MSDOS]: Reset with MSDOS_LIBS_SYSTEM.
+	(NOT_C_CODE): Remove, no longer used.
+	(config.h) [!MSDOS]: No longer include.
+	(LOADLIBES): Use LIBS_SYSTEM as a variable.
+
+	* Makefile.in (BLESSMAIL_TARGET): Set with configure, not cpp.
+
+2010-05-08  Christoph  <cschol2112@googlemail.com>  (tiny change)
+
+	* makefile.w32-in (OTHER_PLATFORM_SUPPORT): Use parenthesis
+	for macros for nmake compatibility.
+
+2010-05-08  Glenn Morris  <rgm@gnu.org>
+
+	* Makefile.in (THIS_IS_MAKEFILE): Remove, unused.
+
+2010-05-07  Chong Yidong  <cyd@stupidchicken.com>
+
+	* Version 23.2 released.
+
+2010-05-06  Glenn Morris  <rgm@gnu.org>
+
+	* Makefile.in: Minimize blessmail-related cpp usage.
+	(BLESSMAIL_TARGET): New variable.
+	(MOVEMAIL_NEEDS_BLESSING): Remove, replace by above variable.
+	(blessmail): Always define this rule.
+	(need-blessmail): New rule, split out from maybe-blessmail.
+	(maybe-blessmail): Use BLESSMAIL_TARGET.
+
 2010-05-04  Glenn Morris  <rgm@gnu.org>
 
 	* Makefile.in: Use @C_SWITCH_SYSTEM@, @C_SWITCH_MACHINE@ rather than
--- a/lib-src/Makefile.in	Thu May 06 09:50:39 2010 +0900
+++ b/lib-src/Makefile.in	Mon May 10 12:37:03 2010 +0900
@@ -1,7 +1,6 @@
 # Makefile for lib-src subdirectory in GNU Emacs.
 # Copyright (C) 1985, 1987, 1988, 1993, 1994, 2001, 2002, 2003, 2004,
-#               2005, 2006, 2007, 2008, 2009, 2010
-#               Free Software Foundation, Inc.
+#   2005, 2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
 
 # This file is part of GNU Emacs.
 
@@ -132,6 +131,9 @@
 # If neither flag is set, blessmail is used.
 MOVE_FLAGS=
 
+## Empty if either MAIL_USE_FLOCK or MAIL_USE_LOCKF, else need-blessmail.
+BLESSMAIL_TARGET=@BLESSMAIL_TARGET@
+
 ## -lkrb if HAVE_LIBKRB or -lkrb4 if HAVE_LIBKRB4
 KRB4LIB=@KRB4LIB@
 ## -ldes if HAVE_LIBDES or -ldes425 if HAVE_LIBDES425
@@ -152,6 +154,9 @@
 ## Extra libraries to use when linking movemail.
 LIBS_MOVE = $(LIBS_MAIL) $(KRB4LIB) $(DESLIB) $(KRB5LIB) $(CRYPTOLIB) $(COM_ERRLIB) $(LIBHESIOD) $(LIBRESOLV)
 
+## Some systems define this to request special libraries.
+LIBS_SYSTEM = @LIBS_SYSTEM@
+
 # 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.
@@ -162,29 +167,12 @@
 # ========================== start of cpp stuff =======================
 /* From here on, comments must be done in C syntax.  */
 
-#define THIS_IS_MAKEFILE
-#define NOT_C_CODE
+#ifdef MSDOS
 #include "../src/config.h"
-
-/* Some s/SYSTEM.h files define this to request special libraries.  */
-#ifndef LIBS_SYSTEM
-#define LIBS_SYSTEM
+LIBS_SYSTEM = MSDOS_LIBS_SYSTEM
 #endif
 
-#undef MOVEMAIL_NEEDS_BLESSING
-#ifndef MAIL_USE_FLOCK
-#ifndef MAIL_USE_LOCKF
-#define MOVEMAIL_NEEDS_BLESSING
-#endif
-#endif
-
-#ifdef MOVEMAIL_NEEDS_BLESSING
-#define BLESSMAIL blessmail
-#else
-#define BLESSMAIL
-#endif
-
-LOADLIBES=LIBS_SYSTEM
+LOADLIBES=$(LIBS_SYSTEM)
 
 
 .SUFFIXES: .m
@@ -218,14 +206,14 @@
 vcdiff: $(srcdir)/vcdiff
 	-cp -p $(srcdir)/vcdiff vcdiff
 
-#ifdef MOVEMAIL_NEEDS_BLESSING
+/* Only used if we need blessmail, but no harm in always defining.
+   This makes the actual blessmail executable.  */
 blessmail:
 	$(EMACS) $(EMACSOPT) -l $(srcdir)/../lisp/mail/blessmail.el
 	chmod +x blessmail
-#endif
 
-maybe-blessmail: BLESSMAIL
-#ifdef MOVEMAIL_NEEDS_BLESSING
+/* This checks if we need to run blessmail.  */
+need-blessmail: blessmail
 /* Don\'t charge ahead and do it!  Let the installer decide.
 	  ./blessmail $(DESTDIR)${archlibdir}/movemail${EXEEXT}  */
 	@if [ `wc -l <blessmail` != 2 ] ; then \
@@ -235,7 +223,9 @@
 	  echo as root, to give  movemail${EXEEXT}  appropriate permissions.; \
 	  echo Do that after running  make install.; \
 	fi
-#endif
+
+/* This is the target invoked by the top-level Makefile.  */
+maybe-blessmail: $(BLESSMAIL_TARGET)
 
 /* Install the internal utilities.  Until they are installed, we can
    just run them directly from lib-src.  */
--- a/lisp/ChangeLog	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/ChangeLog	Mon May 10 12:37:03 2010 +0900
@@ -1,3 +1,286 @@
+2010-05-09  Michael R. Mauger  <mmaug@yahoo.com>
+
+	* progmodes/sql.el: Version 2.1
+	(sql-product-alist): Redesigned structure of product info.
+        (sql-product, sql-user, sql-server, sql-database): Safe
+	variables.
+	(sql-port, sql-port-history): New variables.
+	(sql-interactive-product): New variable.
+	(sql-send-terminator): New variable.
+	(sql-imenu-generic-expression): Added "Types" imenu entry.
+	(sql-oracle-login-params, sql-sqlite-login-params)
+	(sql-mysql-login-params, sql-solid-login-params)
+	(sql-sybase-login-params, sql-informix-login-params)
+	(sql-ingres-login-params, sql-ms-login-params)
+	(sql-postgres-login-params, sql-interbase-login-params)
+	(sql-db2-login-params, sql-linter-login-params)
+	(sql-oracle-scan-on): New variables.
+	(sql-mode-map): Added C-c C-i to start interactive mode.
+	(sql-mode-menu): Updated existing menu entries.
+        (sql-font-lock-keywords-builder): Compile-time font-lock
+	optimization.
+	(sql-mode-oracle-font-lock-keywords)
+	(sql-mode-postgres-font-lock-keywords)
+	(sql-mode-ms-font-lock-keywords)
+	(sql-mode-sybase-font-lock-keywords)
+	(sql-mode-informix-font-lock-keywords)
+	(sql-mode-interbase-font-lock-keywords)
+	(sql-mode-ingres-font-lock-keywords)
+	(sql-mode-solid-font-lock-keywords)
+	(sql-mode-mysql-font-lock-keywords)
+	(sql-mode-sqlite-font-lock-keywords)
+	(sql-mode-db2-font-lock-keywords)
+	(sql-mode-linter-font-lock-keywords): Updated initialization to
+	reduce run-time complexity.
+	(sql-add-product, sql-del-product): New functions.
+	(sql-set-product-feature, sql-get-product-feature): New functions.
+	(sql-product-font-lock): Update product API.
+	(sql-add-product-keywords): New function.
+	(sql-highlight-product): Update product API.
+	(sql-help-list-products): New function.
+	(sql-help): Dynamically lists free and non-free products.
+	(sql-get-login): Corrected bug in handling history and added
+	prompt for port.
+	(sql-copy-column): Copy without properties.
+	(sqli-input-sender): Apply filters to SQLi input.
+	(sql-query-placeholders-and-send): Obey `sql-oracle-scan-on'
+	setting.  Implement as a filter.
+	(sql-escape-newlines-filter): Implement as a filter.
+	(sql-remove-tabs-filter): New function.
+	(sql-send-magic-terminator): New function.
+	(sql-send-string): Implement magic terminator.
+	(sql-send-region): Use `sql-send-string'.
+	(sql-interactive-mode): Use product API.
+	(sql-product-interactive): Use product API.
+	(sql-oracle, sql-sybase, sql-informix, sql-sqlite, sql-mysql)
+	(sql-solid, sql-ingres, sql-ms, sql-postgres, sql-interbase)
+	(sql-db2, sql-linter): Use `sql-product-interactive'.
+	(sql-connect): New function.
+	(sql-connect-oracle, sql-connect-sybase, sql-connect-informix)
+	(sql-connect-sqlite, sql-connect-mysql, sql-connect-solid)
+	(sql-connect-ingres, sql-connect-ms, sql-connect-postgres)
+	(sql-connect-interbase, sql-connect-db2, sql-connect-linter): Use
+	`sql-connect'.
+
+2010-05-09  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* minibuffer.el (completion-pcm-complete-word-inserts-delimiters):
+	New custom variable.
+	(completion-pcm--string->pattern): Use it.
+	(completion-pcm--pattern->regex, completion-pcm--pattern->string):
+	Make it handle any symbol as `any'.
+	(completion-pcm--merge-completions): Extract common suffix for the new
+	`prefix' symbol as well.
+	(completion-substring--all-completions): Use the new `prefix' symbol.
+
+2010-05-09  Michael Albinus  <michael.albinus@gmx.de>
+
+	* net/tramp-compat.el (byte-compile-not-obsolete-vars): Define if
+	not bound.
+	(tramp-compat-copy-file): Add PRESERVE-SELINUX-CONTEXT.
+	(tramp-compat-funcall): New defmacro.
+	(tramp-compat-line-beginning-position)
+	(tramp-compat-line-end-position)
+	(tramp-compat-temporary-file-directory)
+	(tramp-compat-make-temp-file, tramp-compat-file-attributes)
+	(tramp-compat-copy-file, tramp-compat-copy-directory)
+	(tramp-compat-delete-file, tramp-compat-delete-directory)
+	(tramp-compat-number-sequence, tramp-compat-process-running-p)
+	* net/tramp.el (top, with-progress-reporter)
+	(tramp-rfn-eshadow-setup-minibuffer)
+	(tramp-rfn-eshadow-update-overlay, tramp-handle-set-file-times)
+	(tramp-handle-dired-compress-file, tramp-handle-shell-command)
+	(tramp-completion-mode-p, tramp-check-for-regexp)
+	(tramp-open-connection-setup-interactive-shell)
+	(tramp-compute-multi-hops, tramp-read-passwd, tramp-clear-passwd)
+	(tramp-time-diff, tramp-coding-system-change-eol-conversion)
+	(tramp-set-process-query-on-exit-flag, tramp-unload-tramp)
+	* net/tramp-cmds.el (tramp-cleanup-all-connections)
+	(tramp-reporter-dump-variable, tramp-load-report-modules)
+	(tramp-append-tramp-buffers)
+	* net/tramp-gvfs.el (tramp-gvfs-handle-file-selinux-context): Use it.
+
+	* net/tramp-imap.el (top): Autoload `epg-make-context'.
+
+2010-05-08  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* progmodes/compile.el (compilation-buffer-modtime): Rename from
+	buffer-modtime.  Adjust users.
+
+2010-05-08  Chong Yidong  <cyd@stupidchicken.com>
+
+	* international/mule.el (auto-coding-alist):  Only purecopy
+	car of each item, not the whole list (Bug#6083).
+
+2010-05-08  Chong Yidong  <cyd@stupidchicken.com>
+
+	* progmodes/js.el (js-mode): Make paragraph variables local before
+	calling c-setup-paragraph-variables (Bug#6071).
+
+2010-05-08  Eli Zaretskii  <eliz@gnu.org>
+
+	* composite.el (compose-region, reference-point-alist): Fix typos
+	in the doc strings.
+
+2010-05-08  Alexander Klimov <alserkli@inbox.ru> (tiny change)
+
+	* calc/calc-graph.el (calc-graph-plot): Use the proper form for
+	gnuplot's "set" command.
+
+2010-05-08  Juanma Barranquero  <lekktu@gmail.com>
+
+	* abbrev.el (last-abbrev-text): Doc fix.
+	(abbrev-prefix-mark): Don't escape parenthesis.
+
+2010-05-08  Andreas Schwab  <schwab@linux-m68k.org>
+
+	* composite.el (find-composition): Doc fix.
+
+2010-05-08  Juanma Barranquero  <lekktu@gmail.com>
+
+	* progmodes/sql.el (sql-electric-stuff): Fix typo in tag.
+	(sql-oracle-program, sql-sqlite-options)
+	(sql-query-placeholders-and-send): Doc fixes.
+	(sql-set-product, sql-interactive-mode): Reflow docstrings.
+	(sql-imenu-generic-expression, sql-buffer)
+	(sql-mode-ansi-font-lock-keywords, sql-mode-oracle-font-lock-keywords)
+	(sql-mode-postgres-font-lock-keywords, sql-mode-ms-font-lock-keywords)
+	(sql-mode-sybase-font-lock-keywords)
+	(sql-mode-informix-font-lock-keywords)
+	(sql-mode-interbase-font-lock-keywords)
+	(sql-mode-ingres-font-lock-keywords, sql-mode-solid-font-lock-keywords)
+	(sql-mode-mysql-font-lock-keywords, sql-mode-sqlite-font-lock-keywords)
+	(sql-mode-db2-font-lock-keywords, sql-mode-font-lock-keywords)
+	(sql-product-feature, sql-highlight-product)
+	(comint-line-beginning-position, sql-rename-buffer)
+	(sql-toggle-pop-to-buffer-after-send-region sql-oracle)
+	(sql-sybase, sql-informix, sql-sqlite, sql-mysql, sql-solid)
+	(sql-ingres, sql-ms, sql-postgres, sql-interbase, sql-db2, sql-linter):
+	Fix typos in docstrings.
+
+2010-05-08  Juri Linkov  <juri@jurta.org>
+
+	* info.el (Info-fontify-node): Put Info-breadcrumbs to the `display'
+	property instead of `invisible' and `after-string' (bug#5998).
+
+2010-05-08  Juri Linkov  <juri@jurta.org>
+
+	* image-mode.el (image-mode-as-text): Fix typo in docstring.
+
+2010-05-08  Juanma Barranquero  <lekktu@gmail.com>
+
+	* filecache.el (file-cache-add-directory-list)
+	(file-cache-add-directory-recursively): Fix typos in docstrings.
+
+2010-05-08  Kenichi Handa  <handa@m17n.org>
+
+	* language/indian.el (gurmukhi-composable-pattern): Fix typo.
+	(gujarati-composable-pattern): Fix typo.
+
+2010-05-08  Kenichi Handa  <handa@m17n.org>
+
+	* language/indian.el (oriya-composable-pattern)
+	(tamil-composable-pattern, malayalam-composable-pattern):
+	Add two-part vowels to "v" (vowel sign).
+
+2010-05-08  Chong Yidong  <cyd@stupidchicken.com>
+
+	* files.el (copy-directory): Handle symlinks (Bug#5982).
+
+2010-05-08  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* vc-hg.el (vc-hg-state): Use HGRCPATH, not HGRC.
+	(vc-hg-working-revision): Likewise.  Use hg parents, not hg parent
+	(Bug#5846).
+
+2010-05-08  Glenn Morris  <rgm@gnu.org>
+
+	* emacs-lisp/lisp.el (lisp-completion-at-point): Give it a doc string.
+
+	* minibuffer.el (completion-at-point): Doc fix.
+
+2010-05-08  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* electric.el (Electric-command-loop): Minor tweak.
+
+	* ebuff-menu.el (electric-buffer-list): Try and make it behave a bit
+	better with dedicated windows.
+
+2010-05-07  Chong Yidong  <cyd@stupidchicken.com>
+
+	* Version 23.2 released.
+
+2010-05-07  Deniz Dogan <deniz.a.m.dogan@gmail.com>  (tiny change)
+            Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	Highlight vendor specific properties.
+	* textmodes/css-mode.el (css-proprietary-nmstart-re): New var.
+	(css-proprietary-property): New face.
+	(css-font-lock-keywords): Use them.
+
+2010-05-07  Eli Zaretskii  <eliz@gnu.org>
+
+	* cus-start.el (all): Add native condition for tool-bar-* symbols.
+
+2010-05-07  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* textmodes/dns-mode.el (auto-mode-alist): Add entry for .zone files.
+	* files.el (auto-mode-alist): Remove redundant entries.
+
+	* files.el (auto-save-mode): Move to simple.el to fix bootstrap.
+	* simple.el (auto-save-mode): Move from files.el.
+	* minibuffer.el (completion--common-suffix): Fix copy&paste error.
+
+2010-05-07  Christian von Roques <roques@mti.ag> (tiny change)
+
+	* lisp/epg.el (epg-key-capablity-alist): Add "D" flag (Bug#5592).
+
+2010-05-07  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* mail/binhex.el (binhex-decode-region-internal)
+	* mail/uudecode.el (uudecode-decode-region-internal)
+	* net/dns.el (dns-read-string-name, dns-write, dns-read)
+	(dns-read-type, dns-query)
+	* pgg-parse.el (pgg-parse-armor)
+	* pgg.el (pgg-verify-region)
+	* sha1.el (sha1-string-external): Don't run set-buffer-multibyte for
+	XEmacs.
+
+	* net/imap.el (imap-disable-multibyte): Redefine it as a macro.
+
+2010-05-07  Juanma Barranquero  <lekktu@gmail.com>
+
+	* progmodes/cperl-mode.el (cperl-mode-unload-function): New function.
+
+	Fix use of `filter-buffer-substring' (4th arg NOPROPS removed).
+	* emulation/cua-base.el (cua-repeat-replace-region):
+	* emulation/cua-gmrk.el (cua-copy-region-to-global-mark)
+	(cua-cut-region-to-global-mark):
+	Remove text properties with `set-text-properties'.
+
+2010-05-06  Michael Albinus  <michael.albinus@gmx.de>
+
+	* net/tramp.el (top, with-progress-reporter):
+	Use `symbol-function' inside `funcall'.
+
+	* net/tramp-compat.el (tramp-compat-file-attributes)
+	(tramp-compat-delete-file, tramp-compat-delete-directory):
+	Handle only `wrong-number-of-arguments' error.
+
+	* net/tramp-gvfs.el (tramp-gvfs-handle-copy-file): Fix typo.
+	(tramp-gvfs-handle-file-selinux-context): Use `symbol-function'
+	inside `funcall'.
+
+2010-05-06  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* minibuffer.el (completion--sreverse, completion--common-suffix):
+	New functions.
+	(completion-pcm--merge-completions): Extract common suffix when safe.
+
+	* emacs-lisp/easy-mmode.el (define-minor-mode):
+	Make :variable more flexible.
+	* files.el (auto-save-mode): Use it to define using define-minor-mode.
+
 2010-05-05  Juri Linkov  <juri@jurta.org>
 
 	Add `slow' and `history' tags to the desktop data.
@@ -20,8 +303,8 @@
 	(ange-ftp-delete-file): Add FORCE arg.
 	(ange-ftp-rename-remote-to-remote)
 	(ange-ftp-rename-local-to-remote, ange-ftp-rename-remote-to-local)
-	(ange-ftp-load, ange-ftp-compress, ange-ftp-uncompress): Force
-	file deletion.
+	(ange-ftp-load, ange-ftp-compress, ange-ftp-uncompress):
+	Force file deletion.
 
 	* net/tramp-compat.el (tramp-compat-delete-file): New defun.
 
@@ -39,8 +322,8 @@
 	(tramp-fish-handle-make-symbolic-link)
 	(tramp-fish-handle-process-file): Use `tramp-compat-delete-file'.
 
-	* net/tramp-ftp.el (tramp-ftp-file-name-handler): Use
-	`tramp-compat-delete-file'.
+	* net/tramp-ftp.el (tramp-ftp-file-name-handler):
+	Use `tramp-compat-delete-file'.
 
 	* net/tramp-gvfs.el (tramp-gvfs-handle-delete-file): Add FORCE arg.
 	(tramp-gvfs-handle-write-region): Use `tramp-compat-delete-file'.
--- a/lisp/abbrev.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/abbrev.el	Mon May 10 12:37:03 2010 +0900
@@ -338,7 +338,7 @@
 Abbrev to be expanded starts here rather than at beginning of word.
 This way, you can expand an abbrev with a prefix: insert the prefix,
 use this command, then insert the abbrev.  This command inserts a
-temporary hyphen after the prefix \(until the intended abbrev
+temporary hyphen after the prefix (until the intended abbrev
 expansion occurs).
 If the prefix is itself an abbrev, this command expands it, unless
 ARG is non-nil.  Interactively, ARG is the prefix argument."
@@ -460,7 +460,7 @@
 
 (defvar last-abbrev-text nil
   "The exact text of the last abbrev expanded.
-nil if the abbrev has already been unexpanded.")
+It is nil if the abbrev has already been unexpanded.")
 
 (defvar last-abbrev-location 0
   "The location of the start of the last abbrev expanded.")
--- a/lisp/calc/calc-graph.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/calc/calc-graph.el	Mon May 10 12:37:03 2010 +0900
@@ -345,7 +345,7 @@
 		     "set xlabel\nset ylabel\nset title\n"
 		     "set noclip points\nset clip one\nset clip two\n"
 		     "set format \"%g\"\nset tics\nset xtics\nset ytics\n"
-		     "set data style linespoints\n"
+		     "set style data linespoints\n"
 		     "set nogrid\nset nokey\nset nopolar\n"))
 	 (if (>= ver 3)
 	     (insert "set surface\nset nocontour\n"
--- a/lisp/cus-start.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/cus-start.el	Mon May 10 12:37:03 2010 +0900
@@ -408,6 +408,10 @@
 		       (fboundp 'define-fringe-bitmap))
 		      ((equal "font-use-system-font" (symbol-name symbol))
 		       (featurep 'system-font-setting))
+		      ;; Conditioned on x-create-frame, because that's
+		      ;; the condition for loadup.el to preload tool-bar.el.
+		      ((string-match "tool-bar-" (symbol-name symbol))
+		       (fboundp 'x-create-frame))
 		      (t t))))
     (if (not (boundp symbol))
 	;; If variables are removed from C code, give an error here!
--- a/lisp/ebuff-menu.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/ebuff-menu.el	Mon May 10 12:37:03 2010 +0900
@@ -95,7 +95,7 @@
 					     (cons first last))))))
 	(set-buffer buffer)
 	(Buffer-menu-mode)
-	(bury-buffer buffer)
+	(bury-buffer)                ;Get rid of window, if dedicated.
 	(message "")))
     (if select
 	(progn (set-buffer buffer)
--- a/lisp/electric.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/electric.el	Mon May 10 12:37:03 2010 +0900
@@ -58,12 +58,10 @@
         (err nil)
         (prompt-string prompt))
     (while t
-      (if (not (or (stringp prompt) (eq prompt nil) (eq prompt 'noprompt)))
+      (if (functionp prompt)
           (setq prompt-string (funcall prompt)))
       (if (not (stringp prompt-string))
-          (if (eq prompt-string 'noprompt)
-              (setq prompt-string nil)
-            (setq prompt-string "->")))
+          (setq prompt-string (unless (eq prompt-string 'noprompt) "->")))
       (setq cmd (read-key-sequence prompt-string))
       (setq last-command-event (aref cmd (1- (length cmd)))
 	    this-command (key-binding cmd t)
--- a/lisp/emacs-lisp/easy-mmode.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/emacs-lisp/easy-mmode.el	Mon May 10 12:37:03 2010 +0900
@@ -117,7 +117,10 @@
 :keymap MAP	Same as the KEYMAP argument.
 :require SYM	Same as in `defcustom'.
 :variable PLACE	The location (as can be used with `setf') to use instead
-		of the variable MODE to store the state of the mode.
+		of the variable MODE to store the state of the mode.  PLACE
+		can also be of the form (GET . SET) where GET is an expression
+		that returns the current state and SET is a function that takes
+		a new state and sets it.
 
 For example, you could write
   (define-minor-mode foo-mode \"If enabled, foo on you!\"
@@ -149,8 +152,9 @@
 	 (type nil)
 	 (extra-args nil)
 	 (extra-keywords nil)
-         (variable nil)
-         (modefun mode)
+         (variable nil)          ;The PLACE where the state is stored.
+         (setter nil)            ;The function (if any) to set the mode var.
+         (modefun mode)          ;The minor mode function name we're defining.
 	 (require t)
 	 (hook (intern (concat mode-name "-hook")))
 	 (hook-on (intern (concat mode-name "-on-hook")))
@@ -171,7 +175,12 @@
 	(:type (setq type (list :type (pop body))))
 	(:require (setq require (pop body)))
 	(:keymap (setq keymap (pop body)))
-        (:variable (setq variable (setq mode (pop body))))
+        (:variable (setq variable (pop body))
+         (if (not (functionp (cdr-safe variable)))
+             ;; PLACE is not of the form (GET . SET).
+             (setq mode variable)
+           (setq mode (car variable))
+           (setq setter (cdr variable))))
 	(t (push keyw extra-keywords) (push (pop body) extra-keywords))))
 
     (setq keymap-sym (if (and keymap (symbolp keymap)) keymap
@@ -230,7 +239,8 @@
 	 ;; repeat-command still does the toggling correctly.
 	 (interactive (list (or current-prefix-arg 'toggle)))
 	 (let ((,last-message (current-message)))
-           (,(if (symbolp mode) 'setq 'setf) ,mode
+           (,@(if setter (list setter)
+                (list (if (symbolp mode) 'setq 'setf) mode))
             (if (eq arg 'toggle)
                 (not ,mode)
               ;; A nil argument also means ON now.
@@ -240,7 +250,8 @@
            (run-hooks ',hook (if ,mode ',hook-on ',hook-off))
            (if (called-interactively-p 'any)
                (progn
-                 ,(if globalp `(customize-mark-as-set ',mode))
+                 ,(if (and globalp (symbolp mode))
+                      `(customize-mark-as-set ',mode))
                  ;; Avoid overwriting a message shown by the body,
                  ;; but do overwrite previous messages.
                  (unless (and (current-message)
@@ -265,10 +276,15 @@
 		     (t (error "Invalid keymap %S" ,keymap))))
 	     ,(format "Keymap for `%s'." mode-name)))
 
-       ,(unless variable
-          `(add-minor-mode ',mode ',lighter
+       ,(if (not (symbolp mode))
+            (if (or lighter keymap)
+                (error ":lighter and :keymap unsupported with mode expression %s" mode))
+          `(with-no-warnings
+             (add-minor-mode ',mode ',lighter
                            ,(if keymap keymap-sym
-                              `(if (boundp ',keymap-sym) ,keymap-sym)))))))
+                                `(if (boundp ',keymap-sym) ,keymap-sym))
+                             nil
+                             ,(unless (eq mode modefun) 'modefun)))))))
 
 ;;;
 ;;; make global minor mode
--- a/lisp/emacs-lisp/lisp.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/emacs-lisp/lisp.el	Mon May 10 12:37:03 2010 +0900
@@ -628,11 +628,12 @@
         (minibuffer-message "Nothing to complete")
       (let ((completion-annotate-function
              (plist-get plist :annotate-function)))
-        (completion-in-region (nth 0 data) (nth 1 data) (nth 2 data)
+      (completion-in-region (nth 0 data) (nth 1 data) (nth 2 data)
                               (plist-get plist :predicate))))))
-    
+
 
 (defun lisp-completion-at-point (&optional predicate)
+  "Function used for `completion-at-point-functions' in `emacs-lisp-mode'."
   ;; FIXME: the `end' could be after point?
   (let* ((pos (point))
          (beg (with-syntax-table emacs-lisp-mode-syntax-table
--- a/lisp/emulation/cua-base.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/emulation/cua-base.el	Mon May 10 12:37:03 2010 +0900
@@ -1040,7 +1040,9 @@
 		  (setq s (car u) e (cdr u)))))))
 	  (cond ((and s e (<= s e) (= s (mark t)))
 		 (setq cua--repeat-replace-text
-		       (filter-buffer-substring s e nil t)))
+		       (filter-buffer-substring s e))
+		 (set-text-properties 0 (length cua--repeat-replace-text)
+				      nil cua--repeat-replace-text))
 		((and (null s) (eq u elt)) ;; nothing inserted
 		 (setq cua--repeat-replace-text
 		       ""))
--- a/lisp/emulation/cua-gmrk.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/emulation/cua-gmrk.el	Mon May 10 12:37:03 2010 +0900
@@ -137,8 +137,9 @@
       (let ((src-buf (current-buffer)))
 	(save-excursion
 	  (if (equal (marker-buffer cua--global-mark-marker) src-buf)
-	      (let ((text (filter-buffer-substring start end nil t)))
+	      (let ((text (filter-buffer-substring start end)))
 		(goto-char (marker-position cua--global-mark-marker))
+		(set-text-properties 0 (length text) text)
 		(insert text))
 	    (set-buffer (marker-buffer cua--global-mark-marker))
 	    (goto-char (marker-position cua--global-mark-marker))
@@ -161,10 +162,11 @@
 	      (if (and (< start (marker-position cua--global-mark-marker))
 		       (< (marker-position cua--global-mark-marker) end))
 		  (message "Can't move region into itself")
-		(let ((text (filter-buffer-substring start end nil t))
+		(let ((text (filter-buffer-substring start end))
 		      (p1 (copy-marker start))
 		      (p2 (copy-marker end)))
 		  (goto-char (marker-position cua--global-mark-marker))
+		  (set-text-properties 0 (length text) text)
 		  (insert text)
 		  (cua--activate-global-mark)
 		  (delete-region (marker-position p1) (marker-position p2))
--- a/lisp/epg.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/epg.el	Mon May 10 12:37:03 2010 +0900
@@ -137,7 +137,8 @@
   '((?e . encrypt)
     (?s . sign)
     (?c . certify)
-    (?a . authentication)))
+    (?a . authentication)
+    (?D . disabled)))
 
 (defvar epg-new-signature-type-alist
   '((?D . detached)
--- a/lisp/erc/ChangeLog	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/erc/ChangeLog	Mon May 10 12:37:03 2010 +0900
@@ -1,3 +1,7 @@
+2010-05-07  Chong Yidong  <cyd@stupidchicken.com>
+
+	* Version 23.2 released.
+
 2010-03-10  Chong Yidong  <cyd@stupidchicken.com>
 
 	* Branch for 23.2.
@@ -12,8 +16,8 @@
 	(erc-server-reconnect): Use it to reconnect via old
 	connector (Bug#4958).
 
-	* erc.el (erc-determine-parameters): Save
-	erc-server-connect-function to erc-session-connector.
+	* erc.el (erc-determine-parameters):
+	Save erc-server-connect-function to erc-session-connector.
 
 2009-11-03  Stefan Monnier  <monnier@iro.umontreal.ca>
 
--- a/lisp/filecache.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/filecache.el	Mon May 10 12:37:03 2010 +0900
@@ -296,8 +296,8 @@
 (defun file-cache-add-directory-list (directory-list &optional regexp)
   "Add DIRECTORY-LIST (a list of directory names) to the file cache.
 If the optional REGEXP argument is non-nil, only files which match it
-will be added to the cache. Note that the REGEXP is applied to the files
-in each directory, not to the directory list itself."
+will be added to the cache.  Note that the REGEXP is applied to the
+files in each directory, not to the directory list itself."
   (interactive "XAdd files from directory list: ")
   (mapcar
    (lambda (dir) (file-cache-add-directory dir regexp))
@@ -370,10 +370,10 @@
 ;;;###autoload
 (defun file-cache-add-directory-recursively  (dir &optional regexp)
   "Adds DIR and any subdirectories to the file-cache.
-This function does not use any external programs
+This function does not use any external programs.
 If the optional REGEXP argument is non-nil, only files which match it
-will be added to the cache. Note that the REGEXP is applied to the files
-in each directory, not to the directory list itself."
+will be added to the cache.  Note that the REGEXP is applied to the
+files in each directory, not to the directory list itself."
   (interactive "DAdd directory: ")
   (require 'find-lisp)
   (mapcar
--- a/lisp/files.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/files.el	Mon May 10 12:37:03 2010 +0900
@@ -2260,7 +2260,6 @@
      ;; /tmp/Re.... or Message
      ("\\`/tmp/Re" . text-mode)
      ("/Message[0-9]*\\'" . text-mode)
-     ("\\.zone\\'" . zone-mode)
      ;; some news reader is reported to use this
      ("\\`/tmp/fol/" . text-mode)
      ("\\.oak\\'" . scheme-mode)
@@ -2294,7 +2293,6 @@
      ("#\\*mail\\*" . mail-mode)
      ("\\.g\\'" . antlr-mode)
      ("\\.ses\\'" . ses-mode)
-     ("\\.\\(soa\\|zone\\)\\'" . dns-mode)
      ("\\.docbook\\'" . sgml-mode)
      ("\\.com\\'" . dcl-mode)
      ("/config\\.\\(?:bat\\|log\\)\\'" . fundamental-mode)
@@ -4755,10 +4753,14 @@
       (mapc
        (lambda (file)
 	 (let ((target (expand-file-name
-			(file-name-nondirectory file) newname)))
-	   (if (file-directory-p file)
-	       (copy-directory file target keep-time parents)
-	     (copy-file file target t keep-time))))
+			(file-name-nondirectory file) newname))
+	       (attrs (file-attributes file)))
+	   (cond ((file-directory-p file)
+		  (copy-directory file target keep-time parents))
+		 ((stringp (car attrs)) ; Symbolic link
+		  (make-symbolic-link (car attrs) target t))
+		 (t
+		  (copy-file file target t keep-time)))))
        ;; We do not want to copy "." and "..".
        (directory-files	directory 'full directory-files-no-dot-files-regexp))
 
@@ -5150,30 +5152,6 @@
         (kill-buffer-ask buffer)))))
 
 
-(defun auto-save-mode (arg)
-  "Toggle auto-saving of contents of current buffer.
-With prefix argument ARG, turn auto-saving on if positive, else off."
-  (interactive "P")
-  (setq buffer-auto-save-file-name
-        (and (if (null arg)
-		 (or (not buffer-auto-save-file-name)
-		     ;; If auto-save is off because buffer has shrunk,
-		     ;; then toggling should turn it on.
-		     (< buffer-saved-size 0))
-	       (or (eq arg t) (listp arg) (and (integerp arg) (> arg 0))))
-	     (if (and buffer-file-name auto-save-visited-file-name
-		      (not buffer-read-only))
-		 buffer-file-name
-	       (make-auto-save-file-name))))
-  ;; If -1 was stored here, to temporarily turn off saving,
-  ;; turn it back on.
-  (and (< buffer-saved-size 0)
-       (setq buffer-saved-size 0))
-  (if (called-interactively-p 'interactive)
-      (message "Auto-save %s (in this buffer)"
-	       (if buffer-auto-save-file-name "on" "off")))
-  buffer-auto-save-file-name)
-
 (defun rename-auto-save-file ()
   "Adjust current buffer's auto save file name for current conditions.
 Also rename any existing auto save file, if it was made in this session."
--- a/lisp/gnus/ChangeLog	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/gnus/ChangeLog	Mon May 10 12:37:03 2010 +0900
@@ -1,3 +1,62 @@
+2010-05-07  Christian von Roques <roques@mti.ag> (tiny change)
+
+	* mml2015.el (mml2015-epg-find-usable-key): Skip disabled key
+	(Bug#5592).
+
+2010-05-07  Julien Danjou  <julien@danjou.info>
+
+	* gnus-art.el (gnus-mime-pipe-part): Add optional argument `cmd'; pass
+	it to mm-pipe-part.
+
+	* mm-decode.el (mm-pipe-part): Add optional argument `cmd'; use it if
+	it is given.
+
+2010-05-07  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* nnweb.el (nnweb-gmane-search)
+	* yenc.el (yenc-decode-region): Don't run set-buffer-multibyte for
+	XEmacs.
+
+	* gnus-art.el (gnus-article-browse-html-parts)
+	* gnus-group.el (gnus-read-ephemeral-gmane-group)
+	(gnus-read-ephemeral-bug-grou): Use mm-make-temp-file instead of
+	make-temp-file.
+
+	* gnus-dired.el (gnus-dired-mode): Bind gnus-dired-mode-hook,
+	gnus-dired-mode-on-hook and gnus-dired-mode-off-hook for XEmacs when
+	compiling.
+
+	* gnus-ml.el (gnus-mailing-list-mode): Bind gnus-mailing-list-mode-hook,
+	gnus-mailing-list-mode-on-hook and gnus-mailing-list-mode-off-hook for
+	XEmacs when compiling.
+
+	* gnus-salt.el (gnus-pick-mode): Bind gnus-pick-mode-on-hook and
+	gnus-pick-mode-off-hook for XEmacs when compiling.
+	(gnus-binary-mode): Bind gnus-binary-mode-on-hook and
+	gnus-binary-mode-off-hook for XEmacs when compiling.
+
+	* gnus-sum.el (gnus-summary-limit-strange-charsets-predicate): Return
+	nil if char-charset is not available.
+
+	* sieve-manage.el (sieve-manage-disable-multibyte): Redefine it as a
+	macro.
+
+	* mm-url.el (mm-url-form-encode-xwfu): Use mm-encode-coding-string
+	instead of encode-coding-string.
+
+	* mm-util.el (mm-enable-multibyte, mm-disable-multibyte): Use (featurep
+	'xemacs) instead of mm-emacs-mule to switch function definitions.
+	(mm-with-unibyte-current-buffer): Make it a progn macro for XEmacs.
+
+2010-05-06  Tommi Vainikainen  <thv@iki.fi>  (tiny change)
+
+	* mml-sec.el (mml-secure-message-sign): Fix cut and paste error.
+
+2010-05-06  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* gnus-dired.el, gnus-draft.el, gnus-ml.el, gnus-salt.el, gnus-sum.el,
+	gnus-undo.el, mml.el: Require easy-mmode for XEmacs when compiling.
+
 2010-05-03  Juanma Barranquero  <lekktu@gmail.com>
 
 	* mm-util.el (mm-decompress-buffer): Use `delete-file';
@@ -21,6 +80,12 @@
 	* gnus-dired.el (gnus-dired-mode-map): Initialize in declaration.
 	(gnus-dired-mode): Use define-minor-mode.
 
+2010-05-01  Andreas Seltenreich  <seltenreich@gmx.de>
+
+	* mml.el (mml-generate-mime-1,mml-compute-boundary-1): Update 'mml
+	handles on recursive mml-to-mime translation and check them for
+	boundary delimiter collisions.  Reported by: Greg Troxel.
+
 2010-04-27  Katsumi Yamaoka  <yamaoka@jpl.org>
 
 	* gnus-util.el: Don't load tm and apel XEmacs packages when compiling.
--- a/lisp/gnus/gnus-art.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/gnus/gnus-art.el	Mon May 10 12:37:03 2010 +0900
@@ -2897,7 +2897,7 @@
 <img[\t\n ]+\\(?:[^\t\n >]+[\t\n ]+\\)*src=\"\\(cid:\\([^\"]+\\)\\)\""
 					   nil t)
 		   (unless cid-dir
-		     (setq cid-dir (make-temp-file "cid" t))
+		     (setq cid-dir (mm-make-temp-file "cid" t))
 		     (add-to-list 'gnus-article-browse-html-temp-list cid-dir))
 		   (setq file nil
 			 content nil)
@@ -5041,13 +5041,14 @@
     (when data
       (mm-save-part data))))
 
-(defun gnus-mime-pipe-part ()
-  "Pipe the MIME part under point to a process."
+(defun gnus-mime-pipe-part (&optional cmd)
+  "Pipe the MIME part under point to a process.
+Use CMD as the process."
   (interactive)
   (gnus-article-check-buffer)
   (let ((data (get-text-property (point) 'gnus-data)))
     (when data
-      (mm-pipe-part data))))
+      (mm-pipe-part data cmd))))
 
 (defun gnus-mime-view-part ()
   "Interactively choose a viewing method for the MIME part under point."
--- a/lisp/gnus/gnus-dired.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/gnus/gnus-dired.el	Mon May 10 12:37:03 2010 +0900
@@ -39,6 +39,9 @@
 
 ;;; Code:
 
+(eval-when-compile
+  (when (featurep 'xemacs)
+    (require 'easy-mmode))) ; for `define-minor-mode'
 (require 'dired)
 (autoload 'mml-attach-file "mml")
 (autoload 'mm-default-file-encoding "mm-decode");; Shift this to `mailcap.el'?
@@ -84,6 +87,12 @@
 			       gnus-user-agent)
 		(function :tag "Other")))
 
+(eval-when-compile
+  (when (featurep 'xemacs)
+    (defvar gnus-dired-mode-hook)
+    (defvar gnus-dired-mode-on-hook)
+    (defvar gnus-dired-mode-off-hook)))
+
 (define-minor-mode gnus-dired-mode
   "Minor mode for intersections of gnus and dired.
 
--- a/lisp/gnus/gnus-draft.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/gnus/gnus-draft.el	Mon May 10 12:37:03 2010 +0900
@@ -32,6 +32,9 @@
 (require 'nndraft)
 (require 'gnus-agent)
 (eval-when-compile (require 'cl))
+(eval-when-compile
+  (when (featurep 'xemacs)
+    (require 'easy-mmode))) ; for `define-minor-mode'
 
 ;;; Draft minor mode
 
--- a/lisp/gnus/gnus-group.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/gnus/gnus-group.el	Mon May 10 12:37:03 2010 +0900
@@ -2364,7 +2364,7 @@
   (unless range (setq range 500))
   (when (< range 1)
     (error "Invalid range: %s" range))
-  (let ((tmpfile (make-temp-file
+  (let ((tmpfile (mm-make-temp-file
 		  (format "%s.start-%s.range-%s." group start range)))
 	(gnus-thread-sort-functions '(gnus-thread-sort-by-number)))
     (with-temp-file tmpfile
@@ -2445,7 +2445,7 @@
 		     (cdr (assoc 'emacs gnus-bug-group-download-format-alist))))
   (when (stringp number)
     (setq number (string-to-number number)))
-  (let ((tmpfile (make-temp-file "gnus-temp-group-")))
+  (let ((tmpfile (mm-make-temp-file "gnus-temp-group-")))
     (with-temp-file tmpfile
       (url-insert-file-contents (format mbox-url number))
       (write-region (point-min) (point-max) tmpfile)
--- a/lisp/gnus/gnus-ml.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/gnus/gnus-ml.el	Mon May 10 12:37:03 2010 +0900
@@ -30,6 +30,9 @@
 (require 'gnus)
 (require 'gnus-msg)
 (eval-when-compile (require 'cl))
+(eval-when-compile
+  (when (featurep 'xemacs)
+    (require 'easy-mmode))) ; for `define-minor-mode'
 
 ;;; Mailing list minor mode
 
@@ -82,6 +85,12 @@
 	  (gnus-mailing-list-mode 1))
       (gnus-message 1 "no list-post in this message."))))
 
+(eval-when-compile
+  (when (featurep 'xemacs)
+    (defvar gnus-mailing-list-mode-hook)
+    (defvar gnus-mailing-list-mode-on-hook)
+    (defvar gnus-mailing-list-mode-off-hook)))
+
 ;;;###autoload
 (define-minor-mode gnus-mailing-list-mode
   "Minor mode for providing mailing-list commands.
--- a/lisp/gnus/gnus-salt.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/gnus/gnus-salt.el	Mon May 10 12:37:03 2010 +0900
@@ -26,6 +26,9 @@
 ;;; Code:
 
 (eval-when-compile (require 'cl))
+(eval-when-compile
+  (when (featurep 'xemacs)
+    (require 'easy-mmode))) ; for `define-minor-mode'
 
 (require 'gnus)
 (require 'gnus-sum)
@@ -98,6 +101,11 @@
 	["Start reading" gnus-pick-start-reading t]
 	["Switch pick mode off" gnus-pick-mode gnus-pick-mode]))))
 
+(eval-when-compile
+  (when (featurep 'xemacs)
+    (defvar gnus-pick-mode-on-hook)
+    (defvar gnus-pick-mode-off-hook)))
+
 (define-minor-mode gnus-pick-mode
   "Minor mode for providing a pick-and-read interface in Gnus summary buffers.
 
@@ -329,6 +337,11 @@
       '("Pick"
 	["Switch binary mode off" gnus-binary-mode t]))))
 
+(eval-when-compile
+  (when (featurep 'xemacs)
+    (defvar gnus-binary-mode-on-hook)
+    (defvar gnus-binary-mode-off-hook)))
+
 (define-minor-mode gnus-binary-mode
   "Minor mode for providing a binary group interface in Gnus summary buffers."
   :lighter " Binary" :keymap gnus-binary-mode-map
--- a/lisp/gnus/gnus-sum.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/gnus/gnus-sum.el	Mon May 10 12:37:03 2010 +0900
@@ -30,6 +30,9 @@
   (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
 (eval-when-compile
   (require 'cl))
+(eval-when-compile
+  (when (featurep 'xemacs)
+    (require 'easy-mmode))) ; for `define-minor-mode'
 
 (defvar tool-bar-mode)
 (defvar gnus-tmp-header)
@@ -8182,14 +8185,15 @@
       (gnus-summary-position-point))))
 
 (defun gnus-summary-limit-strange-charsets-predicate (header)
-  (let ((string (concat (mail-header-subject header)
-			(mail-header-from header)))
-	charset found)
-    (dotimes (i (1- (length string)))
-      (setq charset (format "%s" (char-charset (aref string (1+ i)))))
-      (when (string-match "unicode\\|big\\|japanese" charset)
-	(setq found t)))
-    found))
+  (when (fboundp 'char-charset)
+    (let ((string (concat (mail-header-subject header)
+			  (mail-header-from header)))
+	  charset found)
+      (dotimes (i (1- (length string)))
+	(setq charset (format "%s" (char-charset (aref string (1+ i)))))
+	(when (string-match "unicode\\|big\\|japanese" charset)
+	  (setq found t)))
+      found)))
 
 (defun gnus-summary-limit-to-predicate (predicate)
   "Limit to articles where PREDICATE returns non-nil.
--- a/lisp/gnus/gnus-undo.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/gnus/gnus-undo.el	Mon May 10 12:37:03 2010 +0900
@@ -45,6 +45,9 @@
 ;;; Code:
 
 (eval-when-compile (require 'cl))
+(eval-when-compile
+  (when (featurep 'xemacs)
+    (require 'easy-mmode))) ; for `define-minor-mode'
 
 (require 'gnus-util)
 (require 'gnus)
--- a/lisp/gnus/mm-decode.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/gnus/mm-decode.el	Mon May 10 12:37:03 2010 +0900
@@ -1301,12 +1301,13 @@
 	  (mm-write-region (point-min) (point-max) file nil nil nil 'binary t)
 	(set-default-file-modes current-file-modes)))))
 
-(defun mm-pipe-part (handle)
-  "Pipe HANDLE to a process."
-  (let* ((name (mail-content-type-get (mm-handle-type handle) 'name))
-	 (command
-	  (gnus-read-shell-command
-           "Shell command on MIME part: " mm-last-shell-command)))
+(defun mm-pipe-part (handle &optional cmd)
+  "Pipe HANDLE to a process.
+Use CMD as the process."
+  (let ((name (mail-content-type-get (mm-handle-type handle) 'name))
+	(command (or cmd
+		     (gnus-read-shell-command
+		      "Shell command on MIME part: " mm-last-shell-command))))
     (mm-with-unibyte-buffer
       (mm-insert-part handle)
       (mm-add-meta-html-tag handle)
--- a/lisp/gnus/mm-url.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/gnus/mm-url.el	Mon May 10 12:37:03 2010 +0900
@@ -404,14 +404,10 @@
       ((= char ?  ) "+")
       ((memq char mm-url-unreserved-chars) (char-to-string char))
       (t (upcase (format "%%%02x" char)))))
-   ;; Fixme: Should this actually be accepting multibyte?  Is there a
-   ;; better way in XEmacs?
-   (if (featurep 'mule)
-       (encode-coding-string chunk
-			     (if (fboundp 'find-coding-systems-string)
-				 (car (find-coding-systems-string chunk))
-				 buffer-file-coding-system))
-     chunk)
+   (mm-encode-coding-string chunk
+			    (if (fboundp 'find-coding-systems-string)
+				(car (find-coding-systems-string chunk))
+			      buffer-file-coding-system))
    ""))
 
 (defun mm-url-encode-www-form-urlencoded (pairs)
--- a/lisp/gnus/mm-util.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/gnus/mm-util.el	Mon May 10 12:37:03 2010 +0900
@@ -908,20 +908,20 @@
 			     (fboundp 'set-buffer-multibyte))
     "True in Emacs with Mule.")
 
-  (if mm-emacs-mule
-      (defun mm-enable-multibyte ()
-	"Set the multibyte flag of the current buffer.
+  (if (featurep 'xemacs)
+      (defalias 'mm-enable-multibyte 'ignore)
+    (defun mm-enable-multibyte ()
+      "Set the multibyte flag of the current buffer.
 Only do this if the default value of `enable-multibyte-characters' is
 non-nil.  This is a no-op in XEmacs."
-	(set-buffer-multibyte 'to))
-    (defalias 'mm-enable-multibyte 'ignore))
+      (set-buffer-multibyte t)))
 
-  (if mm-emacs-mule
-      (defun mm-disable-multibyte ()
-	"Unset the multibyte flag of in the current buffer.
+  (if (featurep 'xemacs)
+      (defalias 'mm-disable-multibyte 'ignore)
+    (defun mm-disable-multibyte ()
+      "Unset the multibyte flag of in the current buffer.
 This is a no-op in XEmacs."
-	(set-buffer-multibyte nil))
-    (defalias 'mm-disable-multibyte 'ignore)))
+      (set-buffer-multibyte nil))))
 
 (defun mm-preferred-coding-system (charset)
   ;; A typo in some Emacs versions.
@@ -1239,22 +1239,24 @@
 harmful since it is likely to modify existing data in the buffer.
 For instance, it converts \"\\300\\255\" into \"\\255\" in
 Emacs 23 (unicode)."
-  ;; FIXME: (default-value 'enable-multibyte-characters) is read-only
-  ;; so let-binding it is wrong.  The right fix is to not use this
-  ;; macro at all any more, since it's been ill-defined from the start.
-  (let ((multibyte (make-symbol "multibyte"))
-	(buffer (make-symbol "buffer")))
-    `(if mm-emacs-mule
-	 (let ((,multibyte enable-multibyte-characters)
-	       (,buffer (current-buffer)))
-	   (unwind-protect
-	       (letf (((default-value 'enable-multibyte-characters) nil))
-		 (set-buffer-multibyte nil)
-		 ,@forms)
-	     (set-buffer ,buffer)
-	     (set-buffer-multibyte ,multibyte)))
-       (letf (((default-value 'enable-multibyte-characters) nil))
-	 ,@forms))))
+  (if (featurep 'xemacs)
+      `(progn ,@forms)
+    ;; FIXME: (default-value 'enable-multibyte-characters) is read-only
+    ;; so let-binding it is wrong.  The right fix is to not use this
+    ;; macro at all any more, since it's been ill-defined from the start.
+    (let ((multibyte (make-symbol "multibyte"))
+	  (buffer (make-symbol "buffer")))
+      `(if mm-emacs-mule
+	   (let ((,multibyte enable-multibyte-characters)
+		 (,buffer (current-buffer)))
+	     (unwind-protect
+		 (letf (((default-value 'enable-multibyte-characters) nil))
+		       (set-buffer-multibyte nil)
+		       ,@forms)
+	       (set-buffer ,buffer)
+	       (set-buffer-multibyte ,multibyte)))
+	 (letf (((default-value 'enable-multibyte-characters) nil))
+	       ,@forms)))))
 (put 'mm-with-unibyte-current-buffer 'lisp-indent-function 0)
 (put 'mm-with-unibyte-current-buffer 'edebug-form-spec '(body))
 
--- a/lisp/gnus/mml-sec.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/gnus/mml-sec.el	Mon May 10 12:37:03 2010 +0900
@@ -308,11 +308,11 @@
 
 
 (defun mml-secure-message-sign (&optional method)
-  "Add MML tags to sign this MML part.
+  "Add MML tags to sign the entire message.
 Use METHOD if given. Else use `mml-secure-method' or
 `mml-default-sign-method'."
   (interactive)
-  (mml-secure-part
+  (mml-secure-message
    (or method mml-secure-method mml-default-sign-method)
    'sign))
 
--- a/lisp/gnus/mml.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/gnus/mml.el	Mon May 10 12:37:03 2010 +0900
@@ -33,6 +33,9 @@
 (require 'mm-decode)
 (require 'mml-sec)
 (eval-when-compile (require 'cl))
+(eval-when-compile
+  (when (featurep 'xemacs)
+    (require 'easy-mmode))) ; for `define-minor-mode'
 
 (autoload 'message-make-message-id "message")
 (declare-function gnus-setup-posting-charset "gnus-msg" (group))
@@ -520,7 +523,10 @@
 			  ;; `m-g-d-t' will be bound to "message/rfc822"
 			  ;; when encoding an article to be forwarded.
 			  (mml-generate-default-type "text/plain"))
-		      (mml-to-mime))
+		      (mml-to-mime)
+		      ;; Update handle so mml-compute-boundary can
+		      ;; detect collisions with the nested parts.
+		      (setcdr (assoc 'contents cont) (buffer-string)))
 		    (let ((mm-7bit-chars (concat mm-7bit-chars "\x1b")))
 		      ;; ignore 0x1b, it is part of iso-2022-jp
 		      (setq encoding (mm-body-7-or-8))))
@@ -699,7 +705,7 @@
 (defun mml-compute-boundary-1 (cont)
   (let (filename)
     (cond
-     ((eq (car cont) 'part)
+     ((member (car cont) '(part mml))
       (with-temp-buffer
 	(cond
 	 ((cdr (assq 'buffer cont))
--- a/lisp/gnus/mml2015.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/gnus/mml2015.el	Mon May 10 12:37:03 2010 +0900
@@ -1021,6 +1021,7 @@
       (let ((pointer (epg-key-sub-key-list (car keys))))
 	(while pointer
 	  (if (and (memq usage (epg-sub-key-capability (car pointer)))
+		   (not (memq 'disabled (epg-sub-key-capability (car pointer))))
 		   (not (memq (epg-sub-key-validity (car pointer))
 			      '(revoked expired))))
 	      (throw 'found (car keys)))
--- a/lisp/gnus/nnweb.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/gnus/nnweb.el	Mon May 10 12:37:03 2010 +0900
@@ -525,7 +525,7 @@
        ;;("TOPDOC" . "1000")
        ))))
   (setq buffer-file-name nil)
-  (set-buffer-multibyte t)
+  (unless (featurep 'xemacs) (set-buffer-multibyte t))
   (mm-decode-coding-region (point-min) (point-max) 'utf-8)
   t)
 
--- a/lisp/gnus/sieve-manage.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/gnus/sieve-manage.el	Mon May 10 12:37:03 2010 +0900
@@ -191,10 +191,10 @@
 
 ;; Internal utility functions
 
-(defsubst sieve-manage-disable-multibyte ()
+(defmacro sieve-manage-disable-multibyte ()
   "Enable multibyte in the current buffer."
-  (when (fboundp 'set-buffer-multibyte)
-    (set-buffer-multibyte nil)))
+  (unless (featurep 'xemacs)
+    '(set-buffer-multibyte nil)))
 
 (declare-function password-read         "password-cache" (prompt &optional key))
 (declare-function password-cache-add    "password-cache" (key password))
--- a/lisp/gnus/yenc.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/gnus/yenc.el	Mon May 10 12:37:03 2010 +0900
@@ -89,9 +89,9 @@
 	      (when (re-search-forward "^=yend.*$" end t)
 		(setq last (match-beginning 0))
 		(setq footer-alist (yenc-parse-line (match-string 0)))
-                (with-current-buffer
-                    (setq work-buffer (generate-new-buffer " *yenc-work*"))
-                  (set-buffer-multibyte nil))
+		(setq work-buffer (generate-new-buffer " *yenc-work*"))
+		(unless (featurep 'xemacs)
+		  (with-current-buffer work-buffer (set-buffer-multibyte nil)))
 		(while (< first last)
 		  (setq char (char-after first))
 		  (cond ((or (eq char ?\r)
--- a/lisp/image-mode.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/image-mode.el	Mon May 10 12:37:03 2010 +0900
@@ -392,7 +392,7 @@
 to display an image file as the actual image.
 
 You can use `image-mode-as-text' in `auto-mode-alist' when you want
-to display an image file as text inititally.
+to display an image file as text initially.
 
 See commands `image-mode' and `image-minor-mode' for more information
 on these modes."
--- a/lisp/info.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/info.el	Mon May 10 12:37:03 2010 +0900
@@ -4343,8 +4343,7 @@
             (cond
              ((> Info-breadcrumbs-depth 0)
 	      (let ((ov (make-overlay (point-min) (1+ header-end))))
-		(overlay-put ov 'invisible t)
-		(overlay-put ov 'after-string (Info-breadcrumbs))
+		(overlay-put ov 'display (Info-breadcrumbs))
 		(overlay-put ov 'evaporate t)))
              ((not (bobp))
               ;; Hide the punctuation at the end, too.
--- a/lisp/international/mule.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/international/mule.el	Mon May 10 12:37:03 2010 +0900
@@ -1690,7 +1690,8 @@
 (defcustom auto-coding-alist
   ;; .exe and .EXE are added to support archive-mode looking at DOS
   ;; self-extracting exe archives.
-  (purecopy '(("\\.\\(\
+  (mapcar (lambda (arg) (cons (purecopy (car arg)) (cdr arg)))
+	  '(("\\.\\(\
 arc\\|zip\\|lzh\\|lha\\|zoo\\|[jew]ar\\|xpi\\|rar\\|7z\\|\
 ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\|7Z\\)\\'"
      . no-conversion-multibyte)
--- a/lisp/language/indian.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/language/indian.el	Mon May 10 12:37:03 2010 +0900
@@ -198,15 +198,14 @@
 
 (defconst gurmukhi-composable-pattern
   (let ((table
-	 '(("a" . "[\u0A01-\u0A02]")	; SIGN ADAK BINDI .. BINDI
-	   ("A" . "\u0A03]")		; SIGN VISARGA
+	 '(("a" . "[\u0A01-\u0A02\u0A70]") ; SIGN ADAK BINDI .. BINDI, TIPPI
+	   ("A" . "\u0A03")		; SIGN VISARGA
 	   ("V" . "[\u0A05-\u0A14]")	; independent vowel
 	   ("C" . "[\u0A15-\u0A39\u0A59-\u0A5E]")	; consonant
-	   ("Y" . "[\u0A2F\u0A30\u0A35\u0A39]") ; YA, RA, VA, HA
+	   ("Y" . "[\u0A2F-u0A30\u0A35\u0A39]") ; YA, RA, VA, HA
 	   ("n" . "\u0A3C")		; NUKTA
 	   ("v" . "[\u0A3E-\u0A4C]")	; vowel sign
 	   ("H" . "\u0A4D")		; VIRAMA
-	   ("a" . "\u0A70")		; TIPPI
 	   ("N" . "\u200C")		; ZWNJ
 	   ("J" . "\u200D")		; ZWJ
 	   ("X" . "[\u0A00-\u0A7F]"))))	; all coverage
@@ -226,7 +225,7 @@
 (defconst gujarati-composable-pattern
   (let ((table
 	 '(("a" . "[\u0A81-\u0A82]")	; SIGN CANDRABINDU .. ANUSVARA
-	   ("A" . "\u0A83]")		; SIGN VISARGA
+	   ("A" . "\u0A83")		; SIGN VISARGA
 	   ("V" . "[\u0A85-\u0A94\u0AE0-\u0AE1]") ; independent vowel
 	   ("C" . "[\u0A95-\u0AB9]")	; consonant
 	   ("R" . "\u0AB0")		; RA
@@ -258,7 +257,7 @@
 	   ("B" . "[\u0B15-\u0B17\u0B1B-\u0B1D\u0B1F-\u0B21\u0B23-\u0B24\u0B27-\u0B30\u0B32-\u0B35\u0B38-\u0B39]") ; consonant with below form
 	   ("R" . "\u0B30")		; RA
 	   ("n" . "\u0B3C")		; NUKTA
-	   ("v" . "[\u0B3E-\u0B44\u0B47\u0B56-\u0B57\u0B62-\u0B63]") ; vowel sign
+	   ("v" . "[\u0B3E-\u0B4C\u0B56-\u0B57\u0B62-\u0B63]") ; vowel sign
 	   ("H" . "\u0B4D")		; VIRAMA
 	   ("N" . "\u200C")		; ZWNJ
 	   ("J" . "\u200D")		; ZWJ
@@ -281,7 +280,7 @@
 	 '(("a" . "\u0B82")		; SIGN ANUSVARA
 	   ("V" . "[\u0B85-\u0B94]")	; independent vowel
 	   ("C" . "[\u0B95-\u0BB9]")	; consonant
-	   ("v" . "[\u0BBE-\u0BC8\u0BD7]") ; vowel sign
+	   ("v" . "[\u0BBE-\u0BCC\u0BD7]") ; vowel sign
 	   ("H" . "\u0BCD")		; VIRAMA
 	   ("N" . "\u200C")		; ZWNJ
 	   ("J" . "\u200D")		; ZWJ
@@ -351,7 +350,7 @@
 	   ("V" . "[\u0D05-\u0D14\u0D60-\u0D61]") ; independent vowel
 	   ("C" . "[\u0D15-\u0D39]")		  ; consonant 
 	   ("Y" . "[\u0D2F-\u0D30\u0D32\u0D35]")  ; YA, RA, LA, VA
-	   ("v" . "[\u0D3E-\u0D48\u0D57\u0D62-\u0D63]")	; postbase matra
+	   ("v" . "[\u0D3E-\u0D4C\u0D57\u0D62-\u0D63]")	; postbase matra
 	   ("H" . "\u0D4D")			  ; SIGN VIRAMA
 	   ("N" . "\u200C")			  ; ZWNJ
 	   ("J" . "\u200D")			  ; ZWJ
--- a/lisp/mail/binhex.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/mail/binhex.el	Mon May 10 12:37:03 2010 +0900
@@ -221,7 +221,8 @@
 	  (goto-char start)
 	  (when (re-search-forward binhex-begin-line end t)
             (setq work-buffer (generate-new-buffer " *binhex-work*"))
-            (with-current-buffer work-buffer (set-buffer-multibyte nil))
+	    (unless (featurep 'xemacs)
+	      (with-current-buffer work-buffer (set-buffer-multibyte nil)))
 	    (beginning-of-line)
 	    (setq bits 0 counter 0)
 	    (while tmp
--- a/lisp/mail/uudecode.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/mail/uudecode.el	Mon May 10 12:37:03 2010 +0900
@@ -216,7 +216,7 @@
 	  (skip-chars-forward non-data-chars end))
 	(if file-name
             (with-temp-file file-name
-              (set-buffer-multibyte nil)
+              (unless (featurep 'xemacs) (set-buffer-multibyte nil))
               (insert (apply 'concat (nreverse result))))
 	  (or (markerp end) (setq end (set-marker (make-marker) end)))
 	  (goto-char start)
--- a/lisp/mh-e/ChangeLog	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/mh-e/ChangeLog	Mon May 10 12:37:03 2010 +0900
@@ -1,3 +1,7 @@
+2010-05-07  Chong Yidong  <cyd@stupidchicken.com>
+
+	* Version 23.2 released.
+
 2010-05-03  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* mh-show.el (mh-showing-mode): Move function to mh-e.el.
--- a/lisp/minibuffer.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/minibuffer.el	Mon May 10 12:37:03 2010 +0900
@@ -1169,7 +1169,7 @@
  `:predicate'           a predicate that completion candidates need to satisfy.
  `:annotation-function' the value to use for `completion-annotate-function'.")
 
-(defun complete-symbol (&optional arg)
+(defun completion-at-point (&optional arg)
   "Perform completion on the text around point.
 The completion method is determined by `completion-at-point-functions'.
 
@@ -1193,7 +1193,7 @@
 	  (completion-in-region start end (nth 2 res)
 				(plist-get plist :predicate))))))))
 
-(defalias 'completion-at-point 'complete-symbol)
+(define-obsolete-function-alias 'complete-symbol 'completion-at-point "24.1")
 
 ;;; Key bindings.
 
@@ -1769,6 +1769,14 @@
   :group 'minibuffer
   :type 'string)
 
+(defcustom completion-pcm-complete-word-inserts-delimiters nil
+  "Treat the SPC or - inserted by `minibuffer-complete-word' as delimiters.
+Those chars are treated as delimiters iff this variable is non-nil.
+I.e. if non-nil, M-x SPC will just insert a \"-\" in the minibuffer, whereas
+if nil, it will list all possible commands in *Completions* because none of
+the commands start with a \"-\" or a SPC."
+  :type 'boolean)
+
 (defun completion-pcm--pattern-trivial-p (pattern)
   (and (stringp (car pattern))
        ;; It can be followed by `point' and "" and still be trivial.
@@ -1781,7 +1789,7 @@
 (defun completion-pcm--string->pattern (string &optional point)
   "Split STRING into a pattern.
 A pattern is a list where each element is either a string
-or a symbol chosen among `any', `star', `point'."
+or a symbol chosen among `any', `star', `point', `prefix'."
   (if (and point (< point (length string)))
       (let ((prefix (substring string 0 point))
             (suffix (substring string point)))
@@ -1794,11 +1802,12 @@
 
       (while (and (setq p (string-match completion-pcm--delim-wild-regex
                                         string p))
-                  ;; If the char was added by minibuffer-complete-word, then
-                  ;; don't treat it as a delimiter, otherwise "M-x SPC"
-                  ;; ends up inserting a "-" rather than listing
-                  ;; all completions.
-                  (not (get-text-property p 'completion-try-word string)))
+                  (or completion-pcm-complete-word-inserts-delimiters
+                      ;; If the char was added by minibuffer-complete-word,
+                      ;; then don't treat it as a delimiter, otherwise
+                      ;; "M-x SPC" ends up inserting a "-" rather than listing
+                      ;; all completions.
+                      (not (get-text-property p 'completion-try-word string))))
         ;; Usually, completion-pcm--delim-wild-regex matches a delimiter,
         ;; meaning that something can be added *before* it, but it can also
         ;; match a prefix and postfix, in which case something can be added
@@ -1824,11 +1833,10 @@
          (concat "\\`"
                  (mapconcat
                   (lambda (x)
-                    (case x
-                      ((star any point)
-                       (if (if (consp group) (memq x group) group)
-                           "\\(.*?\\)" ".*?"))
-                      (t (regexp-quote x))))
+                    (cond
+                     ((stringp x) (regexp-quote x))
+                     ((if (consp group) (memq x group) group)
+                      "\\(.*?\\)" ".*?")))
                   pattern
                   ""))))
     ;; Avoid pathological backtracking.
@@ -1983,6 +1991,17 @@
       (nconc (completion-pcm--hilit-commonality pattern all)
              (length prefix)))))
 
+(defun completion--sreverse (str)
+  "Like `reverse' but for a string STR rather than a list."
+  (apply 'string (nreverse (mapcar 'identity str))))
+
+(defun completion--common-suffix (strs)
+  "Return the common suffix of the strings STRS."
+  (completion--sreverse
+   (try-completion
+    ""
+    (mapcar 'completion--sreverse strs))))
+
 (defun completion-pcm--merge-completions (strs pattern)
   "Extract the commonality in STRS, with the help of PATTERN."
   ;; When completing while ignoring case, we want to try and avoid
@@ -2044,7 +2063,17 @@
                 ;; `any' into a `star' because the surrounding context has
                 ;; changed such that string->pattern wouldn't add an `any'
                 ;; here any more.
-                (unless unique (push elem res))
+                (unless unique
+                  (push elem res)
+                  (when (memq elem '(star point prefix))
+                    ;; Extract common suffix additionally to common prefix.
+                    ;; Only do it for `point', `star', and `prefix' since for
+                    ;; `any' it could lead to a merged completion that
+                    ;; doesn't itself match the candidates.
+                    (let ((suffix (completion--common-suffix comps)))
+                      (assert (stringp suffix))
+                      (unless (equal suffix "")
+                        (push suffix res)))))
                 (setq fixed "")))))
         ;; We return it in reverse order.
         res)))))
@@ -2053,8 +2082,7 @@
   (mapconcat (lambda (x) (cond
                      ((stringp x) x)
                      ((eq x 'star) "*")
-                     ((eq x 'any) "")
-                     ((eq x 'point) "")))
+                     (t "")))           ;any, point, prefix.
              pattern
              ""))
 
@@ -2096,6 +2124,7 @@
              (pointpat (or (memq 'point mergedpat)
                            (memq 'any   mergedpat)
                            (memq 'star  mergedpat)
+                           ;; Not `prefix'.
 			   mergedpat))
              ;; New pos from the start.
              (newpos (length (completion-pcm--pattern->string pointpat)))
@@ -2126,7 +2155,7 @@
                          beforepoint afterpoint bounds))
          (pattern (if (not (stringp (car basic-pattern)))
                       basic-pattern
-                    (cons 'any basic-pattern)))
+                    (cons 'prefix basic-pattern)))
          (all (completion-pcm--all-completions prefix pattern table pred)))
     (list all pattern prefix suffix (car bounds))))
 
--- a/lisp/net/dns.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/net/dns.el	Mon May 10 12:37:03 2010 +0900
@@ -101,7 +101,7 @@
 
 (defun dns-read-string-name (string buffer)
   (with-temp-buffer
-    (set-buffer-multibyte nil)
+    (unless (featurep 'xemacs) (set-buffer-multibyte nil))
     (insert string)
     (goto-char (point-min))
     (dns-read-name buffer)))
@@ -135,7 +135,7 @@
   "Write a DNS packet according to SPEC.
 If TCP-P, the first two bytes of the package with be the length field."
   (with-temp-buffer
-    (set-buffer-multibyte nil)
+    (unless (featurep 'xemacs) (set-buffer-multibyte nil))
     (dns-write-bytes (dns-get 'id spec) 2)
     (dns-write-bytes
      (logior
@@ -186,7 +186,7 @@
 
 (defun dns-read (packet)
   (with-temp-buffer
-    (set-buffer-multibyte nil)
+    (unless (featurep 'xemacs) (set-buffer-multibyte nil))
     (let ((spec nil)
           queries answers authorities additionals)
       (insert packet)
@@ -263,7 +263,7 @@
 	(point (point)))
     (prog1
         (with-temp-buffer
-          (set-buffer-multibyte nil)
+	  (unless (featurep 'xemacs) (set-buffer-multibyte nil))
           (insert string)
           (goto-char (point-min))
           (cond
@@ -391,7 +391,7 @@
   (if (not dns-servers)
       (message "No DNS server configuration found")
     (with-temp-buffer
-      (set-buffer-multibyte nil)
+      (unless (featurep 'xemacs) (set-buffer-multibyte nil))
       (let ((process (condition-case ()
                          (dns-make-network-process (car dns-servers))
                        (error
--- a/lisp/net/imap.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/net/imap.el	Mon May 10 12:37:03 2010 +0900
@@ -475,10 +475,10 @@
       (setcdr alist (imap-remassoc key (cdr alist)))
       alist)))
 
-(defsubst imap-disable-multibyte ()
+(defmacro imap-disable-multibyte ()
   "Enable multibyte in the current buffer."
-  (when (fboundp 'set-buffer-multibyte)
-    (set-buffer-multibyte nil)))
+  (unless (featurep 'xemacs)
+    '(set-buffer-multibyte nil)))
 
 (defsubst imap-utf7-encode (string)
   (if imap-use-utf7
--- a/lisp/net/tramp-cmds.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/net/tramp-cmds.el	Mon May 10 12:37:03 2010 +0900
@@ -106,8 +106,7 @@
   (setq tramp-locked nil)
 
   ;; Flush password cache.
-  (when (functionp 'password-reset)
-    (funcall (symbol-function 'password-reset)))
+  (tramp-compat-funcall 'password-reset)
 
   ;; Flush file and connection cache.
   (clrhash tramp-cache-data)
@@ -254,7 +253,7 @@
 			      (base64-encode-string val))))))
 
     ;; Dump variable.
-    (funcall (symbol-function 'reporter-dump-variable) varsym mailbuf)
+    (tramp-compat-funcall 'reporter-dump-variable varsym mailbuf)
 
     (unless (hash-table-p val)
       ;; Remove string quotation.
@@ -283,10 +282,8 @@
 	(load "mml" 'noerror))
     (require 'message nil 'noerror)
     (require 'mml nil 'noerror))
-  (when (functionp 'message-mode)
-    (funcall (symbol-function 'message-mode)))
-  (when (functionp 'mml-mode)
-    (funcall (symbol-function 'mml-mode) t)))
+  (tramp-compat-funcall 'message-mode)
+  (tramp-compat-funcall 'mml-mode t))
 
 (defun tramp-append-tramp-buffers ()
   "Append Tramp buffers and buffer local variables into the bug report."
@@ -308,15 +305,14 @@
 	(erase-buffer)
 	(insert "\n(setq\n")
 	(lisp-indent-line)
-	(funcall (symbol-function 'reporter-dump-variable)
-		 'buffer-name (current-buffer))
+	(tramp-compat-funcall
+	 'reporter-dump-variable 'buffer-name (current-buffer))
 	(dolist (varsym-or-cons-cell (buffer-local-variables buffer))
 	  (let ((varsym (or (car-safe varsym-or-cons-cell)
 			    varsym-or-cons-cell)))
 	    (when (string-match "tramp" (symbol-name varsym))
-	      (funcall
-	       (symbol-function 'reporter-dump-variable)
-	       varsym (current-buffer)))))
+	      (tramp-compat-funcall
+	       'reporter-dump-variable varsym (current-buffer)))))
 	(lisp-indent-line)
 	(insert ")\n"))
       (insert-buffer-substring elbuf)))
@@ -328,7 +324,7 @@
 	 (symbol-value 'mml-mode))
 
     (let ((tramp-buf-regexp "\\*\\(debug \\)?tramp/")
-	  (buffer-list (funcall (symbol-function 'tramp-list-tramp-buffers)))
+	  (buffer-list (tramp-compat-funcall 'tramp-list-tramp-buffers))
 	  (curbuf (current-buffer)))
 
       ;; There is at least one Tramp buffer.
@@ -376,10 +372,10 @@
 use another mail agent (by copying the contents of this buffer)
 please ensure that the buffers are attached to your email.\n\n")
 	      (dolist (buffer buffer-list)
-		(funcall (symbol-function 'mml-insert-empty-tag)
-			 'part 'type "text/plain" 'encoding "base64"
-			 'disposition "attachment" 'buffer buffer
-			 'description buffer))
+		(tramp-compat-funcall
+		 'mml-insert-empty-tag 'part 'type "text/plain"
+		 'encoding "base64" 'disposition "attachment" 'buffer buffer
+		 'description buffer))
 	      (set-buffer-modified-p nil))
 
 	  ;; Don't send.  Delete the message buffer.
--- a/lisp/net/tramp-compat.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/net/tramp-compat.el	Mon May 10 12:37:03 2010 +0900
@@ -89,14 +89,25 @@
   (unless (boundp 'byte-compile-not-obsolete-var)
     (defvar byte-compile-not-obsolete-var nil))
   (setq byte-compile-not-obsolete-var 'directory-sep-char)
-  (if (boundp 'byte-compile-not-obsolete-vars) ; Emacs 23.2
-      (setq byte-compile-not-obsolete-vars '(directory-sep-char)))
+  ;; Emacs 23.2.
+  (unless (boundp 'byte-compile-not-obsolete-vars)
+    (defvar byte-compile-not-obsolete-vars nil))
+  (setq byte-compile-not-obsolete-vars '(directory-sep-char))
 
   ;; `with-temp-message' does not exists in XEmacs.
   (condition-case nil
       (with-temp-message (current-message) nil)
     (error (defmacro with-temp-message (message &rest body) `(progn ,@body))))
 
+  ;; For not existing functions, or functions with a changed argument
+  ;; list, there are compiler warnings.  We want to avoid them in
+  ;; cases we know what we do.
+  (defmacro tramp-compat-funcall (function &rest arguments)
+    (if (featurep 'xemacs)
+	`(funcall (symbol-function ,function) ,@arguments)
+      `(when (or (subrp ,function) (functionp ,function))
+	 (with-no-warnings (funcall ,function ,@arguments)))))
+
   ;; `set-buffer-multibyte' comes from Emacs Leim.
   (unless (fboundp 'set-buffer-multibyte)
     (defalias 'set-buffer-multibyte 'ignore))
@@ -182,8 +193,8 @@
 own implementation."
   (cond
    ((fboundp 'line-beginning-position)
-    (funcall (symbol-function 'line-beginning-position)))
-   ((fboundp 'point-at-bol) (funcall (symbol-function 'point-at-bol)))
+    (tramp-compat-funcall 'line-beginning-position))
+   ((fboundp 'point-at-bol) (tramp-compat-funcall 'point-at-bol))
    (t (save-excursion (beginning-of-line) (point)))))
 
 (defsubst tramp-compat-line-end-position ()
@@ -191,8 +202,8 @@
 Calls `line-end-position' or `point-at-eol' if defined, else
 own implementation."
   (cond
-   ((fboundp 'line-end-position) (funcall (symbol-function 'line-end-position)))
-   ((fboundp 'point-at-eol) 	 (funcall (symbol-function 'point-at-eol)))
+   ((fboundp 'line-end-position) (tramp-compat-funcall 'line-end-position))
+   ((fboundp 'point-at-eol) (tramp-compat-funcall 'point-at-eol))
    (t (save-excursion (end-of-line) (point)))))
 
 (defsubst tramp-compat-temporary-file-directory ()
@@ -201,7 +212,7 @@
 this is the function `temp-directory'."
   (cond
    ((boundp 'temporary-file-directory) (symbol-value 'temporary-file-directory))
-   ((fboundp 'temp-directory) (funcall (symbol-function 'temp-directory)))
+   ((fboundp 'temp-directory) (tramp-compat-funcall 'temp-directory))
    ((let ((d (getenv "TEMP"))) (and d (file-directory-p d)))
     (file-name-as-directory (getenv "TEMP")))
    ((let ((d (getenv "TMP"))) (and d (file-directory-p d)))
@@ -227,8 +238,7 @@
 	 result)
     (if (fboundp 'make-temp-file)
 	(setq result
-	      (funcall
-	       (symbol-function 'make-temp-file) prefix dir-flag extension))
+	      (tramp-compat-funcall 'make-temp-file prefix dir-flag extension))
       ;; We use our own implementation, taken from files.el.
       (while
 	  (condition-case ()
@@ -261,19 +271,27 @@
    ((tramp-tramp-file-p filename)
     (tramp-file-name-handler 'file-attributes filename id-format))
    (t (condition-case nil
-	  (funcall (symbol-function 'file-attributes) filename id-format)
-	(error (file-attributes filename))))))
+	  (tramp-compat-funcall 'file-attributes filename id-format)
+	(wrong-number-of-arguments (file-attributes filename))))))
 
 ;; PRESERVE-UID-GID has been introduced with Emacs 23.  It does not
 ;; hurt to ignore it for other (X)Emacs versions.
+;; PRESERVE-SELINUX-CONTEXT has been introduced with Emacs 24.
 (defun tramp-compat-copy-file
-  (filename newname &optional ok-if-already-exists keep-date preserve-uid-gid)
+  (filename newname &optional ok-if-already-exists keep-date
+	    preserve-uid-gid preserve-selinux-context)
   "Like `copy-file' for Tramp files (compat function)."
-  (if preserve-uid-gid
-      (funcall
-       (symbol-function 'copy-file)
-       filename newname ok-if-already-exists keep-date preserve-uid-gid)
-    (copy-file filename newname ok-if-already-exists keep-date)))
+  (cond
+   (preserve-selinux-context
+    (tramp-compat-funcall
+     'copy-file filename newname ok-if-already-exists keep-date
+     preserve-uid-gid preserve-selinux-context))
+   (preserve-uid-gid
+    (tramp-compat-funcall
+     'copy-file filename newname ok-if-already-exists keep-date
+     preserve-uid-gid))
+   (t
+    (copy-file filename newname ok-if-already-exists keep-date))))
 
 ;; `copy-directory' is a new function in Emacs 23.2.  Implementation
 ;; is taken from there.
@@ -281,8 +299,7 @@
   (directory newname &optional keep-time parents)
   "Make a copy of DIRECTORY (compat function)."
   (if (fboundp 'copy-directory)
-      (funcall
-       (symbol-function 'copy-directory) directory newname keep-time parents)
+      (tramp-compat-funcall 'copy-directory directory newname keep-time parents)
 
     ;; If `default-directory' is a remote directory, make sure we find
     ;; its `copy-directory' handler.
@@ -320,13 +337,20 @@
 ;; FORCE has been introduced with Emacs 24.1.
 (defun tramp-compat-delete-file (filename &optional force)
   "Like `delete-file' for Tramp files (compat function)."
-  (condition-case nil
-      (funcall (symbol-function 'delete-file) filename force)
-    ;; This Emacs version does not support the FORCE flag.  Setting
-    ;; `delete-by-moving-to-trash' shall give us the same effect.
-    (error
-     (let ((delete-by-moving-to-trash (null force)))
-       (delete-file filename)))))
+  (if (null force)
+      (delete-file filename)
+    (condition-case nil
+	(tramp-compat-funcall 'delete-file filename force)
+      ;; This Emacs version does not support the FORCE flag.  Setting
+      ;; `delete-by-moving-to-trash' shall give us the same effect.
+      (wrong-number-of-arguments
+       (let ((delete-by-moving-to-trash
+	      (cond
+	       ((null force) t)
+	       ((boundp 'delete-by-moving-to-trash)
+		(symbol-value 'delete-by-moving-to-trash))
+	       (t nil))))
+	 (delete-file filename))))))
 
 ;; RECURSIVE has been introduced with Emacs 23.2.
 (defun tramp-compat-delete-directory (directory &optional recursive)
@@ -334,10 +358,10 @@
   (if (null recursive)
       (delete-directory directory)
     (condition-case nil
-	(funcall (symbol-function 'delete-directory) directory recursive)
+	(tramp-compat-funcall 'delete-directory directory recursive)
       ;; This Emacs version does not support the RECURSIVE flag.  We
       ;; use the implementation from Emacs 23.2.
-      (error
+      (wrong-number-of-arguments
        (setq directory (directory-file-name (expand-file-name directory)))
        (if (not (file-symlink-p directory))
 	   (mapc (lambda (file)
@@ -353,7 +377,7 @@
 (defun tramp-compat-number-sequence (from &optional to inc)
   "Return a sequence of numbers from FROM to TO as a list (compat function)."
   (if (or (subrp 'number-sequence) (symbol-file 'number-sequence))
-      (funcall (symbol-function 'number-sequence) from to inc)
+      (tramp-compat-funcall 'number-sequence from to inc)
     (if (or (not to) (= from to))
 	(list from)
       (or inc (setq inc 1))
@@ -383,15 +407,13 @@
     (cond
      ;; GNU Emacs 22 on w32.
      ((fboundp 'w32-window-exists-p)
-      (funcall (symbol-function 'w32-window-exists-p)
-	       process-name process-name))
+      (tramp-compat-funcall 'w32-window-exists-p process-name process-name))
 
      ;; GNU Emacs 23.
      ((and (fboundp 'list-system-processes) (fboundp 'process-attributes))
       (let (result)
-	(dolist (pid (funcall (symbol-function 'list-system-processes)) result)
-	  (let ((attributes
-		 (funcall (symbol-function 'process-attributes) pid)))
+	(dolist (pid (tramp-compat-funcall 'list-system-processes) result)
+	  (let ((attributes (tramp-compat-funcall 'process-attributes pid)))
 	    (when (and (string-equal
                         (cdr (assoc 'user attributes)) (user-login-name))
                        (let ((comm (cdr (assoc 'comm attributes))))
--- a/lisp/net/tramp-gvfs.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/net/tramp-gvfs.el	Mon May 10 12:37:03 2010 +0900
@@ -525,7 +525,7 @@
 	    newname)
 	  ok-if-already-exists keep-date preserve-uid-gid)))
     (when preserve-selinux-context
-      (setq args (append args (list preserve-uid-gid))))
+      (setq args (append args (list preserve-selinux-context))))
     (apply 'copy-file args)))
 
 (defun tramp-gvfs-handle-delete-directory (directory &optional recursive)
@@ -629,7 +629,8 @@
 
 (defun tramp-gvfs-handle-file-selinux-context (filename)
   "Like `file-selinux-context' for Tramp files."
-  (funcall 'file-selinux-context (tramp-gvfs-fuse-file-name filename)))
+  (tramp-compat-funcall
+   'file-selinux-context (tramp-gvfs-fuse-file-name filename)))
 
 (defun tramp-gvfs-handle-file-writable-p (filename)
   "Like `file-writable-p' for Tramp files."
--- a/lisp/net/tramp-imap.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/net/tramp-imap.el	Mon May 10 12:37:03 2010 +0900
@@ -63,6 +63,7 @@
 (autoload 'epg-context-set-progress-callback "epg")
 (autoload 'epg-decrypt-string "epg")
 (autoload 'epg-encrypt-string "epg")
+(autoload 'epg-make-context "epg")
 (autoload 'imap-hash-get "imap-hash")
 (autoload 'imap-hash-make "imap-hash")
 (autoload 'imap-hash-map "imap-hash")
--- a/lisp/net/tramp.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/net/tramp.el	Mon May 10 12:37:03 2010 +0900
@@ -145,7 +145,7 @@
 	 ;; this would load dbus.el.
 	 (when (and (featurep 'dbusbind)
 		    (condition-case nil
-			(funcall 'dbus-get-unique-name :session)
+			(tramp-compat-funcall 'dbus-get-unique-name :session)
 		      (error nil))
 		    (tramp-compat-process-running-p "gvfs-fuse-daemon"))
 	   'tramp-gvfs)
@@ -2273,14 +2273,14 @@
      ;; introduced in Emacs 24.1.
      (when (<= ,level tramp-verbose)
        (condition-case nil
-	   (setq pr (funcall 'make-progress-reporter ,message)
-		 tm (run-at-time 3 0.1 'progress-reporter-update pr))
+	   (setq pr (tramp-compat-funcall 'make-progress-reporter ,message)
+		 tm (if pr (run-at-time 3 0.1 'progress-reporter-update pr)))
 	 (error nil)))
      (unwind-protect
 	 ;; Execute the body.
 	 (progn ,@body)
        ;; Stop progress reporter.
-       (if tm (cancel-timer tm))
+       (if tm (tramp-compat-funcall 'cancel-timer tm))
        (tramp-message ,vec ,level "%s...done" ,message))))
 
 (put 'with-progress-reporter 'lisp-indent-function 3)
@@ -2397,15 +2397,16 @@
 special handling of `substitute-in-file-name'."
   (when (symbol-value 'minibuffer-completing-file-name)
     (setq tramp-rfn-eshadow-overlay
-	  (funcall (symbol-function 'make-overlay)
-		   (funcall (symbol-function 'minibuffer-prompt-end))
-		   (funcall (symbol-function 'minibuffer-prompt-end))))
+	  (tramp-compat-funcall
+	   'make-overlay
+	   (tramp-compat-funcall 'minibuffer-prompt-end)
+	   (tramp-compat-funcall 'minibuffer-prompt-end)))
     ;; Copy rfn-eshadow-overlay properties.
-    (let ((props (funcall (symbol-function 'overlay-properties)
-			  (symbol-value 'rfn-eshadow-overlay))))
+    (let ((props (tramp-compat-funcall
+		  'overlay-properties (symbol-value 'rfn-eshadow-overlay))))
       (while props
-	(funcall (symbol-function 'overlay-put)
-		 tramp-rfn-eshadow-overlay (pop props) (pop props))))))
+	(tramp-compat-funcall
+	 'overlay-put tramp-rfn-eshadow-overlay (pop props) (pop props))))))
 
 (when (boundp 'rfn-eshadow-setup-minibuffer-hook)
   (add-hook 'rfn-eshadow-setup-minibuffer-hook
@@ -2424,10 +2425,12 @@
 `file-name-shadow-mode'; the minibuffer should have already
 been set up by `rfn-eshadow-setup-minibuffer'."
   ;; In remote files name, there is a shadowing just for the local part.
-  (let ((end (or (funcall (symbol-function 'overlay-end)
-			  (symbol-value 'rfn-eshadow-overlay))
-		 (funcall (symbol-function 'minibuffer-prompt-end)))))
-    (when (file-remote-p (buffer-substring-no-properties end (point-max)))
+  (let ((end (or (tramp-compat-funcall
+		  'overlay-end (symbol-value 'rfn-eshadow-overlay))
+		 (tramp-compat-funcall 'minibuffer-prompt-end))))
+    (when
+	(file-remote-p
+	 (tramp-compat-funcall 'buffer-substring-no-properties end (point-max)))
       (save-excursion
 	(save-restriction
 	  (narrow-to-region
@@ -2437,8 +2440,9 @@
 	   (point-max))
 	  (let ((rfn-eshadow-overlay tramp-rfn-eshadow-overlay)
 		(rfn-eshadow-update-overlay-hook nil))
-	    (move-overlay rfn-eshadow-overlay (point-max) (point-max))
-	    (funcall (symbol-function 'rfn-eshadow-update-overlay))))))))
+	    (tramp-compat-funcall
+	     'move-overlay rfn-eshadow-overlay (point-max) (point-max))
+	    (tramp-compat-funcall 'rfn-eshadow-update-overlay)))))))
 
 (when (boundp 'rfn-eshadow-update-overlay-hook)
   (add-hook 'rfn-eshadow-update-overlay-hook
@@ -2988,9 +2992,8 @@
 		;; local host.
 		(and (functionp 'subr-arity)
 		     (subrp (symbol-function 'format-time-string))
-		     (= 3 (cdr (funcall (symbol-function 'subr-arity)
-					(symbol-function
-					 'format-time-string)))))))
+		     (= 3 (cdr (tramp-compat-funcall
+				'subr-arity 'format-time-string))))))
 	   (tramp-send-command-and-check
 	    v (format "%s touch -t %s %s"
 		      (if utc "TZ=UTC; export TZ;" "")
@@ -4156,8 +4159,8 @@
 			(tramp-send-command-and-check
 			 v (concat (nth 2 suffix) " "
 				   (tramp-shell-quote-argument localname))))
-		   ;; `dired-remove-file' is not defined in XEmacs
-		   (funcall (symbol-function 'dired-remove-file) file)
+		   ;; `dired-remove-file' is not defined in XEmacs.
+		   (tramp-compat-funcall 'dired-remove-file file)
 		   (string-match (car suffix) file)
 		   (concat (substring file 0 (match-beginning 0))))))
 	      (t
@@ -4168,8 +4171,8 @@
 			(tramp-send-command-and-check
 			 v (concat "gzip -f "
 				   (tramp-shell-quote-argument localname))))
-		   ;; `dired-remove-file' is not defined in XEmacs
-		   (funcall (symbol-function 'dired-remove-file) file)
+		   ;; `dired-remove-file' is not defined in XEmacs.
+		   (tramp-compat-funcall 'dired-remove-file file)
 		   (cond ((file-exists-p (concat file ".gz"))
 			  (concat file ".gz"))
 			 ((file-exists-p (concat file ".z"))
@@ -4713,8 +4716,7 @@
 	  ;; There's some output, display it.
 	  (when (with-current-buffer output-buffer (> (point-max) (point-min)))
 	    (if (functionp 'display-message-or-buffer)
-		(funcall (symbol-function 'display-message-or-buffer)
-			 output-buffer)
+		(tramp-compat-funcall 'display-message-or-buffer output-buffer)
 	      (pop-to-buffer output-buffer))))))))
 
 ;; File Editing.
@@ -5637,7 +5639,8 @@
              (featurep 'tramp) ;; If it's loaded, we may as well use it.
 	     ;; `partial-completion-mode' does not exist in XEmacs.
 	     ;; It is obsoleted with Emacs 24.1.
-             (and (boundp 'partial-completion-mode) partial-completion-mode)
+             (and (boundp 'partial-completion-mode)
+		  (symbol-value 'partial-completion-mode))
              ;; FIXME: These may have been loaded even if the user never
              ;; intended to use them.
              (featurep 'ido)
@@ -5729,19 +5732,18 @@
 	;; `last-input-event' might be nil.
 	(not (null last-input-event))
 	;; `last-input-event' may have no character approximation.
-	(funcall (symbol-function 'event-to-character) last-input-event)
+	(tramp-compat-funcall 'event-to-character last-input-event)
 	(or
 	 ;; ?\t has event-modifier 'control.
 	 (equal
-	  (funcall (symbol-function 'event-to-character)
-		   last-input-event) ?\t)
+	  (tramp-compat-funcall 'event-to-character last-input-event) ?\t)
 	 (and (not (event-modifiers last-input-event))
 	      (or (equal
-		   (funcall (symbol-function 'event-to-character)
-			    last-input-event) ?\?)
+		   (tramp-compat-funcall 'event-to-character last-input-event)
+		   ?\?)
 		  (equal
-		   (funcall (symbol-function 'event-to-character)
-			    last-input-event) ?\ )))))))
+		   (tramp-compat-funcall 'event-to-character last-input-event)
+		   ?\ )))))))
 
 (defun tramp-connectable-p (filename)
   "Check, whether it is possible to connect the remote host w/o side-effects.
@@ -6776,10 +6778,11 @@
     (when (or (not (tramp-get-connection-property proc "check-remote-echo" nil))
 	      ;; Sometimes, the echo string is suppressed on the remote side.
 	      (not (string-equal
-		    (substring-no-properties
-		     tramp-echo-mark-marker
+		    (tramp-compat-funcall
+		     'substring-no-properties tramp-echo-mark-marker
 		     0 (min tramp-echo-mark-marker-length (1- (point-max))))
-		    (buffer-substring-no-properties
+		    (tramp-compat-funcall
+		     'buffer-substring-no-properties
 		     1 (min (1+ tramp-echo-mark-marker-length) (point-max))))))
       ;; No echo to be handled, now we can look for the regexp.
       (goto-char (point-min))
@@ -6906,7 +6909,7 @@
     (if (featurep 'mule)
 	;; Use MULE to select the right EOL convention for communicating
 	;; with the process.
-	(let* ((cs (or (funcall (symbol-function 'process-coding-system) proc)
+	(let* ((cs (or (tramp-compat-funcall 'process-coding-system proc)
 		       (cons 'undecided 'undecided)))
 	       cs-decode cs-encode)
 	  (when (symbolp cs) (setq cs (cons cs cs)))
@@ -6919,8 +6922,8 @@
 	  (when (search-forward "\r" nil t)
 	    (setq cs-decode (tramp-coding-system-change-eol-conversion
 			     cs-decode 'dos)))
-	  (funcall (symbol-function 'set-buffer-process-coding-system)
-		   cs-decode cs-encode)
+	  (tramp-compat-funcall
+	   'set-buffer-process-coding-system cs-decode cs-encode)
 	  (tramp-message
 	   vec 5 "Setting coding system to `%s' and `%s'" cs-decode cs-encode))
       ;; Look for ^M and do something useful if found.
@@ -6949,7 +6952,7 @@
 	;; Keep the debug buffer.
 	(rename-buffer
 	 (generate-new-buffer-name tramp-temp-buffer-name) 'unique)
-	(funcall (symbol-function 'tramp-cleanup-connection) vec)
+	(tramp-compat-funcall 'tramp-cleanup-connection vec)
 	(if (= (point-min) (point-max))
 	    (kill-buffer nil)
 	  (rename-buffer (tramp-debug-buffer-name vec) 'unique))
@@ -7332,7 +7335,7 @@
 	 'target-alist
 	 (vector
 	  (tramp-file-name-method hop) (tramp-file-name-user hop)
-	  (funcall (symbol-function 'tramp-gw-open-connection) vec gw hop) nil))
+	  (tramp-compat-funcall 'tramp-gw-open-connection vec gw hop) nil))
 	;; For the password prompt, we need the correct values.
 	;; Therefore, we must remember the gateway vector.  But we
 	;; cannot do it as connection property, because it shouldn't
@@ -8611,16 +8614,17 @@
 	   (and (boundp 'auth-sources)
 		(tramp-get-connection-property v "first-password-request" nil)
 		;; Try with Tramp's current method.
-		(funcall (symbol-function 'auth-source-user-or-password)
-			 "password" tramp-current-host tramp-current-method))
+		(tramp-compat-funcall
+		 'auth-source-user-or-password
+		 "password" tramp-current-host tramp-current-method))
 	   ;; Try the password cache.
 	   (when (functionp 'password-read)
 	     (unless (tramp-get-connection-property
 		      v "first-password-request" nil)
-	       (funcall (symbol-function 'password-cache-remove) key))
+	       (tramp-compat-funcall 'password-cache-remove key))
 	     (let ((password
-		    (funcall (symbol-function 'password-read) pw-prompt key)))
-	       (funcall (symbol-function 'password-cache-add) key password)
+		    (tramp-compat-funcall 'password-read pw-prompt key)))
+	       (tramp-compat-funcall 'password-cache-add key password)
 	       password))
 	   ;; Else, get the password interactively.
 	   (read-passwd pw-prompt))
@@ -8628,14 +8632,13 @@
 
 (defun tramp-clear-passwd (vec)
   "Clear password cache for connection related to VEC."
-  (when (functionp 'password-cache-remove)
-    (funcall
-     (symbol-function 'password-cache-remove)
-     (tramp-make-tramp-file-name
-      (tramp-file-name-method vec)
-      (tramp-file-name-user vec)
-      (tramp-file-name-host vec)
-      ""))))
+  (tramp-compat-funcall
+   'password-cache-remove
+   (tramp-make-tramp-file-name
+    (tramp-file-name-method vec)
+    (tramp-file-name-user vec)
+    (tramp-file-name-host vec)
+    "")))
 
 ;; Snarfed code from time-date.el and parse-time.el
 
@@ -8672,16 +8675,17 @@
   ;; Pacify byte-compiler with `symbol-function'.
   (cond ((and (fboundp 'subtract-time)
 	      (fboundp 'float-time))
-         (funcall (symbol-function 'float-time)
-		  (funcall (symbol-function 'subtract-time) t1 t2)))
+         (tramp-compat-funcall
+	  'float-time (tramp-compat-funcall 'subtract-time t1 t2)))
 	((and (fboundp 'subtract-time)
 	      (fboundp 'time-to-seconds))
-         (funcall (symbol-function 'time-to-seconds)
-		  (funcall (symbol-function 'subtract-time) t1 t2)))
+         (tramp-compat-funcall
+	  'time-to-seconds (tramp-compat-funcall 'subtract-time t1 t2)))
         ((fboundp 'itimer-time-difference)
-	 (funcall (symbol-function 'itimer-time-difference)
-		  (if (< (length t1) 3) (append t1 '(0)) t1)
-		  (if (< (length t2) 3) (append t2 '(0)) t2)))
+	 (tramp-compat-funcall
+	  'itimer-time-difference
+	  (if (< (length t1) 3) (append t1 '(0)) t1)
+	  (if (< (length t2) 3) (append t2 '(0)) t2)))
         (t
 	 (let ((time (tramp-time-subtract t1 t2)))
 	   (+ (* (car time) 65536.0)
@@ -8692,18 +8696,18 @@
   "Return a coding system like CODING-SYSTEM but with given EOL-TYPE.
 EOL-TYPE can be one of `dos', `unix', or `mac'."
   (cond ((fboundp 'coding-system-change-eol-conversion)
-         (funcall (symbol-function 'coding-system-change-eol-conversion)
-		  coding-system eol-type))
+         (tramp-compat-funcall
+	  'coding-system-change-eol-conversion coding-system eol-type))
         ((fboundp 'subsidiary-coding-system)
-         (funcall (symbol-function 'subsidiary-coding-system)
-		  coding-system
-		  (cond ((eq eol-type 'dos) 'crlf)
-			((eq eol-type 'unix) 'lf)
-			((eq eol-type 'mac) 'cr)
-			(t
-			 (error "Unknown EOL-TYPE `%s', must be %s"
-				eol-type
-				"`dos', `unix', or `mac'")))))
+         (tramp-compat-funcall
+	  'subsidiary-coding-system coding-system
+	  (cond ((eq eol-type 'dos) 'crlf)
+		((eq eol-type 'unix) 'lf)
+		((eq eol-type 'mac) 'cr)
+		(t
+		 (error "Unknown EOL-TYPE `%s', must be %s"
+			eol-type
+			"`dos', `unix', or `mac'")))))
         (t (error "Can't change EOL conversion -- is MULE missing?"))))
 
 (defun tramp-set-process-query-on-exit-flag (process flag)
@@ -8711,8 +8715,8 @@
 If the second argument flag is non-nil, Emacs will query the user before
 exiting if process is running."
   (if (fboundp 'set-process-query-on-exit-flag)
-      (funcall (symbol-function 'set-process-query-on-exit-flag) process flag)
-    (funcall (symbol-function 'process-kill-without-query) process flag)))
+      (tramp-compat-funcall 'set-process-query-on-exit-flag process flag)
+    (tramp-compat-funcall 'process-kill-without-query) process flag))
 
 
 ;; ------------------------------------------------------------
@@ -8772,8 +8776,7 @@
   ;; When Tramp is not loaded yet, its autoloads are still active.
   (tramp-unload-file-name-handlers)
   ;; ange-ftp settings must be enabled.
-  (when (functionp 'tramp-ftp-enable-ange-ftp)
-    (funcall (symbol-function 'tramp-ftp-enable-ange-ftp)))
+  (tramp-compat-funcall 'tramp-ftp-enable-ange-ftp)
   ;; Maybe its not loaded yet.
   (condition-case nil
       (unload-feature 'tramp 'force)
--- a/lisp/org/ChangeLog	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/org/ChangeLog	Mon May 10 12:37:03 2010 +0900
@@ -1,3 +1,7 @@
+2010-05-07  Chong Yidong  <cyd@stupidchicken.com>
+
+	* Version 23.2 released.
+
 2010-05-05  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* org-table.el (orgtbl-setup):
@@ -40,8 +44,7 @@
 	* org-latex.el (org-export-latex-classes): Update docstring.
 
 	* org.el (org-format-latex-header): Add cookies to the header.
-	(org-splice-latex-header): Implement placement according to
-	cookies.
+	(org-splice-latex-header): Implement placement according to cookies.
 
 2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>
 
@@ -54,8 +57,8 @@
 
 2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>
 
-	* org-latex.el (org-export-latex-make-header): Use
-	`org-splice-latex-header' to build the header.
+	* org-latex.el (org-export-latex-make-header):
+	Use `org-splice-latex-header' to build the header.
 	(org-export-latex-classes): Update docstring.
 
 	* org.el (org-splice-latex-header): New function.
--- a/lisp/pgg-parse.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/pgg-parse.el	Mon May 10 12:37:03 2010 +0900
@@ -503,8 +503,8 @@
 (defun pgg-parse-armor (string)
   (with-temp-buffer
     (buffer-disable-undo)
-    (if (fboundp 'set-buffer-multibyte)
-	(set-buffer-multibyte nil))
+    (unless (featurep 'xemacs)
+      (set-buffer-multibyte nil))
     (insert string)
     (pgg-decode-armor-region (point-min)(point))))
 
--- a/lisp/pgg.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/pgg.el	Mon May 10 12:37:03 2010 +0900
@@ -475,8 +475,8 @@
 	  (if (null signature) nil
 	    (with-temp-buffer
 	      (buffer-disable-undo)
-	      (if (fboundp 'set-buffer-multibyte)
-		  (set-buffer-multibyte nil))
+	      (unless (featurep 'xemacs)
+		(set-buffer-multibyte nil))
 	      (insert-file-contents signature)
 	      (cdr (assq 2 (pgg-decode-armor-region
 			    (point-min)(point-max)))))))
--- a/lisp/progmodes/compile.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/progmodes/compile.el	Mon May 10 12:37:03 2010 +0900
@@ -748,9 +748,9 @@
   "If non-nil, automatically jump to the next error encountered.")
 (make-variable-buffer-local 'compilation-auto-jump-to-next)
 
-(defvar buffer-modtime nil
+(defvar compilation-buffer-modtime nil
   "The buffer modification time, for buffers not associated with files.")
-(make-variable-buffer-local 'buffer-modtime)
+(make-variable-buffer-local 'compilation-buffer-modtime)
 
 (defvar compilation-skip-to-next-location t
   "*If non-nil, skip multiple error messages for the same source location.")
@@ -1588,7 +1588,7 @@
 	mode-name (or name-of-mode "Compilation"))
   (set (make-local-variable 'page-delimiter)
        compilation-page-delimiter)
-  (set (make-local-variable 'buffer-modtime) nil)
+  (set (make-local-variable 'compilation-buffer-modtime) nil)
   (compilation-setup)
   (setq buffer-read-only t)
   (run-mode-hooks 'compilation-mode-hook))
@@ -1804,7 +1804,7 @@
               (unless comint-inhibit-carriage-motion
                 (comint-carriage-motion (process-mark proc) (point)))
               (set-marker (process-mark proc) (point))
-              (set (make-local-variable 'buffer-modtime) (current-time))
+              (set (make-local-variable 'compilation-buffer-modtime) (current-time))
               (run-hooks 'compilation-filter-hook))
 	  (goto-char pos)
           (narrow-to-region min max)
@@ -1978,7 +1978,7 @@
                  ;; There may be no timestamp info if the loc is a `fake-loc',
                  ;; but we just checked that the file has been visited before!
                  (equal (nth 4 loc)
-                        (setq timestamp buffer-modtime)))
+                        (setq timestamp compilation-buffer-modtime)))
       (with-current-buffer (compilation-find-file marker (caar (nth 2 loc))
 						  (cadr (car (nth 2 loc))))
 	(save-restriction
--- a/lisp/progmodes/cperl-mode.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/progmodes/cperl-mode.el	Mon May 10 12:37:03 2010 +0900
@@ -8980,6 +8980,18 @@
     (substring v (match-beginning 1) (match-end 1)))
   "Version of IZ-supported CPerl package this file is based on.")
 
+(defun cperl-mode-unload-function ()
+  "Unload the Cperl mode library."
+  (let ((new-mode (if (eq (symbol-function 'perl-mode) 'cperl-mode)
+		      'fundamental-mode
+		    'perl-mode)))
+    (dolist (buf (buffer-list))
+      (with-current-buffer buf
+	(when (eq major-mode 'cperl-mode)
+	  (funcall new-mode)))))
+  ;; continue standard unloading
+  nil)
+
 (provide 'cperl-mode)
 
 ;; arch-tag: 42e5b19b-e187-4537-929f-1a7408980ce6
--- a/lisp/progmodes/js.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/progmodes/js.el	Mon May 10 12:37:03 2010 +0900
@@ -3327,6 +3327,13 @@
         comment-start-skip "\\(//+\\|/\\*+\\)\\s *")
 
   (let ((c-buffer-is-cc-mode t))
+    ;; FIXME: These are normally set by `c-basic-common-init'.  Should
+    ;; we call it instead?  (Bug#6071)
+    (make-local-variable 'paragraph-start)
+    (make-local-variable 'paragraph-separate)
+    (make-local-variable 'paragraph-ignore-fill-prefix)
+    (make-local-variable 'adaptive-fill-mode)
+    (make-local-variable 'adaptive-fill-regexp)
     (c-setup-paragraph-variables))
 
   (set (make-local-variable 'syntax-begin-function)
--- a/lisp/progmodes/sql.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/progmodes/sql.el	Mon May 10 12:37:03 2010 +0900
@@ -5,7 +5,7 @@
 
 ;; Author: Alex Schroeder <alex@gnu.org>
 ;; Maintainer: Michael Mauger <mmaug@yahoo.com>
-;; Version: 2.0.2
+;; Version: 2.1
 ;; Keywords: comm languages processes
 ;; URL: http://savannah.gnu.org/cgi-bin/viewcvs/emacs/emacs/lisp/progmodes/sql.el
 ;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?SqlMode
@@ -103,83 +103,79 @@
 ;; identifiers; ms (Microsoft SQLServer) also supports identifiers
 ;; enclosed within brackets [].
 
-;; ChangeLog available on request.
-
 ;;; Product Support:
 
 ;; To add support for additional SQL products the following steps
 ;; must be followed ("xyz" is the name of the product in the examples
 ;; below):
 
-;; 1) Add the product to `sql-product' choice list.
-
-;;     (const :tag "XyzDB" xyz)
-
-;; 2) Add an entry to the `sql-product-alist' list.
-
-;;     (xyz
-;;      :font-lock sql-mode-xyz-font-lock-keywords
-;;      :sqli-login (user password server database)
-;;      :sqli-connect sql-connect-xyz
-;;      :sqli-prompt-regexp "^xyzdb> "
-;;      :sqli-prompt-length 7
-;;      :sqli-input-sender nil
-;;      :syntax-alist ((?# . "w")))
-
-;; 3) Add customizable values for the product interpreter and options.
-
-;;     ;; Customization for XyzDB
-;;
-;;     (defcustom sql-xyz-program "ixyz"
-;;       "*Command to start ixyz by XyzDB."
+;; 1) Add the product to the list of known products.
+
+;;     (sql-add-product 'xyz "XyzDB"
+;;     	                '(:free-software t))
+
+;; 2) Define font lock settings.  All ANSI keywords will be
+;;    highlighted automatically, so only product specific keywords
+;;    need to be defined here.
+
+;;     (defvar my-sql-mode-xyz-font-lock-keywords
+;;       '(("\\b\\(red\\|orange\\|yellow\\)\\b"
+;;          . font-lock-keyword-face))
+;;       "XyzDB SQL keywords used by font-lock.")
+
+;;     (sql-set-product-feature 'xyz
+;;                              :font-lock
+;;                              'my-sql-mode-xyz-font-lock-keywords)
+
+;; 3) Define any special syntax characters including comments and
+;;    identifier characters.
+
+;;     (sql-set-product-feature 'xyz
+;;                              :syntax-alist ((?# . "w")))
+
+;; 4) Define the interactive command interpreter for the database
+;;    product.
+
+;;     (defcustom my-sql-xyz-program "ixyz"
+;;       "Command to start ixyz by XyzDB."
 ;;       :type 'file
 ;;       :group 'SQL)
 ;;
-;;     (defcustom sql-xyz-options '("-X" "-Y" "-Z")
-;;       "*List of additional options for `sql-xyz-program'."
+;;     (sql-set-product-feature 'xyz
+;;                              :sqli-program 'my-sql-xyz-program)
+;;     (sql-set-product-feature 'xyz
+;;                              :prompt-regexp "^xyzdb> ")
+;;     (sql-set-product-feature 'xyz
+;;                              :prompt-length 7)
+
+;; 5) Define login parameters and command line formatting.
+
+;;     (defcustom my-sql-xyz-login-params '(user password server database)
+;;       "Login parameters to needed to connect to XyzDB."
+;;       :type '(repeat (choice
+;;                        (const user)
+;;                        (const password)
+;;                        (const server)
+;;                        (const database)))
+;;       :group 'SQL)
+;;
+;;     (sql-set-product-feature 'xyz
+;;                              :sqli-login 'my-sql-xyz-login-params)
+
+;;     (defcustom my-sql-xyz-options '("-X" "-Y" "-Z")
+;;       "List of additional options for `sql-xyz-program'."
 ;;       :type '(repeat string)
 ;;       :group 'SQL)
-
-;; 4) Add an entry to SQL->Product submenu.
-
-;;     ["XyzDB" sql-highlight-xyz-keywords
-;;      :style radio
-;;      :selected (eq sql-product 'xyz)]
-
-;; 5) Add the font-lock specifications.  At a minimum, default to
-;;    using ANSI keywords.  See sql-mode-oracle-font-lock-keywords for
-;;    a more complex example.
-
-;;     (defvar sql-mode-xyz-font-lock-keywords nil
-;;       "XyzDB SQL keywords used by font-lock.")
-
-;; 6) Add a product highlighting function.
-
-;;     (defun sql-highlight-xyz-keywords ()
-;;       "Highlight XyzDB keywords."
-;;       (interactive)
-;;       (sql-set-product 'xyz))
-
-;; 7) Add an autoloaded SQLi function.
-
-;;     ;;;###autoload
-;;     (defun sql-xyz ()
-;;       "Run ixyz by XyzDB as an inferior process."
-;;       (interactive)
-;;       (sql-product-interactive 'xyz))
-
-;; 8) Add a connect function which formats the command line arguments
-;;    and starts the product interpreter in a comint buffer.  See the
-;;    existing connect functions for examples of the types of
-;;    processing available.
-
-;;     (defun sql-connect-xyz ()
-;;       "Create comint buffer and connect to XyzDB using the login
-;;     parameters and command options."
+;;
+;;     (sql-set-product-feature 'xyz
+;;                              :sqli-options 'my-sql-xyz-options))
+
+;;     (defun my-sql-connect-xyz (product options)
+;;       "Connect ti XyzDB in a comint buffer."
 ;;
 ;;         ;; Do something with `sql-user', `sql-password',
 ;;         ;; `sql-database', and `sql-server'.
-;;         (let ((params sql-xyz-options))
+;;         (let ((params options))
 ;;           (if (not (string= "" sql-server))
 ;;              (setq params (append (list "-S" sql-server) params)))
 ;;           (if (not (string= "" sql-database))
@@ -188,25 +184,36 @@
 ;;               (setq params (append (list "-P" sql-password) params)))
 ;;           (if (not (string= "" sql-user))
 ;;               (setq params (append (list "-U" sql-user) params)))
-;;           (set-buffer (apply 'make-comint "SQL" sql-xyz-program
-;;                              nil params))))
-
-;; 9) Save and compile sql.el.
+;;           (sql-connect product params)))
+;;
+;;     (sql-set-product-feature 'xyz
+;;                              :sqli-connect-func 'my-sql-connect-xyz)
+
+;; 6) Define a convienence function to invoke the SQL interpreter.
+
+;;     (defun my-sql-xyz ()
+;;       "Run ixyz by XyzDB as an inferior process."
+;;       (interactive)
+;;       (sql-product-interactive 'xyz))
 
 ;;; To Do:
 
-;; Add better hilight support for other brands; there is a bias towards
-;; Oracle because that's what I use at work.  Anybody else just send in
-;; your lists of reserved words, keywords and builtin functions!  As
-;; long as I don't receive any feedback, everything is hilighted with
-;; ANSI keywords only.  I received the list of ANSI keywords from a
-;; user; if you know of any changes, let me know.
-
-;; Add different hilighting levels.
+;; Improve keyword highlighting for individual products.  I have tried
+;; to update those database that I use.  Feel free to send me updates,
+;; or direct me to the reference manuals for your favorite database.
+
+;; When there are no keywords defined, the ANSI keywords are
+;; highlighted.  ANSI keywords are highlighted even if the keyword is
+;; not used for your current product.  This should help identify
+;; portability concerns.
+
+;; Add different highlighting levels.
+
+;; Add support for listing available tables or the columns in a table.
 
 ;;; Thanks to all the people who helped me out:
 
-;; Alex Schroeder <alex@gnu.org>
+;; Alex Schroeder <alex@gnu.org> -- the original author
 ;; Kai Blauberg <kai.blauberg@metla.fi>
 ;; <ibalaban@dalet.com>
 ;; Yair Friedman <yfriedma@JohnBryce.Co.Il>
@@ -217,7 +224,7 @@
 ;; Michael Mauger <mmaug@yahoo.com> -- improved product support
 ;; Drew Adams <drew.adams@oracle.com> -- Emacs 20 support
 ;; Harald Maier <maierh@myself.com> -- sql-send-string
-;; Stefan Monnier <monnier@iro.umontreal.ca> -- font-lock corrections
+;; Stefan Monnier <monnier@iro.umontreal.ca> -- font-lock corrections; code polish
 
 
 
@@ -240,32 +247,43 @@
 (defgroup SQL nil
   "Running a SQL interpreter from within Emacs buffers."
   :version "20.4"
+  :group 'languages
   :group 'processes)
 
 ;; These four variables will be used as defaults, if set.
 
 (defcustom sql-user ""
-  "*Default username."
+  "Default username."
   :type 'string
   :group 'SQL)
+(put 'sql-user 'safe-local-variable 'stringp)
 
 (defcustom sql-password ""
-  "*Default password.
+  "Default password.
 
 Storing your password in a textfile such as ~/.emacs could be dangerous.
 Customizing your password will store it in your ~/.emacs file."
   :type 'string
   :group 'SQL)
+(put 'sql-password 'risky-local-variable t)
 
 (defcustom sql-database ""
-  "*Default database."
+  "Default database."
   :type 'string
   :group 'SQL)
+(put 'sql-database 'safe-local-variable 'stringp)
 
 (defcustom sql-server ""
-  "*Default server or host."
+  "Default server or host."
   :type 'string
   :group 'SQL)
+(put 'sql-server 'safe-local-variable 'stringp)
+
+(defcustom sql-port nil
+  "Default server or host."
+  :type 'number
+  :group 'SQL)
+(put 'sql-port 'safe-local-variable 'numberp)
 
 ;; SQL Product support
 
@@ -276,108 +294,176 @@
   '((ansi
      :name "ANSI"
      :font-lock sql-mode-ansi-font-lock-keywords)
+
     (db2
      :name "DB2"
      :font-lock sql-mode-db2-font-lock-keywords
-     :sqli-login nil
-     :sqli-connect sql-connect-db2
-     :sqli-prompt-regexp "^db2 => "
-     :sqli-prompt-length 7)
+     :sqli-program sql-db2-program
+     :sqli-options sql-db2-options
+     :sqli-login sql-db2-login-params
+     :sqli-connect-func sql-connect-db2
+     :prompt-regexp "^db2 => "
+     :prompt-length 7
+     :input-filter sql-escape-newlines-filter)
+
     (informix
+     :name "Informix"
      :font-lock sql-mode-informix-font-lock-keywords
-     :sqli-login (database)
-     :sqli-connect sql-connect-informix
-     :sqli-prompt-regexp "^SQL> "
-     :sqli-prompt-length 5)
+     :sqli-program sql-informix-program
+     :sqli-options sql-informix-options
+     :sqli-login sql-informix-login-params
+     :sqli-connect-func sql-connect-informix
+     :prompt-regexp "^> "
+     :prompt-length 2
+     :syntax-alist ((?{ . "<") (?} . ">")))
+
     (ingres
+     :name "Ingres"
      :font-lock sql-mode-ingres-font-lock-keywords
-     :sqli-login (database)
-     :sqli-connect sql-connect-ingres
-     :sqli-prompt-regexp "^\* "
-     :sqli-prompt-length 2)
+     :sqli-program sql-ingres-program
+     :sqli-options sql-ingres-options
+     :sqli-login sql-ingres-login-params
+     :sqli-connect-func sql-connect-ingres
+     :prompt-regexp "^\* "
+     :prompt-length 2)
+
     (interbase
+     :name "Interbase"
      :font-lock sql-mode-interbase-font-lock-keywords
-     :sqli-login (user password database)
-     :sqli-connect sql-connect-interbase
-     :sqli-prompt-regexp "^SQL> "
-     :sqli-prompt-length 5)
+     :sqli-program sql-interbase-program
+     :sqli-options sql-interbase-options
+     :sqli-login sql-interbase-login-params
+     :sqli-connect-func sql-connect-interbase
+     :prompt-regexp "^SQL> "
+     :prompt-length 5)
+
     (linter
+     :name "Linter"
      :font-lock sql-mode-linter-font-lock-keywords
-     :sqli-login (user password database server)
-     :sqli-connect sql-connect-linter
-     :sqli-prompt-regexp "^SQL>"
-     :sqli-prompt-length 4)
+     :sqli-program sql-linter-program
+     :sqli-options sql-linter-options
+     :sqli-login sql-linter-login-params
+     :sqli-connect-func sql-connect-linter
+     :prompt-regexp "^SQL>"
+     :prompt-length 4)
+
     (ms
-     :name "MS SQLServer"
+     :name "Microsoft"
      :font-lock sql-mode-ms-font-lock-keywords
-     :sqli-login (user password server database)
-     :sqli-connect sql-connect-ms
-     :sqli-prompt-regexp "^[0-9]*>"
-     :sqli-prompt-length 5
-     :syntax-alist ((?@ . "w")))
+     :sqli-program sql-ms-program
+     :sqli-options sql-ms-options
+     :sqli-login sql-ms-login-params
+     :sqli-connect-func sql-connect-ms
+     :prompt-regexp "^[0-9]*>"
+     :prompt-length 5
+     :syntax-alist ((?@ . "w"))
+     :terminator ("^go" . "go"))
+
     (mysql
      :name "MySQL"
+     :free-software t
      :font-lock sql-mode-mysql-font-lock-keywords
-     :sqli-login (user password database server)
-     :sqli-connect sql-connect-mysql
-     :sqli-prompt-regexp "^mysql> "
-     :sqli-prompt-length 6)
+     :sqli-program sql-mysql-program
+     :sqli-options sql-mysql-options
+     :sqli-login sql-mysql-login-params
+     :sqli-connect-func sql-connect-mysql
+     :prompt-regexp "^mysql> "
+     :prompt-length 6
+     :input-filter sql-remove-tabs-filter)
+
     (oracle
+     :name "Oracle"
      :font-lock sql-mode-oracle-font-lock-keywords
-     :sqli-login (user password database)
-     :sqli-connect sql-connect-oracle
-     :sqli-prompt-regexp "^SQL> "
-     :sqli-prompt-length 5
-     :syntax-alist ((?$ . "w") (?# . "w")))
+     :sqli-program sql-oracle-program
+     :sqli-options sql-oracle-options
+     :sqli-login sql-oracle-login-params
+     :sqli-connect-func sql-connect-oracle
+     :prompt-regexp "^SQL> "
+     :prompt-length 5
+     :syntax-alist ((?$ . "w") (?# . "w"))
+     :terminator ("\\(^/\\|;\\)" . "/")
+     :input-filter sql-placeholders-filter)
+
     (postgres
+     :name "Postgres"
+     :free-software t
      :font-lock sql-mode-postgres-font-lock-keywords
-     :sqli-login (user database server)
-     :sqli-connect sql-connect-postgres
-     :sqli-prompt-regexp "^.*[#>] *"
-     :sqli-prompt-length 5)
+     :sqli-program sql-postgres-program
+     :sqli-options sql-postgres-options
+     :sqli-login sql-postgres-login-params
+     :sqli-connect-func sql-connect-postgres
+     :prompt-regexp "^.*[#>] *"
+     :prompt-length 5
+     :input-filter sql-remove-tabs-filter
+     :terminator ("\\(^[\\]g\\|;\\)" . ";"))
+
     (solid
+     :name "Solid"
      :font-lock sql-mode-solid-font-lock-keywords
-     :sqli-login (user password server)
-     :sqli-connect sql-connect-solid
-     :sqli-prompt-regexp "^"
-     :sqli-prompt-length 0)
+     :sqli-program sql-solid-program
+     :sqli-options sql-solid-options
+     :sqli-login sql-solid-login-params
+     :sqli-connect-func sql-connect-solid
+     :prompt-regexp "^"
+     :prompt-length 0)
+
     (sqlite
      :name "SQLite"
+     :free-software t
      :font-lock sql-mode-sqlite-font-lock-keywords
-     :sqli-login (database)
-     :sqli-connect sql-connect-sqlite
-     :sqli-prompt-regexp "^sqlite> "
-     :sqli-prompt-length 8)
+     :sqli-program sql-sqlite-program
+     :sqli-options sql-sqlite-options
+     :sqli-login sql-sqlite-login-params
+     :sqli-connect-func sql-connect-sqlite
+     :prompt-regexp "^sqlite> "
+     :prompt-length 8)
+
     (sybase
+     :name "Sybase"
      :font-lock sql-mode-sybase-font-lock-keywords
-     :sqli-login (server user password database)
-     :sqli-connect sql-connect-sybase
-     :sqli-prompt-regexp "^SQL> "
-     :sqli-prompt-length 5
-     :syntax-alist ((?@ . "w")))
+     :sqli-program sql-sybase-program
+     :sqli-options sql-sybase-options
+     :sqli-login sql-sybase-login-params
+     :sqli-connect-func sql-connect-sybase
+     :prompt-regexp "^SQL> "
+     :prompt-length 5
+     :syntax-alist ((?@ . "w"))
+     :terminator ("^go" . "go"))
     )
-  "This variable contains a list of product features for each of the
-SQL products handled by `sql-mode'.  Without an entry in this list a
-product will not be properly highlighted and will not support
-`sql-interactive-mode'.
+  "An alist of product specific configuration settings.
+
+Without an entry in this list a product will not be properly
+highlighted and will not support `sql-interactive-mode'.
 
 Each element in the list is in the following format:
 
  \(PRODUCT FEATURE VALUE ...)
 
-where PRODUCT is the appropriate value of `sql-product'.  The product
-name is then followed by FEATURE-VALUE pairs.  If a FEATURE is not
-specified, its VALUE is treated as nil.  FEATURE must be one of the
-following:
+where PRODUCT is the appropriate value of `sql-product'.  The
+product name is then followed by FEATURE-VALUE pairs.  If a
+FEATURE is not specified, its VALUE is treated as nil.  FEATURE
+may be any one of the following:
+
+ :name                  string containing the displayable name of
+                        the product.
+
+ :free-software         is the product Free (as in Freedom) software?
 
  :font-lock             name of the variable containing the product
                         specific font lock highlighting patterns.
 
- :sqli-login            a list of login parameters (i.e., user,
-                        password, database and server) needed to
-                        connect to the database.
-
- :sqli-connect          the name of a function which accepts no
+ :sqli-program          name of the variable containing the product
+                        specific interactive program name.
+
+ :sqli-options          name of the variable containing the list
+                        of product specific options.
+
+ :sqli-login            name of the variable containing the list of
+                        login parameters (i.e., user, password,
+                        database and server) needed to connect to
+                        the database.
+
+ :sqli-connect-func     name of a function which accepts no
                         parameters that will use the values of
                         `sql-user', `sql-password',
                         `sql-database' and `sql-server' to open a
@@ -385,19 +471,45 @@
                         database.  Do product specific
                         configuration of comint in this function.
 
- :sqli-prompt-regexp    a regular expression string that matches
+ :prompt-regexp         regular expression string that matches
                         the prompt issued by the product
-                        interpreter.  (Not needed in 21.3+)
-
- :sqli-prompt-length    the length of the prompt on the line.(Not
-                        needed in 21.3+)
-
- :syntax-alist          an alist of syntax table entries to enable
-                        special character treatment by font-lock and
-                        imenu. ")
-
+                        interpreter.
+
+ :prompt-length         length of the prompt on the line.
+
+ :input-filter          function which can filter strings sent to
+                        the command interpreter.  It is also used
+                        by the `sql-send-string',
+                        `sql-send-region', `sql-send-paragraph'
+                        and `sql-send-buffer' functions.  The
+                        function is passed the string sent to the
+                        command interpreter and must return the
+                        filtered string.
+
+ :terminator            the terminator to be sent after a
+                        `sql-send-string', `sql-send-region',
+                        `sql-send-paragraph' and
+                        `sql-send-buffer' command.  May be the
+                        literal string or a cons of a regexp to
+                        match an existing terminator in the
+                        string and the terminator to be used if
+                        its absent.  By default \";\".
+
+ :syntax-alist          alist of syntax table entries to enable
+                        special character treatment by font-lock
+                        and imenu.
+
+Other features can be stored but they will be ignored.  However,
+you can develop new functionality which is product independent by
+using `sql-get-product-feature' to lookup the product specific
+settings.")
+
+(defvar sql-indirect-features
+  '(:font-lock :sqli-program :sqli-options :sqli-login))
+
+;;;###autoload
 (defcustom sql-product 'ansi
-  "*Select the SQL database product used so that buffers can be
+  "Select the SQL database product used so that buffers can be
 highlighted properly when you open them."
   :type `(choice
           ,@(mapcar (lambda (prod-info)
@@ -407,8 +519,12 @@
                               ,(car prod-info)))
                     sql-product-alist))
   :group 'SQL)
-
-;; misc customization of sql.el behavior
+(put 'sql-product 'safe-local-variable 'symbolp)
+
+(defvar sql-interactive-product nil
+  "Product under `sql-interactive-mode'.")
+
+;; misc customization of sql.el behaviour
 
 (defcustom sql-electric-stuff nil
   "Treat some input as electric.
@@ -419,19 +535,49 @@
 If set to nil, then you must use \\[comint-send-input] in order to send
 current input in the SQLi buffer to the process."
   :type '(choice (const :tag "Nothing" nil)
-		 (const :tag "The semikolon `;'" semicolon)
+		 (const :tag "The semicolon `;'" semicolon)
 		 (const :tag "The string `go' by itself" go))
   :version "20.8"
   :group 'SQL)
 
+(defcustom sql-send-terminator nil
+  "When non-nil, add a terminator to text sent to the SQL interpreter.
+
+When text is sent to the SQL interpreter (via `sql-send-string',
+`sql-send-region', `sql-send-paragraph' or `sql-send-buffer'), a
+command terminator can be automatically sent as well.  The
+terminator is not sent, if the string sent already ends with the
+terminator.
+
+If this value is t, then the default command terminator for the
+SQL interpreter is sent.  If this value is a string, then the
+string is sent.
+
+If the value is a cons cell of the form (PAT . TERM), then PAT is
+a regexp used to match the terminator in the string and TERM is
+the terminator to be sent.  This form is useful if the SQL
+interpreter has more than one way of submitting a SQL command.
+The PAT regexp can match any of them, and TERM is the way we do
+it automatically."
+
+  :type '(choice (const  :tag "No Terminator" nil)
+		 (const  :tag "Default Terminator" t)
+		 (string :tag "Terminator String")
+		 (cons   :tag "Terminator Pattern and String"
+			 (string :tag "Terminator Pattern")
+			 (string :tag "Terminator String")))
+  :version "22.2"
+  :group 'SQL)
+
 (defcustom sql-pop-to-buffer-after-send-region nil
-  "*If t, pop to the buffer SQL statements are sent to.
-
-After a call to `sql-send-region' or `sql-send-buffer',
-the window is split and the SQLi buffer is shown.  If this
-variable is not nil, that buffer's window will be selected
-by calling `pop-to-buffer'.  If this variable is nil, that
-buffer is shown using `display-buffer'."
+  "When non-nil, pop to the buffer SQL statements are sent to.
+
+After a call to `sql-sent-string', `sql-send-region',
+`sql-send-paragraph' or `sql-send-buffer', the window is split
+and the SQLi buffer is shown.  If this variable is not nil, that
+buffer's window will be selected by calling `pop-to-buffer'.  If
+this variable is nil, that buffer is shown using
+`display-buffer'."
   :type 'boolean
   :group 'SQL)
 
@@ -445,19 +591,20 @@
     ("Functions" "^\\s-*\\(create\\s-+\\(\\w+\\s-+\\)*\\)?function\\s-+\\(\\w+\\)" 3)
     ("Procedures" "^\\s-*\\(create\\s-+\\(\\w+\\s-+\\)*\\)?proc\\(edure\\)?\\s-+\\(\\w+\\)" 4)
     ("Packages" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*package\\s-+\\(body\\s-+\\)?\\(\\w+\\)" 3)
+    ("Types" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*type\\s-+\\(body\\s-+\\)?\\(\\w+\\)" 3)
     ("Indexes" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*index\\s-+\\(\\w+\\)" 2)
     ("Tables/Views" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*\\(table\\|view\\)\\s-+\\(\\w+\\)" 3))
   "Define interesting points in the SQL buffer for `imenu'.
 
 This is used to set `imenu-generic-expression' when SQL mode is
-entered.  Subsequent changes to sql-imenu-generic-expression will not
-affect existing SQL buffers because imenu-generic-expression is a
-local variable.")
+entered.  Subsequent changes to `sql-imenu-generic-expression' will
+not affect existing SQL buffers because imenu-generic-expression is
+a local variable.")
 
 ;; history file
 
 (defcustom sql-input-ring-file-name nil
-  "*If non-nil, name of the file to read/write input history.
+  "If non-nil, name of the file to read/write input history.
 
 You have to set this variable if you want the history of your commands
 saved from one Emacs session to the next.  If this variable is set,
@@ -474,7 +621,7 @@
   :group 'SQL)
 
 (defcustom sql-input-ring-separator "\n--\n"
-  "*Separator between commands in the history file.
+  "Separator between commands in the history file.
 
 If set to \"\\n\", each line in the history file will be interpreted as
 one command.  Multi-line commands are split into several commands when
@@ -492,17 +639,17 @@
 ;; The usual hooks
 
 (defcustom sql-interactive-mode-hook '()
-  "*Hook for customizing `sql-interactive-mode'."
+  "Hook for customizing `sql-interactive-mode'."
   :type 'hook
   :group 'SQL)
 
 (defcustom sql-mode-hook '()
-  "*Hook for customizing `sql-mode'."
+  "Hook for customizing `sql-mode'."
   :type 'hook
   :group 'SQL)
 
 (defcustom sql-set-sqli-hook '()
-  "*Hook for reacting to changes of `sql-buffer'.
+  "Hook for reacting to changes of `sql-buffer'.
 
 This is called by `sql-set-sqli-buffer' when the value of `sql-buffer'
 is changed."
@@ -512,144 +659,220 @@
 ;; Customization for Oracle
 
 (defcustom sql-oracle-program "sqlplus"
-  "*Command to start sqlplus by Oracle.
+  "Command to start sqlplus by Oracle.
 
 Starts `sql-interactive-mode' after doing some setup.
 
-Under NT, \"sqlplus\" usually starts the sqlplus \"GUI\".  In order to
+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.
-
-The program can also specify a TCP connection.  See `make-comint'."
+will find the file in your Orant\\bin directory."
   :type 'file
   :group 'SQL)
 
 (defcustom sql-oracle-options nil
-  "*List of additional options for `sql-oracle-program'."
+  "List of additional options for `sql-oracle-program'."
   :type '(repeat string)
   :version "20.8"
   :group 'SQL)
 
+(defcustom sql-oracle-login-params '(user password database)
+  "List of login parameters needed to connect to Oracle."
+  :type '(repeat (choice
+		  (const user)
+		  (const password)
+		  (const server)
+		  (const database)))
+  :version "24.1"
+  :group 'SQL)
+
+(defcustom sql-oracle-scan-on t
+  "Non-nil if placeholders should be replaced in Oracle SQLi.
+
+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
+prompts are not shown until after the text is entered.
+
+You will probably want to issue the following command in sqlplus
+to be safe:
+
+    SET SCAN OFF"
+  :type 'boolean
+  :group 'SQL)
+
 ;; Customization for SQLite
 
 (defcustom sql-sqlite-program "sqlite"
-  "*Command to start SQLite.
-
-Starts `sql-interactive-mode' after doing some setup.
-
-The program can also specify a TCP connection.  See `make-comint'."
+  "Command to start SQLite.
+
+Starts `sql-interactive-mode' after doing some setup."
   :type 'file
   :group 'SQL)
 
 (defcustom sql-sqlite-options nil
-  "*List of additional options for `sql-sqlite-program'.
+  "List of additional options for `sql-sqlite-program'."
+  :type '(repeat string)
+  :version "20.8"
+  :group 'SQL)
+
+(defcustom sql-sqlite-login-params '(database)
+  "List of login parameters needed to connect to SQLite."
+  :type '(repeat (choice
+		  (const user)
+		  (const password)
+		  (const server)
+		  (const database)))
+  :version "24.1"
+  :group 'SQL)
+
+;; Customization for MySql
+
+(defcustom sql-mysql-program "mysql"
+  "Command to start mysql by TcX.
+
+Starts `sql-interactive-mode' after doing some setup."
+  :type 'file
+  :group 'SQL)
+
+(defcustom sql-mysql-options nil
+  "List of additional options for `sql-mysql-program'.
 The following list of options is reported to make things work
 on Windows: \"-C\" \"-t\" \"-f\" \"-n\"."
   :type '(repeat string)
   :version "20.8"
   :group 'SQL)
 
-;; Customization for MySql
-
-(defcustom sql-mysql-program "mysql"
-  "*Command to start mysql by TcX.
-
-Starts `sql-interactive-mode' after doing some setup.
-
-The program can also specify a TCP connection.  See `make-comint'."
-  :type 'file
-  :group 'SQL)
-
-(defcustom sql-mysql-options nil
-  "*List of additional options for `sql-mysql-program'.
-The following list of options is reported to make things work
-on Windows: \"-C\" \"-t\" \"-f\" \"-n\"."
-  :type '(repeat string)
-  :version "20.8"
+(defcustom sql-mysql-login-params '(user password database server)
+  "List of login parameters needed to connect to MySql."
+  :type '(repeat (choice
+		  (const user)
+		  (const password)
+		  (const server)
+		  (const database)
+                  (const port)))
+  :version "24.1"
   :group 'SQL)
 
 ;; Customization for Solid
 
 (defcustom sql-solid-program "solsql"
-  "*Command to start SOLID SQL Editor.
-
-Starts `sql-interactive-mode' after doing some setup.
-
-The program can also specify a TCP connection.  See `make-comint'."
+  "Command to start SOLID SQL Editor.
+
+Starts `sql-interactive-mode' after doing some setup."
   :type 'file
   :group 'SQL)
 
+(defcustom sql-solid-login-params '(user password server)
+  "List of login parameters needed to connect to Solid."
+  :type '(repeat (choice
+		  (const user)
+		  (const password)
+		  (const server)
+		  (const database)))
+  :version "24.1"
+  :group 'SQL)
+
 ;; Customization for SyBase
 
 (defcustom sql-sybase-program "isql"
-  "*Command to start isql by SyBase.
-
-Starts `sql-interactive-mode' after doing some setup.
-
-The program can also specify a TCP connection.  See `make-comint'."
+  "Command to start isql by SyBase.
+
+Starts `sql-interactive-mode' after doing some setup."
   :type 'file
   :group 'SQL)
 
 (defcustom sql-sybase-options nil
-  "*List of additional options for `sql-sybase-program'.
+  "List of additional options for `sql-sybase-program'.
 Some versions of isql might require the -n option in order to work."
   :type '(repeat string)
   :version "20.8"
   :group 'SQL)
 
+(defcustom sql-sybase-login-params '(server user password database)
+  "List of login parameters needed to connect to Sybase."
+  :type '(repeat (choice
+		  (const user)
+		  (const password)
+		  (const server)
+		  (const database)))
+  :version "24.1"
+  :group 'SQL)
+
 ;; Customization for Informix
 
 (defcustom sql-informix-program "dbaccess"
-  "*Command to start dbaccess by Informix.
-
-Starts `sql-interactive-mode' after doing some setup.
-
-The program can also specify a TCP connection.  See `make-comint'."
+  "Command to start dbaccess by Informix.
+
+Starts `sql-interactive-mode' after doing some setup."
   :type 'file
   :group 'SQL)
 
+(defcustom sql-informix-login-params '(database)
+  "List of login parameters needed to connect to Informix."
+  :type '(repeat (choice
+		  (const user)
+		  (const password)
+		  (const server)
+		  (const database)))
+  :version "24.1"
+  :group 'SQL)
+
 ;; Customization for Ingres
 
 (defcustom sql-ingres-program "sql"
-  "*Command to start sql by Ingres.
-
-Starts `sql-interactive-mode' after doing some setup.
-
-The program can also specify a TCP connection.  See `make-comint'."
+  "Command to start sql by Ingres.
+
+Starts `sql-interactive-mode' after doing some setup."
   :type 'file
   :group 'SQL)
 
+(defcustom sql-ingres-login-params '(database)
+  "List of login parameters needed to connect to Ingres."
+  :type '(repeat (choice
+		  (const user)
+		  (const password)
+		  (const server)
+		  (const database)))
+  :version "24.1"
+  :group 'SQL)
+
 ;; Customization for Microsoft
 
 (defcustom sql-ms-program "osql"
-  "*Command to start osql by Microsoft.
-
-Starts `sql-interactive-mode' after doing some setup.
-
-The program can also specify a TCP connection.  See `make-comint'."
+  "Command to start osql by Microsoft.
+
+Starts `sql-interactive-mode' after doing some setup."
   :type 'file
   :group 'SQL)
 
 (defcustom sql-ms-options '("-w" "300" "-n")
   ;; -w is the linesize
-  "*List of additional options for `sql-ms-program'."
+  "List of additional options for `sql-ms-program'."
   :type '(repeat string)
   :version "22.1"
   :group 'SQL)
 
+(defcustom sql-ms-login-params '(user password server database)
+  "List of login parameters needed to connect to Microsoft."
+  :type '(repeat (choice
+		  (const user)
+		  (const password)
+		  (const server)
+		  (const database)))
+  :version "24.1"
+  :group 'SQL)
+
 ;; Customization for Postgres
 
 (defcustom sql-postgres-program "psql"
   "Command to start psql by Postgres.
 
-Starts `sql-interactive-mode' after doing some setup.
-
-The program can also specify a TCP connection.  See `make-comint'."
+Starts `sql-interactive-mode' after doing some setup."
   :type 'file
   :group 'SQL)
 
 (defcustom sql-postgres-options '("-P" "pager=off")
-  "*List of additional options for `sql-postgres-program'.
+  "List of additional options for `sql-postgres-program'.
 The default setting includes the -P option which breaks older versions
 of the psql client (such as version 6.5.3).  The -P option is equivalent
 to the --pset option.  If you want the psql to prompt you for a user
@@ -660,55 +883,91 @@
   :version "20.8"
   :group 'SQL)
 
+(defcustom sql-postgres-login-params '(user database server)
+  "List of login parameters needed to connect to Postgres."
+  :type '(repeat (choice
+		  (const user)
+		  (const password)
+		  (const server)
+		  (const database)))
+  :version "24.1"
+  :group 'SQL)
+
 ;; Customization for Interbase
 
 (defcustom sql-interbase-program "isql"
-  "*Command to start isql by Interbase.
-
-Starts `sql-interactive-mode' after doing some setup.
-
-The program can also specify a TCP connection.  See `make-comint'."
+  "Command to start isql by Interbase.
+
+Starts `sql-interactive-mode' after doing some setup."
   :type 'file
   :group 'SQL)
 
 (defcustom sql-interbase-options nil
-  "*List of additional options for `sql-interbase-program'."
+  "List of additional options for `sql-interbase-program'."
   :type '(repeat string)
   :version "20.8"
   :group 'SQL)
 
+(defcustom sql-interbase-login-params '(user password database)
+  "List of login parameters needed to connect to Interbase."
+  :type '(repeat (choice
+		  (const user)
+		  (const password)
+		  (const server)
+		  (const database)))
+  :version "24.1"
+  :group 'SQL)
+
 ;; Customization for DB2
 
 (defcustom sql-db2-program "db2"
-  "*Command to start db2 by IBM.
-
-Starts `sql-interactive-mode' after doing some setup.
-
-The program can also specify a TCP connection.  See `make-comint'."
+  "Command to start db2 by IBM.
+
+Starts `sql-interactive-mode' after doing some setup."
   :type 'file
   :group 'SQL)
 
 (defcustom sql-db2-options nil
-  "*List of additional options for `sql-db2-program'."
+  "List of additional options for `sql-db2-program'."
   :type '(repeat string)
   :version "20.8"
   :group 'SQL)
 
+(defcustom sql-db2-login-params nil
+  "List of login parameters needed to connect to DB2."
+  :type '(repeat (choice
+		  (const user)
+		  (const password)
+		  (const server)
+		  (const database)))
+  :version "24.1"
+  :group 'SQL)
+
 ;; Customization for Linter
 
 (defcustom sql-linter-program "inl"
-  "*Command to start inl by RELEX.
+  "Command to start inl by RELEX.
 
 Starts `sql-interactive-mode' after doing some setup."
   :type 'file
   :group 'SQL)
 
 (defcustom sql-linter-options nil
-  "*List of additional options for `sql-linter-program'."
+  "List of additional options for `sql-linter-program'."
   :type '(repeat string)
   :version "21.3"
   :group 'SQL)
 
+(defcustom sql-linter-login-params '(user password database server)
+  "Login parameters to needed to connect to Linter."
+  :type '(repeat (choice
+		  (const user)
+		  (const password)
+		  (const server)
+		  (const database)))
+  :version "24.1"
+  :group 'SQL)
+
 
 
 ;;; Variables which do not need customization
@@ -722,12 +981,15 @@
 (defvar sql-server-history nil
   "History of servers used.")
 
+(defvar sql-port-history nil
+  "History of ports used.")
+
 ;; Passwords are not kept in a history.
 
 (defvar sql-buffer nil
   "Current SQLi buffer.
 
-The global value of sql-buffer is the name of the latest SQLi buffer
+The global value of `sql-buffer' is the name of the latest SQLi buffer
 created.  Any SQL buffer created will make a local copy of this value.
 See `sql-interactive-mode' for more on multiple sessions.  If you want
 to change the SQLi buffer a SQL mode sends its SQL strings to, change
@@ -775,6 +1037,7 @@
     (define-key map (kbd "C-c C-r") 'sql-send-region)
     (define-key map (kbd "C-c C-s") 'sql-send-string)
     (define-key map (kbd "C-c C-b") 'sql-send-buffer)
+    (define-key map (kbd "C-c C-i") 'sql-product-interactive)
     map)
   "Mode map used for `sql-mode'.")
 
@@ -786,16 +1049,15 @@
  `("SQL"
    ["Send Paragraph" sql-send-paragraph (and (buffer-live-p sql-buffer)
 					     (get-buffer-process sql-buffer))]
-   ["Send Region" sql-send-region (and (or (and (boundp 'mark-active); Emacs
-						mark-active)
-					   (mark t)); XEmacs
+   ["Send Region" sql-send-region (and mark-active
 				       (buffer-live-p sql-buffer)
 				       (get-buffer-process sql-buffer))]
    ["Send Buffer" sql-send-buffer (and (buffer-live-p sql-buffer)
 				       (get-buffer-process sql-buffer))]
-   ["Send String" sql-send-string t]
+   ["Send String" sql-send-string (and (buffer-live-p sql-buffer)
+				       (get-buffer-process sql-buffer))]
    ["--" nil nil]
-   ["Start SQLi session" sql-product-interactive (sql-product-feature :sqli-connect)]
+   ["Start SQLi session" sql-product-interactive (sql-get-product-feature sql-product :sqli-connect-func)]
    ["Show SQLi buffer" sql-show-sqli-buffer t]
    ["Set SQLi buffer" sql-set-sqli-buffer t]
    ["Pop to SQLi buffer after send"
@@ -888,25 +1150,64 @@
 statement.  The format of variable should be a valid
 `font-lock-keywords' entry.")
 
-(defmacro sql-keywords-re (&rest keywords)
-  "Compile-time generation of regexp matching any one of KEYWORDS."
-  `(eval-when-compile
-     (concat "\\b"
-	     (regexp-opt ',keywords t)
-	     "\\b")))
-
-(defvar sql-mode-ansi-font-lock-keywords
-  (let ((ansi-funcs (sql-keywords-re
-"abs" "avg" "bit_length" "cardinality" "cast" "char_length"
-"character_length" "coalesce" "convert" "count" "current_date"
-"current_path" "current_role" "current_time" "current_timestamp"
-"current_user" "extract" "localtime" "localtimestamp" "lower" "max"
-"min" "mod" "nullif" "octet_length" "overlay" "placing" "session_user"
-"substring" "sum" "system_user" "translate" "treat" "trim" "upper"
-"user"
-))
-
-	(ansi-non-reserved (sql-keywords-re
+;; While there are international and American standards for SQL, they
+;; are not followed closely, and most vendors offer significant
+;; capabilities beyond those defined in the standard specifications.
+
+;; SQL mode provides support for hilighting based on the product.  In
+;; addition to hilighting the product keywords, any ANSI keywords not
+;; used by the product are also hilighted.  This will help identify
+;; keywords that could be restricted in future versions of the product
+;; or might be a problem if ported to another product.
+
+;; To reduce the complexity and size of the regular expressions
+;; generated to match keywords, ANSI keywords are filtered out of
+;; product keywords if they are equivalent.  To do this, we define a
+;; function `sql-font-lock-keywords-builder' that removes any keywords
+;; that are matched by the ANSI patterns and results in the same face
+;; being applied.  For this to work properly, we must play some games
+;; with the execution and compile time behavior.  This code is a
+;; little tricky but works properly.
+
+;; When defining the keywords for individual products you should
+;; include all of the keywords that you want matched.  The filtering
+;; against the ANSI keywords will be automatic if you use the
+;; `sql-font-lock-keywords-builder' function and follow the
+;; implementation pattern used for the other products in this file.
+
+(eval-when-compile
+  (defvar sql-mode-ansi-font-lock-keywords)
+  (setq sql-mode-ansi-font-lock-keywords nil))
+
+(eval-and-compile
+  (defun sql-font-lock-keywords-builder (face boundaries &rest keywords)
+    "Generation of regexp matching any one of KEYWORDS."
+
+    (let ((bdy (or boundaries '("\\b" . "\\b")))
+	  kwd)
+
+      ;; Remove keywords that are defined in ANSI
+      (setq kwd keywords)
+      (dolist (k keywords)
+	(catch 'next
+	  (dolist (a sql-mode-ansi-font-lock-keywords)
+	    (when (and (eq face (cdr a))
+		       (eq (string-match (car a) k 0) 0)
+		       (eq (match-end 0) (length k)))
+	      (setq kwd (delq k kwd))
+	      (throw 'next nil)))))
+
+      ;; Create a properly formed font-lock-keywords item
+      (cons (concat (car bdy)
+		    (regexp-opt kwd t)
+		    (cdr bdy))
+	    face))))
+
+(eval-when-compile
+  (setq sql-mode-ansi-font-lock-keywords
+	(list
+	 ;; ANSI Non Reserved keywords
+	 (sql-font-lock-keywords-builder 'font-lock-keyword-face nil
 "ada" "asensitive" "assignment" "asymmetric" "atomic" "between"
 "bitvar" "called" "catalog_name" "chain" "character_set_catalog"
 "character_set_name" "character_set_schema" "checked" "class_origin"
@@ -934,9 +1235,9 @@
 "trigger_name" "trigger_schema" "type" "uncommitted" "unnamed"
 "user_defined_type_catalog" "user_defined_type_name"
 "user_defined_type_schema"
-))
-
-	(ansi-reserved (sql-keywords-re
+)
+	 ;; ANSI Reserved keywords
+	 (sql-font-lock-keywords-builder 'font-lock-keyword-face nil
 "absolute" "action" "add" "admin" "after" "aggregate" "alias" "all"
 "allocate" "alter" "and" "any" "are" "as" "asc" "assertion" "at"
 "authorization" "before" "begin" "both" "breadth" "by" "call"
@@ -972,31 +1273,86 @@
 "trigger" "true" "under" "union" "unique" "unknown" "unnest" "update"
 "usage" "using" "value" "values" "variable" "view" "when" "whenever"
 "where" "with" "without" "work" "write" "year"
-))
-
-	(ansi-types (sql-keywords-re
+)
+
+	 ;; ANSI Functions
+	 (sql-font-lock-keywords-builder 'font-lock-builtin-face nil
+"abs" "avg" "bit_length" "cardinality" "cast" "char_length"
+"character_length" "coalesce" "convert" "count" "current_date"
+"current_path" "current_role" "current_time" "current_timestamp"
+"current_user" "extract" "localtime" "localtimestamp" "lower" "max"
+"min" "mod" "nullif" "octet_length" "overlay" "placing" "session_user"
+"substring" "sum" "system_user" "translate" "treat" "trim" "upper"
+"user"
+)
+	 ;; ANSI Data Types
+	 (sql-font-lock-keywords-builder 'font-lock-type-face nil
 "array" "binary" "bit" "blob" "boolean" "char" "character" "clob"
 "date" "dec" "decimal" "double" "float" "int" "integer" "interval"
 "large" "national" "nchar" "nclob" "numeric" "object" "precision"
 "real" "ref" "row" "scope" "smallint" "time" "timestamp" "varchar"
 "varying" "zone"
-)))
-
-    `((,ansi-non-reserved . font-lock-keyword-face)
-      (,ansi-reserved     . font-lock-keyword-face)
-      (,ansi-funcs        . font-lock-builtin-face)
-      (,ansi-types        . font-lock-type-face)))
-
+))))
+
+(defvar sql-mode-ansi-font-lock-keywords
+  (eval-when-compile sql-mode-ansi-font-lock-keywords)
   "ANSI SQL keywords used by font-lock.
 
 This variable is used by `sql-mode' and `sql-interactive-mode'.  The
 regular expressions are created during compilation by calling the
 function `regexp-opt'.  Therefore, take a look at the source before
-you define your own sql-mode-ansi-font-lock-keywords.  You may want to
-add functions and PL/SQL keywords.")
+you define your own `sql-mode-ansi-font-lock-keywords'.  You may want
+to add functions and PL/SQL keywords.")
 
 (defvar sql-mode-oracle-font-lock-keywords
-  (let ((oracle-functions (sql-keywords-re
+  (eval-when-compile
+    (list
+     ;; Oracle SQL*Plus Commands
+     (cons
+      (concat
+       "^\\(?:\\(?:" (regexp-opt '(
+"@" "@@" "accept" "append" "archive" "attribute" "break"
+"btitle" "change" "clear" "column" "connect" "copy" "define"
+"del" "describe" "disconnect" "edit" "execute" "exit" "get" "help"
+"host" "input" "list" "password" "pause" "print" "prompt" "recover"
+"remark" "repfooter" "repheader" "run" "save" "show" "shutdown"
+"spool" "start" "startup" "store" "timing" "ttitle" "undefine"
+"variable" "whenever"
+) t)
+
+       "\\)\\|"
+       "\\(?:compute\\s-+\\(?:avg\\|cou\\|min\\|max\\|num\\|sum\\|std\\|var\\)\\)\\|"
+       "\\(?:set\\s-+\\("
+
+       (regexp-opt
+	'("appi" "appinfo" "array" "arraysize" "auto" "autocommit"
+	  "autop" "autoprint" "autorecovery" "autot" "autotrace" "blo"
+	  "blockterminator" "buffer" "closecursor" "cmds" "cmdsep"
+	  "colsep" "com" "compatibility" "con" "concat" "constraint"
+	  "constraints" "copyc" "copycommit" "copytypecheck" "database"
+	  "def" "define" "document" "echo" "editf" "editfile" "emb"
+	  "embedded" "esc" "escape" "feed" "feedback" "flagger" "flu"
+	  "flush" "hea" "heading" "heads" "headsep" "instance" "lin"
+	  "linesize" "lobof" "loboffset" "logsource" "long" "longc"
+	  "longchunksize" "maxdata" "newp" "newpage" "null" "num"
+	  "numf" "numformat" "numwidth" "pages" "pagesize" "pau"
+	  "pause" "recsep" "recsepchar" "role" "scan" "serveroutput"
+	  "shift" "shiftinout" "show" "showmode" "space" "sqlbl"
+	  "sqlblanklines" "sqlc" "sqlcase" "sqlco" "sqlcontinue" "sqln"
+	  "sqlnumber" "sqlp" "sqlpluscompat" "sqlpluscompatibility"
+	  "sqlpre" "sqlprefix" "sqlprompt" "sqlt" "sqlterminator"
+	  "statement_id" "suf" "suffix" "tab" "term" "termout" "ti"
+	  "time" "timi" "timing" "transaction" "trim" "trimout" "trims"
+	  "trimspool" "truncate" "und" "underline" "ver" "verify" "wra"
+	  "wrap")) "\\)\\)"
+
+       "\\)\\b.*"
+       )
+      'font-lock-doc-face)
+     '("^[ \t]*rem\\(?:ark\\)?.*" . font-lock-comment-face)
+
+     ;; Oracle Functions
+     (sql-font-lock-keywords-builder 'font-lock-builtin-face nil
 "abs" "acos" "add_months" "ascii" "asciistr" "asin" "atan" "atan2"
 "avg" "bfilename" "bin_to_num" "bitand" "cast" "ceil" "chartorowid"
 "chr" "coalesce" "compose" "concat" "convert" "corr" "cos" "cosh"
@@ -1027,9 +1383,9 @@
 "userenv" "var_pop" "var_samp" "variance" "vsize" "width_bucket" "xml"
 "xmlagg" "xmlattribute" "xmlcolattval" "xmlconcat" "xmlelement"
 "xmlforest" "xmlsequence" "xmltransform"
-))
-
-	(oracle-keywords (sql-keywords-re
+)
+     ;; Oracle Keywords
+     (sql-font-lock-keywords-builder 'font-lock-keyword-face nil
 "abort" "access" "accessed" "account" "activate" "add" "admin"
 "advise" "after" "agent" "aggregate" "all" "allocate" "allow" "alter"
 "always" "analyze" "ancillary" "and" "any" "apply" "archive"
@@ -1115,22 +1471,29 @@
 "use" "using" "validate" "validation" "value" "values" "variable"
 "varray" "version" "view" "wait" "when" "whenever" "where" "with"
 "without" "wnds" "wnps" "work" "write" "xmldata" "xmlschema" "xmltype"
-))
-
-	(oracle-types (sql-keywords-re
+)
+     ;; Oracle Data Types
+     (sql-font-lock-keywords-builder 'font-lock-type-face nil
 "bfile" "blob" "byte" "char" "character" "clob" "date" "dec" "decimal"
 "double" "float" "int" "integer" "interval" "long" "national" "nchar"
 "nclob" "number" "numeric" "nvarchar2" "precision" "raw" "real"
 "rowid" "second" "smallint" "time" "timestamp" "urowid" "varchar"
 "varchar2" "varying" "year" "zone"
-))
-
-	(plsql-functions (sql-keywords-re
+)
+
+     ;; Oracle PL/SQL Attributes
+     (sql-font-lock-keywords-builder 'font-lock-builtin-face '("" . "\\b")
 "%bulk_rowcount" "%found" "%isopen" "%notfound" "%rowcount" "%rowtype"
-"%type" "extend" "prior"
-))
-
-	(plsql-keywords (sql-keywords-re
+"%type"
+)
+
+     ;; Oracle PL/SQL Functions
+     (sql-font-lock-keywords-builder 'font-lock-builtin-face nil
+"extend" "prior"
+)
+
+     ;; Oracle PL/SQL Keywords
+     (sql-font-lock-keywords-builder 'font-lock-keyword-face nil
 "autonomous_transaction" "bulk" "char_base" "collect" "constant"
 "cursor" "declare" "do" "elsif" "exception_init" "execute" "exit"
 "extends" "false" "fetch" "forall" "goto" "hour" "if" "interface"
@@ -1138,14 +1501,16 @@
 "separate" "serially_reusable" "sql" "sqlcode" "sqlerrm" "subtype"
 "the" "timezone_abbr" "timezone_hour" "timezone_minute"
 "timezone_region" "true" "varrying" "while"
-))
-
-	(plsql-type (sql-keywords-re
+)
+
+     ;; Oracle PL/SQL Data Types
+     (sql-font-lock-keywords-builder 'font-lock-type-face nil
 "binary_integer" "boolean" "naturaln" "pls_integer" "positive"
 "positiven" "record" "signtype" "string"
-))
-
-	(plsql-warning (sql-keywords-re
+)
+
+     ;; Oracle PL/SQL Exceptions
+     (sql-font-lock-keywords-builder 'font-lock-warning-face nil
 "access_into_null" "case_not_found" "collection_is_null"
 "cursor_already_open" "dup_val_on_index" "invalid_cursor"
 "invalid_number" "login_denied" "no_data_found" "not_logged_on"
@@ -1153,66 +1518,21 @@
 "subscript_beyond_count" "subscript_outside_limit" "sys_invalid_rowid"
 "timeout_on_resource" "too_many_rows" "value_error" "zero_divide"
 "exception" "notfound"
-))
-
-	(sqlplus-commands
-	 (eval-when-compile (concat "^\\(\\("
-				    (regexp-opt '(
-"@" "@@" "accept" "append" "archive" "attribute" "break"
-"btitle" "change" "clear" "column" "connect" "copy" "define"
-"del" "describe" "disconnect" "edit" "execute" "exit" "get" "help"
-"host" "input" "list" "password" "pause" "print" "prompt" "recover"
-"remark" "repfooter" "repheader" "run" "save" "show" "shutdown"
-"spool" "start" "startup" "store" "timing" "ttitle" "undefine"
-"variable" "whenever"
-
-) t)
-
-   "\\)\\|"
-   "\\(compute\\s-+\\(avg\\|cou\\|min\\|max\\|num\\|sum\\|std\\|var\\)\\)\\|"
-   "\\(set\\s-+\\(appi\\(nfo\\)?\\|array\\(size\\)?\\|"
-   "auto\\(commit\\)?\\|autop\\(rint\\)?\\|autorecovery\\|"
-   "autot\\(race\\)?\\|blo\\(ckterminator\\)?\\|cmds\\(ep\\)?\\|"
-   "colsep\\|com\\(patibility\\)?\\|con\\(cat\\)?\\|"
-   "copyc\\(ommit\\)?\\|copytypecheck\\|def\\(ine\\)?\\|"
-   "describe\\|echo\\|editf\\(ile\\)?\\|emb\\(edded\\)?\\|"
-   "esc\\(ape\\)?\\|feed\\(back\\)?\\|flagger\\|"
-   "flu\\(sh\\)?\\|hea\\(ding\\)?\\|heads\\(ep\\)?\\|"
-   "instance\\|lin\\(esize\\)?\\|lobof\\(fset\\)?\\|"
-   "logsource\\|long\\|longc\\(hunksize\\)?\\|mark\\(up\\)?\\|"
-   "newp\\(age\\)?\\|null\\|numf\\(ormat\\)?\\|"
-   "num\\(width\\)?\\|pages\\(ize\\)?\\|pau\\(se\\)?\\|"
-   "recsep\\|recsepchar\\|serverout\\(put\\)?\\|"
-   "shift\\(inout\\)?\\|show\\(mode\\)?\\|"
-   "sqlbl\\(anklines\\)?\\|sqlc\\(ase\\)?\\|"
-   "sqlco\\(ntinue\\)?\\|sqln\\(umber\\)?\\|"
-   "sqlpluscompat\\(ibility\\)?\\|sqlpre\\(fix\\)?\\|"
-   "sqlp\\(rompt\\)?\\|sqlt\\(erminator\\)?\\|"
-   "suf\\(fix\\)?\\|tab\\|term\\(out\\)?\\|ti\\(me\\)?\\|"
-   "timi\\(ng\\)?\\|trim\\(out\\)?\\|trims\\(pool\\)?\\|"
-   "und\\(erline\\)?\\|ver\\(ify\\)?\\|wra\\(p\\)?\\)\\)\\)"
-   "\\b.*$"
-   ))))
-
-    `((,sqlplus-commands . font-lock-doc-face)
-      (,oracle-functions . font-lock-builtin-face)
-      (,oracle-keywords  . font-lock-keyword-face)
-      (,oracle-types     . font-lock-type-face)
-      (,plsql-functions  . font-lock-builtin-face)
-      (,plsql-keywords   . font-lock-keyword-face)
-      (,plsql-type       . font-lock-type-face)
-      (,plsql-warning    . font-lock-warning-face)))
+)))
 
   "Oracle SQL keywords used by font-lock.
 
 This variable is used by `sql-mode' and `sql-interactive-mode'.  The
 regular expressions are created during compilation by calling the
 function `regexp-opt'.  Therefore, take a look at the source before
-you define your own sql-mode-oracle-font-lock-keywords.  You may want
+you define your own `sql-mode-oracle-font-lock-keywords'.  You may want
 to add functions and PL/SQL keywords.")
 
 (defvar sql-mode-postgres-font-lock-keywords
-  (let ((pg-funcs (sql-keywords-re
+  (eval-when-compile
+    (list
+     ;; Postgres Functions
+     (sql-font-lock-keywords-builder 'font-lock-builtin-face nil
 "abbrev" "abs" "acos" "age" "area" "ascii" "asin" "atab2" "atan"
 "atan2" "avg" "bit_length" "both" "broadcast" "btrim" "cbrt" "ceil"
 "center" "char_length" "chr" "coalesce" "col_description" "convert"
@@ -1237,9 +1557,9 @@
 "substring" "sum" "tan" "timeofday" "to_ascii" "to_char" "to_date"
 "to_hex" "to_number" "to_timestamp" "trailing" "translate" "trim"
 "trunc" "upper" "variance" "version" "width"
-))
-
-	(pg-reserved (sql-keywords-re
+)
+     ;; Postgres Reserved
+     (sql-font-lock-keywords-builder 'font-lock-keyword-face nil
 "abort" "access" "add" "after" "aggregate" "alignment" "all" "alter"
 "analyze" "and" "any" "as" "asc" "assignment" "authorization"
 "backward" "basetype" "before" "begin" "between" "binary" "by" "cache"
@@ -1274,9 +1594,10 @@
 "usage" "user" "using" "vacuum" "valid" "validator" "values"
 "variable" "verbose" "view" "volatile" "when" "where" "with" "without"
 "work"
-))
-
-	(pg-types (sql-keywords-re
+)
+
+     ;; Postgres Data Types
+     (sql-font-lock-keywords-builder 'font-lock-type-face nil
 "anyarray" "bigint" "bigserial" "bit" "boolean" "box" "bytea" "char"
 "character" "cidr" "circle" "cstring" "date" "decimal" "double"
 "float4" "float8" "inet" "int2" "int4" "int8" "integer" "internal"
@@ -1287,19 +1608,18 @@
 "timestamp" "varchar" "varying" "void" "zone"
 )))
 
-  `((,pg-funcs    . font-lock-builtin-face)
-    (,pg-reserved . font-lock-keyword-face)
-    (,pg-types    . font-lock-type-face)))
-
   "Postgres SQL keywords used by font-lock.
 
 This variable is used by `sql-mode' and `sql-interactive-mode'.  The
 regular expressions are created during compilation by calling the
 function `regexp-opt'.  Therefore, take a look at the source before
-you define your own sql-mode-postgres-font-lock-keywords.")
+you define your own `sql-mode-postgres-font-lock-keywords'.")
 
 (defvar sql-mode-linter-font-lock-keywords
-  (let ((linter-keywords (sql-keywords-re
+  (eval-when-compile
+    (list
+     ;; Linter Keywords
+     (sql-font-lock-keywords-builder 'font-lock-keyword-face nil
 "autocommit" "autoinc" "autorowid" "cancel" "cascade" "channel"
 "committed" "count" "countblob" "cross" "current" "data" "database"
 "datafile" "datafiles" "datesplit" "dba" "dbname" "default" "deferred"
@@ -1324,9 +1644,10 @@
 "trigger_info_size" "true" "trunc" "uncommitted" "unicode" "unknown"
 "unlimited" "unlisted" "user" "utf8" "value" "varying" "volumes"
 "wait" "windows_code" "workspace" "write" "xml"
-))
-
-	(linter-reserved (sql-keywords-re
+)
+
+     ;; Linter Reserved
+     (sql-font-lock-keywords-builder 'font-lock-keyword-face nil
 "access" "action" "add" "address" "after" "all" "alter" "always" "and"
 "any" "append" "as" "asc" "ascic" "async" "at_begin" "at_end" "audit"
 "aud_obj_name_len" "backup" "base" "before" "between" "blobfile"
@@ -1344,16 +1665,10 @@
 "start" "stop" "sync" "synchronize" "synonym" "sysdate" "table" "then"
 "to" "union" "unique" "unlock" "until" "update" "using" "values"
 "view" "when" "where" "with" "without"
-))
-
-	(linter-types (sql-keywords-re
-"bigint" "bitmap" "blob" "boolean" "char" "character" "date"
-"datetime" "dec" "decimal" "double" "float" "int" "integer" "nchar"
-"number" "numeric" "real" "smallint" "varbyte" "varchar" "byte"
-"cursor" "long"
-))
-
-	(linter-functions (sql-keywords-re
+)
+
+     ;; Linter Functions
+     (sql-font-lock-keywords-builder 'font-lock-builtin-face nil
 "abs" "acos" "asin" "atan" "atan2" "avg" "ceil" "cos" "cosh" "divtime"
 "exp" "floor" "getbits" "getblob" "getbyte" "getlong" "getraw"
 "getstr" "gettext" "getword" "hextoraw" "lenblob" "length" "log"
@@ -1364,13 +1679,16 @@
 "to_gmtime" "to_localtime" "to_number" "trim" "upper" "decode"
 "substr" "substring" "chr" "dayname" "days" "greatest" "hex" "initcap"
 "instr" "least" "multime" "replace" "width"
+)
+
+     ;; Linter Data Types
+     (sql-font-lock-keywords-builder 'font-lock-type-face nil
+"bigint" "bitmap" "blob" "boolean" "char" "character" "date"
+"datetime" "dec" "decimal" "double" "float" "int" "integer" "nchar"
+"number" "numeric" "real" "smallint" "varbyte" "varchar" "byte"
+"cursor" "long"
 )))
 
-    `((,linter-keywords  . font-lock-keyword-face)
-      (,linter-reserved  . font-lock-keyword-face)
-      (,linter-functions . font-lock-builtin-face)
-      (,linter-types     . font-lock-type-face)))
-
   "Linter SQL keywords used by font-lock.
 
 This variable is used by `sql-mode' and `sql-interactive-mode'.  The
@@ -1378,7 +1696,29 @@
 function `regexp-opt'.")
 
 (defvar sql-mode-ms-font-lock-keywords
-  (let ((ms-reserved (sql-keywords-re
+  (eval-when-compile
+    (list
+     ;; MS isql/osql Commands
+     (cons
+      (concat
+       "^\\(?:\\(?:set\\s-+\\(?:"
+       (regexp-opt '(
+"datefirst" "dateformat" "deadlock_priority" "lock_timeout"
+"concat_null_yields_null" "cursor_close_on_commit"
+"disable_def_cnst_chk" "fips_flagger" "identity_insert" "language"
+"offsets" "quoted_identifier" "arithabort" "arithignore" "fmtonly"
+"nocount" "noexec" "numeric_roundabort" "parseonly"
+"query_governor_cost_limit" "rowcount" "textsize" "ansi_defaults"
+"ansi_null_dflt_off" "ansi_null_dflt_on" "ansi_nulls" "ansi_padding"
+"ansi_warnings" "forceplan" "showplan_all" "showplan_text"
+"statistics" "implicit_transactions" "remote_proc_transactions"
+"transaction" "xact_abort"
+) t)
+       "\\)\\)\\|go\\s-*\\|use\\s-+\\|setuser\\s-+\\|dbcc\\s-+\\).*$")
+      'font-lock-doc-face)
+
+     ;; MS Reserved
+     (sql-font-lock-keywords-builder 'font-lock-keyword-face nil
 "absolute" "add" "all" "alter" "and" "any" "as" "asc" "authorization"
 "avg" "backup" "begin" "between" "break" "browse" "bulk" "by"
 "cascade" "case" "check" "checkpoint" "close" "clustered" "coalesce"
@@ -1411,19 +1751,10 @@
 "updlock" "use" "user" "values" "view" "waitfor" "when" "where"
 "while" "with" "work" "writetext" "collate" "function" "openxml"
 "returns"
-))
-
-	(ms-types (sql-keywords-re
-"binary" "bit" "char" "character" "cursor" "datetime" "dec" "decimal"
-"double" "float" "image" "int" "integer" "money" "national" "nchar"
-"ntext" "numeric" "numeric" "nvarchar" "precision" "real"
-"smalldatetime" "smallint" "smallmoney" "text" "timestamp" "tinyint"
-"uniqueidentifier" "varbinary" "varchar" "varying"
-))
-
-	(ms-vars "\\b@[a-zA-Z0-9_]*\\b")
-
-	(ms-functions (sql-keywords-re
+)
+
+     ;; MS Functions
+     (sql-font-lock-keywords-builder 'font-lock-builtin-face nil
 "@@connections" "@@cpu_busy" "@@cursor_rows" "@@datefirst" "@@dbts"
 "@@error" "@@fetch_status" "@@identity" "@@idle" "@@io_busy"
 "@@langid" "@@language" "@@lock_timeout" "@@max_connections"
@@ -1452,37 +1783,26 @@
 "suser_id" "suser_name" "suser_sid" "suser_sname" "system_user" "tan"
 "textptr" "textvalid" "typeproperty" "unicode" "upper" "user"
 "user_id" "user_name" "var" "varp" "year"
-))
-
-	(ms-commands
-	 (eval-when-compile
-	   (concat "^\\(\\(set\\s-+\\("
-		   (regexp-opt '(
-"datefirst" "dateformat" "deadlock_priority" "lock_timeout"
-"concat_null_yields_null" "cursor_close_on_commit"
-"disable_def_cnst_chk" "fips_flagger" "identity_insert" "language"
-"offsets" "quoted_identifier" "arithabort" "arithignore" "fmtonly"
-"nocount" "noexec" "numeric_roundabort" "parseonly"
-"query_governor_cost_limit" "rowcount" "textsize" "ansi_defaults"
-"ansi_null_dflt_off" "ansi_null_dflt_on" "ansi_nulls" "ansi_padding"
-"ansi_warnings" "forceplan" "showplan_all" "showplan_text"
-"statistics" "implicit_transactions" "remote_proc_transactions"
-"transaction" "xact_abort"
-) t)
-		   "\\)\\)\\|go\\s-*\\|use\\s-+\\|setuser\\s-+\\|dbcc\\s-+\\).*$"))))
-
-    `((,ms-commands  . font-lock-doc-face)
-      (,ms-reserved  . font-lock-keyword-face)
-      (,ms-functions . font-lock-builtin-face)
-      (,ms-vars      . font-lock-variable-name-face)
-      (,ms-types     . font-lock-type-face)))
+)
+
+     ;; MS Variables
+     '("\\b@[a-zA-Z0-9_]*\\b" . font-lock-variable-name-face)
+
+     ;; MS Types
+     (sql-font-lock-keywords-builder 'font-lock-type-face nil
+"binary" "bit" "char" "character" "cursor" "datetime" "dec" "decimal"
+"double" "float" "image" "int" "integer" "money" "national" "nchar"
+"ntext" "numeric" "numeric" "nvarchar" "precision" "real"
+"smalldatetime" "smallint" "smallmoney" "text" "timestamp" "tinyint"
+"uniqueidentifier" "varbinary" "varchar" "varying"
+)))
 
   "Microsoft SQLServer SQL keywords used by font-lock.
 
 This variable is used by `sql-mode' and `sql-interactive-mode'.  The
 regular expressions are created during compilation by calling the
 function `regexp-opt'.  Therefore, take a look at the source before
-you define your own sql-mode-ms-font-lock-keywords.")
+you define your own `sql-mode-ms-font-lock-keywords'.")
 
 (defvar sql-mode-sybase-font-lock-keywords nil
   "Sybase SQL keywords used by font-lock.
@@ -1490,7 +1810,7 @@
 This variable is used by `sql-mode' and `sql-interactive-mode'.  The
 regular expressions are created during compilation by calling the
 function `regexp-opt'.  Therefore, take a look at the source before
-you define your own sql-mode-sybase-font-lock-keywords.")
+you define your own `sql-mode-sybase-font-lock-keywords'.")
 
 (defvar sql-mode-informix-font-lock-keywords nil
   "Informix SQL keywords used by font-lock.
@@ -1498,7 +1818,7 @@
 This variable is used by `sql-mode' and `sql-interactive-mode'.  The
 regular expressions are created during compilation by calling the
 function `regexp-opt'.  Therefore, take a look at the source before
-you define your own sql-mode-informix-font-lock-keywords.")
+you define your own `sql-mode-informix-font-lock-keywords'.")
 
 (defvar sql-mode-interbase-font-lock-keywords nil
   "Interbase SQL keywords used by font-lock.
@@ -1506,7 +1826,7 @@
 This variable is used by `sql-mode' and `sql-interactive-mode'.  The
 regular expressions are created during compilation by calling the
 function `regexp-opt'.  Therefore, take a look at the source before
-you define your own sql-mode-interbase-font-lock-keywords.")
+you define your own `sql-mode-interbase-font-lock-keywords'.")
 
 (defvar sql-mode-ingres-font-lock-keywords nil
   "Ingres SQL keywords used by font-lock.
@@ -1514,7 +1834,7 @@
 This variable is used by `sql-mode' and `sql-interactive-mode'.  The
 regular expressions are created during compilation by calling the
 function `regexp-opt'.  Therefore, take a look at the source before
-you define your own sql-mode-interbase-font-lock-keywords.")
+you define your own `sql-mode-interbase-font-lock-keywords'.")
 
 (defvar sql-mode-solid-font-lock-keywords nil
   "Solid SQL keywords used by font-lock.
@@ -1522,10 +1842,13 @@
 This variable is used by `sql-mode' and `sql-interactive-mode'.  The
 regular expressions are created during compilation by calling the
 function `regexp-opt'.  Therefore, take a look at the source before
-you define your own sql-mode-solid-font-lock-keywords.")
+you define your own `sql-mode-solid-font-lock-keywords'.")
 
 (defvar sql-mode-mysql-font-lock-keywords
-  (let ((mysql-funcs (sql-keywords-re
+  (eval-when-compile
+    (list
+     ;; MySQL Functions
+     (sql-font-lock-keywords-builder 'font-lock-builtin-face nil
 "ascii" "avg" "bdmpolyfromtext" "bdmpolyfromwkb" "bdpolyfromtext"
 "bdpolyfromwkb" "benchmark" "bin" "bit_and" "bit_length" "bit_or"
 "bit_xor" "both" "cast" "char_length" "character_length" "coalesce"
@@ -1548,9 +1871,10 @@
 "release_lock" "repeat" "replace" "reverse" "rpad" "rtrim" "soundex"
 "space" "std" "stddev" "substring" "substring_index" "sum" "sysdate"
 "trailing" "trim" "ucase" "unix_timestamp" "upper" "user" "variance"
-))
-
-	(mysql-keywords (sql-keywords-re
+)
+
+     ;; MySQL Keywords
+     (sql-font-lock-keywords-builder 'font-lock-keyword-face nil
 "action" "add" "after" "against" "all" "alter" "and" "as" "asc"
 "auto_increment" "avg_row_length" "bdb" "between" "by" "cascade"
 "case" "change" "character" "check" "checksum" "close" "collate"
@@ -1576,9 +1900,10 @@
 "then" "to" "transaction" "truncate" "type" "uncommitted" "union"
 "unique" "unlock" "update" "use" "using" "values" "when" "where"
 "with" "write" "xor"
-))
-
-	(mysql-types (sql-keywords-re
+)
+
+     ;; MySQL Data Types
+     (sql-font-lock-keywords-builder 'font-lock-type-face nil
 "bigint" "binary" "bit" "blob" "bool" "boolean" "char" "curve" "date"
 "datetime" "dec" "decimal" "double" "enum" "fixed" "float" "geometry"
 "geometrycollection" "int" "integer" "line" "linearring" "linestring"
@@ -1590,16 +1915,12 @@
 "zerofill"
 )))
 
-    `((,mysql-funcs    . font-lock-builtin-face)
-      (,mysql-keywords . font-lock-keyword-face)
-      (,mysql-types    . font-lock-type-face)))
-
   "MySQL SQL keywords used by font-lock.
 
 This variable is used by `sql-mode' and `sql-interactive-mode'.  The
 regular expressions are created during compilation by calling the
 function `regexp-opt'.  Therefore, take a look at the source before
-you define your own sql-mode-mysql-font-lock-keywords.")
+you define your own `sql-mode-mysql-font-lock-keywords'.")
 
 (defvar sql-mode-sqlite-font-lock-keywords nil
   "SQLite SQL keywords used by font-lock.
@@ -1607,7 +1928,7 @@
 This variable is used by `sql-mode' and `sql-interactive-mode'.  The
 regular expressions are created during compilation by calling the
 function `regexp-opt'.  Therefore, take a look at the source before
-you define your own sql-mode-sqlite-font-lock-keywords.")
+you define your own `sql-mode-sqlite-font-lock-keywords'.")
 
 (defvar sql-mode-db2-font-lock-keywords nil
   "DB2 SQL keywords used by font-lock.
@@ -1615,58 +1936,146 @@
 This variable is used by `sql-mode' and `sql-interactive-mode'.  The
 regular expressions are created during compilation by calling the
 function `regexp-opt'.  Therefore, take a look at the source before
-you define your own sql-mode-db2-font-lock-keywords.")
+you define your own `sql-mode-db2-font-lock-keywords'.")
 
 (defvar sql-mode-font-lock-keywords nil
   "SQL keywords used by font-lock.
 
 Setting this variable directly no longer has any affect.  Use
 `sql-product' and `sql-add-product-keywords' to control the
-highlighting rules in sql-mode.")
+highlighting rules in SQL mode.")
 
 
 
 ;;; SQL Product support functions
 
-(defun sql-product-feature (feature &optional product)
-  "Lookup `feature' needed to support the current SQL product.
-
-See \[sql-product-alist] for a list of products and supported features."
-  (plist-get
-   (cdr (assoc (or product sql-product)
-	       sql-product-alist))
-   feature))
+(defun sql-add-product (product display &rest plist)
+  "Add support for a database product in `sql-mode'.
+
+Add PRODUCT to `sql-product-alist' which enables `sql-mode' to
+properly support syntax highlighting and interactive interaction.
+DISPLAY is the name of the SQL product that will appear in the
+menu bar and in messages.  PLIST initializes the product
+configuration."
+
+  ;; Don't do anything if the product is already supported
+  (if (assoc product sql-product-alist)
+      (message "Product `%s' is already defined" product)
+
+    ;; Add product to the alist
+    (add-to-list 'sql-product-alist `((,product :name ,display . ,plist)))
+    ;; Add a menu item to the SQL->Product menu
+    (easy-menu-add-item sql-mode-menu '("Product")
+			;; Each product is represented by a radio
+			;; button with it's display name.
+			`[,display
+			  (lambda () (interactive) (sql-set-product ',product))
+			 :style radio
+			 :selected (eq sql-product ',product)]
+			;; Maintain the product list in
+			;; (case-insensitive) alphabetic order of the
+			;; display names.  Loop thru each keymap item
+			;; looking for an item whose display name is
+			;; after this product's name.
+			(let ((next-item)
+			      (down-display (downcase display)))
+			  (map-keymap (lambda (k b)
+					(when (and (not next-item)
+						   (string-lessp down-display
+								 (downcase (cadr b))))
+					  (setq next-item k)))
+				      (easy-menu-get-map sql-mode-menu '("Product")))
+			  next-item))
+    product))
+
+(defun sql-del-product (product)
+  "Remove support for PRODUCT in `sql-mode'."
+
+  ;; Remove the menu item based on the display name
+  (easy-menu-remove-item sql-mode-menu '("Product") (sql-get-product-feature product :name))
+  ;; Remove the product alist item
+  (setq sql-product-alist (assq-delete-all product sql-product-alist))
+  nil)
+
+(defun sql-set-product-feature (product feature newvalue)
+  "Set FEATURE of database PRODUCT to NEWVALUE.
+
+The PRODUCT must be a symbol which identifies the database
+product.  The product must have already exist on the product
+list.  See `sql-add-product' to add new products.  The FEATURE
+argument must be a plist keyword accepted by
+`sql-product-alist'."
+
+  (let* ((p (assoc product sql-product-alist))
+         (v (plist-get (cdr p) feature)))
+    (if p
+        (if (and
+             (member feature sql-indirect-features)
+             (symbolp v))
+            (set v newvalue)
+          (setcdr p (plist-put (cdr p) feature newvalue)))
+      (message "`%s' is not a known product; use `sql-add-product' to add it first." product))))
+
+(defun sql-get-product-feature (product feature &optional fallback)
+  "Lookup FEATURE associated with a SQL PRODUCT.
+
+If the FEATURE is nil for PRODUCT, and FALLBACK is specified,
+then the FEATURE associated with the FALLBACK product is
+returned.
+
+See `sql-product-alist' for a list of products and supported features."
+  (let* ((p (assoc product sql-product-alist))
+         (v (plist-get (cdr p) feature)))
+
+    (if p
+        ;; If no value and fallback, lookup feature for fallback
+        (if (and (not v)
+                 fallback
+                 (not (eq product fallback)))
+            (sql-get-product-feature fallback feature)
+
+          (if (and
+               (member feature sql-indirect-features)
+               (symbolp v))
+              (symbol-value v)
+            v))
+      (message "`%s' is not a known product; use `sql-add-product' to add it first." product))))
 
 (defun sql-product-font-lock (keywords-only imenu)
-  "Sets `font-lock-defaults' and `font-lock-keywords' based on
-the product-specific keywords and syntax-alists defined in
-`sql-product-alist'."
+  "Configures 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
+skipped.  The IMENU flag indicates whether `imenu-mode' should
+also be configured."
+
   (let
       ;; Get the product-specific syntax-alist.
       ((syntax-alist
 	(append
-	 (sql-product-feature :syntax-alist)
+	 (sql-get-product-feature sql-product :syntax-alist)
 	 '((?_ . "w") (?. . "w")))))
 
     ;; Get the product-specific keywords.
     (setq sql-mode-font-lock-keywords
 	  (append
 	   (unless (eq sql-product 'ansi)
-	     (eval (sql-product-feature :font-lock)))
+	     (sql-get-product-feature sql-product :font-lock))
 	   ;; Always highlight ANSI keywords
-	   (eval (sql-product-feature :font-lock 'ansi))
+	   (sql-get-product-feature 'ansi :font-lock)
 	   ;; Fontify object names in CREATE, DROP and ALTER DDL
 	   ;; statements
 	   (list sql-mode-font-lock-object-name)))
 
     ;; Setup font-lock.  Force re-parsing of `font-lock-defaults'.
-    (set (make-local-variable 'font-lock-set-defaults) nil)
+    (kill-local-variable 'font-lock-set-defaults)
     (setq font-lock-defaults (list 'sql-mode-font-lock-keywords
 				   keywords-only t syntax-alist))
 
     ;; Force font lock to reinitialize if it is already on
     ;; Otherwise, we can wait until it can be started.
     (when (and (fboundp 'font-lock-mode)
+	       (boundp 'font-lock-mode)
 	       font-lock-mode)
       (font-lock-mode-internal nil)
       (font-lock-mode-internal t))
@@ -1683,7 +2092,7 @@
 
     ;; Setup imenu; it needs the same syntax-alist.
     (when imenu
-	(setq imenu-syntax-alist syntax-alist))))
+      (setq imenu-syntax-alist syntax-alist))))
 
 ;;;###autoload
 (defun sql-add-product-keywords (product keywords &optional append)
@@ -1705,38 +2114,40 @@
 adds a fontification pattern to fontify identifiers ending in
 `_t' as data types."
 
-  (let ((font-lock (sql-product-feature :font-lock product))
-	old)
-    (setq old (eval font-lock))
-    (set font-lock
+  (let* ((sql-indirect-features nil)
+         (font-lock-var (sql-get-product-feature product :font-lock))
+         (old-val))
+
+    (setq old-val (symbol-value font-lock-var))
+    (set font-lock-var
 	 (if (eq append 'set)
 	     keywords
 	   (if append
-	       (append old keywords)
-	     (append keywords old))))))
+	       (append old-val keywords)
+	     (append keywords old-val))))))
 
 
 
 ;;; Functions to switch highlighting
 
 (defun sql-highlight-product ()
-  "Turns on the appropriate font highlighting for the SQL product
-selected."
+  "Turns on the font highlighting for the SQL product selected."
   (when (derived-mode-p 'sql-mode)
     ;; Setup font-lock
     (sql-product-font-lock nil t)
 
     ;; Set the mode name to include the product.
-    (setq mode-name (concat "SQL[" (prin1-to-string sql-product) "]"))))
+    (setq mode-name (concat "SQL[" (or (sql-get-product-feature sql-product :name)
+				       (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 "Enter SQL product: "
+   (list (completing-read "SQL product: "
                           (mapcar (lambda (info) (symbol-name (car info)))
                                   sql-product-alist)
-                          nil 'require-match)))
+                          nil 'require-match
+                          (or (and sql-product (symbol-name sql-product)) "ansi"))))
   (if (stringp product) (setq product (intern product)))
   (when (not (assoc product sql-product-alist))
     (error "SQL product %s is not supported; treated as ANSI" product)
@@ -1752,7 +2163,7 @@
 (if (not (fboundp 'comint-line-beginning-position))
     ;; comint-line-beginning-position is defined in Emacs 21
     (defun comint-line-beginning-position ()
-      "Returns the buffer position of the beginning of the line, after any prompt.
+      "Return the buffer position of the beginning of the line, after any prompt.
 The prompt is assumed to be any text at the beginning of the line matching
 the regular expression `comint-prompt-regexp', a buffer local variable."
       (save-excursion (comint-bol nil) (point))))
@@ -1788,6 +2199,30 @@
     (newline))
   (indent-according-to-mode))
 
+(defun sql-help-list-products (indent freep)
+  "Generate listing of products available for use under SQLi.
+
+List products with :free-softare attribute set to FREEP.  Indent
+each line with INDENT."
+
+  (let (sqli-func doc)
+    (setq doc "")
+    (dolist (p sql-product-alist)
+      (setq sqli-func (intern (concat "sql-" (symbol-name (car p)))))
+
+      (if (and (fboundp sqli-func)
+	       (eq (sql-get-product-feature (car p) :free-software) freep))
+	(setq doc
+	      (concat doc
+		      indent
+		      (or (sql-get-product-feature (car p) :name)
+			  (symbol-name (car p)))
+		      ":\t"
+		      "\\["
+		      (symbol-name sqli-func)
+		      "]\n"))))
+    doc))
+
 ;;;###autoload
 (defun sql-help ()
   "Show short help for the SQL modes.
@@ -1797,24 +2232,17 @@
 
 Use the following commands to start a specific SQL interpreter:
 
-    PostGres: \\[sql-postgres]
-    MySQL: \\[sql-mysql]
-    SQLite: \\[sql-sqlite]
+    \\\\FREE
 
 Other non-free SQL implementations are also supported:
 
-    Solid: \\[sql-solid]
-    Oracle: \\[sql-oracle]
-    Informix: \\[sql-informix]
-    Sybase: \\[sql-sybase]
-    Ingres: \\[sql-ingres]
-    Microsoft: \\[sql-ms]
-    DB2: \\[sql-db2]
-    Interbase: \\[sql-interbase]
-    Linter: \\[sql-linter]
+    \\\\NONFREE
 
 But we urge you to choose a free implementation instead of these.
 
+You can also use \\[sql-product-interactive] to invoke the
+interpreter for the current `sql-product'.
+
 Once you have the SQLi buffer, you can enter SQL statements in the
 buffer.  The output generated is appended to the buffer and a new prompt
 is generated.  See the In/Out menu in the SQLi buffer for some functions
@@ -1829,6 +2257,30 @@
 buffer to the interactive SQL buffer (SQLi mode).  The results are
 appended to the SQLi buffer without disturbing your SQL buffer."
   (interactive)
+
+  ;; Insert references to loaded products into the help buffer string
+  (let ((doc (documentation 'sql-help t))
+	changedp)
+    (setq changedp nil)
+
+    ;; Insert FREE software list
+    (when (string-match "^\\(\\s-*\\)[\\\\][\\\\]FREE\\s-*\n" doc 0)
+      (setq doc (replace-match (sql-help-list-products (match-string 1 doc) t)
+			       t t doc 0)
+	    changedp t))
+
+    ;; Insert non-FREE software list
+    (when (string-match "^\\(\\s-*\\)[\\\\][\\\\]NONFREE\\s-*\n" doc 0)
+      (setq doc (replace-match (sql-help-list-products (match-string 1 doc) nil)
+			       t t doc 0)
+	    changedp t))
+
+    ;; If we changed the help text, save the change so that the help
+    ;; sub-system will see it
+    (when changedp
+      (put 'sql-help 'function-documentation doc)))
+
+  ;; Call help on this function
   (describe-function 'sql-help))
 
 (defun sql-read-passwd (prompt &optional default)
@@ -1844,12 +2296,13 @@
 `sql-server-history' and `database-history'.  Passwords are not stored
 in a history.
 
-Parameter WHAT is a list of the arguments passed to this function.
-The function asks for the username if WHAT contains symbol `user', for
-the password if it contains symbol `password', for the server if it
-contains symbol `server', and for the database if it contains symbol
-`database'.  The members of WHAT are processed in the order in which
-they are provided.
+Parameter WHAT is a list of tokens passed as arguments in the
+function call.  The function asks for the username if WHAT
+contains the symbol `user', for the password if it contains the
+symbol `password', for the server if it contains the symbol
+`server', and for the database if it contains the symbol
+`database'.  The members of WHAT are processed in the order in
+which they are provided.
 
 In order to ask the user for username, password and database, call the
 function like this: (sql-get-login 'user 'password 'database)."
@@ -1859,22 +2312,27 @@
      ((eq (car what) 'user)		; user
       (setq sql-user
 	    (read-from-minibuffer "User: " sql-user nil nil
-				  sql-user-history)))
+				  'sql-user-history)))
      ((eq (car what) 'password)		; password
       (setq sql-password
 	    (sql-read-passwd "Password: " sql-password)))
+
      ((eq (car what) 'server)		; server
       (setq sql-server
 	    (read-from-minibuffer "Server: " sql-server nil nil
-				  sql-server-history)))
+				  'sql-server-history)))
+     ((eq (car what) 'port)		; port
+      (setq sql-port
+	    (read-from-minibuffer "Port: " sql-port nil nil
+				  'sql-port-history)))
      ((eq (car what) 'database)		; database
       (setq sql-database
 	    (read-from-minibuffer "Database: " sql-database nil nil
-				  sql-database-history))))
+				  'sql-database-history))))
     (setq what (cdr what))))
 
 (defun sql-find-sqli-buffer ()
-  "Return the current default SQLi buffer or nil.
+  "Returns the current default SQLi buffer or nil.
 In order to qualify, the SQLi buffer must be alive,
 be in `sql-interactive-mode' and have a process."
   (let ((default-buffer (default-value 'sql-buffer)))
@@ -1958,7 +2416,7 @@
       (message "Current SQLi buffer is %s." (buffer-name sql-buffer)))))
 
 (defun sql-make-alternate-buffer-name ()
-  "Return a string that can be used to rename a SQLi buffer.
+  "Returns a string that can be used to rename a SQLi buffer.
 
 This is used to set `sql-alternate-buffer-name' within
 `sql-interactive-mode'."
@@ -1974,7 +2432,7 @@
 	    sql-database)))
 
 (defun sql-rename-buffer ()
-  "Renames a SQLi buffer."
+  "Rename a SQLi buffer."
   (interactive)
   (rename-buffer (format "*SQL: %s*" sql-alternate-buffer-name) t))
 
@@ -1984,7 +2442,7 @@
   (interactive)
   (let ((column))
     (save-excursion
-      (setq column (buffer-substring
+      (setq column (buffer-substring-no-properties
 		  (progn (forward-char 1) (backward-sexp 1) (point))
 		  (progn (forward-sexp 1) (point))))
       (goto-char (point-max))
@@ -2007,69 +2465,98 @@
       (insert column)
       (message "%s" column))))
 
-;; On NT, SQL*Plus for Oracle turns on full buffering for stdout if it
-;; is not attached to a character device; therefore placeholder
+;; On Windows, SQL*Plus for Oracle turns on full buffering for stdout
+;; if it is not attached to a character device; therefore placeholder
 ;; replacement by SQL*Plus is fully buffered.  The workaround lets
 ;; Emacs query for the placeholders.
 
 (defvar sql-placeholder-history nil
   "History of placeholder values used.")
 
-(defun sql-query-placeholders-and-send (proc string)
-  "Send to PROC input STRING, maybe replacing placeholders.
-Placeholders are words starting with and ampersand like &this.
-This function is used for `comint-input-sender' if using `sql-oracle' on NT."
-  (while (string-match "&\\(\\sw+\\)" string)
-    (setq string (replace-match
-		  (read-from-minibuffer
-		   (format "Enter value for %s: " (match-string 1 string))
-		   nil nil nil sql-placeholder-history)
-		  t t string)))
-  (comint-send-string proc string)
-  (if comint-input-sender-no-newline
-      (if (not (string-equal string ""))
-	  (process-send-eof))
-    (comint-send-string proc "\n")))
+(defun sql-placeholders-filter (string)
+  "Replace placeholders in STRING.
+Placeholders are words starting with and ampersand like &this."
+
+  (when sql-oracle-scan-on
+    (while (string-match "&\\(\\sw+\\)" string)
+      (setq string (replace-match
+		    (read-from-minibuffer
+		     (format "Enter value for %s: " (match-string 1 string))
+		     nil nil nil 'sql-placeholder-history)
+		    t t string))))
+  string)
 
 ;; Using DB2 interactively, newlines must be escaped with " \".
 ;; The space before the backslash is relevant.
-(defun sql-escape-newlines-and-send (proc string)
-  "Send to PROC input STRING, escaping newlines if necessary.
+(defun sql-escape-newlines-filter (string)
+  "Escapes 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)
       (setq mb (match-beginning 0)
-	    me (match-end 0))
-      (if (and (> mb 1)
-	       (string-equal " \\" (substring string (- mb 2) mb)))
-	  (setq result (concat result (substring string start me)))
-	(setq result (concat result (substring string start mb) " \\\n")))
-      (setq start me))
-    (setq result (concat result (substring string start)))
-    (comint-send-string proc result)
-    (if comint-input-sender-no-newline
-	(if (not (string-equal string ""))
-	    (process-send-eof))
-      (comint-send-string proc "\n"))))
+	    me (match-end 0)
+	    result (concat result
+			   (substring string start mb)
+			   (if (and (> mb 1)
+				    (string-equal " \\" (substring string (- mb 2) mb)))
+			       "" " \\\n"))
+	    start me))
+    (concat result (substring string start))))
 
 
 
+;;; Input sender for SQLi buffers
+
+(defun sql-input-sender (proc string)
+  "Sends STRING to PROC after applying filters."
+
+  (let* ((product (with-current-buffer (process-buffer proc) sql-product))
+	 (filter  (sql-get-product-feature product :input-filter)))
+
+    ;; Send the string
+    (comint-simple-send proc (if filter (funcall filter string) string))))
+
 ;;; Sending the region to the SQLi buffer.
 
+(defun sql-send-string (str)
+  "Send the string STR to the SQL process."
+  (interactive "sSQL Text: ")
+
+  (let (comint-input-sender-no-newline proc)
+    (if (buffer-live-p sql-buffer)
+	(progn
+	  ;; Ignore the hoping around...
+	  (save-excursion
+	    ;; Get the process
+	    (setq proc (get-buffer-process sql-buffer))
+
+	    ;; Set product context
+	    (with-current-buffer sql-buffer
+	      ;; Send the string
+	      (sql-input-sender proc str)
+
+	      ;; Send a newline if there wasn't one on the end of the string
+	      (unless (string-equal "\n" (substring str (1- (length str))))
+		(comint-send-string proc "\n"))
+
+	      ;; Send a command terminator if we must
+	      (if sql-send-terminator
+		  (sql-send-magic-terminator sql-buffer str sql-send-terminator))
+
+	      (message "Sent string to buffer %s." (buffer-name sql-buffer))))
+
+	  ;; Display the sql buffer
+	  (if sql-pop-to-buffer-after-send-region
+	      (pop-to-buffer sql-buffer)
+	    (display-buffer sql-buffer)))
+
+    ;; We don't have no stinkin' sql
+    (message "No SQL process started."))))
+
 (defun sql-send-region (start end)
   "Send a region to the SQL process."
   (interactive "r")
-  (if (buffer-live-p sql-buffer)
-      (save-excursion
-	(comint-send-region sql-buffer start end)
-	(if (string-match "\n$" (buffer-substring start end))
-	    ()
-	  (comint-send-string sql-buffer "\n"))
-	(message "Sent string to buffer %s." (buffer-name sql-buffer))
-	(if sql-pop-to-buffer-after-send-region
-	    (pop-to-buffer sql-buffer)
-	  (display-buffer sql-buffer)))
-    (message "No SQL process started.")))
+  (sql-send-string (buffer-substring-no-properties start end)))
 
 (defun sql-send-paragraph ()
   "Send the current paragraph to the SQL process."
@@ -2087,29 +2574,46 @@
   (interactive)
   (sql-send-region (point-min) (point-max)))
 
-(defun sql-send-string (str)
-  "Send a string to the SQL process."
-  (interactive "sSQL Text: ")
-  (if (buffer-live-p sql-buffer)
-      (save-excursion
-        (comint-send-string sql-buffer str)
-        (comint-send-string sql-buffer "\n")
-        (message "Sent string to buffer %s." (buffer-name sql-buffer))
-        (if sql-pop-to-buffer-after-send-region
-            (pop-to-buffer sql-buffer)
-          (display-buffer sql-buffer)))
-    (message "No SQL process started.")))
+(defun sql-send-magic-terminator (buf str terminator)
+  "Sends 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)
+	(setq terminator (sql-get-product-feature sql-product :terminator)))
+
+    ;; If there is no terminator specified, use default ";"
+    (unless terminator
+      (setq terminator ";"))
+
+    ;; Parse the setting into the pattern and the terminator string
+    (cond ((stringp terminator)
+	   (setq pat (regexp-quote terminator)
+		 term terminator))
+	  ((consp terminator)
+	   (setq pat (car terminator)
+		 term (cdr terminator)))
+	  (t
+	   nil))
+
+    ;; Check to see if the pattern is present in the str already sent
+    (unless (and pat term
+		 (string-match (concat pat "\n?\\'") str))
+      (comint-send-string buf (concat term "\n")))))
+
+(defun sql-remove-tabs-filter (str)
+  "Replace tab characters with spaces."
+  (replace-regexp-in-string "\t" " " str nil t))
 
 (defun sql-toggle-pop-to-buffer-after-send-region (&optional value)
   "Toggle `sql-pop-to-buffer-after-send-region'.
 
 If given the optional parameter VALUE, sets
-sql-toggle-pop-to-buffer-after-send-region to VALUE."
+`sql-toggle-pop-to-buffer-after-send-region' to VALUE."
   (interactive "P")
   (if value
       (setq sql-pop-to-buffer-after-send-region value)
     (setq sql-pop-to-buffer-after-send-region
-	  (null sql-pop-to-buffer-after-send-region ))))
+	  (null sql-pop-to-buffer-after-send-region))))
 
 
 
@@ -2187,8 +2691,8 @@
   "Major mode to use a SQL interpreter interactively.
 
 Do not call this function by yourself.  The environment must be
-initialized by an entry function specific for the SQL interpreter.  See
-`sql-help' for a list of available entry functions.
+initialized by an entry function specific for the SQL interpreter.
+See `sql-help' for a list of available entry functions.
 
 \\[comint-send-input] after the end of the process' output sends the
 text from the end of process to the end of the current line.
@@ -2252,24 +2756,29 @@
 \(setq comint-output-filter-functions
        \(function (lambda (STR) (comint-show-output))))"
   (delay-mode-hooks (comint-mode))
+
   ;; Get the `sql-product' for this interactive session.
   (set (make-local-variable 'sql-product)
        (or sql-interactive-product
 	   sql-product))
+
   ;; Setup the mode.
   (setq major-mode 'sql-interactive-mode)
-  (setq mode-name (concat "SQLi[" (prin1-to-string sql-product) "]"))
+  (setq mode-name (concat "SQLi[" (or (sql-get-product-feature sql-product :name)
+				      (symbol-name sql-product)) "]"))
   (use-local-map sql-interactive-mode-map)
   (if sql-interactive-mode-menu
       (easy-menu-add sql-interactive-mode-menu)) ; XEmacs
   (set-syntax-table sql-mode-syntax-table)
   (make-local-variable 'sql-mode-font-lock-keywords)
   (make-local-variable 'font-lock-defaults)
+
   ;; Note that making KEYWORDS-ONLY nil will cause havoc if you try
   ;; SELECT 'x' FROM DUAL with SQL*Plus, because the title of the column
   ;; will have just one quote.  Therefore syntactic hilighting is
   ;; disabled for interactive buffers.  No imenu support.
   (sql-product-font-lock t nil)
+
   ;; Enable commenting and uncommenting of the region.
   (make-local-variable 'comment-start)
   (setq comment-start "--")
@@ -2284,16 +2793,19 @@
   (setq sql-alternate-buffer-name (sql-make-alternate-buffer-name))
   ;; User stuff.  Initialize before the hook.
   (set (make-local-variable 'sql-prompt-regexp)
-       (sql-product-feature :sqli-prompt-regexp))
+       (sql-get-product-feature sql-product :prompt-regexp))
   (set (make-local-variable 'sql-prompt-length)
-       (sql-product-feature :sqli-prompt-length))
+       (sql-get-product-feature sql-product :prompt-length))
   (make-local-variable 'sql-input-ring-separator)
   (make-local-variable 'sql-input-ring-file-name)
-  ;; Run hook.
+  (setq comint-process-echoes t)
+  ;; Run the mode hook (along with comint's hooks).
   (run-mode-hooks 'sql-interactive-mode-hook)
   ;; Set comint based on user overrides.
   (setq comint-prompt-regexp sql-prompt-regexp)
   (setq left-margin sql-prompt-length)
+  ;; Install input sender
+  (set (make-local-variable 'comint-input-sender) 'sql-input-sender)
   ;; People wanting a different history file for each
   ;; buffer/process/client/whatever can change separator and file-name
   ;; on the sql-interactive-mode-hook.
@@ -2323,29 +2835,82 @@
 
 ;;;###autoload
 (defun sql-product-interactive (&optional product)
-  "Run product interpreter as an inferior process.
+  "Run PRODUCT interpreter 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 `*SQL*'.
 
 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)"
-  (interactive)
-  (setq product (or product sql-product))
-  (when (sql-product-feature :sqli-connect product)
-    (if (comint-check-proc "*SQL*")
-	(pop-to-buffer "*SQL*")
-      ;; Get credentials.
-      (apply 'sql-get-login (sql-product-feature :sqli-login product))
-      ;; Connect to database.
-      (message "Login...")
-      (funcall (sql-product-feature :sqli-connect product))
-      ;; Set SQLi mode.
-      (setq sql-interactive-product product)
-      (setq sql-buffer (current-buffer))
-      (sql-interactive-mode)
-      ;; All done.
-      (message "Login...done")
-      (pop-to-buffer sql-buffer))))
+  (interactive "P")
+
+  (setq product
+        (cond
+         ((equal product '(4))          ; Universal arg, prompt for product
+          (intern (completing-read "SQL product: "
+                                   (mapcar (lambda (info) (symbol-name (car info)))
+                                           sql-product-alist)
+                                   nil 'require-match
+                                   (or (and sql-product (symbol-name sql-product)) "ansi"))))
+         ((symbolp product) product)    ; Product specified
+         (t sql-product)))              ; Default to sql-product
+
+  (when (sql-get-product-feature product :sqli-connect-func)
+    (if (and sql-buffer
+             (buffer-live-p sql-buffer)
+	     (comint-check-proc sql-buffer))
+	(pop-to-buffer sql-buffer)
+
+      ;; Is the current buffer in sql-mode and
+      ;; there is a buffer local setting of sql-buffer
+      (let* ((start-buffer
+	      (and (derived-mode-p 'sql-mode)
+		   (current-buffer)))
+	     (start-sql-buffer
+	      (and start-buffer
+		   (let (found)
+		     (dolist (var (buffer-local-variables))
+		       (and (consp var)
+			    (eq (car var) 'sql-buffer)
+			    (buffer-live-p (cdr var))
+			    (get-buffer-process (cdr var))
+			    (setq found (cdr var))))
+		     found)))
+	     new-sqli-buffer)
+
+	;; Get credentials.
+	(apply 'sql-get-login (sql-get-product-feature product :sqli-login))
+
+	;; Connect to database.
+	(message "Login...")
+	(funcall (sql-get-product-feature product :sqli-connect-func)
+                 product
+                 (sql-get-product-feature product :sqli-options))
+
+	;; Set SQLi mode.
+	(setq sql-interactive-product product
+	      new-sqli-buffer (current-buffer)
+	      sql-buffer new-sqli-buffer)
+	(sql-interactive-mode)
+
+	;; Set `sql-buffer' in the start buffer
+	(when (and start-buffer (not start-sql-buffer))
+	  (with-current-buffer start-buffer
+	    (setq sql-buffer new-sqli-buffer)))
+
+	;; All done.
+	(message "Login...done")
+	(pop-to-buffer sql-buffer)))))
+
+(defun sql-connect (product params)
+  "Set up a comint buffer to connect to the SQL processor.
+
+PRODUCT is the SQL product.  PARAMS is a list of strings which are
+passed as command line arguments."
+  (let ((program (sql-get-product-feature product :sqli-program)))
+    (set-buffer
+     (if params
+         (apply 'make-comint "SQL" program nil params)
+       (make-comint "SQL" program nil)))))
 
 ;;;###autoload
 (defun sql-oracle ()
@@ -2360,7 +2925,7 @@
 defaults, if set.  Additional command line parameters can be stored in
 the list `sql-oracle-options'.
 
-The buffer is put in sql-interactive-mode, giving commands for sending
+The buffer is put in SQL interactive mode, giving commands for sending
 input.  See `sql-interactive-mode'.
 
 To specify a coding system for converting non-ASCII characters
@@ -2374,27 +2939,23 @@
   (interactive)
   (sql-product-interactive 'oracle))
 
-(defun sql-connect-oracle ()
-  "Create comint buffer and connect to Oracle using the login
-parameters and command options."
+(defun sql-connect-oracle (product options)
+  "Create comint buffer and connect to Oracle."
   ;; Produce user/password@database construct.  Password without user
   ;; is meaningless; database without user/password is meaningless,
   ;; because "@param" will ask sqlplus to interpret the script
   ;; "param".
-  (let ((parameter
-         (if (not (string= "" sql-user))
-             (if (not (string= "" sql-password))
-                 (concat sql-user "/" sql-password)
-               sql-user))))
+  (let ((parameter nil))
+    (if (not (string= "" sql-user))
+	(if (not (string= "" sql-password))
+	    (setq parameter (concat sql-user "/" sql-password))
+	  (setq parameter sql-user)))
     (if (and parameter (not (string= "" sql-database)))
 	(setq parameter (concat parameter "@" sql-database)))
-    (setq parameter (if parameter
-                        (nconc (list parameter) sql-oracle-options)
-                      sql-oracle-options))
-    (set-buffer (apply 'make-comint "SQL" sql-oracle-program nil parameter))
-    ;; SQL*Plus is buffered on WindowsNT; this handles &placeholders.
-    (if (eq window-system 'w32)
-	(setq comint-input-sender 'sql-query-placeholders-and-send))))
+    (if parameter
+	(setq parameter (nconc (list parameter) options))
+      (setq parameter options))
+    (sql-connect product parameter)))
 
 
 
@@ -2411,7 +2972,7 @@
 `sql-database' as defaults, if set.  Additional command line parameters
 can be stored in the list `sql-sybase-options'.
 
-The buffer is put in sql-interactive-mode, giving commands for sending
+The buffer is put in SQL interactive mode, giving commands for sending
 input.  See `sql-interactive-mode'.
 
 To specify a coding system for converting non-ASCII characters
@@ -2425,12 +2986,11 @@
   (interactive)
   (sql-product-interactive 'sybase))
 
-(defun sql-connect-sybase ()
-  "Create comint buffer and connect to Sybase using the login
-parameters and command options."
+(defun sql-connect-sybase (product options)
+  "Create comint buffer and connect to Sybase."
   ;; Put all parameters to the program (if defined) in a list and call
   ;; make-comint.
-  (let ((params sql-sybase-options))
+  (let ((params options))
     (if (not (string= "" sql-server))
 	(setq params (append (list "-S" sql-server) params)))
     (if (not (string= "" sql-database))
@@ -2439,8 +2999,7 @@
 	(setq params (append (list "-P" sql-password) params)))
     (if (not (string= "" sql-user))
 	(setq params (append (list "-U" sql-user) params)))
-    (set-buffer (apply 'make-comint "SQL" sql-sybase-program
-		       nil params))))
+    (sql-connect product params)))
 
 
 
@@ -2455,7 +3014,7 @@
 Interpreter used comes from variable `sql-informix-program'.  Login uses
 the variable `sql-database' as default, if set.
 
-The buffer is put in sql-interactive-mode, giving commands for sending
+The buffer is put in SQL interactive mode, giving commands for sending
 input.  See `sql-interactive-mode'.
 
 To specify a coding system for converting non-ASCII characters
@@ -2469,13 +3028,15 @@
   (interactive)
   (sql-product-interactive 'informix))
 
-(defun sql-connect-informix ()
-  "Create comint buffer and connect to Informix using the login
-parameters and command options."
+(defun sql-connect-informix (product options)
+  "Create comint buffer and connect to Informix."
   ;; username and password are ignored.
-  (set-buffer (if (string= "" sql-database)
-                  (make-comint "SQL" sql-informix-program nil)
-                (make-comint "SQL" sql-informix-program nil sql-database "-"))))
+  (let ((db (if (string= "" sql-database)
+		"-"
+	      (if (string= "" sql-server)
+		  sql-database
+		(concat sql-database "@" sql-server)))))
+    (sql-connect product (append `(,db "-") options))))
 
 
 
@@ -2494,7 +3055,7 @@
 `sql-server' as defaults, if set.  Additional command line parameters
 can be stored in the list `sql-sqlite-options'.
 
-The buffer is put in sql-interactive-mode, giving commands for sending
+The buffer is put in SQL interactive mode, giving commands for sending
 input.  See `sql-interactive-mode'.
 
 To specify a coding system for converting non-ASCII characters
@@ -2508,18 +3069,15 @@
   (interactive)
   (sql-product-interactive 'sqlite))
 
-(defun sql-connect-sqlite ()
-  "Create comint buffer and connect to SQLite using the login
-parameters and command options."
+(defun sql-connect-sqlite (product options)
+  "Create comint buffer and connect to SQLite."
   ;; Put all parameters to the program (if defined) in a list and call
   ;; make-comint.
   (let ((params))
     (if (not (string= "" sql-database))
 	(setq params (append (list sql-database) params)))
-    (if (not (null sql-sqlite-options))
-	(setq params (append sql-sqlite-options params)))
-    (set-buffer (apply 'make-comint "SQL" sql-sqlite-program
-		       nil params))))
+    (setq params (append options params))
+    (sql-connect product params)))
 
 
 
@@ -2538,7 +3096,7 @@
 `sql-server' as defaults, if set.  Additional command line parameters
 can be stored in the list `sql-mysql-options'.
 
-The buffer is put in sql-interactive-mode, giving commands for sending
+The buffer is put in SQL interactive mode, giving commands for sending
 input.  See `sql-interactive-mode'.
 
 To specify a coding system for converting non-ASCII characters
@@ -2552,9 +3110,8 @@
   (interactive)
   (sql-product-interactive 'mysql))
 
-(defun sql-connect-mysql ()
-  "Create comint buffer and connect to MySQL using the login
-parameters and command options."
+(defun sql-connect-mysql (product options)
+  "Create comint buffer and connect to MySQL."
   ;; Put all parameters to the program (if defined) in a list and call
   ;; make-comint.
   (let ((params))
@@ -2562,14 +3119,14 @@
 	(setq params (append (list sql-database) params)))
     (if (not (string= "" sql-server))
 	(setq params (append (list (concat "--host=" sql-server)) params)))
+    (if (not (and sql-port (numberp sql-port)))
+	(setq params (append (list (concat "--port=" (number-to-string sql-port))) params)))
     (if (not (string= "" sql-password))
 	(setq params (append (list (concat "--password=" sql-password)) params)))
     (if (not (string= "" sql-user))
 	(setq params (append (list (concat "--user=" sql-user)) params)))
-    (if (not (null sql-mysql-options))
-	(setq params (append sql-mysql-options params)))
-    (set-buffer (apply 'make-comint "SQL" sql-mysql-program
-		       nil params))))
+    (setq params (append options params))
+    (sql-connect product params)))
 
 
 
@@ -2585,7 +3142,7 @@
 the variables `sql-user', `sql-password', and `sql-server' as
 defaults, if set.
 
-The buffer is put in sql-interactive-mode, giving commands for sending
+The buffer is put in SQL interactive mode, giving commands for sending
 input.  See `sql-interactive-mode'.
 
 To specify a coding system for converting non-ASCII characters
@@ -2599,20 +3156,18 @@
   (interactive)
   (sql-product-interactive 'solid))
 
-(defun sql-connect-solid ()
-  "Create comint buffer and connect to Solid using the login
-parameters and command options."
+(defun sql-connect-solid (product options)
+  "Create comint buffer and connect to Solid."
   ;; Put all parameters to the program (if defined) in a list and call
   ;; make-comint.
-  (let ((params))
+  (let ((params options))
     ;; It only makes sense if both username and password are there.
     (if (not (or (string= "" sql-user)
 		 (string= "" sql-password)))
 	(setq params (append (list sql-user sql-password) params)))
     (if (not (string= "" sql-server))
 	(setq params (append (list sql-server) params)))
-    (set-buffer (apply 'make-comint "SQL" sql-solid-program
-		       nil params))))
+    (sql-connect product params)))
 
 
 
@@ -2627,7 +3182,7 @@
 Interpreter used comes from variable `sql-ingres-program'.  Login uses
 the variable `sql-database' as default, if set.
 
-The buffer is put in sql-interactive-mode, giving commands for sending
+The buffer is put in SQL interactive mode, giving commands for sending
 input.  See `sql-interactive-mode'.
 
 To specify a coding system for converting non-ASCII characters
@@ -2641,13 +3196,14 @@
   (interactive)
   (sql-product-interactive 'ingres))
 
-(defun sql-connect-ingres ()
-  "Create comint buffer and connect to Ingres using the login
-parameters and command options."
+(defun sql-connect-ingres (product options)
+  "Create comint buffer and connect to Ingres."
   ;; username and password are ignored.
-  (set-buffer (if (string= "" sql-database)
-                  (make-comint "SQL" sql-ingres-program nil)
-                (make-comint "SQL" sql-ingres-program nil sql-database))))
+  (sql-connect product
+               (append (if (string= "" sql-database)
+                           nil
+                         (list sql-database))
+                       options)))
 
 
 
@@ -2664,7 +3220,7 @@
 as defaults, if set.  Additional command line parameters can be stored
 in the list `sql-ms-options'.
 
-The buffer is put in sql-interactive-mode, giving commands for sending
+The buffer is put in SQL interactive mode, giving commands for sending
 input.  See `sql-interactive-mode'.
 
 To specify a coding system for converting non-ASCII characters
@@ -2678,12 +3234,11 @@
   (interactive)
   (sql-product-interactive 'ms))
 
-(defun sql-connect-ms ()
-  "Create comint buffer and connect to Microsoft using the login
-parameters and command options."
+(defun sql-connect-ms (product options)
+  "Create comint buffer and connect to Microsoft SQL Server."
   ;; Put all parameters to the program (if defined) in a list and call
   ;; make-comint.
-  (let ((params sql-ms-options))
+  (let ((params options))
     (if (not (string= "" sql-server))
         (setq params (append (list "-S" sql-server) params)))
     (if (not (string= "" sql-database))
@@ -2699,8 +3254,7 @@
 	;; If -P is passed to ISQL as the last argument without a
 	;; password, it's considered null.
 	(setq params (append params (list "-P")))))
-    (set-buffer (apply 'make-comint "SQL" sql-ms-program
-		       nil params))))
+    (sql-connect product params)))
 
 
 
@@ -2717,7 +3271,7 @@
 Additional command line parameters can be stored in the list
 `sql-postgres-options'.
 
-The buffer is put in sql-interactive-mode, giving commands for sending
+The buffer is put in SQL interactive mode, giving commands for sending
 input.  See `sql-interactive-mode'.
 
 To specify a coding system for converting non-ASCII characters
@@ -2736,23 +3290,21 @@
   (interactive)
   (sql-product-interactive 'postgres))
 
-(defun sql-connect-postgres ()
-  "Create comint buffer and connect to Postgres using the login
-parameters and command options."
+(defun sql-connect-postgres (product options)
+  "Create comint buffer and connect to Postgres."
   ;; username and password are ignored.  Mark Stosberg suggest to add
   ;; the database at the end.  Jason Beegan suggest using --pset and
   ;; pager=off instead of \\o|cat.  The later was the solution by
   ;; Gregor Zych.  Jason's suggestion is the default value for
   ;; sql-postgres-options.
-  (let ((params sql-postgres-options))
+  (let ((params options))
     (if (not (string= "" sql-database))
 	(setq params (append params (list sql-database))))
     (if (not (string= "" sql-server))
 	(setq params (append (list "-h" sql-server) params)))
     (if (not (string= "" sql-user))
 	(setq params (append (list "-U" sql-user) params)))
-    (set-buffer (apply 'make-comint "SQL" sql-postgres-program
-		       nil params))))
+    (sql-connect product params)))
 
 
 
@@ -2768,7 +3320,7 @@
 uses the variables `sql-user', `sql-password', and `sql-database' as
 defaults, if set.
 
-The buffer is put in sql-interactive-mode, giving commands for sending
+The buffer is put in SQL interactive mode, giving commands for sending
 input.  See `sql-interactive-mode'.
 
 To specify a coding system for converting non-ASCII characters
@@ -2782,20 +3334,18 @@
   (interactive)
   (sql-product-interactive 'interbase))
 
-(defun sql-connect-interbase ()
-  "Create comint buffer and connect to Interbase using the login
-parameters and command options."
+(defun sql-connect-interbase (product options)
+  "Create comint buffer and connect to Interbase."
   ;; Put all parameters to the program (if defined) in a list and call
   ;; make-comint.
-  (let ((params sql-interbase-options))
+  (let ((params options))
     (if (not (string= "" sql-user))
 	(setq params (append (list "-u" sql-user) params)))
     (if (not (string= "" sql-password))
 	(setq params (append (list "-p" sql-password) params)))
     (if (not (string= "" sql-database))
         (setq params (cons sql-database params))) ; add to the front!
-    (set-buffer (apply 'make-comint "SQL" sql-interbase-program
-		       nil params))))
+    (sql-connect product params)))
 
 
 
@@ -2810,7 +3360,7 @@
 Interpreter used comes from variable `sql-db2-program'.  There is not
 automatic login.
 
-The buffer is put in sql-interactive-mode, giving commands for sending
+The buffer is put in SQL interactive mode, giving commands for sending
 input.  See `sql-interactive-mode'.
 
 If you use \\[sql-accumulate-and-indent] to send multiline commands to
@@ -2829,15 +3379,14 @@
   (interactive)
   (sql-product-interactive 'db2))
 
-(defun sql-connect-db2 ()
-  "Create comint buffer and connect to DB2 using the login
-parameters and command options."
+(defun sql-connect-db2 (product options)
+  "Create comint buffer and connect to DB2."
   ;; Put all parameters to the program (if defined) in a list and call
   ;; make-comint.
-  (set-buffer (apply 'make-comint "SQL" sql-db2-program
-		     nil sql-db2-options))
-  ;; Properly escape newlines when DB2 is interactive.
-  (setq comint-input-sender 'sql-escape-newlines-and-send))
+  (sql-connect product options)
+)
+;;   ;; Properly escape newlines when DB2 is interactive.
+;;   (setq comint-input-sender 'sql-escape-newlines-and-send))
 
 ;;;###autoload
 (defun sql-linter ()
@@ -2850,7 +3399,7 @@
 Interpreter used comes from variable `sql-linter-program' - usually `inl'.
 Login uses the variables `sql-user', `sql-password', `sql-database' and
 `sql-server' as defaults, if set.  Additional command line parameters
-can be stored in the list `sql-linter-options'. Run inl -h to get help on
+can be stored in the list `sql-linter-options'.  Run inl -h to get help on
 parameters.
 
 `sql-database' is used to set the LINTER_MBX environment variable for
@@ -2859,19 +3408,20 @@
 for this to work).  If `sql-password' is an empty string, inl will use
 an empty password.
 
-The buffer is put in sql-interactive-mode, giving commands for sending
+The buffer is put in SQL interactive mode, giving commands for sending
 input.  See `sql-interactive-mode'.
 
 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)"
   (interactive)
   (sql-product-interactive 'linter))
 
-(defun sql-connect-linter ()
-  "Create comint buffer and connect to Linter using the login
-parameters and command options."
+(defun sql-connect-linter (product options)
+  "Create comint buffer and connect to Linter."
   ;; Put all parameters to the program (if defined) in a list and call
   ;; make-comint.
-  (let ((params sql-linter-options) (login nil) (old-mbx (getenv "LINTER_MBX")))
+  (let ((params options)
+        (login nil)
+        (old-mbx (getenv "LINTER_MBX")))
     (if (not (string= "" sql-user))
 	(setq login (concat sql-user "/" sql-password)))
     (setq params (append (list "-u" login) params))
@@ -2880,8 +3430,7 @@
     (if (string= "" sql-database)
 	(setenv "LINTER_MBX" nil)
       (setenv "LINTER_MBX" sql-database))
-    (set-buffer (apply 'make-comint "SQL" sql-linter-program nil
-		       params))
+    (sql-connect product params)
     (setenv "LINTER_MBX" old-mbx)))
 
 
@@ -2890,3 +3439,4 @@
 
 ;; arch-tag: 7e1fa1c4-9ca2-402e-87d2-83a5eccb7ac3
 ;;; sql.el ends here
+
--- a/lisp/sha1.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/sha1.el	Mon May 10 12:37:03 2010 +0900
@@ -95,7 +95,7 @@
       (setq prog sha1-program
 	    args nil))
     (with-temp-buffer
-      (set-buffer-multibyte nil)
+      (unless (featurep 'xemacs) (set-buffer-multibyte nil))
       (insert string)
       (apply (function call-process-region)
 	     (point-min) (point-max)
--- a/lisp/simple.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/simple.el	Mon May 10 12:37:03 2010 +0900
@@ -5306,6 +5306,26 @@
 otherwise turn it off.  When Size Indication mode is enabled, the
 size of the accessible part of the buffer appears in the mode line."
   :global t :group 'mode-line)
+
+(define-minor-mode auto-save-mode
+  "Toggle auto-saving of contents of current buffer.
+With prefix argument ARG, turn auto-saving on if positive, else off."
+  :variable ((and buffer-auto-save-file-name
+                  ;; If auto-save is off because buffer has shrunk,
+                  ;; then toggling should turn it on.
+                  (>= buffer-saved-size 0))
+             . (lambda (val)
+                 (setq buffer-auto-save-file-name
+                       (cond
+                        ((null val) nil)
+                        ((and buffer-file-name auto-save-visited-file-name
+                              (not buffer-read-only))
+                         buffer-file-name)
+                        (t (make-auto-save-file-name))))))
+  ;; If -1 was stored here, to temporarily turn off saving,
+  ;; turn it back on.
+  (and (< buffer-saved-size 0)
+       (setq buffer-saved-size 0)))
 
 (defgroup paren-blinking nil
   "Blinking matching of parens and expressions."
--- a/lisp/textmodes/css-mode.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/textmodes/css-mode.el	Mon May 10 12:37:03 2010 +0900
@@ -212,6 +212,8 @@
 (defconst css-nmchar-re (concat "\\(?:[-[:alnum:]]\\|" css-escapes-re "\\)"))
 (defconst css-nmstart-re (concat "\\(?:[[:alpha:]]\\|" css-escapes-re "\\)"))
 (defconst css-ident-re (concat css-nmstart-re css-nmchar-re "*"))
+(defconst css-proprietary-nmstart-re ;; Vendor-specific properties.
+  "[-_]\\(?:ms\\|moz\\|o\\|webkit\\|khtml\\)-")
 (defconst css-name-re (concat css-nmchar-re "+"))
 
 (defface css-selector '((t :inherit font-lock-function-name-face))
@@ -220,6 +222,8 @@
 (defface css-property '((t :inherit font-lock-variable-name-face))
   "Face to use for properties."
   :group 'css)
+(defface css-proprietary-property '((t :inherit (css-property italic)))
+  "Face to use for vendor-specific properties.")
 
 (defvar css-font-lock-keywords
   `(("!\\s-*important" . font-lock-builtin-face)
@@ -251,8 +255,11 @@
                      ;; No face.
                      nil)))
     ;; Properties.  Again, we don't limit ourselves to css-property-ids.
-    (,(concat "\\(?:[{;]\\|^\\)[ \t]*\\(" css-ident-re "\\)\\s-*:")
-     (1 'css-property))))
+    (,(concat "\\(?:[{;]\\|^\\)[ \t]*\\("
+              "\\(?:\\(" css-proprietary-nmstart-re "\\)\\|"
+              css-nmstart-re "\\)" css-nmchar-re "*"
+              "\\)\\s-*:")
+     (1 (if (match-end 2) 'css-proprietary-property 'css-property)))))
 
 (defvar css-font-lock-defaults
   '(css-font-lock-keywords nil t))
--- a/lisp/textmodes/dns-mode.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/textmodes/dns-mode.el	Mon May 10 12:37:03 2010 +0900
@@ -151,6 +151,7 @@
   (easy-menu-add dns-mode-menu dns-mode-map))
 
 ;;;###autoload (defalias 'zone-mode 'dns-mode)
+;;;###autoload (add-to-list 'auto-mode-alist (purecopy '("\\.zone\\'" . zone-mode)))
 
 ;; Tools.
 
--- a/lisp/url/ChangeLog	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/url/ChangeLog	Mon May 10 12:37:03 2010 +0900
@@ -1,3 +1,7 @@
+2010-05-07  Chong Yidong  <cyd@stupidchicken.com>
+
+	* Version 23.2 released.
+
 2010-05-03  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* url-dired.el (url-dired-minor-mode): Use define-minor-mode.
@@ -62,8 +66,8 @@
 2009-09-12  Chong Yidong  <cyd@stupidchicken.com>
 
 	* url-methods.el (url-scheme--registering-proxy): New variable.
-	(url-scheme-register-proxy, url-scheme-get-property): Avoid
-	calling url-scheme-register-proxy in an infloop (Bug#4191).
+	(url-scheme-register-proxy, url-scheme-get-property):
+	Avoid calling url-scheme-register-proxy in an infloop (Bug#4191).
 
 2009-08-22  Glenn Morris  <rgm@gnu.org>
 
--- a/lisp/vc-hg.el	Thu May 06 09:50:39 2010 +0900
+++ b/lisp/vc-hg.el	Mon May 10 12:37:03 2010 +0900
@@ -168,12 +168,13 @@
                   (condition-case nil
                       ;; Ignore all errors.
 		      (let ((process-environment
-			     ;; Avoid localization of messages so we can parse the output.
-			     (append (list "TERM=dumb" "LANGUAGE=C" "HGRC=") process-environment)))
-
-		      (process-file
-                       "hg" nil t nil
-                       "status" "-A" (file-relative-name file)))
+			     ;; Avoid localization of messages so we
+			     ;; can parse the output.
+			     (append (list "TERM=dumb" "LANGUAGE=C" "HGRCPATH=")
+				     process-environment)))
+			(process-file
+			 "hg" nil t nil
+			 "status" "-A" (file-relative-name file)))
                     ;; Some problem happened.  E.g. We can't find an `hg'
                     ;; executable.
                     (error nil)))))))
@@ -197,7 +198,7 @@
       ((status nil)
        (default-directory (file-name-directory file))
        ;; Avoid localization of messages so we can parse the output.
-       (avoid-local-env (append (list "TERM=dumb" "LANGUAGE=C" "HGRC=")
+       (avoid-local-env (append (list "TERM=dumb" "LANGUAGE=C" "HGRCPATH=")
 				     process-environment))
        (out
         (with-output-to-string
@@ -209,7 +210,7 @@
 			;; Ignore all errors.
 			(process-file
 			 "hg" nil t nil
-			 "parent" "--template" "{rev}" (file-relative-name file)))
+			 "parents" "--template" "{rev}" (file-relative-name file)))
                     ;; Some problem happened.  E.g. We can't find an `hg'
                     ;; executable.
                     (error nil)))))))
--- a/lwlib/ChangeLog	Thu May 06 09:50:39 2010 +0900
+++ b/lwlib/ChangeLog	Mon May 10 12:37:03 2010 +0900
@@ -1,3 +1,16 @@
+2010-05-08  Jan Djärv  <jan.h.d@swipnet.se>
+
+	* xlwmenu.c (XlwMenuDestroy): Remove XtDestroyWidget on subwidgets
+	(Bug #6127).
+
+2010-05-07  Chong Yidong  <cyd@stupidchicken.com>
+
+	* Version 23.2 released.
+
+2010-05-06  Glenn Morris  <rgm@gnu.org>
+
+	* Makefile.in (CPP, LN_S, TOP, LN): Remove unused variables.
+
 2010-05-04  Glenn Morris  <rgm@gnu.org>
 
 	* Makefile.in (C_SWITCH_SYSTEM, C_SWITCH_MACHINE):
@@ -19,17 +32,16 @@
 	XlwMenuRedisplay.
 	(display_menu_item): Replace ws->window with ws->pixmap, remove
 	call to XftDrawRect.
-	(display_menu): Remove this and that argument.  Remove
-	just_compute_this_one_p. Fill pixmap at start and copy it to window
-	at end.
+	(display_menu): Remove this and that argument.
+	Remove just_compute_this_one_p. Fill pixmap at start and copy it to
+	window at end.
 	(expose_cb): New function.
 	(make_windows_if_needed): Replace XCreateWindow with XtCreatePopup.
-	Add eventhandler for expose to expose_cb.  Remove creation of
-	xft_draw.
+	Add eventhandler for expose to expose_cb.  Remove creation of xft_draw.
 	(create_pixmap_for_menu): New function.
 	(remap_menubar): Pop down menus that aren't the same as in old_stack.
-	Set width, heigh, x, y on widget with XtVaSetValues.  Call
-	create_pixmap_for_menu.
+	Set width, heigh, x, y on widget with XtVaSetValues.
+	Call create_pixmap_for_menu.
 	Replace XUnmapWindow with XtPopdown.
 	Remowe two last parameters to display_menu.
 	(map_event_to_widget_value, XlwMenuRedisplay, Key, Select)
--- a/lwlib/Makefile.in	Thu May 06 09:50:39 2010 +0900
+++ b/lwlib/Makefile.in	Mon May 10 12:37:03 2010 +0900
@@ -32,27 +32,21 @@
 
 CC=@CC@
 CFLAGS=@CFLAGS@
-CPP=@CPP@
 CPPFLAGS=@CPPFLAGS@
-LN_S=@LN_S@
 RANLIB=@RANLIB@
 # See below--@X_TOOLKIT_TYPE@ is used below.
 USE_X_TOOLKIT=@X_TOOLKIT_TYPE@
 
-              TOP = .
-
-               AR = ar cq
+AR = ar cq
+RM = rm -f
 
-               LN = ln -s
-               RM = rm -f
-
-     LUCID_OBJS = lwlib-Xlw.o xlwmenu.o lwlib-Xaw.o
-     MOTIF_OBJS = lwlib-Xm.o
+LUCID_OBJS = lwlib-Xlw.o xlwmenu.o lwlib-Xaw.o
+MOTIF_OBJS = lwlib-Xm.o
 
 TOOLKIT_DEFINES = 
-   TOOLKIT_OBJS = $(@X_TOOLKIT_TYPE@_OBJS)
+TOOLKIT_OBJS = $(@X_TOOLKIT_TYPE@_OBJS)
 
-           OBJS = lwlib.o $(TOOLKIT_OBJS) lwlib-utils.o
+OBJS = lwlib.o $(TOOLKIT_OBJS) lwlib-utils.o
 
 # ../src is needed to find config.h.
 ALL_CFLAGS= $(C_SWITCH_SYSTEM) $(C_SWITCH_X_SITE) \
--- a/lwlib/xlwmenu.c	Thu May 06 09:50:39 2010 +0900
+++ b/lwlib/xlwmenu.c	Mon May 10 12:37:03 2010 +0900
@@ -2177,7 +2177,6 @@
     {
       if (mw->menu.windows [i].pixmap != None) 
         XFreePixmap (XtDisplay (mw), mw->menu.windows [i].pixmap);
-      XtDestroyWidget (mw->menu.windows [i].w);
 #ifdef HAVE_XFT
       if (mw->menu.windows [i].xft_draw)
         XftDrawDestroy (mw->menu.windows [i].xft_draw);
--- a/msdos/ChangeLog	Thu May 06 09:50:39 2010 +0900
+++ b/msdos/ChangeLog	Mon May 10 12:37:03 2010 +0900
@@ -1,3 +1,42 @@
+2010-05-10  Glenn Morris  <rgm@gnu.org>
+
+	* sed1v2.inp, sed3v2.inp (LIBS_SYSTEM): Edit to empty.
+
+	* sed3v2.inp (BLESSMAIL_TARGET): Edit to need-blessmail.
+
+2010-05-07  Chong Yidong  <cyd@stupidchicken.com>
+
+	* Version 23.2 released.
+
+2010-05-08  Glenn Morris  <rgm@gnu.org>
+
+	* sed1v2.inp (LIBS_TERMCAP): Edit to empty.
+	(TERMCAP_OBJ): Edit to tparam.o.
+
+2010-05-07  Eli Zaretskii  <eliz@gnu.org>
+
+	Fix breakage due to autoconfiscation of Makefile.in files.
+
+	* sed3v2.inp (C_SWITCH_MACHINE): Edit to empty.
+
+	* sed1v2.inp (@LIB_MATH@): Edit to -lm.
+	(C_SWITCH_MACHINE, C_SWITCH_SYSTEM, LD_SWITCH_SYSTEM_TEMACS)
+	(LD_SWITCH_X_SITE_AUX, LD_SWITCH_X_SITE_AUX_RPATH)
+	(LD_SWITCH_SYSTEM, LD_SWITCH_SYSTEM_EXTRA, LIBTIFF, LIBJPEG)
+	(LIBPNG, LIBGIF, LIBXPM, XFT_LIBS, DBUS_CFLAGS, DBUS_LIBS)
+	(DBUS_OBJ, GCONF_CFLAGS, GCONF_LIBS, GTK_OBJ, LIBXMU, LIBXSM)
+	(LIBXTR6, XOBJ, TOOLKIT_LIBW, WIDGET_OBJ, CYGWIN_OBJ, NS_OBJ)
+	(NS_SUPPORT, LIBSELINUX_LIBS, START_FILES): Edit to empty.
+	(XMENU_OBJ): Edit to xmenu.o.
+	(FONT_OBJ): Edit to value used for X on Unix.
+	(PRE_ALLOC_OBJ): Edit to lastfile.o.
+	(POST_ALLOC_OBJ): Edit to $(vmlimitobj).
+	(@unexec@): Edit to unexec.o.
+
+2010-05-06  Glenn Morris  <rgm@gnu.org>
+
+	* sed1v2.inp, sed5x.inp: Remove LN_S, unused.
+
 2010-04-01  Eli Zaretskii  <eliz@gnu.org>
 
 	Remove support for DJGPP v1.x.
--- a/msdos/sed1v2.inp	Thu May 06 09:50:39 2010 +0900
+++ b/msdos/sed1v2.inp	Mon May 10 12:37:03 2010 +0900
@@ -2,8 +2,8 @@
 # Configuration script for src/Makefile under DJGPP v2.x
 # ----------------------------------------------------------------------
 #
-# Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004,
-#   2005, 2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+#   2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
 #
 # This file is part of GNU Emacs.
 #
@@ -38,19 +38,57 @@
 /^CPPFLAGS *=/s/@[^@\n]*@//
 /^LDFLAGS *=/s/@[^@\n]*@//
 /^LIBS *=/s/@[^@\n]*@//
+s/@LIB_MATH@/-lm/
 /^LIBES *=/,/^ *$/ {
   s/@[^@\n]*@//g
 }
 /^LIBOBJS *=/s/@[^@\n]*@/getloadavg.o/
-/^GETLOADAVG_LIBS *=/s/@[^@\n]*@//
+/^C_SWITCH_MACHINE *=/s/@C_SWITCH_MACHINE@//
+/^C_SWITCH_SYSTEM *=/s/@C_SWITCH_SYSTEM@//
+/^LD_SWITCH_SYSTEM_TEMACS *=/s/@LD_SWITCH_SYSTEM_TEMACS@//
+/^LD_SWITCH_X_SITE_AUX *=/s/@LD_SWITCH_X_SITE_AUX@//
+/^LD_SWITCH_X_SITE_AUX_RPATH *=/s/@LD_SWITCH_X_SITE_AUX_RPATH@//
+/^LD_SWITCH_SYSTEM *=/s/@LD_SWITCH_SYSTEM@//
+/^LD_SWITCH_SYSTEM_EXTRA *=/s/@LD_SWITCH_SYSTEM_EXTRA@//
+/^LIBS_SYSTEM *=/s/@LIBS_SYSTEM@//
+/^LIBTIFF *=/s/@LIBTIFF@//
+/^LIBJPEG *=/s/@LIBJPEG@//
+/^LIBPNG *=/s/@LIBPNG@//
+/^LIBGIF *=/s/@LIBGIF@//
+/^LIBXPM *=/s/@LIBXPM@//
+/^XFT_LIBS *=/s/@XFT_LIBS@//
+/^DBUS_CFLAGS *=/s/@DBUS_CFLAGS@//
+/^DBUS_LIBS *=/s/@DBUS_LIBS@//
+/^DBUS_OBJ *=/s/@DBUS_OBJ@//
+/^GCONF_CFLAGS *=/s/@GCONF_CFLAGS@//
+/^GCONF_LIBS *=/s/@GCONF_LIBS@//
+/^GTK_OBJ *=/s/@GTK_OBJ@//
+/^LIBS_TERMCAP *=/s/@LIBS_TERMCAP@//
+/^TERMCAP_OBJ *=/s/@TERMCAP_OBJ@/tparam.o/
+/^LIBXMU *=/s/@LIBXMU@//
+/^LIBXSM *=/s/@LIBXSM@//
+/^LIBXTR6 *=/s/@LIBXTR6@//
+/^XOBJ *=/s/@XOBJ@//
+/^TOOLKIT_LIBW *=/s/@TOOLKIT_LIBW@//
 /^LIBSOUND *=/s/@LIBSOUND@//
 /^CFLAGS_SOUND *=/s/@CFLAGS_SOUND@//
 /^RSVG_LIBS *=/s/@RSVG_LIBS@//
 /^RSVG_CFLAGS *=/s/@RSVG_CFLAGS@//
+/^WIDGET_OBJ *=/s/@WIDGET_OBJ@//
+/^CYGWIN_OBJ *=/s/@CYGWIN_OBJ@//
+/^NS_OBJ *=/s/@NS_OBJ@//
+/^NS_SUPPORT *=/s/@NS_SUPPORT@//
+/^LIBSELINUX_LIBS *=/s/@LIBSELINUX_LIBS@//
+/^GETLOADAVG_LIBS *=/s/@[^@\n]*@//
+/^START_FILES *=/s/@START_FILES@//
 /^OTHER_FILES *=/s/@OTHER_FILES@//
+/^XMENU_OBJ *=/s/@XMENU_OBJ@/xmenu.o/
+/^FONT_OBJ *=/s/@FONT_OBJ@/xfont.o ftfont.o xftfont.o ftxfont.o/
 /^EXEEXT *=/s/@EXEEXT@/.exe/
+/^PRE_ALLOC_OBJ *=/s/@PRE_ALLOC_OBJ@/lastfile.o/
+/^POST_ALLOC_OBJ *=/s/@POST_ALLOC_OBJ@/$(vmlimitobj)/
+s/@unexec@/unexec.o/g
 /^version *=/s/@[^@\n]*@//
-/^LN_S *=/s/@[^@\n]*@/ln -s/
 /^M_FILE *=/s!@[^@\n]*@!m/intel386.h!
 /^S_FILE *=/s!@[^@\n]*@!s/msdos.h!
 /^@SET_MAKE@$/s/@SET_MAKE@//
--- a/msdos/sed3v2.inp	Thu May 06 09:50:39 2010 +0900
+++ b/msdos/sed3v2.inp	Mon May 10 12:37:03 2010 +0900
@@ -26,6 +26,7 @@
 /^libdir *=/s!=.*$!=/emacs/bin!
 /^srcdir=/s!srcdir=@srcdir@!srcdir := $(subst \\,/,$(shell command.com /c cd))!
 /^VPATH *=/s!=.*$!=.!
+/^BLESSMAIL_TARGET *=/s!@BLESSMAIL_TARGET@!need-blessmail!
 /^KRB4LIB *=/s/@[^@\n]*@//g
 /^DESLIB *=/s/@[^@\n]*@//g
 /^KRB5LIB *=/s/@[^@\n]*@//g
@@ -34,8 +35,10 @@
 /^LIBHESIOD *=/s/@[^@\n]*@//g
 /^LIBRESOLV *=/s/@[^@\n]*@//g
 /^LIBS_MAIL *=/s/@[^@\n]*@//g
+/^LIBS_SYSTEM *=/s/@[^@\n]*@//g
 /^CFLAGS *=/s!=.*$!=-O2 -g!
 /^C_SWITCH_SYSTEM *=/s!=.*$!=-DMSDOS!
+/^C_SWITCH_MACHINE *=/s/@C_SWITCH_MACHINE@//
 /^LOADLIBES *=/s!=.*$!=!
 /^ALLOCA *=/s!@ALLOCA@!!
 /^EXEEXT *=/s!@EXEEXT@!!
--- a/msdos/sed5x.inp	Thu May 06 09:50:39 2010 +0900
+++ b/msdos/sed5x.inp	Mon May 10 12:37:03 2010 +0900
@@ -2,8 +2,8 @@
 # Configuration script for oldxmenu/makefile for DesqView/X
 # ----------------------------------------------------------------------
 #
-# Copyright (C) 1994, 2001, 2002, 2003, 2004, 2005,
-#   2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
+# Copyright (C) 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+#   2009, 2010  Free Software Foundation, Inc.
 #
 # This file is part of GNU Emacs.
 #
@@ -22,7 +22,6 @@
 /^CC *=/s/@[^@\n]*@/gcc/
 /^CPP *=/s/@[^@\n]*@/gcc -e/
 /^CFLAGS *=/s/@[^@\n]*@/-O2 -g/
-/^LN_S *=/s/@[^@\n]*@/ln -s/
 s/|| true//
 
 # arch-tag: 612a79be-2a02-4cb0-8dec-779aac0a2f4f
--- a/nextstep/ChangeLog	Thu May 06 09:50:39 2010 +0900
+++ b/nextstep/ChangeLog	Mon May 10 12:37:03 2010 +0900
@@ -1,3 +1,7 @@
+2010-05-07  Chong Yidong  <cyd@stupidchicken.com>
+
+	* Version 23.2 released.
+
 2010-03-10  Chong Yidong  <cyd@stupidchicken.com>
 
 	* Branch for 23.2.
--- a/nt/ChangeLog	Thu May 06 09:50:39 2010 +0900
+++ b/nt/ChangeLog	Mon May 10 12:37:03 2010 +0900
@@ -1,3 +1,7 @@
+2010-05-07  Chong Yidong  <cyd@stupidchicken.com>
+
+	* Version 23.2 released.
+
 2010-05-04  Glenn Morris  <rgm@gnu.org>
 
 	* config.nt (LD_SWITCH_X_SITE_AUX): Remove.
@@ -55,8 +59,8 @@
 
 2009-01-26  Jason Rumney  <jasonr@gnu.org>
 
-	* emacsclient.rc, emacs.rc: Swap name and description.  Remove
-	Windows versions.
+	* emacsclient.rc, emacs.rc: Swap name and description.
+	Remove Windows versions.
 
 2009-01-15  Jason Rumney  <jasonr@gnu.org>
 
--- a/oldXMenu/ChangeLog	Thu May 06 09:50:39 2010 +0900
+++ b/oldXMenu/ChangeLog	Mon May 10 12:37:03 2010 +0900
@@ -1,7 +1,19 @@
+2010-05-07  Chong Yidong  <cyd@stupidchicken.com>
+
+	* Version 23.2 released.
+
+2010-05-06  Glenn Morris  <rgm@gnu.org>
+
+	* Makefile.in (RANLIB): Let configure set it.
+	(libXMenu11.a): Configure sets RANLIB = : on systems without it.
+
+	* Makefile.in (CPP, LN_S, AS, LD, MV, LS, LINTOPTS, LINTLIBFLAG, MAKE)
+	(STD_DEFINES, CDEBUGFLAGS, RM_CMD): Remove unused variables.
+
 2010-05-04  Glenn Morris  <rgm@gnu.org>
 
-	* Makefile.in (C_SWITCH_SYSTEM, C_SWITCH_MACHINE): Use
-	@C_SWITCH_SYSTEM@, @C_SWITCH_MACHINE@ rather than
+	* Makefile.in (C_SWITCH_SYSTEM, C_SWITCH_MACHINE):
+	Use @C_SWITCH_SYSTEM@, @C_SWITCH_MACHINE@ rather than
 	@c_switch_system@, @c_switch_machine@.
 
 2010-04-27  Dan Nicolaescu  <dann@ics.uci.edu>
--- a/oldXMenu/Makefile.in	Thu May 06 09:50:39 2010 +0900
+++ b/oldXMenu/Makefile.in	Mon May 10 12:37:03 2010 +0900
@@ -15,8 +15,8 @@
 ## without express or implied warranty.
 
 
-## Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-##   Free Software Foundation, Inc.
+## Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+##   2010  Free Software Foundation, Inc.
 
 ## This program is free software: you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published by
@@ -36,7 +36,7 @@
 
 ## To the best of our knowledge, this code was originally based on the
 ## X11 oldXMenu Makefile, which was automatically generated from the
-## X11 oldXMenu Imakefile. There was no explicit copyright information
+## X11 oldXMenu Imakefile.  There was no explicit copyright information
 ## in the Imakefile, therefore we have added the same MIT license as
 ## used by the rest of the oldXMenu code.
 
@@ -53,24 +53,11 @@
 EXTRA=insque.o
 CC=@CC@
 CFLAGS=@CFLAGS@
-CPP=@CPP@
-LN_S=@LN_S@
-             AS = as
-             LD = ld
-           TAGS = etags
-             RM = rm -f
-             MV = mv
-         RANLIB = ranlib
+TAGS = etags
+RM = rm -f
+RANLIB = @RANLIB@
 # Solaris 2.1 ar doesn't accept the 'l' option.
-             AR = ar cq
-             LS = ls
-       LINTOPTS = -axz
-    LINTLIBFLAG = -C
-           MAKE = make
-    STD_DEFINES =
-    CDEBUGFLAGS = -O
-         RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a \
-			tags TAGS make.log
+AR = ar cq
 
 OBJS =  Activate.o \
 	AddPane.o \
@@ -110,11 +97,7 @@
 libXMenu11.a: $(OBJS) $(EXTRA)
 	$(RM) $@
 	$(AR) $@ $(OBJS) $(EXTRA)
-	@echo Do not be alarmed if the following ranlib command
-	@echo fails due to the absence of a ranlib program on your system.
-	-$(RANLIB) $@ || true
-#If running ranlib fails, probably there is none.
-#That's ok.  So don't stop the build.
+	$(RANLIB) $@
 
 Activate.o: Activate.c XMenuInt.h XMenu.h X10.h
 AddPane.o: AddPane.c XMenuInt.h XMenu.h X10.h
--- a/src/ChangeLog	Thu May 06 09:50:39 2010 +0900
+++ b/src/ChangeLog	Mon May 10 12:37:03 2010 +0900
@@ -1,3 +1,181 @@
+2010-05-10  Glenn Morris  <rgm@gnu.org>
+
+	* Makefile.in (LIBS_SYSTEM): Set using configure, not cpp.
+	(LIBS_SYSTEM) [MSDOS]: Reset with MSDOS_LIBS_SYSTEM.
+	(LIBES): Use LIBS_SYSTEM as a variable.
+	* s/msdos.h (LIBS_SYSTEM): Rename to MSDOS_LIBS_SYSTEM.  Always define.
+	* s/aix4-2.h (LIBS_SYSTEM):
+	* s/freebsd.h (LIBS_SYSTEM):
+	* s/hpux10-20.h (LIBS_SYSTEM):
+	* s/sol2-6.h (LIBS_SYSTEM):
+	* s/unixware.h (LIBS_SYSTEM):
+	Move to configure.
+
+	* s/aix4-2.h (MAIL_USE_LOCKF):
+	* s/bsd-common.h (MAIL_USE_FLOCK):
+	* s/darwin.h (MAIL_USE_FLOCK):
+	* s/gnu-linux.h (MAIL_USE_FLOCK):
+	* s/irix6-5.h (MAIL_USE_FLOCK):
+	* s/template.h (MAIL_USE_FLOCK):
+	Move to configure.
+
+2010-05-08  Chong Yidong  <cyd@stupidchicken.com>
+
+	* Version 23.2 released.
+
+2010-05-08  Andreas Schwab  <schwab@linux-m68k.org>
+
+	* composite.c (autocmp_chars): Save point as marker before calling
+	auto-composition-function (Bug#5984).
+
+	* lisp.h (restore_point_unwind): Add prototype.
+
+	* fileio.c (restore_point_unwind): Remove static attribute.
+
+2010-05-08  Kenichi Handa  <handa@m17n.org>
+
+	* ftfont.c (M17N_FLT_USE_NEW_FEATURE): Define it if we can use the
+	new feature of libotf and m17n-flt.
+	(ftfont_check_otf) [M17N_FLT_USE_NEW_FEATURE]:
+	Call OTF_check_features even if no specific feature is given.
+	(PACK_OTF_TAG) [M17N_FLT_USE_NEW_FEATURE]: New macro.
+	(ftfont_drive_otf) [M17N_FLT_USE_NEW_FEATURE]: Handle the case
+	that OUT is NULL.  Use OTF_drive_gsub_with_log and
+	OTF_drive_gpos_with_log instead of OTF_drive_gsub and
+	OTF_drive_gpos.
+	(ftfont_try_otf) [M17N_FLT_USE_NEW_FEATURE]: New function.
+	(ftfont_shape_by_flt) [M17N_FLT_USE_NEW_FEATURE]:
+	Setup mflt_enable_new_feature and mflt_try_otf.
+
+2010-05-08  Jan Djärv  <jan.h.d@swipnet.se>
+
+	* xsettings.c (Ftool_bar_get_system_style): Correct comment.
+
+	* gtkutil.c (xg_pack_tool_bar): Change show_all to show for handle
+	box and toolbar (Bug #6139).
+	(xg_create_tool_bar): Remove comment (Bug #6139).
+	(xg_make_tool_item): Remove gtk_widget_show_all (Bug #6139).
+	(xg_show_toolbar_item): Add gtk_widget_show for weventbox (Bug #6139).
+
+2010-05-08  Juanma Barranquero  <lekktu@gmail.com>
+
+	* makefile.w32-in ($(BLD)/eval.$(O), $(BLD)/w32fns.$(O)):
+	Update dependencies.
+
+2010-05-08  Eli Zaretskii  <eliz@gnu.org>
+
+	* fringe.c (update_window_fringes): Set up truncation bitmaps for
+	R2L lines.
+
+2010-05-08  Glenn Morris  <rgm@gnu.org>
+
+	* Makefile.in (THIS_IS_MAKEFILE): Remove, unused.
+
+	* Makefile.in (LIBS_TERMCAP): Set with configure, not cpp.
+	(TERMCAP_OBJ): New, set by configure, replacing termcapobj.
+	(termcapobj): Replace with TERMCAP_OBJ.
+	(otherobj): Use $TERMCAP_OBJ instead of $termcapobj.
+	(LIBES): Use LIBS_TERMCAP as a variable.
+
+	* s/freebsd.h (osreldate.h): No longer include, since this file
+	does not use __FreeBSD_version any more.
+
+	* s/aix4-2.h (TERMINFO):
+	* s/cygwin.h (TERMINFO):
+	* s/darwin.h (TERMINFO, LIBS_TERMCAP) [HAVE_LIBNCURSES]:
+	* s/freebsd.h (TERMINFO, LIBS_TERMCAP):
+	* s/gnu-linux.h (TERMINFO, LIBS_TERMCAP) [HAVE_LIBNCURSES]:
+	* s/gnu.h (TERMINFO, LIBS_TERMCAP) [HAVE_LIBNCURSES]:
+	* s/hpux10-20.h (TERMINFO, LIBS_TERMCAP):
+	* s/irix6-5.h (TERMINFO):
+	* s/netbsd.h (LIBS_TERMCAP):
+	* s/openbsd.h (TERMINFO, LIBS_TERMCAP):
+	* s/sol2-6.h (LIBS_TERMCAP) [!TERMINFO]:
+	* s/usg5-4.h (TERMINFO):
+	Move to configure.
+
+2010-05-07  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* eval.c (unbind_to): Don't unbind a local binding into the global
+	binding when the local binding disappeared.  Inversely, don't unbind
+	a global binding into a newly created local binding.
+	* data.c (set_internal): Make its `buf' arg into a `where' arg so we
+	can specify the frame to use, when applicable.  Adjust callers.
+
+2010-05-07  Vincent Belaïche  <vincent.belaiche@gmail.com>
+            Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* floatfns.c (Fisnan, Fcopysign, Ffrexp, Fldexp): New functions.
+
+2010-05-07  Eli Zaretskii  <eliz@gnu.org>
+
+	* w32fns.c: Include w32.h.
+	(Fw32_shell_execute): Decode the error message before passing it
+	to `error'.  (Bug#6126)
+
+	* msdos.c (dos_set_window_size):
+	* w16select.c (Fx_selection_exists_p): Use `Fsymbol_value (foo)'
+	instead of `XSYMBOL (foo)->value'.
+
+2010-05-07  Eli Zaretskii  <eliz@gnu.org>
+
+	Fix the MS-DOS build, broken by autoconfiscation.
+
+	* Makefile.in: Don't use Make-style comments past the "start of
+	cpp stuff" line.
+	(MSDOS_OBJ): Remove xmenu.o (it is now defined by XMENU_OBJ).
+
+	* s/msdos.h (UNEXEC): Don't define (@unexec@ in Makefile.in is
+	edited directly by msdos/sed1v2.inp).
+
+2010-05-07  Glenn Morris  <rgm@gnu.org>
+
+	* Makefile.in (LD_SWITCH_SYSTEM): Set with configure, not cpp.
+	(LD_SWITCH_SYSTEM_EXTRA): New variable, set by configure.
+	(TEMACS_LDFLAGS): Use $LD_SWITCH_SYSTEM and $LD_SWITCH_SYSTEM_EXTRA,
+	move out of cpp section.
+	* s/freebsd.h (LD_SWITCH_SYSTEM):
+	* s/gnu-linux.h (LD_SWITCH_SYSTEM):
+	* s/netbsd.h (LD_SWITCH_SYSTEM):
+	* s/openbsd.h (LD_SWITCH_SYSTEM): Move to configure.in.
+
+2010-05-07  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	Define LIB_STANDARD and START_FILES using autoconf.
+	* s/usg5-4.h (LIB_STANDARD):
+	* s/netbsd.h (START_FILES):
+	* s/irix6-5.h (LIB_STANDARD):
+	* s/hpux10-20.h (LIB_STANDARD, START_FILES):
+	* s/gnu-linux.h (START_FILES, LIB_STANDARD):
+	* s/freebsd.h (START_FILES):
+	* s/darwin.h (START_FILES):
+	* s/cygwin.h (START_FILES):
+	* s/aix4-2.h (LIB_STANDARD):
+	* m/ibmrs6000.h (START_FILES): Remove, move logic to configure.in.
+	* Makefile.in (STARTFILES): Rename to START_FILES, define using
+	autoconf, not cpp.
+
+2010-05-06  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	Remove NEED_BSDTTY and NEED_UNISTD_H.
+	* s/hpux10-20.h (NEED_BSDTTY): Remove.
+	* s/aix4-2.h (NEED_UNISTD_H): Remove.
+	* systty.h: Simplify conditionals for including <sys/bsdtty.h>,
+	<sys/ptyio.h> and <unistd.h>.
+
+	* emacs.c (main): Remove NO_DIR_LIBRARY conditional, unused.
+
+	* Makefile.in (STARTFILES): Conditionally define to make the usage clear.
+	* s/gnu.h (START_FILES): Remove empty definition.
+
+2010-05-06  Jan Djärv  <jan.h.d@swipnet.se>
+
+	* xterm.c (x_draw_image_relief): Move declaration of extra to beginning.
+
+2010-05-06  Glenn Morris  <rgm@gnu.org>
+
+	* Makefile.in (CPP, LN_S): Remove unused variables.
+
 2010-05-05  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* syntax.c (Fchar_syntax): Check the arg is a character (bug#6080).
--- a/src/Makefile.in	Thu May 06 09:50:39 2010 +0900
+++ b/src/Makefile.in	Mon May 10 12:37:03 2010 +0900
@@ -37,11 +37,9 @@
 abs_builddir = @abs_builddir@
 VPATH = $(srcdir)
 CC = @CC@
-CPP = @CPP@
 CFLAGS = @CFLAGS@
 CPPFLAGS = @CPPFLAGS@
 LDFLAGS = @LDFLAGS@
-LN_S = @LN_S@
 EXEEXT = @EXEEXT@
 version = @version@
 # Substitute an assignment for the MAKE variable, because
@@ -75,13 +73,23 @@
 ## System-specific CFLAGS.
 C_SWITCH_SYSTEM=@C_SWITCH_SYSTEM@
 ## This holds any special options for linking temacs only (ie, not
-## used by configure).
+## used by configure).  Not used elsewhere because it sometimes
+## contains options that have to do with using Emacs's crt0, 
+## which are only good with temacs.
 LD_SWITCH_SYSTEM_TEMACS=@LD_SWITCH_SYSTEM_TEMACS@
 ## Next two must come before LD_SWITCH_SYSTEM.
 ## If needed, a -R option that says where to find X windows at run time.
 LD_SWITCH_X_SITE_AUX=@LD_SWITCH_X_SITE_AUX@
 ## As above, but using -rpath instead.
 LD_SWITCH_X_SITE_AUX_RPATH=@LD_SWITCH_X_SITE_AUX_RPATH@
+## System-specific LDFLAGS.
+LD_SWITCH_SYSTEM=@LD_SWITCH_SYSTEM@
+LD_SWITCH_SYSTEM_EXTRA=@LD_SWITCH_SYSTEM_EXTRA@
+## Flags to pass to ld only for temacs.
+TEMACS_LDFLAGS = $(LD_SWITCH_SYSTEM) $(LD_SWITCH_SYSTEM_EXTRA) $(LD_SWITCH_SYSTEM_TEMACS)
+
+## Some systems define this to request special libraries.
+LIBS_SYSTEM=@LIBS_SYSTEM@
 
 LIBTIFF=@LIBTIFF@
 LIBJPEG=@LIBJPEG@
@@ -100,6 +108,11 @@
 
 GTK_OBJ=@GTK_OBJ@
 
+## -ltermcap, or -lncurses, or -lcurses, or "".
+LIBS_TERMCAP=@LIBS_TERMCAP@
+## terminfo.o if TERMINFO, else tparam.o.
+TERMCAP_OBJ=@TERMCAP_OBJ@
+
 LIBXMU=@LIBXMU@
 
 LIBXSM=@LIBXSM@
@@ -152,13 +165,14 @@
 
 RUN_TEMACS = `/bin/pwd`/temacs
 
+START_FILES = @START_FILES@
+
 # ========================== start of cpp stuff =======================
 /* From here on, comments must be done in C syntax.  */
 
 /* just to be sure the sh is used */
 SHELL=/bin/sh
 
-#define THIS_IS_MAKEFILE
 #define NOT_C_CODE
 #include "config.h"
 
@@ -184,39 +198,11 @@
    do not let it interfere with this file.  */
 #undef register
 
-/* Some machines do not find the standard C libraries in the usual place.  */
-#ifndef LIB_STANDARD
-#define LIB_STANDARD
-#endif
-
-/* Under GNUstep, putting libc on the link line causes problems. */
-#ifdef NS_IMPL_GNUSTEP
-#undef LIB_STANDARD
-#define LIB_STANDARD
-#endif
-
-/* Some s/SYSTEM.h files define this to request special libraries.  */
-#ifndef LIBS_SYSTEM
-#define LIBS_SYSTEM
-#endif
-
-/* Some s/SYSTEM.h files define this to request special switches in ld.  */
-#ifndef LD_SWITCH_SYSTEM
-#if !defined (__GNUC__) && ((defined (BSD_SYSTEM) && !defined (COFF)))
-#define LD_SWITCH_SYSTEM -X
-#else /* (defined (BSD_SYSTEM) && !defined (COFF)) */
-#define LD_SWITCH_SYSTEM
-#endif /* (defined (BSD_SYSTEM) && !defined (COFF)) */
-#endif /* LD_SWITCH_SYSTEM */
-
-/* These macros are for switches specifically related to X Windows.  */
+/* This macro is for switches specifically related to X Windows.  */
 #ifndef LD_SWITCH_X_SITE
 #define LD_SWITCH_X_SITE
 #endif
 
-STARTFILES = START_FILES
-
-
 #ifdef NS_IMPL_GNUSTEP
 /* Pull in stuff from GNUstep-make. */
 FOUNDATION_LIB=gnu
@@ -239,6 +225,7 @@
 
 /* C_SWITCH_X_SITE must come before C_SWITCH_X_SYSTEM
    since it may have -I options that should override those two.  */
+/* MYCPPFLAGS only referenced in etc/DEBUG.  */
 ALL_CFLAGS=-Demacs -DHAVE_CONFIG_H $(MYCPPFLAGS) -I. -I${srcdir} ${C_SWITCH_MACHINE} ${C_SWITCH_SYSTEM} @C_SWITCH_X_SITE@ @C_SWITCH_X_SYSTEM@ ${CFLAGS_SOUND} ${RSVG_CFLAGS} ${DBUS_CFLAGS} ${GCONF_CFLAGS} ${CFLAGS} @FREETYPE_CFLAGS@ @FONTCONFIG_CFLAGS@ @LIBOTF_CFLAGS@ @M17N_FLT_CFLAGS@ ${DEPFLAGS}
 ALL_OBJC_CFLAGS=$(ALL_CFLAGS) @GNU_OBJC_CFLAGS@
 
@@ -255,8 +242,8 @@
 	$(CC) -c $(CPPFLAGS) $(ALL_OBJC_CFLAGS) $<
 
 #ifdef HAVE_X_WINDOWS
-/* This test needs to say in cpp for the time being, since s/ms-w32.h and
-   s/msdos.h define HAVE_MENUS, possibly overriding configure.  */
+/* This test needs to say in cpp for the time being, since s/msdos.h
+   defines HAVE_MENUS, and does not use the configure script.  */
 #ifdef HAVE_MENUS
 OLDXMENU=@OLDXMENU@
 LIBXMENU=@LIBXMENU@
@@ -325,11 +312,6 @@
 #endif /* not LINKER */
 #endif /* not ORDINARY_LINK */
 
-/* Flags to pass to LD only for temacs.  */
-/* Do not split this line with a backslash.  That can cause trouble with
-   some cpps.  */
-TEMACS_LDFLAGS = LD_SWITCH_SYSTEM $(LD_SWITCH_SYSTEM_TEMACS)
-
 /* 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
    redefined LD to something odd, like "gcc".
@@ -340,10 +322,11 @@
 #endif
 
 #ifdef MSDOS
+LIBS_SYSTEM = MSDOS_LIBS_SYSTEM
 #ifdef HAVE_X_WINDOWS
-MSDOS_OBJ = dosfns.o msdos.o xmenu.o
+MSDOS_OBJ = dosfns.o msdos.o
 #else
-MSDOS_OBJ = dosfns.o msdos.o w16select.o xmenu.o termcap.o
+MSDOS_OBJ = dosfns.o msdos.o w16select.o termcap.o
 #endif
 #endif
 
@@ -387,21 +370,6 @@
   w32.o w32console.o w32fns.o w32heap.o w32inevt.o \
   w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o $(FONT_DRIVERS)
 
-
-#ifdef TERMINFO
-/* Used to be -ltermcap here.  If your machine needs that,
-   define LIBS_TERMCAP in the m/MACHINE.h file.  */
-#ifndef LIBS_TERMCAP
-#define LIBS_TERMCAP -lcurses
-#endif /* LIBS_TERMCAP */
-termcapobj = terminfo.o
-#else /* ! defined (TERMINFO) */
-#ifndef LIBS_TERMCAP
-#define LIBS_TERMCAP
-#endif /* LIBS_TERMCAP */
-termcapobj = tparam.o
-#endif /* ! defined (TERMINFO) */
-
 gmallocobj =
 rallocobj =
 vmlimitobj =
@@ -417,13 +385,13 @@
 vmlimitobj = vm-limit.o
 #endif /* !SYSTEM_MALLOC */
 
-## Empty on Cygwin, lastfile.o elsewhere.
+/* Empty on Cygwin, lastfile.o elsewhere.  */
 PRE_ALLOC_OBJ=@PRE_ALLOC_OBJ@
-## lastfile.o vm-limit.o on Cygwin, $vmlimitobj elsewhere.
+/* lastfile.o vm-limit.o on Cygwin, $vmlimitobj elsewhere.  */
 POST_ALLOC_OBJ=@POST_ALLOC_OBJ@
 
 /* List of object files that make-docfile should not be told about.  */
-otherobj= $(termcapobj) $(PRE_ALLOC_OBJ) $(gmallocobj) $(rallocobj) \
+otherobj= $(TERMCAP_OBJ) $(PRE_ALLOC_OBJ) $(gmallocobj) $(rallocobj) \
   $(POST_ALLOC_OBJ) $(WIDGET_OBJ) $(LIBOBJS)
 
 #ifdef HAVE_MOUSE
@@ -686,10 +654,10 @@
    with GCC, we might need gnulib again after them.  */
 
 LIBES = $(LOADLIBES) $(LIBS) $(LIBX_BASE) $(LIBX_OTHER) $(LIBSOUND) \
-   $(RSVG_LIBS) $(DBUS_LIBS) @LIBGPM@ @LIBRESOLV@ LIBS_SYSTEM LIBS_TERMCAP \
-   $(GETLOADAVG_LIBS) ${GCONF_LIBS} ${LIBSELINUX_LIBS} \
+   $(RSVG_LIBS) $(DBUS_LIBS) @LIBGPM@ @LIBRESOLV@ $(LIBS_SYSTEM) \
+   $(LIBS_TERMCAP) $(GETLOADAVG_LIBS) ${GCONF_LIBS} ${LIBSELINUX_LIBS} \
    @FREETYPE_LIBS@ @FONTCONFIG_LIBS@ @LIBOTF_LIBS@ @M17N_FLT_LIBS@ \
-   $(GNULIB_VAR) @LIB_MATH@ LIB_STANDARD $(GNULIB_VAR)
+   $(GNULIB_VAR) @LIB_MATH@ @LIB_STANDARD@ $(GNULIB_VAR)
 
 all: emacs${EXEEXT} $(OTHER_FILES)
 
@@ -730,7 +698,8 @@
 buildobj.h: Makefile
 	echo "#define BUILDOBJ \"${obj} ${otherobj} " "\"" > buildobj.h
 
-temacs${EXEEXT}: $(LOCALCPP) $(STARTFILES) stamp-oldxmenu ${obj} ${otherobj} prefix-args${EXEEXT}
+/* FIXME LOCALCPP not defined or mentioned anywhere.  */
+temacs${EXEEXT}: $(LOCALCPP) $(START_FILES) stamp-oldxmenu ${obj} ${otherobj} prefix-args${EXEEXT}
 #ifdef NS_IMPL_GNUSTEP
 	$(CC) -rdynamic YMF_PASS_LDFLAGS ( ${TEMACS_LDFLAGS} \
 	-L@GNUSTEP_SYSTEM_LIBRARIES@ -lgnustep-gui -lgnustep-base \
@@ -738,13 +707,10 @@
 	${obj} ${otherobj} ${LIBES}
 #else
 	$(LD) YMF_PASS_LDFLAGS (${STARTFLAGS} ${TEMACS_LDFLAGS}) $(LDFLAGS) \
-    -o temacs ${STARTFILES} ${obj} ${otherobj}  \
+    -o temacs ${START_FILES} ${obj} ${otherobj}  \
     ${LIBES}
 #endif
 
-/* We do not use ALL_LDFLAGS because LD_SWITCH_SYSTEM
-   often contains options that have to do with using Emacs''s crt0,
-   which are only good with temacs.  */
 prefix-args${EXEEXT}: prefix-args.o $(config_h)
 	$(CC) $(LDFLAGS) prefix-args.o -o prefix-args
 
@@ -802,14 +768,14 @@
 
 #ifndef AUTO_DEPEND
 
-## FIXME some of these dependencies are platform-specific.
-## Eg callproc.c only depends on w32.h for WINDOWSNT builds.
-## One way to fix this would be to replace w32.h (etc) by $(W32_H),
-## a variable set by configure.  Doesn't seem worth the trouble.
+/* FIXME some of these dependencies are platform-specific.
+Eg callproc.c only depends on w32.h for WINDOWSNT builds.
+One way to fix this would be to replace w32.h (etc) by $(W32_H),
+a variable set by configure.  Does not seem worth the trouble.
 
-## nsgui.h: In fact, every .o file depends directly or indirectly on
-## dispextern.h and hence nsgui.h under NS.  But the ones that actually
-## use stuff there are more limited.
+nsgui.h: In fact, every .o file depends directly or indirectly on
+dispextern.h and hence nsgui.h under NS.  But the ones that actually
+use stuff there are more limited.  */
 atimer.o: atimer.c atimer.h syssignal.h systime.h lisp.h blockinput.h \
  $(config_h)
 bidi.o: bidi.c buffer.h character.h dispextern.h lisp.h $(config_h)
@@ -1178,6 +1144,6 @@
 	cd ../lisp; $(MAKE) $(MFLAGS) compile-first EMACS=${bootstrap_exe}
 
 #ifdef AUTO_DEPEND
-ALLOBJS=$(STARTFILES) ${obj} ${otherobj} prefix-args.o
+ALLOBJS=$(START_FILES) ${obj} ${otherobj} prefix-args.o
 -include $(ALLOBJS:%.o=deps/%.d)
 #endif
--- a/src/bytecode.c	Thu May 06 09:50:39 2010 +0900
+++ b/src/bytecode.c	Mon May 10 12:37:03 2010 +0900
@@ -604,7 +604,7 @@
 	    else
 	      {
 		BEFORE_POTENTIAL_GC ();
-		set_internal (sym, val, current_buffer, 0);
+		set_internal (sym, val, Qnil, 0);
 		AFTER_POTENTIAL_GC ();
 	      }
 	  }
--- a/src/composite.c	Thu May 06 09:50:39 2010 +0900
+++ b/src/composite.c	Mon May 10 12:37:03 2010 +0900
@@ -990,6 +990,14 @@
 	    {
 	      Lisp_Object args[6];
 
+	      /* Save point as marker before calling out to lisp.  */
+	      if (NILP (string))
+		{
+		  Lisp_Object m = Fmake_marker ();
+		  set_marker_both (m, Qnil, pt, pt_byte);
+		  record_unwind_protect (restore_point_unwind, m);
+		}
+
 	      args[0] = Vauto_composition_function;
 	      args[1] = AREF (elt, 2);
 	      args[2] = pos;
@@ -998,8 +1006,10 @@
 	      args[5] = string;
 	      gstring = safe_call (6, args);
 	    }
-	  if (NILP (string))
-	    TEMP_SET_PT_BOTH (pt, pt_byte);
+	  else if (NILP (string))
+	    {
+	      TEMP_SET_PT_BOTH (pt, pt_byte);
+	    }
 	  return unbind_to (count, gstring);
 	}
     }
--- a/src/config.in	Thu May 06 09:50:39 2010 +0900
+++ b/src/config.in	Mon May 10 12:37:03 2010 +0900
@@ -135,8 +135,8 @@
 /* Define to 1 if you have the <com_err.h> header file. */
 #undef HAVE_COM_ERR_H
 
-/* Define to 1 if you have /usr/lib/crti.o. */
-#undef HAVE_CRTIN
+/* Define to 1 if you have the `copysign' function. */
+#undef HAVE_COPYSIGN
 
 /* Define to 1 if using D-Bus. */
 #undef HAVE_DBUS
@@ -303,6 +303,9 @@
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* Define to 1 if you have the `isnan' function. */
+#undef HAVE_ISNAN
+
 /* Define to 1 if you have the jpeg library (-ljpeg). */
 #undef HAVE_JPEG
 
@@ -816,6 +819,12 @@
 /* Define to unlink, rather than empty, mail spool after reading. */
 #undef MAIL_UNLINK_SPOOL
 
+/* Define if the mailer uses flock to interlock the mail spool. */
+#undef MAIL_USE_FLOCK
+
+/* Define if the mailer uses lockf to interlock the mail spool. */
+#undef MAIL_USE_LOCKF
+
 /* Define to support MMDF mailboxes in movemail. */
 #undef MAIL_USE_MMDF
 
@@ -884,6 +893,9 @@
 /* Process async input synchronously. */
 #undef SYNC_INPUT
 
+/* Define to 1 if you use terminfo instead of termcap. */
+#undef TERMINFO
+
 /* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
 #undef TIME_WITH_SYS_TIME
 
--- a/src/data.c	Thu May 06 09:50:39 2010 +0900
+++ b/src/data.c	Mon May 10 12:37:03 2010 +0900
@@ -1156,7 +1156,7 @@
      (symbol, newval)
      register Lisp_Object symbol, newval;
 {
-  set_internal (symbol, newval, current_buffer, 0);
+  set_internal (symbol, newval, Qnil, 0);
   return newval;
 }
 
@@ -1196,29 +1196,25 @@
 }
 
 /* Store the value NEWVAL into SYMBOL.
-   If buffer-locality is an issue, BUF specifies which buffer to use.
-   (0 stands for the current buffer.)
+   If buffer/frame-locality is an issue, WHERE specifies which context to use.
+   (nil stands for the current buffer/frame).
 
    If BINDFLAG is zero, then if this symbol is supposed to become
    local in every buffer where it is set, then we make it local.
    If BINDFLAG is nonzero, we don't do that.  */
 
 void
-set_internal (symbol, newval, buf, bindflag)
-     register Lisp_Object symbol, newval;
-     struct buffer *buf;
+set_internal (symbol, newval, where, bindflag)
+     register Lisp_Object symbol, newval, where;
      int bindflag;
 {
   int voide = EQ (newval, Qunbound);
   struct Lisp_Symbol *sym;
   Lisp_Object tem1;
 
-  if (buf == 0)
-    buf = current_buffer;
-
   /* If restoring in a dead buffer, do nothing.  */
-  if (NILP (buf->name))
-    return;
+  /* if (BUFFERP (where) && NILP (XBUFFER (where)->name))
+      return; */
 
   CHECK_SYMBOL (symbol);
   if (SYMBOL_CONSTANT_P (symbol))
@@ -1241,15 +1237,19 @@
     case SYMBOL_LOCALIZED:
       {
 	struct Lisp_Buffer_Local_Value *blv = SYMBOL_BLV (sym);
-	Lisp_Object tmp; XSETBUFFER (tmp, buf);
-
+	if (NILP (where))
+	  {
+	    if (blv->frame_local)
+	      where = selected_frame;
+	    else
+	      XSETBUFFER (where, current_buffer);
+	  }
 	/* If the current buffer is not the buffer whose binding is
 	   loaded, or if there may be frame-local bindings and the frame
 	   isn't the right one, or if it's a Lisp_Buffer_Local_Value and
 	   the default binding is loaded, the loaded binding may be the
 	   wrong one.  */
-	if (!EQ (blv->where,
-		 blv->frame_local ? selected_frame : tmp)
+	if (!EQ (blv->where, where)
 	    /* Also unload a global binding (if the var is local_if_set). */
 	    || (EQ (blv->valcell, blv->defcell)))
 	  {
@@ -1261,19 +1261,12 @@
 	      SET_BLV_VALUE (blv, do_symval_forwarding (blv->fwd));
 
 	    /* Find the new binding.  */
-	    {
-	      XSETSYMBOL (symbol, sym); /* May have changed via aliasing.  */
-	      if (blv->frame_local)
-		{
-		  tem1 = Fassq (symbol, XFRAME (selected_frame)->param_alist);
-		  blv->where = selected_frame;
-		}
-	      else
-		{
-		  tem1 = Fassq (symbol, buf->local_var_alist);
-		  blv->where = tmp;
-		}
-	    }
+	    XSETSYMBOL (symbol, sym); /* May have changed via aliasing.  */
+	    tem1 = Fassq (symbol,
+			  (blv->frame_local
+			   ? XFRAME (where)->param_alist
+			   : XBUFFER (where)->local_var_alist));
+	    blv->where = where;
 	    blv->found = 1;
 
 	    if (NILP (tem1))
@@ -1303,8 +1296,8 @@
 		       bindings, not for frame-local bindings.  */
 		    eassert (!blv->frame_local);
 		    tem1 = Fcons (symbol, XCDR (blv->defcell));
-		    buf->local_var_alist
-		      = Fcons (tem1, buf->local_var_alist);
+		    XBUFFER (where)->local_var_alist
+		      = Fcons (tem1, XBUFFER (where)->local_var_alist);
 		  }
 	      }
 
@@ -1322,12 +1315,16 @@
 		 buffer-local indicator, not through Lisp_Objfwd, etc.  */
 	      blv->fwd = NULL;
 	    else
-	      store_symval_forwarding (blv->fwd, newval, buf);
+	      store_symval_forwarding (blv->fwd, newval,
+				       BUFFERP (where)
+				       ? XBUFFER (where) : current_buffer);
 	  }
 	break;
       }
     case SYMBOL_FORWARDED:
       {
+	struct buffer *buf
+	  = BUFFERP (where) ? XBUFFER (where) : current_buffer;
 	union Lisp_Fwd *innercontents = SYMBOL_FWD (sym);
 	if (BUFFER_OBJFWDP (innercontents))
 	  {
--- a/src/emacs.c	Thu May 06 09:50:39 2010 +0900
+++ b/src/emacs.c	Mon May 10 12:37:03 2010 +0900
@@ -1582,9 +1582,7 @@
       syms_of_ccl ();
       syms_of_character ();
       syms_of_cmds ();
-#ifndef NO_DIR_LIBRARY
       syms_of_dired ();
-#endif /* not NO_DIR_LIBRARY */
       syms_of_display ();
       syms_of_doc ();
       syms_of_editfns ();
--- a/src/eval.c	Thu May 06 09:50:39 2010 +0900
+++ b/src/eval.c	Mon May 10 12:37:03 2010 +0900
@@ -26,6 +26,7 @@
 #include "commands.h"
 #include "keyboard.h"
 #include "dispextern.h"
+#include "frame.h"		/* For XFRAME.  */
 
 #if HAVE_X_WINDOWS
 #include "xterm.h"
@@ -786,7 +787,7 @@
      so that old-code that affects n_a before the aliasing is setup
      still works.  */
   if (NILP (Fboundp (base_variable)))
-    set_internal (base_variable, find_symbol_value (new_alias), NULL, 1);
+    set_internal (base_variable, find_symbol_value (new_alias), Qnil, 1);
 
   {
     struct specbinding *p;
@@ -3335,7 +3336,7 @@
 	  if (!sym->constant)
 	    SET_SYMBOL_VAL (sym, value);
 	  else
-	    set_internal (symbol, value, 0, 1);
+	    set_internal (symbol, value, Qnil, 1);
 	  break;
 	}
     case SYMBOL_LOCALIZED: case SYMBOL_FORWARDED:
@@ -3395,7 +3396,7 @@
 	  specpdl_ptr->symbol = symbol;
 
 	specpdl_ptr++;
-	set_internal (symbol, value, 0, 1);
+	set_internal (symbol, value, Qnil, 1);
 	break;
       }
     default: abort ();
@@ -3457,27 +3458,26 @@
 
 	  if (NILP (where))
 	    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 (!NILP (Flocal_variable_p (symbol, where)))
-	      set_internal (symbol, this_binding.old_value, XBUFFER (where), 1);
-	    /* else if (!NILP (Fbuffer_live_p (where)))
-	      error ("Unbinding local %s to global!", symbol); */
-            else
-              ;
-	  else
-	    set_internal (symbol, this_binding.old_value, NULL, 1);
+	    {
+	      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,
+	 since that was already done by specbind.  */
+      else if (XSYMBOL (this_binding.symbol)->redirect == SYMBOL_PLAINVAL)
+	SET_SYMBOL_VAL (XSYMBOL (this_binding.symbol),
+			this_binding.old_value);
       else
-	{
-	  /* If variable has a trivial value (no forwarding), we can
-	     just set it.  No need to check for constant symbols here,
-	     since that was already done by specbind.  */
-	  if (XSYMBOL (this_binding.symbol)->redirect == SYMBOL_PLAINVAL)
-	    SET_SYMBOL_VAL (XSYMBOL (this_binding.symbol),
-			    this_binding.old_value);
-	  else
-	    set_internal (this_binding.symbol, this_binding.old_value, 0, 1);
-	}
+	/* NOTE: we only ever come here if make_local_foo was used for
+	   the first time on this var within this let.  */
+	Fset_default (this_binding.symbol, this_binding.old_value);
     }
 
   if (NILP (Vquit_flag) && !NILP (quitf))
--- a/src/fileio.c	Thu May 06 09:50:39 2010 +0900
+++ b/src/fileio.c	Mon May 10 12:37:03 2010 +0900
@@ -299,7 +299,7 @@
 
 /* Restore point, having saved it as a marker.  */
 
-static Lisp_Object
+Lisp_Object
 restore_point_unwind (location)
      Lisp_Object location;
 {
--- a/src/floatfns.c	Thu May 06 09:50:39 2010 +0900
+++ b/src/floatfns.c	Mon May 10 12:37:03 2010 +0900
@@ -288,6 +288,70 @@
   IN_FLOAT (d = sin (d) / c, "tan", arg);
   return make_float (d);
 }
+
+#if defined HAVE_ISNAN && defined HAVE_COPYSIGN
+DEFUN ("isnan", Fisnan, Sisnan, 1, 1, 0,
+       doc: /* Return non nil iff argument X is a NaN.  */)
+     (x)
+     Lisp_Object x;
+{
+  CHECK_FLOAT (x);
+  return isnan (XFLOAT_DATA (x)) ? Qt : Qnil;
+}
+
+DEFUN ("copysign", Fcopysign, Scopysign, 1, 2, 0,
+       doc: /* Copy sign of X2 to value of X1, and return the result.
+Cause an error if X1 or X2 is not a float.  */)
+     (x1, x2)
+     Lisp_Object x1, x2;
+{
+  double f1, f2;
+
+  CHECK_FLOAT (x1);
+  CHECK_FLOAT (x2);
+
+  f1 = XFLOAT_DATA (x1);
+  f2 = XFLOAT_DATA (x2);
+
+  return make_float (copysign (f1, f2));
+}
+
+DEFUN ("frexp", Ffrexp, Sfrexp, 1, 1, 0,
+       doc: /* Get significand and exponent of a floating point number.
+Breaks the floating point number X into its binary significand SGNFCAND
+\(a floating point value between 0.5 (included) and 1.0 (excluded))
+and an integral exponent EXP for 2, such that:
+
+  X = SGNFCAND * 2^EXP
+
+The function returns the cons cell (SGNFCAND . EXP).
+If X is zero, both parts (SGNFCAND and EXP) are zero.  */)
+     (x)
+     Lisp_Object x;
+{
+  double f = XFLOATINT (x);
+
+  if (f == 0.0)
+    return Fcons (make_float (0.0), make_number (0));
+  else
+    {
+      int    exp;
+      double sgnfcand = frexp (f, &exp);
+      return Fcons (make_float (sgnfcand), make_number (exp));
+    }
+}
+
+DEFUN ("ldexp", Fldexp, Sldexp, 1, 2, 0,
+       doc: /* Construct number X from significand SGNFCAND and exponent EXP.
+Returns the floating point value resulting from multiplying SGNFCAND
+(the significand) by 2 raised to the power of EXP (the exponent).   */)
+     (sgnfcand, exp)
+     Lisp_Object sgnfcand, exp;
+{
+  CHECK_NUMBER (exp);
+  return make_float (ldexp (XFLOATINT (sgnfcand), XINT (exp)));
+}
+#endif
 
 #if 0 /* Leave these out unless we find there's a reason for them.  */
 
@@ -1017,6 +1081,12 @@
   defsubr (&Scos);
   defsubr (&Ssin);
   defsubr (&Stan);
+#if defined HAVE_ISNAN && defined HAVE_COPYSIGN
+  defsubr (&Sisnan);
+  defsubr (&Scopysign);
+  defsubr (&Sfrexp);
+  defsubr (&Sldexp);
+#endif 
 #if 0
   defsubr (&Sacosh);
   defsubr (&Sasinh);
--- a/src/fringe.c	Thu May 06 09:50:39 2010 +0900
+++ b/src/fringe.c	Mon May 10 12:37:03 2010 +0900
@@ -1082,7 +1082,8 @@
 	  left = row->left_user_fringe_bitmap;
 	  left_face_id = row->left_user_fringe_face_id;
 	}
-      else if (row->truncated_on_left_p)
+      else if ((!row->reversed_p && row->truncated_on_left_p)
+	       || (row->reversed_p && row->truncated_on_right_p))
 	left = LEFT_FRINGE(0, Qtruncation, 0);
       else if (row->indicate_bob_p && EQ (boundary_top, Qleft))
 	left = ((row->indicate_eob_p && EQ (boundary_bot, Qleft))
@@ -1110,7 +1111,8 @@
 	  right = row->right_user_fringe_bitmap;
 	  right_face_id = row->right_user_fringe_face_id;
 	}
-      else if (row->truncated_on_right_p)
+      else if ((!row->reversed_p && row->truncated_on_right_p)
+	       || (row->reversed_p && row->truncated_on_left_p))
 	right = RIGHT_FRINGE (0, Qtruncation, 0);
       else if (row->indicate_bob_p && EQ (boundary_top, Qright))
 	right = ((row->indicate_eob_p && EQ (boundary_bot, Qright))
--- a/src/ftfont.c	Thu May 06 09:50:39 2010 +0900
+++ b/src/ftfont.c	Mon May 10 12:37:03 2010 +0900
@@ -1578,6 +1578,14 @@
 
 #ifdef HAVE_M17N_FLT
 
+#if ((LIBOTF_MAJOR_VERSION > 1) || (LIBOTF_RELEASE_NUMBER >= 10) \
+     && (M17NLIB_MAJOR_VERSION > 1) || (M17NLIB_MINOR_VERSION >= 6))
+/* We can use the new feature of libotf and m17n-flt to handle the
+   character encoding scheme introduced in Unicode 5.1 and 5.2 for
+   some Agian scripts.  */
+#define M17N_FLT_USE_NEW_FEATURE
+#endif
+
 struct MFLTFontFT
 {
   MFLTFont flt_font;
@@ -1696,10 +1704,16 @@
 	  else
 	    tags[n] = spec->features[i][n];
 	}
+#ifdef M17N_FLT_USE_NEW_FEATURE
+      if (OTF_check_features (otf, i == 0, spec->script, spec->langsys,
+			      tags, n - negative) != 1)
+	return 0;
+#else  /* not M17N_FLT_USE_NEW_FEATURE */
       if (n - negative > 0
 	  && OTF_check_features (otf, i == 0, spec->script, spec->langsys,
 				 tags, n - negative) != 1)
 	return 0;
+#endif	/* not M17N_FLT_USE_NEW_FEATURE */
     }
   return 1;
 }
@@ -1757,6 +1771,356 @@
   memset (otf_gstring.glyphs, 0, sizeof (OTF_Glyph) * size);
 }
 
+#ifdef M17N_FLT_USE_NEW_FEATURE
+
+/* Pack 32-bit OTF tag (0x7F7F7F7F) into 28-bit (0x0FFFFFFF).  */
+#define PACK_OTF_TAG(TAG)	\
+  ((((TAG) & 0x7F000000) >> 3)	\
+    | (((TAG) & 0x7F0000) >> 2)	\
+    | (((TAG) & 0x7F00) >> 1)	\
+    | ((TAG) & 0x7F))
+
+/* Assuming that FONT is an OpenType font, apply OpenType features
+   specified in SPEC on glyphs between FROM and TO of IN, and record
+   the lastly applied feature in each glyph of IN.  If OUT is not
+   NULL, append the resulting glyphs to OUT while storing glyph
+   position adjustment information in ADJUSTMENT.  */
+
+static int
+ftfont_drive_otf (font, spec, in, from, to, out, adjustment)
+     MFLTFont *font;
+     MFLTOtfSpec *spec;
+     MFLTGlyphString *in;
+     int from, to;
+     MFLTGlyphString *out;
+     MFLTGlyphAdjustment *adjustment;
+{
+  struct MFLTFontFT *flt_font_ft = (struct MFLTFontFT *) font;
+  FT_Face ft_face = flt_font_ft->ft_face;
+  OTF *otf = flt_font_ft->otf;
+  int len = to - from;
+  int i, j, gidx;
+  OTF_Glyph *otfg;
+  char script[5], *langsys = NULL;
+  char *gsub_features = NULL, *gpos_features = NULL;
+  OTF_Feature *features;
+
+  if (len == 0)
+    return from;
+  OTF_tag_name (spec->script, script);
+  if (spec->langsys)
+    {
+      langsys = alloca (5);
+      OTF_tag_name (spec->langsys, langsys);
+    }
+  for (i = 0; i < 2; i++)
+    {
+      char *p;
+
+      if (spec->features[i] && spec->features[i][1] != 0xFFFFFFFF)
+	{
+	  for (j = 0; spec->features[i][j]; j++);
+	  if (i == 0)
+	    p = gsub_features = alloca (6 * j);
+	  else
+	    p = gpos_features = alloca (6 * j);
+	  for (j = 0; spec->features[i][j]; j++)
+	    {
+	      if (spec->features[i][j] == 0xFFFFFFFF)
+		*p++ = '*', *p++ = ',';
+	      else
+		{
+		  OTF_tag_name (spec->features[i][j], p);
+		  p[4] = ',';
+		  p += 5;
+		}
+	    }
+	  *--p = '\0';
+	}
+    }
+
+  setup_otf_gstring (len);
+  for (i = 0; i < len; i++)
+    {
+      otf_gstring.glyphs[i].c = in->glyphs[from + i].c;
+      otf_gstring.glyphs[i].glyph_id = in->glyphs[from + i].code;
+    }
+
+  OTF_drive_gdef (otf, &otf_gstring);
+  gidx = out ? out->used : from;
+
+  if (gsub_features && out)
+    {
+      if (OTF_drive_gsub_with_log (otf, &otf_gstring, script, langsys,
+				   gsub_features) < 0)
+	goto simple_copy;
+      if (out->allocated < out->used + otf_gstring.used)
+	return -2;
+      features = otf->gsub->FeatureList.Feature;
+      for (i = 0, otfg = otf_gstring.glyphs; i < otf_gstring.used; )
+	{
+	  MFLTGlyph *g;
+	  int min_from, max_to;
+	  int j;
+	  int feature_idx = otfg->positioning_type >> 4;
+
+	  g = out->glyphs + out->used;
+	  *g = in->glyphs[from + otfg->f.index.from];
+	  if (g->code != otfg->glyph_id)
+	    {
+	      g->c = 0;
+	      g->code = otfg->glyph_id;
+	      g->measured = 0;
+	    }
+	  out->used++;
+	  min_from = g->from;
+	  max_to = g->to;
+	  if (otfg->f.index.from < otfg->f.index.to)
+	    {
+	      /* OTFG substitutes multiple glyphs in IN.  */
+	      for (j = from + otfg->f.index.from + 1;
+		   j <= from + otfg->f.index.to; j++)
+		{
+		  if (min_from > in->glyphs[j].from)
+		    min_from = in->glyphs[j].from;
+		  if (max_to < in->glyphs[j].to)
+		    max_to = in->glyphs[j].to;
+		}
+	      g->from = min_from;
+	      g->to = max_to;
+	    }
+	  if (feature_idx)
+	    {
+	      unsigned int tag = features[feature_idx - 1].FeatureTag;
+	      tag = PACK_OTF_TAG (tag);
+	      g->internal = (g->internal & ~0x1FFFFFFF) | tag;
+	    }
+	  for (i++, otfg++; (i < otf_gstring.used
+			     && otfg->f.index.from == otfg[-1].f.index.from);
+	       i++, otfg++)
+	    {
+	      g = out->glyphs + out->used;
+	      *g = in->glyphs[from + otfg->f.index.to];
+	      if (g->code != otfg->glyph_id)
+		{
+		  g->c = 0;
+		  g->code = otfg->glyph_id;
+		  g->measured = 0;
+		}
+	      feature_idx = otfg->positioning_type >> 4;
+	      if (feature_idx)
+		{
+		  unsigned int tag = features[feature_idx - 1].FeatureTag;
+		  tag = PACK_OTF_TAG (tag);
+		  g->internal = (g->internal & ~0x1FFFFFFF) | tag;
+		}
+	      out->used++;
+	    }
+	}
+    }
+  else if (gsub_features)
+    {
+      /* Just for checking which features will be applied.  */
+      if (OTF_drive_gsub_with_log (otf, &otf_gstring, script, langsys,
+				   gsub_features) < 0)
+	goto simple_copy;
+      features = otf->gsub->FeatureList.Feature;
+      for (i = 0, otfg = otf_gstring.glyphs; i < otf_gstring.used; i++,
+	     otfg++)
+	{
+	  int feature_idx = otfg->positioning_type >> 4;
+
+	  if (feature_idx)
+	    {
+	      unsigned int tag = features[feature_idx - 1].FeatureTag;
+	      tag = PACK_OTF_TAG (tag);
+	      for (j = otfg->f.index.from; j <= otfg->f.index.to; j++)
+		{
+		  MFLTGlyph *g = in->glyphs + (from + j);
+		  g->internal = (g->internal & ~0x1FFFFFFF) | tag;
+		}
+	    }
+	}
+    }
+  else if (out)
+    {
+      if (out->allocated < out->used + len)
+	return -2;
+      for (i = 0; i < len; i++)
+	out->glyphs[out->used++] = in->glyphs[from + i];
+    }
+
+  if (gpos_features && out)
+    {
+      MFLTGlyph *base = NULL, *mark = NULL, *g;
+      int x_ppem, y_ppem, x_scale, y_scale;
+
+      if (OTF_drive_gpos_with_log (otf, &otf_gstring, script, langsys,
+				   gpos_features) < 0)
+	return to;
+      features = otf->gpos->FeatureList.Feature;
+      x_ppem = ft_face->size->metrics.x_ppem;
+      y_ppem = ft_face->size->metrics.y_ppem;
+      x_scale = ft_face->size->metrics.x_scale;
+      y_scale = ft_face->size->metrics.y_scale;
+
+      for (i = 0, otfg = otf_gstring.glyphs, g = out->glyphs + gidx;
+	   i < otf_gstring.used; i++, otfg++, g++)
+	{
+	  MFLTGlyph *prev;
+	  int feature_idx = otfg->positioning_type >> 4;
+
+	  if (feature_idx)
+	    {
+	      unsigned int tag = features[feature_idx - 1].FeatureTag;
+	      tag = PACK_OTF_TAG (tag);
+	      g->internal = (g->internal & ~0x1FFFFFFF) | tag;
+	    }
+
+	  if (! otfg->glyph_id)
+	    continue;
+	  switch (otfg->positioning_type & 0xF)
+	    {
+	    case 0:
+	      break;
+	    case 1: 		/* Single */
+	    case 2: 		/* Pair */
+	      {
+		int format = otfg->f.f1.format;
+
+		if (format & OTF_XPlacement)
+		  adjustment[i].xoff
+		    = otfg->f.f1.value->XPlacement * x_scale / 0x10000;
+		if (format & OTF_XPlaDevice)
+		  adjustment[i].xoff
+		    += DEVICE_DELTA (otfg->f.f1.value->XPlaDevice, x_ppem);
+		if (format & OTF_YPlacement)
+		  adjustment[i].yoff
+		    = - (otfg->f.f1.value->YPlacement * y_scale / 0x10000);
+		if (format & OTF_YPlaDevice)
+		  adjustment[i].yoff
+		    -= DEVICE_DELTA (otfg->f.f1.value->YPlaDevice, y_ppem);
+		if (format & OTF_XAdvance)
+		  adjustment[i].xadv
+		    += otfg->f.f1.value->XAdvance * x_scale / 0x10000;
+		if (format & OTF_XAdvDevice)
+		  adjustment[i].xadv
+		    += DEVICE_DELTA (otfg->f.f1.value->XAdvDevice, x_ppem);
+		if (format & OTF_YAdvance)
+		  adjustment[i].yadv
+		    += otfg->f.f1.value->YAdvance * y_scale / 0x10000;
+		if (format & OTF_YAdvDevice)
+		  adjustment[i].yadv
+		    += DEVICE_DELTA (otfg->f.f1.value->YAdvDevice, y_ppem);
+		adjustment[i].set = 1;
+	      }
+	      break;
+	    case 3:		/* Cursive */
+	      /* Not yet supported.  */
+	      break;
+	    case 4:		/* Mark-to-Base */
+	    case 5:		/* Mark-to-Ligature */
+	      if (! base)
+		break;
+	      prev = base;
+	      goto label_adjust_anchor;
+	    default:		/* i.e. case 6 Mark-to-Mark */
+	      if (! mark)
+		break;
+	      prev = mark;
+
+	    label_adjust_anchor:
+	      {
+		int base_x, base_y, mark_x, mark_y;
+		int this_from, this_to;
+
+		base_x = otfg->f.f4.base_anchor->XCoordinate * x_scale / 0x10000;
+		base_y = otfg->f.f4.base_anchor->YCoordinate * y_scale / 0x10000;
+		mark_x = otfg->f.f4.mark_anchor->XCoordinate * x_scale / 0x10000;
+		mark_y = otfg->f.f4.mark_anchor->YCoordinate * y_scale / 0x10000;
+
+		if (otfg->f.f4.base_anchor->AnchorFormat != 1)
+		  adjust_anchor (ft_face, otfg->f.f4.base_anchor,
+				 prev->code, x_ppem, y_ppem, &base_x, &base_y);
+		if (otfg->f.f4.mark_anchor->AnchorFormat != 1)
+		  adjust_anchor (ft_face, otfg->f.f4.mark_anchor, g->code,
+				 x_ppem, y_ppem, &mark_x, &mark_y);
+		adjustment[i].xoff = (base_x - mark_x);
+		adjustment[i].yoff = - (base_y - mark_y);
+		adjustment[i].back = (g - prev);
+		adjustment[i].xadv = 0;
+		adjustment[i].advance_is_absolute = 1;
+		adjustment[i].set = 1;
+		this_from = g->from;
+		this_to = g->to;
+		for (j = 0; prev + j < g; j++)
+		  {
+		    if (this_from > prev[j].from)
+		      this_from = prev[j].from;
+		    if (this_to < prev[j].to)
+		      this_to = prev[j].to;
+		  }
+		for (; prev <= g; prev++)
+		  {
+		    prev->from = this_from;
+		    prev->to = this_to;
+		  }
+	      }
+	    }
+	  if (otfg->GlyphClass == OTF_GlyphClass0)
+	    base = mark = g;
+	  else if (otfg->GlyphClass == OTF_GlyphClassMark)
+	    mark = g;
+	  else
+	    base = g;
+	}
+    }
+  else if (gpos_features)
+    {
+      if (OTF_drive_gpos_with_log (otf, &otf_gstring, script, langsys,
+				   gpos_features) < 0)
+	return to;
+      features = otf->gpos->FeatureList.Feature;
+      for (i = 0, otfg = otf_gstring.glyphs; i < otf_gstring.used;
+	   i++, otfg++)
+	if (otfg->positioning_type & 0xF)
+	  {
+	    int feature_idx = otfg->positioning_type >> 4;
+
+	    if (feature_idx)
+	      {
+		unsigned int tag = features[feature_idx - 1].FeatureTag;
+		tag = PACK_OTF_TAG (tag);
+		for (j = otfg->f.index.from; j <= otfg->f.index.to; j++)
+		  {
+		    MFLTGlyph *g = in->glyphs + (from + j);
+		    g->internal = (g->internal & ~0x1FFFFFFF) | tag;
+		  }
+	      }
+	  }
+    }
+  return to;
+
+ simple_copy:
+  if (! out)
+    return to;
+  if (out->allocated < out->used + len)
+    return -2;
+  font->get_metrics (font, in, from, to);
+  memcpy (out->glyphs + out->used, in->glyphs + from,
+	  sizeof (MFLTGlyph) * len);
+  out->used += len;
+  return to;
+}
+
+static int 
+ftfont_try_otf (MFLTFont *font, MFLTOtfSpec *spec,
+		MFLTGlyphString *in, int from, int to)
+{
+  return ftfont_drive_otf (font, spec, in, from, to, NULL, NULL);
+}
+
+#else  /* not M17N_FLT_USE_NEW_FEATURE */
 
 static int
 ftfont_drive_otf (font, spec, in, from, to, out, adjustment)
@@ -2011,6 +2375,8 @@
   return to;
 }
 
+#endif	/* not M17N_FLT_USE_NEW_FEATURE */
+
 static MFLTGlyphString gstring;
 
 static int m17n_flt_initialized;
@@ -2034,6 +2400,10 @@
   if (! m17n_flt_initialized)
     {
       M17N_INIT ();
+#ifdef M17N_FLT_USE_NEW_FEATURE
+      mflt_enable_new_feature = 1;
+      mflt_try_otf = ftfont_try_otf;
+#endif	/* M17N_FLT_USE_NEW_FEATURE */
       m17n_flt_initialized = 1;
     }
 
--- a/src/gtkutil.c	Thu May 06 09:50:39 2010 +0900
+++ b/src/gtkutil.c	Mon May 10 12:37:03 2010 +0900
@@ -3778,7 +3778,9 @@
 
   gtk_box_reorder_child (GTK_BOX (x->vbox_widget), x->handlebox_widget,
                          vbox_pos);
-  gtk_widget_show_all (x->handlebox_widget);
+
+  gtk_widget_show (x->toolbar_widget);
+  gtk_widget_show (x->handlebox_widget);
 }
 
 /* Create a tool bar for frame F.  */
@@ -3794,13 +3796,6 @@
 
   gtk_widget_set_name (x->toolbar_widget, "emacs-toolbar");
 
-  /* We only have icons, so override any user setting.  We could
-     use the caption property of the toolbar item (see update_frame_tool_bar
-     below), but some of those strings are long, making the toolbar so
-     long it does not fit on the screen.  The GtkToolbar widget makes every
-     item equal size, so the longest caption determine the size of every
-     tool bar item.  I think the creators of the GtkToolbar widget
-     counted on 4 or 5 character long strings.  */
   gtk_toolbar_set_style (GTK_TOOLBAR (x->toolbar_widget), GTK_TOOLBAR_ICONS);
   gtk_toolbar_set_orientation (GTK_TOOLBAR (x->toolbar_widget),
                                GTK_ORIENTATION_HORIZONTAL);
@@ -3877,8 +3872,6 @@
                         G_CALLBACK (xg_tool_bar_callback),
                         (gpointer) (EMACS_INT) i);
 
-      gtk_widget_show_all (GTK_WIDGET (ti));
-
       g_object_set_data (G_OBJECT (weventbox), XG_FRAME_DATA, (gpointer)f);
 
       /* Catch expose events to overcome an annoying redraw bug, see
@@ -3963,6 +3956,7 @@
   else gtk_widget_hide (wlbl);
   if (show_image) gtk_widget_show (wimage);
   else gtk_widget_hide (wimage);
+  gtk_widget_show (GTK_WIDGET (weventbox));
   gtk_widget_show (GTK_WIDGET (vb));
   gtk_widget_show (GTK_WIDGET (wbutton));
   gtk_widget_show (GTK_WIDGET (ti));
--- a/src/lisp.h	Thu May 06 09:50:39 2010 +0900
+++ b/src/lisp.h	Mon May 10 12:37:03 2010 +0900
@@ -2381,7 +2381,7 @@
 				     Lisp_Object)) NO_RETURN;
 extern Lisp_Object wrong_type_argument P_ ((Lisp_Object, Lisp_Object)) NO_RETURN;
 extern Lisp_Object do_symval_forwarding (union Lisp_Fwd *);
-extern void set_internal (Lisp_Object, Lisp_Object, struct buffer *, int);
+extern void set_internal (Lisp_Object, Lisp_Object, Lisp_Object, int);
 extern void syms_of_data P_ ((void));
 extern void init_data P_ ((void));
 extern void swap_in_global_binding P_ ((struct Lisp_Symbol *));
@@ -3059,6 +3059,7 @@
 EXFUN (Ffile_executable_p, 1);
 EXFUN (Fread_file_name, 6);
 extern Lisp_Object close_file_unwind P_ ((Lisp_Object));
+extern Lisp_Object restore_point_unwind P_ ((Lisp_Object));
 extern void report_file_error P_ ((const char *, Lisp_Object)) NO_RETURN;
 extern int internal_delete_file P_ ((Lisp_Object, Lisp_Object));
 extern void syms_of_fileio P_ ((void));
--- a/src/m/alpha.h	Thu May 06 09:50:39 2010 +0900
+++ b/src/m/alpha.h	Mon May 10 12:37:03 2010 +0900
@@ -20,25 +20,12 @@
 You should have received a copy of the GNU General Public License
 along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
-
-/* The following line tells the configuration script what sort of
-   operating system this machine is likely to run.
-   USUAL-OPSYS="note"
-
-NOTE-START
-Use -opsystem=osf1
-NOTE-END
-
-*/
-
 #ifndef _LP64
-#define _LP64			/* This doesn't appear to be necessary
-				   on OSF 4/5  -- fx.  */
+#define _LP64 /* This doesn't appear to be necessary on OSF 4/5  -- fx.  */
 #endif
 
 /* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
    is the most significant byte.  */
-
 #undef WORDS_BIG_ENDIAN
 
 /* Now define a symbol for the cpu type, if your compiler
@@ -52,15 +39,12 @@
    are always unsigned.
 
    This flag only matters if you use USE_LISP_UNION_TYPE.  */
-
 #define EXPLICIT_SIGN_EXTEND
 
 /* Data type of load average, as read out of kmem.  */
-
 #define LOAD_AVE_TYPE long
 
 /* Convert that into an integer that is 100 for a load average of 1.0  */
-
 #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
 
 /* GNU malloc and the relocating allocator do not work together
--- a/src/m/ibmrs6000.h	Thu May 06 09:50:39 2010 +0900
+++ b/src/m/ibmrs6000.h	Mon May 10 12:37:03 2010 +0900
@@ -1,6 +1,6 @@
 /* R2 AIX machine/system dependent defines
-   Copyright (C) 1988, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-                 2008, 2009, 2010  Free Software Foundation, Inc.
+   Copyright (C) 1988, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+                 2009, 2010  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -18,13 +18,6 @@
 along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 
-/* The following line tells the configuration script what sort of
-   operating system this machine is likely to run.
-   USUAL-OPSYS="aix3-1"  */
-
-/* Now define a symbol for the cpu type, if your compiler
-   does not define it automatically.  */
-
 /* The data segment in this machine always starts at address 0x20000000.
    An address of data cannot be stored correctly in a Lisp object;
    we always lose the high bits.  We must tell XPNTR to add them back.  */
@@ -43,7 +36,6 @@
 #undef ADDR_CORRECT
 #define ADDR_CORRECT(x) ((int)(x))
 
-#define START_FILES
 /*** BUILD 9008 - FIONREAD problem still exists in X-Windows. ***/
 #define BROKEN_FIONREAD
 /* As we define BROKEN_FIONREAD, SIGIO will be undefined in systty.h.
--- a/src/m/ibms390.h	Thu May 06 09:50:39 2010 +0900
+++ b/src/m/ibms390.h	Mon May 10 12:37:03 2010 +0900
@@ -18,13 +18,8 @@
 along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 
-/* The following line tells the configuration script what sort of
-   operating system this machine is likely to run.
-   USUAL-OPSYS="<name of system .h file here, without the s- or .h>"  */
-
 /* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
    is the most significant byte.  */
-
 #define WORDS_BIG_ENDIAN
 
 /* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend
@@ -32,15 +27,12 @@
    are always unsigned.
 
    This flag only matters if you use USE_LISP_UNION_TYPE.  */
-
 #define EXPLICIT_SIGN_EXTEND
 
 /* Data type of load average, as read out of kmem.  */
-
 #define LOAD_AVE_TYPE long
 
 /* Convert that into an integer that is 100 for a load average of 1.0  */
-
 #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
 
 /* Define VIRT_ADDR_VARIES if the virtual addresses of
@@ -49,7 +41,6 @@
 
    Otherwise Emacs assumes that text space precedes data space,
    numerically.  */
-
 #define VIRT_ADDR_VARIES
 
 /* arch-tag: d8a0ffa4-a8f0-4736-90d3-7fd7b21b8314
--- a/src/m/ibms390x.h	Thu May 06 09:50:39 2010 +0900
+++ b/src/m/ibms390x.h	Mon May 10 12:37:03 2010 +0900
@@ -21,23 +21,12 @@
    into ibms390.h.  */
 
 
-/* The following line tells the configuration script what sort of
-   operating system this machine is likely to run.
-   USUAL-OPSYS="<name of system .h file here, without the s- or .h>"
-
-NOTE-START
-IBM s390 64 bits (-machine=ibms390x64)
-
-  The possibilities for -opsystem are: gnu-linux.
-
-NOTE-END */
-
+/* Used for machine IBM s390 64 bits with opsys gnu-linux.  */
 #define BITS_PER_LONG 64
 #define BITS_PER_EMACS_INT 64
 
 /* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
    is the most significant byte.  */
-
 #define WORDS_BIG_ENDIAN
 
 /* Define the type to use.  */
@@ -49,15 +38,12 @@
    are always unsigned.
 
    This flag only matters if you use USE_LISP_UNION_TYPE.  */
-
 #undef EXPLICIT_SIGN_EXTEND
 
 /* Data type of load average, as read out of kmem.  */
-
 #define LOAD_AVE_TYPE long
 
 /* Convert that into an integer that is 100 for a load average of 1.0  */
-
 #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
 
 /* Define VIRT_ADDR_VARIES if the virtual addresses of
@@ -66,23 +52,19 @@
 
    Otherwise Emacs assumes that text space precedes data space,
    numerically.  */
-
 #define VIRT_ADDR_VARIES
 
 /* Define HAVE_ALLOCA to say that the system provides a properly
    working alloca function and it should be used.  Undefine it if an
    assembler-language alloca in the file alloca.s should be used. */
-
 #define HAVE_ALLOCA
 
 /* On the 64 bit architecture, we can use 60 bits for addresses */
-
 #define VALBITS         60
 
 #define LINKER $(CC) -nostdlib
 
 /* Define XPNTR to avoid or'ing with DATA_SEG_BITS */
-
 #define XPNTR(a) XUINT (a)
 
 /* arch-tag: 4b87653c-6add-4663-8691-7d9dc17b5519
--- a/src/m/intel386.h	Thu May 06 09:50:39 2010 +0900
+++ b/src/m/intel386.h	Mon May 10 12:37:03 2010 +0900
@@ -1,6 +1,6 @@
 /* Machine description file for intel 386.
-   Copyright (C) 1987, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-                 2008, 2009, 2010  Free Software Foundation, Inc.
+   Copyright (C) 1987, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+                 2009, 2010  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -18,25 +18,8 @@
 along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 
-/* The following line tells the configuration script what sort of
-   operating system this machine is likely to run.
-   USUAL-OPSYS="note"
-
-NOTE-START
-Intel 386 (-machine=intel386)
-
-  The possibilities for -opsystem are: bsd4-2, usg5-2-2, usg5-3,
-  isc2-2, 386-ix, and linux.
-
-  18.58 should support a wide variety of operating systems.
-  Use linux for Linux.
-  It isn't clear what to do on an SCO system.
-
-NOTE-END */
-
 /* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
    is the most significant byte.  */
-
 #undef WORDS_BIG_ENDIAN
 
 #ifdef USG
--- a/src/m/sparc.h	Thu May 06 09:50:39 2010 +0900
+++ b/src/m/sparc.h	Mon May 10 12:37:03 2010 +0900
@@ -1,6 +1,6 @@
 /* machine description file for Sun 4 SPARC.
-   Copyright (C) 1987, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-                 2008, 2009, 2010  Free Software Foundation, Inc.
+   Copyright (C) 1987, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+                 2009, 2010  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -17,47 +17,34 @@
 You should have received a copy of the GNU General Public License
 along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
-/* The following line tells the configuration script what sort of
-   operating system this machine is likely to run.
-   USUAL-OPSYS="note"
-
-NOTE-START
-Use -opsystem=sunos4 for operating system version 4, and
--opsystem=bsd4-2 for earlier versions.
-NOTE-END  */
-
 /* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
    is the most significant byte.  */
-
 #define WORDS_BIG_ENDIAN
 
 /* __sparc__ is defined by the compiler by default.  */
 
 /* XINT must explicitly sign-extend
    This flag only matters if you use USE_LISP_UNION_TYPE.  */
-
 #define EXPLICIT_SIGN_EXTEND
 
 /* Data type of load average, as read out of kmem.  */
-
 #define LOAD_AVE_TYPE long
 
 /* Convert that into an integer that is 100 for a load average of 1.0  */
-
 #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
 
 /* Mask for address bits within a memory segment */
-
 #define SEGMENT_MASK (SEGSIZ - 1)
 
 #ifdef __arch64__		/* GCC, 64-bit ABI.  */
+
 #define BITS_PER_LONG 64
 
 #ifndef _LP64
-#define _LP64			/* Done on Alpha -- not sure if it
-				   should be here.  -- fx */
+#define _LP64 /* Done on Alpha -- not sure if it should be here.  -- fx */
 #endif
-#endif
+
+#endif  /* __arch64__ */
 
 /* arch-tag: 0a6f7882-33fd-4811-9832-7466c51e50f7
    (do not change this comment) */
--- a/src/m/vax.h	Thu May 06 09:50:39 2010 +0900
+++ b/src/m/vax.h	Mon May 10 12:37:03 2010 +0900
@@ -18,18 +18,8 @@
 along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 
-/* The following line tells the configuration script what sort of
-   operating system this machine is likely to run.
-   USUAL-OPSYS="note"
-
-NOTE-START
-The vax (-machine=vax) runs zillions of different operating systems.
-
-NOTE-END  */
-
 /* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
    is the most significant byte.  */
-
 #undef WORDS_BIG_ENDIAN
 
 /* #define vax    -- appears to be done automatically  */
@@ -38,11 +28,9 @@
    support the load average, so disable it for them.  */
 
 /* Data type of load average, as read out of kmem.  */
-
 #define LOAD_AVE_TYPE double
 
 /* Convert that into an integer that is 100 for a load average of 1.0  */
-
 #define LOAD_AVE_CVT(x) ((int) ((x) * 100.0))
 
 #define HAVE_FTIME
--- a/src/makefile.w32-in	Thu May 06 09:50:39 2010 +0900
+++ b/src/makefile.w32-in	Mon May 10 12:37:03 2010 +0900
@@ -697,6 +697,7 @@
 	$(SRC)/commands.h \
 	$(SRC)/composite.h \
 	$(SRC)/dispextern.h \
+	$(SRC)/frame.h \
 	$(SRC)/keyboard.h \
 	$(SRC)/systime.h \
 	$(SRC)/w32gui.h
@@ -1554,6 +1555,7 @@
 	$(SRC)/keyboard.h \
 	$(SRC)/systime.h \
 	$(SRC)/termhooks.h \
+	$(SRC)/w32.h \
 	$(SRC)/w32font.h \
 	$(SRC)/w32gui.h \
 	$(SRC)/w32heap.h \
--- a/src/msdos.c	Thu May 06 09:50:39 2010 +0900
+++ b/src/msdos.c	Mon May 10 12:37:03 2010 +0900
@@ -528,8 +528,7 @@
   /* If the user specified a special video mode for these dimensions,
      use that mode.  */
   sprintf (video_name, "screen-dimensions-%dx%d", *rows, *cols);
-  video_mode = XSYMBOL (Fintern_soft (build_string (video_name),
-				      Qnil))-> value;
+  video_mode = Fsymbol_value (Fintern_soft (build_string (video_name), Qnil));
 
   if (INTEGERP (video_mode)
       && (video_mode_value = XINT (video_mode)) > 0)
--- a/src/s/aix4-2.h	Thu May 06 09:50:39 2010 +0900
+++ b/src/s/aix4-2.h	Mon May 10 12:37:03 2010 +0900
@@ -87,31 +87,10 @@
 #define LINKER cc
 #endif
 
-/* No need to specify -lc when linking.  */
-
-#define LIB_STANDARD
-
-/* -lpthreads seems to be necessary for Xlib in X11R6, and should be harmless
-   on older versions of X where it happens to exist.  */
-#ifdef HAVE_LIBPTHREADS
-#define LIBS_SYSTEM -lrts -lIM -liconv -lpthreads
-#else
-/* IBM's X11R5 use -lIM and -liconv in AIX 3.2.2.  */
-#define LIBS_SYSTEM -lrts -lIM -liconv
-#endif
-
-
-/* Use terminfo instead of termcap.  */
-
-#define TERMINFO
-
 /* The following definition seems to be needed in AIX version 3.1.6.8.
    It may not have been needed in certain earlier versions.  */
 #define HAVE_TCATTR
 
-/* Include unistd.h, even though we don't define POSIX.  */
-#define NEED_UNISTD_H
-
 /* AIX doesn't define this.  */
 #define unix 1
 
@@ -122,7 +101,6 @@
 
 /* Perry Smith <pedz@ddivt1.austin.ibm.com> says these are correct.  */
 #define SIGNALS_VIA_CHARACTERS
-#define MAIL_USE_LOCKF
 #define CLASH_DETECTION
 
 /* Perry Smith <pedz@ddivt1.austin.ibm.com> says these are correct.  */
--- a/src/s/bsd-common.h	Thu May 06 09:50:39 2010 +0900
+++ b/src/s/bsd-common.h	Mon May 10 12:37:03 2010 +0900
@@ -1,6 +1,7 @@
 /* Definitions file for GNU Emacs running on bsd 4.3
-   Copyright (C) 1985, 1986, 2001, 2002, 2003, 2004, 2005, 2006,
-                 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
+
+Copyright (C) 1985, 1986, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+  2008, 2009, 2010  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -18,10 +19,8 @@
 along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 
-/*
- *	Define symbols to identify the version of Unix this is.
- *	Define all the symbols that apply correctly.
- */
+/*      Define symbols to identify the version of Unix this is.
+ *	Define all the symbols that apply correctly.   */
 
 /* We give these symbols the numeric values found in <sys/param.h> to
    avoid warnings about redefined macros.  */
@@ -55,61 +54,41 @@
    generated in the Makefile generated by `xmkmf'.  If we don't
    define NARROWPROTO, we will see the wrong function prototypes
    for X functions taking float or double parameters.  */
-
 #define NARROWPROTO 1
 
 /* SYSTEM_TYPE should indicate the kind of system you are using.
  It sets the Lisp variable system-type.  */
-
 #define SYSTEM_TYPE "berkeley-unix"
 
 /* Do not use interrupt_input = 1 by default, because in 4.3
    we can make noninterrupt input work properly.  */
-
 #undef INTERRUPT_INPUT
 
 /* First pty name is /dev/ptyp0.  */
-
 #define FIRST_PTY_LETTER 'p'
 
-/*
- *	Define HAVE_PTYS if the system supports pty devices.
- */
-
+/* Define HAVE_PTYS if the system supports pty devices.  */
 #define HAVE_PTYS
 
 /* Define HAVE_SOCKETS if system supports 4.2-compatible sockets.  */
-
 #define HAVE_SOCKETS
 
 /* Define this symbol if your system has the functions bcopy, etc. */
-
 #define BSTRING
 
-/* define MAIL_USE_FLOCK if the mailer uses flock
-   to interlock access to /usr/spool/mail/$USER.
-   The alternative is that a lock file named
-   /usr/spool/mail/$USER.lock.  */
-
-#define MAIL_USE_FLOCK
-
 /* Define CLASH_DETECTION if you want lock files to be written
    so that Emacs can tell instantly when you try to modify
    a file that someone else has modified in his Emacs.  */
-
 #define CLASH_DETECTION
 
 /* The file containing the kernel's symbol table is called /vmunix.  */
-
 #define KERNEL_FILE "/vmunix"
 
 /* The symbol in the kernel where the load average is found
    is named _avenrun.  */
-
 #define LDAV_SYMBOL "_avenrun"
 
 /* Send signals to subprocesses by "typing" special chars at them.  */
-
 #define SIGNALS_VIA_CHARACTERS
 
 /* arch-tag: 0c367245-bde3-492e-9029-3ff6898beb95
--- a/src/s/cygwin.h	Thu May 06 09:50:39 2010 +0900
+++ b/src/s/cygwin.h	Mon May 10 12:37:03 2010 +0900
@@ -106,10 +106,6 @@
 #define UNEXEC unexcw.o
 #define LINKER $(CC)
 
-/* Use terminfo instead of termcap.  Fewer environment variables to
-   go wrong, more terminal types. */
-#define TERMINFO
-
 #define HAVE_SOCKETS
 
 /* vfork() interacts badly with setsid(), causing ptys to fail to
@@ -134,11 +130,6 @@
 /* Don't link against static libgcc */
 #define LIB_GCC
 
-/* Don't list system libs on link command line */
-#define LIB_STANDARD
-
-#define START_FILES ecrt0.o
-
 /* the end */
 
 /* arch-tag: 5ae7ba00-83b0-4ab3-806a-3e845779191b
--- a/src/s/darwin.h	Thu May 06 09:50:39 2010 +0900
+++ b/src/s/darwin.h	Mon May 10 12:37:03 2010 +0900
@@ -1,6 +1,7 @@
 /* System description header file for Darwin (Mac OS X).
-   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-                 2008, 2009, 2010 Free Software Foundation, Inc.
+
+Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+  2010  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -18,10 +19,8 @@
 along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 
-/*
- *	Define symbols to identify the version of Unix this is.
- *	Define all the symbols that apply correctly.
- */
+/*	Define symbols to identify the version of Unix this is.
+ *	Define all the symbols that apply correctly.  */
 
 #define BSD4_2
 /* BSD4_3 and BSD4_4 are already defined in sys/param.h */
@@ -31,13 +30,11 @@
    may not be defined on non-OSX Darwin, and we cannot define DARWIN
    here because Panther and lower CoreFoundation.h uses DARWIN to
    distinguish OS X from pure Darwin. */
-
 #define DARWIN_OS
 
 
 /* SYSTEM_TYPE should indicate the kind of system you are using.
  It sets the Lisp variable system-type.  */
-
 #define SYSTEM_TYPE "darwin"
 
 /* Emacs can read input using SIGIO and buffering characters itself,
@@ -61,12 +58,10 @@
    It would have Emacs fork off a separate process
    to read the input and send it to the true Emacs process
    through a pipe. */
-
 #define INTERRUPT_INPUT
 
 /* Letter to use in finding device name of first pty,
   if system supports pty's.  'a' means it is /dev/ptya0  */
-
 #define FIRST_PTY_LETTER 'p'
 
 /*
@@ -79,16 +74,13 @@
  *	Do not define both.  HAVE_TERMIOS is preferred, if it is
  *	supported on your system.
  */
-
 #define HAVE_TERMIOS
-
 #define NO_TERMIO
 
 /*
  *	Define HAVE_PTYS if the system supports pty devices.
  *      Note: PTYs are broken on darwin <6.  Use at your own risk.
  */
-
 #define HAVE_PTYS
 /* Run only once.  We need a `for'-loop because the code uses
    `continue'.  */
@@ -117,20 +109,11 @@
 #define MIN_PTY_KERNEL_VERSION '7'
 
 /* Define this symbol if your system has the functions bcopy, etc. */
-
 #define BSTRING
 
-/* define MAIL_USE_FLOCK if the mailer uses flock
-   to interlock access to /usr/spool/mail/$USER.
-   The alternative is that a lock file named
-   /usr/spool/mail/$USER.lock.  */
-
-#define MAIL_USE_FLOCK
-
 /* Define CLASH_DETECTION if you want lock files to be written
    so that Emacs can tell instantly when you try to modify
    a file that someone else has modified in his Emacs.  */
-
 #define CLASH_DETECTION
 
 /* Avoid the use of the name init_process (process.c) because it is
@@ -152,23 +135,18 @@
 #define HAVE_SOCKETS
 
 /* Definitions for how to dump.  Copied from nextstep.h.  */
-
 #define UNEXEC unexmacosx.o
 
-#define START_FILES pre-crt0.o
-
 /* start_of_text isn't actually used, so make it compile without error.  */
 #define TEXT_START (0)
 
 /* Definitions for how to compile & link.  */
-
 #ifdef HAVE_NS
 #define SYSTEM_PURESIZE_EXTRA 200000
 #endif
 
 /* On Darwin, res_init appears not to be useful: see bug#562 and
    http://lists.gnu.org/archive/html/emacs-devel/2007-11/msg01467.html  */
-
 #undef HAVE_RES_INIT
 #undef HAVE_LIBRESOLV
 
@@ -181,16 +159,6 @@
 #undef HAVE_POSIX_MEMALIGN
 #endif
 
-/* The ncurses library has been moved out of the System framework in
-   Mac OS X 10.2.  So if ./configure detects it, set the command-line
-   option to use it.  */
-#ifdef HAVE_LIBNCURSES
-#define LIBS_TERMCAP -lncurses
-/* This prevents crashes when running Emacs in Terminal.app under
-   10.2.  */
-#define TERMINFO
-#endif
-
 /* Link this program just by running cc.  */
 #define ORDINARY_LINK
 
--- a/src/s/freebsd.h	Thu May 06 09:50:39 2010 +0900
+++ b/src/s/freebsd.h	Mon May 10 12:37:03 2010 +0900
@@ -1,9 +1,8 @@
 /* System description header for FreeBSD systems.
-   This file describes the parameters that system description files
-   should define or not.
-   Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-                 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-                 Free Software Foundation, Inc.
+
+Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+  2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+  Free Software Foundation, Inc.
 
 Author: Shawn M. Carey
 (according to authors.el)
@@ -23,8 +22,6 @@
 You should have received a copy of the GNU General Public License
 along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#include <osreldate.h>
-
 /* Get most of the stuff from bsd-common */
 #include "bsd-common.h"
 
@@ -33,21 +30,6 @@
 
 #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)
 
-#define LIBS_SYSTEM -lutil
-#if __FreeBSD_version < 400000
-#define LIBS_TERMCAP -ltermcap
-#else
-#define TERMINFO
-#define LIBS_TERMCAP -lncurses
-#endif
-
-/* Let `ld' find image libs and similar things in /usr/local/lib.  The
-   system compiler, GCC, has apparently been modified to not look
-   there, contrary to what a stock GCC would do.  */
-
-#define LD_SWITCH_SYSTEM  -L/usr/local/lib
-#define START_FILES pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o $(CRT_DIR)/crtbegin.o
-#define LIB_STANDARD -lgcc -lc -lgcc $(CRT_DIR)/crtend.o $(CRT_DIR)/crtn.o
 #undef LIB_GCC
 #define LIB_GCC
 
--- a/src/s/gnu-linux.h	Thu May 06 09:50:39 2010 +0900
+++ b/src/s/gnu-linux.h	Mon May 10 12:37:03 2010 +0900
@@ -1,7 +1,7 @@
 /* This file is the configuration file for Linux-based GNU systems
-   Copyright (C) 1985, 1986, 1992, 1994, 1996, 1999, 2001, 2002, 2003, 2004,
-                 2005, 2006, 2007, 2008, 2009, 2010
-                 Free Software Foundation, Inc.
+
+Copyright (C) 1985, 1986, 1992, 1994, 1996, 1999, 2001, 2002, 2003, 2004,
+  2005, 2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -103,41 +103,15 @@
 #define HAVE_SOCKETS
 
 /* Define this symbol if your system has the functions bcopy, etc. */
-
 #define BSTRING
 
 /* This is used in list_system_processes.  */
 #define HAVE_PROCFS 1
 
-/* define MAIL_USE_FLOCK if the mailer uses flock
-   to interlock access to /usr/spool/mail/$USER.
-   The alternative is that a lock file named
-   /usr/spool/mail/$USER.lock.  */
-
-/* On GNU/Linux systems, both methods are used by various mail
-   programs.  I assume that most people are using newer mailers that
-   have heard of flock.  Change this if you need to. */
-/* Debian contains a patch which says: ``On Debian/GNU/Linux systems,
-   configure gets the right answers, and that means *NOT* using flock.
-   Using flock is guaranteed to be the wrong thing. See Debian Policy
-   for details.'' and then uses `#ifdef DEBIAN'.  Unfortunately the
-   Debian maintainer hasn't provided a clean fix for Emacs.
-   movemail.c will use `maillock' when MAILDIR, HAVE_LIBMAIL and
-   HAVE_MAILLOCK_H are defined, so the following appears to be the
-   correct logic.  -- fx */
-/* We must check for HAVE_LIBLOCKFILE too, as movemail does.
-   liblockfile is a Free Software replacement for libmail, used on
-   Debian systems and elsewhere. -rfr */
-
-#if !((defined (HAVE_LIBMAIL) || defined (HAVE_LIBLOCKFILE)) &&	\
-      defined (HAVE_MAILLOCK_H))
-#define MAIL_USE_FLOCK
-#endif
 
 /* Define CLASH_DETECTION if you want lock files to be written
    so that Emacs can tell instantly when you try to modify
    a file that someone else has modified in his Emacs.  */
-
 #define CLASH_DETECTION
 
 /* Here, on a separate page, add any special hacks needed
@@ -169,17 +143,6 @@
 /* Ask GCC where to find libgcc.a.  */
 #define LIB_GCC `$(CC) $(C_SWITCH_X_SITE) -print-libgcc-file-name`
 
-#define START_FILES pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o
-
-/* Here is how to find X Windows.  LD_SWITCH_X_SITE_AUX gives an -R option
-   that says where to find X windows at run time.  */
-
-#ifdef __mips__
-#define LD_SWITCH_SYSTEM -G 0 $(LD_SWITCH_X_SITE_AUX)
-#else
-#define LD_SWITCH_SYSTEM $(LD_SWITCH_X_SITE_AUX)
-#endif /* __mips__ */
-
 #ifdef emacs
 #define INTERRUPT_INPUT
 #endif
@@ -190,12 +153,6 @@
 
 #undef LIB_GCC
 #define LIB_GCC
-#define LIB_STANDARD -lgcc -lc -lgcc $(CRT_DIR)/crtn.o
-
-#ifdef HAVE_LIBNCURSES
-#define TERMINFO
-#define LIBS_TERMCAP -lncurses
-#endif
 
 #define UNEXEC unexelf.o
 
--- a/src/s/gnu.h	Thu May 06 09:50:39 2010 +0900
+++ b/src/s/gnu.h	Mon May 10 12:37:03 2010 +0900
@@ -28,13 +28,6 @@
 
 #define SIGNALS_VIA_CHARACTERS
 
-/* Tell Emacs that we are a terminfo based system; disable the use
-   of local termcap.  (GNU uses ncurses.) */
-#ifdef HAVE_LIBNCURSES
-#define TERMINFO
-#define LIBS_TERMCAP -lncurses
-#endif
-
 /* Use mmap directly for allocating larger buffers.  */
 #ifdef DOUG_LEA_MALLOC
 #undef REL_ALLOC
@@ -44,8 +37,6 @@
 #define ORDINARY_LINK
 #define DATA_START ({ extern int data_start; (char *) &data_start; })
 
-#define START_FILES
-
 /* Some losing code fails to include this and then assumes
    that because it is braindead that O_RDONLY==0.  */
 #ifndef NOT_C_CODE
--- a/src/s/hpux10-20.h	Thu May 06 09:50:39 2010 +0900
+++ b/src/s/hpux10-20.h	Mon May 10 12:37:03 2010 +0900
@@ -1,6 +1,7 @@
 /* System description file for hpux version 10.20.
-   Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-     2008, 2009, 2010  Free Software Foundation, Inc.
+
+Copyright (C) 1999, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+  2009, 2010  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -77,9 +78,6 @@
 
 /* Special hacks needed to make Emacs run on this system.  */
 
-/* Use the system provided termcap(3) library */
-#define TERMINFO
-
 /* In hpux, the symbol SIGIO is defined, but the feature
    doesn't work in the way Emacs needs it to.  */
 
@@ -91,9 +89,6 @@
 
 #define UNEXEC unexhp9k800.o
 
-/* Include the file bsdtty.h, since this machine has job control.  */
-#define NEED_BSDTTY
-
 /* This is how to get the device name of the tty end of a pty.  */
 #define PTY_TTY_NAME_SPRINTF \
             sprintf (pty_name, "/dev/pty/tty%c%x", c, i);
@@ -132,28 +127,18 @@
 /* AlainF 20-Jul-1996 says this is right.  */
 #define KERNEL_FILE "/stand/vmunix"
 
-#define LIBS_SYSTEM -l:libdld.sl
-
-#define LIB_STANDARD -lc
 
 /* Rainer Malzbender <rainer@displaytech.com> says definining
    HAVE_XRMSETDATABASE allows Emacs to compile on HP-UX 10.20
    using GCC.  */
-
 #ifndef HAVE_XRMSETDATABASE
 #define HAVE_XRMSETDATABASE
 #endif
 
-/* Make sure we get select from libc rather than from libcurses
-   because libcurses on HPUX 10.10 has a broken version of select.
-   We used to use -lc -lcurses, but this may be cleaner.  */
-#define LIBS_TERMCAP -ltermcap
-
 /* 2000-11-21: Temporarily disable Unix 98 large file support found by
    configure.  It fails on HPUX 11, at least, because it enables
    header sections which lose when `static' is defined away, as it is
    on HP-UX.  (You get duplicate symbol errors on linking). */
-
 #undef _FILE_OFFSET_BITS
 
 /* Define NO_REMAP if memory segmentation makes it not work well
@@ -163,8 +148,6 @@
 
 #define NO_REMAP
 
-#define START_FILES pre-crt0.o $(CRT_DIR)/crt0.o
-
 /* Define VIRT_ADDR_VARIES if the virtual addresses of
    pure and impure space as loaded can vary, and even their
    relative order cannot be relied on.
--- a/src/s/irix6-5.h	Thu May 06 09:50:39 2010 +0900
+++ b/src/s/irix6-5.h	Mon May 10 12:37:03 2010 +0900
@@ -27,10 +27,6 @@
 
 #define SETPGRP_RELEASES_CTTY
 
-#ifdef LIB_STANDARD
-#undef LIB_STANDARD
-#endif
-
 #ifdef SYSTEM_TYPE
 #undef SYSTEM_TYPE
 #endif
@@ -44,13 +40,8 @@
 /* Make process_send_signal work by "typing" a signal character on the pty.  */
 #define SIGNALS_VIA_CHARACTERS
 
-/* Use terminfo instead of termcap.  */
-
-#define TERMINFO
-
 /* Letter to use in finding device name of first pty,
   if system supports pty's.  'a' means it is /dev/ptya0  */
-
 #undef FIRST_PTY_LETTER
 #define FIRST_PTY_LETTER 'q'
 
@@ -94,21 +85,10 @@
 
 #define UNEXEC unexelf.o
 
-/* define MAIL_USE_FLOCK if the mailer uses flock
-   to interlock access to /usr/spool/mail/$USER.
-   The alternative is that a lock file named
-   /usr/spool/mail/$USER.lock.  */
-
-#define MAIL_USE_FLOCK
-
 #define NARROWPROTO 1
 
 #define USE_MMAP_FOR_BUFFERS 1
 
-/* arch-tag: ad0660e0-acf8-46ae-b866-4f3df5b1101b
-   (do not change this comment) */
-
-
 #if _MIPS_SZLONG == 64		/* -mabi=64 (gcc) or -64 (MIPSpro) */
 #define _LP64			/* lisp.h takes care of the rest */
 #endif /* _MIPS_SZLONG */
@@ -121,5 +101,8 @@
 #define GC_SETJMP_WORKS 1
 #define GC_MARK_STACK GC_MAKE_GCPROS_NOOPS
 
+/* arch-tag: ad0660e0-acf8-46ae-b866-4f3df5b1101b
+   (do not change this comment) */
+
 /* arch-tag: d7ad9ec2-54ad-4b2f-adf2-0070c5c63e83
    (do not change this comment) */
--- a/src/s/ms-w32.h	Thu May 06 09:50:39 2010 +0900
+++ b/src/s/ms-w32.h	Mon May 10 12:37:03 2010 +0900
@@ -1,6 +1,7 @@
 /* System description file for Windows NT.
-   Copyright (C) 1993, 1994, 1995, 2001, 2002, 2003, 2004, 2005, 2006,
-                 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
+
+Copyright (C) 1993, 1994, 1995, 2001, 2002, 2003, 2004, 2005, 2006,
+  2007, 2008, 2009, 2010  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -89,12 +90,6 @@
 
 #define COFF 1
 
-/* define MAIL_USE_FLOCK if the mailer uses flock
-   to interlock access to /usr/spool/mail/$USER.
-   The alternative is that a lock file named
-   /usr/spool/mail/$USER.lock.  */
-
-/* #define MAIL_USE_FLOCK */
 #define MAIL_USE_POP 1
 #define MAIL_USE_SYSTEM_LOCK 1
 
--- a/src/s/msdos.h	Thu May 06 09:50:39 2010 +0900
+++ b/src/s/msdos.h	Mon May 10 12:37:03 2010 +0900
@@ -1,7 +1,7 @@
 /* System description file for MS-DOS
 
-   Copyright (C) 1993, 1996, 1997, 2001, 2002, 2003, 2004, 2005, 2006,
-                 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+Copyright (C) 1993, 1996, 1997, 2001, 2002, 2003, 2004, 2005, 2006,
+  2007, 2008, 2009, 2010  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -131,7 +131,7 @@
 /* We have (the code to control) a mouse.  */
 #define HAVE_MOUSE
 
-/* We canuse mouse menus.  */
+/* We can use mouse menus.  */
 #define HAVE_MENUS
 
 /* Define one of these for easier conditionals.  */
@@ -140,8 +140,9 @@
    commentary below, in the non-X branch.  The 140KB number was
    measured on GNU/Linux and on MS-WIndows.  */
 #define SYSTEM_PURESIZE_EXTRA (-170000+140000)
-#define LIBS_SYSTEM -lxext -lsys
+#define MSDOS_LIBS_SYSTEM -lxext -lsys
 #else
+#define MSDOS_LIBS_SYSTEM
 /* We need a little extra space, see ../../lisp/loadup.el.
    As of 20091024, DOS-specific files use up 62KB of pure space.  But
    overall, we end up wasting 130KB of pure space, because
@@ -163,7 +164,5 @@
 
 #define NO_REMAP
 
-#define UNEXEC unexec.o
-
 /* arch-tag: d184f860-815d-4ff4-8187-d05c0f3c37d0
    (do not change this comment) */
--- a/src/s/netbsd.h	Thu May 06 09:50:39 2010 +0900
+++ b/src/s/netbsd.h	Mon May 10 12:37:03 2010 +0900
@@ -1,7 +1,7 @@
 /* s/ file for netbsd system.
 
-   Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-                 2008, 2009, 2010  Free Software Foundation, Inc.
+Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+  2010  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -26,27 +26,11 @@
 
 #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)
 
-#define LIBS_TERMCAP -ltermcap
-
-#define START_FILES pre-crt0.o $(CRT_DIR)/crt0.o START_FILES_1 $(CRT_DIR)/crtbegin.o
-#define LIB_STANDARD -lgcc -lc -lgcc $(CRT_DIR)/crtend.o END_FILES_1
 #undef LIB_GCC
 #define LIB_GCC
 
-#ifdef HAVE_CRTIN
-#define START_FILES_1 $(CRT_DIR)/crti.o 
-#define END_FILES_1 $(CRT_DIR)/crtn.o
-#else
-#define START_FILES_1
-#define END_FILES_1
-#endif
-
 #define AMPERSAND_FULL_NAME
 
-/* LD_SWITCH_X_SITE_AUX_RPATH gives a -rpath option (which is what
-   OSF1 uses) that says where to find X windows at run time.  */
-#define LD_SWITCH_SYSTEM $(LD_SWITCH_X_SITE_AUX_RPATH) -Wl,-rpath,/usr/pkg/lib -L/usr/pkg/lib -Wl,-rpath,/usr/local/lib -L/usr/local/lib
-
 /* On post 1.3 releases of NetBSD, gcc -nostdlib also clears
    the library search parth, i.e. it won't search /usr/lib
    for libc and friends. Using -nostartfiles instead avoids
--- a/src/s/openbsd.h	Thu May 06 09:50:39 2010 +0900
+++ b/src/s/openbsd.h	Mon May 10 12:37:03 2010 +0900
@@ -1,20 +1,7 @@
-/* s/ file for openbsd systems.  */
-
-/* Mostly the same as NetBSD.  */
-#include "netbsd.h"
-
-/*  David Mazieres <dm@reeducation-labor.lcs.mit.edu> says this
-    is necessary.  Otherwise Emacs dumps core when run -nw.  */
-#undef LIBS_TERMCAP
+/* System file for openbsd.  */
 
-#define TERMINFO
-#define LIBS_TERMCAP -lncurses
-
-#undef LD_SWITCH_SYSTEM
-
-  /*  Han Boetes <han@mijncomputer.nl> says this
-      is necessary,  otherwise Emacs dumps core on elf systems.  */
-#define LD_SWITCH_SYSTEM $(LD_SWITCH_X_SITE_AUX_RPATH) -Z
+/* The same as NetBSD.  Note there are differences in configure.  */
+#include "netbsd.h"
 
 /* arch-tag: 7e3f65ca-3f48-4237-933f-2b208b21e8e2
    (do not change this comment) */
--- a/src/s/sol2-6.h	Thu May 06 09:50:39 2010 +0900
+++ b/src/s/sol2-6.h	Mon May 10 12:37:03 2010 +0900
@@ -1,7 +1,7 @@
 /* Definitions file for GNU Emacs running on Solaris 2.6.
 
-   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-                 2008, 2009, 2010  Free Software Foundation, Inc.
+Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+  2008, 2009, 2010  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -27,8 +27,6 @@
 
 #define POSIX
 
-#define LIBS_SYSTEM -lsocket -lnsl -lkstat
-
 /* Prefer kstat over kvm in getloadavg.c, kstat doesn't require root.
    ghazi@caip.rutgers.edu, 7/21/97.  Don't redefine if already defined
    (e.g., by config.h). */
@@ -38,16 +36,8 @@
 
 /* inoue@ainet.or.jp says Solaris has a bug related to X11R6-style
    XIM support.  */
-
 #define INHIBIT_X11R6_XIM
 
-/* Must use the system's termcap, if we use any termcap.
-   It does special things.  */
-
-#ifndef TERMINFO
-#define LIBS_TERMCAP -ltermcap
-#endif
-
 /* This is the same definition as in usg5-4.h, but with sigblock/sigunblock
    rather than sighold/sigrelse, which appear to be BSD4.1 specific.
    It may also be appropriate for SVR4.x
--- a/src/s/template.h	Thu May 06 09:50:39 2010 +0900
+++ b/src/s/template.h	Mon May 10 12:37:03 2010 +0900
@@ -1,8 +1,9 @@
 /* Template for system description header files.
    This file describes the parameters that system description files
    should define or not.
-   Copyright (C) 1985, 1986, 1992, 1999, 2001, 2002, 2003, 2004, 2005,
-                 2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
+
+Copyright (C) 1985, 1986, 1992, 1999, 2001, 2002, 2003, 2004, 2005,
+  2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -102,13 +103,6 @@
 
 /* #define COFF */
 
-/* define MAIL_USE_FLOCK if the mailer uses flock
-   to interlock access to /usr/spool/mail/$USER.
-   The alternative is that a lock file named
-   /usr/spool/mail/$USER.lock.  */
-
-#define MAIL_USE_FLOCK
-
 /* Define CLASH_DETECTION if you want lock files to be written
    so that Emacs can tell instantly when you try to modify
    a file that someone else has modified in his Emacs.  */
--- a/src/s/unixware.h	Thu May 06 09:50:39 2010 +0900
+++ b/src/s/unixware.h	Mon May 10 12:37:03 2010 +0900
@@ -1,7 +1,7 @@
 /* s/ file for Unixware.
 
-   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-                 2008, 2009, 2010  Free Software Foundation, Inc.
+Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+  2008, 2009, 2010  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -28,9 +28,6 @@
 
 #undef HAVE_SYSV_SIGPAUSE
 
-/* Motif needs -lgen.  */
-#define LIBS_SYSTEM -lsocket -lnsl -lelf -lgen
-
 /* This is the same definition as in usg5-4.h, but with sigblock/sigunblock
    rather than sighold/sigrelse, which appear to be BSD4.1 specific.
    It may also be appropriate for SVR4.x
--- a/src/s/usg5-4.h	Thu May 06 09:50:39 2010 +0900
+++ b/src/s/usg5-4.h	Mon May 10 12:37:03 2010 +0900
@@ -1,6 +1,7 @@
 /* Definitions file for GNU Emacs running on AT&T's System V Release 4
-   Copyright (C) 1987, 1990, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-                 2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
+
+Copyright (C) 1987, 1990, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+  2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -75,10 +76,6 @@
 #define rindex strrchr
 #endif /* ! defined (HAVE_RINDEX) */
 
-/* Use terminfo instead of termcap.  */
-
-#define TERMINFO
-
 
 /* The docs for system V/386 suggest v.3 has sigpause,
    so let's give it a try.  */
@@ -97,8 +94,6 @@
 
 #define ORDINARY_LINK
 
-#define LIB_STANDARD
-
 /* Undump with ELF */
 
 #undef COFF
--- a/src/systty.h	Thu May 06 09:50:39 2010 +0900
+++ b/src/systty.h	Mon May 10 12:37:03 2010 +0900
@@ -51,11 +51,8 @@
 #include <termios.h>
 #endif
 
-#ifdef NEED_BSDTTY
+#ifdef HPUX
 #include <sys/bsdtty.h>
-#endif
-
-#if defined (HPUX) && defined (HAVE_PTYS)
 #include <sys/ptyio.h>
 #endif
 
@@ -63,7 +60,7 @@
 #include <sys/pty.h>
 #endif /* AIX */
 
-#if (defined (POSIX) || defined (NEED_UNISTD_H)) && defined (HAVE_UNISTD_H)
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
 
--- a/src/w16select.c	Thu May 06 09:50:39 2010 +0900
+++ b/src/w16select.c	Mon May 10 12:37:03 2010 +0900
@@ -685,8 +685,8 @@
      into the clipboard if we run under Windows, so we cannot check
      the clipboard alone.)  */
   if ((EQ (selection, Qnil) || EQ (selection, QPRIMARY))
-      && ! NILP (SYMBOL_VALUE (Fintern_soft (build_string ("kill-ring"),
-					     Qnil))))
+      && ! NILP (Fsymbol_value (Fintern_soft (build_string ("kill-ring"),
+					      Qnil))))
     return Qt;
 
   if (EQ (selection, QCLIPBOARD))
--- a/src/w32fns.c	Thu May 06 09:50:39 2010 +0900
+++ b/src/w32fns.c	Mon May 10 12:37:03 2010 +0900
@@ -47,6 +47,7 @@
 #include "systime.h"
 #include "termhooks.h"
 #include "w32heap.h"
+#include "w32.h"
 
 #include "bitmaps/gray.xbm"
 
@@ -6333,6 +6334,7 @@
      Lisp_Object operation, document, parameters, show_flag;
 {
   Lisp_Object current_dir;
+  char *errstr;
 
   CHECK_STRING (document);
 
@@ -6353,7 +6355,17 @@
 			   XINT (show_flag) : SW_SHOWDEFAULT))
       > 32)
     return Qt;
-  error ("ShellExecute failed: %s", w32_strerror (0));
+  errstr = w32_strerror (0);
+  /* The error string might be encoded in the locale's encoding.  */
+  if (!NILP (Vlocale_coding_system))
+    {
+      Lisp_Object decoded =
+	code_convert_string_norecord (make_unibyte_string (errstr,
+							   strlen (errstr)),
+				      Vlocale_coding_system, 0);
+      errstr = (char *)SDATA (decoded);
+    }
+  error ("ShellExecute failed: %s", errstr);
 }
 
 /* Lookup virtual keycode from string representing the name of a
--- a/src/xsettings.c	Thu May 06 09:50:39 2010 +0900
+++ b/src/xsettings.c	Mon May 10 12:37:03 2010 +0900
@@ -740,7 +740,7 @@
 DEFUN ("tool-bar-get-system-style", Ftool_bar_get_system_style, Stool_bar_get_system_style,
        0, 0, 0,
        doc: /* Get the system tool bar style.
-If no system tool bar style is known, return `tool-bar-style' is set to a
+If no system tool bar style is known, return `tool-bar-style' if set to a
 known style.  Otherwise return image.  */)
   ()
 {
--- a/src/xterm.c	Thu May 06 09:50:39 2010 +0900
+++ b/src/xterm.c	Mon May 10 12:37:03 2010 +0900
@@ -2291,7 +2291,7 @@
 x_draw_image_relief (s)
      struct glyph_string *s;
 {
-  int x0, y0, x1, y1, thick, raised_p;
+  int x0, y0, x1, y1, thick, raised_p, extra;
   XRectangle r;
   int x = s->x;
   int y = s->ybase - image_ascent (s->img, s->face, &s->slice);
@@ -2322,7 +2322,7 @@
       raised_p = s->img->relief > 0;
     }
 
-  int extra = s->face->id == TOOL_BAR_FACE_ID
+  extra = s->face->id == TOOL_BAR_FACE_ID
     ? XINT (Vtool_bar_button_margin) : 0;
   
   x0 = x - thick - extra;
--- a/test/ChangeLog	Thu May 06 09:50:39 2010 +0900
+++ b/test/ChangeLog	Mon May 10 12:37:03 2010 +0900
@@ -1,3 +1,7 @@
+2010-05-07  Chong Yidong  <cyd@stupidchicken.com>
+
+	* Version 23.2 released.
+
 2010-03-29  Chong Yidong  <cyd@stupidchicken.com>
 
 	* cedet/semantic-ia-utest.el