]> code.delx.au - gnu-emacs/commitdiff
Merge from origin/emacs-25
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 18 Apr 2016 21:05:31 +0000 (14:05 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 18 Apr 2016 21:05:31 +0000 (14:05 -0700)
ac00a92 Make sh-electric-here-document-mode accessible in sh-mode-hoo...
3287f48 ; Add entry to MAINTAINERS
b85981f * configure.ac (HAVE_MODULES): Exclude gnu-kfreebsd from prev...
0f33284 Make use of rectangle-preview custom variable.
aa0d83a Make use of rectangle-preview face.
33bef6e Use 'grep-find-program' in check-declare.el
a8560e5 Improve "C-h S" for cl-lib symbols
52e798b Fix minor issues with removing left or right fringes
d6ffd64 Speed up redisplay in ansi-term mode
4ab671c Simplify 8-bit character handling by terminal for 'raw-text'
f3653ec * configure.ac (HAVE_MODULES): Treat gnu like gnu-linux.  (Bu...
ab849b7 Fix w32 memory-management problem when extending buffer text

1  2 
admin/MAINTAINERS
configure.ac
doc/lispref/windows.texi
lisp/progmodes/sh-script.el
lisp/term.el
lisp/window.el

diff --combined admin/MAINTAINERS
index 0fe30f01f6a45368937beee3c459ad47bfa3d087,b15c57e7ee702c324056935114e1fd3b50cfd8f7..f8baddd53163f3f3b75466167fe647004d9f7c66
@@@ -61,7 -61,7 +61,7 @@@ Michael Albinu
              lisp/net/tramp*.el
              lisp/url/url-tramp.el
              doc/misc/tramp*.texi
 -            test/automated/tramp-tests.el
 +            test/lisp/net/tramp-tests.el
  
          D-Bus
            src/dbusbind.c
            lisp/net/secrets.el
              lisp/net/zeroconf.el
            doc/misc/dbus.texi
 -            test/automated/dbus-tests.el
 +            test/lisp/net/dbus-tests.el
  
          File Notifications
            src/gfilenotify.c
+           src/kqueue.c
            lisp/filenotify.el
 -          test/automated/file-notify-tests.el
 +          test/lisp/filenotify-tests.el
  
  Simen Heggestøyl
        lisp/textmodes/css-mode.el
@@@ -210,9 -211,9 +211,9 @@@ Michael Albinu
          lisp/autorevert.el
        lisp/eshell/em-tramp.el
        lisp/notifications.el
 -        test/automated/auto-revert-tests.el
 -      test/automated/inotify-test.el
 -      test/automated/vc-tests.el
 +        test/lisp/autorevert-tests.el
 +      test/lisp/vc/vc-tests.el
 +      test/src/inotify-test.el
  
  Nicolas Petton
        lisp/emacs-lisp/subr-x.el
diff --combined configure.ac
index 0f6f65024520b8f1a62138633228e439856cff2e,89bc0c5638fd1fe93bc61ba48d1880c64bb224fb..eec6ce769cdc1dbe088d46cce5cf3edbae582dd3
@@@ -23,7 -23,7 +23,7 @@@ dnl  along with GNU Emacs.  If not, se
  
  AC_PREREQ(2.65)
  dnl Note this is parsed by (at least) make-dist and lisp/cedet/ede/emacs.el.
 -AC_INIT(GNU Emacs, 25.0.92, bug-gnu-emacs@gnu.org)
 +AC_INIT(GNU Emacs, 25.1.50, bug-gnu-emacs@gnu.org)
  
  dnl Set emacs_config_options to the options of 'configure', quoted for the shell,
  dnl and then quoted again for a C string.  Separate options with spaces.
@@@ -330,7 -330,6 +330,7 @@@ OPTION_DEFAULT_ON([tiff],[don't compil
  OPTION_DEFAULT_ON([gif],[don't compile with GIF image support])
  OPTION_DEFAULT_ON([png],[don't compile with PNG image support])
  OPTION_DEFAULT_ON([rsvg],[don't compile with SVG image support])
 +OPTION_DEFAULT_ON([libsystemd],[don't compile with libsystemd support])
  OPTION_DEFAULT_OFF([cairo],[compile with Cairo drawing (experimental)])
  OPTION_DEFAULT_ON([xml2],[don't compile with XML parsing support])
  OPTION_DEFAULT_ON([imagemagick],[don't compile with ImageMagick image support])
@@@ -547,14 -546,6 +547,14 @@@ AC_ARG_ENABLE(gtk-deprecation-warnings
                [Show Gtk+/Gdk deprecation warnings for Gtk+ >= 3.0])],
  [ac_enable_gtk_deprecation_warnings="${enableval}"],[])
  
 +BUILD_DETAILS=
 +AC_ARG_ENABLE([build-details],
 +  [AS_HELP_STRING([--disable-build-details],
 +                [Make the build more deterministic by omitting host
 +                 names, time stamps, etc. from the output.])],
 +  [test "$enableval" = no && BUILD_DETAILS=--no-build-details])
 +AC_SUBST([BUILD_DETAILS])
 +
  dnl This used to use changequote, but, apart from 'changequote is evil'
  dnl per the autoconf manual, we can speed up autoconf somewhat by quoting
  dnl the great gob of text.  Thus it's not processed for possible expansion.
@@@ -616,7 -607,12 +616,7 @@@ case "${canonical}" i
        * )            unported=yes ;;
      esac
      opsys=darwin
 -    ## Use fink packages if available.
 -    ## FIXME find a better way to do this: http://debbugs.gnu.org/11507
 -##    if test -d /sw/include && test -d /sw/lib; then
 -##      GCC_TEST_OPTIONS="-I/sw/include -L/sw/lib"
 -##      NON_GCC_TEST_OPTIONS=${GCC_TEST_OPTIONS}
 -##    fi
 +    ## FIXME: Find a way to use Fink if available (Bug#11507).
    ;;
  
    ## Chromium Native Client
      opsys=aix4-2
    ;;
  
 -  ## Silicon Graphics machines
 -  ## Iris 4D
 -  mips-sgi-irix6.5 )
 -    opsys=irix6-5
 -    # Without defining _LANGUAGE_C, things get masked out in the headers
 -    # so that, for instance, grepping for 'free' in stdlib.h fails and
 -    # AC_HEADER_STD_C fails.   (MIPSPro 7.2.1.2m compilers, Irix 6.5.3m).
 -    NON_GCC_TEST_OPTIONS="-D_LANGUAGE_C"
 -  ;;
 -
    ## Suns
    *-sun-solaris* \
      | i[3456]86-*-solaris2* | i[3456]86-*-sunos5* \
@@@ -768,6 -774,8 +768,6 @@@ AM_PROG_CC_C_
  
  if test x$GCC = xyes; then
    test "x$GCC_TEST_OPTIONS" != x && CC="$CC $GCC_TEST_OPTIONS"
 -else
 -  test "x$NON_GCC_TEST_OPTIONS" != x && CC="$CC $NON_GCC_TEST_OPTIONS"
  fi
  
  dnl This is used in lib/Makefile.am to use nt/gnulib.mk, the
@@@ -843,44 -851,17 +843,44 @@@ if test "$ac_test_CFLAGS" != set; the
    esac
  fi
  
 +# gl_GCC_VERSION_IFELSE([major], [minor], [run-if-found], [run-if-not-found])
 +# ---------------------------------------------------------------------------
 +# If $CPP is gcc-MAJOR.MINOR or newer, then run RUN-IF-FOUND.
 +# Otherwise, run RUN-IF-NOT-FOUND.
 +AC_DEFUN([gl_GCC_VERSION_IFELSE],
 +  [AC_PREPROC_IFELSE(
 +    [AC_LANG_PROGRAM(
 +      [[
 +#if ($1) < __GNUC__ || (($1) == __GNUC__ && ($2) <= __GNUC_MINOR__)
 +/* ok */
 +#else
 +# error "your version of gcc is older than $1.$2"
 +#endif
 +      ]]),
 +    ], [$3], [$4])
 +  ]
 +)
 +
  AC_ARG_ENABLE([gcc-warnings],
 -  [AS_HELP_STRING([--enable-gcc-warnings],
 -                  [turn on lots of GCC warnings/errors. This is intended for
 -                 developers, and may generate false alarms when used
 -                 with older or non-GNU development tools.])],
 +  [AS_HELP_STRING([--enable-gcc-warnings@<:@=TYPE@:>@],
 +                  [control generation of GCC warnings.  The TYPE 'yes'
 +                 means to fail if any warnings are issued; 'warn-only'
 +                 means issue warnings without failing (default for
 +                 developer builds); 'no' means disable warnings
 +                 (default for non-developer builds).])],
    [case $enableval in
 -     yes|no) ;;
 +     yes|no|warn-only) ;;
       *)      AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;
     esac
     gl_gcc_warnings=$enableval],
 -  [gl_gcc_warnings=no]
 +  [# By default, use 'warn-only' if it looks like the invoker of 'configure'
 +   # is a developer as opposed to a builder.  This is most likely true
 +   # if GCC is recent enough and there is a .git directory or file;
 +   # however, if there is also a .tarball-version file it is probably
 +   # just a release imported into Git for patch management.
 +   gl_gcc_warnings=no
 +   test -e "$srcdir"/.git && test ! -f "$srcdir"/.tarball-version &&
 +     gl_GCC_VERSION_IFELSE([5], [3], [gl_gcc_warnings=warn-only])]
  )
  
  # clang is unduly picky about some things.
@@@ -896,7 -877,7 +896,7 @@@ AC_CACHE_CHECK([whether the compiler i
  
  # When compiling with GCC, prefer -isystem to -I when including system
  # include files, to avoid generating useless diagnostics for the files.
 -AS_IF([test "$gl_gcc_warnings" != yes],
 +AS_IF([test $gl_gcc_warnings = no],
   [
    isystem='-I'
    AS_IF([test "$emacs_cv_clang" = yes],
         nw="$nw -Wwrite-strings"
         ;;
    esac
 -  AS_IF([test -z "$nw"],
 +  AS_IF([test $gl_gcc_warnings = yes],
      [gl_WARN_ADD([-Werror], [WERROR_CFLAGS])])
    AC_SUBST([WERROR_CFLAGS])
  
    nw="$nw -Wvla"                    # Emacs uses <vla.h>.
    nw="$nw -Wswitch-default"         # Too many warnings for now
    nw="$nw -Winline"                 # OK to ignore 'inline'
 -  nw="$nw -Wjump-misses-init"       # We sometimes safely jump over init.
    nw="$nw -Wstrict-overflow"        # OK to optimize assuming that
                                      # signed overflow has undefined behavior
    nw="$nw -Wsync-nand"              # irrelevant here, and provokes ObjC warning
  
  dnl We need -znocombreloc if we're using a relatively recent GNU ld.
  dnl If we can link with the flag, it shouldn't do any harm anyhow.
 -dnl (Don't use '-z nocombreloc' as -z takes no arg on Irix.)
  dnl Treat GCC specially since it just gives a non-fatal 'unrecognized option'
  dnl if not built to support GNU ld.
  
@@@ -1472,7 -1455,7 +1472,7 @@@ LIBS=$OLD_LIB
  
  dnl Current possibilities handled by sed (aix4-2 -> aix,
  dnl gnu-linux -> gnu/linux, etc.):
 -dnl gnu, gnu/linux, gnu/kfreebsd, aix, cygwin, darwin, hpux, irix.
 +dnl gnu, gnu/linux, gnu/kfreebsd, aix, cygwin, darwin, hpux.
  dnl And special cases: berkeley-unix, usg-unix-v, ms-dos, windows-nt.
  SYSTEM_TYPE=`echo $opsys | sed -e 's/[[0-9]].*//' -e 's|-|/|'`
  
  
  dnl checks for header files
  AC_CHECK_HEADERS_ONCE(
 +  malloc.h
    sys/systeminfo.h
    sys/sysinfo.h
    coff.h pty.h
  ## $window_system is now set to the window system we will
  ## ultimately use.
  
 -if test "$window_system" = none && test "$gl_gcc_warnings" = yes; then
 -   # Too many warnings for now.
 -   nw=
 -   nw="$nw -Wsuggest-attribute=noreturn"
 -   gl_MANYWARN_COMPLEMENT([WARN_CFLAGS], [$WARN_CFLAGS], [$nw])
 -
 -   gl_WARN_ADD([-Wno-unused-variable])
 -   gl_WARN_ADD([-Wno-unused-but-set-variable])
 -   gl_WARN_ADD([-Wno-unused-but-set-parameter])
 -fi
 -
  term_header=
  HAVE_X_WINDOWS=no
  HAVE_X11=no
@@@ -2128,13 -2121,7 +2128,13 @@@ case "$opsys" i
    cygwin) hybrid_malloc=yes;;
  esac
  
 +if test "${system_malloc}" != yes && test "${doug_lea_malloc}" != yes \
 +   && test "${UNEXEC_OBJ}" = unexelf.o; then
 +  hybrid_malloc=yes
 +fi
 +
  GMALLOC_OBJ=
 +HYBRID_MALLOC=
  if test "${system_malloc}" = "yes"; then
    AC_DEFINE([SYSTEM_MALLOC], 1,
      [Define to 1 to use the system memory allocator, even if it is not
  elif test "$hybrid_malloc" = yes; then
    AC_DEFINE(HYBRID_MALLOC, 1,
      [Define to use gmalloc before dumping and the system malloc after.])
 +  HYBRID_MALLOC=1
    GNU_MALLOC=
    GNU_MALLOC_reason="only before dumping"
    GMALLOC_OBJ=gmalloc.o
         of the main data segment.])
    fi
  fi
 +AC_SUBST([HYBRID_MALLOC])
 +AM_CONDITIONAL([HYBRID_MALLOC_LIB], [test -n "$HYBRID_MALLOC"])
  AC_SUBST(GMALLOC_OBJ)
  AC_SUBST(VMLIMIT_OBJ)
  
 -if test "$doug_lea_malloc" = "yes" ; then
 +if test "$doug_lea_malloc" = "yes" && test "$hybrid_malloc" != yes; then
    if test "$GNU_MALLOC" = yes ; then
      GNU_MALLOC_reason="
        (Using Doug Lea's new malloc from the GNU C Library.)"
  
  use_mmap_for_buffers=no
  case "$opsys" in
 -  cygwin|mingw32|freebsd|irix6-5) use_mmap_for_buffers=yes ;;
 +  cygwin|mingw32) use_mmap_for_buffers=yes ;;
  esac
  
  AC_FUNC_MMAP
@@@ -2420,20 -2404,13 +2420,20 @@@ if test "${HAVE_X11}" = "yes" || test "
        OLD_LIBS=$LIBS
        CFLAGS="$CFLAGS $IMAGEMAGICK_CFLAGS"
        LIBS="$IMAGEMAGICK_LIBS $LIBS"
 -      AC_CHECK_FUNCS(MagickExportImagePixels MagickMergeImageLayers)
 +      AC_CHECK_FUNCS(MagickExportImagePixels MagickMergeImageLayers MagickAutoOrientImage)
        CFLAGS=$OLD_CFLAGS
        LIBS=$OLD_LIBS
      fi
    fi
  fi
  
 +AC_CHECK_LIB(anl, getaddrinfo_a, HAVE_GETADDRINFO_A=yes)
 +if test "${HAVE_GETADDRINFO_A}" = "yes"; then
 +  AC_DEFINE(HAVE_GETADDRINFO_A, 1,
 +[Define to 1 if you have getaddrinfo_a for asynchronous DNS resolution.])
 +  GETADDRINFO_A_LIBS="-lanl"
 +  AC_SUBST(GETADDRINFO_A_LIBS)
 +fi
  
  HAVE_GTK=no
  GTK_OBJ=
  AC_SUBST(LIBGNUTLS_LIBS)
  AC_SUBST(LIBGNUTLS_CFLAGS)
  
 +HAVE_LIBSYSTEMD=no
 +if test "${with_libsystemd}" = "yes" ; then
 +  dnl This code has been tested with libsystemd 222 and later.
 +  dnl FIXME: Find the earliest version number for which Emacs should work,
 +  dnl and change '222' to that number.
 +  EMACS_CHECK_MODULES([LIBSYSTEMD], [libsystemd >= 222],
 +    [HAVE_LIBSYSTEMD=yes], [HAVE_LIBSYSTEMD=no])
 +  if test "${HAVE_LIBSYSTEMD}" = "yes"; then
 +    AC_DEFINE(HAVE_LIBSYSTEMD, 1, [Define if using libsystemd.])
 +  fi
 +fi
 +
 +AC_SUBST(LIBSYSTEMD_LIBS)
 +AC_SUBST(LIBSYSTEMD_CFLAGS)
 +
  NOTIFY_OBJ=
  NOTIFY_SUMMARY=no
  
@@@ -3374,24 -3336,26 +3374,26 @@@ HAVE_MODULES=n
  MODULES_OBJ=
  MODULES_SUFFIX=
  if test "${with_modules}" != "no"; then
-   if test "$opsys" = "gnu-linux"; then
-     LIBMODULES="-ldl"
-     MODULES_SUFFIX=".so"
-     HAVE_MODULES=yes
-   elif test "$opsys" = "cygwin"; then
-     MODULES_SUFFIX=".dll"
-     HAVE_MODULES=yes
-   elif test "$opsys" = "darwin"; then
-     MODULES_SUFFIX=".so"
-     HAVE_MODULES=yes
-   elif test "$opsys" = "mingw32"; then
-     MODULES_SUFFIX=".dll"
-     HAVE_MODULES=yes
-   else
-     # BSD system have dlopen in the libc
-     AC_CHECK_FUNC(dlopen, [MODULES_SUFFIX=".so"]
-                           [HAVE_MODULES=yes], [])
-   fi
+   case $opsys in
+     gnu|gnu-linux)
+       LIBMODULES="-ldl"
+       MODULES_SUFFIX=".so"
+       HAVE_MODULES=yes
+       ;;
+     cygwin|mingw32)
+       MODULES_SUFFIX=".dll"
+       HAVE_MODULES=yes
+       ;;
+     darwin)
+       MODULES_SUFFIX=".so"
+       HAVE_MODULES=yes
+       ;;
+     *)
+       # BSD system have dlopen in the libc
+       AC_CHECK_FUNC(dlopen, [MODULES_SUFFIX=".so"]
+                             [HAVE_MODULES=yes], [])
+       ;;
+   esac
  
    if test "${HAVE_MODULES}" = no; then
      AC_MSG_ERROR([Dynamic modules are not supported on your system])
  AC_SUBST(LIBXML2_LIBS)
  AC_SUBST(LIBXML2_CFLAGS)
  
 -# If netdb.h doesn't declare h_errno, we must declare it by hand.
 -# On MinGW, that is provided by nt/inc/sys/socket.h and w32.c.
 -if test "${opsys}" = "mingw32"; then
 -  emacs_cv_netdb_declares_h_errno=yes
 -fi
 -AC_CACHE_CHECK(whether netdb declares h_errno,
 -             emacs_cv_netdb_declares_h_errno,
 -[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]],
 -  [[return h_errno;]])],
 -  emacs_cv_netdb_declares_h_errno=yes, emacs_cv_netdb_declares_h_errno=no)])
 -if test $emacs_cv_netdb_declares_h_errno = yes; then
 -  AC_DEFINE(HAVE_H_ERRNO, 1, [Define to 1 if netdb.h declares h_errno.])
 -fi
 -
  # Check for mail-locking functions in a "mail" library.  Probably this should
  # have the same check as for liblockfile below.
  AC_CHECK_LIB(mail, maillock, have_mail=yes, have_mail=no)
@@@ -3768,7 -3746,7 +3770,7 @@@ mail_lock=n
  case "$opsys" in
    aix4-2) mail_lock="lockf" ;;
  
 -  gnu|freebsd|dragonfly|netbsd|openbsd|darwin|irix6-5) mail_lock="flock" ;;
 +  gnu|freebsd|dragonfly|netbsd|openbsd|darwin) 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.
@@@ -3813,7 -3791,7 +3815,7 @@@ AC_CHECK_FUNCS(accept4 fchdir gethostna
  getrusage get_current_dir_name \
  lrand48 random rint \
  select getpagesize setlocale newlocale \
 -getrlimit setrlimit shutdown getaddrinfo \
 +getrlimit setrlimit shutdown \
  pthread_sigmask strsignal setitimer \
  sendto recvfrom getsockname getpeername getifaddrs freeifaddrs \
  gai_strerror sync \
@@@ -3823,7 -3801,6 +3825,7 @@@ LIBS=$OLD_LIB
  
  dnl No need to check for posix_memalign if aligned_alloc works.
  AC_CHECK_FUNCS([aligned_alloc posix_memalign], [break])
 +AC_CHECK_DECLS([aligned_alloc], [], [], [[#include <stdlib.h>]])
  
  dnl Cannot use AC_CHECK_FUNCS
  AC_CACHE_CHECK([for __builtin_unwind_init],
@@@ -4000,13 -3977,44 +4002,13 @@@ AC_CACHE_CHECK([whether signals can be 
       [emacs_cv_alternate_stack=yes],
       [emacs_cv_alternate_stack=no])])
  
 -# Do we have res_init, for detecting changes in /etc/resolv.conf?
 -# 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
 -resolv=no
 -
 -if test $opsys != darwin; then
 -
 -  AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <netinet/in.h>
 -#include <arpa/nameser.h>
 -#include <resolv.h>]],
 -    [[return res_init();]])],
 -    have_res_init=yes, have_res_init=no)
 -  if test "$have_res_init" = no; then
 -    OLIBS="$LIBS"
 -    LIBS="$LIBS -lresolv"
 -    AC_MSG_CHECKING(for res_init with -lresolv)
 -    AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <netinet/in.h>
 -#include <arpa/nameser.h>
 -#include <resolv.h>]],
 -      [[return res_init();]])],
 -      have_res_init=yes, have_res_init=no)
 -    AC_MSG_RESULT($have_res_init)
 -    if test "$have_res_init" = yes ; then
 -      resolv=yes
 -    fi
 -    LIBS="$OLIBS"
 -  fi
 -
 -  if test "$have_res_init" = yes; then
 -    AC_DEFINE(HAVE_RES_INIT, 1, [Define to 1 if res_init is available.])
 -  fi
 -fi                              dnl !darwin
 -
  # Do we need the Hesiod library to provide the support routines?
  dnl FIXME?  Should we be skipping this on Darwin too?
  LIBHESIOD=
 +LIBRESOLV=
  if test "$with_hesiod" != no ; then
    # Don't set $LIBS here -- see comments above.  FIXME which comments?
 +  resolv=no
    AC_CHECK_FUNC(res_send, , [AC_CHECK_FUNC(__res_send, ,
       [AC_CHECK_LIB(resolv, res_send, resolv=yes,
                  [AC_CHECK_LIB(resolv, __res_send, resolv=yes)])])])
    else
      RESOLVLIB=
    fi
 +  hesiod=no
    AC_CHECK_FUNC(hes_getmailhost, , [AC_CHECK_LIB(hesiod, hes_getmailhost,
        hesiod=yes, :, $RESOLVLIB)])
  
    if test x"$hesiod" = xyes; then
      LIBHESIOD=-lhesiod
 +    LIBRESOLV=$RESOLVLIB
    fi
  fi
  AC_SUBST(LIBHESIOD)
 -
 -# Do we need libresolv (due to res_init or Hesiod)?
 -if test "$resolv" = yes && test $opsys != darwin; then
 -  LIBRESOLV=-lresolv
 -else
 -  LIBRESOLV=
 -fi
  AC_SUBST(LIBRESOLV)
  
  # These tell us which Kerberos-related libraries to use.
@@@ -4219,7 -4232,7 +4221,7 @@@ els
    SEPCHAR=':'
  fi
  AC_DEFINE_UNQUOTED(SEPCHAR, ['$SEPCHAR'], [Character that separates PATH elements.])
 -dnl This is for MinGW, and is used in test/automated/Makefile.in.
 +dnl This is for MinGW, and is used in test/Makefile.in.
  dnl The MSYS Bash has heuristics for replacing ':' with ';' when it
  dnl decides that a command-line argument to be passed to a MinGW program
  dnl is a PATH-style list of directories.  But that heuristics plays it
@@@ -4278,7 -4291,7 +4280,7 @@@ esa
  
  
  case $opsys in
 -  irix6-5 | sol2* | unixware )
 +  sol2* | unixware )
      dnl Some SVr4s don't define NSIG in sys/signal.h for ANSI environments;
      dnl instead, there's a system variable _sys_nsig.  Unfortunately, we
      dnl need the constant to dimension an array.  So wire in the appropriate
@@@ -4292,7 -4305,7 +4294,7 @@@ emacs_broken_SIGIO=n
  case $opsys in
    dnl SIGIO exists, but the feature doesn't work in the way Emacs needs.
    dnl See eg <http://article.gmane.org/gmane.os.openbsd.ports/46831>.
 -  hpux* | irix6-5 | nacl | openbsd | sol2* | unixware )
 +  hpux* | nacl | openbsd | sol2* | unixware )
      emacs_broken_SIGIO=yes
      ;;
  
@@@ -4400,7 -4413,7 +4402,7 @@@ dnl generated in the Makefile generate
  dnl NARROWPROTO, we will see the wrong function prototypes for X functions
  dnl taking float or double parameters.
  case $opsys in
 -  cygwin|gnu|gnu-linux|gnu-kfreebsd|irix6-5|freebsd|netbsd|openbsd)
 +  cygwin|gnu|gnu-linux|gnu-kfreebsd|freebsd|netbsd|openbsd)
      AC_DEFINE(NARROWPROTO, 1, [Define if system's imake configuration
        file defines 'NeedWidePrototypes' as 'NO'.])
    ;;
@@@ -4408,6 -4421,7 +4410,6 @@@ esa
  
  
  dnl Used in process.c, this must be a loop, even if it only runs once.
 -dnl (Except on SGI; see below.  Take that, clarity and consistency!)
  AH_TEMPLATE(PTY_ITERATION, [How to iterate over PTYs.])
  dnl Only used if !PTY_ITERATION.  Iterate from FIRST_PTY_LETTER to z,
  dnl trying suffixes 0-16.
@@@ -4470,6 -4484,27 +4472,6 @@@ case $opsys i
      AC_DEFINE(PTY_TTY_NAME_SPRINTF, [sprintf (pty_name, "/dev/pty/tty%c%x", c, i);])
      ;;
  
 -  irix6-5 )
 -    dnl It looks like this cannot be right, because it is not a loop.
 -    dnl However, process.c actually does this:
 -    dnl # ifndef __sgi
 -    dnl   continue;
 -    dnl # else
 -    dnl   return -1;
 -    dnl # endif
 -    dnl which presumably makes it OK, since irix == sgi (?).
 -    dnl FIXME it seems like this special treatment is unnecessary?
 -    dnl Why can't irix use a single-trip loop like eg cygwin?
 -    AC_DEFINE(PTY_ITERATION, [])
 -    dnl Not used, because PTY_ITERATION is defined.
 -    AC_DEFINE(FIRST_PTY_LETTER, ['q'])
 -    AC_DEFINE(PTY_OPEN, [ { struct sigaction ocstat, cstat; struct stat stb; char * name; sigemptyset(&cstat.sa_mask); cstat.sa_handler = SIG_DFL; cstat.sa_flags = 0; sigaction(SIGCHLD, &cstat, &ocstat); name = _getpty (&fd, O_RDWR | O_NDELAY, 0600, 0); sigaction(SIGCHLD, &ocstat, (struct sigaction *)0); if (name == 0) return -1; if (fd < 0) return -1; if (fstat (fd, &stb) < 0) return -1; strcpy (pty_name, name); }])
 -    dnl No need to get the pty name at all.
 -    AC_DEFINE(PTY_NAME_SPRINTF, [])
 -    dnl No need to use sprintf to get the tty name--we get that from _getpty.
 -    AC_DEFINE(PTY_TTY_NAME_SPRINTF, [])
 -    ;;
 -
    sol2* )
      dnl On SysVr4, grantpt(3) forks a subprocess, so do not use
      dnl O_CLOEXEC when opening the pty, and keep the SIGCHLD handler
@@@ -4504,7 -4539,8 +4506,7 @@@ AH_TEMPLATE(SIGNALS_VIA_CHARACTERS, [Ma
  
  case $opsys in
    dnl Perry Smith <pedz@ddivt1.austin.ibm.com> says this is correct for AIX.
 -  dnl thomas@mathematik.uni-bremen.de says this is needed for IRIX.
 -  aix4-2 | cygwin | gnu | irix6-5 | dragonfly | freebsd | netbsd | openbsd | darwin )
 +  aix4-2 | cygwin | gnu | dragonfly | freebsd | netbsd | openbsd | darwin )
      AC_DEFINE(SIGNALS_VIA_CHARACTERS, 1)
      ;;
  
@@@ -4584,7 -4620,8 +4586,7 @@@ if test x$GCC = xyes; the
     AC_DEFINE(GC_SETJMP_WORKS, 1)
  else
    case $opsys in
 -    dnl irix: Tested on Irix 6.5.  SCM worked on earlier versions.
 -    aix* | dragonfly | freebsd | netbsd | openbsd | irix6-5 | sol2* )
 +    aix* | dragonfly | freebsd | netbsd | openbsd | sol2* )
        AC_DEFINE(GC_SETJMP_WORKS, 1)
        ;;
    esac
@@@ -4688,6 -4725,12 +4690,6 @@@ case $opsys i
      AC_DEFINE(HPUX, [], [Define if the system is HPUX.])
      ;;
  
 -  irix6-5)
 -    AC_DEFINE(USG, [])
 -    AC_DEFINE(USG5_4, [])
 -    AC_DEFINE(IRIX6_5, [], [Define if the system is IRIX.])
 -    ;;
 -
    mingw32)
      AC_DEFINE(DOS_NT, [])
      AC_DEFINE(WINDOWSNT, 1, [Define if compiling for native MS Windows.])
@@@ -4761,6 -4804,11 +4763,6 @@@ case $opsys i
        reopen it in the child.])
      ;;
  
 -  irix6-5)
 -    AC_DEFINE(PREFER_VSUSP, 1, [Define if process_send_signal should
 -      use VSUSP instead of VSWTCH.])
 -    ;;
 -
    sol2-10)
      AC_DEFINE(_STRUCTURED_PROC, 1, [Needed for system_process_attributes
        on Solaris.])
  AC_SUBST(RALLOC_OBJ)
  
  if test "$opsys" = "cygwin"; then
 -  CYGWIN_OBJ="sheap.o cygw32.o"
 +  CYGWIN_OBJ="cygw32.o"
    ## Cygwin differs because of its unexec().
    PRE_ALLOC_OBJ=
    POST_ALLOC_OBJ=lastfile.o
@@@ -5328,13 -5376,13 +5330,13 @@@ AC_CONFIG_FILES([Makefile lib/Makefile 
         leim/Makefile nextstep/Makefile nt/Makefile])
  
  dnl test/ is not present in release tarfiles.
 -opt_makefile=test/automated/Makefile
 +opt_makefile=test/Makefile
  
  if test -f "$srcdir/$opt_makefile.in"; then
    SUBDIR_MAKEFILES="$SUBDIR_MAKEFILES $opt_makefile"
    dnl Again, it's best not to use a variable.  Though you can add
    dnl ", [], [opt_makefile='$opt_makefile']" and it should work.
 -  AC_CONFIG_FILES([test/automated/Makefile])
 +  AC_CONFIG_FILES([test/Makefile])
  fi
  
  
diff --combined doc/lispref/windows.texi
index bb13934fb3a4f0ce896c4e7684d4b9d194bca882,0665eb9098db6e9966a18fa7585948fae0dd6854..74837ac82b9a5b1fec1b78803b7b9e3cbc67963a
@@@ -545,12 -545,6 +545,12 @@@ its pixel height is the pixel height o
  children.
  @end defun
  
 +@defun window-pixel-height-before-size-change &optional Lisp_Object &optional window
 +This function returns the height of window @var{window} in pixels at the
 +time @code{window-size-change-functions} was run for the last time on
 +@var{window}'s frame (@pxref{Window Hooks}).
 +@end defun
 +
  @cindex window pixel width
  @cindex pixel width of a window
  @cindex total pixel width of a window
@@@ -565,12 -559,6 +565,12 @@@ If @var{window} is an internal window, 
  the screen areas spanned by its children.
  @end defun
  
 +@defun window-pixel-width-before-size-change &optional Lisp_Object &optional window
 +This function returns the width of window @var{window} in pixels at the
 +time @code{window-size-change-functions} was run for the last time on
 +@var{window}'s frame (@pxref{Window Hooks}).
 +@end defun
 +
  @cindex full-width window
  @cindex full-height window
    The following functions can be used to determine whether a given
@@@ -617,6 -605,12 +617,12 @@@ exceed its total height as returned by 
  @cindex body width of a window
  The @dfn{body width} of a window is the width of its text area, which
  does not include the scroll bar, fringes, margins or a right divider.
+ Note that when one or both fringes are removed (by setting their width
+ to zero), the display engine reserves two character cells, one on each
+ side of the window, for displaying the continuation and truncation
+ glyphs, which leaves 2 columns less for text display.  (The function
+ @code{window-max-chars-per-line}, described below, takes this
+ peculiarity into account.)
  
  @defun window-body-width &optional window pixelwise
  This function returns the width, in columns, of the body of window
@@@ -2409,23 -2403,6 +2415,23 @@@ visible and, unless @var{alist} contain
  entry (@pxref{Choosing Window Options}), raises that frame if necessary.
  @end defun
  
 +@defun display-buffer-reuse-mode-window buffer alist
 +This function tries to display @var{buffer} by finding a window
 +that is displaying a buffer in a given mode.
 +
 +If @var{alist} contains a @code{mode} entry, its value is a major mode
 +(a symbol) or a list of major modes.  If @var{alist} contains no
 +@code{mode} entry, the current major mode of @var{buffer} is used.  A
 +window is a candidate if it displays a buffer that derives from one of
 +the given modes.
 +
 +The behaviour is also controlled by entries for
 +@code{inhibit-same-window}, @code{reusable-frames} and
 +@code{inhibit-switch-frame} as is done in the function
 +@code{display-buffer-reuse-window}.
 +
 +@end defun
 +
  @defun display-buffer-pop-up-frame buffer alist
  This function creates a new frame, and displays the buffer in that
  frame's window.  It actually performs the frame creation by calling
@@@ -4116,11 -4093,11 +4122,11 @@@ was created for
  The argument @var{configuration} must be a value that was previously
  returned by @code{current-window-configuration}.  The configuration is
  restored in the frame from which @var{configuration} was made, whether
 -that frame is selected or not.  This always counts as a window size
 -change and triggers execution of the @code{window-size-change-functions}
 -(@pxref{Window Hooks}), because @code{set-window-configuration} doesn't
 -know how to tell whether the new configuration actually differs from the
 -old one.
 +that frame is selected or not.  In some rare cases this may trigger
 +execution of the @code{window-size-change-functions} (@pxref{Window
 +Hooks}) even if the size of windows did not change at all.  The
 +@code{window-configuration-change-hook} functions will be called if and
 +only if at least one window was added to or deleted from the frame.
  
  If the frame from which @var{configuration} was saved is dead, all this
  function does is restore the three variables @code{window-min-height},
@@@ -4407,38 -4384,33 +4413,38 @@@ work
  @end defvar
  
  @defvar window-size-change-functions
 -This variable holds a list of functions to be called if the size of
 -any window changes for any reason.  The functions are called at the
 -beginning of a redisplay cycle, and just once for each frame on which
 -size changes have occurred.
 -
 -Each function receives the frame as its sole argument.  There is no
 -direct way to find out which windows on that frame have changed size, or
 -precisely how.  However, if a size-change function records, at each
 -call, the existing windows and their sizes, it can also compare the
 -present sizes and the previous sizes.
 -
 -Creating or deleting windows counts as a size change, and therefore
 -causes these functions to be called.  Changing the frame size also
 -counts, because it changes the sizes of the existing windows.
 +This variable holds a list of functions to be called if the size of any
 +window changes for any reason.  The functions are called once per
 +redisplay, and once for each frame on which size changes have occurred.
 +
 +Each function receives the frame as its sole argument.  To find out
 +whether a specific window has changed size, compare the return values of
 +@code{window-pixel-width-before-size-change} and
 +@code{window-pixel-width} respectively
 +@code{window-pixel-height-before-size-change} and
 +@code{window-pixel-height} for that window (@pxref{Window Sizes}).
 +
 +These function are usually only called when at least one window was
 +added or has changed size since the last time this hook was run for the
 +associated frame.  In some rare cases this hook also runs when a window
 +that was added intermittently has been deleted afterwards.  In these
 +cases none of the windows on the frame will appear to have changed its
 +size.
  
  You may use @code{save-selected-window} in these functions
  (@pxref{Selecting Windows}).  However, do not use
  @code{save-window-excursion} (@pxref{Window Configurations}); exiting
 -that macro counts as a size change, which would cause these functions
 -to be called over and over.
 +that macro counts as a size change, which would cause these functions to
 +be called again.
  @end defvar
  
  @defvar window-configuration-change-hook
 -A normal hook that is run every time you change the window configuration
 -of an existing frame.  This includes splitting or deleting windows,
 -changing the sizes of windows, or displaying a different buffer in a
 -window.
 +A normal hook that is run every time the window configuration of a frame
 +changes.  Window configuration changes include splitting and deleting
 +windows and the display of a different buffer in a window.  Resizing the
 +frame or individual windows do not count as configuration changes.  Use
 +@code{window-size-change-functions}, see above, when you want to track
 +size changes that are not caused by the deletion or creation of windows.
  
  The buffer-local part of this hook is run once for each window on the
  affected frame, with the relevant window selected and its buffer
index 2b61bc2e752e4eefff7b7ae80355adf4a01d6c68,4f160e1ad6ddbae6d3b6d06505b4ce8e950438ff..4fe47f026b6a0e0772ecae8e05bc805bc74fb23b
@@@ -1225,9 -1225,10 +1225,10 @@@ and command `sh-reset-indent-vars-to-gl
    :type 'hook
    :group 'sh-script)
  
- (defcustom sh-mode-hook nil
+ (defcustom sh-mode-hook '(sh-electric-here-document-mode)
    "Hook run by `sh-mode'."
    :type 'hook
+   :options '(sh-electric-here-document-mode)
    :group 'sh-script)
  
  (defcustom sh-learn-basic-offset nil
@@@ -1616,7 -1617,8 +1617,8 @@@ buffer indents as it currently is inden
  \\[sh-execute-region]  Have optional header and region be executed in a subshell.
  
  `sh-electric-here-document-mode' controls whether insertion of two
- unquoted < insert a here document.
+ unquoted < insert a here document.  You can control this behavior by
+ modifying `sh-mode-hook'.
  
  If you generally program a shell different from your login shell you can
  set `sh-shell-file' accordingly.  If your shell's file name doesn't correctly
@@@ -1653,7 -1655,6 +1655,6 @@@ with your script for an edit-interpret-
    (setq-local syntax-propertize-function #'sh-syntax-propertize-function)
    (add-hook 'syntax-propertize-extend-region-functions
              #'syntax-propertize-multiline 'append 'local)
-   (sh-electric-here-document-mode 1)
    (setq-local skeleton-pair-alist '((?` _ ?`)))
    (setq-local skeleton-pair-filter-function 'sh-quoted-p)
    (setq-local skeleton-further-elements
    (setq-local skeleton-filter-function 'sh-feature)
    (setq-local skeleton-newline-indent-rigidly t)
    (setq-local defun-prompt-regexp
 -            (concat "^\\(function[ \t]\\|[[:alnum:]]+[ \t]+()[ \t]+\\)"))
 +              (concat
 +               "^\\("
 +               "\\(function[ \t]\\)?[ \t]*[[:alnum:]]+[ \t]*([ \t]*)"
 +               "\\|"
 +               "function[ \t]+[[:alnum:]]+[ \t]*\\(([ \t]*)\\)?"
 +               "\\)[ \t]*"))
    (setq-local add-log-current-defun-function #'sh-current-defun-name)
    (add-hook 'completion-at-point-functions
              #'sh-completion-at-point-function nil t)
diff --combined lisp/term.el
index ecaca505683072b17fe939a3fe8106fe646adac2,8cdf0c0e77c44c4a5558475213e1d3f7b8c10e3e..3520a3938e30aeb0acc5e2ffd82ac165ad691345
@@@ -834,10 -834,6 +834,10 @@@ is buffer-local.
      (define-key map [down] 'term-send-down)
      (define-key map [right] 'term-send-right)
      (define-key map [left] 'term-send-left)
 +    (define-key map [C-up] 'term-send-ctrl-up)
 +    (define-key map [C-down] 'term-send-ctrl-down)
 +    (define-key map [C-right] 'term-send-ctrl-right)
 +    (define-key map [C-left] 'term-send-ctrl-left)
      (define-key map [delete] 'term-send-del)
      (define-key map [deletechar] 'term-send-del)
      (define-key map [backspace] 'term-send-backspace)
@@@ -1221,10 -1217,6 +1221,10 @@@ without any interpretation.
  (defun term-send-down  () (interactive) (term-send-raw-string "\eOB"))
  (defun term-send-right () (interactive) (term-send-raw-string "\eOC"))
  (defun term-send-left  () (interactive) (term-send-raw-string "\eOD"))
 +(defun term-send-ctrl-up    () (interactive) (term-send-raw-string "\e[1;5A"))
 +(defun term-send-ctrl-down  () (interactive) (term-send-raw-string "\e[1;5B"))
 +(defun term-send-ctrl-right () (interactive) (term-send-raw-string "\e[1;5C"))
 +(defun term-send-ctrl-left  () (interactive) (term-send-raw-string "\e[1;5D"))
  (defun term-send-home  () (interactive) (term-send-raw-string "\e[1~"))
  (defun term-send-insert() (interactive) (term-send-raw-string "\e[2~"))
  (defun term-send-end   () (interactive) (term-send-raw-string "\e[4~"))
@@@ -4159,7 -4151,17 +4159,17 @@@ the process.  Any more args are argumen
      ;; .emacs ...
      (term-set-escape-char ?\C-x))
  
-   (switch-to-buffer term-ansi-buffer-name))
+   (switch-to-buffer term-ansi-buffer-name)
+   ;; For some reason, without the below setting, ansi-term behaves
+   ;; sluggishly, not clear why, since the buffer is typically very
+   ;; small.
+   ;;
+   ;; There's a larger problem here with supporting bidirectional text:
+   ;; the application that writes to the terminal could have its own
+   ;; ideas about displaying bidirectional text, and might not want us
+   ;; reordering the text or deciding on base paragraph direction.  One
+   ;; such application is Emacs in TTY mode...  FIXME.
+   (setq bidi-paragraph-direction 'left-to-right))
  
  \f
  ;;; Serial terminals
diff --combined lisp/window.el
index 1d41d821dc467b84c1cc39630fe5130b7386cf2a,fd0fcc975bea2f125259f690e79a98892223b567..e086efb594d97f8895f5a9e1bfe033e9b97d8e05
@@@ -1889,9 -1889,19 +1889,19 @@@ the font.
           (ncols (/ window-width font-width)))
        (if (and (display-graphic-p)
               overflow-newline-into-fringe
-              (/= (frame-parameter nil 'left-fringe) 0)
-              (/= (frame-parameter nil 'right-fringe) 0))
+                (not
+                 (or (eq left-fringe-width 0)
+                     (and (null left-fringe-width)
+                          (= (frame-parameter nil 'left-fringe) 0))))
+                (not
+                 (or (eq right-fringe-width 0)
+                     (and (null right-fringe-width)
+                          (= (frame-parameter nil 'right-fringe) 0)))))
          ncols
+         ;; FIXME: This should remove 1 more column when there are no
+         ;; fringes, lines are truncated, and the window is hscrolled,
+         ;; but EOL is not in the view, because then there are 2
+         ;; truncation glyphs, not one.
        (1- ncols)))))
  
  (defun window-current-scroll-bars (&optional window)
@@@ -6736,71 -6746,6 +6746,71 @@@ that frame.
        (unless (cdr (assq 'inhibit-switch-frame alist))
          (window--maybe-raise-frame (window-frame window)))))))
  
 +(defun display-buffer-reuse-mode-window (buffer alist)
 +  "Return a window based on the mode of the buffer it displays.
 +Display BUFFER in the returned window.  Return nil if no usable
 +window is found.
 +
 +If ALIST contains a `mode' entry, its value is a major mode (a
 +symbol) or a list of modes.  A window is a candidate if it
 +displays a buffer that derives from one of the given modes.  When
 +ALIST contains no `mode' entry, the current major mode of BUFFER
 +is used.
 +
 +The behaviour is also controlled by entries for
 +`inhibit-same-window', `reusable-frames' and
 +`inhibit-switch-frame' as is done in the function
 +`display-buffer-reuse-window'."
 +  (let* ((alist-entry (assq 'reusable-frames alist))
 +         (alist-mode-entry (assq 'mode alist))
 +       (frames (cond (alist-entry (cdr alist-entry))
 +                     ((if (eq pop-up-frames 'graphic-only)
 +                          (display-graphic-p)
 +                        pop-up-frames)
 +                      0)
 +                     (display-buffer-reuse-frames 0)
 +                     (t (last-nonminibuffer-frame))))
 +         (inhibit-same-window-p (cdr (assq 'inhibit-same-window alist)))
 +       (windows (window-list-1 nil 'nomini frames))
 +         (buffer-mode (with-current-buffer buffer major-mode))
 +         (allowed-modes (if alist-mode-entry
 +                            (cdr alist-mode-entry)
 +                          buffer-mode))
 +         (curwin (selected-window))
 +         (curframe (selected-frame)))
 +    (unless (listp allowed-modes)
 +      (setq allowed-modes (list allowed-modes)))
 +    (let (same-mode-same-frame
 +          same-mode-other-frame
 +          derived-mode-same-frame
 +          derived-mode-other-frame)
 +      (dolist (window windows)
 +        (let (mode? frame?)
 +          (with-current-buffer (window-buffer window)
 +            (setq mode?
 +                  (cond ((memq major-mode allowed-modes)
 +                         'same)
 +                        ((derived-mode-p allowed-modes)
 +                         'derived))))
 +          (when (and mode?
 +                     (not (and inhibit-same-window-p
 +                               (eq window curwin))))
 +            (if (eq curframe (window-frame window))
 +                (if (eq mode? 'same)
 +                    (push window same-mode-same-frame)
 +                  (push window derived-mode-same-frame))
 +              (if (eq mode? 'same)
 +                  (push window same-mode-other-frame)
 +                (push window derived-mode-other-frame))))))
 +      (let ((window (car (nconc same-mode-same-frame
 +                                same-mode-other-frame
 +                                derived-mode-same-frame
 +                                derived-mode-other-frame))))
 +        (when (window-live-p window)
 +          (prog1 (window--display-buffer buffer window 'reuse alist)
 +            (unless (cdr (assq 'inhibit-switch-frame alist))
 +              (window--maybe-raise-frame (window-frame window)))))))))
 +
  (defun display-buffer--special-action (buffer)
    "Return special display action for BUFFER, if any.
  If `special-display-p' returns non-nil for BUFFER, return an