Merge from emacs--devo--0
authorMiles Bader <miles@gnu.org>
Sat, 16 Jun 2007 22:32:13 +0000 (22:32 +0000)
committerMiles Bader <miles@gnu.org>
Sat, 16 Jun 2007 22:32:13 +0000 (22:32 +0000)
Patches applied:

 * emacs--devo--0  (patch 793-802)

   - Update from CVS
   - Remove RCS keywords
   - Merge from emacs--rel--22

 * emacs--rel--22  (patch 42-50)

   - Update from CVS
   - Merge from gnus--rel--5.10
   - Gnus ChangeLog tweaks

 * gnus--rel--5.10  (patch 229-232)

   - Merge from emacs--devo--0, emacs--rel--22
   - ChangeLog tweak
   - Update from CVS

Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-223

28 files changed:
1  2 
configure
configure.in
etc/PROBLEMS
etc/TODO
lisp/desktop.el
lisp/emacs-lisp/bytecomp.el
lisp/font-lock.el
lisp/progmodes/sh-script.el
lisp/startup.el
lisp/subr.el
lisp/term/mac-win.el
lisp/term/x-win.el
lisp/wid-edit.el
src/ChangeLog
src/composite.c
src/config.in
src/dispextern.h
src/editfns.c
src/frame.h
src/macfns.c
src/macgui.h
src/macterm.c
src/regex.c
src/term.c
src/w32menu.c
src/xdisp.c
src/xfns.c
src/xmenu.c

diff --cc configure
+++ b/configure
@@@ -1345,10 -1337,8 +1345,10 @@@ Optional Packages
    --with-xpm              use -lXpm for displaying XPM images
    --with-jpeg             use -ljpeg for displaying JPEG images
    --with-tiff             use -ltiff for displaying TIFF images
-   --with-gif              use -lungif for displaying GIF images
+   --with-gif              use -lungif (or -lgif) for displaying GIF images
    --with-png              use -lpng for displaying PNG images
 +  --with-freetype         use -lfreetype for local fonts support
 +  --with-xft              use -lXft for anti aliased fonts
    --with-gpm              use -lgpm for mouse support on a GNU/Linux console
    --with-gtk              use GTK (same as --with-x-toolkit=gtk)
    --with-pkg-config-prog  Path to pkg-config to use for finding GTK
    fi
  fi
  
 -### Link with -lXft if available to work around a bug.
 -HAVE_XFT=maybe
 -if test "${HAVE_GTK}" = "yes"; then
 -    if test "X${with_pkg_config_prog}" != X; then
 -    PKG_CONFIG="${with_pkg_config_prog}"
 -  fi
 -
 -
 -  succeeded=no
 -
 -  if test -z "$PKG_CONFIG"; then
 -    # Extract the first word of "pkg-config", so it can be a program name with args.
 -set dummy pkg-config; ac_word=$2
 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5
 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
++HAVE_XAW3D=no
 +if test x"${USE_X_TOOLKIT}" = xmaybe || test x"${USE_X_TOOLKIT}" = xLUCID; then
-   if test x"${HAVE_X11R5}" = xyes; then
-     { echo "$as_me:$LINENO: checking X11 version 5 with Xaw" >&5
- echo $ECHO_N "checking X11 version 5 with Xaw... $ECHO_C" >&6; }
-     if test "${emacs_cv_x11_version_5_with_xaw+set}" = set; then
++  if test x"${HAVE_X11R5}" != xyes; then
++    USE_X_TOOLKIT=none
++  else
++    { echo "$as_me:$LINENO: checking for xaw3d" >&5
++echo $ECHO_N "checking for xaw3d... $ECHO_C" >&6; }
++    if test "${emacs_cv_xaw3d+set}" = set; then
    echo $ECHO_N "(cached) $ECHO_C" >&6
  else
 -  case $PKG_CONFIG in
 -  [\\/]* | ?:[\\/]*)
 -  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
 -  ;;
 -  *)
 -  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 -for as_dir in $PATH
 -do
 -  IFS=$as_save_IFS
 -  test -z "$as_dir" && as_dir=.
 -  for ac_exec_ext in '' $ac_executable_extensions; do
 -  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
 -    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
 -    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
 -    break 2
 -  fi
 -done
 -done
 -IFS=$as_save_IFS
 +  cat >conftest.$ac_ext <<_ACEOF
 +/* confdefs.h.  */
 +_ACEOF
 +cat confdefs.h >>conftest.$ac_ext
 +cat >>conftest.$ac_ext <<_ACEOF
 +/* end confdefs.h.  */
  
 -  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
 -  ;;
 +#include <X11/Intrinsic.h>
- #include <X11/Xaw/Simple.h>
++#include <X11/Xaw3d/Simple.h>
 +int
 +main ()
 +{
 +
 +  ;
 +  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
 -fi
 -PKG_CONFIG=$ac_cv_path_PKG_CONFIG
 -if test -n "$PKG_CONFIG"; then
 -  { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
 -echo "${ECHO_T}$PKG_CONFIG" >&6; }
 +eval "echo \"\$as_me:$LINENO: $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
 +  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 &&
 +       $as_test_x conftest$ac_exeext; then
-   emacs_cv_x11_version_5_with_xaw=yes
++  emacs_cv_xaw3d=yes
  else
 -  { echo "$as_me:$LINENO: result: no" >&5
 -echo "${ECHO_T}no" >&6; }
 -fi
 -
 +  echo "$as_me: failed program was:" >&5
 +sed 's/^/| /' conftest.$ac_ext >&5
  
-       emacs_cv_x11_version_5_with_xaw=no
 -  fi
++      emacs_cv_xaw3d=no
 +fi
  
 -  if test "$PKG_CONFIG" = "no" ; then
 -     HAVE_XFT=no
 -  else
 -     PKG_CONFIG_MIN_VERSION=0.9.0
 -     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
 -        { echo "$as_me:$LINENO: checking for xft >= 0.13.0" >&5
 -echo $ECHO_N "checking for xft >= 0.13.0... $ECHO_C" >&6; }
 +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
 +      conftest$ac_exeext conftest.$ac_ext
 +fi
  
-     if test $emacs_cv_x11_version_5_with_xaw = yes; then
-       { echo "$as_me:$LINENO: result: 5 or newer, with Xaw; use toolkit by default" >&5
- echo "${ECHO_T}5 or newer, with Xaw; use toolkit by default" >&6; }
 -        if $PKG_CONFIG --exists "xft >= 0.13.0" 2>&5; then
 -            { echo "$as_me:$LINENO: result: yes" >&5
 -echo "${ECHO_T}yes" >&6; }
 -            succeeded=yes
++    if test $emacs_cv_xaw3d = yes; then
++      { echo "$as_me:$LINENO: result: yes; using Lucid toolkit" >&5
++echo "${ECHO_T}yes; using Lucid toolkit" >&6; }
 +      USE_X_TOOLKIT=LUCID
++      HAVE_XAW3D=yes
 -            { echo "$as_me:$LINENO: checking XFT_CFLAGS" >&5
 -echo $ECHO_N "checking XFT_CFLAGS... $ECHO_C" >&6; }
 -            XFT_CFLAGS=`$PKG_CONFIG --cflags "xft >= 0.13.0"|sed -e 's,///*,/,g'`
 -            { echo "$as_me:$LINENO: result: $XFT_CFLAGS" >&5
 -echo "${ECHO_T}$XFT_CFLAGS" >&6; }
++cat >>confdefs.h <<\_ACEOF
++#define HAVE_XAW3D 1
++_ACEOF
 -            { echo "$as_me:$LINENO: checking XFT_LIBS" >&5
 -echo $ECHO_N "checking XFT_LIBS... $ECHO_C" >&6; }
 -            XFT_LIBS=`$PKG_CONFIG --libs "xft >= 0.13.0"|sed -e 's,///*,/,g'`
 -            { echo "$as_me:$LINENO: result: $XFT_LIBS" >&5
 -echo "${ECHO_T}$XFT_LIBS" >&6; }
 -        else
 -            { echo "$as_me:$LINENO: result: no" >&5
 +    else
-       if test x"${USE_X_TOOLKIT}" = xLUCID; then
++      { echo "$as_me:$LINENO: result: no" >&5
+ echo "${ECHO_T}no" >&6; }
 -            XFT_CFLAGS=""
 -            XFT_LIBS=""
 -            ## If we have a custom action on failure, don't print errors, but
 -            ## do set a variable so people can do so.
 -            XFT_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "xft >= 0.13.0"`
 -
 -        fi
 -
 -
 -
 -     else
 -        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
 -        echo "*** See http://www.freedesktop.org/software/pkgconfig"
 -     fi
 -  fi
 -
 -  if test $succeeded = yes; then
 -     :
 -  else
 -     HAVE_XFT=no
 -  fi
 -
 -  if test "$HAVE_XFT" != no; then
 -    OLD_CFLAGS="$CPPFLAGS"
 -    OLD_CPPFLAGS="$CFLAGS"
 -    OLD_LIBS="$LIBS"
 -    CPPFLAGS="$CPPFLAGS $XFT_CFLAGS"
 -    CFLAGS="$CFLAGS $XFT_CFLAGS"
 -    LIBS="$XFT_LIBS $LIBS"
 -    if test "${ac_cv_header_X11_Xft_Xft_h+set}" = set; then
 -  { echo "$as_me:$LINENO: checking for X11/Xft/Xft.h" >&5
 -echo $ECHO_N "checking for X11/Xft/Xft.h... $ECHO_C" >&6; }
 -if test "${ac_cv_header_X11_Xft_Xft_h+set}" = set; then
++      { echo "$as_me:$LINENO: checking for libXaw" >&5
++echo $ECHO_N "checking for libXaw... $ECHO_C" >&6; }
++      if test "${emacs_cv_xaw+set}" = set; then
+   echo $ECHO_N "(cached) $ECHO_C" >&6
 -fi
 -{ echo "$as_me:$LINENO: result: $ac_cv_header_X11_Xft_Xft_h" >&5
 -echo "${ECHO_T}$ac_cv_header_X11_Xft_Xft_h" >&6; }
+ else
 -  # Is the header compilable?
 -{ echo "$as_me:$LINENO: checking X11/Xft/Xft.h usability" >&5
 -echo $ECHO_N "checking X11/Xft/Xft.h usability... $ECHO_C" >&6; }
 -cat >conftest.$ac_ext <<_ACEOF
++  cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h.  */
 -$ac_includes_default
 -#include <X11/Xft/Xft.h>
++
++#include <X11/Intrinsic.h>
++#include <X11/Xaw/Simple.h>
++int
++main ()
++{
++
++  ;
++  return 0;
++}
+ _ACEOF
 -rm -f conftest.$ac_objext
 -if { (ac_try="$ac_compile"
++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 "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
 -  (eval "$ac_compile") 2>conftest.er1
++  (eval "$ac_link") 2>conftest.er1
+   ac_status=$?
+   grep -v '^ *+' conftest.er1 >conftest.err
+   rm -f conftest.er1
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
 -       } && test -s conftest.$ac_objext; then
 -  ac_header_compiler=yes
++       } && test -s conftest$ac_exeext &&
++       $as_test_x conftest$ac_exeext; then
++  emacs_cv_xaw=yes
+ else
+   echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
 -      ac_header_compiler=no
++      emacs_cv_xaw=no
+ fi
 -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
 -echo "${ECHO_T}$ac_header_compiler" >&6; }
++rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
++      conftest$ac_exeext conftest.$ac_ext
++fi
 -# Is the header present?
 -{ echo "$as_me:$LINENO: checking X11/Xft/Xft.h presence" >&5
 -echo $ECHO_N "checking X11/Xft/Xft.h presence... $ECHO_C" >&6; }
 -cat >conftest.$ac_ext <<_ACEOF
++      if test $emacs_cv_xaw = yes; then
++        { echo "$as_me:$LINENO: result: yes; using Lucid toolkit" >&5
++echo "${ECHO_T}yes; using Lucid toolkit" >&6; }
++        USE_X_TOOLKIT=LUCID
++      elif test x"${USE_X_TOOLKIT}" = xLUCID; then
 +        { { echo "$as_me:$LINENO: error: Lucid toolkit requires X11/Xaw include files" >&5
 +echo "$as_me: error: Lucid toolkit requires X11/Xaw include files" >&2;}
 +   { (exit 1); exit 1; }; }
 +      else
-         { echo "$as_me:$LINENO: result: before 5 or no Xaw; do not use toolkit by default" >&5
- echo "${ECHO_T}before 5 or no Xaw; do not use toolkit by default" >&6; }
++        { echo "$as_me:$LINENO: result: no; do not use toolkit by default" >&5
++echo "${ECHO_T}no; do not use toolkit by default" >&6; }
 +        USE_X_TOOLKIT=none
 +      fi
 +    fi
-   else
-     USE_X_TOOLKIT=none
 +  fi
 +fi
 +
 +X_TOOLKIT_TYPE=$USE_X_TOOLKIT
 +
 +if test "${USE_X_TOOLKIT}" != "none"; then
 +  { echo "$as_me:$LINENO: checking X11 toolkit version" >&5
 +echo $ECHO_N "checking X11 toolkit version... $ECHO_C" >&6; }
 +  if test "${emacs_cv_x11_toolkit_version_6+set}" = set; then
 +  echo $ECHO_N "(cached) $ECHO_C" >&6
 +else
 +  cat >conftest.$ac_ext <<_ACEOF
  /* confdefs.h.  */
  _ACEOF
  cat confdefs.h >>conftest.$ac_ext
    echo "$as_me: failed program was:" >&5
  sed 's/^/| /' conftest.$ac_ext >&5
  
 -      ac_cv_lib_Xmu_XmuConvertStandardSelection=no
 +      emacs_cv_lesstif=no
  fi
  
 -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
 -      conftest$ac_exeext conftest.$ac_ext
 -LIBS=$ac_check_lib_save_LIBS
 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
  fi
 -{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xmu_XmuConvertStandardSelection" >&5
 -echo "${ECHO_T}$ac_cv_lib_Xmu_XmuConvertStandardSelection" >&6; }
 -if test $ac_cv_lib_Xmu_XmuConvertStandardSelection = yes; then
 -  cat >>confdefs.h <<_ACEOF
 -#define HAVE_LIBXMU 1
 +{ echo "$as_me:$LINENO: result: $emacs_cv_lesstif" >&5
 +echo "${ECHO_T}$emacs_cv_lesstif" >&6; }
 +    if test $emacs_cv_lesstif = yes; then
 +      # Make sure this -I option remains in CPPFLAGS after it is set
 +      # back to REAL_CPPFLAGS.
 +      # There is no need to change REAL_CFLAGS, because REAL_CFLAGS does not
 +      # have those other -I options anyway.  Ultimately, having this
 +      # directory ultimately in CPPFLAGS will be enough.
 +      REAL_CPPFLAGS="-I/usr/X11R6/LessTif/Motif1.2/include $REAL_CPPFLAGS"
 +      LDFLAGS="-L/usr/X11R6/LessTif/Motif1.2/lib $LDFLAGS"
 +    else
 +      CFLAGS=$OLD_CFLAGS
 +      CPPFLAGS=$OLD_CPPFLAGS
 +    fi
 +  fi
 +fi
 +
- ### Is -lXaw3d available?
- HAVE_XAW3D=no
- if test "${HAVE_X11}" = "yes"; then
-   if test "${USE_X_TOOLKIT}" != "none" && test "${with_toolkit_scroll_bars}" != "no"; then
-             { echo "$as_me:$LINENO: checking for X11/Xaw3d/Scrollbar.h" >&5
- echo $ECHO_N "checking for X11/Xaw3d/Scrollbar.h... $ECHO_C" >&6; }
- if test "${ac_cv_header_X11_Xaw3d_Scrollbar_h+set}" = set; then
-   echo $ECHO_N "(cached) $ECHO_C" >&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 <X11/Xaw3d/Scrollbar.h>
- _ACEOF
- if { (ac_try="$ac_cpp conftest.$ac_ext"
- case "(($ac_try" in
-   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-   *) ac_try_echo=$ac_try;;
- esac
- eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
-   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
-   ac_status=$?
-   grep -v '^ *+' conftest.er1 >conftest.err
-   rm -f conftest.er1
-   cat conftest.err >&5
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-        }; then
-   ac_cv_header_X11_Xaw3d_Scrollbar_h=yes
- else
-   echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
-   ac_cv_header_X11_Xaw3d_Scrollbar_h=no
- fi
- rm -f conftest.err conftest.$ac_ext
- fi
- { echo "$as_me:$LINENO: result: $ac_cv_header_X11_Xaw3d_Scrollbar_h" >&5
- echo "${ECHO_T}$ac_cv_header_X11_Xaw3d_Scrollbar_h" >&6; }
- if test $ac_cv_header_X11_Xaw3d_Scrollbar_h = yes; then
-   { echo "$as_me:$LINENO: checking for XawScrollbarSetThumb in -lXaw3d" >&5
- echo $ECHO_N "checking for XawScrollbarSetThumb in -lXaw3d... $ECHO_C" >&6; }
- if test "${ac_cv_lib_Xaw3d_XawScrollbarSetThumb+set}" = set; then
-   echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-   ac_check_lib_save_LIBS=$LIBS
- LIBS="-lXaw3d  $LIBS"
- cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h.  */
- _ACEOF
- cat confdefs.h >>conftest.$ac_ext
- cat >>conftest.$ac_ext <<_ACEOF
- /* end confdefs.h.  */
- /* Override any GCC internal prototype to avoid an error.
-    Use char because int might match the return type of a GCC
-    builtin and then its argument prototype would still apply.  */
- #ifdef __cplusplus
- extern "C"
- #endif
- char XawScrollbarSetThumb ();
- int
- main ()
- {
- return XawScrollbarSetThumb ();
-   ;
-   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 "echo \"\$as_me:$LINENO: $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
-   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 &&
-        $as_test_x conftest$ac_exeext; then
-   ac_cv_lib_Xaw3d_XawScrollbarSetThumb=yes
- else
-   echo "$as_me: failed program was:" >&5
- sed 's/^/| /' conftest.$ac_ext >&5
-       ac_cv_lib_Xaw3d_XawScrollbarSetThumb=no
- fi
- rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-       conftest$ac_exeext conftest.$ac_ext
- LIBS=$ac_check_lib_save_LIBS
- fi
- { echo "$as_me:$LINENO: result: $ac_cv_lib_Xaw3d_XawScrollbarSetThumb" >&5
- echo "${ECHO_T}$ac_cv_lib_Xaw3d_XawScrollbarSetThumb" >&6; }
- if test $ac_cv_lib_Xaw3d_XawScrollbarSetThumb = yes; then
-   HAVE_XAW3D=yes
- fi
- fi
-     if test "${HAVE_XAW3D}" = "yes"; then
- cat >>confdefs.h <<\_ACEOF
- #define HAVE_XAW3D 1
- _ACEOF
-     fi
-   fi
- fi
 +
 +
 +USE_TOOLKIT_SCROLL_BARS=no
 +if test "${with_toolkit_scroll_bars}" != "no"; then
 +  if test "${USE_X_TOOLKIT}" != "none"; then
 +    if test "${USE_X_TOOLKIT}" = "MOTIF"; then
 +      cat >>confdefs.h <<\_ACEOF
 +#define USE_TOOLKIT_SCROLL_BARS 1
  _ACEOF
  
 -  LIBS="-lXmu $LIBS"
 +      HAVE_XAW3D=no
 +      USE_TOOLKIT_SCROLL_BARS=yes
 +    elif test "${HAVE_XAW3D}" = "yes"; then
 +      cat >>confdefs.h <<\_ACEOF
 +#define USE_TOOLKIT_SCROLL_BARS 1
 +_ACEOF
  
 -fi
 +      USE_TOOLKIT_SCROLL_BARS=yes
 +    fi
 +  elif test "${HAVE_GTK}" = "yes"; then
 +    cat >>confdefs.h <<\_ACEOF
 +#define USE_TOOLKIT_SCROLL_BARS 1
 +_ACEOF
  
 -  test $ac_cv_lib_Xmu_XmuConvertStandardSelection = no && LIBS="$OLDLIBS"
 -fi
 +    USE_TOOLKIT_SCROLL_BARS=yes
 +  elif test "${HAVE_CARBON}" = "yes"; then
 +    cat >>confdefs.h <<\_ACEOF
 +#define USE_TOOLKIT_SCROLL_BARS 1
 +_ACEOF
  
 -# On Irix 6.5, at least, we need XShapeQueryExtension from -lXext for Xaw3D.
 -if test "${HAVE_X11}" = "yes"; then
 -  if test "${USE_X_TOOLKIT}" != "none"; then
 +    USE_TOOLKIT_SCROLL_BARS=yes
 +  fi
 +fi
  
 -{ echo "$as_me:$LINENO: checking for XShapeQueryExtension in -lXext" >&5
 -echo $ECHO_N "checking for XShapeQueryExtension in -lXext... $ECHO_C" >&6; }
 -if test "${ac_cv_lib_Xext_XShapeQueryExtension+set}" = set; then
 -  echo $ECHO_N "(cached) $ECHO_C" >&6
 -else
 -  ac_check_lib_save_LIBS=$LIBS
 -LIBS="-lXext  $LIBS"
  cat >conftest.$ac_ext <<_ACEOF
  /* confdefs.h.  */
  _ACEOF
diff --cc configure.in
@@@ -110,13 -105,9 +105,13 @@@ AC_ARG_WITH(jpeg
  AC_ARG_WITH(tiff,
  [  --with-tiff             use -ltiff for displaying TIFF images])
  AC_ARG_WITH(gif,
- [  --with-gif              use -lungif for displaying GIF images])
+ [  --with-gif              use -lungif (or -lgif) for displaying GIF images])
  AC_ARG_WITH(png,
  [  --with-png              use -lpng for displaying PNG images])
 +AC_ARG_WITH(freetype,
 +[  --with-freetype         use -lfreetype for local fonts support])
 +AC_ARG_WITH(xft,
 +[  --with-xft              use -lXft for anti aliased fonts])
  AC_ARG_WITH(gpm,
  [  --with-gpm              use -lgpm for mouse support on a GNU/Linux console])
  AC_ARG_WITH(gtk,
@@@ -2217,26 -2202,75 +2211,44 @@@ if test "${HAVE_GTK}" = "yes"; the
    fi
  fi
  
 -### Link with -lXft if available to work around a bug.
 -HAVE_XFT=maybe
 -if test "${HAVE_GTK}" = "yes"; then
 -  dnl Check if --with-pkg-config-prog has been given.
 -  if test "X${with_pkg_config_prog}" != X; then
 -    PKG_CONFIG="${with_pkg_config_prog}"
 -  fi
 -
 -  PKG_CHECK_MODULES(XFT, xft >= 0.13.0, , HAVE_XFT=no)
 -  if test "$HAVE_XFT" != no; then
 -    OLD_CFLAGS="$CPPFLAGS"
 -    OLD_CPPFLAGS="$CFLAGS"
 -    OLD_LIBS="$LIBS"
 -    CPPFLAGS="$CPPFLAGS $XFT_CFLAGS"
 -    CFLAGS="$CFLAGS $XFT_CFLAGS"
 -    LIBS="$XFT_LIBS $LIBS"
 -    AC_CHECK_HEADER(X11/Xft/Xft.h,
 -      AC_CHECK_LIB(Xft, XftFontOpen, HAVE_XFT=yes, , $XFT_LIBS))
 -
 -    if test "${HAVE_XFT}" = "yes"; then
 -      AC_DEFINE(HAVE_XFT, 1, [Define to 1 if you have the Xft library.])
 -      AC_SUBST(XFT_LIBS)
 -      C_SWITCH_X_SITE="$C_SWITCH_X_SITE $XFT_CFLAGS"
 -    else
 -      CFLAGS="$OLD_CPPFLAGS"
 -      CFLAGS="$OLD_CFLAGS"
 -      LIBS="$OLD_LIBS"
 -    fi
 -  fi
 -fi
 -
  dnl Do not put whitespace before the #include statements below.
  dnl Older compilers (eg sunos4 cc) choke on it.
+ HAVE_XAW3D=no
  if test x"${USE_X_TOOLKIT}" = xmaybe || test x"${USE_X_TOOLKIT}" = xLUCID; then
-   if test x"${HAVE_X11R5}" = xyes; then
-     AC_MSG_CHECKING(X11 version 5 with Xaw)
-     AC_CACHE_VAL(emacs_cv_x11_version_5_with_xaw,
+   if test x"${HAVE_X11R5}" != xyes; then
+     USE_X_TOOLKIT=none
+   else
+     AC_MSG_CHECKING(for xaw3d)
+     AC_CACHE_VAL(emacs_cv_xaw3d,
      [AC_TRY_LINK([
  #include <X11/Intrinsic.h>
- #include <X11/Xaw/Simple.h>],
+ #include <X11/Xaw3d/Simple.h>],
        [],
-       emacs_cv_x11_version_5_with_xaw=yes,
-       emacs_cv_x11_version_5_with_xaw=no)])
-     if test $emacs_cv_x11_version_5_with_xaw = yes; then
-       AC_MSG_RESULT([5 or newer, with Xaw; use toolkit by default])
+       emacs_cv_xaw3d=yes,
+       emacs_cv_xaw3d=no)])
+     if test $emacs_cv_xaw3d = yes; then
+       AC_MSG_RESULT([yes; using Lucid toolkit])
        USE_X_TOOLKIT=LUCID
+       HAVE_XAW3D=yes
+       AC_DEFINE(HAVE_XAW3D, 1,
+                 [Define to 1 if you have the Xaw3d library (-lXaw3d).])
      else
-       if test x"${USE_X_TOOLKIT}" = xLUCID; then
+       AC_MSG_RESULT(no)
+       AC_MSG_CHECKING(for libXaw)
+       AC_CACHE_VAL(emacs_cv_xaw,
+       [AC_TRY_LINK([
+ #include <X11/Intrinsic.h>
+ #include <X11/Xaw/Simple.h>],
+         [],
+         emacs_cv_xaw=yes,
+         emacs_cv_xaw=no)])
+       if test $emacs_cv_xaw = yes; then
+         AC_MSG_RESULT([yes; using Lucid toolkit])
+         USE_X_TOOLKIT=LUCID
+       elif test x"${USE_X_TOOLKIT}" = xLUCID; then
          AC_MSG_ERROR([Lucid toolkit requires X11/Xaw include files])
        else
-         AC_MSG_RESULT(before 5 or no Xaw; do not use toolkit by default)
+         AC_MSG_RESULT([no; do not use toolkit by default])
          USE_X_TOOLKIT=none
        fi
      fi
diff --cc etc/PROBLEMS
Simple merge
diff --cc etc/TODO
Simple merge
diff --cc lisp/desktop.el
@@@ -722,92 -837,72 +837,73 @@@ DIRNAME must be the directory in which 
      ((eq desktop-file-name-format 'local) (file-relative-name filename dirname))
      (t (expand-file-name filename))))
  
++
  ;; ----------------------------------------------------------------------------
  ;;;###autoload
- (defun desktop-save (dirname)
+ (defun desktop-save (dirname &optional release)
    "Save the desktop in a desktop file.
  Parameter DIRNAME specifies where to save the desktop file.
+ Optional parameter RELEASE says whether we're done with this desktop.
  See also `desktop-base-file-name'."
    (interactive "DDirectory to save desktop file in: ")
-   (run-hooks 'desktop-save-hook)
-   (setq dirname (file-name-as-directory (expand-file-name dirname)))
+   (setq desktop-dirname (file-name-as-directory (expand-file-name dirname)))
    (save-excursion
-     (let ((filename (desktop-full-file-name dirname))
-           (info
-             (mapcar
-               #'(lambda (b)
-                   (set-buffer b)
-                   (list
-                     (desktop-file-name (buffer-file-name) dirname)
-                     (buffer-name)
-                     major-mode
-                     ;; minor modes
-                     (let (ret)
-                       (mapc
-                         #'(lambda (minor-mode)
-                           (and
-                             (boundp minor-mode)
-                             (symbol-value minor-mode)
-                             (let* ((special (assq minor-mode desktop-minor-mode-table))
-                                    (value (cond (special (cadr special))
-                                                 ((functionp minor-mode) minor-mode))))
-                               (when value (add-to-list 'ret value)))))
-                         (mapcar #'car minor-mode-alist))
-                       ret)
-                     (point)
-                     (list (mark t) mark-active)
-                     buffer-read-only
-                     ;; Auxiliary information
-                     (when (functionp desktop-save-buffer)
-                       (funcall desktop-save-buffer dirname))
-                     (let ((locals desktop-locals-to-save)
-                           (loclist (buffer-local-variables))
-                           (ll))
-                       (while locals
-                         (let ((here (assq (car locals) loclist)))
-                           (if here
-                             (setq ll (cons here ll))
-                             (when (member (car locals) loclist)
-                               (setq ll (cons (car locals) ll)))))
-                         (setq locals (cdr locals)))
-                       ll)))
-               (buffer-list)))
-           (eager desktop-restore-eager))
-       (with-temp-buffer
-       (insert
-         ";; -*- mode: emacs-lisp; coding: utf-8-emacs; -*-\n"
-         desktop-header
-         ";; Created " (current-time-string) "\n"
-          ";; Desktop file format version " desktop-file-version "\n"
-          ";; Emacs version " emacs-version "\n\n"
-          ";; Global section:\n")
-         (dolist (varspec desktop-globals-to-save)
-           (desktop-outvar varspec))
-         (if (memq 'kill-ring desktop-globals-to-save)
-             (insert
-              "(setq kill-ring-yank-pointer (nthcdr "
-           (int-to-string (- (length kill-ring) (length kill-ring-yank-pointer)))
-              " kill-ring))\n"))
-         (insert "\n;; Buffer section -- buffers listed in same order as in buffer list:\n")
-         (dolist (l info)
-         (when (apply 'desktop-save-buffer-p l)
-           (insert "("
-                   (if (or (not (integerp eager))
-                           (unless (zerop eager)
-                             (setq eager (1- eager))
-                             t))
-                       "desktop-create-buffer"
-                     "desktop-append-buffer-args")
-                   " "
-                   desktop-file-version)
-           (dolist (e l)
-             (insert "\n  " (desktop-value-to-string e)))
-           (insert ")\n\n")))
-       (setq default-directory dirname)
-       (let ((coding-system-for-write 'utf-8-emacs))
-         (write-region (point-min) (point-max) filename nil 'nomessage)))))
-   (setq desktop-dirname dirname))
+     (let ((eager desktop-restore-eager)
+         (new-modtime (nth 5 (file-attributes (desktop-full-file-name)))))
+       (when
+         (or (not new-modtime)         ; nothing to overwrite
+             (equal desktop-file-modtime new-modtime)
+             (yes-or-no-p (if desktop-file-modtime
+                              (if (> (float-time new-modtime) (float-time desktop-file-modtime))
+                                  "Desktop file is more recent than the one loaded.  Save anyway? "
+                                "Desktop file isn't the one loaded.  Overwrite it? ")
+                            "Current desktop was not loaded from a file.  Overwrite this desktop file? "))
+             (unless release (error "Desktop file conflict")))
+       ;; If we're done with it, release the lock.
+       ;; Otherwise, claim it if it's unclaimed or if we created it.
+       (if release
+           (desktop-release-lock)
+         (unless (and new-modtime (desktop-owner)) (desktop-claim-lock)))
+       (with-temp-buffer
+         (insert
+          ";; -*- mode: emacs-lisp; coding: emacs-mule; -*-\n"
+          desktop-header
+          ";; Created " (current-time-string) "\n"
+          ";; Desktop file format version " desktop-file-version "\n"
+          ";; Emacs version " emacs-version "\n")
+         (save-excursion (run-hooks 'desktop-save-hook))
+         (goto-char (point-max))
+         (insert "\n;; Global section:\n")
+         (mapc (function desktop-outvar) desktop-globals-to-save)
+         (when (memq 'kill-ring desktop-globals-to-save)
+           (insert
+            "(setq kill-ring-yank-pointer (nthcdr "
+            (int-to-string (- (length kill-ring) (length kill-ring-yank-pointer)))
+            " kill-ring))\n"))
+         (insert "\n;; Buffer section -- buffers listed in same order as in buffer list:\n")
+         (dolist (l (mapcar 'desktop-buffer-info (buffer-list)))
+           (when (apply 'desktop-save-buffer-p l)
+             (insert "("
+                     (if (or (not (integerp eager))
+                             (if (zerop eager)
+                                 nil
+                               (setq eager (1- eager))))
+                         "desktop-create-buffer"
+                       "desktop-append-buffer-args")
+                     " "
+                     desktop-file-version)
+             (dolist (e l)
+               (insert "\n  " (desktop-value-to-string e)))
+             (insert ")\n\n")))
+         (setq default-directory dirname)
+         (let ((coding-system-for-write 'emacs-mule))
+           (write-region (point-min) (point-max) (desktop-full-file-name) nil 'nomessage))
+         ;; We remember when it was modified (which is presumably just now).
+         (setq desktop-file-modtime (nth 5 (file-attributes (desktop-full-file-name)))))))))
  
  ;; ----------------------------------------------------------------------------
  ;;;###autoload
@@@ -1920,9 -1916,9 +1916,9 @@@ With argument, insert value in current 
    (let ((dynamic-docstrings byte-compile-dynamic-docstrings)
        (dynamic byte-compile-dynamic))
      (set-buffer outbuffer)
-     (goto-char 1)
+     (goto-char (point-min))
      ;; The magic number of .elc files is ";ELC", or 0x3B454C43.  After
 -    ;; that is the file-format version number (18, 19 or 20) as a
 +    ;; that is the file-format version number (18, 19, 20, or 23) as a
      ;; byte, followed by some nulls.  The primary motivation for doing
      ;; this is to get some binary characters up in the first line of
      ;; the file so that `diff' will simply say "Binary files differ"
Simple merge
Simple merge
diff --cc lisp/startup.el
Simple merge
diff --cc lisp/subr.el
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc src/ChangeLog
Simple merge
diff --cc src/composite.c
@@@ -537,11 -500,9 +537,12 @@@ update_compositions (from, to, check_ma
         avoid it, in such a case, we change the property of the
         latter to the copy of it.  */
        if (from > BEGV
-         && find_composition (from - 1, -1, &start, &end, &prop, Qnil))
+         && find_composition (from - 1, -1, &start, &end, &prop, Qnil)
+         && COMPOSITION_VALID_P (start, end, prop))
        {
 +        min_pos = start;
 +        if (end > to)
 +          max_pos = end;
          if (from < end)
            Fput_text_property (make_number (from), make_number (end),
                                Qcomposition,
          from = end;
        }
        else if (from < ZV
-              && find_composition (from, -1, &start, &from, &prop, Qnil))
+              && find_composition (from, -1, &start, &from, &prop, Qnil)
+              && COMPOSITION_VALID_P (start, from, prop))
 -      run_composition_function (start, from, prop);
 +      {
 +        if (from > to)
 +          max_pos = from;
 +        run_composition_function (start, from, prop);
 +      }
      }
  
    if (check_mask & CHECK_INSIDE)
          run_composition_function (start, end, prop);
        }
        else if (to < ZV
-              && find_composition (to, -1, &start, &end, &prop, Qnil))
+              && find_composition (to, -1, &start, &end, &prop, Qnil)
+              && COMPOSITION_VALID_P (start, end, prop))
 -      run_composition_function (start, end, prop);
 +      {
 +        run_composition_function (start, end, prop);
 +        max_pos = end;
 +      }
 +    }
 +  if (min_pos < max_pos)
 +    {
 +      int count = SPECPDL_INDEX ();
 +
 +      specbind (Qinhibit_read_only, Qt);
 +      specbind (Qinhibit_modification_hooks, Qt);
 +      specbind (Qinhibit_point_motion_hooks, Qt);
 +      Fremove_list_of_text_properties (make_number (min_pos),
 +                                     make_number (max_pos),
 +                                     Fcons (Qauto_composed, Qnil), Qnil);
 +      unbind_to (count, Qnil);
      }
  }
  
diff --cc src/config.in
Simple merge
Simple merge
diff --cc src/editfns.c
Simple merge
diff --cc src/frame.h
Simple merge
diff --cc src/macfns.c
Simple merge
diff --cc src/macgui.h
Simple merge
diff --cc src/macterm.c
Simple merge
diff --cc src/regex.c
Simple merge
diff --cc src/term.c
Simple merge
diff --cc src/w32menu.c
Simple merge
diff --cc src/xdisp.c
Simple merge
diff --cc src/xfns.c
Simple merge
diff --cc src/xmenu.c
Simple merge