Merged from emacs@sv.gnu.org. Last-minute emacsclient rewrites be damned!
authorKaroly Lorentey <lorentey@elte.hu>
Sun, 3 Dec 2006 15:03:30 +0000 (15:03 +0000)
committerKaroly Lorentey <lorentey@elte.hu>
Sun, 3 Dec 2006 15:03:30 +0000 (15:03 +0000)
Patches applied:

 * emacs@sv.gnu.org/emacs--devo--0--patch-490
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-491
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-492
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-493
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-494
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-495
   Merge from gnus--rel--5.10

 * emacs@sv.gnu.org/emacs--devo--0--patch-496
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-497
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-498
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-499
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-500
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-501
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-502
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-503
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-504
   Merge from gnus--rel--5.10

 * emacs@sv.gnu.org/emacs--devo--0--patch-505
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-506
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-507
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-508
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-509
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-510
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-511
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-512
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-513
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-514
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-515
   Merge from gnus--rel--5.10

 * emacs@sv.gnu.org/emacs--devo--0--patch-516
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-517
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-518
   Merge from gnus--rel--5.10

 * emacs@sv.gnu.org/emacs--devo--0--patch-519
   Update from CVS: etc/TUTORIAL.cn: Updated.

 * emacs@sv.gnu.org/emacs--devo--0--patch-520
   Merge from erc--emacs--22

 * emacs@sv.gnu.org/emacs--devo--0--patch-521
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-522
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-523
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-524
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-525
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-526
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-527
   Merge from gnus--rel--5.10

 * emacs@sv.gnu.org/emacs--devo--0--patch-528
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-529
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-530
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-531
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-532
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-533
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-534
   Merge from gnus--rel--5.10

 * emacs@sv.gnu.org/emacs--devo--0--patch-535
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-161
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-162
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-163
   Merge from emacs--devo--0

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-164
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-165
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-166
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-167
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-168
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-169
   Merge from emacs--devo--0

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-170
   Update from CVS

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-588

140 files changed:
README
README.multi-tty [new file with mode: 0644]
admin/notes/BRANCH
configure
configure.in
info/COPYING [deleted file]
lib-src/emacsclient.c
lib-src/etags.c
lisp/bindings.el
lisp/cus-face.el
lisp/cus-start.el
lisp/double.el
lisp/ebuff-menu.el
lisp/echistory.el
lisp/ediff-wind.el
lisp/edmacro.el
lisp/emulation/cua-base.el
lisp/env.el
lisp/faces.el
lisp/files.el
lisp/font-lock.el
lisp/frame.el
lisp/fringe.el
lisp/help-fns.el
lisp/international/encoded-kb.el
lisp/international/mule-cmds.el
lisp/international/mule.el
lisp/isearch.el
lisp/ldefs-boot.el
lisp/loadup.el
lisp/mail/emacsbug.el
lisp/menu-bar.el
lisp/progmodes/ebrowse.el
lisp/scroll-bar.el
lisp/server.el
lisp/simple.el
lisp/startup.el
lisp/subr.el
lisp/talk.el
lisp/term/AT386.el
lisp/term/README
lisp/term/apollo.el
lisp/term/bobcat.el
lisp/term/cygwin.el
lisp/term/internal.el
lisp/term/iris-ansi.el
lisp/term/linux.el
lisp/term/lk201.el
lisp/term/mac-win.el
lisp/term/news.el
lisp/term/rxvt.el
lisp/term/sun.el
lisp/term/tvi970.el
lisp/term/vt100.el
lisp/term/vt102.el
lisp/term/vt125.el
lisp/term/vt200.el
lisp/term/vt201.el
lisp/term/vt220.el
lisp/term/vt240.el
lisp/term/vt300.el
lisp/term/vt320.el
lisp/term/vt400.el
lisp/term/vt420.el
lisp/term/wyse50.el
lisp/term/x-win.el
lisp/term/xterm.el
lisp/termdev.el [new file with mode: 0644]
lisp/tmm.el
lisp/tool-bar.el
lisp/version.el
lisp/x-dnd.el
lisp/xt-mouse.el
lispref/elisp-covers.texi [deleted file]
lwlib/xlwmenu.c
mac/makefile.MPW
s.diff [new file with mode: 0644]
src/.arch-inventory
src/.gdbinit
src/Makefile.in
src/alloc.c
src/buffer.c
src/callint.c
src/callproc.c
src/cm.c
src/cm.h
src/coding.c
src/coding.h
src/config.in
src/data.c
src/dispextern.h
src/dispnew.c
src/emacs.c
src/eval.c
src/fileio.c
src/fns.c
src/fontset.c
src/frame.c
src/frame.h
src/fringe.c
src/gtkutil.c
src/image.c
src/indent.c
src/intervals.h
src/keyboard.c
src/keyboard.h
src/keymap.c
src/keymap.h
src/lisp.h
src/lread.c
src/macfns.c
src/macterm.c
src/macterm.h
src/minibuf.c
src/msdos.c
src/prefix-args.c
src/print.c
src/process.c
src/puresize.h
src/scroll.c
src/sysdep.c
src/syssignal.h
src/term.c
src/termchar.h
src/termhooks.h
src/terminal.c [new file with mode: 0644]
src/termopts.h
src/w32term.c
src/w32term.h
src/widget.c
src/window.c
src/window.h
src/xdisp.c
src/xfaces.c
src/xfns.c
src/xmenu.c
src/xselect.c
src/xsmfns.c
src/xterm.c
src/xterm.h

diff --git a/README b/README
index 793b756..ebb4224 100644 (file)
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-This directory tree holds version 22.0.91 of GNU Emacs, the extensible,
+This directory tree holds version 23.0.51 of GNU Emacs, the extensible,
 customizable, self-documenting real-time display editor.
 
 The file INSTALL in this directory says how to build and install GNU
diff --git a/README.multi-tty b/README.multi-tty
new file mode 100644 (file)
index 0000000..bfa03ed
--- /dev/null
@@ -0,0 +1,1536 @@
+                       -*- coding: utf-8; mode: text; -*-
+GOAL
+----
+
+This branch implements support for opening multiple, different tty
+devices and simultaneous X and tty frames from a single Emacs session.
+
+Some use cases:
+Emacs is notoriously slow at startup, so most people use another
+editor or emacsclient for quick editing jobs from the console.
+Unfortunately, emacsclient was very awkward to use, because it did not
+support opening a new Emacs frame on the current virtual tty.
+Now, with multi-tty support, it can do that.  (Emacsclient starts up
+faster than vi!)
+
+Some Gnus users (including me) run Gnus in an X frame in its own Emacs
+instance, which they typically leave running for weeks.  It would be
+nice if they could connect to this instance from a remote ssh session
+and check their messages without opening a remote X frame or resorting
+to gnus-slave.
+
+WHO IS DOING IT
+---------------
+
+I'm Károly LÅ‘rentey.  My address: lorentey@elte.hu.
+
+Comments, bug reports, suggestions and patches are welcome; send them
+to multi-tty@lists.fnord.hu.
+
+The following is a (sadly incomplete) list of people who have
+contributed to the project by testing, submitting patches, bug
+reports, and suggestions.  Thanks!
+
+Bernard Adrian <bernadrian@free.fr>
+ARISAWA Akihiro <ari@mbf.ocn.ne.jp>
+Vincent Bernat <bernat@luffy.cx>
+Han Boetes <han@mijncomputer.nl>
+Francisco Borges <borges@let.rug.nl>
+Damien Cassou <damien.cassou@laposte.net>
+Robert J. Chassell <bob@rattlesnake.com>
+Romain Francoise <romain@orebokech.com>
+Ami Fischman <ami@fischman.org>
+Noah Friedman <friedman@splode.com>
+Friedrich Delgado Friedrichs <friedel@nomaden.org>
+Samium Gromoff <_deepfire@mail.ru>
+Mikhail Gusarov <dottedmag@dottedmag.net>
+Eric Hanchrow <offby1@blarg.net>
+IRIE Tetsuya <irie@t.email.ne.jp>
+Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp>
+Bas Kok <nekkobassu@yahoo.com>
+Jurej Kubelka <Juraj.Kubelka@email.cz>
+David Lichteblau <david@lichteblau.com>
+Richard Lewis <rtf@jabble.com>
+mace <mace@kirjakaapeli.lib.hel.fi>
+Suresh Madhu <madhu@cs.unm.edu>
+Xavier Mallard <zedek@gnu-rox.org>
+Istvan Marko <mi-mtty@kismala.com>
+Ted Morse <morse@ciholas.com>
+Gergely Nagy <algernon@debian.org>
+Dan Nicolaescu <dann@ics.uci.edu>
+Kalle Olavi Niemitalo <kon@iki.fi>
+Mark Plaksin <happy@mcplaksin.org>
+Frank Ruell <stoerte@dreamwarrior.net>
+Tom Schutzer-Weissmann <trmsw@yahoo.co.uk>
+Joakim Verona <joakim@verona.se>
+Dan Waber <dwaber@logolalia.com>
+and many others.
+
+Richard Stallman was kind enough to review an earlier version of my
+patches.
+
+
+MAILING LISTS
+-------------
+
+The multi-tty mailing list (discussion & bug reports):
+
+       Address:        multi-tty@lists.fnord.hu
+       Signup:         http://lists.fnord.hu/mailman/listinfo/multi-tty
+       Archive:        http://news.gmane.org/gmane.emacs.multi-tty/
+
+Commit notifications (read-only):
+
+        Address:       multi-tty-commits@lists.fnord.hu
+       Signup:         http://lists.fnord.hu/mailman/listinfo/multi-tty-commits
+
+
+STATUS
+------
+
+The branch is now very stable and almost full-featured.  All of the
+major problems have been fixed, only a few minor issues remain.  (It
+still needs to be ported to Windows/Mac/DOS, though.)  Both multiple
+tty device support and simultaneous X and tty frame support works
+fine.  Emacsclient has been extended to support opening new tty and X
+frames.  It has been changed to open new Emacs frames by default.
+
+The multi-tty branch has been scheduled for inclusion in the next
+major release of Emacs (version 23).  I expect the merge into the
+development trunk to occur sometime during next year (2006), after the
+merge of the Unicode branch.
+
+Tested on GNU/Linux, Solaris 8, FreeBSD and OpenBSD.  Please let me
+know if you succeed or fail to use it on other platforms---I'll have a
+few tricky test cases for you.
+
+Known problems:
+
+        * GTK support.  If you compile your Emacs with the GTK
+          toolkit, some functionality of multi-tty will be lost.  In
+          particular, you will not be able to work on multiple X
+          displays at once.  Current releases of GTK have limitations
+          and bugs that prevent full-blown multi-display support in
+          Emacs.  (GTK crashes when Emacs tries to disconnect from an
+          X server.)  Use the Lucid toolkit if you want to see a
+          complete feature set.
+
+        * The single-kboard mode.
+
+         If your multi-tty Emacs session seems to be frozen, you
+         probably have a recursive editing session or a pending
+         minibuffer prompt (which is a kind of recursive editing) on
+         another display.  To unfreeze your session, switch to that
+         display and complete the recursive edit, for example by
+         pressing C-] (`abort-recursive-edit').
+
+         I am sorry to say that currently there is no way to break
+         out of this "single-kboard mode" from a frozen display.  If
+         you are unable to switch to the display that locks the
+         others (for example because it is on a remote computer),
+         then you can use emacsclient to break out of all recursive
+         editing sessions:
+
+               emacsclient -e '(top-level)'
+
+         Note that this (perhaps) unintuitive behaviour is by design.
+         Single-kboard mode is required because of an intrinsic Emacs
+         limitation that is very hard to eliminate.  (This limitation
+         is related to the single-threaded nature of Emacs.)
+
+         I plan to implement better user notification and support for
+         breaking out of single-kboard mode from locked displays.
+
+       * Mac, Windows and DOS support is broken, doesn't even
+         compile.  Multiple display support will probably not provide
+         new Emacs features on these systems, but the multi-tty
+         branch changed a few low-level interfaces, and the
+         system-dependent source files need to be adapted
+         accordingly.  The changes are mostly trivial, so almost
+         anyone can help, if only by compiling the branch and
+         reporting the compiler errors.
+
+
+HOW TO GET THE BRANCH
+---------------------
+
+The branch uses Bazaar 1 (http://bazaar.canonical.com) for version control.
+
+Retrieving the latest version of the branch:
+
+       baz register-archive -f http://aszt.inf.elte.hu/~lorentey/mirror/arch/2004
+       baz get lorentey@elte.hu--2004/emacs--multi-tty <directory>
+
+This incantation uses an archive mirror that is hosted on a
+high-bandwidth site.  Please note that on average there is a two-hour
+delay for commits to arrive on this mirror.  My primary mirror is on the
+low-bandwidth http://lorentey.hu/ site:
+
+       baz register-archive -f http://lorentey.hu/arch/2004/
+       baz get lorentey@elte.hu--2004/emacs--multi-tty <directory>
+
+This is "instantly" updated, but very slow from outside Hungary.
+(By "instantly" I mean as soon as I connect the notebook I work on to
+a network.  It could take days.)
+
+The Arch supermirror provides mirroring services for all public Arch
+repositories.  We have a mirror there, too, if you prefer.
+
+       baz register-archive -f http://mirrors.sourcecontrol.net/lorentey%40elte.hu--2004
+       baz get lorentey@elte.hu--2004/emacs--multi-tty <directory>
+
+My GPG key id is 0FB27A3F; it is available from
+hkp://wwwkeys.eu.pgp.net/, or from my homepage at
+http://lorentey.hu/rolam/gpg.html)
+
+Don't worry if the above checkout takes a few minutes to complete;
+once you have a source tree, updating it to the latest revision will
+be _much_ faster.  Use the following command for the update:
+
+       baz replay
+
+You can find more information about Bazaar on
+http://bazaar.canonical.com/.  It's a distributed source control
+system that is somewhat less broken than competing projects.
+
+If you don't have Bazaar, the branch has a homepage from which you can
+download conventional patches against Emacs CVS HEAD:
+
+       http://lorentey.hu/project/emacs.html
+
+I suggest you use Bazaar whenever feasible.
+
+
+DEBIAN PACKAGES
+---------------
+
+If you run Debian, or a distribution based on Debian, you are welcome
+to use our binary packages; put these lines in your /etc/apt/sources.list:
+
+       # Multi-tty Emacs
+       deb http://aszt.inf.elte.hu/~lorentey/mirror/apt unstable multi-tty
+       deb-src http://aszt.inf.elte.hu/~lorentey/mirror/apt unstable multi-tty
+
+Note that these packages are intended solely to provide an easy way to
+test the new multi-tty features.  They are not to be taken as Emacs
+releases, and it's a mistake to expect robust operation or any kind of
+timely support for them.  Do not install them, unless you'd like to
+have your editor crash on you.
+
+
+COMPILATION
+-----------
+
+The multi-tty branch is compiled the same way as Emacs itself:
+
+       make maintainer-clean  # (If you have compiled Emacs before)
+
+       ./configure --without-gtk <your favourite options>
+       make bootstrap
+       make install
+
+If you have strange compilation errors, they may be caused by old
+*.elc files that are left over from an earlier bootstrap.  The `make
+maintainer-clean' target deletes them, so it is a good idea to run
+that before reporting a bug.  (Emacs requires a clean recompilation
+after certain kinds of source code changes.)
+
+TESTING
+-------
+
+To test the multi-tty branch, start up the Emacs server with the
+following commands:
+
+       emacs
+       M-x server-start
+
+and then (from a shell prompt on another terminal) start emacsclient
+with
+       emacsclient -t /optional/file/names...   (for a tty frame)
+       emacsclient /optional/file/names...      (for an X frame)
+
+(Make sure both emacs and emacsclient are multi-tty versions.)
+You'll hopefully have two fully working, independent frames on
+separate terminals. The new frame is closed automatically when you
+finish editing the specified files (C-x #), but delete-frame (C-x 5 0)
+also works.  Of course, you can create frames on more than two tty
+devices.
+
+Creating new frames on the same tty with C-x 5 2 (make-frame-command)
+works, and behaves the same way as in previous Emacs versions.  If you
+exit emacs, all terminals should be restored to their previous states.
+
+This is work in progress, and probably full of bugs.  It is a good
+idea to run emacs from gdb, so that you'll have a live instance to
+debug if something goes wrong.  Please send me your bug reports on our
+mailing list: multi-tty@lists.fnord.hu
+
+TIPS & TRICKS
+-------------
+
+I think the best way to use the new Emacs is to have it running inside
+a disconnected GNU screen session, and always use emacsclient for
+normal work.  One advantage of this is that not a single keystroke of
+your work will be lost if the display device that you are using
+crashes, or the network connection times out, or whatever.  (I had an
+extremely unstable X server for some time while I was developing these
+patches, and running Emacs this way has saved me a number of M-x
+recover-session invocations.)
+
+I use the following two bash scripts to handle my Emacs sessions:
+
+-------------------------------------------------------connect-emacs--
+#!/bin/bash
+# Usage: connect-emacs <name> <args>...
+#
+# Connects to the Emacs instance called NAME.  Starts up the instance
+# if it is not already running.  The rest of the arguments are passed
+# to emacsclient.
+
+name="$1"
+shift
+    
+if [ -z "$name" ]; then
+    echo "Usage: connect_emacs <name> <args>..." >&2
+    exit 1
+fi
+preload-emacs "$name" wait
+/usr/bin/emacsclient.emacs-multi-tty -s "$name" "$@"
+----------------------------------------------------------------------
+
+-------------------------------------------------------preload-emacs--
+#!/bin/bash
+# Usage: preload-emacs <name> [<waitp>]
+#
+# Preloads the Emacs instance called NAME in a detached screen
+# session.  Does nothing if the instance is already running.  If WAITP
+# is non-empty, the function waits until the server starts up and
+# creates its socket; otherwise it returns immediately.
+
+name="$1"
+waitp="$2"
+screendir="/var/run/screen/S-$USER"
+serverdir="/tmp/emacs$UID"
+emacs=/usr/bin/emacs-multi-tty # Or wherever you installed your multi-tty Emacs
+
+if [ -z "$name" ]; then 
+    echo "Usage: preload_emacs <name> [<waitp>]" >&2
+    exit 1
+fi
+
+if [ ! -e "$screendir"/*."$name" ]; then
+    if [ -e "$serverdir/$name" ]; then
+       # Delete leftover socket (for the wait option)
+       rm "$serverdir/$name"
+    fi
+    screen -dmS "$name" "$emacs" -nw --eval "(setq server-name \"$name\")" -f server-start
+fi
+if [ ! -z "$waitp" ]; then
+    while [ ! -e "$serverdir/$name" ]; do sleep 0.1; done
+fi
+----------------------------------------------------------------------
+
+I have the following in my profile to have two instances automatically
+preloaded for editing and email:
+
+       preload-emacs editor
+       preload-emacs gnus
+
+It is useful to set up short aliases for connect-emacs.  I use the
+following:
+
+       alias edit="connect-emacs editor"
+       alias e=edit
+       alias et="connect-emacs editor -t"
+       alias gnus="connect-emacs gnus"
+
+
+CHANGELOG
+---------
+
+See arch logs.
+
+
+NEWS
+----
+
+For the NEWS file:  (Needs much, much work)
+
+** Support for multiple terminal devices and simultaneous graphical
+   and tty frames has been added.  You can test for the presence of
+   this feature in your Lisp code by testing for the `multi-tty'
+   feature.
+
+*** The `window-system' variable has been made frame-local. The new
+    `initial-window-system' variable contains the `window-system'
+    value for the first frame.
+
+*** You can specify a terminal device (`tty' parameter) and a terminal
+    type (`tty-type' parameter) to `make-terminal-frame'.
+
+*** The new function `make-frame-on-tty' allows you to create a new
+    frame on another tty device interactively.
+
+*** The function `make-frame-on-display' now works during a tty
+    session, and `make-frame-on-tty' works during a graphical session.
+
+*** Emacsclient has been extended to support opening a new terminal
+    frame. Its behaviour has been changed to open a new Emacs frame by
+    default.  Use the -c option to get the old behavior of opening
+    files in the currently selected Emacs frame.
+
+*** C-z now invokes `suspend-frame', C-x C-c now invokes
+    `save-buffers-kill-terminal'.
+
+*** New functions: frame-tty-name, frame-tty-type, delete-tty,
+    suspend-tty, resume-tty, terminal-id, terminal-parameters,
+    terminal-parameter, set-terminal-parameter,
+    modify-terminal-parameters, environment, let-environment
+
+*** New variables: local-key-translation-map, local-function-key-map
+
+*** The `keyboard-translate-table' variable and the terminal and
+    keyboard coding systems have been made terminal-local.
+
+*** In addition to the global key-translation-map and
+    function-key-map, Emacs has terminal-local
+    local-key-translation-map and local-function-key-map variables,
+    and uses them instead of the global keymaps to set up translations
+    and function key sequences relevant to a specific terminal device.
+
+*** talk.el has been extended for multiple tty support.
+
+* * *
+
+(The rest of this file consists of my development notes and as such it
+is probably not very interesting for anyone else.)
+
+THINGS TO DO
+------------
+
+** See if `tty-defined-color-alist' needs to be terminal-local.
+   Update: Dan says it should be, so convert it.
+
+** Mikhail Gusarov suggest to add a hook akin to
+   `after-make-frame-functions' that is called whenever Emacs connects
+   to a new terminal.  Good idea!
+
+** emacsclient -t on the console does not work after su.  You have to
+   use non-root accounts or start as root to see this.
+
+       Login: root
+       Password:
+       # su lorentey
+       $ emacsclient -t
+       *ERROR*: Could not open file: /dev/tty1
+
+   The tty can be opened as /dev/tty by emacsclient, but not by Emacs.
+   This seems to be a serious problem.  Currently my only idea is to
+   bring back the ugly pty proxy hack from the initial versions of
+   multi-tty.  Suggestions would be appreciated.
+
+   Update: we could change emacsclient to pass its open file
+   descriptor to the Emacs process.  Unfortunately, this requires a
+   new Lisp-level Emacs API, and as file descriptors are not otherwise
+   exported to Lisp, this approach seems at least as ugly as the pty
+   proxy idea.
+
+** lisp/vc.el depends on the terminal type during load time.
+   `vc-annotate-color-map' is one example that needs to be fixed.
+
+** Understand how `quit_throw_to_read_char' works, and fix any bugs
+   that come to light.
+
+** See if getcjmp can be eliminated somehow.  Why does Emacs allow
+   asynchronous input processing while it's reading input anyway?
+
+** `delete-frame' events are handled by `special-event-map'
+   immediately when read by `read_char'.  This is fine but it prevents
+   higher-level keymaps from binding that event to get notified of the
+   deleted frame.
+
+   Sometimes it would be useful for Lisp code to be notified of frame
+   deletions after they have happened, usually because they want to
+   clean up after the deleted frame.  Not all frame-local states can
+   be stored as a frame parameter.  For example,
+   `display-splash-screen' uses `recursive-edit' with a special keymap
+   override to create its buffer---and it leads to all kinds of
+   nastiness if Emacs stays in this recursive edit mode after the
+   frame containing the splash screen is deleted.  Basically, the
+   splash-screen implementation wants to throw out of the recursive
+   edit when the frame is deleted; however, it is not legal to throw
+   from `delete-frame-functions' because `delete-frame' must not fail.
+   (Introducing `delete-frame-after-functions' would not help either
+   because `delete-frame' may not fail at that time either.)
+
+   Currently `fancy-splash-screens' installs a
+   `delete-frame-functions' hook that sets up a timer to exit the
+   recursive edit.  This is an adequate solution, but it would perhaps
+   be better to have something like a `frame-deleted' event that could
+   be bound in the normal way.
+
+** Trouble: `setenv' doesn't actually set environment variables in the
+   Emacs process.  This defeats the purpose of the elaborate
+   `server-with-environment' magic around the `tgetent' call in
+   `init_tty'.  D'oh.
+
+** (Possibly) create hooks in struct device for creating frames on a
+   specific terminal, and eliminate the hackish terminal-related frame
+   parameters (display, tty, tty-type).
+
+       make_terminal_frame
+               create_tty_output
+
+** Decide whether to keep the C implementation of terminal parameters,
+   or revert to the previous, purely Lisp code.  It turned out that
+   local environments do not need terminal parameters after all.
+
+** Move Fsend_string_to_terminal to term.c, and declare get_named_tty
+   as static, removing it from dispextern.h.
+   Move fatal to emacs.c and declare it somewhere.
+
+** Search for `suspend-emacs' references and replace them with
+   `suspend-frame', if necessary.  Ditto for `save-buffers-kill-emacs'
+   vs. `save-buffers-kill-display'.
+
+** Emacs crashes when a tty frame is resized so that there is no space
+   for all its windows.  (Tom Schutzer-Weissmann)
+
+** Report GTK multi-display problems to GTK maintainers.  For extra
+   credit, fix them.
+
+   Currently you can not connect to new X displays when you compile
+   Emacs with GTK support.  If you want to play around with GTK
+   multidisplay (and don't mind core dumps), you can edit src/config.h
+   and define HAVE_GTK_MULTIDISPLAY there by hand.
+   
+       http://bugzilla.gnome.org/show_bug.cgi?id=85715
+
+   Update: Han reports that GTK+ version 2.8.9 almost gets display
+   disconnects right.  GTK will probably be fully fixed by the time
+   multi-tty gets into the trunk.
+
+   Update: I am still having problems with GTK+ 2.8.10.  I have the
+   impression that the various multidisplay fixes will only get
+   released in GTK+ 2.10.
+
+** Audit `face-valid-attribute-values' usage in customize and
+   elsewhere.  Its return value depends on the current window system.
+   Replace static initializers using it with runtime functions.  For
+   example, custom's buttons are broken on non-initial device types.
+
+** Possibly turn off the double C-g feature when there is an X frame.
+   C.f. (emacs)Emergency Escape.
+
+** frames-on-display-list should also accept frames.
+
+** Consider the `tty-type' frame parameter and the `display-tty-type'
+   function.  They serve the exact same purpose.  I think it may be
+   a good idea to eliminate one of them, preferably `tty-type'.
+
+** The handling of lisp/term/*.el, and frame creation in general, is a
+   big, big mess.  How come the terminal-specific file is loaded by
+   tty-create-frame-with-faces?  I don't think it is necessary to load
+   these files for each frame; once per terminal should be enough.
+   Update: lisp/term/*.el is not loaded repeatedly anymore, but
+   faces.el still needs to be cleaned up.
+
+** Fix frame-set-background-mode in this branch.  It was recently
+   changed in CVS, and frame.el in multi-tty has not yet been adapted
+   for the changes.  (It needs to look at
+   default-frame-background-mode.)  (Update: maybe it is fixed now;
+   needs testing.) (Note that the byte compiler has this to say about
+   term/rxvt.el:)
+
+       term/rxvt.el:309:17:Warning: assignment to free variable
+           `default-frame-background-mode'
+
+** I think `(set-)terminal-local-value' and the terminal parameter
+   mechanism should be integrated into a single framework.
+
+   (Update: `(set-)terminal-local-value' is now eliminated, but the
+   terminal-local variables should still be accessible as terminal
+   parameters.  This also applies to `display-name' and similar
+   functions.)
+
+** Add the following hooks: after-delete-frame-hook (for server.el,
+   instead of delete-frame-functions),
+   after-delete-terminal-functions, after-create-terminal-functions.
+
+** BULK RENAME: The `display-' prefix of new Lisp-level functions
+   conflicts with stuff like `display-time-mode'.  Use `device-'
+   or `terminal-' instead.  I think I prefer `terminal-'.
+
+   It turns out that most of the offending Lisp functions were defined
+   in the trunk.  Therefore, compatibility aliases should be defined
+   for the following names:
+
+    display-color-cells                        terminal-color-cells
+    display-color-p                    terminal-color-p
+    display-graphic-p                  terminal-graphic-p
+    display-grayscale-p                        terminal-grayscale-p
+    display-images-p                   terminal-images-p
+    display-mm-height                  terminal-mm-height
+    display-mm-width                   terminal-mm-width
+    display-mouse-p                    terminal-mouse-p
+    display-multi-font-p               terminal-multi-font-p
+    display-multi-frame-p              terminal-multi-frame-p
+    display-pixel-height               terminal-pixel-height
+    display-pixel-width                        terminal-pixel-width
+    display-pixels-per-inch            terminal-pixels-per-inch
+    display-planes                     terminal-planes
+    display-popup-menus-p              terminal-popup-menus-p
+    display-save-under                 terminal-save-under
+    display-screens                    terminal-screens
+    display-supports-face-attributes-p terminal-supports-face-attributes-p
+    display-visual-class               terminal-visual-class
+    framep-on-display                  framep-on-terminal
+    frames-on-display-list             frames-on-terminal-list
+
+   The following functions were introduced in the multi-tty branch, and
+   were renamed without aliases:
+
+    delete-display                     delete-terminal
+    display-controlling-tty-p           controlling-tty-p
+    display-list                        terminal-list
+    display-live-p                      terminal-live-p
+    display-name                        terminal-name
+    display-tty-type                    tty-type
+    frame-display                       frame-terminal
+    selected-display                   selected-terminal
+
+** The single-keyboard mode of MULTI_KBOARD is extremely confusing
+   sometimes; Emacs does not respond to stimuli from other keyboards.
+   At least a beep or a message would be important, if the single-mode
+   is still required to prevent interference.  (Reported by Dan
+   Nicolaescu.)  
+
+   Update: selecting a region with the mouse enables single_kboard
+   under X.  This is very confusing.
+
+   Update: After discussions with Richard Stallman, this will be
+   resolved by having locked displays warn the user to wait, and
+   introducing a complex protocol to remotely bail out of
+   single-kboard mode by pressing C-g.
+
+   Update: Warning the user is not trivial to implement, as Emacs has
+   only one echo area, shared by all frames.  Ideally the warning
+   should not be displayed on the display that is locking the others.
+   Perhaps the high probability of user confusion caused by
+   single_kboard mode deserves a special case in the display code.
+   Alternatively, it might be good enough to signal single_kboard mode
+   by changing the modelines or some other frame-local display element
+   on the locked out displays.
+
+   Update: In fact struct kboard does have an echo_string slot.
+
+** The session management module is prone to crashes when the X
+   connection is closed and then later I try to connect to a new X
+   session:
+
+       #0  0xb7ebc806 in SmcGetIceConnection () from /usr/X11R6/lib/libSM.so.6
+       #1  0x080e6641 in x_session_check_input (bufp=0xbf86c9c0) at xsmfns.c:144
+       #2  0x080d3bbc in XTread_socket (device=0xa722ff8, expected=1, hold_quit=0xbf86ca90) at xterm.c:7037
+       #3  0x080fa404 in read_avail_input (expected=1) at keyboard.c:6696
+       #4  0x080fa4ca in handle_async_input () at keyboard.c:6900
+       #5  0x080d51fa in x_term_init (display_name=162628899, xrm_option=0x0, resource_name=0x857068c "emacs") at xterm.c:10622
+       #6  0x080d920e in x_display_info_for_name (name=162628899) at xfns.c:3975
+       #7  0x080d92f9 in check_x_display_info (object=1) at xfns.c:274
+       #8  0x080d97b8 in Fx_create_frame (parms=151221485) at xfns.c:3016
+       #9  0x0815bf72 in Ffuncall (nargs=2, args=0xbf86ceec) at eval.c:2851
+
+   I installed a workaround to prevent this.  The X session manager is
+   only contacted when the very first display in the Emacs session is
+   an X display.  Also, x_delete_display() on this display aborts
+   session management, and XTread_socket only calls
+   x_session_check_input when it is called for the display that the
+   session was opened on.  While this does not really fix the bug, it
+   makes it much less frequent, because session manager support will
+   not normally be enabled when Emacs can survive the shutdown of the
+   X server.
+
+   See if xsmfns.c should be updated.
+
+** Hunt down display-related functions in frame.el and extend them all
+   to accept display ids.
+
+** rif->flush_display_optional (NULL) calls should be replaced by a
+   new global function.
+
+** The set-locale-environment hack (adding the DISPLAY option) should
+   be replaced with a clean design.
+
+** standard-display-table should be display-local.
+   standard-display-european should be display-local.
+
+** With iswitchb-default-method set to 'always-frame, only frames on
+   the current display should be considered.  This might involve
+   extending `get-buffer-window'.
+
+** Have a look at Vlocale_coding_system.  Seems like it would be a
+   tedious job to localize it, although most references use it for
+   interfacing with libc and are therefore OK with the global
+   definition.
+
+   Exceptions found so far: x-select-text and
+   x-cut-buffer-or-selection-value.
+
+** Have a look at fatal_error_hook.
+
+** Have a look at set_frame_matrix_frame.
+
+** Check if we got term-setup-hook right.
+
+** I think tip_frame should be display-local.
+
+** Check display reference count handling in x_create_tip_frame.
+
+** make-frame does not correctly handle extra parameters in its
+   argument:
+
+       (frame-parameter (make-frame (list (cons 'foobar 42))) 'foobar)
+               => nil
+
+   (This is likely an error in the CVS trunk.)
+
+** Dan Nicolaescu suggests that -nw should be added as an alias for -t
+   in emacsclient.  Good idea.  (Alas, implementing this is not
+   trivial, getopt_long does not seem to support two-letter ``short''
+   options.  Patches are welcome.)
+
+** Mark Plaksin suggests that emacsclient should accept the same
+   X-related command-line arguments as Emacs.  Most of the X-related
+   argument-handling is done in Lisp, so this should be quite easy to
+   implement.  (For example, Samium Gromoff wants emacsclient to
+   support --geometry; implementing this would add that support.)
+
+** Gergely Nagy suggests that C-x # should only kill the current
+   frame, not any other emacsclient frame that may have the same file
+   opened for editing.  I think I agree with him.
+
+** Very strange bug: visible-bell does not work on secondary
+   terminals in xterm and konsole.  The screen does flicker a bit,
+   but it's so quick it isn't noticable.
+
+   (Update: This is probably some problem with padding or whatnot on
+   the secondary terminals.)
+
+** Move baud_rate to struct display.
+
+** Implement support for starting an interactive Emacs session without
+   an initial frame.  (The user would connect to it and open frames
+   later, with emacsclient.)
+
+** Fix Mac support (I can't do this entirely myself).  Note that the
+   current state of Mac-specific source files in the multi-tty tree
+   are not useful; before starting work on Mac support, revert to
+   pristine, pre-multi-tty versions.
+
+** Fix W32 support (I can't do this entirely myself).  Note that the
+   current state of W32-specific source files in the multi-tty tree
+   are not useful; before starting work on W32 support, revert to
+   pristine, pre-multi-tty versions.
+
+** Fix DOS support (I can't do this entirely myself).  Note that the
+   current state of DOS-specific source files in the multi-tty tree
+   are not useful; before starting work on DOS support, revert to
+   pristine, pre-multi-tty versions.
+
+** Do a grep on XXX and ?? for more issues.
+
+** flow-ctrl.el must be updated.
+
+** Fix stuff_char for multi-tty.  Doesn't seem to be of high priority.
+
+DIARY OF CHANGES
+----------------
+
+(ex-TODO items with explanations.)
+
+-- Introduce a new struct for terminal devices.
+
+   (Done, see struct tty_output.  The list of members is not yet
+   complete.)
+
+-- Change the bootstrap procedure to initialize tty_list.
+
+   (Done, but needs review.)
+
+-- Change make-terminal-frame to support specifying another tty.
+
+   (Done, new frame parameters: `tty' and `tty-type'.)
+
+-- Implement support for reading from multiple terminals.
+
+   (Done, read_avail_input tries to read from each terminal, until one
+   succeeds.  MULTI_KBOARD is not used.  Secondary terminals don't send
+   SIGIO!)
+
+   (Update: They do, now.)
+
+   (Update2: After enabling X, they don't.)
+
+-- other-frame should cycle through the frames on the `current'
+   terminal only.
+
+   (Done, by trivially modifiying next_frame and prev_frame.)
+
+-- Support different terminal sizes.
+
+   (Done, no problem.)
+
+-- Make sure terminal resizes are handled gracefully.  (Could be
+   problematic.)
+
+   (Done.  We don't get automatic SIGWINCH for additional ttys,
+   though.)
+
+-- Extend emacsclient to automatically open a new tty when it connects
+   to Emacs.
+
+   (Done.  It's an ugly hack, needs more work.)
+
+-- Redisplay must refresh the topmost frame on *all* terminals, not
+   just the initial terminal.
+
+   (Done, but introduced an ugly redisplay problems.  Ugh.)
+
+-- Fix redisplay problems.
+
+   (Done; it turned out that the entire Wcm structure must be moved
+   inside tty_output.  Why didn't I catch this earlier?)
+
+-- Provide a way for emacsclient to tell Emacs that the tty has been
+   resized.
+
+   (Done, simply forward the SIGWINCH signal.)
+
+-- Each keypress should automatically select the frame corresponding
+   to the terminal that it was coming from.  This means that Emacs
+   must know from which terminal the last keyboard event came from.
+
+   (Done, it was quite simple, the input event system already
+   supported multiple frames.)
+
+-- Fix SIGIO issue with secondary terminals.
+
+   (Done, emacsclient signals Emacs after writing to the proxy pseudo
+   terminal.  Note that this means that multi-tty does not work with
+   raw ttys!)
+
+   (Update: This is bullshit.  There is a read_input_waiting function,
+   extend that somehow.)
+
+   (Update of update: The first update was not right either, extending
+   read_input_waiting was not necessary.  Secondary ttys do seem to
+   send signals on input.)
+
+   (Update^3: Not any more.)
+
+-- Make make-terminal-frame look up the `tty' and `tty-type' frame
+   parameters from the currently selected terminal before the global
+   default.
+
+   (Done.)
+
+-- Put all cached terminal escape sequences into struct tty_output.
+   Currently, they are still stored in global variables, so we don't
+   really support multiple terminal types.
+
+   (Done.  It was not fun.)
+
+-- Implement sane error handling after initialization.  (Currently
+   emacs exits if you specify a bad terminal type.)  The helpful error
+   messages must still be provided when Emacs starts.
+
+   (Done.)
+
+-- Implement terminal deletion, i.e., deleting local frames, closing
+   the tty device and restoring its previous state without exiting
+   Emacs.
+
+   (Done, but at the moment only called when an error happens during
+   initialization.  There is a memory corruption error around this
+   somewhere.)  (Update: now it is fully enabled.)
+
+-- Implement automatic deletion of terminals when the last frame on
+   that terminal is closed.
+
+   (Done.)
+
+-- Restore tty screen after closing the terminal.
+
+   (Done, we do the same as Emacs 21.2 for all terminals.)
+
+-- 'TERM=dumb src/emacs' does not restore the terminal state.
+
+   (Done.)
+
+-- C-g should work on secondary terminals.
+
+   (Done, but the binding is not configurable.)
+
+-- Deal with SIGHUP in Emacs and in emacsclient.  (After this, the
+   server-frames may be removed from server.el.)
+
+   (Done, nothing to do.  It seems that Emacs does not receive SIGHUP
+   from secondary ttys, which is actually a good thing.)  (Update: I
+   think it would be a bad idea to remove server-frames.)
+
+-- Change emacsclient/server.el to support the -t argument better,
+   i.e. automatically close the socket when the frame is closed.
+
+   (Seems to be working OK.)
+
+-- Fix mysterious memory corruption error with tty deletion.  To
+   trigger it, try the following shell command:
+
+       while true; do TERM=no-such-terminal-definition emacsclient -h; done
+
+   Emacs usually dumps core after a few dozen iterations.  (The bug
+   seems to be related to the xfreeing or bzeroing of
+   tty_output.Wcm.  Maybe there are outside references to struct Wcm?
+   Why were these vars collected into a struct before multi-tty
+   support?)
+
+   (Done.  Whew.  It turned out that the problem had nothing to do
+   with hypothetical external references to Wcm, or any other
+   tty_output component; it was simply that delete_tty closed the
+   filehandles of secondary ttys twice, resulting in fclose doubly
+   freeing memory.  Utterly trivial matter.  I love the C's memory
+   management, it puts hair on your chest.)
+
+-- Support raw secondary terminals.  (Note that SIGIO works only on
+   the controlling terminal.) Hint: extend read_input_waiting for
+   multiple ttys and hopefully this will be fixed.
+
+   (Done, it seems to have been working already for some time.  It
+   seems F_SETOWN does work, after all.  Not sure what made it fail
+   earlier, but it seems to be fixed (there were several changes
+   around request_sigio, maybe one of them did it).
+   read_input_waiting is only used in sys_select, don't change
+   it.)  (Update: After adding X support, it's broken again.)
+   (Update^2: No it isn't.) :-)
+
+-- Find out why does Emacs abort when it wants to close its
+   controlling tty.  Hint: chan_process[] array.  Hey, maybe
+   noninterrupt-IO would work, too?  Update: no, there is no process
+   for stdin/out.
+
+   (Done.  Added add/delete_keyboard_wait_descriptor to
+   term_init/delete_tty.  The hint was right, in a way.)
+
+-- Issue with SIGIO: it needs to be disabled during redisplay.  See if
+   fcntl kernel behaviour could be emulated by emacsclient.
+
+   (Done.  Simply disabled the SIGIO emulation hack in emacsclient.)
+   (Update: it was added back.)  (Update^2: and removed again.)
+
+-- server.el: There are issues with saving files in buffers of closed
+   clients.  Try editing a file with emacsclient -f, and (without
+   saving it) do a delete-frame.  The frame is closed without
+   question, and a surprising confirmation prompt appears in another
+   frame.
+
+   (Done.  delete-frame now asks for confirmation if it still has
+   pending buffers, and modified buffers don't seem to be deleted.)
+
+-- emacsclient.el, server.el: Handle eval or file open errors when
+   doing -t.
+
+   (Done.)
+
+-- Make parts of struct tty_output accessible from Lisp.  The device
+   name and the type is sufficient.
+
+   (Done, see frame-tty-name and frame-tty-type.)
+
+-- Export delete_tty to the Lisp environment, for emacsclient.
+
+   (Done, see delete-tty.)
+
+-- Get rid of the accessor macros in termchar.h, or define macros for
+   all members.
+
+   (Done.)
+
+-- Move device-specific parameters (like costs) commonly used by
+   device backends to a common, device-dependent structure.
+
+   (Done.  See struct display_method in termhooks.h.)
+
+-- Fix X support.
+
+   (Done.  Well, it seems to be working.)
+
+-- Allow simultaneous X and tty frames.  (Handling input could be
+   tricky.  Or maybe not.)
+
+   (Done.  Allowed, that is.  It is currently extremely unstable, to
+   the point of being unusable.  The rif variable causes constant
+   core dumps.  Handling input is indeed tricky.)
+
+-- Rewrite multi-tty input in terms of MULTI_KBOARD.
+
+   (Done.  In fact, there was no need to rewrite anything, I just
+   added a kboard member to tty_display_info, and initialized the
+   frame's kboard from there.)
+
+-- Fix rif issue with X-tty combo sessions.  IMHO the best thing to do
+   is to get rid of that global variable (and use the value value in
+   display_method, which is guaranteed to be correct).
+
+   (Done, did exactly that.  Core dumps during combo sessions became
+   much rarer.  In fact, I have not yet met a single one.)
+
+-- Add multi-tty support to talk.el.
+
+   (Done.)
+
+-- Clean up the source of emacsclient.  It is a mess.
+
+   (Done, eliminated stupid proxy-pty kludge.)
+
+-- Fix faces on tty frames during X-tty combo sessions.  There is an
+   init_frame_faces call in init_sys_modes, see if there is a problem
+   with it.
+
+   (Done, there was a stupid mistake in
+   Ftty_supports_face_attributes_p. Colors are broken, though.)
+
+-- C-x 5 2, C-x 5 o, C-x 5 0 on an emacsclient frame unexpectedly
+   exits emacsclient.  This is a result of trying to be clever with
+   delete-frame-functions.
+
+   (Fixed, added delete-tty-after-functions, and changed server.el to
+   use it.)
+
+-- Something with (maybe) multi-keyboard support broke function keys
+   and arrows on ttys during X+tty combo sessions.  Debug this.
+
+   (I can't reproduce it, maybe the terminal type was wrong.)
+
+-- Fix input from raw ttys (again).
+
+   (Now it seems to work all right.)
+
+-- During an X-tty combo session, a (message "Hello") from a tty frame
+   goes to the X frame.  Fix this.
+
+   (Done.  There was a safeguard against writing to the initial
+   terminal frame during bootstrap which prevented echo_area_display
+   from working correctly on a tty frame during a combo session.)
+
+-- If there are no frames on its controlling terminal, Emacs should
+   exit if the user presses C-c there.
+
+   (Done, as far as possible.  See the SIGTERM comment in
+   interrupt_signal on why this seems to be impossible to solve this
+   in general.)
+
+-- During an X session, Emacs seems to read from stdin.  Also, Emacs
+   fails to start without a controlling tty.
+
+   (Fixed by replacing the troublesome termcap display with a dummy
+   bootstrap display during bootstrap.
+
+-- Do tty output through struct display, like graphical display
+   backends.
+
+   (Done.)
+
+-- Define an output_initial value for output_method for the initial
+   frame that is dumped with Emacs.  Checking for this frame (e.g. in
+   cmd_error_internal) is ugly.
+
+   (Done, breaking interactive temacs.)
+
+-- The command `emacsclient -t -e '(delete-frame)'' fails to exit.
+
+   (Fixed.)
+
+-- frame-creation-function should always create a frame that is on the
+   same display as the selected frame.  Maybe frame-creation-function
+   should simply be removed and make-frame changed to do the right
+   thing.
+
+   (Done, with a nice hack.  frame-creation-function is now frame-local.)
+
+-- Fix C-g on raw ttys.
+
+   (Done.  I disabled the interrupt/quit keys on all secondary
+   terminals, so Emacs sees C-g as normal input.  This looks like an
+   overkill, because emacsclient has extra code to pass SIGINT to
+   Emacs, so C-g should remain the interrupt/quit key on emacsclient
+   frames.  See the next entry why implementing this distinction would
+   be a bad idea.)
+
+-- Make sure C-g goes to the right frame with ttys.  This is hard, as
+   SIGINT doesn't have a tty parameter. :-(
+
+   (Done, the previous change fixes this as a pleasant side effect.)
+
+-- I have seen a case when Emacs with multiple ttys fell into a loop
+   eating 100% of CPU time.  Strace showed this loop:
+
+       getpid()                                = 30284
+       kill(30284, SIGIO)                      = 0
+       --- SIGIO (I/O possible) @ 0 (0) ---
+       ioctl(6, FIONREAD, [0])                 = -1 EIO (Input/output error)
+       ioctl(5, FIONREAD, [0])                 = -1 EIO (Input/output error)
+       ioctl(0, FIONREAD, [0])                 = 0
+       sigreturn()                             = ? (mask now [])
+       gettimeofday({1072842297, 747760}, NULL) = 0
+       gettimeofday({1072842297, 747806}, NULL) = 0
+       select(9, [0 3 5 6], NULL, NULL, {0, 0}) = 2 (in [5 6], left {0, 0})
+       select(9, [0 3 5 6], NULL, NULL, {0, 0}) = 2 (in [5 6], left {0, 0})
+       gettimeofday({1072842297, 748245}, NULL) = 0
+
+   I have seen something similar with a single X frame, but have not
+   been able to reproduce it for debugging.
+
+   Update: This may have been caused by checking for nread != 0
+   instead of nread > 0 after calling read_socket_hook in
+   read_avail_input.
+
+   (Fixed.  This was caused by unconditionally including stdin in
+   input_wait_mask in init_process.  The select call in
+   wait_reading_process_input always returned immediately, indicating
+   that there is pending input from stdin, which nobody read.
+
+   Note that the above strace output seems to be an unrelated but
+   similar bug.  I think that is now fixed.)
+
+-- Exiting Emacs while there are emacsclient frames doesn't restore the
+   ttys to their default states.
+
+   (This seems to be fixed by some previous change.)
+
+-- Allow opening an X session after -nw.
+
+   (Done.)
+
+-- Fix color handling during tty+X combo sessions.  (It seems that tty
+   sessions automatically convert the face colors to terminal colors
+   when the face is loaded.  This conversion must happen instead on
+   the fly in write_glyphs, which might be problematic, as color
+   approximation is currently done in lisp (term/tty-colors.el).)
+   (Update: hm, colors seem to work fine if I start emacs with -nw and
+   then create an X frame.  Maybe it's just a small buglet somewhere.)
+
+   (Seems to be fixed.  The problem was in startup.el, it did not
+   initialize tty colors when the initial window system was
+   graphical.)
+
+-- emacs -nw --eval '(y-or-n-p "Foobar")' segfaults.  (Reported by
+   Romain Francoise)
+
+   (Fixed, there was a keyboard initialization problem.)
+
+-- Fix interactive use of temacs.  There are face-related SEGVs, most
+   likely because of changes in realize_default_face, realize_face.
+
+   (Fixed.)
+
+-- Don't exit Emacs when the last X connection fails during a
+   multi-display session.
+
+   (Fixed.)
+
+-- Dan Nicolaescu noticed that starting emacsclient on the same
+   terminal device that is the controlling tty of the Emacs process
+   gives unexpected results.
+
+   (Fixed.)
+
+-- Istvan Marko reported that Emacs hang on ttys if it was started
+   from a shell script.
+
+   (Fixed.  There was a bug in the multi-tty version of
+   narrow_foreground_group.  tcsetpgrp blocks if it is called from a
+   process that is not in the same process group as the tty.)
+
+-- emacsclient -t from an Emacs term buffer does not work, complains
+   about face problems.  This can even lock up Emacs (if the recursive
+   frame sets single_kboard).  Update: the face problems are caused by
+   bugs in term.el, not in multi-tty.  The lockup is caused by
+   single_kboard mode, and is not easily resolvable.  The best thing to
+   do is to simply refuse to create a tty frame of type `eterm'.
+
+   (Fixed, changed emacsclient to check for TERM=eterm.  The face
+   complaints seem to be caused by bugs in term.el; they are not
+   related to multi-tty.)
+
+-- Find out the best way to support suspending Emacs with multiple
+   ttys.  My guess: disable it on the controlling tty, but from other
+   ttys pass it on to emacsclient somehow.  (It is (I hope) trivial to
+   extend emacsclient to handle suspend/resume.  A `kill -STOP' almost
+   works right now.)
+
+   (Done.  I needed to play with signal handling and the server
+   protocol a bit to make emacsclient behave as a normal UNIX program
+   wrt foreground/background process groups.)
+
+-- There is a flicker during the startup of `emacs -nw'; it's as if
+   the terminal is initialized, reset and then initialialized again.
+   Debug this.  (Hint: narrow_foreground_group is called twice during
+   startup.)
+
+   (This is gone.)
+
+-- Robert Chassell has found serious copy-paste bugs with the
+   multi-tty branch.  There seem to be redisplay bugs while copying
+   from X to a terminal frame.  Copying accented characters do not
+   work for me.
+
+   (Patch-124 should fix this, by changing the interprogram-*-function
+   variables to be frame-local, as suggested by Mark Plaksin
+   (thanks!).  I think that the redisplay bugs are in fact not bugs,
+   but delays caused by single_kboard --> perhaps MULTI_KBOARD should
+   be removed.)
+
+-- frame-creation-function was removed, which might be a bad idea.
+   Think up a compatible solution.
+
+   (It was an internal interface that may be changed when necessary.)
+
+-- Change Lisp code not to (getenv "TERM"); use the `tty-type' frame
+   parameter or the frame-tty-type function instead.  (M-x tags-search
+   "TERM" helps with this.)  Update: Actually, all getenv invocations
+   should be checked for multi-tty compatibility, and an interface
+   must be implemented to get the remote client's environment.
+
+   (Done.  Only getenv calls in lisp/term/*.el were changed; other
+   calls should be mostly left as they are.)
+
+-- Add an elaborate mechanism for display-local variables.  (There are
+   already a few of these; search for `terminal-local' in the Elisp
+   manual.)
+
+   (Not needed.  Display-local variables could be emulated by
+   frame-local variables.)
+
+-- Emacs assumes that all terminal frames have the same locale
+   settings as Emacs itself.  This may lead to bogus results in a
+   multi-locale setup. (E.g., while logging in from a remote client
+   with a different locale.)
+   (Update after new bugreport by Friedrich Delgado Friedrichs: 
+   (at least) the structs terminal_coding and keyboard_coding in
+   coding.c must be moved to struct display, and the Lisp interface
+   [set-]keyboard-coding-system must be adapted for the change.)
+
+   (Fixed.  Emacs now uses the locale settings as seen by the
+   emacsclient process for server tty frames.)
+   (Update: Not really; Vlocale_coding_system is still global.)
+
+-- Make `struct display' accessible to Lisp programs.  Accessor functions:
+
+       (displayp OBJECT):  Returns t if OBJECT is a display.
+               => Implemented as display-live-p.
+
+       (display-list):  Returns list of currently active displays.
+               => Implemented.
+
+       (selected-display):  Returns the display object of the selected frame.
+               => Not strictly necessary, but implemented anyway.
+
+       (frame-display FRAME):  Returns the display object of FRAME.
+               => Implemented.
+
+       (display-frames DISPLAY):  Returns a list of frames on DISPLAY.
+               => Already implemented, see frames-on-display-list.
+
+       (display-type DISPLAY):  Returns the type of DISPLAY, as a
+               symbol.  (See `framep'.)
+               => Implemented as display-live-p.
+
+       (display-device DISPLAY): Returns the name of the device that
+               DISPLAY uses, as a string.  (E.g: "/dev/pts/16", or
+               ":0.0")
+               => Implemented as display-name.
+
+       etc.
+
+   See next issue why this is necessary.
+
+   (Update: The consensus on emacs-devel seems to be to do this via
+   integer identifiers.  That's fine by me.)
+
+   (Done.)
+
+-- The following needs to be supported:
+
+       $ emacsclient -t
+               C-z
+       $ emacsclient -t
+               (This fails now.)
+
+   The cleanest way to solve this is to allow multiple displays on the
+   same terminal device; each new emacsclient process should create
+   its own display.  As displays are currently identified by their
+   device names, this is not possible until struct display becomes
+   accessible as a Lisp-level object.
+
+   (Done.)
+
+-- Miles Bader suggests that C-x C-c on an emacsclient frame should
+   only close the frame, not exit the entire Emacs session.  Update:
+   see above for a function that does this.  Maybe this should be the
+   new default?  
+
+   (Done.  This is the new default.  No complaints so far.)
+
+-- Clean up the frame-local variable system.  I think it's ugly and
+   error-prone.  But maybe I just haven't yet fully understood it.
+
+   (Nothing to do.  It doesn't seem ugly any more.  It's rather clever.)
+
+-- Support multiple character locales.  A version of
+   `set-locale-environment' needs to be written for setting up
+   display-local settings on ttys.  I think calling
+   set-display-table-and-terminal-coding-system and
+   set-keyboard-coding-system would be enough.  The language
+   environment itself should remain a global setting.
+
+   (Done, by an ugly hack.)
+
+-- The terminal customization files in term/*.el tend to change global
+   parameters, which may confuse Emacs with multiple displays.  Change
+   them to tweak only frame-local settings, if possible.  (They tend
+   to call define-key to set function key sequences a lot.)
+
+   (Done, by making `function-key-map' terminal-local (i.e., part of
+   struct kboard).  This has probably covered all the remaining problems.)
+
+-- Make `function-key-map' and `key-translation-map' terminal-local.
+
+   (Done.)
+
+-- Implement `terminal-local-value' and `set-terminal-local-value' to
+   allow deterministic access to terminal local bindings.  The
+   encode-kb package can not set up `key-translation-map' without
+   these.  The terminal-local bindings seem to be independent of what
+   frame is selected.
+
+   (Done.)
+
+-- xt-mouse.el needs to be adapted for multi-tty.  It currently
+   signals an error on kill-emacs under X, which prevents the user
+   from exiting Emacs. (Reported by Mnemonikk on freenode.)
+
+   (Done, I hope.)
+   
+
+-- Having {reset,init}_all_sys_modes in set-input-mode breaks arrow
+   keys on non-selected terminals under screen, and sometimes on other
+   terminal types as well.  The other function keys continue to work
+   fine.  Sometimes faces on these screens become garbled.
+
+   This only seems to affect displays that are of the same terminfo
+   type as the selected one. Interestingly, in screen Emacs normally
+   reports the up arrow key as `M-o A', but after the above SNAFU, it
+   complains about `M-[ a'.  UNIX ttys are a complete mystery to me,
+   but it seems the reset-reinitialize cycle somehow leaves the
+   non-selected terminals in a different state than usual.  I have no
+   idea how this could happen.
+
+   Currently set-input-mode resets only the currently selected
+   terminal, which seems to somehow work around the problem.
+
+   Update:
+
+       Dan Nicolaescu <dann@ics.uci.edu> writes:
+       > Some terminals have 2 modes for cursor keys: Application Mode where
+       > the cursor keys transmit the codes defined in the terminfo entry, and
+       > Cursor mode. Applications have to send the smkx and rmkx terminfo
+       > strings to switch between the 2 modes. So Emacs (and emacsclient) have
+       > to send smkx when initializing and rmkx when quitting (or on
+       > suspend). 
+
+   (I think patch-370 fixed this.)
+
+-- This long-standing bug (first reported by Han Boetes) seems to come
+   and go all the time.  It is time to track it down and fix it.
+
+       emacs
+               M-x server-start
+       
+       # From another xterm:
+       emacsclient -e '(y-or-n-p "Do you want me to crash? ")'
+               # Notice how the answer ends up in the *scratch* buffer
+               M-x garbage-collect
+               SIGSEGV
+
+   (Fixed in patch-414 after detailed analysis by Kalle Olavi Niemitalo.)
+
+-- normal-erase-is-backspace-mode in simple.el needs to be updated for
+   multi-tty (rep. by Dan Waber).  (The Delete key is broken on X
+   because of this.)
+
+   (Fixed in patch-427.)
+
+-- I think keyboard-translate-table should be made terminal-local.
+
+   (Done in patch-431.)
+
+-- The semantics of terminal-local variables are confusing; it is not
+   clear what binding is in effect in any given time.  See if
+   current_kboard (or at least the terminal-local bindings exported to
+   Lisp) might be changed to be tied to the selected frame instead.
+   Currently, `function-key-map' and `key-translation-map' may be
+   accessed reliably only using the hackish
+   `(set-)terminal-local-value' functions.
+
+   Perhaps there should be a difference between `last-command' &co.
+   and these more conventional configuration variables.
+   (E.g. `symbol-value' would use current_kboard to access
+   `last-command', but SELECTED_FRAME()->display->kboard to get the
+   value of `function-key-map'.
+
+   (Fixed in patch-434.)
+
+-- If the first key pressed on a new tty terminal is a function key,
+   it is not recognized correctly.  May be related to the bug below.
+
+   (Seems to have been fixed as a side effect of patch-434.  "The bug
+   below" was the set-input-mode madness.)  
+
+   (Update: this bug was fixed for good in patch-449.  It was tracked
+   down to a bug in `read_key_sequence': it failed to reinitialize its
+   local function-key-map/key-translation-map references when it
+   switched keyboards.  I don't understand why did this bug only
+   appear on brand new frames, though!)
+
+-- Disable connecting to a new X display when we use the GTK toolkit.
+
+   (Disabled in patch-450.)
+
+-- Implement automatic forwarding of client environment variables to
+   forked processes, as discussed on the multi-tty list.  Terminal
+   parameters are now accessible in C code, so the biggest obstacle is
+   gone.  The `getenv_internal' and `child_setup' functions in
+   callproc.c must be changed to support the following variable:
+
+       terminal-local-environment-variables is a variable defined in ...
+
+       Enable or disable terminal-local environment variables.
+
+       If set to t, `getenv', `setenv' and subprocess creation
+       functions use the environment variables of the emacsclient
+       process that created the selected frame, ignoring
+       `process-environment'.
+
+       If set to nil, Emacs uses `process-environment' and ignores
+       the client environment.
+
+       Otherwise, `terminal-local-environment-variables' should be a
+       list of variable names (represented by Lisp strings) to look
+       up in the client environment.  The rest will come from
+       `process-environment'.
+
+   (Implemented in patch-461; `terminal-getenv', `terminal-setenv' and
+   `with-terminal-environment' are now replaced by extensions to
+   `getenv' and `setenv', and the new `local-environment-variables'
+   facility.  Yay!)
+
+   (Updated in patch-465 to fix the semantics of let-binding
+   `process-environment'.  `process-environment' was changed to
+   override all local/global environment variables, and a new variable
+   `global-environment' was introduced to have `process-environment's
+   old meaning.)
+
+   (Updated in patch-466 to fix the case when two emacsclient sessions
+   share the same terminal, but have different environment.  The local
+   environment lists are now stored as frame parameters, so the
+   C-level terminal parameters are not strictly necessary any more.)
+
+-- `Fdelete_frame' is called from various critical places where it is
+   not acceptable for the frame deletion to fail, e.g. from
+   x_connection_closed after an X error.  `Fdelete_frame' now protects
+   against `delete-frame-functions' throwing an error and preventing a
+   frame delete. (patch-475)
+
+-- Fix set-input-mode for multi-tty.  It's a truly horrible interface;
+   what if we'd blow it up into several separate functions (with a
+   compatibility definition)?
+
+   (Done.  See `set-input-interrupt-mode', `set-output-flow-control',
+   `set-input-meta-mode' and `set-quit-char'.) (patch-457)
+
+-- Let-binding `overriding-terminal-local-map' on a brand new frame
+   does not seem to work correctly.  (See `fancy-splash-screens'.)
+   The keymap seems to be set up right, but events go to another
+   terminal.  Or is it `unread-command-events' that gets Emacs
+   confused?  Investigate.
+
+   (Emacs was confused because a process filter entered
+   `recursive-edit' while Emacs was reading input.  I added support
+   for this in the input system.) (patch-489)
+
+-- I smell something funny around pop_kboard's "deleted kboard" case.
+   Determine what are the circumstances of this case, and fix any
+   bug that comes to light.
+
+   (It happens simply because single_kboard's terminal is sometimes
+   deleted while executing a command on it, for example the one that
+   kills the terminal.  There was no bug here, but I rewrote the whole
+   single_kboard mess anyway.) (patch-489)
+
+-- Understand Emacs's low-level input system (it's black magic) :-)
+   What exactly does interrupt_input do?  I tried to disable it for
+   raw secondary tty support, but it does not seem to do anything
+   useful.  (Update: Look again. X unconditionally enables this, maybe
+   that's why raw terminal support is broken again.  I really do need
+   to understand input.)
+   (Update: I am starting to understand the read_key_sequence->read-char
+   ->kbd_buffer_get_event->read_avail_input->read_socket_hook path.  Yay!)
+
+   (Update: OK, it all seems so easy now (NOT).  Input could be done
+   synchronously (with wait_reading_process_input), or asynchronously
+   by SIGIO or polling (SIGALRM).  C-g either sets the Vquit_flag,
+   signals a 'quit condition (when immediate_quit), or throws to
+   `getcjmp' when Emacs was waiting for input when the C-g event
+   arrived.)
+
+-- Replace wrong_kboard_jmpbuf with a special return value of
+   read_char.  It is absurd that we use setjmp/longjmp just to return
+   to the immediate caller.
+
+   (Done in patch-500.)
+
+-- `tool-bar-mode', `scroll-bar-mode', `menu-bar-mode' and
+   'fringe-mode' are modes global to the entire Emacs session, not
+   just a single frame or a single terminal.  This means that their
+   status sometimes differs from what's actually displayed on the
+   screen.  As a consequence, the Options | Show/Hide menu sometimes
+   shows incorrect status, and you have to select an option twice for
+   it to have any visible effect on the current frame.
+
+   Change Emacs so that the status of the items in the Options |
+   Show/Hide menu correspond to the current frame.
+
+   (Done in patch-537.)
+
+-- The `default-directory' variable should somehow be set to the
+   cwd of the emacsclient process when the user runs emacsclient
+   without file arguments.  Perhaps it is OK to just override the
+   directory of the *scratch* buffer.
+
+   (Done in patch-539.)
+
+-- The borders on tooltip frames on X are messed up.  More
+   specifically, the frame's internal border (internal-border-width
+   frame parameter) is not filled with the correct background color.
+
+   It seems the border contents are drawn onto by the
+   update_single_window call in `x-show-tip'.  After some debugging, I
+   think the window's background color is not set up
+   correctly---calling `x_clear_area' fills the specified area with
+   black, not light yellow.
+
+   (Done in patch-544.  A background_pixel field was defined both in
+   struct frame and struct x_output, and Emacs got confused between
+   them.)
+
+;;; arch-tag: 8da1619e-2e79-41a8-9ac9-a0485daad17d
+
dissimilarity index 86%
index 2c343e5..20d29f8 100644 (file)
@@ -1,18 +1,27 @@
-This file describes the CVS branch in which it is maintained.
-Everything below the line is branch-specific.
-________________________________________________________________________
-
-This is the "HEAD" branch, otherwise known as the "trunk".  Its primary
-purpose is to accumulate changes that are not yet partitioned into a
-specific (versioned) release.  When people say "use CVS emacs", this is
-the branch they are talking about.  Likewise, a "cvs checkout" without
-the "-r" option results in this branch.
-
-The plans for this branch are not specified; Emacs hackers add to it
-relatively free of constraint (aside from proper legal / accounting
-practices), although sometimes there is related discussion on the
-emacs-devel mailing list.
-
-The closure process for this branch is undocumented; concepts such as
-"freeze", "release", or "integration with the trunk" are not applicable
-to this branch.
+This file describes the Arch branch in which it is maintained.
+Everything below the line is branch-specific.
+________________________________________________________________________
+
+This is the "multi-tty" branch.  It contains a version of Emacs that
+is able to create frames on multiple display devices and display
+types, including multiple tty devices and tty+X combined sessions.
+The branch has an enhanced version of emacsclient that is capable of
+opening a new Emacs frame on the terminal it runs on.
+
+Commit access to the multi-tty branch is only available to its
+maintainer, Károly LÃ…\91rentey (lorentey@elte.hu).  The best way to
+contribute to the project is to create your own public Arch branch,
+and publish your changes there.  (I will then be able to easily "pull"
+your changes into the multi-tty branch.)
+
+The branch is scheduled for inclusion in the next major release of
+Emacs, version 22.
+
+Please read the file README.multi-tty in the base directory for
+details.
+
+
+
+Local Variables:
+coding: utf-8
+End:
index d0c58bf..e746090 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,25 +1,54 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59.
+# Generated by GNU Autoconf 2.61.
 #
-# Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
 ## --------------------- ##
 ## M4sh Initialization.  ##
 ## --------------------- ##
 
-# Be Bourne compatible
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   emulate sh
   NULLCMD=:
   # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
-  set -o posix
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
 fi
-DUALCASE=1; export DUALCASE # for MKS sh
 
 # Support unset when possible.
 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
@@ -29,8 +58,43 @@ else
 fi
 
 
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
 # Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
 PS1='$ '
 PS2='> '
 PS4='+ '
@@ -44,18 +108,19 @@ do
   if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
     eval $as_var=C; export $as_var
   else
-    $as_unset $as_var
+    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
   fi
 done
 
 # Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
 else
   as_expr=false
 fi
 
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
   as_basename=basename
 else
   as_basename=false
@@ -63,157 +128,388 @@ fi
 
 
 # Name of the executable.
-as_me=`$as_basename "$0" ||
+as_me=`$as_basename -- "$0" ||
 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
         X"$0" : 'X\(//\)$' \| \
-        X"$0" : 'X\(/\)$' \| \
-        .     : '\(.\)' 2>/dev/null ||
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
 echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
-         /^X\/\(\/\/\)$/{ s//\1/; q; }
-         /^X\/\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
 
+# CDPATH.
+$as_unset CDPATH
 
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
 
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
+if test "x$CONFIG_SHELL" = x; then
+  if (eval ":") 2>/dev/null; then
+  as_have_required=yes
+else
+  as_have_required=no
 fi
 
+  if test $as_have_required = yes &&    (eval ":
+(as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
 
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
-  # Find who we are.  Look in the path if we contain no path at all
-  # relative or not.
-  case $0 in
-    *[\\/]* ) as_myself=$0 ;;
-    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
 
-       ;;
-  esac
-  # We did not find ourselves, most probably we were run as `sh COMMAND'
-  # in which case we are not to be found in the path.
-  if test "x$as_myself" = x; then
-    as_myself=$0
-  fi
-  if test ! -f "$as_myself"; then
-    { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
-   { (exit 1); exit 1; }; }
-  fi
-  case $CONFIG_SHELL in
-  '')
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=\$LINENO
+  as_lineno_2=\$LINENO
+  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+  :
+else
+  as_candidate_shells=
     as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-  for as_base in sh bash ksh sh5; do
-        case $as_dir in
+  case $as_dir in
         /*)
-          if ("$as_dir/$as_base" -c '
+          for as_base in sh bash ksh sh5; do
+            as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+          done;;
+       esac
+done
+IFS=$as_save_IFS
+
+
+      for as_shell in $as_candidate_shells $SHELL; do
+        # Try only shells that exist, to save several forks.
+        if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+               { ("$as_shell") 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+_ASEOF
+}; then
+  CONFIG_SHELL=$as_shell
+              as_have_required=yes
+              if { "$as_shell" 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+(as_func_return () {
+  (exit $1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
   as_lineno_1=$LINENO
   as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
   test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
-            $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
-            $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
-            CONFIG_SHELL=$as_dir/$as_base
-            export CONFIG_SHELL
-            exec "$CONFIG_SHELL" "$0" ${1+"$@"}
-          fi;;
-        esac
-       done
-done
-;;
-  esac
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+  break
+fi
+
+fi
+
+      done
+
+      if test "x$CONFIG_SHELL" != x; then
+  for as_var in BASH_ENV ENV
+        do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+        done
+        export CONFIG_SHELL
+        exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+    if test $as_have_required = no; then
+  echo This script requires a shell more modern than all the
+      echo shells that I found on your system.  Please install a
+      echo modern shell, or manually run the script under such a
+      echo shell if you do have one.
+      { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+  echo No shell found that supports shell functions.
+  echo Please tell autoconf@gnu.org about your system,
+  echo including any error possibly output before this
+  echo message
+}
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
 
   # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
   # uniformly replaced by the line number.  The first 'sed' inserts a
-  # line-number line before each line; the second 'sed' does the real
-  # work.  The second script uses 'N' to pair each line-number line
-  # with the numbered line, and appends trailing '-' during
-  # substitution so that $LINENO is not a special case at line end.
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
   # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
-  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
-  sed '=' <$as_myself |
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
     sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
       N
-      s,$,-,
-      : loop
-      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
       t loop
-      s,-$,,
-      s,^['$as_cr_digits']*\n,,
+      s/-\n.*//
     ' >$as_me.lineno &&
-  chmod +x $as_me.lineno ||
+  chmod +x "$as_me.lineno" ||
     { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
    { (exit 1); exit 1; }; }
 
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
-  # original and so on.  Autoconf is especially sensible to this).
-  . ./$as_me.lineno
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
   # Exit status is that of the last command.
   exit
 }
 
 
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
-  *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T='     ' ;;
-  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
-  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
 esac
 
-if expr a : '\(a\)' >/dev/null 2>&1; then
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
 else
   as_expr=false
 fi
 
 rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir
+fi
 echo >conf$$.file
 if ln -s conf$$.file conf$$ 2>/dev/null; then
-  # We could just check for DJGPP; but this test a) works b) is more generic
-  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
-  if test -f conf$$.exe; then
-    # Don't use ln at all; we don't have any links
+  as_ln_s='ln -s'
+  # ... but there are two gotchas:
+  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+  # In both cases, we have to default to `cp -p'.
+  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
     as_ln_s='cp -p'
-  else
-    as_ln_s='ln -s'
-  fi
 elif ln conf$$.file conf$$ 2>/dev/null; then
   as_ln_s=ln
 else
   as_ln_s='cp -p'
 fi
-rm -f conf$$ conf$$.exe conf$$.file
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
 
 if mkdir -p . 2>/dev/null; then
   as_mkdir_p=:
@@ -222,7 +518,28 @@ else
   as_mkdir_p=false
 fi
 
-as_executable_p="test -f"
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+        test -d "$1/.";
+      else
+       case $1 in
+        -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -231,39 +548,27 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
 
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS="  $as_nl"
-
-# CDPATH.
-$as_unset CDPATH
 
+exec 7<&0 </dev/null 6>&1
 
 # Name of the host.
 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
 # so uname gets run too.
 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
 
-exec 6>&1
-
 #
 # Initializations.
 #
 ac_default_prefix=/usr/local
+ac_clean_files=
 ac_config_libobj_dir=.
+LIBOBJS=
 cross_compiling=no
 subdirs=
 MFLAGS=
 MAKEFLAGS=
 SHELL=${CONFIG_SHELL-/bin/sh}
 
-# Maximum number of lines to put in a shell here document.
-# This variable seems obsolete.  It should probably be removed, and
-# only ac_max_sed_lines should be used.
-: ${ac_max_here_lines=38}
-
 # Identity of this package.
 PACKAGE_NAME=
 PACKAGE_TARNAME=
@@ -276,42 +581,156 @@ ac_config_libobj_dir=src
 # Factoring default headers for most tests.
 ac_includes_default="\
 #include <stdio.h>
-#if HAVE_SYS_TYPES_H
+#ifdef HAVE_SYS_TYPES_H
 # include <sys/types.h>
 #endif
-#if HAVE_SYS_STAT_H
+#ifdef HAVE_SYS_STAT_H
 # include <sys/stat.h>
 #endif
-#if STDC_HEADERS
+#ifdef STDC_HEADERS
 # include <stdlib.h>
 # include <stddef.h>
 #else
-# if HAVE_STDLIB_H
+# ifdef HAVE_STDLIB_H
 #  include <stdlib.h>
 # endif
 #endif
-#if HAVE_STRING_H
-# if !STDC_HEADERS && HAVE_MEMORY_H
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
 #  include <memory.h>
 # endif
 # include <string.h>
 #endif
-#if HAVE_STRINGS_H
+#ifdef HAVE_STRINGS_H
 # include <strings.h>
 #endif
-#if HAVE_INTTYPES_H
+#ifdef HAVE_INTTYPES_H
 # include <inttypes.h>
-#else
-# if HAVE_STDINT_H
-#  include <stdint.h>
-# endif
 #endif
-#if HAVE_UNISTD_H
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAINT build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP LN_S INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA RANLIB ac_ct_RANLIB INSTALL_INFO GZIP_PROG LIBSOUND PKG_CONFIG ALSA_CFLAGS ALSA_LIBS CFLAGS_SOUND SET_MAKE GTK_CFLAGS GTK_LIBS ALLOCA liblockfile LIBOBJS NEED_SETGID KMEM_GROUP GETLOADAVG_LIBS GETOPT_H GETOPTOBJS version configuration canonical srcdir lispdir locallisppath lisppath x_default_search_path etcdir archlibdir docdir bitmapdir gamedir gameuser c_switch_system c_switch_machine LD_SWITCH_X_SITE LD_SWITCH_X_SITE_AUX C_SWITCH_X_SITE X_TOOLKIT_TYPE machfile opsysfile carbon_appdir LTLIBOBJS'
+ac_header_list=
+ac_func_list=
+ac_subst_vars='SHELL
+PATH_SEPARATOR
+PACKAGE_NAME
+PACKAGE_TARNAME
+PACKAGE_VERSION
+PACKAGE_STRING
+PACKAGE_BUGREPORT
+exec_prefix
+prefix
+program_transform_name
+bindir
+sbindir
+libexecdir
+datarootdir
+datadir
+sysconfdir
+sharedstatedir
+localstatedir
+includedir
+oldincludedir
+docdir
+infodir
+htmldir
+dvidir
+pdfdir
+psdir
+libdir
+localedir
+mandir
+DEFS
+ECHO_C
+ECHO_N
+ECHO_T
+LIBS
+build_alias
+host_alias
+target_alias
+MAINT
+build
+build_cpu
+build_vendor
+build_os
+host
+host_cpu
+host_vendor
+host_os
+CC
+CFLAGS
+LDFLAGS
+CPPFLAGS
+ac_ct_CC
+EXEEXT
+OBJEXT
+CPP
+GREP
+EGREP
+LN_S
+INSTALL_PROGRAM
+INSTALL_SCRIPT
+INSTALL_DATA
+RANLIB
+INSTALL_INFO
+GZIP_PROG
+LIBSOUND
+PKG_CONFIG
+ALSA_CFLAGS
+ALSA_LIBS
+CFLAGS_SOUND
+SET_MAKE
+XMKMF
+GTK_CFLAGS
+GTK_LIBS
+ALLOCA
+liblockfile
+LIBOBJS
+NEED_SETGID
+KMEM_GROUP
+GETLOADAVG_LIBS
+GETOPT_H
+GETOPTOBJS
+version
+configuration
+canonical
+srcdir
+lispdir
+locallisppath
+lisppath
+x_default_search_path
+etcdir
+archlibdir
+bitmapdir
+gamedir
+gameuser
+c_switch_system
+c_switch_machine
+LD_SWITCH_X_SITE
+LD_SWITCH_X_SITE_AUX
+C_SWITCH_X_SITE
+X_TOOLKIT_TYPE
+machfile
+opsysfile
+carbon_appdir
+LTLIBOBJS'
 ac_subst_files=''
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP
+XMKMF'
+
 
 # Initialize some variables set by options.
 ac_init_help=
@@ -338,34 +757,48 @@ x_libraries=NONE
 # and all the variables that are supposed to be based on exec_prefix
 # by default will actually change.
 # Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
 bindir='${exec_prefix}/bin'
 sbindir='${exec_prefix}/sbin'
 libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
-libdir='${exec_prefix}/lib'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
+docdir='${datarootdir}/doc/${PACKAGE}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
 
 ac_prev=
+ac_dashdash=
 for ac_option
 do
   # If the previous option needs an argument, assign it.
   if test -n "$ac_prev"; then
-    eval "$ac_prev=\$ac_option"
+    eval $ac_prev=\$ac_option
     ac_prev=
     continue
   fi
 
-  ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+  case $ac_option in
+  *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)   ac_optarg=yes ;;
+  esac
 
   # Accept the important Cygnus configure options, so we can diagnose typos.
 
-  case $ac_option in
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
 
   -bindir | --bindir | --bindi | --bind | --bin | --bi)
     ac_prev=bindir ;;
@@ -387,33 +820,45 @@ do
   --config-cache | -C)
     cache_file=config.cache ;;
 
-  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+  -datadir | --datadir | --datadi | --datad)
     ac_prev=datadir ;;
-  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
-  | --da=*)
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
     datadir=$ac_optarg ;;
 
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
   -disable-* | --disable-*)
     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+    expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
    { (exit 1); exit 1; }; }
-    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
-    eval "enable_$ac_feature=no" ;;
+    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
+    eval enable_$ac_feature=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
 
   -enable-* | --enable-*)
     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+    expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
    { (exit 1); exit 1; }; }
-    ac_feature=`echo $ac_feature | sed 's/-/_/g'`
-    case $ac_option in
-      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
-      *) ac_optarg=yes ;;
-    esac
-    eval "enable_$ac_feature='$ac_optarg'" ;;
+    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
+    eval enable_$ac_feature=\$ac_optarg ;;
 
   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
@@ -440,6 +885,12 @@ do
   -host=* | --host=* | --hos=* | --ho=*)
     host_alias=$ac_optarg ;;
 
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$ac_optarg ;;
+
   -includedir | --includedir | --includedi | --included | --include \
   | --includ | --inclu | --incl | --inc)
     ac_prev=includedir ;;
@@ -464,13 +915,16 @@ do
   | --libexe=* | --libex=* | --libe=*)
     libexecdir=$ac_optarg ;;
 
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
   -localstatedir | --localstatedir | --localstatedi | --localstated \
-  | --localstate | --localstat | --localsta | --localst \
-  | --locals | --local | --loca | --loc | --lo)
+  | --localstate | --localstat | --localsta | --localst | --locals)
     ac_prev=localstatedir ;;
   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
-  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
-  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
     localstatedir=$ac_optarg ;;
 
   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
@@ -535,6 +989,16 @@ do
   | --progr-tra=* | --program-tr=* | --program-t=*)
     program_transform_name=$ac_optarg ;;
 
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$ac_optarg ;;
+
   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
@@ -587,24 +1051,20 @@ do
   -with-* | --with-*)
     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+    expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
       { echo "$as_me: error: invalid package name: $ac_package" >&2
    { (exit 1); exit 1; }; }
-    ac_package=`echo $ac_package| sed 's/-/_/g'`
-    case $ac_option in
-      *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
-      *) ac_optarg=yes ;;
-    esac
-    eval "with_$ac_package='$ac_optarg'" ;;
+    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
+    eval with_$ac_package=\$ac_optarg ;;
 
   -without-* | --without-*)
     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
     # Reject names that are not valid shell variable names.
-    expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+    expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
       { echo "$as_me: error: invalid package name: $ac_package" >&2
    { (exit 1); exit 1; }; }
-    ac_package=`echo $ac_package | sed 's/-/_/g'`
-    eval "with_$ac_package=no" ;;
+    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
+    eval with_$ac_package=no ;;
 
   --x)
     # Obsolete; use --with-x.
@@ -635,8 +1095,7 @@ Try \`$0 --help' for more information." >&2
     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
    { (exit 1); exit 1; }; }
-    ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
-    eval "$ac_envvar='$ac_optarg'"
+    eval $ac_envvar=\$ac_optarg
     export $ac_envvar ;;
 
   *)
@@ -656,27 +1115,19 @@ if test -n "$ac_prev"; then
    { (exit 1); exit 1; }; }
 fi
 
-# Be sure to have absolute paths.
-for ac_var in exec_prefix prefix
-do
-  eval ac_val=$`echo $ac_var`
-  case $ac_val in
-    [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
-    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
-   { (exit 1); exit 1; }; };;
-  esac
-done
-
-# Be sure to have absolute paths.
-for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
-             localstatedir libdir includedir oldincludedir infodir mandir
+# Be sure to have absolute directory names.
+for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
+               datadir sysconfdir sharedstatedir localstatedir includedir \
+               oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+               libdir localedir mandir
 do
-  eval ac_val=$`echo $ac_var`
+  eval ac_val=\$$ac_var
   case $ac_val in
-    [\\/$]* | ?:[\\/]* ) ;;
-    *)  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
-   { (exit 1); exit 1; }; };;
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
   esac
+  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; }
 done
 
 # There might be people who depend on the old broken behavior: `$host'
@@ -703,74 +1154,76 @@ test -n "$host_alias" && ac_tool_prefix=$host_alias-
 test "$silent" = yes && exec 6>/dev/null
 
 
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
-  ac_srcdir_defaulted=yes
-  # Try the directory containing this script, then its parent.
-  ac_confdir=`(dirname "$0") 2>/dev/null ||
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  { echo "$as_me: error: Working directory cannot be determined" >&2
+   { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  { echo "$as_me: error: pwd does not report name of working directory" >&2
+   { (exit 1); exit 1; }; }
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then the parent directory.
+  ac_confdir=`$as_dirname -- "$0" ||
 $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
         X"$0" : 'X\(//\)[^/]' \| \
         X"$0" : 'X\(//\)$' \| \
-        X"$0" : 'X\(/\)' \| \
-        .     : '\(.\)' 2>/dev/null ||
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
 echo X"$0" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
   srcdir=$ac_confdir
-  if test ! -r $srcdir/$ac_unique_file; then
+  if test ! -r "$srcdir/$ac_unique_file"; then
     srcdir=..
   fi
 else
   ac_srcdir_defaulted=no
 fi
-if test ! -r $srcdir/$ac_unique_file; then
-  if test "$ac_srcdir_defaulted" = yes; then
-    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
-   { (exit 1); exit 1; }; }
-  else
-    { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+if test ! -r "$srcdir/$ac_unique_file"; then
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
    { (exit 1); exit 1; }; }
-  fi
 fi
-(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
-  { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+       cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
    { (exit 1); exit 1; }; }
-srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
-ac_env_build_alias_set=${build_alias+set}
-ac_env_build_alias_value=$build_alias
-ac_cv_env_build_alias_set=${build_alias+set}
-ac_cv_env_build_alias_value=$build_alias
-ac_env_host_alias_set=${host_alias+set}
-ac_env_host_alias_value=$host_alias
-ac_cv_env_host_alias_set=${host_alias+set}
-ac_cv_env_host_alias_value=$host_alias
-ac_env_target_alias_set=${target_alias+set}
-ac_env_target_alias_value=$target_alias
-ac_cv_env_target_alias_set=${target_alias+set}
-ac_cv_env_target_alias_value=$target_alias
-ac_env_CC_set=${CC+set}
-ac_env_CC_value=$CC
-ac_cv_env_CC_set=${CC+set}
-ac_cv_env_CC_value=$CC
-ac_env_CFLAGS_set=${CFLAGS+set}
-ac_env_CFLAGS_value=$CFLAGS
-ac_cv_env_CFLAGS_set=${CFLAGS+set}
-ac_cv_env_CFLAGS_value=$CFLAGS
-ac_env_LDFLAGS_set=${LDFLAGS+set}
-ac_env_LDFLAGS_value=$LDFLAGS
-ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
-ac_cv_env_LDFLAGS_value=$LDFLAGS
-ac_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_env_CPPFLAGS_value=$CPPFLAGS
-ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_cv_env_CPPFLAGS_value=$CPPFLAGS
-ac_env_CPP_set=${CPP+set}
-ac_env_CPP_value=$CPP
-ac_cv_env_CPP_set=${CPP+set}
-ac_cv_env_CPP_value=$CPP
+       pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
 
 #
 # Report the --help message.
@@ -799,9 +1252,6 @@ Configuration:
   -n, --no-create         do not create output files
       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
 
-_ACEOF
-
-  cat <<_ACEOF
 Installation directories:
   --prefix=PREFIX         install architecture-independent files in PREFIX
                          [$ac_default_prefix]
@@ -819,15 +1269,22 @@ Fine tuning of the installation directories:
   --bindir=DIR           user executables [EPREFIX/bin]
   --sbindir=DIR          system admin executables [EPREFIX/sbin]
   --libexecdir=DIR       program executables [EPREFIX/libexec]
-  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
   --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
   --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
   --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
   --libdir=DIR           object code libraries [EPREFIX/lib]
   --includedir=DIR       C header files [PREFIX/include]
   --oldincludedir=DIR    C header files for non-gcc [/usr/include]
-  --infodir=DIR          info documentation [PREFIX/info]
-  --mandir=DIR           man documentation [PREFIX/man]
+  --datarootdir=DIR      read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR          read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR          info documentation [DATAROOTDIR/info]
+  --localedir=DIR        locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR           man documentation [DATAROOTDIR/man]
+  --docdir=DIR           documentation root [DATAROOTDIR/doc/PACKAGE]
+  --htmldir=DIR          html documentation [DOCDIR]
+  --dvidir=DIR           dvi documentation [DOCDIR]
+  --pdfdir=DIR           pdf documentation [DOCDIR]
+  --psdir=DIR            ps documentation [DOCDIR]
 _ACEOF
 
   cat <<\_ACEOF
@@ -893,126 +1350,96 @@ Some influential environment variables:
   CFLAGS      C compiler flags
   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
               nonstandard directory <lib dir>
-  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
-              headers in a nonstandard directory <include dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
   CPP         C preprocessor
+  XMKMF       Path to xmkmf, Makefile generator for X Window System
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
 
 _ACEOF
+ac_status=$?
 fi
 
 if test "$ac_init_help" = "recursive"; then
   # If there are subdirs, report their specific --help.
-  ac_popdir=`pwd`
   for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
-    test -d $ac_dir || continue
+    test -d "$ac_dir" || continue
     ac_builddir=.
 
-if test "$ac_dir" != .; then
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
   ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
-  # A "../" for each directory in $ac_dir_suffix.
-  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
-  ac_dir_suffix= ac_top_builddir=
-fi
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
 
 case $srcdir in
-  .)  # No --srcdir option.  We are building in place.
+  .)  # We are building in place.
     ac_srcdir=.
-    if test -z "$ac_top_builddir"; then
-       ac_top_srcdir=.
-    else
-       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
-    fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
     ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir ;;
-  *) # Relative path.
-    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
-  case "$ac_dir" in
-  .) ac_abs_builddir=`pwd`;;
-  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
-  *) ac_abs_builddir=`pwd`/"$ac_dir";;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
-  case ${ac_top_builddir}. in
-  .) ac_abs_top_builddir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
-  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
-  case $ac_srcdir in
-  .) ac_abs_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
-  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
-  case $ac_top_srcdir in
-  .) ac_abs_top_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
-  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
-  esac;;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
 esac
-
-    cd $ac_dir
-    # Check for guested configure; otherwise get Cygnus style configure.
-    if test -f $ac_srcdir/configure.gnu; then
-      echo
-      $SHELL $ac_srcdir/configure.gnu  --help=recursive
-    elif test -f $ac_srcdir/configure; then
-      echo
-      $SHELL $ac_srcdir/configure  --help=recursive
-    elif test -f $ac_srcdir/configure.ac ||
-          test -f $ac_srcdir/configure.in; then
-      echo
-      $ac_configure --help
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+    elif test -f "$ac_srcdir/configure"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure" --help=recursive
     else
       echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
-    fi
-    cd "$ac_popdir"
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
   done
 fi
 
-test -n "$ac_init_help" && exit 0
+test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
+configure
+generated by GNU Autoconf 2.61
 
-Copyright (C) 2003 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
-  exit 0
+  exit
 fi
-exec 5>config.log
-cat >&5 <<_ACEOF
+cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by $as_me, which was
-generated by GNU Autoconf 2.59.  Invocation command line was
+generated by GNU Autoconf 2.61.  Invocation command line was
 
   $ $0 $@
 
 _ACEOF
+exec 5>>config.log
 {
 cat <<_ASUNAME
 ## --------- ##
@@ -1031,7 +1458,7 @@ uname -v = `(uname -v) 2>/dev/null || echo unknown`
 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
+/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
@@ -1045,6 +1472,7 @@ do
   test -z "$as_dir" && as_dir=.
   echo "PATH: $as_dir"
 done
+IFS=$as_save_IFS
 
 } >&5
 
@@ -1066,7 +1494,6 @@ _ACEOF
 ac_configure_args=
 ac_configure_args0=
 ac_configure_args1=
-ac_sep=
 ac_must_keep_next=false
 for ac_pass in 1 2
 do
@@ -1077,7 +1504,7 @@ do
     -q | -quiet | --quiet | --quie | --qui | --qu | --q \
     | -silent | --silent | --silen | --sile | --sil)
       continue ;;
-    *" "*|*"   "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+    *\'*)
       ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
     esac
     case $ac_pass in
@@ -1099,9 +1526,7 @@ do
          -* ) ac_must_keep_next=true ;;
        esac
       fi
-      ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
-      # Get rid of the leading space.
-      ac_sep=" "
+      ac_configure_args="$ac_configure_args '$ac_arg'"
       ;;
     esac
   done
@@ -1112,8 +1537,8 @@ $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_
 # When interrupted or exit'd, cleanup temporary files, and complete
 # config.log.  We remove comments because anyway the quotes in there
 # would cause problems or look ugly.
-# WARNING: Be sure not to use single quotes in there, as some shells,
-# such as our DU 5.0 friend, will then `close' the trap.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
 trap 'exit_status=$?
   # Save into config.log some information that might help in debugging.
   {
@@ -1126,20 +1551,34 @@ trap 'exit_status=$?
 _ASBOX
     echo
     # The following way of writing the cache mishandles newlines in values,
-{
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
   (set) 2>&1 |
-    case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
-    *ac_space=\ *)
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
       sed -n \
-       "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
-         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
-      ;;
+       "s/'\''/'\''\\\\'\'''\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
     *)
-      sed -n \
-       "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
       ;;
-    esac;
-}
+    esac |
+    sort
+)
     echo
 
     cat <<\_ASBOX
@@ -1150,22 +1589,28 @@ _ASBOX
     echo
     for ac_var in $ac_subst_vars
     do
-      eval ac_val=$`echo $ac_var`
-      echo "$ac_var='"'"'$ac_val'"'"'"
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      echo "$ac_var='\''$ac_val'\''"
     done | sort
     echo
 
     if test -n "$ac_subst_files"; then
       cat <<\_ASBOX
-## ------------- ##
-## Output files. ##
-## ------------- ##
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
 _ASBOX
       echo
       for ac_var in $ac_subst_files
       do
-       eval ac_val=$`echo $ac_var`
-       echo "$ac_var='"'"'$ac_val'"'"'"
+       eval ac_val=\$$ac_var
+       case $ac_val in
+       *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+       esac
+       echo "$ac_var='\''$ac_val'\''"
       done | sort
       echo
     fi
@@ -1177,26 +1622,24 @@ _ASBOX
 ## ----------- ##
 _ASBOX
       echo
-      sed "/^$/d" confdefs.h | sort
+      cat confdefs.h
       echo
     fi
     test "$ac_signal" != 0 &&
       echo "$as_me: caught signal $ac_signal"
     echo "$as_me: exit $exit_status"
   } >&5
-  rm -f core *.core &&
-  rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
     exit $exit_status
-     ' 0
+' 0
 for ac_signal in 1 2 13 15; do
   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
 done
 ac_signal=0
 
 # confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo >confdefs.h
+rm -f -r conftest* confdefs.h
 
 # Predefined preprocessor variables.
 
@@ -1227,14 +1670,17 @@ _ACEOF
 
 # Let the site file select an alternate cache file if it wants to.
 # Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
-  if test "x$prefix" != xNONE; then
-    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
-  else
-    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
-  fi
+if test -n "$CONFIG_SITE"; then
+  set x "$CONFIG_SITE"
+elif test "x$prefix" != xNONE; then
+  set x "$prefix/share/config.site" "$prefix/etc/config.site"
+else
+  set x "$ac_default_prefix/share/config.site" \
+       "$ac_default_prefix/etc/config.site"
 fi
-for ac_site_file in $CONFIG_SITE; do
+shift
+for ac_site_file
+do
   if test -r "$ac_site_file"; then
     { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
 echo "$as_me: loading site script $ac_site_file" >&6;}
@@ -1250,8 +1696,8 @@ if test -r "$cache_file"; then
     { echo "$as_me:$LINENO: loading cache $cache_file" >&5
 echo "$as_me: loading cache $cache_file" >&6;}
     case $cache_file in
-      [\\/]* | ?:[\\/]* ) . $cache_file;;
-      *)                      . ./$cache_file;;
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
     esac
   fi
 else
@@ -1260,15 +1706,17 @@ echo "$as_me: creating cache $cache_file" >&6;}
   >$cache_file
 fi
 
+ac_header_list="$ac_header_list sys/time.h"
+ac_header_list="$ac_header_list unistd.h"
+ac_func_list="$ac_func_list alarm"
 # Check that the precious variables saved in the cache have kept the same
 # value.
 ac_cache_corrupted=false
-for ac_var in `(set) 2>&1 |
-              sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+for ac_var in $ac_precious_vars; do
   eval ac_old_set=\$ac_cv_env_${ac_var}_set
   eval ac_new_set=\$ac_env_${ac_var}_set
-  eval ac_old_val="\$ac_cv_env_${ac_var}_value"
-  eval ac_new_val="\$ac_env_${ac_var}_value"
+  eval ac_old_val=\$ac_cv_env_${ac_var}_value
+  eval ac_new_val=\$ac_env_${ac_var}_value
   case $ac_old_set,$ac_new_set in
     set,)
       { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
@@ -1293,8 +1741,7 @@ echo "$as_me:   current value: $ac_new_val" >&2;}
   # Pass precious variables to config.status.
   if test "$ac_new_set" = set; then
     case $ac_new_val in
-    *" "*|*"   "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
-      ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
     *) ac_arg=$ac_var=$ac_new_val ;;
     esac
     case " $ac_configure_args " in
@@ -1311,12 +1758,6 @@ echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start ov
    { (exit 1); exit 1; }; }
 fi
 
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
 
 
 
@@ -1333,23 +1774,28 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-          ac_config_headers="$ac_config_headers src/config.h:src/config.in"
+ac_config_headers="$ac_config_headers src/config.h:src/config.in"
 
 
 test "$program_prefix" != NONE &&
-  program_transform_name="s,^,$program_prefix,;$program_transform_name"
+  program_transform_name="s&^&$program_prefix&;$program_transform_name"
 # Use a double $ so make ignores it.
 test "$program_suffix" != NONE &&
-  program_transform_name="s,\$,$program_suffix,;$program_transform_name"
+  program_transform_name="s&\$&$program_suffix&;$program_transform_name"
 # Double any \ or $.  echo might interpret backslashes.
 # By default was `s,x,x', remove it if useless.
 cat <<\_ACEOF >conftest.sed
 s/[\\$]/&&/g;s/;s,x,x,$//
 _ACEOF
 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
-rm conftest.sed
+rm -f conftest.sed
 
 
 lispdir='${datadir}/emacs/${version}/lisp'
@@ -1364,16 +1810,15 @@ gamedir='${localstatedir}/games/emacs'
 gameuser=games
 
 
-# Check whether --with-gcc or --without-gcc was given.
+# Check whether --with-gcc was given.
 if test "${with_gcc+set}" = set; then
-  withval="$with_gcc"
+  withval=$with_gcc;
+fi
 
-fi;
 
-# Check whether --with-pop or --without-pop was given.
+# Check whether --with-pop was given.
 if test "${with_pop+set}" = set; then
-  withval="$with_pop"
-  if test "$withval" = yes; then
+  withval=$with_pop; if test "$withval" = yes; then
    cat >>confdefs.h <<\_ACEOF
 #define MAIL_USE_POP 1
 _ACEOF
@@ -1385,23 +1830,23 @@ else
 #define MAIL_USE_POP 1
 _ACEOF
 
-fi;
+fi
 
 
-# Check whether --with-kerberos or --without-kerberos was given.
+
+# Check whether --with-kerberos was given.
 if test "${with_kerberos+set}" = set; then
-  withval="$with_kerberos"
-  cat >>confdefs.h <<\_ACEOF
+  withval=$with_kerberos; cat >>confdefs.h <<\_ACEOF
 #define KERBEROS 1
 _ACEOF
 
-fi;
+fi
 
 
-# Check whether --with-kerberos5 or --without-kerberos5 was given.
+
+# Check whether --with-kerberos5 was given.
 if test "${with_kerberos5+set}" = set; then
-  withval="$with_kerberos5"
-  if test "${with_kerberos5+set}" = set; then
+  withval=$with_kerberos5; if test "${with_kerberos5+set}" = set; then
   if test "${with_kerberos+set}" != set; then
     with_kerberos=yes
     cat >>confdefs.h <<\_ACEOF
@@ -1415,30 +1860,30 @@ cat >>confdefs.h <<\_ACEOF
 #define KERBEROS5 1
 _ACEOF
 
-fi;
+fi
 
-# Check whether --with-hesiod or --without-hesiod was given.
-if test "${with_hesiod+set}" = set; then
-  withval="$with_hesiod"
 
+# Check whether --with-hesiod was given.
+if test "${with_hesiod+set}" = set; then
+  withval=$with_hesiod;
 cat >>confdefs.h <<\_ACEOF
 #define HESIOD 1
 _ACEOF
 
-fi;
+fi
 
 
-# Check whether --with-sound or --without-sound was given.
+
+# Check whether --with-sound was given.
 if test "${with_sound+set}" = set; then
-  withval="$with_sound"
+  withval=$with_sound;
+fi
 
-fi;
 
 
-# Check whether --with-x-toolkit or --without-x-toolkit was given.
+# Check whether --with-x-toolkit was given.
 if test "${with_x_toolkit+set}" = set; then
-  withval="$with_x_toolkit"
-         case "${withval}" in
+  withval=$with_x_toolkit;       case "${withval}" in
            y | ye | yes )      val=athena ;;
            n | no )            val=no  ;;
            l | lu | luc | luci | lucid )       val=lucid ;;
@@ -1457,88 +1902,89 @@ Currently, \`yes', \`athena' and \`lucid' are synonyms." >&2;}
          esac
          with_x_toolkit=$val
 
-fi;
+fi
+
 
-# Check whether --with-xpm or --without-xpm was given.
+# Check whether --with-xpm was given.
 if test "${with_xpm+set}" = set; then
-  withval="$with_xpm"
+  withval=$with_xpm;
+fi
 
-fi;
 
-# Check whether --with-jpeg or --without-jpeg was given.
+# Check whether --with-jpeg was given.
 if test "${with_jpeg+set}" = set; then
-  withval="$with_jpeg"
+  withval=$with_jpeg;
+fi
 
-fi;
 
-# Check whether --with-tiff or --without-tiff was given.
+# Check whether --with-tiff was given.
 if test "${with_tiff+set}" = set; then
-  withval="$with_tiff"
+  withval=$with_tiff;
+fi
 
-fi;
 
-# Check whether --with-gif or --without-gif was given.
+# Check whether --with-gif was given.
 if test "${with_gif+set}" = set; then
-  withval="$with_gif"
+  withval=$with_gif;
+fi
 
-fi;
 
-# Check whether --with-png or --without-png was given.
+# Check whether --with-png was given.
 if test "${with_png+set}" = set; then
-  withval="$with_png"
+  withval=$with_png;
+fi
 
-fi;
 
-# Check whether --with-gtk or --without-gtk was given.
+# Check whether --with-gtk was given.
 if test "${with_gtk+set}" = set; then
-  withval="$with_gtk"
+  withval=$with_gtk;
+fi
 
-fi;
 
-# Check whether --with-pkg-config-prog or --without-pkg-config-prog was given.
+# Check whether --with-pkg-config-prog was given.
 if test "${with_pkg_config_prog+set}" = set; then
-  withval="$with_pkg_config_prog"
+  withval=$with_pkg_config_prog;
+fi
 
-fi;
 
-# Check whether --with-toolkit-scroll-bars or --without-toolkit-scroll-bars was given.
+# Check whether --with-toolkit-scroll-bars was given.
 if test "${with_toolkit_scroll_bars+set}" = set; then
-  withval="$with_toolkit_scroll_bars"
+  withval=$with_toolkit_scroll_bars;
+fi
 
-fi;
 
-# Check whether --with-xim or --without-xim was given.
+# Check whether --with-xim was given.
 if test "${with_xim+set}" = set; then
-  withval="$with_xim"
+  withval=$with_xim;
+fi
 
-fi;
 
-# Check whether --with-carbon or --without-carbon was given.
+# Check whether --with-carbon was given.
 if test "${with_carbon+set}" = set; then
-  withval="$with_carbon"
+  withval=$with_carbon;
+fi
 
-fi;
-# Check whether --enable-carbon-app or --disable-carbon-app was given.
+# Check whether --enable-carbon-app was given.
 if test "${enable_carbon_app+set}" = set; then
-  enableval="$enable_carbon_app"
-   carbon_appdir_x=${enableval}
-fi;
+  enableval=$enable_carbon_app;  carbon_appdir_x=${enableval}
+fi
 
-# Check whether --enable-asserts or --disable-asserts was given.
+
+# Check whether --enable-asserts was given.
 if test "${enable_asserts+set}" = set; then
-  enableval="$enable_asserts"
-  USE_XASSERTS=$enableval
+  enableval=$enable_asserts; USE_XASSERTS=$enableval
 else
   USE_XASSERTS=no
-fi;
+fi
+
 
-# Check whether --enable-maintainer-mode or --disable-maintainer-mode was given.
+# Check whether --enable-maintainer-mode was given.
 if test "${enable_maintainer_mode+set}" = set; then
-  enableval="$enable_maintainer_mode"
-  USE_MAINTAINER_MODE=$enableval
+  enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
 else
   USE_MAINTAINER_MODE=no
-fi;
+fi
+
 if test $USE_MAINTAINER_MODE = yes; then
   MAINT=
 else
@@ -1546,15 +1992,15 @@ else
 fi
 
 
-# Check whether --enable-locallisppath or --disable-locallisppath was given.
+# Check whether --enable-locallisppath was given.
 if test "${enable_locallisppath+set}" = set; then
-  enableval="$enable_locallisppath"
-  if test "${enableval}" = "no"; then
+  enableval=$enable_locallisppath; if test "${enableval}" = "no"; then
   locallisppath=
 elif test "${enableval}" != "yes"; then
   locallisppath=${enableval}
 fi
-fi;
+fi
+
 
 #### Make srcdir absolute, if it isn't already.  It's important to
 #### avoid running the path through pwd unnecessarily, since pwd can
 ### Canonicalize the configuration name.
 
 ac_aux_dir=
-for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
-  if test -f $ac_dir/install-sh; then
+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+  if test -f "$ac_dir/install-sh"; then
     ac_aux_dir=$ac_dir
     ac_install_sh="$ac_aux_dir/install-sh -c"
     break
-  elif test -f $ac_dir/install.sh; then
+  elif test -f "$ac_dir/install.sh"; then
     ac_aux_dir=$ac_dir
     ac_install_sh="$ac_aux_dir/install.sh -c"
     break
-  elif test -f $ac_dir/shtool; then
+  elif test -f "$ac_dir/shtool"; then
     ac_aux_dir=$ac_dir
     ac_install_sh="$ac_aux_dir/shtool install -c"
     break
   fi
 done
 if test -z "$ac_aux_dir"; then
-  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
-echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
+  { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
+echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
    { (exit 1); exit 1; }; }
 fi
-ac_config_guess="$SHELL $ac_aux_dir/config.guess"
-ac_config_sub="$SHELL $ac_aux_dir/config.sub"
-ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
 
 # Make sure we can run config.sub.
-$ac_config_sub sun4 >/dev/null 2>&1 ||
-  { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
-echo "$as_me: error: cannot run $ac_config_sub" >&2;}
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
    { (exit 1); exit 1; }; }
 
-echo "$as_me:$LINENO: checking build system type" >&5
-echo $ECHO_N "checking build system type... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6; }
 if test "${ac_cv_build+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_build_alias=$build_alias
-test -z "$ac_cv_build_alias" &&
-  ac_cv_build_alias=`$ac_config_guess`
-test -z "$ac_cv_build_alias" &&
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
   { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
    { (exit 1); exit 1; }; }
-ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
-  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
    { (exit 1); exit 1; }; }
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_build" >&5
-echo "${ECHO_T}$ac_cv_build" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+echo "$as_me: error: invalid value of canonical build" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
 build=$ac_cv_build
-build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-
-
-echo "$as_me:$LINENO: checking host system type" >&5
-echo $ECHO_N "checking host system type... $ECHO_C" >&6
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ echo "$as_me:$LINENO: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6; }
 if test "${ac_cv_host+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_host_alias=$host_alias
-test -z "$ac_cv_host_alias" &&
-  ac_cv_host_alias=$ac_cv_build_alias
-ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
-  { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
-echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
    { (exit 1); exit 1; }; }
+fi
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_host" >&5
-echo "${ECHO_T}$ac_cv_host" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+echo "$as_me: error: invalid value of canonical host" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
 host=$ac_cv_host
-host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 
 canonical=$host
@@ -2727,8 +3208,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -2741,32 +3222,34 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 fi
 if test -z "$ac_cv_prog_CC"; then
   ac_ct_CC=$CC
   # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -2779,36 +3262,51 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CC="gcc"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  CC=$ac_ct_CC
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
 else
   CC="$ac_cv_prog_CC"
 fi
 
 if test -z "$CC"; then
-  if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -2821,74 +3319,34 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_CC"; then
-  ac_ct_CC=$CC
-  # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; 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_prog_ac_ct_CC+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CC="cc"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
+  { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  CC=$ac_ct_CC
-else
-  CC="$ac_cv_prog_CC"
-fi
 
+  fi
 fi
 if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -2902,7 +3360,7 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
        continue
@@ -2913,6 +3371,7 @@ do
   fi
 done
 done
+IFS=$as_save_IFS
 
 if test $ac_prog_rejected = yes; then
   # We found a bogon in the path, so make sure we never use it.
@@ -2930,22 +3389,23 @@ fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 fi
 if test -z "$CC"; then
   if test -n "$ac_tool_prefix"; then
-  for ac_prog in cl
+  for ac_prog in cl.exe
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -2958,36 +3418,38 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+  echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
     test -n "$CC" && break
   done
 fi
 if test -z "$CC"; then
   ac_ct_CC=$CC
-  for ac_prog in cl
+  for ac_prog in cl.exe
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -3000,29 +3462,45 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
+  echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
   test -n "$ac_ct_CC" && break
 done
 
-  CC=$ac_ct_CC
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
 fi
 
 fi
@@ -3035,21 +3513,35 @@ See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }
 
 # Provide some information about the compiler.
-echo "$as_me:$LINENO:" \
-     "checking for C compiler version" >&5
+echo "$as_me:$LINENO: checking for C compiler version" >&5
 ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
-  (eval $ac_compiler --version </dev/null >&5) 2>&5
+{ (ac_try="$ac_compiler --version >&5"
+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_compiler --version >&5") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
-  (eval $ac_compiler -v </dev/null >&5) 2>&5
+{ (ac_try="$ac_compiler -v >&5"
+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_compiler -v >&5") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
-  (eval $ac_compiler -V </dev/null >&5) 2>&5
+{ (ac_try="$ac_compiler -V >&5"
+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_compiler -V >&5") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }
@@ -3074,47 +3566,77 @@ ac_clean_files="$ac_clean_files a.out a.exe b.out"
 # Try to create an executable without -o first, disregard a.out.
 # It will help us diagnose broken compilers, and finding out an intuition
 # of exeext.
-echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
-echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
-  (eval $ac_link_default) 2>&5
+#
+# List of possible output files, starting from the most likely.
+# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
+# only as a last resort.  b.out is created by i960 compilers.
+ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
+#
+# The IRIX 6 linker writes into existing files which may not be
+# executable, retaining their permissions.  Remove them first so a
+# subsequent execution test works.
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { (ac_try="$ac_link_default"
+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_default") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  # Find the output, starting from the most likely.  This scheme is
-# not robust to junk in `.', hence go to wildcards (a.*) only as a last
-# resort.
-
-# Be careful to initialize this variable, since it used to be cached.
-# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
-ac_cv_exeext=
-# b.out is created by i960 compilers.
-for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
 do
   test -f "$ac_file" || continue
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
-       ;;
-    conftest.$ac_ext )
-       # This is the source file.
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
        ;;
     [ab].out )
        # We found the default executable, but exeext='' is most
        # certainly right.
        break;;
     *.* )
-       ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-       # FIXME: I believe we export ac_cv_exeext for Libtool,
-       # but it would be cool to find out if it's true.  Does anybody
-       # maintain Libtool? --akim.
-       export ac_cv_exeext
+        if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+       then :; else
+          ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+       fi
+       # We set ac_cv_exeext here because the later test for it is not
+       # safe: cross compilers may not add the suffix if given an `-o'
+       # argument, so we may need to know it at that point already.
+       # Even if this section looks crufty: it has the advantage of
+       # actually working.
        break;;
     * )
        break;;
   esac
 done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
 else
+  ac_file=''
+fi
+
+{ echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6; }
+if test -z "$ac_file"; then
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
@@ -3126,19 +3648,21 @@ See \`config.log' for more details." >&2;}
 fi
 
 ac_exeext=$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6
 
-# Check the compiler produces executables we can run.  If not, either
+# Check that the compiler produces executables we can run.  If not, either
 # the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }
 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
 # If not cross compiling, check that we can run a simple program.
 if test "$cross_compiling" != yes; then
   if { ac_try='./$ac_file'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (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_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -3157,22 +3681,27 @@ See \`config.log' for more details." >&2;}
     fi
   fi
 fi
-echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
 
 rm -f a.out a.exe conftest$ac_cv_exeext b.out
 ac_clean_files=$ac_clean_files_save
-# Check the compiler produces executables we can run.  If not, either
+# Check that the compiler produces executables we can run.  If not, either
 # the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
-echo "$as_me:$LINENO: result: $cross_compiling" >&5
-echo "${ECHO_T}$cross_compiling" >&6
-
-echo "$as_me:$LINENO: checking for suffix of executables" >&5
-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6; }
+
+{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
+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>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
@@ -3183,9 +3712,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
 for ac_file in conftest.exe conftest conftest.*; do
   test -f "$ac_file" || continue
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-         export ac_cv_exeext
          break;;
     * ) break;;
   esac
@@ -3199,14 +3727,14 @@ See \`config.log' for more details." >&2;}
 fi
 
 rm -f conftest$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-echo "${ECHO_T}$ac_cv_exeext" >&6
+echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6; }
 
 rm -f conftest.$ac_ext
 EXEEXT=$ac_cv_exeext
 ac_exeext=$EXEEXT
-echo "$as_me:$LINENO: checking for suffix of object files" >&5
-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
 if test "${ac_cv_objext+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -3226,14 +3754,20 @@ main ()
 }
 _ACEOF
 rm -f conftest.o conftest.obj
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+if { (ac_try="$ac_compile"
+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>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; then
-  for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
   case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
        break;;
   esac
@@ -3251,12 +3785,12 @@ fi
 
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-echo "${ECHO_T}$ac_cv_objext" >&6
+echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6; }
 OBJEXT=$ac_cv_objext
 ac_objext=$OBJEXT
-echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
 if test "${ac_cv_c_compiler_gnu+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -3279,50 +3813,49 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_compiler_gnu=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_compiler_gnu=no
+       ac_compiler_gnu=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_cv_c_compiler_gnu=$ac_compiler_gnu
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
 GCC=`test $ac_compiler_gnu = yes && echo yes`
 ac_test_CFLAGS=${CFLAGS+set}
 ac_save_CFLAGS=$CFLAGS
-CFLAGS="-g"
-echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
 if test "${ac_cv_prog_cc_g+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -3338,311 +3871,248 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_prog_cc_g=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_prog_cc_g=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
-if test "$ac_test_CFLAGS" = set; then
-  CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
-  if test "$GCC" = yes; then
-    CFLAGS="-g -O2"
-  else
-    CFLAGS="-g"
-  fi
-else
-  if test "$GCC" = yes; then
-    CFLAGS="-O2"
-  else
-    CFLAGS=
-  fi
-fi
-echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
-echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_stdc+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_cv_prog_cc_stdc=no
-ac_save_CC=$CC
-cat >conftest.$ac_ext <<_ACEOF
+       CFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <stdarg.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
-     char **p;
-     int i;
-{
-  return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
+
+int
+main ()
 {
-  char *s;
-  va_list v;
-  va_start (v,p);
-  s = g (p, va_arg (v,int));
-  va_end (v);
-  return s;
-}
 
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
-   function prototypes and stuff, but not '\xHH' hex character constants.
-   These don't provoke an error unfortunately, instead are silently treated
-   as 'x'.  The following induces an error, until -std1 is added to get
-   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
-   array size at least.  It's necessary to write '\x00'==0 to get something
-   that's true only with -std1.  */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
   ;
   return 0;
 }
 _ACEOF
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX                  -qlanglvl=ansi
-# Ultrix and OSF/1     -std1
-# HP-UX 10.20 and later        -Ae
-# HP-UX older versions -Aa -D_HPUX_SOURCE
-# SVR4                 -Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
-  CC="$ac_save_CC $ac_arg"
-  rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_prog_cc_stdc=$ac_arg
-break
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-fi
-rm -f conftest.err conftest.$ac_objext
-done
-rm -f conftest.$ac_ext conftest.$ac_objext
-CC=$ac_save_CC
-
-fi
-
-case "x$ac_cv_prog_cc_stdc" in
-  x|xno)
-    echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6 ;;
-  *)
-    echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
-    CC="$CC $ac_cv_prog_cc_stdc" ;;
-esac
-
-# Some people use a C++ compiler to compile C.  Since we use `exit',
-# in C++ we need to declare it.  In case someone uses the same compiler
-# for both compiling C and C++ we need to have the C++ compiler decide
-# the declaration of exit, since it's the most demanding environment.
-cat >conftest.$ac_ext <<_ACEOF
-#ifndef __cplusplus
-  choke me
-#endif
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  for ac_declaration in \
-   '' \
-   'extern "C" void std::exit (int) throw (); using std::exit;' \
-   'extern "C" void std::exit (int); using std::exit;' \
-   'extern "C" void exit (int) throw ();' \
-   'extern "C" void exit (int);' \
-   'void exit (int);'
-do
-  cat >conftest.$ac_ext <<_ACEOF
+       ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_declaration
-#include <stdlib.h>
+
 int
 main ()
 {
-exit (42);
+
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-continue
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  cat >conftest.$ac_ext <<_ACEOF
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_declaration
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
 int
 main ()
 {
-exit (42);
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  break
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_c89=$ac_arg
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
 done
-rm -f conftest*
-if test -n "$ac_declaration"; then
-  echo '#ifdef __cplusplus' >>confdefs.h
-  echo $ac_declaration      >>confdefs.h
-  echo '#endif'             >>confdefs.h
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
 fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6; } ;;
+  xno)
+    { echo "$as_me:$LINENO: result: unsupported" >&5
+echo "${ECHO_T}unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
+esac
 
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -3688,8 +4158,8 @@ ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
-echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -3723,24 +4193,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 #endif
                     Syntax error
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   :
 else
   echo "$as_me: failed program was:" >&5
@@ -3749,9 +4217,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
   # Broken: fails on valid input.
 continue
 fi
+
 rm -f conftest.err conftest.$ac_ext
 
-  # OK, works on sane cases.  Now check whether non-existent headers
+  # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -3761,24 +4230,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   # Broken: success on invalid input.
 continue
 else
@@ -3789,6 +4256,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 ac_preproc_ok=:
 break
 fi
+
 rm -f conftest.err conftest.$ac_ext
 
 done
@@ -3806,8 +4274,8 @@ fi
 else
   ac_cv_prog_CPP=$CPP
 fi
-echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6
+echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6; }
 ac_preproc_ok=false
 for ac_c_preproc_warn_flag in '' yes
 do
@@ -3830,24 +4298,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 #endif
                     Syntax error
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   :
 else
   echo "$as_me: failed program was:" >&5
@@ -3856,9 +4322,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
   # Broken: fails on valid input.
 continue
 fi
+
 rm -f conftest.err conftest.$ac_ext
 
-  # OK, works on sane cases.  Now check whether non-existent headers
+  # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -3868,24 +4335,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   # Broken: success on invalid input.
 continue
 else
@@ -3896,6 +4361,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 ac_preproc_ok=:
 break
 fi
+
 rm -f conftest.err conftest.$ac_ext
 
 done
@@ -3918,24 +4384,171 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-echo "$as_me:$LINENO: checking for egrep" >&5
-echo $ECHO_N "checking for egrep... $ECHO_C" >&6
-if test "${ac_cv_prog_egrep+set}" = set; then
+{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
+echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # Extract the first word of "grep ggrep" to use in msg output
+if test -z "$GREP"; then
+set dummy grep ggrep; ac_prog_name=$2
+if test "${ac_cv_path_GREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_path_GREP_found=false
+# Loop through the user's path and test for each of PROGNAME-LIST
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in grep ggrep; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
+    ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+    { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+    # Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+
+    $ac_path_GREP_found && break 3
+  done
+done
+
+done
+IFS=$as_save_IFS
+
+
+fi
+
+GREP="$ac_cv_path_GREP"
+if test -z "$GREP"; then
+  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     # Extract the first word of "egrep" to use in msg output
+if test -z "$EGREP"; then
+set dummy egrep; ac_prog_name=$2
+if test "${ac_cv_path_EGREP+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
-    then ac_cv_prog_egrep='grep -E'
-    else ac_cv_prog_egrep='egrep'
+  ac_path_EGREP_found=false
+# Loop through the user's path and test for each of PROGNAME-LIST
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in egrep; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
+    ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+    { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+    # Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
     fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+
+    $ac_path_EGREP_found && break 3
+  done
+done
+
+done
+IFS=$as_save_IFS
+
+
+fi
+
+EGREP="$ac_cv_path_EGREP"
+if test -z "$EGREP"; then
+  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+else
+  ac_cv_path_EGREP=$EGREP
 fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
-echo "${ECHO_T}$ac_cv_prog_egrep" >&6
- EGREP=$ac_cv_prog_egrep
+
+
+   fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
 
 
 
-echo "$as_me:$LINENO: checking for AIX" >&5
-echo $ECHO_N "checking for AIX... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for AIX" >&5
+echo $ECHO_N "checking for AIX... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -3949,15 +4562,15 @@ cat >>conftest.$ac_ext <<_ACEOF
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
   $EGREP "yes" >/dev/null 2>&1; then
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
 cat >>confdefs.h <<\_ACEOF
 #define _ALL_SOURCE 1
 _ACEOF
 
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 rm -f conftest*
 
@@ -3970,8 +4583,8 @@ _ACEOF
 
 
 ### Use -Wno-pointer-sign if the compiler supports it
-echo "$as_me:$LINENO: checking whether gcc understands -Wno-pointer-sign" >&5
-echo $ECHO_N "checking whether gcc understands -Wno-pointer-sign... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking whether gcc understands -Wno-pointer-sign" >&5
+echo $ECHO_N "checking whether gcc understands -Wno-pointer-sign... $ECHO_C" >&6; }
 SAVE_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS -Wno-pointer-sign"
 cat >conftest.$ac_ext <<_ACEOF
@@ -3990,55 +4603,51 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   has_option=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-has_option=no
+       has_option=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 if test $has_option = yes; then
    C_WARNINGS_SWITCH="-Wno-pointer-sign $C_WARNINGS_SWITCH"
 fi
-echo "$as_me:$LINENO: result: $has_option" >&5
-echo "${ECHO_T}$has_option" >&6
+echo "$as_me:$LINENO: result: $has_option" >&5
+echo "${ECHO_T}$has_option" >&6; }
 CFLAGS="$SAVE_CFLAGS"
 unset has_option
 unset SAVE_CFLAGS
 
 #### Some other nice autoconf tests.
 
-echo "$as_me:$LINENO: checking whether ln -s works" >&5
-echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking whether ln -s works" >&5
+echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; }
 LN_S=$as_ln_s
 if test "$LN_S" = "ln -s"; then
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
 else
-  echo "$as_me:$LINENO: result: no, using $LN_S" >&5
-echo "${ECHO_T}no, using $LN_S" >&6
+  echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+echo "${ECHO_T}no, using $LN_S" >&6; }
 fi
 
 ac_ext=c
@@ -4046,8 +4655,8 @@ ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
-echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -4081,24 +4690,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 #endif
                     Syntax error
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   :
 else
   echo "$as_me: failed program was:" >&5
@@ -4107,9 +4714,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
   # Broken: fails on valid input.
 continue
 fi
+
 rm -f conftest.err conftest.$ac_ext
 
-  # OK, works on sane cases.  Now check whether non-existent headers
+  # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -4119,24 +4727,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   # Broken: success on invalid input.
 continue
 else
@@ -4147,6 +4753,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 ac_preproc_ok=:
 break
 fi
+
 rm -f conftest.err conftest.$ac_ext
 
 done
@@ -4164,8 +4771,8 @@ fi
 else
   ac_cv_prog_CPP=$CPP
 fi
-echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6
+echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6; }
 ac_preproc_ok=false
 for ac_c_preproc_warn_flag in '' yes
 do
@@ -4188,24 +4795,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 #endif
                     Syntax error
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   :
 else
   echo "$as_me: failed program was:" >&5
@@ -4214,9 +4819,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
   # Broken: fails on valid input.
 continue
 fi
+
 rm -f conftest.err conftest.$ac_ext
 
-  # OK, works on sane cases.  Now check whether non-existent headers
+  # OK, works on sane cases.  Now check whether nonexistent headers
   # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -4226,24 +4832,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   # Broken: success on invalid input.
 continue
 else
@@ -4254,6 +4858,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
 ac_preproc_ok=:
 break
 fi
+
 rm -f conftest.err conftest.$ac_ext
 
 done
@@ -4288,8 +4893,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # OS/2's system install, which has a completely different semantic
 # ./install, which can be erroneously created by make from ./install.sh.
-echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
 if test -z "$INSTALL"; then
 if test "${ac_cv_path_install+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -4311,7 +4916,7 @@ case $as_dir/ in
     # by default.
     for ac_prog in ginstall scoinst install; do
       for ac_exec_ext in '' $ac_executable_extensions; do
-       if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+       if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
          if test $ac_prog = install &&
            grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
            # AIX install.  It has an incompatible calling convention.
@@ -4330,21 +4935,22 @@ case $as_dir/ in
     ;;
 esac
 done
+IFS=$as_save_IFS
 
 
 fi
   if test "${ac_cv_path_install+set}" = set; then
     INSTALL=$ac_cv_path_install
   else
-    # As a last resort, use the slow shell script.  We don't cache a
-    # path for INSTALL within a source directory, because that will
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for INSTALL within a source directory, because that will
     # break other packages using the cache if that directory is
-    # removed, or if the path is relative.
+    # removed, or if the value is a relative name.
     INSTALL=$ac_install_sh
   fi
 fi
-echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6; }
 
 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
 # It thinks the first close brace ends the variable substitution.
@@ -4358,8 +4964,8 @@ if test "x$RANLIB" = x; then
   if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_RANLIB+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -4372,32 +4978,34 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
 fi
 fi
 RANLIB=$ac_cv_prog_RANLIB
 if test -n "$RANLIB"; then
-  echo "$as_me:$LINENO: result: $RANLIB" >&5
-echo "${ECHO_T}$RANLIB" >&6
+  echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 fi
 if test -z "$ac_cv_prog_RANLIB"; then
   ac_ct_RANLIB=$RANLIB
   # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -4410,27 +5018,41 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_ac_ct_RANLIB="ranlib"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
-  test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
 fi
 fi
 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
 if test -n "$ac_ct_RANLIB"; then
-  echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
-echo "${ECHO_T}$ac_ct_RANLIB" >&6
+  echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-  RANLIB=$ac_ct_RANLIB
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
 else
   RANLIB="$ac_cv_prog_RANLIB"
 fi
@@ -4438,8 +5060,8 @@ fi
 fi
 # Extract the first word of "install-info", so it can be a program name with args.
 set dummy install-info; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_path_INSTALL_INFO+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -4454,31 +5076,32 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_INSTALL_INFO="$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
 
   ;;
 esac
 fi
 INSTALL_INFO=$ac_cv_path_INSTALL_INFO
-
 if test -n "$INSTALL_INFO"; then
-  echo "$as_me:$LINENO: result: $INSTALL_INFO" >&5
-echo "${ECHO_T}$INSTALL_INFO" >&6
+  echo "$as_me:$LINENO: result: $INSTALL_INFO" >&5
+echo "${ECHO_T}$INSTALL_INFO" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 # Extract the first word of "install-info", so it can be a program name with args.
 set dummy install-info; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_path_INSTALL_INFO+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -4493,31 +5116,32 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_INSTALL_INFO="$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
 
   ;;
 esac
 fi
 INSTALL_INFO=$ac_cv_path_INSTALL_INFO
-
 if test -n "$INSTALL_INFO"; then
-  echo "$as_me:$LINENO: result: $INSTALL_INFO" >&5
-echo "${ECHO_T}$INSTALL_INFO" >&6
+  echo "$as_me:$LINENO: result: $INSTALL_INFO" >&5
+echo "${ECHO_T}$INSTALL_INFO" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 # Extract the first word of "install-info", so it can be a program name with args.
 set dummy install-info; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_path_INSTALL_INFO+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -4532,32 +5156,33 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_INSTALL_INFO="$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
 
   test -z "$ac_cv_path_INSTALL_INFO" && ac_cv_path_INSTALL_INFO=":"
   ;;
 esac
 fi
 INSTALL_INFO=$ac_cv_path_INSTALL_INFO
-
 if test -n "$INSTALL_INFO"; then
-  echo "$as_me:$LINENO: result: $INSTALL_INFO" >&5
-echo "${ECHO_T}$INSTALL_INFO" >&6
+  echo "$as_me:$LINENO: result: $INSTALL_INFO" >&5
+echo "${ECHO_T}$INSTALL_INFO" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
 # Extract the first word of "gzip", so it can be a program name with args.
 set dummy gzip; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_path_GZIP_PROG+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -4572,29 +5197,30 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_path_GZIP_PROG="$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
 
   ;;
 esac
 fi
 GZIP_PROG=$ac_cv_path_GZIP_PROG
-
 if test -n "$GZIP_PROG"; then
-  echo "$as_me:$LINENO: result: $GZIP_PROG" >&5
-echo "${ECHO_T}$GZIP_PROG" >&6
+  echo "$as_me:$LINENO: result: $GZIP_PROG" >&5
+echo "${ECHO_T}$GZIP_PROG" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
 
 
+
 if test x$GCC = xyes && test "x$GCC_LINK_TEST_OPTIONS" != x
 then
   ac_link="$ac_link $GCC_LINK_TEST_OPTIONS"
@@ -4613,44 +5239,41 @@ else
   LDFLAGS="$LDFLAGS -znocombreloc"
 fi
 
-echo "$as_me:$LINENO: checking for -znocombreloc" >&5
-echo $ECHO_N "checking for -znocombreloc... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for -znocombreloc" >&5
+echo $ECHO_N "checking for -znocombreloc... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 main(){return 0;}
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+  (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
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-LDFLAGS=$late_LDFLAGS
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+       LDFLAGS=$late_LDFLAGS
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 
 #### Extract some information from the operating system and machine files.
@@ -4804,15 +5427,15 @@ fi
 
 
 
-# Check whether --enable-largefile or --disable-largefile was given.
+# Check whether --enable-largefile was given.
 if test "${enable_largefile+set}" = set; then
-  enableval="$enable_largefile"
+  enableval=$enable_largefile;
+fi
 
-fi;
 if test "$enable_largefile" != no; then
 
-  echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5
-echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5
+echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6; }
 if test "${ac_cv_sys_largefile_CC+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -4820,8 +5443,8 @@ else
      if test "$GCC" != yes; then
        ac_save_CC=$CC
        while :; do
-        # IRIX 6.2 and later do not support large files by default,
-        # so use the C compiler's -n32 option if that helps.
+        # IRIX 6.2 and later do not support large files by default,
+        # so use the C compiler's -n32 option if that helps.
         cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -4845,84 +5468,77 @@ main ()
   return 0;
 }
 _ACEOF
-        rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+        rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext
-        CC="$CC -n32"
-        rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+
+rm -f core conftest.err conftest.$ac_objext
+        CC="$CC -n32"
+        rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_sys_largefile_CC=' -n32'; break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext
+
+rm -f core conftest.err conftest.$ac_objext
         break
        done
        CC=$ac_save_CC
        rm -f conftest.$ac_ext
     fi
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5
-echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
+echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5
+echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6; }
   if test "$ac_cv_sys_largefile_CC" != no; then
     CC=$CC$ac_cv_sys_largefile_CC
   fi
 
-  echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5
-echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5
+echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6; }
 if test "${ac_cv_sys_file_offset_bits+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   while :; do
-  ac_cv_sys_file_offset_bits=no
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -4947,34 +5563,31 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  break
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_sys_file_offset_bits=no; break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -5000,54 +5613,53 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_sys_file_offset_bits=64; break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  ac_cv_sys_file_offset_bits=unknown
   break
 done
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5
-echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
-if test "$ac_cv_sys_file_offset_bits" != no; then
-
+{ echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5
+echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6; }
+case $ac_cv_sys_file_offset_bits in #(
+  no | unknown) ;;
+  *)
 cat >>confdefs.h <<_ACEOF
 #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
 _ACEOF
-
-fi
+;;
+esac
 rm -f conftest*
-  echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5
-echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
+  if test $ac_cv_sys_file_offset_bits = unknown; then
+    { echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5
+echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6; }
 if test "${ac_cv_sys_large_files+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   while :; do
-  ac_cv_sys_large_files=no
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -5072,34 +5684,31 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  break
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_sys_large_files=no; break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -5125,47 +5734,47 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_sys_large_files=1; break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  ac_cv_sys_large_files=unknown
   break
 done
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5
-echo "${ECHO_T}$ac_cv_sys_large_files" >&6
-if test "$ac_cv_sys_large_files" != no; then
-
+{ echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5
+echo "${ECHO_T}$ac_cv_sys_large_files" >&6; }
+case $ac_cv_sys_large_files in #(
+  no | unknown) ;;
+  *)
 cat >>confdefs.h <<_ACEOF
 #define _LARGE_FILES $ac_cv_sys_large_files
 _ACEOF
-
-fi
+;;
+esac
 rm -f conftest*
+  fi
 fi
 
 
@@ -5188,8 +5797,8 @@ esac
 
 if test "${with_sound}" != "no"; then
   # Sound support for GNU/Linux and the free BSDs.
-  echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
 if test "${ac_cv_header_stdc+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -5213,35 +5822,31 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_header_stdc=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_header_stdc=no
+       ac_cv_header_stdc=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
@@ -5297,6 +5902,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <ctype.h>
+#include <stdlib.h>
 #if ((' ' & 0x0FF) == 0x020)
 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
@@ -5316,18 +5922,27 @@ main ()
   for (i = 0; i < 256; i++)
     if (XOR (islower (i), ISLOWER (i))
        || toupper (i) != TOUPPER (i))
-      exit(2);
-  exit (0);
+      return 2;
+  return 0;
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+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>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (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_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -5340,12 +5955,14 @@ sed 's/^/| /' conftest.$ac_ext >&5
 ( exit $ac_status )
 ac_cv_header_stdc=no
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
+
+
 fi
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
 if test $ac_cv_header_stdc = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -5368,9 +5985,9 @@ for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
                  inttypes.h stdint.h unistd.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -5384,38 +6001,35 @@ $ac_includes_default
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   eval "$as_ac_Header=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_Header=no"
+       eval "$as_ac_Header=no"
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
@@ -5432,18 +6046,19 @@ done
 for ac_header in machine/soundcard.h sys/soundcard.h soundcard.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -5454,41 +6069,37 @@ $ac_includes_default
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f 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.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -5497,24 +6108,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -5522,9 +6131,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -5548,25 +6158,19 @@ echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
@@ -5579,8 +6183,8 @@ fi
 done
 
   # Emulation library used on NetBSD.
-  echo "$as_me:$LINENO: checking for _oss_ioctl in -lossaudio" >&5
-echo $ECHO_N "checking for _oss_ioctl in -lossaudio... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for _oss_ioctl in -lossaudio" >&5
+echo $ECHO_N "checking for _oss_ioctl in -lossaudio... $ECHO_C" >&6; }
 if test "${ac_cv_lib_ossaudio__oss_ioctl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -5593,56 +6197,53 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char _oss_ioctl ();
 int
 main ()
 {
-_oss_ioctl ();
+return _oss_ioctl ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_ossaudio__oss_ioctl=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_ossaudio__oss_ioctl=no
+       ac_cv_lib_ossaudio__oss_ioctl=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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_ossaudio__oss_ioctl" >&5
-echo "${ECHO_T}$ac_cv_lib_ossaudio__oss_ioctl" >&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_ossaudio__oss_ioctl" >&5
+echo "${ECHO_T}$ac_cv_lib_ossaudio__oss_ioctl" >&6; }
 if test $ac_cv_lib_ossaudio__oss_ioctl = yes; then
   LIBSOUND=-lossaudio
 else
@@ -5662,8 +6263,8 @@ fi
   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
+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
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -5678,28 +6279,29 @@ do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  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
 
   test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
   ;;
 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
+  echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+echo "${ECHO_T}$PKG_CONFIG" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
   fi
 
   if test "$PKG_CONFIG" = "no" ; then
@@ -5707,28 +6309,28 @@ fi
   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 $ALSA_MODULES" >&5
-echo $ECHO_N "checking for $ALSA_MODULES... $ECHO_C" >&6
+        echo "$as_me:$LINENO: checking for $ALSA_MODULES" >&5
+echo $ECHO_N "checking for $ALSA_MODULES... $ECHO_C" >&6; }
 
         if $PKG_CONFIG --exists "$ALSA_MODULES" 2>&5; then
-            echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+            echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
             succeeded=yes
 
-            echo "$as_me:$LINENO: checking ALSA_CFLAGS" >&5
-echo $ECHO_N "checking ALSA_CFLAGS... $ECHO_C" >&6
+            echo "$as_me:$LINENO: checking ALSA_CFLAGS" >&5
+echo $ECHO_N "checking ALSA_CFLAGS... $ECHO_C" >&6; }
             ALSA_CFLAGS=`$PKG_CONFIG --cflags "$ALSA_MODULES"`
-            echo "$as_me:$LINENO: result: $ALSA_CFLAGS" >&5
-echo "${ECHO_T}$ALSA_CFLAGS" >&6
+            echo "$as_me:$LINENO: result: $ALSA_CFLAGS" >&5
+echo "${ECHO_T}$ALSA_CFLAGS" >&6; }
 
-            echo "$as_me:$LINENO: checking ALSA_LIBS" >&5
-echo $ECHO_N "checking ALSA_LIBS... $ECHO_C" >&6
+            echo "$as_me:$LINENO: checking ALSA_LIBS" >&5
+echo $ECHO_N "checking ALSA_LIBS... $ECHO_C" >&6; }
             ALSA_LIBS=`$PKG_CONFIG --libs "$ALSA_MODULES"`
-            echo "$as_me:$LINENO: result: $ALSA_LIBS" >&5
-echo "${ECHO_T}$ALSA_LIBS" >&6
+            echo "$as_me:$LINENO: result: $ALSA_LIBS" >&5
+echo "${ECHO_T}$ALSA_LIBS" >&6; }
         else
-            echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+            echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
             ALSA_CFLAGS=""
             ALSA_LIBS=""
             ## If we have a custom action on failure, don't print errors, but
@@ -5795,18 +6397,19 @@ for ac_header in sys/select.h sys/timeb.h sys/time.h unistd.h utime.h \
   sys/utsname.h pwd.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -5817,41 +6420,37 @@ $ac_includes_default
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f 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.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -5860,24 +6459,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -5885,9 +6482,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -5911,25 +6509,19 @@ echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
@@ -5942,8 +6534,8 @@ fi
 done
 
 
-echo "$as_me:$LINENO: checking if personality LINUX32 can be set" >&5
-echo $ECHO_N "checking if personality LINUX32 can be set... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking if personality LINUX32 can be set" >&5
+echo $ECHO_N "checking if personality LINUX32 can be set... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -5960,37 +6552,33 @@ personality (PER_LINUX32)
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   emacs_cv_personality_linux32=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-emacs_cv_personality_linux32=no
+       emacs_cv_personality_linux32=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $emacs_cv_personality_linux32" >&5
-echo "${ECHO_T}$emacs_cv_personality_linux32" >&6
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $emacs_cv_personality_linux32" >&5
+echo "${ECHO_T}$emacs_cv_personality_linux32" >&6; }
 
 if test $emacs_cv_personality_linux32 = yes; then
 
@@ -6004,9 +6592,9 @@ fi
 for ac_header in term.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -6017,24 +6605,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   eval "$as_ac_Header=yes"
 else
   echo "$as_me: failed program was:" >&5
@@ -6042,10 +6628,12 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   eval "$as_ac_Header=no"
 fi
+
 rm -f conftest.err conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
@@ -6055,8 +6643,8 @@ fi
 
 done
 
-echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
 if test "${ac_cv_header_stdc+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -6080,35 +6668,31 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_header_stdc=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_header_stdc=no
+       ac_cv_header_stdc=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
@@ -6164,6 +6748,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <ctype.h>
+#include <stdlib.h>
 #if ((' ' & 0x0FF) == 0x020)
 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
@@ -6183,18 +6768,27 @@ main ()
   for (i = 0; i < 256; i++)
     if (XOR (islower (i), ISLOWER (i))
        || toupper (i) != TOUPPER (i))
-      exit(2);
-  exit (0);
+      return 2;
+  return 0;
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+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>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (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_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -6207,12 +6801,14 @@ sed 's/^/| /' conftest.$ac_ext >&5
 ( exit $ac_status )
 ac_cv_header_stdc=no
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
+
+
 fi
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
 if test $ac_cv_header_stdc = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -6221,8 +6817,8 @@ _ACEOF
 
 fi
 
-echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
-echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
+echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; }
 if test "${ac_cv_header_time+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -6246,38 +6842,34 @@ return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_header_time=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_header_time=no
+       ac_cv_header_time=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
-echo "${ECHO_T}$ac_cv_header_time" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
+echo "${ECHO_T}$ac_cv_header_time" >&6; }
 if test $ac_cv_header_time = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -6286,8 +6878,8 @@ _ACEOF
 
 fi
 
-echo "$as_me:$LINENO: checking whether sys_siglist is declared" >&5
-echo $ECHO_N "checking whether sys_siglist is declared... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking whether sys_siglist is declared" >&5
+echo $ECHO_N "checking whether sys_siglist is declared... $ECHO_C" >&6; }
 if test "${ac_cv_have_decl_sys_siglist+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -6302,7 +6894,7 @@ int
 main ()
 {
 #ifndef sys_siglist
-  char *p = (char *) sys_siglist;
+  (void) sys_siglist;
 #endif
 
   ;
@@ -6310,38 +6902,34 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_have_decl_sys_siglist=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_have_decl_sys_siglist=no
+       ac_cv_have_decl_sys_siglist=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_decl_sys_siglist" >&5
-echo "${ECHO_T}$ac_cv_have_decl_sys_siglist" >&6
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_sys_siglist" >&5
+echo "${ECHO_T}$ac_cv_have_decl_sys_siglist" >&6; }
 if test $ac_cv_have_decl_sys_siglist = yes; then
 
 cat >>confdefs.h <<_ACEOF
@@ -6360,8 +6948,8 @@ fi
 
 if test $ac_cv_have_decl_sys_siglist != yes; then
   # For Tru64, at least:
-  echo "$as_me:$LINENO: checking whether __sys_siglist is declared" >&5
-echo $ECHO_N "checking whether __sys_siglist is declared... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking whether __sys_siglist is declared" >&5
+echo $ECHO_N "checking whether __sys_siglist is declared... $ECHO_C" >&6; }
 if test "${ac_cv_have_decl___sys_siglist+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -6376,7 +6964,7 @@ int
 main ()
 {
 #ifndef __sys_siglist
-  char *p = (char *) __sys_siglist;
+  (void) __sys_siglist;
 #endif
 
   ;
@@ -6384,38 +6972,34 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_have_decl___sys_siglist=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_have_decl___sys_siglist=no
+       ac_cv_have_decl___sys_siglist=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_decl___sys_siglist" >&5
-echo "${ECHO_T}$ac_cv_have_decl___sys_siglist" >&6
+echo "$as_me:$LINENO: result: $ac_cv_have_decl___sys_siglist" >&5
+echo "${ECHO_T}$ac_cv_have_decl___sys_siglist" >&6; }
 if test $ac_cv_have_decl___sys_siglist = yes; then
 
 cat >>confdefs.h <<_ACEOF
@@ -6440,8 +7024,8 @@ _ACEOF
 
   fi
 fi
-echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5
-echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6; }
 if test "${ac_cv_header_sys_wait_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -6454,7 +7038,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include <sys/types.h>
 #include <sys/wait.h>
 #ifndef WEXITSTATUS
-# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
+# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8)
 #endif
 #ifndef WIFEXITED
 # define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
@@ -6471,38 +7055,34 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_header_sys_wait_h=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_header_sys_wait_h=no
+       ac_cv_header_sys_wait_h=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5
-echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6; }
 if test $ac_cv_header_sys_wait_h = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -6512,8 +7092,8 @@ _ACEOF
 fi
 
 
-echo "$as_me:$LINENO: checking for struct utimbuf" >&5
-echo $ECHO_N "checking for struct utimbuf... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for struct utimbuf" >&5
+echo $ECHO_N "checking for struct utimbuf... $ECHO_C" >&6; }
 if test "${emacs_cv_struct_utimbuf+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -6545,38 +7125,34 @@ static struct utimbuf x; x.actime = x.modtime;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   emacs_cv_struct_utimbuf=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-emacs_cv_struct_utimbuf=no
+       emacs_cv_struct_utimbuf=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $emacs_cv_struct_utimbuf" >&5
-echo "${ECHO_T}$emacs_cv_struct_utimbuf" >&6
+echo "$as_me:$LINENO: result: $emacs_cv_struct_utimbuf" >&5
+echo "${ECHO_T}$emacs_cv_struct_utimbuf" >&6; }
 if test $emacs_cv_struct_utimbuf = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -6585,8 +7161,8 @@ _ACEOF
 
 fi
 
-echo "$as_me:$LINENO: checking return type of signal handlers" >&5
-echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking return type of signal handlers" >&5
+echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; }
 if test "${ac_cv_type_signal+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -6598,56 +7174,44 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <sys/types.h>
 #include <signal.h>
-#ifdef signal
-# undef signal
-#endif
-#ifdef __cplusplus
-extern "C" void (*signal (int, void (*)(int)))(int);
-#else
-void (*signal ()) ();
-#endif
 
 int
 main ()
 {
-int i;
+return *(signal (0, 0)) (0) == 1;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_type_signal=void
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_type_signal=int
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_signal=int
+       ac_cv_type_signal=void
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
-echo "${ECHO_T}$ac_cv_type_signal" >&6
+echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
+echo "${ECHO_T}$ac_cv_type_signal" >&6; }
 
 cat >>confdefs.h <<_ACEOF
 #define RETSIGTYPE $ac_cv_type_signal
@@ -6655,8 +7219,8 @@ _ACEOF
 
 
 
-echo "$as_me:$LINENO: checking for speed_t" >&5
-echo $ECHO_N "checking for speed_t... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for speed_t" >&5
+echo $ECHO_N "checking for speed_t... $ECHO_C" >&6; }
 if test "${emacs_cv_speed_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -6676,38 +7240,34 @@ speed_t x = 1;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   emacs_cv_speed_t=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-emacs_cv_speed_t=no
+       emacs_cv_speed_t=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $emacs_cv_speed_t" >&5
-echo "${ECHO_T}$emacs_cv_speed_t" >&6
+echo "$as_me:$LINENO: result: $emacs_cv_speed_t" >&5
+echo "${ECHO_T}$emacs_cv_speed_t" >&6; }
 if test $emacs_cv_speed_t = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -6716,8 +7276,8 @@ _ACEOF
 
 fi
 
-echo "$as_me:$LINENO: checking for struct timeval" >&5
-echo $ECHO_N "checking for struct timeval... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for struct timeval" >&5
+echo $ECHO_N "checking for struct timeval... $ECHO_C" >&6; }
 if test "${emacs_cv_struct_timeval+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -6746,38 +7306,34 @@ static struct timeval x; x.tv_sec = x.tv_usec;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   emacs_cv_struct_timeval=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-emacs_cv_struct_timeval=no
+       emacs_cv_struct_timeval=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $emacs_cv_struct_timeval" >&5
-echo "${ECHO_T}$emacs_cv_struct_timeval" >&6
+echo "$as_me:$LINENO: result: $emacs_cv_struct_timeval" >&5
+echo "${ECHO_T}$emacs_cv_struct_timeval" >&6; }
 HAVE_TIMEVAL=$emacs_cv_struct_timeval
 if test $emacs_cv_struct_timeval = yes; then
 
@@ -6787,8 +7343,8 @@ _ACEOF
 
 fi
 
-echo "$as_me:$LINENO: checking for struct exception" >&5
-echo $ECHO_N "checking for struct exception... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for struct exception" >&5
+echo $ECHO_N "checking for struct exception... $ECHO_C" >&6; }
 if test "${emacs_cv_struct_exception+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -6808,38 +7364,34 @@ static struct exception x; x.arg1 = x.arg2 = x.retval; x.name = ""; x.type = 1;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   emacs_cv_struct_exception=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-emacs_cv_struct_exception=no
+       emacs_cv_struct_exception=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $emacs_cv_struct_exception" >&5
-echo "${ECHO_T}$emacs_cv_struct_exception" >&6
+echo "$as_me:$LINENO: result: $emacs_cv_struct_exception" >&5
+echo "${ECHO_T}$emacs_cv_struct_exception" >&6; }
 HAVE_EXCEPTION=$emacs_cv_struct_exception
 if test $emacs_cv_struct_exception != yes; then
 
@@ -6853,18 +7405,19 @@ fi
 for ac_header in sys/socket.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -6875,41 +7428,37 @@ $ac_includes_default
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f 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.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -6918,24 +7467,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -6943,9 +7490,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -6969,25 +7517,19 @@ echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
@@ -7003,9 +7545,9 @@ done
 for ac_header in net/if.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -7022,38 +7564,35 @@ $ac_includes_default
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   eval "$as_ac_Header=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_Header=no"
+       eval "$as_ac_Header=no"
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
@@ -7064,8 +7603,8 @@ fi
 done
 
 
-echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5
-echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5
+echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6; }
 if test "${ac_cv_struct_tm+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -7081,44 +7620,42 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-struct tm *tp; tp->tm_sec;
+struct tm tm;
+                                    int *p = &tm.tm_sec;
+                                    return !p;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_struct_tm=time.h
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_struct_tm=sys/time.h
+       ac_cv_struct_tm=sys/time.h
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5
-echo "${ECHO_T}$ac_cv_struct_tm" >&6
+echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5
+echo "${ECHO_T}$ac_cv_struct_tm" >&6; }
 if test $ac_cv_struct_tm = sys/time.h; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -7127,8 +7664,8 @@ _ACEOF
 
 fi
 
-echo "$as_me:$LINENO: checking for struct tm.tm_zone" >&5
-echo $ECHO_N "checking for struct tm.tm_zone... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for struct tm.tm_zone" >&5
+echo $ECHO_N "checking for struct tm.tm_zone... $ECHO_C" >&6; }
 if test "${ac_cv_member_struct_tm_tm_zone+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -7153,33 +7690,28 @@ return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_tm_tm_zone=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >conftest.$ac_ext <<_ACEOF
+       cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -7200,40 +7732,37 @@ return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_tm_tm_zone=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_member_struct_tm_tm_zone=no
+       ac_cv_member_struct_tm_tm_zone=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5
-echo "${ECHO_T}$ac_cv_member_struct_tm_tm_zone" >&6
+echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5
+echo "${ECHO_T}$ac_cv_member_struct_tm_tm_zone" >&6; }
 if test $ac_cv_member_struct_tm_tm_zone = yes; then
 
 cat >>confdefs.h <<_ACEOF
@@ -7250,8 +7779,77 @@ cat >>confdefs.h <<\_ACEOF
 _ACEOF
 
 else
-  echo "$as_me:$LINENO: checking for tzname" >&5
-echo $ECHO_N "checking for tzname... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking whether tzname is declared" >&5
+echo $ECHO_N "checking whether tzname is declared... $ECHO_C" >&6; }
+if test "${ac_cv_have_decl_tzname+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 <time.h>
+
+int
+main ()
+{
+#ifndef tzname
+  (void) tzname;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+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
+  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_cv_have_decl_tzname=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_have_decl_tzname=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_tzname" >&5
+echo "${ECHO_T}$ac_cv_have_decl_tzname" >&6; }
+if test $ac_cv_have_decl_tzname = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_TZNAME 1
+_ACEOF
+
+
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_TZNAME 0
+_ACEOF
+
+
+fi
+
+
+  { echo "$as_me:$LINENO: checking for tzname" >&5
+echo $ECHO_N "checking for tzname... $ECHO_C" >&6; }
 if test "${ac_cv_var_tzname+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -7262,52 +7860,49 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <time.h>
-#ifndef tzname /* For SGI.  */
-extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
+#if !HAVE_DECL_TZNAME
+extern char *tzname[];
 #endif
 
 int
 main ()
 {
-atoi(*tzname);
+return tzname[0][0];
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_var_tzname=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_var_tzname=no
+       ac_cv_var_tzname=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5
-echo "${ECHO_T}$ac_cv_var_tzname" >&6
+echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5
+echo "${ECHO_T}$ac_cv_var_tzname" >&6; }
   if test $ac_cv_var_tzname = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -7317,8 +7912,8 @@ _ACEOF
   fi
 fi
 
-echo "$as_me:$LINENO: checking for struct tm.tm_gmtoff" >&5
-echo $ECHO_N "checking for struct tm.tm_gmtoff... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for struct tm.tm_gmtoff" >&5
+echo $ECHO_N "checking for struct tm.tm_gmtoff... $ECHO_C" >&6; }
 if test "${ac_cv_member_struct_tm_tm_gmtoff+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -7341,33 +7936,28 @@ return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_tm_tm_gmtoff=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >conftest.$ac_ext <<_ACEOF
+       cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -7386,40 +7976,37 @@ return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_tm_tm_gmtoff=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_member_struct_tm_tm_gmtoff=no
+       ac_cv_member_struct_tm_tm_gmtoff=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_gmtoff" >&5
-echo "${ECHO_T}$ac_cv_member_struct_tm_tm_gmtoff" >&6
+echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_gmtoff" >&5
+echo "${ECHO_T}$ac_cv_member_struct_tm_tm_gmtoff" >&6; }
 if test $ac_cv_member_struct_tm_tm_gmtoff = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -7428,8 +8015,8 @@ _ACEOF
 
 fi
 
-echo "$as_me:$LINENO: checking for struct ifreq.ifr_flags" >&5
-echo $ECHO_N "checking for struct ifreq.ifr_flags... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for struct ifreq.ifr_flags" >&5
+echo $ECHO_N "checking for struct ifreq.ifr_flags... $ECHO_C" >&6; }
 if test "${ac_cv_member_struct_ifreq_ifr_flags+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -7458,33 +8045,28 @@ return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_ifreq_ifr_flags=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >conftest.$ac_ext <<_ACEOF
+       cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -7509,40 +8091,37 @@ return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_ifreq_ifr_flags=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_member_struct_ifreq_ifr_flags=no
+       ac_cv_member_struct_ifreq_ifr_flags=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_member_struct_ifreq_ifr_flags" >&5
-echo "${ECHO_T}$ac_cv_member_struct_ifreq_ifr_flags" >&6
+echo "$as_me:$LINENO: result: $ac_cv_member_struct_ifreq_ifr_flags" >&5
+echo "${ECHO_T}$ac_cv_member_struct_ifreq_ifr_flags" >&6; }
 if test $ac_cv_member_struct_ifreq_ifr_flags = yes; then
 
 cat >>confdefs.h <<_ACEOF
@@ -7551,8 +8130,8 @@ _ACEOF
 
 
 fi
-echo "$as_me:$LINENO: checking for struct ifreq.ifr_hwaddr" >&5
-echo $ECHO_N "checking for struct ifreq.ifr_hwaddr... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for struct ifreq.ifr_hwaddr" >&5
+echo $ECHO_N "checking for struct ifreq.ifr_hwaddr... $ECHO_C" >&6; }
 if test "${ac_cv_member_struct_ifreq_ifr_hwaddr+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -7581,33 +8160,28 @@ return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_ifreq_ifr_hwaddr=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >conftest.$ac_ext <<_ACEOF
+       cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -7632,40 +8206,37 @@ return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_ifreq_ifr_hwaddr=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_member_struct_ifreq_ifr_hwaddr=no
+       ac_cv_member_struct_ifreq_ifr_hwaddr=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_member_struct_ifreq_ifr_hwaddr" >&5
-echo "${ECHO_T}$ac_cv_member_struct_ifreq_ifr_hwaddr" >&6
+echo "$as_me:$LINENO: result: $ac_cv_member_struct_ifreq_ifr_hwaddr" >&5
+echo "${ECHO_T}$ac_cv_member_struct_ifreq_ifr_hwaddr" >&6; }
 if test $ac_cv_member_struct_ifreq_ifr_hwaddr = yes; then
 
 cat >>confdefs.h <<_ACEOF
@@ -7674,8 +8245,8 @@ _ACEOF
 
 
 fi
-echo "$as_me:$LINENO: checking for struct ifreq.ifr_netmask" >&5
-echo $ECHO_N "checking for struct ifreq.ifr_netmask... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for struct ifreq.ifr_netmask" >&5
+echo $ECHO_N "checking for struct ifreq.ifr_netmask... $ECHO_C" >&6; }
 if test "${ac_cv_member_struct_ifreq_ifr_netmask+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -7704,33 +8275,28 @@ return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_ifreq_ifr_netmask=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >conftest.$ac_ext <<_ACEOF
+       cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -7755,40 +8321,37 @@ return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_ifreq_ifr_netmask=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_member_struct_ifreq_ifr_netmask=no
+       ac_cv_member_struct_ifreq_ifr_netmask=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_member_struct_ifreq_ifr_netmask" >&5
-echo "${ECHO_T}$ac_cv_member_struct_ifreq_ifr_netmask" >&6
+echo "$as_me:$LINENO: result: $ac_cv_member_struct_ifreq_ifr_netmask" >&5
+echo "${ECHO_T}$ac_cv_member_struct_ifreq_ifr_netmask" >&6; }
 if test $ac_cv_member_struct_ifreq_ifr_netmask = yes; then
 
 cat >>confdefs.h <<_ACEOF
@@ -7797,8 +8360,8 @@ _ACEOF
 
 
 fi
-echo "$as_me:$LINENO: checking for struct ifreq.ifr_broadaddr" >&5
-echo $ECHO_N "checking for struct ifreq.ifr_broadaddr... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for struct ifreq.ifr_broadaddr" >&5
+echo $ECHO_N "checking for struct ifreq.ifr_broadaddr... $ECHO_C" >&6; }
 if test "${ac_cv_member_struct_ifreq_ifr_broadaddr+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -7827,33 +8390,28 @@ return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_ifreq_ifr_broadaddr=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >conftest.$ac_ext <<_ACEOF
+       cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -7878,40 +8436,37 @@ return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_ifreq_ifr_broadaddr=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_member_struct_ifreq_ifr_broadaddr=no
+       ac_cv_member_struct_ifreq_ifr_broadaddr=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_member_struct_ifreq_ifr_broadaddr" >&5
-echo "${ECHO_T}$ac_cv_member_struct_ifreq_ifr_broadaddr" >&6
+echo "$as_me:$LINENO: result: $ac_cv_member_struct_ifreq_ifr_broadaddr" >&5
+echo "${ECHO_T}$ac_cv_member_struct_ifreq_ifr_broadaddr" >&6; }
 if test $ac_cv_member_struct_ifreq_ifr_broadaddr = yes; then
 
 cat >>confdefs.h <<_ACEOF
@@ -7920,8 +8475,8 @@ _ACEOF
 
 
 fi
-echo "$as_me:$LINENO: checking for struct ifreq.ifr_addr" >&5
-echo $ECHO_N "checking for struct ifreq.ifr_addr... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for struct ifreq.ifr_addr" >&5
+echo $ECHO_N "checking for struct ifreq.ifr_addr... $ECHO_C" >&6; }
 if test "${ac_cv_member_struct_ifreq_ifr_addr+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -7950,33 +8505,28 @@ return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_ifreq_ifr_addr=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >conftest.$ac_ext <<_ACEOF
+       cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -8001,40 +8551,37 @@ return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_ifreq_ifr_addr=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_member_struct_ifreq_ifr_addr=no
+       ac_cv_member_struct_ifreq_ifr_addr=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_member_struct_ifreq_ifr_addr" >&5
-echo "${ECHO_T}$ac_cv_member_struct_ifreq_ifr_addr" >&6
+echo "$as_me:$LINENO: result: $ac_cv_member_struct_ifreq_ifr_addr" >&5
+echo "${ECHO_T}$ac_cv_member_struct_ifreq_ifr_addr" >&6; }
 if test $ac_cv_member_struct_ifreq_ifr_addr = yes; then
 
 cat >>confdefs.h <<_ACEOF
@@ -8046,11 +8593,11 @@ fi
 
 
 
-echo "$as_me:$LINENO: checking for function prototypes" >&5
-echo $ECHO_N "checking for function prototypes... $ECHO_C" >&6
-if test "$ac_cv_prog_cc_stdc" != no; then
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+echo "$as_me:$LINENO: checking for function prototypes" >&5
+echo $ECHO_N "checking for function prototypes... $ECHO_C" >&6; }
+if test "$ac_cv_prog_cc_c89" != no; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
 #define PROTOTYPES 1
@@ -8062,12 +8609,12 @@ cat >>confdefs.h <<\_ACEOF
 _ACEOF
 
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-echo "$as_me:$LINENO: checking for working volatile" >&5
-echo $ECHO_N "checking for working volatile... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for working volatile" >&5
+echo $ECHO_N "checking for working volatile... $ECHO_C" >&6; }
 if test "${ac_cv_c_volatile+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -8083,44 +8630,41 @@ main ()
 {
 
 volatile int x;
-int * volatile y;
+int * volatile y = (int *) 0;
+return !x && !y;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_c_volatile=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_c_volatile=no
+       ac_cv_c_volatile=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_c_volatile" >&5
-echo "${ECHO_T}$ac_cv_c_volatile" >&6
+echo "$as_me:$LINENO: result: $ac_cv_c_volatile" >&5
+echo "${ECHO_T}$ac_cv_c_volatile" >&6; }
 if test $ac_cv_c_volatile = no; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -8129,8 +8673,8 @@ _ACEOF
 
 fi
 
-echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
-echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
+echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; }
 if test "${ac_cv_c_const+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -8148,10 +8692,10 @@ main ()
 #ifndef __cplusplus
   /* Ultrix mips cc rejects this.  */
   typedef int charset[2];
-  const charset x;
+  const charset cs;
   /* SunOS 4.1.1 cc rejects this.  */
-  char const *const *ccp;
-  char **p;
+  char const *const *pcpcc;
+  char **ppc;
   /* NEC SVR4.0.2 mips cc rejects this.  */
   struct point {int x, y;};
   static struct point const zero = {0,0};
@@ -8160,16 +8704,17 @@ main ()
      an arm of an if-expression whose if-part is not a constant
      expression */
   const char *g = "string";
-  ccp = &g + (g ? g-g : 0);
+  pcpcc = &g + (g ? g-g : 0);
   /* HPUX 7.0 cc rejects these. */
-  ++ccp;
-  p = (char**) ccp;
-  ccp = (char const *const *) p;
+  ++pcpcc;
+  ppc = (char**) pcpcc;
+  pcpcc = (char const *const *) ppc;
   { /* SCO 3.2v4 cc rejects this.  */
     char *t;
     char const *s = 0 ? (char *) 0 : (char const *) 0;
 
     *t++ = 0;
+    if (s) return 0;
   }
   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
     int x[] = {25, 17};
@@ -8188,7 +8733,9 @@ main ()
   }
   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
     const int foo = 10;
+    if (!foo) return 0;
   }
+  return !cs[0] && !zero.x;
 #endif
 
   ;
@@ -8196,38 +8743,34 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_c_const=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_c_const=no
+       ac_cv_c_const=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
-echo "${ECHO_T}$ac_cv_c_const" >&6
+echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
+echo "${ECHO_T}$ac_cv_c_const" >&6; }
 if test $ac_cv_c_const = no; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -8236,8 +8779,8 @@ _ACEOF
 
 fi
 
-echo "$as_me:$LINENO: checking for void * support" >&5
-echo $ECHO_N "checking for void * support... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for void * support" >&5
+echo $ECHO_N "checking for void * support... $ECHO_C" >&6; }
 if test "${emacs_cv_void_star+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -8257,38 +8800,34 @@ void * foo;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   emacs_cv_void_star=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-emacs_cv_void_star=no
+       emacs_cv_void_star=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $emacs_cv_void_star" >&5
-echo "${ECHO_T}$emacs_cv_void_star" >&6
+echo "$as_me:$LINENO: result: $emacs_cv_void_star" >&5
+echo "${ECHO_T}$emacs_cv_void_star" >&6; }
 if test $emacs_cv_void_star = yes; then
   cat >>confdefs.h <<\_ACEOF
 #define POINTER_TYPE void
@@ -8305,38 +8844,39 @@ fi
 
 
 
-echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
-if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; }
+set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
 all:
-       @echo 'ac_maketemp="$(MAKE)"'
+       @echo '@@@%%%=$(MAKE)=@@@%%%'
 _ACEOF
 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
-if test -n "$ac_maketemp"; then
-  eval ac_cv_prog_make_${ac_make}_set=yes
-else
-  eval ac_cv_prog_make_${ac_make}_set=no
-fi
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
 rm -f conftest.make
 fi
-if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
   SET_MAKE=
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
   SET_MAKE="MAKE=${MAKE-make}"
 fi
 
 
-echo "$as_me:$LINENO: checking for long file names" >&5
-echo $ECHO_N "checking for long file names... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for long file names" >&5
+echo $ECHO_N "checking for long file names... $ECHO_C" >&6; }
 if test "${ac_cv_sys_long_file_names+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -8345,37 +8885,30 @@ else
 #      .               the current directory, where building will happen
 #      $prefix/lib     where we will be installing things
 #      $exec_prefix/lib        likewise
-# eval it to expand exec_prefix.
 #      $TMPDIR         if set, where it might want to write temporary files
-# if $TMPDIR is not set:
 #      /tmp            where it might want to write temporary files
 #      /var/tmp                likewise
 #      /usr/tmp                likewise
-if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
-  ac_tmpdirs=$TMPDIR
-else
-  ac_tmpdirs='/tmp /var/tmp /usr/tmp'
-fi
-for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
-  test -d $ac_dir || continue
-  test -w $ac_dir || continue # It is less confusing to not echo anything here.
+for ac_dir in . "$TMPDIR" /tmp /var/tmp /usr/tmp "$prefix/lib" "$exec_prefix/lib"; do
+  # Skip $TMPDIR if it is empty or bogus, and skip $exec_prefix/lib
+  # in the usual case where exec_prefix is '${prefix}'.
+  case $ac_dir in #(
+    . | /* | ?:[\\/]*) ;; #(
+    *) continue;;
+  esac
+  test -w "$ac_dir/." || continue # It is less confusing to not echo anything here.
   ac_xdir=$ac_dir/cf$$
-  (umask 077 && mkdir $ac_xdir 2>/dev/null) || continue
+  (umask 077 && mkdir "$ac_xdir" 2>/dev/null) || continue
   ac_tf1=$ac_xdir/conftest9012345
   ac_tf2=$ac_xdir/conftest9012346
-  (echo 1 >$ac_tf1) 2>/dev/null
-  (echo 2 >$ac_tf2) 2>/dev/null
-  ac_val=`cat $ac_tf1 2>/dev/null`
-  if test ! -f $ac_tf1 || test "$ac_val" != 1; then
+  touch "$ac_tf1" 2>/dev/null && test -f "$ac_tf1" && test ! -f "$ac_tf2" ||
     ac_cv_sys_long_file_names=no
-    rm -rf $ac_xdir 2>/dev/null
-    break
-  fi
-  rm -rf $ac_xdir 2>/dev/null
+  rm -f -r "$ac_xdir" 2>/dev/null
+  test $ac_cv_sys_long_file_names = no && break
 done
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sys_long_file_names" >&5
-echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6
+echo "$as_me:$LINENO: result: $ac_cv_sys_long_file_names" >&5
+echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6; }
 if test $ac_cv_sys_long_file_names = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -8387,45 +8920,49 @@ fi
 
 #### Choose a window system.
 
-echo "$as_me:$LINENO: checking for X" >&5
-echo $ECHO_N "checking for X... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for X" >&5
+echo $ECHO_N "checking for X... $ECHO_C" >&6; }
 
-ac_path_x_has_been_run=yes
 
-# Check whether --with-x or --without-x was given.
+# Check whether --with-x was given.
 if test "${with_x+set}" = set; then
-  withval="$with_x"
+  withval=$with_x;
+fi
 
-fi;
 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
 if test "x$with_x" = xno; then
   # The user explicitly disabled X.
   have_x=disabled
 else
-  if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
-    # Both variables are already set.
-    have_x=yes
-  else
-    if test "${ac_cv_have_x+set}" = set; then
+  case $x_includes,$x_libraries in #(
+    *\'*) { { echo "$as_me:$LINENO: error: Cannot use X directory names containing '" >&5
+echo "$as_me: error: Cannot use X directory names containing '" >&2;}
+   { (exit 1); exit 1; }; };; #(
+    *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   # One or both of the vars are not set, and there is no cached value.
 ac_x_includes=no ac_x_libraries=no
-rm -fr conftest.dir
+rm -f -r conftest.dir
 if mkdir conftest.dir; then
   cd conftest.dir
-  # Make sure to not put "make" in the Imakefile rules, since we grep it out.
   cat >Imakefile <<'_ACEOF'
-acfindx:
-       @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
-_ACEOF
-  if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
+incroot:
+       @echo incroot='${INCROOT}'
+usrlibdir:
+       @echo usrlibdir='${USRLIBDIR}'
+libdir:
+       @echo libdir='${LIBDIR}'
+_ACEOF
+  if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-    eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
+    for ac_var in incroot usrlibdir libdir; do
+      eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
+    done
     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
     for ac_extension in a so sl; do
-      if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
-        test -f $ac_im_libdir/libX11.$ac_extension; then
+      if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
+        test -f "$ac_im_libdir/libX11.$ac_extension"; then
        ac_im_usrlibdir=$ac_im_libdir; break
       fi
     done
@@ -8433,7 +8970,7 @@ _ACEOF
     # bogus both because they are the default anyway, and because
     # using them would break gcc on systems where it needs fixed includes.
     case $ac_im_incroot in
-       /usr/include) ;;
+       /usr/include) ac_x_includes= ;;
        *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
     esac
     case $ac_im_usrlibdir in
@@ -8442,7 +8979,7 @@ _ACEOF
     esac
   fi
   cd ..
-  rm -fr conftest.dir
+  rm -f -r conftest.dir
 fi
 
 # Standard set of common directories for X headers.
@@ -8483,7 +9020,7 @@ ac_x_header_dirs='
 /usr/openwin/share/include'
 
 if test "$ac_x_includes" = no; then
-  # Guess where to find include files, by looking for a specified header file.
+  # Guess where to find include files, by looking for Xlib.h.
   # First, try using that file with no special directory specified.
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -8491,26 +9028,24 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <X11/Intrinsic.h>
+#include <X11/Xlib.h>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   # We can compile using X headers with no special include directory.
 ac_x_includes=
 else
@@ -8518,12 +9053,13 @@ else
 sed 's/^/| /' conftest.$ac_ext >&5
 
   for ac_dir in $ac_x_header_dirs; do
-  if test -r "$ac_dir/X11/Intrinsic.h"; then
+  if test -r "$ac_dir/X11/Xlib.h"; then
     ac_x_includes=$ac_dir
     break
   fi
 done
 fi
+
 rm -f conftest.err conftest.$ac_ext
 fi # $ac_x_includes = no
 
@@ -8532,44 +9068,40 @@ if test "$ac_x_libraries" = no; then
   # See if we find them without any special options.
   # Don't add to $LIBS permanently.
   ac_save_LIBS=$LIBS
-  LIBS="-lXt $LIBS"
+  LIBS="-lX11 $LIBS"
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <X11/Intrinsic.h>
+#include <X11/Xlib.h>
 int
 main ()
 {
-XtMalloc (0)
+XrmInitialize ()
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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
   LIBS=$ac_save_LIBS
 # We can link X programs with no special library path.
 ac_x_libraries=
@@ -8577,53 +9109,54 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-LIBS=$ac_save_LIBS
+       LIBS=$ac_save_LIBS
 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
 do
   # Don't even attempt the hair of trying to link an X program!
   for ac_extension in a so sl; do
-    if test -r $ac_dir/libXt.$ac_extension; then
+    if test -r "$ac_dir/libX11.$ac_extension"; then
       ac_x_libraries=$ac_dir
       break 2
     fi
   done
 done
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi # $ac_x_libraries = no
 
-if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
-  # Didn't find X anywhere.  Cache the known absence of X.
-  ac_cv_have_x="have_x=no"
-else
-  # Record where we found X for the cache.
-  ac_cv_have_x="have_x=yes \
-               ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
-fi
+case $ac_x_includes,$ac_x_libraries in #(
+  no,* | *,no | *\'*)
+    # Didn't find X, or a directory has "'" in its name.
+    ac_cv_have_x="have_x=no";; #(
+  *)
+    # Record where we found X for the cache.
+    ac_cv_have_x="have_x=yes\
+       ac_x_includes='$ac_x_includes'\
+       ac_x_libraries='$ac_x_libraries'"
+esac
 fi
-
-  fi
+;; #(
+    *) have_x=yes;;
+  esac
   eval "$ac_cv_have_x"
 fi # $with_x != no
 
 if test "$have_x" != yes; then
-  echo "$as_me:$LINENO: result: $have_x" >&5
-echo "${ECHO_T}$have_x" >&6
+  echo "$as_me:$LINENO: result: $have_x" >&5
+echo "${ECHO_T}$have_x" >&6; }
   no_x=yes
 else
   # If each of the values was on the command line, it overrides each guess.
   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
   # Update the cache value to reflect the command line values.
-  ac_cv_have_x="have_x=yes \
-               ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
-  # It might be that x_includes is empty (headers are found in the
-  # standard search path. Then output the corresponding message
-  ac_out_x_includes=$x_includes
-  test "x$x_includes" = x && ac_out_x_includes="in standard search path"
-  echo "$as_me:$LINENO: result: libraries $x_libraries, headers $ac_out_x_includes" >&5
-echo "${ECHO_T}libraries $x_libraries, headers $ac_out_x_includes" >&6
+  ac_cv_have_x="have_x=yes\
+       ac_x_includes='$x_includes'\
+       ac_x_libraries='$x_libraries'"
+  { echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5
+echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6; }
 fi
 
 if test "$no_x" = yes; then
@@ -8683,17 +9216,17 @@ fi
 HAVE_CARBON=no
 if test "${with_carbon}" != no; then
   if test "${ac_cv_header_Carbon_Carbon_h+set}" = set; then
-  echo "$as_me:$LINENO: checking for Carbon/Carbon.h" >&5
-echo $ECHO_N "checking for Carbon/Carbon.h... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for Carbon/Carbon.h" >&5
+echo $ECHO_N "checking for Carbon/Carbon.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_Carbon_Carbon_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_Carbon_Carbon_h" >&5
-echo "${ECHO_T}$ac_cv_header_Carbon_Carbon_h" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_Carbon_Carbon_h" >&5
+echo "${ECHO_T}$ac_cv_header_Carbon_Carbon_h" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking Carbon/Carbon.h usability" >&5
-echo $ECHO_N "checking Carbon/Carbon.h usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking Carbon/Carbon.h usability" >&5
+echo $ECHO_N "checking Carbon/Carbon.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -8704,41 +9237,37 @@ $ac_includes_default
 #include <Carbon/Carbon.h>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f 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.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking Carbon/Carbon.h presence" >&5
-echo $ECHO_N "checking Carbon/Carbon.h presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking Carbon/Carbon.h presence" >&5
+echo $ECHO_N "checking Carbon/Carbon.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -8747,24 +9276,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <Carbon/Carbon.h>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -8772,9 +9299,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -8798,25 +9326,18 @@ echo "$as_me: WARNING: Carbon/Carbon.h:     section \"Present But Cannot Be Comp
 echo "$as_me: WARNING: Carbon/Carbon.h: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: Carbon/Carbon.h: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: Carbon/Carbon.h: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for Carbon/Carbon.h" >&5
-echo $ECHO_N "checking for Carbon/Carbon.h... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for Carbon/Carbon.h" >&5
+echo $ECHO_N "checking for Carbon/Carbon.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_Carbon_Carbon_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_cv_header_Carbon_Carbon_h=$ac_header_preproc
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_Carbon_Carbon_h" >&5
-echo "${ECHO_T}$ac_cv_header_Carbon_Carbon_h" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_Carbon_Carbon_h" >&5
+echo "${ECHO_T}$ac_cv_header_Carbon_Carbon_h" >&6; }
 
 fi
 if test $ac_cv_header_Carbon_Carbon_h = yes; then
@@ -8890,8 +9411,8 @@ UNEXEC_SRC="`echo ${unexec} | sed 's/\.o/.c/'`"
 # Assume not, until told otherwise.
 GNU_MALLOC=yes
 doug_lea_malloc=yes
-echo "$as_me:$LINENO: checking for malloc_get_state" >&5
-echo $ECHO_N "checking for malloc_get_state... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for malloc_get_state" >&5
+echo $ECHO_N "checking for malloc_get_state... $ECHO_C" >&6; }
 if test "${ac_cv_func_malloc_get_state+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -8918,76 +9439,67 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef malloc_get_state
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char malloc_get_state ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_malloc_get_state) || defined (__stub___malloc_get_state)
+#if defined __stub_malloc_get_state || defined __stub___malloc_get_state
 choke me
-#else
-char (*f) () = malloc_get_state;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != malloc_get_state;
+return malloc_get_state ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_func_malloc_get_state=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_func_malloc_get_state=no
+       ac_cv_func_malloc_get_state=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_malloc_get_state" >&5
-echo "${ECHO_T}$ac_cv_func_malloc_get_state" >&6
+echo "$as_me:$LINENO: result: $ac_cv_func_malloc_get_state" >&5
+echo "${ECHO_T}$ac_cv_func_malloc_get_state" >&6; }
 if test $ac_cv_func_malloc_get_state = yes; then
   :
 else
   doug_lea_malloc=no
 fi
 
-echo "$as_me:$LINENO: checking for malloc_set_state" >&5
-echo $ECHO_N "checking for malloc_set_state... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for malloc_set_state" >&5
+echo $ECHO_N "checking for malloc_set_state... $ECHO_C" >&6; }
 if test "${ac_cv_func_malloc_set_state+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -9014,76 +9526,67 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef malloc_set_state
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char malloc_set_state ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_malloc_set_state) || defined (__stub___malloc_set_state)
+#if defined __stub_malloc_set_state || defined __stub___malloc_set_state
 choke me
-#else
-char (*f) () = malloc_set_state;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != malloc_set_state;
+return malloc_set_state ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_func_malloc_set_state=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_func_malloc_set_state=no
+       ac_cv_func_malloc_set_state=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_malloc_set_state" >&5
-echo "${ECHO_T}$ac_cv_func_malloc_set_state" >&6
+echo "$as_me:$LINENO: result: $ac_cv_func_malloc_set_state" >&5
+echo "${ECHO_T}$ac_cv_func_malloc_set_state" >&6; }
 if test $ac_cv_func_malloc_set_state = yes; then
   :
 else
   doug_lea_malloc=no
 fi
 
-echo "$as_me:$LINENO: checking whether __after_morecore_hook exists" >&5
-echo $ECHO_N "checking whether __after_morecore_hook exists... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking whether __after_morecore_hook exists" >&5
+echo $ECHO_N "checking whether __after_morecore_hook exists... $ECHO_C" >&6; }
 if test "${emacs_cv_var___after_morecore_hook+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -9103,39 +9606,36 @@ __after_morecore_hook = 0
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_var___after_morecore_hook=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-emacs_cv_var___after_morecore_hook=no
+       emacs_cv_var___after_morecore_hook=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $emacs_cv_var___after_morecore_hook" >&5
-echo "${ECHO_T}$emacs_cv_var___after_morecore_hook" >&6
+echo "$as_me:$LINENO: result: $emacs_cv_var___after_morecore_hook" >&5
+echo "${ECHO_T}$emacs_cv_var___after_morecore_hook" >&6; }
 if test $emacs_cv_var___after_morecore_hook = no; then
   doug_lea_malloc=no
 fi
@@ -9166,18 +9666,19 @@ fi
 for ac_header in stdlib.h unistd.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -9188,41 +9689,37 @@ $ac_includes_default
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f 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.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -9231,24 +9728,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -9256,9 +9751,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -9282,25 +9778,19 @@ echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
@@ -9316,9 +9806,9 @@ done
 for ac_func in getpagesize
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -9344,68 +9834,60 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
@@ -9414,8 +9896,8 @@ _ACEOF
 fi
 done
 
-echo "$as_me:$LINENO: checking for working mmap" >&5
-echo $ECHO_N "checking for working mmap... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for working mmap" >&5
+echo $ECHO_N "checking for working mmap... $ECHO_C" >&6; }
 if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -9457,21 +9939,21 @@ $ac_includes_default
 #include <fcntl.h>
 #include <sys/mman.h>
 
-#if !STDC_HEADERS && !HAVE_STDLIB_H
+#if !defined STDC_HEADERS && !defined HAVE_STDLIB_H
 char *malloc ();
 #endif
 
 /* This mess was copied from the GNU getpagesize.h.  */
-#if !HAVE_GETPAGESIZE
+#ifndef HAVE_GETPAGESIZE
 /* Assume that all systems that can run configure have sys/param.h.  */
-# if !HAVE_SYS_PARAM_H
+# ifndef HAVE_SYS_PARAM_H
 #  define HAVE_SYS_PARAM_H 1
 # endif
 
 # ifdef _SC_PAGESIZE
 #  define getpagesize() sysconf(_SC_PAGESIZE)
 # else /* no _SC_PAGESIZE */
-#  if HAVE_SYS_PARAM_H
+#  ifdef HAVE_SYS_PARAM_H
 #   include <sys/param.h>
 #   ifdef EXEC_PAGESIZE
 #    define getpagesize() EXEC_PAGESIZE
@@ -9510,15 +9992,15 @@ main ()
   /* First, make a file with some known garbage in it. */
   data = (char *) malloc (pagesize);
   if (!data)
-    exit (1);
+    return 1;
   for (i = 0; i < pagesize; ++i)
     *(data + i) = rand ();
   umask (0);
   fd = creat ("conftest.mmap", 0600);
   if (fd < 0)
-    exit (1);
+    return 1;
   if (write (fd, data, pagesize) != pagesize)
-    exit (1);
+    return 1;
   close (fd);
 
   /* Next, try to mmap the file at a fixed address which already has
@@ -9526,17 +10008,17 @@ main ()
      we see the same garbage.  */
   fd = open ("conftest.mmap", O_RDWR);
   if (fd < 0)
-    exit (1);
+    return 1;
   data2 = (char *) malloc (2 * pagesize);
   if (!data2)
-    exit (1);
-  data2 += (pagesize - ((long) data2 & (pagesize - 1))) & (pagesize - 1);
+    return 1;
+  data2 += (pagesize - ((long int) data2 & (pagesize - 1))) & (pagesize - 1);
   if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE,
                     MAP_PRIVATE | MAP_FIXED, fd, 0L))
-    exit (1);
+    return 1;
   for (i = 0; i < pagesize; ++i)
     if (*(data + i) != *(data2 + i))
-      exit (1);
+      return 1;
 
   /* Finally, make sure that changes to the mapped area do not
      percolate back to the file as seen by read().  (This is a bug on
@@ -9545,24 +10027,33 @@ main ()
     *(data2 + i) = *(data2 + i) + 1;
   data3 = (char *) malloc (pagesize);
   if (!data3)
-    exit (1);
+    return 1;
   if (read (fd, data3, pagesize) != pagesize)
-    exit (1);
+    return 1;
   for (i = 0; i < pagesize; ++i)
     if (*(data + i) != *(data3 + i))
-      exit (1);
+      return 1;
   close (fd);
-  exit (0);
+  return 0;
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+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>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (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_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -9575,11 +10066,13 @@ sed 's/^/| /' conftest.$ac_ext >&5
 ( exit $ac_status )
 ac_cv_func_mmap_fixed_mapped=no
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
+
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5
-echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6
+echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5
+echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6; }
 if test $ac_cv_func_mmap_fixed_mapped = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -9596,8 +10089,8 @@ fi
 LIBS="$libsrc_libs $LIBS"
 
 
-echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5
-echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5
+echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6; }
 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -9610,56 +10103,53 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char dnet_ntoa ();
 int
 main ()
 {
-dnet_ntoa ();
+return dnet_ntoa ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_dnet_dnet_ntoa=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_dnet_dnet_ntoa=no
+       ac_cv_lib_dnet_dnet_ntoa=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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_dnet_dnet_ntoa" >&5
-echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
+echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6; }
 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBDNET 1
@@ -9670,8 +10160,8 @@ _ACEOF
 fi
 
 
-echo "$as_me:$LINENO: checking for main in -lXbsd" >&5
-echo $ECHO_N "checking for main in -lXbsd... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for main in -lXbsd" >&5
+echo $ECHO_N "checking for main in -lXbsd... $ECHO_C" >&6; }
 if test "${ac_cv_lib_Xbsd_main+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -9688,54 +10178,51 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-main ();
+return main ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_Xbsd_main=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_Xbsd_main=no
+       ac_cv_lib_Xbsd_main=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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_Xbsd_main" >&5
-echo "${ECHO_T}$ac_cv_lib_Xbsd_main" >&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_Xbsd_main" >&5
+echo "${ECHO_T}$ac_cv_lib_Xbsd_main" >&6; }
 if test $ac_cv_lib_Xbsd_main = yes; then
   LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -lXbsd"
 fi
 
 
 
-echo "$as_me:$LINENO: checking for cma_open in -lpthreads" >&5
-echo $ECHO_N "checking for cma_open in -lpthreads... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for cma_open in -lpthreads" >&5
+echo $ECHO_N "checking for cma_open in -lpthreads... $ECHO_C" >&6; }
 if test "${ac_cv_lib_pthreads_cma_open+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -9748,56 +10235,53 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char cma_open ();
 int
 main ()
 {
-cma_open ();
+return cma_open ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_pthreads_cma_open=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_pthreads_cma_open=no
+       ac_cv_lib_pthreads_cma_open=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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_pthreads_cma_open" >&5
-echo "${ECHO_T}$ac_cv_lib_pthreads_cma_open" >&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_cma_open" >&5
+echo "${ECHO_T}$ac_cv_lib_pthreads_cma_open" >&6; }
 if test $ac_cv_lib_pthreads_cma_open = yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBPTHREADS 1
@@ -9808,22 +10292,22 @@ _ACEOF
 fi
 
 
-echo "$as_me:$LINENO: checking for XFree86 in /usr/X386" >&5
-echo $ECHO_N "checking for XFree86 in /usr/X386... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for XFree86 in /usr/X386" >&5
+echo $ECHO_N "checking for XFree86 in /usr/X386... $ECHO_C" >&6; }
 if test -d /usr/X386/include; then
   HAVE_XFREE386=yes
   : ${C_SWITCH_X_SITE="-I/usr/X386/include"}
 else
   HAVE_XFREE386=no
 fi
-echo "$as_me:$LINENO: result: $HAVE_XFREE386" >&5
-echo "${ECHO_T}$HAVE_XFREE386" >&6
+echo "$as_me:$LINENO: result: $HAVE_XFREE386" >&5
+echo "${ECHO_T}$HAVE_XFREE386" >&6; }
 
 
 case ${host_os} in
 aix*)
-  echo "$as_me:$LINENO: checking for -bbigtoc option" >&5
-echo $ECHO_N "checking for -bbigtoc option... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for -bbigtoc option" >&5
+echo $ECHO_N "checking for -bbigtoc option... $ECHO_C" >&6; }
 if test "${gdb_cv_bigtoc+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -9850,40 +10334,37 @@ int i;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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
   :
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-gdb_cv_bigtoc=
+       gdb_cv_bigtoc=
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 
 fi
-echo "$as_me:$LINENO: result: $gdb_cv_bigtoc" >&5
-echo "${ECHO_T}$gdb_cv_bigtoc" >&6
+echo "$as_me:$LINENO: result: $gdb_cv_bigtoc" >&5
+echo "${ECHO_T}$gdb_cv_bigtoc" >&6; }
   ;;
 esac
 
@@ -9910,8 +10391,8 @@ if test "${HAVE_X11}" = "yes"; then
   fi
 
   if test "${opsys}" = "gnu-linux"; then
-    echo "$as_me:$LINENO: checking whether X on GNU/Linux needs -b to link" >&5
-echo $ECHO_N "checking whether X on GNU/Linux needs -b to link... $ECHO_C" >&6
+    echo "$as_me:$LINENO: checking whether X on GNU/Linux needs -b to link" >&5
+echo $ECHO_N "checking whether X on GNU/Linux needs -b to link... $ECHO_C" >&6; }
     cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -9928,35 +10409,32 @@ XOpenDisplay ("foo");
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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
   xlinux_first_failure=no
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-xlinux_first_failure=yes
+       xlinux_first_failure=yes
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
     if test "${xlinux_first_failure}" = "yes"; then
       OLD_LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE"
@@ -9983,35 +10461,32 @@ XOpenDisplay ("foo");
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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
   xlinux_second_failure=no
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-xlinux_second_failure=yes
+       xlinux_second_failure=yes
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
       if test "${xlinux_second_failure}" = "yes"; then
        # If we get the same failure with -b, there is no use adding -b.
@@ -10020,22 +10495,22 @@ rm -f conftest.err conftest.$ac_objext \
        C_SWITCH_X_SITE="$OLD_C_SWITCH_X_SITE"
        CPPFLAGS="$OLD_CPPFLAGS"
        LIBS="$OLD_LIBS"
-        echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+        echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
       else
-        echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+        echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
       fi
     else
-      echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+      echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
     fi
   fi
 
   # Reportedly, some broken Solaris systems have XKBlib.h but are missing
   # header files included from there.
-  echo "$as_me:$LINENO: checking for Xkb" >&5
-echo $ECHO_N "checking for Xkb... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for Xkb" >&5
+echo $ECHO_N "checking for Xkb... $ECHO_C" >&6; }
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -10053,38 +10528,35 @@ XkbDescPtr kb = XkbGetKeyboard (0, XkbAllComponentsMask, XkbUseCoreKbd);
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_xkb=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-emacs_xkb=no
+       emacs_xkb=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
-  echo "$as_me:$LINENO: result: $emacs_xkb" >&5
-echo "${ECHO_T}$emacs_xkb" >&6
+  echo "$as_me:$LINENO: result: $emacs_xkb" >&5
+echo "${ECHO_T}$emacs_xkb" >&6; }
   if test $emacs_xkb = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -10101,9 +10573,9 @@ for ac_func in XrmSetDatabase XScreenResourceString \
 XScreenNumberOfScreen XSetWMProtocols
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -10129,68 +10601,60 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
@@ -10202,8 +10666,8 @@ done
 fi
 
 if test "${window_system}" = "x11"; then
-  echo "$as_me:$LINENO: checking X11 version 6" >&5
-echo $ECHO_N "checking X11 version 6... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking X11 version 6" >&5
+echo $ECHO_N "checking X11 version 6... $ECHO_C" >&6; }
   if test "${emacs_cv_x11_version_6+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -10226,55 +10690,52 @@ fail;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_6=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-emacs_cv_x11_version_6=no
+       emacs_cv_x11_version_6=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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_6 = yes; then
-    echo "$as_me:$LINENO: result: 6 or newer" >&5
-echo "${ECHO_T}6 or newer" >&6
+    echo "$as_me:$LINENO: result: 6 or newer" >&5
+echo "${ECHO_T}6 or newer" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_X11R6 1
 _ACEOF
 
   else
-    echo "$as_me:$LINENO: result: before 6" >&5
-echo "${ECHO_T}before 6" >&6
+    echo "$as_me:$LINENO: result: before 6" >&5
+echo "${ECHO_T}before 6" >&6; }
   fi
 fi
 
 if test "${window_system}" = "x11"; then
-  echo "$as_me:$LINENO: checking X11 version 5" >&5
-echo $ECHO_N "checking X11 version 5... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking X11 version 5" >&5
+echo $ECHO_N "checking X11 version 5... $ECHO_C" >&6; }
   if test "${emacs_cv_x11_version_5+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -10297,41 +10758,38 @@ fail;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-emacs_cv_x11_version_5=no
+       emacs_cv_x11_version_5=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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 = yes; then
-    echo "$as_me:$LINENO: result: 5 or newer" >&5
-echo "${ECHO_T}5 or newer" >&6
+    echo "$as_me:$LINENO: result: 5 or newer" >&5
+echo "${ECHO_T}5 or newer" >&6; }
     HAVE_X11R5=yes
 
 cat >>confdefs.h <<\_ACEOF
@@ -10340,8 +10798,8 @@ _ACEOF
 
   else
     HAVE_X11R5=no
-    echo "$as_me:$LINENO: result: before 5" >&5
-echo "${ECHO_T}before 5" >&6
+    echo "$as_me:$LINENO: result: before 5" >&5
+echo "${ECHO_T}before 5" >&6; }
   fi
 fi
 
@@ -10365,8 +10823,8 @@ echo "$as_me: error: Conflicting options, --with-gtk is incompatible with --with
   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
+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
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  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
 
   test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
   ;;
 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
+  echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+echo "${ECHO_T}$PKG_CONFIG" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
   fi
 
   if test "$PKG_CONFIG" = "no" ; then
@@ -10414,28 +10873,28 @@ echo "$as_me: error:
   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 $GTK_MODULES" >&5
-echo $ECHO_N "checking for $GTK_MODULES... $ECHO_C" >&6
+        echo "$as_me:$LINENO: checking for $GTK_MODULES" >&5
+echo $ECHO_N "checking for $GTK_MODULES... $ECHO_C" >&6; }
 
         if $PKG_CONFIG --exists "$GTK_MODULES" 2>&5; then
-            echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+            echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
             succeeded=yes
 
-            echo "$as_me:$LINENO: checking GTK_CFLAGS" >&5
-echo $ECHO_N "checking GTK_CFLAGS... $ECHO_C" >&6
+            echo "$as_me:$LINENO: checking GTK_CFLAGS" >&5
+echo $ECHO_N "checking GTK_CFLAGS... $ECHO_C" >&6; }
             GTK_CFLAGS=`$PKG_CONFIG --cflags "$GTK_MODULES"`
-            echo "$as_me:$LINENO: result: $GTK_CFLAGS" >&5
-echo "${ECHO_T}$GTK_CFLAGS" >&6
+            echo "$as_me:$LINENO: result: $GTK_CFLAGS" >&5
+echo "${ECHO_T}$GTK_CFLAGS" >&6; }
 
-            echo "$as_me:$LINENO: checking GTK_LIBS" >&5
-echo $ECHO_N "checking GTK_LIBS... $ECHO_C" >&6
+            echo "$as_me:$LINENO: checking GTK_LIBS" >&5
+echo $ECHO_N "checking GTK_LIBS... $ECHO_C" >&6; }
             GTK_LIBS=`$PKG_CONFIG --libs "$GTK_MODULES"`
-            echo "$as_me:$LINENO: result: $GTK_LIBS" >&5
-echo "${ECHO_T}$GTK_LIBS" >&6
+            echo "$as_me:$LINENO: result: $GTK_LIBS" >&5
+echo "${ECHO_T}$GTK_LIBS" >&6; }
         else
-            echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+            echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
             GTK_CFLAGS=""
             GTK_LIBS=""
             ## If we have a custom action on failure, don't print errors, but
@@ -10477,14 +10936,16 @@ _ACEOF
     with_toolkit_scroll_bars=yes
   fi
 
-      HAVE_GTK_MULTIDISPLAY=no
+          HAVE_GTK_MULTIDISPLAY=no
+
+      HAVE_GTK_FILE_SELECTION=no
 
-for ac_func in gdk_display_open
+for ac_func in gtk_file_selection_new
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -10510,91 +10971,77 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- HAVE_GTK_MULTIDISPLAY=yes
+ HAVE_GTK_FILE_SELECTION=yes
 fi
 done
 
-  if test "${HAVE_GTK_MULTIDISPLAY}" = "yes"; then
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_GTK_MULTIDISPLAY 1
-_ACEOF
-
-  fi
-      HAVE_GTK_FILE_SELECTION=no
+      HAVE_GTK_FILE_CHOOSER=no
 
-for ac_func in gtk_file_selection_new
+for ac_func in gtk_file_chooser_dialog_new
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -10620,209 +11067,98 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- HAVE_GTK_FILE_SELECTION=yes
+ HAVE_GTK_FILE_CHOOSER=yes
 fi
 done
 
 
-      HAVE_GTK_FILE_CHOOSER=no
+  if test "$HAVE_GTK_FILE_SELECTION" = yes \
+     && test "$HAVE_GTK_FILE_CHOOSER" = yes;  then
 
-for ac_func in gtk_file_chooser_dialog_new
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_GTK_FILE_BOTH 1
+_ACEOF
+
+  fi
+
+      if test "$HAVE_GTK_FILE_CHOOSER" = yes; then
+    HAVE_GTK_AND_PTHREAD=no
+
+for ac_header in pthread.h
 do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != $ac_func;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- HAVE_GTK_FILE_CHOOSER=yes
-fi
-done
-
-
-  if test "$HAVE_GTK_FILE_SELECTION" = yes \
-     && test "$HAVE_GTK_FILE_CHOOSER" = yes;  then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_GTK_FILE_BOTH 1
-_ACEOF
-
-  fi
-
-      if test "$HAVE_GTK_FILE_CHOOSER" = yes; then
-    HAVE_GTK_AND_PTHREAD=no
-
-for ac_header in pthread.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
-  # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -10832,41 +11168,37 @@ $ac_includes_default
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f 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.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -10875,24 +11207,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -10900,9 +11230,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -10926,25 +11257,19 @@ echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
@@ -10957,8 +11282,8 @@ fi
 done
 
     if test "$ac_cv_header_pthread_h"; then
-      echo "$as_me:$LINENO: checking for pthread_self in -lpthread" >&5
-echo $ECHO_N "checking for pthread_self in -lpthread... $ECHO_C" >&6
+      echo "$as_me:$LINENO: checking for pthread_self in -lpthread" >&5
+echo $ECHO_N "checking for pthread_self in -lpthread... $ECHO_C" >&6; }
 if test "${ac_cv_lib_pthread_pthread_self+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -10971,56 +11296,53 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char pthread_self ();
 int
 main ()
 {
-pthread_self ();
+return pthread_self ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_pthread_pthread_self=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_pthread_pthread_self=no
+       ac_cv_lib_pthread_pthread_self=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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_pthread_pthread_self" >&5
-echo "${ECHO_T}$ac_cv_lib_pthread_pthread_self" >&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_self" >&5
+echo "${ECHO_T}$ac_cv_lib_pthread_pthread_self" >&6; }
 if test $ac_cv_lib_pthread_pthread_self = yes; then
   HAVE_GTK_AND_PTHREAD=yes
 fi
@@ -11039,8 +11361,8 @@ fi
 
 if test x"${USE_X_TOOLKIT}" = xmaybe; 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
+    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
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -11062,45 +11384,42 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-emacs_cv_x11_version_5_with_xaw=no
+       emacs_cv_x11_version_5_with_xaw=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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
+      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; }
       USE_X_TOOLKIT=LUCID
     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: 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; }
       USE_X_TOOLKIT=none
     fi
   else
@@ -11111,8 +11430,8 @@ 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
+  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
@@ -11135,50 +11454,47 @@ fail;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_toolkit_version_6=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-emacs_cv_x11_toolkit_version_6=no
+       emacs_cv_x11_toolkit_version_6=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
 
   HAVE_X11XTR6=$emacs_cv_x11_toolkit_version_6
   if test $emacs_cv_x11_toolkit_version_6 = yes; then
-    echo "$as_me:$LINENO: result: 6 or newer" >&5
-echo "${ECHO_T}6 or newer" >&6
+    echo "$as_me:$LINENO: result: 6 or newer" >&5
+echo "${ECHO_T}6 or newer" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_X11XTR6 1
 _ACEOF
 
   else
-    echo "$as_me:$LINENO: result: before 6" >&5
-echo "${ECHO_T}before 6" >&6
+    echo "$as_me:$LINENO: result: before 6" >&5
+echo "${ECHO_T}before 6" >&6; }
   fi
 
   OLDLIBS="$LIBS"
@@ -11188,8 +11504,8 @@ echo "${ECHO_T}before 6" >&6
     LIBS="-lXt $LIBS"
   fi
 
-echo "$as_me:$LINENO: checking for XmuConvertStandardSelection in -lXmu" >&5
-echo $ECHO_N "checking for XmuConvertStandardSelection in -lXmu... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for XmuConvertStandardSelection in -lXmu" >&5
+echo $ECHO_N "checking for XmuConvertStandardSelection in -lXmu... $ECHO_C" >&6; }
 if test "${ac_cv_lib_Xmu_XmuConvertStandardSelection+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -11202,56 +11518,53 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char XmuConvertStandardSelection ();
 int
 main ()
 {
-XmuConvertStandardSelection ();
+return XmuConvertStandardSelection ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_Xmu_XmuConvertStandardSelection=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_Xmu_XmuConvertStandardSelection=no
+       ac_cv_lib_Xmu_XmuConvertStandardSelection=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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_Xmu_XmuConvertStandardSelection" >&5
-echo "${ECHO_T}$ac_cv_lib_Xmu_XmuConvertStandardSelection" >&6
+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
@@ -11268,8 +11581,8 @@ fi
 if test "${HAVE_X11}" = "yes"; then
   if test "${USE_X_TOOLKIT}" != "none"; then
 
-echo "$as_me:$LINENO: checking for XShapeQueryExtension in -lXext" >&5
-echo $ECHO_N "checking for XShapeQueryExtension in -lXext... $ECHO_C" >&6
+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
@@ -11282,56 +11595,53 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char XShapeQueryExtension ();
 int
 main ()
 {
-XShapeQueryExtension ();
+return XShapeQueryExtension ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_Xext_XShapeQueryExtension=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_Xext_XShapeQueryExtension=no
+       ac_cv_lib_Xext_XShapeQueryExtension=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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_Xext_XShapeQueryExtension" >&5
-echo "${ECHO_T}$ac_cv_lib_Xext_XShapeQueryExtension" >&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_Xext_XShapeQueryExtension" >&5
+echo "${ECHO_T}$ac_cv_lib_Xext_XShapeQueryExtension" >&6; }
 if test $ac_cv_lib_Xext_XShapeQueryExtension = yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBXEXT 1
@@ -11345,8 +11655,8 @@ fi
 fi
 
 if test "${USE_X_TOOLKIT}" = "MOTIF"; then
-  echo "$as_me:$LINENO: checking for Motif version 2.1" >&5
-echo $ECHO_N "checking for Motif version 2.1... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for Motif version 2.1" >&5
+echo $ECHO_N "checking for Motif version 2.1... $ECHO_C" >&6; }
 if test "${emacs_cv_motif_version_2_1+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -11370,38 +11680,34 @@ Motif version prior to 2.1.
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   emacs_cv_motif_version_2_1=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-emacs_cv_motif_version_2_1=no
+       emacs_cv_motif_version_2_1=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $emacs_cv_motif_version_2_1" >&5
-echo "${ECHO_T}$emacs_cv_motif_version_2_1" >&6
+echo "$as_me:$LINENO: result: $emacs_cv_motif_version_2_1" >&5
+echo "${ECHO_T}$emacs_cv_motif_version_2_1" >&6; }
   HAVE_MOTIF_2_1=$emacs_cv_motif_version_2_1
   if test $emacs_cv_motif_version_2_1 = yes; then
     HAVE_LIBXP=no
@@ -11410,8 +11716,8 @@ cat >>confdefs.h <<\_ACEOF
 #define HAVE_MOTIF_2_1 1
 _ACEOF
 
-    echo "$as_me:$LINENO: checking for XpCreateContext in -lXp" >&5
-echo $ECHO_N "checking for XpCreateContext in -lXp... $ECHO_C" >&6
+    echo "$as_me:$LINENO: checking for XpCreateContext in -lXp" >&5
+echo $ECHO_N "checking for XpCreateContext in -lXp... $ECHO_C" >&6; }
 if test "${ac_cv_lib_Xp_XpCreateContext+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -11424,56 +11730,53 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char XpCreateContext ();
 int
 main ()
 {
-XpCreateContext ();
+return XpCreateContext ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_Xp_XpCreateContext=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_Xp_XpCreateContext=no
+       ac_cv_lib_Xp_XpCreateContext=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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_Xp_XpCreateContext" >&5
-echo "${ECHO_T}$ac_cv_lib_Xp_XpCreateContext" >&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_Xp_XpCreateContext" >&5
+echo "${ECHO_T}$ac_cv_lib_Xp_XpCreateContext" >&6; }
 if test $ac_cv_lib_Xp_XpCreateContext = yes; then
   HAVE_LIBXP=yes
 fi
@@ -11486,8 +11789,8 @@ _ACEOF
 
     fi
   else
-    echo "$as_me:$LINENO: checking for LessTif where some systems put it" >&5
-echo $ECHO_N "checking for LessTif where some systems put it... $ECHO_C" >&6
+    echo "$as_me:$LINENO: checking for LessTif where some systems put it" >&5
+echo $ECHO_N "checking for LessTif where some systems put it... $ECHO_C" >&6; }
 if test "${emacs_cv_lesstif+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -11514,38 +11817,34 @@ int x = 5;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   emacs_cv_lesstif=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-emacs_cv_lesstif=no
+       emacs_cv_lesstif=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $emacs_cv_lesstif" >&5
-echo "${ECHO_T}$emacs_cv_lesstif" >&6
+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.
@@ -11565,8 +11864,8 @@ fi
 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
+            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
@@ -11578,24 +11877,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <X11/Xaw3d/Scrollbar.h>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (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
@@ -11603,13 +11900,14 @@ 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
+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
+  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
@@ -11622,56 +11920,53 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char XawScrollbarSetThumb ();
 int
 main ()
 {
-XawScrollbarSetThumb ();
+return XawScrollbarSetThumb ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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
+       ac_cv_lib_Xaw3d_XawScrollbarSetThumb=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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
+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
@@ -11741,27 +12036,22 @@ XIMProc  callback;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   HAVE_XIM=yes
 
 cat >>confdefs.h <<\_ACEOF
@@ -11772,9 +12062,10 @@ else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-HAVE_XIM=no
+       HAVE_XIM=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 
 if test "${with_xim}" != "no"; then
@@ -11822,34 +12113,31 @@ extern Bool XRegisterIMInstantiateCallback(Display*, XrmDatabase, char*,
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   emacs_cv_arg6_star=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
   if test "$emacs_cv_arg6_star" = yes; then
     cat >>confdefs.h <<\_ACEOF
@@ -11870,17 +12158,17 @@ HAVE_XPM=no
 if test "${HAVE_X11}" = "yes"; then
   if test "${with_xpm}" != "no"; then
     if test "${ac_cv_header_X11_xpm_h+set}" = set; then
-  echo "$as_me:$LINENO: checking for X11/xpm.h" >&5
-echo $ECHO_N "checking for X11/xpm.h... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for X11/xpm.h" >&5
+echo $ECHO_N "checking for X11/xpm.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_X11_xpm_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_X11_xpm_h" >&5
-echo "${ECHO_T}$ac_cv_header_X11_xpm_h" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_X11_xpm_h" >&5
+echo "${ECHO_T}$ac_cv_header_X11_xpm_h" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking X11/xpm.h usability" >&5
-echo $ECHO_N "checking X11/xpm.h usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking X11/xpm.h usability" >&5
+echo $ECHO_N "checking X11/xpm.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -11891,41 +12179,37 @@ $ac_includes_default
 #include <X11/xpm.h>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f 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.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking X11/xpm.h presence" >&5
-echo $ECHO_N "checking X11/xpm.h presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking X11/xpm.h presence" >&5
+echo $ECHO_N "checking X11/xpm.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -11934,24 +12218,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <X11/xpm.h>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -11959,9 +12241,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -11985,30 +12268,23 @@ echo "$as_me: WARNING: X11/xpm.h:     section \"Present But Cannot Be Compiled\"
 echo "$as_me: WARNING: X11/xpm.h: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: X11/xpm.h: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: X11/xpm.h: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for X11/xpm.h" >&5
-echo $ECHO_N "checking for X11/xpm.h... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for X11/xpm.h" >&5
+echo $ECHO_N "checking for X11/xpm.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_X11_xpm_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_cv_header_X11_xpm_h=$ac_header_preproc
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_X11_xpm_h" >&5
-echo "${ECHO_T}$ac_cv_header_X11_xpm_h" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_X11_xpm_h" >&5
+echo "${ECHO_T}$ac_cv_header_X11_xpm_h" >&6; }
 
 fi
 if test $ac_cv_header_X11_xpm_h = yes; then
-  echo "$as_me:$LINENO: checking for XpmReadFileToPixmap in -lXpm" >&5
-echo $ECHO_N "checking for XpmReadFileToPixmap in -lXpm... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for XpmReadFileToPixmap in -lXpm" >&5
+echo $ECHO_N "checking for XpmReadFileToPixmap in -lXpm... $ECHO_C" >&6; }
 if test "${ac_cv_lib_Xpm_XpmReadFileToPixmap+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -12021,56 +12297,53 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char XpmReadFileToPixmap ();
 int
 main ()
 {
-XpmReadFileToPixmap ();
+return XpmReadFileToPixmap ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_Xpm_XpmReadFileToPixmap=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_Xpm_XpmReadFileToPixmap=no
+       ac_cv_lib_Xpm_XpmReadFileToPixmap=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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_Xpm_XpmReadFileToPixmap" >&5
-echo "${ECHO_T}$ac_cv_lib_Xpm_XpmReadFileToPixmap" >&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_Xpm_XpmReadFileToPixmap" >&5
+echo "${ECHO_T}$ac_cv_lib_Xpm_XpmReadFileToPixmap" >&6; }
 if test $ac_cv_lib_Xpm_XpmReadFileToPixmap = yes; then
   HAVE_XPM=yes
 fi
@@ -12079,8 +12352,8 @@ fi
 
 
     if test "${HAVE_XPM}" = "yes"; then
-      echo "$as_me:$LINENO: checking for XpmReturnAllocPixels preprocessor define" >&5
-echo $ECHO_N "checking for XpmReturnAllocPixels preprocessor define... $ECHO_C" >&6
+      echo "$as_me:$LINENO: checking for XpmReturnAllocPixels preprocessor define" >&5
+echo $ECHO_N "checking for XpmReturnAllocPixels preprocessor define... $ECHO_C" >&6; }
       cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -12103,11 +12376,11 @@ rm -f conftest*
 
 
       if test "${HAVE_XPM}" = "yes"; then
-       echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+       echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
       else
-       echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+       echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
       fi
     fi
   fi
@@ -12126,17 +12399,17 @@ HAVE_JPEG=no
 if test "${HAVE_X11}" = "yes"; then
   if test "${with_jpeg}" != "no"; then
             if test "${ac_cv_header_jerror_h+set}" = set; then
-  echo "$as_me:$LINENO: checking for jerror.h" >&5
-echo $ECHO_N "checking for jerror.h... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for jerror.h" >&5
+echo $ECHO_N "checking for jerror.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_jerror_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_jerror_h" >&5
-echo "${ECHO_T}$ac_cv_header_jerror_h" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_jerror_h" >&5
+echo "${ECHO_T}$ac_cv_header_jerror_h" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking jerror.h usability" >&5
-echo $ECHO_N "checking jerror.h usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking jerror.h usability" >&5
+echo $ECHO_N "checking jerror.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -12147,41 +12420,37 @@ $ac_includes_default
 #include <jerror.h>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f 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.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking jerror.h presence" >&5
-echo $ECHO_N "checking jerror.h presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking jerror.h presence" >&5
+echo $ECHO_N "checking jerror.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -12190,24 +12459,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <jerror.h>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -12215,9 +12482,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -12241,30 +12509,23 @@ echo "$as_me: WARNING: jerror.h:     section \"Present But Cannot Be Compiled\""
 echo "$as_me: WARNING: jerror.h: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: jerror.h: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: jerror.h: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for jerror.h" >&5
-echo $ECHO_N "checking for jerror.h... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for jerror.h" >&5
+echo $ECHO_N "checking for jerror.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_jerror_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_cv_header_jerror_h=$ac_header_preproc
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_jerror_h" >&5
-echo "${ECHO_T}$ac_cv_header_jerror_h" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_jerror_h" >&5
+echo "${ECHO_T}$ac_cv_header_jerror_h" >&6; }
 
 fi
 if test $ac_cv_header_jerror_h = yes; then
-  echo "$as_me:$LINENO: checking for jpeg_destroy_compress in -ljpeg" >&5
-echo $ECHO_N "checking for jpeg_destroy_compress in -ljpeg... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for jpeg_destroy_compress in -ljpeg" >&5
+echo $ECHO_N "checking for jpeg_destroy_compress in -ljpeg... $ECHO_C" >&6; }
 if test "${ac_cv_lib_jpeg_jpeg_destroy_compress+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -12277,56 +12538,53 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char jpeg_destroy_compress ();
 int
 main ()
 {
-jpeg_destroy_compress ();
+return jpeg_destroy_compress ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_jpeg_jpeg_destroy_compress=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_jpeg_jpeg_destroy_compress=no
+       ac_cv_lib_jpeg_jpeg_destroy_compress=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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_jpeg_jpeg_destroy_compress" >&5
-echo "${ECHO_T}$ac_cv_lib_jpeg_jpeg_destroy_compress" >&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_jpeg_jpeg_destroy_compress" >&5
+echo "${ECHO_T}$ac_cv_lib_jpeg_jpeg_destroy_compress" >&6; }
 if test $ac_cv_lib_jpeg_jpeg_destroy_compress = yes; then
   HAVE_JPEG=yes
 fi
@@ -12379,18 +12637,19 @@ if test "${HAVE_X11}" = "yes"; then
 for ac_header in png.h libpng/png.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -12401,41 +12660,37 @@ $ac_includes_default
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f 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.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -12444,24 +12699,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -12469,9 +12722,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -12495,25 +12749,19 @@ echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
@@ -12526,8 +12774,8 @@ fi
 done
 
     if test "$ac_cv_header_png_h" = yes || test "$ac_cv_header_libpng_png_h" = yes ; then
-      echo "$as_me:$LINENO: checking for png_get_channels in -lpng" >&5
-echo $ECHO_N "checking for png_get_channels in -lpng... $ECHO_C" >&6
+      echo "$as_me:$LINENO: checking for png_get_channels in -lpng" >&5
+echo $ECHO_N "checking for png_get_channels in -lpng... $ECHO_C" >&6; }
 if test "${ac_cv_lib_png_png_get_channels+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -12540,56 +12788,53 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char png_get_channels ();
 int
 main ()
 {
-png_get_channels ();
+return png_get_channels ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_png_png_get_channels=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_png_png_get_channels=no
+       ac_cv_lib_png_png_get_channels=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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_png_png_get_channels" >&5
-echo "${ECHO_T}$ac_cv_lib_png_png_get_channels" >&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_png_png_get_channels" >&5
+echo "${ECHO_T}$ac_cv_lib_png_png_get_channels" >&6; }
 if test $ac_cv_lib_png_png_get_channels = yes; then
   HAVE_PNG=yes
 fi
@@ -12611,17 +12856,17 @@ HAVE_TIFF=no
 if test "${HAVE_X11}" = "yes"; then
   if test "${with_tiff}" != "no"; then
     if test "${ac_cv_header_tiffio_h+set}" = set; then
-  echo "$as_me:$LINENO: checking for tiffio.h" >&5
-echo $ECHO_N "checking for tiffio.h... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for tiffio.h" >&5
+echo $ECHO_N "checking for tiffio.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_tiffio_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_tiffio_h" >&5
-echo "${ECHO_T}$ac_cv_header_tiffio_h" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_tiffio_h" >&5
+echo "${ECHO_T}$ac_cv_header_tiffio_h" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking tiffio.h usability" >&5
-echo $ECHO_N "checking tiffio.h usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking tiffio.h usability" >&5
+echo $ECHO_N "checking tiffio.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -12632,41 +12877,37 @@ $ac_includes_default
 #include <tiffio.h>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f 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.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking tiffio.h presence" >&5
-echo $ECHO_N "checking tiffio.h presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking tiffio.h presence" >&5
+echo $ECHO_N "checking tiffio.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -12675,24 +12916,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <tiffio.h>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -12700,9 +12939,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -12726,33 +12966,26 @@ echo "$as_me: WARNING: tiffio.h:     section \"Present But Cannot Be Compiled\""
 echo "$as_me: WARNING: tiffio.h: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: tiffio.h: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: tiffio.h: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for tiffio.h" >&5
-echo $ECHO_N "checking for tiffio.h... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for tiffio.h" >&5
+echo $ECHO_N "checking for tiffio.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_tiffio_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_cv_header_tiffio_h=$ac_header_preproc
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_tiffio_h" >&5
-echo "${ECHO_T}$ac_cv_header_tiffio_h" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_tiffio_h" >&5
+echo "${ECHO_T}$ac_cv_header_tiffio_h" >&6; }
 
 fi
 if test $ac_cv_header_tiffio_h = yes; then
   tifflibs="-lz -lm"
       # At least one tiff package requires the jpeg library.
       if test "${HAVE_JPEG}" = yes; then tifflibs="-ljpeg $tifflibs"; fi
-      echo "$as_me:$LINENO: checking for TIFFGetVersion in -ltiff" >&5
-echo $ECHO_N "checking for TIFFGetVersion in -ltiff... $ECHO_C" >&6
+      echo "$as_me:$LINENO: checking for TIFFGetVersion in -ltiff" >&5
+echo $ECHO_N "checking for TIFFGetVersion in -ltiff... $ECHO_C" >&6; }
 if test "${ac_cv_lib_tiff_TIFFGetVersion+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -12765,56 +12998,53 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char TIFFGetVersion ();
 int
 main ()
 {
-TIFFGetVersion ();
+return TIFFGetVersion ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_tiff_TIFFGetVersion=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_tiff_TIFFGetVersion=no
+       ac_cv_lib_tiff_TIFFGetVersion=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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_tiff_TIFFGetVersion" >&5
-echo "${ECHO_T}$ac_cv_lib_tiff_TIFFGetVersion" >&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_tiff_TIFFGetVersion" >&5
+echo "${ECHO_T}$ac_cv_lib_tiff_TIFFGetVersion" >&6; }
 if test $ac_cv_lib_tiff_TIFFGetVersion = yes; then
   HAVE_TIFF=yes
 fi
@@ -12838,17 +13068,17 @@ HAVE_GIF=no
 if test "${HAVE_X11}" = "yes"; then
   if test "${with_gif}" != "no"; then
     if test "${ac_cv_header_gif_lib_h+set}" = set; then
-  echo "$as_me:$LINENO: checking for gif_lib.h" >&5
-echo $ECHO_N "checking for gif_lib.h... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for gif_lib.h" >&5
+echo $ECHO_N "checking for gif_lib.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_gif_lib_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_gif_lib_h" >&5
-echo "${ECHO_T}$ac_cv_header_gif_lib_h" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_gif_lib_h" >&5
+echo "${ECHO_T}$ac_cv_header_gif_lib_h" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking gif_lib.h usability" >&5
-echo $ECHO_N "checking gif_lib.h usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking gif_lib.h usability" >&5
+echo $ECHO_N "checking gif_lib.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -12859,41 +13089,37 @@ $ac_includes_default
 #include <gif_lib.h>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f 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.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking gif_lib.h presence" >&5
-echo $ECHO_N "checking gif_lib.h presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking gif_lib.h presence" >&5
+echo $ECHO_N "checking gif_lib.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -12902,24 +13128,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <gif_lib.h>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -12927,9 +13151,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -12953,32 +13178,25 @@ echo "$as_me: WARNING: gif_lib.h:     section \"Present But Cannot Be Compiled\"
 echo "$as_me: WARNING: gif_lib.h: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: gif_lib.h: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: gif_lib.h: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for gif_lib.h" >&5
-echo $ECHO_N "checking for gif_lib.h... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for gif_lib.h" >&5
+echo $ECHO_N "checking for gif_lib.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_gif_lib_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_cv_header_gif_lib_h=$ac_header_preproc
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_gif_lib_h" >&5
-echo "${ECHO_T}$ac_cv_header_gif_lib_h" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_gif_lib_h" >&5
+echo "${ECHO_T}$ac_cv_header_gif_lib_h" >&6; }
 
 fi
 if test $ac_cv_header_gif_lib_h = yes; then
   # EGifPutExtensionLast only exists from version libungif-4.1.0b1.
 # Earlier versions can crash Emacs.
-      echo "$as_me:$LINENO: checking for EGifPutExtensionLast in -lungif" >&5
-echo $ECHO_N "checking for EGifPutExtensionLast in -lungif... $ECHO_C" >&6
+      echo "$as_me:$LINENO: checking for EGifPutExtensionLast in -lungif" >&5
+echo $ECHO_N "checking for EGifPutExtensionLast in -lungif... $ECHO_C" >&6; }
 if test "${ac_cv_lib_ungif_EGifPutExtensionLast+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -12991,56 +13209,53 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char EGifPutExtensionLast ();
 int
 main ()
 {
-EGifPutExtensionLast ();
+return EGifPutExtensionLast ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_ungif_EGifPutExtensionLast=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_ungif_EGifPutExtensionLast=no
+       ac_cv_lib_ungif_EGifPutExtensionLast=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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_ungif_EGifPutExtensionLast" >&5
-echo "${ECHO_T}$ac_cv_lib_ungif_EGifPutExtensionLast" >&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_ungif_EGifPutExtensionLast" >&5
+echo "${ECHO_T}$ac_cv_lib_ungif_EGifPutExtensionLast" >&6; }
 if test $ac_cv_lib_ungif_EGifPutExtensionLast = yes; then
   HAVE_GIF=yes
 fi
@@ -13060,17 +13275,17 @@ _ACEOF
 fi
 
 if test "${ac_cv_header_malloc_malloc_h+set}" = set; then
-  echo "$as_me:$LINENO: checking for malloc/malloc.h" >&5
-echo $ECHO_N "checking for malloc/malloc.h... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for malloc/malloc.h" >&5
+echo $ECHO_N "checking for malloc/malloc.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_malloc_malloc_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_malloc_malloc_h" >&5
-echo "${ECHO_T}$ac_cv_header_malloc_malloc_h" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_malloc_malloc_h" >&5
+echo "${ECHO_T}$ac_cv_header_malloc_malloc_h" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking malloc/malloc.h usability" >&5
-echo $ECHO_N "checking malloc/malloc.h usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking malloc/malloc.h usability" >&5
+echo $ECHO_N "checking malloc/malloc.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -13081,41 +13296,37 @@ $ac_includes_default
 #include <malloc/malloc.h>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f 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.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking malloc/malloc.h presence" >&5
-echo $ECHO_N "checking malloc/malloc.h presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking malloc/malloc.h presence" >&5
+echo $ECHO_N "checking malloc/malloc.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -13124,24 +13335,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <malloc/malloc.h>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -13149,9 +13358,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -13175,25 +13385,18 @@ echo "$as_me: WARNING: malloc/malloc.h:     section \"Present But Cannot Be Comp
 echo "$as_me: WARNING: malloc/malloc.h: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: malloc/malloc.h: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: malloc/malloc.h: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for malloc/malloc.h" >&5
-echo $ECHO_N "checking for malloc/malloc.h... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for malloc/malloc.h" >&5
+echo $ECHO_N "checking for malloc/malloc.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_malloc_malloc_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_cv_header_malloc_malloc_h=$ac_header_preproc
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_malloc_malloc_h" >&5
-echo "${ECHO_T}$ac_cv_header_malloc_malloc_h" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_malloc_malloc_h" >&5
+echo "${ECHO_T}$ac_cv_header_malloc_malloc_h" >&6; }
 
 fi
 if test $ac_cv_header_malloc_malloc_h = yes; then
 HAVE_X_SM=no
 if test "${HAVE_X11}" = "yes"; then
   if test "${ac_cv_header_X11_SM_SMlib_h+set}" = set; then
-  echo "$as_me:$LINENO: checking for X11/SM/SMlib.h" >&5
-echo $ECHO_N "checking for X11/SM/SMlib.h... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for X11/SM/SMlib.h" >&5
+echo $ECHO_N "checking for X11/SM/SMlib.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_X11_SM_SMlib_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_X11_SM_SMlib_h" >&5
-echo "${ECHO_T}$ac_cv_header_X11_SM_SMlib_h" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_X11_SM_SMlib_h" >&5
+echo "${ECHO_T}$ac_cv_header_X11_SM_SMlib_h" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking X11/SM/SMlib.h usability" >&5
-echo $ECHO_N "checking X11/SM/SMlib.h usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking X11/SM/SMlib.h usability" >&5
+echo $ECHO_N "checking X11/SM/SMlib.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -13250,41 +13453,37 @@ $ac_includes_default
 #include <X11/SM/SMlib.h>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f 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.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking X11/SM/SMlib.h presence" >&5
-echo $ECHO_N "checking X11/SM/SMlib.h presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking X11/SM/SMlib.h presence" >&5
+echo $ECHO_N "checking X11/SM/SMlib.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -13293,24 +13492,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <X11/SM/SMlib.h>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -13318,9 +13515,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -13344,30 +13542,23 @@ echo "$as_me: WARNING: X11/SM/SMlib.h:     section \"Present But Cannot Be Compi
 echo "$as_me: WARNING: X11/SM/SMlib.h: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: X11/SM/SMlib.h: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: X11/SM/SMlib.h: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for X11/SM/SMlib.h" >&5
-echo $ECHO_N "checking for X11/SM/SMlib.h... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for X11/SM/SMlib.h" >&5
+echo $ECHO_N "checking for X11/SM/SMlib.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_X11_SM_SMlib_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_cv_header_X11_SM_SMlib_h=$ac_header_preproc
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_X11_SM_SMlib_h" >&5
-echo "${ECHO_T}$ac_cv_header_X11_SM_SMlib_h" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_X11_SM_SMlib_h" >&5
+echo "${ECHO_T}$ac_cv_header_X11_SM_SMlib_h" >&6; }
 
 fi
 if test $ac_cv_header_X11_SM_SMlib_h = yes; then
-  echo "$as_me:$LINENO: checking for SmcOpenConnection in -lSM" >&5
-echo $ECHO_N "checking for SmcOpenConnection in -lSM... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for SmcOpenConnection in -lSM" >&5
+echo $ECHO_N "checking for SmcOpenConnection in -lSM... $ECHO_C" >&6; }
 if test "${ac_cv_lib_SM_SmcOpenConnection+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -13380,56 +13571,53 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char SmcOpenConnection ();
 int
 main ()
 {
-SmcOpenConnection ();
+return SmcOpenConnection ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_SM_SmcOpenConnection=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_SM_SmcOpenConnection=no
+       ac_cv_lib_SM_SmcOpenConnection=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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_SM_SmcOpenConnection" >&5
-echo "${ECHO_T}$ac_cv_lib_SM_SmcOpenConnection" >&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_SM_SmcOpenConnection" >&5
+echo "${ECHO_T}$ac_cv_lib_SM_SmcOpenConnection" >&6; }
 if test $ac_cv_lib_SM_SmcOpenConnection = yes; then
   HAVE_X_SM=yes
 fi
@@ -13452,8 +13640,8 @@ _ACEOF
 fi
 
 # If netdb.h doesn't declare h_errno, we must declare it by hand.
-echo "$as_me:$LINENO: checking whether netdb declares h_errno" >&5
-echo $ECHO_N "checking whether netdb declares h_errno... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking whether netdb declares h_errno" >&5
+echo $ECHO_N "checking whether netdb declares h_errno... $ECHO_C" >&6; }
 if test "${emacs_cv_netdb_declares_h_errno+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -13473,39 +13661,36 @@ return h_errno;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_netdb_declares_h_errno=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-emacs_cv_netdb_declares_h_errno=no
+       emacs_cv_netdb_declares_h_errno=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $emacs_cv_netdb_declares_h_errno" >&5
-echo "${ECHO_T}$emacs_cv_netdb_declares_h_errno" >&6
+echo "$as_me:$LINENO: result: $emacs_cv_netdb_declares_h_errno" >&5
+echo "${ECHO_T}$emacs_cv_netdb_declares_h_errno" >&6; }
 if test $emacs_cv_netdb_declares_h_errno = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -13516,8 +13701,8 @@ fi
 
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
-echo "$as_me:$LINENO: checking for working alloca.h" >&5
-echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for working alloca.h" >&5
+echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6; }
 if test "${ac_cv_working_alloca_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -13532,44 +13717,42 @@ int
 main ()
 {
 char *p = (char *) alloca (2 * sizeof (int));
+                         if (p) return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_working_alloca_h=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_working_alloca_h=no
+       ac_cv_working_alloca_h=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5
-echo "${ECHO_T}$ac_cv_working_alloca_h" >&6
+echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5
+echo "${ECHO_T}$ac_cv_working_alloca_h" >&6; }
 if test $ac_cv_working_alloca_h = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -13578,8 +13761,8 @@ _ACEOF
 
 fi
 
-echo "$as_me:$LINENO: checking for alloca" >&5
-echo $ECHO_N "checking for alloca... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for alloca" >&5
+echo $ECHO_N "checking for alloca... $ECHO_C" >&6; }
 if test "${ac_cv_func_alloca_works+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -13596,7 +13779,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 #  include <malloc.h>
 #  define alloca _alloca
 # else
-#  if HAVE_ALLOCA_H
+#  ifdef HAVE_ALLOCA_H
 #   include <alloca.h>
 #  else
 #   ifdef _AIX
@@ -13614,44 +13797,42 @@ int
 main ()
 {
 char *p = (char *) alloca (1);
+                                   if (p) return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_func_alloca_works=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_func_alloca_works=no
+       ac_cv_func_alloca_works=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5
-echo "${ECHO_T}$ac_cv_func_alloca_works" >&6
+echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5
+echo "${ECHO_T}$ac_cv_func_alloca_works" >&6; }
 
 if test $ac_cv_func_alloca_works = yes; then
 
@@ -13665,15 +13846,15 @@ else
 # contain a buggy version.  If you still want to use their alloca,
 # use ar to extract alloca.o from them instead of compiling alloca.c.
 
-ALLOCA=alloca.$ac_objext
+ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
 
 cat >>confdefs.h <<\_ACEOF
 #define C_ALLOCA 1
 _ACEOF
 
 
-echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5
-echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5
+echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6; }
 if test "${ac_cv_os_cray+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -13683,7 +13864,7 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#if defined(CRAY) && ! defined(CRAY2)
+#if defined CRAY && ! defined CRAY2
 webecray
 #else
 wenotbecray
 rm -f conftest*
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5
-echo "${ECHO_T}$ac_cv_os_cray" >&6
+echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5
+echo "${ECHO_T}$ac_cv_os_cray" >&6; }
 if test $ac_cv_os_cray = yes; then
   for ac_func in _getb67 GETB67 getb67; do
     as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -13732,68 +13913,60 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
 
 cat >>confdefs.h <<_ACEOF
@@ -13806,8 +13979,8 @@ fi
   done
 fi
 
-echo "$as_me:$LINENO: checking stack direction for C alloca" >&5
-echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking stack direction for C alloca" >&5
+echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6; }
 if test "${ac_cv_c_stack_direction+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -13820,6 +13993,7 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+$ac_includes_default
 int
 find_stack_direction ()
 {
@@ -13837,17 +14011,26 @@ find_stack_direction ()
 int
 main ()
 {
-  exit (find_stack_direction () < 0);
+  return find_stack_direction () < 0;
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+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>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (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_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -13860,11 +14043,13 @@ sed 's/^/| /' conftest.$ac_ext >&5
 ( exit $ac_status )
 ac_cv_c_stack_direction=-1
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
+
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5
-echo "${ECHO_T}$ac_cv_c_stack_direction" >&6
+echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5
+echo "${ECHO_T}$ac_cv_c_stack_direction" >&6; }
 
 cat >>confdefs.h <<_ACEOF
 #define STACK_DIRECTION $ac_cv_c_stack_direction
@@ -13877,8 +14062,8 @@ fi
 # fmod, logb, and frexp are found in -lm on most systems.
 # On HPUX 9.01, -lm does not contain logb, so check for sqrt.
 
-echo "$as_me:$LINENO: checking for sqrt in -lm" >&5
-echo $ECHO_N "checking for sqrt in -lm... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for sqrt in -lm" >&5
+echo $ECHO_N "checking for sqrt in -lm... $ECHO_C" >&6; }
 if test "${ac_cv_lib_m_sqrt+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -13891,56 +14076,53 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char sqrt ();
 int
 main ()
 {
-sqrt ();
+return sqrt ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_m_sqrt=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_m_sqrt=no
+       ac_cv_lib_m_sqrt=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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_m_sqrt" >&5
-echo "${ECHO_T}$ac_cv_lib_m_sqrt" >&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_m_sqrt" >&5
+echo "${ECHO_T}$ac_cv_lib_m_sqrt" >&6; }
 if test $ac_cv_lib_m_sqrt = yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBM 1
@@ -13954,8 +14136,8 @@ fi
 # Check for mail-locking functions in a "mail" library.  Probably this should
 # have the same check as for liblockfile below.
 
-echo "$as_me:$LINENO: checking for maillock in -lmail" >&5
-echo $ECHO_N "checking for maillock in -lmail... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for maillock in -lmail" >&5
+echo $ECHO_N "checking for maillock in -lmail... $ECHO_C" >&6; }
 if test "${ac_cv_lib_mail_maillock+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -13968,56 +14150,53 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char maillock ();
 int
 main ()
 {
-maillock ();
+return maillock ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_mail_maillock=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_mail_maillock=no
+       ac_cv_lib_mail_maillock=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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_mail_maillock" >&5
-echo "${ECHO_T}$ac_cv_lib_mail_maillock" >&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_mail_maillock" >&5
+echo "${ECHO_T}$ac_cv_lib_mail_maillock" >&6; }
 if test $ac_cv_lib_mail_maillock = yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBMAIL 1
@@ -14028,8 +14207,8 @@ _ACEOF
 fi
 
 
-echo "$as_me:$LINENO: checking for maillock in -llockfile" >&5
-echo $ECHO_N "checking for maillock in -llockfile... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for maillock in -llockfile" >&5
+echo $ECHO_N "checking for maillock in -llockfile... $ECHO_C" >&6; }
 if test "${ac_cv_lib_lockfile_maillock+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -14042,56 +14221,53 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char maillock ();
 int
 main ()
 {
-maillock ();
+return maillock ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_lockfile_maillock=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_lockfile_maillock=no
+       ac_cv_lib_lockfile_maillock=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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_lockfile_maillock" >&5
-echo "${ECHO_T}$ac_cv_lib_lockfile_maillock" >&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_lockfile_maillock" >&5
+echo "${ECHO_T}$ac_cv_lib_lockfile_maillock" >&6; }
 if test $ac_cv_lib_lockfile_maillock = yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBLOCKFILE 1
@@ -14107,8 +14283,8 @@ fi
 if test "$ac_cv_lib_lockfile_maillock" = no; then
       # Extract the first word of "liblockfile.so", so it can be a program name with args.
 set dummy liblockfile.so; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
 if test "${ac_cv_prog_liblockfile+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
   for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
     ac_cv_prog_liblockfile="yes"
     echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 done
+IFS=$as_save_IFS
 
   test -z "$ac_cv_prog_liblockfile" && ac_cv_prog_liblockfile="no"
 fi
 fi
 liblockfile=$ac_cv_prog_liblockfile
 if test -n "$liblockfile"; then
-  echo "$as_me:$LINENO: result: $liblockfile" >&5
-echo "${ECHO_T}$liblockfile" >&6
+  echo "$as_me:$LINENO: result: $liblockfile" >&5
+echo "${ECHO_T}$liblockfile" >&6; }
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
+
   if test $ac_cv_prog_liblockfile = yes; then
     { { echo "$as_me:$LINENO: error: Shared liblockfile found but can't link against it.
 This probably means that movemail could lose mail.
@@ -14157,9 +14335,9 @@ fi
 for ac_func in touchlock
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -14185,68 +14363,60 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
@@ -14259,18 +14429,19 @@ done
 for ac_header in maillock.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -14281,41 +14452,37 @@ $ac_includes_default
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f 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.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -14324,24 +14491,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -14349,9 +14514,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -14375,25 +14541,19 @@ echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
@@ -14485,9 +14645,9 @@ gai_strerror mkstemp getline getdelim mremap memmove fsync bzero \
 memset memcmp difftime memcpy mempcpy mblen mbrlen posix_memalign
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -14513,68 +14673,60 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
@@ -14588,18 +14740,19 @@ done
 for ac_header in sys/un.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -14610,41 +14763,37 @@ $ac_includes_default
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f 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.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -14653,24 +14802,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -14678,9 +14825,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -14704,25 +14852,19 @@ echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
@@ -14738,21 +14880,23 @@ done
 
 
 
-for ac_header in stdlib.h sys/time.h unistd.h
+
+for ac_header in $ac_header_list
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -14763,41 +14907,37 @@ $ac_includes_default
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f 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.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -14806,24 +14946,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -14831,9 +14969,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -14857,25 +14996,19 @@ echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
 done
 
 
-for ac_func in alarm
+
+
+
+
+
+
+
+for ac_func in $ac_func_list
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -14919,68 +15059,60 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
@@ -14989,8 +15121,24 @@ _ACEOF
 fi
 done
 
-echo "$as_me:$LINENO: checking for working mktime" >&5
-echo $ECHO_N "checking for working mktime... $ECHO_C" >&6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ echo "$as_me:$LINENO: checking for working mktime" >&5
+echo $ECHO_N "checking for working mktime... $ECHO_C" >&6; }
 if test "${ac_cv_func_working_mktime+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -15004,26 +15152,24 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 /* Test program from Paul Eggert and Tony Leneis.  */
-#if TIME_WITH_SYS_TIME
+#ifdef TIME_WITH_SYS_TIME
 # include <sys/time.h>
 # include <time.h>
 #else
-# if HAVE_SYS_TIME_H
+# ifdef HAVE_SYS_TIME_H
 #  include <sys/time.h>
 # else
 #  include <time.h>
 # endif
 #endif
 
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
+#include <stdlib.h>
 
-#if HAVE_UNISTD_H
+#ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif
 
-#if !HAVE_ALARM
+#ifndef HAVE_ALARM
 # define alarm(X) /* empty */
 #endif
 
@@ -15040,9 +15186,9 @@ static char *tz_strings[] = {
 };
 #define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
 
-/* Fail if mktime fails to convert a date in the spring-forward gap.
+/* Return 0 if mktime fails to convert a date in the spring-forward gap.
    Based on a problem report from Andreas Jaeger.  */
-static void
+static int
 spring_forward_gap ()
 {
   /* glibc (up to about 1998-10-07) failed this test. */
@@ -15061,29 +15207,27 @@ spring_forward_gap ()
   tm.tm_min = 0;
   tm.tm_sec = 0;
   tm.tm_isdst = -1;
-  if (mktime (&tm) == (time_t)-1)
-    exit (1);
+  return mktime (&tm) != (time_t) -1;
 }
 
-static void
+static int
 mktime_test1 (now)
      time_t now;
 {
   struct tm *lt;
-  if ((lt = localtime (&now)) && mktime (lt) != now)
-    exit (1);
+  return ! (lt = localtime (&now)) || mktime (lt) == now;
 }
 
-static void
+static int
 mktime_test (now)
      time_t now;
 {
-  mktime_test1 (now);
-  mktime_test1 ((time_t) (time_t_max - now));
-  mktime_test1 ((time_t) (time_t_min + now));
+  return (mktime_test1 (now)
+         && mktime_test1 ((time_t) (time_t_max - now))
+         && mktime_test1 ((time_t) (time_t_min + now)));
 }
 
-static void
+static int
 irix_6_4_bug ()
 {
   /* Based on code from Ariel Faigon.  */
@@ -15096,11 +15240,10 @@ irix_6_4_bug ()
   tm.tm_sec = 0;
   tm.tm_isdst = -1;
   mktime (&tm);
-  if (tm.tm_mon != 2 || tm.tm_mday != 31)
-    exit (1);
+  return tm.tm_mon == 2 && tm.tm_mday == 31;
 }
 
-static void
+static int
 bigtime_test (j)
      int j;
 {
@@ -15122,8 +15265,39 @@ bigtime_test (j)
             && lt->tm_wday == tm.tm_wday
             && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst)
                  == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst))))
-       exit (1);
+       return 0;
     }
+  return 1;
+}
+
+static int
+year_2050_test ()
+{
+  /* The correct answer for 2050-02-01 00:00:00 in Pacific time,
+     ignoring leap seconds.  */
+  unsigned long int answer = 2527315200UL;
+
+  struct tm tm;
+  time_t t;
+  tm.tm_year = 2050 - 1900;
+  tm.tm_mon = 2 - 1;
+  tm.tm_mday = 1;
+  tm.tm_hour = tm.tm_min = tm.tm_sec = 0;
+  tm.tm_isdst = -1;
+
+  /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
+     instead of "TZ=America/Vancouver" in order to detect the bug even
+     on systems that don't support the Olson extension, or don't have the
+     full zoneinfo tables installed.  */
+  putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
+
+  t = mktime (&tm);
+
+  /* Check that the result is either a failure, or close enough
+     to the correct answer that we can assume the discrepancy is
+     due to leap seconds.  */
+  return (t == (time_t) -1
+         || (0 < t && answer - 120 <= t && t <= answer + 120));
 }
 
 int
@@ -15150,28 +15324,39 @@ main ()
        putenv (tz_strings[i]);
 
       for (t = 0; t <= time_t_max - delta; t += delta)
-       mktime_test (t);
-      mktime_test ((time_t) 1);
-      mktime_test ((time_t) (60 * 60));
-      mktime_test ((time_t) (60 * 60 * 24));
+       if (! mktime_test (t))
+         return 1;
+      if (! (mktime_test ((time_t) 1)
+            && mktime_test ((time_t) (60 * 60))
+            && mktime_test ((time_t) (60 * 60 * 24))))
+       return 1;
 
       for (j = 1; 0 < j; j *= 2)
-       bigtime_test (j);
-      bigtime_test (j - 1);
+       if (! bigtime_test (j))
+         return 1;
+      if (! bigtime_test (j - 1))
+       return 1;
     }
-  irix_6_4_bug ();
-  spring_forward_gap ();
-  exit (0);
+  return ! (irix_6_4_bug () && spring_forward_gap () && year_2050_test ());
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+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>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (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_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -15184,18 +15369,18 @@ sed 's/^/| /' conftest.$ac_ext >&5
 ( exit $ac_status )
 ac_cv_func_working_mktime=no
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
+
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_working_mktime" >&5
-echo "${ECHO_T}$ac_cv_func_working_mktime" >&6
+echo "$as_me:$LINENO: result: $ac_cv_func_working_mktime" >&5
+echo "${ECHO_T}$ac_cv_func_working_mktime" >&6; }
 if test $ac_cv_func_working_mktime = no; then
-  case $LIBOBJS in
-    "mktime.$ac_objext"   | \
-  *" mktime.$ac_objext"   | \
-    "mktime.$ac_objext "* | \
+  case " $LIBOBJS " in
   *" mktime.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS mktime.$ac_objext" ;;
+  *) LIBOBJS="$LIBOBJS mktime.$ac_objext"
+ ;;
 esac
 
 fi
@@ -15219,8 +15404,8 @@ echo "$as_me: error: $srcdir/$ac_config_libobj_dir/getloadavg.c is missing" >&2;
 ac_save_LIBS=$LIBS
 
 # Check for getloadavg, but be sure not to touch the cache variable.
-(echo "$as_me:$LINENO: checking for getloadavg" >&5
-echo $ECHO_N "checking for getloadavg... $ECHO_C" >&6
+(echo "$as_me:$LINENO: checking for getloadavg" >&5
+echo $ECHO_N "checking for getloadavg... $ECHO_C" >&6; }
 if test "${ac_cv_func_getloadavg+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -15247,68 +15432,59 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef getloadavg
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char getloadavg ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_getloadavg) || defined (__stub___getloadavg)
+#if defined __stub_getloadavg || defined __stub___getloadavg
 choke me
-#else
-char (*f) () = getloadavg;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != getloadavg;
+return getloadavg ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_func_getloadavg=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_func_getloadavg=no
+       ac_cv_func_getloadavg=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_getloadavg" >&5
-echo "${ECHO_T}$ac_cv_func_getloadavg" >&6
+echo "$as_me:$LINENO: result: $ac_cv_func_getloadavg" >&5
+echo "${ECHO_T}$ac_cv_func_getloadavg" >&6; }
 if test $ac_cv_func_getloadavg = yes; then
   exit 0
 else
@@ -15321,9 +15497,9 @@ fi
 for ac_func in pstat_getdynamic
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -15349,68 +15525,60 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
@@ -15422,8 +15590,8 @@ done
 
 # Solaris has libkstat which does not require root.
 
-echo "$as_me:$LINENO: checking for kstat_open in -lkstat" >&5
-echo $ECHO_N "checking for kstat_open in -lkstat... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for kstat_open in -lkstat" >&5
+echo $ECHO_N "checking for kstat_open in -lkstat... $ECHO_C" >&6; }
 if test "${ac_cv_lib_kstat_kstat_open+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -15436,56 +15604,53 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char kstat_open ();
 int
 main ()
 {
-kstat_open ();
+return kstat_open ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_kstat_kstat_open=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_kstat_kstat_open=no
+       ac_cv_lib_kstat_kstat_open=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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_kstat_kstat_open" >&5
-echo "${ECHO_T}$ac_cv_lib_kstat_kstat_open" >&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_kstat_kstat_open" >&5
+echo "${ECHO_T}$ac_cv_lib_kstat_kstat_open" >&6; }
 if test $ac_cv_lib_kstat_kstat_open = yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBKSTAT 1
@@ -15502,8 +15667,8 @@ test $ac_cv_lib_kstat_kstat_open = yes && ac_have_func=yes
 # to get the right answer into the cache.
 # For kstat on solaris, we need libelf to force the definition of SVR4 below.
 if test $ac_have_func = no; then
-  echo "$as_me:$LINENO: checking for elf_begin in -lelf" >&5
-echo $ECHO_N "checking for elf_begin in -lelf... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for elf_begin in -lelf" >&5
+echo $ECHO_N "checking for elf_begin in -lelf... $ECHO_C" >&6; }
 if test "${ac_cv_lib_elf_elf_begin+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -15516,64 +15681,61 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char elf_begin ();
 int
 main ()
 {
-elf_begin ();
+return elf_begin ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_elf_elf_begin=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_elf_elf_begin=no
+       ac_cv_lib_elf_elf_begin=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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_elf_elf_begin" >&5
-echo "${ECHO_T}$ac_cv_lib_elf_elf_begin" >&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_elf_elf_begin" >&5
+echo "${ECHO_T}$ac_cv_lib_elf_elf_begin" >&6; }
 if test $ac_cv_lib_elf_elf_begin = yes; then
   LIBS="-lelf $LIBS"
 fi
 
 fi
 if test $ac_have_func = no; then
-  echo "$as_me:$LINENO: checking for kvm_open in -lkvm" >&5
-echo $ECHO_N "checking for kvm_open in -lkvm... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for kvm_open in -lkvm" >&5
+echo $ECHO_N "checking for kvm_open in -lkvm... $ECHO_C" >&6; }
 if test "${ac_cv_lib_kvm_kvm_open+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -15586,63 +15748,60 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char kvm_open ();
 int
 main ()
 {
-kvm_open ();
+return kvm_open ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_kvm_kvm_open=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_kvm_kvm_open=no
+       ac_cv_lib_kvm_kvm_open=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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_kvm_kvm_open" >&5
-echo "${ECHO_T}$ac_cv_lib_kvm_kvm_open" >&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_kvm_kvm_open" >&5
+echo "${ECHO_T}$ac_cv_lib_kvm_kvm_open" >&6; }
 if test $ac_cv_lib_kvm_kvm_open = yes; then
   LIBS="-lkvm $LIBS"
 fi
 
   # Check for the 4.4BSD definition of getloadavg.
-  echo "$as_me:$LINENO: checking for getloadavg in -lutil" >&5
-echo $ECHO_N "checking for getloadavg in -lutil... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for getloadavg in -lutil" >&5
+echo $ECHO_N "checking for getloadavg in -lutil... $ECHO_C" >&6; }
 if test "${ac_cv_lib_util_getloadavg+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -15655,56 +15814,53 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char getloadavg ();
 int
 main ()
 {
-getloadavg ();
+return getloadavg ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_util_getloadavg=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_util_getloadavg=no
+       ac_cv_lib_util_getloadavg=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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_util_getloadavg" >&5
-echo "${ECHO_T}$ac_cv_lib_util_getloadavg" >&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_util_getloadavg" >&5
+echo "${ECHO_T}$ac_cv_lib_util_getloadavg" >&6; }
 if test $ac_cv_lib_util_getloadavg = yes; then
   LIBS="-lutil $LIBS" ac_have_func=yes ac_cv_func_getloadavg_setgid=yes
 fi
@@ -15716,8 +15872,8 @@ if test $ac_have_func = no; then
   # Since it is not a standard part of AIX, it might be installed locally.
   ac_getloadavg_LIBS=$LIBS
   LIBS="-L/usr/local/lib $LIBS"
-  echo "$as_me:$LINENO: checking for getloadavg in -lgetloadavg" >&5
-echo $ECHO_N "checking for getloadavg in -lgetloadavg... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for getloadavg in -lgetloadavg" >&5
+echo $ECHO_N "checking for getloadavg in -lgetloadavg... $ECHO_C" >&6; }
 if test "${ac_cv_lib_getloadavg_getloadavg+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -15730,56 +15886,53 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char getloadavg ();
 int
 main ()
 {
-getloadavg ();
+return getloadavg ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_getloadavg_getloadavg=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_getloadavg_getloadavg=no
+       ac_cv_lib_getloadavg_getloadavg=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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_getloadavg_getloadavg" >&5
-echo "${ECHO_T}$ac_cv_lib_getloadavg_getloadavg" >&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_getloadavg_getloadavg" >&5
+echo "${ECHO_T}$ac_cv_lib_getloadavg_getloadavg" >&6; }
 if test $ac_cv_lib_getloadavg_getloadavg = yes; then
   LIBS="-lgetloadavg $LIBS"
 else
@@ -15794,9 +15947,9 @@ fi
 for ac_func in getloadavg
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -15822,80 +15975,70 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 else
-  case $LIBOBJS in
-    "getloadavg.$ac_objext"   | \
-  *" getloadavg.$ac_objext"   | \
-    "getloadavg.$ac_objext "* | \
+  case " $LIBOBJS " in
   *" getloadavg.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS getloadavg.$ac_objext" ;;
+  *) LIBOBJS="$LIBOBJS getloadavg.$ac_objext"
+ ;;
 esac
 
 
@@ -15906,17 +16049,17 @@ _ACEOF
 # Figure out what our getloadavg.c needs.
 ac_have_func=no
 if test "${ac_cv_header_sys_dg_sys_info_h+set}" = set; then
-  echo "$as_me:$LINENO: checking for sys/dg_sys_info.h" >&5
-echo $ECHO_N "checking for sys/dg_sys_info.h... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for sys/dg_sys_info.h" >&5
+echo $ECHO_N "checking for sys/dg_sys_info.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_sys_dg_sys_info_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_sys_dg_sys_info_h" >&5
-echo "${ECHO_T}$ac_cv_header_sys_dg_sys_info_h" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_sys_dg_sys_info_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_dg_sys_info_h" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking sys/dg_sys_info.h usability" >&5
-echo $ECHO_N "checking sys/dg_sys_info.h usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking sys/dg_sys_info.h usability" >&5
+echo $ECHO_N "checking sys/dg_sys_info.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -15927,41 +16070,37 @@ $ac_includes_default
 #include <sys/dg_sys_info.h>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f 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.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking sys/dg_sys_info.h presence" >&5
-echo $ECHO_N "checking sys/dg_sys_info.h presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking sys/dg_sys_info.h presence" >&5
+echo $ECHO_N "checking sys/dg_sys_info.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -15970,24 +16109,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <sys/dg_sys_info.h>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -15995,9 +16132,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -16021,25 +16159,18 @@ echo "$as_me: WARNING: sys/dg_sys_info.h:     section \"Present But Cannot Be Co
 echo "$as_me: WARNING: sys/dg_sys_info.h: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: sys/dg_sys_info.h: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: sys/dg_sys_info.h: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for sys/dg_sys_info.h" >&5
-echo $ECHO_N "checking for sys/dg_sys_info.h... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for sys/dg_sys_info.h" >&5
+echo $ECHO_N "checking for sys/dg_sys_info.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_sys_dg_sys_info_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_cv_header_sys_dg_sys_info_h=$ac_header_preproc
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_sys_dg_sys_info_h" >&5
-echo "${ECHO_T}$ac_cv_header_sys_dg_sys_info_h" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_sys_dg_sys_info_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_dg_sys_info_h" >&6; }
 
 fi
 if test $ac_cv_header_sys_dg_sys_info_h = yes; then
@@ -16050,8 +16181,8 @@ cat >>confdefs.h <<\_ACEOF
 _ACEOF
 
 
-echo "$as_me:$LINENO: checking for dg_sys_info in -ldgc" >&5
-echo $ECHO_N "checking for dg_sys_info in -ldgc... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for dg_sys_info in -ldgc" >&5
+echo $ECHO_N "checking for dg_sys_info in -ldgc... $ECHO_C" >&6; }
 if test "${ac_cv_lib_dgc_dg_sys_info+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -16064,56 +16195,53 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char dg_sys_info ();
 int
 main ()
 {
-dg_sys_info ();
+return dg_sys_info ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_dgc_dg_sys_info=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_dgc_dg_sys_info=no
+       ac_cv_lib_dgc_dg_sys_info=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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_dgc_dg_sys_info" >&5
-echo "${ECHO_T}$ac_cv_lib_dgc_dg_sys_info" >&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_dgc_dg_sys_info" >&5
+echo "${ECHO_T}$ac_cv_lib_dgc_dg_sys_info" >&6; }
 if test $ac_cv_lib_dgc_dg_sys_info = yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBDGC 1
 
 
 if test "${ac_cv_header_locale_h+set}" = set; then
-  echo "$as_me:$LINENO: checking for locale.h" >&5
-echo $ECHO_N "checking for locale.h... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for locale.h" >&5
+echo $ECHO_N "checking for locale.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_locale_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_locale_h" >&5
-echo "${ECHO_T}$ac_cv_header_locale_h" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_locale_h" >&5
+echo "${ECHO_T}$ac_cv_header_locale_h" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking locale.h usability" >&5
-echo $ECHO_N "checking locale.h usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking locale.h usability" >&5
+echo $ECHO_N "checking locale.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -16149,41 +16277,37 @@ $ac_includes_default
 #include <locale.h>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f 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.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking locale.h presence" >&5
-echo $ECHO_N "checking locale.h presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking locale.h presence" >&5
+echo $ECHO_N "checking locale.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -16192,24 +16316,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <locale.h>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -16217,9 +16339,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -16243,25 +16366,18 @@ echo "$as_me: WARNING: locale.h:     section \"Present But Cannot Be Compiled\""
 echo "$as_me: WARNING: locale.h: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: locale.h: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: locale.h: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for locale.h" >&5
-echo $ECHO_N "checking for locale.h... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for locale.h" >&5
+echo $ECHO_N "checking for locale.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_locale_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_cv_header_locale_h=$ac_header_preproc
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_locale_h" >&5
-echo "${ECHO_T}$ac_cv_header_locale_h" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_locale_h" >&5
+echo "${ECHO_T}$ac_cv_header_locale_h" >&6; }
 
 fi
 
@@ -16270,9 +16386,9 @@ fi
 for ac_func in setlocale
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -16298,68 +16414,60 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 
 if test $ac_have_func = no; then
   if test "${ac_cv_header_inq_stats_cpustats_h+set}" = set; then
-  echo "$as_me:$LINENO: checking for inq_stats/cpustats.h" >&5
-echo $ECHO_N "checking for inq_stats/cpustats.h... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for inq_stats/cpustats.h" >&5
+echo $ECHO_N "checking for inq_stats/cpustats.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_inq_stats_cpustats_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_inq_stats_cpustats_h" >&5
-echo "${ECHO_T}$ac_cv_header_inq_stats_cpustats_h" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_inq_stats_cpustats_h" >&5
+echo "${ECHO_T}$ac_cv_header_inq_stats_cpustats_h" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking inq_stats/cpustats.h usability" >&5
-echo $ECHO_N "checking inq_stats/cpustats.h usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking inq_stats/cpustats.h usability" >&5
+echo $ECHO_N "checking inq_stats/cpustats.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -16404,41 +16512,37 @@ $ac_includes_default
 #include <inq_stats/cpustats.h>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f 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.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking inq_stats/cpustats.h presence" >&5
-echo $ECHO_N "checking inq_stats/cpustats.h presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking inq_stats/cpustats.h presence" >&5
+echo $ECHO_N "checking inq_stats/cpustats.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -16447,24 +16551,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <inq_stats/cpustats.h>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -16472,9 +16574,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -16498,25 +16601,18 @@ echo "$as_me: WARNING: inq_stats/cpustats.h:     section \"Present But Cannot Be
 echo "$as_me: WARNING: inq_stats/cpustats.h: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: inq_stats/cpustats.h: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: inq_stats/cpustats.h: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for inq_stats/cpustats.h" >&5
-echo $ECHO_N "checking for inq_stats/cpustats.h... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for inq_stats/cpustats.h" >&5
+echo $ECHO_N "checking for inq_stats/cpustats.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_inq_stats_cpustats_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_cv_header_inq_stats_cpustats_h=$ac_header_preproc
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_inq_stats_cpustats_h" >&5
-echo "${ECHO_T}$ac_cv_header_inq_stats_cpustats_h" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_inq_stats_cpustats_h" >&5
+echo "${ECHO_T}$ac_cv_header_inq_stats_cpustats_h" >&6; }
 
 fi
 if test $ac_cv_header_inq_stats_cpustats_h = yes; then
 
 if test $ac_have_func = no; then
   if test "${ac_cv_header_sys_cpustats_h+set}" = set; then
-  echo "$as_me:$LINENO: checking for sys/cpustats.h" >&5
-echo $ECHO_N "checking for sys/cpustats.h... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for sys/cpustats.h" >&5
+echo $ECHO_N "checking for sys/cpustats.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_sys_cpustats_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_sys_cpustats_h" >&5
-echo "${ECHO_T}$ac_cv_header_sys_cpustats_h" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_sys_cpustats_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_cpustats_h" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking sys/cpustats.h usability" >&5
-echo $ECHO_N "checking sys/cpustats.h usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking sys/cpustats.h usability" >&5
+echo $ECHO_N "checking sys/cpustats.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -16559,41 +16655,37 @@ $ac_includes_default
 #include <sys/cpustats.h>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f 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.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking sys/cpustats.h presence" >&5
-echo $ECHO_N "checking sys/cpustats.h presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking sys/cpustats.h presence" >&5
+echo $ECHO_N "checking sys/cpustats.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -16602,24 +16694,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <sys/cpustats.h>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -16627,9 +16717,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -16653,25 +16744,18 @@ echo "$as_me: WARNING: sys/cpustats.h:     section \"Present But Cannot Be Compi
 echo "$as_me: WARNING: sys/cpustats.h: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: sys/cpustats.h: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: sys/cpustats.h: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for sys/cpustats.h" >&5
-echo $ECHO_N "checking for sys/cpustats.h... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for sys/cpustats.h" >&5
+echo $ECHO_N "checking for sys/cpustats.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_sys_cpustats_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_cv_header_sys_cpustats_h=$ac_header_preproc
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_sys_cpustats_h" >&5
-echo "${ECHO_T}$ac_cv_header_sys_cpustats_h" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_sys_cpustats_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_cpustats_h" >&6; }
 
 fi
 if test $ac_cv_header_sys_cpustats_h = yes; then
@@ -16689,18 +16773,19 @@ if test $ac_have_func = no; then
 for ac_header in mach/mach.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -16711,41 +16796,37 @@ $ac_includes_default
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f 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.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -16754,24 +16835,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -16779,9 +16858,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -16805,25 +16885,19 @@ echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
 for ac_header in nlist.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -16863,41 +16938,37 @@ $ac_includes_default
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f 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.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -16906,24 +16977,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -16931,9 +17000,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -16957,33 +17027,27 @@ echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
- echo "$as_me:$LINENO: checking for struct nlist.n_un.n_name" >&5
-echo $ECHO_N "checking for struct nlist.n_un.n_name... $ECHO_C" >&6
echo "$as_me:$LINENO: checking for struct nlist.n_un.n_name" >&5
+echo $ECHO_N "checking for struct nlist.n_un.n_name... $ECHO_C" >&6; }
 if test "${ac_cv_member_struct_nlist_n_un_n_name+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -17006,33 +17070,28 @@ return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_nlist_n_un_n_name=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >conftest.$ac_ext <<_ACEOF
+       cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -17051,40 +17110,37 @@ return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_nlist_n_un_n_name=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_member_struct_nlist_n_un_n_name=no
+       ac_cv_member_struct_nlist_n_un_n_name=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_member_struct_nlist_n_un_n_name" >&5
-echo "${ECHO_T}$ac_cv_member_struct_nlist_n_un_n_name" >&6
+echo "$as_me:$LINENO: result: $ac_cv_member_struct_nlist_n_un_n_name" >&5
+echo "${ECHO_T}$ac_cv_member_struct_nlist_n_un_n_name" >&6; }
 if test $ac_cv_member_struct_nlist_n_un_n_name = yes; then
 
 cat >>confdefs.h <<_ACEOF
@@ -17108,8 +17164,8 @@ done
 
 
 # Some definitions of getloadavg require that the program be installed setgid.
-echo "$as_me:$LINENO: checking whether getloadavg requires setgid" >&5
-echo $ECHO_N "checking whether getloadavg requires setgid... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking whether getloadavg requires setgid" >&5
+echo $ECHO_N "checking whether getloadavg requires setgid... $ECHO_C" >&6; }
 if test "${ac_cv_func_getloadavg_setgid+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -17133,8 +17189,8 @@ fi
 rm -f conftest*
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_getloadavg_setgid" >&5
-echo "${ECHO_T}$ac_cv_func_getloadavg_setgid" >&6
+echo "$as_me:$LINENO: result: $ac_cv_func_getloadavg_setgid" >&5
+echo "${ECHO_T}$ac_cv_func_getloadavg_setgid" >&6; }
 if test $ac_cv_func_getloadavg_setgid = yes; then
   NEED_SETGID=true
 
@@ -17147,8 +17203,8 @@ else
 fi
 
 if test $ac_cv_func_getloadavg_setgid = yes; then
-  echo "$as_me:$LINENO: checking group of /dev/kmem" >&5
-echo $ECHO_N "checking group of /dev/kmem... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking group of /dev/kmem" >&5
+echo $ECHO_N "checking group of /dev/kmem... $ECHO_C" >&6; }
 if test "${ac_cv_group_kmem+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -17162,8 +17218,8 @@ else
               / /s/.* //;p;'`
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_group_kmem" >&5
-echo "${ECHO_T}$ac_cv_group_kmem" >&6
+echo "$as_me:$LINENO: result: $ac_cv_group_kmem" >&5
+echo "${ECHO_T}$ac_cv_group_kmem" >&6; }
   KMEM_GROUP=$ac_cv_group_kmem
 fi
 if test "x$ac_save_LIBS" = x; then
@@ -17175,13 +17231,12 @@ LIBS=$ac_save_LIBS
 
 
 
-echo "$as_me:$LINENO: checking for _LARGEFILE_SOURCE value needed for large files" >&5
-echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for _LARGEFILE_SOURCE value needed for large files" >&5
+echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6; }
 if test "${ac_cv_sys_largefile_source+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   while :; do
-  ac_cv_sys_largefile_source=no
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -17192,40 +17247,39 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-return !fseeko;
+return fseeko (stdin, 0, 0) && (fseeko) (stdin, 0, 0);
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  break
+  (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_sys_largefile_source=no; break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -17237,112 +17291,59 @@ cat >>conftest.$ac_ext <<_ACEOF
 int
 main ()
 {
-return !fseeko;
+return fseeko (stdin, 0, 0) && (fseeko) (stdin, 0, 0);
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_sys_largefile_source=1; break
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+  ac_cv_sys_largefile_source=unknown
   break
 done
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_source" >&5
-echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6
-if test "$ac_cv_sys_largefile_source" != no; then
-
+{ echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_source" >&5
+echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6; }
+case $ac_cv_sys_largefile_source in #(
+  no | unknown) ;;
+  *)
 cat >>confdefs.h <<_ACEOF
 #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
 _ACEOF
-
-fi
+;;
+esac
 rm -f conftest*
 
 # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
 # in glibc 2.1.3, but that breaks too many other things.
 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
-echo "$as_me:$LINENO: checking for fseeko" >&5
-echo $ECHO_N "checking for fseeko... $ECHO_C" >&6
-if test "${ac_cv_func_fseeko+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 <stdio.h>
-int
-main ()
-{
-return fseeko && fseeko (stdin, 0, 0);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_fseeko=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_func_fseeko=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_fseeko" >&5
-echo "${ECHO_T}$ac_cv_func_fseeko" >&6
-if test $ac_cv_func_fseeko = yes; then
+if test $ac_cv_sys_largefile_source != unknown; then
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_FSEEKO 1
 for ac_header in getopt.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -17400,41 +17402,37 @@ $ac_includes_default
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f 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.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -17443,24 +17441,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -17468,9 +17464,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -17494,25 +17491,19 @@ echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
@@ -17531,9 +17522,9 @@ done
 for ac_func in getopt_long_only
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -17559,68 +17550,60 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
@@ -17634,8 +17617,8 @@ done
   fi
 
       if test -z "$GETOPT_H"; then
-    echo "$as_me:$LINENO: checking whether optreset is declared" >&5
-echo $ECHO_N "checking whether optreset is declared... $ECHO_C" >&6
+    echo "$as_me:$LINENO: checking whether optreset is declared" >&5
+echo $ECHO_N "checking whether optreset is declared... $ECHO_C" >&6; }
 if test "${ac_cv_have_decl_optreset+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -17651,7 +17634,7 @@ int
 main ()
 {
 #ifndef optreset
-  char *p = (char *) optreset;
+  (void) optreset;
 #endif
 
   ;
@@ -17659,38 +17642,34 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_have_decl_optreset=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_have_decl_optreset=no
+       ac_cv_have_decl_optreset=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_decl_optreset" >&5
-echo "${ECHO_T}$ac_cv_have_decl_optreset" >&6
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_optreset" >&5
+echo "${ECHO_T}$ac_cv_have_decl_optreset" >&6; }
 if test $ac_cv_have_decl_optreset = yes; then
   GETOPT_H=getopt.h
 fi
   fi
 
       if test -z "$GETOPT_H"; then
-    echo "$as_me:$LINENO: checking for working GNU getopt function" >&5
-echo $ECHO_N "checking for working GNU getopt function... $ECHO_C" >&6
+    echo "$as_me:$LINENO: checking for working GNU getopt function" >&5
+echo $ECHO_N "checking for working GNU getopt function... $ECHO_C" >&6; }
 if test "${gl_cv_func_gnu_getopt+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   if test "$cross_compiling" = yes; then
-                        echo "$as_me:$LINENO: checking whether getopt_clip is declared" >&5
-echo $ECHO_N "checking whether getopt_clip is declared... $ECHO_C" >&6
+                        echo "$as_me:$LINENO: checking whether getopt_clip is declared" >&5
+echo $ECHO_N "checking whether getopt_clip is declared... $ECHO_C" >&6; }
 if test "${ac_cv_have_decl_getopt_clip+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -17721,7 +17700,7 @@ int
 main ()
 {
 #ifndef getopt_clip
-  char *p = (char *) getopt_clip;
+  (void) getopt_clip;
 #endif
 
   ;
@@ -17729,38 +17708,34 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_have_decl_getopt_clip=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_have_decl_getopt_clip=no
+       ac_cv_have_decl_getopt_clip=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_have_decl_getopt_clip" >&5
-echo "${ECHO_T}$ac_cv_have_decl_getopt_clip" >&6
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_getopt_clip" >&5
+echo "${ECHO_T}$ac_cv_have_decl_getopt_clip" >&6; }
 if test $ac_cv_have_decl_getopt_clip = yes; then
   gl_cv_func_gnu_getopt=no
 else
@@ -17790,13 +17765,22 @@ main ()
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+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>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (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_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -17809,11 +17793,13 @@ sed 's/^/| /' conftest.$ac_ext >&5
 ( exit $ac_status )
 gl_cv_func_gnu_getopt=no
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
+
+
 fi
-echo "$as_me:$LINENO: result: $gl_cv_func_gnu_getopt" >&5
-echo "${ECHO_T}$gl_cv_func_gnu_getopt" >&6
+echo "$as_me:$LINENO: result: $gl_cv_func_gnu_getopt" >&5
+echo "${ECHO_T}$gl_cv_func_gnu_getopt" >&6; }
     if test "$gl_cv_func_gnu_getopt" = "no"; then
       GETOPT_H=getopt.h
     fi
@@ -17840,8 +17826,8 @@ fi
 
 
 
-echo "$as_me:$LINENO: checking whether getpgrp requires zero arguments" >&5
-echo $ECHO_N "checking whether getpgrp requires zero arguments... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking whether getpgrp requires zero arguments" >&5
+echo $ECHO_N "checking whether getpgrp requires zero arguments... $ECHO_C" >&6; }
 if test "${ac_cv_func_getpgrp_void+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -17862,39 +17848,35 @@ getpgrp (0);
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_func_getpgrp_void=no
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_func_getpgrp_void=yes
+       ac_cv_func_getpgrp_void=yes
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_getpgrp_void" >&5
-echo "${ECHO_T}$ac_cv_func_getpgrp_void" >&6
+echo "$as_me:$LINENO: result: $ac_cv_func_getpgrp_void" >&5
+echo "${ECHO_T}$ac_cv_func_getpgrp_void" >&6; }
 if test $ac_cv_func_getpgrp_void = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -17908,9 +17890,9 @@ fi
 for ac_func in strftime
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -17936,68 +17918,60 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
@@ -18005,8 +17979,8 @@ _ACEOF
 
 else
   # strftime is in -lintl on SCO UNIX.
-echo "$as_me:$LINENO: checking for strftime in -lintl" >&5
-echo $ECHO_N "checking for strftime in -lintl... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for strftime in -lintl" >&5
+echo $ECHO_N "checking for strftime in -lintl... $ECHO_C" >&6; }
 if test "${ac_cv_lib_intl_strftime+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -18019,56 +17993,53 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char strftime ();
 int
 main ()
 {
-strftime ();
+return strftime ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_intl_strftime=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_intl_strftime=no
+       ac_cv_lib_intl_strftime=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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_intl_strftime" >&5
-echo "${ECHO_T}$ac_cv_lib_intl_strftime" >&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_intl_strftime" >&5
+echo "${ECHO_T}$ac_cv_lib_intl_strftime" >&6; }
 if test $ac_cv_lib_intl_strftime = yes; then
   cat >>confdefs.h <<\_ACEOF
 #define HAVE_STRFTIME 1
@@ -18086,9 +18057,9 @@ done
 for ac_func in grantpt
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -18114,68 +18085,60 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
@@ -18190,9 +18153,9 @@ done
 for ac_func in getpt
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -18218,68 +18181,60 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
@@ -18294,8 +18249,8 @@ done
 # It's better to believe a function is not available
 # than to expect to find it in ncurses.
 
-echo "$as_me:$LINENO: checking for tparm in -lncurses" >&5
-echo $ECHO_N "checking for tparm in -lncurses... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for tparm in -lncurses" >&5
+echo $ECHO_N "checking for tparm in -lncurses... $ECHO_C" >&6; }
 if test "${ac_cv_lib_ncurses_tparm+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -18308,56 +18263,53 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char tparm ();
 int
 main ()
 {
-tparm ();
+return tparm ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_ncurses_tparm=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_ncurses_tparm=no
+       ac_cv_lib_ncurses_tparm=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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_ncurses_tparm" >&5
-echo "${ECHO_T}$ac_cv_lib_ncurses_tparm" >&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_tparm" >&5
+echo "${ECHO_T}$ac_cv_lib_ncurses_tparm" >&6; }
 if test $ac_cv_lib_ncurses_tparm = yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBNCURSES 1
@@ -18372,8 +18324,8 @@ fi
 if test "$with_hesiod" = yes ; then
   # Don't set $LIBS here -- see comments above.
   resolv=no
-  echo "$as_me:$LINENO: checking for res_send" >&5
-echo $ECHO_N "checking for res_send... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for res_send" >&5
+echo $ECHO_N "checking for res_send... $ECHO_C" >&6; }
 if test "${ac_cv_func_res_send+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -18400,73 +18352,64 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef res_send
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char res_send ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_res_send) || defined (__stub___res_send)
+#if defined __stub_res_send || defined __stub___res_send
 choke me
-#else
-char (*f) () = res_send;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != res_send;
+return res_send ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_func_res_send=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_func_res_send=no
+       ac_cv_func_res_send=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_res_send" >&5
-echo "${ECHO_T}$ac_cv_func_res_send" >&6
+echo "$as_me:$LINENO: result: $ac_cv_func_res_send" >&5
+echo "${ECHO_T}$ac_cv_func_res_send" >&6; }
 if test $ac_cv_func_res_send = yes; then
   :
 else
-  echo "$as_me:$LINENO: checking for __res_send" >&5
-echo $ECHO_N "checking for __res_send... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for __res_send" >&5
+echo $ECHO_N "checking for __res_send... $ECHO_C" >&6; }
 if test "${ac_cv_func___res_send+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -18493,73 +18436,64 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef __res_send
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char __res_send ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub___res_send) || defined (__stub_____res_send)
+#if defined __stub___res_send || defined __stub_____res_send
 choke me
-#else
-char (*f) () = __res_send;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != __res_send;
+return __res_send ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_func___res_send=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_func___res_send=no
+       ac_cv_func___res_send=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func___res_send" >&5
-echo "${ECHO_T}$ac_cv_func___res_send" >&6
+echo "$as_me:$LINENO: result: $ac_cv_func___res_send" >&5
+echo "${ECHO_T}$ac_cv_func___res_send" >&6; }
 if test $ac_cv_func___res_send = yes; then
   :
 else
-  echo "$as_me:$LINENO: checking for res_send in -lresolv" >&5
-echo $ECHO_N "checking for res_send in -lresolv... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for res_send in -lresolv" >&5
+echo $ECHO_N "checking for res_send in -lresolv... $ECHO_C" >&6; }
 if test "${ac_cv_lib_resolv_res_send+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -18572,61 +18506,58 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char res_send ();
 int
 main ()
 {
-res_send ();
+return res_send ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_resolv_res_send=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_resolv_res_send=no
+       ac_cv_lib_resolv_res_send=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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_resolv_res_send" >&5
-echo "${ECHO_T}$ac_cv_lib_resolv_res_send" >&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_res_send" >&5
+echo "${ECHO_T}$ac_cv_lib_resolv_res_send" >&6; }
 if test $ac_cv_lib_resolv_res_send = yes; then
   resolv=yes
 else
-  echo "$as_me:$LINENO: checking for __res_send in -lresolv" >&5
-echo $ECHO_N "checking for __res_send in -lresolv... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for __res_send in -lresolv" >&5
+echo $ECHO_N "checking for __res_send in -lresolv... $ECHO_C" >&6; }
 if test "${ac_cv_lib_resolv___res_send+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -18639,56 +18570,53 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char __res_send ();
 int
 main ()
 {
-__res_send ();
+return __res_send ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_resolv___res_send=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_resolv___res_send=no
+       ac_cv_lib_resolv___res_send=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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_resolv___res_send" >&5
-echo "${ECHO_T}$ac_cv_lib_resolv___res_send" >&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_resolv___res_send" >&5
+echo "${ECHO_T}$ac_cv_lib_resolv___res_send" >&6; }
 if test $ac_cv_lib_resolv___res_send = yes; then
   resolv=yes
 fi
@@ -18709,8 +18637,8 @@ _ACEOF
   else
     RESOLVLIB=
   fi
-  echo "$as_me:$LINENO: checking for hes_getmailhost" >&5
-echo $ECHO_N "checking for hes_getmailhost... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for hes_getmailhost" >&5
+echo $ECHO_N "checking for hes_getmailhost... $ECHO_C" >&6; }
 if test "${ac_cv_func_hes_getmailhost+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -18737,73 +18665,64 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef hes_getmailhost
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char hes_getmailhost ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_hes_getmailhost) || defined (__stub___hes_getmailhost)
+#if defined __stub_hes_getmailhost || defined __stub___hes_getmailhost
 choke me
-#else
-char (*f) () = hes_getmailhost;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != hes_getmailhost;
+return hes_getmailhost ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_func_hes_getmailhost=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_func_hes_getmailhost=no
+       ac_cv_func_hes_getmailhost=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_hes_getmailhost" >&5
-echo "${ECHO_T}$ac_cv_func_hes_getmailhost" >&6
+echo "$as_me:$LINENO: result: $ac_cv_func_hes_getmailhost" >&5
+echo "${ECHO_T}$ac_cv_func_hes_getmailhost" >&6; }
 if test $ac_cv_func_hes_getmailhost = yes; then
   :
 else
-  echo "$as_me:$LINENO: checking for hes_getmailhost in -lhesiod" >&5
-echo $ECHO_N "checking for hes_getmailhost in -lhesiod... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for hes_getmailhost in -lhesiod" >&5
+echo $ECHO_N "checking for hes_getmailhost in -lhesiod... $ECHO_C" >&6; }
 if test "${ac_cv_lib_hesiod_hes_getmailhost+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -18816,56 +18735,53 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char hes_getmailhost ();
 int
 main ()
 {
-hes_getmailhost ();
+return hes_getmailhost ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_hesiod_hes_getmailhost=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_hesiod_hes_getmailhost=no
+       ac_cv_lib_hesiod_hes_getmailhost=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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_hesiod_hes_getmailhost" >&5
-echo "${ECHO_T}$ac_cv_lib_hesiod_hes_getmailhost" >&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_hesiod_hes_getmailhost" >&5
+echo "${ECHO_T}$ac_cv_lib_hesiod_hes_getmailhost" >&6; }
 if test $ac_cv_lib_hesiod_hes_getmailhost = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -18883,8 +18799,8 @@ fi
 # These tell us which Kerberos-related libraries to use.
 if test "${with_kerberos+set}" = set; then
 
-echo "$as_me:$LINENO: checking for com_err in -lcom_err" >&5
-echo $ECHO_N "checking for com_err in -lcom_err... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for com_err in -lcom_err" >&5
+echo $ECHO_N "checking for com_err in -lcom_err... $ECHO_C" >&6; }
 if test "${ac_cv_lib_com_err_com_err+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -18897,56 +18813,53 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char com_err ();
 int
 main ()
 {
-com_err ();
+return com_err ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_com_err_com_err=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_com_err_com_err=no
+       ac_cv_lib_com_err_com_err=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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_com_err_com_err" >&5
-echo "${ECHO_T}$ac_cv_lib_com_err_com_err" >&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_com_err_com_err" >&5
+echo "${ECHO_T}$ac_cv_lib_com_err_com_err" >&6; }
 if test $ac_cv_lib_com_err_com_err = yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBCOM_ERR 1
@@ -18957,8 +18870,8 @@ _ACEOF
 fi
 
 
-echo "$as_me:$LINENO: checking for mit_des_cbc_encrypt in -lk5crypto" >&5
-echo $ECHO_N "checking for mit_des_cbc_encrypt in -lk5crypto... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for mit_des_cbc_encrypt in -lk5crypto" >&5
+echo $ECHO_N "checking for mit_des_cbc_encrypt in -lk5crypto... $ECHO_C" >&6; }
 if test "${ac_cv_lib_k5crypto_mit_des_cbc_encrypt+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -18971,56 +18884,53 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char mit_des_cbc_encrypt ();
 int
 main ()
 {
-mit_des_cbc_encrypt ();
+return mit_des_cbc_encrypt ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_k5crypto_mit_des_cbc_encrypt=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_k5crypto_mit_des_cbc_encrypt=no
+       ac_cv_lib_k5crypto_mit_des_cbc_encrypt=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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_k5crypto_mit_des_cbc_encrypt" >&5
-echo "${ECHO_T}$ac_cv_lib_k5crypto_mit_des_cbc_encrypt" >&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_k5crypto_mit_des_cbc_encrypt" >&5
+echo "${ECHO_T}$ac_cv_lib_k5crypto_mit_des_cbc_encrypt" >&6; }
 if test $ac_cv_lib_k5crypto_mit_des_cbc_encrypt = yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBK5CRYPTO 1
@@ -19031,8 +18941,8 @@ _ACEOF
 fi
 
 
-echo "$as_me:$LINENO: checking for mit_des_cbc_encrypt in -lcrypto" >&5
-echo $ECHO_N "checking for mit_des_cbc_encrypt in -lcrypto... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for mit_des_cbc_encrypt in -lcrypto" >&5
+echo $ECHO_N "checking for mit_des_cbc_encrypt in -lcrypto... $ECHO_C" >&6; }
 if test "${ac_cv_lib_crypto_mit_des_cbc_encrypt+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -19045,56 +18955,53 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char mit_des_cbc_encrypt ();
 int
 main ()
 {
-mit_des_cbc_encrypt ();
+return mit_des_cbc_encrypt ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_crypto_mit_des_cbc_encrypt=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_crypto_mit_des_cbc_encrypt=no
+       ac_cv_lib_crypto_mit_des_cbc_encrypt=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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_crypto_mit_des_cbc_encrypt" >&5
-echo "${ECHO_T}$ac_cv_lib_crypto_mit_des_cbc_encrypt" >&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_mit_des_cbc_encrypt" >&5
+echo "${ECHO_T}$ac_cv_lib_crypto_mit_des_cbc_encrypt" >&6; }
 if test $ac_cv_lib_crypto_mit_des_cbc_encrypt = yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBCRYPTO 1
@@ -19105,8 +19012,8 @@ _ACEOF
 fi
 
 
-echo "$as_me:$LINENO: checking for krb5_init_context in -lkrb5" >&5
-echo $ECHO_N "checking for krb5_init_context in -lkrb5... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for krb5_init_context in -lkrb5" >&5
+echo $ECHO_N "checking for krb5_init_context in -lkrb5... $ECHO_C" >&6; }
 if test "${ac_cv_lib_krb5_krb5_init_context+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -19119,56 +19026,53 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char krb5_init_context ();
 int
 main ()
 {
-krb5_init_context ();
+return krb5_init_context ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_krb5_krb5_init_context=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_krb5_krb5_init_context=no
+       ac_cv_lib_krb5_krb5_init_context=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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_krb5_krb5_init_context" >&5
-echo "${ECHO_T}$ac_cv_lib_krb5_krb5_init_context" >&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_krb5_krb5_init_context" >&5
+echo "${ECHO_T}$ac_cv_lib_krb5_krb5_init_context" >&6; }
 if test $ac_cv_lib_krb5_krb5_init_context = yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBKRB5 1
@@ -19180,8 +19084,8 @@ fi
 
   if test "${with_kerberos5+set}" != set; then
 
-echo "$as_me:$LINENO: checking for des_cbc_encrypt in -ldes425" >&5
-echo $ECHO_N "checking for des_cbc_encrypt in -ldes425... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for des_cbc_encrypt in -ldes425" >&5
+echo $ECHO_N "checking for des_cbc_encrypt in -ldes425... $ECHO_C" >&6; }
 if test "${ac_cv_lib_des425_des_cbc_encrypt+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -19194,56 +19098,53 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char des_cbc_encrypt ();
 int
 main ()
 {
-des_cbc_encrypt ();
+return des_cbc_encrypt ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_des425_des_cbc_encrypt=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_des425_des_cbc_encrypt=no
+       ac_cv_lib_des425_des_cbc_encrypt=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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_des425_des_cbc_encrypt" >&5
-echo "${ECHO_T}$ac_cv_lib_des425_des_cbc_encrypt" >&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_des425_des_cbc_encrypt" >&5
+echo "${ECHO_T}$ac_cv_lib_des425_des_cbc_encrypt" >&6; }
 if test $ac_cv_lib_des425_des_cbc_encrypt = yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBDES425 1
@@ -19253,8 +19154,8 @@ _ACEOF
 
 else
 
-echo "$as_me:$LINENO: checking for des_cbc_encrypt in -ldes" >&5
-echo $ECHO_N "checking for des_cbc_encrypt in -ldes... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for des_cbc_encrypt in -ldes" >&5
+echo $ECHO_N "checking for des_cbc_encrypt in -ldes... $ECHO_C" >&6; }
 if test "${ac_cv_lib_des_des_cbc_encrypt+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -19267,56 +19168,53 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char des_cbc_encrypt ();
 int
 main ()
 {
-des_cbc_encrypt ();
+return des_cbc_encrypt ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_des_des_cbc_encrypt=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_des_des_cbc_encrypt=no
+       ac_cv_lib_des_des_cbc_encrypt=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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_des_des_cbc_encrypt" >&5
-echo "${ECHO_T}$ac_cv_lib_des_des_cbc_encrypt" >&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_des_des_cbc_encrypt" >&5
+echo "${ECHO_T}$ac_cv_lib_des_des_cbc_encrypt" >&6; }
 if test $ac_cv_lib_des_des_cbc_encrypt = yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBDES 1
@@ -19329,8 +19227,8 @@ fi
 fi
 
 
-echo "$as_me:$LINENO: checking for krb_get_cred in -lkrb4" >&5
-echo $ECHO_N "checking for krb_get_cred in -lkrb4... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for krb_get_cred in -lkrb4" >&5
+echo $ECHO_N "checking for krb_get_cred in -lkrb4... $ECHO_C" >&6; }
 if test "${ac_cv_lib_krb4_krb_get_cred+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -19343,56 +19241,53 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char krb_get_cred ();
 int
 main ()
 {
-krb_get_cred ();
+return krb_get_cred ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_krb4_krb_get_cred=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_krb4_krb_get_cred=no
+       ac_cv_lib_krb4_krb_get_cred=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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_krb4_krb_get_cred" >&5
-echo "${ECHO_T}$ac_cv_lib_krb4_krb_get_cred" >&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_krb4_krb_get_cred" >&5
+echo "${ECHO_T}$ac_cv_lib_krb4_krb_get_cred" >&6; }
 if test $ac_cv_lib_krb4_krb_get_cred = yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBKRB4 1
@@ -19402,8 +19297,8 @@ _ACEOF
 
 else
 
-echo "$as_me:$LINENO: checking for krb_get_cred in -lkrb" >&5
-echo $ECHO_N "checking for krb_get_cred in -lkrb... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for krb_get_cred in -lkrb" >&5
+echo $ECHO_N "checking for krb_get_cred in -lkrb... $ECHO_C" >&6; }
 if test "${ac_cv_lib_krb_krb_get_cred+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -19416,56 +19311,53 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char krb_get_cred ();
 int
 main ()
 {
-krb_get_cred ();
+return krb_get_cred ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_krb_krb_get_cred=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_krb_krb_get_cred=no
+       ac_cv_lib_krb_krb_get_cred=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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_krb_krb_get_cred" >&5
-echo "${ECHO_T}$ac_cv_lib_krb_krb_get_cred" >&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_krb_krb_get_cred" >&5
+echo "${ECHO_T}$ac_cv_lib_krb_krb_get_cred" >&6; }
 if test $ac_cv_lib_krb_krb_get_cred = yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBKRB 1
 for ac_header in krb5.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -19506,41 +19399,37 @@ $ac_includes_default
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f 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.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -19549,24 +19438,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -19574,9 +19461,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -19600,25 +19488,19 @@ echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
@@ -19635,18 +19517,19 @@ done
 for ac_header in des.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -19657,41 +19540,37 @@ $ac_includes_default
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f 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.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -19700,24 +19579,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -19725,9 +19602,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -19751,25 +19629,19 @@ echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
@@ -19782,18 +19654,19 @@ else
 for ac_header in kerberosIV/des.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -19804,41 +19677,37 @@ $ac_includes_default
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f 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.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -19847,24 +19716,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -19872,9 +19739,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -19898,25 +19766,19 @@ echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
@@ -19929,18 +19791,19 @@ else
 for ac_header in kerberos/des.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -19951,41 +19814,37 @@ $ac_includes_default
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f 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.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -19994,24 +19853,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -20019,9 +19876,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -20045,25 +19903,19 @@ echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
@@ -20087,18 +19939,19 @@ done
 for ac_header in krb.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -20109,41 +19962,37 @@ $ac_includes_default
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f 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.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -20152,24 +20001,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -20177,9 +20024,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -20203,25 +20051,19 @@ echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
@@ -20234,18 +20076,19 @@ else
 for ac_header in kerberosIV/krb.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -20256,41 +20099,37 @@ $ac_includes_default
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f 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.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -20299,24 +20138,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -20324,9 +20161,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -20350,25 +20188,19 @@ echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
@@ -20381,18 +20213,19 @@ else
 for ac_header in kerberos/krb.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -20403,41 +20236,37 @@ $ac_includes_default
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f 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.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -20446,24 +20275,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -20471,9 +20298,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -20497,25 +20325,19 @@ echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
@@ -20540,18 +20362,19 @@ done
 for ac_header in com_err.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -20562,41 +20385,37 @@ $ac_includes_default
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f 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.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -20605,24 +20424,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -20630,9 +20447,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -20656,25 +20474,19 @@ echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
@@ -20691,8 +20503,8 @@ fi
 # Solaris requires -lintl if you want strerror (which calls dgettext)
 # to return localized messages.
 
-echo "$as_me:$LINENO: checking for dgettext in -lintl" >&5
-echo $ECHO_N "checking for dgettext in -lintl... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for dgettext in -lintl" >&5
+echo $ECHO_N "checking for dgettext in -lintl... $ECHO_C" >&6; }
 if test "${ac_cv_lib_intl_dgettext+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -20705,56 +20517,53 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char dgettext ();
 int
 main ()
 {
-dgettext ();
+return dgettext ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_intl_dgettext=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_intl_dgettext=no
+       ac_cv_lib_intl_dgettext=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+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_intl_dgettext" >&5
-echo "${ECHO_T}$ac_cv_lib_intl_dgettext" >&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_intl_dgettext" >&5
+echo "${ECHO_T}$ac_cv_lib_intl_dgettext" >&6; }
 if test $ac_cv_lib_intl_dgettext = yes; then
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBINTL 1
@@ -20765,8 +20574,8 @@ _ACEOF
 fi
 
 
-echo "$as_me:$LINENO: checking whether localtime caches TZ" >&5
-echo $ECHO_N "checking whether localtime caches TZ... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking whether localtime caches TZ" >&5
+echo $ECHO_N "checking whether localtime caches TZ... $ECHO_C" >&6; }
 if test "${emacs_cv_localtime_cache+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -20812,13 +20621,22 @@ main()
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+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>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (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_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -20831,16 +20649,18 @@ sed 's/^/| /' conftest.$ac_ext >&5
 ( exit $ac_status )
 emacs_cv_localtime_cache=yes
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
+
+
 else
        # If we lack tzset, report that localtime does not cache TZ,
        # since we can't invalidate the cache if we don't have tzset.
        emacs_cv_localtime_cache=no
 fi
 fi
-echo "$as_me:$LINENO: result: $emacs_cv_localtime_cache" >&5
-echo "${ECHO_T}$emacs_cv_localtime_cache" >&6
+echo "$as_me:$LINENO: result: $emacs_cv_localtime_cache" >&5
+echo "${ECHO_T}$emacs_cv_localtime_cache" >&6; }
 if test $emacs_cv_localtime_cache = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -20854,9 +20674,9 @@ if test "x$HAVE_TIMEVAL" = xyes; then
 for ac_func in gettimeofday
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -20882,68 +20702,60 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
@@ -20953,8 +20765,8 @@ fi
 done
 
   if test $ac_cv_func_gettimeofday = yes; then
-    echo "$as_me:$LINENO: checking whether gettimeofday can accept two arguments" >&5
-echo $ECHO_N "checking whether gettimeofday can accept two arguments... $ECHO_C" >&6
+    echo "$as_me:$LINENO: checking whether gettimeofday can accept two arguments" >&5
+echo $ECHO_N "checking whether gettimeofday can accept two arguments... $ECHO_C" >&6; }
 if test "${emacs_cv_gettimeofday_two_arguments+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -20985,38 +20797,34 @@ struct timeval time;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   emacs_cv_gettimeofday_two_arguments=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-emacs_cv_gettimeofday_two_arguments=no
+       emacs_cv_gettimeofday_two_arguments=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $emacs_cv_gettimeofday_two_arguments" >&5
-echo "${ECHO_T}$emacs_cv_gettimeofday_two_arguments" >&6
+echo "$as_me:$LINENO: result: $emacs_cv_gettimeofday_two_arguments" >&5
+echo "${ECHO_T}$emacs_cv_gettimeofday_two_arguments" >&6; }
     if test $emacs_cv_gettimeofday_two_arguments = no; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -21028,8 +20836,8 @@ _ACEOF
 fi
 
 # This defines (or not) HAVE_TZNAME and HAVE_TM_ZONE.
-echo "$as_me:$LINENO: checking for struct tm.tm_zone" >&5
-echo $ECHO_N "checking for struct tm.tm_zone... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for struct tm.tm_zone" >&5
+echo $ECHO_N "checking for struct tm.tm_zone... $ECHO_C" >&6; }
 if test "${ac_cv_member_struct_tm_tm_zone+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -21054,33 +20862,28 @@ return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_tm_tm_zone=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >conftest.$ac_ext <<_ACEOF
+       cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -21101,40 +20904,37 @@ return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_member_struct_tm_tm_zone=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_member_struct_tm_tm_zone=no
+       ac_cv_member_struct_tm_tm_zone=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5
-echo "${ECHO_T}$ac_cv_member_struct_tm_tm_zone" >&6
+echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5
+echo "${ECHO_T}$ac_cv_member_struct_tm_tm_zone" >&6; }
 if test $ac_cv_member_struct_tm_tm_zone = yes; then
 
 cat >>confdefs.h <<_ACEOF
@@ -21151,8 +20951,77 @@ cat >>confdefs.h <<\_ACEOF
 _ACEOF
 
 else
-  echo "$as_me:$LINENO: checking for tzname" >&5
-echo $ECHO_N "checking for tzname... $ECHO_C" >&6
+  { echo "$as_me:$LINENO: checking whether tzname is declared" >&5
+echo $ECHO_N "checking whether tzname is declared... $ECHO_C" >&6; }
+if test "${ac_cv_have_decl_tzname+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 <time.h>
+
+int
+main ()
+{
+#ifndef tzname
+  (void) tzname;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+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
+  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_cv_have_decl_tzname=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_have_decl_tzname=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_tzname" >&5
+echo "${ECHO_T}$ac_cv_have_decl_tzname" >&6; }
+if test $ac_cv_have_decl_tzname = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_TZNAME 1
+_ACEOF
+
+
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_TZNAME 0
+_ACEOF
+
+
+fi
+
+
+  { echo "$as_me:$LINENO: checking for tzname" >&5
+echo $ECHO_N "checking for tzname... $ECHO_C" >&6; }
 if test "${ac_cv_var_tzname+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -21163,52 +21032,49 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <time.h>
-#ifndef tzname /* For SGI.  */
-extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
+#if !HAVE_DECL_TZNAME
+extern char *tzname[];
 #endif
 
 int
 main ()
 {
-atoi(*tzname);
+return tzname[0][0];
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_var_tzname=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_var_tzname=no
+       ac_cv_var_tzname=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5
-echo "${ECHO_T}$ac_cv_var_tzname" >&6
+echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5
+echo "${ECHO_T}$ac_cv_var_tzname" >&6; }
   if test $ac_cv_var_tzname = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -21220,8 +21086,8 @@ fi
 
 
 if test "$ac_cv_func_gettimeofday" = yes; then
-  echo "$as_me:$LINENO: checking for struct timezone" >&5
-echo $ECHO_N "checking for struct timezone... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for struct timezone" >&5
+echo $ECHO_N "checking for struct timezone... $ECHO_C" >&6; }
 if test "${emacs_cv_struct_timezone+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -21241,27 +21107,22 @@ struct timezone tz;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
               if test "$cross_compiling" = yes; then
   emacs_cv_struct_timezone=yes
 else
@@ -21289,13 +21150,22 @@ main () {
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+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>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (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_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -21308,23 +21178,26 @@ sed 's/^/| /' conftest.$ac_ext >&5
 ( exit $ac_status )
 emacs_cv_struct_timezone=no
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
+
+
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-emacs_cv_struct_timezone=no
+       emacs_cv_struct_timezone=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $emacs_cv_struct_timezone" >&5
-echo "${ECHO_T}$emacs_cv_struct_timezone" >&6
+echo "$as_me:$LINENO: result: $emacs_cv_struct_timezone" >&5
+echo "${ECHO_T}$emacs_cv_struct_timezone" >&6; }
 fi
 
 ok_so_far=yes
-echo "$as_me:$LINENO: checking for socket" >&5
-echo $ECHO_N "checking for socket... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for socket" >&5
+echo $ECHO_N "checking for socket... $ECHO_C" >&6; }
 if test "${ac_cv_func_socket+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -21351,68 +21224,59 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef socket
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char socket ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_socket) || defined (__stub___socket)
+#if defined __stub_socket || defined __stub___socket
 choke me
-#else
-char (*f) () = socket;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != socket;
+return socket ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_func_socket=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_func_socket=no
+       ac_cv_func_socket=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_socket" >&5
-echo "${ECHO_T}$ac_cv_func_socket" >&6
+echo "$as_me:$LINENO: result: $ac_cv_func_socket" >&5
+echo "${ECHO_T}$ac_cv_func_socket" >&6; }
 if test $ac_cv_func_socket = yes; then
   :
 else
 
 if test $ok_so_far = yes; then
   if test "${ac_cv_header_netinet_in_h+set}" = set; then
-  echo "$as_me:$LINENO: checking for netinet/in.h" >&5
-echo $ECHO_N "checking for netinet/in.h... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for netinet/in.h" >&5
+echo $ECHO_N "checking for netinet/in.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_netinet_in_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_netinet_in_h" >&5
-echo "${ECHO_T}$ac_cv_header_netinet_in_h" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_netinet_in_h" >&5
+echo "${ECHO_T}$ac_cv_header_netinet_in_h" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking netinet/in.h usability" >&5
-echo $ECHO_N "checking netinet/in.h usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking netinet/in.h usability" >&5
+echo $ECHO_N "checking netinet/in.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -21442,41 +21306,37 @@ $ac_includes_default
 #include <netinet/in.h>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f 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.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking netinet/in.h presence" >&5
-echo $ECHO_N "checking netinet/in.h presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking netinet/in.h presence" >&5
+echo $ECHO_N "checking netinet/in.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -21485,24 +21345,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <netinet/in.h>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -21510,9 +21368,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -21536,25 +21395,18 @@ echo "$as_me: WARNING: netinet/in.h:     section \"Present But Cannot Be Compile
 echo "$as_me: WARNING: netinet/in.h: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: netinet/in.h: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: netinet/in.h: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for netinet/in.h" >&5
-echo $ECHO_N "checking for netinet/in.h... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for netinet/in.h" >&5
+echo $ECHO_N "checking for netinet/in.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_netinet_in_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_cv_header_netinet_in_h=$ac_header_preproc
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_netinet_in_h" >&5
-echo "${ECHO_T}$ac_cv_header_netinet_in_h" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_netinet_in_h" >&5
+echo "${ECHO_T}$ac_cv_header_netinet_in_h" >&6; }
 
 fi
 if test $ac_cv_header_netinet_in_h = yes; then
 fi
 if test $ok_so_far = yes; then
   if test "${ac_cv_header_arpa_inet_h+set}" = set; then
-  echo "$as_me:$LINENO: checking for arpa/inet.h" >&5
-echo $ECHO_N "checking for arpa/inet.h... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for arpa/inet.h" >&5
+echo $ECHO_N "checking for arpa/inet.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_arpa_inet_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_arpa_inet_h" >&5
-echo "${ECHO_T}$ac_cv_header_arpa_inet_h" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_arpa_inet_h" >&5
+echo "${ECHO_T}$ac_cv_header_arpa_inet_h" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking arpa/inet.h usability" >&5
-echo $ECHO_N "checking arpa/inet.h usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking arpa/inet.h usability" >&5
+echo $ECHO_N "checking arpa/inet.h usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -21588,41 +21440,37 @@ $ac_includes_default
 #include <arpa/inet.h>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f 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.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking arpa/inet.h presence" >&5
-echo $ECHO_N "checking arpa/inet.h presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking arpa/inet.h presence" >&5
+echo $ECHO_N "checking arpa/inet.h presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -21631,24 +21479,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <arpa/inet.h>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -21656,9 +21502,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -21682,25 +21529,18 @@ echo "$as_me: WARNING: arpa/inet.h:     section \"Present But Cannot Be Compiled
 echo "$as_me: WARNING: arpa/inet.h: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: arpa/inet.h: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: arpa/inet.h: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for arpa/inet.h" >&5
-echo $ECHO_N "checking for arpa/inet.h... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for arpa/inet.h" >&5
+echo $ECHO_N "checking for arpa/inet.h... $ECHO_C" >&6; }
 if test "${ac_cv_header_arpa_inet_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_cv_header_arpa_inet_h=$ac_header_preproc
 fi
-echo "$as_me:$LINENO: result: $ac_cv_header_arpa_inet_h" >&5
-echo "${ECHO_T}$ac_cv_header_arpa_inet_h" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_arpa_inet_h" >&5
+echo "${ECHO_T}$ac_cv_header_arpa_inet_h" >&6; }
 
 fi
 if test $ac_cv_header_arpa_inet_h = yes; then
 for ac_header in sys/ioctl.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -21745,41 +21586,37 @@ $ac_includes_default
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f 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.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -21788,24 +21625,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -21813,9 +21648,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -21839,25 +21675,19 @@ echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
@@ -21878,23 +21708,23 @@ _ACEOF
 
 fi
 
-echo "$as_me:$LINENO: checking whether system supports dynamic ptys" >&5
-echo $ECHO_N "checking whether system supports dynamic ptys... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking whether system supports dynamic ptys" >&5
+echo $ECHO_N "checking whether system supports dynamic ptys... $ECHO_C" >&6; }
 if test -d /dev/pts && ls -d /dev/ptmx > /dev/null 2>&1 ; then
-  echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_DEV_PTMX 1
 _ACEOF
 
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
 fi
 
-echo "$as_me:$LINENO: checking for pid_t" >&5
-echo $ECHO_N "checking for pid_t... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for pid_t" >&5
+echo $ECHO_N "checking for pid_t... $ECHO_C" >&6; }
 if test "${ac_cv_type_pid_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -21905,50 +21735,47 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
+typedef pid_t ac__type_new_;
 int
 main ()
 {
-if ((pid_t *) 0)
+if ((ac__type_new_ *) 0)
   return 0;
-if (sizeof (pid_t))
+if (sizeof (ac__type_new_))
   return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_type_pid_t=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_pid_t=no
+       ac_cv_type_pid_t=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5
-echo "${ECHO_T}$ac_cv_type_pid_t" >&6
+echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5
+echo "${ECHO_T}$ac_cv_type_pid_t" >&6; }
 if test $ac_cv_type_pid_t = yes; then
   :
 else
@@ -21960,22 +21787,22 @@ _ACEOF
 fi
 
 
-
-for ac_header in unistd.h vfork.h
+for ac_header in vfork.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -21986,41 +21813,37 @@ $ac_includes_default
 #include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_header_compiler=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_header_compiler=no
+       ac_header_compiler=no
 fi
-rm -f 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.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
 
 # Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -22029,24 +21852,22 @@ cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 #include <$ac_header>
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+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; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then
   ac_header_preproc=yes
 else
   echo "$as_me: failed program was:" >&5
@@ -22054,9 +21875,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
   ac_header_preproc=no
 fi
+
 rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
 
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -22080,25 +21902,19 @@ echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\
 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
     { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
+
     ;;
 esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   eval "$as_ac_Header=\$ac_header_preproc"
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 
 fi
 if test `eval echo '${'$as_ac_Header'}'` = yes; then
@@ -22115,9 +21931,9 @@ done
 for ac_func in fork vfork
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -22143,68 +21959,60 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #undef $ac_func
 
-/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
 char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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
   eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+       eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+              { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
 if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
@@ -22214,8 +22022,8 @@ fi
 done
 
 if test "x$ac_cv_func_fork" = xyes; then
-  echo "$as_me:$LINENO: checking for working fork" >&5
-echo $ECHO_N "checking for working fork... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for working fork" >&5
+echo $ECHO_N "checking for working fork... $ECHO_C" >&6; }
 if test "${ac_cv_func_fork_works+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -22223,27 +22031,40 @@ else
   ac_cv_func_fork_works=cross
 else
   cat >conftest.$ac_ext <<_ACEOF
-/* By Ruediger Kuhlmann. */
-      #include <sys/types.h>
-      #if HAVE_UNISTD_H
-      # include <unistd.h>
-      #endif
-      /* Some systems only have a dummy stub for fork() */
-      int main ()
-      {
-       if (fork() < 0)
-         exit (1);
-       exit (0);
-      }
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+
+         /* By Ruediger Kuhlmann. */
+         return fork () < 0;
+
+  ;
+  return 0;
+}
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+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>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (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_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -22256,11 +22077,13 @@ sed 's/^/| /' conftest.$ac_ext >&5
 ( exit $ac_status )
 ac_cv_func_fork_works=no
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
+
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_fork_works" >&5
-echo "${ECHO_T}$ac_cv_func_fork_works" >&6
+echo "$as_me:$LINENO: result: $ac_cv_func_fork_works" >&5
+echo "${ECHO_T}$ac_cv_func_fork_works" >&6; }
 
 else
   ac_cv_func_fork_works=$ac_cv_func_fork
@@ -22280,8 +22103,8 @@ echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross co
 fi
 ac_cv_func_vfork_works=$ac_cv_func_vfork
 if test "x$ac_cv_func_vfork" = xyes; then
-  echo "$as_me:$LINENO: checking for working vfork" >&5
-echo $ECHO_N "checking for working vfork... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for working vfork" >&5
+echo $ECHO_N "checking for working vfork... $ECHO_C" >&6; }
 if test "${ac_cv_func_vfork_works+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -22295,15 +22118,9 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 /* Thanks to Paul Eggert for this test.  */
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+$ac_includes_default
 #include <sys/wait.h>
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-#if HAVE_VFORK_H
+#ifdef HAVE_VFORK_H
 # include <vfork.h>
 #endif
 /* On some sparc systems, changes by the child to local and incoming
@@ -22374,7 +22191,7 @@ main ()
 
     while (wait(&status) != child)
       ;
-    exit(
+    return (
         /* Was there some problem with vforking?  */
         child < 0
 
@@ -22391,13 +22208,22 @@ main ()
 }
 _ACEOF
 rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
+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>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
+  { (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_try") 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
@@ -22410,11 +22236,13 @@ sed 's/^/| /' conftest.$ac_ext >&5
 ( exit $ac_status )
 ac_cv_func_vfork_works=no
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
+
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_vfork_works" >&5
-echo "${ECHO_T}$ac_cv_func_vfork_works" >&6
+echo "$as_me:$LINENO: result: $ac_cv_func_vfork_works" >&5
+echo "${ECHO_T}$ac_cv_func_vfork_works" >&6; }
 
 fi;
 if test "x$ac_cv_func_fork_works" = xcross; then
@@ -22445,8 +22273,8 @@ _ACEOF
 fi
 
 
-echo "$as_me:$LINENO: checking for nl_langinfo and CODESET" >&5
-echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for nl_langinfo and CODESET" >&5
+echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6; }
 if test "${emacs_cv_langinfo_codeset+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -22466,40 +22294,37 @@ char* cs = nl_langinfo(CODESET);
 }
 _ACEOF
 rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (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_langinfo_codeset=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-emacs_cv_langinfo_codeset=no
+       emacs_cv_langinfo_codeset=no
 fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 
 fi
-echo "$as_me:$LINENO: result: $emacs_cv_langinfo_codeset" >&5
-echo "${ECHO_T}$emacs_cv_langinfo_codeset" >&6
+echo "$as_me:$LINENO: result: $emacs_cv_langinfo_codeset" >&5
+echo "${ECHO_T}$emacs_cv_langinfo_codeset" >&6; }
 if test $emacs_cv_langinfo_codeset = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -22508,8 +22333,8 @@ _ACEOF
 
 fi
 
-echo "$as_me:$LINENO: checking for size_t" >&5
-echo $ECHO_N "checking for size_t... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for size_t" >&5
+echo $ECHO_N "checking for size_t... $ECHO_C" >&6; }
 if test "${ac_cv_type_size_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -22520,50 +22345,47 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
+typedef size_t ac__type_new_;
 int
 main ()
 {
-if ((size_t *) 0)
+if ((ac__type_new_ *) 0)
   return 0;
-if (sizeof (size_t))
+if (sizeof (ac__type_new_))
   return 0;
   ;
   return 0;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_type_size_t=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_size_t=no
+       ac_cv_type_size_t=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
-echo "${ECHO_T}$ac_cv_type_size_t" >&6
+echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
+echo "${ECHO_T}$ac_cv_type_size_t" >&6; }
 if test $ac_cv_type_size_t = yes; then
 
 cat >>confdefs.h <<_ACEOF
@@ -22574,8 +22396,8 @@ _ACEOF
 fi
 
 
-echo "$as_me:$LINENO: checking for mbstate_t" >&5
-echo $ECHO_N "checking for mbstate_t... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for mbstate_t" >&5
+echo $ECHO_N "checking for mbstate_t... $ECHO_C" >&6; }
 if test "${ac_cv_type_mbstate_t+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -22596,38 +22418,34 @@ mbstate_t x; return sizeof x;
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   ac_cv_type_mbstate_t=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_type_mbstate_t=no
+       ac_cv_type_mbstate_t=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_type_mbstate_t" >&5
-echo "${ECHO_T}$ac_cv_type_mbstate_t" >&6
+echo "$as_me:$LINENO: result: $ac_cv_type_mbstate_t" >&5
+echo "${ECHO_T}$ac_cv_type_mbstate_t" >&6; }
    if test $ac_cv_type_mbstate_t = yes; then
 
 cat >>confdefs.h <<\_ACEOF
@@ -22642,8 +22460,8 @@ _ACEOF
 
    fi
 
-echo "$as_me:$LINENO: checking for C restrict keyword" >&5
-echo $ECHO_N "checking for C restrict keyword... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for C restrict keyword" >&5
+echo $ECHO_N "checking for C restrict keyword... $ECHO_C" >&6; }
 if test "${emacs_cv_c_restrict+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -22663,33 +22481,28 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   emacs_cv_c_restrict=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >conftest.$ac_ext <<_ACEOF
+       cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -22705,40 +22518,37 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   emacs_cv_c_restrict=__restrict
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-emacs_cv_c_restrict=no
+       emacs_cv_c_restrict=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $emacs_cv_c_restrict" >&5
-echo "${ECHO_T}$emacs_cv_c_restrict" >&6
+echo "$as_me:$LINENO: result: $emacs_cv_c_restrict" >&5
+echo "${ECHO_T}$emacs_cv_c_restrict" >&6; }
 case "$emacs_cv_c_restrict" in
   yes) emacs_restrict=restrict;;
   no) emacs_restrict="";;
@@ -22752,8 +22562,8 @@ _ACEOF
 
 fi
 
-echo "$as_me:$LINENO: checking for C restricted array declarations" >&5
-echo $ECHO_N "checking for C restricted array declarations... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for C restricted array declarations" >&5
+echo $ECHO_N "checking for C restricted array declarations... $ECHO_C" >&6; }
 if test "${emacs_cv_c_restrict_arr+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
@@ -22773,38 +22583,34 @@ main ()
 }
 _ACEOF
 rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+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
   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); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
   emacs_cv_c_restrict_arr=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-emacs_cv_c_restrict_arr=no
+       emacs_cv_c_restrict_arr=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $emacs_cv_c_restrict_arr" >&5
-echo "${ECHO_T}$emacs_cv_c_restrict_arr" >&6
+echo "$as_me:$LINENO: result: $emacs_cv_c_restrict_arr" >&5
+echo "${ECHO_T}$emacs_cv_c_restrict_arr" >&6; }
 if test "$emacs_cv_c_restrict_arr" = yes; then
 
 cat >>confdefs.h <<\_ACEOF
 rm -f conftest*
 
 
-                                                                                                    ac_config_files="$ac_config_files Makefile lib-src/Makefile.c:lib-src/Makefile.in oldXMenu/Makefile man/Makefile lwlib/Makefile src/Makefile.c:src/Makefile.in lisp/Makefile lispref/Makefile lispintro/Makefile leim/Makefile"
-          ac_config_commands="$ac_config_commands default"
+ac_config_files="$ac_config_files Makefile lib-src/Makefile.c:lib-src/Makefile.in oldXMenu/Makefile man/Makefile lwlib/Makefile src/Makefile.c:src/Makefile.in lisp/Makefile lispref/Makefile lispintro/Makefile leim/Makefile"
+
+ac_config_commands="$ac_config_commands default"
+
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
 # tests run on this system so they can be shared between configure
@@ -23056,39 +22864,58 @@ _ACEOF
 
 # The following way of writing the cache mishandles newlines in values,
 # but we know of no workaround that is simple, portable, and efficient.
-# So, don't put newlines in cache variables' values.
+# So, we kill variables containing newlines.
 # Ultrix sh set writes to stderr and can't be redirected directly,
 # and sets the high bit in the cache file unless we assign to the vars.
-{
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+
   (set) 2>&1 |
-    case `(ac_space=' '; set | grep ac_space) 2>&1` in
-    *ac_space=\ *)
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
       # `set' does not quote correctly, so add quotes (double-quote
       # substitution turns \\\\ into \\, and sed turns \\ into \).
       sed -n \
        "s/'/'\\\\''/g;
          s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
-      ;;
+      ;; #(
     *)
       # `set' quotes correctly as required by POSIX, so do not add quotes.
-      sed -n \
-       "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
       ;;
-    esac;
-} |
+    esac |
+    sort
+) |
   sed '
+     /^ac_cv_env_/b end
      t clear
-     : clear
+     :clear
      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
      t end
-     /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
-     : end' >>confcache
-if diff $cache_file confcache >/dev/null 2>&1; then :; else
-  if test -w $cache_file; then
-    test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    test "x$cache_file" != "x/dev/null" &&
+      { echo "$as_me:$LINENO: updating cache $cache_file" >&5
+echo "$as_me: updating cache $cache_file" >&6;}
     cat confcache >$cache_file
   else
-    echo "not updating unwritable cache $cache_file"
+    { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+echo "$as_me: not updating unwritable cache $cache_file" >&6;}
   fi
 fi
 rm -f confcache
@@ -23097,32 +22924,18 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix
 # Let make expand exec_prefix.
 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
 
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
-  ac_vpsub='/^[         ]*VPATH[        ]*=/{
-s/:*\$(srcdir):*/:/;
-s/:*\${srcdir}:*/:/;
-s/:*@srcdir@:*/:/;
-s/^\([^=]*=[    ]*\):*/\1/;
-s/:*$//;
-s/^[^=]*=[      ]*$//;
-}'
-fi
-
 DEFS=-DHAVE_CONFIG_H
 
 ac_libobjs=
 ac_ltlibobjs=
 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
   # 1. Remove the extension, and $U if already installed.
-  ac_i=`echo "$ac_i" |
-        sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
-  # 2. Add them.
-  ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
-  ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
 done
 LIBOBJS=$ac_libobjs
 
@@ -23153,17 +22966,45 @@ cat >>$CONFIG_STATUS <<\_ACEOF
 ## M4sh Initialization.  ##
 ## --------------------- ##
 
-# Be Bourne compatible
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
   emulate sh
   NULLCMD=:
   # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
-  set -o posix
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
 fi
-DUALCASE=1; export DUALCASE # for MKS sh
 
 # Support unset when possible.
 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
@@ -23173,8 +23014,43 @@ else
 fi
 
 
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
 # Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
 PS1='$ '
 PS2='> '
 PS4='+ '
   if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
     eval $as_var=C; export $as_var
   else
-    $as_unset $as_var
+    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
   fi
 done
 
 # Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
 else
   as_expr=false
 fi
 
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
   as_basename=basename
 else
   as_basename=false
 
 
 # Name of the executable.
-as_me=`$as_basename "$0" ||
+as_me=`$as_basename -- "$0" ||
 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
         X"$0" : 'X\(//\)$' \| \
-        X"$0" : 'X\(/\)$' \| \
-        .     : '\(.\)' 2>/dev/null ||
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
 echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
-         /^X\/\(\/\/\)$/{ s//\1/; q; }
-         /^X\/\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-
-
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
 
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  echo "#! /bin/sh" >conf$$.sh
-  echo  "exit 0"   >>conf$$.sh
-  chmod +x conf$$.sh
-  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
-    PATH_SEPARATOR=';'
-  else
-    PATH_SEPARATOR=:
-  fi
-  rm -f conf$$.sh
-fi
+# CDPATH.
+$as_unset CDPATH
 
 
-  as_lineno_1=$LINENO
-  as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
-  test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2"  || {
-  # Find who we are.  Look in the path if we contain no path at all
-  # relative or not.
-  case $0 in
-    *[\\/]* ) as_myself=$0 ;;
-    *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
 
-       ;;
-  esac
-  # We did not find ourselves, most probably we were run as `sh COMMAND'
-  # in which case we are not to be found in the path.
-  if test "x$as_myself" = x; then
-    as_myself=$0
-  fi
-  if test ! -f "$as_myself"; then
-    { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
-echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
-   { (exit 1); exit 1; }; }
-  fi
-  case $CONFIG_SHELL in
-  '')
-    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for as_base in sh bash ksh sh5; do
-        case $as_dir in
-        /*)
-          if ("$as_dir/$as_base" -c '
   as_lineno_1=$LINENO
   as_lineno_2=$LINENO
-  as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
   test "x$as_lineno_1" != "x$as_lineno_2" &&
-  test "x$as_lineno_3"  = "x$as_lineno_2" ') 2>/dev/null; then
-            $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
-            $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
-            CONFIG_SHELL=$as_dir/$as_base
-            export CONFIG_SHELL
-            exec "$CONFIG_SHELL" "$0" ${1+"$@"}
-          fi;;
-        esac
-       done
-done
-;;
-  esac
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
 
   # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
   # uniformly replaced by the line number.  The first 'sed' inserts a
-  # line-number line before each line; the second 'sed' does the real
-  # work.  The second script uses 'N' to pair each line-number line
-  # with the numbered line, and appends trailing '-' during
-  # substitution so that $LINENO is not a special case at line end.
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
   # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
-  # second 'sed' script.  Blame Lee E. McMahon for sed's syntax.  :-)
-  sed '=' <$as_myself |
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
     sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
       N
-      s,$,-,
-      : loop
-      s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
       t loop
-      s,-$,,
-      s,^['$as_cr_digits']*\n,,
+      s/-\n.*//
     ' >$as_me.lineno &&
-  chmod +x $as_me.lineno ||
-    { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
-echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+  chmod +x "$as_me.lineno" ||
+    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
    { (exit 1); exit 1; }; }
 
   # Don't try to exec as it changes $[0], causing all sort of problems
   # (the dirname of $[0] is not the place where we might find the
-  # original and so on.  Autoconf is especially sensible to this).
-  . ./$as_me.lineno
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
   # Exit status is that of the last command.
   exit
 }
 
 
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
-  *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T='     ' ;;
-  *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
-  *)       ECHO_N= ECHO_C='\c' ECHO_T= ;;
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
 esac
 
-if expr a : '\(a\)' >/dev/null 2>&1; then
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
   as_expr=expr
 else
   as_expr=false
 fi
 
 rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir
+fi
 echo >conf$$.file
 if ln -s conf$$.file conf$$ 2>/dev/null; then
-  # We could just check for DJGPP; but this test a) works b) is more generic
-  # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
-  if test -f conf$$.exe; then
-    # Don't use ln at all; we don't have any links
+  as_ln_s='ln -s'
+  # ... but there are two gotchas:
+  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+  # In both cases, we have to default to `cp -p'.
+  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
     as_ln_s='cp -p'
-  else
-    as_ln_s='ln -s'
-  fi
 elif ln conf$$.file conf$$ 2>/dev/null; then
   as_ln_s=ln
 else
   as_ln_s='cp -p'
 fi
-rm -f conf$$ conf$$.exe conf$$.file
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
 
 if mkdir -p . 2>/dev/null; then
   as_mkdir_p=:
@@ -23368,7 +23206,28 @@ else
   as_mkdir_p=false
 fi
 
-as_executable_p="test -f"
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+        test -d "$1/.";
+      else
+       case $1 in
+        -*)set "./$1";;
+       esac;
+       case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+       ???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
 
 # Sed expression to map a string onto a valid CPP name.
 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -23377,31 +23236,14 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
 
 
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS="  $as_nl"
-
-# CDPATH.
-$as_unset CDPATH
-
 exec 6>&1
 
-# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# Save the log message, to keep $[0] and so on meaningful, and to
 # report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.  Logging --version etc. is OK.
-exec 5>>config.log
-{
-  echo
-  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
-} >&5
-cat >&5 <<_CSEOF
-
+# values after options handling.
+ac_log="
 This file was extended by $as_me, which was
-generated by GNU Autoconf 2.59.  Invocation command line was
+generated by GNU Autoconf 2.61.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -23409,30 +23251,20 @@ generated by GNU Autoconf 2.59.  Invocation command line was
   CONFIG_COMMANDS = $CONFIG_COMMANDS
   $ $0 $@
 
-_CSEOF
-echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
-echo >&5
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
 _ACEOF
 
+cat >>$CONFIG_STATUS <<_ACEOF
 # Files that config.status was made for.
-if test -n "$ac_config_files"; then
-  echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_headers"; then
-  echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
-fi
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
 
-if test -n "$ac_config_links"; then
-  echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_commands"; then
-  echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
-fi
+_ACEOF
 
 cat >>$CONFIG_STATUS <<\_ACEOF
-
 ac_cs_usage="\
 \`$as_me' instantiates files from templates according to the
 current configuration.
@@ -23440,7 +23272,7 @@ current configuration.
 Usage: $0 [OPTIONS] [FILE]...
 
   -h, --help       print this help, then exit
-  -V, --version    print version number, then exit
+  -V, --version    print version number and configuration settings, then exit
   -q, --quiet      do not print progress messages
   -d, --debug      don't remove temporary files
       --recheck    update $as_me by reconfiguring in the same conditions
@@ -23459,19 +23291,21 @@ Configuration commands:
 $config_commands
 
 Report bugs to <bug-autoconf@gnu.org>."
-_ACEOF
 
+_ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
 config.status
-configured by $0, generated by GNU Autoconf 2.59,
-  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+configured by $0, generated by GNU Autoconf 2.61,
+  with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
-Copyright (C) 2003 Free Software Foundation, Inc.
+Copyright (C) 2006 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
-srcdir=$srcdir
-INSTALL="$INSTALL"
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
 _ACEOF
 
 cat >>$CONFIG_STATUS <<\_ACEOF
@@ -23482,39 +23316,24 @@ while test $# != 0
 do
   case $1 in
   --*=*)
-    ac_option=`expr "x$1" : 'x\([^=]*\)='`
-    ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
     ac_shift=:
     ;;
-  -*)
+  *)
     ac_option=$1
     ac_optarg=$2
     ac_shift=shift
     ;;
-  *) # This is not an option, so the user has probably given explicit
-     # arguments.
-     ac_option=$1
-     ac_need_defaults=false;;
   esac
 
   case $ac_option in
   # Handling of the options.
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
     ac_cs_recheck=: ;;
-  --version | --vers* | -V )
-    echo "$ac_cs_version"; exit 0 ;;
-  --he | --h)
-    # Conflict between --help and --header
-    { { echo "$as_me:$LINENO: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&2;}
-   { (exit 1); exit 1; }; };;
-  --help | --hel | -h )
-    echo "$ac_cs_usage"; exit 0 ;;
-  --debug | --d* | -d )
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    echo "$ac_cs_version"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
     debug=: ;;
   --file | --fil | --fi | --f )
     $ac_shift
@@ -23524,18 +23343,24 @@ Try \`$0 --help' for more information." >&2;}
     $ac_shift
     CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
     ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    { echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    echo "$ac_cs_usage"; exit ;;
   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
   | -silent | --silent | --silen | --sile | --sil | --si | --s)
     ac_cs_silent=: ;;
 
   # This is an error.
-  -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2;}
+  -*) { echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2
    { (exit 1); exit 1; }; } ;;
 
-  *) ac_config_targets="$ac_config_targets $1" ;;
+  *) ac_config_targets="$ac_config_targets $1"
+     ac_need_defaults=false ;;
 
   esac
   shift
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 if \$ac_cs_recheck; then
-  echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
-  exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+  CONFIG_SHELL=$SHELL
+  export CONFIG_SHELL
+  exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
 fi
 
 _ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  echo "$ac_log"
+} >&5
 
+_ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 #
-# INIT-COMMANDS section.
+# INIT-COMMANDS
 #
-
 GCC="$GCC" NON_GNU_CPP="$NON_GNU_CPP" CPP="$CPP" CPP_NEED_TRADITIONAL="$CPP_NEED_TRADITIONAL" CPPFLAGS="$CPPFLAGS"
 
 _ACEOF
 
-
-
 cat >>$CONFIG_STATUS <<\_ACEOF
+
+# Handling of arguments.
 for ac_config_target in $ac_config_targets
 do
-  case "$ac_config_target" in
-  # Handling of arguments.
-  "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
-  "lib-src/Makefile.c" ) CONFIG_FILES="$CONFIG_FILES lib-src/Makefile.c:lib-src/Makefile.in" ;;
-  "oldXMenu/Makefile" ) CONFIG_FILES="$CONFIG_FILES oldXMenu/Makefile" ;;
-  "man/Makefile" ) CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
-  "lwlib/Makefile" ) CONFIG_FILES="$CONFIG_FILES lwlib/Makefile" ;;
-  "src/Makefile.c" ) CONFIG_FILES="$CONFIG_FILES src/Makefile.c:src/Makefile.in" ;;
-  "lisp/Makefile" ) CONFIG_FILES="$CONFIG_FILES lisp/Makefile" ;;
-  "lispref/Makefile" ) CONFIG_FILES="$CONFIG_FILES lispref/Makefile" ;;
-  "lispintro/Makefile" ) CONFIG_FILES="$CONFIG_FILES lispintro/Makefile" ;;
-  "leim/Makefile" ) CONFIG_FILES="$CONFIG_FILES leim/Makefile" ;;
-  "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
-  "src/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS src/config.h:src/config.in" ;;
+  case $ac_config_target in
+    "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h:src/config.in" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "lib-src/Makefile.c") CONFIG_FILES="$CONFIG_FILES lib-src/Makefile.c:lib-src/Makefile.in" ;;
+    "oldXMenu/Makefile") CONFIG_FILES="$CONFIG_FILES oldXMenu/Makefile" ;;
+    "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
+    "lwlib/Makefile") CONFIG_FILES="$CONFIG_FILES lwlib/Makefile" ;;
+    "src/Makefile.c") CONFIG_FILES="$CONFIG_FILES src/Makefile.c:src/Makefile.in" ;;
+    "lisp/Makefile") CONFIG_FILES="$CONFIG_FILES lisp/Makefile" ;;
+    "lispref/Makefile") CONFIG_FILES="$CONFIG_FILES lispref/Makefile" ;;
+    "lispintro/Makefile") CONFIG_FILES="$CONFIG_FILES lispintro/Makefile" ;;
+    "leim/Makefile") CONFIG_FILES="$CONFIG_FILES leim/Makefile" ;;
+    "default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
+
   *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
    { (exit 1); exit 1; }; };;
   esac
 done
 
+
 # If the user did not use the arguments to specify the items to instantiate,
 # then the envvar interface is used.  Set only those that are not.
 # We use the long form for the default assignment because of an extremely
@@ -23602,351 +23439,458 @@ if $ac_need_defaults; then
 fi
 
 # Have a temporary directory for convenience.  Make it in the build tree
-# simply because there is no reason to put it here, and in addition,
+# simply because there is no reason against having it here, and in addition,
 # creating and moving files from /tmp can sometimes cause problems.
-# Create a temporary directory, and hook for its removal unless debugging.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
 $debug ||
 {
-  trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
   trap '{ (exit 1); exit 1; }' 1 2 13 15
 }
-
 # Create a (secure) tmp directory for tmp files.
 
 {
-  tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
   test -n "$tmp" && test -d "$tmp"
 }  ||
 {
-  tmp=./confstat$$-$RANDOM
-  (umask 077 && mkdir $tmp)
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
 } ||
 {
    echo "$me: cannot create a temporary directory in ." >&2
    { (exit 1); exit 1; }
 }
 
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-
 #
-# CONFIG_FILES section.
+# Set up the sed scripts for CONFIG_FILES section.
 #
 
 # No need to generate the scripts if there are no CONFIG_FILES.
 # This happens for instance when ./config.status config.h
-if test -n "\$CONFIG_FILES"; then
-  # Protect against being on the right side of a sed subst in config.status.
-  sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
-   s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
-s,@SHELL@,$SHELL,;t t
-s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
-s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
-s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
-s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
-s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
-s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
-s,@exec_prefix@,$exec_prefix,;t t
-s,@prefix@,$prefix,;t t
-s,@program_transform_name@,$program_transform_name,;t t
-s,@bindir@,$bindir,;t t
-s,@sbindir@,$sbindir,;t t
-s,@libexecdir@,$libexecdir,;t t
-s,@datadir@,$datadir,;t t
-s,@sysconfdir@,$sysconfdir,;t t
-s,@sharedstatedir@,$sharedstatedir,;t t
-s,@localstatedir@,$localstatedir,;t t
-s,@libdir@,$libdir,;t t
-s,@includedir@,$includedir,;t t
-s,@oldincludedir@,$oldincludedir,;t t
-s,@infodir@,$infodir,;t t
-s,@mandir@,$mandir,;t t
-s,@build_alias@,$build_alias,;t t
-s,@host_alias@,$host_alias,;t t
-s,@target_alias@,$target_alias,;t t
-s,@DEFS@,$DEFS,;t t
-s,@ECHO_C@,$ECHO_C,;t t
-s,@ECHO_N@,$ECHO_N,;t t
-s,@ECHO_T@,$ECHO_T,;t t
-s,@LIBS@,$LIBS,;t t
-s,@MAINT@,$MAINT,;t t
-s,@build@,$build,;t t
-s,@build_cpu@,$build_cpu,;t t
-s,@build_vendor@,$build_vendor,;t t
-s,@build_os@,$build_os,;t t
-s,@host@,$host,;t t
-s,@host_cpu@,$host_cpu,;t t
-s,@host_vendor@,$host_vendor,;t t
-s,@host_os@,$host_os,;t t
-s,@CC@,$CC,;t t
-s,@CFLAGS@,$CFLAGS,;t t
-s,@LDFLAGS@,$LDFLAGS,;t t
-s,@CPPFLAGS@,$CPPFLAGS,;t t
-s,@ac_ct_CC@,$ac_ct_CC,;t t
-s,@EXEEXT@,$EXEEXT,;t t
-s,@OBJEXT@,$OBJEXT,;t t
-s,@CPP@,$CPP,;t t
-s,@EGREP@,$EGREP,;t t
-s,@LN_S@,$LN_S,;t t
-s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
-s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
-s,@INSTALL_DATA@,$INSTALL_DATA,;t t
-s,@RANLIB@,$RANLIB,;t t
-s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
-s,@INSTALL_INFO@,$INSTALL_INFO,;t t
-s,@GZIP_PROG@,$GZIP_PROG,;t t
-s,@LIBSOUND@,$LIBSOUND,;t t
-s,@PKG_CONFIG@,$PKG_CONFIG,;t t
-s,@ALSA_CFLAGS@,$ALSA_CFLAGS,;t t
-s,@ALSA_LIBS@,$ALSA_LIBS,;t t
-s,@CFLAGS_SOUND@,$CFLAGS_SOUND,;t t
-s,@SET_MAKE@,$SET_MAKE,;t t
-s,@GTK_CFLAGS@,$GTK_CFLAGS,;t t
-s,@GTK_LIBS@,$GTK_LIBS,;t t
-s,@ALLOCA@,$ALLOCA,;t t
-s,@liblockfile@,$liblockfile,;t t
-s,@LIBOBJS@,$LIBOBJS,;t t
-s,@NEED_SETGID@,$NEED_SETGID,;t t
-s,@KMEM_GROUP@,$KMEM_GROUP,;t t
-s,@GETLOADAVG_LIBS@,$GETLOADAVG_LIBS,;t t
-s,@GETOPT_H@,$GETOPT_H,;t t
-s,@GETOPTOBJS@,$GETOPTOBJS,;t t
-s,@version@,$version,;t t
-s,@configuration@,$configuration,;t t
-s,@canonical@,$canonical,;t t
-s,@srcdir@,$srcdir,;t t
-s,@lispdir@,$lispdir,;t t
-s,@locallisppath@,$locallisppath,;t t
-s,@lisppath@,$lisppath,;t t
-s,@x_default_search_path@,$x_default_search_path,;t t
-s,@etcdir@,$etcdir,;t t
-s,@archlibdir@,$archlibdir,;t t
-s,@docdir@,$docdir,;t t
-s,@bitmapdir@,$bitmapdir,;t t
-s,@gamedir@,$gamedir,;t t
-s,@gameuser@,$gameuser,;t t
-s,@c_switch_system@,$c_switch_system,;t t
-s,@c_switch_machine@,$c_switch_machine,;t t
-s,@LD_SWITCH_X_SITE@,$LD_SWITCH_X_SITE,;t t
-s,@LD_SWITCH_X_SITE_AUX@,$LD_SWITCH_X_SITE_AUX,;t t
-s,@C_SWITCH_X_SITE@,$C_SWITCH_X_SITE,;t t
-s,@X_TOOLKIT_TYPE@,$X_TOOLKIT_TYPE,;t t
-s,@machfile@,$machfile,;t t
-s,@opsysfile@,$opsysfile,;t t
-s,@carbon_appdir@,$carbon_appdir,;t t
-s,@LTLIBOBJS@,$LTLIBOBJS,;t t
-CEOF
-
-_ACEOF
-
-  cat >>$CONFIG_STATUS <<\_ACEOF
-  # Split the substitutions into bite-sized pieces for seds with
-  # small command number limits, like on Digital OSF/1 and HP-UX.
-  ac_max_sed_lines=48
-  ac_sed_frag=1 # Number of current file.
-  ac_beg=1 # First line for current file.
-  ac_end=$ac_max_sed_lines # Line after last line for current file.
-  ac_more_lines=:
-  ac_sed_cmds=
-  while $ac_more_lines; do
-    if test $ac_beg -gt 1; then
-      sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
-    else
-      sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
-    fi
-    if test ! -s $tmp/subs.frag; then
-      ac_more_lines=false
-    else
-      # The purpose of the label and of the branching condition is to
-      # speed up the sed processing (if there are no `@' at all, there
-      # is no need to browse any of the substitutions).
-      # These are the two extra sed commands mentioned above.
-      (echo ':t
-  /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
-      if test -z "$ac_sed_cmds"; then
-       ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
-      else
-       ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
-      fi
-      ac_sed_frag=`expr $ac_sed_frag + 1`
-      ac_beg=$ac_end
-      ac_end=`expr $ac_end + $ac_max_sed_lines`
-    fi
-  done
-  if test -z "$ac_sed_cmds"; then
-    ac_sed_cmds=cat
+if test -n "$CONFIG_FILES"; then
+
+_ACEOF
+
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  cat >conf$$subs.sed <<_ACEOF
+SHELL!$SHELL$ac_delim
+PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
+PACKAGE_NAME!$PACKAGE_NAME$ac_delim
+PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
+PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
+PACKAGE_STRING!$PACKAGE_STRING$ac_delim
+PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
+exec_prefix!$exec_prefix$ac_delim
+prefix!$prefix$ac_delim
+program_transform_name!$program_transform_name$ac_delim
+bindir!$bindir$ac_delim
+sbindir!$sbindir$ac_delim
+libexecdir!$libexecdir$ac_delim
+datarootdir!$datarootdir$ac_delim
+datadir!$datadir$ac_delim
+sysconfdir!$sysconfdir$ac_delim
+sharedstatedir!$sharedstatedir$ac_delim
+localstatedir!$localstatedir$ac_delim
+includedir!$includedir$ac_delim
+oldincludedir!$oldincludedir$ac_delim
+docdir!$docdir$ac_delim
+infodir!$infodir$ac_delim
+htmldir!$htmldir$ac_delim
+dvidir!$dvidir$ac_delim
+pdfdir!$pdfdir$ac_delim
+psdir!$psdir$ac_delim
+libdir!$libdir$ac_delim
+localedir!$localedir$ac_delim
+mandir!$mandir$ac_delim
+DEFS!$DEFS$ac_delim
+ECHO_C!$ECHO_C$ac_delim
+ECHO_N!$ECHO_N$ac_delim
+ECHO_T!$ECHO_T$ac_delim
+LIBS!$LIBS$ac_delim
+build_alias!$build_alias$ac_delim
+host_alias!$host_alias$ac_delim
+target_alias!$target_alias$ac_delim
+MAINT!$MAINT$ac_delim
+build!$build$ac_delim
+build_cpu!$build_cpu$ac_delim
+build_vendor!$build_vendor$ac_delim
+build_os!$build_os$ac_delim
+host!$host$ac_delim
+host_cpu!$host_cpu$ac_delim
+host_vendor!$host_vendor$ac_delim
+host_os!$host_os$ac_delim
+CC!$CC$ac_delim
+CFLAGS!$CFLAGS$ac_delim
+LDFLAGS!$LDFLAGS$ac_delim
+CPPFLAGS!$CPPFLAGS$ac_delim
+ac_ct_CC!$ac_ct_CC$ac_delim
+EXEEXT!$EXEEXT$ac_delim
+OBJEXT!$OBJEXT$ac_delim
+CPP!$CPP$ac_delim
+GREP!$GREP$ac_delim
+EGREP!$EGREP$ac_delim
+LN_S!$LN_S$ac_delim
+INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
+INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
+INSTALL_DATA!$INSTALL_DATA$ac_delim
+RANLIB!$RANLIB$ac_delim
+INSTALL_INFO!$INSTALL_INFO$ac_delim
+GZIP_PROG!$GZIP_PROG$ac_delim
+LIBSOUND!$LIBSOUND$ac_delim
+PKG_CONFIG!$PKG_CONFIG$ac_delim
+ALSA_CFLAGS!$ALSA_CFLAGS$ac_delim
+ALSA_LIBS!$ALSA_LIBS$ac_delim
+CFLAGS_SOUND!$CFLAGS_SOUND$ac_delim
+SET_MAKE!$SET_MAKE$ac_delim
+XMKMF!$XMKMF$ac_delim
+GTK_CFLAGS!$GTK_CFLAGS$ac_delim
+GTK_LIBS!$GTK_LIBS$ac_delim
+ALLOCA!$ALLOCA$ac_delim
+liblockfile!$liblockfile$ac_delim
+LIBOBJS!$LIBOBJS$ac_delim
+NEED_SETGID!$NEED_SETGID$ac_delim
+KMEM_GROUP!$KMEM_GROUP$ac_delim
+GETLOADAVG_LIBS!$GETLOADAVG_LIBS$ac_delim
+GETOPT_H!$GETOPT_H$ac_delim
+GETOPTOBJS!$GETOPTOBJS$ac_delim
+version!$version$ac_delim
+configuration!$configuration$ac_delim
+canonical!$canonical$ac_delim
+srcdir!$srcdir$ac_delim
+lispdir!$lispdir$ac_delim
+locallisppath!$locallisppath$ac_delim
+lisppath!$lisppath$ac_delim
+x_default_search_path!$x_default_search_path$ac_delim
+etcdir!$etcdir$ac_delim
+archlibdir!$archlibdir$ac_delim
+bitmapdir!$bitmapdir$ac_delim
+gamedir!$gamedir$ac_delim
+gameuser!$gameuser$ac_delim
+c_switch_system!$c_switch_system$ac_delim
+c_switch_machine!$c_switch_machine$ac_delim
+LD_SWITCH_X_SITE!$LD_SWITCH_X_SITE$ac_delim
+LD_SWITCH_X_SITE_AUX!$LD_SWITCH_X_SITE_AUX$ac_delim
+_ACEOF
+
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
+    break
+  elif $ac_last_try; then
+    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
   fi
-fi # test -n "$CONFIG_FILES"
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+  ac_eof=`expr $ac_eof + 1`
+fi
 
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+CEOF$ac_eof
 _ACEOF
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  cat >conf$$subs.sed <<_ACEOF
+C_SWITCH_X_SITE!$C_SWITCH_X_SITE$ac_delim
+X_TOOLKIT_TYPE!$X_TOOLKIT_TYPE$ac_delim
+machfile!$machfile$ac_delim
+opsysfile!$opsysfile$ac_delim
+carbon_appdir!$carbon_appdir$ac_delim
+LTLIBOBJS!$LTLIBOBJS$ac_delim
+_ACEOF
+
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 6; then
+    break
+  elif $ac_last_try; then
+    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+  ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+:end
+s/|#_!!_#|//g
+CEOF$ac_eof
+_ACEOF
+
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[         ]*VPATH[        ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[    ]*\):*/\1/
+s/:*$//
+s/^[^=]*=[      ]*$//
+}'
+fi
+
 cat >>$CONFIG_STATUS <<\_ACEOF
-for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
-  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
-  case $ac_file in
-  - | *:- | *:-:* ) # input from stdin
-       cat >$tmp/stdin
-       ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-       ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-       ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  * )   ac_file_in=$ac_file.in ;;
+fi # test -n "$CONFIG_FILES"
+
+
+for ac_tag in  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
+echo "$as_me: error: Invalid tag $ac_tag." >&2;}
+   { (exit 1); exit 1; }; };;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
   esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
 
-  # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
-  ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+        # (if the path is not absolute).  The absolute path cannot be DOS-style,
+        # because $ac_f cannot contain `:'.
+        test -f "$ac_f" ||
+          case $ac_f in
+          [\\/$]*) false;;
+          *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+          esac ||
+          { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+   { (exit 1); exit 1; }; };;
+      esac
+      ac_file_inputs="$ac_file_inputs $ac_f"
+    done
+
+    # Let's still pretend it is `configure' which instantiates (i.e., don't
+    # use $as_me), people would be surprised to read:
+    #    /* config.h.  Generated by config.status.  */
+    configure_input="Generated from "`IFS=:
+         echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    fi
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin";;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
 $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
         X"$ac_file" : 'X\(//\)[^/]' \| \
         X"$ac_file" : 'X\(//\)$' \| \
-        X"$ac_file" : 'X\(/\)' \| \
-        .     : '\(.\)' 2>/dev/null ||
+        X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
 echo X"$ac_file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-  { if $as_mkdir_p; then
-    mkdir -p "$ac_dir"
-  else
-    as_dir="$ac_dir"
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  { as_dir="$ac_dir"
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
     as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
         X"$as_dir" : 'X\(//\)[^/]' \| \
         X"$as_dir" : 'X\(//\)$' \| \
-        X"$as_dir" : 'X\(/\)' \| \
-        .     : '\(.\)' 2>/dev/null ||
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
 echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
     done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
    { (exit 1); exit 1; }; }; }
-
   ac_builddir=.
 
-if test "$ac_dir" != .; then
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
   ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
-  # A "../" for each directory in $ac_dir_suffix.
-  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
-  ac_dir_suffix= ac_top_builddir=
-fi
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
 
 case $srcdir in
-  .)  # No --srcdir option.  We are building in place.
+  .)  # We are building in place.
     ac_srcdir=.
-    if test -z "$ac_top_builddir"; then
-       ac_top_srcdir=.
-    else
-       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
-    fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
     ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir ;;
-  *) # Relative path.
-    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_builddir$srcdir ;;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
 esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
 
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
-  case "$ac_dir" in
-  .) ac_abs_builddir=`pwd`;;
-  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
-  *) ac_abs_builddir=`pwd`/"$ac_dir";;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
-  case ${ac_top_builddir}. in
-  .) ac_abs_top_builddir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
-  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
-  case $ac_srcdir in
-  .) ac_abs_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
-  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
-  case $ac_top_srcdir in
-  .) ac_abs_top_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
-  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
-  esac;;
-esac
 
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
 
   case $INSTALL in
   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
-  *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
   esac
+_ACEOF
 
-  # Let's still pretend it is `configure' which instantiates (i.e., don't
-  # use $as_me), people would be surprised to read:
-  #    /* config.h.  Generated by config.status.  */
-  if test x"$ac_file" = x-; then
-    configure_input=
-  else
-    configure_input="$ac_file.  "
-  fi
-  configure_input=$configure_input"Generated from `echo $ac_file_in |
-                                    sed 's,.*/,,'` by configure."
-
-  # First look for the input files in the build tree, otherwise in the
-  # src tree.
-  ac_file_inputs=`IFS=:
-    for f in $ac_file_in; do
-      case $f in
-      -) echo $tmp/stdin ;;
-      [\\/$]*)
-        # Absolute (can't be DOS-style, as IFS=:)
-        test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-        echo "$f";;
-      *) # Relative
-        if test -f "$f"; then
-          # Build tree
-          echo "$f"
-        elif test -f "$srcdir/$f"; then
-          # Source tree
-          echo "$srcdir/$f"
-        else
-          # /dev/null tree
-          { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-        fi;;
-      esac
-    done` || { (exit 1); exit 1; }
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
 
-  if test x"$ac_file" != x-; then
-    { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
-    rm -f "$ac_file"
-  fi
+case `sed -n '/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+' $ac_file_inputs` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
 _ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+    s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
 cat >>$CONFIG_STATUS <<_ACEOF
   sed "$ac_vpsub
 $extrasub
@@ -23954,365 +23898,140 @@ _ACEOF
 cat >>$CONFIG_STATUS <<\_ACEOF
 :t
 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s,@configure_input@,$configure_input,;t t
-s,@srcdir@,$ac_srcdir,;t t
-s,@abs_srcdir@,$ac_abs_srcdir,;t t
-s,@top_srcdir@,$ac_top_srcdir,;t t
-s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
-s,@builddir@,$ac_builddir,;t t
-s,@abs_builddir@,$ac_abs_builddir,;t t
-s,@top_builddir@,$ac_top_builddir,;t t
-s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
-s,@INSTALL@,$ac_INSTALL,;t t
-" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
-  rm -f $tmp/stdin
-  if test x"$ac_file" != x-; then
-    mv $tmp/out $ac_file
-  else
-    cat $tmp/out
-    rm -f $tmp/out
-  fi
-
-done
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-#
-# CONFIG_HEADER section.
-#
-
-# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
-# NAME is the cpp macro being defined and VALUE is the value it is being given.
-#
-# ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
-ac_dB='[        ].*$,\1#\2'
-ac_dC=' '
-ac_dD=',;t'
-# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
-ac_uB='$,\1#\2define\3'
-ac_uC=' '
-ac_uD=',;t'
-
-for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
-  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+s&@configure_input@&$configure_input&;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+$ac_datarootdir_hack
+" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[         ]*datarootdir[  ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&5
+echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&2;}
+
+  rm -f "$tmp/stdin"
   case $ac_file in
-  - | *:- | *:-:* ) # input from stdin
-       cat >$tmp/stdin
-       ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-       ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
-       ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
-  * )   ac_file_in=$ac_file.in ;;
+  -) cat "$tmp/out"; rm -f "$tmp/out";;
+  *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
   esac
-
-  test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
-
-  # First look for the input files in the build tree, otherwise in the
-  # src tree.
-  ac_file_inputs=`IFS=:
-    for f in $ac_file_in; do
-      case $f in
-      -) echo $tmp/stdin ;;
-      [\\/$]*)
-        # Absolute (can't be DOS-style, as IFS=:)
-        test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-        # Do quote $f, to prevent DOS paths from being IFS'd.
-        echo "$f";;
-      *) # Relative
-        if test -f "$f"; then
-          # Build tree
-          echo "$f"
-        elif test -f "$srcdir/$f"; then
-          # Source tree
-          echo "$srcdir/$f"
-        else
-          # /dev/null tree
-          { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
-   { (exit 1); exit 1; }; }
-        fi;;
-      esac
-    done` || { (exit 1); exit 1; }
-  # Remove the trailing spaces.
-  sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
-
-_ACEOF
-
-# Transform confdefs.h into two sed scripts, `conftest.defines' and
-# `conftest.undefs', that substitutes the proper values into
-# config.h.in to produce config.h.  The first handles `#define'
-# templates, and the second `#undef' templates.
-# And first: Protect against being on the right side of a sed subst in
-# config.status.  Protect against being in an unquoted here document
-# in config.status.
-rm -f conftest.defines conftest.undefs
-# Using a here document instead of a string reduces the quoting nightmare.
-# Putting comments in sed scripts is not portable.
-#
-# `end' is used to avoid that the second main sed command (meant for
-# 0-ary CPP macros) applies to n-ary macro definitions.
-# See the Autoconf documentation for `clear'.
-cat >confdef2sed.sed <<\_ACEOF
-s/[\\&,]/\\&/g
-s,[\\$`],\\&,g
-t clear
-: clear
-s,^[    ]*#[    ]*define[       ][      ]*\([^  (][^    (]*\)\(([^)]*)\)[       ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
-t end
-s,^[    ]*#[    ]*define[       ][      ]*\([^  ][^     ]*\)[   ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
-: end
-_ACEOF
-# If some macros were called several times there might be several times
-# the same #defines, which is useless.  Nevertheless, we may not want to
-# sort them, since we want the *last* AC-DEFINE to be honored.
-uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
-sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
-rm -f confdef2sed.sed
-
-# This sed command replaces #undef with comments.  This is necessary, for
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+_ACEOF
+
+# Transform confdefs.h into a sed script `conftest.defines', that
+# substitutes the proper values into config.h.in to produce config.h.
+rm -f conftest.defines conftest.tail
+# First, append a space to every undef/define line, to ease matching.
+echo 's/$/ /' >conftest.defines
+# Then, protect against being on the right side of a sed subst, or in
+# an unquoted here document, in config.status.  If some macros were
+# called several times there might be several #defines for the same
+# symbol, which is useless.  But do not sort them, since the last
+# AC_DEFINE must be honored.
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
+# NAME is the cpp macro being defined, VALUE is the value it is being given.
+# PARAMS is the parameter list in the macro definition--in most cases, it's
+# just an empty string.
+ac_dA='s,^\\([  #]*\\)[^        ]*\\([  ]*'
+ac_dB='\\)[     (].*,\\1define\\2'
+ac_dC=' '
+ac_dD=' ,'
+
+uniq confdefs.h |
+  sed -n '
+       t rset
+       :rset
+       s/^[     ]*#[    ]*define[       ][      ]*//
+       t ok
+       d
+       :ok
+       s/[\\&,]/\\&/g
+       s/^\('"$ac_word_re"'\)\(([^()]*)\)[      ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
+       s/^\('"$ac_word_re"'\)[  ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
+  ' >>conftest.defines
+
+# Remove the space that was appended to ease matching.
+# Then replace #undef with comments.  This is necessary, for
 # example, in the case of _POSIX_SOURCE, which is predefined and required
 # on some systems where configure will not decide to define it.
-cat >>conftest.undefs <<\_ACEOF
-s,^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
-_ACEOF
-
-# Break up conftest.defines because some shells have a limit on the size
-# of here documents, and old seds have small limits too (100 cmds).
-echo '  # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
-echo '  if grep "^[     ]*#[    ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
-echo '  # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
-echo '  :' >>$CONFIG_STATUS
-rm -f conftest.tail
-while grep . conftest.defines >/dev/null
+# (The regexp can be short, since the line contains either #define or #undef.)
+echo 's/ $//
+s,^[    #]*u.*,/* & */,' >>conftest.defines
+
+# Break up conftest.defines:
+ac_max_sed_lines=50
+
+# First sed command is:         sed -f defines.sed $ac_file_inputs >"$tmp/out1"
+# Second one is:        sed -f defines.sed "$tmp/out1" >"$tmp/out2"
+# Third one will be:    sed -f defines.sed "$tmp/out2" >"$tmp/out1"
+# et cetera.
+ac_in='$ac_file_inputs'
+ac_out='"$tmp/out1"'
+ac_nxt='"$tmp/out2"'
+
+while :
 do
-  # Write a limited-size here document to $tmp/defines.sed.
-  echo '  cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
-  # Speed up: don't consider the non `#define' lines.
-  echo '/^[     ]*#[    ]*define/!b' >>$CONFIG_STATUS
-  # Work around the forget-to-reset-the-flag bug.
-  echo 't clr' >>$CONFIG_STATUS
-  echo ': clr' >>$CONFIG_STATUS
-  sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
+  # Write a here document:
+    cat >>$CONFIG_STATUS <<_ACEOF
+    # First, check the format of the line:
+    cat >"\$tmp/defines.sed" <<\\CEOF
+/^[     ]*#[    ]*undef[        ][      ]*$ac_word_re[  ]*\$/b def
+/^[     ]*#[    ]*define[       ][      ]*$ac_word_re[(         ]/b def
+b
+:def
+_ACEOF
+  sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
   echo 'CEOF
-  sed -f $tmp/defines.sed $tmp/in >$tmp/out
-  rm -f $tmp/in
-  mv $tmp/out $tmp/in
-' >>$CONFIG_STATUS
-  sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
+    sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
+  ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
+  sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
+  grep . conftest.tail >/dev/null || break
   rm -f conftest.defines
   mv conftest.tail conftest.defines
 done
-rm -f conftest.defines
-echo '  fi # grep' >>$CONFIG_STATUS
-echo >>$CONFIG_STATUS
-
-# Break up conftest.undefs because some shells have a limit on the size
-# of here documents, and old seds have small limits too (100 cmds).
-echo '  # Handle all the #undef templates' >>$CONFIG_STATUS
-rm -f conftest.tail
-while grep . conftest.undefs >/dev/null
-do
-  # Write a limited-size here document to $tmp/undefs.sed.
-  echo '  cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
-  # Speed up: don't consider the non `#undef'
-  echo '/^[     ]*#[    ]*undef/!b' >>$CONFIG_STATUS
-  # Work around the forget-to-reset-the-flag bug.
-  echo 't clr' >>$CONFIG_STATUS
-  echo ': clr' >>$CONFIG_STATUS
-  sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
-  echo 'CEOF
-  sed -f $tmp/undefs.sed $tmp/in >$tmp/out
-  rm -f $tmp/in
-  mv $tmp/out $tmp/in
-' >>$CONFIG_STATUS
-  sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
-  rm -f conftest.undefs
-  mv conftest.tail conftest.undefs
-done
-rm -f conftest.undefs
+rm -f conftest.defines conftest.tail
 
+echo "ac_result=$ac_in" >>$CONFIG_STATUS
 cat >>$CONFIG_STATUS <<\_ACEOF
-  # Let's still pretend it is `configure' which instantiates (i.e., don't
-  # use $as_me), people would be surprised to read:
-  #    /* config.h.  Generated by config.status.  */
-  if test x"$ac_file" = x-; then
-    echo "/* Generated by configure.  */" >$tmp/config.h
-  else
-    echo "/* $ac_file.  Generated by configure.  */" >$tmp/config.h
-  fi
-  cat $tmp/in >>$tmp/config.h
-  rm -f $tmp/in
   if test x"$ac_file" != x-; then
-    if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
+    echo "/* $configure_input  */" >"$tmp/config.h"
+    cat "$ac_result" >>"$tmp/config.h"
+    if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then
       { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
 echo "$as_me: $ac_file is unchanged" >&6;}
     else
-      ac_dir=`(dirname "$ac_file") 2>/dev/null ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-        X"$ac_file" : 'X\(//\)[^/]' \| \
-        X"$ac_file" : 'X\(//\)$' \| \
-        X"$ac_file" : 'X\(/\)' \| \
-        .     : '\(.\)' 2>/dev/null ||
-echo X"$ac_file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-      { if $as_mkdir_p; then
-    mkdir -p "$ac_dir"
-  else
-    as_dir="$ac_dir"
-    as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-        X"$as_dir" : 'X\(//\)[^/]' \| \
-        X"$as_dir" : 'X\(//\)$' \| \
-        X"$as_dir" : 'X\(/\)' \| \
-        .     : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-    done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
-   { (exit 1); exit 1; }; }; }
-
       rm -f $ac_file
-      mv $tmp/config.h $ac_file
+      mv "$tmp/config.h" $ac_file
     fi
   else
-    cat $tmp/config.h
-    rm -f $tmp/config.h
+    echo "/* $configure_input  */"
+    cat "$ac_result"
   fi
-done
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-#
-# CONFIG_COMMANDS section.
-#
-for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
-  ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
-  ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
-  ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
-$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-        X"$ac_dest" : 'X\(//\)[^/]' \| \
-        X"$ac_dest" : 'X\(//\)$' \| \
-        X"$ac_dest" : 'X\(/\)' \| \
-        .     : '\(.\)' 2>/dev/null ||
-echo X"$ac_dest" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-  { if $as_mkdir_p; then
-    mkdir -p "$ac_dir"
-  else
-    as_dir="$ac_dir"
-    as_dirs=
-    while test ! -d "$as_dir"; do
-      as_dirs="$as_dir $as_dirs"
-      as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-        X"$as_dir" : 'X\(//\)[^/]' \| \
-        X"$as_dir" : 'X\(//\)$' \| \
-        X"$as_dir" : 'X\(/\)' \| \
-        .     : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
-         /^X\(\/\/\)[^/].*/{ s//\1/; q; }
-         /^X\(\/\/\)$/{ s//\1/; q; }
-         /^X\(\/\).*/{ s//\1/; q; }
-         s/.*/./; q'`
-    done
-    test ! -n "$as_dirs" || mkdir $as_dirs
-  fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
-   { (exit 1); exit 1; }; }; }
-
-  ac_builddir=.
-
-if test "$ac_dir" != .; then
-  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
-  # A "../" for each directory in $ac_dir_suffix.
-  ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
-  ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
-  .)  # No --srcdir option.  We are building in place.
-    ac_srcdir=.
-    if test -z "$ac_top_builddir"; then
-       ac_top_srcdir=.
-    else
-       ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
-    fi ;;
-  [\\/]* | ?:[\\/]* )  # Absolute path.
-    ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir ;;
-  *) # Relative path.
-    ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
+  rm -f "$tmp/out12"
+ ;;
 
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
-  case "$ac_dir" in
-  .) ac_abs_builddir=`pwd`;;
-  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
-  *) ac_abs_builddir=`pwd`/"$ac_dir";;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
-  case ${ac_top_builddir}. in
-  .) ac_abs_top_builddir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
-  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
-  case $ac_srcdir in
-  .) ac_abs_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
-  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
-  esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
-  case $ac_top_srcdir in
-  .) ac_abs_top_srcdir=$ac_abs_builddir;;
-  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
-  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
-  esac;;
-esac
+  :C)  { echo "$as_me:$LINENO: executing $ac_file commands" >&5
+echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
 
 
-  { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
-echo "$as_me: executing $ac_dest commands" >&6;}
-  case $ac_dest in
-    default )
+  case $ac_file$ac_mode in
+    "default":C)
 
 ### Make the necessary directories, if they don't exist.
 for dir in etc lisp ; do
 touch src/config.stamp
 
  ;;
+
   esac
-done
-_ACEOF
+done # for ac_tag
 
-cat >>$CONFIG_STATUS <<\_ACEOF
 
 { (exit 0); exit 0; }
 _ACEOF
index 8b2bfcb..86b4811 100644 (file)
@@ -2073,12 +2073,15 @@ if test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "gtk"; then
 
   dnl  Check if we can use multiple displays with this GTK version.
   dnl  If gdk_display_open exists, assume all others are there also.
+  dnl  XXX The multidisplay feature is severely broken in current GTK
+  dnl  versions. --lorentey
   HAVE_GTK_MULTIDISPLAY=no
-  AC_CHECK_FUNCS(gdk_display_open, HAVE_GTK_MULTIDISPLAY=yes)
-  if test "${HAVE_GTK_MULTIDISPLAY}" = "yes"; then
-    AC_DEFINE(HAVE_GTK_MULTIDISPLAY, 1,
-              [Define to 1 if GTK can handle more than one display.])
-  fi
+  dnl AC_CHECK_FUNCS(gdk_display_open, HAVE_GTK_MULTIDISPLAY=yes)
+  dnl if test "${HAVE_GTK_MULTIDISPLAY}" = "yes"; then
+  dnl   AC_DEFINE(HAVE_GTK_MULTIDISPLAY, 1,
+  dnl             [Define to 1 if GTK can handle more than one display.])
+  dnl fi
+
   dnl  Check if we have the old file selection dialog.
   dnl  If gdk_display_open exists, assume all others are there also.
   HAVE_GTK_FILE_SELECTION=no
diff --git a/info/COPYING b/info/COPYING
deleted file mode 100644 (file)
index d511905..0000000
+++ /dev/null
@@ -1,339 +0,0 @@
-                   GNU GENERAL PUBLIC LICENSE
-                      Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-                           Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.)  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-                   GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-  2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-                           NO WARRANTY
-
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-                    END OF TERMS AND CONDITIONS
-
-           How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    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
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    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, write to the Free Software Foundation, Inc.,
-    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
-    Gnomovision version 69, Copyright (C) year name of author
-    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-  <signature of Ty Coon>, 1 April 1989
-  Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs.  If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.
index f05b98e..64a0e00 100644 (file)
@@ -76,7 +76,31 @@ Boston, MA 02110-1301, USA.  */
 # include <pwd.h>
 #endif /* not WINDOWSNT */
 #endif /* not VMS */
+#include <sys/stat.h>
 
+#include <signal.h>
+#include <errno.h>
+
+/* From lisp.h */
+#ifndef DIRECTORY_SEP
+#define DIRECTORY_SEP '/'
+#endif
+#ifndef IS_DIRECTORY_SEP
+#define IS_DIRECTORY_SEP(_c_) ((_c_) == DIRECTORY_SEP)
+#endif
+#ifndef IS_DEVICE_SEP
+#ifndef DEVICE_SEP
+#define IS_DEVICE_SEP(_c_) 0
+#else
+#define IS_DEVICE_SEP(_c_) ((_c_) == DEVICE_SEP)
+#endif
+#endif
+#ifndef IS_ANY_SEP
+#define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_))
+#endif
+
+
+\f
 char *getenv (), *getwd ();
 char *(getcwd) ();
 
@@ -85,7 +109,7 @@ char *(getcwd) ();
 #endif
 \f
 #define SEND_STRING(data) (send_to_emacs (s, (data)))
-#define SEND_QUOTED(data) (quote_file_name (s, (data)))
+#define SEND_QUOTED(data) (quote_argument (s, (data)))
 
 #ifndef EXIT_SUCCESS
 #define EXIT_SUCCESS 0
@@ -110,15 +134,30 @@ char *(getcwd) ();
 /* Name used to invoke this program.  */
 char *progname;
 
+/* The first argument to main. */
+int main_argc;
+
+/* The second argument to main. */
+char **main_argv;
+
 /* Nonzero means don't wait for a response from Emacs.  --no-wait.  */
 int nowait = 0;
 
 /* Nonzero means args are expressions to be evaluated.  --eval.  */
 int eval = 0;
 
+/* Nonzero means don't open a new frame.  --current-frame.  */
+int current_frame = 0;
+
+/* Nonzero means open a new graphical frame. */
+int window_system = 0;
+
 /* The display on which Emacs should work.  --display.  */
 char *display = NULL;
 
+/* Nonzero means open a new Emacs frame on the current terminal. */
+int tty = 0;
+
 /* If non-NULL, the name of an editor to fallback to if the server
    is not running.  --alternate-editor.   */
 const char *alternate_editor = NULL;
@@ -132,6 +171,9 @@ char *server_file = NULL;
 /* PID of the Emacs server process.  */
 int emacs_pid = 0;
 
+/* File handles for communicating with Emacs. */
+FILE *out, *in;
+
 void print_help_and_exit () NO_RETURN;
 
 struct option longopts[] =
@@ -140,6 +182,8 @@ struct option longopts[] =
   { "eval",    no_argument,       NULL, 'e' },
   { "help",    no_argument,       NULL, 'H' },
   { "version", no_argument,       NULL, 'V' },
+  { "tty",     no_argument,       NULL, 't' },
+  { "current-frame", no_argument,  NULL, 'c' },
   { "alternate-editor", required_argument, NULL, 'a' },
 #ifndef NO_SOCKETS_IN_FILE_SYSTEM
   { "socket-name",     required_argument, NULL, 's' },
@@ -149,6 +193,111 @@ struct option longopts[] =
   { 0, 0, 0, 0 }
 };
 
+\f
+/* Like malloc but get fatal error if memory is exhausted.  */
+
+long *
+xmalloc (size)
+     unsigned int size;
+{
+  long *result = (long *) malloc (size);
+  if (result == NULL)
+    {
+      perror ("malloc");
+      exit (EXIT_FAILURE);
+    }
+  return result;
+}
+
+/* Like strdup but get a fatal error if memory is exhausted. */
+
+char *
+xstrdup (const char *s)
+{
+  char *result = strdup (s);
+  if (result == NULL)
+    {
+      perror ("strdup");
+      exit (EXIT_FAILURE);
+    }
+  return result;
+}
+
+/* From sysdep.c */
+#if !defined (HAVE_GET_CURRENT_DIR_NAME) || defined (BROKEN_GET_CURRENT_DIR_NAME)
+
+/* Return the current working directory.  Returns NULL on errors.
+   Any other returned value must be freed with free. This is used
+   only when get_current_dir_name is not defined on the system.  */
+char*
+get_current_dir_name ()
+{
+  char *buf;
+  char *pwd;
+  struct stat dotstat, pwdstat;
+  /* If PWD is accurate, use it instead of calling getwd.  PWD is
+     sometimes a nicer name, and using it may avoid a fatal error if a
+     parent directory is searchable but not readable.  */
+    if ((pwd = getenv ("PWD")) != 0
+      && (IS_DIRECTORY_SEP (*pwd) || (*pwd && IS_DEVICE_SEP (pwd[1])))
+      && stat (pwd, &pwdstat) == 0
+      && stat (".", &dotstat) == 0
+      && dotstat.st_ino == pwdstat.st_ino
+      && dotstat.st_dev == pwdstat.st_dev
+#ifdef MAXPATHLEN
+      && strlen (pwd) < MAXPATHLEN
+#endif
+      )
+    {
+      buf = (char *) xmalloc (strlen (pwd) + 1);
+      if (!buf)
+        return NULL;
+      strcpy (buf, pwd);
+    }
+#ifdef HAVE_GETCWD
+  else
+    {
+      size_t buf_size = 1024;
+      buf = (char *) xmalloc (buf_size);
+      if (!buf)
+        return NULL;
+      for (;;)
+        {
+          if (getcwd (buf, buf_size) == buf)
+            break;
+          if (errno != ERANGE)
+            {
+              int tmp_errno = errno;
+              free (buf);
+              errno = tmp_errno;
+              return NULL;
+            }
+          buf_size *= 2;
+          buf = (char *) realloc (buf, buf_size);
+          if (!buf)
+            return NULL;
+        }
+    }
+#else
+  else
+    {
+      /* We need MAXPATHLEN here.  */
+      buf = (char *) xmalloc (MAXPATHLEN + 1);
+      if (!buf)
+        return NULL;
+      if (getwd (buf) == NULL)
+        {
+          int tmp_errno = errno;
+          free (buf);
+          errno = tmp_errno;
+          return NULL;
+        }
+    }
+#endif
+  return buf;
+}
+#endif
+
 /* Message functions. */
 
 #ifdef WINDOWSNT
@@ -205,16 +354,19 @@ decode_options (argc, argv)
      char **argv;
 {
   alternate_editor = getenv ("ALTERNATE_EDITOR");
+  display = getenv ("DISPLAY");
+  if (display && strlen (display) == 0)
+    display = NULL;
 
   while (1)
     {
       int opt = getopt_long (argc, argv,
 #ifndef NO_SOCKETS_IN_FILE_SYSTEM
-                            "VHnea:s:f:d:",
+                            "VHnea:s:f:d:tc",
 #else
-                             "VHnea:f:d:",
+                            "VHnea:f:d:tc",
 #endif
-                             longopts, 0);
+                            longopts, 0);
 
       if (opt == EOF)
        break;
@@ -257,6 +409,14 @@ decode_options (argc, argv)
          exit (EXIT_SUCCESS);
          break;
 
+        case 't':
+          tty = 1;
+          break;
+
+        case 'c':
+          current_frame = 1;
+          break;
+
        case 'H':
          print_help_and_exit ();
          break;
@@ -267,55 +427,73 @@ decode_options (argc, argv)
          break;
        }
     }
+
+  if (!tty && display)
+    window_system = 1;
+  else
+    tty = 1;
+
+  /* --no-wait implies --current-frame on ttys when there are file
+       arguments or expressions given.  */
+  if (nowait && tty && argc - optind > 0)
+    current_frame = 1;
+
+  if (current_frame)
+    {
+      tty = 0;
+      window_system = 0;
+    }
+
+  if (tty)
+    window_system = 0;
 }
 
+\f
 void
 print_help_and_exit ()
 {
   message (FALSE,
-         "Usage: %s [OPTIONS] FILE...\n\
+          "Usage: %s [OPTIONS] FILE...\n\
 Tell the Emacs server to visit the specified files.\n\
 Every FILE can be either just a FILENAME or [+LINE[:COLUMN]] FILENAME.\n\
 \n\
 The following OPTIONS are accepted:\n\
-\n\
--V, --version          Just print version info and return\n\
--H, --help             Print this usage information message\n\
--e, --eval             Evaluate FILE arguments as Lisp expressions\n\
--n, --no-wait          Don't wait for the server to return\n\
--d, --display=DISPLAY  Visit the file in the given display\n"
+-V, --version           Just print version info and return\n\
+-H, --help              Print this usage information message\n\
+-t, --tty               Open a new Emacs frame on the current terminal\n\
+-c, --current-frame    Do not create a new frame; use the current Emacs frame\n\
+-e, --eval              Evaluate the FILE arguments as ELisp expressions\n\
+-n, --no-wait           Don't wait for the server to return\n\
+-d, --display=DISPLAY   Visit the file in the given display\n"
 #ifndef NO_SOCKETS_IN_FILE_SYSTEM
 "-s, --socket-name=FILENAME\n\
-                       Set filename of the UNIX socket for communication\n"
+                        Set filename of the UNIX socket for communication\n"
 #endif
 "-f, --server-file=FILENAME\n\
-                       Set filename of the TCP authentication file\n\
+                        Set filename of the TCP authentication file\n\
 -a, --alternate-editor=EDITOR\n\
-                       Editor to fallback to if server is not running\n\
+                        Editor to fallback to if the server is not running\n\
 \n\
 Report bugs to bug-gnu-emacs@gnu.org.\n", progname);
   exit (EXIT_SUCCESS);
 }
 
-\f
 /*
   Try to run a different command, or --if no alternate editor is
   defined-- exit with an errorcode.
 */
 void
-fail (argc, argv)
-     int argc;
-     char **argv;
+fail (void)
 {
   if (alternate_editor)
     {
       int i = optind - 1;
 #ifdef WINDOWSNT
-      argv[i] = (char *)alternate_editor;
+      main_argv[i] = (char *)alternate_editor;
 #endif
-      execvp (alternate_editor, argv + i);
+      execvp (alternate_editor, main_argv + i);
       message (TRUE, "%s: error executing alternate editor \"%s\"\n",
-               progname, alternate_editor);
+              progname, alternate_editor);
     }
   exit (EXIT_FAILURE);
 }
@@ -328,10 +506,13 @@ main (argc, argv)
      int argc;
      char **argv;
 {
-  message (TRUE, "%s: Sorry, the Emacs server is supported only\non systems with Berkely sockets.\n",
+  main_argc = argc;
+  main_argv = argv;
+  progname = argv[0];
+  message (TRUE, "%s: Sorry, the Emacs server is supported only\n"
+          "on systems with Berkeley sockets.\n", 
           argv[0]);
-
-  fail (argc, argv);
+  fail ();
 }
 
 #else /* HAVE_SOCKETS && HAVE_INET_SOCKETS */
@@ -395,18 +576,21 @@ send_to_emacs (s, data)
     }
 }
 
-/* In NAME, insert a & before each &, each space, each newline, and
+\f
+/* In STR, insert a & before each &, each space, each newline, and
    any initial -.  Change spaces to underscores, too, so that the
-   return value never contains a space.  */
+   return value never contains a space.
+
+   Does not change the string.  Outputs the result to STREAM.  */
 void
-quote_file_name (s, name)
+quote_argument (s, str)
      HSOCKET s;
-     char *name;
+     char *str;
 {
-  char *copy = (char *) malloc (strlen (name) * 2 + 1);
+  char *copy = (char *) xmalloc (strlen (str) * 2 + 1);
   char *p, *q;
 
-  p = name;
+  p = str;
   q = copy;
   while (*p)
     {
@@ -424,7 +608,7 @@ quote_file_name (s, name)
        }
       else
        {
-         if (*p == '&' || (*p == '-' && p == name))
+         if (*p == '&' || (*p == '-' && p == str))
            *q++ = '&';
          *q++ = *p++;
        }
@@ -436,6 +620,42 @@ quote_file_name (s, name)
   free (copy);
 }
 
+
+/* The inverse of quote_argument.  Removes quoting in string STR by
+   modifying the string in place.   Returns STR. */
+
+char *
+unquote_argument (str)
+     char *str;
+{
+  char *p, *q;
+
+  if (! str)
+    return str;
+
+  p = str;
+  q = str;
+  while (*p)
+    {
+      if (*p == '&')
+        {
+          p++;
+          if (*p == '&')
+            *p = '&';
+          else if (*p == '_')
+            *p = ' ';
+          else if (*p == 'n')
+            *p = '\n';
+          else if (*p == '-')
+            *p = '-';
+        }
+      *q++ = *p++;
+    }
+  *q = 0;
+  return str;
+}
+
+\f
 int
 file_name_absolute_p (filename)
      const unsigned char *filename;
@@ -485,6 +705,7 @@ initialize_sockets ()
   atexit (close_winsock);
 }
 #endif /* WINDOWSNT */
+
 \f
 /*
  * Read the information needed to set up a TCP comm channel with
@@ -624,6 +845,119 @@ socket_status (socket_name)
   return 0;
 }
 
+\f
+/* A signal handler that passes the signal to the Emacs process.
+   Useful for SIGWINCH.  */
+
+SIGTYPE
+pass_signal_to_emacs (int signalnum)
+{
+  int old_errno = errno;
+
+  if (emacs_pid)
+    kill (emacs_pid, signalnum);
+
+  signal (signalnum, pass_signal_to_emacs);
+  errno = old_errno;
+}
+
+/* Signal handler for SIGCONT; notify the Emacs process that it can
+   now resume our tty frame.  */
+
+SIGTYPE
+handle_sigcont (int signalnum)
+{
+  int old_errno = errno;
+
+  if (tcgetpgrp (1) == getpgrp ())
+    {
+      /* We are in the foreground. */
+      fprintf (out, "-resume \n");
+      fflush (out);
+      fsync (fileno (out));
+    }
+  else
+    {
+      /* We are in the background; cancel the continue. */
+      kill (getpid (), SIGSTOP);
+    }
+
+  signal (signalnum, handle_sigcont);
+  errno = old_errno;
+}
+
+/* Signal handler for SIGTSTP; notify the Emacs process that we are
+   going to sleep.  Normally the suspend is initiated by Emacs via
+   server-handle-suspend-tty, but if the server gets out of sync with
+   reality, we may get a SIGTSTP on C-z.  Handling this signal and
+   notifying Emacs about it should get things under control again. */
+
+SIGTYPE
+handle_sigtstp (int signalnum)
+{
+  int old_errno = errno;
+  sigset_t set;
+  
+  if (out)
+    {
+      fprintf (out, "-suspend \n");
+      fflush (out);
+      fsync (fileno (out));
+    }
+
+  /* Unblock this signal and call the default handler by temprarily
+     changing the handler and resignalling. */
+  sigprocmask (SIG_BLOCK, NULL, &set);
+  sigdelset (&set, signalnum);
+  signal (signalnum, SIG_DFL);
+  kill (getpid (), signalnum);
+  sigprocmask (SIG_SETMASK, &set, NULL); /* Let's the above signal through. */
+  signal (signalnum, handle_sigtstp);
+
+  errno = old_errno;
+}
+
+/* Set up signal handlers before opening a frame on the current tty.  */
+
+void
+init_signals (void)
+{
+  /* Set up signal handlers. */
+  signal (SIGWINCH, pass_signal_to_emacs);
+
+  /* Don't pass SIGINT and SIGQUIT to Emacs, because it has no way of
+     deciding which terminal the signal came from.  C-g is now a
+     normal input event on secondary terminals.  */
+#if 0
+  signal (SIGINT, pass_signal_to_emacs);
+  signal (SIGQUIT, pass_signal_to_emacs);
+#endif
+
+  signal (SIGCONT, handle_sigcont);
+  signal (SIGTSTP, handle_sigtstp);
+  signal (SIGTTOU, handle_sigtstp);
+}
+
+
+
+/* Returns 1 if PREFIX is a prefix of STRING. */
+static int
+strprefix (char *prefix, char *string)
+{
+  int i;
+  if (! prefix)
+    return 1;
+
+  if (!string)
+    return 0;
+
+  for (i = 0; prefix[i]; i++)
+    if (!string[i] || string[i] != prefix[i])
+      return 0;
+  return 1;
+}
+
+
 HSOCKET
 set_local_socket ()
 {
@@ -645,30 +979,31 @@ set_local_socket ()
   {
     int sock_status = 0;
     int default_sock = !socket_name;
-    int saved_errno;
+    int saved_errno = 0;
+
     char *server_name = "server";
 
     if (socket_name && !index (socket_name, '/') && !index (socket_name, '\\'))
       { /* socket_name is a file name component.  */
-       server_name = socket_name;
-       socket_name = NULL;
-       default_sock = 1;       /* Try both UIDs.  */
+       server_name = socket_name;
+       socket_name = NULL;
+       default_sock = 1;       /* Try both UIDs.  */
       }
 
     if (default_sock)
       {
-       socket_name = alloca (100 + strlen (server_name));
-       sprintf (socket_name, "/tmp/emacs%d/%s",
-                (int) geteuid (), server_name);
+       socket_name = alloca (100 + strlen (server_name));
+       sprintf (socket_name, "/tmp/emacs%d/%s",
+                (int) geteuid (), server_name);
       }
 
     if (strlen (socket_name) < sizeof (server.sun_path))
       strcpy (server.sun_path, socket_name);
     else
       {
-       message (TRUE, "%s: socket-name %s too long",
-                progname, socket_name);
-       exit (EXIT_FAILURE);
+        message (TRUE, "%s: socket-name %s too long",
+                 progname, socket_name);
+        fail ();
       }
 
     /* See if the socket exists, and if it's owned by us. */
@@ -707,7 +1042,7 @@ set_local_socket ()
                  }
 
                sock_status = socket_status (server.sun_path);
-               saved_errno = errno;
+                saved_errno = errno;
              }
            else
              errno = saved_errno;
@@ -717,26 +1052,26 @@ set_local_socket ()
     switch (sock_status)
       {
       case 1:
-        /* There's a socket, but it isn't owned by us.  This is OK if
-           we are root. */
-        if (0 != geteuid ())
-          {
-            message (TRUE, "%s: Invalid socket owner\n", progname);
+       /* There's a socket, but it isn't owned by us.  This is OK if
+          we are root. */
+       if (0 != geteuid ())
+         {
+           message (TRUE, "%s: Invalid socket owner\n", progname);
            return INVALID_SOCKET;
-          }
-        break;
+         }
+       break;
 
       case 2:
-        /* `stat' failed */
-        if (saved_errno == ENOENT)
-          message (TRUE,
-                   "%s: can't find socket; have you started the server?\n\
+       /* `stat' failed */
+       if (saved_errno == ENOENT)
+         message (TRUE,
+                  "%s: can't find socket; have you started the server?\n\
 To start the server in Emacs, type \"M-x server-start\".\n",
                   progname);
-        else
-          message (TRUE, "%s: can't stat %s: %s\n",
+       else
+         message (TRUE, "%s: can't stat %s: %s\n",
                   progname, server.sun_path, strerror (saved_errno));
-        return INVALID_SOCKET;
+       return INVALID_SOCKET;
       }
   }
 
@@ -755,19 +1090,18 @@ HSOCKET
 set_socket ()
 {
   HSOCKET s;
-
+  
   INITIALIZE ();
-
+  
 #ifndef NO_SOCKETS_IN_FILE_SYSTEM
   /* Explicit --socket-name argument.  */
   if (socket_name)
     {
       s = set_local_socket ();
       if ((s != INVALID_SOCKET) || alternate_editor)
-        return s;
-
+       return s;
       message (TRUE, "%s: error accessing socket \"%s\"",
-               progname, socket_name);
+              progname, socket_name);
       exit (EXIT_FAILURE);
     }
 #endif
@@ -780,13 +1114,13 @@ set_socket ()
     {
       s = set_tcp_socket ();
       if ((s != INVALID_SOCKET) || alternate_editor)
-        return s;
-
+       return s;
       message (TRUE, "%s: error accessing server file \"%s\"",
-               progname, server_file);
+              progname, server_file);
       exit (EXIT_FAILURE);
     }
-
+  
 #ifndef NO_SOCKETS_IN_FILE_SYSTEM
   /* Implicit local socket.  */
   s = set_local_socket ();
@@ -818,40 +1152,35 @@ main (argc, argv)
 {
   HSOCKET s;
   int i, rl, needlf = 0;
-  char *cwd;
+  char *cwd, *str;
   char string[BUFSIZ+1];
 
+  main_argc = argc;
+  main_argv = argv;
   progname = argv[0];
 
   /* Process options.  */
   decode_options (argc, argv);
 
-  if ((argc - optind < 1) && !eval)
+  if ((argc - optind < 1) && !eval && !tty && !window_system)
     {
-      message (TRUE, "%s: file name or argument required\nTry `%s --help' for more information\n",
-              progname, progname);
+      message (TRUE, "%s: file name or argument required\n"
+              "Try `%s --help' for more information\n",
+              progname, progname);
       exit (EXIT_FAILURE);
     }
 
   if ((s = set_socket ()) == INVALID_SOCKET)
-    fail (argc, argv);
+    fail ();
 
-#ifdef HAVE_GETCWD
-  cwd = getcwd (string, sizeof string);
-#else
-  cwd = getwd (string);
-#endif
+
+  cwd = get_current_dir_name ();
   if (cwd == 0)
     {
       /* getwd puts message in STRING if it fails.  */
-      message (TRUE, "%s: %s (%s)\n", progname,
-#ifdef HAVE_GETCWD
-              "Cannot get current working directory",
-#else
-              string,
-#endif
-              strerror (errno));
-      fail (argc, argv);
+      message (TRUE, "%s: %s\n", progname,
+              "Cannot get current working directory");
+      fail ();
     }
 
 #ifdef WINDOWSNT
@@ -860,7 +1189,7 @@ main (argc, argv)
     emacsclient can allow Emacs to grab the focus by calling the function
     AllowSetForegroundWindow().  Unfortunately, older Windows (W95, W98
     and NT) lack this function, so we have to check its availability.
-   */
+  */
   if (emacs_pid)
     {
       HMODULE hUser32;
@@ -875,12 +1204,42 @@ main (argc, argv)
     }
 #endif
 
+  /* First of all, send our version number for verification. */
+  SEND_STRING ("-version ");
+  SEND_STRING (VERSION);
+  SEND_STRING (" ");
+
+  /* Send over our environment. */
+  if (!current_frame)
+    {
+      extern char **environ;
+      int i;
+      for (i = 0; environ[i]; i++)
+        {
+          char *name = xstrdup (environ[i]);
+          char *value = strchr (name, '=');
+          SEND_STRING ("-env ");
+          SEND_QUOTED (environ[i]);
+          SEND_STRING (" ");
+        }
+    }
+
+  /* Send over our current directory. */
+  if (!current_frame)
+    {
+      SEND_STRING ("-dir ");          
+      SEND_QUOTED (cwd);
+      SEND_STRING ("/");
+      SEND_STRING (" ");
+    }
+
+ retry:
   if (nowait)
     SEND_STRING ("-nowait ");
 
-  if (eval)
-    SEND_STRING ("-eval ");
-
+  if (current_frame)
+    SEND_STRING ("-current-frame ");
+  
   if (display)
     {
       SEND_STRING ("-display ");
@@ -888,74 +1247,189 @@ main (argc, argv)
       SEND_STRING (" ");
     }
 
+  if (tty)
+    {
+      char *tty_name = ttyname (fileno (stdin));
+      char *type = getenv ("TERM");
+
+      if (! tty_name)
+        {
+          message (TRUE, "%s: could not get terminal name\n", progname);
+          fail ();
+        }
+
+      if (! type)
+        {
+          message (TRUE, "%s: please set the TERM variable to your terminal type\n",
+                   progname);
+          fail ();
+        }
+
+      if (! strcmp (type, "eterm"))
+        {
+          /* This causes nasty, MULTI_KBOARD-related input lockouts. */
+          message (TRUE, "%s: opening a frame in an Emacs term buffer"
+                   " is not supported\n", progname);
+          fail ();
+        }
+
+      init_signals ();
+
+      SEND_STRING ("-tty ");
+      SEND_QUOTED (tty_name);
+      SEND_STRING (" ");
+      SEND_QUOTED (type);
+      SEND_STRING (" ");
+    }
+
+  if (window_system)
+    SEND_STRING ("-window-system ");
+
   if ((argc - optind > 0))
     {
       for (i = optind; i < argc; i++)
        {
+          int relative = 0;
+
          if (eval)
-           ; /* Don't prepend any cwd or anything like that.  */
-         else if (*argv[i] == '+')
-           {
+            {
+              /* Don't prepend cwd or anything like that.  */
+              SEND_STRING ("-eval ");
+              SEND_QUOTED (argv[i]);
+              SEND_STRING (" ");
+              continue;
+            }
+
+          if (*argv[i] == '+')
+            {
              char *p = argv[i] + 1;
              while (isdigit ((unsigned char) *p) || *p == ':') p++;
-             if (*p != 0)
-               {
-                 SEND_QUOTED (cwd);
-                 SEND_STRING ("/");
-               }
-           }
+             if (*p == 0)
+                {
+                  SEND_STRING ("-position ");
+                  SEND_QUOTED (argv[i]);
+                  SEND_STRING (" ");
+                  continue;
+                }
+              else
+                relative = 1;
+            }
           else if (! file_name_absolute_p (argv[i]))
-           {
-             SEND_QUOTED (cwd);
-             SEND_STRING ("/");
-           }
-
-         SEND_QUOTED (argv[i]);
-         SEND_STRING (" ");
-       }
+            relative = 1;
+
+          SEND_STRING ("-file ");
+          if (relative)
+            {
+              SEND_QUOTED (cwd);
+              SEND_STRING ("/");
+            }
+          SEND_QUOTED (argv[i]);
+          SEND_STRING (" ");
+        }
     }
   else
     {
-      while (fgets (string, BUFSIZ, stdin))
-       {
-         SEND_QUOTED (string);
-       }
-      SEND_STRING (" ");
+      if (!tty && !window_system)
+        {
+          while ((str = fgets (string, BUFSIZ, stdin)))
+            {
+              if (eval)
+                SEND_STRING ("-eval ");
+              else
+                SEND_STRING ("-file ");
+              SEND_QUOTED (out);
+            }
+          SEND_STRING (" ");
+        }
     }
 
   SEND_STRING ("\n");
 
-  /* Maybe wait for an answer.   */
-  if (!nowait)
+  /* Wait for an answer. */
+  if (!eval && !tty && !nowait)
     {
-      if (!eval)
+      printf ("Waiting for Emacs...");
+      needlf = 2;
+    }
+  fflush (stdout);
+  fsync (1);
+
+  /* Now, wait for an answer and print any messages.  */
+  while ((rl = recv (s, string, BUFSIZ, 0)) > 0)
+    {
+      char *p;
+      string[rl] = '\0';
+
+      p = string + strlen (string) - 1;
+      while (p > string && *p == '\n')
+        *p-- = 0;
+
+      if (strprefix ("-good-version ", string))
         {
-          printf ("Waiting for Emacs...");
-          needlf = 2;
+          /* -good-version: The versions match. */
         }
-      fflush (stdout);
-
-      /* Now, wait for an answer and print any messages.  */
-      while ((rl = recv (s, string, BUFSIZ, 0)) > 0)
+      else if (strprefix ("-emacs-pid ", string))
+        {
+          /* -emacs-pid PID: The process id of the Emacs process. */
+          emacs_pid = strtol (string + strlen ("-emacs-pid"), NULL, 10);
+        }
+      else if (strprefix ("-window-system-unsupported ", string))
+        {
+          /* -window-system-unsupported: Emacs was compiled without X
+              support.  Try again on the terminal. */
+          window_system = 0;
+          nowait = 0;
+          tty = 1;
+          goto retry;
+        }
+      else if (strprefix ("-print ", string))
         {
-         string[rl] = '\0';
-          if (needlf == 2)
+          /* -print STRING: Print STRING on the terminal. */
+          str = unquote_argument (string + strlen ("-print "));
+          if (needlf)
             printf ("\n");
-         printf ("%s", string);
-         needlf = string[0] == '\0' ? needlf : string[strlen (string) - 1] != '\n';
+          printf ("%s", str);
+          needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n';
+        }
+      else if (strprefix ("-error ", string))
+        {
+          /* -error DESCRIPTION: Signal an error on the terminal. */
+          str = unquote_argument (string + strlen ("-error "));
+          if (needlf)
+            printf ("\n");
+          fprintf (stderr, "*ERROR*: %s", str);
+          needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n';
+        }
+      else if (strprefix ("-suspend ", str))
+        {
+          /* -suspend: Suspend this terminal, i.e., stop the process. */
+          if (needlf)
+            printf ("\n");
+          needlf = 0;
+          kill (0, SIGSTOP);
+        }
+      else
+        {
+          /* Unknown command. */
+          if (needlf)
+            printf ("\n");
+          printf ("*ERROR*: Unknown message: %s", string);
+          needlf = string[0] == '\0' ? needlf : string[strlen (string) - 1] != '\n';
         }
-
-      if (needlf)
-        printf ("\n");
-      fflush (stdout);
     }
 
+  if (needlf)
+    printf ("\n");
+  fflush (stdout);
+  fsync (1);
+
   CLOSE_SOCKET (s);
   return EXIT_SUCCESS;
 }
 
 #endif /* HAVE_SOCKETS && HAVE_INET_SOCKETS */
 
+\f
 #ifndef HAVE_STRERROR
 char *
 strerror (errnum)
index c3578a4..26dac36 100644 (file)
@@ -41,7 +41,7 @@
  * configuration file containing regexp definitions for etags.
  */
 
-char pot_etags_version[] = "@(#) pot revision number is $Revision: 17.22 $";
+char pot_etags_version[] = "@(#) pot revision number is $Revision: 3.61 $";
 
 #define        TRUE    1
 #define        FALSE   0
index 6fb7b40..755d7fe 100644 (file)
@@ -170,6 +170,12 @@ corresponding to the mode line clicked."
       (push (cons eol (cons mnemonic desc)) mode-line-eol-desc-cache)
       desc)))
 
+(defvar mode-line-client
+  `(""
+    (:propertize ("" (:eval (if (frame-parameter nil 'client) "@" "")))
+                help-echo "Emacsclient frame"))
+  "Mode-line control for identifying Emacsclient frames.")
+
 (defvar mode-line-mule-info
   `(""
     (current-input-method
@@ -209,7 +215,7 @@ mnemonics of the following coding systems:
 
 (make-variable-buffer-local 'mode-line-mule-info)
 
-(defvar mode-line-frame-identification '("-%F  ")
+(defvar mode-line-frame-identification '(window-system "  " "-%F  ")
   "Mode-line control to describe the current frame.")
 
 (defvar mode-line-process nil "\
@@ -286,6 +292,7 @@ Keymap to display on minor modes.")
         "%e"
         (propertize "-" 'help-echo help-echo)
         'mode-line-mule-info
+        'mode-line-client
         'mode-line-modified
         'mode-line-frame-identification
         'mode-line-buffer-identification
@@ -314,6 +321,7 @@ Keymap to display on minor modes.")
                     'local-map (make-mode-line-mouse-map
                                 'mouse-2 #'mode-line-widen))
         (propertize ")%]--" 'help-echo help-echo)))
+
        (standard-mode-line-position
        `((-3 ,(propertize "%p" 'help-echo help-echo))
          (size-indication-mode
index 53ad084..e847ae1 100644 (file)
     (when (fboundp 'facep)
       (unless (facep face)
        ;; If the user has already created the face, respect that.
-       (let ((value (or (get face 'saved-face) spec)))
+       (let ((value (or (get face 'saved-face) spec))
+             (have-window-system (memq initial-window-system '(x w32))))
          ;; Create global face.
          (make-empty-face face)
          ;; Create frame-local faces
          (dolist (frame (frame-list))
-           (face-spec-set face value frame)))
-       ;; When making a face after frames already exist
-       (if (memq window-system '(x w32 mac))
-           (make-face-x-resource-internal face))))
+           (face-spec-set face value frame)
+           (when (memq (window-system frame) '(x w32 mac))
+             (setq have-window-system t)))
+         ;; When making a face after frames already exist
+         (if have-window-system
+             (make-face-x-resource-internal face)))))
     ;; Don't record SPEC until we see it causes no errors.
     (put face 'face-defface-spec spec)
     (push (cons 'defface face) current-load-list)
index 730c83e..15f314d 100644 (file)
@@ -412,14 +412,10 @@ since it could result in memory overflow and make Emacs crash."
                       (eq system-type 'ms-dos))
                      ((string-match "\\`w32-" (symbol-name symbol))
                       (eq system-type 'windows-nt))
-                     ((string-match "\\`mac-" (symbol-name symbol))
-                      (eq window-system 'mac))
+                     ((string-match "\\`mac-" (symbol-name symbol))
+                      (or (eq system-type 'mac) (eq system-type 'darwin)))
                      ((string-match "\\`x-.*gtk" (symbol-name symbol))
-                      (or (boundp 'gtk)
-                          (and window-system
-                               (not (eq window-system 'pc))
-                               (not (eq window-system 'mac))
-                               (not (eq system-type 'windows-nt)))))
+                      (featurep 'gtk))
                      ((string-match "\\`x-" (symbol-name symbol))
                       (fboundp 'x-create-frame))
                      ((string-match "selection" (symbol-name symbol))
index e869ca3..25fd2c4 100644 (file)
@@ -145,11 +145,12 @@ but not `C-u X' or `ESC X' since the X is not the prefix key."
   (if enable-flag
       (progn
        ;; Set up key-translation-map as indicated by `double-map'.
+       ;; XXX I don't think key-translation-map should be made local here. -- Lorentey
        (kill-local-variable 'key-translation-map)
        (make-local-variable 'key-translation-map)
        (setq key-translation-map (if (keymapp key-translation-map)
-                                     (copy-keymap key-translation-map)
-                                   (make-sparse-keymap)))
+                                            (copy-keymap key-translation-map)
+                                          (make-sparse-keymap)))
        (mapcar (function (lambda (entry)
                            (define-key key-translation-map
                              (vector (nth 0 entry))
index e3f9183..8bfbb53 100644 (file)
@@ -175,7 +175,7 @@ Entry to this mode via command `electric-buffer-list' calls the value of
   (let ((map (make-keymap)))
     (fillarray (car (cdr map)) 'Electric-buffer-menu-undefined)
     (define-key map "\e" nil)
-    (define-key map "\C-z" 'suspend-emacs)
+    (define-key map "\C-z" 'suspend-frame)
     (define-key map "v" 'Electric-buffer-menu-mode-view-buffer)
     (define-key map (char-to-string help-char) 'Helper-help)
     (define-key map "?" 'Helper-describe-bindings)
index 2ddc7f1..46a1f53 100644 (file)
@@ -66,7 +66,7 @@ With prefix arg NOCONFIRM, execute current line as-is without editing."
   (define-key electric-history-map "\C-c" nil)
   (define-key electric-history-map "\C-c\C-c" 'Electric-history-quit)
   (define-key electric-history-map "\C-]" 'Electric-history-quit)
-  (define-key electric-history-map "\C-z" 'suspend-emacs)
+  (define-key electric-history-map "\C-z" 'suspend-frame)
   (define-key electric-history-map (char-to-string help-char) 'Helper-help)
   (define-key electric-history-map "?" 'Helper-describe-bindings)
   (define-key electric-history-map "\e>" 'end-of-buffer)
index c0786b9..7d9daa6 100644 (file)
   :group 'frames)
 
 
-(defcustom ediff-window-setup-function (if (ediff-window-display-p)
-                                       'ediff-setup-windows-multiframe
-                                     'ediff-setup-windows-plain)
+(defcustom ediff-window-setup-function 'ediff-setup-windows-automatic
   "*Function called to set up windows.
-Ediff provides a choice of two functions: `ediff-setup-windows-plain', for
-doing everything in one frame, and `ediff-setup-windows-multiframe',
-which sets the control panel in a separate frame.  Also, if the latter
-function detects that one of the buffers A/B is seen in some other frame,
-it will try to keep that buffer in that frame.
+Ediff provides a choice of three functions: `ediff-setup-windows-plain', for
+doing everything in one frame, `ediff-setup-windows-multiframe', which sets
+the control panel in a separate frame, and
+`ediff-setup-windows-automatic' (the default), which chooses an appropriate
+behaviour based on the current window system.  If the multiframe function
+detects that one of the buffers A/B is seen in some other frame, it will try
+to keep that buffer in that frame.
 
 If you don't like the two functions provided---write your own one.
 The basic guidelines:
@@ -94,7 +94,8 @@ The basic guidelines:
        Buffer C may not be used in jobs that compare only two buffers.
 If you plan to do something fancy, take a close look at how the two
 provided functions are written."
-  :type '(choice (const :tag "Multi Frame" ediff-setup-windows-multiframe)
+  :type '(choice (const :tag "Automatic" ediff-setup-windows-automatic)
+                (const :tag "Multi Frame" ediff-setup-windows-multiframe)
                 (const :tag "Single Frame" ediff-setup-windows-plain)
                 (function :tag "Other function"))
   :group 'ediff-window)
@@ -335,6 +336,12 @@ into icons, regardless of the window manager."
        buffer-A buffer-B buffer-C control-buffer))
   (run-hooks 'ediff-after-setup-windows-hook))
 
+;; Set up windows using the correct method based on the current window system.
+(defun ediff-setup-windows-automatic (buffer-A buffer-B buffer-C control-buffer)
+  (if (ediff-window-display-p)
+      (ediff-setup-windows-multiframe buffer-A buffer-B buffer-C control-buffer)
+    (ediff-setup-windows-plain buffer-A buffer-B buffer-C control-buffer)))
+
 ;; Just set up 3 windows.
 ;; Usually used without windowing systems
 ;; With windowing, we want to use dedicated frames.
index 0fecaf2..3b562bb 100644 (file)
@@ -489,9 +489,9 @@ doubt, use whitespace."
             (fkey nil) tlen tkey
             (bind (or (loop for map in maps for b = (lookup-key map key)
                             thereis (and (not (integerp b)) b))
-                      (and (setq fkey (lookup-key function-key-map rest-mac))
+                      (and (setq fkey (lookup-key local-function-key-map rest-mac))
                            (setq tlen fkey tkey (edmacro-subseq rest-mac 0 tlen)
-                                 fkey (lookup-key function-key-map tkey))
+                                 fkey (lookup-key local-function-key-map tkey))
                            (loop for map in maps
                                  for b = (lookup-key map fkey)
                                  when (and (not (integerp b)) b)
index 2fbd096..236e3e2 100644 (file)
@@ -1144,9 +1144,9 @@ If ARG is the atom `-', scroll upward by nearly full screen."
        (memq 'shift (event-modifiers
                     (aref (this-single-command-keys) 0)))
        ;; See if raw escape sequence maps to a shifted event, e.g. S-up or C-S-home.
-       (and (boundp 'function-key-map)
-           function-key-map
-           (let ((ev (lookup-key function-key-map
+       (and (boundp 'local-function-key-map)
+           local-function-key-map
+           (let ((ev (lookup-key local-function-key-map
                                  (this-single-command-raw-keys))))
              (and (vector ev)
                   (symbolp (setq ev (aref ev 0)))
index 5a3de0a..96ff1f3 100644 (file)
@@ -36,6 +36,8 @@
 
 ;;; Code:
 
+(eval-when-compile (require 'cl))
+
 ;; History list for environment variable names.
 (defvar read-envvar-name-history nil)
 
@@ -52,7 +54,8 @@ If it is also not t, RET does not exit if it does non-null completion."
                                        locale-coding-system t)
                                     (substring enventry 0
                                                (string-match "=" enventry)))))
-                          process-environment)
+                          (append process-environment
+                                  (frame-parameter (frame-with-environment) 'environment)))
                   nil mustmatch nil 'read-envvar-name-history))
 
 ;; History list for VALUE argument to setenv.
@@ -88,27 +91,70 @@ Use `$$' to insert a single dollar sign."
                   start (+ (match-beginning 0) 1)))))
     string))
 
-;; Fixme: Should `process-environment' be recoded if LC_CTYPE &c is set?
 
-(defun setenv (variable &optional value substitute-env-vars)
+(defun setenv-internal (env variable value keep-empty)
+  "Set VARIABLE to VALUE in ENV, adding empty entries if KEEP-EMPTY.
+Changes ENV by side-effect, and returns its new value."
+  (let ((pattern (concat "\\`" (regexp-quote variable) "\\(=\\|\\'\\)"))
+       (case-fold-search nil)
+       (scan env)
+       prev found)
+    ;; Handle deletions from the beginning of the list specially.
+    (if (and (null value)
+            (not keep-empty)
+            env
+            (stringp (car env))
+            (string-match pattern (car env)))
+       (cdr env)
+      ;; Try to find existing entry for VARIABLE in ENV.
+      (while (and scan (stringp (car scan)))
+       (when (string-match pattern (car scan))
+         (if value
+             (setcar scan (concat variable "=" value))
+           (if keep-empty
+               (setcar scan variable)
+             (setcdr prev (cdr scan))))
+         (setq found t
+               scan nil))
+       (setq prev scan
+             scan (cdr scan)))
+      (if (and (not found) (or value keep-empty))
+         (cons (if value
+                   (concat variable "=" value)
+                 variable)
+               env)
+       env))))
+
+;; Fixme: Should the environment be recoded if LC_CTYPE &c is set?
+
+(defun setenv (variable &optional value substitute-env-vars frame)
   "Set the value of the environment variable named VARIABLE to VALUE.
 VARIABLE should be a string.  VALUE is optional; if not provided or
 nil, the environment variable VARIABLE will be removed.
 
-Interactively, a prefix argument means to unset the variable.
-Interactively, the current value (if any) of the variable
-appears at the front of the history list when you type in the new value.
-Interactively, always replace environment variables in the new value.
+Interactively, a prefix argument means to unset the variable, and
+otherwise the current value (if any) of the variable appears at
+the front of the history list when you type in the new value.
+This function always replaces environment variables in the new
+value when called interactively.
 
 SUBSTITUTE-ENV-VARS, if non-nil, means to substitute environment
 variables in VALUE with `substitute-env-vars', which see.
 This is normally used only for interactive calls.
 
+If optional parameter FRAME is non-nil, this function modifies
+only the frame-local value of VARIABLE on FRAME, ignoring
+`process-environment'.  Note that frames on the same terminal
+device usually share their environment, so calling `setenv' on
+one of them affects the others as well.
+
+If FRAME is nil, `setenv' changes the global value of VARIABLE by
+modifying `process-environment'.  Note that the global value
+overrides any frame-local values.
+
 The return value is the new value of VARIABLE, or nil if
 it was removed from the environment.
 
-This function works by modifying `process-environment'.
-
 As a special case, setting variable `TZ' calls `set-time-zone-rule' as
 a side-effect."
   (interactive
@@ -138,36 +184,30 @@ a side-effect."
   (if (and value (multibyte-string-p value))
       (setq value (encode-coding-string value locale-coding-system)))
   (if (string-match "=" variable)
-      (error "Environment variable name `%s' contains `='" variable)
-    (let ((pattern (concat "\\`" (regexp-quote (concat variable "="))))
-         (case-fold-search nil)
-         (scan process-environment)
-         found)
-      (if (string-equal "TZ" variable)
-         (set-time-zone-rule value))
-      (while scan
-       (cond ((string-match pattern (car scan))
-              (setq found t)
-              (if (eq nil value)
-                  (setq process-environment (delq (car scan)
-                                                  process-environment))
-                (setcar scan (concat variable "=" value)))
-              (setq scan nil)))
-       (setq scan (cdr scan)))
-      (or found
-         (if value
-             (setq process-environment
-                   (cons (concat variable "=" value)
-                         process-environment))))))
+      (error "Environment variable name `%s' contains `='" variable))
+  (if (string-equal "TZ" variable)
+      (set-time-zone-rule value))
+  (if (null frame)
+      (setq process-environment (setenv-internal process-environment
+                                                variable value t))
+    (setq frame (frame-with-environment frame))
+    (set-frame-parameter frame 'environment
+                        (setenv-internal (frame-parameter frame 'environment)
+                                         variable value nil)))
   value)
 
-(defun getenv (variable)
+(defun getenv (variable &optional frame)
   "Get the value of environment variable VARIABLE.
 VARIABLE should be a string.  Value is nil if VARIABLE is undefined in
 the environment.  Otherwise, value is a string.
 
-This function consults the variable `process-environment'
-for its value."
+If optional parameter FRAME is non-nil, then it should be a
+frame.  This function will look up VARIABLE in its 'environment
+parameter.
+
+Otherwise, this function searches `process-environment' for
+VARIABLE.  If it is not found there, then it continues the search
+in the environment list of the selected frame."
   (interactive (list (read-envvar-name "Get environment variable: " t)))
   (let ((value (getenv-internal (if (multibyte-string-p variable)
                                    (encode-coding-string
@@ -179,6 +219,91 @@ for its value."
       (message "%s" (if value value "Not set")))
     value))
 
+(defun environment ()
+  "Return a list of environment variables with their values.
+Each entry in the list is a string of the form NAME=VALUE.
+
+The returned list can not be used to change environment
+variables, only read them.  See `setenv' to do that.
+
+The list is constructed by concatenating the elements of
+`process-environment' and the 'environment parameter of the
+selected frame, and removing duplicated and empty values.
+
+Non-ASCII characters are encoded according to the initial value of
+`locale-coding-system', i.e. the elements must normally be decoded for use.
+See `setenv' and `getenv'."
+  (let* ((env (append process-environment
+                     (frame-parameter (frame-with-environment)
+                                      'environment)
+                     nil))
+        (scan env)
+        prev seen)
+    ;; Remove unset variables from the beginning of the list.
+    (while (and env
+               (or (not (stringp (car env)))
+                   (not (string-match "=" (car env)))))
+      (or (member (car env) seen)
+         (setq seen (cons (car env) seen)))
+      (setq env (cdr env)
+           scan env))
+    (let (name)
+      (while scan
+       (cond ((or (not (stringp (car scan)))
+                  (not (string-match "=" (car scan))))
+              ;; Unset variable.
+              (or (member (car scan) seen)
+                  (setq seen (cons (car scan) seen)))
+              (setcdr prev (cdr scan)))
+             ((member (setq name (substring (car scan) 0 (string-match "=" (car scan)))) seen)
+              ;; Duplicated variable.
+              (setcdr prev (cdr scan)))
+             (t
+              ;; New variable.
+              (setq seen (cons name seen))))
+       (setq prev scan
+             scan (cdr scan))))
+    env))
+
+(defmacro let-environment (varlist &rest body)
+  "Evaluate BODY with environment variables set according to VARLIST.
+The environment variables are then restored to their previous
+values.
+The value of the last form in BODY is returned.
+
+Each element of VARLIST is either a string (which variable is
+then removed from the environment), or a list (NAME
+VALUEFORM) (which sets NAME to the value of VALUEFORM, a string).
+All the VALUEFORMs are evaluated before any variables are set."
+  (declare (indent 2))
+  (let ((old-env (make-symbol "old-env"))
+       (name (make-symbol "name"))
+       (value (make-symbol "value"))
+       (entry (make-symbol "entry"))
+       (frame (make-symbol "frame")))
+    `(let ((,frame (selected-frame))
+           ,old-env)
+       ;; Evaluate VALUEFORMs and replace them in VARLIST with their values.
+       (dolist (,entry ,varlist)
+        (unless (stringp ,entry)
+          (if (cdr (cdr ,entry))
+              (error "`let-environment' bindings can have only one value-form"))
+          (setcdr ,entry (eval (cadr ,entry)))))
+       ;; Set the variables.
+       (dolist (,entry ,varlist)
+        (let ((,name (if (stringp ,entry) ,entry (car ,entry)))
+              (,value (if (consp ,entry) (cdr ,entry))))
+          (setq ,old-env (cons (cons ,name (getenv ,name)) ,old-env))
+          (setenv ,name ,value)))
+       (unwind-protect
+          (progn ,@body)
+        ;; Restore old values.
+        (with-selected-frame (if (frame-live-p ,frame)
+                                 ,frame
+                               (selected-frame))
+          (dolist (,entry ,old-env)
+            (setenv (car ,entry) (cdr ,entry))))))))
+
 (provide 'env)
 
 ;;; arch-tag: b7d6a8f7-bc81-46db-8e39-8d721d4ed0b8
index c44bee3..a681c89 100644 (file)
@@ -935,7 +935,7 @@ an integer value."
   (let ((valid
          (case attribute
            (:family
-            (if window-system
+            (if (window-system frame)
                 (mapcar #'(lambda (x) (cons (car x) (car x)))
                         (x-font-family-list))
              ;; Only one font on TTYs.
@@ -944,7 +944,7 @@ an integer value."
             (mapcar #'(lambda (x) (cons (symbol-name x) x))
                     (internal-lisp-face-attribute-values attribute)))
            ((:underline :overline :strike-through :box)
-            (if window-system
+            (if (window-system frame)
                 (nconc (mapcar #'(lambda (x) (cons (symbol-name x) x))
                                (internal-lisp-face-attribute-values attribute))
                        (mapcar #'(lambda (c) (cons c c))
@@ -957,7 +957,7 @@ an integer value."
            ((:height)
             'integerp)
            (:stipple
-            (and (memq window-system '(x w32 mac))
+            (and (memq (window-system frame) '(x w32 mac))
                  (mapcar #'list
                          (apply #'nconc
                                 (mapcar (lambda (dir)
@@ -1075,7 +1075,7 @@ of a global face.  Value is the new attribute value."
               ;; explicitly in VALID, using color approximation code
               ;; in tty-colors.el.
               (when (and (memq attribute '(:foreground :background))
-                         (not (memq window-system '(x w32 mac)))
+                         (not (memq (window-system frame) '(x w32 mac)))
                          (not (member new-value
                                       '("unspecified"
                                         "unspecified-fg" "unspecified-bg"))))
@@ -1371,14 +1371,14 @@ If FRAME is nil, the current FRAME is used."
            req (car conjunct)
            options (cdr conjunct)
            match (cond ((eq req 'type)
-                        (or (memq window-system options)
+                        (or (memq (window-system frame) options)
                             ;; FIXME: This should be revisited to use
                             ;; display-graphic-p, provided that the
                             ;; color selection depends on the number
                             ;; of supported colors, and all defface's
                             ;; are changed to look at number of colors
                             ;; instead of (type graphic) etc.
-                            (and (null window-system)
+                            (and (null (window-system frame))
                                  (memq 'tty options))
                             (and (memq 'motif options)
                                  (featurep 'motif))
@@ -1592,35 +1592,40 @@ variable with `setq'; this won't have the expected effect."
                 (const light)
                 (const :tag "automatic" nil)))
 
-(defvar default-frame-background-mode nil
-  "Internal variable for the default brightness of the background.
-Emacs sets it automatically depending on the terminal type.
-The value `nil' means `dark'.  If Emacs runs in non-windowed
-mode from `xterm' or a similar terminal emulator, the value is
-`light'.  On rxvt terminals, the value depends on the environment
-variable COLORFGBG.")
 
 (defun frame-set-background-mode (frame)
   "Set up display-dependent faces on FRAME.
 Display-dependent faces are those which have different definitions
 according to the `background-mode' and `display-type' frame parameters."
   (let* ((bg-resource
-         (and window-system
+         (and (window-system frame)
               (x-get-resource "backgroundMode" "BackgroundMode")))
         (bg-color (frame-parameter frame 'background-color))
+        (terminal-bg-mode (terminal-parameter frame 'background-mode))
+        (tty-type (tty-type frame))
         (bg-mode
          (cond (frame-background-mode)
                (bg-resource
                 (intern (downcase bg-resource)))
-               ((and (null window-system) (null bg-color))
-                ;; No way to determine this automatically (?).
-                (or default-frame-background-mode 'dark))
-               ;; Unspecified frame background color can only happen
-               ;; on tty's.
-               ((member bg-color '(unspecified "unspecified-bg"))
-                (or default-frame-background-mode 'dark))
+               (terminal-bg-mode)
+               ((and (null (window-system frame))
+                     ;; Unspecified frame background color can only
+                     ;; happen on tty's.
+                     (member bg-color '(nil unspecified "unspecified-bg")))
+                ;; There is no way to determine the background mode
+                ;; automatically, so we make a guess based on the
+                ;; terminal type.
+                (if (and tty-type
+                         (string-match "^\\(xterm\\|rxvt\\|dtterm\\|eterm\\)"
+                                       tty-type))
+                    'light
+                  'dark))
                ((equal bg-color "unspecified-fg") ; inverted colors
-                (if (eq default-frame-background-mode 'light) 'dark 'light))
+                (if (and tty-type
+                         (string-match "^\\(xterm\\|rxvt\\|dtterm\\|eterm\\)"
+                                       tty-type))
+                    'dark
+                  'light))
                ((>= (apply '+ (x-color-values bg-color frame))
                    ;; Just looking at the screen, colors whose
                    ;; values add up to .6 of the white total
@@ -1629,7 +1634,7 @@ according to the `background-mode' and `display-type' frame parameters."
                 'light)
                (t 'dark)))
         (display-type
-         (cond ((null window-system)
+         (cond ((null (window-system frame))
                 (if (tty-display-color-p frame) 'color 'mono))
                ((x-display-color-p frame)
                 'color)
@@ -1725,15 +1730,24 @@ the X resource ``reverseVideo'' is present, handle that.
 Value is the new frame created."
   (setq parameters (x-handle-named-frame-geometry parameters))
   (let ((visibility-spec (assq 'visibility parameters))
-       (frame-list (frame-list))
-       (frame (x-create-frame (cons '(visibility . nil) parameters)))
+       (frame (x-create-frame `((visibility . nil) . ,parameters)))
        success)
     (unwind-protect
        (progn
+         (x-setup-function-keys frame)
          (x-handle-reverse-video frame parameters)
          (frame-set-background-mode frame)
          (face-set-after-frame-default frame)
-         (if (or (null frame-list) (null visibility-spec))
+         ;; Arrange for the kill and yank functions to set and check the clipboard.
+         (modify-frame-parameters
+          frame '((interprogram-cut-function . x-select-text)))
+         (modify-frame-parameters
+          frame '((interprogram-paste-function . x-cut-buffer-or-selection-value)))
+         ;; Make sure the tool-bar is ready to be enabled.  The
+         ;; `tool-bar-lines' frame parameter will not take effect
+         ;; without this call.
+         (tool-bar-setup frame)
+         (if (null visibility-spec)
              (make-frame-visible frame)
            (modify-frame-parameters frame (list visibility-spec)))
          (setq success t))
@@ -1764,7 +1778,7 @@ Initialize colors of certain faces from frame parameters."
        (when (not (equal face 'default))
          (face-spec-set face (face-user-default-spec face) frame)
          (internal-merge-in-global-face face frame)
-         (when (and (memq window-system '(x w32 mac))
+         (when (and (memq (window-system frame) '(x w32 mac))
                     (or (not (boundp 'inhibit-default-face-x-resources))
                         (not (eq face 'default))))
            (make-face-x-resource-internal face frame)))
@@ -1815,8 +1829,15 @@ created."
   (let ((frame (make-terminal-frame parameters))
        success)
     (unwind-protect
-       (progn
+       (with-selected-frame frame
          (tty-handle-reverse-video frame (frame-parameters frame))
+
+         ;; Make sure the kill and yank functions do not touch the X clipboard.
+         (modify-frame-parameters frame '((interprogram-cut-function . nil)))
+         (modify-frame-parameters frame '((interprogram-paste-function . nil)))
+
+         (set-locale-environment nil frame)
+         (tty-run-terminal-initialization frame)
          (frame-set-background-mode frame)
          (face-set-after-frame-default frame)
          (setq success t))
@@ -1824,6 +1845,52 @@ created."
        (delete-frame frame)))
     frame))
 
+(defun tty-find-type (pred type)
+  "Return the longest prefix of TYPE to which PRED returns non-nil.
+TYPE should be a tty type name such as \"xterm-16color\".
+
+The function tries only those prefixes that are followed by a
+dash or underscore in the original type name, like \"xterm\" in
+the above example."
+  (let (hyphend)
+    (while (and type
+               (not (funcall pred type)))
+      ;; Strip off last hyphen and what follows, then try again
+      (setq type
+           (if (setq hyphend (string-match "[-_][^-_]+$" type))
+               (substring type 0 hyphend)
+             nil))))
+  type)
+
+(defun tty-run-terminal-initialization (frame &optional type)
+  "Run the special initialization code for the terminal type of FRAME.
+The optional TYPE parameter may be used to override the autodetected
+terminal type to a different value."
+  (setq type (or type (tty-type frame)))
+  ;; Load library for our terminal type.
+  ;; User init file can set term-file-prefix to nil to prevent this.
+  (with-selected-frame frame
+    (unless (or (null term-file-prefix)
+               ;; Don't reinitialize the terminal each time a new
+               ;; frame is opened on it.
+               (terminal-parameter frame 'terminal-initted))
+      (let* (term-init-func)
+       ;; First, load the terminal initialization file, if it is
+       ;; available and it hasn't been loaded already.
+       (tty-find-type #'(lambda (type)
+                          (let ((file (locate-library (concat term-file-prefix type))))
+                            (and file
+                                 (or (assoc file load-history)
+                                     (load file t t)))))
+                      type)
+       ;; Next, try to find a matching initialization function, and call it.
+       (tty-find-type #'(lambda (type)
+                          (fboundp (setq term-init-func
+                                         (intern (concat "terminal-init-" type)))))
+                      type)
+       (when (fboundp term-init-func)
+         (funcall term-init-func))
+       (set-terminal-parameter frame 'terminal-initted term-init-func)))))
 
 ;; Called from C function init_display to initialize faces of the
 ;; dumped terminal frame on startup.
index 396e4c2..75aa460 100644 (file)
@@ -2362,6 +2362,7 @@ asking you for confirmation."
        minor-mode-overriding-map-alist
        mode-line-buffer-identification
        mode-line-format
+       mode-line-client
        mode-line-modes
        mode-line-modified
        mode-line-mule-info
@@ -5122,6 +5123,22 @@ With prefix arg, silently save all file-visiting buffers, then kill."
        (or (null confirm-kill-emacs)
           (funcall confirm-kill-emacs "Really exit Emacs? "))
        (kill-emacs)))
+
+(defun save-buffers-kill-terminal (&optional arg)
+  "Offer to save each buffer, then kill the current connection.
+If the current frame has no client, kill Emacs itself.
+
+With prefix arg, silently save all file-visiting buffers, then kill.
+
+If emacsclient was started with a list of filenames to edit, then
+only these files will be asked to be saved."
+  (interactive "P")
+  (let ((proc (frame-parameter (selected-frame) 'client))
+       (frame (selected-frame)))
+    (if (null proc)
+       (save-buffers-kill-emacs)
+      (server-save-buffers-kill-terminal proc arg))))
+
 \f
 ;; We use /: as a prefix to "quote" a file name
 ;; so that magic file name handlers will not apply to it.
@@ -5219,7 +5236,7 @@ With prefix arg, silently save all file-visiting buffers, then kill."
 (define-key ctl-x-map "i" 'insert-file)
 (define-key esc-map "~" 'not-modified)
 (define-key ctl-x-map "\C-d" 'list-directory)
-(define-key ctl-x-map "\C-c" 'save-buffers-kill-emacs)
+(define-key ctl-x-map "\C-c" 'save-buffers-kill-terminal)
 (define-key ctl-x-map "\C-q" 'toggle-read-only)
 
 (define-key ctl-x-4-map "f" 'find-file-other-window)
index a6f079e..dfd3ec3 100644 (file)
@@ -2215,7 +2215,7 @@ other modes in which C preprocessor directives are used. e.g. `asm-mode' and
      `(;; Control structures.  Emacs Lisp forms.
        (,(concat
          "(" (regexp-opt
-              '("cond" "if" "while" "while-no-input" "let" "let*"
+              '("cond" "if" "while" "while-no-input" "let" "let*" "let-environment"
                 "prog" "progn" "progv" "prog1" "prog2" "prog*"
                 "inline" "lambda" "save-restriction" "save-excursion"
                 "save-window-excursion" "save-selected-window"
@@ -2227,7 +2227,7 @@ other modes in which C preprocessor directives are used. e.g. `asm-mode' and
                 "with-current-buffer" "with-electric-help"
                 "with-local-quit" "with-no-warnings"
                 "with-output-to-string" "with-output-to-temp-buffer"
-                "with-selected-window" "with-syntax-table"
+                "with-selected-window" "with-selected-frame" "with-syntax-table"
                 "with-temp-buffer" "with-temp-file" "with-temp-message"
                 "with-timeout" "with-timeout-handler") t)
          "\\>")
index 9aba8c5..c9b9b1e 100644 (file)
 
 ;;; Code:
 
-(defvar frame-creation-function nil
-  "Window-system dependent function to call to create a new frame.
-The window system startup file should set this to its frame creation
-function, which should take an alist of parameters as its argument.")
+(defvar frame-creation-function-alist
+  (list (cons nil
+             (if (fboundp 'tty-create-frame-with-faces)
+                 'tty-create-frame-with-faces
+               (function
+                (lambda (parameters)
+                  (error "Can't create multiple frames without a window system"))))))
+  "Alist of window-system dependent functions to call to create a new frame.
+The window system startup file should add its frame creation
+function to this list, which should take an alist of parameters
+as its argument.")
+
+(defvar window-system-default-frame-alist nil
+  "Alist of window-system dependent default frame parameters.
+You can set this in your `.emacs' file; for example,
+
+    ;; Disable menubar and toolbar on the console, but enable them under X.
+    (setq window-system-default-frame-alist
+          '((x (menu-bar-lines . 1) (tool-bar-lines . 1))
+            (nil (menu-bar-lines . 0) (tool-bar-lines . 0))))
+
+Parameters specified here supersede the values given in `default-frame-alist'.")
 
 ;; The initial value given here used to ask for a minibuffer.
 ;; But that's not necessary, because the default is to have one.
@@ -189,7 +207,9 @@ Pass it BUFFER as first arg, and (cdr ARGS) gives the rest of the args."
 (defun frame-initialize ()
   "Create an initial frame if necessary."
   ;; Are we actually running under a window system at all?
-  (if (and window-system (not noninteractive) (not (eq window-system 'pc)))
+  (if (and initial-window-system
+          (not noninteractive)
+          (not (eq initial-window-system 'pc)))
       (progn
        ;; Turn on special-display processing only if there's a window system.
        (setq special-display-function 'special-display-popup-frame)
@@ -206,6 +226,9 @@ Pass it BUFFER as first arg, and (cdr ARGS) gives the rest of the args."
                  (setq frame-initial-frame-alist
                        (cons '(horizontal-scroll-bars . t)
                              frame-initial-frame-alist)))
+             (setq frame-initial-frame-alist
+                   (cons (cons 'window-system initial-window-system)
+                         frame-initial-frame-alist))
              (setq default-minibuffer-frame
                    (setq frame-initial-frame
                          (make-frame frame-initial-frame-alist)))
@@ -215,21 +238,13 @@ Pass it BUFFER as first arg, and (cdr ARGS) gives the rest of the args."
              ;; because that would override explicit user resizing.
              (setq initial-frame-alist
                    (frame-remove-geometry-params initial-frame-alist))))
+       ;; Copy the environment of the Emacs process into the new frame.
+       (set-frame-parameter frame-initial-frame 'environment
+                            (frame-parameter terminal-frame 'environment))
        ;; At this point, we know that we have a frame open, so we
        ;; can delete the terminal frame.
        (delete-frame terminal-frame)
-       (setq terminal-frame nil))
-
-    ;; No, we're not running a window system.  Use make-terminal-frame if
-    ;; we support that feature, otherwise arrange to cause errors.
-    (or (eq window-system 'pc)
-       (setq frame-creation-function
-             (if (fboundp 'tty-create-frame-with-faces)
-                 'tty-create-frame-with-faces
-               (function
-                (lambda (parameters)
-                  (error
-                   "Can't create multiple frames without a window system"))))))))
+       (setq terminal-frame nil))))
 
 (defvar frame-notice-user-settings t
   "Non-nil means function `frame-notice-user-settings' wasn't run yet.")
@@ -239,7 +254,9 @@ Pass it BUFFER as first arg, and (cdr ARGS) gives the rest of the args."
 ;; information to which we must react; do what needs to be done.
 (defun frame-notice-user-settings ()
   "Act on user's init file settings of frame parameters.
-React to settings of `default-frame-alist', `initial-frame-alist' there."
+React to settings of `initial-frame-alist',
+`window-system-default-frame-alist' and `default-frame-alist'
+there (in decreasing order of priority)."
   ;; Make menu-bar-mode and default-frame-alist consistent.
   (when (boundp 'menu-bar-mode)
     (let ((default (assq 'menu-bar-lines default-frame-alist)))
@@ -254,20 +271,30 @@ React to settings of `default-frame-alist', `initial-frame-alist' there."
   ;; parameter in default-frame-alist in a dumped Emacs, which is not
   ;; what we want.
   (when (and (boundp 'tool-bar-mode)
-            (not noninteractive))
+            (not noninteractive))
     (let ((default (assq 'tool-bar-lines default-frame-alist)))
       (if default
-         (setq tool-bar-mode (not (eq (cdr default) 0)))
-       (setq default-frame-alist
-             (cons (cons 'tool-bar-lines (if tool-bar-mode 1 0))
-                   default-frame-alist)))))
+         (setq tool-bar-mode (not (eq (cdr default) 0)))
+       ;; If Emacs was started on a tty, changing default-frame-alist
+       ;; would disable the toolbar on X frames created later.  We
+       ;; want to keep the default of showing a toolbar under X even
+       ;; in this case.
+       ;;
+       ;; If the user explicitly called `tool-bar-mode' in .emacs,
+       ;; then default-frame-alist is already changed anyway.
+       (when initial-window-system
+         (setq default-frame-alist
+               (cons (cons 'tool-bar-lines (if tool-bar-mode 1 0))
+                     default-frame-alist))))))
 
   ;; Creating and deleting frames may shift the selected frame around,
   ;; and thus the current buffer.  Protect against that.  We don't
   ;; want to use save-excursion here, because that may also try to set
   ;; the buffer of the selected window, which fails when the selected
   ;; window is the minibuffer.
-  (let ((old-buffer (current-buffer)))
+  (let ((old-buffer (current-buffer))
+       (window-system-frame-alist (cdr (assq initial-window-system
+                                             window-system-default-frame-alist))))
 
     (when (and frame-notice-user-settings
               (null frame-initial-frame))
@@ -279,8 +306,9 @@ React to settings of `default-frame-alist', `initial-frame-alist' there."
        ;; Can't modify the minibuffer parameter, so don't try.
        (setq parms (delq (assq 'minibuffer parms) parms))
        (modify-frame-parameters nil
-                                (if (null window-system)
+                                (if (null initial-window-system)
                                     (append initial-frame-alist
+                                            window-system-frame-alist
                                             default-frame-alist
                                             parms
                                             nil)
@@ -288,7 +316,7 @@ React to settings of `default-frame-alist', `initial-frame-alist' there."
                                   ;; default-frame-alist were already
                                   ;; applied in pc-win.el.
                                   parms))
-       (if (null window-system) ;; MS-DOS does this differently in pc-win.el
+       (if (null initial-window-system) ;; MS-DOS does this differently in pc-win.el
            (let ((newparms (frame-parameters))
                  (frame (selected-frame)))
              (tty-handle-reverse-video frame newparms)
@@ -310,6 +338,7 @@ React to settings of `default-frame-alist', `initial-frame-alist' there."
       ;; switch `tool-bar-mode' off.
       (when (display-graphic-p)
        (let ((tool-bar-lines (or (assq 'tool-bar-lines initial-frame-alist)
+                                 (assq 'tool-bar-lines window-system-frame-alist)
                                  (assq 'tool-bar-lines default-frame-alist))))
          (when (and tool-bar-originally-present
                      (or (null tool-bar-lines)
@@ -370,6 +399,7 @@ React to settings of `default-frame-alist', `initial-frame-alist' there."
       ;; create here, so that its new value, gleaned from the user's
       ;; .emacs file, will be applied to the existing screen.
       (if (not (eq (cdr (or (assq 'minibuffer initial-frame-alist)
+                           (assq 'minibuffer window-system-frame-alist)
                            (assq 'minibuffer default-frame-alist)
                            '(minibuffer . t)))
                   t))
@@ -389,6 +419,7 @@ React to settings of `default-frame-alist', `initial-frame-alist' there."
                (setq parms (delq (assq 'name parms) parms)))
 
            (setq parms (append initial-frame-alist
+                               window-system-frame-alist
                                default-frame-alist
                                parms
                                nil))
@@ -468,6 +499,7 @@ React to settings of `default-frame-alist', `initial-frame-alist' there."
        ;; the new parameters.
        (let (newparms allparms tail)
          (setq allparms (append initial-frame-alist
+                                window-system-frame-alist
                                 default-frame-alist nil))
          (if (assq 'height frame-initial-geometry-arguments)
              (setq allparms (assq-delete-all 'height allparms)))
@@ -524,19 +556,25 @@ React to settings of `default-frame-alist', `initial-frame-alist' there."
 (defun modify-all-frames-parameters (alist)
   "Modify all current and future frames' parameters according to ALIST.
 This changes `default-frame-alist' and possibly `initial-frame-alist'.
+Furthermore, this function removes all parameters in ALIST from
+`window-system-default-frame-alist'.
 See help of `modify-frame-parameters' for more information."
-  (let (element)                       ;; temp
-    (dolist (frame (frame-list))
-      (modify-frame-parameters frame alist))
-
-    (dolist (pair alist)               ;; conses to add/replace
-      ;; initial-frame-alist needs setting only when
-      ;; frame-notice-user-settings is true
-      (and frame-notice-user-settings
-          (setq element (assoc (car pair) initial-frame-alist))
-          (setq initial-frame-alist (delq element initial-frame-alist)))
-      (and (setq element (assoc (car pair) default-frame-alist))
-          (setq default-frame-alist (delq element default-frame-alist)))))
+  (dolist (frame (frame-list))
+    (modify-frame-parameters frame alist))
+
+  (dolist (pair alist) ;; conses to add/replace
+    ;; initial-frame-alist needs setting only when
+    ;; frame-notice-user-settings is true.
+    (and frame-notice-user-settings
+        (setq initial-frame-alist
+              (assq-delete-all (car pair) initial-frame-alist)))
+    (setq default-frame-alist
+         (assq-delete-all (car pair) default-frame-alist))
+    ;; Remove any similar settings from the window-system specific
+    ;; parameters---they would override default-frame-alist.
+    (dolist (w window-system-default-frame-alist)
+      (setcdr w (assq-delete-all (car pair) (cdr w)))))
+
   (and frame-notice-user-settings
        (setq initial-frame-alist (append initial-frame-alist alist)))
   (setq default-frame-alist (append default-frame-alist alist)))
@@ -567,12 +605,28 @@ is not considered (see `next-frame')."
   (select-frame-set-input-focus (selected-frame)))
 
 (defun make-frame-on-display (display &optional parameters)
-  "Make a frame on display DISPLAY.
+  "Make a frame on display DISPLAY.
 The optional second argument PARAMETERS specifies additional frame parameters."
   (interactive "sMake frame on display: ")
   (or (string-match "\\`[^:]*:[0-9]+\\(\\.[0-9]+\\)?\\'" display)
       (error "Invalid display, not HOST:SERVER or HOST:SERVER.SCREEN"))
-  (make-frame (cons (cons 'display display) parameters)))
+  (when (and (boundp 'x-initialized) (not x-initialized))
+    (setq x-display-name display)
+    (x-initialize-window-system))
+  (make-frame `((window-system . x) (display . ,display) . ,parameters)))
+
+(defun make-frame-on-tty (tty type &optional parameters)
+  "Make a frame on terminal device TTY.
+TTY should be the file name of the tty device to use.  TYPE
+should be the terminal type string of TTY, for example \"xterm\"
+or \"vt100\".  The optional third argument PARAMETERS specifies
+additional frame parameters."
+  (interactive "fOpen frame on tty device: \nsTerminal type of %s: ")
+  (unless tty
+    (error "Invalid terminal device"))
+  (unless type
+    (error "Invalid terminal type"))
+  (make-frame `((window-system . nil) (tty . ,tty) (tty-type . ,type) . ,parameters)))
 
 (defun make-frame-command ()
   "Make a new frame, and select it if the terminal displays only one frame."
@@ -611,7 +665,12 @@ You cannot specify either `width' or `height', you must use neither or both.
  (minibuffer . only)   The frame should contain only a minibuffer.
  (minibuffer . WINDOW) The frame should use WINDOW as its minibuffer window.
 
-Before the frame is created (via `frame-creation-function'), functions on the
+ (window-system . nil) The frame should be displayed on a terminal device.
+ (window-system . x)   The frame should be displayed in an X window.
+
+ (terminal . ID)          The frame should use the terminal identified by ID.
+
+Before the frame is created (via `frame-creation-function-alist'), functions on the
 hook `before-make-frame-hook' are run.  After the frame is created, functions
 on `after-make-frame-functions' are run with one arg, the newly created frame.
 
@@ -621,8 +680,33 @@ window system may select the new frame for its own reasons, for
 instance if the frame appears under the mouse pointer and your
 setup is for focus to follow the pointer."
   (interactive)
-  (run-hooks 'before-make-frame-hook)
-  (let ((frame (funcall frame-creation-function parameters)))
+  (let* ((w (cond
+            ((assq 'terminal parameters)
+             (let ((type (terminal-live-p (cdr (assq 'terminal parameters)))))
+               (cond
+                ((eq type t) nil)
+                ((eq type nil) (error "Terminal %s does not exist" (cdr (assq 'terminal parameters))))
+                (t type))))
+            ((assq 'window-system parameters)
+             (cdr (assq 'window-system parameters)))
+            (t window-system)))
+        (frame-creation-function (cdr (assq w frame-creation-function-alist)))
+        (oldframe (selected-frame))
+        frame)
+    (unless frame-creation-function
+      (error "Don't know how to create a frame on window system %s" w))
+    (run-hooks 'before-make-frame-hook)
+    (setq frame (funcall frame-creation-function (append parameters (cdr (assq w window-system-default-frame-alist)))))
+    (normal-erase-is-backspace-setup-frame frame)
+    ;; Inherit the 'environment and 'client parameters.
+    (let ((env (frame-parameter oldframe 'environment))
+         (client (frame-parameter oldframe 'client)))
+      (if (not (framep env))
+         (setq env oldframe))
+      (if (and env (not (assq 'environment parameters)))
+         (set-frame-parameter frame 'environment env))
+      (if (and client (not (assq 'client parameters)))
+         (set-frame-parameter frame 'client client)))
     (run-hook-with-args 'after-make-frame-functions frame)
     frame))
 
@@ -642,23 +726,29 @@ setup is for focus to follow the pointer."
    (function (lambda (frame)
               (eq frame (window-frame (minibuffer-window frame)))))))
 
-(defun frames-on-display-list (&optional display)
-  "Return a list of all frames on DISPLAY.
-DISPLAY is a name of a display, a string of the form HOST:SERVER.SCREEN.
-If DISPLAY is omitted or nil, it defaults to the selected frame's display."
-  (let* ((display (or display (frame-parameter nil 'display)))
+(defun frames-on-display-list (&optional terminal)
+  "Return a list of all frames on TERMINAL.
+
+TERMINAL should be a terminal identifier (an integer), a frame,
+or a name of an X display (a string of the form
+HOST:SERVER.SCREEN).
+
+If TERMINAL is omitted or nil, it defaults to the selected
+frame's terminal device."
+  (let* ((terminal (terminal-id terminal))
         (func #'(lambda (frame)
-                  (equal (frame-parameter frame 'display) display))))
+                  (eq (frame-terminal frame) terminal))))
     (filtered-frame-list func)))
 
-(defun framep-on-display (&optional display)
-  "Return the type of frames on DISPLAY.
-DISPLAY may be a display name or a frame.  If it is a frame, its type is
-returned.
-If DISPLAY is omitted or nil, it defaults to the selected frame's display.
-All frames on a given display are of the same type."
-  (or (framep display)
-      (framep (car (frames-on-display-list display)))))
+(defun framep-on-display (&optional terminal)
+  "Return the type of frames on TERMINAL.
+TERMINAL may be a terminal id, a display name or a frame.  If it
+is a frame, its type is returned.  If TERMINAL is omitted or nil,
+it defaults to the selected frame's terminal device.  All frames
+on a given display are of the same type."
+  (or (terminal-live-p terminal)
+      (framep terminal)
+      (framep (car (frames-on-display-list terminal)))))
 
 (defun frame-remove-geometry-params (param-list)
   "Return the parameter list PARAM-LIST, but with geometry specs removed.
@@ -697,9 +787,9 @@ This variable does not have any effect on MS-Windows."
     (select-frame frame)
     (raise-frame frame)
     ;; Ensure, if possible, that frame gets input focus.
-    (cond ((memq window-system '(x mac))
+    (cond ((memq (window-system frame) '(x max))
           (x-focus-frame frame))
-         ((eq window-system 'w32)
+         ((eq (window-system frame) 'w32)
           (w32-focus-frame frame)))
     (cond (focus-follows-mouse
           (set-mouse-position (selected-frame) (1- (frame-width)) 0))))
@@ -736,6 +826,21 @@ Otherwise, that variable should be nil."
       (iconify-frame)
     (make-frame-visible)))
 
+(defun suspend-frame ()
+  "Do whatever is right to suspend the current frame.
+Calls `suspend-emacs' if invoked from the controlling tty device,
+`suspend-tty' from a secondary tty device, and
+`iconify-or-deiconify-frame' from an X frame."
+  (interactive)
+  (let ((type (framep (selected-frame))))
+    (cond
+     ((eq type 'x) (iconify-or-deiconify-frame))
+     ((eq type t)
+      (if (controlling-tty-p)
+         (suspend-emacs)
+       (suspend-tty)))
+     (t (suspend-emacs)))))
+
 (defun make-frame-names-alist ()
   (let* ((current-frame (selected-frame))
         (falist
@@ -769,9 +874,9 @@ If there is no frame by that name, signal an error."
     (raise-frame frame)
     (select-frame frame)
     ;; Ensure, if possible, that frame gets input focus.
-    (cond ((memq window-system '(x mac))
+    (cond ((eq (window-system frame) 'x)
           (x-focus-frame frame))
-         ((eq window-system 'w32)
+         ((eq (window-system frame) 'w32)
           (w32-focus-frame frame)))
     (when focus-follows-mouse
       (set-mouse-position frame (1- (frame-width frame)) 0))))
@@ -984,6 +1089,10 @@ bars (top, bottom, or nil)."
     (cons vert hor)))
 \f
 ;;;; Frame/display capabilities.
+(defun selected-terminal ()
+  "Return the terminal that is now selected."
+  (frame-terminal (selected-frame)))
+
 (defun display-mouse-p (&optional display)
   "Return non-nil if DISPLAY has a mouse available.
 DISPLAY can be a display name, a frame, or nil (meaning the selected
@@ -1161,7 +1270,7 @@ the question is inapplicable to a certain kind of display."
      ((eq frame-type 'pc)
       16)
      (t
-      (tty-display-color-cells)))))
+      (tty-display-color-cells display)))))
 
 (defun display-visual-class (&optional display)
   "Returns the visual class of DISPLAY.
index 317fff0..7a04d87 100644 (file)
@@ -104,40 +104,13 @@ This is usually invoked when setting `fringe-mode' via customize."
 See `fringe-mode' for possible values and their effect."
   (setq fringe-mode value)
 
-  ;; Apply it to default-frame-alist.
-  (let ((parameter (assq 'left-fringe default-frame-alist)))
-    (if (consp parameter)
-       (setcdr parameter (if (consp fringe-mode)
-                             (car fringe-mode)
-                           fringe-mode))
-      (setq default-frame-alist
-           (cons (cons 'left-fringe (if (consp fringe-mode)
-                                        (car fringe-mode)
-                                      fringe-mode))
-                 default-frame-alist))))
-  (let ((parameter (assq 'right-fringe default-frame-alist)))
-    (if (consp parameter)
-       (setcdr parameter (if (consp fringe-mode)
-                             (cdr fringe-mode)
-                           fringe-mode))
-      (setq default-frame-alist
-           (cons (cons 'right-fringe (if (consp fringe-mode)
-                                         (cdr fringe-mode)
-                                       fringe-mode))
-                 default-frame-alist))))
-
-  ;; Apply it to existing frames.
-  (let ((frames (frame-list)))
-    (while frames
-      (modify-frame-parameters
-       (car frames)
-       (list (cons 'left-fringe (if (consp fringe-mode)
-                                   (car fringe-mode)
-                                 fringe-mode))
-            (cons 'right-fringe (if (consp fringe-mode)
-                                    (cdr fringe-mode)
-                                  fringe-mode))))
-      (setq frames (cdr frames)))))
+  (modify-all-frames-parameters
+   (list (cons 'left-fringe (if (consp fringe-mode)
+                               (car fringe-mode)
+                             fringe-mode))
+        (cons 'right-fringe (if (consp fringe-mode)
+                                (cdr fringe-mode)
+                              fringe-mode)))))
 
 ;; For initialization of fringe-mode, take account of changes
 ;; made explicitly to default-frame-alist.
index 8df0794..a105083 100644 (file)
@@ -425,10 +425,11 @@ If ANY-SYMBOL is non-nil, don't insist the symbol be bound."
       0))
 
 ;;;###autoload
-(defun describe-variable (variable &optional buffer)
+(defun describe-variable (variable &optional buffer frame)
   "Display the full documentation of VARIABLE (a symbol).
 Returns the documentation as a string, also.
-If VARIABLE has a buffer-local value in BUFFER (default to the current buffer),
+If VARIABLE has a buffer-local value in BUFFER or FRAME
+\(default to the current buffer and current frame),
 it is displayed along with the global value."
   (interactive
    (let ((v (variable-at-point))
@@ -447,14 +448,19 @@ it is displayed along with the global value."
      (list (if (equal val "")
               v (intern val)))))
   (unless (buffer-live-p buffer) (setq buffer (current-buffer)))
+  (unless (frame-live-p frame) (setq frame (selected-frame)))
   (if (not (symbolp variable))
       (message "You did not specify a variable")
     (save-excursion
-      (let* ((valvoid (not (with-current-buffer buffer (boundp variable))))
-            ;; Extract the value before setting up the output buffer,
-            ;; in case `buffer' *is* the output buffer.
-            (val (unless valvoid (buffer-local-value variable buffer)))
-            val-start-pos)
+      (let ((valvoid (not (with-current-buffer buffer (boundp variable))))
+           val val-start-pos locus)
+       ;; Extract the value before setting up the output buffer,
+       ;; in case `buffer' *is* the output buffer.
+       (unless valvoid
+         (with-selected-frame frame
+           (with-current-buffer buffer
+             (setq val (symbol-value variable)
+                   locus (variable-binding-locus variable)))))
        (help-setup-xref (list #'describe-variable variable buffer)
                         (interactive-p))
        (with-output-to-temp-buffer (help-buffer)
@@ -516,11 +522,13 @@ it is displayed along with the global value."
                      (delete-region (1- from) from)))))
            (terpri)
 
-           (when (local-variable-p variable)
-             (princ (format "%socal in buffer %s; "
-                            (if (get variable 'permanent-local)
-                                "Permanently l" "L")
-                            (buffer-name)))
+           (when locus
+             (if (bufferp locus)
+                 (princ (format "%socal in buffer %s; "
+                                (if (get variable 'permanent-local)
+                                    "Permanently l" "L")
+                                (buffer-name)))
+               (princ (format "It is a frame-local variable; ")))
              (if (not (default-boundp variable))
                  (princ "globally void")
                (let ((val (default-value variable)))
index 3acb1cf..160dd8a 100644 (file)
@@ -173,7 +173,7 @@ The following key sequence may cause multilingual text insertion."
       (setq str (format "%s%c" str (read-char-exclusive))))
     (vector (aref result 0))))
 
-(defun encoded-kbd-setup-keymap (coding)
+(defun encoded-kbd-setup-keymap (keymap coding)
   ;; At first, reset the keymap.
   (define-key encoded-kbd-mode-map "\e" nil)
   ;; Then setup the keymap according to the keyboard coding system.
@@ -181,7 +181,7 @@ The following key sequence may cause multilingual text insertion."
    ((eq (coding-system-type coding) 1) ; SJIS
     (let ((i 128))
       (while (< i 256)
-       (define-key key-translation-map
+       (define-key keymap
          (vector i) 'encoded-kbd-self-insert-sjis)
        (setq i (1+ i))))
     8)
@@ -189,7 +189,7 @@ The following key sequence may cause multilingual text insertion."
    ((eq (coding-system-type coding) 3) ; Big5
     (let ((i 161))
       (while (< i 255)
-       (define-key key-translation-map
+       (define-key keymap
          (vector i) 'encoded-kbd-self-insert-big5)
        (setq i (1+ i))))
     8)
@@ -215,20 +215,20 @@ The following key sequence may cause multilingual text insertion."
            (aset encoded-kbd-iso2022-invocations 1 1))
        (when use-designation
          (define-key encoded-kbd-mode-map "\e" 'encoded-kbd-iso2022-esc-prefix)
-         (define-key key-translation-map "\e" 'encoded-kbd-iso2022-esc-prefix))
+         (define-key keymap "\e" 'encoded-kbd-iso2022-esc-prefix))
        (when (or (aref flags 2) (aref flags 3))
-         (define-key key-translation-map
+         (define-key keymap
            [?\216] 'encoded-kbd-iso2022-single-shift)
-         (define-key key-translation-map
+         (define-key keymap
            [?\217] 'encoded-kbd-iso2022-single-shift))
        (or (eq (aref flags 0) 'ascii)
            (dotimes (i 96)
-             (define-key key-translation-map
+             (define-key keymap
                (vector (+ 32 i)) 'encoded-kbd-self-insert-iso2022-7bit)))
        (if (aref flags 7)
            t
          (dotimes (i 96)
-           (define-key key-translation-map
+           (define-key keymap
              (vector (+ 160 i)) 'encoded-kbd-self-insert-iso2022-8bit))
          8))))
 
@@ -243,7 +243,7 @@ The following key sequence may cause multilingual text insertion."
          (setq from (setq to elt)))
        (while (<= from to)
          (if (>= from 128)
-             (define-key key-translation-map
+             (define-key keymap
                (vector from) 'encoded-kbd-self-insert-ccl))
          (setq from (1+ from))))
       8))
@@ -251,59 +251,47 @@ The following key sequence may cause multilingual text insertion."
    (t
     nil)))
 
-;; key-translation-map at the time Encoded-kbd mode is turned on is
-;; saved here.
-(defvar saved-key-translation-map nil)
-
-;; Input mode at the time Encoded-kbd mode is turned on is saved here.
-(defvar saved-input-mode nil)
-
-(put 'encoded-kbd-mode 'permanent-local t)
 ;;;###autoload
-(define-minor-mode encoded-kbd-mode
-  "Toggle Encoded-kbd minor mode.
-With arg, turn Encoded-kbd mode on if and only if arg is positive.
-
-You should not turn this mode on manually, instead use the command
-\\[set-keyboard-coding-system] which turns on or off this mode
-automatically.
-
-In Encoded-kbd mode, a text sent from keyboard is accepted
-as a multilingual text encoded in a coding system set by
-\\[set-keyboard-coding-system]."
-  :global t :group 'keyboard :group 'mule
-
-  (if encoded-kbd-mode
-      ;; We are turning on Encoded-kbd mode.
-      (let ((coding (keyboard-coding-system))
-           result)
-       (or saved-key-translation-map
-           (if (keymapp key-translation-map)
-               (setq saved-key-translation-map
-                     (copy-keymap key-translation-map))
-             (setq key-translation-map (make-sparse-keymap))))
-       (or saved-input-mode
-           (setq saved-input-mode
-                 (current-input-mode)))
-       (setq result (and coding (encoded-kbd-setup-keymap coding)))
-       (if result
-           (if (eq result 8)
-               (set-input-mode
-                (nth 0 saved-input-mode) 
-                (nth 1 saved-input-mode)
-                'use-8th-bit
-                (nth 3 saved-input-mode)))
-         (setq encoded-kbd-mode nil
-               saved-key-translation-map nil
-               saved-input-mode nil)
-         (error "Unsupported coding system in Encoded-kbd mode: %S"
-                coding)))
-
-    ;; We are turning off Encoded-kbd mode.
-    (setq key-translation-map saved-key-translation-map
-         saved-key-translation-map nil)
-    (apply 'set-input-mode saved-input-mode)
-    (setq saved-input-mode nil)))
+(defun encoded-kbd-setup-display (display)
+  "Set up a `key-translation-map' for `keyboard-coding-system' on DISPLAY.
+
+DISPLAY may be a display id, a frame, or nil for the selected frame's display."
+  (let ((frame (if (framep display) display (car (frames-on-display-list display)))))
+    (when frame
+      (with-selected-frame frame
+       ;; Remove any previous encoded-kb keymap from key-translation-map.
+       (let ((m local-key-translation-map))
+         (if (equal (keymap-prompt m) "encoded-kb")
+             (setq local-key-translation-map (keymap-parent m))
+           (while (keymap-parent m)
+             (if (equal (keymap-prompt (keymap-parent m)) "encoded-kb")
+                 (set-keymap-parent m (keymap-parent (keymap-parent m))))
+             (setq m (keymap-parent m)))))
+
+       (if (keyboard-coding-system)
+           ;; We are turning on Encoded-kbd mode.
+           (let ((coding (keyboard-coding-system))
+                 (keymap (make-sparse-keymap "encoded-kb"))
+                 (cim (current-input-mode))
+                 result)
+             (set-keymap-parent keymap local-key-translation-map)
+             (setq local-key-translation-map keymap)
+             (unless (terminal-parameter nil 'encoded-kbd-saved-input-meta-mode)
+               (set-terminal-parameter nil 'encoded-kbd-saved-input-mode (nth 2 cim)))
+             (setq result (and coding (encoded-kbd-setup-keymap keymap coding)))
+             (if result
+                 (when (and (eq result 8)
+                            (memq (nth 2 cim) '(t nil)))
+                   (set-input-meta-mode 'use-8th-bit))
+               (set-terminal-parameter nil 'encoded-kbd-saved-input-meta-mode nil)
+               (error "Unsupported coding system in Encoded-kbd mode: %S"
+                      coding)))
+         ;; We are turning off Encoded-kbd mode.
+         (when (and (terminal-parameter nil 'encoded-kbd-saved-input-meta-mode)
+                    (not (equal (nth 2 (current-input-mode))
+                                (terminal-parameter nil 'encoded-kbd-saved-input-meta-mode))))
+           (set-input-meta-mode (terminal-parameter nil 'encoded-kbd-saved-input-meta-mode)))
+         (set-terminal-parameter nil 'saved-input-meta-mode nil))))))
 
 (provide 'encoded-kb)
 
index fc461bf..2cec516 100644 (file)
   t)
 (define-key-after set-coding-system-map [set-terminal-coding-system]
   '(menu-item "For Terminal" set-terminal-coding-system
-             :enable (null (memq window-system '(x w32 mac)))
+             :enable (null (memq initial-window-system '(x w32 mac)))
              :help "How to encode terminal output")
   t)
 (define-key-after set-coding-system-map [separator-3]
@@ -1825,7 +1825,7 @@ The default status is as follows:
 
 (reset-language-environment)
 
-(defun set-display-table-and-terminal-coding-system (language-name &optional coding-system)
+(defun set-display-table-and-terminal-coding-system (language-name &optional coding-system display)
   "Set up the display table and terminal coding system for LANGUAGE-NAME."
   (let ((coding (get-language-info language-name 'unibyte-display)))
     (if (and coding
@@ -1841,7 +1841,7 @@ The default status is as follows:
        (dotimes (i 128)
          (aset standard-display-table (+ i 128) nil))))
     (or (eq window-system 'pc)
-       (set-terminal-coding-system (or coding-system coding)))))
+       (set-terminal-coding-system (or coding-system coding) display))))
 
 (defun set-language-environment (language-name)
   "Set up multi-lingual environment for using LANGUAGE-NAME.
@@ -2449,7 +2449,7 @@ is returned.  Thus, for instance, if charset \"ISO8859-2\",
 ;; too, for setting things such as calendar holidays, ps-print paper
 ;; size, spelling dictionary.
 
-(defun set-locale-environment (&optional locale-name)
+(defun set-locale-environment (&optional locale-name display)
   "Set up multi-lingual environment for using LOCALE-NAME.
 This sets the language environment, the coding system priority,
 the default input method and sometimes other things.
@@ -2470,6 +2470,11 @@ directory named `/usr/share/locale' or `/usr/lib/locale'.  LOCALE-NAME
 will be translated according to the table specified by
 `locale-translation-file-name'.
 
+If DISPLAY is non-nil, only set the keyboard coding system and
+the terminal coding system for the given display, and don't touch
+session-global parameters like the language environment.  DISPLAY
+may be a display id or a frame.
+
 See also `locale-charset-language-names', `locale-language-names',
 `locale-preferred-coding-systems' and `locale-coding-system'."
   (interactive "sSet environment for locale: ")
@@ -2499,7 +2504,7 @@ See also `locale-charset-language-names', `locale-language-names',
       (let ((vars '("LC_ALL" "LC_CTYPE" "LANG")))
        (while (and vars
                    (= 0 (length locale))) ; nil or empty string
-         (setq locale (getenv (pop vars))))))
+         (setq locale (getenv (pop vars) display)))))
 
     (unless locale
       ;; The two tests are kept separate so the byte-compiler sees
@@ -2573,28 +2578,34 @@ See also `locale-charset-language-names', `locale-language-names',
 
          ;; Set up for this character set.  This is now the right way
          ;; to do it for both unibyte and multibyte modes.
-         (set-language-environment language-name)
+         (unless display
+           (set-language-environment language-name))
 
          ;; If default-enable-multibyte-characters is nil,
          ;; we are using single-byte characters,
          ;; so the display table and terminal coding system are irrelevant.
          (when default-enable-multibyte-characters
            (set-display-table-and-terminal-coding-system
-            language-name coding-system))
+            language-name coding-system display))
 
          ;; Set the `keyboard-coding-system' if appropriate (tty
          ;; only).  At least X and MS Windows can generate
          ;; multilingual input.
-         (unless window-system
-           (let ((kcs (or coding-system
-                          (car (get-language-info language-name
-                                                  'coding-system)))))
-             (if kcs (set-keyboard-coding-system kcs))))
-
-         (setq locale-coding-system
-               (car (get-language-info language-name 'coding-priority))))
-
-       (when (and coding-system
+         ;; XXX This was disabled unless `window-system', but that
+         ;; leads to buggy behaviour when a tty frame is opened
+         ;; later.  Setting the keyboard coding system has no adverse
+         ;; effect on X, so let's do it anyway. -- Lorentey
+         (let ((kcs (or coding-system
+                        (car (get-language-info language-name
+                                                'coding-system)))))
+           (if kcs (set-keyboard-coding-system kcs display)))
+
+         (unless display
+           (setq locale-coding-system
+                 (car (get-language-info language-name 'coding-priority)))))
+
+       (when (and (not display)
+                  coding-system
                   (not (coding-system-equal coding-system
                                             locale-coding-system)))
          (prefer-coding-system coding-system)
@@ -2606,9 +2617,9 @@ See also `locale-charset-language-names', `locale-language-names',
     (when (boundp 'w32-ansi-code-page)
       (let ((code-page-coding (intern (format "cp%d" w32-ansi-code-page))))
        (when (coding-system-p code-page-coding)
-         (setq locale-coding-system code-page-coding)
-         (set-keyboard-coding-system code-page-coding)
-         (set-terminal-coding-system code-page-coding))))
+         (unless display (setq locale-coding-system code-page-coding))
+         (set-keyboard-coding-system code-page-coding display)
+         (set-terminal-coding-system code-page-coding display))))
 
     (when (eq system-type 'darwin)
       ;; On Darwin, file names are always encoded in utf-8, no matter
@@ -2617,38 +2628,39 @@ See also `locale-charset-language-names', `locale-language-names',
       ;; Mac OS X's Terminal.app by default uses utf-8 regardless of
       ;; the locale.
       (when (and (null window-system)
-                (equal (getenv "TERM_PROGRAM") "Apple_Terminal"))
+                (equal (getenv "TERM_PROGRAM" display) "Apple_Terminal"))
        (set-terminal-coding-system 'utf-8)
        (set-keyboard-coding-system 'utf-8)))
 
     ;; Default to A4 paper if we're not in a C, POSIX or US locale.
     ;; (See comments in Flocale_info.)
-    (let ((locale locale)
-         (paper (locale-info 'paper)))
-      (if paper
-         ;; This will always be null at the time of writing.
-         (cond
-          ((equal paper '(216 279))
-           (setq ps-paper-type 'letter))
-          ((equal paper '(210 297))
-           (setq ps-paper-type 'a4)))
-       (let ((vars '("LC_ALL" "LC_PAPER" "LANG")))
-         (while (and vars (= 0 (length locale)))
-           (setq locale (getenv (pop vars)))))
-       (when locale
-         ;; As of glibc 2.2.5, these are the only US Letter locales,
-         ;; and the rest are A4.
-         (setq ps-paper-type
-               (or (locale-name-match locale '(("c$" . letter)
-                                               ("posix$" . letter)
-                                               (".._us" . letter)
-                                               (".._pr" . letter)
-                                               (".._ca" . letter)
-                                               ("enu$" . letter) ; Windows
-                                               ("esu$" . letter)
-                                               ("enc$" . letter)
-                                               ("frc$" . letter)))
-                   'a4))))))
+    (unless display
+      (let ((locale locale)
+           (paper (locale-info 'paper)))
+       (if paper
+           ;; This will always be null at the time of writing.
+           (cond
+            ((equal paper '(216 279))
+             (setq ps-paper-type 'letter))
+            ((equal paper '(210 297))
+             (setq ps-paper-type 'a4)))
+         (let ((vars '("LC_ALL" "LC_PAPER" "LANG")))
+           (while (and vars (= 0 (length locale)))
+             (setq locale (getenv (pop vars) display))))
+         (when locale
+           ;; As of glibc 2.2.5, these are the only US Letter locales,
+           ;; and the rest are A4.
+           (setq ps-paper-type
+                 (or (locale-name-match locale '(("c$" . letter)
+                                                 ("posix$" . letter)
+                                                 (".._us" . letter)
+                                                 (".._pr" . letter)
+                                                 (".._ca" . letter)
+                                                 ("enu$" . letter) ; Windows
+                                                 ("esu$" . letter)
+                                                 ("enc$" . letter)
+                                                 ("frc$" . letter)))
+                     'a4)))))))
   nil)
 \f
 ;;; Charset property
index 468b867..8b610a0 100644 (file)
@@ -1218,13 +1218,17 @@ see) to CODING-SYSTEM."
 This is normally set according to the selected language environment.
 See also the command `set-terminal-coding-system'.")
 
-(defun set-terminal-coding-system (coding-system)
-  "Set coding system of your terminal to CODING-SYSTEM.
-All text output to the terminal will be encoded
+(defun set-terminal-coding-system (coding-system &optional display)
+  "Set coding system of terminal output to CODING-SYSTEM.
+All text output to DISPLAY will be encoded
 with the specified coding system.
+
 For a list of possible values of CODING-SYSTEM, use \\[list-coding-systems].
 The default is determined by the selected language environment
-or by the previous use of this command."
+or by the previous use of this command.
+
+DISPLAY may be a display id, a frame, or nil for the selected frame's display.
+The setting has no effect on graphical displays."
   (interactive
    (list (let ((default (if (and (not (terminal-coding-system))
                                 default-terminal-coding-system)
@@ -1238,7 +1242,7 @@ or by the previous use of this command."
       (setq coding-system default-terminal-coding-system))
   (if coding-system
       (setq default-terminal-coding-system coding-system))
-  (set-terminal-coding-system-internal coding-system)
+  (set-terminal-coding-system-internal coding-system display)
   (redraw-frame (selected-frame)))
 
 (defvar default-keyboard-coding-system nil
@@ -1246,14 +1250,17 @@ or by the previous use of this command."
 This is normally set according to the selected language environment.
 See also the command `set-keyboard-coding-system'.")
 
-(defun set-keyboard-coding-system (coding-system)
-  "Set coding system for keyboard input to CODING-SYSTEM.
-In addition, this command enables Encoded-kbd minor mode.
-\(If CODING-SYSTEM is nil, Encoded-kbd mode is turned off -- see
-`encoded-kbd-mode'.)
+(defun set-keyboard-coding-system (coding-system &optional display)
+  "Set coding system for keyboard input on DISPLAY to CODING-SYSTEM.
+In addition, this command calls `encoded-kbd-setup-display' to set up the
+translation of keyboard input events to the specified coding system.
+
 For a list of possible values of CODING-SYSTEM, use \\[list-coding-systems].
 The default is determined by the selected language environment
-or by the previous use of this command."
+or by the previous use of this command.
+
+DISPLAY may be a display id, a frame, or nil for the selected frame's display.
+The setting has no effect on graphical displays."
   (interactive
    (list (let ((default (if (and (not (keyboard-coding-system))
                                 default-keyboard-coding-system)
@@ -1270,9 +1277,9 @@ or by the previous use of this command."
   (if (and coding-system
           (coding-system-get coding-system 'ascii-incompatible))
       (error "%s is not ASCII-compatible" coding-system))
-  (set-keyboard-coding-system-internal coding-system)
+  (set-keyboard-coding-system-internal coding-system display)
   (setq keyboard-coding-system coding-system)
-  (encoded-kbd-mode (if coding-system 1 0)))
+  (encoded-kbd-setup-display display))
 
 (defcustom keyboard-coding-system nil
   "Specify coding system for keyboard input.
@@ -1288,8 +1295,8 @@ use either \\[customize] or \\[set-keyboard-coding-system]."
   :link '(info-link "(emacs)Terminal Coding")
   :link '(info-link "(emacs)Unibyte Mode")
   :set (lambda (symbol value)
-        ;; Don't load encoded-kbd-mode unnecessarily.
-        (if (or value (boundp 'encoded-kbd-mode))
+        ;; Don't load encoded-kb unnecessarily.
+        (if (or value (boundp 'encoded-kbd-setup-display))
             (set-keyboard-coding-system value)
           (set-default 'keyboard-coding-system nil))) ; must initialize
   :version "22.1"
index a7d239a..85e0bb6 100644 (file)
@@ -1644,7 +1644,7 @@ Isearch mode."
         (keylist (listify-key-sequence key))
          scroll-command isearch-point)
     (cond ((and (= (length key) 1)
-               (let ((lookup (lookup-key function-key-map key)))
+               (let ((lookup (lookup-key local-function-key-map key)))
                  (not (or (null lookup) (integerp lookup)
                           (keymapp lookup)))))
           ;; Handle a function key that translates into something else.
@@ -1658,7 +1658,7 @@ Isearch mode."
                 (isearch-done)
                 (apply 'isearch-unread keylist))
             (setq keylist
-                  (listify-key-sequence (lookup-key function-key-map key)))
+                  (listify-key-sequence (lookup-key local-function-key-map key)))
             (while keylist
               (setq key (car keylist))
               ;; If KEY is a printing char, we handle it here
index 8407815..f7d8d46 100644 (file)
@@ -4,7 +4,7 @@
 \f
 ;;;### (autoloads (5x5-crack 5x5-crack-xor-mutate 5x5-crack-mutating-best
 ;;;;;;  5x5-crack-mutating-current 5x5-crack-randomly 5x5) "5x5"
-;;;;;;  "play/5x5.el" (17504 41540))
+;;;;;;  "play/5x5.el" (17383 38807))
 ;;; Generated autoloads from play/5x5.el
 
 (autoload (quote 5x5) "5x5" "\
@@ -63,14 +63,14 @@ should return a grid vector array that is the new solution.
 
 ;;;***
 \f
-;;;### (autoloads nil "abbrev" "abbrev.el" (17504 41540))
+;;;### (autoloads nil "abbrev" "abbrev.el" (17496 38721))
 ;;; Generated autoloads from abbrev.el
 (put 'abbrev-mode 'safe-local-variable 'booleanp)
 
 ;;;***
 \f
 ;;;### (autoloads (list-one-abbrev-table) "abbrevlist" "abbrevlist.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17405 10313))
 ;;; Generated autoloads from abbrevlist.el
 
 (autoload (quote list-one-abbrev-table) "abbrevlist" "\
@@ -81,7 +81,7 @@ Display alphabetical listing of ABBREV-TABLE in buffer OUTPUT-BUFFER.
 ;;;***
 \f
 ;;;### (autoloads (ada-mode ada-add-extensions) "ada-mode" "progmodes/ada-mode.el"
-;;;;;;  (17759 28871))
+;;;;;;  (17778 50475))
 ;;; Generated autoloads from progmodes/ada-mode.el
 
 (autoload (quote ada-add-extensions) "ada-mode" "\
@@ -142,7 +142,7 @@ If you use ada-xref.el:
 ;;;***
 \f
 ;;;### (autoloads (ada-header) "ada-stmt" "progmodes/ada-stmt.el"
-;;;;;;  (17759 28871))
+;;;;;;  (17778 50475))
 ;;; Generated autoloads from progmodes/ada-stmt.el
 
 (autoload (quote ada-header) "ada-stmt" "\
@@ -153,7 +153,7 @@ Insert a descriptive header at the top of the file.
 ;;;***
 \f
 ;;;### (autoloads (ada-find-file) "ada-xref" "progmodes/ada-xref.el"
-;;;;;;  (17759 28871))
+;;;;;;  (17778 50475))
 ;;; Generated autoloads from progmodes/ada-xref.el
 
 (autoload (quote ada-find-file) "ada-xref" "\
@@ -168,7 +168,7 @@ Completion is available.
 ;;;;;;  change-log-mode add-change-log-entry-other-window add-change-log-entry
 ;;;;;;  find-change-log prompt-for-change-log-name add-log-mailing-address
 ;;;;;;  add-log-full-name add-log-current-defun-function) "add-log"
-;;;;;;  "add-log.el" (17746 34860))
+;;;;;;  "add-log.el" (17778 50472))
 ;;; Generated autoloads from add-log.el
 
 (defvar add-log-current-defun-function nil "\
@@ -306,7 +306,7 @@ Fix any old-style date entries in the current log file to default format.
 \f
 ;;;### (autoloads (defadvice ad-activate ad-add-advice ad-disable-advice
 ;;;;;;  ad-enable-advice ad-default-compilation-action ad-redefinition-action)
-;;;;;;  "advice" "emacs-lisp/advice.el" (17701 49518))
+;;;;;;  "advice" "emacs-lisp/advice.el" (17713 5989))
 ;;; Generated autoloads from emacs-lisp/advice.el
 
 (defvar ad-redefinition-action (quote warn) "\
@@ -434,7 +434,7 @@ See Info node `(elisp)Advising Functions' for comprehensive documentation.
 \f
 ;;;### (autoloads (align-newline-and-indent align-unhighlight-rule
 ;;;;;;  align-highlight-rule align-current align-entire align-regexp
-;;;;;;  align) "align" "align.el" (17504 41540))
+;;;;;;  align) "align" "align.el" (17390 26934))
 ;;; Generated autoloads from align.el
 
 (autoload (quote align) "align" "\
@@ -524,7 +524,7 @@ A replacement function for `newline-and-indent', aligning as it goes.
 ;;;***
 \f
 ;;;### (autoloads (outlineify-sticky allout-mode) "allout" "allout.el"
-;;;;;;  (17759 28868))
+;;;;;;  (17778 50472))
 ;;; Generated autoloads from allout.el
 
 (put (quote allout-show-bodies) (quote safe-local-variable) (if (fboundp (quote booleanp)) (quote booleanp) (quote (lambda (x) (member x (quote (t nil)))))))
@@ -780,7 +780,7 @@ setup for auto-startup.
 ;;;***
 \f
 ;;;### (autoloads (ange-ftp-hook-function ange-ftp-reread-dir) "ange-ftp"
-;;;;;;  "net/ange-ftp.el" (17504 41540))
+;;;;;;  "net/ange-ftp.el" (17390 26944))
 ;;; Generated autoloads from net/ange-ftp.el
 
 (defalias (quote ange-ftp-re-read-dir) (quote ange-ftp-reread-dir))
@@ -802,7 +802,7 @@ Not documented
 ;;;***
 \f
 ;;;### (autoloads (animate-birthday-present animate-sequence animate-string)
-;;;;;;  "animate" "play/animate.el" (17504 41540))
+;;;;;;  "animate" "play/animate.el" (17383 38807))
 ;;; Generated autoloads from play/animate.el
 
 (autoload (quote animate-string) "animate" "\
@@ -830,7 +830,7 @@ You can specify the one's name by NAME; the default value is \"Sarah\".
 ;;;***
 \f
 ;;;### (autoloads (ansi-color-process-output ansi-color-for-comint-mode-on)
-;;;;;;  "ansi-color" "ansi-color.el" (17504 41540))
+;;;;;;  "ansi-color" "ansi-color.el" (17390 26934))
 ;;; Generated autoloads from ansi-color.el
 
 (autoload (quote ansi-color-for-comint-mode-on) "ansi-color" "\
@@ -856,7 +856,7 @@ This is a good function to put in `comint-output-filter-functions'.
 ;;;***
 \f
 ;;;### (autoloads (antlr-set-tabs antlr-mode antlr-show-makefile-rules)
-;;;;;;  "antlr-mode" "progmodes/antlr-mode.el" (17504 41540))
+;;;;;;  "antlr-mode" "progmodes/antlr-mode.el" (17490 7905))
 ;;; Generated autoloads from progmodes/antlr-mode.el
 
 (autoload (quote antlr-show-makefile-rules) "antlr-mode" "\
@@ -895,7 +895,7 @@ Used in `antlr-mode'.  Also a useful function in `java-mode-hook'.
 ;;;### (autoloads (appt-activate appt-make-list appt-delete appt-add
 ;;;;;;  appt-display-diary appt-display-duration appt-display-mode-line
 ;;;;;;  appt-msg-window appt-visible appt-audible appt-message-warning-time
-;;;;;;  appt-issue-message) "appt" "calendar/appt.el" (17686 53337))
+;;;;;;  appt-issue-message) "appt" "calendar/appt.el" (17713 5989))
 ;;; Generated autoloads from calendar/appt.el
 
 (defvar appt-issue-message t "\
@@ -983,7 +983,7 @@ ARG is positive, otherwise off.
 \f
 ;;;### (autoloads (apropos-documentation apropos-value apropos apropos-documentation-property
 ;;;;;;  apropos-command apropos-variable apropos-read-pattern) "apropos"
-;;;;;;  "apropos.el" (17746 34860))
+;;;;;;  "apropos.el" (17778 50472))
 ;;; Generated autoloads from apropos.el
 
 (autoload (quote apropos-read-pattern) "apropos" "\
@@ -1079,8 +1079,8 @@ Returns list of symbols and documentation found.
 
 ;;;***
 \f
-;;;### (autoloads (archive-mode) "arc-mode" "arc-mode.el" (17604
-;;;;;;  18983))
+;;;### (autoloads (archive-mode) "arc-mode" "arc-mode.el" (17611
+;;;;;;  9183))
 ;;; Generated autoloads from arc-mode.el
 
 (autoload (quote archive-mode) "arc-mode" "\
@@ -1100,7 +1100,7 @@ archive.
 
 ;;;***
 \f
-;;;### (autoloads (array-mode) "array" "array.el" (17504 41540))
+;;;### (autoloads (array-mode) "array" "array.el" (17374 21266))
 ;;; Generated autoloads from array.el
 
 (autoload (quote array-mode) "array" "\
@@ -1171,8 +1171,8 @@ Entering array mode calls the function `array-mode-hook'.
 
 ;;;***
 \f
-;;;### (autoloads (artist-mode) "artist" "textmodes/artist.el" (17522
-;;;;;;  22309))
+;;;### (autoloads (artist-mode) "artist" "textmodes/artist.el" (17524
+;;;;;;  8598))
 ;;; Generated autoloads from textmodes/artist.el
 
 (autoload (quote artist-mode) "artist" "\
@@ -1377,8 +1377,8 @@ Keymap summary
 
 ;;;***
 \f
-;;;### (autoloads (asm-mode) "asm-mode" "progmodes/asm-mode.el" (17504
-;;;;;;  41540))
+;;;### (autoloads (asm-mode) "asm-mode" "progmodes/asm-mode.el" (17490
+;;;;;;  7930))
 ;;; Generated autoloads from progmodes/asm-mode.el
 
 (autoload (quote asm-mode) "asm-mode" "\
@@ -1405,8 +1405,24 @@ Special commands:
 
 ;;;***
 \f
+;;;### (autoloads (auto-show-mode auto-show-mode) "auto-show" "obsolete/auto-show.el"
+;;;;;;  (17279 27080))
+;;; Generated autoloads from obsolete/auto-show.el
+
+(defvar auto-show-mode nil "\
+Obsolete.")
+
+(custom-autoload (quote auto-show-mode) "auto-show")
+
+(autoload (quote auto-show-mode) "auto-show" "\
+This command is obsolete.
+
+\(fn ARG)" t nil)
+
+;;;***
+\f
 ;;;### (autoloads (autoarg-kp-mode autoarg-mode) "autoarg" "autoarg.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17778 50472))
 ;;; Generated autoloads from autoarg.el
 
 (defvar autoarg-mode nil "\
@@ -1451,7 +1467,7 @@ Toggle Autoarg-KP minor mode globally.
 With ARG, turn Autoarg mode on if ARG is positive, off otherwise.
 \\<autoarg-kp-mode-map>
 This is similar to \\[autoarg-mode] but rebinds the keypad keys `kp-1'
-&c to supply digit arguments.
+etc. to supply digit arguments.
 
 \\{autoarg-kp-mode-map}
 
@@ -1460,7 +1476,7 @@ This is similar to \\[autoarg-mode] but rebinds the keypad keys `kp-1'
 ;;;***
 \f
 ;;;### (autoloads (autoconf-mode) "autoconf" "progmodes/autoconf.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 27404))
 ;;; Generated autoloads from progmodes/autoconf.el
 
 (autoload (quote autoconf-mode) "autoconf" "\
@@ -1471,7 +1487,7 @@ Major mode for editing Autoconf configure.in files.
 ;;;***
 \f
 ;;;### (autoloads (auto-insert-mode define-auto-insert auto-insert)
-;;;;;;  "autoinsert" "autoinsert.el" (17704 3960))
+;;;;;;  "autoinsert" "autoinsert.el" (17713 5989))
 ;;; Generated autoloads from autoinsert.el
 
 (autoload (quote auto-insert) "autoinsert" "\
@@ -1510,7 +1526,7 @@ insert a template for the file depending on the mode of the buffer.
 \f
 ;;;### (autoloads (batch-update-autoloads update-directory-autoloads
 ;;;;;;  update-file-autoloads) "autoload" "emacs-lisp/autoload.el"
-;;;;;;  (17596 14703))
+;;;;;;  (17611 8435))
 ;;; Generated autoloads from emacs-lisp/autoload.el
 
 (autoload (quote update-file-autoloads) "autoload" "\
@@ -1545,7 +1561,7 @@ Calls `update-directory-autoloads' on the command line arguments.
 \f
 ;;;### (autoloads (global-auto-revert-mode turn-on-auto-revert-tail-mode
 ;;;;;;  auto-revert-tail-mode turn-on-auto-revert-mode auto-revert-mode)
-;;;;;;  "autorevert" "autorevert.el" (17504 41540))
+;;;;;;  "autorevert" "autorevert.el" (17505 62410))
 ;;; Generated autoloads from autorevert.el
 
 (autoload (quote auto-revert-mode) "autorevert" "\
@@ -1597,10 +1613,9 @@ This function is designed to be added to hooks, for example:
 Non-nil if Global-Auto-Revert mode is enabled.
 See the command `global-auto-revert-mode' for a description of this minor-mode.
 Setting this variable directly does not take effect;
-either customize it (see the info node `Easy Customization')
-or call the function `global-auto-revert-mode'.")
+use either \\[customize] or the function `global-auto-revert-mode'.")
 
-(custom-autoload (quote global-auto-revert-mode) "autorevert" nil)
+(custom-autoload (quote global-auto-revert-mode) "autorevert")
 
 (autoload (quote global-auto-revert-mode) "autorevert" "\
 Revert any buffer when file on disk changes.
@@ -1614,7 +1629,7 @@ Use `auto-revert-mode' to revert a particular buffer.
 ;;;***
 \f
 ;;;### (autoloads (mouse-avoidance-mode mouse-avoidance-mode) "avoid"
-;;;;;;  "avoid.el" (17628 62475))
+;;;;;;  "avoid.el" (17713 5162))
 ;;; Generated autoloads from avoid.el
 
 (defvar mouse-avoidance-mode nil "\
@@ -1655,7 +1670,7 @@ definition of \"random distance\".)
 ;;;***
 \f
 ;;;### (autoloads (backquote) "backquote" "emacs-lisp/backquote.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 26937))
 ;;; Generated autoloads from emacs-lisp/backquote.el
 
 (autoload (quote backquote) "backquote" "\
@@ -1680,7 +1695,7 @@ Vectors work just like lists.  Nested backquotes are permitted.
 ;;;***
 \f
 ;;;### (autoloads (display-battery-mode battery) "battery" "battery.el"
-;;;;;;  (17746 34860))
+;;;;;;  (17778 50472))
 ;;; Generated autoloads from battery.el
  (put 'battery-mode-line-string 'risky-local-variable t)
 
@@ -1712,7 +1727,7 @@ seconds.
 ;;;***
 \f
 ;;;### (autoloads (benchmark benchmark-run-compiled benchmark-run)
-;;;;;;  "benchmark" "emacs-lisp/benchmark.el" (17504 41540))
+;;;;;;  "benchmark" "emacs-lisp/benchmark.el" (17390 26937))
 ;;; Generated autoloads from emacs-lisp/benchmark.el
 
 (autoload (quote benchmark-run) "benchmark" "\
@@ -1744,8 +1759,8 @@ non-interactive use see also `benchmark-run' and
 
 ;;;***
 \f
-;;;### (autoloads (bibtex-mode) "bibtex" "textmodes/bibtex.el" (17746
-;;;;;;  34862))
+;;;### (autoloads (bibtex-mode) "bibtex" "textmodes/bibtex.el" (17778
+;;;;;;  50479))
 ;;; Generated autoloads from textmodes/bibtex.el
 
 (autoload (quote bibtex-mode) "bibtex" "\
@@ -1807,7 +1822,7 @@ if that value is non-nil.
 \f
 ;;;### (autoloads (binhex-decode-region binhex-decode-region-external
 ;;;;;;  binhex-decode-region-internal) "binhex" "gnus/binhex.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17383 38804))
 ;;; Generated autoloads from gnus/binhex.el
 
 (defconst binhex-begin-line "^:...............................................................$")
@@ -1830,8 +1845,8 @@ Binhex decode region between START and END.
 
 ;;;***
 \f
-;;;### (autoloads (blackbox) "blackbox" "play/blackbox.el" (17504
-;;;;;;  41540))
+;;;### (autoloads (blackbox) "blackbox" "play/blackbox.el" (17383
+;;;;;;  38807))
 ;;; Generated autoloads from play/blackbox.el
 
 (autoload (quote blackbox) "blackbox" "\
@@ -1953,7 +1968,7 @@ a reflection.
 ;;;### (autoloads (bookmark-bmenu-list bookmark-load bookmark-save
 ;;;;;;  bookmark-write bookmark-delete bookmark-insert bookmark-rename
 ;;;;;;  bookmark-insert-location bookmark-relocate bookmark-jump
-;;;;;;  bookmark-set) "bookmark" "bookmark.el" (17504 41540))
+;;;;;;  bookmark-set) "bookmark" "bookmark.el" (17390 26935))
 ;;; Generated autoloads from bookmark.el
  (define-key ctl-x-map "rb" 'bookmark-jump)
  (define-key ctl-x-map "rm" 'bookmark-set)
@@ -2143,7 +2158,7 @@ deletion, or > if it is flagged for displaying.
 ;;;;;;  browse-url browse-url-of-region browse-url-of-dired-file
 ;;;;;;  browse-url-of-buffer browse-url-of-file browse-url-url-at-point
 ;;;;;;  browse-url-galeon-program browse-url-firefox-program browse-url-browser-function)
-;;;;;;  "browse-url" "net/browse-url.el" (17522 22309))
+;;;;;;  "browse-url" "net/browse-url.el" (17524 8597))
 ;;; Generated autoloads from net/browse-url.el
 
 (defvar browse-url-browser-function (cond ((memq system-type (quote (windows-nt ms-dos cygwin))) (quote browse-url-default-windows-browser)) ((memq system-type (quote (darwin))) (quote browse-url-default-macosx-browser)) (t (quote browse-url-default-browser))) "\
@@ -2157,17 +2172,17 @@ associated with the first REGEXP which matches the current URL.  The
 function is passed the URL and any other args of `browse-url'.  The last
 regexp should probably be \".\" to specify a default browser.")
 
-(custom-autoload (quote browse-url-browser-function) "browse-url" t)
+(custom-autoload (quote browse-url-browser-function) "browse-url")
 
 (defvar browse-url-firefox-program "firefox" "\
 *The name by which to invoke Firefox.")
 
-(custom-autoload (quote browse-url-firefox-program) "browse-url" t)
+(custom-autoload (quote browse-url-firefox-program) "browse-url")
 
 (defvar browse-url-galeon-program "galeon" "\
 *The name by which to invoke Galeon.")
 
-(custom-autoload (quote browse-url-galeon-program) "browse-url" t)
+(custom-autoload (quote browse-url-galeon-program) "browse-url")
 
 (autoload (quote browse-url-url-at-point) "browse-url" "\
 Not documented
@@ -2474,8 +2489,8 @@ Default to the URL around or before point.
 
 ;;;***
 \f
-;;;### (autoloads (snarf-bruces bruce) "bruce" "play/bruce.el" (17504
-;;;;;;  41540))
+;;;### (autoloads (snarf-bruces bruce) "bruce" "play/bruce.el" (17383
+;;;;;;  38807))
 ;;; Generated autoloads from play/bruce.el
 
 (autoload (quote bruce) "bruce" "\
@@ -2491,7 +2506,7 @@ Return a vector containing the lines from `bruce-phrases-file'.
 ;;;***
 \f
 ;;;### (autoloads (bs-show bs-customize bs-cycle-previous bs-cycle-next)
-;;;;;;  "bs" "bs.el" (17759 28868))
+;;;;;;  "bs" "bs.el" (17778 50472))
 ;;; Generated autoloads from bs.el
 
 (autoload (quote bs-cycle-next) "bs" "\
@@ -2532,8 +2547,8 @@ name of buffer configuration.
 ;;;***
 \f
 ;;;### (autoloads (insert-text-button make-text-button insert-button
-;;;;;;  make-button define-button-type) "button" "button.el" (17504
-;;;;;;  41540))
+;;;;;;  make-button define-button-type) "button" "button.el" (17390
+;;;;;;  26935))
 ;;; Generated autoloads from button.el
 
 (defvar button-map (let ((map (make-sparse-keymap))) (define-key map "\r" (quote push-button)) (define-key map [mouse-2] (quote push-button)) map) "\
@@ -2621,7 +2636,7 @@ Also see `make-text-button'.
 ;;;;;;  batch-byte-compile-if-not-done display-call-tree byte-compile
 ;;;;;;  compile-defun byte-compile-file byte-recompile-directory
 ;;;;;;  byte-force-recompile byte-compile-warnings-safe-p) "bytecomp"
-;;;;;;  "emacs-lisp/bytecomp.el" (17759 30016))
+;;;;;;  "emacs-lisp/bytecomp.el" (17778 50473))
 ;;; Generated autoloads from emacs-lisp/bytecomp.el
 (put 'byte-compile-dynamic 'safe-local-variable 'booleanp)
 (put 'byte-compile-dynamic-docstrings 'safe-local-variable 'booleanp)
@@ -2725,7 +2740,7 @@ and corresponding effects.
 
 ;;;***
 \f
-;;;### (autoloads nil "cal-dst" "calendar/cal-dst.el" (17759 28868))
+;;;### (autoloads nil "cal-dst" "calendar/cal-dst.el" (17778 50472))
 ;;; Generated autoloads from calendar/cal-dst.el
 
 (put (quote calendar-daylight-savings-starts) (quote risky-local-variable) t)
@@ -2735,7 +2750,7 @@ and corresponding effects.
 ;;;***
 \f
 ;;;### (autoloads (list-yahrzeit-dates) "cal-hebrew" "calendar/cal-hebrew.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 27324))
 ;;; Generated autoloads from calendar/cal-hebrew.el
 
 (autoload (quote list-yahrzeit-dates) "cal-hebrew" "\
@@ -2750,7 +2765,7 @@ from the cursor position.
 ;;;### (autoloads (defmath calc-embedded-activate calc-embedded calc-grab-rectangle
 ;;;;;;  calc-grab-region full-calc-keypad calc-keypad calc-eval quick-calc
 ;;;;;;  full-calc calc calc-dispatch calc-settings-file) "calc" "calc/calc.el"
-;;;;;;  (17672 28071))
+;;;;;;  (17713 5989))
 ;;; Generated autoloads from calc/calc.el
 
 (defvar calc-settings-file (convert-standard-filename "~/.calc.el") "\
@@ -2828,8 +2843,8 @@ Not documented
 
 ;;;***
 \f
-;;;### (autoloads (calculator) "calculator" "calculator.el" (17504
-;;;;;;  41540))
+;;;### (autoloads (calculator) "calculator" "calculator.el" (17390
+;;;;;;  26935))
 ;;; Generated autoloads from calculator.el
 
 (autoload (quote calculator) "calculator" "\
@@ -2857,7 +2872,7 @@ See the documentation for `calculator-mode' for more information.
 ;;;;;;  mark-holidays-in-calendar view-calendar-holidays-initially
 ;;;;;;  calendar-remove-frame-by-deleting mark-diary-entries-in-calendar
 ;;;;;;  view-diary-entries-initially calendar-offset) "calendar"
-;;;;;;  "calendar/calendar.el" (17732 62701))
+;;;;;;  "calendar/calendar.el" (17778 50296))
 ;;; Generated autoloads from calendar/calendar.el
 
 (defvar calendar-offset 0 "\
@@ -3430,7 +3445,7 @@ movement commands will not work correctly.")
 ;;;***
 \f
 ;;;### (autoloads (canlock-verify canlock-insert-header) "canlock"
-;;;;;;  "gnus/canlock.el" (17504 41540))
+;;;;;;  "gnus/canlock.el" (17383 38804))
 ;;; Generated autoloads from gnus/canlock.el
 
 (autoload (quote canlock-insert-header) "canlock" "\
@@ -3447,15 +3462,15 @@ it fails.
 
 ;;;***
 \f
-;;;### (autoloads nil "cc-compat" "progmodes/cc-compat.el" (17508
-;;;;;;  50987))
+;;;### (autoloads nil "cc-compat" "progmodes/cc-compat.el" (17515
+;;;;;;  24859))
 ;;; Generated autoloads from progmodes/cc-compat.el
 (put 'c-indent-level 'safe-local-variable 'integerp)
 
 ;;;***
 \f
 ;;;### (autoloads (c-guess-basic-syntax) "cc-engine" "progmodes/cc-engine.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17411 11765))
 ;;; Generated autoloads from progmodes/cc-engine.el
 
 (autoload (quote c-guess-basic-syntax) "cc-engine" "\
@@ -3467,7 +3482,7 @@ Return the syntactic context of the current line.
 \f
 ;;;### (autoloads (pike-mode idl-mode java-mode objc-mode c++-mode
 ;;;;;;  c-mode c-initialize-cc-mode) "cc-mode" "progmodes/cc-mode.el"
-;;;;;;  (17599 63482))
+;;;;;;  (17611 8970))
 ;;; Generated autoloads from progmodes/cc-mode.el
 
 (autoload (quote c-initialize-cc-mode) "cc-mode" "\
@@ -3625,7 +3640,7 @@ Key bindings:
 ;;;***
 \f
 ;;;### (autoloads (c-set-offset c-add-style c-set-style) "cc-styles"
-;;;;;;  "progmodes/cc-styles.el" (17522 22309))
+;;;;;;  "progmodes/cc-styles.el" (17524 8597))
 ;;; Generated autoloads from progmodes/cc-styles.el
 
 (autoload (quote c-set-style) "cc-styles" "\
@@ -3676,14 +3691,14 @@ and exists only for compatibility reasons.
 
 ;;;***
 \f
-;;;### (autoloads nil "cc-subword" "progmodes/cc-subword.el" (17522
-;;;;;;  22309))
+;;;### (autoloads nil "cc-subword" "progmodes/cc-subword.el" (17515
+;;;;;;  24933))
 ;;; Generated autoloads from progmodes/cc-subword.el
  (autoload 'c-subword-mode "cc-subword" "Mode enabling subword movement and editing keys." t)
 
 ;;;***
 \f
-;;;### (autoloads nil "cc-vars" "progmodes/cc-vars.el" (17522 22309))
+;;;### (autoloads nil "cc-vars" "progmodes/cc-vars.el" (17778 50475))
 ;;; Generated autoloads from progmodes/cc-vars.el
 (put 'c-basic-offset 'safe-local-variable 'integerp)
 (put 'c-backslash-column 'safe-local-variable 'integerp)
@@ -3693,7 +3708,7 @@ and exists only for compatibility reasons.
 \f
 ;;;### (autoloads (ccl-execute-with-args check-ccl-program define-ccl-program
 ;;;;;;  declare-ccl-program ccl-dump ccl-compile) "ccl" "international/ccl.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17279 27079))
 ;;; Generated autoloads from international/ccl.el
 
 (autoload (quote ccl-compile) "ccl" "\
@@ -3952,7 +3967,7 @@ See the documentation of `define-ccl-program' for the detail of CCL program.
 ;;;***
 \f
 ;;;### (autoloads (cfengine-mode) "cfengine" "progmodes/cfengine.el"
-;;;;;;  (17671 29986))
+;;;;;;  (17713 5991))
 ;;; Generated autoloads from progmodes/cfengine.el
 
 (autoload (quote cfengine-mode) "cfengine" "\
@@ -3974,7 +3989,7 @@ to the action header.
 ;;;;;;  checkdoc-comments checkdoc-continue checkdoc-start checkdoc-current-buffer
 ;;;;;;  checkdoc-eval-current-buffer checkdoc-message-interactive
 ;;;;;;  checkdoc-interactive checkdoc) "checkdoc" "emacs-lisp/checkdoc.el"
-;;;;;;  (17746 34861))
+;;;;;;  (17778 50473))
 ;;; Generated autoloads from emacs-lisp/checkdoc.el
 
 (autoload (quote checkdoc) "checkdoc" "\
@@ -4157,8 +4172,8 @@ checking of documentation strings.
 ;;;***
 \f
 ;;;### (autoloads (encode-hz-buffer encode-hz-region decode-hz-buffer
-;;;;;;  decode-hz-region) "china-util" "language/china-util.el" (17504
-;;;;;;  41540))
+;;;;;;  decode-hz-region) "china-util" "language/china-util.el" (17279
+;;;;;;  27080))
 ;;; Generated autoloads from language/china-util.el
 
 (autoload (quote decode-hz-region) "china-util" "\
@@ -4186,7 +4201,7 @@ Encode the text in the current buffer to HZ.
 ;;;***
 \f
 ;;;### (autoloads (command-history list-command-history repeat-matching-complex-command)
-;;;;;;  "chistory" "chistory.el" (17504 41540))
+;;;;;;  "chistory" "chistory.el" (17390 26936))
 ;;; Generated autoloads from chistory.el
 
 (autoload (quote repeat-matching-complex-command) "chistory" "\
@@ -4225,7 +4240,7 @@ and runs the normal hook `command-history-hook'.
 
 ;;;***
 \f
-;;;### (autoloads nil "cl" "emacs-lisp/cl.el" (17701 49518))
+;;;### (autoloads nil "cl" "emacs-lisp/cl.el" (17713 5989))
 ;;; Generated autoloads from emacs-lisp/cl.el
 
 (defvar custom-print-functions nil "\
@@ -4241,7 +4256,7 @@ a future Emacs interpreter will be able to use it.")
 ;;;***
 \f
 ;;;### (autoloads (common-lisp-indent-function) "cl-indent" "emacs-lisp/cl-indent.el"
-;;;;;;  (17731 48935))
+;;;;;;  (17778 49129))
 ;;; Generated autoloads from emacs-lisp/cl-indent.el
 
 (autoload (quote common-lisp-indent-function) "cl-indent" "\
@@ -4252,7 +4267,7 @@ Not documented
 ;;;***
 \f
 ;;;### (autoloads (c-macro-expand) "cmacexp" "progmodes/cmacexp.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 27407))
 ;;; Generated autoloads from progmodes/cmacexp.el
 
 (autoload (quote c-macro-expand) "cmacexp" "\
@@ -4272,8 +4287,8 @@ For use inside Lisp programs, see also `c-macro-expansion'.
 
 ;;;***
 \f
-;;;### (autoloads (run-scheme) "cmuscheme" "cmuscheme.el" (17504
-;;;;;;  41540))
+;;;### (autoloads (run-scheme) "cmuscheme" "cmuscheme.el" (17390
+;;;;;;  26936))
 ;;; Generated autoloads from cmuscheme.el
 
 (autoload (quote run-scheme) "cmuscheme" "\
@@ -4294,7 +4309,7 @@ is run).
 ;;;***
 \f
 ;;;### (autoloads (cp-make-coding-system) "code-pages" "international/code-pages.el"
-;;;;;;  (17701 49519))
+;;;;;;  (17713 5990))
 ;;; Generated autoloads from international/code-pages.el
 
 (autoload (quote cp-make-coding-system) "code-pages" "\
@@ -4355,7 +4370,7 @@ Return an updated `non-iso-charset-alist'.
 \f
 ;;;### (autoloads (codepage-setup cp-supported-codepages cp-offset-for-codepage
 ;;;;;;  cp-language-for-codepage cp-charset-for-codepage cp-make-coding-systems-for-codepage)
-;;;;;;  "codepage" "international/codepage.el" (17668 1411))
+;;;;;;  "codepage" "international/codepage.el" (17713 5990))
 ;;; Generated autoloads from international/codepage.el
 
 (autoload (quote cp-make-coding-systems-for-codepage) "codepage" "\
@@ -4414,7 +4429,7 @@ read/written by MS-DOS software, or for display on the MS-DOS terminal.
 ;;;### (autoloads (comint-redirect-results-list-from-process comint-redirect-results-list
 ;;;;;;  comint-redirect-send-command-to-process comint-redirect-send-command
 ;;;;;;  comint-run make-comint make-comint-in-buffer) "comint" "comint.el"
-;;;;;;  (17759 29233))
+;;;;;;  (17778 50473))
 ;;; Generated autoloads from comint.el
 
 (defvar comint-output-filter-functions (quote (comint-postoutput-scroll-to-bottom comint-watch-for-password-prompt)) "\
@@ -4504,8 +4519,8 @@ REGEXP-GROUP is the regular expression group in REGEXP to use.
 
 ;;;***
 \f
-;;;### (autoloads (compare-windows) "compare-w" "compare-w.el" (17636
-;;;;;;  48139))
+;;;### (autoloads (compare-windows) "compare-w" "compare-w.el" (17713
+;;;;;;  5305))
 ;;; Generated autoloads from compare-w.el
 
 (autoload (quote compare-windows) "compare-w" "\
@@ -4542,7 +4557,7 @@ on third call it again advances points to the next difference and so on.
 ;;;;;;  compilation-shell-minor-mode compilation-mode compilation-start
 ;;;;;;  compile compilation-disable-input compile-command compilation-search-path
 ;;;;;;  compilation-ask-about-save compilation-window-height compilation-mode-hook)
-;;;;;;  "compile" "progmodes/compile.el" (17759 29277))
+;;;;;;  "compile" "progmodes/compile.el" (17778 50475))
 ;;; Generated autoloads from progmodes/compile.el
 
 (defvar compilation-mode-hook nil "\
@@ -4704,7 +4719,7 @@ This is the value of `next-error-function' in Compilation buffers.
 ;;;***
 \f
 ;;;### (autoloads (partial-completion-mode) "complete" "complete.el"
-;;;;;;  (17625 60530))
+;;;;;;  (17713 4883))
 ;;; Generated autoloads from complete.el
 
 (defvar partial-completion-mode nil "\
@@ -4746,7 +4761,7 @@ second TAB brings up the `*Completions*' buffer.
 ;;;***
 \f
 ;;;### (autoloads (dynamic-completion-mode) "completion" "completion.el"
-;;;;;;  (17704 3960))
+;;;;;;  (17713 5989))
 ;;; Generated autoloads from completion.el
 
 (defvar dynamic-completion-mode nil "\
@@ -4768,7 +4783,7 @@ Enable dynamic word-completion.
 ;;;### (autoloads (decompose-composite-char compose-last-chars compose-chars-after
 ;;;;;;  find-composition compose-chars decompose-string compose-string
 ;;;;;;  decompose-region compose-region encode-composition-rule)
-;;;;;;  "composite" "composite.el" (17504 41540))
+;;;;;;  "composite" "composite.el" (17327 23539))
 ;;; Generated autoloads from composite.el
 
 (defconst reference-point-alist (quote ((tl . 0) (tc . 1) (tr . 2) (Bl . 3) (Bc . 4) (Br . 5) (bl . 6) (bc . 7) (br . 8) (cl . 9) (cc . 10) (cr . 11) (top-left . 0) (top-center . 1) (top-right . 2) (base-left . 3) (base-center . 4) (base-right . 5) (bottom-left . 6) (bottom-center . 7) (bottom-right . 8) (center-left . 9) (center-center . 10) (center-right . 11) (ml . 3) (mc . 10) (mr . 5) (mid-left . 3) (mid-center . 10) (mid-right . 5))) "\
@@ -4990,7 +5005,7 @@ Optional 3rd arg WITH-COMPOSITION-RULE is ignored.
 ;;;### (autoloads (conf-xdefaults-mode conf-ppd-mode conf-colon-mode
 ;;;;;;  conf-space-keywords conf-space-mode conf-javaprop-mode conf-windows-mode
 ;;;;;;  conf-unix-mode conf-mode) "conf-mode" "textmodes/conf-mode.el"
-;;;;;;  (17680 45980))
+;;;;;;  (17713 5992))
 ;;; Generated autoloads from textmodes/conf-mode.el
 
 (autoload (quote conf-mode) "conf-mode" "\
@@ -5146,7 +5161,7 @@ For details see `conf-mode'.  Example:
 ;;;***
 \f
 ;;;### (autoloads (shuffle-vector cookie-snarf cookie-insert cookie)
-;;;;;;  "cookie1" "play/cookie1.el" (17566 60307))
+;;;;;;  "cookie1" "play/cookie1.el" (17569 17996))
 ;;; Generated autoloads from play/cookie1.el
 
 (autoload (quote cookie) "cookie1" "\
@@ -5178,7 +5193,7 @@ Randomly permute the elements of VECTOR (all permutations equally likely).
 ;;;***
 \f
 ;;;### (autoloads (copyright copyright-fix-years copyright-update)
-;;;;;;  "copyright" "emacs-lisp/copyright.el" (17504 41540))
+;;;;;;  "copyright" "emacs-lisp/copyright.el" (17390 26938))
 ;;; Generated autoloads from emacs-lisp/copyright.el
 
 (autoload (quote copyright-update) "copyright" "\
@@ -5206,7 +5221,7 @@ Insert a copyright by $ORGANIZATION notice at cursor.
 ;;;***
 \f
 ;;;### (autoloads (cperl-perldoc-at-point cperl-perldoc cperl-mode)
-;;;;;;  "cperl-mode" "progmodes/cperl-mode.el" (17759 28873))
+;;;;;;  "cperl-mode" "progmodes/cperl-mode.el" (17778 50475))
 ;;; Generated autoloads from progmodes/cperl-mode.el
 
 (autoload (quote cperl-mode) "cperl-mode" "\
@@ -5397,7 +5412,7 @@ Run a `perldoc' on the word around point.
 ;;;***
 \f
 ;;;### (autoloads (cpp-parse-edit cpp-highlight-buffer) "cpp" "progmodes/cpp.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 27408))
 ;;; Generated autoloads from progmodes/cpp.el
 
 (autoload (quote cpp-highlight-buffer) "cpp" "\
@@ -5416,7 +5431,7 @@ Edit display information for cpp conditionals.
 ;;;***
 \f
 ;;;### (autoloads (crisp-mode crisp-mode) "crisp" "emulation/crisp.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 26938))
 ;;; Generated autoloads from emulation/crisp.el
 
 (defvar crisp-mode nil "\
@@ -5427,7 +5442,7 @@ indicates CRiSP mode is enabled.
 Setting this variable directly does not take effect;
 use either M-x customize or the function `crisp-mode'.")
 
-(custom-autoload (quote crisp-mode) "crisp" nil)
+(custom-autoload (quote crisp-mode) "crisp")
 
 (autoload (quote crisp-mode) "crisp" "\
 Toggle CRiSP/Brief emulation minor mode.
@@ -5440,7 +5455,7 @@ With ARG, turn CRiSP mode on if ARG is positive, off otherwise.
 ;;;***
 \f
 ;;;### (autoloads (completing-read-multiple) "crm" "emacs-lisp/crm.el"
-;;;;;;  (17506 11763))
+;;;;;;  (17515 24857))
 ;;; Generated autoloads from emacs-lisp/crm.el
 
 (autoload (quote completing-read-multiple) "crm" "\
@@ -5476,7 +5491,7 @@ INHERIT-INPUT-METHOD.
 ;;;***
 \f
 ;;;### (autoloads (cua-selection-mode cua-mode) "cua-base" "emulation/cua-base.el"
-;;;;;;  (17664 10809))
+;;;;;;  (17713 6163))
 ;;; Generated autoloads from emulation/cua-base.el
 
 (defvar cua-mode nil "\
@@ -5542,7 +5557,7 @@ Enable CUA selection mode without the C-z/C-x/C-c/C-v bindings.
 ;;;;;;  customize-face customize-changed-options customize-option-other-window
 ;;;;;;  customize-option customize-group-other-window customize-group
 ;;;;;;  customize-mode customize customize-save-variable customize-set-variable
-;;;;;;  customize-set-value) "cus-edit" "cus-edit.el" (17759 28868))
+;;;;;;  customize-set-value) "cus-edit" "cus-edit.el" (17778 50473))
 ;;; Generated autoloads from cus-edit.el
  (add-hook 'same-window-regexps "\\`\\*Customiz.*\\*\\'")
 
@@ -5831,7 +5846,7 @@ The format is suitable for use with `easy-menu-define'.
 ;;;***
 \f
 ;;;### (autoloads (custom-reset-faces custom-theme-reset-faces custom-set-faces
-;;;;;;  custom-declare-face) "cus-face" "cus-face.el" (17504 41540))
+;;;;;;  custom-declare-face) "cus-face" "cus-face.el" (17390 26936))
 ;;; Generated autoloads from cus-face.el
 
 (autoload (quote custom-declare-face) "cus-face" "\
@@ -5901,7 +5916,7 @@ This means reset FACE to its value in FROM-THEME.
 ;;;***
 \f
 ;;;### (autoloads (customize-create-theme) "cus-theme" "cus-theme.el"
-;;;;;;  (17632 36218))
+;;;;;;  (17713 5203))
 ;;; Generated autoloads from cus-theme.el
 
 (autoload (quote customize-create-theme) "cus-theme" "\
@@ -5912,7 +5927,7 @@ Create a custom theme.
 ;;;***
 \f
 ;;;### (autoloads (cvs-status-mode) "cvs-status" "cvs-status.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17496 38723))
 ;;; Generated autoloads from cvs-status.el
 
 (autoload (quote cvs-status-mode) "cvs-status" "\
@@ -5923,7 +5938,7 @@ Mode used for cvs status output.
 ;;;***
 \f
 ;;;### (autoloads (global-cwarn-mode turn-on-cwarn-mode cwarn-mode)
-;;;;;;  "cwarn" "progmodes/cwarn.el" (17504 41540))
+;;;;;;  "cwarn" "progmodes/cwarn.el" (17390 27408))
 ;;; Generated autoloads from progmodes/cwarn.el
 
 (autoload (quote cwarn-mode) "cwarn" "\
@@ -5949,10 +5964,11 @@ This function is designed to be added to hooks, for example:
 Non-nil if Global-Cwarn mode is enabled.
 See the command `global-cwarn-mode' for a description of this minor-mode.
 Setting this variable directly does not take effect;
-either customize it (see the info node `Easy Customization')
-or call the function `global-cwarn-mode'.")
+use either \\[customize] or the function `global-cwarn-mode'.")
 
-(custom-autoload (quote global-cwarn-mode) "cwarn" nil)
+(custom-autoload (quote global-cwarn-mode) "cwarn")
+
+(put (quote global-cwarn-mode) (quote custom-set) (quote custom-set-minor-mode))
 
 (autoload (quote global-cwarn-mode) "cwarn" "\
 Toggle Cwarn mode in every buffer.
@@ -5966,7 +5982,7 @@ in which `turn-on-cwarn-mode-if-enabled' turns it on.
 \f
 ;;;### (autoloads (standard-display-cyrillic-translit cyrillic-encode-alternativnyj-char
 ;;;;;;  cyrillic-encode-koi8-r-char) "cyril-util" "language/cyril-util.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17279 27080))
 ;;; Generated autoloads from language/cyril-util.el
 
 (autoload (quote cyrillic-encode-koi8-r-char) "cyril-util" "\
@@ -5995,7 +6011,7 @@ If the argument is nil, we return the display table to its standard state.
 ;;;***
 \f
 ;;;### (autoloads (dabbrev-expand dabbrev-completion) "dabbrev" "dabbrev.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 26936))
 ;;; Generated autoloads from dabbrev.el
  (define-key esc-map "/" 'dabbrev-expand)
  (define-key esc-map [?\C-/] 'dabbrev-completion)
@@ -6039,8 +6055,8 @@ See also `dabbrev-abbrev-char-regexp' and \\[dabbrev-completion].
 
 ;;;***
 \f
-;;;### (autoloads (dcl-mode) "dcl-mode" "progmodes/dcl-mode.el" (17504
-;;;;;;  41540))
+;;;### (autoloads (dcl-mode) "dcl-mode" "progmodes/dcl-mode.el" (17390
+;;;;;;  27408))
 ;;; Generated autoloads from progmodes/dcl-mode.el
 
 (autoload (quote dcl-mode) "dcl-mode" "\
@@ -6167,7 +6183,7 @@ There is some minimal font-lock support (see vars
 ;;;***
 \f
 ;;;### (autoloads (cancel-debug-on-entry debug-on-entry debug) "debug"
-;;;;;;  "emacs-lisp/debug.el" (17504 41540))
+;;;;;;  "emacs-lisp/debug.el" (17390 26938))
 ;;; Generated autoloads from emacs-lisp/debug.el
 
 (setq debugger (quote debug))
@@ -6211,7 +6227,7 @@ To specify a nil argument interactively, exit with an empty minibuffer.
 ;;;***
 \f
 ;;;### (autoloads (decipher-mode decipher) "decipher" "play/decipher.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17383 38807))
 ;;; Generated autoloads from play/decipher.el
 
 (autoload (quote decipher) "decipher" "\
@@ -6240,8 +6256,8 @@ The most useful commands are:
 ;;;***
 \f
 ;;;### (autoloads (delimit-columns-rectangle delimit-columns-region
-;;;;;;  delimit-columns-customize) "delim-col" "delim-col.el" (17686
-;;;;;;  35928))
+;;;;;;  delimit-columns-customize) "delim-col" "delim-col.el" (17713
+;;;;;;  5989))
 ;;; Generated autoloads from delim-col.el
 
 (autoload (quote delimit-columns-customize) "delim-col" "\
@@ -6265,8 +6281,8 @@ START and END delimits the corners of text rectangle.
 
 ;;;***
 \f
-;;;### (autoloads (delphi-mode) "delphi" "progmodes/delphi.el" (17604
-;;;;;;  18983))
+;;;### (autoloads (delphi-mode) "delphi" "progmodes/delphi.el" (17611
+;;;;;;  9414))
 ;;; Generated autoloads from progmodes/delphi.el
 
 (autoload (quote delphi-mode) "delphi" "\
@@ -6316,8 +6332,8 @@ no args, if that value is non-nil.
 
 ;;;***
 \f
-;;;### (autoloads (delete-selection-mode) "delsel" "delsel.el" (17504
-;;;;;;  41540))
+;;;### (autoloads (delete-selection-mode) "delsel" "delsel.el" (17390
+;;;;;;  26936))
 ;;; Generated autoloads from delsel.el
 
 (defalias (quote pending-delete-mode) (quote delete-selection-mode))
@@ -6326,10 +6342,11 @@ no args, if that value is non-nil.
 Non-nil if Delete-Selection mode is enabled.
 See the command `delete-selection-mode' for a description of this minor-mode.
 Setting this variable directly does not take effect;
-either customize it (see the info node `Easy Customization')
-or call the function `delete-selection-mode'.")
+use either \\[customize] or the function `delete-selection-mode'.")
+
+(custom-autoload (quote delete-selection-mode) "delsel")
 
-(custom-autoload (quote delete-selection-mode) "delsel" nil)
+(put (quote delete-selection-mode) (quote custom-set) (quote custom-set-minor-mode))
 
 (autoload (quote delete-selection-mode) "delsel" "\
 Toggle Delete Selection mode.
@@ -6346,7 +6363,7 @@ any selection.
 ;;;***
 \f
 ;;;### (autoloads (derived-mode-init-mode-variables define-derived-mode)
-;;;;;;  "derived" "emacs-lisp/derived.el" (17504 41540))
+;;;;;;  "derived" "emacs-lisp/derived.el" (17390 26938))
 ;;; Generated autoloads from emacs-lisp/derived.el
 
 (autoload (quote define-derived-mode) "derived" "\
@@ -6411,7 +6428,7 @@ the first time the mode is used.
 ;;;***
 \f
 ;;;### (autoloads (describe-char describe-text-properties) "descr-text"
-;;;;;;  "descr-text.el" (17504 41540))
+;;;;;;  "descr-text.el" (17778 50473))
 ;;; Generated autoloads from descr-text.el
 
 (autoload (quote describe-text-properties) "descr-text" "\
@@ -6437,7 +6454,7 @@ as well as widgets, buttons, overlays, and text properties.
 ;;;### (autoloads (desktop-revert desktop-save-in-desktop-dir desktop-change-dir
 ;;;;;;  desktop-load-default desktop-read desktop-remove desktop-save
 ;;;;;;  desktop-clear desktop-locals-to-save desktop-save-mode) "desktop"
-;;;;;;  "desktop.el" (17672 28070))
+;;;;;;  "desktop.el" (17713 5989))
 ;;; Generated autoloads from desktop.el
 
 (defvar desktop-save-mode nil "\
@@ -6620,7 +6637,7 @@ Revert to the last loaded desktop.
 \f
 ;;;### (autoloads (gnus-article-outlook-deuglify-article gnus-outlook-deuglify-article
 ;;;;;;  gnus-article-outlook-repair-attribution gnus-article-outlook-unwrap-lines)
-;;;;;;  "deuglify" "gnus/deuglify.el" (17504 41540))
+;;;;;;  "deuglify" "gnus/deuglify.el" (17490 7932))
 ;;; Generated autoloads from gnus/deuglify.el
 
 (autoload (quote gnus-article-outlook-unwrap-lines) "deuglify" "\
@@ -6653,7 +6670,7 @@ Deuglify broken Outlook (Express) articles and redisplay.
 ;;;***
 \f
 ;;;### (autoloads (devanagari-post-read-conversion devanagari-compose-region)
-;;;;;;  "devan-util" "language/devan-util.el" (17504 41540))
+;;;;;;  "devan-util" "language/devan-util.el" (17279 27080))
 ;;; Generated autoloads from language/devan-util.el
 
 (defconst devanagari-consonant "[\x51ad5-\x51af9\x51b38-\x51b3f]")
@@ -6671,7 +6688,7 @@ Not documented
 ;;;***
 \f
 ;;;### (autoloads (diary-mode diary-mail-entries diary) "diary-lib"
-;;;;;;  "calendar/diary-lib.el" (17522 22309))
+;;;;;;  "calendar/diary-lib.el" (17518 54393))
 ;;; Generated autoloads from calendar/diary-lib.el
 
 (autoload (quote diary) "diary-lib" "\
@@ -6717,18 +6734,18 @@ Major mode for editing the diary file.
 ;;;***
 \f
 ;;;### (autoloads (diff-backup diff diff-command diff-switches) "diff"
-;;;;;;  "diff.el" (17544 39648))
+;;;;;;  "diff.el" (17549 4607))
 ;;; Generated autoloads from diff.el
 
 (defvar diff-switches "-c" "\
 *A string or list of strings specifying switches to be passed to diff.")
 
-(custom-autoload (quote diff-switches) "diff" t)
+(custom-autoload (quote diff-switches) "diff")
 
 (defvar diff-command "diff" "\
 *The command to use to run diff.")
 
-(custom-autoload (quote diff-command) "diff" t)
+(custom-autoload (quote diff-command) "diff")
 
 (autoload (quote diff) "diff" "\
 Find and display the differences between OLD and NEW files.
@@ -6751,7 +6768,7 @@ With prefix arg, prompt for diff switches.
 ;;;***
 \f
 ;;;### (autoloads (diff-minor-mode diff-mode) "diff-mode" "diff-mode.el"
-;;;;;;  (17672 28070))
+;;;;;;  (17778 50473))
 ;;; Generated autoloads from diff-mode.el
 
 (autoload (quote diff-mode) "diff-mode" "\
@@ -6781,7 +6798,7 @@ Minor mode for viewing/editing context diffs.
 ;;;;;;  dired dired-copy-preserve-time dired-dwim-target dired-keep-marker-symlink
 ;;;;;;  dired-keep-marker-hardlink dired-keep-marker-copy dired-keep-marker-rename
 ;;;;;;  dired-trivial-filenames dired-ls-F-marks-symlinks dired-listing-switches)
-;;;;;;  "dired" "dired.el" (17746 34860))
+;;;;;;  "dired" "dired.el" (17778 50473))
 ;;; Generated autoloads from dired.el
 
 (defvar dired-listing-switches "-al" "\
@@ -6986,7 +7003,7 @@ Keybindings:
 ;;;;;;  dired-run-shell-command dired-do-shell-command dired-clean-directory
 ;;;;;;  dired-do-print dired-do-touch dired-do-chown dired-do-chgrp
 ;;;;;;  dired-do-chmod dired-compare-directories dired-backup-diff
-;;;;;;  dired-diff) "dired-aux" "dired-aux.el" (17746 34860))
+;;;;;;  dired-diff) "dired-aux" "dired-aux.el" (17778 50473))
 ;;; Generated autoloads from dired-aux.el
 
 (autoload (quote dired-diff) "dired-aux" "\
@@ -7398,7 +7415,7 @@ true then the type of the file linked to by FILE is printed instead.
 
 ;;;***
 \f
-;;;### (autoloads (dired-jump) "dired-x" "dired-x.el" (17656 34193))
+;;;### (autoloads (dired-jump) "dired-x" "dired-x.el" (17713 5989))
 ;;; Generated autoloads from dired-x.el
 
 (autoload (quote dired-jump) "dired-x" "\
@@ -7412,7 +7429,7 @@ buffer and try again.
 
 ;;;***
 \f
-;;;### (autoloads (dirtrack) "dirtrack" "dirtrack.el" (17586 63360))
+;;;### (autoloads (dirtrack) "dirtrack" "dirtrack.el" (17591 9569))
 ;;; Generated autoloads from dirtrack.el
 
 (autoload (quote dirtrack) "dirtrack" "\
@@ -7431,8 +7448,8 @@ You can enable directory tracking by adding this function to
 
 ;;;***
 \f
-;;;### (autoloads (disassemble) "disass" "emacs-lisp/disass.el" (17504
-;;;;;;  41540))
+;;;### (autoloads (disassemble) "disass" "emacs-lisp/disass.el" (17390
+;;;;;;  26938))
 ;;; Generated autoloads from emacs-lisp/disass.el
 
 (autoload (quote disassemble) "disass" "\
@@ -7450,7 +7467,7 @@ redefine OBJECT if it is a symbol.
 ;;;;;;  standard-display-graphic standard-display-g1 standard-display-ascii
 ;;;;;;  standard-display-default standard-display-8bit describe-current-display-table
 ;;;;;;  describe-display-table set-display-table-slot display-table-slot
-;;;;;;  make-display-table) "disp-table" "disp-table.el" (17504 41540))
+;;;;;;  make-display-table) "disp-table" "disp-table.el" (17778 50473))
 ;;; Generated autoloads from disp-table.el
 
 (autoload (quote make-display-table) "disp-table" "\
@@ -7551,7 +7568,7 @@ for users who call this function in `.emacs'.
 ;;;***
 \f
 ;;;### (autoloads (dissociated-press) "dissociate" "play/dissociate.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17383 38807))
 ;;; Generated autoloads from play/dissociate.el
 
 (autoload (quote dissociated-press) "dissociate" "\
@@ -7567,7 +7584,7 @@ Default is 2.
 
 ;;;***
 \f
-;;;### (autoloads (dnd-protocol-alist) "dnd" "dnd.el" (17710 3074))
+;;;### (autoloads (dnd-protocol-alist) "dnd" "dnd.el" (17713 5989))
 ;;; Generated autoloads from dnd.el
 
 (defvar dnd-protocol-alist (quote (("^file:///" . dnd-open-local-file) ("^file://" . dnd-open-file) ("^file:" . dnd-open-local-file) ("^\\(https?\\|ftp\\|file\\|nfs\\)://" . dnd-open-file))) "\
@@ -7588,7 +7605,7 @@ if some action was made, or nil if the URL is ignored.")
 ;;;***
 \f
 ;;;### (autoloads (dns-mode-soa-increment-serial dns-mode) "dns-mode"
-;;;;;;  "textmodes/dns-mode.el" (17630 16368))
+;;;;;;  "textmodes/dns-mode.el" (17713 5203))
 ;;; Generated autoloads from textmodes/dns-mode.el
 
 (autoload (quote dns-mode) "dns-mode" "\
@@ -7612,7 +7629,7 @@ Locate SOA record and increment the serial field.
 
 ;;;***
 \f
-;;;### (autoloads (doctor) "doctor" "play/doctor.el" (17504 41540))
+;;;### (autoloads (doctor) "doctor" "play/doctor.el" (17374 21430))
 ;;; Generated autoloads from play/doctor.el
 
 (autoload (quote doctor) "doctor" "\
@@ -7623,7 +7640,7 @@ Switch to *doctor* buffer and start giving psychotherapy.
 ;;;***
 \f
 ;;;### (autoloads (double-mode double-mode) "double" "double.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 26937))
 ;;; Generated autoloads from double.el
 
 (defvar double-mode nil "\
@@ -7631,7 +7648,7 @@ Toggle Double mode.
 Setting this variable directly does not take effect;
 use either \\[customize] or the function `double-mode'.")
 
-(custom-autoload (quote double-mode) "double" nil)
+(custom-autoload (quote double-mode) "double")
 
 (autoload (quote double-mode) "double" "\
 Toggle Double mode.
@@ -7644,7 +7661,7 @@ when pressed twice.  See variable `double-map' for details.
 
 ;;;***
 \f
-;;;### (autoloads (dunnet) "dunnet" "play/dunnet.el" (17746 34862))
+;;;### (autoloads (dunnet) "dunnet" "play/dunnet.el" (17778 50475))
 ;;; Generated autoloads from play/dunnet.el
 
 (autoload (quote dunnet) "dunnet" "\
@@ -7655,7 +7672,7 @@ Switch to *dungeon* buffer and start game.
 ;;;***
 \f
 ;;;### (autoloads (gnus-earcon-display) "earcon" "gnus/earcon.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17383 38805))
 ;;; Generated autoloads from gnus/earcon.el
 
 (autoload (quote gnus-earcon-display) "earcon" "\
@@ -7667,7 +7684,7 @@ Play sounds in message buffers.
 \f
 ;;;### (autoloads (easy-mmode-defsyntax easy-mmode-defmap easy-mmode-define-keymap
 ;;;;;;  define-global-minor-mode define-minor-mode) "easy-mmode"
-;;;;;;  "emacs-lisp/easy-mmode.el" (17656 34193))
+;;;;;;  "emacs-lisp/easy-mmode.el" (17778 50473))
 ;;; Generated autoloads from emacs-lisp/easy-mmode.el
 
 (defalias (quote easy-mmode-define-minor-mode) (quote define-minor-mode))
@@ -7759,8 +7776,8 @@ CSS contains a list of syntax specifications of the form (CHAR . SYNTAX).
 ;;;***
 \f
 ;;;### (autoloads (easy-menu-change easy-menu-create-menu easy-menu-do-define
-;;;;;;  easy-menu-define) "easymenu" "emacs-lisp/easymenu.el" (17658
-;;;;;;  58024))
+;;;;;;  easy-menu-define) "easymenu" "emacs-lisp/easymenu.el" (17390
+;;;;;;  26938))
 ;;; Generated autoloads from emacs-lisp/easymenu.el
 
 (put (quote easy-menu-define) (quote lisp-indent-function) (quote defun))
@@ -7905,7 +7922,7 @@ To implement dynamic menus, either call this from
 ;;;;;;  ebnf-eps-directory ebnf-spool-region ebnf-spool-buffer ebnf-spool-file
 ;;;;;;  ebnf-spool-directory ebnf-print-region ebnf-print-buffer
 ;;;;;;  ebnf-print-file ebnf-print-directory ebnf-customize) "ebnf2ps"
-;;;;;;  "progmodes/ebnf2ps.el" (17759 28873))
+;;;;;;  "progmodes/ebnf2ps.el" (17778 50475))
 ;;; Generated autoloads from progmodes/ebnf2ps.el
 
 (autoload (quote ebnf-customize) "ebnf2ps" "\
@@ -8164,8 +8181,8 @@ See `ebnf-style-database' documentation.
 ;;;;;;  ebrowse-tags-find-declaration-other-window ebrowse-tags-find-definition
 ;;;;;;  ebrowse-tags-view-definition ebrowse-tags-find-declaration
 ;;;;;;  ebrowse-tags-view-declaration ebrowse-member-mode ebrowse-electric-choose-tree
-;;;;;;  ebrowse-tree-mode) "ebrowse" "progmodes/ebrowse.el" (17588
-;;;;;;  11509))
+;;;;;;  ebrowse-tree-mode) "ebrowse" "progmodes/ebrowse.el" (17591
+;;;;;;  9719))
 ;;; Generated autoloads from progmodes/ebrowse.el
 
 (autoload (quote ebrowse-tree-mode) "ebrowse" "\
@@ -8316,7 +8333,7 @@ Display statistics for a class tree.
 ;;;***
 \f
 ;;;### (autoloads (electric-buffer-list) "ebuff-menu" "ebuff-menu.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17778 50473))
 ;;; Generated autoloads from ebuff-menu.el
 
 (autoload (quote electric-buffer-list) "ebuff-menu" "\
@@ -8341,7 +8358,7 @@ Run hooks in `electric-buffer-menu-mode-hook' on entry.
 ;;;***
 \f
 ;;;### (autoloads (Electric-command-history-redo-expression) "echistory"
-;;;;;;  "echistory.el" (17504 41540))
+;;;;;;  "echistory.el" (17390 26937))
 ;;; Generated autoloads from echistory.el
 
 (autoload (quote Electric-command-history-redo-expression) "echistory" "\
@@ -8354,7 +8371,7 @@ With prefix arg NOCONFIRM, execute current line as-is without editing.
 \f
 ;;;### (autoloads (edebug-all-forms edebug-all-defs edebug-eval-top-level-form
 ;;;;;;  edebug-basic-spec edebug-all-forms edebug-all-defs) "edebug"
-;;;;;;  "emacs-lisp/edebug.el" (17628 62479))
+;;;;;;  "emacs-lisp/edebug.el" (17713 5203))
 ;;; Generated autoloads from emacs-lisp/edebug.el
 
 (defvar edebug-all-defs nil "\
@@ -8427,7 +8444,7 @@ Toggle edebugging of all forms.
 ;;;;;;  ediff-merge-directory-revisions ediff-merge-directories-with-ancestor
 ;;;;;;  ediff-merge-directories ediff-directories3 ediff-directory-revisions
 ;;;;;;  ediff-directories ediff-buffers3 ediff-buffers ediff-backup
-;;;;;;  ediff-files3 ediff-files) "ediff" "ediff.el" (17759 28868))
+;;;;;;  ediff-files3 ediff-files) "ediff" "ediff.el" (17778 50473))
 ;;; Generated autoloads from ediff.el
 
 (autoload (quote ediff-files) "ediff" "\
@@ -8665,7 +8682,7 @@ With optional NODE, goes to that node.
 ;;;***
 \f
 ;;;### (autoloads (ediff-customize) "ediff-help" "ediff-help.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17401 60342))
 ;;; Generated autoloads from ediff-help.el
 
 (autoload (quote ediff-customize) "ediff-help" "\
@@ -8675,7 +8692,7 @@ Not documented
 
 ;;;***
 \f
-;;;### (autoloads nil "ediff-hook" "ediff-hook.el" (17504 41540))
+;;;### (autoloads nil "ediff-hook" "ediff-hook.el" (17401 60342))
 ;;; Generated autoloads from ediff-hook.el
 
 (defvar ediff-window-setup-function)
@@ -8688,7 +8705,7 @@ Not documented
 ;;;***
 \f
 ;;;### (autoloads (ediff-show-registry) "ediff-mult" "ediff-mult.el"
-;;;;;;  (17731 48935))
+;;;;;;  (17778 49123))
 ;;; Generated autoloads from ediff-mult.el
 
 (autoload (quote ediff-show-registry) "ediff-mult" "\
@@ -8701,7 +8718,7 @@ Display Ediff's registry.
 ;;;***
 \f
 ;;;### (autoloads (ediff-toggle-use-toolbar ediff-toggle-multiframe)
-;;;;;;  "ediff-util" "ediff-util.el" (17680 45980))
+;;;;;;  "ediff-util" "ediff-util.el" (17713 5989))
 ;;; Generated autoloads from ediff-util.el
 
 (autoload (quote ediff-toggle-multiframe) "ediff-util" "\
@@ -8722,7 +8739,7 @@ To change the default, set the variable `ediff-use-toolbar-p', which see.
 \f
 ;;;### (autoloads (format-kbd-macro read-kbd-macro edit-named-kbd-macro
 ;;;;;;  edit-last-kbd-macro edit-kbd-macro) "edmacro" "edmacro.el"
-;;;;;;  (17618 27597))
+;;;;;;  (17713 2486))
 ;;; Generated autoloads from edmacro.el
 
 (defvar edmacro-eight-bits nil "\
@@ -8775,7 +8792,7 @@ or nil, use a compact 80-column format.
 ;;;***
 \f
 ;;;### (autoloads (edt-emulation-on edt-set-scroll-margins) "edt"
-;;;;;;  "emulation/edt.el" (17504 41540))
+;;;;;;  "emulation/edt.el" (17390 26938))
 ;;; Generated autoloads from emulation/edt.el
 
 (autoload (quote edt-set-scroll-margins) "edt" "\
@@ -8793,7 +8810,7 @@ Turn on EDT Emulation.
 ;;;***
 \f
 ;;;### (autoloads (electric-helpify with-electric-help) "ehelp" "ehelp.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17778 50473))
 ;;; Generated autoloads from ehelp.el
 
 (autoload (quote with-electric-help) "ehelp" "\
@@ -8831,7 +8848,7 @@ Not documented
 ;;;***
 \f
 ;;;### (autoloads (turn-on-eldoc-mode eldoc-mode eldoc-minor-mode-string)
-;;;;;;  "eldoc" "emacs-lisp/eldoc.el" (17721 38189))
+;;;;;;  "eldoc" "emacs-lisp/eldoc.el" (17713 5989))
 ;;; Generated autoloads from emacs-lisp/eldoc.el
 
 (defvar eldoc-minor-mode-string " ElDoc" "\
@@ -8869,8 +8886,8 @@ Emacs Lisp mode) that support Eldoc.")
 
 ;;;***
 \f
-;;;### (autoloads (elide-head) "elide-head" "elide-head.el" (17504
-;;;;;;  41540))
+;;;### (autoloads (elide-head) "elide-head" "elide-head.el" (17390
+;;;;;;  26937))
 ;;; Generated autoloads from elide-head.el
 
 (autoload (quote elide-head) "elide-head" "\
@@ -8886,7 +8903,7 @@ This is suitable as an entry on `find-file-hook' or appropriate mode hooks.
 ;;;***
 \f
 ;;;### (autoloads (elint-initialize) "elint" "emacs-lisp/elint.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 26938))
 ;;; Generated autoloads from emacs-lisp/elint.el
 
 (autoload (quote elint-initialize) "elint" "\
@@ -8897,8 +8914,8 @@ Initialize elint.
 ;;;***
 \f
 ;;;### (autoloads (elp-results elp-instrument-package elp-instrument-list
-;;;;;;  elp-instrument-function) "elp" "emacs-lisp/elp.el" (17504
-;;;;;;  41540))
+;;;;;;  elp-instrument-function) "elp" "emacs-lisp/elp.el" (17390
+;;;;;;  26938))
 ;;; Generated autoloads from emacs-lisp/elp.el
 
 (autoload (quote elp-instrument-function) "elp" "\
@@ -8932,7 +8949,7 @@ displayed.
 ;;;***
 \f
 ;;;### (autoloads (report-emacs-bug) "emacsbug" "mail/emacsbug.el"
-;;;;;;  (17746 34862))
+;;;;;;  (17778 50475))
 ;;; Generated autoloads from mail/emacsbug.el
 
 (autoload (quote report-emacs-bug) "emacsbug" "\
@@ -8947,7 +8964,7 @@ Prompts for bug subject.  Leaves you in a mail buffer.
 ;;;;;;  emerge-revisions emerge-files-with-ancestor-remote emerge-files-remote
 ;;;;;;  emerge-files-with-ancestor-command emerge-files-command emerge-buffers-with-ancestor
 ;;;;;;  emerge-buffers emerge-files-with-ancestor emerge-files) "emerge"
-;;;;;;  "emerge.el" (17504 41540))
+;;;;;;  "emerge.el" (17279 27122))
 ;;; Generated autoloads from emerge.el
 
 (defvar menu-bar-emerge-menu (make-sparse-keymap "Emerge"))
@@ -9024,37 +9041,21 @@ Not documented
 
 ;;;***
 \f
-;;;### (autoloads (encoded-kbd-mode) "encoded-kb" "international/encoded-kb.el"
-;;;;;;  (17504 41540))
+;;;### (autoloads (encoded-kbd-setup-display) "encoded-kb" "international/encoded-kb.el"
+;;;;;;  (17323 25934))
 ;;; Generated autoloads from international/encoded-kb.el
 
-(defvar encoded-kbd-mode nil "\
-Non-nil if Encoded-Kbd mode is enabled.
-See the command `encoded-kbd-mode' for a description of this minor-mode.
-Setting this variable directly does not take effect;
-either customize it (see the info node `Easy Customization')
-or call the function `encoded-kbd-mode'.")
+(autoload (quote encoded-kbd-setup-display) "encoded-kb" "\
+Set up a `key-translation-map' for `keyboard-coding-system' on DISPLAY.
 
-(custom-autoload (quote encoded-kbd-mode) "encoded-kb" nil)
+DISPLAY may be a display id, a frame, or nil for the selected frame's display.
 
-(autoload (quote encoded-kbd-mode) "encoded-kb" "\
-Toggle Encoded-kbd minor mode.
-With arg, turn Encoded-kbd mode on if and only if arg is positive.
-
-You should not turn this mode on manually, instead use the command
-\\[set-keyboard-coding-system] which turns on or off this mode
-automatically.
-
-In Encoded-kbd mode, a text sent from keyboard is accepted
-as a multilingual text encoded in a coding system set by
-\\[set-keyboard-coding-system].
-
-\(fn &optional ARG)" t nil)
+\(fn DISPLAY)" nil nil)
 
 ;;;***
 \f
 ;;;### (autoloads (enriched-decode enriched-encode enriched-mode)
-;;;;;;  "enriched" "textmodes/enriched.el" (17746 34862))
+;;;;;;  "enriched" "textmodes/enriched.el" (17778 50479))
 ;;; Generated autoloads from textmodes/enriched.el
 
 (autoload (quote enriched-mode) "enriched" "\
@@ -9084,8 +9085,8 @@ Not documented
 
 ;;;***
 \f
-;;;### (autoloads (erc-handle-irc-url erc-select erc-select-read-args)
-;;;;;;  "erc" "erc/erc.el" (17746 35371))
+;;;### (autoloads (erc-handle-irc-url erc erc-select-read-args) "erc"
+;;;;;;  "erc/erc.el" (17778 50473))
 ;;; Generated autoloads from erc/erc.el
 
 (autoload (quote erc-select-read-args) "erc" "\
@@ -9093,7 +9094,7 @@ Prompt the user for values of nick, server, port, and password.
 
 \(fn)" nil nil)
 
-(autoload (quote erc-select) "erc" "\
+(autoload (quote erc) "erc" "\
 Select connection parameters and run ERC.
 Non-interactively, it takes keyword arguments
    (server (erc-compute-server))
@@ -9104,7 +9105,7 @@ Non-interactively, it takes keyword arguments
 
 That is, if called with
 
-   (erc-select :server \"irc.freenode.net\" :full-name \"Harry S Truman\")
+   (erc :server \"irc.freenode.net\" :full-name \"Harry S Truman\")
 
 server and full-name will be set to those values, whereas
 `erc-compute-port', `erc-compute-nick' and `erc-compute-full-name' will
@@ -9121,27 +9122,27 @@ Otherwise, connect to HOST:PORT as USER and /join CHANNEL.
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-autoaway" "erc/erc-autoaway.el" (17746
-;;;;;;  34861))
+;;;### (autoloads nil "erc-autoaway" "erc/erc-autoaway.el" (17778
+;;;;;;  50473))
 ;;; Generated autoloads from erc/erc-autoaway.el
  (autoload 'erc-autoaway-mode "erc-autoaway")
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-button" "erc/erc-button.el" (17504 41540))
+;;;### (autoloads nil "erc-button" "erc/erc-button.el" (17454 30949))
 ;;; Generated autoloads from erc/erc-button.el
  (autoload 'erc-button-mode "erc-button" nil t)
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-compat" "erc/erc-compat.el" (17504 41540))
+;;;### (autoloads nil "erc-compat" "erc/erc-compat.el" (17778 50473))
 ;;; Generated autoloads from erc/erc-compat.el
  (autoload 'erc-define-minor-mode "erc-compat")
 
 ;;;***
 \f
 ;;;### (autoloads (erc-ctcp-query-DCC pcomplete/erc-mode/DCC erc-cmd-DCC)
-;;;;;;  "erc-dcc" "erc/erc-dcc.el" (17746 34861))
+;;;;;;  "erc-dcc" "erc/erc-dcc.el" (17778 50473))
 ;;; Generated autoloads from erc/erc-dcc.el
 
 (autoload (quote erc-cmd-DCC) "erc-dcc" "\
@@ -9173,7 +9174,7 @@ that subcommand.
 ;;;;;;  erc-ezb-add-session erc-ezb-end-of-session-list erc-ezb-init-session-list
 ;;;;;;  erc-ezb-identify erc-ezb-notice-autodetect erc-ezb-lookup-action
 ;;;;;;  erc-ezb-get-login erc-cmd-ezb) "erc-ezbounce" "erc/erc-ezbounce.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17469 12056))
 ;;; Generated autoloads from erc/erc-ezbounce.el
 
 (autoload (quote erc-cmd-ezb) "erc-ezbounce" "\
@@ -9235,8 +9236,8 @@ Add EZBouncer convenience functions to ERC.
 
 ;;;***
 \f
-;;;### (autoloads (erc-fill) "erc-fill" "erc/erc-fill.el" (17504
-;;;;;;  41540))
+;;;### (autoloads (erc-fill) "erc-fill" "erc/erc-fill.el" (17778
+;;;;;;  50473))
 ;;; Generated autoloads from erc/erc-fill.el
  (autoload 'erc-fill-mode "erc-fill" nil t)
 
@@ -9248,15 +9249,15 @@ You can put this on `erc-insert-modify-hook' and/or `erc-send-modify-hook'.
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-hecomplete" "erc/erc-hecomplete.el" (17504
-;;;;;;  41540))
+;;;### (autoloads nil "erc-hecomplete" "erc/erc-hecomplete.el" (17396
+;;;;;;  42158))
 ;;; Generated autoloads from erc/erc-hecomplete.el
  (autoload 'erc-hecomplete-mode "erc-hecomplete" nil t)
 
 ;;;***
 \f
 ;;;### (autoloads (erc-identd-stop erc-identd-start) "erc-identd"
-;;;;;;  "erc/erc-identd.el" (17592 59702))
+;;;;;;  "erc/erc-identd.el" (17591 9873))
 ;;; Generated autoloads from erc/erc-identd.el
  (autoload 'erc-identd-mode "erc-identd")
 
@@ -9278,7 +9279,7 @@ Not documented
 ;;;***
 \f
 ;;;### (autoloads (erc-create-imenu-index) "erc-imenu" "erc/erc-imenu.el"
-;;;;;;  (17592 59702))
+;;;;;;  (17591 9873))
 ;;; Generated autoloads from erc/erc-imenu.el
 
 (autoload (quote erc-create-imenu-index) "erc-imenu" "\
@@ -9288,14 +9289,14 @@ Not documented
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-join" "erc/erc-join.el" (17504 41540))
+;;;### (autoloads nil "erc-join" "erc/erc-join.el" (17469 12056))
 ;;; Generated autoloads from erc/erc-join.el
  (autoload 'erc-autojoin-mode "erc-join" nil t)
 
 ;;;***
 \f
 ;;;### (autoloads (erc-chanlist erc-list-channels) "erc-list" "erc/erc-list.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17396 42158))
 ;;; Generated autoloads from erc/erc-list.el
  (autoload 'erc-list-mode "erc-list")
 
@@ -9316,7 +9317,7 @@ to RFC and send the LIST header (#321) at start of list transmission.
 ;;;***
 \f
 ;;;### (autoloads (erc-save-buffer-in-logs erc-logging-enabled) "erc-log"
-;;;;;;  "erc/erc-log.el" (17623 45181))
+;;;;;;  "erc/erc-log.el" (17778 50473))
 ;;; Generated autoloads from erc/erc-log.el
  (autoload 'erc-log-mode "erc-log" nil t)
 
@@ -9348,7 +9349,7 @@ You can save every individual message by putting this function on
 ;;;### (autoloads (erc-delete-dangerous-host erc-add-dangerous-host
 ;;;;;;  erc-delete-keyword erc-add-keyword erc-delete-fool erc-add-fool
 ;;;;;;  erc-delete-pal erc-add-pal) "erc-match" "erc/erc-match.el"
-;;;;;;  (17632 36219))
+;;;;;;  (17713 5203))
 ;;; Generated autoloads from erc/erc-match.el
  (autoload 'erc-match-mode "erc-match")
 
@@ -9395,7 +9396,7 @@ Delete dangerous-host interactively to `erc-dangerous-hosts'.
 ;;;***
 \f
 ;;;### (autoloads (erc-cmd-WHOLEFT) "erc-netsplit" "erc/erc-netsplit.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17469 12056))
 ;;; Generated autoloads from erc/erc-netsplit.el
  (autoload 'erc-netsplit-mode "erc-netsplit")
 
@@ -9407,7 +9408,7 @@ Show who's gone.
 ;;;***
 \f
 ;;;### (autoloads (erc-server-select erc-determine-network) "erc-networks"
-;;;;;;  "erc/erc-networks.el" (17504 41540))
+;;;;;;  "erc/erc-networks.el" (17778 50473))
 ;;; Generated autoloads from erc/erc-networks.el
 
 (autoload (quote erc-determine-network) "erc-networks" "\
@@ -9425,7 +9426,7 @@ Interactively select a server to connect to using `erc-server-alist'.
 ;;;***
 \f
 ;;;### (autoloads (pcomplete/erc-mode/NOTIFY erc-cmd-NOTIFY) "erc-notify"
-;;;;;;  "erc/erc-notify.el" (17504 41540))
+;;;;;;  "erc/erc-notify.el" (17396 42158))
 ;;; Generated autoloads from erc/erc-notify.el
  (autoload 'erc-notify-mode "erc-notify" nil t)
 
@@ -9443,33 +9444,33 @@ Not documented
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-page" "erc/erc-page.el" (17504 41540))
+;;;### (autoloads nil "erc-page" "erc/erc-page.el" (17396 42158))
 ;;; Generated autoloads from erc/erc-page.el
  (autoload 'erc-page-mode "erc-page")
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-pcomplete" "erc/erc-pcomplete.el" (17592
-;;;;;;  59702))
+;;;### (autoloads nil "erc-pcomplete" "erc/erc-pcomplete.el" (17591
+;;;;;;  9873))
 ;;; Generated autoloads from erc/erc-pcomplete.el
  (autoload 'erc-completion-mode "erc-pcomplete" nil t)
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-replace" "erc/erc-replace.el" (17504 41540))
+;;;### (autoloads nil "erc-replace" "erc/erc-replace.el" (17778 50473))
 ;;; Generated autoloads from erc/erc-replace.el
  (autoload 'erc-replace-mode "erc-replace")
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-ring" "erc/erc-ring.el" (17504 41540))
+;;;### (autoloads nil "erc-ring" "erc/erc-ring.el" (17396 42158))
 ;;; Generated autoloads from erc/erc-ring.el
  (autoload 'erc-ring-mode "erc-ring" nil t)
 
 ;;;***
 \f
 ;;;### (autoloads (erc-nickserv-identify erc-nickserv-identify-mode)
-;;;;;;  "erc-services" "erc/erc-services.el" (17504 41540))
+;;;;;;  "erc-services" "erc/erc-services.el" (17396 42158))
 ;;; Generated autoloads from erc/erc-services.el
  (autoload 'erc-services-mode "erc-services" nil t)
 
@@ -9486,14 +9487,14 @@ When called interactively, read the password using `read-passwd'.
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-sound" "erc/erc-sound.el" (17504 41540))
+;;;### (autoloads nil "erc-sound" "erc/erc-sound.el" (17778 50473))
 ;;; Generated autoloads from erc/erc-sound.el
  (autoload 'erc-sound-mode "erc-sound")
 
 ;;;***
 \f
 ;;;### (autoloads (erc-speedbar-browser) "erc-speedbar" "erc/erc-speedbar.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17396 42158))
 ;;; Generated autoloads from erc/erc-speedbar.el
 
 (autoload (quote erc-speedbar-browser) "erc-speedbar" "\
@@ -9504,20 +9505,20 @@ This will add a speedbar major display mode.
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-spelling" "erc/erc-spelling.el" (17618
-;;;;;;  27598))
+;;;### (autoloads nil "erc-spelling" "erc/erc-spelling.el" (17713
+;;;;;;  2485))
 ;;; Generated autoloads from erc/erc-spelling.el
  (autoload 'erc-spelling-mode "erc-spelling" nil t)
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-stamp" "erc/erc-stamp.el" (17504 41540))
+;;;### (autoloads nil "erc-stamp" "erc/erc-stamp.el" (17396 42169))
 ;;; Generated autoloads from erc/erc-stamp.el
  (autoload 'erc-timestamp-mode "erc-stamp" nil t)
 
 ;;;***
 \f
-;;;### (autoloads nil "erc-track" "erc/erc-track.el" (17592 59703))
+;;;### (autoloads nil "erc-track" "erc/erc-track.el" (17778 50473))
 ;;; Generated autoloads from erc/erc-track.el
  (autoload 'erc-track-mode "erc-track" nil t)
  (autoload 'erc-track-when-inactive-mode "erc-track" nil t)
@@ -9525,7 +9526,7 @@ This will add a speedbar major display mode.
 ;;;***
 \f
 ;;;### (autoloads (erc-truncate-buffer erc-truncate-buffer-to-size)
-;;;;;;  "erc-truncate" "erc/erc-truncate.el" (17746 34861))
+;;;;;;  "erc-truncate" "erc/erc-truncate.el" (17778 50473))
 ;;; Generated autoloads from erc/erc-truncate.el
  (autoload 'erc-truncate-mode "erc-truncate" nil t)
 
@@ -9545,7 +9546,7 @@ Meant to be used in hooks, like `erc-insert-post-hook'.
 ;;;***
 \f
 ;;;### (autoloads (erc-xdcc-add-file) "erc-xdcc" "erc/erc-xdcc.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17396 42158))
 ;;; Generated autoloads from erc/erc-xdcc.el
 
 (autoload (quote erc-xdcc-add-file) "erc-xdcc" "\
@@ -9555,8 +9556,8 @@ Add a file to `erc-xdcc-files'.
 
 ;;;***
 \f
-;;;### (autoloads (eshell-mode) "esh-mode" "eshell/esh-mode.el" (17504
-;;;;;;  41540))
+;;;### (autoloads (eshell-mode) "esh-mode" "eshell/esh-mode.el" (17390
+;;;;;;  26939))
 ;;; Generated autoloads from eshell/esh-mode.el
 
 (autoload (quote eshell-mode) "esh-mode" "\
@@ -9568,8 +9569,8 @@ Emacs shell interactive mode.
 
 ;;;***
 \f
-;;;### (autoloads (eshell-test) "esh-test" "eshell/esh-test.el" (17504
-;;;;;;  41540))
+;;;### (autoloads (eshell-test) "esh-test" "eshell/esh-test.el" (17390
+;;;;;;  26939))
 ;;; Generated autoloads from eshell/esh-test.el
 
 (autoload (quote eshell-test) "esh-test" "\
@@ -9580,7 +9581,7 @@ Test Eshell to verify that it works as expected.
 ;;;***
 \f
 ;;;### (autoloads (eshell-report-bug eshell-command-result eshell-command
-;;;;;;  eshell) "eshell" "eshell/eshell.el" (17504 41540))
+;;;;;;  eshell) "eshell" "eshell/eshell.el" (17427 42815))
 ;;; Generated autoloads from eshell/eshell.el
 
 (autoload (quote eshell) "eshell" "\
@@ -9626,7 +9627,7 @@ Please include any configuration details that might be involved.
 ;;;;;;  visit-tags-table tags-table-mode find-tag-default-function
 ;;;;;;  find-tag-hook tags-add-tables tags-compression-info-list
 ;;;;;;  tags-table-list tags-case-fold-search) "etags" "progmodes/etags.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17411 11766))
 ;;; Generated autoloads from progmodes/etags.el
 
 (defvar tags-file-name nil "\
@@ -9641,7 +9642,7 @@ Use the `etags' program to make a tags table file.")
 A value of t means case-insensitive, a value of nil means case-sensitive.
 Any other value means use the setting of `case-fold-search'.")
 
-(custom-autoload (quote tags-case-fold-search) "etags" t)
+(custom-autoload (quote tags-case-fold-search) "etags")
 
 (defvar tags-table-list nil "\
 *List of file names of tags tables to search.
@@ -9650,7 +9651,7 @@ To switch to a new list of tags tables, setting this variable is sufficient.
 If you set this variable, do not also set `tags-file-name'.
 Use the `etags' program to make a tags table file.")
 
-(custom-autoload (quote tags-table-list) "etags" t)
+(custom-autoload (quote tags-table-list) "etags")
 
 (defvar tags-compression-info-list (quote ("" ".Z" ".bz2" ".gz" ".tgz")) "\
 *List of extensions tried by etags when jka-compr is used.
@@ -9659,7 +9660,7 @@ These extensions will be tried only if jka-compr was activated
 \(i.e. via customize of `auto-compression-mode' or by calling the function
 `auto-compression-mode').")
 
-(custom-autoload (quote tags-compression-info-list) "etags" t)
+(custom-autoload (quote tags-compression-info-list) "etags")
 
 (defvar tags-add-tables (quote ask-user) "\
 *Control whether to add a new tags table to the current list.
@@ -9667,14 +9668,14 @@ t means do; nil means don't (always start a new list).
 Any other value means ask the user whether to add a new tags table
 to the current list (as opposed to starting a new list).")
 
-(custom-autoload (quote tags-add-tables) "etags" t)
+(custom-autoload (quote tags-add-tables) "etags")
 
 (defvar find-tag-hook nil "\
 *Hook to be run by \\[find-tag] after finding a tag.  See `run-hooks'.
 The value in the buffer in which \\[find-tag] is done is used,
 not the value in the buffer \\[find-tag] goes to.")
 
-(custom-autoload (quote find-tag-hook) "etags" t)
+(custom-autoload (quote find-tag-hook) "etags")
 
 (defvar find-tag-default-function nil "\
 *A function of no arguments used by \\[find-tag] to pick a default tag.
@@ -9682,7 +9683,7 @@ If nil, and the symbol that is the value of `major-mode'
 has a `find-tag-default-function' property (see `put'), that is used.
 Otherwise, `find-tag-default' is used.")
 
-(custom-autoload (quote find-tag-default-function) "etags" t)
+(custom-autoload (quote find-tag-default-function) "etags")
 
 (autoload (quote tags-table-mode) "etags" "\
 Major mode for tags table file buffers.
@@ -9928,7 +9929,7 @@ for \\[find-tag] (which see).
 ;;;;;;  ethio-fidel-to-sera-buffer ethio-fidel-to-sera-region ethio-sera-to-fidel-marker
 ;;;;;;  ethio-sera-to-fidel-mail ethio-sera-to-fidel-mail-or-marker
 ;;;;;;  ethio-sera-to-fidel-buffer ethio-sera-to-fidel-region setup-ethiopic-environment-internal)
-;;;;;;  "ethio-util" "language/ethio-util.el" (17557 12727))
+;;;;;;  "ethio-util" "language/ethio-util.el" (17549 5052))
 ;;; Generated autoloads from language/ethio-util.el
 
 (autoload (quote setup-ethiopic-environment-internal) "ethio-util" "\
@@ -10123,7 +10124,7 @@ Transcribe Ethiopic characters in ASCII depending on the file extension.
 \f
 ;;;### (autoloads (eudc-load-eudc eudc-query-form eudc-expand-inline
 ;;;;;;  eudc-get-phone eudc-get-email eudc-set-server) "eudc" "net/eudc.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 26944))
 ;;; Generated autoloads from net/eudc.el
 
 (autoload (quote eudc-set-server) "eudc" "\
@@ -10179,7 +10180,7 @@ This does nothing except loading eudc by autoload side-effect.
 \f
 ;;;### (autoloads (eudc-display-jpeg-as-button eudc-display-jpeg-inline
 ;;;;;;  eudc-display-sound eudc-display-mail eudc-display-url eudc-display-generic-binary)
-;;;;;;  "eudc-bob" "net/eudc-bob.el" (17504 41540))
+;;;;;;  "eudc-bob" "net/eudc-bob.el" (17390 26944))
 ;;; Generated autoloads from net/eudc-bob.el
 
 (autoload (quote eudc-display-generic-binary) "eudc-bob" "\
@@ -10215,7 +10216,7 @@ Display a button for the JPEG DATA.
 ;;;***
 \f
 ;;;### (autoloads (eudc-try-bbdb-insert eudc-insert-record-at-point-into-bbdb)
-;;;;;;  "eudc-export" "net/eudc-export.el" (17504 41540))
+;;;;;;  "eudc-export" "net/eudc-export.el" (17390 26944))
 ;;; Generated autoloads from net/eudc-export.el
 
 (autoload (quote eudc-insert-record-at-point-into-bbdb) "eudc-export" "\
@@ -10232,7 +10233,7 @@ Call `eudc-insert-record-at-point-into-bbdb' if on a record.
 ;;;***
 \f
 ;;;### (autoloads (eudc-edit-hotlist) "eudc-hotlist" "net/eudc-hotlist.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 26944))
 ;;; Generated autoloads from net/eudc-hotlist.el
 
 (autoload (quote eudc-edit-hotlist) "eudc-hotlist" "\
@@ -10242,8 +10243,8 @@ Edit the hotlist of directory servers in a specialized buffer.
 
 ;;;***
 \f
-;;;### (autoloads (ewoc-create) "ewoc" "emacs-lisp/ewoc.el" (17541
-;;;;;;  35103))
+;;;### (autoloads (ewoc-create) "ewoc" "emacs-lisp/ewoc.el" (17549
+;;;;;;  4607))
 ;;; Generated autoloads from emacs-lisp/ewoc.el
 
 (autoload (quote ewoc-create) "ewoc" "\
@@ -10272,7 +10273,7 @@ fourth arg NOSEP non-nil inhibits this.
 ;;;### (autoloads (executable-make-buffer-file-executable-if-script-p
 ;;;;;;  executable-self-display executable-set-magic executable-interpret
 ;;;;;;  executable-command-find-posix-p) "executable" "progmodes/executable.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 27408))
 ;;; Generated autoloads from progmodes/executable.el
 
 (autoload (quote executable-command-find-posix-p) "executable" "\
@@ -10314,7 +10315,7 @@ file modes.
 ;;;***
 \f
 ;;;### (autoloads (expand-jump-to-next-slot expand-jump-to-previous-slot
-;;;;;;  expand-add-abbrevs) "expand" "expand.el" (17746 34860))
+;;;;;;  expand-add-abbrevs) "expand" "expand.el" (17778 50473))
 ;;; Generated autoloads from expand.el
 
 (autoload (quote expand-add-abbrevs) "expand" "\
@@ -10357,7 +10358,7 @@ This is used only in conjunction with `expand-add-abbrevs'.
 
 ;;;***
 \f
-;;;### (autoloads (f90-mode) "f90" "progmodes/f90.el" (17759 28873))
+;;;### (autoloads (f90-mode) "f90" "progmodes/f90.el" (17778 50475))
 ;;; Generated autoloads from progmodes/f90.el
 
 (autoload (quote f90-mode) "f90" "\
@@ -10424,7 +10425,7 @@ with no args, if that value is non-nil.
 ;;;;;;  facemenu-remove-all facemenu-remove-face-props facemenu-set-read-only
 ;;;;;;  facemenu-set-intangible facemenu-set-invisible facemenu-set-face-from-menu
 ;;;;;;  facemenu-set-background facemenu-set-foreground facemenu-set-face)
-;;;;;;  "facemenu" "facemenu.el" (17718 30634))
+;;;;;;  "facemenu" "facemenu.el" (17778 50473))
 ;;; Generated autoloads from facemenu.el
  (define-key global-map "\M-o" 'facemenu-keymap)
  (autoload 'facemenu-keymap "facemenu" "Keymap for face-changing commands." t 'keymap)
@@ -10591,9 +10592,49 @@ argument BUFFER-NAME is nil, it defaults to *Colors*.
 
 ;;;***
 \f
+;;;### (autoloads (turn-on-fast-lock fast-lock-mode) "fast-lock"
+;;;;;;  "obsolete/fast-lock.el" (17713 5990))
+;;; Generated autoloads from obsolete/fast-lock.el
+
+(autoload (quote fast-lock-mode) "fast-lock" "\
+Toggle Fast Lock mode.
+With arg, turn Fast Lock mode on if and only if arg is positive and the buffer
+is associated with a file.  Enable it automatically in your `~/.emacs' by:
+
+ (setq font-lock-support-mode 'fast-lock-mode)
+
+If Fast Lock mode is enabled, and the current buffer does not contain any text
+properties, any associated Font Lock cache is used if its timestamp matches the
+buffer's file, and its `font-lock-keywords' match those that you are using.
+
+Font Lock caches may be saved:
+- When you save the file's buffer.
+- When you kill an unmodified file's buffer.
+- When you exit Emacs, for all unmodified or saved buffers.
+Depending on the value of `fast-lock-save-events'.
+See also the commands `fast-lock-read-cache' and `fast-lock-save-cache'.
+
+Use \\[font-lock-fontify-buffer] to fontify the buffer if the cache is bad.
+
+Various methods of control are provided for the Font Lock cache.  In general,
+see variable `fast-lock-cache-directories' and function `fast-lock-cache-name'.
+For saving, see variables `fast-lock-minimum-size', `fast-lock-save-events',
+`fast-lock-save-others' and `fast-lock-save-faces'.
+
+\(fn &optional ARG)" t nil)
+
+(autoload (quote turn-on-fast-lock) "fast-lock" "\
+Unconditionally turn on Fast Lock mode.
+
+\(fn)" nil nil)
+
+(when (fboundp (quote add-minor-mode)) (defvar fast-lock-mode nil) (add-minor-mode (quote fast-lock-mode) nil))
+
+;;;***
+\f
 ;;;### (autoloads (feedmail-queue-reminder feedmail-run-the-queue
 ;;;;;;  feedmail-run-the-queue-global-prompt feedmail-run-the-queue-no-prompts
-;;;;;;  feedmail-send-it) "feedmail" "mail/feedmail.el" (17746 34862))
+;;;;;;  feedmail-send-it) "feedmail" "mail/feedmail.el" (17778 50475))
 ;;; Generated autoloads from mail/feedmail.el
 
 (autoload (quote feedmail-send-it) "feedmail" "\
@@ -10647,7 +10688,7 @@ you can set `feedmail-queue-reminder-alist' to nil.
 ;;;***
 \f
 ;;;### (autoloads (ffap-bindings dired-at-point ffap-at-mouse ffap-menu
-;;;;;;  find-file-at-point ffap-next) "ffap" "ffap.el" (17746 34860))
+;;;;;;  find-file-at-point ffap-next) "ffap" "ffap.el" (17778 50473))
 ;;; Generated autoloads from ffap.el
 
 (autoload (quote ffap-next) "ffap" "\
@@ -10706,7 +10747,7 @@ Evaluate the forms in variable `ffap-bindings'.
 ;;;### (autoloads (file-cache-minibuffer-complete file-cache-add-directory-recursively
 ;;;;;;  file-cache-add-directory-using-locate file-cache-add-directory-using-find
 ;;;;;;  file-cache-add-file file-cache-add-directory-list file-cache-add-directory)
-;;;;;;  "filecache" "filecache.el" (17669 35274))
+;;;;;;  "filecache" "filecache.el" (17713 5989))
 ;;; Generated autoloads from filecache.el
 
 (autoload (quote file-cache-add-directory) "filecache" "\
@@ -10765,8 +10806,8 @@ the name is considered already unique; only the second substitution
 
 ;;;***
 \f
-;;;### (autoloads (filesets-init) "filesets" "filesets.el" (17715
-;;;;;;  55644))
+;;;### (autoloads (filesets-init) "filesets" "filesets.el" (17778
+;;;;;;  48448))
 ;;; Generated autoloads from filesets.el
 
 (autoload (quote filesets-init) "filesets" "\
@@ -10777,7 +10818,7 @@ Set up hooks, load the cache file -- if existing -- and build the menu.
 
 ;;;***
 \f
-;;;### (autoloads nil "fill" "textmodes/fill.el" (17746 34862))
+;;;### (autoloads nil "fill" "textmodes/fill.el" (17778 50479))
 ;;; Generated autoloads from textmodes/fill.el
 (put 'colon-double-space 'safe-local-variable 'booleanp)
 
@@ -10785,7 +10826,7 @@ Set up hooks, load the cache file -- if existing -- and build the menu.
 \f
 ;;;### (autoloads (find-grep-dired find-name-dired find-dired find-grep-options
 ;;;;;;  find-ls-subdir-switches find-ls-option) "find-dired" "find-dired.el"
-;;;;;;  (17652 14941))
+;;;;;;  (17713 5989))
 ;;; Generated autoloads from find-dired.el
 
 (defvar find-ls-option (if (eq system-type (quote berkeley-unix)) (quote ("-ls" . "-gilsb")) (quote ("-exec ls -ld {} \\;" . "-ld"))) "\
@@ -10846,7 +10887,7 @@ Thus ARG can also contain additional grep options.
 \f
 ;;;### (autoloads (ff-mouse-find-other-file-other-window ff-mouse-find-other-file
 ;;;;;;  ff-find-other-file ff-get-other-file) "find-file" "find-file.el"
-;;;;;;  (17595 2870))
+;;;;;;  (17611 8432))
 ;;; Generated autoloads from find-file.el
 
 (defvar ff-special-constructs (quote (("^#\\s *\\(include\\|import\\)\\s +[<\"]\\(.*\\)[>\"]" lambda nil (buffer-substring (match-beginning 2) (match-end 2))))) "\
@@ -10940,7 +10981,7 @@ Visit the file you click on in another window.
 ;;;;;;  find-variable find-variable-noselect find-function-other-frame
 ;;;;;;  find-function-other-window find-function find-function-noselect
 ;;;;;;  find-function-search-for-symbol find-library) "find-func"
-;;;;;;  "emacs-lisp/find-func.el" (17746 34861))
+;;;;;;  "emacs-lisp/find-func.el" (17778 50473))
 ;;; Generated autoloads from emacs-lisp/find-func.el
 
 (autoload (quote find-library) "find-func" "\
@@ -11094,7 +11135,7 @@ Define some key bindings for the find-function family of functions.
 ;;;***
 \f
 ;;;### (autoloads (find-lisp-find-dired-filter find-lisp-find-dired-subdirectories
-;;;;;;  find-lisp-find-dired) "find-lisp" "find-lisp.el" (17504 41540))
+;;;;;;  find-lisp-find-dired) "find-lisp" "find-lisp.el" (17396 42165))
 ;;; Generated autoloads from find-lisp.el
 
 (autoload (quote find-lisp-find-dired) "find-lisp" "\
@@ -11115,7 +11156,7 @@ Change the filter on a find-lisp-find-dired buffer to REGEXP.
 ;;;***
 \f
 ;;;### (autoloads (finder-by-keyword finder-commentary finder-list-keywords)
-;;;;;;  "finder" "finder.el" (17504 41540))
+;;;;;;  "finder" "finder.el" (17469 12047))
 ;;; Generated autoloads from finder.el
 
 (autoload (quote finder-list-keywords) "finder" "\
@@ -11137,7 +11178,7 @@ Find packages matching a given keyword.
 ;;;***
 \f
 ;;;### (autoloads (enable-flow-control-on enable-flow-control) "flow-ctrl"
-;;;;;;  "flow-ctrl.el" (17504 41540))
+;;;;;;  "flow-ctrl.el" (17390 26939))
 ;;; Generated autoloads from flow-ctrl.el
 
 (autoload (quote enable-flow-control) "flow-ctrl" "\
@@ -11159,7 +11200,7 @@ to get the effect of a C-q.
 ;;;***
 \f
 ;;;### (autoloads (fill-flowed fill-flowed-encode) "flow-fill" "gnus/flow-fill.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17478 25198))
 ;;; Generated autoloads from gnus/flow-fill.el
 
 (autoload (quote fill-flowed-encode) "flow-fill" "\
@@ -11175,7 +11216,7 @@ Not documented
 ;;;***
 \f
 ;;;### (autoloads (flymake-mode-off flymake-mode-on flymake-mode)
-;;;;;;  "flymake" "progmodes/flymake.el" (17715 55646))
+;;;;;;  "flymake" "progmodes/flymake.el" (17778 50475))
 ;;; Generated autoloads from progmodes/flymake.el
 
 (autoload (quote flymake-mode) "flymake" "\
@@ -11199,7 +11240,7 @@ Turn flymake mode off.
 \f
 ;;;### (autoloads (flyspell-buffer flyspell-region flyspell-mode-off
 ;;;;;;  turn-off-flyspell turn-on-flyspell flyspell-mode flyspell-prog-mode)
-;;;;;;  "flyspell" "textmodes/flyspell.el" (17759 28874))
+;;;;;;  "flyspell" "textmodes/flyspell.el" (17778 50479))
 ;;; Generated autoloads from textmodes/flyspell.el
 
 (autoload (quote flyspell-prog-mode) "flyspell" "\
@@ -11268,7 +11309,7 @@ Flyspell whole buffer.
 \f
 ;;;### (autoloads (follow-delete-other-windows-and-split follow-mode
 ;;;;;;  turn-off-follow-mode turn-on-follow-mode) "follow" "follow.el"
-;;;;;;  (17746 34860))
+;;;;;;  (17778 50473))
 ;;; Generated autoloads from follow.el
 
 (autoload (quote turn-on-follow-mode) "follow" "\
@@ -11342,8 +11383,8 @@ in your `~/.emacs' file, replacing [f7] by your favourite key:
 
 ;;;***
 \f
-;;;### (autoloads (footnote-mode) "footnote" "mail/footnote.el" (17504
-;;;;;;  41540))
+;;;### (autoloads (footnote-mode) "footnote" "mail/footnote.el" (17390
+;;;;;;  26942))
 ;;; Generated autoloads from mail/footnote.el
 
 (autoload (quote footnote-mode) "footnote" "\
@@ -11364,7 +11405,7 @@ key             binding
 ;;;***
 \f
 ;;;### (autoloads (forms-find-file-other-window forms-find-file forms-mode)
-;;;;;;  "forms" "forms.el" (17504 41540))
+;;;;;;  "forms" "forms.el" (17390 26939))
 ;;; Generated autoloads from forms.el
 
 (autoload (quote forms-mode) "forms" "\
@@ -11401,7 +11442,7 @@ Visit a file in Forms mode in other window.
 ;;;***
 \f
 ;;;### (autoloads (fortran-mode fortran-tab-mode-default) "fortran"
-;;;;;;  "progmodes/fortran.el" (17658 57872))
+;;;;;;  "progmodes/fortran.el" (17778 50475))
 ;;; Generated autoloads from progmodes/fortran.el
 
 (defvar fortran-tab-mode-default nil "\
@@ -11487,7 +11528,7 @@ with no args, if that value is non-nil.
 ;;;***
 \f
 ;;;### (autoloads (fortune fortune-to-signature fortune-compile fortune-from-region
-;;;;;;  fortune-add-fortune) "fortune" "play/fortune.el" (17504 41540))
+;;;;;;  fortune-add-fortune) "fortune" "play/fortune.el" (17383 38807))
 ;;; Generated autoloads from play/fortune.el
 
 (autoload (quote fortune-add-fortune) "fortune" "\
@@ -11537,7 +11578,7 @@ and choose the directory as the fortune-file.
 ;;;***
 \f
 ;;;### (autoloads (gdb-enable-debug gdba) "gdb-ui" "progmodes/gdb-ui.el"
-;;;;;;  (17759 28873))
+;;;;;;  (17778 50475))
 ;;; Generated autoloads from progmodes/gdb-ui.el
 
 (autoload (quote gdba) "gdb-ui" "\
@@ -11600,8 +11641,8 @@ Non-nil means record the process input and output in `gdb-debug-ring'.")
 ;;;***
 \f
 ;;;### (autoloads (generic-make-keywords-list generic-mode generic-mode-internal
-;;;;;;  define-generic-mode) "generic" "emacs-lisp/generic.el" (17504
-;;;;;;  41540))
+;;;;;;  define-generic-mode) "generic" "emacs-lisp/generic.el" (17390
+;;;;;;  26938))
 ;;; Generated autoloads from emacs-lisp/generic.el
 
 (defvar generic-mode-list nil "\
@@ -11676,7 +11717,7 @@ regular expression that can be used as an element of
 ;;;***
 \f
 ;;;### (autoloads (glasses-mode) "glasses" "progmodes/glasses.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17778 50476))
 ;;; Generated autoloads from progmodes/glasses.el
 
 (autoload (quote glasses-mode) "glasses" "\
@@ -11689,7 +11730,7 @@ at places they belong to.
 ;;;***
 \f
 ;;;### (autoloads (gmm-tool-bar-from-list gmm-widget-p gmm-error
-;;;;;;  gmm-message) "gmm-utils" "gnus/gmm-utils.el" (17715 55645))
+;;;;;;  gmm-message) "gmm-utils" "gnus/gmm-utils.el" (17778 48450))
 ;;; Generated autoloads from gnus/gmm-utils.el
 
 (autoload (quote gmm-message) "gmm-utils" "\
@@ -11736,7 +11777,7 @@ DEFAULT-MAP specifies the default key map for ICON-LIST.
 ;;;***
 \f
 ;;;### (autoloads (gnus gnus-other-frame gnus-slave gnus-no-server
-;;;;;;  gnus-slave-no-server) "gnus" "gnus/gnus.el" (17759 28869))
+;;;;;;  gnus-slave-no-server) "gnus" "gnus/gnus.el" (17778 50473))
 ;;; Generated autoloads from gnus/gnus.el
 (when (fboundp 'custom-autoload)
  (custom-autoload 'gnus-select-method "gnus"))
@@ -11789,7 +11830,7 @@ prompt the user for the name of an NNTP server to use.
 ;;;;;;  gnus-agent-get-undownloaded-list gnus-agent-delete-group
 ;;;;;;  gnus-agent-rename-group gnus-agent-possibly-save-gcc gnus-agentize
 ;;;;;;  gnus-slave-unplugged gnus-plugged gnus-unplugged) "gnus-agent"
-;;;;;;  "gnus/gnus-agent.el" (17732 62702))
+;;;;;;  "gnus/gnus-agent.el" (17778 50473))
 ;;; Generated autoloads from gnus/gnus-agent.el
 
 (autoload (quote gnus-unplugged) "gnus-agent" "\
@@ -11880,7 +11921,7 @@ If CLEAN, obsolete (ignore).
 ;;;***
 \f
 ;;;### (autoloads (gnus-article-prepare-display) "gnus-art" "gnus/gnus-art.el"
-;;;;;;  (17746 34861))
+;;;;;;  (17778 50473))
 ;;; Generated autoloads from gnus/gnus-art.el
 
 (autoload (quote gnus-article-prepare-display) "gnus-art" "\
@@ -11891,7 +11932,7 @@ Make the current buffer look like a nice article.
 ;;;***
 \f
 ;;;### (autoloads (gnus-audio-play) "gnus-audio" "gnus/gnus-audio.el"
-;;;;;;  (17686 35982))
+;;;;;;  (17383 38805))
 ;;; Generated autoloads from gnus/gnus-audio.el
 
 (autoload (quote gnus-audio-play) "gnus-audio" "\
@@ -11903,8 +11944,8 @@ Play a sound FILE through the speaker.
 \f
 ;;;### (autoloads (gnus-cache-delete-group gnus-cache-rename-group
 ;;;;;;  gnus-cache-generate-nov-databases gnus-cache-generate-active
-;;;;;;  gnus-jog-cache) "gnus-cache" "gnus/gnus-cache.el" (17686
-;;;;;;  35982))
+;;;;;;  gnus-jog-cache) "gnus-cache" "gnus/gnus-cache.el" (17383
+;;;;;;  38805))
 ;;; Generated autoloads from gnus/gnus-cache.el
 
 (autoload (quote gnus-jog-cache) "gnus-cache" "\
@@ -11946,7 +11987,7 @@ supported.
 ;;;***
 \f
 ;;;### (autoloads (gnus-delay-initialize gnus-delay-send-queue gnus-delay-article)
-;;;;;;  "gnus-delay" "gnus/gnus-delay.el" (17686 35982))
+;;;;;;  "gnus-delay" "gnus/gnus-delay.el" (17383 38805))
 ;;; Generated autoloads from gnus/gnus-delay.el
 
 (autoload (quote gnus-delay-article) "gnus-delay" "\
@@ -11982,7 +12023,7 @@ Checking delayed messages is skipped if optional arg NO-CHECK is non-nil.
 ;;;***
 \f
 ;;;### (autoloads (gnus-user-format-function-D gnus-user-format-function-d)
-;;;;;;  "gnus-diary" "gnus/gnus-diary.el" (17746 34861))
+;;;;;;  "gnus-diary" "gnus/gnus-diary.el" (17778 50473))
 ;;; Generated autoloads from gnus/gnus-diary.el
 
 (autoload (quote gnus-user-format-function-d) "gnus-diary" "\
@@ -11998,7 +12039,7 @@ Not documented
 ;;;***
 \f
 ;;;### (autoloads (turn-on-gnus-dired-mode) "gnus-dired" "gnus/gnus-dired.el"
-;;;;;;  (17686 35982))
+;;;;;;  (17383 38805))
 ;;; Generated autoloads from gnus/gnus-dired.el
 
 (autoload (quote turn-on-gnus-dired-mode) "gnus-dired" "\
@@ -12009,7 +12050,7 @@ Convenience method to turn on gnus-dired-mode.
 ;;;***
 \f
 ;;;### (autoloads (gnus-draft-reminder) "gnus-draft" "gnus/gnus-draft.el"
-;;;;;;  (17701 49519))
+;;;;;;  (17713 5989))
 ;;; Generated autoloads from gnus/gnus-draft.el
 
 (autoload (quote gnus-draft-reminder) "gnus-draft" "\
@@ -12021,8 +12062,8 @@ Reminder user if there are unsent drafts.
 \f
 ;;;### (autoloads (gnus-convert-png-to-face gnus-convert-face-to-png
 ;;;;;;  gnus-face-from-file gnus-x-face-from-file gnus-insert-random-x-face-header
-;;;;;;  gnus-random-x-face) "gnus-fun" "gnus/gnus-fun.el" (17686
-;;;;;;  35982))
+;;;;;;  gnus-random-x-face) "gnus-fun" "gnus/gnus-fun.el" (17466
+;;;;;;  28574))
 ;;; Generated autoloads from gnus/gnus-fun.el
 
 (autoload (quote gnus-random-x-face) "gnus-fun" "\
@@ -12061,7 +12102,7 @@ FILE should be a PNG file that's 48x48 and smaller than or equal to
 ;;;***
 \f
 ;;;### (autoloads (gnus-fetch-group-other-frame gnus-fetch-group)
-;;;;;;  "gnus-group" "gnus/gnus-group.el" (17731 48936))
+;;;;;;  "gnus-group" "gnus/gnus-group.el" (17778 50473))
 ;;; Generated autoloads from gnus/gnus-group.el
 
 (autoload (quote gnus-fetch-group) "gnus-group" "\
@@ -12078,7 +12119,7 @@ Pop up a frame and enter GROUP.
 ;;;***
 \f
 ;;;### (autoloads (gnus-batch-score) "gnus-kill" "gnus/gnus-kill.el"
-;;;;;;  (17686 35982))
+;;;;;;  (17383 38805))
 ;;; Generated autoloads from gnus/gnus-kill.el
 
 (defalias (quote gnus-batch-kill) (quote gnus-batch-score))
@@ -12093,7 +12134,7 @@ Usage: emacs -batch -l ~/.emacs -l gnus -f gnus-batch-score
 \f
 ;;;### (autoloads (gnus-mailing-list-mode gnus-mailing-list-insinuate
 ;;;;;;  turn-on-gnus-mailing-list-mode) "gnus-ml" "gnus/gnus-ml.el"
-;;;;;;  (17686 35982))
+;;;;;;  (17549 5046))
 ;;; Generated autoloads from gnus/gnus-ml.el
 
 (autoload (quote turn-on-gnus-mailing-list-mode) "gnus-ml" "\
@@ -12118,7 +12159,7 @@ Minor mode for providing mailing-list commands.
 \f
 ;;;### (autoloads (gnus-group-split-fancy gnus-group-split gnus-group-split-update
 ;;;;;;  gnus-group-split-setup) "gnus-mlspl" "gnus/gnus-mlspl.el"
-;;;;;;  (17686 35982))
+;;;;;;  (17383 38805))
 ;;; Generated autoloads from gnus/gnus-mlspl.el
 
 (autoload (quote gnus-group-split-setup) "gnus-mlspl" "\
@@ -12219,7 +12260,7 @@ Calling (gnus-group-split-fancy nil nil \"mail.others\") returns:
 ;;;***
 \f
 ;;;### (autoloads (gnus-change-server) "gnus-move" "gnus/gnus-move.el"
-;;;;;;  (17686 35982))
+;;;;;;  (17383 38805))
 ;;; Generated autoloads from gnus/gnus-move.el
 
 (autoload (quote gnus-change-server) "gnus-move" "\
@@ -12231,7 +12272,7 @@ Update the .newsrc.eld file to reflect the change of nntp server.
 ;;;***
 \f
 ;;;### (autoloads (gnus-button-reply gnus-button-mailto gnus-msg-mail)
-;;;;;;  "gnus-msg" "gnus/gnus-msg.el" (17686 35982))
+;;;;;;  "gnus-msg" "gnus/gnus-msg.el" (17383 38805))
 ;;; Generated autoloads from gnus/gnus-msg.el
 
 (autoload (quote gnus-msg-mail) "gnus-msg" "\
@@ -12256,7 +12297,7 @@ Like `message-reply'.
 ;;;***
 \f
 ;;;### (autoloads (gnus-nocem-load-cache gnus-nocem-scan-groups)
-;;;;;;  "gnus-nocem" "gnus/gnus-nocem.el" (17686 35982))
+;;;;;;  "gnus-nocem" "gnus/gnus-nocem.el" (17427 41288))
 ;;; Generated autoloads from gnus/gnus-nocem.el
 
 (autoload (quote gnus-nocem-scan-groups) "gnus-nocem" "\
@@ -12273,7 +12314,7 @@ Load the NoCeM cache.
 \f
 ;;;### (autoloads (gnus-treat-newsgroups-picon gnus-treat-mail-picon
 ;;;;;;  gnus-treat-from-picon) "gnus-picon" "gnus/gnus-picon.el"
-;;;;;;  (17686 35982))
+;;;;;;  (17383 38805))
 ;;; Generated autoloads from gnus/gnus-picon.el
 
 (autoload (quote gnus-treat-from-picon) "gnus-picon" "\
@@ -12300,7 +12341,7 @@ If picons are already displayed, remove them.
 ;;;;;;  gnus-sorted-nintersection gnus-sorted-range-intersection
 ;;;;;;  gnus-sorted-intersection gnus-intersection gnus-sorted-complement
 ;;;;;;  gnus-sorted-ndifference gnus-sorted-difference) "gnus-range"
-;;;;;;  "gnus/gnus-range.el" (17686 35982))
+;;;;;;  "gnus/gnus-range.el" (17383 38805))
 ;;; Generated autoloads from gnus/gnus-range.el
 
 (autoload (quote gnus-sorted-difference) "gnus-range" "\
@@ -12368,7 +12409,7 @@ Add NUM into sorted LIST by side effect.
 ;;;***
 \f
 ;;;### (autoloads (gnus-registry-install-hooks gnus-registry-initialize)
-;;;;;;  "gnus-registry" "gnus/gnus-registry.el" (17703 53657))
+;;;;;;  "gnus-registry" "gnus/gnus-registry.el" (17713 5990))
 ;;; Generated autoloads from gnus/gnus-registry.el
 
 (autoload (quote gnus-registry-initialize) "gnus-registry" "\
@@ -12384,8 +12425,8 @@ Install the registry hooks.
 ;;;***
 \f
 ;;;### (autoloads (gnus-sieve-article-add-rule gnus-sieve-generate
-;;;;;;  gnus-sieve-update) "gnus-sieve" "gnus/gnus-sieve.el" (17686
-;;;;;;  35982))
+;;;;;;  gnus-sieve-update) "gnus-sieve" "gnus/gnus-sieve.el" (17469
+;;;;;;  13458))
 ;;; Generated autoloads from gnus/gnus-sieve.el
 
 (autoload (quote gnus-sieve-update) "gnus-sieve" "\
@@ -12413,7 +12454,7 @@ Not documented
 ;;;***
 \f
 ;;;### (autoloads (gnus-batch-brew-soup) "gnus-soup" "gnus/gnus-soup.el"
-;;;;;;  (17686 35982))
+;;;;;;  (17383 38805))
 ;;; Generated autoloads from gnus/gnus-soup.el
 
 (autoload (quote gnus-batch-brew-soup) "gnus-soup" "\
@@ -12433,7 +12474,7 @@ Note -- this function hasn't been implemented yet.
 ;;;***
 \f
 ;;;### (autoloads (gnus-update-format) "gnus-spec" "gnus/gnus-spec.el"
-;;;;;;  (17686 35982))
+;;;;;;  (17383 38805))
 ;;; Generated autoloads from gnus/gnus-spec.el
 
 (autoload (quote gnus-update-format) "gnus-spec" "\
@@ -12444,8 +12485,8 @@ Update the format specification near point.
 ;;;***
 \f
 ;;;### (autoloads (gnus-fixup-nnimap-unread-after-getting-new-news
-;;;;;;  gnus-declare-backend) "gnus-start" "gnus/gnus-start.el" (17686
-;;;;;;  35982))
+;;;;;;  gnus-declare-backend) "gnus-start" "gnus/gnus-start.el" (17778
+;;;;;;  50473))
 ;;; Generated autoloads from gnus/gnus-start.el
 
 (autoload (quote gnus-declare-backend) "gnus-start" "\
@@ -12461,7 +12502,7 @@ Not documented
 ;;;***
 \f
 ;;;### (autoloads (gnus-add-configuration) "gnus-win" "gnus/gnus-win.el"
-;;;;;;  (17686 35982))
+;;;;;;  (17383 38805))
 ;;; Generated autoloads from gnus/gnus-win.el
 
 (autoload (quote gnus-add-configuration) "gnus-win" "\
@@ -12471,7 +12512,7 @@ Add the window configuration CONF to `gnus-buffer-configuration'.
 
 ;;;***
 \f
-;;;### (autoloads (gomoku) "gomoku" "play/gomoku.el" (17504 41540))
+;;;### (autoloads (gomoku) "gomoku" "play/gomoku.el" (17778 50475))
 ;;; Generated autoloads from play/gomoku.el
 
 (autoload (quote gomoku) "gomoku" "\
@@ -12498,7 +12539,7 @@ Use \\[describe-mode] for more info.
 ;;;***
 \f
 ;;;### (autoloads (goto-address goto-address-at-point) "goto-addr"
-;;;;;;  "net/goto-addr.el" (17580 16976))
+;;;;;;  "net/goto-addr.el" (17591 9445))
 ;;; Generated autoloads from net/goto-addr.el
 
 (define-obsolete-function-alias (quote goto-address-at-mouse) (quote goto-address-at-point) "22.1")
@@ -12528,7 +12569,7 @@ Also fontifies the buffer appropriately (see `goto-address-fontify-p' and
 \f
 ;;;### (autoloads (rgrep lgrep grep-find grep grep-mode grep-compute-defaults
 ;;;;;;  grep-process-setup grep-setup-hook grep-find-command grep-command
-;;;;;;  grep-window-height) "grep" "progmodes/grep.el" (17645 45313))
+;;;;;;  grep-window-height) "grep" "progmodes/grep.el" (17713 5410))
 ;;; Generated autoloads from progmodes/grep.el
 
 (defvar grep-window-height nil "\
@@ -12665,7 +12706,7 @@ This command shares argument histories with \\[lgrep] and \\[grep-find].
 
 ;;;***
 \f
-;;;### (autoloads (gs-load-image) "gs" "gs.el" (17598 60524))
+;;;### (autoloads (gs-load-image) "gs" "gs.el" (17390 26939))
 ;;; Generated autoloads from gs.el
 
 (autoload (quote gs-load-image) "gs" "\
@@ -12679,7 +12720,7 @@ the form \"WINDOW-ID PIXMAP-ID\".  Value is non-nil if successful.
 ;;;***
 \f
 ;;;### (autoloads (gdb-script-mode bashdb jdb pdb perldb xdb dbx
-;;;;;;  sdb gdb) "gud" "progmodes/gud.el" (17661 56350))
+;;;;;;  sdb gdb) "gud" "progmodes/gud.el" (17778 50476))
 ;;; Generated autoloads from progmodes/gud.el
 
 (autoload (quote gdb) "gud" "\
@@ -12689,8 +12730,12 @@ directory and source-file directory for your debugger.  By
 default this command starts GDB using a graphical interface.  See
 `gdba' for more information.
 
-To run GDB in text command mode, set `gud-gdb-command-name' to
-\"gdb --fullname\" and include the pathname, if necessary.
+To run GDB in text command mode, replace the GDB \"--annotate=3\"
+option with \"--fullname\" either in the minibuffer for the
+current Emacs session, or the custom variable
+`gud-gdb-command-name' for all future sessions.  You need to use
+text command mode to debug multiple programs within one Emacs
+session.
 
 \(fn COMMAND-LINE)" t nil)
 
@@ -12735,7 +12780,7 @@ and source-file directory for your debugger.
 (autoload (quote jdb) "gud" "\
 Run jdb with command line COMMAND-LINE in a buffer.
 The buffer is named \"*gud*\" if no initial class is given or
-\"*gud-<initial-class-basename>*\" if there is.         If the \"-classpath\"
+\"*gud-<initial-class-basename>*\" if there is.  If the \"-classpath\"
 switch is given, omit all whitespace between it and its value.
 
 See `gud-jdb-use-classpath' and `gud-jdb-classpath' documentation for
@@ -12765,8 +12810,8 @@ Major mode for editing GDB scripts
 
 ;;;***
 \f
-;;;### (autoloads (handwrite) "handwrite" "play/handwrite.el" (17759
-;;;;;;  28871))
+;;;### (autoloads (handwrite) "handwrite" "play/handwrite.el" (17778
+;;;;;;  50475))
 ;;; Generated autoloads from play/handwrite.el
 
 (autoload (quote handwrite) "handwrite" "\
@@ -12784,7 +12829,7 @@ Variables: handwrite-linespace     (default 12)
 ;;;***
 \f
 ;;;### (autoloads (hanoi-unix-64 hanoi-unix hanoi) "hanoi" "play/hanoi.el"
-;;;;;;  (17746 34862))
+;;;;;;  (17778 50475))
 ;;; Generated autoloads from play/hanoi.el
 
 (autoload (quote hanoi) "hanoi" "\
@@ -12814,7 +12859,7 @@ to be updated.
 ;;;### (autoloads (scan-buf-previous-region scan-buf-next-region
 ;;;;;;  scan-buf-move-to-region help-at-pt-display-when-idle help-at-pt-set-timer
 ;;;;;;  help-at-pt-cancel-timer display-local-help help-at-pt-kbd-string
-;;;;;;  help-at-pt-string) "help-at-pt" "help-at-pt.el" (17710 3074))
+;;;;;;  help-at-pt-string) "help-at-pt" "help-at-pt.el" (17713 5990))
 ;;; Generated autoloads from help-at-pt.el
 
 (autoload (quote help-at-pt-string) "help-at-pt" "\
@@ -12944,7 +12989,7 @@ different regions.  With numeric argument ARG, behaves like
 ;;;### (autoloads (describe-categories describe-syntax describe-variable
 ;;;;;;  variable-at-point describe-function-1 describe-simplify-lib-file-name
 ;;;;;;  help-C-file-name describe-function) "help-fns" "help-fns.el"
-;;;;;;  (17736 44182))
+;;;;;;  (17778 50473))
 ;;; Generated autoloads from help-fns.el
 
 (autoload (quote describe-function) "help-fns" "\
@@ -12978,10 +13023,11 @@ If ANY-SYMBOL is non-nil, don't insist the symbol be bound.
 (autoload (quote describe-variable) "help-fns" "\
 Display the full documentation of VARIABLE (a symbol).
 Returns the documentation as a string, also.
-If VARIABLE has a buffer-local value in BUFFER (default to the current buffer),
+If VARIABLE has a buffer-local value in BUFFER or FRAME
+\(default to the current buffer and current frame),
 it is displayed along with the global value.
 
-\(fn VARIABLE &optional BUFFER)" t nil)
+\(fn VARIABLE &optional BUFFER FRAME)" t nil)
 
 (autoload (quote describe-syntax) "help-fns" "\
 Describe the syntax specifications in the syntax table of BUFFER.
@@ -13001,7 +13047,7 @@ BUFFER should be a buffer or a buffer name.
 ;;;***
 \f
 ;;;### (autoloads (three-step-help) "help-macro" "help-macro.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17778 50473))
 ;;; Generated autoloads from help-macro.el
 
 (defvar three-step-help nil "\
@@ -13017,7 +13063,7 @@ A value of nil means skip the middle step, so that
 \f
 ;;;### (autoloads (help-xref-on-pp help-insert-xref-button help-xref-button
 ;;;;;;  help-make-xrefs help-setup-xref help-mode-finish help-mode-setup
-;;;;;;  help-mode) "help-mode" "help-mode.el" (17604 18983))
+;;;;;;  help-mode) "help-mode" "help-mode.el" (17611 9183))
 ;;; Generated autoloads from help-mode.el
 
 (autoload (quote help-mode) "help-mode" "\
@@ -13100,7 +13146,7 @@ Add xrefs for symbols in `pp's output between FROM and TO.
 ;;;***
 \f
 ;;;### (autoloads (Helper-help Helper-describe-bindings) "helper"
-;;;;;;  "emacs-lisp/helper.el" (17586 63376))
+;;;;;;  "emacs-lisp/helper.el" (17591 9619))
 ;;; Generated autoloads from emacs-lisp/helper.el
 
 (autoload (quote Helper-describe-bindings) "helper" "\
@@ -13116,7 +13162,7 @@ Provide help for current mode.
 ;;;***
 \f
 ;;;### (autoloads (hexlify-buffer hexl-find-file hexl-mode) "hexl"
-;;;;;;  "hexl.el" (17746 34860))
+;;;;;;  "hexl.el" (17778 50473))
 ;;; Generated autoloads from hexl.el
 
 (autoload (quote hexl-mode) "hexl" "\
@@ -13213,7 +13259,7 @@ This discards the buffer's undo information.
 ;;;### (autoloads (hi-lock-write-interactive-patterns hi-lock-unface-buffer
 ;;;;;;  hi-lock-face-phrase-buffer hi-lock-face-buffer hi-lock-line-face-buffer
 ;;;;;;  global-hi-lock-mode hi-lock-mode) "hi-lock" "hi-lock.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 26939))
 ;;; Generated autoloads from hi-lock.el
 
 (autoload (quote hi-lock-mode) "hi-lock" "\
@@ -13266,10 +13312,11 @@ is found.  A mode is excluded if it's in the list `hi-lock-exclude-modes'.
 Non-nil if Global-Hi-Lock mode is enabled.
 See the command `global-hi-lock-mode' for a description of this minor-mode.
 Setting this variable directly does not take effect;
-either customize it (see the info node `Easy Customization')
-or call the function `global-hi-lock-mode'.")
+use either \\[customize] or the function `global-hi-lock-mode'.")
+
+(custom-autoload (quote global-hi-lock-mode) "hi-lock")
 
-(custom-autoload (quote global-hi-lock-mode) "hi-lock" nil)
+(put (quote global-hi-lock-mode) (quote custom-set) (quote custom-set-minor-mode))
 
 (autoload (quote global-hi-lock-mode) "hi-lock" "\
 Toggle Hi-Lock mode in every buffer.
@@ -13338,7 +13385,7 @@ be found in variable `hi-lock-interactive-patterns'.
 ;;;***
 \f
 ;;;### (autoloads (hide-ifdef-lines hide-ifdef-read-only hide-ifdef-initially
-;;;;;;  hide-ifdef-mode) "hideif" "progmodes/hideif.el" (17522 22309))
+;;;;;;  hide-ifdef-mode) "hideif" "progmodes/hideif.el" (17524 8597))
 ;;; Generated autoloads from progmodes/hideif.el
 
 (autoload (quote hide-ifdef-mode) "hideif" "\
@@ -13378,22 +13425,22 @@ how the hiding is done:
 (defvar hide-ifdef-initially nil "\
 *Non-nil means call `hide-ifdefs' when Hide-Ifdef mode is first activated.")
 
-(custom-autoload (quote hide-ifdef-initially) "hideif" t)
+(custom-autoload (quote hide-ifdef-initially) "hideif")
 
 (defvar hide-ifdef-read-only nil "\
 *Set to non-nil if you want buffer to be read-only while hiding text.")
 
-(custom-autoload (quote hide-ifdef-read-only) "hideif" t)
+(custom-autoload (quote hide-ifdef-read-only) "hideif")
 
 (defvar hide-ifdef-lines nil "\
 *Non-nil means hide the #ifX, #else, and #endif lines.")
 
-(custom-autoload (quote hide-ifdef-lines) "hideif" t)
+(custom-autoload (quote hide-ifdef-lines) "hideif")
 
 ;;;***
 \f
 ;;;### (autoloads (hs-minor-mode) "hideshow" "progmodes/hideshow.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17778 50476))
 ;;; Generated autoloads from progmodes/hideshow.el
 
 (defvar hs-special-modes-alist (quote ((c-mode "{" "}" "/[*/]" nil hs-c-like-adjust-block-beginning) (c++-mode "{" "}" "/[*/]" nil hs-c-like-adjust-block-beginning) (bibtex-mode ("^@\\S(*\\(\\s(\\)" 1)) (java-mode "{" "}" "/[*/]" nil hs-c-like-adjust-block-beginning))) "\
@@ -13451,7 +13498,7 @@ Key bindings:
 ;;;;;;  highlight-compare-buffers highlight-changes-rotate-faces
 ;;;;;;  highlight-changes-previous-change highlight-changes-next-change
 ;;;;;;  highlight-changes-mode highlight-changes-remove-highlight)
-;;;;;;  "hilit-chg" "hilit-chg.el" (17504 41540))
+;;;;;;  "hilit-chg" "hilit-chg.el" (17390 27370))
 ;;; Generated autoloads from hilit-chg.el
 
 (autoload (quote highlight-changes-remove-highlight) "hilit-chg" "\
@@ -13581,7 +13628,7 @@ variable `highlight-changes-global-changes-existing-buffers' is non-nil).
 ;;;;;;  hippie-expand-ignore-buffers hippie-expand-max-buffers hippie-expand-no-restriction
 ;;;;;;  hippie-expand-dabbrev-as-symbol hippie-expand-dabbrev-skip-space
 ;;;;;;  hippie-expand-verbose hippie-expand-try-functions-list) "hippie-exp"
-;;;;;;  "hippie-exp.el" (17504 41540))
+;;;;;;  "hippie-exp.el" (17390 26939))
 ;;; Generated autoloads from hippie-exp.el
 
 (defvar hippie-expand-try-functions-list (quote (try-complete-file-name-partially try-complete-file-name try-expand-all-abbrevs try-expand-list try-expand-line try-expand-dabbrev try-expand-dabbrev-all-buffers try-expand-dabbrev-from-kill try-complete-lisp-symbol-partially try-complete-lisp-symbol)) "\
@@ -13589,40 +13636,40 @@ The list of expansion functions tried in order by `hippie-expand'.
 To change the behavior of `hippie-expand', remove, change the order of,
 or insert functions in this list.")
 
-(custom-autoload (quote hippie-expand-try-functions-list) "hippie-exp" t)
+(custom-autoload (quote hippie-expand-try-functions-list) "hippie-exp")
 
 (defvar hippie-expand-verbose t "\
 *Non-nil makes `hippie-expand' output which function it is trying.")
 
-(custom-autoload (quote hippie-expand-verbose) "hippie-exp" t)
+(custom-autoload (quote hippie-expand-verbose) "hippie-exp")
 
 (defvar hippie-expand-dabbrev-skip-space nil "\
 *Non-nil means tolerate trailing spaces in the abbreviation to expand.")
 
-(custom-autoload (quote hippie-expand-dabbrev-skip-space) "hippie-exp" t)
+(custom-autoload (quote hippie-expand-dabbrev-skip-space) "hippie-exp")
 
 (defvar hippie-expand-dabbrev-as-symbol t "\
 *Non-nil means expand as symbols, i.e. syntax `_' is considered a letter.")
 
-(custom-autoload (quote hippie-expand-dabbrev-as-symbol) "hippie-exp" t)
+(custom-autoload (quote hippie-expand-dabbrev-as-symbol) "hippie-exp")
 
 (defvar hippie-expand-no-restriction t "\
 *Non-nil means that narrowed buffers are widened during search.")
 
-(custom-autoload (quote hippie-expand-no-restriction) "hippie-exp" t)
+(custom-autoload (quote hippie-expand-no-restriction) "hippie-exp")
 
 (defvar hippie-expand-max-buffers nil "\
 *The maximum number of buffers (apart from the current) searched.
 If nil, all buffers are searched.")
 
-(custom-autoload (quote hippie-expand-max-buffers) "hippie-exp" t)
+(custom-autoload (quote hippie-expand-max-buffers) "hippie-exp")
 
 (defvar hippie-expand-ignore-buffers (quote ("^ \\*.*\\*$" dired-mode)) "\
 *A list specifying which buffers not to search (if not current).
 Can contain both regexps matching buffer names (as strings) and major modes
 \(as atoms)")
 
-(custom-autoload (quote hippie-expand-ignore-buffers) "hippie-exp" t)
+(custom-autoload (quote hippie-expand-ignore-buffers) "hippie-exp")
 
 (defvar hippie-expand-only-buffers nil "\
 *A list specifying the only buffers to search (in addition to current).
@@ -13630,7 +13677,7 @@ Can contain both regexps matching buffer names (as strings) and major modes
 \(as atoms).  If non-nil, this variable overrides the variable
 `hippie-expand-ignore-buffers'.")
 
-(custom-autoload (quote hippie-expand-only-buffers) "hippie-exp" t)
+(custom-autoload (quote hippie-expand-only-buffers) "hippie-exp")
 
 (autoload (quote hippie-expand) "hippie-exp" "\
 Try to expand text before point, using multiple methods.
@@ -13654,7 +13701,7 @@ argument VERBOSE non-nil makes the function verbose.
 ;;;***
 \f
 ;;;### (autoloads (global-hl-line-mode hl-line-mode) "hl-line" "hl-line.el"
-;;;;;;  (17652 40095))
+;;;;;;  (17713 5990))
 ;;; Generated autoloads from hl-line.el
 
 (autoload (quote hl-line-mode) "hl-line" "\
@@ -13695,7 +13742,7 @@ Global-Hl-Line mode uses the functions `global-hl-line-unhighlight' and
 ;;;***
 \f
 ;;;### (autoloads (list-holidays holidays) "holidays" "calendar/holidays.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17427 42815))
 ;;; Generated autoloads from calendar/holidays.el
 
 (autoload (quote holidays) "holidays" "\
@@ -13731,8 +13778,35 @@ The optional LABEL is used to label the buffer created.
 
 ;;;***
 \f
-;;;### (autoloads (html2text) "html2text" "gnus/html2text.el" (17746
-;;;;;;  34861))
+;;;### (autoloads (hscroll-global-mode hscroll-mode turn-on-hscroll)
+;;;;;;  "hscroll" "obsolete/hscroll.el" (17383 38806))
+;;; Generated autoloads from obsolete/hscroll.el
+
+(autoload (quote turn-on-hscroll) "hscroll" "\
+This function is obsolete.
+Emacs now does hscrolling automatically, if `truncate-lines' is non-nil.
+Also see `automatic-hscrolling'.
+
+\(fn)" nil nil)
+
+(autoload (quote hscroll-mode) "hscroll" "\
+This function is obsolete.
+Emacs now does hscrolling automatically, if `truncate-lines' is non-nil.
+Also see `automatic-hscrolling'.
+
+\(fn &optional ARG)" t nil)
+
+(autoload (quote hscroll-global-mode) "hscroll" "\
+This function is obsolete.
+Emacs now does hscrolling automatically, if `truncate-lines' is non-nil.
+Also see `automatic-hscrolling'.
+
+\(fn &optional ARG)" t nil)
+
+;;;***
+\f
+;;;### (autoloads (html2text) "html2text" "gnus/html2text.el" (17778
+;;;;;;  50473))
 ;;; Generated autoloads from gnus/html2text.el
 
 (autoload (quote html2text) "html2text" "\
@@ -13764,7 +13838,7 @@ Convert HTML to plain text in the current buffer.
 ;;;;;;  ibuffer-backward-filter-group ibuffer-forward-filter-group
 ;;;;;;  ibuffer-toggle-filter-group ibuffer-mouse-toggle-filter-group
 ;;;;;;  ibuffer-interactive-filter-by-mode ibuffer-mouse-filter-by-mode
-;;;;;;  ibuffer-auto-mode) "ibuf-ext" "ibuf-ext.el" (17701 49517))
+;;;;;;  ibuffer-auto-mode) "ibuf-ext" "ibuf-ext.el" (17713 5990))
 ;;; Generated autoloads from ibuf-ext.el
 
 (autoload (quote ibuffer-auto-mode) "ibuf-ext" "\
@@ -14130,8 +14204,8 @@ defaults to one.
 ;;;***
 \f
 ;;;### (autoloads (define-ibuffer-filter define-ibuffer-op define-ibuffer-sorter
-;;;;;;  define-ibuffer-column) "ibuf-macs" "ibuf-macs.el" (17504
-;;;;;;  41540))
+;;;;;;  define-ibuffer-column) "ibuf-macs" "ibuf-macs.el" (17466
+;;;;;;  28164))
 ;;; Generated autoloads from ibuf-macs.el
 
 (autoload (quote define-ibuffer-column) "ibuf-macs" "\
@@ -14220,7 +14294,7 @@ bound to the current value of the filter.
 ;;;***
 \f
 ;;;### (autoloads (ibuffer ibuffer-other-window ibuffer-list-buffers)
-;;;;;;  "ibuffer" "ibuffer.el" (17652 14941))
+;;;;;;  "ibuffer" "ibuffer.el" (17713 5990))
 ;;; Generated autoloads from ibuffer.el
 
 (autoload (quote ibuffer-list-buffers) "ibuffer" "\
@@ -14261,7 +14335,7 @@ FORMATS is the value to use for `ibuffer-formats'.
 \f
 ;;;### (autoloads (icalendar-import-buffer icalendar-import-file
 ;;;;;;  icalendar-export-region icalendar-export-file) "icalendar"
-;;;;;;  "calendar/icalendar.el" (17504 41540))
+;;;;;;  "calendar/icalendar.el" (17401 60141))
 ;;; Generated autoloads from calendar/icalendar.el
 
 (autoload (quote icalendar-export-file) "icalendar" "\
@@ -14313,8 +14387,8 @@ buffer `*icalendar-errors*'.
 
 ;;;***
 \f
-;;;### (autoloads (icomplete-mode) "icomplete" "icomplete.el" (17686
-;;;;;;  53336))
+;;;### (autoloads (icomplete-mode) "icomplete" "icomplete.el" (17778
+;;;;;;  50473))
 ;;; Generated autoloads from icomplete.el
 
 (defvar icomplete-mode nil "\
@@ -14334,7 +14408,7 @@ With a numeric argument, turn Icomplete mode on iff ARG is positive.
 
 ;;;***
 \f
-;;;### (autoloads (icon-mode) "icon" "progmodes/icon.el" (17504 41540))
+;;;### (autoloads (icon-mode) "icon" "progmodes/icon.el" (17390 27408))
 ;;; Generated autoloads from progmodes/icon.el
 
 (autoload (quote icon-mode) "icon" "\
@@ -14375,7 +14449,7 @@ with no args, if that value is non-nil.
 ;;;***
 \f
 ;;;### (autoloads (idlwave-shell) "idlw-shell" "progmodes/idlw-shell.el"
-;;;;;;  (17596 14703))
+;;;;;;  (17778 50476))
 ;;; Generated autoloads from progmodes/idlw-shell.el
 
 (autoload (quote idlwave-shell) "idlw-shell" "\
@@ -14401,11 +14475,11 @@ See also the variable `idlwave-shell-prompt-pattern'.
 ;;;***
 \f
 ;;;### (autoloads (idlwave-mode) "idlwave" "progmodes/idlwave.el"
-;;;;;;  (17746 34862))
+;;;;;;  (17778 50476))
 ;;; Generated autoloads from progmodes/idlwave.el
 
 (autoload (quote idlwave-mode) "idlwave" "\
-Major mode for editing IDL source files (version 6.0_em22).
+Major mode for editing IDL source files (version 6.1_em22).
 
 The main features of this mode are
 
@@ -14536,8 +14610,8 @@ The main features of this mode are
 ;;;;;;  ido-find-alternate-file ido-find-file-other-window ido-find-file
 ;;;;;;  ido-find-file-in-dir ido-switch-buffer-other-frame ido-insert-buffer
 ;;;;;;  ido-kill-buffer ido-display-buffer ido-switch-buffer-other-window
-;;;;;;  ido-switch-buffer ido-mode ido-mode) "ido" "ido.el" (17759
-;;;;;;  28868))
+;;;;;;  ido-switch-buffer ido-mode ido-mode) "ido" "ido.el" (17778
+;;;;;;  50473))
 ;;; Generated autoloads from ido.el
 
 (defvar ido-mode nil "\
@@ -14798,7 +14872,7 @@ DEF, if non-nil, is the default value.
 
 ;;;***
 \f
-;;;### (autoloads (ielm) "ielm" "ielm.el" (17504 41540))
+;;;### (autoloads (ielm) "ielm" "ielm.el" (17390 26940))
 ;;; Generated autoloads from ielm.el
  (add-hook 'same-window-buffer-names "*ielm*")
 
@@ -14811,7 +14885,7 @@ Switches to the buffer `*ielm*', or creates it if it does not exist.
 ;;;***
 \f
 ;;;### (autoloads (iimage-mode turn-on-iimage-mode) "iimage" "iimage.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17778 50473))
 ;;; Generated autoloads from iimage.el
 
 (autoload (quote turn-on-iimage-mode) "iimage" "\
@@ -14830,7 +14904,7 @@ Toggle inline image minor mode.
 ;;;;;;  insert-image put-image create-image image-type-available-p
 ;;;;;;  image-type image-type-from-file-name image-type-from-file-header
 ;;;;;;  image-type-from-buffer image-type-from-data) "image" "image.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17490 7905))
 ;;; Generated autoloads from image.el
 
 (autoload (quote image-type-from-data) "image" "\
@@ -14992,7 +15066,7 @@ Example:
 \f
 ;;;### (autoloads (auto-image-file-mode insert-image-file image-file-name-regexp
 ;;;;;;  image-file-name-regexps image-file-name-extensions) "image-file"
-;;;;;;  "image-file.el" (17504 41540))
+;;;;;;  "image-file.el" (17390 26940))
 ;;; Generated autoloads from image-file.el
 
 (defvar image-file-name-extensions (quote ("png" "jpeg" "jpg" "gif" "tiff" "tif" "xbm" "xpm" "pbm" "pgm" "ppm" "pnm")) "\
@@ -15005,7 +15079,7 @@ setting this variable directly does not take effect unless
 `auto-image-file-mode' is re-enabled; this happens automatically when
 the variable is set using \\[customize].")
 
-(custom-autoload (quote image-file-name-extensions) "image-file" nil)
+(custom-autoload (quote image-file-name-extensions) "image-file")
 
 (defvar image-file-name-regexps nil "\
 *List of regexps matching image-file filenames.
@@ -15017,7 +15091,7 @@ enabled, setting this variable directly does not take effect unless
 `auto-image-file-mode' is re-enabled; this happens automatically when
 the variable is set using \\[customize].")
 
-(custom-autoload (quote image-file-name-regexps) "image-file" nil)
+(custom-autoload (quote image-file-name-regexps) "image-file")
 
 (autoload (quote image-file-name-regexp) "image-file" "\
 Return a regular expression matching image-file filenames.
@@ -15035,10 +15109,11 @@ the command `insert-file-contents'.
 Non-nil if Auto-Image-File mode is enabled.
 See the command `auto-image-file-mode' for a description of this minor-mode.
 Setting this variable directly does not take effect;
-either customize it (see the info node `Easy Customization')
-or call the function `auto-image-file-mode'.")
+use either \\[customize] or the function `auto-image-file-mode'.")
+
+(custom-autoload (quote auto-image-file-mode) "image-file")
 
-(custom-autoload (quote auto-image-file-mode) "image-file" nil)
+(put (quote auto-image-file-mode) (quote custom-set) (quote custom-set-minor-mode))
 
 (autoload (quote auto-image-file-mode) "image-file" "\
 Toggle visiting of image files as images.
@@ -15054,7 +15129,7 @@ Image files are those whose name has an extension in
 ;;;***
 \f
 ;;;### (autoloads (image-mode-maybe image-minor-mode image-mode)
-;;;;;;  "image-mode" "image-mode.el" (17652 40095))
+;;;;;;  "image-mode" "image-mode.el" (17713 5990))
 ;;; Generated autoloads from image-mode.el
  (push '("\\.jpe?g\\'"    . image-mode) auto-mode-alist)
  (push '("\\.png\\'"      . image-mode) auto-mode-alist)
@@ -15092,7 +15167,7 @@ information on these modes.
 ;;;***
 \f
 ;;;### (autoloads (imenu imenu-add-menubar-index imenu-add-to-menubar
-;;;;;;  imenu-sort-function) "imenu" "imenu.el" (17656 34193))
+;;;;;;  imenu-sort-function) "imenu" "imenu.el" (17713 5990))
 ;;; Generated autoloads from imenu.el
 
 (defvar imenu-sort-function nil "\
@@ -15207,7 +15282,7 @@ for more information.
 \f
 ;;;### (autoloads (indian-char-glyph indian-glyph-char in-is13194-pre-write-conversion
 ;;;;;;  in-is13194-post-read-conversion indian-compose-string indian-compose-region)
-;;;;;;  "ind-util" "language/ind-util.el" (17504 41540))
+;;;;;;  "ind-util" "language/ind-util.el" (17342 36796))
 ;;; Generated autoloads from language/ind-util.el
 
 (autoload (quote indian-compose-region) "ind-util" "\
@@ -15250,7 +15325,7 @@ See also the function `indian-glyph-char'.
 \f
 ;;;### (autoloads (inferior-lisp inferior-lisp-prompt inferior-lisp-load-command
 ;;;;;;  inferior-lisp-program inferior-lisp-filter-regexp) "inf-lisp"
-;;;;;;  "progmodes/inf-lisp.el" (17541 35103))
+;;;;;;  "progmodes/inf-lisp.el" (17549 4607))
 ;;; Generated autoloads from progmodes/inf-lisp.el
 
 (defvar inferior-lisp-filter-regexp "\\`\\s *\\(:\\(\\w\\|\\s_\\)\\)?\\s *\\'" "\
@@ -15259,12 +15334,12 @@ Input matching this regexp is not saved on the input history in Inferior Lisp
 mode.  Default is whitespace followed by 0 or 1 single-letter colon-keyword
 \(as in :a, :c, etc.)")
 
-(custom-autoload (quote inferior-lisp-filter-regexp) "inf-lisp" t)
+(custom-autoload (quote inferior-lisp-filter-regexp) "inf-lisp")
 
 (defvar inferior-lisp-program "lisp" "\
 *Program name for invoking an inferior Lisp in Inferior Lisp mode.")
 
-(custom-autoload (quote inferior-lisp-program) "inf-lisp" t)
+(custom-autoload (quote inferior-lisp-program) "inf-lisp")
 
 (defvar inferior-lisp-load-command "(load \"%s\")\n" "\
 *Format-string for building a Lisp expression to load a file.
@@ -15275,7 +15350,7 @@ The string \"(progn (load \\\"%s\\\" :verbose nil :print t) (values))\\n\"
 produces cosmetically superior output for this application,
 but it works only in Common Lisp.")
 
-(custom-autoload (quote inferior-lisp-load-command) "inf-lisp" t)
+(custom-autoload (quote inferior-lisp-load-command) "inf-lisp")
 
 (defvar inferior-lisp-prompt "^[^> \n]*>+:? *" "\
 Regexp to recognize prompts in the Inferior Lisp mode.
@@ -15293,7 +15368,7 @@ kcl: \"^>+ *\"
 
 This is a fine thing to set in your .emacs file or through Custom.")
 
-(custom-autoload (quote inferior-lisp-prompt) "inf-lisp" t)
+(custom-autoload (quote inferior-lisp-prompt) "inf-lisp")
 
 (defvar inferior-lisp-mode-hook (quote nil) "\
 *Hook for customising Inferior Lisp mode.")
@@ -15317,7 +15392,7 @@ of `inferior-lisp-program').  Runs the hooks from
 ;;;### (autoloads (Info-speedbar-browser Info-goto-emacs-key-command-node
 ;;;;;;  Info-goto-emacs-command-node Info-mode info-apropos Info-index
 ;;;;;;  Info-directory Info-on-current-buffer info-standalone info-emacs-manual
-;;;;;;  info info-other-window) "info" "info.el" (17665 54360))
+;;;;;;  info info-other-window) "info" "info.el" (17713 5990))
 ;;; Generated autoloads from info.el
 
 (autoload (quote info-other-window) "info" "\
@@ -15483,7 +15558,7 @@ This will add a speedbar major display mode.
 \f
 ;;;### (autoloads (info-complete-file info-complete-symbol info-lookup-file
 ;;;;;;  info-lookup-symbol info-lookup-reset) "info-look" "info-look.el"
-;;;;;;  (17746 34860))
+;;;;;;  (17778 50473))
 ;;; Generated autoloads from info-look.el
 
 (autoload (quote info-lookup-reset) "info-look" "\
@@ -15531,7 +15606,7 @@ Perform completion on file preceding point.
 ;;;***
 \f
 ;;;### (autoloads (info-xref-check-all-custom info-xref-check-all
-;;;;;;  info-xref-check) "info-xref" "info-xref.el" (17522 22308))
+;;;;;;  info-xref-check) "info-xref" "info-xref.el" (17524 8597))
 ;;; Generated autoloads from info-xref.el
 
 (autoload (quote info-xref-check) "info-xref" "\
@@ -15558,7 +15633,7 @@ quite a while.
 ;;;***
 \f
 ;;;### (autoloads (batch-info-validate Info-validate Info-split Info-tagify)
-;;;;;;  "informat" "informat.el" (17504 41540))
+;;;;;;  "informat" "informat.el" (17390 26940))
 ;;; Generated autoloads from informat.el
 
 (autoload (quote Info-tagify) "informat" "\
@@ -15599,7 +15674,7 @@ For example, invoke \"emacs -batch -f batch-info-validate $info/ ~/*.info\"
 \f
 ;;;### (autoloads (isearch-process-search-multibyte-characters isearch-toggle-input-method
 ;;;;;;  isearch-toggle-specified-input-method) "isearch-x" "international/isearch-x.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17279 27123))
 ;;; Generated autoloads from international/isearch-x.el
 
 (autoload (quote isearch-toggle-specified-input-method) "isearch-x" "\
@@ -15619,8 +15694,8 @@ Not documented
 
 ;;;***
 \f
-;;;### (autoloads (isearchb-activate) "isearchb" "isearchb.el" (17504
-;;;;;;  41540))
+;;;### (autoloads (isearchb-activate) "isearchb" "isearchb.el" (17390
+;;;;;;  26940))
 ;;; Generated autoloads from isearchb.el
 
 (autoload (quote isearchb-activate) "isearchb" "\
@@ -15633,10 +15708,41 @@ accessed via isearchb.
 
 ;;;***
 \f
+;;;### (autoloads (iso-accents-mode) "iso-acc" "obsolete/iso-acc.el"
+;;;;;;  (17383 38806))
+;;; Generated autoloads from obsolete/iso-acc.el
+
+(autoload (quote iso-accents-mode) "iso-acc" "\
+Toggle ISO Accents mode, in which accents modify the following letter.
+This permits easy insertion of accented characters according to ISO-8859-1.
+When Iso-accents mode is enabled, accent character keys
+\(`, ', \", ^, / and ~) do not self-insert; instead, they modify the following
+letter key so that it inserts an ISO accented letter.
+
+You can customize ISO Accents mode to a particular language
+with the command `iso-accents-customize'.
+
+Special combinations: ~c gives a c with cedilla,
+~d gives an Icelandic eth (d with dash).
+~t gives an Icelandic thorn.
+\"s gives German sharp s.
+/a gives a with ring.
+/e gives an a-e ligature.
+~< and ~> give guillemots.
+~! gives an inverted exclamation mark.
+~? gives an inverted question mark.
+
+With an argument, a positive argument enables ISO Accents mode,
+and a negative argument disables it.
+
+\(fn &optional ARG)" t nil)
+
+;;;***
+\f
 ;;;### (autoloads (iso-cvt-define-menu iso-cvt-write-only iso-cvt-read-only
 ;;;;;;  iso-sgml2iso iso-iso2sgml iso-iso2duden iso-iso2gtex iso-gtex2iso
 ;;;;;;  iso-tex2iso iso-iso2tex iso-german iso-spanish) "iso-cvt"
-;;;;;;  "international/iso-cvt.el" (17504 41540))
+;;;;;;  "international/iso-cvt.el" (17279 27079))
 ;;; Generated autoloads from international/iso-cvt.el
 
 (autoload (quote iso-spanish) "iso-cvt" "\
@@ -15720,7 +15826,7 @@ Add submenus to the File menu, to convert to and from various formats.
 ;;;***
 \f
 ;;;### (autoloads nil "iso-transl" "international/iso-transl.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17279 27115))
 ;;; Generated autoloads from international/iso-transl.el
  (or key-translation-map (setq key-translation-map (make-sparse-keymap)))
  (define-key key-translation-map "\C-x8" 'iso-transl-ctl-x-8-map)
@@ -15733,7 +15839,7 @@ Add submenus to the File menu, to convert to and from various formats.
 ;;;;;;  ispell-region ispell-change-dictionary ispell-kill-ispell
 ;;;;;;  ispell-help ispell-pdict-save ispell-word ispell-local-dictionary-alist
 ;;;;;;  ispell-personal-dictionary) "ispell" "textmodes/ispell.el"
-;;;;;;  (17746 34863))
+;;;;;;  (17778 50479))
 ;;; Generated autoloads from textmodes/ispell.el
 (put 'ispell-check-comments 'safe-local-variable (lambda (a) (memq a '(nil t exclusive))))
 
@@ -16021,18 +16127,19 @@ You can bind this to the key C-c i in GNUS or mail by adding to
 
 ;;;***
 \f
-;;;### (autoloads (iswitchb-mode) "iswitchb" "iswitchb.el" (17504
-;;;;;;  41540))
+;;;### (autoloads (iswitchb-mode) "iswitchb" "iswitchb.el" (17441
+;;;;;;  26660))
 ;;; Generated autoloads from iswitchb.el
 
 (defvar iswitchb-mode nil "\
 Non-nil if Iswitchb mode is enabled.
 See the command `iswitchb-mode' for a description of this minor-mode.
 Setting this variable directly does not take effect;
-either customize it (see the info node `Easy Customization')
-or call the function `iswitchb-mode'.")
+use either \\[customize] or the function `iswitchb-mode'.")
+
+(custom-autoload (quote iswitchb-mode) "iswitchb")
 
-(custom-autoload (quote iswitchb-mode) "iswitchb" nil)
+(put (quote iswitchb-mode) (quote custom-set) (quote custom-set-minor-mode))
 
 (autoload (quote iswitchb-mode) "iswitchb" "\
 Toggle Iswitchb global minor mode.
@@ -16047,7 +16154,7 @@ This mode enables switching between buffers using substrings.  See
 ;;;### (autoloads (read-hiragana-string japanese-zenkaku-region japanese-hankaku-region
 ;;;;;;  japanese-hiragana-region japanese-katakana-region japanese-zenkaku
 ;;;;;;  japanese-hankaku japanese-hiragana japanese-katakana setup-japanese-environment-internal)
-;;;;;;  "japan-util" "language/japan-util.el" (17504 41540))
+;;;;;;  "japan-util" "language/japan-util.el" (17279 27080))
 ;;; Generated autoloads from language/japan-util.el
 
 (autoload (quote setup-japanese-environment-internal) "japan-util" "\
@@ -16125,7 +16232,7 @@ If non-nil, second arg INITIAL-INPUT is a string to insert before reading.
 ;;;***
 \f
 ;;;### (autoloads (jka-compr-uninstall jka-compr-handler) "jka-compr"
-;;;;;;  "jka-compr.el" (17504 41540))
+;;;;;;  "jka-compr.el" (17411 12435))
 ;;; Generated autoloads from jka-compr.el
 
 (defvar jka-compr-inhibit nil "\
@@ -16150,7 +16257,7 @@ by `jka-compr-installed'.
 \f
 ;;;### (autoloads (keypad-setup keypad-numlock-shifted-setup keypad-shifted-setup
 ;;;;;;  keypad-numlock-setup keypad-setup) "keypad" "emulation/keypad.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 26938))
 ;;; Generated autoloads from emulation/keypad.el
 
 (defvar keypad-setup nil "\
@@ -16158,28 +16265,28 @@ Specifies the keypad setup for unshifted keypad keys when NumLock is off.
 When selecting the plain numeric keypad setup, the character returned by the
 decimal key must be specified.")
 
-(custom-autoload (quote keypad-setup) "keypad" nil)
+(custom-autoload (quote keypad-setup) "keypad")
 
 (defvar keypad-numlock-setup nil "\
 Specifies the keypad setup for unshifted keypad keys when NumLock is on.
 When selecting the plain numeric keypad setup, the character returned by the
 decimal key must be specified.")
 
-(custom-autoload (quote keypad-numlock-setup) "keypad" nil)
+(custom-autoload (quote keypad-numlock-setup) "keypad")
 
 (defvar keypad-shifted-setup nil "\
 Specifies the keypad setup for shifted keypad keys when NumLock is off.
 When selecting the plain numeric keypad setup, the character returned by the
 decimal key must be specified.")
 
-(custom-autoload (quote keypad-shifted-setup) "keypad" nil)
+(custom-autoload (quote keypad-shifted-setup) "keypad")
 
 (defvar keypad-numlock-shifted-setup nil "\
 Specifies the keypad setup for shifted keypad keys when NumLock is off.
 When selecting the plain numeric keypad setup, the character returned by the
 decimal key must be specified.")
 
-(custom-autoload (quote keypad-numlock-shifted-setup) "keypad" nil)
+(custom-autoload (quote keypad-numlock-shifted-setup) "keypad")
 
 (autoload (quote keypad-setup) "keypad" "\
 Set keypad bindings in function-key-map according to SETUP.
@@ -16206,7 +16313,7 @@ the decimal key on the keypad is mapped to DECIMAL instead of `.'
 ;;;***
 \f
 ;;;### (autoloads (kinsoku) "kinsoku" "international/kinsoku.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17307 17630))
 ;;; Generated autoloads from international/kinsoku.el
 
 (autoload (quote kinsoku) "kinsoku" "\
@@ -16227,8 +16334,8 @@ the context of text formatting.
 
 ;;;***
 \f
-;;;### (autoloads (kkc-region) "kkc" "international/kkc.el" (17721
-;;;;;;  3805))
+;;;### (autoloads (kkc-region) "kkc" "international/kkc.el" (17778
+;;;;;;  49121))
 ;;; Generated autoloads from international/kkc.el
 
 (defvar kkc-after-update-conversion-functions nil "\
@@ -16253,7 +16360,7 @@ and the return value is the length of the conversion.
 ;;;### (autoloads (kmacro-end-call-mouse kmacro-end-and-call-macro
 ;;;;;;  kmacro-end-or-call-macro kmacro-start-macro-or-insert-counter
 ;;;;;;  kmacro-call-macro kmacro-end-macro kmacro-start-macro) "kmacro"
-;;;;;;  "kmacro.el" (17652 14942))
+;;;;;;  "kmacro.el" (17778 50473))
 ;;; Generated autoloads from kmacro.el
  (global-set-key "\C-x(" 'kmacro-start-macro)
  (global-set-key "\C-x)" 'kmacro-end-macro)
@@ -16360,7 +16467,7 @@ If kbd macro currently being defined end it before activating it.
 \f
 ;;;### (autoloads (kannada-post-read-conversion kannada-compose-string
 ;;;;;;  kannada-compose-region) "knd-util" "language/knd-util.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17279 27080))
 ;;; Generated autoloads from language/knd-util.el
 
 (defconst kannada-consonant "[\x51f75-\x51fb9]")
@@ -16383,7 +16490,7 @@ Not documented
 ;;;***
 \f
 ;;;### (autoloads (setup-korean-environment-internal) "korea-util"
-;;;;;;  "language/korea-util.el" (17504 41540))
+;;;;;;  "language/korea-util.el" (17279 27080))
 ;;; Generated autoloads from language/korea-util.el
 
 (defvar default-korean-keyboard (if (string-match "3" (or (getenv "HANGUL_KEYBOARD_TYPE") "")) "3" "") "\
@@ -16398,7 +16505,7 @@ Not documented
 ;;;***
 \f
 ;;;### (autoloads (lm lm-test-run) "landmark" "play/landmark.el"
-;;;;;;  (17580 16977))
+;;;;;;  (17778 50475))
 ;;; Generated autoloads from play/landmark.el
 
 (defalias (quote landmark-repeat) (quote lm-test-run))
@@ -16432,8 +16539,8 @@ Use \\[describe-mode] for more info.
 \f
 ;;;### (autoloads (lao-compose-region lao-composition-function lao-post-read-conversion
 ;;;;;;  lao-transcribe-roman-to-lao-string lao-transcribe-single-roman-syllable-to-lao
-;;;;;;  lao-compose-string) "lao-util" "language/lao-util.el" (17504
-;;;;;;  41540))
+;;;;;;  lao-compose-string) "lao-util" "language/lao-util.el" (17279
+;;;;;;  27080))
 ;;; Generated autoloads from language/lao-util.el
 
 (autoload (quote lao-compose-string) "lao-util" "\
@@ -16482,7 +16589,7 @@ Not documented
 \f
 ;;;### (autoloads (latexenc-find-file-coding-system latexenc-coding-system-to-inputenc
 ;;;;;;  latexenc-inputenc-to-coding-system latex-inputenc-coding-alist)
-;;;;;;  "latexenc" "international/latexenc.el" (17664 29029))
+;;;;;;  "latexenc" "international/latexenc.el" (17713 5990))
 ;;; Generated autoloads from international/latexenc.el
 
 (defvar latex-inputenc-coding-alist (quote (("ansinew" . windows-1252) ("applemac" . mac-roman) ("ascii" . us-ascii) ("cp1250" . windows-1250) ("cp1252" . windows-1252) ("cp1257" . cp1257) ("cp437de" . cp437) ("cp437" . cp437) ("cp850" . cp850) ("cp852" . cp852) ("cp858" . cp858) ("cp865" . cp865) ("latin1" . iso-8859-1) ("latin2" . iso-8859-2) ("latin3" . iso-8859-3) ("latin4" . iso-8859-4) ("latin5" . iso-8859-5) ("latin9" . iso-8859-15) ("next" . next) ("utf8" . utf-8) ("utf8x" . utf-8))) "\
@@ -16514,7 +16621,7 @@ coding system names is determined from `latex-inputenc-coding-alist'.
 ;;;***
 \f
 ;;;### (autoloads (latin1-display-ucs-per-lynx latin1-display latin1-display)
-;;;;;;  "latin1-disp" "international/latin1-disp.el" (17504 41540))
+;;;;;;  "latin1-disp" "international/latin1-disp.el" (17279 27079))
 ;;; Generated autoloads from international/latin1-disp.el
 
 (defvar latin1-display nil "\
@@ -16532,7 +16639,7 @@ charsets if you don't have a Unicode font with which to display them.
 Setting this variable directly does not take effect;
 use either \\[customize] or the function `latin1-display'.")
 
-(custom-autoload (quote latin1-display) "latin1-disp" nil)
+(custom-autoload (quote latin1-display) "latin1-disp")
 
 (autoload (quote latin1-display) "latin1-disp" "\
 Set up Latin-1/ASCII display for the arguments character SETS.
@@ -16553,12 +16660,80 @@ changed if the display can render Unicode characters.
 Setting this variable directly does not take effect;
 use either \\[customize] or the function `latin1-display'.")
 
-(custom-autoload (quote latin1-display-ucs-per-lynx) "latin1-disp" nil)
+(custom-autoload (quote latin1-display-ucs-per-lynx) "latin1-disp")
+
+;;;***
+\f
+;;;### (autoloads (turn-on-lazy-lock lazy-lock-mode) "lazy-lock"
+;;;;;;  "obsolete/lazy-lock.el" (17383 38807))
+;;; Generated autoloads from obsolete/lazy-lock.el
+
+(autoload (quote lazy-lock-mode) "lazy-lock" "\
+Toggle Lazy Lock mode.
+With arg, turn Lazy Lock mode on if and only if arg is positive.  Enable it
+automatically in your `~/.emacs' by:
+
+ (setq font-lock-support-mode 'lazy-lock-mode)
+
+For a newer font-lock support mode with similar functionality, see
+`jit-lock-mode'.  Eventually, Lazy Lock mode will be deprecated in
+JIT Lock's favor.
+
+When Lazy Lock mode is enabled, fontification can be lazy in a number of ways:
+
+- Demand-driven buffer fontification if `lazy-lock-minimum-size' is non-nil.
+  This means initial fontification does not occur if the buffer is greater than
+  `lazy-lock-minimum-size' characters in length.  Instead, fontification occurs
+  when necessary, such as when scrolling through the buffer would otherwise
+  reveal unfontified areas.  This is useful if buffer fontification is too slow
+  for large buffers.
+
+- Deferred scroll fontification if `lazy-lock-defer-on-scrolling' is non-nil.
+  This means demand-driven fontification does not occur as you scroll.
+  Instead, fontification is deferred until after `lazy-lock-defer-time' seconds
+  of Emacs idle time, while Emacs remains idle.  This is useful if
+  fontification is too slow to keep up with scrolling.
+
+- Deferred on-the-fly fontification if `lazy-lock-defer-on-the-fly' is non-nil.
+  This means on-the-fly fontification does not occur as you type.  Instead,
+  fontification is deferred until after `lazy-lock-defer-time' seconds of Emacs
+  idle time, while Emacs remains idle.  This is useful if fontification is too
+  slow to keep up with your typing.
+
+- Deferred context fontification if `lazy-lock-defer-contextually' is non-nil.
+  This means fontification updates the buffer corresponding to true syntactic
+  context, after `lazy-lock-defer-time' seconds of Emacs idle time, while Emacs
+  remains idle.  Otherwise, fontification occurs on modified lines only, and
+  subsequent lines can remain fontified corresponding to previous syntactic
+  contexts.  This is useful where strings or comments span lines.
+
+- Stealthy buffer fontification if `lazy-lock-stealth-time' is non-nil.
+  This means remaining unfontified areas of buffers are fontified if Emacs has
+  been idle for `lazy-lock-stealth-time' seconds, while Emacs remains idle.
+  This is useful if any buffer has any deferred fontification.
+
+Basic Font Lock mode on-the-fly fontification behavior fontifies modified
+lines only.  Thus, if `lazy-lock-defer-contextually' is non-nil, Lazy Lock mode
+on-the-fly fontification may fontify differently, albeit correctly.  In any
+event, to refontify some lines you can use \\[font-lock-fontify-block].
+
+Stealth fontification only occurs while the system remains unloaded.
+If the system load rises above `lazy-lock-stealth-load' percent, stealth
+fontification is suspended.  Stealth fontification intensity is controlled via
+the variable `lazy-lock-stealth-nice' and `lazy-lock-stealth-lines', and
+verbosity is controlled via the variable `lazy-lock-stealth-verbose'.
+
+\(fn &optional ARG)" t nil)
+
+(autoload (quote turn-on-lazy-lock) "lazy-lock" "\
+Unconditionally turn on Lazy Lock mode.
+
+\(fn)" nil nil)
 
 ;;;***
 \f
 ;;;### (autoloads (ld-script-mode) "ld-script" "progmodes/ld-script.el"
-;;;;;;  (17610 3931))
+;;;;;;  (17611 9419))
 ;;; Generated autoloads from progmodes/ld-script.el
 
 (add-to-list (quote auto-mode-alist) (quote ("\\.ld[si]?\\>" . ld-script-mode)))
@@ -16573,7 +16748,7 @@ A major mode to edit GNU ld script files
 ;;;***
 \f
 ;;;### (autoloads (ledit-from-lisp-mode ledit-mode) "ledit" "ledit.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17778 50475))
 ;;; Generated autoloads from ledit.el
 
 (defconst ledit-save-files t "\
@@ -16594,6 +16769,7 @@ Like Lisp mode, plus these special commands:
   \\[ledit-go-to-lisp] -- transfer to Lisp job and transmit saved text.
   \\[ledit-go-to-liszt] -- transfer to Liszt (Lisp compiler) job
           and transmit saved text.
+
 \\{ledit-mode-map}
 To make Lisp mode automatically change to Ledit mode,
 do (setq lisp-mode-hook 'ledit-from-lisp-mode)
@@ -16607,7 +16783,7 @@ Not documented
 
 ;;;***
 \f
-;;;### (autoloads (life) "life" "play/life.el" (17675 64484))
+;;;### (autoloads (life) "life" "play/life.el" (17713 5990))
 ;;; Generated autoloads from play/life.el
 
 (autoload (quote life) "life" "\
@@ -16620,8 +16796,8 @@ generations (this defaults to 1).
 
 ;;;***
 \f
-;;;### (autoloads (unload-feature) "loadhist" "loadhist.el" (17746
-;;;;;;  34860))
+;;;### (autoloads (unload-feature) "loadhist" "loadhist.el" (17778
+;;;;;;  50475))
 ;;; Generated autoloads from loadhist.el
 
 (autoload (quote unload-feature) "loadhist" "\
@@ -16644,7 +16820,7 @@ such as redefining an Emacs function.
 ;;;***
 \f
 ;;;### (autoloads (locate-with-filter locate locate-ls-subdir-switches)
-;;;;;;  "locate" "locate.el" (17668 1406))
+;;;;;;  "locate" "locate.el" (17778 50475))
 ;;; Generated autoloads from locate.el
 
 (defvar locate-ls-subdir-switches "-al" "\
@@ -16691,7 +16867,7 @@ except that FILTER is not optional.
 
 ;;;***
 \f
-;;;### (autoloads (log-edit) "log-edit" "log-edit.el" (17504 41540))
+;;;### (autoloads (log-edit) "log-edit" "log-edit.el" (17496 38723))
 ;;; Generated autoloads from log-edit.el
 
 (autoload (quote log-edit) "log-edit" "\
@@ -16712,8 +16888,8 @@ If BUFFER is non-nil `log-edit' will jump to that buffer, use it to edit the
 
 ;;;***
 \f
-;;;### (autoloads (log-view-mode) "log-view" "log-view.el" (17504
-;;;;;;  41540))
+;;;### (autoloads (log-view-mode) "log-view" "log-view.el" (17496
+;;;;;;  38723))
 ;;; Generated autoloads from log-view.el
 
 (autoload (quote log-view-mode) "log-view" "\
@@ -16723,8 +16899,8 @@ Major mode for browsing CVS log output.
 
 ;;;***
 \f
-;;;### (autoloads (longlines-mode) "longlines" "longlines.el" (17710
-;;;;;;  3074))
+;;;### (autoloads (longlines-mode) "longlines" "longlines.el" (17778
+;;;;;;  50475))
 ;;; Generated autoloads from longlines.el
 
 (autoload (quote longlines-mode) "longlines" "\
@@ -16745,8 +16921,8 @@ are indicated with a symbol.
 ;;;***
 \f
 ;;;### (autoloads (print-region lpr-region print-buffer lpr-buffer
-;;;;;;  lpr-command lpr-switches printer-name) "lpr" "lpr.el" (17686
-;;;;;;  35928))
+;;;;;;  lpr-command lpr-switches printer-name) "lpr" "lpr.el" (17713
+;;;;;;  5990))
 ;;; Generated autoloads from lpr.el
 
 (defvar lpr-windows-system (memq system-type (quote (emx win32 w32 mswindows ms-dos windows-nt))))
@@ -16840,19 +17016,19 @@ for further customization of the printer command.
 ;;;***
 \f
 ;;;### (autoloads (ls-lisp-support-shell-wildcards) "ls-lisp" "ls-lisp.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 26942))
 ;;; Generated autoloads from ls-lisp.el
 
 (defvar ls-lisp-support-shell-wildcards t "\
 *Non-nil means ls-lisp treats file patterns as shell wildcards.
 Otherwise they are treated as Emacs regexps (for backward compatibility).")
 
-(custom-autoload (quote ls-lisp-support-shell-wildcards) "ls-lisp" t)
+(custom-autoload (quote ls-lisp-support-shell-wildcards) "ls-lisp")
 
 ;;;***
 \f
-;;;### (autoloads (phases-of-moon) "lunar" "calendar/lunar.el" (17504
-;;;;;;  41540))
+;;;### (autoloads (phases-of-moon) "lunar" "calendar/lunar.el" (17390
+;;;;;;  27324))
 ;;; Generated autoloads from calendar/lunar.el
 
 (autoload (quote phases-of-moon) "lunar" "\
@@ -16865,8 +17041,8 @@ This function is suitable for execution in a .emacs file.
 
 ;;;***
 \f
-;;;### (autoloads (m4-mode) "m4-mode" "progmodes/m4-mode.el" (17504
-;;;;;;  41540))
+;;;### (autoloads (m4-mode) "m4-mode" "progmodes/m4-mode.el" (17390
+;;;;;;  27408))
 ;;; Generated autoloads from progmodes/m4-mode.el
 
 (autoload (quote m4-mode) "m4-mode" "\
@@ -16878,7 +17054,7 @@ A major mode to edit m4 macro files.
 ;;;***
 \f
 ;;;### (autoloads (macroexpand-all) "macroexp" "emacs-lisp/macroexp.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 26938))
 ;;; Generated autoloads from emacs-lisp/macroexp.el
 
 (autoload (quote macroexpand-all) "macroexp" "\
@@ -16892,7 +17068,7 @@ definitions to shadow the loaded ones for use in file byte-compilation.
 ;;;***
 \f
 ;;;### (autoloads (apply-macro-to-region-lines kbd-macro-query insert-kbd-macro
-;;;;;;  name-last-kbd-macro) "macros" "macros.el" (17504 41540))
+;;;;;;  name-last-kbd-macro) "macros" "macros.el" (17778 50475))
 ;;; Generated autoloads from macros.el
 
 (autoload (quote name-last-kbd-macro) "macros" "\
@@ -16981,7 +17157,7 @@ and then select the region of un-tablified names and use
 ;;;***
 \f
 ;;;### (autoloads (what-domain mail-extract-address-components) "mail-extr"
-;;;;;;  "mail/mail-extr.el" (17504 41540))
+;;;;;;  "mail/mail-extr.el" (17390 26942))
 ;;; Generated autoloads from mail/mail-extr.el
 
 (autoload (quote mail-extract-address-components) "mail-extr" "\
@@ -17013,7 +17189,7 @@ Convert mail domain DOMAIN to the country it corresponds to.
 \f
 ;;;### (autoloads (mail-hist-put-headers-into-history mail-hist-keep-history
 ;;;;;;  mail-hist-enable mail-hist-define-keys) "mail-hist" "mail/mail-hist.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 26942))
 ;;; Generated autoloads from mail/mail-hist.el
 
 (autoload (quote mail-hist-define-keys) "mail-hist" "\
@@ -17029,7 +17205,7 @@ Not documented
 (defvar mail-hist-keep-history t "\
 *Non-nil means keep a history for headers and text of outgoing mail.")
 
-(custom-autoload (quote mail-hist-keep-history) "mail-hist" t)
+(custom-autoload (quote mail-hist-keep-history) "mail-hist")
 
 (autoload (quote mail-hist-put-headers-into-history) "mail-hist" "\
 Put headers and contents of this message into mail header history.
@@ -17044,8 +17220,8 @@ This function normally would be called when the message is sent.
 \f
 ;;;### (autoloads (mail-fetch-field mail-unquote-printable-region
 ;;;;;;  mail-unquote-printable mail-quote-printable mail-file-babyl-p
-;;;;;;  mail-use-rfc822) "mail-utils" "mail/mail-utils.el" (17504
-;;;;;;  41540))
+;;;;;;  mail-use-rfc822) "mail-utils" "mail/mail-utils.el" (17390
+;;;;;;  26942))
 ;;; Generated autoloads from mail/mail-utils.el
 
 (defvar mail-use-rfc822 nil "\
@@ -17053,7 +17229,7 @@ This function normally would be called when the message is sent.
 Otherwise, (the default) use a smaller, somewhat faster, and
 often correct parser.")
 
-(custom-autoload (quote mail-use-rfc822) "mail-utils" t)
+(custom-autoload (quote mail-use-rfc822) "mail-utils")
 
 (autoload (quote mail-file-babyl-p) "mail-utils" "\
 Not documented
@@ -17097,7 +17273,7 @@ If 4th arg LIST is non-nil, return a list of all such fields.
 ;;;***
 \f
 ;;;### (autoloads (define-mail-abbrev build-mail-abbrevs mail-abbrevs-setup)
-;;;;;;  "mailabbrev" "mail/mailabbrev.el" (17504 41540))
+;;;;;;  "mailabbrev" "mail/mailabbrev.el" (17390 26942))
 ;;; Generated autoloads from mail/mailabbrev.el
 
 (autoload (quote mail-abbrevs-setup) "mailabbrev" "\
@@ -17120,8 +17296,8 @@ If DEFINITION contains multiple addresses, separate them with commas.
 ;;;***
 \f
 ;;;### (autoloads (mail-complete define-mail-alias expand-mail-aliases
-;;;;;;  mail-complete-style) "mailalias" "mail/mailalias.el" (17504
-;;;;;;  41540))
+;;;;;;  mail-complete-style) "mailalias" "mail/mailalias.el" (17390
+;;;;;;  26942))
 ;;; Generated autoloads from mail/mailalias.el
 
 (defvar mail-complete-style (quote angles) "\
@@ -17133,7 +17309,7 @@ If `parens', they look like:
 If `angles', they look like:
        Elvis Parsley <king@grassland.com>")
 
-(custom-autoload (quote mail-complete-style) "mailalias" t)
+(custom-autoload (quote mail-complete-style) "mailalias")
 
 (autoload (quote expand-mail-aliases) "mailalias" "\
 Expand all mail aliases in suitable header fields found between BEG and END.
@@ -17167,7 +17343,7 @@ current header, calls `mail-complete-function' and passes prefix arg if any.
 ;;;***
 \f
 ;;;### (autoloads (mailclient-send-it) "mailclient" "mail/mailclient.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 26942))
 ;;; Generated autoloads from mail/mailclient.el
 
 (autoload (quote mailclient-send-it) "mailclient" "\
@@ -17181,7 +17357,7 @@ The mail client is taken to be the handler of mailto URLs.
 \f
 ;;;### (autoloads (makefile-imake-mode makefile-bsdmake-mode makefile-makepp-mode
 ;;;;;;  makefile-gmake-mode makefile-automake-mode makefile-mode)
-;;;;;;  "make-mode" "progmodes/make-mode.el" (17701 49519))
+;;;;;;  "make-mode" "progmodes/make-mode.el" (17713 5991))
 ;;; Generated autoloads from progmodes/make-mode.el
 
 (autoload (quote makefile-mode) "make-mode" "\
@@ -17298,8 +17474,8 @@ An adapted `makefile-mode' that knows about imake.
 
 ;;;***
 \f
-;;;### (autoloads (make-command-summary) "makesum" "makesum.el" (17504
-;;;;;;  41540))
+;;;### (autoloads (make-command-summary) "makesum" "makesum.el" (17390
+;;;;;;  26943))
 ;;; Generated autoloads from makesum.el
 
 (autoload (quote make-command-summary) "makesum" "\
@@ -17310,7 +17486,7 @@ Previous contents of that buffer are killed first.
 
 ;;;***
 \f
-;;;### (autoloads (man-follow man) "man" "man.el" (17658 57980))
+;;;### (autoloads (man-follow man) "man" "man.el" (17713 5990))
 ;;; Generated autoloads from man.el
 
 (defalias (quote manual-entry) (quote man))
@@ -17337,7 +17513,7 @@ Get a Un*x manual page of the item under point and put it in a buffer.
 
 ;;;***
 \f
-;;;### (autoloads (master-mode) "master" "master.el" (17504 41540))
+;;;### (autoloads (master-mode) "master" "master.el" (17279 27123))
 ;;; Generated autoloads from master.el
 
 (autoload (quote master-mode) "master" "\
@@ -17359,8 +17535,8 @@ yourself the value of `master-of' by calling `master-show-slave'.
 
 ;;;***
 \f
-;;;### (autoloads (menu-bar-mode) "menu-bar" "menu-bar.el" (17759
-;;;;;;  28868))
+;;;### (autoloads (menu-bar-mode) "menu-bar" "menu-bar.el" (17778
+;;;;;;  50475))
 ;;; Generated autoloads from menu-bar.el
 
 (put (quote menu-bar-mode) (quote standard-value) (quote (t)))
@@ -17395,7 +17571,7 @@ turn on menu bars; otherwise, turn off menu bars.
 ;;;;;;  message-cite-function message-yank-prefix message-citation-line-function
 ;;;;;;  message-send-mail-function message-user-organization-file
 ;;;;;;  message-signature-separator message-from-style) "message"
-;;;;;;  "gnus/message.el" (17759 28869))
+;;;;;;  "gnus/message.el" (17778 50473))
 ;;; Generated autoloads from gnus/message.el
 
 (defvar message-from-style (quote default) "\
@@ -17649,7 +17825,7 @@ which specify the range to operate on.
 ;;;***
 \f
 ;;;### (autoloads (metapost-mode metafont-mode) "meta-mode" "progmodes/meta-mode.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 27409))
 ;;; Generated autoloads from progmodes/meta-mode.el
 
 (autoload (quote metafont-mode) "meta-mode" "\
@@ -17676,7 +17852,7 @@ Turning on MetaPost mode calls the value of the variable
 \f
 ;;;### (autoloads (metamail-region metamail-buffer metamail-interpret-body
 ;;;;;;  metamail-interpret-header) "metamail" "mail/metamail.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 26942))
 ;;; Generated autoloads from mail/metamail.el
 
 (autoload (quote metamail-interpret-header) "metamail" "\
@@ -17721,7 +17897,7 @@ redisplayed as output is inserted.
 \f
 ;;;### (autoloads (mh-fully-kill-draft mh-send-letter mh-user-agent-compose
 ;;;;;;  mh-smail-batch mh-smail-other-window mh-smail) "mh-comp"
-;;;;;;  "mh-e/mh-comp.el" (17690 32932))
+;;;;;;  "mh-e/mh-comp.el" (17713 5990))
 ;;; Generated autoloads from mh-e/mh-comp.el
 
 (autoload (quote mh-smail) "mh-comp" "\
@@ -17808,7 +17984,7 @@ delete the draft message.
 
 ;;;***
 \f
-;;;### (autoloads (mh-version) "mh-e" "mh-e/mh-e.el" (17759 28870))
+;;;### (autoloads (mh-version) "mh-e" "mh-e/mh-e.el" (17778 50475))
 ;;; Generated autoloads from mh-e/mh-e.el
 
 (put (quote mh-progs) (quote risky-local-variable) t)
@@ -17825,7 +18001,7 @@ Display version information about MH-E and the MH mail handling system.
 ;;;***
 \f
 ;;;### (autoloads (mh-folder-mode mh-nmail mh-rmail) "mh-folder"
-;;;;;;  "mh-e/mh-folder.el" (17504 41540))
+;;;;;;  "mh-e/mh-folder.el" (17490 7902))
 ;;; Generated autoloads from mh-e/mh-folder.el
 
 (autoload (quote mh-rmail) "mh-folder" "\
@@ -17907,7 +18083,7 @@ perform the operation on all messages in that region.
 ;;;***
 \f
 ;;;### (autoloads (midnight-delay-set clean-buffer-list) "midnight"
-;;;;;;  "midnight.el" (17731 48935))
+;;;;;;  "midnight.el" (17778 49127))
 ;;; Generated autoloads from midnight.el
 
 (autoload (quote clean-buffer-list) "midnight" "\
@@ -17934,17 +18110,18 @@ to its second argument TM.
 ;;;***
 \f
 ;;;### (autoloads (minibuffer-electric-default-mode) "minibuf-eldef"
-;;;;;;  "minibuf-eldef.el" (17504 41540))
+;;;;;;  "minibuf-eldef.el" (17390 26943))
 ;;; Generated autoloads from minibuf-eldef.el
 
 (defvar minibuffer-electric-default-mode nil "\
 Non-nil if Minibuffer-Electric-Default mode is enabled.
 See the command `minibuffer-electric-default-mode' for a description of this minor-mode.
 Setting this variable directly does not take effect;
-either customize it (see the info node `Easy Customization')
-or call the function `minibuffer-electric-default-mode'.")
+use either \\[customize] or the function `minibuffer-electric-default-mode'.")
+
+(custom-autoload (quote minibuffer-electric-default-mode) "minibuf-eldef")
 
-(custom-autoload (quote minibuffer-electric-default-mode) "minibuf-eldef" nil)
+(put (quote minibuffer-electric-default-mode) (quote custom-set) (quote custom-set-minor-mode))
 
 (autoload (quote minibuffer-electric-default-mode) "minibuf-eldef" "\
 Toggle Minibuffer Electric Default mode.
@@ -17962,7 +18139,7 @@ Returns non-nil if the new state is enabled.
 ;;;***
 \f
 ;;;### (autoloads (mixal-mode) "mixal-mode" "progmodes/mixal-mode.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 27409))
 ;;; Generated autoloads from progmodes/mixal-mode.el
 
 (autoload (quote mixal-mode) "mixal-mode" "\
@@ -17977,7 +18154,7 @@ Major mode for the mixal asm language.
 \f
 ;;;### (autoloads (malayalam-composition-function malayalam-post-read-conversion
 ;;;;;;  malayalam-compose-region) "mlm-util" "language/mlm-util.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17342 36796))
 ;;; Generated autoloads from language/mlm-util.el
 
 (autoload (quote malayalam-compose-region) "mlm-util" "\
@@ -18000,7 +18177,7 @@ PATTERN regexp.
 ;;;***
 \f
 ;;;### (autoloads (mm-inline-external-body mm-extern-cache-contents)
-;;;;;;  "mm-extern" "gnus/mm-extern.el" (17632 36219))
+;;;;;;  "mm-extern" "gnus/mm-extern.el" (17713 5203))
 ;;; Generated autoloads from gnus/mm-extern.el
 
 (autoload (quote mm-extern-cache-contents) "mm-extern" "\
@@ -18019,7 +18196,7 @@ If NO-DISPLAY is nil, display it. Otherwise, do nothing after replacing.
 ;;;***
 \f
 ;;;### (autoloads (mm-inline-partial) "mm-partial" "gnus/mm-partial.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17383 38805))
 ;;; Generated autoloads from gnus/mm-partial.el
 
 (autoload (quote mm-inline-partial) "mm-partial" "\
@@ -18033,7 +18210,7 @@ If NO-DISPLAY is nil, display it. Otherwise, do nothing after replacing.
 ;;;***
 \f
 ;;;### (autoloads (mm-url-insert-file-contents-external mm-url-insert-file-contents)
-;;;;;;  "mm-url" "gnus/mm-url.el" (17610 3931))
+;;;;;;  "mm-url" "gnus/mm-url.el" (17611 9417))
 ;;; Generated autoloads from gnus/mm-url.el
 
 (autoload (quote mm-url-insert-file-contents) "mm-url" "\
@@ -18050,7 +18227,7 @@ Insert file contents of URL using `mm-url-program'.
 ;;;***
 \f
 ;;;### (autoloads (mm-uu-dissect-text-parts mm-uu-dissect) "mm-uu"
-;;;;;;  "gnus/mm-uu.el" (17715 55646))
+;;;;;;  "gnus/mm-uu.el" (17778 50473))
 ;;; Generated autoloads from gnus/mm-uu.el
 
 (autoload (quote mm-uu-dissect) "mm-uu" "\
@@ -18070,7 +18247,7 @@ Assume text has been decoded if DECODED is non-nil.
 ;;;***
 \f
 ;;;### (autoloads (mml1991-sign mml1991-encrypt) "mml1991" "gnus/mml1991.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17496 38719))
 ;;; Generated autoloads from gnus/mml1991.el
 
 (autoload (quote mml1991-encrypt) "mml1991" "\
@@ -18087,7 +18264,7 @@ Not documented
 \f
 ;;;### (autoloads (mml2015-self-encrypt mml2015-sign mml2015-encrypt
 ;;;;;;  mml2015-verify-test mml2015-verify mml2015-decrypt-test mml2015-decrypt)
-;;;;;;  "mml2015" "gnus/mml2015.el" (17504 41540))
+;;;;;;  "mml2015" "gnus/mml2015.el" (17778 50473))
 ;;; Generated autoloads from gnus/mml2015.el
 
 (autoload (quote mml2015-decrypt) "mml2015" "\
@@ -18128,7 +18305,7 @@ Not documented
 ;;;***
 \f
 ;;;### (autoloads (modula-2-mode) "modula2" "progmodes/modula2.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17322 60488))
 ;;; Generated autoloads from progmodes/modula2.el
 
 (autoload (quote modula-2-mode) "modula2" "\
@@ -18160,7 +18337,7 @@ followed by the first character of the construct.
 ;;;***
 \f
 ;;;### (autoloads (unmorse-region morse-region) "morse" "play/morse.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17383 38807))
 ;;; Generated autoloads from play/morse.el
 
 (autoload (quote morse-region) "morse" "\
@@ -18175,8 +18352,8 @@ Convert morse coded text in region to ordinary ASCII text.
 
 ;;;***
 \f
-;;;### (autoloads (mouse-sel-mode) "mouse-sel" "mouse-sel.el" (17704
-;;;;;;  3961))
+;;;### (autoloads (mouse-sel-mode) "mouse-sel" "mouse-sel.el" (17713
+;;;;;;  5990))
 ;;; Generated autoloads from mouse-sel.el
 
 (defvar mouse-sel-mode nil "\
@@ -18228,7 +18405,7 @@ primary selection and region.
 
 ;;;***
 \f
-;;;### (autoloads (mpuz) "mpuz" "play/mpuz.el" (17504 41540))
+;;;### (autoloads (mpuz) "mpuz" "play/mpuz.el" (17383 38807))
 ;;; Generated autoloads from play/mpuz.el
 
 (autoload (quote mpuz) "mpuz" "\
@@ -18238,17 +18415,16 @@ Multiplication puzzle with GNU Emacs.
 
 ;;;***
 \f
-;;;### (autoloads (msb-mode) "msb" "msb.el" (17566 60306))
+;;;### (autoloads (msb-mode) "msb" "msb.el" (17569 17797))
 ;;; Generated autoloads from msb.el
 
 (defvar msb-mode nil "\
 Non-nil if Msb mode is enabled.
 See the command `msb-mode' for a description of this minor-mode.
 Setting this variable directly does not take effect;
-either customize it (see the info node `Easy Customization')
-or call the function `msb-mode'.")
+use either \\[customize] or the function `msb-mode'.")
 
-(custom-autoload (quote msb-mode) "msb" nil)
+(custom-autoload (quote msb-mode) "msb")
 
 (autoload (quote msb-mode) "msb" "\
 Toggle Msb mode.
@@ -18265,7 +18441,7 @@ different buffer menu using the function `msb'.
 ;;;;;;  describe-current-coding-system describe-current-coding-system-briefly
 ;;;;;;  describe-coding-system describe-character-set list-charset-chars
 ;;;;;;  read-charset list-character-sets) "mule-diag" "international/mule-diag.el"
-;;;;;;  (17623 45182))
+;;;;;;  (17713 2489))
 ;;; Generated autoloads from international/mule-diag.el
 
 (defvar non-iso-charset-alist (\` ((mac-roman (ascii latin-iso8859-1 mule-unicode-2500-33ff mule-unicode-0100-24ff mule-unicode-e000-ffff) mac-roman-decoder ((0 255))) (viscii (ascii vietnamese-viscii-lower vietnamese-viscii-upper) viet-viscii-nonascii-translation-table ((0 255))) (vietnamese-tcvn (ascii vietnamese-viscii-lower vietnamese-viscii-upper) viet-tcvn-nonascii-translation-table ((0 255))) (koi8-r (ascii cyrillic-iso8859-5) cyrillic-koi8-r-nonascii-translation-table ((32 255))) (alternativnyj (ascii cyrillic-iso8859-5) cyrillic-alternativnyj-nonascii-translation-table ((32 255))) (koi8-u (ascii cyrillic-iso8859-5 mule-unicode-0100-24ff) cyrillic-koi8-u-nonascii-translation-table ((32 255))) (big5 (ascii chinese-big5-1 chinese-big5-2) decode-big5-char ((32 127) ((161 254) 64 126 161 254))) (sjis (ascii katakana-jisx0201 japanese-jisx0208) decode-sjis-char ((32 127 161 223) ((129 159 224 239) 64 126 128 252))))) "\
@@ -18439,7 +18615,7 @@ system which uses fontsets).
 ;;;;;;  coding-system-translation-table-for-decode coding-system-pre-write-conversion
 ;;;;;;  coding-system-post-read-conversion lookup-nested-alist set-nested-alist
 ;;;;;;  truncate-string-to-width store-substring string-to-sequence)
-;;;;;;  "mule-util" "international/mule-util.el" (17504 41540))
+;;;;;;  "mule-util" "international/mule-util.el" (17279 27079))
 ;;; Generated autoloads from international/mule-util.el
 
 (autoload (quote string-to-sequence) "mule-util" "\
@@ -18568,17 +18744,16 @@ basis, this may not be accurate.
 ;;;***
 \f
 ;;;### (autoloads (mwheel-install mouse-wheel-mode) "mwheel" "mwheel.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17505 62425))
 ;;; Generated autoloads from mwheel.el
 
 (defvar mouse-wheel-mode nil "\
 Non-nil if Mouse-Wheel mode is enabled.
 See the command `mouse-wheel-mode' for a description of this minor-mode.
 Setting this variable directly does not take effect;
-either customize it (see the info node `Easy Customization')
-or call the function `mouse-wheel-mode'.")
+use either \\[customize] or the function `mouse-wheel-mode'.")
 
-(custom-autoload (quote mouse-wheel-mode) "mwheel" nil)
+(custom-autoload (quote mouse-wheel-mode) "mwheel")
 
 (autoload (quote mouse-wheel-mode) "mwheel" "\
 Toggle mouse wheel support.
@@ -18597,7 +18772,7 @@ Enable mouse wheel support.
 ;;;### (autoloads (network-connection network-connection-to-service
 ;;;;;;  whois-reverse-lookup whois finger ftp run-dig dns-lookup-host
 ;;;;;;  nslookup nslookup-host route arp netstat ipconfig ping traceroute)
-;;;;;;  "net-utils" "net/net-utils.el" (17504 41540))
+;;;;;;  "net-utils" "net/net-utils.el" (17390 26944))
 ;;; Generated autoloads from net/net-utils.el
 
 (autoload (quote traceroute) "net-utils" "\
@@ -18693,7 +18868,7 @@ Open a network connection to HOST on PORT.
 ;;;;;;  uncomment-region comment-kill comment-set-column comment-indent
 ;;;;;;  comment-indent-default comment-normalize-vars comment-multi-line
 ;;;;;;  comment-padding comment-style comment-column) "newcomment"
-;;;;;;  "newcomment.el" (17707 61789))
+;;;;;;  "newcomment.el" (17778 50475))
 ;;; Generated autoloads from newcomment.el
 
 (defalias (quote indent-for-comment) (quote comment-indent))
@@ -18889,7 +19064,7 @@ unless optional argument SOFT is non-nil.
 \f
 ;;;### (autoloads (newsticker-show-news newsticker-start-ticker newsticker-start
 ;;;;;;  newsticker-ticker-running-p newsticker-running-p) "newsticker"
-;;;;;;  "net/newsticker.el" (17504 41540))
+;;;;;;  "net/newsticker.el" (17390 26944))
 ;;; Generated autoloads from net/newsticker.el
 
 (autoload (quote newsticker-running-p) "newsticker" "\
@@ -18931,7 +19106,7 @@ Switch to newsticker buffer.  You may want to bind this to a key.
 ;;;***
 \f
 ;;;### (autoloads (nndiary-generate-nov-databases) "nndiary" "gnus/nndiary.el"
-;;;;;;  (17746 34862))
+;;;;;;  (17778 50473))
 ;;; Generated autoloads from gnus/nndiary.el
 
 (autoload (quote nndiary-generate-nov-databases) "nndiary" "\
@@ -18941,8 +19116,8 @@ Generate NOV databases in all nndiary directories.
 
 ;;;***
 \f
-;;;### (autoloads (nndoc-add-type) "nndoc" "gnus/nndoc.el" (17504
-;;;;;;  41540))
+;;;### (autoloads (nndoc-add-type) "nndoc" "gnus/nndoc.el" (17383
+;;;;;;  38805))
 ;;; Generated autoloads from gnus/nndoc.el
 
 (autoload (quote nndoc-add-type) "nndoc" "\
@@ -18957,7 +19132,7 @@ symbol in the alist.
 ;;;***
 \f
 ;;;### (autoloads (nnfolder-generate-active-file) "nnfolder" "gnus/nnfolder.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 27386))
 ;;; Generated autoloads from gnus/nnfolder.el
 
 (autoload (quote nnfolder-generate-active-file) "nnfolder" "\
@@ -18969,7 +19144,7 @@ This command does not work if you use short group names.
 ;;;***
 \f
 ;;;### (autoloads (nnkiboze-generate-groups) "nnkiboze" "gnus/nnkiboze.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17383 38805))
 ;;; Generated autoloads from gnus/nnkiboze.el
 
 (autoload (quote nnkiboze-generate-groups) "nnkiboze" "\
@@ -18981,7 +19156,7 @@ Finds out what articles are to be part of the nnkiboze groups.
 ;;;***
 \f
 ;;;### (autoloads (nnml-generate-nov-databases) "nnml" "gnus/nnml.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17383 38805))
 ;;; Generated autoloads from gnus/nnml.el
 
 (autoload (quote nnml-generate-nov-databases) "nnml" "\
@@ -18992,7 +19167,7 @@ Generate NOV databases in all nnml directories.
 ;;;***
 \f
 ;;;### (autoloads (nnsoup-revert-variables nnsoup-set-variables nnsoup-pack-replies)
-;;;;;;  "nnsoup" "gnus/nnsoup.el" (17746 34862))
+;;;;;;  "nnsoup" "gnus/nnsoup.el" (17778 50473))
 ;;; Generated autoloads from gnus/nnsoup.el
 
 (autoload (quote nnsoup-pack-replies) "nnsoup" "\
@@ -19013,7 +19188,7 @@ Revert posting and mailing methods to the standard Emacs methods.
 ;;;***
 \f
 ;;;### (autoloads (disable-command enable-command disabled-command-function)
-;;;;;;  "novice" "novice.el" (17665 54360))
+;;;;;;  "novice" "novice.el" (17778 50475))
 ;;; Generated autoloads from novice.el
 
 (defvar disabled-command-function (quote disabled-command-function) "\
@@ -19046,7 +19221,7 @@ to future sessions.
 ;;;***
 \f
 ;;;### (autoloads (nroff-mode) "nroff-mode" "textmodes/nroff-mode.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 27169))
 ;;; Generated autoloads from textmodes/nroff-mode.el
 
 (autoload (quote nroff-mode) "nroff-mode" "\
@@ -19061,7 +19236,7 @@ closing requests for requests that are used in matched pairs.
 ;;;***
 \f
 ;;;### (autoloads (octave-help) "octave-hlp" "progmodes/octave-hlp.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 27409))
 ;;; Generated autoloads from progmodes/octave-hlp.el
 
 (autoload (quote octave-help) "octave-hlp" "\
@@ -19075,7 +19250,7 @@ If KEY is not a string, prompt for it with completion.
 ;;;***
 \f
 ;;;### (autoloads (inferior-octave) "octave-inf" "progmodes/octave-inf.el"
-;;;;;;  (17731 48936))
+;;;;;;  (17778 49132))
 ;;; Generated autoloads from progmodes/octave-inf.el
 
 (autoload (quote inferior-octave) "octave-inf" "\
@@ -19098,7 +19273,7 @@ startup file, `~/.emacs-octave'.
 ;;;***
 \f
 ;;;### (autoloads (octave-mode) "octave-mod" "progmodes/octave-mod.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17427 42815))
 ;;; Generated autoloads from progmodes/octave-mod.el
 
 (autoload (quote octave-mode) "octave-mod" "\
@@ -19196,13 +19371,35 @@ including a reproducible test case and send the message.
 
 ;;;***
 \f
+;;;### (autoloads (edit-options list-options) "options" "obsolete/options.el"
+;;;;;;  (17569 17776))
+;;; Generated autoloads from obsolete/options.el
+
+(autoload (quote list-options) "options" "\
+Display a list of Emacs user options, with values and documentation.
+It is now better to use Customize instead.
+
+\(fn)" t nil)
+
+(autoload (quote edit-options) "options" "\
+Edit a list of Emacs user option values.
+Selects a buffer containing such a list,
+in which there are commands to set the option values.
+Type \\[describe-mode] in that buffer for a list of commands.
+
+The Custom feature is intended to make this obsolete.
+
+\(fn)" t nil)
+
+;;;***
+\f
 ;;;### (autoloads (org-export-icalendar-combine-agenda-files org-export-icalendar-all-agenda-files
 ;;;;;;  org-export-icalendar-this-file orgtbl-mode turn-on-orgtbl
 ;;;;;;  org-remember-handler org-remember-apply-template org-remember-annotation
 ;;;;;;  org-store-link org-tags-view org-diary org-cycle-agenda-files
 ;;;;;;  org-todo-list org-agenda-list org-batch-agenda org-agenda
 ;;;;;;  org-global-cycle org-cycle org-mode) "org" "textmodes/org.el"
-;;;;;;  (17759 28874))
+;;;;;;  (17778 50479))
 ;;; Generated autoloads from textmodes/org.el
 
 (autoload (quote org-mode) "org" "\
@@ -19470,7 +19667,7 @@ The file is stored under the name `org-combined-agenda-icalendar-file'.
 ;;;***
 \f
 ;;;### (autoloads (outline-minor-mode outline-mode) "outline" "outline.el"
-;;;;;;  (17508 50986))
+;;;;;;  (17515 24859))
 ;;; Generated autoloads from outline.el
 (put 'outline-regexp 'safe-local-variable 'string-or-null-p)
 
@@ -19526,8 +19723,8 @@ See the command `outline-mode' for more information on this mode.
 
 ;;;***
 \f
-;;;### (autoloads nil "paragraphs" "textmodes/paragraphs.el" (17504
-;;;;;;  41540))
+;;;### (autoloads nil "paragraphs" "textmodes/paragraphs.el" (17496
+;;;;;;  38721))
 ;;; Generated autoloads from textmodes/paragraphs.el
 (put 'paragraph-start 'safe-local-variable 'stringp)
 (put 'paragraph-separate 'safe-local-variable 'stringp)
@@ -19541,7 +19738,7 @@ See the command `outline-mode' for more information on this mode.
 
 ;;;***
 \f
-;;;### (autoloads (show-paren-mode) "paren" "paren.el" (17504 41540))
+;;;### (autoloads (show-paren-mode) "paren" "paren.el" (17778 50475))
 ;;; Generated autoloads from paren.el
 
 (defvar show-paren-mode nil "\
@@ -19566,7 +19763,7 @@ in `show-paren-style' after `show-paren-delay' seconds of Emacs idle time.
 ;;;***
 \f
 ;;;### (autoloads (parse-time-string) "parse-time" "calendar/parse-time.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 27324))
 ;;; Generated autoloads from calendar/parse-time.el
 
 (autoload (quote parse-time-string) "parse-time" "\
@@ -19578,8 +19775,8 @@ unknown are returned as nil.
 
 ;;;***
 \f
-;;;### (autoloads (pascal-mode) "pascal" "progmodes/pascal.el" (17504
-;;;;;;  41540))
+;;;### (autoloads (pascal-mode) "pascal" "progmodes/pascal.el" (17390
+;;;;;;  27409))
 ;;; Generated autoloads from progmodes/pascal.el
 
 (autoload (quote pascal-mode) "pascal" "\
@@ -19632,7 +19829,7 @@ no args, if that value is non-nil.
 ;;;***
 \f
 ;;;### (autoloads (pc-bindings-mode) "pc-mode" "emulation/pc-mode.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 26938))
 ;;; Generated autoloads from emulation/pc-mode.el
 
 (autoload (quote pc-bindings-mode) "pc-mode" "\
@@ -19650,17 +19847,18 @@ C-Escape does list-buffers.
 ;;;***
 \f
 ;;;### (autoloads (pc-selection-mode pc-selection-mode) "pc-select"
-;;;;;;  "emulation/pc-select.el" (17504 41540))
+;;;;;;  "emulation/pc-select.el" (17390 26938))
 ;;; Generated autoloads from emulation/pc-select.el
 
 (defvar pc-selection-mode nil "\
 Non-nil if Pc-Selection mode is enabled.
 See the command `pc-selection-mode' for a description of this minor-mode.
 Setting this variable directly does not take effect;
-either customize it (see the info node `Easy Customization')
-or call the function `pc-selection-mode'.")
+use either \\[customize] or the function `pc-selection-mode'.")
+
+(custom-autoload (quote pc-selection-mode) "pc-select")
 
-(custom-autoload (quote pc-selection-mode) "pc-select" nil)
+(put (quote pc-selection-mode) (quote custom-set) (quote custom-set-minor-mode))
 
 (autoload (quote pc-selection-mode) "pc-select" "\
 Change mark behavior to emulate Motif, MAC or MS-Windows cut and paste style.
@@ -19722,12 +19920,12 @@ This mode enables Delete Selection mode and Transient Mark mode.
 Setting this variable directly does not take effect;
 you must modify it using \\[customize] or \\[pc-selection-mode].")
 
-(custom-autoload (quote pc-selection-mode) "pc-select" nil)
+(custom-autoload (quote pc-selection-mode) "pc-select")
 
 ;;;***
 \f
-;;;### (autoloads (pcomplete/cvs) "pcmpl-cvs" "pcmpl-cvs.el" (17504
-;;;;;;  41540))
+;;;### (autoloads (pcomplete/cvs) "pcmpl-cvs" "pcmpl-cvs.el" (17390
+;;;;;;  26944))
 ;;; Generated autoloads from pcmpl-cvs.el
 
 (autoload (quote pcomplete/cvs) "pcmpl-cvs" "\
@@ -19738,7 +19936,7 @@ Completion rules for the `cvs' command.
 ;;;***
 \f
 ;;;### (autoloads (pcomplete/tar pcomplete/make pcomplete/bzip2 pcomplete/gzip)
-;;;;;;  "pcmpl-gnu" "pcmpl-gnu.el" (17504 41540))
+;;;;;;  "pcmpl-gnu" "pcmpl-gnu.el" (17390 26944))
 ;;; Generated autoloads from pcmpl-gnu.el
 
 (autoload (quote pcomplete/gzip) "pcmpl-gnu" "\
@@ -19766,7 +19964,7 @@ Completion for the GNU tar utility.
 ;;;***
 \f
 ;;;### (autoloads (pcomplete/mount pcomplete/umount pcomplete/kill)
-;;;;;;  "pcmpl-linux" "pcmpl-linux.el" (17504 41540))
+;;;;;;  "pcmpl-linux" "pcmpl-linux.el" (17390 26944))
 ;;; Generated autoloads from pcmpl-linux.el
 
 (autoload (quote pcomplete/kill) "pcmpl-linux" "\
@@ -19786,8 +19984,8 @@ Completion for GNU/Linux `mount'.
 
 ;;;***
 \f
-;;;### (autoloads (pcomplete/rpm) "pcmpl-rpm" "pcmpl-rpm.el" (17504
-;;;;;;  41540))
+;;;### (autoloads (pcomplete/rpm) "pcmpl-rpm" "pcmpl-rpm.el" (17390
+;;;;;;  26944))
 ;;; Generated autoloads from pcmpl-rpm.el
 
 (autoload (quote pcomplete/rpm) "pcmpl-rpm" "\
@@ -19803,7 +20001,7 @@ You can use \\[eshell-report-bug] to do so.
 \f
 ;;;### (autoloads (pcomplete/chgrp pcomplete/chown pcomplete/which
 ;;;;;;  pcomplete/xargs pcomplete/rm pcomplete/rmdir pcomplete/cd)
-;;;;;;  "pcmpl-unix" "pcmpl-unix.el" (17504 41540))
+;;;;;;  "pcmpl-unix" "pcmpl-unix.el" (17390 26944))
 ;;; Generated autoloads from pcmpl-unix.el
 
 (autoload (quote pcomplete/cd) "pcmpl-unix" "\
@@ -19849,8 +20047,8 @@ Completion for the `chgrp' command.
 \f
 ;;;### (autoloads (pcomplete-shell-setup pcomplete-comint-setup pcomplete-list
 ;;;;;;  pcomplete-help pcomplete-expand pcomplete-continue pcomplete-expand-and-complete
-;;;;;;  pcomplete-reverse pcomplete) "pcomplete" "pcomplete.el" (17504
-;;;;;;  41540))
+;;;;;;  pcomplete-reverse pcomplete) "pcomplete" "pcomplete.el" (17466
+;;;;;;  27845))
 ;;; Generated autoloads from pcomplete.el
 
 (autoload (quote pcomplete) "pcomplete" "\
@@ -19909,7 +20107,7 @@ Setup shell-mode to use pcomplete.
 \f
 ;;;### (autoloads (cvs-dired-use-hook cvs-dired-action cvs-status
 ;;;;;;  cvs-update cvs-examine cvs-quickdir cvs-checkout) "pcvs"
-;;;;;;  "pcvs.el" (17759 28868))
+;;;;;;  "pcvs.el" (17778 50475))
 ;;; Generated autoloads from pcvs.el
 
 (autoload (quote cvs-checkout) "pcvs" "\
@@ -19986,7 +20184,7 @@ The exact behavior is determined also by `cvs-dired-use-hook'." (when (stringp d
 
 ;;;***
 \f
-;;;### (autoloads nil "pcvs-defs" "pcvs-defs.el" (17672 28070))
+;;;### (autoloads nil "pcvs-defs" "pcvs-defs.el" (17713 5990))
 ;;; Generated autoloads from pcvs-defs.el
 
 (defvar cvs-global-menu (let ((m (make-sparse-keymap "PCL-CVS"))) (define-key m [status] (quote (menu-item "Directory Status" cvs-status :help "A more verbose status of a workarea"))) (define-key m [checkout] (quote (menu-item "Checkout Module" cvs-checkout :help "Check out a module from the repository"))) (define-key m [update] (quote (menu-item "Update Directory" cvs-update :help "Fetch updates from the repository"))) (define-key m [examine] (quote (menu-item "Examine Directory" cvs-examine :help "Examine the current state of a workarea"))) (fset (quote cvs-global-menu) m)))
@@ -19994,7 +20192,7 @@ The exact behavior is determined also by `cvs-dired-use-hook'." (when (stringp d
 ;;;***
 \f
 ;;;### (autoloads (perl-mode) "perl-mode" "progmodes/perl-mode.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17499 10453))
 ;;; Generated autoloads from progmodes/perl-mode.el
 
 (autoload (quote perl-mode) "perl-mode" "\
@@ -20052,7 +20250,7 @@ Turning on Perl mode runs the normal hook `perl-mode-hook'.
 ;;;### (autoloads (pgg-snarf-keys pgg-snarf-keys-region pgg-insert-key
 ;;;;;;  pgg-verify pgg-verify-region pgg-sign pgg-sign-region pgg-decrypt
 ;;;;;;  pgg-decrypt-region pgg-encrypt pgg-encrypt-symmetric pgg-encrypt-symmetric-region
-;;;;;;  pgg-encrypt-region) "pgg" "pgg.el" (17661 56347))
+;;;;;;  pgg-encrypt-region) "pgg" "pgg.el" (17713 5990))
 ;;; Generated autoloads from pgg.el
 
 (autoload (quote pgg-encrypt-region) "pgg" "\
@@ -20186,7 +20384,7 @@ Import public keys in the current buffer.
 ;;;***
 \f
 ;;;### (autoloads (pgg-gpg-symmetric-key-p) "pgg-gpg" "pgg-gpg.el"
-;;;;;;  (17664 29027))
+;;;;;;  (17713 5990))
 ;;; Generated autoloads from pgg-gpg.el
 
 (autoload (quote pgg-gpg-symmetric-key-p) "pgg-gpg" "\
@@ -20197,7 +20395,7 @@ True if decoded armor MESSAGE-KEYS has symmetric encryption indicator.
 ;;;***
 \f
 ;;;### (autoloads (picture-mode) "picture" "textmodes/picture.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17466 28579))
 ;;; Generated autoloads from textmodes/picture.el
 
 (autoload (quote picture-mode) "picture" "\
@@ -20278,7 +20476,7 @@ they are not defaultly assigned to keys.
 ;;;***
 \f
 ;;;### (autoloads (po-find-file-coding-system) "po" "textmodes/po.el"
-;;;;;;  (17604 18984))
+;;;;;;  (17611 9183))
 ;;; Generated autoloads from textmodes/po.el
 
 (autoload (quote po-find-file-coding-system) "po" "\
@@ -20289,7 +20487,7 @@ Called through `file-coding-system-alist', before the file is visited for real.
 
 ;;;***
 \f
-;;;### (autoloads (pong) "pong" "play/pong.el" (17557 12730))
+;;;### (autoloads (pong) "pong" "play/pong.el" (17549 5052))
 ;;; Generated autoloads from play/pong.el
 
 (autoload (quote pong) "pong" "\
@@ -20306,7 +20504,7 @@ pong-mode keybindings:\\<pong-mode-map>
 ;;;***
 \f
 ;;;### (autoloads (pp-eval-last-sexp pp-eval-expression pp pp-buffer
-;;;;;;  pp-to-string) "pp" "emacs-lisp/pp.el" (17746 34861))
+;;;;;;  pp-to-string) "pp" "emacs-lisp/pp.el" (17778 50473))
 ;;; Generated autoloads from emacs-lisp/pp.el
 
 (autoload (quote pp-to-string) "pp" "\
@@ -20367,7 +20565,7 @@ Ignores leading comment characters.
 ;;;;;;  pr-ps-buffer-print pr-ps-buffer-using-ghostscript pr-ps-buffer-preview
 ;;;;;;  pr-ps-directory-ps-print pr-ps-directory-print pr-ps-directory-using-ghostscript
 ;;;;;;  pr-ps-directory-preview pr-interface) "printing" "printing.el"
-;;;;;;  (17746 34861))
+;;;;;;  (17778 50475))
 ;;; Generated autoloads from printing.el
 
 (autoload (quote pr-interface) "printing" "\
@@ -20955,7 +21153,7 @@ are both set to t.
 ;;;***
 \f
 ;;;### (autoloads (switch-to-prolog prolog-mode) "prolog" "progmodes/prolog.el"
-;;;;;;  (17665 30176))
+;;;;;;  (17713 5991))
 ;;; Generated autoloads from progmodes/prolog.el
 
 (autoload (quote prolog-mode) "prolog" "\
@@ -20978,7 +21176,7 @@ With prefix argument \\[universal-prefix], prompt for the program to use.
 
 ;;;***
 \f
-;;;### (autoloads nil "ps-bdf" "ps-bdf.el" (17504 41540))
+;;;### (autoloads nil "ps-bdf" "ps-bdf.el" (17778 50476))
 ;;; Generated autoloads from ps-bdf.el
 
 (defvar bdf-directory-list (if (memq system-type (quote (ms-dos windows-nt))) (list (expand-file-name "fonts/bdf" installation-directory)) (quote ("/usr/local/share/emacs/fonts/bdf"))) "\
@@ -20987,8 +21185,8 @@ The default value is '(\"/usr/local/share/emacs/fonts/bdf\").")
 
 ;;;***
 \f
-;;;### (autoloads (ps-mode) "ps-mode" "progmodes/ps-mode.el" (17504
-;;;;;;  41540))
+;;;### (autoloads (ps-mode) "ps-mode" "progmodes/ps-mode.el" (17390
+;;;;;;  27409))
 ;;; Generated autoloads from progmodes/ps-mode.el
 
 (autoload (quote ps-mode) "ps-mode" "\
@@ -21037,7 +21235,7 @@ Typing \\<ps-run-mode-map>\\[ps-run-goto-error] when the cursor is at the number
 ;;;### (autoloads (ps-mule-begin-page ps-mule-begin-job ps-mule-encode-header-string
 ;;;;;;  ps-mule-initialize ps-mule-plot-composition ps-mule-plot-string
 ;;;;;;  ps-mule-set-ascii-font ps-mule-prepare-ascii-font ps-multibyte-buffer)
-;;;;;;  "ps-mule" "ps-mule.el" (17504 41540))
+;;;;;;  "ps-mule" "ps-mule.el" (17778 50476))
 ;;; Generated autoloads from ps-mule.el
 
 (defvar ps-multibyte-buffer nil "\
@@ -21158,8 +21356,8 @@ Not documented
 ;;;;;;  ps-spool-region ps-spool-buffer-with-faces ps-spool-buffer
 ;;;;;;  ps-print-region-with-faces ps-print-region ps-print-buffer-with-faces
 ;;;;;;  ps-print-buffer ps-print-customize ps-print-color-p ps-paper-type
-;;;;;;  ps-page-dimensions-database) "ps-print" "ps-print.el" (17686
-;;;;;;  35929))
+;;;;;;  ps-page-dimensions-database) "ps-print" "ps-print.el" (17778
+;;;;;;  50476))
 ;;; Generated autoloads from ps-print.el
 
 (defvar ps-page-dimensions-database (list (list (quote a4) (/ (* 72 21.0) 2.54) (/ (* 72 29.7) 2.54) "A4") (list (quote a3) (/ (* 72 29.7) 2.54) (/ (* 72 42.0) 2.54) "A3") (list (quote letter) (* 72 8.5) (* 72 11.0) "Letter") (list (quote legal) (* 72 8.5) (* 72 14.0) "Legal") (list (quote letter-small) (* 72 7.68) (* 72 10.16) "LetterSmall") (list (quote tabloid) (* 72 11.0) (* 72 17.0) "Tabloid") (list (quote ledger) (* 72 17.0) (* 72 11.0) "Ledger") (list (quote statement) (* 72 5.5) (* 72 8.5) "Statement") (list (quote executive) (* 72 7.5) (* 72 10.0) "Executive") (list (quote a4small) (* 72 7.47) (* 72 10.85) "A4Small") (list (quote b4) (* 72 10.125) (* 72 14.33) "B4") (list (quote b5) (* 72 7.16) (* 72 10.125) "B5")) "\
@@ -21356,7 +21554,7 @@ If EXTENSION is any other symbol, it is ignored.
 ;;;***
 \f
 ;;;### (autoloads (jython-mode python-mode run-python) "python" "progmodes/python.el"
-;;;;;;  (17759 28873))
+;;;;;;  (17778 50476))
 ;;; Generated autoloads from progmodes/python.el
 
 (add-to-list (quote interpreter-mode-alist) (quote ("jython" . jython-mode)))
@@ -21431,7 +21629,7 @@ Runs `jython-mode-hook' after `python-mode-hook'.
 ;;;***
 \f
 ;;;### (autoloads (quoted-printable-decode-region) "qp" "gnus/qp.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17407 3112))
 ;;; Generated autoloads from gnus/qp.el
 
 (autoload (quote quoted-printable-decode-region) "qp" "\
@@ -21454,7 +21652,7 @@ them into characters should be done separately.
 ;;;;;;  quail-defrule quail-install-decode-map quail-install-map
 ;;;;;;  quail-define-rules quail-show-keyboard-layout quail-set-keyboard-layout
 ;;;;;;  quail-define-package quail-use-package quail-title) "quail"
-;;;;;;  "international/quail.el" (17660 47810))
+;;;;;;  "international/quail.el" (17713 5990))
 ;;; Generated autoloads from international/quail.el
 
 (autoload (quote quail-title) "quail" "\
@@ -21685,8 +21883,8 @@ of each directory.
 \f
 ;;;### (autoloads (quickurl-list quickurl-list-mode quickurl-edit-urls
 ;;;;;;  quickurl-browse-url-ask quickurl-browse-url quickurl-add-url
-;;;;;;  quickurl-ask quickurl) "quickurl" "net/quickurl.el" (17504
-;;;;;;  41540))
+;;;;;;  quickurl-ask quickurl) "quickurl" "net/quickurl.el" (17390
+;;;;;;  26944))
 ;;; Generated autoloads from net/quickurl.el
 
 (defconst quickurl-reread-hook-postfix "\n;; Local Variables:\n;; eval: (progn (require 'quickurl) (add-hook 'local-write-file-hooks (lambda () (quickurl-read) nil)))\n;; End:\n" "\
@@ -21758,7 +21956,7 @@ Display `quickurl-list' as a formatted list using `quickurl-list-mode'.
 ;;;***
 \f
 ;;;### (autoloads (rcirc-track-minor-mode rcirc-connect rcirc) "rcirc"
-;;;;;;  "net/rcirc.el" (17672 28071))
+;;;;;;  "net/rcirc.el" (17778 50475))
 ;;; Generated autoloads from net/rcirc.el
 
 (autoload (quote rcirc) "rcirc" "\
@@ -21790,8 +21988,8 @@ Global minor mode for tracking activity in rcirc buffers.
 
 ;;;***
 \f
-;;;### (autoloads (remote-compile) "rcompile" "net/rcompile.el" (17578
-;;;;;;  29458))
+;;;### (autoloads (remote-compile) "rcompile" "net/rcompile.el" (17569
+;;;;;;  18006))
 ;;; Generated autoloads from net/rcompile.el
 
 (autoload (quote remote-compile) "rcompile" "\
@@ -21803,7 +22001,7 @@ See \\[compile].
 ;;;***
 \f
 ;;;### (autoloads (re-builder) "re-builder" "emacs-lisp/re-builder.el"
-;;;;;;  (17759 28868))
+;;;;;;  (17778 50473))
 ;;; Generated autoloads from emacs-lisp/re-builder.el
 
 (defalias (quote regexp-builder) (quote re-builder))
@@ -21815,7 +22013,7 @@ Construct a regexp interactively.
 
 ;;;***
 \f
-;;;### (autoloads (recentf-mode) "recentf" "recentf.el" (17718 30636))
+;;;### (autoloads (recentf-mode) "recentf" "recentf.el" (17778 48817))
 ;;; Generated autoloads from recentf.el
 
 (defvar recentf-mode nil "\
@@ -21842,8 +22040,8 @@ that were operated on recently.
 ;;;### (autoloads (clear-rectangle string-insert-rectangle string-rectangle
 ;;;;;;  delete-whitespace-rectangle open-rectangle insert-rectangle
 ;;;;;;  yank-rectangle kill-rectangle extract-rectangle delete-extract-rectangle
-;;;;;;  delete-rectangle move-to-column-force) "rect" "rect.el" (17639
-;;;;;;  6256))
+;;;;;;  delete-rectangle move-to-column-force) "rect" "rect.el" (17713
+;;;;;;  5306))
 ;;; Generated autoloads from rect.el
 
 (autoload (quote move-to-column-force) "rect" "\
@@ -21971,8 +22169,8 @@ rectangle which were empty.
 
 ;;;***
 \f
-;;;### (autoloads (refill-mode) "refill" "textmodes/refill.el" (17504
-;;;;;;  41540))
+;;;### (autoloads (refill-mode) "refill" "textmodes/refill.el" (17390
+;;;;;;  26946))
 ;;; Generated autoloads from textmodes/refill.el
 
 (autoload (quote refill-mode) "refill" "\
@@ -21988,7 +22186,7 @@ refilling if they would cause auto-filling.
 ;;;***
 \f
 ;;;### (autoloads (reftex-reset-scanning-information reftex-mode
-;;;;;;  turn-on-reftex) "reftex" "textmodes/reftex.el" (17504 41540))
+;;;;;;  turn-on-reftex) "reftex" "textmodes/reftex.el" (17405 10316))
 ;;; Generated autoloads from textmodes/reftex.el
 
 (autoload (quote turn-on-reftex) "reftex" "\
@@ -22038,7 +22236,7 @@ This enforces rescanning the buffer on next use.
 ;;;***
 \f
 ;;;### (autoloads (reftex-citation) "reftex-cite" "textmodes/reftex-cite.el"
-;;;;;;  (17746 34863))
+;;;;;;  (17778 50479))
 ;;; Generated autoloads from textmodes/reftex-cite.el
 
 (autoload (quote reftex-citation) "reftex-cite" "\
@@ -22068,7 +22266,7 @@ While entering the regexp, completion on knows citation keys is possible.
 ;;;***
 \f
 ;;;### (autoloads (reftex-isearch-minor-mode) "reftex-global" "textmodes/reftex-global.el"
-;;;;;;  (17712 1062))
+;;;;;;  (17713 5992))
 ;;; Generated autoloads from textmodes/reftex-global.el
 
 (autoload (quote reftex-isearch-minor-mode) "reftex-global" "\
@@ -22085,7 +22283,7 @@ With no argument, this command toggles
 ;;;***
 \f
 ;;;### (autoloads (reftex-index-phrases-mode) "reftex-index" "textmodes/reftex-index.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17418 6743))
 ;;; Generated autoloads from textmodes/reftex-index.el
 
 (autoload (quote reftex-index-phrases-mode) "reftex-index" "\
@@ -22118,7 +22316,7 @@ Here are all local bindings.
 ;;;***
 \f
 ;;;### (autoloads (reftex-all-document-files) "reftex-parse" "textmodes/reftex-parse.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17405 10316))
 ;;; Generated autoloads from textmodes/reftex-parse.el
 
 (autoload (quote reftex-all-document-files) "reftex-parse" "\
@@ -22130,8 +22328,8 @@ of master file.
 
 ;;;***
 \f
-;;;### (autoloads nil "reftex-vars" "textmodes/reftex-vars.el" (17704
-;;;;;;  3967))
+;;;### (autoloads nil "reftex-vars" "textmodes/reftex-vars.el" (17713
+;;;;;;  5992))
 ;;; Generated autoloads from textmodes/reftex-vars.el
 (put 'reftex-vref-is-default 'safe-local-variable (lambda (x) (or (stringp x) (symbolp x))))
 (put 'reftex-fref-is-default 'safe-local-variable (lambda (x) (or (stringp x) (symbolp x))))
@@ -22141,11 +22339,11 @@ of master file.
 ;;;***
 \f
 ;;;### (autoloads (regexp-opt-depth regexp-opt) "regexp-opt" "emacs-lisp/regexp-opt.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17778 50473))
 ;;; Generated autoloads from emacs-lisp/regexp-opt.el
 
 (autoload (quote regexp-opt) "regexp-opt" "\
-Return a regexp to match a string in STRINGS.
+Return a regexp to match a string in the list STRINGS.
 Each string should be unique in STRINGS and should not contain any regexps,
 quoted or not.  If optional PAREN is non-nil, ensure that the returned regexp
 is enclosed by at least one regexp grouping construct.
@@ -22168,7 +22366,7 @@ This means the number of non-shy regexp grouping constructs
 
 ;;;***
 \f
-;;;### (autoloads (repeat) "repeat" "repeat.el" (17504 41540))
+;;;### (autoloads (repeat) "repeat" "repeat.el" (17390 26945))
 ;;; Generated autoloads from repeat.el
 
 (autoload (quote repeat) "repeat" "\
@@ -22186,7 +22384,7 @@ can be modified by the global variable `repeat-on-final-keystroke'.
 ;;;***
 \f
 ;;;### (autoloads (reporter-submit-bug-report) "reporter" "mail/reporter.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 26943))
 ;;; Generated autoloads from mail/reporter.el
 
 (autoload (quote reporter-submit-bug-report) "reporter" "\
@@ -22218,7 +22416,7 @@ mail-sending package is used for editing and sending the message.
 ;;;***
 \f
 ;;;### (autoloads (reposition-window) "reposition" "reposition.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 26945))
 ;;; Generated autoloads from reposition.el
 
 (autoload (quote reposition-window) "reposition" "\
@@ -22245,8 +22443,8 @@ first comment line visible (if point is in a comment).
 
 ;;;***
 \f
-;;;### (autoloads (resume-suspend-hook) "resume" "resume.el" (17746
-;;;;;;  34861))
+;;;### (autoloads (resume-suspend-hook) "resume" "resume.el" (17778
+;;;;;;  50476))
 ;;; Generated autoloads from resume.el
 
 (autoload (quote resume-suspend-hook) "resume" "\
@@ -22257,7 +22455,7 @@ Clear out the file used for transmitting args when Emacs resumes.
 ;;;***
 \f
 ;;;### (autoloads (global-reveal-mode reveal-mode) "reveal" "reveal.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17496 38723))
 ;;; Generated autoloads from reveal.el
 
 (autoload (quote reveal-mode) "reveal" "\
@@ -22274,10 +22472,9 @@ With zero or negative ARG turn mode off.
 Non-nil if Global-Reveal mode is enabled.
 See the command `global-reveal-mode' for a description of this minor-mode.
 Setting this variable directly does not take effect;
-either customize it (see the info node `Easy Customization')
-or call the function `global-reveal-mode'.")
+use either \\[customize] or the function `global-reveal-mode'.")
 
-(custom-autoload (quote global-reveal-mode) "reveal" nil)
+(custom-autoload (quote global-reveal-mode) "reveal")
 
 (autoload (quote global-reveal-mode) "reveal" "\
 Toggle Reveal mode in all buffers on or off.
@@ -22292,7 +22489,7 @@ With zero or negative ARG turn mode off.
 ;;;***
 \f
 ;;;### (autoloads (make-ring ring-p) "ring" "emacs-lisp/ring.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 26938))
 ;;; Generated autoloads from emacs-lisp/ring.el
 
 (autoload (quote ring-p) "ring" "\
@@ -22307,7 +22504,7 @@ Make a ring that can contain SIZE elements.
 
 ;;;***
 \f
-;;;### (autoloads (rlogin) "rlogin" "net/rlogin.el" (17504 41540))
+;;;### (autoloads (rlogin) "rlogin" "net/rlogin.el" (17390 26944))
 ;;; Generated autoloads from net/rlogin.el
  (add-hook 'same-window-regexps "^\\*rlogin-.*\\*\\(\\|<[0-9]+>\\)")
 
@@ -22358,8 +22555,8 @@ variable.
 ;;;;;;  rmail-mail-new-frame rmail-primary-inbox-list rmail-delete-after-output
 ;;;;;;  rmail-highlight-face rmail-highlighted-headers rmail-retry-ignored-headers
 ;;;;;;  rmail-displayed-headers rmail-ignored-headers rmail-dont-reply-to-names
-;;;;;;  rmail-movemail-variant-p) "rmail" "mail/rmail.el" (17746
-;;;;;;  34862))
+;;;;;;  rmail-movemail-variant-p) "rmail" "mail/rmail.el" (17778
+;;;;;;  50475))
 ;;; Generated autoloads from mail/rmail.el
 
 (autoload (quote rmail-movemail-variant-p) "rmail" "\
@@ -22624,7 +22821,7 @@ Set PASSWORD to be used for retrieving mail from a POP or IMAP server.
 ;;;***
 \f
 ;;;### (autoloads (rmail-edit-current-message) "rmailedit" "mail/rmailedit.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 26943))
 ;;; Generated autoloads from mail/rmailedit.el
 
 (autoload (quote rmail-edit-current-message) "rmailedit" "\
@@ -22636,7 +22833,7 @@ Edit the contents of this message.
 \f
 ;;;### (autoloads (rmail-next-labeled-message rmail-previous-labeled-message
 ;;;;;;  rmail-read-label rmail-kill-label rmail-add-label) "rmailkwd"
-;;;;;;  "mail/rmailkwd.el" (17504 41540))
+;;;;;;  "mail/rmailkwd.el" (17390 26943))
 ;;; Generated autoloads from mail/rmailkwd.el
 
 (autoload (quote rmail-add-label) "rmailkwd" "\
@@ -22675,7 +22872,7 @@ With prefix argument N moves forward N messages with these labels.
 ;;;***
 \f
 ;;;### (autoloads (set-rmail-inbox-list) "rmailmsc" "mail/rmailmsc.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 26943))
 ;;; Generated autoloads from mail/rmailmsc.el
 
 (autoload (quote set-rmail-inbox-list) "rmailmsc" "\
@@ -22689,7 +22886,7 @@ If FILE-NAME is empty, remove any existing inbox list.
 \f
 ;;;### (autoloads (rmail-output-body-to-file rmail-output rmail-fields-not-to-output
 ;;;;;;  rmail-output-to-rmail-file rmail-output-file-alist) "rmailout"
-;;;;;;  "mail/rmailout.el" (17759 28870))
+;;;;;;  "mail/rmailout.el" (17778 50475))
 ;;; Generated autoloads from mail/rmailout.el
 
 (defvar rmail-output-file-alist nil "\
@@ -22756,8 +22953,8 @@ FILE-NAME defaults, interactively, from the Subject field of the message.
 \f
 ;;;### (autoloads (rmail-sort-by-labels rmail-sort-by-lines rmail-sort-by-correspondent
 ;;;;;;  rmail-sort-by-recipient rmail-sort-by-author rmail-sort-by-subject
-;;;;;;  rmail-sort-by-date) "rmailsort" "mail/rmailsort.el" (17504
-;;;;;;  41540))
+;;;;;;  rmail-sort-by-date) "rmailsort" "mail/rmailsort.el" (17390
+;;;;;;  26943))
 ;;; Generated autoloads from mail/rmailsort.el
 
 (autoload (quote rmail-sort-by-date) "rmailsort" "\
@@ -22809,18 +23006,18 @@ KEYWORDS is a comma-separated list of labels.
 ;;;;;;  rmail-summary-by-senders rmail-summary-by-topic rmail-summary-by-regexp
 ;;;;;;  rmail-summary-by-recipients rmail-summary-by-labels rmail-summary
 ;;;;;;  rmail-summary-line-count-flag rmail-summary-scroll-between-messages)
-;;;;;;  "rmailsum" "mail/rmailsum.el" (17504 41540))
+;;;;;;  "rmailsum" "mail/rmailsum.el" (17427 42815))
 ;;; Generated autoloads from mail/rmailsum.el
 
 (defvar rmail-summary-scroll-between-messages t "\
 *Non-nil means Rmail summary scroll commands move between messages.")
 
-(custom-autoload (quote rmail-summary-scroll-between-messages) "rmailsum" t)
+(custom-autoload (quote rmail-summary-scroll-between-messages) "rmailsum")
 
 (defvar rmail-summary-line-count-flag t "\
 *Non-nil means Rmail summary should show the number of lines in each message.")
 
-(custom-autoload (quote rmail-summary-line-count-flag) "rmailsum" t)
+(custom-autoload (quote rmail-summary-line-count-flag) "rmailsum")
 
 (autoload (quote rmail-summary) "rmailsum" "\
 Display a summary of all messages, one line per message.
@@ -22870,7 +23067,7 @@ SENDERS is a string of names separated by commas.
 
 By default, `identity' is set.")
 
-(custom-autoload (quote rmail-summary-line-decoder) "rmailsum" t)
+(custom-autoload (quote rmail-summary-line-decoder) "rmailsum")
 
 (defvar rmail-user-mail-address-regexp nil "\
 *Regexp matching user mail addresses.
@@ -22886,50 +23083,107 @@ Then it should be a regexp matching your mail addresses.
 
 Setting this variable has an effect only before reading a mail.")
 
-(custom-autoload (quote rmail-user-mail-address-regexp) "rmailsum" t)
+(custom-autoload (quote rmail-user-mail-address-regexp) "rmailsum")
+
+;;;***
+\f
+;;;### (autoloads (news-post-news) "rnewspost" "obsolete/rnewspost.el"
+;;;;;;  (17383 38807))
+;;; Generated autoloads from obsolete/rnewspost.el
+
+(autoload (quote news-post-news) "rnewspost" "\
+Begin editing a new USENET news article to be posted.
+Type \\[describe-mode] once editing the article to get a list of commands.
+If NOQUERY is non-nil, we do not query before doing the work.
+
+\(fn &optional NOQUERY)" t nil)
 
 ;;;***
 \f
 ;;;### (autoloads (toggle-rot13-mode rot13-other-window rot13-region
-;;;;;;  rot13-string rot13) "rot13" "rot13.el" (17504 41540))
+;;;;;;  rot13-string rot13) "rot13" "rot13.el" (17778 50476))
 ;;; Generated autoloads from rot13.el
 
 (autoload (quote rot13) "rot13" "\
-Return Rot13 encryption of OBJECT, a buffer or string.
+Return ROT13 encryption of OBJECT, a buffer or string.
 
 \(fn OBJECT &optional START END)" nil nil)
 
 (autoload (quote rot13-string) "rot13" "\
-Return Rot13 encryption of STRING.
+Return ROT13 encryption of STRING.
 
 \(fn STRING)" nil nil)
 
 (autoload (quote rot13-region) "rot13" "\
-Rot13 encrypt the region between START and END in current buffer.
+ROT13 encrypt the region between START and END in current buffer.
 
 \(fn START END)" t nil)
 
 (autoload (quote rot13-other-window) "rot13" "\
-Display current buffer in rot 13 in another window.
+Display current buffer in ROT13 in another window.
 The text itself is not modified, only the way it is displayed is affected.
 
-To terminate the rot13 display, delete that window.  As long as that window
+To terminate the ROT13 display, delete that window.  As long as that window
 is not deleted, any buffer displayed in it will become instantly encoded
-in rot 13.
+in ROT13.
 
 See also `toggle-rot13-mode'.
 
 \(fn)" t nil)
 
 (autoload (quote toggle-rot13-mode) "rot13" "\
-Toggle the use of rot 13 encoding for the current window.
+Toggle the use of ROT13 encoding for the current window.
 
 \(fn)" t nil)
 
 ;;;***
 \f
-;;;### (autoloads (ruler-mode) "ruler-mode" "ruler-mode.el" (17746
-;;;;;;  34861))
+;;;### (autoloads (resize-minibuffer-mode resize-minibuffer-frame-exactly
+;;;;;;  resize-minibuffer-frame-max-height resize-minibuffer-frame
+;;;;;;  resize-minibuffer-window-exactly resize-minibuffer-window-max-height
+;;;;;;  resize-minibuffer-mode) "rsz-mini" "obsolete/rsz-mini.el"
+;;;;;;  (17383 38807))
+;;; Generated autoloads from obsolete/rsz-mini.el
+
+(defvar resize-minibuffer-mode nil "\
+*This variable is obsolete.")
+
+(custom-autoload (quote resize-minibuffer-mode) "rsz-mini")
+
+(defvar resize-minibuffer-window-max-height nil "\
+*This variable is obsolete.")
+
+(custom-autoload (quote resize-minibuffer-window-max-height) "rsz-mini")
+
+(defvar resize-minibuffer-window-exactly t "\
+*This variable is obsolete.")
+
+(custom-autoload (quote resize-minibuffer-window-exactly) "rsz-mini")
+
+(defvar resize-minibuffer-frame nil "\
+*This variable is obsolete.")
+
+(custom-autoload (quote resize-minibuffer-frame) "rsz-mini")
+
+(defvar resize-minibuffer-frame-max-height nil "\
+*This variable is obsolete.")
+
+(custom-autoload (quote resize-minibuffer-frame-max-height) "rsz-mini")
+
+(defvar resize-minibuffer-frame-exactly t "\
+*This variable is obsolete.")
+
+(custom-autoload (quote resize-minibuffer-frame-exactly) "rsz-mini")
+
+(autoload (quote resize-minibuffer-mode) "rsz-mini" "\
+This function is obsolete.
+
+\(fn &optional PREFIX)" t nil)
+
+;;;***
+\f
+;;;### (autoloads (ruler-mode) "ruler-mode" "ruler-mode.el" (17778
+;;;;;;  50476))
 ;;; Generated autoloads from ruler-mode.el
 
 (autoload (quote ruler-mode) "ruler-mode" "\
@@ -22939,8 +23193,8 @@ Display a ruler in the header line if ARG > 0.
 
 ;;;***
 \f
-;;;### (autoloads (rx rx-to-string) "rx" "emacs-lisp/rx.el" (17504
-;;;;;;  41540))
+;;;### (autoloads (rx rx-to-string) "rx" "emacs-lisp/rx.el" (17418
+;;;;;;  6751))
 ;;; Generated autoloads from emacs-lisp/rx.el
 
 (autoload (quote rx-to-string) "rx" "\
@@ -23248,7 +23502,7 @@ enclosed in `(and ...)'.
 ;;;***
 \f
 ;;;### (autoloads (savehist-mode savehist-mode) "savehist" "savehist.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17466 28165))
 ;;; Generated autoloads from savehist.el
 
 (defvar savehist-mode nil "\
@@ -23256,7 +23510,7 @@ Mode for automatic saving of minibuffer history.
 Set this by calling the `savehist-mode' function or using the customize
 interface.")
 
-(custom-autoload (quote savehist-mode) "savehist" nil)
+(custom-autoload (quote savehist-mode) "savehist")
 
 (autoload (quote savehist-mode) "savehist" "\
 Toggle savehist-mode.
@@ -23274,7 +23528,7 @@ which is probably undesirable.
 ;;;***
 \f
 ;;;### (autoloads (dsssl-mode scheme-mode) "scheme" "progmodes/scheme.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 27409))
 ;;; Generated autoloads from progmodes/scheme.el
 
 (autoload (quote scheme-mode) "scheme" "\
@@ -23316,7 +23570,7 @@ that variable's value is a string.
 ;;;***
 \f
 ;;;### (autoloads (gnus-score-mode) "score-mode" "gnus/score-mode.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17383 38805))
 ;;; Generated autoloads from gnus/score-mode.el
 
 (autoload (quote gnus-score-mode) "score-mode" "\
@@ -23329,8 +23583,33 @@ This mode is an extended emacs-lisp mode.
 
 ;;;***
 \f
+;;;### (autoloads (scribe-mode) "scribe" "obsolete/scribe.el" (17383
+;;;;;;  38807))
+;;; Generated autoloads from obsolete/scribe.el
+
+(autoload (quote scribe-mode) "scribe" "\
+Major mode for editing files of Scribe (a text formatter) source.
+Scribe-mode is similar to text-mode, with a few extra commands added.
+\\{scribe-mode-map}
+
+Interesting variables:
+
+`scribe-fancy-paragraphs'
+  Non-nil makes Scribe mode use a different style of paragraph separation.
+
+`scribe-electric-quote'
+  Non-nil makes insert of double quote use `` or '' depending on context.
+
+`scribe-electric-parenthesis'
+  Non-nil makes an open-parenthesis char (one of `([<{')
+  automatically insert its close if typed after an @Command form.
+
+\(fn)" t nil)
+
+;;;***
+\f
 ;;;### (autoloads (scroll-all-mode) "scroll-all" "scroll-all.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17778 50476))
 ;;; Generated autoloads from scroll-all.el
 
 (defvar scroll-all-mode nil "\
@@ -23353,7 +23632,7 @@ apply to all visible windows in the same frame.
 ;;;***
 \f
 ;;;### (autoloads (scroll-lock-mode) "scroll-lock" "scroll-lock.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 26945))
 ;;; Generated autoloads from scroll-lock.el
 
 (autoload (quote scroll-lock-mode) "scroll-lock" "\
@@ -23375,7 +23654,7 @@ during scrolling.
 ;;;;;;  mail-alias-file mail-default-reply-to mail-archive-file-name
 ;;;;;;  mail-header-separator send-mail-function mail-interactive
 ;;;;;;  mail-self-blind mail-specify-envelope-from mail-from-style)
-;;;;;;  "sendmail" "mail/sendmail.el" (17660 47811))
+;;;;;;  "sendmail" "mail/sendmail.el" (17713 5990))
 ;;; Generated autoloads from mail/sendmail.el
 
 (defvar mail-from-style (quote angles) "\
@@ -23675,18 +23954,19 @@ Like `mail' command, but display mail buffer in another frame.
 
 ;;;***
 \f
-;;;### (autoloads (server-mode server-start) "server" "server.el"
-;;;;;;  (17759 28868))
+;;;### (autoloads (server-save-buffers-kill-terminal server-mode
+;;;;;;  server-start) "server" "server.el" (17778 59051))
 ;;; Generated autoloads from server.el
 
 (autoload (quote server-start) "server" "\
 Allow this Emacs process to be a server for client processes.
 This starts a server communications subprocess through which
-client \"editors\" can send your editing commands to this Emacs job.
-To use the server, set up the program `emacsclient' in the
+client \"editors\" can send your editing commands to this Emacs
+job.  To use the server, set up the program `emacsclient' in the
 Emacs distribution as your standard \"editor\".
 
-Prefix arg means just kill any existing server communications subprocess.
+Prefix arg LEAVE-DEAD means just kill any existing server
+communications subprocess.
 
 \(fn &optional LEAVE-DEAD)" t nil)
 
@@ -23707,9 +23987,19 @@ Server mode runs a process that accepts commands from the
 
 \(fn &optional ARG)" t nil)
 
+(autoload (quote server-save-buffers-kill-terminal) "server" "\
+Offer to save each buffer, then kill PROC.
+
+With prefix arg, silently save all file-visiting buffers, then kill.
+
+If emacsclient was started with a list of filenames to edit, then
+only these files will be asked to be saved.
+
+\(fn PROC &optional ARG)" nil nil)
+
 ;;;***
 \f
-;;;### (autoloads (ses-mode) "ses" "ses.el" (17759 28868))
+;;;### (autoloads (ses-mode) "ses" "ses.el" (17778 50477))
 ;;; Generated autoloads from ses.el
 
 (autoload (quote ses-mode) "ses" "\
@@ -23728,7 +24018,7 @@ These are active only in the minibuffer, when entering or editing a formula:
 ;;;***
 \f
 ;;;### (autoloads (html-mode sgml-mode) "sgml-mode" "textmodes/sgml-mode.el"
-;;;;;;  (17522 22309))
+;;;;;;  (17524 8650))
 ;;; Generated autoloads from textmodes/sgml-mode.el
 
 (autoload (quote sgml-mode) "sgml-mode" "\
@@ -23796,7 +24086,7 @@ To work around that, do:
 ;;;***
 \f
 ;;;### (autoloads (sh-mode) "sh-script" "progmodes/sh-script.el"
-;;;;;;  (17710 3081))
+;;;;;;  (17713 5991))
 ;;; Generated autoloads from progmodes/sh-script.el
 (put 'sh-shell 'safe-local-variable 'symbolp)
 
@@ -23860,7 +24150,7 @@ with your script for an edit-interpret-debug cycle.
 
 ;;;***
 \f
-;;;### (autoloads (sha1) "sha1" "gnus/sha1.el" (17504 41540))
+;;;### (autoloads (sha1) "sha1" "gnus/sha1.el" (17383 38805))
 ;;; Generated autoloads from gnus/sha1.el
 
 (autoload (quote sha1) "sha1" "\
@@ -23875,7 +24165,7 @@ If BINARY is non-nil, return a string in binary form.
 ;;;***
 \f
 ;;;### (autoloads (list-load-path-shadows) "shadow" "emacs-lisp/shadow.el"
-;;;;;;  (17746 34861))
+;;;;;;  (17778 50473))
 ;;; Generated autoloads from emacs-lisp/shadow.el
 
 (autoload (quote list-load-path-shadows) "shadow" "\
@@ -23922,8 +24212,8 @@ buffer called `*Shadows*'.  Shadowings are located by calling the
 ;;;***
 \f
 ;;;### (autoloads (shadow-initialize shadow-define-regexp-group shadow-define-literal-group
-;;;;;;  shadow-define-cluster) "shadowfile" "shadowfile.el" (17746
-;;;;;;  34861))
+;;;;;;  shadow-define-cluster) "shadowfile" "shadowfile.el" (17778
+;;;;;;  50477))
 ;;; Generated autoloads from shadowfile.el
 
 (autoload (quote shadow-define-cluster) "shadowfile" "\
@@ -23962,7 +24252,7 @@ Set up file shadowing.
 ;;;***
 \f
 ;;;### (autoloads (shell shell-dumb-shell-regexp) "shell" "shell.el"
-;;;;;;  (17715 55645))
+;;;;;;  (17778 48451))
 ;;; Generated autoloads from shell.el
 
 (defvar shell-dumb-shell-regexp "cmd\\(proxy\\)?\\.exe" "\
@@ -24009,7 +24299,7 @@ Otherwise, one argument `-i' is passed to the shell.
 ;;;***
 \f
 ;;;### (autoloads (sieve-upload-and-bury sieve-upload sieve-manage)
-;;;;;;  "sieve" "gnus/sieve.el" (17504 41540))
+;;;;;;  "sieve" "gnus/sieve.el" (17383 38805))
 ;;; Generated autoloads from gnus/sieve.el
 
 (autoload (quote sieve-manage) "sieve" "\
@@ -24030,7 +24320,7 @@ Not documented
 ;;;***
 \f
 ;;;### (autoloads (sieve-mode) "sieve-mode" "gnus/sieve-mode.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17383 38805))
 ;;; Generated autoloads from gnus/sieve-mode.el
 
 (autoload (quote sieve-mode) "sieve-mode" "\
@@ -24045,14 +24335,14 @@ Turning on Sieve mode runs `sieve-mode-hook'.
 
 ;;;***
 \f
-;;;### (autoloads nil "simple" "simple.el" (17746 34861))
+;;;### (autoloads nil "simple" "simple.el" (17778 50477))
 ;;; Generated autoloads from simple.el
 (put 'fill-prefix 'safe-local-variable 'string-or-null-p)
 
 ;;;***
 \f
-;;;### (autoloads (simula-mode) "simula" "progmodes/simula.el" (17504
-;;;;;;  41540))
+;;;### (autoloads (simula-mode) "simula" "progmodes/simula.el" (17390
+;;;;;;  27409))
 ;;; Generated autoloads from progmodes/simula.el
 
 (autoload (quote simula-mode) "simula" "\
@@ -24101,7 +24391,7 @@ with no arguments, if that value is non-nil.
 ;;;***
 \f
 ;;;### (autoloads (skeleton-pair-insert-maybe skeleton-insert skeleton-proxy-new
-;;;;;;  define-skeleton) "skeleton" "skeleton.el" (17522 22308))
+;;;;;;  define-skeleton) "skeleton" "skeleton.el" (17524 8650))
 ;;; Generated autoloads from skeleton.el
 
 (defvar skeleton-filter-function (quote identity) "\
@@ -24211,7 +24501,7 @@ symmetrical ones, and the same character twice for the others.
 ;;;***
 \f
 ;;;### (autoloads (smerge-mode smerge-ediff) "smerge-mode" "smerge-mode.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17496 38723))
 ;;; Generated autoloads from smerge-mode.el
 
 (autoload (quote smerge-ediff) "smerge-mode" "\
@@ -24230,7 +24520,7 @@ Minor mode to simplify editing output from the diff3 program.
 ;;;***
 \f
 ;;;### (autoloads (smiley-buffer smiley-region) "smiley" "gnus/smiley.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17441 26811))
 ;;; Generated autoloads from gnus/smiley.el
 
 (autoload (quote smiley-region) "smiley" "\
@@ -24248,7 +24538,7 @@ interactively. If there's no argument, do it at the current buffer
 ;;;***
 \f
 ;;;### (autoloads (smtpmail-send-queued-mail smtpmail-send-it) "smtpmail"
-;;;;;;  "mail/smtpmail.el" (17718 30637))
+;;;;;;  "mail/smtpmail.el" (17778 50475))
 ;;; Generated autoloads from mail/smtpmail.el
 
 (autoload (quote smtpmail-send-it) "smtpmail" "\
@@ -24263,7 +24553,7 @@ Send mail that was queued as a result of setting `smtpmail-queue-mail'.
 
 ;;;***
 \f
-;;;### (autoloads (snake) "snake" "play/snake.el" (17504 41540))
+;;;### (autoloads (snake) "snake" "play/snake.el" (17383 38807))
 ;;; Generated autoloads from play/snake.el
 
 (autoload (quote snake) "snake" "\
@@ -24287,7 +24577,7 @@ Snake mode keybindings:
 ;;;***
 \f
 ;;;### (autoloads (snmpv2-mode snmp-mode) "snmp-mode" "net/snmp-mode.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 26944))
 ;;; Generated autoloads from net/snmp-mode.el
 
 (autoload (quote snmp-mode) "snmp-mode" "\
@@ -24318,7 +24608,7 @@ then `snmpv2-mode-hook'.
 \f
 ;;;### (autoloads (solar-equinoxes-solstices sunrise-sunset calendar-location-name
 ;;;;;;  calendar-longitude calendar-latitude calendar-time-display-form)
-;;;;;;  "solar" "calendar/solar.el" (17504 41540))
+;;;;;;  "solar" "calendar/solar.el" (17390 27324))
 ;;; Generated autoloads from calendar/solar.el
 
 (defvar calendar-time-display-form (quote (12-hours ":" minutes am-pm (if time-zone " (") time-zone (if time-zone ")"))) "\
@@ -24335,7 +24625,7 @@ For example, the form
 
 would give military-style times like `21:07 (UTC)'.")
 
-(custom-autoload (quote calendar-time-display-form) "solar" t)
+(custom-autoload (quote calendar-time-display-form) "solar")
 
 (defvar calendar-latitude nil "\
 *Latitude of `calendar-location-name' in degrees.
@@ -24347,7 +24637,7 @@ York City.
 
 This variable should be set in `site-start'.el.")
 
-(custom-autoload (quote calendar-latitude) "solar" t)
+(custom-autoload (quote calendar-latitude) "solar")
 
 (defvar calendar-longitude nil "\
 *Longitude of `calendar-location-name' in degrees.
@@ -24359,7 +24649,7 @@ York City.
 
 This variable should be set in `site-start'.el.")
 
-(custom-autoload (quote calendar-longitude) "solar" t)
+(custom-autoload (quote calendar-longitude) "solar")
 
 (defvar calendar-location-name (quote (let ((float-output-format "%.1f")) (format "%s%s, %s%s" (if (numberp calendar-latitude) (abs calendar-latitude) (+ (aref calendar-latitude 0) (/ (aref calendar-latitude 1) 60.0))) (if (numberp calendar-latitude) (if (> calendar-latitude 0) "N" "S") (if (equal (aref calendar-latitude 2) (quote north)) "N" "S")) (if (numberp calendar-longitude) (abs calendar-longitude) (+ (aref calendar-longitude 0) (/ (aref calendar-longitude 1) 60.0))) (if (numberp calendar-longitude) (if (> calendar-longitude 0) "E" "W") (if (equal (aref calendar-longitude 2) (quote east)) "E" "W"))))) "\
 *Expression evaluating to name of `calendar-longitude', `calendar-latitude'.
@@ -24368,7 +24658,7 @@ pair.
 
 This variable should be set in `site-start'.el.")
 
-(custom-autoload (quote calendar-location-name) "solar" t)
+(custom-autoload (quote calendar-location-name) "solar")
 
 (autoload (quote sunrise-sunset) "solar" "\
 Local time of sunrise and sunset for today.  Accurate to a few seconds.
@@ -24389,8 +24679,8 @@ Requires floating point.
 
 ;;;***
 \f
-;;;### (autoloads (solitaire) "solitaire" "play/solitaire.el" (17504
-;;;;;;  41540))
+;;;### (autoloads (solitaire) "solitaire" "play/solitaire.el" (17383
+;;;;;;  38807))
 ;;; Generated autoloads from play/solitaire.el
 
 (autoload (quote solitaire) "solitaire" "\
@@ -24467,7 +24757,7 @@ Pick your favourite shortcuts:
 \f
 ;;;### (autoloads (reverse-region sort-columns sort-regexp-fields
 ;;;;;;  sort-fields sort-numeric-fields sort-pages sort-paragraphs
-;;;;;;  sort-lines sort-subr) "sort" "sort.el" (17746 34861))
+;;;;;;  sort-lines sort-subr) "sort" "sort.el" (17778 50477))
 ;;; Generated autoloads from sort.el
 
 (autoload (quote sort-subr) "sort" "\
@@ -24609,8 +24899,8 @@ From a program takes two point or marker arguments, BEG and END.
 
 ;;;***
 \f
-;;;### (autoloads (spam-initialize) "spam" "gnus/spam.el" (17504
-;;;;;;  41540))
+;;;### (autoloads (spam-initialize) "spam" "gnus/spam.el" (17441
+;;;;;;  26811))
 ;;; Generated autoloads from gnus/spam.el
 
 (autoload (quote spam-initialize) "spam" "\
@@ -24622,7 +24912,7 @@ Install the spam.el hooks and do other initialization
 \f
 ;;;### (autoloads (spam-report-deagentize spam-report-agentize spam-report-url-to-file
 ;;;;;;  spam-report-url-ping-mm-url spam-report-process-queue) "spam-report"
-;;;;;;  "gnus/spam-report.el" (17504 41540))
+;;;;;;  "gnus/spam-report.el" (17390 27306))
 ;;; Generated autoloads from gnus/spam-report.el
 
 (autoload (quote spam-report-process-queue) "spam-report" "\
@@ -24665,7 +24955,7 @@ Spam reports will be queued with the method used when
 ;;;***
 \f
 ;;;### (autoloads (speedbar-get-focus speedbar-frame-mode) "speedbar"
-;;;;;;  "speedbar.el" (17746 34861))
+;;;;;;  "speedbar.el" (17778 50477))
 ;;; Generated autoloads from speedbar.el
 
 (defalias (quote speedbar) (quote speedbar-frame-mode))
@@ -24690,7 +24980,7 @@ selected.  If the speedbar frame is active, then select the attached frame.
 ;;;***
 \f
 ;;;### (autoloads (spell-string spell-region spell-word spell-buffer)
-;;;;;;  "spell" "textmodes/spell.el" (17504 41540))
+;;;;;;  "spell" "textmodes/spell.el" (17390 26946))
 ;;; Generated autoloads from textmodes/spell.el
 
 (put (quote spell-filter) (quote risky-local-variable) t)
@@ -24726,8 +25016,8 @@ Check spelling of string supplied as argument.
 
 ;;;***
 \f
-;;;### (autoloads (snarf-spooks spook) "spook" "play/spook.el" (17504
-;;;;;;  41540))
+;;;### (autoloads (snarf-spooks spook) "spook" "play/spook.el" (17383
+;;;;;;  38807))
 ;;; Generated autoloads from play/spook.el
 
 (autoload (quote spook) "spook" "\
@@ -24745,8 +25035,8 @@ Return a vector containing the lines from `spook-phrases-file'.
 ;;;### (autoloads (sql-linter sql-db2 sql-interbase sql-postgres
 ;;;;;;  sql-ms sql-ingres sql-solid sql-mysql sql-sqlite sql-informix
 ;;;;;;  sql-sybase sql-oracle sql-product-interactive sql-mode sql-help
-;;;;;;  sql-add-product-keywords) "sql" "progmodes/sql.el" (17504
-;;;;;;  41540))
+;;;;;;  sql-add-product-keywords) "sql" "progmodes/sql.el" (17390
+;;;;;;  27409))
 ;;; Generated autoloads from progmodes/sql.el
 
 (autoload (quote sql-add-product-keywords) "sql" "\
@@ -25177,8 +25467,8 @@ input.  See `sql-interactive-mode'.
 ;;;;;;  strokes-mode strokes-list-strokes strokes-load-user-strokes
 ;;;;;;  strokes-help strokes-describe-stroke strokes-do-complex-stroke
 ;;;;;;  strokes-do-stroke strokes-read-complex-stroke strokes-read-stroke
-;;;;;;  strokes-global-set-stroke) "strokes" "strokes.el" (17704
-;;;;;;  3962))
+;;;;;;  strokes-global-set-stroke) "strokes" "strokes.el" (17713
+;;;;;;  5991))
 ;;; Generated autoloads from strokes.el
 
 (autoload (quote strokes-global-set-stroke) "strokes" "\
@@ -25288,7 +25578,7 @@ Read a complex stroke and insert its glyph into the current buffer.
 ;;;***
 \f
 ;;;### (autoloads (studlify-buffer studlify-word studlify-region)
-;;;;;;  "studly" "play/studly.el" (17504 41540))
+;;;;;;  "studly" "play/studly.el" (17279 27079))
 ;;; Generated autoloads from play/studly.el
 
 (autoload (quote studlify-region) "studly" "\
@@ -25308,7 +25598,7 @@ Studlify-case the current buffer.
 
 ;;;***
 \f
-;;;### (autoloads (locate-library) "subr" "subr.el" (17759 28868))
+;;;### (autoloads (locate-library) "subr" "subr.el" (17778 50477))
 ;;; Generated autoloads from subr.el
 
 (autoload (quote locate-library) "subr" "\
@@ -25330,7 +25620,7 @@ and the file name is displayed in the echo area.
 ;;;***
 \f
 ;;;### (autoloads (sc-cite-original) "supercite" "mail/supercite.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 26943))
 ;;; Generated autoloads from mail/supercite.el
 
 (autoload (quote sc-cite-original) "supercite" "\
@@ -25362,7 +25652,7 @@ before, and `sc-post-hook' is run after the guts of this function.
 
 ;;;***
 \f
-;;;### (autoloads (t-mouse-mode) "t-mouse" "t-mouse.el" (17746 34861))
+;;;### (autoloads (t-mouse-mode) "t-mouse" "t-mouse.el" (17778 50477))
 ;;; Generated autoloads from t-mouse.el
 
 (defvar t-mouse-mode nil "\
@@ -25384,7 +25674,7 @@ Turn it on to use Emacs mouse commands, and off to use t-mouse commands.
 
 ;;;***
 \f
-;;;### (autoloads (tabify untabify) "tabify" "tabify.el" (17610 3931))
+;;;### (autoloads (tabify untabify) "tabify" "tabify.el" (17778 50477))
 ;;; Generated autoloads from tabify.el
 
 (autoload (quote untabify) "tabify" "\
@@ -25419,7 +25709,7 @@ The variable `tab-width' controls the spacing of tab stops.
 ;;;;;;  table-recognize table-insert-row-column table-insert-column
 ;;;;;;  table-insert-row table-insert table-point-left-cell-hook
 ;;;;;;  table-point-entered-cell-hook table-load-hook table-cell-map-hook)
-;;;;;;  "table" "textmodes/table.el" (17746 34863))
+;;;;;;  "table" "textmodes/table.el" (17778 50479))
 ;;; Generated autoloads from textmodes/table.el
 
 (defvar table-cell-map-hook nil "\
@@ -26007,7 +26297,7 @@ converts a table into plain text without frames.  It is a companion to
 
 ;;;***
 \f
-;;;### (autoloads (talk-connect) "talk" "talk.el" (17504 41540))
+;;;### (autoloads (talk talk-connect) "talk" "talk.el" (17390 26945))
 ;;; Generated autoloads from talk.el
 
 (autoload (quote talk-connect) "talk" "\
@@ -26015,9 +26305,14 @@ Connect to display DISPLAY for the Emacs talk group.
 
 \(fn DISPLAY)" t nil)
 
+(autoload (quote talk) "talk" "\
+Connect to the Emacs talk group from the current X display or tty frame.
+
+\(fn)" t nil)
+
 ;;;***
 \f
-;;;### (autoloads (tar-mode) "tar-mode" "tar-mode.el" (17527 7050))
+;;;### (autoloads (tar-mode) "tar-mode" "tar-mode.el" (17778 50477))
 ;;; Generated autoloads from tar-mode.el
 
 (autoload (quote tar-mode) "tar-mode" "\
@@ -26041,7 +26336,7 @@ See also: variables `tar-update-datestamp' and `tar-anal-blocksize'.
 ;;;***
 \f
 ;;;### (autoloads (tcl-help-on-word inferior-tcl tcl-mode) "tcl"
-;;;;;;  "progmodes/tcl.el" (17504 41540))
+;;;;;;  "progmodes/tcl.el" (17478 25206))
 ;;; Generated autoloads from progmodes/tcl.el
 
 (autoload (quote tcl-mode) "tcl" "\
@@ -26092,7 +26387,7 @@ Prefix argument means invert sense of `tcl-use-smart-word-finder'.
 
 ;;;***
 \f
-;;;### (autoloads (rsh telnet) "telnet" "net/telnet.el" (17504 41540))
+;;;### (autoloads (rsh telnet) "telnet" "net/telnet.el" (17390 26944))
 ;;; Generated autoloads from net/telnet.el
  (add-hook 'same-window-regexps "\\*telnet-.*\\*\\(\\|<[0-9]+>\\)")
 
@@ -26119,8 +26414,8 @@ Normally input is edited in Emacs and sent a line at a time.
 
 ;;;***
 \f
-;;;### (autoloads (ansi-term term make-term) "term" "term.el" (17566
-;;;;;;  60306))
+;;;### (autoloads (ansi-term term make-term) "term" "term.el" (17778
+;;;;;;  50478))
 ;;; Generated autoloads from term.el
 
 (autoload (quote make-term) "term" "\
@@ -26148,8 +26443,8 @@ Start a terminal-emulator in a new buffer.
 
 ;;;***
 \f
-;;;### (autoloads (terminal-emulator) "terminal" "terminal.el" (17746
-;;;;;;  34861))
+;;;### (autoloads (terminal-emulator) "terminal" "terminal.el" (17778
+;;;;;;  50479))
 ;;; Generated autoloads from terminal.el
 
 (autoload (quote terminal-emulator) "terminal" "\
@@ -26186,7 +26481,7 @@ subprocess started.
 ;;;***
 \f
 ;;;### (autoloads (testcover-this-defun) "testcover" "emacs-lisp/testcover.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 26938))
 ;;; Generated autoloads from emacs-lisp/testcover.el
 
 (autoload (quote testcover-this-defun) "testcover" "\
@@ -26196,7 +26491,7 @@ Start coverage on function under point.
 
 ;;;***
 \f
-;;;### (autoloads (tetris) "tetris" "play/tetris.el" (17504 41540))
+;;;### (autoloads (tetris) "tetris" "play/tetris.el" (17383 38807))
 ;;; Generated autoloads from play/tetris.el
 
 (autoload (quote tetris) "tetris" "\
@@ -26227,13 +26522,13 @@ tetris-mode keybindings:
 ;;;;;;  tex-start-commands tex-start-options slitex-run-command latex-run-command
 ;;;;;;  tex-run-command tex-offer-save tex-main-file tex-first-line-header-regexp
 ;;;;;;  tex-directory tex-shell-file-name) "tex-mode" "textmodes/tex-mode.el"
-;;;;;;  (17566 60308))
+;;;;;;  (17569 17779))
 ;;; Generated autoloads from textmodes/tex-mode.el
 
 (defvar tex-shell-file-name nil "\
 *If non-nil, the shell file name to run in the subshell used to run TeX.")
 
-(custom-autoload (quote tex-shell-file-name) "tex-mode" t)
+(custom-autoload (quote tex-shell-file-name) "tex-mode")
 
 (defvar tex-directory "." "\
 *Directory in which temporary files are written.
@@ -26241,7 +26536,7 @@ You can make this `/tmp' if your TEXINPUTS has no relative directories in it
 and you don't try to apply \\[tex-region] or \\[tex-buffer] when there are
 `\\input' commands with relative directories.")
 
-(custom-autoload (quote tex-directory) "tex-mode" t)
+(custom-autoload (quote tex-directory) "tex-mode")
 
 (defvar tex-first-line-header-regexp nil "\
 Regexp for matching a first line which `tex-region' should include.
@@ -26249,40 +26544,40 @@ If this is non-nil, it should be a regular expression string;
 if it matches the first line of the file,
 `tex-region' always includes the first line in the TeX run.")
 
-(custom-autoload (quote tex-first-line-header-regexp) "tex-mode" t)
+(custom-autoload (quote tex-first-line-header-regexp) "tex-mode")
 
 (defvar tex-main-file nil "\
 *The main TeX source file which includes this buffer's file.
 The command `tex-file' runs TeX on the file specified by `tex-main-file'
 if the variable is non-nil.")
 
-(custom-autoload (quote tex-main-file) "tex-mode" t)
+(custom-autoload (quote tex-main-file) "tex-mode")
 
 (defvar tex-offer-save t "\
 *If non-nil, ask about saving modified buffers before \\[tex-file] is run.")
 
-(custom-autoload (quote tex-offer-save) "tex-mode" t)
+(custom-autoload (quote tex-offer-save) "tex-mode")
 
 (defvar tex-run-command "tex" "\
 *Command used to run TeX subjob.
 TeX Mode sets `tex-command' to this string.
 See the documentation of that variable.")
 
-(custom-autoload (quote tex-run-command) "tex-mode" t)
+(custom-autoload (quote tex-run-command) "tex-mode")
 
 (defvar latex-run-command "latex" "\
 *Command used to run LaTeX subjob.
 LaTeX Mode sets `tex-command' to this string.
 See the documentation of that variable.")
 
-(custom-autoload (quote latex-run-command) "tex-mode" t)
+(custom-autoload (quote latex-run-command) "tex-mode")
 
 (defvar slitex-run-command "slitex" "\
 *Command used to run SliTeX subjob.
 SliTeX Mode sets `tex-command' to this string.
 See the documentation of that variable.")
 
-(custom-autoload (quote slitex-run-command) "tex-mode" t)
+(custom-autoload (quote slitex-run-command) "tex-mode")
 
 (defvar tex-start-options "" "\
 *TeX options to use when starting TeX.
@@ -26290,34 +26585,34 @@ These immediately precede the commands in `tex-start-commands'
 and the input file name, with no separating space and are not shell-quoted.
 If nil, TeX runs with no options.  See the documentation of `tex-command'.")
 
-(custom-autoload (quote tex-start-options) "tex-mode" t)
+(custom-autoload (quote tex-start-options) "tex-mode")
 
 (defvar tex-start-commands "\\nonstopmode\\input" "\
 *TeX commands to use when starting TeX.
 They are shell-quoted and precede the input file name, with a separating space.
 If nil, no commands are used.  See the documentation of `tex-command'.")
 
-(custom-autoload (quote tex-start-commands) "tex-mode" t)
+(custom-autoload (quote tex-start-commands) "tex-mode")
 
 (defvar latex-block-names nil "\
 *User defined LaTeX block names.
 Combined with `latex-standard-block-names' for minibuffer completion.")
 
-(custom-autoload (quote latex-block-names) "tex-mode" t)
+(custom-autoload (quote latex-block-names) "tex-mode")
 
 (defvar tex-bibtex-command "bibtex" "\
 *Command used by `tex-bibtex-file' to gather bibliographic data.
 If this string contains an asterisk (`*'), that is replaced by the file name;
 otherwise, the file name, preceded by blank, is added at the end.")
 
-(custom-autoload (quote tex-bibtex-command) "tex-mode" t)
+(custom-autoload (quote tex-bibtex-command) "tex-mode")
 
 (defvar tex-dvi-print-command "lpr -d" "\
 *Command used by \\[tex-print] to print a .dvi file.
 If this string contains an asterisk (`*'), that is replaced by the file name;
 otherwise, the file name, preceded by blank, is added at the end.")
 
-(custom-autoload (quote tex-dvi-print-command) "tex-mode" t)
+(custom-autoload (quote tex-dvi-print-command) "tex-mode")
 
 (defvar tex-alt-dvi-print-command "lpr -d" "\
 *Command used by \\[tex-print] with a prefix arg to print a .dvi file.
@@ -26334,7 +26629,7 @@ for example,
 would tell \\[tex-print] with a prefix argument to ask you which printer to
 use.")
 
-(custom-autoload (quote tex-alt-dvi-print-command) "tex-mode" t)
+(custom-autoload (quote tex-alt-dvi-print-command) "tex-mode")
 
 (defvar tex-dvi-view-command (quote (cond ((eq window-system (quote x)) "xdvi") ((eq window-system (quote w32)) "yap") (t "dvi2tty * | cat -s"))) "\
 *Command used by \\[tex-view] to display a `.dvi' file.
@@ -26344,13 +26639,13 @@ otherwise, the file name, preceded by a space, is added at the end.
 
 If the value is a form, it is evaluated to get the command to use.")
 
-(custom-autoload (quote tex-dvi-view-command) "tex-mode" t)
+(custom-autoload (quote tex-dvi-view-command) "tex-mode")
 
 (defvar tex-show-queue-command "lpq" "\
 *Command used by \\[tex-show-print-queue] to show the print queue.
 Should show the queue(s) that \\[tex-print] puts jobs on.")
 
-(custom-autoload (quote tex-show-queue-command) "tex-mode" t)
+(custom-autoload (quote tex-show-queue-command) "tex-mode")
 
 (defvar tex-default-mode (quote latex-mode) "\
 *Mode to enter for a new file that might be either TeX or LaTeX.
@@ -26358,17 +26653,17 @@ This variable is used when it can't be determined whether the file
 is plain TeX or LaTeX or what because the file contains no commands.
 Normally set to either `plain-tex-mode' or `latex-mode'.")
 
-(custom-autoload (quote tex-default-mode) "tex-mode" t)
+(custom-autoload (quote tex-default-mode) "tex-mode")
 
 (defvar tex-open-quote "``" "\
 *String inserted by typing \\[tex-insert-quote] to open a quotation.")
 
-(custom-autoload (quote tex-open-quote) "tex-mode" t)
+(custom-autoload (quote tex-open-quote) "tex-mode")
 
 (defvar tex-close-quote "''" "\
 *String inserted by typing \\[tex-insert-quote] to close a quotation.")
 
-(custom-autoload (quote tex-close-quote) "tex-mode" t)
+(custom-autoload (quote tex-close-quote) "tex-mode")
 
 (autoload (quote tex-mode) "tex-mode" "\
 Major mode for editing files of input for TeX, LaTeX, or SliTeX.
@@ -26529,7 +26824,7 @@ Major mode to edit DocTeX files.
 ;;;***
 \f
 ;;;### (autoloads (texi2info texinfo-format-region texinfo-format-buffer)
-;;;;;;  "texinfmt" "textmodes/texinfmt.el" (17746 34863))
+;;;;;;  "texinfmt" "textmodes/texinfmt.el" (17778 50479))
 ;;; Generated autoloads from textmodes/texinfmt.el
 
 (autoload (quote texinfo-format-buffer) "texinfmt" "\
@@ -26569,18 +26864,18 @@ if large.  You can use Info-split to do this manually.
 ;;;***
 \f
 ;;;### (autoloads (texinfo-mode texinfo-close-quote texinfo-open-quote)
-;;;;;;  "texinfo" "textmodes/texinfo.el" (17504 41540))
+;;;;;;  "texinfo" "textmodes/texinfo.el" (17390 26946))
 ;;; Generated autoloads from textmodes/texinfo.el
 
 (defvar texinfo-open-quote "``" "\
 *String inserted by typing \\[texinfo-insert-quote] to open a quotation.")
 
-(custom-autoload (quote texinfo-open-quote) "texinfo" t)
+(custom-autoload (quote texinfo-open-quote) "texinfo")
 
 (defvar texinfo-close-quote "''" "\
 *String inserted by typing \\[texinfo-insert-quote] to close a quotation.")
 
-(custom-autoload (quote texinfo-close-quote) "texinfo" t)
+(custom-autoload (quote texinfo-close-quote) "texinfo")
 
 (autoload (quote texinfo-mode) "texinfo" "\
 Major mode for editing Texinfo files.
@@ -26656,7 +26951,7 @@ value of `texinfo-mode-hook'.
 ;;;### (autoloads (thai-auto-composition-mode thai-composition-function
 ;;;;;;  thai-post-read-conversion thai-compose-buffer thai-compose-string
 ;;;;;;  thai-compose-region) "thai-util" "language/thai-util.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17279 27123))
 ;;; Generated autoloads from language/thai-util.el
 
 (autoload (quote thai-compose-region) "thai-util" "\
@@ -26700,7 +26995,7 @@ Minor mode for automatically correct Thai character composition.
 \f
 ;;;### (autoloads (list-at-point number-at-point symbol-at-point
 ;;;;;;  sexp-at-point thing-at-point bounds-of-thing-at-point forward-thing)
-;;;;;;  "thingatpt" "thingatpt.el" (17675 64484))
+;;;;;;  "thingatpt" "thingatpt.el" (17778 50479))
 ;;; Generated autoloads from thingatpt.el
 
 (autoload (quote forward-thing) "thingatpt" "\
@@ -26757,7 +27052,7 @@ Not documented
 \f
 ;;;### (autoloads (thumbs-dired-setroot thumbs-dired-show thumbs-dired-show-marked
 ;;;;;;  thumbs-show-from-dir thumbs-find-thumb) "thumbs" "thumbs.el"
-;;;;;;  (17591 28068))
+;;;;;;  (17591 9719))
 ;;; Generated autoloads from thumbs.el
 
 (autoload (quote thumbs-find-thumb) "thumbs" "\
@@ -26796,7 +27091,7 @@ In dired, call the setroot program on the image at point.
 ;;;;;;  tibetan-composition-function tibetan-decompose-string tibetan-decompose-region
 ;;;;;;  tibetan-compose-region tibetan-compose-string tibetan-transcription-to-tibetan
 ;;;;;;  tibetan-tibetan-to-transcription tibetan-char-p) "tibet-util"
-;;;;;;  "language/tibet-util.el" (17504 41540))
+;;;;;;  "language/tibet-util.el" (17279 27080))
 ;;; Generated autoloads from language/tibet-util.el
 
 (autoload (quote tibetan-char-p) "tibet-util" "\
@@ -26875,7 +27170,7 @@ Not documented
 ;;;***
 \f
 ;;;### (autoloads (tildify-buffer tildify-region) "tildify" "textmodes/tildify.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 26946))
 ;;; Generated autoloads from textmodes/tildify.el
 
 (autoload (quote tildify-region) "tildify" "\
@@ -26899,7 +27194,7 @@ This function performs no refilling of the changed text.
 ;;;***
 \f
 ;;;### (autoloads (display-time-mode display-time display-time-day-and-date)
-;;;;;;  "time" "time.el" (17675 64484))
+;;;;;;  "time" "time.el" (17713 5993))
 ;;; Generated autoloads from time.el
 
 (defvar display-time-day-and-date nil "\
@@ -26941,8 +27236,8 @@ This runs the normal hook `display-time-hook' after each update.
 ;;;### (autoloads (safe-date-to-time time-to-days time-to-day-in-year
 ;;;;;;  date-leap-year-p days-between date-to-day time-add time-subtract
 ;;;;;;  time-since days-to-time time-less-p seconds-to-time time-to-seconds
-;;;;;;  date-to-time) "time-date" "calendar/time-date.el" (17504
-;;;;;;  41540))
+;;;;;;  date-to-time) "time-date" "calendar/time-date.el" (17390
+;;;;;;  27324))
 ;;; Generated autoloads from calendar/time-date.el
 
 (autoload (quote date-to-time) "time-date" "\
@@ -27028,7 +27323,7 @@ If DATE is malformed, return a time value of zeros.
 ;;;***
 \f
 ;;;### (autoloads (time-stamp-toggle-active time-stamp) "time-stamp"
-;;;;;;  "time-stamp.el" (17504 41540))
+;;;;;;  "time-stamp.el" (17778 50479))
 ;;; Generated autoloads from time-stamp.el
 (put 'time-stamp-format 'safe-local-variable 'stringp)
 (put 'time-stamp-line-limit 'safe-local-variable 'integerp)
@@ -27071,7 +27366,7 @@ With ARG, turn time stamping on if and only if arg is positive.
 ;;;;;;  timeclock-workday-remaining-string timeclock-reread-log timeclock-query-out
 ;;;;;;  timeclock-change timeclock-status-string timeclock-out timeclock-in
 ;;;;;;  timeclock-modeline-display) "timeclock" "calendar/timeclock.el"
-;;;;;;  (17628 62478))
+;;;;;;  (17713 4915))
 ;;; Generated autoloads from calendar/timeclock.el
 
 (autoload (quote timeclock-modeline-display) "timeclock" "\
@@ -27172,7 +27467,7 @@ relative only to the time worked today, and not to past time.
 \f
 ;;;### (autoloads (with-timeout run-with-idle-timer add-timeout run-with-timer
 ;;;;;;  run-at-time cancel-function-timers cancel-timer) "timer"
-;;;;;;  "emacs-lisp/timer.el" (17687 61868))
+;;;;;;  "emacs-lisp/timer.el" (17713 5989))
 ;;; Generated autoloads from emacs-lisp/timer.el
 
 (defalias (quote disable-timeout) (quote cancel-timer))
@@ -27248,7 +27543,7 @@ be detected.
 ;;;***
 \f
 ;;;### (autoloads (batch-titdic-convert titdic-convert) "titdic-cnv"
-;;;;;;  "international/titdic-cnv.el" (17504 41540))
+;;;;;;  "international/titdic-cnv.el" (17279 27079))
 ;;; Generated autoloads from international/titdic-cnv.el
 
 (autoload (quote titdic-convert) "titdic-cnv" "\
@@ -27271,8 +27566,8 @@ To get complete usage, invoke \"emacs -batch -f batch-titdic-convert -h\".
 ;;;***
 \f
 ;;;### (autoloads (tamil-composition-function tamil-post-read-conversion
-;;;;;;  tamil-compose-region) "tml-util" "language/tml-util.el" (17504
-;;;;;;  41540))
+;;;;;;  tamil-compose-region) "tml-util" "language/tml-util.el" (17279
+;;;;;;  27080))
 ;;; Generated autoloads from language/tml-util.el
 
 (autoload (quote tamil-compose-region) "tml-util" "\
@@ -27295,10 +27590,9 @@ PATTERN regexp.
 ;;;***
 \f
 ;;;### (autoloads (tmm-prompt tmm-menubar-mouse tmm-menubar) "tmm"
-;;;;;;  "tmm.el" (17504 41540))
+;;;;;;  "tmm.el" (17778 50479))
 ;;; Generated autoloads from tmm.el
  (define-key global-map "\M-`" 'tmm-menubar)
- (define-key global-map [f10] 'tmm-menubar)
  (define-key global-map [menu-bar mouse-1] 'tmm-menubar-mouse)
 
 (autoload (quote tmm-menubar) "tmm" "\
@@ -27336,7 +27630,7 @@ Its value should be an event that has a binding in MENU.
 \f
 ;;;### (autoloads (todo-show todo-cp todo-mode todo-print todo-top-priorities
 ;;;;;;  todo-insert-item todo-add-item-non-interactively todo-add-category)
-;;;;;;  "todo-mode" "calendar/todo-mode.el" (17504 41540))
+;;;;;;  "todo-mode" "calendar/todo-mode.el" (17390 27324))
 ;;; Generated autoloads from calendar/todo-mode.el
 
 (autoload (quote todo-add-category) "todo-mode" "\
@@ -27396,10 +27690,16 @@ Show TODO list.
 ;;;***
 \f
 ;;;### (autoloads (tool-bar-local-item-from-menu tool-bar-add-item-from-menu
-;;;;;;  tool-bar-local-item tool-bar-add-item) "tool-bar" "tool-bar.el"
-;;;;;;  (17504 41540))
+;;;;;;  tool-bar-local-item tool-bar-add-item toggle-tool-bar-mode-from-frame)
+;;;;;;  "tool-bar" "tool-bar.el" (17496 38966))
 ;;; Generated autoloads from tool-bar.el
 
+(autoload (quote toggle-tool-bar-mode-from-frame) "tool-bar" "\
+Toggle tool bar on or off, based on the status of the current frame.
+See `tool-bar-mode' for more information.
+
+\(fn &optional ARG)" t nil)
+
 (put (quote tool-bar-mode) (quote standard-value) (quote (t)))
 
 (autoload (quote tool-bar-add-item) "tool-bar" "\
@@ -27464,7 +27764,7 @@ holds a keymap.
 ;;;***
 \f
 ;;;### (autoloads (tpu-edt-on tpu-edt-mode) "tpu-edt" "emulation/tpu-edt.el"
-;;;;;;  (17746 34861))
+;;;;;;  (17778 50473))
 ;;; Generated autoloads from emulation/tpu-edt.el
 
 (defvar tpu-edt-mode nil "\
@@ -27491,7 +27791,7 @@ Turn on TPU/edt emulation.
 ;;;***
 \f
 ;;;### (autoloads (tpu-set-cursor-bound tpu-set-cursor-free tpu-set-scroll-margins)
-;;;;;;  "tpu-extras" "emulation/tpu-extras.el" (17504 41540))
+;;;;;;  "tpu-extras" "emulation/tpu-extras.el" (17390 26938))
 ;;; Generated autoloads from emulation/tpu-extras.el
 
 (autoload (quote tpu-set-scroll-margins) "tpu-extras" "\
@@ -27511,7 +27811,7 @@ Constrain the cursor to the flow of the text.
 
 ;;;***
 \f
-;;;### (autoloads (tq-create) "tq" "emacs-lisp/tq.el" (17652 14943))
+;;;### (autoloads (tq-create) "tq" "emacs-lisp/tq.el" (17713 5733))
 ;;; Generated autoloads from emacs-lisp/tq.el
 
 (autoload (quote tq-create) "tq" "\
@@ -27525,7 +27825,7 @@ to a tcp server on another machine.
 ;;;***
 \f
 ;;;### (autoloads (trace-function-background trace-function trace-buffer)
-;;;;;;  "trace" "emacs-lisp/trace.el" (17656 34194))
+;;;;;;  "trace" "emacs-lisp/trace.el" (17713 5989))
 ;;; Generated autoloads from emacs-lisp/trace.el
 
 (defvar trace-buffer "*trace-output*" "\
@@ -27562,7 +27862,7 @@ BUFFER defaults to `trace-buffer'.
 ;;;### (autoloads (tramp-unload-tramp tramp-completion-handle-file-name-completion
 ;;;;;;  tramp-completion-handle-file-name-all-completions tramp-unload-file-name-handlers
 ;;;;;;  tramp-file-name-handler tramp-completion-file-name-regexp
-;;;;;;  tramp-file-name-regexp) "tramp" "net/tramp.el" (17759 28871))
+;;;;;;  tramp-file-name-regexp) "tramp" "net/tramp.el" (17778 50475))
 ;;; Generated autoloads from net/tramp.el
 
 (defvar tramp-unified-filenames (not (featurep (quote xemacs))) "\
@@ -27675,7 +27975,7 @@ Discard Tramp from loading remote files.
 ;;;***
 \f
 ;;;### (autoloads (tramp-ftp-enable-ange-ftp) "tramp-ftp" "net/tramp-ftp.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17374 21429))
 ;;; Generated autoloads from net/tramp-ftp.el
 
 (autoload (quote tramp-ftp-enable-ange-ftp) "tramp-ftp" "\
@@ -27690,8 +27990,8 @@ Not documented
 ;;;;;;  tumme-display-thumb tumme-display-thumbs-append tumme-setup-dired-keybindings
 ;;;;;;  tumme-jump-thumbnail-buffer tumme-delete-tag tumme-tag-files
 ;;;;;;  tumme-show-all-from-dir tumme-display-thumbs tumme-dired-with-window-configuration
-;;;;;;  tumme-dired-insert-marked-thumbs) "tumme" "tumme.el" (17647
-;;;;;;  30168))
+;;;;;;  tumme-dired-insert-marked-thumbs) "tumme" "tumme.el" (17713
+;;;;;;  5410))
 ;;; Generated autoloads from tumme.el
 
 (autoload (quote tumme-dired-insert-marked-thumbs) "tumme" "\
@@ -27821,8 +28121,8 @@ easy-to-use form.
 
 ;;;***
 \f
-;;;### (autoloads (help-with-tutorial) "tutorial" "tutorial.el" (17735
-;;;;;;  57938))
+;;;### (autoloads (help-with-tutorial) "tutorial" "tutorial.el" (17778
+;;;;;;  50471))
 ;;; Generated autoloads from tutorial.el
 
 (autoload (quote help-with-tutorial) "tutorial" "\
@@ -27847,7 +28147,7 @@ resumed later.
 ;;;***
 \f
 ;;;### (autoloads (2C-split 2C-associate-buffer 2C-two-columns) "two-column"
-;;;;;;  "textmodes/two-column.el" (17706 55365))
+;;;;;;  "textmodes/two-column.el" (17713 5993))
 ;;; Generated autoloads from textmodes/two-column.el
  (autoload '2C-command "two-column" () t 'keymap)
  (global-set-key "\C-x6" '2C-command)
@@ -27898,7 +28198,7 @@ First column's text    sSs  Second column's text
 ;;;;;;  type-break type-break-mode type-break-keystroke-threshold
 ;;;;;;  type-break-good-break-interval type-break-good-rest-interval
 ;;;;;;  type-break-interval type-break-mode) "type-break" "type-break.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 26947))
 ;;; Generated autoloads from type-break.el
 
 (defvar type-break-mode nil "\
@@ -27907,12 +28207,12 @@ See the docstring for the `type-break-mode' command for more information.
 Setting this variable directly does not take effect;
 use either \\[customize] or the function `type-break-mode'.")
 
-(custom-autoload (quote type-break-mode) "type-break" nil)
+(custom-autoload (quote type-break-mode) "type-break")
 
 (defvar type-break-interval (* 60 60) "\
 *Number of seconds between scheduled typing breaks.")
 
-(custom-autoload (quote type-break-interval) "type-break" t)
+(custom-autoload (quote type-break-interval) "type-break")
 
 (defvar type-break-good-rest-interval (/ type-break-interval 6) "\
 *Number of seconds of idle time considered to be an adequate typing rest.
@@ -27924,7 +28224,7 @@ rest from typing, then the next typing break is simply rescheduled for later.
 If a break is interrupted before this much time elapses, the user will be
 asked whether or not really to interrupt the break.")
 
-(custom-autoload (quote type-break-good-rest-interval) "type-break" t)
+(custom-autoload (quote type-break-good-rest-interval) "type-break")
 
 (defvar type-break-good-break-interval nil "\
 *Number of seconds considered to be an adequate explicit typing rest.
@@ -27934,7 +28234,7 @@ length (in seconds) for a break initiated by the command `type-break',
 overriding `type-break-good-rest-interval'.  This provides querying of
 break interruptions when `type-break-good-rest-interval' is nil.")
 
-(custom-autoload (quote type-break-good-break-interval) "type-break" t)
+(custom-autoload (quote type-break-good-break-interval) "type-break")
 
 (defvar type-break-keystroke-threshold (let* ((wpm 35) (avg-word-length 5) (upper (* wpm avg-word-length (/ type-break-interval 60))) (lower (/ upper 5))) (cons lower upper)) "\
 *Upper and lower bound on number of keystrokes for considering typing break.
@@ -27958,7 +28258,7 @@ keystroke even though they really require multiple keys to generate them.
 The command `type-break-guesstimate-keystroke-threshold' can be used to
 guess a reasonably good pair of values for this variable.")
 
-(custom-autoload (quote type-break-keystroke-threshold) "type-break" t)
+(custom-autoload (quote type-break-keystroke-threshold) "type-break")
 
 (autoload (quote type-break-mode) "type-break" "\
 Enable or disable typing-break mode.
@@ -28081,7 +28381,7 @@ FRAC should be the inverse of the fractional value; for example, a value of
 ;;;***
 \f
 ;;;### (autoloads (ununderline-region underline-region) "underline"
-;;;;;;  "textmodes/underline.el" (17504 41540))
+;;;;;;  "textmodes/underline.el" (17390 26946))
 ;;; Generated autoloads from textmodes/underline.el
 
 (autoload (quote underline-region) "underline" "\
@@ -28102,7 +28402,7 @@ which specify the range to operate on.
 ;;;***
 \f
 ;;;### (autoloads (unforward-rmail-message undigestify-rmail-message)
-;;;;;;  "undigest" "mail/undigest.el" (17504 41540))
+;;;;;;  "undigest" "mail/undigest.el" (17390 26943))
 ;;; Generated autoloads from mail/undigest.el
 
 (autoload (quote undigestify-rmail-message) "undigest" "\
@@ -28121,7 +28421,7 @@ following the containing message.
 ;;;***
 \f
 ;;;### (autoloads (unrmail batch-unrmail) "unrmail" "mail/unrmail.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 26943))
 ;;; Generated autoloads from mail/unrmail.el
 
 (autoload (quote batch-unrmail) "unrmail" "\
@@ -28140,8 +28440,8 @@ Convert Rmail file FILE to system inbox format file TO-FILE.
 
 ;;;***
 \f
-;;;### (autoloads (unsafep) "unsafep" "emacs-lisp/unsafep.el" (17504
-;;;;;;  41540))
+;;;### (autoloads (unsafep) "unsafep" "emacs-lisp/unsafep.el" (17405
+;;;;;;  10313))
 ;;; Generated autoloads from emacs-lisp/unsafep.el
 
 (autoload (quote unsafep) "unsafep" "\
@@ -28154,7 +28454,7 @@ of symbols with local bindings.
 ;;;***
 \f
 ;;;### (autoloads (url-retrieve-synchronously url-retrieve) "url"
-;;;;;;  "url/url.el" (17746 34863))
+;;;;;;  "url/url.el" (17778 50479))
 ;;; Generated autoloads from url/url.el
 
 (autoload (quote url-retrieve) "url" "\
@@ -28194,7 +28494,7 @@ no further processing).  URL is either a string or a parsed URL.
 ;;;***
 \f
 ;;;### (autoloads (url-register-auth-scheme url-get-authentication)
-;;;;;;  "url-auth" "url/url-auth.el" (17504 41540))
+;;;;;;  "url-auth" "url/url-auth.el" (17383 38807))
 ;;; Generated autoloads from url/url-auth.el
 
 (autoload (quote url-get-authentication) "url-auth" "\
@@ -28236,8 +28536,8 @@ RATING   a rating between 1 and 10 of the strength of the authentication.
 ;;;***
 \f
 ;;;### (autoloads (url-cache-expired url-cache-extract url-is-cached
-;;;;;;  url-store-in-cache) "url-cache" "url/url-cache.el" (17504
-;;;;;;  41540))
+;;;;;;  url-store-in-cache) "url-cache" "url/url-cache.el" (17337
+;;;;;;  56256))
 ;;; Generated autoloads from url/url-cache.el
 
 (autoload (quote url-store-in-cache) "url-cache" "\
@@ -28262,7 +28562,7 @@ Return t iff a cached file has expired.
 
 ;;;***
 \f
-;;;### (autoloads (url-cid) "url-cid" "url/url-cid.el" (17504 41540))
+;;;### (autoloads (url-cid) "url-cid" "url/url-cid.el" (17383 38807))
 ;;; Generated autoloads from url/url-cid.el
 
 (autoload (quote url-cid) "url-cid" "\
@@ -28273,7 +28573,7 @@ Not documented
 ;;;***
 \f
 ;;;### (autoloads (url-dav-vc-registered url-dav-supported-p) "url-dav"
-;;;;;;  "url/url-dav.el" (17686 35930))
+;;;;;;  "url/url-dav.el" (17713 5993))
 ;;; Generated autoloads from url/url-dav.el
 
 (autoload (quote url-dav-supported-p) "url-dav" "\
@@ -28288,8 +28588,8 @@ Not documented
 
 ;;;***
 \f
-;;;### (autoloads (url-file) "url-file" "url/url-file.el" (17504
-;;;;;;  41540))
+;;;### (autoloads (url-file) "url-file" "url/url-file.el" (17383
+;;;;;;  38807))
 ;;; Generated autoloads from url/url-file.el
 
 (autoload (quote url-file) "url-file" "\
@@ -28300,7 +28600,7 @@ Handle file: and ftp: URLs.
 ;;;***
 \f
 ;;;### (autoloads (url-open-stream url-gateway-nslookup-host) "url-gw"
-;;;;;;  "url/url-gw.el" (17759 30290))
+;;;;;;  "url/url-gw.el" (17778 50299))
 ;;; Generated autoloads from url/url-gw.el
 
 (autoload (quote url-gateway-nslookup-host) "url-gw" "\
@@ -28319,8 +28619,8 @@ Might do a non-blocking connection; use `process-status' to check.
 ;;;***
 \f
 ;;;### (autoloads (url-insert-file-contents url-file-local-copy url-copy-file
-;;;;;;  url-handler-mode) "url-handlers" "url/url-handlers.el" (17652
-;;;;;;  14946))
+;;;;;;  url-handler-mode) "url-handlers" "url/url-handlers.el" (17713
+;;;;;;  5734))
 ;;; Generated autoloads from url/url-handlers.el
 
 (defvar url-handler-mode nil "\
@@ -28364,7 +28664,7 @@ Not documented
 ;;;***
 \f
 ;;;### (autoloads (url-http-options url-http-file-attributes url-http-file-exists-p
-;;;;;;  url-http) "url-http" "url/url-http.el" (17759 28874))
+;;;;;;  url-http) "url-http" "url/url-http.el" (17778 50479))
 ;;; Generated autoloads from url/url-http.el
 
 (autoload (quote url-http) "url-http" "\
@@ -28429,7 +28729,7 @@ HTTPS retrievals are asynchronous.")
 
 ;;;***
 \f
-;;;### (autoloads (url-irc) "url-irc" "url/url-irc.el" (17592 59703))
+;;;### (autoloads (url-irc) "url-irc" "url/url-irc.el" (17591 9873))
 ;;; Generated autoloads from url/url-irc.el
 
 (autoload (quote url-irc) "url-irc" "\
@@ -28439,8 +28739,8 @@ Not documented
 
 ;;;***
 \f
-;;;### (autoloads (url-ldap) "url-ldap" "url/url-ldap.el" (17504
-;;;;;;  41540))
+;;;### (autoloads (url-ldap) "url-ldap" "url/url-ldap.el" (17383
+;;;;;;  38807))
 ;;; Generated autoloads from url/url-ldap.el
 
 (autoload (quote url-ldap) "url-ldap" "\
@@ -28454,7 +28754,7 @@ URL can be a URL string, or a URL vector of the type returned by
 ;;;***
 \f
 ;;;### (autoloads (url-mailto url-mail) "url-mailto" "url/url-mailto.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17383 38807))
 ;;; Generated autoloads from url/url-mailto.el
 
 (autoload (quote url-mail) "url-mailto" "\
@@ -28470,7 +28770,7 @@ Handle the mailto: URL syntax.
 ;;;***
 \f
 ;;;### (autoloads (url-data url-generic-emulator-loader url-info
-;;;;;;  url-man) "url-misc" "url/url-misc.el" (17504 41540))
+;;;;;;  url-man) "url-misc" "url/url-misc.el" (17383 38807))
 ;;; Generated autoloads from url/url-misc.el
 
 (autoload (quote url-man) "url-misc" "\
@@ -28502,7 +28802,7 @@ Fetch a data URL (RFC 2397).
 ;;;***
 \f
 ;;;### (autoloads (url-snews url-news) "url-news" "url/url-news.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17374 21266))
 ;;; Generated autoloads from url/url-news.el
 
 (autoload (quote url-news) "url-news" "\
@@ -28519,7 +28819,7 @@ Not documented
 \f
 ;;;### (autoloads (url-ns-user-pref url-ns-prefs isInNet isResolvable
 ;;;;;;  dnsResolve dnsDomainIs isPlainHostName) "url-ns" "url/url-ns.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17383 38807))
 ;;; Generated autoloads from url/url-ns.el
 
 (autoload (quote isPlainHostName) "url-ns" "\
@@ -28560,7 +28860,7 @@ Not documented
 ;;;***
 \f
 ;;;### (autoloads (url-generic-parse-url url-recreate-url) "url-parse"
-;;;;;;  "url/url-parse.el" (17759 28874))
+;;;;;;  "url/url-parse.el" (17778 50479))
 ;;; Generated autoloads from url/url-parse.el
 
 (autoload (quote url-recreate-url) "url-parse" "\
@@ -28578,7 +28878,7 @@ Format is:
 ;;;***
 \f
 ;;;### (autoloads (url-setup-privacy-info) "url-privacy" "url/url-privacy.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17350 14840))
 ;;; Generated autoloads from url/url-privacy.el
 
 (autoload (quote url-setup-privacy-info) "url-privacy" "\
@@ -28594,7 +28894,7 @@ Setup variables that expose info about you and your system.
 ;;;;;;  url-strip-leading-spaces url-eat-trailing-space url-get-normalized-date
 ;;;;;;  url-lazy-message url-normalize-url url-insert-entities-in-string
 ;;;;;;  url-parse-args url-debug url-debug) "url-util" "url/url-util.el"
-;;;;;;  (17615 40606))
+;;;;;;  (17778 50479))
 ;;; Generated autoloads from url/url-util.el
 
 (defvar url-debug nil "\
@@ -28723,7 +29023,7 @@ This uses `url-current-object', set locally to the buffer.
 ;;;***
 \f
 ;;;### (autoloads (ask-user-about-supersession-threat ask-user-about-lock)
-;;;;;;  "userlock" "userlock.el" (17504 41540))
+;;;;;;  "userlock" "userlock.el" (17778 50479))
 ;;; Generated autoloads from userlock.el
 
 (autoload (quote ask-user-about-lock) "userlock" "\
@@ -28751,7 +29051,7 @@ The buffer in question is current when this function is called.
 
 ;;;***
 \f
-;;;### (autoloads nil "utf-7" "international/utf-7.el" (17504 41540))
+;;;### (autoloads nil "utf-7" "international/utf-7.el" (17279 27196))
 ;;; Generated autoloads from international/utf-7.el
 (autoload-coding-system 'utf-7 '(require 'utf-7))
 
@@ -28759,7 +29059,7 @@ The buffer in question is current when this function is called.
 \f
 ;;;### (autoloads (uudecode-decode-region uudecode-decode-region-internal
 ;;;;;;  uudecode-decode-region-external) "uudecode" "gnus/uudecode.el"
-;;;;;;  (17548 26487))
+;;;;;;  (17549 5046))
 ;;; Generated autoloads from gnus/uudecode.el
 
 (autoload (quote uudecode-decode-region-external) "uudecode" "\
@@ -28789,7 +29089,7 @@ If FILE-NAME is non-nil, save the result to FILE-NAME.
 ;;;;;;  vc-directory vc-merge vc-insert-headers vc-version-other-window
 ;;;;;;  vc-diff vc-register vc-next-action vc-do-command edit-vc-file
 ;;;;;;  with-vc-file vc-branch-part vc-trunk-p vc-before-checkin-hook
-;;;;;;  vc-checkin-hook vc-checkout-hook) "vc" "vc.el" (17721 3805))
+;;;;;;  vc-checkin-hook vc-checkout-hook) "vc" "vc.el" (17778 49122))
 ;;; Generated autoloads from vc.el
 
 (defvar vc-checkout-hook nil "\
@@ -29077,7 +29377,7 @@ colors. `vc-annotate-background' specifies the background color.
 
 ;;;***
 \f
-;;;### (autoloads nil "vc-arch" "vc-arch.el" (17504 41540))
+;;;### (autoloads nil "vc-arch" "vc-arch.el" (17390 26947))
 ;;; Generated autoloads from vc-arch.el
  (defun vc-arch-registered (file)
   (if (vc-find-root file "{arch}/=tagging-method")
@@ -29087,7 +29387,7 @@ colors. `vc-annotate-background' specifies the background color.
 
 ;;;***
 \f
-;;;### (autoloads nil "vc-cvs" "vc-cvs.el" (17504 41540))
+;;;### (autoloads nil "vc-cvs" "vc-cvs.el" (17390 26948))
 ;;; Generated autoloads from vc-cvs.el
  (defun vc-cvs-registered (f)
   (when (file-readable-p (expand-file-name
@@ -29097,7 +29397,7 @@ colors. `vc-annotate-background' specifies the background color.
 
 ;;;***
 \f
-;;;### (autoloads nil "vc-mcvs" "vc-mcvs.el" (17504 41540))
+;;;### (autoloads nil "vc-mcvs" "vc-mcvs.el" (17390 26948))
 ;;; Generated autoloads from vc-mcvs.el
  (defun vc-mcvs-registered (file)
   (if (vc-find-root file "MCVS/CVS")
@@ -29108,27 +29408,27 @@ colors. `vc-annotate-background' specifies the background color.
 ;;;***
 \f
 ;;;### (autoloads (vc-rcs-master-templates) "vc-rcs" "vc-rcs.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 26948))
 ;;; Generated autoloads from vc-rcs.el
 
 (defvar vc-rcs-master-templates (quote ("%sRCS/%s,v" "%s%s,v" "%sRCS/%s")) "\
 *Where to look for RCS master files.
 For a description of possible values, see `vc-check-master-templates'.")
 
-(custom-autoload (quote vc-rcs-master-templates) "vc-rcs" t)
+(custom-autoload (quote vc-rcs-master-templates) "vc-rcs")
  (defun vc-rcs-registered (f) (vc-default-registered 'RCS f))
 
 ;;;***
 \f
 ;;;### (autoloads (vc-sccs-master-templates) "vc-sccs" "vc-sccs.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 26948))
 ;;; Generated autoloads from vc-sccs.el
 
 (defvar vc-sccs-master-templates (quote ("%sSCCS/s.%s" "%ss.%s" vc-sccs-search-project-dir)) "\
 *Where to look for SCCS master files.
 For a description of possible values, see `vc-check-master-templates'.")
 
-(custom-autoload (quote vc-sccs-master-templates) "vc-sccs" t)
+(custom-autoload (quote vc-sccs-master-templates) "vc-sccs")
  (defun vc-sccs-registered(f) (vc-default-registered 'SCCS f))
 
 (defun vc-sccs-search-project-dir (dirname basename) "\
@@ -29138,7 +29438,7 @@ find any project directory." (let ((project-dir (getenv "PROJECTDIR")) dirs dir)
 
 ;;;***
 \f
-;;;### (autoloads nil "vc-svn" "vc-svn.el" (17746 41336))
+;;;### (autoloads nil "vc-svn" "vc-svn.el" (17778 50479))
 ;;; Generated autoloads from vc-svn.el
  (defun vc-svn-registered (f)
   (let ((admin-dir (cond ((and (eq system-type 'windows-nt)
@@ -29156,7 +29456,7 @@ find any project directory." (let ((project-dir (getenv "PROJECTDIR")) dirs dir)
 ;;;***
 \f
 ;;;### (autoloads (vhdl-mode) "vhdl-mode" "progmodes/vhdl-mode.el"
-;;;;;;  (17759 28874))
+;;;;;;  (17778 50476))
 ;;; Generated autoloads from progmodes/vhdl-mode.el
 
 (autoload (quote vhdl-mode) "vhdl-mode" "\
@@ -29697,7 +29997,7 @@ Key bindings:
 
 ;;;***
 \f
-;;;### (autoloads (vi-mode) "vi" "emulation/vi.el" (17504 41540))
+;;;### (autoloads (vi-mode) "vi" "emulation/vi.el" (17279 27079))
 ;;; Generated autoloads from emulation/vi.el
 
 (autoload (quote vi-mode) "vi" "\
@@ -29752,7 +30052,7 @@ Syntax table and abbrevs while in vi mode remain as they were in Emacs.
 ;;;### (autoloads (viqr-pre-write-conversion viqr-post-read-conversion
 ;;;;;;  viet-encode-viqr-buffer viet-encode-viqr-region viet-decode-viqr-buffer
 ;;;;;;  viet-decode-viqr-region viet-encode-viscii-char) "viet-util"
-;;;;;;  "language/viet-util.el" (17504 41540))
+;;;;;;  "language/viet-util.el" (17279 27080))
 ;;; Generated autoloads from language/viet-util.el
 
 (autoload (quote viet-encode-viscii-char) "viet-util" "\
@@ -29798,8 +30098,8 @@ Not documented
 \f
 ;;;### (autoloads (View-exit-and-edit view-mode-enter view-mode view-buffer-other-frame
 ;;;;;;  view-buffer-other-window view-buffer view-file-other-frame
-;;;;;;  view-file-other-window view-file) "view" "view.el" (17504
-;;;;;;  41540))
+;;;;;;  view-file-other-window view-file) "view" "view.el" (17390
+;;;;;;  26949))
 ;;; Generated autoloads from view.el
 
 (defvar view-mode nil "\
@@ -30008,8 +30308,8 @@ Exit View mode and make the current buffer editable.
 
 ;;;***
 \f
-;;;### (autoloads (vip-mode vip-setup) "vip" "emulation/vip.el" (17746
-;;;;;;  34861))
+;;;### (autoloads (vip-mode vip-setup) "vip" "emulation/vip.el" (17778
+;;;;;;  50473))
 ;;; Generated autoloads from emulation/vip.el
 
 (autoload (quote vip-setup) "vip" "\
@@ -30025,7 +30325,7 @@ Turn on VIP emulation of VI.
 ;;;***
 \f
 ;;;### (autoloads (viper-mode toggle-viper-mode) "viper" "emulation/viper.el"
-;;;;;;  (17746 34861))
+;;;;;;  (17778 50473))
 ;;; Generated autoloads from emulation/viper.el
 
 (autoload (quote toggle-viper-mode) "viper" "\
@@ -30042,7 +30342,7 @@ Turn on Viper emulation of Vi in Emacs. See Info node `(viper)Viper'.
 ;;;***
 \f
 ;;;### (autoloads (warn lwarn display-warning) "warnings" "emacs-lisp/warnings.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17496 38727))
 ;;; Generated autoloads from emacs-lisp/warnings.el
 
 (defvar warning-prefix-function nil "\
@@ -30131,7 +30431,7 @@ this is equivalent to `display-warning', using
 ;;;***
 \f
 ;;;### (autoloads (wdired-change-to-wdired-mode) "wdired" "wdired.el"
-;;;;;;  (17611 30621))
+;;;;;;  (17713 1026))
 ;;; Generated autoloads from wdired.el
 
 (autoload (quote wdired-change-to-wdired-mode) "wdired" "\
@@ -30147,7 +30447,7 @@ See `wdired-mode'.
 
 ;;;***
 \f
-;;;### (autoloads (webjump) "webjump" "net/webjump.el" (17504 41540))
+;;;### (autoloads (webjump) "webjump" "net/webjump.el" (17390 26944))
 ;;; Generated autoloads from net/webjump.el
 
 (autoload (quote webjump) "webjump" "\
@@ -30164,7 +30464,7 @@ Please submit bug reports and other feedback to the author, Neil W. Van Dyke
 ;;;***
 \f
 ;;;### (autoloads (which-function-mode) "which-func" "progmodes/which-func.el"
-;;;;;;  (17611 25727))
+;;;;;;  (17611 10401))
 ;;; Generated autoloads from progmodes/which-func.el
  (put 'which-func-format 'risky-local-variable t)
  (put 'which-func-current 'risky-local-variable t)
@@ -30175,8 +30475,7 @@ Please submit bug reports and other feedback to the author, Neil W. Van Dyke
 Non-nil if Which-Function mode is enabled.
 See the command `which-function-mode' for a description of this minor-mode.
 Setting this variable directly does not take effect;
-either customize it (see the info node `Easy Customization')
-or call the function `which-function-mode'.")
+use either \\[customize] or the function `which-function-mode'.")
 
 (custom-autoload (quote which-function-mode) "which-func" nil)
 
@@ -30197,7 +30496,7 @@ and off otherwise.
 ;;;;;;  whitespace-buffer whitespace-toggle-ateol-check whitespace-toggle-spacetab-check
 ;;;;;;  whitespace-toggle-indent-check whitespace-toggle-trailing-check
 ;;;;;;  whitespace-toggle-leading-check) "whitespace" "whitespace.el"
-;;;;;;  (17746 34861))
+;;;;;;  (17778 50479))
 ;;; Generated autoloads from whitespace.el
 
 (autoload (quote whitespace-toggle-leading-check) "whitespace" "\
@@ -30288,7 +30587,7 @@ This is meant to be added buffer-locally to `write-file-functions'.
 ;;;***
 \f
 ;;;### (autoloads (widget-minor-mode widget-browse-other-window widget-browse
-;;;;;;  widget-browse-at) "wid-browse" "wid-browse.el" (17504 41540))
+;;;;;;  widget-browse-at) "wid-browse" "wid-browse.el" (17390 26950))
 ;;; Generated autoloads from wid-browse.el
 
 (autoload (quote widget-browse-at) "wid-browse" "\
@@ -30315,8 +30614,8 @@ With arg, turn widget mode on if and only if arg is positive.
 ;;;***
 \f
 ;;;### (autoloads (widget-setup widget-insert widget-delete widget-create
-;;;;;;  widget-prompt-value widgetp) "wid-edit" "wid-edit.el" (17746
-;;;;;;  34861))
+;;;;;;  widget-prompt-value widgetp) "wid-edit" "wid-edit.el" (17778
+;;;;;;  50479))
 ;;; Generated autoloads from wid-edit.el
 
 (autoload (quote widgetp) "wid-edit" "\
@@ -30360,8 +30659,8 @@ Setup current buffer so editing string widgets works.
 ;;;***
 \f
 ;;;### (autoloads (windmove-default-keybindings windmove-down windmove-right
-;;;;;;  windmove-up windmove-left) "windmove" "windmove.el" (17504
-;;;;;;  41540))
+;;;;;;  windmove-up windmove-left) "windmove" "windmove.el" (17390
+;;;;;;  26950))
 ;;; Generated autoloads from windmove.el
 
 (autoload (quote windmove-left) "windmove" "\
@@ -30414,7 +30713,7 @@ Default MODIFIER is 'shift.
 ;;;***
 \f
 ;;;### (autoloads (winner-mode winner-mode) "winner" "winner.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 26950))
 ;;; Generated autoloads from winner.el
 
 (defvar winner-mode nil "\
@@ -30422,7 +30721,7 @@ Toggle Winner mode.
 Setting this variable directly does not take effect;
 use either \\[customize] or the function `winner-mode'.")
 
-(custom-autoload (quote winner-mode) "winner" nil)
+(custom-autoload (quote winner-mode) "winner")
 
 (autoload (quote winner-mode) "winner" "\
 Toggle Winner mode.
@@ -30433,7 +30732,7 @@ With arg, turn Winner mode on if and only if arg is positive.
 ;;;***
 \f
 ;;;### (autoloads (woman-find-file woman-dired-find-file woman) "woman"
-;;;;;;  "woman.el" (17715 55645))
+;;;;;;  "woman.el" (17778 48451))
 ;;; Generated autoloads from woman.el
 
 (autoload (quote woman) "woman" "\
@@ -30469,7 +30768,7 @@ decompress the file if appropriate.  See the documentation for the
 ;;;***
 \f
 ;;;### (autoloads (wordstar-mode) "ws-mode" "emulation/ws-mode.el"
-;;;;;;  (17504 41540))
+;;;;;;  (17390 26938))
 ;;; Generated autoloads from emulation/ws-mode.el
 
 (autoload (quote wordstar-mode) "ws-mode" "\
@@ -30582,7 +30881,7 @@ The key bindings are:
 ;;;***
 \f
 ;;;### (autoloads (xml-parse-region xml-parse-file) "xml" "xml.el"
-;;;;;;  (17610 3931))
+;;;;;;  (17611 9421))
 ;;; Generated autoloads from xml.el
 
 (autoload (quote xml-parse-file) "xml" "\
@@ -30607,18 +30906,19 @@ If PARSE-NS is non-nil, then QNAMES are expanded.
 
 ;;;***
 \f
-;;;### (autoloads (xterm-mouse-mode) "xt-mouse" "xt-mouse.el" (17504
-;;;;;;  41540))
+;;;### (autoloads (xterm-mouse-mode) "xt-mouse" "xt-mouse.el" (17390
+;;;;;;  26950))
 ;;; Generated autoloads from xt-mouse.el
 
 (defvar xterm-mouse-mode nil "\
 Non-nil if Xterm-Mouse mode is enabled.
 See the command `xterm-mouse-mode' for a description of this minor-mode.
 Setting this variable directly does not take effect;
-either customize it (see the info node `Easy Customization')
-or call the function `xterm-mouse-mode'.")
+use either \\[customize] or the function `xterm-mouse-mode'.")
+
+(custom-autoload (quote xterm-mouse-mode) "xt-mouse")
 
-(custom-autoload (quote xterm-mouse-mode) "xt-mouse" nil)
+(put (quote xterm-mouse-mode) (quote custom-set) (quote custom-set-minor-mode))
 
 (autoload (quote xterm-mouse-mode) "xt-mouse" "\
 Toggle XTerm mouse mode.
@@ -30636,7 +30936,7 @@ down the SHIFT key while pressing the mouse button.
 ;;;***
 \f
 ;;;### (autoloads (yenc-extract-filename yenc-decode-region) "yenc"
-;;;;;;  "gnus/yenc.el" (17504 41540))
+;;;;;;  "gnus/yenc.el" (17383 38805))
 ;;; Generated autoloads from gnus/yenc.el
 
 (autoload (quote yenc-decode-region) "yenc" "\
@@ -30652,7 +30952,7 @@ Extract file name from an yenc header.
 ;;;***
 \f
 ;;;### (autoloads (psychoanalyze-pinhead apropos-zippy insert-zippyism
-;;;;;;  yow) "yow" "play/yow.el" (17504 41540))
+;;;;;;  yow) "yow" "play/yow.el" (17383 38807))
 ;;; Generated autoloads from play/yow.el
 
 (autoload (quote yow) "yow" "\
@@ -30678,7 +30978,7 @@ Zippy goes to the analyst.
 
 ;;;***
 \f
-;;;### (autoloads (zone) "zone" "play/zone.el" (17504 41540))
+;;;### (autoloads (zone) "zone" "play/zone.el" (17383 38807))
 ;;; Generated autoloads from play/zone.el
 
 (autoload (quote zone) "zone" "\
@@ -30707,10 +31007,10 @@ Zone out, completely.
 ;;;;;;  "calendar/cal-iso.el" "calendar/cal-julian.el" "calendar/cal-mayan.el"
 ;;;;;;  "calendar/cal-menu.el" "calendar/cal-move.el" "calendar/cal-persia.el"
 ;;;;;;  "calendar/cal-tex.el" "calendar/cal-x.el" "case-table.el"
-;;;;;;  "cdl.el" "cus-dep.el" "cus-start.el" "custom.el" "dframe.el"
-;;;;;;  "dos-fns.el" "dos-vars.el" "dos-w32.el" "ediff-diff.el" "ediff-init.el"
-;;;;;;  "ediff-merg.el" "ediff-ptch.el" "ediff-vers.el" "ediff-wind.el"
-;;;;;;  "electric.el" "emacs-lisp/assoc.el" "emacs-lisp/authors.el"
+;;;;;;  "cdl.el" "cus-dep.el" "cus-load.el" "cus-start.el" "custom.el"
+;;;;;;  "dframe.el" "dos-fns.el" "dos-vars.el" "dos-w32.el" "ediff-diff.el"
+;;;;;;  "ediff-init.el" "ediff-merg.el" "ediff-ptch.el" "ediff-vers.el"
+;;;;;;  "ediff-wind.el" "electric.el" "emacs-lisp/assoc.el" "emacs-lisp/authors.el"
 ;;;;;;  "emacs-lisp/bindat.el" "emacs-lisp/byte-opt.el" "emacs-lisp/byte-run.el"
 ;;;;;;  "emacs-lisp/cl-compat.el" "emacs-lisp/cl-extra.el" "emacs-lisp/cl-macs.el"
 ;;;;;;  "emacs-lisp/cl-seq.el" "emacs-lisp/cl-specs.el" "emacs-lisp/cust-print.el"
@@ -30793,9 +31093,15 @@ Zone out, completely.
 ;;;;;;  "net/eudcb-bbdb.el" "net/eudcb-ldap.el" "net/eudcb-mab.el"
 ;;;;;;  "net/eudcb-ph.el" "net/ldap.el" "net/netrc.el" "net/tls.el"
 ;;;;;;  "net/tramp-smb.el" "net/tramp-util.el" "net/tramp-uu.el"
-;;;;;;  "net/tramp-vc.el" "net/trampver.el" "patcomp.el" "paths.el"
-;;;;;;  "pcvs-info.el" "pcvs-parse.el" "pcvs-util.el" "pgg-def.el"
-;;;;;;  "pgg-parse.el" "pgg-pgp.el" "pgg-pgp5.el" "play/gamegrid.el"
+;;;;;;  "net/tramp-vc.el" "net/trampver.el" "obsolete/awk-mode.el"
+;;;;;;  "obsolete/bg-mouse.el" "obsolete/float.el" "obsolete/hilit19.el"
+;;;;;;  "obsolete/iso-insert.el" "obsolete/iso-swed.el" "obsolete/keyswap.el"
+;;;;;;  "obsolete/mlsupport.el" "obsolete/ooutline.el" "obsolete/profile.el"
+;;;;;;  "obsolete/rnews.el" "obsolete/sc.el" "obsolete/sun-curs.el"
+;;;;;;  "obsolete/sun-fns.el" "obsolete/swedish.el" "obsolete/uncompress.el"
+;;;;;;  "obsolete/x-apollo.el" "obsolete/x-menu.el" "patcomp.el"
+;;;;;;  "paths.el" "pcvs-info.el" "pcvs-parse.el" "pcvs-util.el"
+;;;;;;  "pgg-def.el" "pgg-parse.el" "pgg-pgp.el" "pgg-pgp5.el" "play/gamegrid.el"
 ;;;;;;  "play/gametree.el" "play/meese.el" "progmodes/ada-prj.el"
 ;;;;;;  "progmodes/cc-align.el" "progmodes/cc-awk.el" "progmodes/cc-bytecomp.el"
 ;;;;;;  "progmodes/cc-cmds.el" "progmodes/cc-defs.el" "progmodes/cc-fonts.el"
@@ -30814,7 +31120,7 @@ Zone out, completely.
 ;;;;;;  "term/vt100.el" "term/vt102.el" "term/vt125.el" "term/vt200.el"
 ;;;;;;  "term/vt201.el" "term/vt220.el" "term/vt240.el" "term/vt300.el"
 ;;;;;;  "term/vt320.el" "term/vt400.el" "term/vt420.el" "term/w32-win.el"
-;;;;;;  "term/wyse50.el" "textmodes/bib-mode.el" "textmodes/makeinfo.el"
+;;;;;;  "term/wyse50.el" "termdev.el" "textmodes/bib-mode.el" "textmodes/makeinfo.el"
 ;;;;;;  "textmodes/page-ext.el" "textmodes/page.el" "textmodes/refbib.el"
 ;;;;;;  "textmodes/refer.el" "textmodes/reftex-auc.el" "textmodes/reftex-dcr.el"
 ;;;;;;  "textmodes/reftex-ref.el" "textmodes/reftex-sel.el" "textmodes/reftex-toc.el"
@@ -30825,13 +31131,13 @@ Zone out, completely.
 ;;;;;;  "url/url-nfs.el" "url/url-proxy.el" "url/url-vars.el" "url/vc-dav.el"
 ;;;;;;  "vc-hooks.el" "vcursor.el" "version.el" "vms-patch.el" "vmsproc.el"
 ;;;;;;  "vt-control.el" "vt100-led.el" "w32-fns.el" "w32-vars.el"
-;;;;;;  "widget.el" "window.el" "x-dnd.el") (17759 32231 360716))
+;;;;;;  "widget.el" "window.el" "x-dnd.el") (17778 59104 269580))
 
 ;;;***
 \f
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
+;;; Local Variables:
+;;; version-control: never
+;;; no-byte-compile: t
+;;; no-update-autoloads: t
+;;; End:
 ;;; loaddefs.el ends here
index 7d4e25d..aa019a8 100644 (file)
 (load "widget")
 (load "custom")
 (load "emacs-lisp/map-ynp")
-(load "env")
 (load "cus-start")
 (load "international/mule")
 (load "international/mule-conf.el") ;Don't get confused if someone compiled this by mistake.
+(load "env")
 (load "format")
 (load "bindings")
 (setq load-source-file-function 'load-with-code-conversion)
 (load "files")
 
+(load "startup")
+
 (load "cus-face")
 (load "faces")  ; after here, `defface' may be used.
 
 (load "indent")
 (load "window")
 (load "frame")
+(load "termdev")
 (load "term/tty-colors")
 (load "font-core")
 ;; facemenu must be loaded before font-lock, because `facemenu-keymap'
 (message "%s" (garbage-collect))
 (load "menu-bar")
 (load "paths.el")  ;Don't get confused if someone compiled paths by mistake.
-(load "startup")
 (load "emacs-lisp/lisp")
 (load "textmodes/page")
 (load "register")
       (load "international/fontset")
       (load "dnd")
       (load "mwheel")
-      (load "tool-bar")))
-(if (featurep 'x)
-    (load "x-dnd"))
+      (load "tool-bar")
+      (load "x-dnd")
+      (load "term/x-win")))
 (message "%s" (garbage-collect))
 
 (if (eq system-type 'vax-vms)
index 84a92e3..3d4a53b 100644 (file)
@@ -48,7 +48,7 @@
   :group 'emacsbug
   :type 'string)
 
-(defcustom report-emacs-bug-pretest-address "emacs-pretest-bug@gnu.org"
+(defcustom report-emacs-bug-pretest-address "multi-tty@lists.fnord.hu"
   "*Address of mailing list for GNU Emacs pretest bugs."
   :group 'emacsbug
   :type 'string)
index 0fdb0c8..fb59ef9 100644 (file)
@@ -928,15 +928,15 @@ mail status in mode line"))
        :button `(:toggle . tooltip-mode)))
 
 (define-key menu-bar-showhide-menu [menu-bar-mode]
-  '(menu-item "Menu-bar" menu-bar-mode
+  '(menu-item "Menu-bar" toggle-menu-bar-mode-from-frame
              :help "Toggle menu-bar on/off"
-             :button (:toggle . menu-bar-mode)))
+             :button (:toggle . (> (frame-parameter nil 'menu-bar-lines) 0))))
 
 (define-key menu-bar-showhide-menu [showhide-tool-bar]
-  (list 'menu-item "Tool-bar" 'tool-bar-mode
-       :help "Turn tool-bar on/off"
+  (list 'menu-item "Tool-bar" 'toggle-tool-bar-mode-from-frame
+       :help "Toggle tool-bar on/off"
        :visible `(display-graphic-p)
-       :button `(:toggle . tool-bar-mode)))
+       :button `(:toggle . (> (frame-parameter nil 'tool-bar-lines) 0))))
 
 (define-key menu-bar-options-menu [showhide]
   (list 'menu-item "Show/Hide" menu-bar-showhide-menu))
@@ -1744,18 +1744,10 @@ turn on menu bars; otherwise, turn off menu bars."
   :init-value nil
   :global t
   :group 'frames
+
   ;; Make menu-bar-mode and default-frame-alist consistent.
-  (let ((lines (if menu-bar-mode 1 0)))
-    ;; Alter existing frames...
-    (mapc (lambda (frame)
-           (modify-frame-parameters frame
-                                    (list (cons 'menu-bar-lines lines))))
-         (frame-list))
-    ;; ...and future ones.
-    (let ((elt (assq 'menu-bar-lines default-frame-alist)))
-      (if elt
-         (setcdr elt lines)
-       (add-to-list 'default-frame-alist (cons 'menu-bar-lines lines)))))
+  (modify-all-frames-parameters (list (cons 'menu-bar-lines
+                                           (if menu-bar-mode 1 0))))
 
   ;; Make the message appear when Emacs is idle.  We can not call message
   ;; directly.  The minor-mode message "Menu-bar mode disabled" comes
@@ -1765,6 +1757,30 @@ turn on menu bars; otherwise, turn off menu bars."
                         "Menu-bar mode disabled.  Use M-x menu-bar-mode to make the menu bar appear."))
   menu-bar-mode)
 
+(defun toggle-menu-bar-mode-from-frame (&optional arg)
+  "Toggle menu bar on or off, based on the status of the current frame.
+See `menu-bar-mode' for more information."
+  (interactive (list (or current-prefix-arg 'toggle)))
+  (if (eq arg 'toggle)
+      (menu-bar-mode (if (> (frame-parameter nil 'menu-bar-lines) 0) 0 1))
+    (menu-bar-mode arg)))
+
+(defun menu-bar-open (&optional frame)
+  "Start key navigation of the menu bar in FRAME.
+
+This function decides which method to use to access the menu
+depending on FRAME's terminal device.  On X displays, it calls
+`x-menu-bar-open'; otherwise it calls `tmm-menubar'.
+
+If FRAME is nil or not given, use the selected frame."
+  (interactive)
+  (if (eq window-system 'x)
+      (x-menu-bar-open frame)
+    (with-selected-frame (or frame (selected-frame))
+      (tmm-menubar))))
+
+(global-set-key [f10] 'menu-bar-open)
+
 (provide 'menu-bar)
 
 ;;; arch-tag: 6e6a3c22-4ec4-4d3d-8190-583f8ef94ced
index 7a45dcd..f624ac5 100644 (file)
@@ -2004,7 +2004,7 @@ COLLAPSE non-nil means collapse the branch."
     (fillarray (car (cdr map)) 'ebrowse-electric-list-undefined)
     (fillarray (car (cdr submap)) 'ebrowse-electric-list-undefined)
     (define-key map "\e" submap)
-    (define-key map "\C-z" 'suspend-emacs)
+    (define-key map "\C-z" 'suspend-frame)
     (define-key map "\C-h" 'Helper-help)
     (define-key map "?" 'Helper-describe-bindings)
     (define-key map "\C-c" nil)
@@ -3964,7 +3964,7 @@ Prefix arg ARG says how much."
     (fillarray (car (cdr map)) 'ebrowse-electric-position-undefined)
     (fillarray (car (cdr submap)) 'ebrowse-electric-position-undefined)
     (define-key map "\e" submap)
-    (define-key map "\C-z" 'suspend-emacs)
+    (define-key map "\C-z" 'suspend-frame)
     (define-key map "\C-h" 'Helper-help)
     (define-key map "?" 'Helper-describe-bindings)
     (define-key map "\C-c" nil)
index 69d696f..4801f9e 100644 (file)
@@ -88,21 +88,8 @@ This is nil while loading `scroll-bar.el', and t afterward.")
   (setq scroll-bar-mode value)
 
   (when scroll-bar-mode-explicit
-    ;; Apply it to default-frame-alist.
-    (let ((parameter (assq 'vertical-scroll-bars default-frame-alist)))
-      (if (consp parameter)
-         (setcdr parameter scroll-bar-mode)
-       (setq default-frame-alist
-             (cons (cons 'vertical-scroll-bars scroll-bar-mode)
-                   default-frame-alist))))
-
-    ;; Apply it to existing frames.
-    (let ((frames (frame-list)))
-      (while frames
-       (modify-frame-parameters
-        (car frames)
-        (list (cons 'vertical-scroll-bars scroll-bar-mode)))
-       (setq frames (cdr frames))))))
+    (modify-all-frames-parameters (list (cons 'vertical-scroll-bars
+                                             scroll-bar-mode)))))
 
 (defcustom scroll-bar-mode default-frame-scroll-bars
   "*Specify whether to have vertical scroll bars, and on which side.
index 3ae585e..7a4179e 100644 (file)
@@ -8,6 +8,7 @@
 ;; Keywords: processes
 
 ;; Changes by peck@sun.com and by rms.
+;; Overhaul by Karoly Lorentey <lorentey@elte.hu> for multi-tty support.
 
 ;; This file is part of GNU Emacs.
 
@@ -41,7 +42,7 @@
 ;; This program transmits the file names to Emacs through
 ;; the server subprocess, and Emacs visits them and lets you edit them.
 
-;; Note that any number of clients may dispatch files to emacs to be edited.
+;; Note that any number of clients may dispatch files to Emacs to be edited.
 
 ;; When you finish editing a Server buffer, again call server-edit
 ;; to mark that buffer as done for the client and switch to the next
@@ -138,12 +139,11 @@ If set, the server accepts remote connections; otherwise it is local."
 
 (defvar server-clients nil
   "List of current server clients.
-Each element is (CLIENTID BUFFERS...) where CLIENTID is a string
-that can be given to the server process to identify a client.
-When a buffer is marked as \"done\", it is removed from this list.")
+Each element is (PROC PROPERTIES...) where PROC is a process object,
+and PROPERTIES is an association list of client properties.")
 
 (defvar server-buffer-clients nil
-  "List of client ids for clients requesting editing of current buffer.")
+  "List of client processes requesting editing of current buffer.")
 (make-variable-buffer-local 'server-buffer-clients)
 ;; Changing major modes should not erase this local.
 (put 'server-buffer-clients 'permanent-local t)
@@ -197,34 +197,164 @@ are done with it in the server.")
 
 (defvar server-name "server")
 
-(defvar server-socket-dir
-  (format "/tmp/emacs%d" (user-uid)))
+(defvar server-socket-dir nil
+  "The directory in which to place the server socket.
+Initialized by `server-start'.")
+
+(defun server-client (proc)
+  "Return the Emacs client corresponding to PROC.
+PROC must be a process object.
+The car of the result is PROC; the cdr is an association list.
+See `server-client-get' and `server-client-set'."
+  (assq proc server-clients))
+
+(defun server-client-get (client property)
+  "Get the value of PROPERTY in CLIENT.
+CLIENT may be a process object, or a client returned by `server-client'.
+Return nil if CLIENT has no such property."
+  (or (listp client) (setq client (server-client client)))
+  (cdr (assq property (cdr client))))
+
+(defun server-client-set (client property value)
+  "Set the PROPERTY to VALUE in CLIENT, and return VALUE.
+CLIENT may be a process object, or a client returned by `server-client'."
+  (let (p proc)
+    (if (listp client)
+       (setq proc (car client))
+      (setq proc client
+           client (server-client client)))
+    (setq p (assq property client))
+    (cond
+     (p (setcdr p value))
+     (client (setcdr client (cons (cons property value) (cdr client))))
+     (t (setq server-clients
+             `((,proc (,property . ,value)) . ,server-clients))))
+    value))
+
+(defun server-clients-with (property value)
+  "Return a list of clients with PROPERTY set to VALUE."
+  (let (result)
+    (dolist (client server-clients result)
+      (when (equal value (server-client-get client property))
+       (setq result (cons (car client) result))))))
+
+(defun server-add-client (proc)
+  "Create a client for process PROC, if it doesn't already have one.
+New clients have no properties."
+  (unless (server-client proc)
+    (setq server-clients (cons (cons proc nil)
+                              server-clients))))
+
+(defun server-getenv-from (env variable)
+  "Get the value of VARIABLE in ENV.
+VARIABLE should be a string.  Value is nil if VARIABLE is
+undefined in ENV.  Otherwise, value is a string.
+
+ENV should be in the same format as `process-environment'."
+  (let (entry result)
+    (while (and env (null result))
+      (setq entry (car env)
+           env (cdr env))
+      (if (and (> (length entry) (length variable))
+              (eq ?= (aref entry (length variable)))
+              (equal variable (substring entry 0 (length variable))))
+         (setq result (substring entry (+ (length variable) 1)))))
+    result))
+
+(defmacro server-with-environment (env vars &rest body)
+  "Evaluate BODY with environment variables VARS set to those in ENV.
+The environment variables are then restored to their previous values.
+
+VARS should be a list of strings.
+ENV should be in the same format as `process-environment'."
+  (declare (indent 2))
+  (let ((oldvalues (make-symbol "oldvalues"))
+       (var (make-symbol "var"))
+       (value (make-symbol "value"))
+       (pair (make-symbol "pair")))
+    `(let (,oldvalues)
+       (dolist (,var ,vars)
+        (let ((,value (server-getenv-from ,env ,var)))
+          (setq ,oldvalues (cons (cons ,var (getenv ,var)) ,oldvalues))
+          (setenv ,var ,value)))
+       (unwind-protect
+          (progn ,@body)
+        (dolist (,pair ,oldvalues)
+          (setenv (car ,pair) (cdr ,pair)))))))
+
+(defun server-delete-client (client &optional noframe)
+  "Delete CLIENT, including its buffers, terminals and frames.
+If NOFRAME is non-nil, let the frames live.  (To be used from
+`delete-frame-functions'.)"
+  (server-log (concat "server-delete-client" (if noframe " noframe"))
+             client)
+  ;; Force a new lookup of client (prevents infinite recursion).
+  (setq client (server-client
+               (if (listp client) (car client) client)))
+  (let ((proc (car client))
+       (buffers (server-client-get client 'buffers)))
+    (when client
+
+      ;; Kill the client's buffers.
+      (dolist (buf buffers)
+       (when (buffer-live-p buf)
+         (with-current-buffer buf
+           ;; Kill the buffer if necessary.
+           (when (and (equal server-buffer-clients
+                             (list proc))
+                      (or (and server-kill-new-buffers
+                               (not server-existing-buffer))
+                          (server-temp-file-p))
+                      (not (buffer-modified-p)))
+             (let (flag)
+               (unwind-protect
+                   (progn (setq server-buffer-clients nil)
+                          (kill-buffer (current-buffer))
+                          (setq flag t))
+                 (unless flag
+                   ;; Restore clients if user pressed C-g in `kill-buffer'.
+                   (setq server-buffer-clients (list proc)))))))))
+
+      ;; Delete the client's frames.
+      (unless noframe
+       (dolist (frame (frame-list))
+         (when (and (frame-live-p frame)
+                    (equal proc (frame-parameter frame 'client)))
+           ;; Prevent `server-handle-delete-frame' from calling us
+           ;; recursively.
+           (set-frame-parameter frame 'client nil)
+           (delete-frame frame))))
+
+      (setq server-clients (delq client server-clients))
+
+      ;; Delete the client's tty.
+      (let ((terminal (server-client-get client 'terminal)))
+       (when (eq (terminal-live-p terminal) t)
+         (delete-terminal terminal)))
+
+      ;; Delete the client's process.
+      (if (eq (process-status (car client)) 'open)
+         (delete-process (car client)))
+
+      (server-log "Deleted" proc))))
 
 (defun server-log (string &optional client)
-  "If a *server* buffer exists, write STRING to it for logging purposes."
+  "If a *server* buffer exists, write STRING to it for logging purposes.
+If CLIENT is non-nil, add a description of it to the logged
+message."
   (when (get-buffer "*server*")
     (with-current-buffer "*server*"
       (goto-char (point-max))
       (insert (current-time-string)
-             (if client (format " %s:" client) " ")
+             (cond
+              ((null client) " ")
+              ((listp client) (format " %s: " (car client)))
+              (t (format " %s: " client)))
              string)
       (or (bolp) (newline)))))
 
 (defun server-sentinel (proc msg)
-  (let ((client (assq proc server-clients)))
-    ;; Remove PROC from the list of clients.
-    (when client
-      (setq server-clients (delq client server-clients))
-      (dolist (buf (cdr client))
-       (with-current-buffer buf
-         ;; Remove PROC from the clients of each buffer.
-         (setq server-buffer-clients (delq proc server-buffer-clients))
-         ;; Kill the buffer if necessary.
-         (when (and (null server-buffer-clients)
-                    (or (and server-kill-new-buffers
-                             (not server-existing-buffer))
-                        (server-temp-file-p)))
-           (kill-buffer (current-buffer)))))))
+  "The process sentinel for Emacs server connections."
   ;; If this is a new client process, set the query-on-exit flag to nil
   ;; for this process (it isn't inherited from the server process).
   (when (and (eq (process-status proc) 'open)
@@ -236,47 +366,34 @@ are done with it in the server.")
   ;; (and (process-contact proc :server)
   ;;      (eq (process-status proc) 'closed)
   ;;      (ignore-errors (delete-file (process-get proc :server-file))))
-  (server-log (format "Status changed to %s" (process-status proc)) proc))
-
-(defun server-select-display (display)
-  ;; If the current frame is on `display' we're all set.
-  (unless (equal (frame-parameter (selected-frame) 'display) display)
-    ;; Otherwise, look for an existing frame there and select it.
-    (dolist (frame (frame-list))
-      (when (equal (frame-parameter frame 'display) display)
-       (select-frame frame)))
-    ;; If there's no frame on that display yet, create and select one.
-    (unless (equal (frame-parameter (selected-frame) 'display) display)
-      (let* ((buffer (generate-new-buffer " *server-dummy*"))
-             (frame (make-frame-on-display
-                     display
-                     ;; Make it display (and remember) some dummy buffer, so
-                     ;; we can detect later if the frame is in use or not.
-                     `((server-dummmy-buffer . ,buffer)
-                       ;; This frame may be deleted later (see
-                       ;; server-unselect-display) so we want it to be as
-                       ;; unobtrusive as possible.
-                       (visibility . nil)))))
-        (select-frame frame)
-        (set-window-buffer (selected-window) buffer)))))
-
-(defun server-unselect-display (frame)
-  ;; If the temporary frame is in use (displays something real), make it
-  ;; visible.  If not (which can happen if the user's customizations call
-  ;; pop-to-buffer etc.), delete it to avoid preserving the connection after
-  ;; the last real frame is deleted.
-  (if (and (eq (frame-first-window frame)
-               (next-window (frame-first-window frame) 'nomini))
-           (eq (window-buffer (frame-first-window frame))
-               (frame-parameter frame 'server-dummy-buffer)))
-      ;; The temp frame still only shows one buffer, and that is the
-      ;; internal temp buffer.
-      (delete-frame frame)
-    (set-frame-parameter frame 'visibility t))
-  (kill-buffer (frame-parameter frame 'server-dummy-buffer))
-  (set-frame-parameter frame 'server-dummy-buffer nil))
+  (server-log (format "Status changed to %s: %s" (process-status proc) msg) proc)
+  (server-delete-client proc))
+
+(defun server-handle-delete-frame (frame)
+  "Delete the client connection when the emacsclient frame is deleted."
+  (let ((proc (frame-parameter frame 'client)))
+    (when (and (frame-live-p frame)
+              proc
+              ;; See if this is the last frame for this client.
+              (>= 1 (let ((frame-num 0))
+                     (dolist (f (frame-list))
+                       (when (eq proc (frame-parameter f 'client))
+                         (setq frame-num (1+ frame-num))))
+                     frame-num)))
+      (server-log (format "server-handle-delete-frame, frame %s" frame) proc)
+      (server-delete-client proc 'noframe)))) ; Let delete-frame delete the frame later.
+
+(defun server-handle-suspend-tty (terminal)
+  "Notify the emacsclient process to suspend itself when its tty device is suspended."
+  (dolist (proc (server-clients-with 'terminal terminal))
+    (server-log (format "server-handle-suspend-tty, terminal %s" terminal) proc)
+    (condition-case err
+       (server-send-string proc "-suspend \n")
+      (file-error (condition-case nil (server-delete-client proc) (error nil))))))
 
 (defun server-unquote-arg (arg)
+  "Remove &-quotation from ARG.
+See `server-quote-arg' and `server-process-filter'."
   (replace-regexp-in-string
    "&." (lambda (s)
          (case (aref s 1)
@@ -286,6 +403,26 @@ are done with it in the server.")
            (t " ")))
    arg t t))
 
+(defun server-quote-arg (arg)
+  "In ARG, insert a & before each &, each space, each newline, and -.
+Change spaces to underscores, too, so that the return value never
+contains a space.
+
+See `server-unquote-arg' and `server-process-filter'."
+  (replace-regexp-in-string
+   "[-&\n ]" (lambda (s)
+              (case (aref s 0)
+                (?& "&&")
+                (?- "&-")
+                (?\n "&n")
+                (?\s "&_")))
+   arg t t))
+
+(defun server-send-string (proc string)
+  "A wrapper around `proc-send-string' for logging."
+  (server-log (concat "Sent " string) proc)
+  (process-send-string proc string))
+
 (defun server-ensure-safe-dir (dir)
   "Make sure DIR is a directory with no race-condition issues.
 Creates the directory if necessary and makes sure:
@@ -307,67 +444,85 @@ Creates the directory if necessary and makes sure:
 (defun server-start (&optional leave-dead)
   "Allow this Emacs process to be a server for client processes.
 This starts a server communications subprocess through which
-client \"editors\" can send your editing commands to this Emacs job.
-To use the server, set up the program `emacsclient' in the
+client \"editors\" can send your editing commands to this Emacs
+job.  To use the server, set up the program `emacsclient' in the
 Emacs distribution as your standard \"editor\".
 
-Prefix arg means just kill any existing server communications subprocess."
+Prefix arg LEAVE-DEAD means just kill any existing server
+communications subprocess."
   (interactive "P")
-  (when server-process
-    ;; kill it dead!
-    (ignore-errors (delete-process server-process)))
-  ;; If this Emacs already had a server, clear out associated status.
-  (while server-clients
-    (let ((buffer (nth 1 (car server-clients))))
-      (server-buffer-done buffer)))
-  ;; Now any previous server is properly stopped.
-  (unless leave-dead
-    (let* ((server-dir (if server-use-tcp server-auth-dir server-socket-dir))
-           (server-file (expand-file-name server-name server-dir)))
-      ;; Make sure there is a safe directory in which to place the socket.
-      (server-ensure-safe-dir server-dir)
-      ;; Remove any leftover socket or authentication file.
-      (ignore-errors (delete-file server-file))
-      (when server-process
-        (server-log (message "Restarting server")))
-      (letf (((default-file-modes) ?\700))
-        (setq server-process
-              (apply #'make-network-process
-                     :name server-name
-                     :server t
-                     :noquery t
-                     :sentinel 'server-sentinel
-                     :filter 'server-process-filter
-                     ;; We must receive file names without being decoded.
-                     ;; Those are decoded by server-process-filter according
-                     ;; to file-name-coding-system.
-                     :coding 'raw-text
-                     ;; The rest of the args depends on the kind of socket used.
-                     (if server-use-tcp
-                         (list :family nil
-                               :service t
-                               :host (or server-host 'local)
-                               :plist '(:authenticated nil))
-                       (list :family 'local
-                             :service server-file
-                             :plist '(:authenticated t)))))
-        (unless server-process (error "Could not start server process"))
-        (when server-use-tcp
-          (let ((auth-key
-                 (loop
-                    ;; The auth key is a 64-byte string of random chars in the
-                    ;; range `!'..`~'.
-                    for i below 64
-                    collect (+ 33 (random 94)) into auth
-                    finally return (concat auth))))
-            (process-put server-process :auth-key auth-key)
-            (with-temp-file server-file
-              (set-buffer-multibyte nil)
-              (setq buffer-file-coding-system 'no-conversion)
-              (insert (format-network-address
-                       (process-contact server-process :local))
-                      " " (int-to-string (emacs-pid))
-                      "\n" auth-key))))))))
+  (when (or
+        (not server-clients)
+        (yes-or-no-p
+         "The current server still has clients; delete them? "))
+    ;; It is safe to get the user id now.
+    (setq server-socket-dir (or server-socket-dir
+                               (format "/tmp/emacs%d" (user-uid))))
+    (when server-process
+      ;; kill it dead!
+      (ignore-errors (delete-process server-process)))
+    ;; Delete the socket files made by previous server invocations.
+    (condition-case ()
+       (delete-file (expand-file-name server-name server-socket-dir))
+      (error nil))
+    ;; If this Emacs already had a server, clear out associated status.
+    (while server-clients
+      (server-delete-client (car server-clients)))
+    ;; Now any previous server is properly stopped.
+    (if leave-dead
+       (progn
+         (server-log (message "Server stopped"))
+         (setq server-process nil))
+      (let* ((server-dir (if server-use-tcp server-auth-dir server-socket-dir))
+            (server-file (expand-file-name server-name server-dir)))
+       ;; Make sure there is a safe directory in which to place the socket.
+       (server-ensure-safe-dir server-dir)
+       ;; Remove any leftover socket or authentication file.
+       (ignore-errors (delete-file server-file))
+       (when server-process
+         (server-log (message "Restarting server")))
+       (letf (((default-file-modes) ?\700))
+         (add-hook 'suspend-tty-functions 'server-handle-suspend-tty)
+         (add-hook 'delete-frame-functions 'server-handle-delete-frame)
+         (add-hook 'kill-buffer-query-functions 'server-kill-buffer-query-function)
+         (add-hook 'kill-emacs-query-functions 'server-kill-emacs-query-function)
+         (setq server-process
+               (apply #'make-network-process
+                      :name server-name
+                      :server t
+                      :noquery t
+                      :sentinel 'server-sentinel
+                      :filter 'server-process-filter
+                      ;; We must receive file names without being decoded.
+                      ;; Those are decoded by server-process-filter according
+                      ;; to file-name-coding-system.
+                      :coding 'raw-text
+                      ;; The rest of the args depends on the kind of socket used.
+                      (if server-use-tcp
+                          (list :family nil
+                                :service t
+                                :host (or server-host 'local)
+                                :plist '(:authenticated nil))
+                        (list :family 'local
+                              :service server-file
+                              :plist '(:authenticated t)))))
+         (unless server-process (error "Could not start server process"))
+         (when server-use-tcp
+           (let ((auth-key
+                  (loop
+                   ;; The auth key is a 64-byte string of random chars in the
+                   ;; range `!'..`~'.
+                   for i below 64
+                   collect (+ 33 (random 94)) into auth
+                   finally return (concat auth))))
+             (process-put server-process :auth-key auth-key)
+             (with-temp-file server-file
+               (set-buffer-multibyte nil)
+               (setq buffer-file-coding-system 'no-conversion)
+               (insert (format-network-address
+                        (process-contact server-process :local))
+                       " " (int-to-string (emacs-pid))
+                       "\n" auth-key)))))))))
 
 ;;;###autoload
 (define-minor-mode server-mode
@@ -384,25 +539,123 @@ Server mode runs a process that accepts commands from the
 \f
 (defun* server-process-filter (proc string)
   "Process a request from the server to edit some files.
-PROC is the server process.  Format of STRING is \"PATH PATH PATH... \\n\"."
+PROC is the server process.  STRING consists of a sequence of
+commands prefixed by a dash.  Some commands have arguments; these
+are &-quoted and need to be decoded by `server-unquote-arg'.  The
+filter parses and executes these commands.
+
+To illustrate the protocol, here is an example command that
+emacsclient sends to create a new X frame (note that the whole
+sequence is sent on a single line):
+
+       -version 21.3.50 xterm
+       -env HOME /home/lorentey
+       -env DISPLAY :0.0
+       ... lots of other -env commands
+       -display :0.0
+       -window-system
+
+The server normally sends back the single command `-good-version'
+as a response.
+
+The following commands are accepted by the server:
+
+`-auth AUTH-STRING'
+  Authenticate the client using the secret authentication string
+  AUTH_STRING.
+
+`-version CLIENT-VERSION'
+  Check version numbers between server and client, and signal an
+  error if there is a mismatch.  The server replies with
+  `-good-version' to confirm the match.
+
+`-env NAME=VALUE'
+  An environment variable on the client side.
+
+`-dir DIRNAME'
+  The current working directory of the client process.
+
+`-current-frame'
+  Forbid the creation of new frames.
+
+`-nowait'
+  Request that the next frame created should not be
+  associated with this client.
+
+`-display DISPLAY'
+  Set the display name to open X frames on.
+
+`-position LINE[:COLUMN]'
+  Go to the given line and column number
+  in the next file opened.
+
+`-file FILENAME'
+  Load the given file in the current frame.
+
+`-eval EXPR'
+  Evaluate EXPR as a Lisp expression and return the
+  result in -print commands.
+
+`-window-system'
+  Open a new X frame.
+
+`-tty DEVICENAME TYPE'
+  Open a new tty frame at the client.
+
+`-suspend'
+  Suspend this tty frame.  The client sends this string in
+  response to SIGTSTP and SIGTTOU.  The server must cease all I/O
+  on this tty until it gets a -resume command.
+
+`-resume'
+  Resume this tty frame. The client sends this string when it
+  gets the SIGCONT signal and it is the foreground process on its
+  controlling tty.
+
+`-ignore COMMENT'
+  Do nothing, but put the comment in the server
+  log.  Useful for debugging.
+
+
+The following commands are accepted by the client:
+
+`-good-version'
+  Signals a version match between the client and the server.
+
+`-emacs-pid PID'
+  Describes the process id of the Emacs process;
+  used to forward window change signals to it.
+
+`-window-system-unsupported'
+  Signals that the server does not
+  support creating X frames; the client must try again with a tty
+  frame.
+
+`-print STRING'
+  Print STRING on stdout.  Used to send values
+  returned by -eval.
+
+`-error DESCRIPTION'
+  Signal an error (but continue processing).
+
+`-suspend'
+  Suspend this terminal, i.e., stop the client process.  Sent
+  when the user presses C-z."
+  (server-log (concat "Received " string) proc)
   ;; First things first: let's check the authentication
   (unless (process-get proc :authenticated)
     (if (and (string-match "-auth \\(.*?\\)\n" string)
-             (equal (match-string 1 string) (process-get proc :auth-key)))
-        (progn
-          (setq string (substring string (match-end 0)))
-          (process-put proc :authenticated t)
-          (server-log "Authentication successful" proc))
+            (equal (match-string 1 string) (process-get proc :auth-key)))
+       (progn
+         (setq string (substring string (match-end 0)))
+         (process-put proc :authenticated t)
+         (server-log "Authentication successful" proc))
       (server-log "Authentication failed" proc)
-      (process-send-string proc "Authentication failed")
+      (server-send-string
+       proc (concat "-error " (server-quote-arg "Authentication failed")))
       (delete-process proc)
       ;; We return immediately
       (return-from server-process-filter)))
-  (server-log string proc)
-  (let ((prev (process-get proc :previous-string)))
-    (when prev
-      (setq string (concat prev string))
-      (process-put proc :previous-string nil)))
   (when (> (recursion-depth) 0)
     ;; We're inside a minibuffer already, so if the emacs-client is trying
     ;; to open a frame on a new display, we might end up with an unusable
@@ -411,104 +664,289 @@ PROC is the server process.  Format of STRING is \"PATH PATH PATH... \\n\"."
     ;; Similarly with recursive-edits such as the splash screen.
     (process-put proc :previous-string string)
     (run-with-timer 0 nil (lexical-let ((proc proc))
-                            (lambda () (server-process-filter proc ""))))
+                           (lambda () (server-process-filter proc ""))))
     (top-level))
-  ;; If the input is multiple lines,
-  ;; process each line individually.
-  (while (string-match "\n" string)
-    (let ((request (substring string 0 (match-beginning 0)))
-         (coding-system (and default-enable-multibyte-characters
-                             (or file-name-coding-system
-                                 default-file-name-coding-system)))
-         client nowait eval
-         (files nil)
-         (lineno 1)
-         (tmp-frame nil) ;; Sometimes used to embody the selected display.
-         (columnno 0))
-      ;; Remove this line from STRING.
-      (setq string (substring string (match-end 0)))
-      (setq client (cons proc nil))
-      (while (string-match "[^ ]* " request)
-       (let ((arg (substring request (match-beginning 0) (1- (match-end 0)))))
-         (setq request (substring request (match-end 0)))
-         (cond
-            ((equal "-nowait" arg) (setq nowait t))
-            ((equal "-eval" arg) (setq eval t))
-            ((and (equal "-display" arg) (string-match "\\([^ ]*\\) " request))
-             (let ((display (server-unquote-arg (match-string 1 request))))
-               (setq request (substring request (match-end 0)))
-               (condition-case err
-                   (setq tmp-frame (server-select-display display))
-                 (error (process-send-string proc (nth 1 err))
-                        (setq request "")))))
-            ;; ARG is a line number option.
-            ((string-match "\\`\\+[0-9]+\\'" arg)
-             (setq lineno (string-to-number (substring arg 1))))
-            ;; ARG is line number:column option.
-            ((string-match "\\`+\\([0-9]+\\):\\([0-9]+\\)\\'" arg)
-             (setq lineno (string-to-number (match-string 1 arg))
-                   columnno (string-to-number (match-string 2 arg))))
-            (t
-             ;; Undo the quoting that emacsclient does
-             ;; for certain special characters.
-             (setq arg (server-unquote-arg arg))
-             ;; Now decode the file name if necessary.
-             (when coding-system
-               (setq arg (decode-coding-string arg coding-system)))
-             (if eval
-                 (let* (errorp
-                        (v (condition-case errobj
-                               (eval (car (read-from-string arg)))
-                             (error (setq errorp t) errobj))))
-                   (when v
-                     (with-temp-buffer
-                       (let ((standard-output (current-buffer)))
-                         (when errorp (princ "error: "))
-                         (pp v)
-                         (ignore-errors
-                           (process-send-region proc (point-min) (point-max)))
-                         ))))
-               ;; ARG is a file name.
-               ;; Collapse multiple slashes to single slashes.
-               (setq arg (command-line-normalize-file-name arg))
-               (push (list arg lineno columnno) files))
-             (setq lineno 1)
-             (setq columnno 0)))))
-      (when files
-       (run-hooks 'pre-command-hook)
-       (server-visit-files files client nowait)
-       (run-hooks 'post-command-hook))
-      ;; CLIENT is now a list (CLIENTNUM BUFFERS...)
-      (if (null (cdr client))
-         ;; This client is empty; get rid of it immediately.
-         (progn
-           (delete-process proc)
-           (server-log "Close empty client" proc))
-       ;; We visited some buffer for this client.
-       (or nowait (push client server-clients))
-       (unless (or isearch-mode (minibufferp))
-         (server-switch-buffer (nth 1 client))
-         (run-hooks 'server-switch-hook)
-         (unless nowait
-           (message "%s" (substitute-command-keys
-                           "When done with a buffer, type \\[server-edit]")))))
-      (when (frame-live-p tmp-frame)
-        ;; Delete tmp-frame or make it visible depending on whether it's
-        ;; been used or not.
-        (server-unselect-display tmp-frame))))
-  ;; Save for later any partial line that remains.
-  (when (> (length string) 0)
-    (process-put proc :previous-string string)))
+  (let ((prev (process-get proc 'previous-string)))
+    (when prev
+      (setq string (concat prev string))
+      (process-put proc 'previous-string nil)))
+  (condition-case err
+      (progn
+       (server-add-client proc)
+       ;; If the input is multiple lines,
+       ;; process each line individually.
+       (while (string-match "\n" string)
+         (let ((request (substring string 0 (match-beginning 0)))
+               (coding-system (and default-enable-multibyte-characters
+                                   (or file-name-coding-system
+                                       default-file-name-coding-system)))
+               (client (server-client proc))
+               current-frame
+               nowait ; t if emacsclient does not want to wait for us.
+               frame ; The frame that was opened for the client (if any).
+               display              ; Open the frame on this display.
+               dontkill       ; t if the client should not be killed.
+               env
+               dir
+               (files nil)
+               (lineno 1)
+               (columnno 0))
+           ;; Remove this line from STRING.
+           (setq string (substring string (match-end 0)))
+           (while (string-match " *[^ ]* " request)
+             (let ((arg (substring request (match-beginning 0) (1- (match-end 0)))))
+               (setq request (substring request (match-end 0)))
+               (cond
+                ;; -version CLIENT-VERSION:
+                ;; Check version numbers, signal an error if there is a mismatch.
+                ((and (equal "-version" arg)
+                      (string-match "\\([0-9.]+\\) " request))
+                 (let* ((client-version (match-string 1 request))
+                        (truncated-emacs-version
+                         (substring emacs-version 0 (length client-version))))
+                   (setq request (substring request (match-end 0)))
+                   (if (equal client-version truncated-emacs-version)
+                       (progn
+                         (server-send-string proc "-good-version \n")
+                         (server-client-set client 'version client-version))
+                     (error (concat "Version mismatch: Emacs is "
+                                    truncated-emacs-version
+                                    ", emacsclient is " client-version)))))
+
+                ;; -nowait:  Emacsclient won't wait for a result.
+                ((equal "-nowait" arg) (setq nowait t))
+
+                ;; -current-frame:  Don't create frames.
+                ((equal "-current-frame" arg) (setq current-frame t))
+
+                ;; -display DISPLAY:
+                ;; Open X frames on the given display instead of the default.
+                ((and (equal "-display" arg) (string-match "\\([^ ]*\\) " request))
+                 (setq display (match-string 1 request)
+                       request (substring request (match-end 0))))
+
+                ;; -window-system:  Open a new X frame.
+                ((equal "-window-system" arg)
+                 (unless (server-client-get client 'version)
+                   (error "Protocol error; make sure to use the correct version of emacsclient"))
+                 (unless current-frame
+                   (if (fboundp 'x-create-frame)
+                       (let ((params (if nowait
+                                         ;; Flag frame as client-created, but use a dummy client.
+                                         ;; This will prevent the frame from being deleted when
+                                         ;; emacsclient quits while also preventing
+                                         ;; `server-save-buffers-kill-terminal' from unexpectedly
+                                         ;; killing emacs on that frame.
+                                         (list (cons 'client 'nowait) (cons 'environment env))
+                                       (list (cons 'client proc) (cons 'environment env)))))
+                         (setq frame (make-frame-on-display
+                                      (or display
+                                          (frame-parameter nil 'display)
+                                          (getenv "DISPLAY")
+                                          (error "Please specify display"))
+                                      params))
+                         (server-log (format "%s created" frame) proc)
+                         ;; XXX We need to ensure the parameters are
+                         ;; really set because Emacs forgets unhandled
+                         ;; initialization parameters for X frames at
+                         ;; the moment.
+                         (modify-frame-parameters frame params)
+                         (select-frame frame)
+                         (server-client-set client 'frame frame)
+                         (server-client-set client 'terminal (frame-terminal frame))
+
+                         ;; Display *scratch* by default.
+                         (switch-to-buffer (get-buffer-create "*scratch*") 'norecord)
+                         (if dir (setq default-directory dir))
+
+                         (setq dontkill t))
+                     ;; This emacs does not support X.
+                     (server-log "Window system unsupported" proc)
+                     (server-send-string proc "-window-system-unsupported \n")
+                     (setq dontkill t))))
+
+                ;; -resume:  Resume a suspended tty frame.
+                ((equal "-resume" arg)
+                 (let ((terminal (server-client-get client 'terminal)))
+                   (setq dontkill t)
+                   (when (eq (terminal-live-p terminal) t)
+                     (resume-tty terminal))))
+
+                ;; -suspend:  Suspend the client's frame.  (In case we
+                ;; get out of sync, and a C-z sends a SIGTSTP to
+                ;; emacsclient.)
+                ((equal "-suspend" arg)
+                 (let ((terminal (server-client-get client 'terminal)))
+                   (setq dontkill t)
+                   (when (eq (terminal-live-p terminal) t)
+                     (suspend-tty terminal))))
+
+                ;; -ignore COMMENT:  Noop; useful for debugging emacsclient.
+                ;; (The given comment appears in the server log.)
+                ((and (equal "-ignore" arg) (string-match "\\([^ ]*\\) " request))
+                 (setq dontkill t
+                       request (substring request (match-end 0))))
+
+                ;; -tty DEVICE-NAME TYPE:  Open a new tty frame at the client.
+                ((and (equal "-tty" arg) (string-match "\\([^ ]*\\) \\([^ ]*\\) " request))
+                 (let ((tty (server-unquote-arg (match-string 1 request)))
+                       (type (server-unquote-arg (match-string 2 request))))
+                   (setq request (substring request (match-end 0)))
+                   (unless (server-client-get client 'version)
+                     (error "Protocol error; make sure you use the correct version of emacsclient"))
+                   (unless current-frame
+                     (server-with-environment env
+                         '("LANG" "LC_CTYPE" "LC_ALL"
+                           ;; For tgetent(3); list according to ncurses(3).
+                           "BAUDRATE" "COLUMNS" "ESCDELAY" "HOME" "LINES"
+                           "NCURSES_ASSUMED_COLORS" "NCURSES_NO_PADDING"
+                           "NCURSES_NO_SETBUF" "TERM" "TERMCAP" "TERMINFO"
+                           "TERMINFO_DIRS" "TERMPATH")
+                       (setq frame (make-frame-on-tty tty type
+                                                      ;; Ignore nowait here; we always need to clean
+                                                      ;; up opened ttys when the client dies.
+                                                      `((client . ,proc)
+                                                        (environment . ,env)))))
+                     (select-frame frame)
+                     (server-client-set client 'frame frame)
+                     (server-client-set client 'tty (terminal-name frame))
+                     (server-client-set client 'terminal (frame-terminal frame))
+
+                     ;; Display *scratch* by default.
+                     (switch-to-buffer (get-buffer-create "*scratch*") 'norecord)
+                     (if dir (setq default-directory dir))
+
+                     ;; Reply with our pid.
+                     (server-send-string proc (concat "-emacs-pid " (number-to-string (emacs-pid)) "\n"))
+                     (setq dontkill t))))
+
+                ;; -position LINE:  Go to the given line in the next file.
+                ((and (equal "-position" arg) (string-match "\\(\\+[0-9]+\\) " request))
+                 (setq lineno (string-to-number (substring (match-string 1 request) 1))
+                       request (substring request (match-end 0))))
+
+                ;; -position LINE:COLUMN:  Set point to the given position in the next file.
+                ((and (equal "-position" arg) (string-match "\\+\\([0-9]+\\):\\([0-9]+\\) " request))
+                 (setq lineno (string-to-number (match-string 1 request))
+                       columnno (string-to-number (match-string 2 request))
+                       request (substring request (match-end 0))))
+
+                ;; -file FILENAME:  Load the given file.
+                ((and (equal "-file" arg) (string-match "\\([^ ]+\\) " request))
+                 (let ((file (server-unquote-arg (match-string 1 request))))
+                   (setq request (substring request (match-end 0)))
+                   (if coding-system
+                       (setq file (decode-coding-string file coding-system)))
+                   (setq file (command-line-normalize-file-name file))
+                   (push (list file lineno columnno) files)
+                   (server-log (format "New file: %s (%d:%d)" file lineno columnno) proc))
+                 (setq lineno 1
+                       columnno 0))
+
+                ;; -eval EXPR:  Evaluate a Lisp expression.
+                ((and (equal "-eval" arg) (string-match "\\([^ ]+\\) " request))
+                 (let ((expr (server-unquote-arg (match-string 1 request))))
+                   (setq request (substring request (match-end 0)))
+                   (if coding-system
+                       (setq expr (decode-coding-string expr coding-system)))
+                   (let ((v (eval (car (read-from-string expr)))))
+                     (when (and (not frame) v)
+                       (with-temp-buffer
+                         (let ((standard-output (current-buffer)))
+                           (pp v)
+                           (server-send-string
+                            proc (format "-print %s\n"
+                                         (server-quote-arg
+                                          (buffer-substring-no-properties (point-min)
+                                                                          (point-max)))))))))
+                   (setq lineno 1
+                         columnno 0)))
+
+                ;; -env NAME=VALUE:  An environment variable.
+                ((and (equal "-env" arg) (string-match "\\([^ ]+\\) " request))
+                 (let ((var (server-unquote-arg (match-string 1 request))))
+                   ;; XXX Variables should be encoded as in getenv/setenv.
+                   (setq request (substring request (match-end 0)))
+                   (setq env (cons var env))))
+
+                ;; -dir DIRNAME:  The cwd of the emacsclient process.
+                ((and (equal "-dir" arg) (string-match "\\([^ ]+\\) " request))
+                 (setq dir (server-unquote-arg (match-string 1 request)))
+                 (setq request (substring request (match-end 0)))
+                 (if coding-system
+                     (setq dir (decode-coding-string dir coding-system)))
+                 (setq dir (command-line-normalize-file-name dir)))
+
+                ;; Unknown command.
+                (t (error "Unknown command: %s" arg)))))
+
+           (let (buffers)
+             (when files
+               (run-hooks 'pre-command-hook)
+               (setq buffers (server-visit-files files client nowait))
+               (run-hooks 'post-command-hook))
+
+             (when frame
+               (with-selected-frame frame
+                 (display-startup-echo-area-message)
+                 (unless inhibit-splash-screen
+                   (condition-case err
+                       ;; This looks scary because `fancy-splash-screens'
+                       ;; will call `recursive-edit' from a process filter.
+                       ;; However, that should be safe to do now.
+                       (display-splash-screen t)
+                     ;; `recursive-edit' will throw an error if Emacs is
+                     ;; already doing a recursive edit elsewhere.  Catch it
+                     ;; here so that we can finish normally.
+                     (error nil)))))
+
+             ;; Delete the client if necessary.
+             (cond
+              (nowait
+               ;; Client requested nowait; return immediately.
+               (server-log "Close nowait client" proc)
+               (server-delete-client proc))
+              ((and (not dontkill) (null buffers))
+               ;; This client is empty; get rid of it immediately.
+               (server-log "Close empty client" proc)
+               (server-delete-client proc)))
+             (cond
+              ((or isearch-mode (minibufferp))
+               nil)
+              ((and frame (null buffers))
+               (message "%s" (substitute-command-keys
+                              "When done with this frame, type \\[delete-frame]")))
+              ((not (null buffers))
+               (server-switch-buffer (car buffers))
+               (run-hooks 'server-switch-hook)
+               (unless nowait
+                 (message "%s" (substitute-command-keys
+                                "When done with a buffer, type \\[server-edit]"))))))))
+
+       ;; Save for later any partial line that remains.
+       (when (> (length string) 0)
+         (process-put proc 'previous-string string)))
+    ;; condition-case
+    (error (ignore-errors
+            (server-send-string
+             proc (concat "-error " (server-quote-arg (error-message-string err))))
+            (setq string "")
+            (server-log (error-message-string err) proc)
+            (delete-process proc)))))
 
 (defun server-goto-line-column (file-line-col)
+  "Move point to the position indicated in FILE-LINE-COL.
+FILE-LINE-COL should be a three-element list as described in
+`server-visit-files'."
   (goto-line (nth 1 file-line-col))
   (let ((column-number (nth 2 file-line-col)))
-    (when (> column-number 0)
-      (move-to-column (1- column-number)))))
+    (if (> column-number 0)
+       (move-to-column (1- column-number)))))
 
 (defun server-visit-files (files client &optional nowait)
-  "Find FILES and return the list CLIENT with the buffers nconc'd.
+  "Find FILES and return a list of buffers created.
 FILES is an alist whose elements are (FILENAME LINENUMBER COLUMNNUMBER).
+CLIENT is the client that requested this operation.
 NOWAIT non-nil means this client is not waiting for the results,
 so don't mark these buffers specially, just visit them normally."
   ;; Bind last-nonmenu-event to force use of keyboard, not mouse, for queries.
@@ -522,7 +960,7 @@ so don't mark these buffers specially, just visit them normally."
        ;; modified, revert it.  If there is an existing buffer with
        ;; deleted file, offer to write it.
        (let* ((minibuffer-auto-raise (or server-raise-frame
-                                          minibuffer-auto-raise))
+                                         minibuffer-auto-raise))
               (filen (car file))
               (obuf (get-file-buffer filen)))
          (add-to-history 'file-name-history filen)
@@ -530,14 +968,14 @@ so don't mark these buffers specially, just visit them normally."
              (progn
                (cond ((file-exists-p filen)
                       (when (not (verify-visited-file-modtime obuf))
-                         (revert-buffer t nil)))
+                        (revert-buffer t nil)))
                      (t
                       (when (y-or-n-p
-                              (concat "File no longer exists: "
-                                      filen
-                                      ", write buffer to file? "))
-                         (write-file filen))))
-               (setq server-existing-buffer t)
+                             (concat "File no longer exists: " filen
+                                     ", write buffer to file? "))
+                        (write-file filen))))
+               (unless server-buffer-clients
+                 (setq server-existing-buffer t))
                (server-goto-line-column file))
            (set-buffer (find-file-noselect filen))
            (server-goto-line-column file)
@@ -547,7 +985,11 @@ so don't mark these buffers specially, just visit them normally."
          (add-hook 'kill-buffer-hook 'server-kill-buffer nil t)
          (push (car client) server-buffer-clients))
        (push (current-buffer) client-record)))
-    (nconc client client-record)))
+    (unless nowait
+      (server-client-set
+       client 'buffers
+       (nconc (server-client-get client 'buffers) client-record)))
+    client-record))
 \f
 (defun server-buffer-done (buffer &optional for-killing)
   "Mark BUFFER as \"done\" for its client(s).
@@ -557,27 +999,24 @@ or nil.  KILLED is t if we killed BUFFER (typically, because it was visiting
 a temp file).
 FOR-KILLING if non-nil indicates that we are called from `kill-buffer'."
   (let ((next-buffer nil)
-       (killed nil)
-       (old-clients server-clients))
-    (while old-clients
-      (let ((client (car old-clients)))
+       (killed nil))
+    (dolist (client server-clients)
+      (let ((buffers (server-client-get client 'buffers)))
        (or next-buffer
-           (setq next-buffer (nth 1 (memq buffer client))))
-       (delq buffer client)
-       ;; Delete all dead buffers from CLIENT.
-       (let ((tail client))
-         (while tail
-           (and (bufferp (car tail))
-                (null (buffer-name (car tail)))
-                (delq (car tail) client))
-           (setq tail (cdr tail))))
-       ;; If client now has no pending buffers,
-       ;; tell it that it is done, and forget it entirely.
-       (unless (cdr client)
-         (delete-process (car client))
-         (server-log "Close" (car client))
-         (setq server-clients (delq client server-clients))))
-      (setq old-clients (cdr old-clients)))
+           (setq next-buffer (nth 1 (memq buffer buffers))))
+       (when buffers                   ; Ignore bufferless clients.
+         (setq buffers (delq buffer buffers))
+         ;; Delete all dead buffers from CLIENT.
+         (dolist (b buffers)
+           (and (bufferp b)
+                (not (buffer-live-p b))
+                (setq buffers (delq b buffers))))
+         (server-client-set client 'buffers buffers)
+         ;; If client now has no pending buffers,
+         ;; tell it that it is done, and forget it entirely.
+         (unless buffers
+           (server-log "Close" client)
+           (server-delete-client client)))))
     (when (and (bufferp buffer) (buffer-name buffer))
       ;; We may or may not kill this buffer;
       ;; if we do, do not call server-buffer-done recursively
@@ -642,30 +1081,32 @@ specifically for the clients and did not exist before their request for it."
 ;; but I think that is dangerous--the client would proceed
 ;; using whatever is on disk in that file. -- rms.
 (defun server-kill-buffer-query-function ()
+  "Ask before killing a server buffer."
   (or (not server-buffer-clients)
+      (let ((res t))
+       (dolist (proc server-buffer-clients res)
+         (let ((client (server-client proc)))
+           (when (and client (eq (process-status proc) 'open))
+             (setq res nil)))))
       (yes-or-no-p (format "Buffer `%s' still has clients; kill it? "
                           (buffer-name (current-buffer))))))
 
-(add-hook 'kill-buffer-query-functions
-         'server-kill-buffer-query-function)
-
 (defun server-kill-emacs-query-function ()
-  (let (live-client
-       (tail server-clients))
-    ;; See if any clients have any buffers that are still alive.
-    (while tail
-      (when (memq t (mapcar 'stringp (mapcar 'buffer-name (cdr (car tail)))))
-       (setq live-client t))
-      (setq tail (cdr tail)))
-    (or (not live-client)
-       (yes-or-no-p "Server buffers still have clients; exit anyway? "))))
-
-(add-hook 'kill-emacs-query-functions 'server-kill-emacs-query-function)
+  "Ask before exiting Emacs it has live clients."
+  (or (not server-clients)
+      (let (live-client)
+       (dolist (client server-clients live-client)
+         (when (memq t (mapcar 'buffer-live-p (server-client-get
+                                               client 'buffers)))
+           (setq live-client t))))
+      (yes-or-no-p "This Emacs session has clients; exit anyway? ")))
 
 (defvar server-kill-buffer-running nil
   "Non-nil while `server-kill-buffer' or `server-buffer-done' is running.")
 
 (defun server-kill-buffer ()
+  "Remove the current buffer from its clients' buffer list.
+Designed to be added to `kill-buffer-hook'."
   ;; Prevent infinite recursion if user has made server-done-hook
   ;; call kill-buffer.
   (or server-kill-buffer-running
@@ -699,18 +1140,26 @@ starts server process and that is all.  Invoked by \\[server-edit]."
 
 (defun server-switch-buffer (&optional next-buffer killed-one)
   "Switch to another buffer, preferably one that has a client.
-Arg NEXT-BUFFER is a suggestion; if it is a live buffer, use it."
-  ;; KILLED-ONE is t in a recursive call
-  ;; if we have already killed one temp-file server buffer.
-  ;; This means we should avoid the final "switch to some other buffer"
-  ;; since we've already effectively done that.
+Arg NEXT-BUFFER is a suggestion; if it is a live buffer, use it.
+
+KILLED-ONE is t in a recursive call if we have already killed one
+temp-file server buffer.  This means we should avoid the final
+\"switch to some other buffer\" since we've already effectively
+done that."
   (if (null next-buffer)
-      (if server-clients
-         (server-switch-buffer (nth 1 (car server-clients)) killed-one)
-       (unless (or killed-one (window-dedicated-p (selected-window)))
-         (switch-to-buffer (other-buffer))
+      (progn
+       (let ((rest server-clients))
+         (while (and rest (not next-buffer))
+           (let ((client (car rest)))
+             ;; Only look at frameless clients.
+             (when (not (server-client-get client 'frame))
+               (setq next-buffer (car (server-client-get client 'buffers))))
+             (setq rest (cdr rest)))))
+       (and next-buffer (server-switch-buffer next-buffer killed-one))
+       (unless (or next-buffer killed-one (window-dedicated-p (selected-window)))
+         ;; (switch-to-buffer (other-buffer))
          (message "No server buffers remain to edit")))
-    (if (not (buffer-name next-buffer))
+    (if (not (buffer-live-p next-buffer))
        ;; If NEXT-BUFFER is a dead buffer, remove the server records for it
        ;; and try the next surviving server buffer.
        (apply 'server-switch-buffer (server-buffer-done next-buffer))
@@ -739,8 +1188,8 @@ Arg NEXT-BUFFER is a suggestion; if it is a live buffer, use it."
               (get-window-with-predicate
                (lambda (w)
                  (and (not (window-dedicated-p w))
-                      (equal (frame-parameter (window-frame w) 'display)
-                             (frame-parameter (selected-frame) 'display))))
+                      (equal (frame-terminal (window-frame w))
+                             (frame-terminal (selected-frame)))))
                'nomini 'visible (selected-window))))
            (condition-case nil
                (switch-to-buffer next-buffer)
@@ -750,10 +1199,31 @@ Arg NEXT-BUFFER is a suggestion; if it is a live buffer, use it."
     (when server-raise-frame
       (select-frame-set-input-focus (window-frame (selected-window))))))
 
+;;;###autoload
+(defun server-save-buffers-kill-terminal (proc &optional arg)
+  "Offer to save each buffer, then kill PROC.
+
+With prefix arg, silently save all file-visiting buffers, then kill.
+
+If emacsclient was started with a list of filenames to edit, then
+only these files will be asked to be saved."
+  (let ((buffers (server-client-get proc 'buffers)))
+    ;; If client is bufferless, emulate a normal Emacs session
+    ;; exit and offer to save all buffers.  Otherwise, offer to
+    ;; save only the buffers belonging to the client.
+    (save-some-buffers arg
+                      (if buffers
+                          (lambda () (memq (current-buffer) buffers))
+                        t))
+    (server-delete-client proc)))
+
 (define-key ctl-x-map "#" 'server-edit)
 
 (defun server-unload-hook ()
+  "Unload the server library."
   (server-mode -1)
+  (remove-hook 'suspend-tty-functions 'server-handle-suspend-tty)
+  (remove-hook 'delete-frame-functions 'server-handle-delete-frame)
   (remove-hook 'kill-buffer-query-functions 'server-kill-buffer-query-function)
   (remove-hook 'kill-emacs-query-functions 'server-kill-emacs-query-function)
   (remove-hook 'kill-buffer-hook 'server-kill-buffer))
index 7a278ad..1dd6d8b 100644 (file)
@@ -85,34 +85,22 @@ If the optional third argument FRAME is non-nil, use that frame's
 buffer list instead of the selected frame's buffer list.
 If no other buffer exists, the buffer `*scratch*' is returned."
   (setq frame (or frame (selected-frame)))
-  (or (get-next-valid-buffer (frame-parameter frame 'buried-buffer-list)
-                            buffer visible-ok frame)
-      (get-next-valid-buffer (nreverse (buffer-list frame))
-                            buffer visible-ok frame)
+  (or (get-next-valid-buffer (nreverse (buffer-list frame))
+                            buffer visible-ok frame)
       (progn
        (set-buffer-major-mode (get-buffer-create "*scratch*"))
        (get-buffer "*scratch*"))))
-
 (defun next-buffer ()
   "Switch to the next buffer in cyclic order."
   (interactive)
-  (let ((buffer (current-buffer))
-       (bbl (frame-parameter nil 'buried-buffer-list)))
+  (let ((buffer (current-buffer)))
     (switch-to-buffer (other-buffer buffer t))
-    (bury-buffer buffer)
-    (set-frame-parameter nil 'buried-buffer-list
-                        (cons buffer (delq buffer bbl)))))
+    (bury-buffer buffer)))
 
 (defun previous-buffer ()
   "Switch to the previous buffer in cyclic order."
   (interactive)
-  (let ((buffer (last-buffer (current-buffer) t))
-       (bbl (frame-parameter nil 'buried-buffer-list)))
-    (switch-to-buffer buffer)
-    ;; Clean up buried-buffer-list up to and including the chosen buffer.
-    (while (and bbl (not (eq (car bbl) buffer)))
-      (setq bbl (cdr bbl)))
-    (set-frame-parameter nil 'buried-buffer-list bbl)))
+  (switch-to-buffer (last-buffer (current-buffer) t)))
 
 \f
 ;;; next-error support framework
@@ -2392,6 +2380,8 @@ the text which should be made available.
 The second, optional, argument PUSH, has the same meaning as the
 similar argument to `x-set-cut-buffer', which see.")
 
+(make-variable-frame-local 'interprogram-cut-function)
+
 (defvar interprogram-paste-function nil
   "Function to call to get text cut from other programs.
 
@@ -2412,6 +2402,8 @@ most recent string, the function should return nil.  If it is
 difficult to tell whether Emacs or some other program provided the
 current string, it is probably good enough to return nil if the string
 is equal (according to `string=') to the last text Emacs provided.")
+
+(make-variable-frame-local 'interprogram-paste-function)
 \f
 
 
@@ -5428,36 +5420,33 @@ front of the list of recently selected ones."
 \f
 ;;; Handling of Backspace and Delete keys.
 
-(defcustom normal-erase-is-backspace
-  (and (not noninteractive)
-       (or (memq system-type '(ms-dos windows-nt))
-          (eq window-system 'mac)
-          (and (memq window-system '(x))
-               (fboundp 'x-backspace-delete-keys-p)
-               (x-backspace-delete-keys-p))
-          ;; If the terminal Emacs is running on has erase char
-          ;; set to ^H, use the Backspace key for deleting
-          ;; backward and, and the Delete key for deleting forward.
-          (and (null window-system)
-               (eq tty-erase-char ?\^H))))
-  "If non-nil, Delete key deletes forward and Backspace key deletes backward.
-
-On window systems, the default value of this option is chosen
-according to the keyboard used.  If the keyboard has both a Backspace
-key and a Delete key, and both are mapped to their usual meanings, the
-option's default value is set to t, so that Backspace can be used to
-delete backward, and Delete can be used to delete forward.
-
-If not running under a window system, customizing this option accomplishes
-a similar effect by mapping C-h, which is usually generated by the
-Backspace key, to DEL, and by mapping DEL to C-d via
-`keyboard-translate'.  The former functionality of C-h is available on
-the F1 key.  You should probably not use this setting if you don't
-have both Backspace, Delete and F1 keys.
+(defcustom normal-erase-is-backspace 'maybe
+  "Set the default behaviour of the Delete and Backspace keys.
+
+If set to t, Delete key deletes forward and Backspace key deletes
+backward.
+
+If set to nil, both Delete and Backspace keys delete backward.
+
+If set to 'maybe (which is the default), Emacs automatically
+selects a behaviour.  On window systems, the behaviour depends on
+the keyboard used.  If the keyboard has both a Backspace key and
+a Delete key, and both are mapped to their usual meanings, the
+option's default value is set to t, so that Backspace can be used
+to delete backward, and Delete can be used to delete forward.
+
+If not running under a window system, customizing this option
+accomplishes a similar effect by mapping C-h, which is usually
+generated by the Backspace key, to DEL, and by mapping DEL to C-d
+via `keyboard-translate'.  The former functionality of C-h is
+available on the F1 key.  You should probably not use this
+setting if you don't have both Backspace, Delete and F1 keys.
 
 Setting this variable with setq doesn't take effect.  Programmatically,
 call `normal-erase-is-backspace-mode' (which see) instead."
-  :type 'boolean
+  :type '(choice (const :tag "Off" nil)
+                (const :tag "Maybe" maybe)
+                (other :tag "On" t))
   :group 'editing-basics
   :version "21.1"
   :set (lambda (symbol value)
@@ -5467,17 +5456,38 @@ call `normal-erase-is-backspace-mode' (which see) instead."
             (normal-erase-is-backspace-mode (or value 0))
           (set-default symbol value))))
 
+(defun normal-erase-is-backspace-setup-frame (&optional frame)
+  "Set up `normal-erase-is-backspace-mode' on FRAME, if necessary."
+  (unless frame (setq frame (selected-frame)))
+  (with-selected-frame frame
+    (unless (terminal-parameter nil 'normal-erase-is-backspace)
+      (if (cond ((eq normal-erase-is-backspace 'maybe)
+                (and (not noninteractive)
+                     (or (memq system-type '(ms-dos windows-nt))
+                         (eq window-system 'mac)
+                         (and (memq window-system '(x))
+                              (fboundp 'x-backspace-delete-keys-p)
+                              (x-backspace-delete-keys-p))
+                         ;; If the terminal Emacs is running on has erase char
+                         ;; set to ^H, use the Backspace key for deleting
+                         ;; backward and, and the Delete key for deleting forward.
+                         (and (null window-system)
+                              (eq tty-erase-char ?\^H)))))
+               (t
+                normal-erase-is-backspace))
+         (normal-erase-is-backspace-mode 1)
+       (normal-erase-is-backspace-mode 0)))))
 
 (defun normal-erase-is-backspace-mode (&optional arg)
   "Toggle the Erase and Delete mode of the Backspace and Delete keys.
 
 With numeric arg, turn the mode on if and only if ARG is positive.
 
-On window systems, when this mode is on, Delete is mapped to C-d and
-Backspace is mapped to DEL; when this mode is off, both Delete and
-Backspace are mapped to DEL.  (The remapping goes via
-`function-key-map', so binding Delete or Backspace in the global or
-local keymap will override that.)
+On window systems, when this mode is on, Delete is mapped to C-d
+and Backspace is mapped to DEL; when this mode is off, both
+Delete and Backspace are mapped to DEL.  (The remapping goes via
+`local-function-key-map', so binding Delete or Backspace in the
+global or local keymap will override that.)
 
 In addition, on window systems, the bindings of C-Delete, M-Delete,
 C-M-Delete, C-Backspace, M-Backspace, and C-M-Backspace are changed in
@@ -5499,54 +5509,57 @@ have both Backspace, Delete and F1 keys.
 
 See also `normal-erase-is-backspace'."
   (interactive "P")
-  (setq normal-erase-is-backspace
-       (if arg
-           (> (prefix-numeric-value arg) 0)
-         (not normal-erase-is-backspace)))
-
-  (cond ((or (memq window-system '(x w32 mac pc))
-            (memq system-type '(ms-dos windows-nt)))
-        (let ((bindings
-               `(([C-delete] [C-backspace])
-                 ([M-delete] [M-backspace])
-                 ([C-M-delete] [C-M-backspace])
-                 (,esc-map
-                  [C-delete] [C-backspace])))
-              (old-state (lookup-key function-key-map [delete])))
-
-          (if normal-erase-is-backspace
+  (let ((enabled (or (and arg (> (prefix-numeric-value arg) 0))
+                    (and (not arg)
+                         (not (eq 1 (terminal-parameter
+                                     nil 'normal-erase-is-backspace)))))))
+    (set-terminal-parameter nil 'normal-erase-is-backspace
+                           (if enabled 1 0))
+
+    (cond ((or (memq window-system '(x w32 mac pc))
+              (memq system-type '(ms-dos windows-nt)))
+          (let* ((bindings
+                  `(([C-delete] [C-backspace])
+                    ([M-delete] [M-backspace])
+                    ([C-M-delete] [C-M-backspace])
+                    (,esc-map
+                     [C-delete] [C-backspace])))
+                 (old-state (lookup-key local-function-key-map [delete])))
+
+            (if enabled
+                (progn
+                  (define-key local-function-key-map [delete] [?\C-d])
+                  (define-key local-function-key-map [kp-delete] [?\C-d])
+                  (define-key local-function-key-map [backspace] [?\C-?]))
+              (define-key local-function-key-map [delete] [?\C-?])
+              (define-key local-function-key-map [kp-delete] [?\C-?])
+              (define-key local-function-key-map [backspace] [?\C-?]))
+
+            ;; Maybe swap bindings of C-delete and C-backspace, etc.
+            (unless (equal old-state (lookup-key local-function-key-map [delete]))
+              (dolist (binding bindings)
+                (let ((map global-map))
+                  (when (keymapp (car binding))
+                    (setq map (car binding) binding (cdr binding)))
+                  (let* ((key1 (nth 0 binding))
+                         (key2 (nth 1 binding))
+                         (binding1 (lookup-key map key1))
+                         (binding2 (lookup-key map key2)))
+                    (define-key map key1 binding2)
+                    (define-key map key2 binding1)))))))
+         (t
+          (if enabled
               (progn
-                (define-key function-key-map [delete] [?\C-d])
-                (define-key function-key-map [kp-delete] [?\C-d])
-                (define-key function-key-map [backspace] [?\C-?]))
-            (define-key function-key-map [delete] [?\C-?])
-            (define-key function-key-map [kp-delete] [?\C-?])
-            (define-key function-key-map [backspace] [?\C-?]))
-
-          ;; Maybe swap bindings of C-delete and C-backspace, etc.
-          (unless (equal old-state (lookup-key function-key-map [delete]))
-            (dolist (binding bindings)
-              (let ((map global-map))
-                (when (keymapp (car binding))
-                  (setq map (car binding) binding (cdr binding)))
-                (let* ((key1 (nth 0 binding))
-                       (key2 (nth 1 binding))
-                       (binding1 (lookup-key map key1))
-                       (binding2 (lookup-key map key2)))
-                  (define-key map key1 binding2)
-                  (define-key map key2 binding1)))))))
-        (t
-         (if normal-erase-is-backspace
-             (progn
-               (keyboard-translate ?\C-h ?\C-?)
-               (keyboard-translate ?\C-? ?\C-d))
-           (keyboard-translate ?\C-h ?\C-h)
-           (keyboard-translate ?\C-? ?\C-?))))
-
-  (run-hooks 'normal-erase-is-backspace-hook)
-  (if (interactive-p)
-      (message "Delete key deletes %s"
-              (if normal-erase-is-backspace "forward" "backward"))))
+                (keyboard-translate ?\C-h ?\C-?)
+                (keyboard-translate ?\C-? ?\C-d))
+            (keyboard-translate ?\C-h ?\C-h)
+            (keyboard-translate ?\C-? ?\C-?))))
+
+    (run-hooks 'normal-erase-is-backspace-hook)
+    (if (interactive-p)
+       (message "Delete key deletes %s"
+                (if (terminal-parameter nil 'normal-erase-is-backspace)
+                    "forward" "backward")))))
 \f
 (defvar vis-mode-saved-buffer-invisibility-spec nil
   "Saved value of `buffer-invisibility-spec' when Visible mode is on.")
index 2573d07..724329a 100644 (file)
 (defvar command-line-processed nil
   "Non-nil once command line has been processed.")
 
+(defvar window-system initial-window-system
+  "Name of window system the selected frame is displaying through.
+The value is a symbol--for instance, `x' for X windows.
+The value is nil if the selected frame is on a text-only-terminal.")
+
+(make-variable-frame-local 'window-system)
+
 (defgroup initialization nil
   "Emacs start-up procedure."
   :group 'internal)
@@ -437,36 +444,19 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
        ;; for instance due to a dense colormap.
        (when (or frame-initial-frame
                  ;; If frame-initial-frame has no meaning, do this anyway.
-                 (not (and window-system
+                 (not (and initial-window-system
                            (not noninteractive)
-                           (not (eq window-system 'pc)))))
+                           (not (eq initial-window-system 'pc)))))
          ;; Modify the initial frame based on what .emacs puts into
          ;; ...-frame-alist.
          (if (fboundp 'frame-notice-user-settings)
              (frame-notice-user-settings))
+         ;; Set the faces for the initial background mode even if
+         ;; frame-notice-user-settings didn't (such as on a tty).
+         ;; frame-set-background-mode is idempotent, so it won't
+         ;; cause any harm if it's already been done.
          (if (fboundp 'frame-set-background-mode)
-             ;; Set the faces for the initial background mode even if
-             ;; frame-notice-user-settings didn't (such as on a tty).
-             ;; frame-set-background-mode is idempotent, so it won't
-             ;; cause any harm if it's already been done.
-             (let ((frame (selected-frame))
-                   term)
-               (when (and (null window-system)
-                          ;; Don't override default set by files in lisp/term.
-                          (null default-frame-background-mode)
-                          (let ((bg (frame-parameter frame 'background-color)))
-                            (or (null bg)
-                                (member bg '(unspecified "unspecified-bg"
-                                                         "unspecified-fg")))))
-
-                 (setq term (getenv "TERM"))
-                 ;; Some files in lisp/term do a better job with the
-                 ;; background mode, but we leave this here anyway, in
-                 ;; case they remove those files.
-                 (if (string-match "^\\(xterm\\|rxvt\\|dtterm\\|eterm\\)"
-                                   term)
-                     (setq default-frame-background-mode 'light)))
-               (frame-set-background-mode (selected-frame)))))
+             (frame-set-background-mode (selected-frame))))
 
        ;; Now we know the user's default font, so add it to the menu.
        (if (fboundp 'font-menu-add-default)
@@ -507,6 +497,20 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
 (defvar tool-bar-originally-present nil
   "Non-nil if tool-bars are present before user and site init files are read.")
 
+(defvar handle-args-function-alist '((nil . tty-handle-args))
+  "Functions for processing window-system dependent command-line arguments.
+Window system startup files should add their own function to this
+alist, which should parse the command line arguments.  Those
+pertaining to the window system should be processed and removed
+from the returned command line.")
+
+(defvar window-system-initialization-alist '((nil . ignore))
+  "Alist of window-system initialization functions.
+Window-system startup files should add their own initialization
+function to this list.  The function should take no arguments,
+and initialize the window system environment to prepare for
+opening the first frame (e.g. open a connection to an X server).")
+
 ;; Handle the X-like command-line arguments "-fg", "-bg", "-name", etc.
 (defun tty-handle-args (args)
   (let (rest)
@@ -611,16 +615,22 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
     (setq eol-mnemonic-dos  "(DOS)"
           eol-mnemonic-mac  "(Mac)")))
 
-  ;; Read window system's init file if using a window system.
+  ;; Make sure window system's init file was loaded in loadup.el if using a window system.
   (condition-case error
-      (if (and window-system (not noninteractive))
-         (load (concat term-file-prefix
-                       (symbol-name window-system)
-                       "-win")
-               ;; Every window system should have a startup file;
-               ;; barf if we can't find it.
-               nil t))
-    ;; If we can't read it, print the error message and exit.
+    (unless noninteractive
+      (if (and initial-window-system
+              (not (featurep
+                    (intern (concat (symbol-name initial-window-system) "-win")))))
+         (error "Unsupported window system `%s'" initial-window-system))
+      ;; Process window-system specific command line parameters.
+      (setq command-line-args
+           (funcall (or (cdr (assq initial-window-system handle-args-function-alist))
+                        (error "Unsupported window system `%s'" initial-window-system))
+                    command-line-args))
+      ;; Initialize the window system. (Open connection, etc.)
+      (funcall (or (cdr (assq initial-window-system window-system-initialization-alist))
+                  (error "Unsupported window system `%s'" initial-window-system))))
+    ;; If there was an error, print the error message and exit.
     (error
      (princ
       (if (eq (car error) 'error)
@@ -636,13 +646,9 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
                              (cdr error) ", "))))
       'external-debugging-output)
      (terpri 'external-debugging-output)
-     (setq window-system nil)
+     (setq initial-window-system nil)
      (kill-emacs)))
 
-  ;; Windowed displays do this inside their *-win.el.
-  (unless (or (display-graphic-p) noninteractive)
-    (setq command-line-args (tty-handle-args command-line-args)))
-
   (set-locale-environment nil)
 
   ;; Convert preloaded file names to absolute.
@@ -759,7 +765,7 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
   ;; If frame was created with a menu bar, set menu-bar-mode on.
   (unless (or noninteractive
              emacs-basic-display
-              (and (memq window-system '(x w32))
+              (and (memq initial-window-system '(x w32))
                    (<= (frame-parameter nil 'menu-bar-lines) 0)))
     (menu-bar-mode 1))
 
@@ -773,7 +779,6 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
   ;; Can't do this init in defcustom because the relevant variables
   ;; are not set.
   (custom-reevaluate-setting 'blink-cursor-mode)
-  (custom-reevaluate-setting 'normal-erase-is-backspace)
   (custom-reevaluate-setting 'tooltip-mode)
   (custom-reevaluate-setting 'global-font-lock-mode)
   (custom-reevaluate-setting 'mouse-wheel-down-event)
@@ -782,13 +787,15 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
   (custom-reevaluate-setting 'send-mail-function)
   (custom-reevaluate-setting 'focus-follows-mouse)
 
+  (normal-erase-is-backspace-setup-frame)
+
   ;; Register default TTY colors for the case the terminal hasn't a
-  ;; terminal init file.
-  (unless (memq window-system '(x w32 mac))
-    ;; We do this regardles of whether the terminal supports colors
-    ;; or not, since they can switch that support on or off in
-    ;; mid-session by setting the tty-color-mode frame parameter.
-    (tty-register-default-colors))
+  ;; terminal init file.  We do this regardles of whether the terminal
+  ;; supports colors or not and regardless the current display type,
+  ;; since users can connect to color-capable terminals and also
+  ;; switch color support on or off in mid-session by setting the
+  ;; tty-color-mode frame parameter.
+  (tty-register-default-colors)
 
   ;; Record whether the tool-bar is present before the user and site
   ;; init files are processed.  frame-notice-user-settings uses this
@@ -1050,31 +1057,8 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'."
   ;; Load library for our terminal type.
   ;; User init file can set term-file-prefix to nil to prevent this.
   (unless (or noninteractive
-              window-system
-              (null term-file-prefix))
-    (let* ((TERM (getenv "TERM"))
-           (term TERM)
-          hyphend)
-      (while (and term
-                  (not (load (concat term-file-prefix term) t t)))
-        ;; Strip off last hyphen and what follows, then try again
-        (setq term
-              (if (setq hyphend (string-match "[-_][^-_]+\\'" term))
-                  (substring term 0 hyphend)
-                nil)))
-      (setq term TERM)
-      ;; The terminal file has been loaded, now call the terminal specific
-      ;; initialization function.
-      (while term
-       (let ((term-init-func (intern-soft (concat "terminal-init-" term))))
-         (if (not (fboundp term-init-func))
-              ;; Strip off last hyphen and what follows, then try again
-              (setq term
-                    (if (setq hyphend (string-match "[-_][^-_]+\\'" term))
-                        (substring term 0 hyphend)
-                      nil))
-            (setq term nil)
-           (funcall term-init-func))))))
+              initial-window-system)
+    (tty-run-terminal-initialization (selected-frame)))
 
   ;; Update the out-of-memory error message based on user's key bindings
   ;; for save-some-buffers.
@@ -1343,7 +1327,6 @@ Warning Warning!!!  Pure space overflow    !!!Warning Warning
     (force-mode-line-update)
     (setq fancy-current-text (cdr fancy-current-text))))
 
-
 (defun fancy-splash-default-action ()
   "Stop displaying the splash screen buffer.
 This is an internal function used to turn off the splash screen after
@@ -1353,12 +1336,23 @@ mouse."
   (if (and (memq 'down (event-modifiers last-command-event))
           (eq (posn-window (event-start last-command-event))
               (selected-window)))
-      ;; This is a mouse-down event in the spash screen window.
+      ;; This is a mouse-down event in the splash screen window.
       ;; Ignore it and consume the corresponding mouse-up event.
       (read-event)
     (push last-command-event unread-command-events))
   (throw 'exit nil))
 
+(defun fancy-splash-exit ()
+  "Exit the splash screen."
+  (if (get-buffer "GNU Emacs")
+      (throw 'stop-splashing nil)))
+
+(defun fancy-splash-delete-frame (frame)
+  "Exit the splash screen after the frame is deleted."
+  ;; We can not throw from `delete-frame-events', so we set up a timer
+  ;; to exit the recursive edit as soon as Emacs is idle again.
+  (if (frame-live-p frame)
+      (run-at-time 0 nil 'fancy-splash-exit)))
 
 (defun fancy-splash-screens (&optional hide-on-input)
   "Display fancy splash screens when Emacs starts."
@@ -1376,13 +1370,18 @@ mouse."
          (setq splash-buffer (current-buffer))
          (catch 'stop-splashing
            (unwind-protect
-               (let ((map (make-sparse-keymap))
-                     (cursor-type nil))
-                 (use-local-map map)
-                 (define-key map [switch-frame] 'ignore)
+               (let* ((map (make-sparse-keymap))
+                      (cursor-type nil)
+                      (overriding-local-map map)
+                      ;; Catch if our frame is deleted; the delete-frame
+                      ;; event is unreliable and is handled by
+                      ;; `special-event-map' anyway.
+                      (delete-frame-functions (cons 'fancy-splash-delete-frame
+                                                    delete-frame-functions)))
                  (define-key map [t] 'fancy-splash-default-action)
                  (define-key map [mouse-movement] 'ignore)
                  (define-key map [mode-line t] 'ignore)
+                 (define-key map [select-window] 'ignore)
                  (setq display-hourglass nil
                        minor-mode-map-alist nil
                        emulation-mode-map-alists nil
@@ -1400,7 +1399,10 @@ mouse."
              (setq display-hourglass old-hourglass
                    minor-mode-map-alist old-minor-mode-map-alist
                    emulation-mode-map-alists old-emulation-mode-map-alists)
-             (kill-buffer splash-buffer)))))
+             (kill-buffer splash-buffer)
+             (when (frame-live-p frame)
+               (select-frame frame)
+               (switch-to-buffer fancy-splash-outer-buffer))))))
     ;; If hide-on-input is nil, don't hide the buffer on input.
     (if (or (window-minibuffer-p)
            (window-dedicated-p (selected-window)))
@@ -1427,6 +1429,7 @@ Warning Warning!!!  Pure space overflow    !!!Warning Warning
          (view-mode-enter nil 'kill-buffer))
       (goto-char (point-min)))))
 
+
 (defun fancy-splash-frame ()
   "Return the frame to use for the fancy splash screen.
 Returning non-nil does not mean we should necessarily
@@ -1514,90 +1517,90 @@ More Manuals / Ordering Manuals    How to order printed manuals from the FSF
                         "
 Copyright (C) 2006 Free Software Foundation, Inc."))
 
-            ;; No mouse menus, so give help using kbd commands.
-
-            ;; If keys have their default meanings,
-            ;; use precomputed string to save lots of time.
-            (if (and (eq (key-binding "\C-h") 'help-command)
-                     (eq (key-binding "\C-xu") 'advertised-undo)
-                     (eq (key-binding "\C-x\C-c") 'save-buffers-kill-emacs)
-                     (eq (key-binding "\C-ht") 'help-with-tutorial)
-                     (eq (key-binding "\C-hi") 'info)
-                     (eq (key-binding "\C-hr") 'info-emacs-manual)
-                     (eq (key-binding "\C-h\C-n") 'view-emacs-news))
-                (insert "
+           ;; No mouse menus, so give help using kbd commands.
+
+           ;; If keys have their default meanings,
+           ;; use precomputed string to save lots of time.
+           (if (and (eq (key-binding "\C-h") 'help-command)
+                    (eq (key-binding "\C-xu") 'advertised-undo)
+                    (eq (key-binding "\C-x\C-c") 'save-buffers-kill-terminal)
+                    (eq (key-binding "\C-ht") 'help-with-tutorial)
+                    (eq (key-binding "\C-hi") 'info)
+                    (eq (key-binding "\C-hr") 'info-emacs-manual)
+                    (eq (key-binding "\C-h\C-n") 'view-emacs-news))
+               (insert "
 Get help          C-h  (Hold down CTRL and press h)
 Emacs manual      C-h r
 Emacs tutorial    C-h t           Undo changes     C-x u
 Buy manuals        C-h C-m         Exit Emacs      C-x C-c
 Browse manuals     C-h i")
 
-              (insert (substitute-command-keys
-                       (format "\n
+             (insert (substitute-command-keys
+                      (format "\n
 Get help          %s
 Emacs manual      \\[info-emacs-manual]
 Emacs tutorial    \\[help-with-tutorial]\tUndo changes\t\\[advertised-undo]
-Buy manuals        \\[view-order-manuals]\tExit Emacs\t\\[save-buffers-kill-emacs]
+Buy manuals        \\[view-order-manuals]\tExit Emacs\t\\[save-buffers-kill-terminal]
 Browse manuals     \\[info]"
-                               (let ((where (where-is-internal
-                                             'help-command nil t)))
-                                 (if where
-                                     (key-description where)
-                                   "M-x help"))))))
-
-            ;; Say how to use the menu bar with the keyboard.
-            (if (and (eq (key-binding "\M-`") 'tmm-menubar)
-                     (eq (key-binding [f10]) 'tmm-menubar))
-                (insert "
+                              (let ((where (where-is-internal
+                                            'help-command nil t)))
+                                (if where
+                                    (key-description where)
+                                  "M-x help"))))))
+
+           ;; Say how to use the menu bar with the keyboard.
+           (if (and (eq (key-binding "\M-`") 'tmm-menubar)
+                    (eq (key-binding [f10]) 'tmm-menubar))
+               (insert "
 Activate menubar   F10  or  ESC `  or   M-`")
-              (insert (substitute-command-keys "
+             (insert (substitute-command-keys "
 Activate menubar     \\[tmm-menubar]")))
 
-            ;; Many users seem to have problems with these.
-            (insert "
+           ;; Many users seem to have problems with these.
+           (insert "
 \(`C-' means use the CTRL key.  `M-' means use the Meta (or Alt) key.
 If you have no Meta key, you may instead type ESC followed by the character.)")
 
-            (insert "\n\n" (emacs-version)
-                    "
+           (insert "\n\n" (emacs-version)
+                   "
 Copyright (C) 2006 Free Software Foundation, Inc.")
 
-            (if (and (eq (key-binding "\C-h\C-c") 'describe-copying)
-                     (eq (key-binding "\C-h\C-d") 'describe-distribution)
-                     (eq (key-binding "\C-h\C-w") 'describe-no-warranty))
-                (insert
-                 "\n
+           (if (and (eq (key-binding "\C-h\C-c") 'describe-copying)
+                    (eq (key-binding "\C-h\C-d") 'describe-distribution)
+                    (eq (key-binding "\C-h\C-w") 'describe-no-warranty))
+               (insert
+                "\n
 GNU Emacs comes with ABSOLUTELY NO WARRANTY; type C-h C-w for full details.
 Emacs is Free Software--Free as in Freedom--so you can redistribute copies
 of Emacs and modify it; type C-h C-c to see the conditions.
 Type C-h C-d for information on getting the latest version.")
-              (insert (substitute-command-keys
-                       "\n
+             (insert (substitute-command-keys
+                      "\n
 GNU Emacs comes with ABSOLUTELY NO WARRANTY; type \\[describe-no-warranty] for full details.
 Emacs is Free Software--Free as in Freedom--so you can redistribute copies
 of Emacs and modify it; type \\[describe-copying] to see the conditions.
 Type \\[describe-distribution] for information on getting the latest version."))))
 
-          ;; The rest of the startup screen is the same on all
-          ;; kinds of terminals.
-
-          ;; Give information on recovering, if there was a crash.
-          (and auto-save-list-file-prefix
-               ;; Don't signal an error if the
-               ;; directory for auto-save-list files
-               ;; does not yet exist.
-               (file-directory-p (file-name-directory
-                                  auto-save-list-file-prefix))
-               (directory-files
-                (file-name-directory auto-save-list-file-prefix)
-                nil
-                (concat "\\`"
-                        (regexp-quote (file-name-nondirectory
-                                       auto-save-list-file-prefix)))
-                t)
-               (insert "\n\nIf an Emacs session crashed recently, "
-                       "type Meta-x recover-session RET\nto recover"
-                       " the files you were editing."))
+         ;; The rest of the startup screen is the same on all
+         ;; kinds of terminals.
+
+         ;; Give information on recovering, if there was a crash.
+         (and auto-save-list-file-prefix
+              ;; Don't signal an error if the
+              ;; directory for auto-save-list files
+              ;; does not yet exist.
+              (file-directory-p (file-name-directory
+                                 auto-save-list-file-prefix))
+              (directory-files
+               (file-name-directory auto-save-list-file-prefix)
+               nil
+               (concat "\\`"
+                       (regexp-quote (file-name-nondirectory
+                                      auto-save-list-file-prefix)))
+               t)
+              (insert "\n\nIf an Emacs session crashed recently, "
+                      "type Meta-x recover-session RET\nto recover"
+                      " the files you were editing."))
 
           ;; Display the input that we set up in the buffer.
           (set-buffer-modified-p nil)
@@ -1605,20 +1608,18 @@ Type \\[describe-distribution] for information on getting the latest version."))
          (if (and view-read-only (not view-mode))
              (view-mode-enter nil 'kill-buffer))
           (goto-char (point-min))
-          (if hide-on-input
-              (if (or (window-minibuffer-p)
-                      (window-dedicated-p (selected-window)))
-                  ;; If hide-on-input is nil, creating a new frame will
-                  ;; generate enough events that the subsequent `sit-for'
-                  ;; will immediately return anyway.
-                  nil ;; (pop-to-buffer (current-buffer))
+         (if hide-on-input
+             (if (or (window-minibuffer-p)
+                     (window-dedicated-p (selected-window)))
+                 ;; If hide-on-input is nil, creating a new frame will
+                 ;; generate enough events that the subsequent `sit-for'
+                 ;; will immediately return anyway.
+                 nil ;; (pop-to-buffer (current-buffer))
                (save-window-excursion
-                  (switch-to-buffer (current-buffer))
-                 (sit-for 120)))
-          (condition-case nil
-              (switch-to-buffer (current-buffer))
-            ;; In case the window is dedicated or something.
-            (error (pop-to-buffer (current-buffer))))))
+                 (switch-to-buffer (current-buffer))
+                 (sit-for 120))
+               (condition-case nil
+                   (switch-to-buffer (current-buffer))))))
       ;; Unwind ... ensure splash buffer is killed
       (if hide-on-input
          (kill-buffer "GNU Emacs")
@@ -1636,7 +1637,45 @@ Type \\[describe-distribution] for information on getting the latest version."))
 
 (defun display-startup-echo-area-message ()
   (let ((resize-mini-windows t))
-    (message "%s" (startup-echo-area-message))))
+    (or noninteractive ;(input-pending-p) init-file-had-error
+       ;; t if the init file says to inhibit the echo area startup message.
+       (and inhibit-startup-echo-area-message
+            user-init-file
+            (or (and (get 'inhibit-startup-echo-area-message 'saved-value)
+                     (equal inhibit-startup-echo-area-message
+                            (if (equal init-file-user "")
+                                (user-login-name)
+                              init-file-user)))
+                ;; Wasn't set with custom; see if .emacs has a setq.
+                (let ((buffer (get-buffer-create " *temp*")))
+                  (prog1
+                      (condition-case nil
+                          (save-excursion
+                            (set-buffer buffer)
+                            (insert-file-contents user-init-file)
+                            (re-search-forward
+                             (concat
+                              "([ \t\n]*setq[ \t\n]+"
+                              "inhibit-startup-echo-area-message[ \t\n]+"
+                              (regexp-quote
+                               (prin1-to-string
+                                (if (equal init-file-user "")
+                                    (user-login-name)
+                                  init-file-user)))
+                              "[ \t\n]*)")
+                             nil t))
+                        (error nil))
+                    (kill-buffer buffer)))))
+       ;; display-splash-screen at the end of command-line-1 calls
+       ;; use-fancy-splash-screens-p. This can cause image.el to be
+       ;; loaded, putting "Loading image... done" in the echo area.
+       ;; This hides startup-echo-area-message. So
+       ;; use-fancy-splash-screens-p is called here simply to get the
+       ;; loading of image.el (if needed) out of the way before
+       ;; display-startup-echo-area-message runs.
+       (progn
+         (use-fancy-splash-screens-p)
+         (message "%s" (startup-echo-area-message))))))
 
 
 (defun display-splash-screen (&optional hide-on-input)
@@ -1645,51 +1684,14 @@ Fancy splash screens are used on graphic displays,
 normal otherwise.
 With a prefix argument, any user input hides the splash screen."
   (interactive "P")
-  (if (use-fancy-splash-screens-p)
-      (fancy-splash-screens hide-on-input)
-    (normal-splash-screen hide-on-input)))
-
+  ;; Prevent recursive calls from server-process-filter.
+  (if (not (get-buffer "GNU Emacs"))
+      (if (use-fancy-splash-screens-p)
+         (fancy-splash-screens hide-on-input)
+       (normal-splash-screen hide-on-input))))
 
 (defun command-line-1 (command-line-args-left)
-  (or noninteractive (input-pending-p) init-file-had-error
-      ;; t if the init file says to inhibit the echo area startup message.
-      (and inhibit-startup-echo-area-message
-          user-init-file
-          (or (and (get 'inhibit-startup-echo-area-message 'saved-value)
-                   (equal inhibit-startup-echo-area-message
-                          (if (equal init-file-user "")
-                              (user-login-name)
-                            init-file-user)))
-              ;; Wasn't set with custom; see if .emacs has a setq.
-              (let ((buffer (get-buffer-create " *temp*")))
-                (prog1
-                    (condition-case nil
-                        (save-excursion
-                          (set-buffer buffer)
-                          (insert-file-contents user-init-file)
-                          (re-search-forward
-                           (concat
-                            "([ \t\n]*setq[ \t\n]+"
-                            "inhibit-startup-echo-area-message[ \t\n]+"
-                            (regexp-quote
-                             (prin1-to-string
-                              (if (equal init-file-user "")
-                                  (user-login-name)
-                                init-file-user)))
-                            "[ \t\n]*)")
-                           nil t))
-                      (error nil))
-                  (kill-buffer buffer)))))
-      ;; display-splash-screen at the end of command-line-1 calls
-      ;; use-fancy-splash-screens-p. This can cause image.el to be
-      ;; loaded, putting "Loading image... done" in the echo area.
-      ;; This hides startup-echo-area-message. So
-      ;; use-fancy-splash-screens-p is called here simply to get the
-      ;; loading of image.el (if needed) out of the way before
-      ;; display-startup-echo-area-message runs.
-      (progn
-        (use-fancy-splash-screens-p)
-        (display-startup-echo-area-message)))
+  (display-startup-echo-area-message)
 
   ;; Delay 2 seconds after an init file error message
   ;; was displayed, so user can read it.
index f3cf451..91c12fd 100644 (file)
@@ -1611,7 +1611,7 @@ any other non-digit terminates the character code and is then used as input."))
       ;; or C-q C-x might not return immediately since ESC or C-x might be
       ;; bound to some prefix in function-key-map or key-translation-map.
       (setq translated char)
-      (let ((translation (lookup-key function-key-map (vector char))))
+      (let ((translation (lookup-key local-function-key-map (vector char))))
        (if (arrayp translation)
            (setq translated (aref translation 0))))
       (cond ((null translated))
@@ -2349,6 +2349,23 @@ See also `with-temp-buffer'."
         (if (window-live-p save-selected-window-window)
             (select-window save-selected-window-window 'norecord))))))
 
+(defmacro with-selected-frame (frame &rest body)
+  "Execute the forms in BODY with FRAME as the selected frame.
+The value returned is the value of the last form in BODY.
+See also `with-temp-buffer'."
+  (declare (indent 1) (debug t))
+  (let ((old-frame (make-symbol "old-frame"))
+       (old-buffer (make-symbol "old-buffer")))
+    `(let ((,old-frame (selected-frame))
+          (,old-buffer (current-buffer)))
+       (unwind-protect
+          (progn (select-frame ,frame)
+                 ,@body)
+        (if (frame-live-p ,old-frame)
+            (select-frame ,old-frame))
+        (if (buffer-live-p ,old-buffer)
+            (set-buffer ,old-buffer))))))
+
 (defmacro with-temp-file (file &rest body)
   "Create a new buffer, evaluate BODY there, and write the buffer to FILE.
 The value returned is the value of the last form in BODY.
index ef1a78f..8ec443b 100644 (file)
@@ -46,17 +46,44 @@ Each element has the form (DISPLAY FRAME BUFFER).")
   ;; Add the new buffers to all talk frames.
   (talk-update-buffers))
 
-(defun talk-add-display (display)
-  (let* ((elt (assoc display talk-display-alist))
-        (name (concat "*talk-" display "*"))
-        buffer frame)
-    (if (not (and elt (frame-live-p (setq frame (nth 1 elt)))))
-       (setq frame (make-frame-on-display display (list (cons 'name name)))))
+;;;###autoload
+(defun talk ()
+  "Connect to the Emacs talk group from the current X display or tty frame."
+  (interactive)
+  (let ((type (frame-live-p (selected-frame)))
+       (display (frame-terminal (selected-frame))))
+    (cond
+     ((eq type t)
+      (talk-add-display (selected-frame)))
+     ((eq type 'x)
+      (talk-add-display (frame-terminal (selected-frame))))
+     (t
+      (error "Unknown frame type"))))
+  (talk-update-buffers))
+
+(defun talk-add-display (frame)
+  (let* ((display (if (frame-live-p frame)
+                     (frame-terminal frame)
+                   frame))
+        (elt (assoc display talk-display-alist))
+        (name (concat "*talk-" (terminal-name display) "*"))
+        buffer)
+    (unless (frame-live-p frame)
+      (setq frame (make-frame-on-display display (list (cons 'name name)))))
+    (if (and elt (frame-live-p (nth 1 elt)))
+       (setq frame (nth 1 elt)))
     (if (not (and elt (buffer-name (get-buffer (setq buffer (nth 2 elt))))))
        (setq buffer (get-buffer-create name)))
+    (add-to-list 'delete-frame-functions 'talk-handle-delete-frame)
     (setq talk-display-alist
          (cons (list display frame buffer) (delq elt talk-display-alist)))))
 
+(defun talk-handle-delete-frame (frame)
+  (dolist (d talk-display-alist)
+    (when (eq (nth 1 d) frame)
+      (setq talk-display-alist (delq d talk-display-alist))
+      (talk-update-buffers))))
+
 (defun talk-disconnect ()
   "Disconnect this display from the Emacs talk group."
   (interactive)
index 4afc076..2f98e7b 100644 (file)
 
 ;;; Code:
 
-(if (boundp 'AT386-keypad-map)
-    nil
-  ;; The terminal initialization should already have set up some keys
-  (setq AT386-keypad-map (lookup-key function-key-map "\e["))
-  (if (not (keymapp AT386-keypad-map))
-      (error "What?  Your AT386 termcap/terminfo has no keycaps in it"))
-
-  ;; Equivalents of these are set up automatically by termcap/terminfo
-  ;;  (define-key AT386-keypad-map "A" [up])
-  ;;  (define-key AT386-keypad-map "B" [down])
-  ;;  (define-key AT386-keypad-map "C" [right])
-  ;;  (define-key AT386-keypad-map "D" [left])
-
-  ;; These would be set up by terminfo, but not termcap
-  (define-key AT386-keypad-map "H" [home])
-  (define-key AT386-keypad-map "Y" [end])
-  (define-key AT386-keypad-map "U" [next])     ;; PgDn
-  (define-key AT386-keypad-map "V" [prior])    ;; PgUp
-  (define-key AT386-keypad-map "@" [insert])   ;; Ins key
-
-  ;; These are not normally set up by either
-  (define-key AT386-keypad-map "G" [kp-5])     ;; Unlabeled center key
-  (define-key AT386-keypad-map "S" [kp-subtract])
-  (define-key AT386-keypad-map "T" [kp-add])
-
-  ;; Arrange for the ALT key to be equivalent to ESC
-  (define-key function-key-map "\eN" [27]) ; ALT map
-  )
+(defun terminal-init-AT386 ()
+  "Terminal initialization function for AT386."
+  (let ((AT386-keypad-map (lookup-key local-function-key-map "\e[")))
+    ;; The terminal initialization should already have set up some keys
+    (if (not (keymapp AT386-keypad-map))
+       (error "What?  Your AT386 termcap/terminfo has no keycaps in it"))
+
+    ;; Equivalents of these are set up automatically by termcap/terminfo
+    ;;  (define-key AT386-keypad-map "A" [up])
+    ;;  (define-key AT386-keypad-map "B" [down])
+    ;;  (define-key AT386-keypad-map "C" [right])
+    ;;  (define-key AT386-keypad-map "D" [left])
+
+    ;; These would be set up by terminfo, but not termcap
+    (define-key AT386-keypad-map "H" [home])
+    (define-key AT386-keypad-map "Y" [end])
+    (define-key AT386-keypad-map "U" [next])   ;; PgDn
+    (define-key AT386-keypad-map "V" [prior])  ;; PgUp
+    (define-key AT386-keypad-map "@" [insert]) ;; Ins key
+
+    ;; These are not normally set up by either
+    (define-key AT386-keypad-map "G" [kp-5])   ;; Unlabeled center key
+    (define-key AT386-keypad-map "S" [kp-subtract])
+    (define-key AT386-keypad-map "T" [kp-add])
+
+    ;; Arrange for the ALT key to be equivalent to ESC
+    (define-key local-function-key-map "\eN" [27]) ; ALT map
+    ))
 
 ;;; arch-tag: abec1b03-582f-49f8-b8cb-e2fd52ea4bd7
 ;;; AT386.el ends here
index 581f321..1912df4 100644 (file)
@@ -1,19 +1,43 @@
    This directory contains files of elisp that customize Emacs for certain
 terminal types.
 
-   When Emacs starts, it checks the TERM environment variable to see what type
-of terminal the user is running on, checks for an elisp file named
-"term/${TERM}.el", and if one exists, loads it.  If that doesn't yield a file
-that exists, the last hyphen and what follows it is stripped.  If that doesn't
-yield a file that exists, the previous hyphen is stripped, and so on until all
-hyphens are gone.  For example, if the terminal type is `aaa-48-foo', Emacs
-will try first `term/aaa-48-foo.el', then `term/aaa-48.el' and finally
-`term/aaa.el'.  Each terminal specific file should contain a function
-named terminal-init-TERMINALNAME (eg terminal-init-aaa-48 for
-term/aaa-48.el) that Emacs will call in order to initialize the
-terminal. The terminal files should not contain any top level forms
-that are executed when the file is loaded, all the initialization
-actions are performed by the terminal-init-TERMINALNAME functions.
+   When Emacs opens a new terminal, it checks the TERM environment variable to
+see what type of terminal the user is running on, searches for an elisp file
+named "term/${TERM}.el", and if one exists, loads it.  If Emacs finds no
+suitable file, then it strips the last hyphen and what follows it from TERM,
+and tries again.  If that still doesn't yield a file, then the previous hyphen
+is stripped, and so on until all hyphens are gone.  For example, if the
+terminal type is `aaa-48-foo', Emacs will try first `term/aaa-48-foo.el', then
+`term/aaa-48.el' and finally `term/aaa.el'.  Emacs stops searching at the
+first file found, and will not load more than one file for any terminal.  Note
+that it is not an error if Emacs is unable to find a terminal initialization
+file; in that case, it will simply proceed with the next step without loading
+any files.
+
+   Once the file has been loaded (or the search failed), Emacs tries to call a
+function named `terminal-init-TERMINALNAME' (eg `terminal-init-aaa-48' for the
+`aaa-48' terminal) in order to initialize the terminal.  Once again, if the
+function is not found, Emacs strips the last component of the name and tries
+again using the shorter name.  This search is independent of the previous file
+search, so that you can have terminal initialization functions for a family of
+terminals collected in a single file named after the family name, and users
+may put terminal initialization functions directly in their .emacs files.
+
+   Note that an individual terminal file is loaded only once in an Emacs
+session; if the same terminal type is opened again, Emacs will simply call the
+initialization function without reloading the file.  Therefore, all the actual
+initialization actions should be collected in terminal-init-* functions; the
+file should not contain any top-level form that is not a function or variable
+declaration.  Simply loading the file should not have any side effect.
+
+   Similarly, the terminal initialization function is called only once on any
+given terminal, when the first frame is created on it.  The function is not
+called for subsequent frames on the same terminal.  Therefore, terminal-init-*
+functions should only modify terminal-local variables (such as
+`local-function-key-map') and terminal parameters.  For example, it is not
+correct to modify frame parameters, since the modifications will only be
+applied for the first frame opened on the terminal.
+
 
    When writing terminal packages, there are some things it is good to keep in
 mind.
index 749ff85..c47de91 100644 (file)
@@ -1,7 +1,7 @@
 ;; -*- no-byte-compile: t -*-
 (defun terminal-init-apollo ()
-  "Terminal initialization function for apollo."  
-  (load "term/vt100" nil t))
+  "Terminal initialization function for apollo."
+  (tty-run-terminal-initialization (selected-frame) "vt100"))
 
 ;;; arch-tag: c72f446f-e6b7-4749-90a4-bd68632adacf
 ;;; apollo.el ends here
index 82401f7..974476f 100644 (file)
@@ -1,7 +1,7 @@
 ;; -*- no-byte-compile: t -*-
 
 (defun terminal-init-bobcat ()
-  "Terminal initialization function for bobcat."  
+  "Terminal initialization function for bobcat."
   ;; HP terminals usually encourage using ^H as the rubout character
   (keyboard-translate ?\177 ?\^h)
   (keyboard-translate ?\^h ?\177))
index 3bdd5d3..df857ba 100644 (file)
@@ -3,7 +3,7 @@
 ;;; The Cygwin terminal can't really display underlines.
 
 (defun terminal-init-cygwin ()
-  "Terminal initialization function for cygwin."  
+  "Terminal initialization function for cygwin."
   (tty-no-underline))
 
 ;; arch-tag: ca81ce67-3c41-4883-a29b-4c3d64a21191
index a242528..0cbb3ae 100644 (file)
 ;; ---------------------------------------------------------------------------
 ;; keyboard setup -- that's simple!
 (set-input-mode nil nil 0)
-(define-key function-key-map [backspace] "\177") ; Normal behaviour for BS
-(define-key function-key-map [delete] "\C-d")    ; ... and Delete
-(define-key function-key-map [tab] [?\t])
-(define-key function-key-map [linefeed] [?\n])
-(define-key function-key-map [clear] [11])
-(define-key function-key-map [return] [13])
-(define-key function-key-map [escape] [?\e])
-(define-key function-key-map [M-backspace] [?\M-\d])
-(define-key function-key-map [M-delete] [?\M-d])
-(define-key function-key-map [M-tab] [?\M-\t])
-(define-key function-key-map [M-linefeed] [?\M-\n])
-(define-key function-key-map [M-clear] [?\M-\013])
-(define-key function-key-map [M-return] [?\M-\015])
-(define-key function-key-map [M-escape] [?\M-\e])
+(define-key local-function-key-map [backspace] "\177") ; Normal behaviour for BS
+(define-key local-function-key-map [delete] "\C-d") ; ... and Delete
+(define-key local-function-key-map [tab] [?\t])
+(define-key local-function-key-map [linefeed] [?\n])
+(define-key local-function-key-map [clear] [11])
+(define-key local-function-key-map [return] [13])
+(define-key local-function-key-map [escape] [?\e])
+(define-key local-function-key-map [M-backspace] [?\M-\d])
+(define-key local-function-key-map [M-delete] [?\M-d])
+(define-key local-function-key-map [M-tab] [?\M-\t])
+(define-key local-function-key-map [M-linefeed] [?\M-\n])
+(define-key local-function-key-map [M-clear] [?\M-\013])
+(define-key local-function-key-map [M-return] [?\M-\015])
+(define-key local-function-key-map [M-escape] [?\M-\e]))
 (put 'backspace 'ascii-character 127)
 (put 'delete 'ascii-character 127)
 (put 'tab 'ascii-character ?\t)
dissimilarity index 88%
index 267b11b..0f1d426 100644 (file)
-;;; iris-ansi.el --- configure Emacs for SGI xwsh and winterm apps -*- no-byte-compile: t -*-
-
-;; Copyright (C) 1997, 2002, 2003, 2004, 2005,
-;;   2006 Free Software Foundation, Inc.
-
-;; Author: Dan Nicolaescu <dann@ics.uci.edu>
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
-;; any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-
-;;; Code:
-
-(defun iris-ansi-initialize-terminal ()
-  "Terminal initialization function for iris-ansi."
-  (define-key function-key-map "\e[120q" [S-escape])
-  (define-key function-key-map "\e[121q" [C-escape])
-
-  (define-key function-key-map "\e[001q" [f1])
-  (define-key function-key-map "\e[013q" [S-f1])
-  (define-key function-key-map "\e[025q" [C-f1])
-
-
-  (define-key function-key-map "\e[002q" [f2])
-  (define-key function-key-map "\e[014q" [S-f2])
-  (define-key function-key-map "\e[026q" [C-f2])
-  (define-key function-key-map "\e[038q" [M-f2])
-
-  (define-key function-key-map "\e[003q" [f3])
-  (define-key function-key-map "\e[015q" [S-f3])
-  (define-key function-key-map "\e[027q" [C-f3])
-
-
-  (define-key function-key-map "\e[004q" [f4])
-  (define-key function-key-map "\e[016q" [S-f4])
-  (define-key function-key-map "\e[028q" [C-f4])
-
-
-  (define-key function-key-map "\e[005q" [f5])
-  (define-key function-key-map "\e[017q" [S-f5])
-  (define-key function-key-map "\e[029q" [C-f5])
-
-
-  (define-key function-key-map "\e[006q" [f6])
-  (define-key function-key-map "\e[018q" [S-f6])
-  (define-key function-key-map "\e[030q" [C-f6])
-
-
-  (define-key function-key-map "\e[007q" [f7])
-  (define-key function-key-map "\e[019q" [S-f7])
-  (define-key function-key-map "\e[031q" [C-f7])
-
-
-  (define-key function-key-map "\e[008q" [f8])
-  (define-key function-key-map "\e[020q" [S-f8])
-  (define-key function-key-map "\e[032q" [C-f8])
-
-
-  (define-key function-key-map "\e[009q" [f9])
-  (define-key function-key-map "\e[021q" [S-f9])
-  (define-key function-key-map "\e[033q" [C-f9])
-
-
-  (define-key function-key-map "\e[010q" [f10])
-  (define-key function-key-map "\e[022q" [S-f10])
-  (define-key function-key-map "\e[034q" [C-f10])
-
-
-  (define-key function-key-map "\e[011q" [f11])
-  (define-key function-key-map "\e[023q" [S-f11])
-  (define-key function-key-map "\e[035q" [C-f11])
-  (define-key function-key-map "\e[047q" [M-f11])
-
-  (define-key function-key-map "\e[012q" [f12])
-  (define-key function-key-map "\e[024q" [S-f12])
-  (define-key function-key-map "\e[036q" [C-f12])
-  (define-key function-key-map "\e[048q" [M-f12])
-
-
-  (define-key function-key-map "\e[057q" [?\C-`])
-  (define-key function-key-map "\e[115q" [?\M-`])
-
-  (define-key function-key-map "\e[049q" [?\C-1])
-  (define-key function-key-map "\e[058q" [?\M-1])
-
-
-  (define-key function-key-map "\e[059q" [?\M-2])
-
-  (define-key function-key-map "\e[050q" [?\C-3])
-  (define-key function-key-map "\e[060q" [?\M-3])
-
-  (define-key function-key-map "\e[051q" [?\C-4])
-  (define-key function-key-map "\e[061q" [?\M-4])
-
-  (define-key function-key-map "\e[052q" [?\C-5])
-  (define-key function-key-map "\e[062q" [?\M-5])
-
-
-  (define-key function-key-map "\e[063q" [?\M-6])
-
-  (define-key function-key-map "\e[053q" [?\C-7])
-  (define-key function-key-map "\e[064q" [?\M-7])
-
-  (define-key function-key-map "\e[054q" [?\C-8])
-  (define-key function-key-map "\e[065q" [?\M-8])
-
-  (define-key function-key-map "\e[055q" [?\C-9])
-  (define-key function-key-map "\e[066q" [?\M-9])
-
-  (define-key function-key-map "\e[056q" [?\C-0])
-  (define-key function-key-map "\e[067q" [?\M-0])
-
-  (define-key function-key-map "\e[068q" [?\M--])
-
-  (define-key function-key-map "\e[069q" [?\C-=])
-  (define-key function-key-map "\e[070q" [?\M-=])
-
-  ;; I don't know what to do with those.
-  ;;(define-key function-key-map "^H" [<del>])
-  ;;(define-key function-key-map "^H" [S-<del>])
-  ;;(define-key function-key-map "\177" [C-<del>])
-  ;;(define-key function-key-map "\e[071q" [M-<del>])
-
-  (define-key function-key-map "\e[Z" [?\S-\t])
-  (define-key function-key-map "\e[072q" [?\C-\t])
-  ;; This only works if you remove the M-TAB keybing from the system.4Dwmrc
-  ;; our your ~/.4Dwmrc, if you use the 4Dwm window manager.
-  (define-key function-key-map "\e[073q" [?\M-\t])
-
-  (define-key function-key-map "\e[074q" [?\M-q])
-
-  (define-key function-key-map "\e[075q" [?\M-w])
-
-  (define-key function-key-map "\e[076q" [?\M-e])
-
-  (define-key function-key-map "\e[077q" [?\M-r])
-
-  (define-key function-key-map "\e[078q" [?\M-t])
-
-  (define-key function-key-map "\e[079q" [?\M-y])
-
-  (define-key function-key-map "\e[080q" [?\M-u])
-
-  (define-key function-key-map "\e[081q" [?\M-i])
-
-  (define-key function-key-map "\e[082q" [?\M-o])
-
-  (define-key function-key-map "\e[083q" [?\M-p])
-
-  (define-key function-key-map "\e[084q" [?\M-\[])
-
-  (define-key function-key-map "\e[085q" [?\M-\]])
-
-  (define-key function-key-map "\e[086q" [?\M-\\])
-
-  (define-key function-key-map "\e[087q" [?\M-a])
-
-  (define-key function-key-map "\e[088q" [?\M-s])
-
-  (define-key function-key-map "\e[089q" [?\M-d])
-
-  (define-key function-key-map "\e[090q" [?\M-f])
-
-  (define-key function-key-map "\e[091q" [?\M-g])
-
-  (define-key function-key-map "\e[092q" [?\M-h])
-
-  (define-key function-key-map "\e[093q" [?\M-j])
-
-  (define-key function-key-map "\e[094q" [?\M-k])
-
-  (define-key function-key-map "\e[095q" [?\M-l])
-
-  (define-key function-key-map "\e[096q" [?\C-\;])
-  (define-key function-key-map "\e[097q" [?\M-:]) ;; we are cheating
-                                                 ;; here, this is
-                                                 ;; realy M-;, but
-                                                 ;; M-: generates the
-                                                 ;; same string and
-                                                 ;; is more usefull.
-
-  (define-key function-key-map "\e[098q" [?\C-'])
-  (define-key function-key-map "\e[099q" [?\M-'])
-
-  (define-key function-key-map "\e[100q" [?\M-\n])
-
-  (define-key function-key-map "\e[101q" [?\M-z])
-
-  (define-key function-key-map "\e[102q" [?\M-x])
-
-  (define-key function-key-map "\e[103q" [?\M-c])
-
-  (define-key function-key-map "\e[104q" [?\M-v])
-
-  (define-key function-key-map "\e[105q" [?\M-b])
-
-  (define-key function-key-map "\e[106q" [M-n])
-
-  (define-key function-key-map "\e[107q" [M-m])
-
-  (define-key function-key-map "\e[108q" [?\C-,])
-  (define-key function-key-map "\e[109q" [?\M-,])
-
-  (define-key function-key-map "\e[110q" [?\C-.])
-  (define-key function-key-map "\e[111q" [?\M-.])
-
-  (define-key function-key-map "\e[112q" [?\C-/])
-  (define-key function-key-map "\e[113q" [?\M-/])
-
-  (define-key function-key-map "\e[139q" [insert])
-  (define-key function-key-map "\e[139q" [S-insert])
-  (define-key function-key-map "\e[140q" [C-insert])
-  (define-key function-key-map "\e[141q" [M-insert])
-
-  (define-key function-key-map "\e[H" [home])
-  (define-key function-key-map "\e[143q" [S-home])
-  (define-key function-key-map "\e[144q" [C-home])
-
-
-  (define-key function-key-map "\e[150q" [prior])
-  (define-key function-key-map "\e[151q" [S-prior]) ;; those don't
-                                                   ;; seem to
-                                                   ;; generate
-                                                   ;; anything
-  (define-key function-key-map "\e[152q" [C-prior])
-
-
-  ;; (define-key function-key-map "^?" [delete])
-  (define-key function-key-map "\e[P" [S-delete])
-  (define-key function-key-map "\e[142q" [C-delete])
-  (define-key function-key-map "\e[M" [M-delete])
-
-  (define-key function-key-map "\e[146q" [end])
-  (define-key function-key-map "\e[147q" [S-end]) ;; those don't seem
-                                                 ;; to generate
-                                                 ;; anything
-  (define-key function-key-map "\e[148q" [C-end])
-
-  (define-key function-key-map "\e[154q" [next])
-  (define-key function-key-map "\e[155q" [S-next])
-  (define-key function-key-map "\e[156q" [C-next])
-
-
-  (define-key function-key-map "\e[161q" [S-up])
-  (define-key function-key-map "\e[162q" [C-up])
-  (define-key function-key-map "\e[163q" [M-up])
-
-  (define-key function-key-map "\e[158q" [S-left])
-  (define-key function-key-map "\e[159q" [C-left])
-  (define-key function-key-map "\e[160q" [M-left])
-
-  (define-key function-key-map "\e[164q" [S-down])
-  (define-key function-key-map "\e[165q" [C-down])
-  (define-key function-key-map "\e[166q" [M-down])
-
-  (define-key function-key-map "\e[167q" [S-right])
-  (define-key function-key-map "\e[168q" [C-right])
-  (define-key function-key-map "\e[169q" [M-right])
-
-  ;; Keypad functions, most of those are untested.
-  (define-key function-key-map "\e[179q" [?\C-/])
-  (define-key function-key-map "\e[180q" [?\M-/])
-
-  (define-key function-key-map "\e[187q" [?\C-*])
-  (define-key function-key-map "\e[188q" [?\M-*])
-
-  (define-key function-key-map "\e[198q" [?\C--])
-  (define-key function-key-map "\e[199q" [?\M--])
-
-  ;; Something else takes care of home, up, prior, down, left, right, next
-  ;;(define-key function-key-map "\e[H" [home])
-  (define-key function-key-map "\e[172q" [C-home])
-
-  ;;(define-key function-key-map "\e[A" [up])
-  (define-key function-key-map "\e[182q" [C-up])
-
-
-  ;;(define-key function-key-map "\e[150q" [prior])
-  (define-key function-key-map "\e[190q" [C-prior])
-
-
-  (define-key function-key-map "\e[200q" [?\C-+])
-  (define-key function-key-map "\e[201q" [?\M-+])
-
-  ;;(define-key function-key-map "\e[D" [left])
-  (define-key function-key-map "\e[174q" [C-left])
-
-
-  (define-key function-key-map "\e[000q" [begin])
-  (define-key function-key-map "\e[184q" [C-begin])
-
-
-  ;;(define-key function-key-map "\e[C" [right])
-  (define-key function-key-map "\e[192q" [C-right])
-
-  ;;(define-key function-key-map "\e[146q" [end])
-  (define-key function-key-map "\e[176q" [C-end])
-
-  ;;(define-key function-key-map "\e[B" [down])
-  (define-key function-key-map "\e[186q" [C-down])
-
-  ;;(define-key function-key-map "\e[154q" [next])
-  (define-key function-key-map "\e[194q" [C-next])
-
-
-  (define-key function-key-map "\e[100q" [M-enter])
-
-  (define-key function-key-map "\e[139q" [insert])
-  (define-key function-key-map "\e[178q" [C-inset])
-
-  (define-key function-key-map "\e[P" [delete])
-  (define-key function-key-map "\e[196q" [C-delete])
-  (define-key function-key-map "\e[197q" [M-delete]))
-
-;;; arch-tag: b1d0e73a-bb7d-47be-9fb2-6fb126469a1b
-;;; iris-ansi.el ends here
+;;; iris-ansi.el --- configure Emacs for SGI xwsh and winterm apps -*- no-byte-compile: t -*-
+
+;; Copyright (C) 1997, 2002, 2003, 2004, 2005,
+;;   2006 Free Software Foundation, Inc.
+
+;; Author: Dan Nicolaescu <dann@ics.uci.edu>
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+
+;;; Code:
+
+(defvar iris-function-map (make-sparse-keymap)
+  "Function key definitions for SGI xwsh and winterm apps.")
+
+(define-key iris-function-map "\e[120q" [S-escape])
+(define-key iris-function-map "\e[121q" [C-escape])
+
+(define-key iris-function-map "\e[001q" [f1])
+(define-key iris-function-map "\e[013q" [S-f1])
+(define-key iris-function-map "\e[025q" [C-f1])
+
+
+(define-key iris-function-map "\e[002q" [f2])
+(define-key iris-function-map "\e[014q" [S-f2])
+(define-key iris-function-map "\e[026q" [C-f2])
+(define-key iris-function-map "\e[038q" [M-f2])
+
+(define-key iris-function-map "\e[003q" [f3])
+(define-key iris-function-map "\e[015q" [S-f3])
+(define-key iris-function-map "\e[027q" [C-f3])
+
+
+(define-key iris-function-map "\e[004q" [f4])
+(define-key iris-function-map "\e[016q" [S-f4])
+(define-key iris-function-map "\e[028q" [C-f4])
+
+
+(define-key iris-function-map "\e[005q" [f5])
+(define-key iris-function-map "\e[017q" [S-f5])
+(define-key iris-function-map "\e[029q" [C-f5])
+
+
+(define-key iris-function-map "\e[006q" [f6])
+(define-key iris-function-map "\e[018q" [S-f6])
+(define-key iris-function-map "\e[030q" [C-f6])
+
+
+(define-key iris-function-map "\e[007q" [f7])
+(define-key iris-function-map "\e[019q" [S-f7])
+(define-key iris-function-map "\e[031q" [C-f7])
+
+
+(define-key iris-function-map "\e[008q" [f8])
+(define-key iris-function-map "\e[020q" [S-f8])
+(define-key iris-function-map "\e[032q" [C-f8])
+
+
+(define-key iris-function-map "\e[009q" [f9])
+(define-key iris-function-map "\e[021q" [S-f9])
+(define-key iris-function-map "\e[033q" [C-f9])
+
+
+(define-key iris-function-map "\e[010q" [f10])
+(define-key iris-function-map "\e[022q" [S-f10])
+(define-key iris-function-map "\e[034q" [C-f10])
+
+
+(define-key iris-function-map "\e[011q" [f11])
+(define-key iris-function-map "\e[023q" [S-f11])
+(define-key iris-function-map "\e[035q" [C-f11])
+(define-key iris-function-map "\e[047q" [M-f11])
+
+(define-key iris-function-map "\e[012q" [f12])
+(define-key iris-function-map "\e[024q" [S-f12])
+(define-key iris-function-map "\e[036q" [C-f12])
+(define-key iris-function-map "\e[048q" [M-f12])
+
+
+(define-key iris-function-map "\e[057q" [?\C-`])
+(define-key iris-function-map "\e[115q" [?\M-`])
+
+(define-key iris-function-map "\e[049q" [?\C-1])
+(define-key iris-function-map "\e[058q" [?\M-1])
+
+
+(define-key iris-function-map "\e[059q" [?\M-2])
+
+(define-key iris-function-map "\e[050q" [?\C-3])
+(define-key iris-function-map "\e[060q" [?\M-3])
+
+(define-key iris-function-map "\e[051q" [?\C-4])
+(define-key iris-function-map "\e[061q" [?\M-4])
+
+(define-key iris-function-map "\e[052q" [?\C-5])
+(define-key iris-function-map "\e[062q" [?\M-5])
+
+
+(define-key iris-function-map "\e[063q" [?\M-6])
+
+(define-key iris-function-map "\e[053q" [?\C-7])
+(define-key iris-function-map "\e[064q" [?\M-7])
+
+(define-key iris-function-map "\e[054q" [?\C-8])
+(define-key iris-function-map "\e[065q" [?\M-8])
+
+(define-key iris-function-map "\e[055q" [?\C-9])
+(define-key iris-function-map "\e[066q" [?\M-9])
+
+(define-key iris-function-map "\e[056q" [?\C-0])
+(define-key iris-function-map "\e[067q" [?\M-0])
+
+(define-key iris-function-map "\e[068q" [?\M--])
+
+(define-key iris-function-map "\e[069q" [?\C-=])
+(define-key iris-function-map "\e[070q" [?\M-=])
+
+;; I don't know what to do with those.
+;;(define-key iris-function-map "^H" [<del>])
+;;(define-key iris-function-map "^H" [S-<del>])
+;;(define-key iris-function-map "\177" [C-<del>])
+;;(define-key iris-function-map "\e[071q" [M-<del>])
+
+(define-key iris-function-map "\e[Z" [?\S-\t])
+(define-key iris-function-map "\e[072q" [?\C-\t])
+;; This only works if you remove the M-TAB keybing from the system.4Dwmrc
+;; our your ~/.4Dwmrc, if you use the 4Dwm window manager.
+(define-key iris-function-map "\e[073q" [?\M-\t])
+
+(define-key iris-function-map "\e[074q" [?\M-q])
+
+(define-key iris-function-map "\e[075q" [?\M-w])
+
+(define-key iris-function-map "\e[076q" [?\M-e])
+
+(define-key iris-function-map "\e[077q" [?\M-r])
+
+(define-key iris-function-map "\e[078q" [?\M-t])
+
+(define-key iris-function-map "\e[079q" [?\M-y])
+
+(define-key iris-function-map "\e[080q" [?\M-u])
+
+(define-key iris-function-map "\e[081q" [?\M-i])
+
+(define-key iris-function-map "\e[082q" [?\M-o])
+
+(define-key iris-function-map "\e[083q" [?\M-p])
+
+(define-key iris-function-map "\e[084q" [?\M-\[])
+
+(define-key iris-function-map "\e[085q" [?\M-\]])
+
+(define-key iris-function-map "\e[086q" [?\M-\\])
+
+(define-key iris-function-map "\e[087q" [?\M-a])
+
+(define-key iris-function-map "\e[088q" [?\M-s])
+
+(define-key iris-function-map "\e[089q" [?\M-d])
+
+(define-key iris-function-map "\e[090q" [?\M-f])
+
+(define-key iris-function-map "\e[091q" [?\M-g])
+
+(define-key iris-function-map "\e[092q" [?\M-h])
+
+(define-key iris-function-map "\e[093q" [?\M-j])
+
+(define-key iris-function-map "\e[094q" [?\M-k])
+
+(define-key iris-function-map "\e[095q" [?\M-l])
+
+(define-key iris-function-map "\e[096q" [?\C-\;])
+(define-key iris-function-map "\e[097q" [?\M-:]) ;; we are cheating
+                                                 ;; here, this is realy
+                                                 ;; M-;, but M-:
+                                                 ;; generates the same
+                                                 ;; string and is more
+                                                 ;; usefull.
+
+(define-key iris-function-map "\e[098q" [?\C-'])
+(define-key iris-function-map "\e[099q" [?\M-'])
+
+(define-key iris-function-map "\e[100q" [?\M-\n])
+
+(define-key iris-function-map "\e[101q" [?\M-z])
+
+(define-key iris-function-map "\e[102q" [?\M-x])
+
+(define-key iris-function-map "\e[103q" [?\M-c])
+
+(define-key iris-function-map "\e[104q" [?\M-v])
+
+(define-key iris-function-map "\e[105q" [?\M-b])
+
+(define-key iris-function-map "\e[106q" [M-n])
+
+(define-key iris-function-map "\e[107q" [M-m])
+
+(define-key iris-function-map "\e[108q" [?\C-,])
+(define-key iris-function-map "\e[109q" [?\M-,])
+
+(define-key iris-function-map "\e[110q" [?\C-.])
+(define-key iris-function-map "\e[111q" [?\M-.])
+
+(define-key iris-function-map "\e[112q" [?\C-/])
+(define-key iris-function-map "\e[113q" [?\M-/])
+
+(define-key iris-function-map "\e[139q" [insert])
+(define-key iris-function-map "\e[139q" [S-insert])
+(define-key iris-function-map "\e[140q" [C-insert])
+(define-key iris-function-map "\e[141q" [M-insert])
+
+(define-key iris-function-map "\e[H" [home])
+(define-key iris-function-map "\e[143q" [S-home])
+(define-key iris-function-map "\e[144q" [C-home])
+
+
+(define-key iris-function-map "\e[150q" [prior])
+(define-key iris-function-map "\e[151q" [S-prior]) ;; those don't seem
+                                                   ;; to generate
+                                                   ;; anything
+(define-key iris-function-map "\e[152q" [C-prior])
+
+
+;; (define-key iris-function-map "^?" [delete]) ?? something else seems to take care of this.
+(define-key iris-function-map "\e[P" [S-delete])
+(define-key iris-function-map "\e[142q" [C-delete])
+(define-key iris-function-map "\e[M" [M-delete])
+
+(define-key iris-function-map "\e[146q" [end])
+(define-key iris-function-map "\e[147q" [S-end]) ;; those don't seem to
+                                                 ;; generate anything
+(define-key iris-function-map "\e[148q" [C-end])
+
+(define-key iris-function-map "\e[154q" [next])
+(define-key iris-function-map "\e[155q" [S-next])
+(define-key iris-function-map "\e[156q" [C-next])
+
+
+(define-key iris-function-map "\e[161q" [S-up])
+(define-key iris-function-map "\e[162q" [C-up])
+(define-key iris-function-map "\e[163q" [M-up])
+
+(define-key iris-function-map "\e[158q" [S-left])
+(define-key iris-function-map "\e[159q" [C-left])
+(define-key iris-function-map "\e[160q" [M-left])
+
+(define-key iris-function-map "\e[164q" [S-down])
+(define-key iris-function-map "\e[165q" [C-down])
+(define-key iris-function-map "\e[166q" [M-down])
+
+(define-key iris-function-map "\e[167q" [S-right])
+(define-key iris-function-map "\e[168q" [C-right])
+(define-key iris-function-map "\e[169q" [M-right])
+
+;; Keypad functions, most of those are untested.
+(define-key iris-function-map "\e[179q" [?\C-/])
+(define-key iris-function-map "\e[180q" [?\M-/])
+
+(define-key iris-function-map "\e[187q" [?\C-*])
+(define-key iris-function-map "\e[188q" [?\M-*])
+
+(define-key iris-function-map "\e[198q" [?\C--])
+(define-key iris-function-map "\e[199q" [?\M--])
+
+;; Something else takes care of home, up, prior, down, left, right, next
+;(define-key iris-function-map "\e[H" [home])
+(define-key iris-function-map "\e[172q" [C-home])
+
+;(define-key iris-function-map "\e[A" [up])
+(define-key iris-function-map "\e[182q" [C-up])
+
+
+;(define-key iris-function-map "\e[150q" [prior])
+(define-key iris-function-map "\e[190q" [C-prior])
+
+
+(define-key iris-function-map "\e[200q" [?\C-+])
+(define-key iris-function-map "\e[201q" [?\M-+])
+
+;(define-key iris-function-map "\e[D" [left])
+(define-key iris-function-map "\e[174q" [C-left])
+
+
+(define-key iris-function-map "\e[000q" [begin])
+(define-key iris-function-map "\e[184q" [C-begin])
+
+
+;(define-key iris-function-map "\e[C" [right])
+(define-key iris-function-map "\e[192q" [C-right])
+
+;(define-key iris-function-map "\e[146q" [end])
+(define-key iris-function-map "\e[176q" [C-end])
+
+;(define-key iris-function-map "\e[B" [down])
+(define-key iris-function-map "\e[186q" [C-down])
+
+;(define-key iris-function-map "\e[154q" [next])
+(define-key iris-function-map "\e[194q" [C-next])
+
+
+(define-key iris-function-map "\e[100q" [M-enter])
+
+(define-key iris-function-map "\e[139q" [insert])
+(define-key iris-function-map "\e[178q" [C-inset])
+
+(define-key iris-function-map "\e[P" [delete])
+(define-key iris-function-map "\e[196q" [C-delete])
+(define-key iris-function-map "\e[197q" [M-delete])
+
+(defun terminal-init-iris-ansi ()
+  "Terminal initialization function for iris-ansi."
+  ;; Use inheritance to let the main keymap override these defaults.
+  ;; This way we don't override terminfo-derived settings or settings
+  ;; made in the .emacs file.
+  (let ((m (copy-keymap iris-function-map)))
+    (set-keymap-parent m (keymap-parent local-function-key-map))
+    (set-keymap-parent local-function-key-map m)))
+
+;;; arch-tag: b1d0e73a-bb7d-47be-9fb2-6fb126469a1b
+;;; iris-ansi.el ends here
index 7fa9a96..449cd83 100644 (file)
@@ -13,9 +13,8 @@
   ;; Meta will continue to work, because the kernel
   ;; turns that into Escape.
 
-  (let ((value (current-input-mode)))
-    ;; The third arg only matters in that it is not t or nil.
-    (set-input-mode (nth 0 value) (nth 1 value) 'iso-latin-1 (nth 3 value))))
+  ;; The arg only matters in that it is not t or nil.
+  (set-input-meta-mode 'iso-latin-1))
 
 ;;; arch-tag: 5d0c4f63-739b-4862-abf3-041fe42adb8f
 ;;; linux.el ends here
dissimilarity index 84%
index 1f8d9ca..17ac347 100644 (file)
@@ -1,72 +1,83 @@
-;; -*- no-byte-compile: t -*-
-;; Define function key sequences for DEC terminals.
-
-;; Termcap or terminfo should set these.
-;; (define-key function-key-map "\e[A" [up])
-;; (define-key function-key-map "\e[B" [down])
-;; (define-key function-key-map "\e[C" [right])
-;; (define-key function-key-map "\e[D" [left])
-
-(define-key function-key-map "\e[1~" [find])
-(define-key function-key-map "\e[2~" [insert])
-(define-key function-key-map "\e[3~" [delete])
-(define-key function-key-map "\e[4~" [select])
-(define-key function-key-map "\e[5~" [prior])
-(define-key function-key-map "\e[6~" [next])
-(define-key function-key-map "\e[11~" [f1])
-(define-key function-key-map "\e[12~" [f2])
-(define-key function-key-map "\e[13~" [f3])
-(define-key function-key-map "\e[14~" [f4])
-(define-key function-key-map "\e[15~" [f5])
-(define-key function-key-map "\e[17~" [f6])
-(define-key function-key-map "\e[18~" [f7])
-(define-key function-key-map "\e[19~" [f8])
-(define-key function-key-map "\e[20~" [f9])
-(define-key function-key-map "\e[21~" [f10])
-;; Customarily F11 is used as the ESC key.
-;; The file that includes this one, takes care of that.
-(define-key function-key-map "\e[23~" [f11])
-(define-key function-key-map "\e[24~" [f12])
-(define-key function-key-map "\e[25~" [f13])
-(define-key function-key-map "\e[26~" [f14])
-(define-key function-key-map "\e[28~" [help])
-(define-key function-key-map "\e[29~" [menu])
-(define-key function-key-map "\e[31~" [f17])
-(define-key function-key-map "\e[32~" [f18])
-(define-key function-key-map "\e[33~" [f19])
-(define-key function-key-map "\e[34~" [f20])
-
-;; Termcap or terminfo should set these.
-;; (define-key function-key-map "\eOA" [up])
-;; (define-key function-key-map "\eOB" [down])
-;; (define-key function-key-map "\eOC" [right])
-;; (define-key function-key-map "\eOD" [left])
-
-;; Termcap or terminfo should set these, but doesn't properly.
-;; Termcap sets these to k1-k4, which get mapped to f1-f4 in term.c
-(define-key function-key-map "\eOP" [kp-f1])
-(define-key function-key-map "\eOQ" [kp-f2])
-(define-key function-key-map "\eOR" [kp-f3])
-(define-key function-key-map "\eOS" [kp-f4])
-
-(define-key function-key-map "\eOI" [kp-tab])
-(define-key function-key-map "\eOj" [kp-multiply])
-(define-key function-key-map "\eOk" [kp-add])
-(define-key function-key-map "\eOl" [kp-separator])
-(define-key function-key-map "\eOM" [kp-enter])
-(define-key function-key-map "\eOm" [kp-subtract])
-(define-key function-key-map "\eOn" [kp-decimal])
-(define-key function-key-map "\eOo" [kp-divide])
-(define-key function-key-map "\eOp" [kp-0])
-(define-key function-key-map "\eOq" [kp-1])
-(define-key function-key-map "\eOr" [kp-2])
-(define-key function-key-map "\eOs" [kp-3])
-(define-key function-key-map "\eOt" [kp-4])
-(define-key function-key-map "\eOu" [kp-5])
-(define-key function-key-map "\eOv" [kp-6])
-(define-key function-key-map "\eOw" [kp-7])
-(define-key function-key-map "\eOx" [kp-8])
-(define-key function-key-map "\eOy" [kp-9])
-
-;;; arch-tag: 7ffb4444-6a23-43e1-b457-43cf4f673c0d
-;;; lk201.el ends here
+;; -*- no-byte-compile: t -*-
+;; Define function key sequences for DEC terminals.
+
+(defvar lk201-function-map (make-sparse-keymap)
+  "Function key definitions for DEC terminals.")
+
+;; Termcap or terminfo should set these.
+;; (define-key lk201-function-map "\e[A" [up])
+;; (define-key lk201-function-map "\e[B" [down])
+;; (define-key lk201-function-map "\e[C" [right])
+;; (define-key lk201-function-map "\e[D" [left])
+
+(define-key lk201-function-map "\e[1~" [find])
+(define-key lk201-function-map "\e[2~" [insert])
+(define-key lk201-function-map "\e[3~" [delete])
+(define-key lk201-function-map "\e[4~" [select])
+(define-key lk201-function-map "\e[5~" [prior])
+(define-key lk201-function-map "\e[6~" [next])
+(define-key lk201-function-map "\e[11~" [f1])
+(define-key lk201-function-map "\e[12~" [f2])
+(define-key lk201-function-map "\e[13~" [f3])
+(define-key lk201-function-map "\e[14~" [f4])
+(define-key lk201-function-map "\e[15~" [f5])
+(define-key lk201-function-map "\e[17~" [f6])
+(define-key lk201-function-map "\e[18~" [f7])
+(define-key lk201-function-map "\e[19~" [f8])
+(define-key lk201-function-map "\e[20~" [f9])
+(define-key lk201-function-map "\e[21~" [f10])
+;; Customarily F11 is used as the ESC key.
+;; The file that includes this one, takes care of that.
+(define-key lk201-function-map "\e[23~" [f11])
+(define-key lk201-function-map "\e[24~" [f12])
+(define-key lk201-function-map "\e[25~" [f13])
+(define-key lk201-function-map "\e[26~" [f14])
+(define-key lk201-function-map "\e[28~" [help])
+(define-key lk201-function-map "\e[29~" [menu])
+(define-key lk201-function-map "\e[31~" [f17])
+(define-key lk201-function-map "\e[32~" [f18])
+(define-key lk201-function-map "\e[33~" [f19])
+(define-key lk201-function-map "\e[34~" [f20])
+
+;; Termcap or terminfo should set these.
+;; (define-key lk201-function-map "\eOA" [up])
+;; (define-key lk201-function-map "\eOB" [down])
+;; (define-key lk201-function-map "\eOC" [right])
+;; (define-key lk201-function-map "\eOD" [left])
+
+;; Termcap or terminfo should set these, but doesn't properly.
+;; Termcap sets these to k1-k4, which get mapped to f1-f4 in term.c
+(define-key lk201-function-map "\eOP" [kp-f1])
+(define-key lk201-function-map "\eOQ" [kp-f2])
+(define-key lk201-function-map "\eOR" [kp-f3])
+(define-key lk201-function-map "\eOS" [kp-f4])
+
+(define-key lk201-function-map "\eOI" [kp-tab])
+(define-key lk201-function-map "\eOj" [kp-multiply])
+(define-key lk201-function-map "\eOk" [kp-add])
+(define-key lk201-function-map "\eOl" [kp-separator])
+(define-key lk201-function-map "\eOM" [kp-enter])
+(define-key lk201-function-map "\eOm" [kp-subtract])
+(define-key lk201-function-map "\eOn" [kp-decimal])
+(define-key lk201-function-map "\eOo" [kp-divide])
+(define-key lk201-function-map "\eOp" [kp-0])
+(define-key lk201-function-map "\eOq" [kp-1])
+(define-key lk201-function-map "\eOr" [kp-2])
+(define-key lk201-function-map "\eOs" [kp-3])
+(define-key lk201-function-map "\eOt" [kp-4])
+(define-key lk201-function-map "\eOu" [kp-5])
+(define-key lk201-function-map "\eOv" [kp-6])
+(define-key lk201-function-map "\eOw" [kp-7])
+(define-key lk201-function-map "\eOx" [kp-8])
+(define-key lk201-function-map "\eOy" [kp-9])
+
+(defun terminal-init-lk201 ()
+  ;; Use inheritance to let the main keymap override these defaults.
+  ;; This way we don't override terminfo-derived settings or settings
+  ;; made in the .emacs file.
+  (let ((m (copy-keymap lk201-function-map)))
+    (set-keymap-parent m (keymap-parent local-function-key-map))
+    (set-keymap-parent local-function-key-map m)))
+
+;;; arch-tag: 7ffb4444-6a23-43e1-b457-43cf4f673c0d
+;;; lk201.el ends here
index 3f67c2c..43454a5 100644 (file)
@@ -1065,20 +1065,20 @@ XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp")
 
 ;; Map certain keypad keys into ASCII characters
 ;; that people usually expect.
-(define-key function-key-map [backspace] [?\d])
-(define-key function-key-map [delete] [?\d])
-(define-key function-key-map [tab] [?\t])
-(define-key function-key-map [linefeed] [?\n])
-(define-key function-key-map [clear] [?\C-l])
-(define-key function-key-map [return] [?\C-m])
-(define-key function-key-map [escape] [?\e])
-(define-key function-key-map [M-backspace] [?\M-\d])
-(define-key function-key-map [M-delete] [?\M-\d])
-(define-key function-key-map [M-tab] [?\M-\t])
-(define-key function-key-map [M-linefeed] [?\M-\n])
-(define-key function-key-map [M-clear] [?\M-\C-l])
-(define-key function-key-map [M-return] [?\M-\C-m])
-(define-key function-key-map [M-escape] [?\M-\e])
+(define-key local-function-key-map [backspace] [?\d])
+(define-key local-function-key-map [delete] [?\d])
+(define-key local-function-key-map [tab] [?\t])
+(define-key local-function-key-map [linefeed] [?\n])
+(define-key local-function-key-map [clear] [?\C-l])
+(define-key local-function-key-map [return] [?\C-m])
+(define-key local-function-key-map [escape] [?\e])
+(define-key local-function-key-map [M-backspace] [?\M-\d])
+(define-key local-function-key-map [M-delete] [?\M-\d])
+(define-key local-function-key-map [M-tab] [?\M-\t])
+(define-key local-function-key-map [M-linefeed] [?\M-\n])
+(define-key local-function-key-map [M-clear] [?\M-\C-l])
+(define-key local-function-key-map [M-return] [?\M-\C-m])
+(define-key local-function-key-map [M-escape] [?\M-\e])
 
 ;; These tell read-char how to convert
 ;; these special chars to ASCII.
index a008256..6fd39d2 100644 (file)
 
 (defun terminal-init-news ()
   "Terminal initialization function for news."
-  (if (boundp 'news-fkey-prefix)
-      nil
-    ;; The terminal initialization should already have set up some keys
-    (setq news-fkey-prefix (lookup-key function-key-map "\eO"))
+  ;; The terminal initialization should already have set up some keys
+  (let ((news-fkey-prefix (lookup-key local-function-key-map "\eO")))
     (if (not (keymapp news-fkey-prefix))
        (error "What?  Your news termcap/terminfo has no keycaps in it"))
 
index e99fc94..cd8160c 100644 (file)
 
 ;;; Code:
 
+(defvar rxvt-function-map (make-sparse-keymap)
+  "Function key overrides for rxvt.")
+
+;; Set up function-key-map entries that termcap and terminfo don't know.
+(define-key rxvt-function-map "\e[A" [up])
+(define-key rxvt-function-map "\e[B" [down])
+(define-key rxvt-function-map "\e[C" [right])
+(define-key rxvt-function-map "\e[D" [left])
+(define-key rxvt-function-map "\e[2~" [insert])
+(define-key rxvt-function-map "\e[3~" [delete])
+(define-key rxvt-function-map "\e[4~" [select])
+(define-key rxvt-function-map "\e[5~" [prior])
+(define-key rxvt-function-map "\e[6~" [next])
+(define-key rxvt-function-map "\e[7~" [home])
+(define-key rxvt-function-map "\e[8~" [end])
+(define-key rxvt-function-map "\e[11~" [f1])
+(define-key rxvt-function-map "\e[12~" [f2])
+(define-key rxvt-function-map "\e[13~" [f3])
+(define-key rxvt-function-map "\e[14~" [f4])
+(define-key rxvt-function-map "\e[15~" [f5])
+(define-key rxvt-function-map "\e[17~" [f6])
+(define-key rxvt-function-map "\e[18~" [f7])
+(define-key rxvt-function-map "\e[19~" [f8])
+(define-key rxvt-function-map "\e[20~" [f9])
+(define-key rxvt-function-map "\e[21~" [f10])
+;; The strings emitted by f11 and f12 are the same as the strings
+;; emitted by S-f1 and S-f2, so don't define f11 and f12.
+;; (define-key rxvt-function-map "\e[23~" [f11])
+;; (define-key rxvt-function-map "\e[24~" [f12])
+(define-key rxvt-function-map "\e[29~" [print])
+
+(define-key rxvt-function-map "\e[11^" [C-f1])
+(define-key rxvt-function-map "\e[12^" [C-f2])
+(define-key rxvt-function-map "\e[13^" [C-f3])
+(define-key rxvt-function-map "\e[14^" [C-f4])
+(define-key rxvt-function-map "\e[15^" [C-f5])
+(define-key rxvt-function-map "\e[17^" [C-f6])
+(define-key rxvt-function-map "\e[18^" [C-f7])
+(define-key rxvt-function-map "\e[19^" [C-f8])
+(define-key rxvt-function-map "\e[20^" [C-f9])
+(define-key rxvt-function-map "\e[21^" [C-f10])
+
+(define-key rxvt-function-map "\e[23~" [S-f1])
+(define-key rxvt-function-map "\e[24~" [S-f2])
+(define-key rxvt-function-map "\e[25~" [S-f3])
+(define-key rxvt-function-map "\e[26~" [S-f4])
+(define-key rxvt-function-map "\e[28~" [S-f5])
+(define-key rxvt-function-map "\e[29~" [S-f6])
+(define-key rxvt-function-map "\e[31~" [S-f7])
+(define-key rxvt-function-map "\e[32~" [S-f8])
+(define-key rxvt-function-map "\e[33~" [S-f9])
+(define-key rxvt-function-map "\e[34~" [S-f10])
+
+(define-key rxvt-function-map "\e[23^" [C-S-f1])
+(define-key rxvt-function-map "\e[24^" [C-S-f2])
+(define-key rxvt-function-map "\e[25^" [C-S-f3])
+(define-key rxvt-function-map "\e[26^" [C-S-f4])
+(define-key rxvt-function-map "\e[28^" [C-S-f5])
+(define-key rxvt-function-map "\e[29^" [C-S-f6])
+(define-key rxvt-function-map "\e[31^" [C-S-f7])
+(define-key rxvt-function-map "\e[32^" [C-S-f8])
+(define-key rxvt-function-map "\e[33^" [C-S-f9])
+(define-key rxvt-function-map "\e[34^" [C-S-f10])
+
+(define-key rxvt-function-map "\e[2^" [C-insert])
+(define-key rxvt-function-map "\e[3^" [C-delete])
+(define-key rxvt-function-map "\e[5^" [C-prior])
+(define-key rxvt-function-map "\e[6^" [C-next])
+(define-key rxvt-function-map "\e[7^" [C-home])
+(define-key rxvt-function-map "\e[8^" [C-end])
+(define-key rxvt-function-map "\eOd" [C-left])
+(define-key rxvt-function-map "\eOc" [C-right])
+(define-key rxvt-function-map "\eOa" [C-up])
+(define-key rxvt-function-map "\eOb" [C-down])
+
+(define-key rxvt-function-map "\e[2;2~" [S-insert])
+(define-key rxvt-function-map "\e[3$" [S-delete])
+(define-key rxvt-function-map "\e[5$" [S-prior])
+(define-key rxvt-function-map "\e[6$" [S-next])
+(define-key rxvt-function-map "\e[7$" [S-home])
+(define-key rxvt-function-map "\e[8$" [S-end])
+(define-key rxvt-function-map "\e[d" [S-left])
+(define-key rxvt-function-map "\e[c" [S-right])
+(define-key rxvt-function-map "\e[a" [S-up])
+(define-key rxvt-function-map "\e[b" [S-down])
+
 (defun terminal-init-rxvt ()
   "Terminal initialization function for rxvt."
+
   ;; The terminal intialization C code file might have initialized
   ;; function keys F11->F42 from the termcap/terminfo information.  On
   ;; a PC-style keyboard these keys correspond to
   ;; function-key-map.  This substitution is needed because if a key
   ;; definition if found in function-key-map, there are no further
   ;; lookups in other keymaps.
-  (substitute-key-definition [f11] [S-f1] function-key-map)
-  (substitute-key-definition [f12] [S-f2] function-key-map)
-  (substitute-key-definition [f13] [S-f3] function-key-map)
-  (substitute-key-definition [f14] [S-f4] function-key-map)
-  (substitute-key-definition [f15] [S-f5] function-key-map)
-  (substitute-key-definition [f16] [S-f6] function-key-map)
-  (substitute-key-definition [f17] [S-f7] function-key-map)
-  (substitute-key-definition [f18] [S-f8] function-key-map)
-  (substitute-key-definition [f19] [S-f9] function-key-map)
-  (substitute-key-definition [f20] [S-f10] function-key-map)
+  (substitute-key-definition [f11] [S-f1] local-function-key-map)
+  (substitute-key-definition [f12] [S-f2] local-function-key-map)
+  (substitute-key-definition [f13] [S-f3] local-function-key-map)
+  (substitute-key-definition [f14] [S-f4] local-function-key-map)
+  (substitute-key-definition [f15] [S-f5] local-function-key-map)
+  (substitute-key-definition [f16] [S-f6] local-function-key-map)
+  (substitute-key-definition [f17] [S-f7] local-function-key-map)
+  (substitute-key-definition [f18] [S-f8] local-function-key-map)
+  (substitute-key-definition [f19] [S-f9] local-function-key-map)
+  (substitute-key-definition [f20] [S-f10] local-function-key-map)
 
-  (substitute-key-definition [f23] [C-f1] function-key-map)
-  (substitute-key-definition [f24] [C-f2] function-key-map)
-  (substitute-key-definition [f25] [C-f3] function-key-map)
-  (substitute-key-definition [f26] [C-f4] function-key-map)
-  (substitute-key-definition [f27] [C-f5] function-key-map)
-  (substitute-key-definition [f28] [C-f6] function-key-map)
-  (substitute-key-definition [f29] [C-f7] function-key-map)
-  (substitute-key-definition [f30] [C-f8] function-key-map)
-  (substitute-key-definition [f31] [C-f9] function-key-map)
-  (substitute-key-definition [f32] [C-f10] function-key-map)
+  (substitute-key-definition [f23] [C-f1] local-function-key-map)
+  (substitute-key-definition [f24] [C-f2] local-function-key-map)
+  (substitute-key-definition [f25] [C-f3] local-function-key-map)
+  (substitute-key-definition [f26] [C-f4] local-function-key-map)
+  (substitute-key-definition [f27] [C-f5] local-function-key-map)
+  (substitute-key-definition [f28] [C-f6] local-function-key-map)
+  (substitute-key-definition [f29] [C-f7] local-function-key-map)
+  (substitute-key-definition [f30] [C-f8] local-function-key-map)
+  (substitute-key-definition [f31] [C-f9] local-function-key-map)
+  (substitute-key-definition [f32] [C-f10] local-function-key-map)
 
-  (substitute-key-definition [f33] [C-S-f1] function-key-map)
-  (substitute-key-definition [f34] [C-S-f2] function-key-map)
-  (substitute-key-definition [f35] [C-S-f3] function-key-map)
-  (substitute-key-definition [f36] [C-S-f4] function-key-map)
-  (substitute-key-definition [f37] [C-S-f5] function-key-map)
-  (substitute-key-definition [f38] [C-S-f6] function-key-map)
-  (substitute-key-definition [f39] [C-S-f7] function-key-map)
-  (substitute-key-definition [f40] [C-S-f8] function-key-map)
-  (substitute-key-definition [f41] [C-S-f9] function-key-map)
-  (substitute-key-definition [f42] [C-S-f10] function-key-map)
+  (substitute-key-definition [f33] [C-S-f1] local-function-key-map)
+  (substitute-key-definition [f34] [C-S-f2] local-function-key-map)
+  (substitute-key-definition [f35] [C-S-f3] local-function-key-map)
+  (substitute-key-definition [f36] [C-S-f4] local-function-key-map)
+  (substitute-key-definition [f37] [C-S-f5] local-function-key-map)
+  (substitute-key-definition [f38] [C-S-f6] local-function-key-map)
+  (substitute-key-definition [f39] [C-S-f7] local-function-key-map)
+  (substitute-key-definition [f40] [C-S-f8] local-function-key-map)
+  (substitute-key-definition [f41] [C-S-f9] local-function-key-map)
+  (substitute-key-definition [f42] [C-S-f10] local-function-key-map)
 
-  ;; Set up function-key-map entries that termcap and terminfo don't know.
-  (let ((map (make-sparse-keymap)))
-    (define-key map "\e[A" [up])
-    (define-key map "\e[B" [down])
-    (define-key map "\e[C" [right])
-    (define-key map "\e[D" [left])
-    (define-key map "\e[2~" [insert])
-    (define-key map "\e[3~" [delete])
-    (define-key map "\e[4~" [select])
-    (define-key map "\e[5~" [prior])
-    (define-key map "\e[6~" [next])
-    (define-key map "\e[7~" [home])
-    (define-key map "\e[8~" [end])
-    (define-key map "\e[11~" [f1])
-    (define-key map "\e[12~" [f2])
-    (define-key map "\e[13~" [f3])
-    (define-key map "\e[14~" [f4])
-    (define-key map "\e[15~" [f5])
-    (define-key map "\e[17~" [f6])
-    (define-key map "\e[18~" [f7])
-    (define-key map "\e[19~" [f8])
-    (define-key map "\e[20~" [f9])
-    (define-key map "\e[21~" [f10])
-    ;; The strings emitted by f11 and f12 are the same as the strings
-    ;; emitted by S-f1 and S-f2, so don't define f11 and f12.
-    ;; (define-key map "\e[23~" [f11])
-    ;; (define-key map "\e[24~" [f12])
-    (define-key map "\e[29~" [print])
-
-    (define-key map "\e[11^" [C-f1])
-    (define-key map "\e[12^" [C-f2])
-    (define-key map "\e[13^" [C-f3])
-    (define-key map "\e[14^" [C-f4])
-    (define-key map "\e[15^" [C-f5])
-    (define-key map "\e[17^" [C-f6])
-    (define-key map "\e[18^" [C-f7])
-    (define-key map "\e[19^" [C-f8])
-    (define-key map "\e[20^" [C-f9])
-    (define-key map "\e[21^" [C-f10])
-
-    (define-key map "\e[23~" [S-f1])
-    (define-key map "\e[24~" [S-f2])
-    (define-key map "\e[25~" [S-f3])
-    (define-key map "\e[26~" [S-f4])
-    (define-key map "\e[28~" [S-f5])
-    (define-key map "\e[29~" [S-f6])
-    (define-key map "\e[31~" [S-f7])
-    (define-key map "\e[32~" [S-f8])
-    (define-key map "\e[33~" [S-f9])
-    (define-key map "\e[34~" [S-f10])
-
-    (define-key map "\e[23^" [C-S-f1])
-    (define-key map "\e[24^" [C-S-f2])
-    (define-key map "\e[25^" [C-S-f3])
-    (define-key map "\e[26^" [C-S-f4])
-    (define-key map "\e[28^" [C-S-f5])
-    (define-key map "\e[29^" [C-S-f6])
-    (define-key map "\e[31^" [C-S-f7])
-    (define-key map "\e[32^" [C-S-f8])
-    (define-key map "\e[33^" [C-S-f9])
-    (define-key map "\e[34^" [C-S-f10])
-
-    (define-key map "\e[2^" [C-insert])
-    (define-key map "\e[3^" [C-delete])
-    (define-key map "\e[5^" [C-prior])
-    (define-key map "\e[6^" [C-next])
-    (define-key map "\e[7^" [C-home])
-    (define-key map "\e[8^" [C-end])
-    (define-key map "\eOd" [C-left])
-    (define-key map "\eOc" [C-right])
-    (define-key map "\eOa" [C-up])
-    (define-key map "\eOb" [C-down])
-
-    (define-key map "\e[2;2~" [S-insert])
-    (define-key map "\e[3$" [S-delete])
-    (define-key map "\e[5$" [S-prior])
-    (define-key map "\e[6$" [S-next])
-    (define-key map "\e[7$" [S-home])
-    (define-key map "\e[8$" [S-end])
-    (define-key map "\e[d" [S-left])
-    (define-key map "\e[c" [S-right])
-    (define-key map "\e[a" [S-up])
-    (define-key map "\e[b" [S-down])
-
-    ;; Use inheritance to let the main keymap override those defaults.
-    ;; This way we don't override terminfo-derived settings or settings
-    ;; made in the .emacs file.
-    (set-keymap-parent map (keymap-parent function-key-map))
-    (set-keymap-parent function-key-map map))
+  ;; Use inheritance to let the main keymap override those defaults.
+  ;; This way we don't override terminfo-derived settings or settings
+  ;; made in the .emacs file.
+  (let ((m (copy-keymap rxvt-function-map)))
+    (set-keymap-parent m (keymap-parent local-function-key-map))
+    (set-keymap-parent local-function-key-map m))
 
   ;; Initialize colors and background mode.
   (rxvt-register-default-colors)
@@ -239,7 +243,7 @@ for the currently selected frame."
                            (- 256 ncolors)
                            (list color color color))
          (setq ncolors (1- ncolors))))
-       
+
        ((= ncolors 72) ; rxvt-unicode
        ;; 64 non-gray colors
        (let ((levels '(0 139 205 255))
@@ -280,9 +284,9 @@ for the currently selected frame."
 ;; intelligent way than the default guesswork in startup.el.
 (defun rxvt-set-background-mode ()
   "Set background mode as appropriate for the default rxvt colors."
-  (let ((fgbg (getenv "COLORFGBG"))
+  (let ((fgbg (getenv "COLORFGBG" (terminal-id)))
        bg rgb)
-    (setq default-frame-background-mode 'light)
+    (set-terminal-parameter nil 'background-mode 'light)
     (when (and fgbg
               (string-match ".*;\\([0-9][0-9]?\\)\\'" fgbg))
       (setq bg (string-to-number (substring fgbg (match-beginning 1))))
@@ -295,8 +299,7 @@ for the currently selected frame."
             ;; The following line assumes that white is the 15th
             ;; color in rxvt-standard-colors.
             (* (apply '+ (car (cddr (nth 15 rxvt-standard-colors)))) 0.6))
-         (setq default-frame-background-mode 'dark)))
-    (frame-set-background-mode (selected-frame))))
+         (set-terminal-parameter nil 'background-mode 'dark)))))
 
 ;; arch-tag: 20cf2fb6-6318-4bab-9dbf-1d15048f2257
 ;;; rxvt.el ends here
index 0d264f2..8913fa9 100644 (file)
 
 (defun terminal-init-sun ()
   "Terminal initialization function for sun."
-  (define-key function-key-map "\e[" sun-raw-prefix)
+  (define-key local-function-key-map "\e[" sun-raw-prefix)
 
   (define-key sun-raw-prefix "210z" [r3])
   (define-key sun-raw-prefix "213z" [r6])
index ffcce0f..bcdf886 100644 (file)
 
 (defun terminal-init-tvi970 ()
   "Terminal initialization function for tvi970."
-  (or (lookup-key function-key-map "\e[")
-      (define-key function-key-map "\e[" (make-keymap)))
-  ;; (or (lookup-key function-key-map "\eO")
-  ;;    (define-key function-key-map "\eO" (make-keymap)))
+  (or (lookup-key local-function-key-map "\e[")
+      (define-key local-function-key-map "\e[" (make-keymap)))
+  ;; (or (lookup-key local-function-key-map "\eO")
+  ;;    (define-key local-function-key-map "\eO" (make-keymap)))
 
   ;; Miscellaneous keys
   (mapcar (function (lambda (key-binding)
-                     (define-key function-key-map
+                     (define-key local-function-key-map
                        (car key-binding) (nth 1 key-binding))))
          '(
            ;; These are set up by termcap or terminfo
@@ -54,7 +54,7 @@
            ("\e[@"     [insert])
            ("\e[L"     [insertline])
            ("\e[M"     [deleteline])
-           ("\e[U"     [next]) ;; actually the `page' key
+           ("\e[U"     [next])         ;; actually the `page' key
 
            ;; These won't be set up by either
            ("\eOm"     [kp-subtract])
   ;; The numeric keypad keys.
   (let ((i 0))
     (while (< i 10)
-      (define-key function-key-map
+      (define-key local-function-key-map
        (format "\eO%c" (+ i ?p))
        (vector (intern (format "kp-%d" i))))
       (setq i (1+ i))))
   ;; The numbered function keys.
   (let ((i 0))
     (while (< i 16)
-      (define-key function-key-map
+      (define-key local-function-key-map
        (format "\e?%c" (+ i ?a))
        (vector (intern (format "f%d" (1+ i)))))
-      (define-key function-key-map
+      (define-key local-function-key-map
        (format "\e?%c" (+ i ?A))
        (vector (intern (format "S-f%d" (1+ i)))))
       (setq i (1+ i))))
 
   (tvi970-set-keypad-mode 1))
+
 \f
 ;;; Should keypad numbers send ordinary digits or distinct escape sequences?
 (defvar tvi970-keypad-numeric nil
index c5732a2..be1d8ee 100644 (file)
 
 ;; Set up function-key-map entries that termcap and terminfo don't know.
 
-
 (defun terminal-init-vt100 ()
   "Terminal initialization function for vt100."
-  (load "term/lk201" nil t))
+  (tty-run-terminal-initialization (selected-frame) "lk201"))
 
 ;;; Controlling the screen width.
 (defvar vt100-wide-mode (= (frame-width) 132)
index ad780ed..67a90a8 100644 (file)
@@ -1,8 +1,8 @@
 ;; -*- no-byte-compile: t -*-
 
 (defun terminal-init-vt102 ()
-  "Terminal initialization function for vt102."  
-  (load "term/vt100" nil t))
+  "Terminal initialization function for vt102."
+  (tty-run-terminal-initialization (selected-frame) "vt100"))
 
 ;;; arch-tag: 6e839cfc-125a-4574-82f1-c23a51f7c50f
 ;;; vt102.el ends here
index 2221e59..82a7047 100644 (file)
@@ -1,8 +1,8 @@
 ;; -*- no-byte-compile: t -*-
 
 (defun terminal-init-vt125 ()
-  "Terminal initialization function for vt125."  
-  (load "term/vt100" nil t))
+  "Terminal initialization function for vt125."
+  (tty-run-terminal-initialization (selected-frame) "vt100"))
 
 ;;; arch-tag: 1d92d70f-dd55-4a1d-9088-e215a4883801
 ;;; vt125.el ends here
index e1215d1..7e7b328 100644 (file)
@@ -1,12 +1,11 @@
 ;; -*- no-byte-compile: t -*-
 ;; For our purposes we can treat the vt200 and vt100 almost alike.
 ;; Most differences are handled by the termcap entry.
-
 (defun terminal-init-vt200 ()
-  "Terminal initialization function for vt200."  
-  (load "term/vt100" nil t)
+  "Terminal initialization function for vt200."
+  (tty-run-terminal-initialization (selected-frame) "vt100")
   ;; Make F11 an escape key.
-  (define-key function-key-map "\e[23~" [?\e]))
+  (define-key local-function-key-map "\e[23~" [?\e]))
 
 ;;; arch-tag: 0f78f583-9f32-4237-b106-28bcfff21d89
 ;;; vt200.el ends here
index 315030a..a63f956 100644 (file)
@@ -2,10 +2,10 @@
 ;; For our purposes we can treat the vt200 and vt100 almost alike.
 ;; Most differences are handled by the termcap entry.
 (defun terminal-init-vt201 ()
-  "Terminal initialization function for vt201."  
-  (load "term/vt100" nil t)
+  "Terminal initialization function for vt201."
+  (tty-run-terminal-initialization (selected-frame) "vt100")
   ;; Make F11 an escape key.
-  (define-key function-key-map "\e[23~" [?\e]))
+  (define-key local-function-key-map "\e[23~" [?\e]))
 
 ;;; arch-tag: a6abb38f-60ea-449e-a9e9-3fb8572c52ae
 ;;; vt201.el ends here
index cccd2a6..b2b8fc9 100644 (file)
@@ -2,10 +2,10 @@
 ;; For our purposes we can treat the vt200 and vt100 almost alike.
 ;; Most differences are handled by the termcap entry.
 (defun terminal-init-vt220 ()
-  "Terminal initialization function for vt220."  
-  (load "term/vt100" nil t)
+  "Terminal initialization function for vt220."
+  (tty-run-terminal-initialization (selected-frame) "vt100")
   ;; Make F11 an escape key.
-  (define-key function-key-map "\e[23~" [?\e]))
+  (define-key local-function-key-map "\e[23~" [?\e]))
 
 ;;; arch-tag: 98fc4867-a20d-46a1-a276-d7be31e49871
 ;;; vt220.el ends here
index bb3931e..cb26ebf 100644 (file)
@@ -2,10 +2,10 @@
 ;; For our purposes we can treat the vt200 and vt100 almost alike.
 ;; Most differences are handled by the termcap entry.
 (defun terminal-init-vt240 ()
-  "Terminal initialization function for vt240."  
-  (load "term/vt100" nil t)
+  "Terminal initialization function for vt240."
+  (tty-run-terminal-initialization (selected-frame) "vt100")
   ;; Make F11 an escape key.
-  (define-key function-key-map "\e[23~" [?\e]))
+  (define-key local-function-key-map "\e[23~" [?\e]))
 
 ;;; arch-tag: d9f88e9c-02dc-49ff-871c-a415f08e4eb7
 ;;; vt240.el ends here
index ff600f4..9a09ad5 100644 (file)
@@ -1,9 +1,9 @@
 ;; -*- no-byte-compile: t -*-
 (defun terminal-init-vt300 ()
-  "Terminal initialization function for vt300."  
-  (load "term/vt100" nil t)
+  "Terminal initialization function for vt300."
+  (tty-run-terminal-initialization (selected-frame) "vt100")
   ;; Make F11 an escape key.
-  (define-key function-key-map "\e[23~" [?\e]))
+  (define-key local-function-key-map "\e[23~" [?\e]))
 
 ;;; arch-tag: 876831c9-a6f2-444a-b033-706e6fbc149f
 ;;; vt300.el ends here
index fb7772c..803d728 100644 (file)
@@ -1,9 +1,9 @@
 ;; -*- no-byte-compile: t -*-
 (defun terminal-init-vt320 ()
-  "Terminal initialization function for vt320."  
-  (load "term/vt100" nil t)
+  "Terminal initialization function for vt320."
+  (tty-run-terminal-initialization (selected-frame) "vt100")
   ;; Make F11 an escape key.
-  (define-key function-key-map "\e[23~" [?\e]))
+  (define-key local-function-key-map "\e[23~" [?\e]))
 
 ;;; arch-tag: f9f4c954-0b9e-45f9-b450-a320d32abd9c
 ;;; vt320.el ends here
index 97c0c5d..f73f466 100644 (file)
@@ -1,9 +1,9 @@
 ;; -*- no-byte-compile: t -*-
 (defun terminal-init-vt400 ()
-  "Terminal initialization function for vt400."  
-  (load "term/vt100" nil t)
+  "Terminal initialization function for vt400."
+  (tty-run-terminal-initialization (selected-frame) "vt100")
   ;; Make F11 an escape key.
-  (define-key function-key-map "\e[23~" [?\e]))
+  (define-key local-function-key-map "\e[23~" [?\e]))
 
 ;;; arch-tag: a70809c5-6b21-42cc-ba20-536683e5e7d5
 ;;; vt400.el ends here
index 65ffa75..e65ba1a 100644 (file)
@@ -1,9 +1,9 @@
 ;; -*- no-byte-compile: t -*-
-(defun terminal-init-vt420 ()
-  "Terminal initialization function for vt420."  
-  (load "term/vt100" nil t)
+(defun terminal-init-vt420
+  "Terminal initialization function for vt420."
+  (tty-run-terminal-initialization (selected-frame) "vt100")
   ;; Make F11 an escape key.
-  (define-key function-key-map "\e[23~" [?\e]))
+  (define-key local-function-key-map "\e[23~" [?\e]))
 
 ;;; arch-tag: df2f897c-3a12-4b3c-9259-df089f96c160
 ;;; vt420.el ends here
index 40e70c8..07de099 100644 (file)
@@ -40,9 +40,9 @@
 
 (defun terminal-init-wyse50 ()
   "Terminal initialization function for wyse50."
-  (define-key function-key-map "\C-a" (make-keymap))
+  (define-key local-function-key-map "\C-a" (make-keymap))
   (mapcar (function (lambda (key-definition)
-                     (define-key function-key-map
+                     (define-key local-function-key-map
                        (car key-definition) (nth 1 key-definition))))
          '(
            ;; These might be set up by termcap and terminfo
            ("\eY"      [key-clear])            ;; Not an X keysym
 
            ;; These are totally strange :-)
-           ("\eW"      [?\C-?])            ;; Not an X keysym
-           ("\^a\^k\^m"        [funct-up]) ;; Not an X keysym
-           ("\^a\^j\^m"        [funct-down])  ;; Not an X keysym
-           ("\^a\^l\^m"        [funct-right]) ;; Not an X keysym
-           ("\^a\^h\^m"        [funct-left])  ;; Not an X keysym
+           ("\eW"      [?\C-?])                ;; Not an X keysym
+           ("\^a\^k\^m"        [funct-up])     ;; Not an X keysym
+           ("\^a\^j\^m"        [funct-down])   ;; Not an X keysym
+           ("\^a\^l\^m"        [funct-right])  ;; Not an X keysym
+           ("\^a\^h\^m"        [funct-left])   ;; Not an X keysym
            ("\^a\^m\^m"        [funct-return]) ;; Not an X keysym
            ("\^a\^i\^m"        [funct-tab])    ;; Not an X keysym
            ))
index e97d375..afb749f 100644 (file)
 
 ;;; Commentary:
 
-;; X-win.el:  this file is loaded from ../lisp/startup.el when it recognizes
-;; that X windows are to be used.  Command line switches are parsed and those
-;; pertaining to X are processed and removed from the command line.  The
-;; X display is opened and hooks are set for popping up the initial window.
+;; X-win.el: this file defines functions to initialize the X window
+;; system and process X-specific command line parameters before
+;; creating the first X frame.
+
+;; Note that contrary to previous Emacs versions, the act of loading
+;; this file should not have the side effect of initializing the
+;; window system or processing command line arguments (this file is
+;; now loaded in loadup.el).  See the variables
+;; `handle-args-function-alist' and
+;; `window-system-initialization-alist' for more details.
 
 ;; startup.el will then examine startup files, and eventually call the hooks
 ;; which create the first window(s).
@@ -65,7 +71,7 @@
 ;; An alist of X options and the function which handles them.  See
 ;; ../startup.el.
 
-(if (not (eq window-system 'x))
+(if (not (fboundp 'x-create-frame))
     (error "%s: Loading x-win.el but not compiled for X" (invocation-name)))
 
 (require 'frame)
@@ -1167,27 +1173,30 @@ XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp")
 \f
 ;;;; Function keys
 
-(substitute-key-definition 'suspend-emacs 'iconify-or-deiconify-frame
-                          global-map)
-
-;; Map certain keypad keys into ASCII characters
-;; that people usually expect.
-(define-key function-key-map [backspace] [127])
-(define-key function-key-map [delete] [127])
-(define-key function-key-map [tab] [?\t])
-(define-key function-key-map [linefeed] [?\n])
-(define-key function-key-map [clear] [?\C-l])
-(define-key function-key-map [return] [?\C-m])
-(define-key function-key-map [escape] [?\e])
-(define-key function-key-map [M-backspace] [?\M-\d])
-(define-key function-key-map [M-delete] [?\M-\d])
-(define-key function-key-map [M-tab] [?\M-\t])
-(define-key function-key-map [M-linefeed] [?\M-\n])
-(define-key function-key-map [M-clear] [?\M-\C-l])
-(define-key function-key-map [M-return] [?\M-\C-m])
-(define-key function-key-map [M-escape] [?\M-\e])
-(define-key function-key-map [iso-lefttab] [backtab])
-(define-key function-key-map [S-iso-lefttab] [backtab])
+(defun x-setup-function-keys (frame)
+  "Set up `function-key-map' on FRAME for the X window system."
+  ;; Don't do this twice on the same display, or it would break
+  ;; normal-erase-is-backspace-mode.
+  (unless (terminal-parameter frame 'x-setup-function-keys)
+    ;; Map certain keypad keys into ASCII characters that people usually expect.
+    (with-selected-frame frame
+      (define-key local-function-key-map [backspace] [127])
+      (define-key local-function-key-map [delete] [127])
+      (define-key local-function-key-map [tab] [?\t])
+      (define-key local-function-key-map [linefeed] [?\n])
+      (define-key local-function-key-map [clear] [?\C-l])
+      (define-key local-function-key-map [return] [?\C-m])
+      (define-key local-function-key-map [escape] [?\e])
+      (define-key local-function-key-map [M-backspace] [?\M-\d])
+      (define-key local-function-key-map [M-delete] [?\M-\d])
+      (define-key local-function-key-map [M-tab] [?\M-\t])
+      (define-key local-function-key-map [M-linefeed] [?\M-\n])
+      (define-key local-function-key-map [M-clear] [?\M-\C-l])
+      (define-key local-function-key-map [M-return] [?\M-\C-m])
+      (define-key local-function-key-map [M-escape] [?\M-\e])
+      (define-key local-function-key-map [iso-lefttab] [backtab])
+      (define-key local-function-key-map [S-iso-lefttab] [backtab]))
+    (set-terminal-parameter frame 'x-setup-function-keys t)))
 
 ;; These tell read-char how to convert
 ;; these special chars to ASCII.
@@ -2383,164 +2392,165 @@ order until succeed.")
     (or clip-text primary-text cut-text)
     ))
 
-\f
-;; Do the actual X Windows setup here; the above code just defines
-;; functions and variables that we use now.
-
-(setq command-line-args (x-handle-args command-line-args))
-
-;; Make sure we have a valid resource name.
-(or (stringp x-resource-name)
-    (let (i)
-      (setq x-resource-name (invocation-name))
-
-      ;; Change any . or * characters in x-resource-name to hyphens,
-      ;; so as not to choke when we use it in X resource queries.
-      (while (setq i (string-match "[.*]" x-resource-name))
-       (aset x-resource-name i ?-))))
-
-(x-open-connection (or x-display-name
-                      (setq x-display-name (getenv "DISPLAY")))
-                  x-command-line-resources
-                  ;; Exit Emacs with fatal error if this fails.
-                  t)
-
-(setq frame-creation-function 'x-create-frame-with-faces)
-
-(setq x-cut-buffer-max (min (- (/ (x-server-max-request-size) 2) 100)
-                           x-cut-buffer-max))
-
-;; Setup the default fontset.
-(setup-default-fontset)
-
-;; Create the standard fontset.
-(create-fontset-from-fontset-spec standard-fontset-spec t)
-
-;; Create fontset specified in X resources "Fontset-N" (N is 0, 1, ...).
-(create-fontset-from-x-resource)
-
-;; Try to create a fontset from a font specification which comes
-;; from initial-frame-alist, default-frame-alist, or X resource.
-;; A font specification in command line argument (i.e. -fn XXXX)
-;; should be already in default-frame-alist as a `font'
-;; parameter.  However, any font specifications in site-start
-;; library, user's init file (.emacs), and default.el are not
-;; yet handled here.
-
-(let ((font (or (cdr (assq 'font initial-frame-alist))
-               (cdr (assq 'font default-frame-alist))
-               (x-get-resource "font" "Font")))
-      xlfd-fields resolved-name)
-  (if (and font
-          (not (query-fontset font))
-          (setq resolved-name (x-resolve-font-name font))
-          (setq xlfd-fields (x-decompose-font-name font)))
-      (if (string= "fontset" (aref xlfd-fields xlfd-regexp-registry-subnum))
-         (new-fontset font (x-complement-fontset-spec xlfd-fields nil))
-       ;; Create a fontset from FONT.  The fontset name is
-       ;; generated from FONT.
-       (create-fontset-from-ascii-font font resolved-name "startup"))))
-
-;; Apply a geometry resource to the initial frame.  Put it at the end
-;; of the alist, so that anything specified on the command line takes
-;; precedence.
-(let* ((res-geometry (x-get-resource "geometry" "Geometry"))
-       parsed)
-  (if res-geometry
-      (progn
-       (setq parsed (x-parse-geometry res-geometry))
-       ;; If the resource specifies a position,
-       ;; call the position and size "user-specified".
-       (if (or (assq 'top parsed) (assq 'left parsed))
-           (setq parsed (cons '(user-position . t)
-                              (cons '(user-size . t) parsed))))
-       ;; All geometry parms apply to the initial frame.
-       (setq initial-frame-alist (append initial-frame-alist parsed))
-       ;; The size parms apply to all frames.  Don't set it if there are
-       ;; sizes there already (from command line).
-       (if (and (assq 'height parsed)
-                (not (assq 'height default-frame-alist)))
-           (setq default-frame-alist
-                 (cons (cons 'height (cdr (assq 'height parsed)))
-                       default-frame-alist)))
-       (if (and (assq 'width parsed)
-                (not (assq 'width default-frame-alist)))
-           (setq default-frame-alist
-                 (cons (cons 'width (cdr (assq 'width parsed)))
-                       default-frame-alist))))))
-
-;; Check the reverseVideo resource.
-(let ((case-fold-search t))
-  (let ((rv (x-get-resource "reverseVideo" "ReverseVideo")))
-    (if (and rv
-            (string-match "^\\(true\\|yes\\|on\\)$" rv))
-       (setq default-frame-alist
-             (cons '(reverse . t) default-frame-alist)))))
+(defun x-clipboard-yank ()
+  "Insert the clipboard contents, or the last stretch of killed text."
+  (interactive "*")
+  (let ((clipboard-text (x-selection-value 'CLIPBOARD))
+       (x-select-enable-clipboard t))
+    (if (and clipboard-text (> (length clipboard-text) 0))
+       (kill-new clipboard-text))
+    (yank)))
+
+(defun x-menu-bar-open (&optional frame)
+  "Open the menu bar if `menu-bar-mode' is on. otherwise call `tmm-menubar'."
+  (interactive "i")
+  (if menu-bar-mode (menu-bar-open frame)
+    (tmm-menubar)))
 
-;; Set x-selection-timeout, measured in milliseconds.
-(let ((res-selection-timeout
-       (x-get-resource "selectionTimeout" "SelectionTimeout")))
-  (setq x-selection-timeout 20000)
-  (if res-selection-timeout
-      (setq x-selection-timeout (string-to-number res-selection-timeout))))
+\f
+;;; Window system initialization.
 
 (defun x-win-suspend-error ()
   (error "Suspending an Emacs running under X makes no sense"))
-(add-hook 'suspend-hook 'x-win-suspend-error)
 
-;; Arrange for the kill and yank functions to set and check the clipboard.
-(setq interprogram-cut-function 'x-select-text)
-(setq interprogram-paste-function 'x-cut-buffer-or-selection-value)
+(defvar x-initialized nil
+  "Non-nil if the X window system has been initialized.")
+
+(defun x-initialize-window-system ()
+  "Initialize Emacs for X frames and open the first connection to an X server."
+  ;; Make sure we have a valid resource name.
+  (or (stringp x-resource-name)
+      (let (i)
+       (setq x-resource-name (invocation-name))
+
+       ;; Change any . or * characters in x-resource-name to hyphens,
+       ;; so as not to choke when we use it in X resource queries.
+       (while (setq i (string-match "[.*]" x-resource-name))
+         (aset x-resource-name i ?-))))
+
+  (x-open-connection (or x-display-name
+                        (setq x-display-name (or (getenv "DISPLAY" (terminal-id))
+                                                 (getenv "DISPLAY"))))
+                    x-command-line-resources
+                    ;; Exit Emacs with fatal error if this fails and we
+                    ;; are the initial display.
+                    (eq initial-window-system 'x))
+
+  (setq x-cut-buffer-max (min (- (/ (x-server-max-request-size) 2) 100)
+                             x-cut-buffer-max))
+
+  ;; Setup the default fontset.
+  (setup-default-fontset)
+
+  ;; Create the standard fontset.
+  (create-fontset-from-fontset-spec standard-fontset-spec t)
+
+  ;; Create fontset specified in X resources "Fontset-N" (N is 0, 1, ...).
+  (create-fontset-from-x-resource)
+
+  ;; Try to create a fontset from a font specification which comes
+  ;; from initial-frame-alist, default-frame-alist, or X resource.
+  ;; A font specification in command line argument (i.e. -fn XXXX)
+  ;; should be already in default-frame-alist as a `font'
+  ;; parameter.  However, any font specifications in site-start
+  ;; library, user's init file (.emacs), and default.el are not
+  ;; yet handled here.
+
+  (let ((font (or (cdr (assq 'font initial-frame-alist))
+                 (cdr (assq 'font default-frame-alist))
+                 (x-get-resource "font" "Font")))
+       xlfd-fields resolved-name)
+    (if (and font
+            (not (query-fontset font))
+            (setq resolved-name (x-resolve-font-name font))
+            (setq xlfd-fields (x-decompose-font-name font)))
+       (if (string= "fontset" (aref xlfd-fields xlfd-regexp-registry-subnum))
+           (new-fontset font (x-complement-fontset-spec xlfd-fields nil))
+         ;; Create a fontset from FONT.  The fontset name is
+         ;; generated from FONT.
+         (create-fontset-from-ascii-font font resolved-name "startup"))))
+
+  ;; Apply a geometry resource to the initial frame.  Put it at the end
+  ;; of the alist, so that anything specified on the command line takes
+  ;; precedence.
+  (let* ((res-geometry (x-get-resource "geometry" "Geometry"))
+        parsed)
+    (if res-geometry
+       (progn
+         (setq parsed (x-parse-geometry res-geometry))
+         ;; If the resource specifies a position,
+         ;; call the position and size "user-specified".
+         (if (or (assq 'top parsed) (assq 'left parsed))
+             (setq parsed (cons '(user-position . t)
+                                (cons '(user-size . t) parsed))))
+         ;; All geometry parms apply to the initial frame.
+         (setq initial-frame-alist (append initial-frame-alist parsed))
+         ;; The size parms apply to all frames.  Don't set it if there are 
+         ;; sizes there already (from command line).
+         (if (and (assq 'height parsed)
+                  (not (assq 'height default-frame-alist)))
+             (setq default-frame-alist
+                   (cons (cons 'height (cdr (assq 'height parsed)))
+                         default-frame-alist)))
+         (if (and (assq 'width parsed)
+                  (not (assq 'width default-frame-alist)))
+             (setq default-frame-alist
+                   (cons (cons 'width (cdr (assq 'width parsed)))
+                         default-frame-alist))))))
+
+  ;; Check the reverseVideo resource.
+  (let ((case-fold-search t))
+    (let ((rv (x-get-resource "reverseVideo" "ReverseVideo")))
+      (if (and rv
+              (string-match "^\\(true\\|yes\\|on\\)$" rv))
+         (setq default-frame-alist
+               (cons '(reverse . t) default-frame-alist)))))
 
-;; Turn off window-splitting optimization; X is usually fast enough
-;; that this is only annoying.
-(setq split-window-keep-point t)
+  ;; Set x-selection-timeout, measured in milliseconds.
+  (let ((res-selection-timeout
+        (x-get-resource "selectionTimeout" "SelectionTimeout")))
+    (setq x-selection-timeout 20000)
+    (if res-selection-timeout
+       (setq x-selection-timeout (string-to-number res-selection-timeout))))
 
-;; Don't show the frame name; that's redundant with X.
-(setq-default mode-line-frame-identification "  ")
+  ;; Don't let Emacs suspend under X.
+  (add-hook 'suspend-hook 'x-win-suspend-error)
 
-;; Motif direct handling of f10 wasn't working right,
-;; So temporarily we've turned it off in lwlib-Xm.c
-;; and turned the Emacs f10 back on.
-;; ;; Motif normally handles f10 itself, so don't try to handle it a second time.
-;; (if (featurep 'motif)
-;;     (global-set-key [f10] 'ignore))
+  ;; Turn off window-splitting optimization; X is usually fast enough
+  ;; that this is only annoying.
+  (setq split-window-keep-point t)
 
-;; Turn on support for mouse wheels.
-(mouse-wheel-mode 1)
+  ;; Motif direct handling of f10 wasn't working right,
+  ;; So temporarily we've turned it off in lwlib-Xm.c
+  ;; and turned the Emacs f10 back on.
+  ;; ;; Motif normally handles f10 itself, so don't try to handle it a second time.
+  ;; (if (featurep 'motif)
+  ;;     (global-set-key [f10] 'ignore))
 
+  ;; Turn on support for mouse wheels.
+  (mouse-wheel-mode 1)
 
-;; Enable CLIPBOARD copy/paste through menu bar commands.
-(menu-bar-enable-clipboard)
+  ;; Enable CLIPBOARD copy/paste through menu bar commands.
+  (menu-bar-enable-clipboard)
 
-;; Override Paste so it looks at CLIPBOARD first.
-(defun x-clipboard-yank ()
-  "Insert the clipboard contents, or the last stretch of killed text."
-  (interactive "*")
-  (let ((clipboard-text (x-selection-value 'CLIPBOARD))
-       (x-select-enable-clipboard t))
-    (if (and clipboard-text (> (length clipboard-text) 0))
-       (kill-new clipboard-text))
-    (yank)))
+  ;; Override Paste so it looks at CLIPBOARD first.
+  (define-key menu-bar-edit-menu [paste]
+    (append '(menu-item "Paste" x-clipboard-yank
+                       :enable (not buffer-read-only)
+                       :help "Paste (yank) text most recently cut/copied")
+           nil))
+
+  (setq x-initialized t))
+
+(add-to-list 'handle-args-function-alist '(x . x-handle-args))
+(add-to-list 'frame-creation-function-alist '(x . x-create-frame-with-faces))
+(add-to-list 'window-system-initialization-alist '(x . x-initialize-window-system))
 
-(define-key menu-bar-edit-menu [paste]
-  '(menu-item "Paste" x-clipboard-yank
-             :enable (not buffer-read-only)
-             :help "Paste (yank) text most recently cut/copied"))
+(provide 'x-win)
 
 ;; Initiate drag and drop
 (add-hook 'after-make-frame-functions 'x-dnd-init-frame)
 (define-key special-event-map [drag-n-drop] 'x-dnd-handle-drag-n-drop-event)
 
-;; Let F10 do menu bar navigation.
-(defun x-menu-bar-open (&optional frame)
-  "Open the menu bar if `menu-bar-mode' is on. otherwise call `tmm-menubar'."
-  (interactive "i")
-  (if menu-bar-mode (menu-bar-open frame)
-    (tmm-menubar)))
-                  
-(and (fboundp 'menu-bar-open)
-     (global-set-key [f10] 'x-menu-bar-open))
-
 ;; arch-tag: f1501302-db8b-4d95-88e3-116697d89f78
 ;;; x-win.el ends here
dissimilarity index 70%
index fac25d8..fd21c77 100644 (file)
-;;; xterm.el --- define function key sequences and standard colors for xterm
-
-;; Copyright (C) 1995, 2002, 2003, 2004, 2005,
-;;   2006 Free Software Foundation, Inc.
-
-;; Author: FSF
-;; Keywords: terminals
-
-;; This file is part of GNU Emacs.
-
-;; GNU Emacs is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
-;; any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
-
-;;; Commentary:
-
-;;; Code:
-
-(defun terminal-init-xterm ()
-  "Terminal initialization function for xterm."
-  ;; rxvt terminals sometimes set the TERM variable to "xterm", but
-  ;; rxvt's keybindings that are incompatible with xterm's. It is
-  ;; better in that case to use rxvt's initializion function.
-  (if (and (getenv "COLORTERM")
-          (string-match "\\`rxvt" (getenv "COLORTERM")))
-      (progn 
-       (eval-and-compile (load "term/rxvt"))
-       (terminal-init-rxvt))
-
-    ;; The terminal intialization C code file might have initialized
-    ;; function keys F13->F60 from the termcap/terminfo information.  On
-    ;; a PC-style keyboard these keys correspond to
-    ;; MODIFIER-FUNCTION_KEY, where modifier is S-, C, A-, C-S-.  The
-    ;; code here subsitutes the corresponding defintions in
-    ;; function-key-map. This substitution is needed because if a key
-    ;; definition is found in function-key-map, there are no further
-    ;; lookups in other keymaps.
-    (substitute-key-definition [f13] [S-f1] function-key-map)
-    (substitute-key-definition [f14] [S-f2] function-key-map)
-    (substitute-key-definition [f15] [S-f3] function-key-map)
-    (substitute-key-definition [f16] [S-f4] function-key-map)
-    (substitute-key-definition [f17] [S-f5] function-key-map)
-    (substitute-key-definition [f18] [S-f6] function-key-map)
-    (substitute-key-definition [f19] [S-f7] function-key-map)
-    (substitute-key-definition [f20] [S-f8] function-key-map)
-    (substitute-key-definition [f21] [S-f9] function-key-map)
-    (substitute-key-definition [f22] [S-f10] function-key-map)
-    (substitute-key-definition [f23] [S-f11] function-key-map)
-    (substitute-key-definition [f24] [S-f12] function-key-map)
-
-    (substitute-key-definition [f25] [C-f1] function-key-map)
-    (substitute-key-definition [f26] [C-f2] function-key-map)
-    (substitute-key-definition [f27] [C-f3] function-key-map)
-    (substitute-key-definition [f28] [C-f4] function-key-map)
-    (substitute-key-definition [f29] [C-f5] function-key-map)
-    (substitute-key-definition [f30] [C-f6] function-key-map)
-    (substitute-key-definition [f31] [C-f7] function-key-map)
-    (substitute-key-definition [f32] [C-f8] function-key-map)
-    (substitute-key-definition [f33] [C-f9] function-key-map)
-    (substitute-key-definition [f34] [C-f10] function-key-map)
-    (substitute-key-definition [f35] [C-f11] function-key-map)
-    (substitute-key-definition [f36] [C-f12] function-key-map)
-
-    (substitute-key-definition [f37] [C-S-f1] function-key-map)
-    (substitute-key-definition [f38] [C-S-f2] function-key-map)
-    (substitute-key-definition [f39] [C-S-f3] function-key-map)
-    (substitute-key-definition [f40] [C-S-f4] function-key-map)
-    (substitute-key-definition [f41] [C-S-f5] function-key-map)
-    (substitute-key-definition [f42] [C-S-f6] function-key-map)
-    (substitute-key-definition [f43] [C-S-f7] function-key-map)
-    (substitute-key-definition [f44] [C-S-f8] function-key-map)
-    (substitute-key-definition [f45] [C-S-f9] function-key-map)
-    (substitute-key-definition [f46] [C-S-f10] function-key-map)
-    (substitute-key-definition [f47] [C-S-f11] function-key-map)
-    (substitute-key-definition [f48] [C-S-f12] function-key-map)
-
-    (substitute-key-definition [f49] [A-f1] function-key-map)
-    (substitute-key-definition [f50] [A-f2] function-key-map)
-    (substitute-key-definition [f51] [A-f3] function-key-map)
-    (substitute-key-definition [f52] [A-f4] function-key-map)
-    (substitute-key-definition [f53] [A-f5] function-key-map)
-    (substitute-key-definition [f54] [A-f6] function-key-map)
-    (substitute-key-definition [f55] [A-f7] function-key-map)
-    (substitute-key-definition [f56] [A-f8] function-key-map)
-    (substitute-key-definition [f57] [A-f9] function-key-map)
-    (substitute-key-definition [f58] [A-f10] function-key-map)
-    (substitute-key-definition [f59] [A-f11] function-key-map)
-    (substitute-key-definition [f60] [A-f12] function-key-map)
-
-    (let ((map (make-sparse-keymap)))
-      ;; xterm from X.org 6.8.2 uses these key definitions.
-      (define-key map "\eOP" [f1])
-      (define-key map "\eOQ" [f2])
-      (define-key map "\eOR" [f3])
-      (define-key map "\eOS" [f4])
-      (define-key map "\e[15~" [f5])
-      (define-key map "\e[17~" [f6])
-      (define-key map "\e[18~" [f7])
-      (define-key map "\e[19~" [f8])
-      (define-key map "\e[20~" [f9])
-      (define-key map "\e[21~" [f10])
-      (define-key map "\e[23~" [f11])
-      (define-key map "\e[24~" [f12])
-
-      (define-key map "\eO2P" [S-f1])
-      (define-key map "\eO2Q" [S-f2])
-      (define-key map "\eO2R" [S-f3])
-      (define-key map "\eO2S" [S-f4])
-      (define-key map "\e[1;2P" [S-f1])
-      (define-key map "\e[1;2Q" [S-f2])
-      (define-key map "\e[1;2R" [S-f3])
-      (define-key map "\e[1;2S" [S-f4])
-      (define-key map "\e[15;2~" [S-f5])
-      (define-key map "\e[17;2~" [S-f6])
-      (define-key map "\e[18;2~" [S-f7])
-      (define-key map "\e[19;2~" [S-f8])
-      (define-key map "\e[20;2~" [S-f9])
-      (define-key map "\e[21;2~" [S-f10])
-      (define-key map "\e[23;2~" [S-f11])
-      (define-key map "\e[24;2~" [S-f12])
-
-      (define-key map "\eO5P" [C-f1])
-      (define-key map "\eO5Q" [C-f2])
-      (define-key map "\eO5R" [C-f3])
-      (define-key map "\eO5S" [C-f4])
-      (define-key map "\e[15;5~" [C-f5])
-      (define-key map "\e[17;5~" [C-f6])
-      (define-key map "\e[18;5~" [C-f7])
-      (define-key map "\e[19;5~" [C-f8])
-      (define-key map "\e[20;5~" [C-f9])
-      (define-key map "\e[21;5~" [C-f10])
-      (define-key map "\e[23;5~" [C-f11])
-      (define-key map "\e[24;5~" [C-f12])
-
-      (define-key map "\eO6P" [C-S-f1])
-      (define-key map "\eO6Q" [C-S-f2])
-      (define-key map "\eO6R" [C-S-f3])
-      (define-key map "\eO6S" [C-S-f4])
-      (define-key map "\e[15;6~" [C-S-f5])
-      (define-key map "\e[17;6~" [C-S-f6])
-      (define-key map "\e[18;6~" [C-S-f7])
-      (define-key map "\e[19;6~" [C-S-f8])
-      (define-key map "\e[20;6~" [C-S-f9])
-      (define-key map "\e[21;6~" [C-S-f10])
-      (define-key map "\e[23;6~" [C-S-f11])
-      (define-key map "\e[24;6~" [C-S-f12])
-
-      (define-key map "\eO3P" [A-f1])
-      (define-key map "\eO3Q" [A-f2])
-      (define-key map "\eO3R" [A-f3])
-      (define-key map "\eO3S" [A-f4])
-      (define-key map "\e[15;3~" [A-f5])
-      (define-key map "\e[17;3~" [A-f6])
-      (define-key map "\e[18;3~" [A-f7])
-      (define-key map "\e[19;3~" [A-f8])
-      (define-key map "\e[20;3~" [A-f9])
-      (define-key map "\e[21;3~" [A-f10])
-      (define-key map "\e[23;3~" [A-f11])
-      (define-key map "\e[24;3~" [A-f12])
-
-      (define-key map "\eOA" [up])
-      (define-key map "\eOB" [down])
-      (define-key map "\eOC" [right])
-      (define-key map "\eOD" [left])
-      (define-key map "\eOF" [end])
-      (define-key map "\eOH" [home])
-
-      (define-key map "\e[1;2A" [S-up])
-      (define-key map "\e[1;2B" [S-down])
-      (define-key map "\e[1;2C" [S-right])
-      (define-key map "\e[1;2D" [S-left])
-      (define-key map "\e[1;2F" [S-end])
-      (define-key map "\e[1;2H" [S-home])
-
-      (define-key map "\e[1;5A" [C-up])
-      (define-key map "\e[1;5B" [C-down])
-      (define-key map "\e[1;5C" [C-right])
-      (define-key map "\e[1;5D" [C-left])
-      (define-key map "\e[1;5F" [C-end])
-      (define-key map "\e[1;5H" [C-home])
-
-      (define-key map "\e[1;6A" [C-S-up])
-      (define-key map "\e[1;6B" [C-S-down])
-      (define-key map "\e[1;6C" [C-S-right])
-      (define-key map "\e[1;6D" [C-S-left])
-      (define-key map "\e[1;6F" [C-S-end])
-      (define-key map "\e[1;6H" [C-S-home])
-
-      (define-key map "\e[1;3A" [A-up])
-      (define-key map "\e[1;3B" [A-down])
-      (define-key map "\e[1;3C" [A-right])
-      (define-key map "\e[1;3D" [A-left])
-      (define-key map "\e[1;3F" [A-end])
-      (define-key map "\e[1;3H" [A-home])
-
-      (define-key map "\e[2~" [insert])
-      (define-key map "\e[3~" [delete])
-      (define-key map "\e[5~" [prior])
-      (define-key map "\e[6~" [next])
-
-      (define-key map "\e[2;2~" [S-insert])
-      (define-key map "\e[3;2~" [S-delete])
-      (define-key map "\e[5;2~" [S-prior])
-      (define-key map "\e[6;2~" [S-next])
-
-      (define-key map "\e[2;5~" [C-insert])
-      (define-key map "\e[3;5~" [C-delete])
-      (define-key map "\e[5;5~" [C-prior])
-      (define-key map "\e[6;5~" [C-next])
-
-      (define-key map "\e[2;6~" [C-S-insert])
-      (define-key map "\e[3;6~" [C-S-delete])
-      (define-key map "\e[5;6~" [C-S-prior])
-      (define-key map "\e[6;6~" [C-S-next])
-
-      (define-key map "\e[2;3~" [A-insert])
-      (define-key map "\e[3;3~" [A-delete])
-      (define-key map "\e[5;3~" [A-prior])
-      (define-key map "\e[6;3~" [A-next])
-
-      (define-key map "\e[4~" [select])
-      (define-key map "\e[29~" [print])
-      
-      ;; These keys are available in xterm starting from version 216
-      ;; if the modifyOtherKeys resource is set to 1.
-
-      (define-key map "\e[27;5;9~"   [C-tab])
-      (define-key map "\e[27;5;13~"  [C-return])
-      (define-key map "\e[27;5;39~"  [?\C-\'])
-      (define-key map "\e[27;5;44~"  [?\C-,])
-      (define-key map "\e[27;5;45~"  [?\C--])
-      (define-key map "\e[27;5;46~"  [?\C-.])
-      (define-key map "\e[27;5;47~"  [?\C-/])
-      (define-key map "\e[27;5;48~"  [?\C-0])
-      (define-key map "\e[27;5;49~"  [?\C-1])
-      ;; Not all C-DIGIT keys have a distinct binding.
-      (define-key map "\e[27;5;57~"  [?\C-9])
-      (define-key map "\e[27;5;59~"  [(C-\;)])
-      (define-key map "\e[27;5;61~"  [?\C-=])
-      (define-key map "\e[27;5;92~"  [?\C-\\])
-
-      (define-key map "\e[27;6;33~"  [?\C-!])
-      (define-key map "\e[27;6;34~"  [?\C-\"])
-      (define-key map "\e[27;6;35~"  [?\C-#])
-      (define-key map "\e[27;6;36~"  [?\C-$])
-      (define-key map "\e[27;6;37~"  [?\C-%])
-      (define-key map "\e[27;6;38~"  [(C-&)])
-      (define-key map "\e[27;6;40~"  [?\C-(])
-      (define-key map "\e[27;6;41~"  [?\C-)])
-      (define-key map "\e[27;6;42~"  [?\C-*])
-      (define-key map "\e[27;6;43~"  [?\C-+])
-      (define-key map "\e[27;6;58~"  [?\C-:])
-      (define-key map "\e[27;6;60~"  [?\C-<])
-      (define-key map "\e[27;6;62~"  [?\C->])
-      (define-key map "\e[27;6;63~"  [(C-\?)])
-
-      ;; These are the strings emitted for various C-M- combinations
-      ;; for keyboards that the Meta and Alt modifiers are on the same
-      ;; key (usually labeled "Alt").
-      (define-key map "\e[27;13;9~"  [(C-M-tab)])
-      (define-key map "\e[27;13;13~" [(C-M-return)])
-
-      (define-key map "\e[27;13;39~" [?\C-\M-\'])
-      (define-key map "\e[27;13;44~" [?\C-\M-,])
-      (define-key map "\e[27;13;45~" [?\C-\M--])
-      (define-key map "\e[27;13;46~" [?\C-\M-.])
-      (define-key map "\e[27;13;47~" [?\C-\M-/])
-      (define-key map "\e[27;13;48~" [?\C-\M-0])
-      (define-key map "\e[27;13;49~" [?\C-\M-1])
-      (define-key map "\e[27;13;50~" [?\C-\M-2])
-      (define-key map "\e[27;13;51~" [?\C-\M-3])
-      (define-key map "\e[27;13;52~" [?\C-\M-4])
-      (define-key map "\e[27;13;53~" [?\C-\M-5])
-      (define-key map "\e[27;13;54~" [?\C-\M-6])
-      (define-key map "\e[27;13;55~" [?\C-\M-7])
-      (define-key map "\e[27;13;56~" [?\C-\M-8])
-      (define-key map "\e[27;13;57~" [?\C-\M-9])
-      (define-key map "\e[27;13;59~" [?\C-\M-\;])
-      (define-key map "\e[27;13;61~" [?\C-\M-=])
-      (define-key map "\e[27;13;92~" [?\C-\M-\\])
-
-      (define-key map "\e[27;14;33~"  [?\C-\M-!])
-      (define-key map "\e[27;14;34~"  [?\C-\M-\"])
-      (define-key map "\e[27;14;35~"  [?\C-\M-#])
-      (define-key map "\e[27;14;36~"  [?\C-\M-$])
-      (define-key map "\e[27;14;37~"  [?\C-\M-%])
-      (define-key map "\e[27;14;38~"  [(C-M-&)])
-      (define-key map "\e[27;14;40~"  [?\C-\M-(])
-      (define-key map "\e[27;14;41~"  [?\C-\M-)])
-      (define-key map "\e[27;14;42~"  [?\C-\M-*])
-      (define-key map "\e[27;14;43~"  [?\C-\M-+])
-      (define-key map "\e[27;14;58~"  [?\C-\M-:])
-      (define-key map "\e[27;14;60~"  [?\C-\M-<])
-      (define-key map "\e[27;14;62~"  [?\C-\M->])
-      (define-key map "\e[27;14;63~"  [(C-M-\?)])
-
-      (define-key map "\e[27;7;9~"  [(C-M-tab)])
-      (define-key map "\e[27;7;13~" [(C-M-return)])
-
-      (define-key map "\e[27;7;39~" [?\C-\M-\'])
-      (define-key map "\e[27;7;44~" [?\C-\M-,])
-      (define-key map "\e[27;7;45~" [?\C-\M--])
-      (define-key map "\e[27;7;46~" [?\C-\M-.])
-      (define-key map "\e[27;7;47~" [?\C-\M-/])
-      (define-key map "\e[27;7;48~" [?\C-\M-0])
-      (define-key map "\e[27;7;49~" [?\C-\M-1])
-      (define-key map "\e[27;7;50~" [?\C-\M-2])
-      (define-key map "\e[27;7;51~" [?\C-\M-3])
-      (define-key map "\e[27;7;52~" [?\C-\M-4])
-      (define-key map "\e[27;7;53~" [?\C-\M-5])
-      (define-key map "\e[27;7;54~" [?\C-\M-6])
-      (define-key map "\e[27;7;55~" [?\C-\M-7])
-      (define-key map "\e[27;7;56~" [?\C-\M-8])
-      (define-key map "\e[27;7;57~" [?\C-\M-9])
-      (define-key map "\e[27;7;59~" [?\C-\M-\;])
-      (define-key map "\e[27;7;61~" [?\C-\M-=])
-      (define-key map "\e[27;7;92~" [?\C-\M-\\])
-
-      (define-key map "\e[27;8;33~"  [?\C-\M-!])
-      (define-key map "\e[27;8;34~"  [?\C-\M-\"])
-      (define-key map "\e[27;8;35~"  [?\C-\M-#])
-      (define-key map "\e[27;8;36~"  [?\C-\M-$])
-      (define-key map "\e[27;8;37~"  [?\C-\M-%])
-      (define-key map "\e[27;8;38~"  [(C-M-&)])
-      (define-key map "\e[27;8;40~"  [?\C-\M-(])
-      (define-key map "\e[27;8;41~"  [?\C-\M-)])
-      (define-key map "\e[27;8;42~"  [?\C-\M-*])
-      (define-key map "\e[27;8;43~"  [?\C-\M-+])
-      (define-key map "\e[27;8;58~"  [?\C-\M-:])
-      (define-key map "\e[27;8;60~"  [?\C-\M-<])
-      (define-key map "\e[27;8;62~"  [?\C-\M->])
-      (define-key map "\e[27;8;63~"  [(C-M-\?)])
-
-      (define-key map "\e[27;2;9~"   [S-tab])
-      (define-key map "\e[27;2;13~"  [S-return])
-
-      (define-key map "\e[27;6;9~"   [(C-S-tab)])
-      (define-key map "\e[27;6;13~"  [(C-S-return)])
-
-      ;; Other versions of xterm might emit these.
-      (define-key map "\e[A" [up])
-      (define-key map "\e[B" [down])
-      (define-key map "\e[C" [right])
-      (define-key map "\e[D" [left])
-      (define-key map "\e[1~" [home])
-
-      (define-key map "\eO2A" [S-up])
-      (define-key map "\eO2B" [S-down])
-      (define-key map "\eO2C" [S-right])
-      (define-key map "\eO2D" [S-left])
-      (define-key map "\eO2F" [S-end])
-      (define-key map "\eO2H" [S-home])
-
-      (define-key map "\eO5A" [C-up])
-      (define-key map "\eO5B" [C-down])
-      (define-key map "\eO5C" [C-right])
-      (define-key map "\eO5D" [C-left])
-      (define-key map "\eO5F" [C-end])
-      (define-key map "\eO5H" [C-home])
-
-      (define-key map "\e[11~" [f1])
-      (define-key map "\e[12~" [f2])
-      (define-key map "\e[13~" [f3])
-      (define-key map "\e[14~" [f4])
-
-      ;; Use inheritance to let the main keymap override those defaults.
-      ;; This way we don't override terminfo-derived settings or settings
-      ;; made in the .emacs file.
-      (set-keymap-parent map (keymap-parent function-key-map))
-      (set-keymap-parent function-key-map map))
-
-    ;; Do it!
-    (xterm-register-default-colors)
-    ;; This recomputes all the default faces given the colors we've just set up.
-    (tty-set-up-initial-frame-faces)))
-
-;; Set up colors, for those versions of xterm that support it.
-(defvar xterm-standard-colors
-  ;; The names in the comments taken from XTerm-col.ad in the xterm
-  ;; distribution, see ftp://dickey.his.com/xterm/.  RGB values are
-  ;; from rgb.txt.
-  '(("black"          0 (  0   0   0)) ; black
-    ("red"            1 (205   0   0)) ; red3
-    ("green"          2 (  0 205   0)) ; green3
-    ("yellow"         3 (205 205   0)) ; yellow3
-    ("blue"           4 (  0   0 238)) ; blue2
-    ("magenta"        5 (205   0 205)) ; magenta3
-    ("cyan"           6 (  0 205 205)) ; cyan3
-    ("white"          7 (229 229 229)) ; gray90
-    ("brightblack"    8 (127 127 127)) ; gray50
-    ("brightred"      9 (255   0   0)) ; red
-    ("brightgreen"   10 (  0 255   0)) ; green
-    ("brightyellow"  11 (255 255   0)) ; yellow
-    ("brightblue"    12 (92   92 255)) ; rgb:5c/5c/ff
-    ("brightmagenta" 13 (255   0 255)) ; magenta
-    ("brightcyan"    14 (  0 255 255)) ; cyan
-    ("brightwhite"   15 (255 255 255)))        ; white
-  "Names of 16 standard xterm/aixterm colors, their numbers, and RGB values.")
-
-(defun xterm-rgb-convert-to-16bit (prim)
-  "Convert an 8-bit primary color value PRIM to a corresponding 16-bit value."
-  (logior prim (lsh prim 8)))
-
-(defun xterm-register-default-colors ()
-  "Register the default set of colors for xterm or compatible emulator.
-
-This function registers the number of colors returned by `display-color-cells'
-for the currently selected frame.  The first 16 colors are taken from
-`xterm-standard-colors', which see, while the rest are computed assuming
-either the 88- or 256-color standard color scheme supported by latest
-versions of xterm."
-  (let* ((ncolors (display-color-cells))
-        (colors xterm-standard-colors)
-        (color (car colors)))
-    (if (> ncolors 0)
-       ;; Clear the 8 default tty colors registered by startup.el
-       (tty-color-clear))
-    ;; Only register as many colors as are supported by the display.
-    (while (and (> ncolors 0) colors)
-      (tty-color-define (car color) (cadr color)
-                       (mapcar 'xterm-rgb-convert-to-16bit
-                               (car (cddr color))))
-      (setq colors (cdr colors)
-           color (car colors)
-           ncolors (1- ncolors)))
-    ;; We've exhausted the colors from `xterm-standard-colors'.  If there
-    ;; are more colors to support, compute them now.
-    (when (> ncolors 0)
-      (cond
-       ((= ncolors 240)        ; 256-color xterm
-       ;; 216 non-gray colors first
-       (let ((r 0) (g 0) (b 0))
-         (while (> ncolors 24)
-           ;; This and other formulae taken from 256colres.pl and
-           ;; 88colres.pl in the xterm distribution.
-           (tty-color-define (format "color-%d" (- 256 ncolors))
-                             (- 256 ncolors)
-                             (mapcar 'xterm-rgb-convert-to-16bit
-                                     (list (if (zerop r) 0 (+ (* r 40) 55))
-                                           (if (zerop g) 0 (+ (* g 40) 55))
-                                           (if (zerop b) 0 (+ (* b 40) 55)))))
-
-           (setq b (1+ b))
-           (if (> b 5)
-               (setq g (1+ g)
-                     b 0))
-           (if (> g 5)
-               (setq r (1+ r)
-                     g 0))
-           (setq ncolors (1- ncolors))))
-       ;; Now the 24 gray colors
-       (while (> ncolors 0)
-         (setq color (xterm-rgb-convert-to-16bit (+ 8 (* (- 24 ncolors) 10))))
-         (tty-color-define (format "color-%d" (- 256 ncolors))
-                           (- 256 ncolors)
-                           (list color color color))
-         (setq ncolors (1- ncolors))))
-       ((= ncolors 72)  ; 88-color xterm
-       ;; 64 non-gray colors
-       (let ((levels '(0 139 205 255))
-             (r 0) (g 0) (b 0))
-         (while (> ncolors 8)
-           (tty-color-define (format "color-%d" (- 88 ncolors))
-                             (- 88 ncolors)
-                             (mapcar 'xterm-rgb-convert-to-16bit
-                                     (list (nth r levels)
-                                           (nth g levels)
-                                           (nth b levels))))
-           (setq b (1+ b))
-           (if (> b 3)
-               (setq g (1+ g)
-                     b 0))
-           (if (> g 3)
-               (setq r (1+ r)
-                     g 0))
-           (setq ncolors (1- ncolors))))
-       ;; Now the 8 gray colors
-       (while (> ncolors 0)
-         (setq color (xterm-rgb-convert-to-16bit
-                      (floor
-                       (if (= ncolors 8)
-                           46.36363636
-                         (+ (* (- 8 ncolors) 23.18181818) 69.54545454)))))
-         (tty-color-define (format "color-%d" (- 88 ncolors))
-                           (- 88 ncolors)
-                           (list color color color))
-         (setq ncolors (1- ncolors))))
-       (t (error "Unsupported number of xterm colors (%d)" (+ 16 ncolors)))))
-    ;; Modifying color mappings means realized faces don't use the
-    ;; right colors, so clear them.
-    (clear-face-cache)))
-
-;; arch-tag: 12e7ebdd-1e6c-4b25-b0f9-35ace25e855a
-;;; xterm.el ends here
+;;; xterm.el --- define function key sequences and standard colors for xterm
+
+;; Copyright (C) 1995, 2002, 2003, 2004, 2005,
+;;   2006 Free Software Foundation, Inc.
+
+;; Author: FSF
+;; Keywords: terminals
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
+
+;;; Code:
+
+(defvar xterm-function-map (make-sparse-keymap)
+  "Function key map overrides for xterm.")
+
+;; xterm from X.org 6.8.2 uses these key definitions.
+(define-key xterm-function-map "\eOP" [f1])
+(define-key xterm-function-map "\eOQ" [f2])
+(define-key xterm-function-map "\eOR" [f3])
+(define-key xterm-function-map "\eOS" [f4])
+(define-key xterm-function-map "\e[15~" [f5])
+(define-key xterm-function-map "\e[17~" [f6])
+(define-key xterm-function-map "\e[18~" [f7])
+(define-key xterm-function-map "\e[19~" [f8])
+(define-key xterm-function-map "\e[20~" [f9])
+(define-key xterm-function-map "\e[21~" [f10])
+(define-key xterm-function-map "\e[23~" [f11])
+(define-key xterm-function-map "\e[24~" [f12])
+
+(define-key xterm-function-map "\eO2P" [S-f1])
+(define-key xterm-function-map "\eO2Q" [S-f2])
+(define-key xterm-function-map "\eO2R" [S-f3])
+(define-key xterm-function-map "\eO2S" [S-f4])
+(define-key xterm-function-map "\e[1;2P" [S-f1])
+(define-key xterm-function-map "\e[1;2Q" [S-f2])
+(define-key xterm-function-map "\e[1;2R" [S-f3])
+(define-key xterm-function-map "\e[1;2S" [S-f4])
+(define-key xterm-function-map "\e[15;2~" [S-f5])
+(define-key xterm-function-map "\e[17;2~" [S-f6])
+(define-key xterm-function-map "\e[18;2~" [S-f7])
+(define-key xterm-function-map "\e[19;2~" [S-f8])
+(define-key xterm-function-map "\e[20;2~" [S-f9])
+(define-key xterm-function-map "\e[21;2~" [S-f10])
+(define-key xterm-function-map "\e[23;2~" [S-f11])
+(define-key xterm-function-map "\e[24;2~" [S-f12])
+
+(define-key xterm-function-map "\eO5P" [C-f1])
+(define-key xterm-function-map "\eO5Q" [C-f2])
+(define-key xterm-function-map "\eO5R" [C-f3])
+(define-key xterm-function-map "\eO5S" [C-f4])
+(define-key xterm-function-map "\e[15;5~" [C-f5])
+(define-key xterm-function-map "\e[17;5~" [C-f6])
+(define-key xterm-function-map "\e[18;5~" [C-f7])
+(define-key xterm-function-map "\e[19;5~" [C-f8])
+(define-key xterm-function-map "\e[20;5~" [C-f9])
+(define-key xterm-function-map "\e[21;5~" [C-f10])
+(define-key xterm-function-map "\e[23;5~" [C-f11])
+(define-key xterm-function-map "\e[24;5~" [C-f12])
+
+(define-key xterm-function-map "\eO6P" [C-S-f1])
+(define-key xterm-function-map "\eO6Q" [C-S-f2])
+(define-key xterm-function-map "\eO6R" [C-S-f3])
+(define-key xterm-function-map "\eO6S" [C-S-f4])
+(define-key xterm-function-map "\e[15;6~" [C-S-f5])
+(define-key xterm-function-map "\e[17;6~" [C-S-f6])
+(define-key xterm-function-map "\e[18;6~" [C-S-f7])
+(define-key xterm-function-map "\e[19;6~" [C-S-f8])
+(define-key xterm-function-map "\e[20;6~" [C-S-f9])
+(define-key xterm-function-map "\e[21;6~" [C-S-f10])
+(define-key xterm-function-map "\e[23;6~" [C-S-f11])
+(define-key xterm-function-map "\e[24;6~" [C-S-f12])
+
+(define-key xterm-function-map "\eO3P" [A-f1])
+(define-key xterm-function-map "\eO3Q" [A-f2])
+(define-key xterm-function-map "\eO3R" [A-f3])
+(define-key xterm-function-map "\eO3S" [A-f4])
+(define-key xterm-function-map "\e[15;3~" [A-f5])
+(define-key xterm-function-map "\e[17;3~" [A-f6])
+(define-key xterm-function-map "\e[18;3~" [A-f7])
+(define-key xterm-function-map "\e[19;3~" [A-f8])
+(define-key xterm-function-map "\e[20;3~" [A-f9])
+(define-key xterm-function-map "\e[21;3~" [A-f10])
+(define-key xterm-function-map "\e[23;3~" [A-f11])
+(define-key xterm-function-map "\e[24;3~" [A-f12])
+
+(define-key xterm-function-map "\eOA" [up])
+(define-key xterm-function-map "\eOB" [down])
+(define-key xterm-function-map "\eOC" [right])
+(define-key xterm-function-map "\eOD" [left])
+(define-key xterm-function-map "\eOF" [end])
+(define-key xterm-function-map "\eOH" [home])
+
+(define-key xterm-function-map "\e[1;2A" [S-up])
+(define-key xterm-function-map "\e[1;2B" [S-down])
+(define-key xterm-function-map "\e[1;2C" [S-right])
+(define-key xterm-function-map "\e[1;2D" [S-left])
+(define-key xterm-function-map "\e[1;2F" [S-end])
+(define-key xterm-function-map "\e[1;2H" [S-home])
+
+(define-key xterm-function-map "\e[1;5A" [C-up])
+(define-key xterm-function-map "\e[1;5B" [C-down])
+(define-key xterm-function-map "\e[1;5C" [C-right])
+(define-key xterm-function-map "\e[1;5D" [C-left])
+(define-key xterm-function-map "\e[1;5F" [C-end])
+(define-key xterm-function-map "\e[1;5H" [C-home])
+
+(define-key xterm-function-map "\e[1;6A" [C-S-up])
+(define-key xterm-function-map "\e[1;6B" [C-S-down])
+(define-key xterm-function-map "\e[1;6C" [C-S-right])
+(define-key xterm-function-map "\e[1;6D" [C-S-left])
+(define-key xterm-function-map "\e[1;6F" [C-S-end])
+(define-key xterm-function-map "\e[1;6H" [C-S-home])
+
+(define-key xterm-function-map "\e[1;3A" [A-up])
+(define-key xterm-function-map "\e[1;3B" [A-down])
+(define-key xterm-function-map "\e[1;3C" [A-right])
+(define-key xterm-function-map "\e[1;3D" [A-left])
+(define-key xterm-function-map "\e[1;3F" [A-end])
+(define-key xterm-function-map "\e[1;3H" [A-home])
+
+(define-key xterm-function-map "\e[2~" [insert])
+(define-key xterm-function-map "\e[3~" [delete])
+(define-key xterm-function-map "\e[5~" [prior])
+(define-key xterm-function-map "\e[6~" [next])
+
+(define-key xterm-function-map "\e[2;2~" [S-insert])
+(define-key xterm-function-map "\e[3;2~" [S-delete])
+(define-key xterm-function-map "\e[5;2~" [S-prior])
+(define-key xterm-function-map "\e[6;2~" [S-next])
+
+(define-key xterm-function-map "\e[2;5~" [C-insert])
+(define-key xterm-function-map "\e[3;5~" [C-delete])
+(define-key xterm-function-map "\e[5;5~" [C-prior])
+(define-key xterm-function-map "\e[6;5~" [C-next])
+
+(define-key xterm-function-map "\e[2;6~" [C-S-insert])
+(define-key xterm-function-map "\e[3;6~" [C-S-delete])
+(define-key xterm-function-map "\e[5;6~" [C-S-prior])
+(define-key xterm-function-map "\e[6;6~" [C-S-next])
+
+(define-key xterm-function-map "\e[2;3~" [A-insert])
+(define-key xterm-function-map "\e[3;3~" [A-delete])
+(define-key xterm-function-map "\e[5;3~" [A-prior])
+(define-key xterm-function-map "\e[6;3~" [A-next])
+
+(define-key xterm-function-map "\e[4~" [select])
+(define-key xterm-function-map "\e[29~" [print])
+
+;; These keys are available in xterm starting from version 216
+;; if the modifyOtherKeys resource is set to 1.
+
+(define-key xterm-function-map "\e[27;5;9~"   [C-tab])
+(define-key xterm-function-map "\e[27;5;13~"  [C-return])
+(define-key xterm-function-map "\e[27;5;39~"  [?\C-\'])
+(define-key xterm-function-map "\e[27;5;44~"  [?\C-,])
+(define-key xterm-function-map "\e[27;5;45~"  [?\C--])
+(define-key xterm-function-map "\e[27;5;46~"  [?\C-.])
+(define-key xterm-function-map "\e[27;5;47~"  [?\C-/])
+(define-key xterm-function-map "\e[27;5;48~"  [?\C-0])
+(define-key xterm-function-map "\e[27;5;49~"  [?\C-1])
+;; Not all C-DIGIT keys have a distinct binding.
+(define-key xterm-function-map "\e[27;5;57~"  [?\C-9])
+(define-key xterm-function-map "\e[27;5;59~"  [(C-\;)])
+(define-key xterm-function-map "\e[27;5;61~"  [?\C-=])
+(define-key xterm-function-map "\e[27;5;92~"  [?\C-\\])
+
+(define-key xterm-function-map "\e[27;6;33~"  [?\C-!])
+(define-key xterm-function-map "\e[27;6;34~"  [?\C-\"])
+(define-key xterm-function-map "\e[27;6;35~"  [?\C-#])
+(define-key xterm-function-map "\e[27;6;36~"  [?\C-$])
+(define-key xterm-function-map "\e[27;6;37~"  [?\C-%])
+(define-key xterm-function-map "\e[27;6;38~"  [(C-&)])
+(define-key xterm-function-map "\e[27;6;40~"  [?\C-(])
+(define-key xterm-function-map "\e[27;6;41~"  [?\C-)])
+(define-key xterm-function-map "\e[27;6;42~"  [?\C-*])
+(define-key xterm-function-map "\e[27;6;43~"  [?\C-+])
+(define-key xterm-function-map "\e[27;6;58~"  [?\C-:])
+(define-key xterm-function-map "\e[27;6;60~"  [?\C-<])
+(define-key xterm-function-map "\e[27;6;62~"  [?\C->])
+(define-key xterm-function-map "\e[27;6;63~"  [(C-\?)])
+
+;; These are the strings emitted for various C-M- combinations
+;; for keyboards that the Meta and Alt modifiers are on the same
+;; key (usually labeled "Alt").
+(define-key xterm-function-map "\e[27;13;9~"  [(C-M-tab)])
+(define-key xterm-function-map "\e[27;13;13~" [(C-M-return)])
+
+(define-key xterm-function-map "\e[27;13;39~" [?\C-\M-\'])
+(define-key xterm-function-map "\e[27;13;44~" [?\C-\M-,])
+(define-key xterm-function-map "\e[27;13;45~" [?\C-\M--])
+(define-key xterm-function-map "\e[27;13;46~" [?\C-\M-.])
+(define-key xterm-function-map "\e[27;13;47~" [?\C-\M-/])
+(define-key xterm-function-map "\e[27;13;48~" [?\C-\M-0])
+(define-key xterm-function-map "\e[27;13;49~" [?\C-\M-1])
+(define-key xterm-function-map "\e[27;13;50~" [?\C-\M-2])
+(define-key xterm-function-map "\e[27;13;51~" [?\C-\M-3])
+(define-key xterm-function-map "\e[27;13;52~" [?\C-\M-4])
+(define-key xterm-function-map "\e[27;13;53~" [?\C-\M-5])
+(define-key xterm-function-map "\e[27;13;54~" [?\C-\M-6])
+(define-key xterm-function-map "\e[27;13;55~" [?\C-\M-7])
+(define-key xterm-function-map "\e[27;13;56~" [?\C-\M-8])
+(define-key xterm-function-map "\e[27;13;57~" [?\C-\M-9])
+(define-key xterm-function-map "\e[27;13;59~" [?\C-\M-\;])
+(define-key xterm-function-map "\e[27;13;61~" [?\C-\M-=])
+(define-key xterm-function-map "\e[27;13;92~" [?\C-\M-\\])
+
+(define-key xterm-function-map "\e[27;14;33~"  [?\C-\M-!])
+(define-key xterm-function-map "\e[27;14;34~"  [?\C-\M-\"])
+(define-key xterm-function-map "\e[27;14;35~"  [?\C-\M-#])
+(define-key xterm-function-map "\e[27;14;36~"  [?\C-\M-$])
+(define-key xterm-function-map "\e[27;14;37~"  [?\C-\M-%])
+(define-key xterm-function-map "\e[27;14;38~"  [(C-M-&)])
+(define-key xterm-function-map "\e[27;14;40~"  [?\C-\M-(])
+(define-key xterm-function-map "\e[27;14;41~"  [?\C-\M-)])
+(define-key xterm-function-map "\e[27;14;42~"  [?\C-\M-*])
+(define-key xterm-function-map "\e[27;14;43~"  [?\C-\M-+])
+(define-key xterm-function-map "\e[27;14;58~"  [?\C-\M-:])
+(define-key xterm-function-map "\e[27;14;60~"  [?\C-\M-<])
+(define-key xterm-function-map "\e[27;14;62~"  [?\C-\M->])
+(define-key xterm-function-map "\e[27;14;63~"  [(C-M-\?)])
+
+(define-key xterm-function-map "\e[27;7;9~"  [(C-M-tab)])
+(define-key xterm-function-map "\e[27;7;13~" [(C-M-return)])
+
+(define-key xterm-function-map "\e[27;7;39~" [?\C-\M-\'])
+(define-key xterm-function-map "\e[27;7;44~" [?\C-\M-,])
+(define-key xterm-function-map "\e[27;7;45~" [?\C-\M--])
+(define-key xterm-function-map "\e[27;7;46~" [?\C-\M-.])
+(define-key xterm-function-map "\e[27;7;47~" [?\C-\M-/])
+(define-key xterm-function-map "\e[27;7;48~" [?\C-\M-0])
+(define-key xterm-function-map "\e[27;7;49~" [?\C-\M-1])
+(define-key xterm-function-map "\e[27;7;50~" [?\C-\M-2])
+(define-key xterm-function-map "\e[27;7;51~" [?\C-\M-3])
+(define-key xterm-function-map "\e[27;7;52~" [?\C-\M-4])
+(define-key xterm-function-map "\e[27;7;53~" [?\C-\M-5])
+(define-key xterm-function-map "\e[27;7;54~" [?\C-\M-6])
+(define-key xterm-function-map "\e[27;7;55~" [?\C-\M-7])
+(define-key xterm-function-map "\e[27;7;56~" [?\C-\M-8])
+(define-key xterm-function-map "\e[27;7;57~" [?\C-\M-9])
+(define-key xterm-function-map "\e[27;7;59~" [?\C-\M-\;])
+(define-key xterm-function-map "\e[27;7;61~" [?\C-\M-=])
+(define-key xterm-function-map "\e[27;7;92~" [?\C-\M-\\])
+
+(define-key xterm-function-map "\e[27;8;33~"  [?\C-\M-!])
+(define-key xterm-function-map "\e[27;8;34~"  [?\C-\M-\"])
+(define-key xterm-function-map "\e[27;8;35~"  [?\C-\M-#])
+(define-key xterm-function-map "\e[27;8;36~"  [?\C-\M-$])
+(define-key xterm-function-map "\e[27;8;37~"  [?\C-\M-%])
+(define-key xterm-function-map "\e[27;8;38~"  [(C-M-&)])
+(define-key xterm-function-map "\e[27;8;40~"  [?\C-\M-(])
+(define-key xterm-function-map "\e[27;8;41~"  [?\C-\M-)])
+(define-key xterm-function-map "\e[27;8;42~"  [?\C-\M-*])
+(define-key xterm-function-map "\e[27;8;43~"  [?\C-\M-+])
+(define-key xterm-function-map "\e[27;8;58~"  [?\C-\M-:])
+(define-key xterm-function-map "\e[27;8;60~"  [?\C-\M-<])
+(define-key xterm-function-map "\e[27;8;62~"  [?\C-\M->])
+(define-key xterm-function-map "\e[27;8;63~"  [(C-M-\?)])
+
+(define-key xterm-function-map "\e[27;2;9~"   [S-tab])
+(define-key xterm-function-map "\e[27;2;13~"  [S-return])
+
+(define-key xterm-function-map "\e[27;6;9~"   [(C-S-tab)])
+(define-key xterm-function-map "\e[27;6;13~"  [(C-S-return)])
+
+;; Other versions of xterm might emit these.
+(define-key xterm-function-map "\e[A" [up])
+(define-key xterm-function-map "\e[B" [down])
+(define-key xterm-function-map "\e[C" [right])
+(define-key xterm-function-map "\e[D" [left])
+(define-key xterm-function-map "\e[1~" [home])
+
+(define-key xterm-function-map "\e[1;2A" [S-up])
+(define-key xterm-function-map "\e[1;2B" [S-down])
+(define-key xterm-function-map "\e[1;2C" [S-right])
+(define-key xterm-function-map "\e[1;2D" [S-left])
+(define-key xterm-function-map "\e[1;2F" [S-end])
+(define-key xterm-function-map "\e[1;2H" [S-home])
+
+(define-key xterm-function-map "\e[1;5A" [C-up])
+(define-key xterm-function-map "\e[1;5B" [C-down])
+(define-key xterm-function-map "\e[1;5C" [C-right])
+(define-key xterm-function-map "\e[1;5D" [C-left])
+(define-key xterm-function-map "\e[1;5F" [C-end])
+(define-key xterm-function-map "\e[1;5H" [C-home])
+
+(define-key xterm-function-map "\e[11~" [f1])
+(define-key xterm-function-map "\e[12~" [f2])
+(define-key xterm-function-map "\e[13~" [f3])
+(define-key xterm-function-map "\e[14~" [f4])
+
+(defun terminal-init-xterm ()
+  "Terminal initialization function for xterm."
+  ;; rxvt terminals sometimes set the TERM variable to "xterm", but
+  ;; rxvt's keybindings are incompatible with xterm's. It is
+  ;; better in that case to use rxvt's initializion function.
+  (if (and (getenv "COLORTERM" (terminal-id))
+          (string-match "\\`rxvt" (getenv "COLORTERM" (terminal-id))))
+      (tty-run-terminal-initialization (selected-frame) "rxvt")
+
+    ;; The terminal intialization C code file might have initialized
+    ;; function keys F13->F60 from the termcap/terminfo information.  On
+    ;; a PC-style keyboard these keys correspond to
+    ;; MODIFIER-FUNCTION_KEY, where modifier is S-, C, A-, C-S-.  The
+    ;; code here subsitutes the corresponding defintions in
+    ;; function-key-map. This substitution is needed because if a key
+    ;; definition is found in function-key-map, there are no further
+    ;; lookups in other keymaps.
+    (substitute-key-definition [f13] [S-f1] local-function-key-map)
+    (substitute-key-definition [f14] [S-f2] local-function-key-map)
+    (substitute-key-definition [f15] [S-f3] local-function-key-map)
+    (substitute-key-definition [f16] [S-f4] local-function-key-map)
+    (substitute-key-definition [f17] [S-f5] local-function-key-map)
+    (substitute-key-definition [f18] [S-f6] local-function-key-map)
+    (substitute-key-definition [f19] [S-f7] local-function-key-map)
+    (substitute-key-definition [f20] [S-f8] local-function-key-map)
+    (substitute-key-definition [f21] [S-f9] local-function-key-map)
+    (substitute-key-definition [f22] [S-f10] local-function-key-map)
+    (substitute-key-definition [f23] [S-f11] local-function-key-map)
+    (substitute-key-definition [f24] [S-f12] local-function-key-map)
+
+    (substitute-key-definition [f25] [C-f1] local-function-key-map)
+    (substitute-key-definition [f26] [C-f2] local-function-key-map)
+    (substitute-key-definition [f27] [C-f3] local-function-key-map)
+    (substitute-key-definition [f28] [C-f4] local-function-key-map)
+    (substitute-key-definition [f29] [C-f5] local-function-key-map)
+    (substitute-key-definition [f30] [C-f6] local-function-key-map)
+    (substitute-key-definition [f31] [C-f7] local-function-key-map)
+    (substitute-key-definition [f32] [C-f8] local-function-key-map)
+    (substitute-key-definition [f33] [C-f9] local-function-key-map)
+    (substitute-key-definition [f34] [C-f10] local-function-key-map)
+    (substitute-key-definition [f35] [C-f11] local-function-key-map)
+    (substitute-key-definition [f36] [C-f12] local-function-key-map)
+
+    (substitute-key-definition [f37] [C-S-f1] local-function-key-map)
+    (substitute-key-definition [f38] [C-S-f2] local-function-key-map)
+    (substitute-key-definition [f39] [C-S-f3] local-function-key-map)
+    (substitute-key-definition [f40] [C-S-f4] local-function-key-map)
+    (substitute-key-definition [f41] [C-S-f5] local-function-key-map)
+    (substitute-key-definition [f42] [C-S-f6] local-function-key-map)
+    (substitute-key-definition [f43] [C-S-f7] local-function-key-map)
+    (substitute-key-definition [f44] [C-S-f8] local-function-key-map)
+    (substitute-key-definition [f45] [C-S-f9] local-function-key-map)
+    (substitute-key-definition [f46] [C-S-f10] local-function-key-map)
+    (substitute-key-definition [f47] [C-S-f11] local-function-key-map)
+    (substitute-key-definition [f48] [C-S-f12] local-function-key-map)
+
+    (substitute-key-definition [f49] [A-f1] local-function-key-map)
+    (substitute-key-definition [f50] [A-f2] local-function-key-map)
+    (substitute-key-definition [f51] [A-f3] local-function-key-map)
+    (substitute-key-definition [f52] [A-f4] local-function-key-map)
+    (substitute-key-definition [f53] [A-f5] local-function-key-map)
+    (substitute-key-definition [f54] [A-f6] local-function-key-map)
+    (substitute-key-definition [f55] [A-f7] local-function-key-map)
+    (substitute-key-definition [f56] [A-f8] local-function-key-map)
+    (substitute-key-definition [f57] [A-f9] local-function-key-map)
+    (substitute-key-definition [f58] [A-f10] local-function-key-map)
+    (substitute-key-definition [f59] [A-f11] local-function-key-map)
+    (substitute-key-definition [f60] [A-f12] local-function-key-map)
+
+    ;; Use inheritance to let the main keymap override those defaults.
+    ;; This way we don't override terminfo-derived settings or settings
+    ;; made in the .emacs file.
+    (let ((m (copy-keymap xterm-function-map)))
+      (set-keymap-parent m (keymap-parent local-function-key-map))
+      (set-keymap-parent local-function-key-map m)))
+
+    (xterm-register-default-colors)
+    ;; This recomputes all the default faces given the colors we've just set up.
+    (tty-set-up-initial-frame-faces))
+
+;; Set up colors, for those versions of xterm that support it.
+(defvar xterm-standard-colors
+  ;; The names in the comments taken from XTerm-col.ad in the xterm
+  ;; distribution, see ftp://dickey.his.com/xterm/.  RGB values are
+  ;; from rgb.txt.
+  '(("black"          0 (  0   0   0)) ; black
+    ("red"            1 (205   0   0)) ; red3
+    ("green"          2 (  0 205   0)) ; green3
+    ("yellow"         3 (205 205   0)) ; yellow3
+    ("blue"           4 (  0   0 238)) ; blue2
+    ("magenta"        5 (205   0 205)) ; magenta3
+    ("cyan"           6 (  0 205 205)) ; cyan3
+    ("white"          7 (229 229 229)) ; gray90
+    ("brightblack"    8 (127 127 127)) ; gray50
+    ("brightred"      9 (255   0   0)) ; red
+    ("brightgreen"   10 (  0 255   0)) ; green
+    ("brightyellow"  11 (255 255   0)) ; yellow
+    ("brightblue"    12 (92   92 255)) ; rgb:5c/5c/ff
+    ("brightmagenta" 13 (255   0 255)) ; magenta
+    ("brightcyan"    14 (  0 255 255)) ; cyan
+    ("brightwhite"   15 (255 255 255)))        ; white
+  "Names of 16 standard xterm/aixterm colors, their numbers, and RGB values.")
+
+(defun xterm-rgb-convert-to-16bit (prim)
+  "Convert an 8-bit primary color value PRIM to a corresponding 16-bit value."
+  (logior prim (lsh prim 8)))
+
+(defun xterm-register-default-colors ()
+  "Register the default set of colors for xterm or compatible emulator.
+
+This function registers the number of colors returned by `display-color-cells'
+for the currently selected frame.  The first 16 colors are taken from
+`xterm-standard-colors', which see, while the rest are computed assuming
+either the 88- or 256-color standard color scheme supported by latest
+versions of xterm."
+  (let* ((ncolors (display-color-cells (selected-frame)))
+        (colors xterm-standard-colors)
+        (color (car colors)))
+    (if (> ncolors 0)
+       ;; Clear the 8 default tty colors registered by startup.el
+       (tty-color-clear))
+    ;; Only register as many colors as are supported by the display.
+    (while (and (> ncolors 0) colors)
+      (tty-color-define (car color) (cadr color)
+                       (mapcar 'xterm-rgb-convert-to-16bit
+                               (car (cddr color))))
+      (setq colors (cdr colors)
+           color (car colors)
+           ncolors (1- ncolors)))
+    ;; We've exhausted the colors from `xterm-standard-colors'.  If there
+    ;; are more colors to support, compute them now.
+    (when (> ncolors 0)
+      (cond
+       ((= ncolors 240)        ; 256-color xterm
+       ;; 216 non-gray colors first
+       (let ((r 0) (g 0) (b 0))
+         (while (> ncolors 24)
+           ;; This and other formulae taken from 256colres.pl and
+           ;; 88colres.pl in the xterm distribution.
+           (tty-color-define (format "color-%d" (- 256 ncolors))
+                             (- 256 ncolors)
+                             (mapcar 'xterm-rgb-convert-to-16bit
+                                     (list (if (zerop r) 0 (+ (* r 40) 55))
+                                           (if (zerop g) 0 (+ (* g 40) 55))
+                                           (if (zerop b) 0 (+ (* b 40) 55)))))
+
+           (setq b (1+ b))
+           (if (> b 5)
+               (setq g (1+ g)
+                     b 0))
+           (if (> g 5)
+               (setq r (1+ r)
+                     g 0))
+           (setq ncolors (1- ncolors))))
+       ;; Now the 24 gray colors
+       (while (> ncolors 0)
+         (setq color (xterm-rgb-convert-to-16bit (+ 8 (* (- 24 ncolors) 10))))
+         (tty-color-define (format "color-%d" (- 256 ncolors))
+                           (- 256 ncolors)
+                           (list color color color))
+         (setq ncolors (1- ncolors))))
+       ((= ncolors 72)  ; 88-color xterm
+       ;; 64 non-gray colors
+       (let ((levels '(0 139 205 255))
+             (r 0) (g 0) (b 0))
+         (while (> ncolors 8)
+           (tty-color-define (format "color-%d" (- 88 ncolors))
+                             (- 88 ncolors)
+                             (mapcar 'xterm-rgb-convert-to-16bit
+                                     (list (nth r levels)
+                                           (nth g levels)
+                                           (nth b levels))))
+           (setq b (1+ b))
+           (if (> b 3)
+               (setq g (1+ g)
+                     b 0))
+           (if (> g 3)
+               (setq r (1+ r)
+                     g 0))
+           (setq ncolors (1- ncolors))))
+       ;; Now the 8 gray colors
+       (while (> ncolors 0)
+         (setq color (xterm-rgb-convert-to-16bit
+                      (floor
+                       (if (= ncolors 8)
+                           46.36363636
+                         (+ (* (- 8 ncolors) 23.18181818) 69.54545454)))))
+         (tty-color-define (format "color-%d" (- 88 ncolors))
+                           (- 88 ncolors)
+                           (list color color color))
+         (setq ncolors (1- ncolors))))
+       (t (error "Unsupported number of xterm colors (%d)" (+ 16 ncolors)))))
+    ;; Modifying color mappings means realized faces don't use the
+    ;; right colors, so clear them.
+    (clear-face-cache)))
+
+;; arch-tag: 12e7ebdd-1e6c-4b25-b0f9-35ace25e855a
+;;; xterm.el ends here
diff --git a/lisp/termdev.el b/lisp/termdev.el
new file mode 100644 (file)
index 0000000..c73fe01
--- /dev/null
@@ -0,0 +1,195 @@
+;;; termdev.el --- functions for dealing with terminals
+
+;; Copyright (C) 2005 Free Software Foundation, Inc.
+
+;; Author: Karoly Lorentey <karoly@lorentey.hu>
+;; Created: 2005-12-22
+;; Keywords: internal
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 2, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+(substitute-key-definition 'suspend-emacs 'suspend-frame global-map)
+
+(defun terminal-id (&optional terminal)
+  "Return the numerical id of terminal TERMINAL.
+
+TERMINAL can be a terminal id (an integer), a frame, or
+nil (meaning the selected frame's terminal).  Alternatively,
+TERMINAL may be the name of an X display
+device (HOST.SERVER.SCREEN) or a tty device file."
+  (cond
+   ((integerp terminal)
+    (if (terminal-live-p terminal)
+       terminal
+      (signal 'wrong-type-argument (list 'terminal-live-p terminal))))
+   ((or (null terminal) (framep terminal))
+    (frame-terminal terminal))
+   ((stringp terminal)
+    (let ((f (car (filtered-frame-list (lambda (frame)
+                                        (or (equal (frame-parameter frame 'display) terminal)
+                                            (equal (frame-parameter frame 'tty) terminal)))))))
+      (or f (error "Display %s does not exist" terminal))
+      (frame-terminal f)))
+   (t
+    (error "Invalid argument %s in `terminal-id'" terminal))))
+
+;; (defun terminal-getenv (variable &optional terminal global-ok)
+;;   "Get the value of VARIABLE in the client environment of TERMINAL.
+;; VARIABLE should be a string.  Value is nil if VARIABLE is undefined in
+;; the environment.  Otherwise, value is a string.
+
+;; If TERMINAL has an associated emacsclient process, then
+;; `terminal-getenv' looks up VARIABLE in the environment of that
+;; process; otherwise the function consults the global environment,
+;; i.e., the environment of the Emacs process itself.
+
+;; If GLOBAL-OK is non-nil, and VARIABLE is not defined in the
+;; terminal-local environment, then `terminal-getenv' will return
+;; its value in the global environment instead.
+
+;; TERMINAL can be a terminal id, a frame, or nil (meaning the
+;; selected frame's terminal)."
+;;   (setq terminal (terminal-id terminal))
+;;   (if (null (terminal-parameter terminal 'environment))
+;;       (getenv variable)
+;;     (if (multibyte-string-p variable)
+;;     (setq variable (encode-coding-string variable locale-coding-system)))
+;;     (let ((env (terminal-parameter terminal 'environment))
+;;       result entry)
+;;       (while (and env (null result))
+;;     (setq entry (car env)
+;;           env (cdr env))
+;;     (if (and (> (length entry) (length variable))
+;;              (eq ?= (aref entry (length variable)))
+;;              (equal variable (substring entry 0 (length variable))))
+;;         (setq result (substring entry (+ (length variable) 1)))))
+;;       (if (and global-ok (null result))
+;;       (getenv variable)
+;;     (and result (decode-coding-string result locale-coding-system))))))
+
+;; (defun terminal-setenv (variable &optional value terminal)
+;;   "Set the value of VARIABLE in the environment of TERMINAL.
+;; VARIABLE should be string.  VALUE is optional; if not provided or
+;; nil, the environment variable VARIABLE is removed.  Returned
+;; value is the new value of VARIABLE, or nil if it was removed from
+;; the environment.
+
+;; If TERMINAL was created by an emacsclient invocation, then the
+;; variable is set in the environment of the emacsclient process;
+;; otherwise the function changes the environment of the Emacs
+;; process itself.
+
+;; TERMINAL can be a terminal id, a frame, or nil (meaning the
+;; selected frame's terminal)."
+;;   (if (null (terminal-parameter terminal 'environment))
+;;       (setenv variable value)
+;;     (with-terminal-environment terminal variable
+;;       (setenv variable value))))
+
+;; (defun terminal-setenv-internal (variable value terminal)
+;;   "Set the value of VARIABLE in the environment of TERMINAL.
+;; The caller is responsible to ensure that both VARIABLE and VALUE
+;; are usable in environment variables and that TERMINAL is a
+;; remote terminal."
+;;   (if (multibyte-string-p variable)
+;;       (setq variable (encode-coding-string variable locale-coding-system)))
+;;   (if (and value (multibyte-string-p value))
+;;       (setq value (encode-coding-string value locale-coding-system)))
+;;   (let ((env (terminal-parameter terminal 'environment))
+;;     found)
+;;     (while (and env (not found))
+;;       (if (and (> (length (car env)) (length variable))
+;;              (eq ?= (aref (car env) (length variable)))
+;;              (equal variable (substring (car env) 0 (length variable))))
+;;       (progn
+;;         (if value
+;;             (setcar env (concat variable "=" value))
+;;           (set-terminal-parameter terminal 'environment
+;;                                   (delq (car env)
+;;                                         (terminal-parameter terminal
+;;                                                             'environment))))
+;;         (setq found t))
+;;     (setq env (cdr env))))
+;;     (cond
+;;      ((and value found)
+;;       (setcar env (concat variable "=" value)))
+;;      ((and value (not found))
+;;       (set-terminal-parameter terminal 'environment
+;;                           (cons (concat variable "=" value)
+;;                                 (terminal-parameter terminal
+;;                                                     'environment))))
+;;      ((and (not value) found)
+;;       (set-terminal-parameter terminal 'environment
+;;                           (delq (car env)
+;;                                 (terminal-parameter terminal
+;;                                                     'environment)))))))
+
+;; (defmacro with-terminal-environment (terminal vars &rest body)
+;;   "Evaluate BODY with environment variables VARS set to those of TERMINAL.
+;; The environment variables are then restored to their previous values.
+
+;; VARS should be a single string, a list of strings, or t for all
+;; environment variables.
+
+;; TERMINAL can be a terminal id, a frame, or nil (meaning the
+;; selected frame's terminal).
+
+;; If BODY uses `setenv' to change environment variables in VARS,
+;; then the new variable values will be remembered for TERMINAL, and
+;; `terminal-getenv' will return them even outside BODY."
+;;   (declare (indent 2))
+;;   (let ((var (make-symbol "var"))
+;;     (term (make-symbol "term"))
+;;     (v (make-symbol "v"))
+;;     (old-env (make-symbol "old-env")))
+;;     `(let ((,term ,terminal)                ; Evaluate arguments only once.
+;;        (,v ,vars))
+;;        (if (stringp ,v)
+;;        (setq ,v (list ,v)))
+;;        (cond
+;;     ((null (terminal-parameter ,term 'environment))
+;;      ;; Not a remote terminal; nothing to do.
+;;      (progn ,@body))
+;;     ((eq ,v t)
+;;      ;; Switch the entire process-environment.
+;;      (let (,old-env process-environment)
+;;        (setq process-environment (terminal-parameter ,term 'environment))
+;;        (unwind-protect
+;;            (progn ,@body)
+;;          (set-terminal-parameter ,term 'environment process-environment)
+;;          (setq process-environment ,old-env))))
+;;     (t
+;;      ;; Do only a set of variables.
+;;      (let (,old-env)
+;;        (dolist (,var ,v)
+;;          (setq ,old-env (cons (cons ,var (getenv ,var)) ,old-env))
+;;          (setenv ,var (terminal-getenv ,var ,term)))
+;;        (unwind-protect
+;;            (progn ,@body)
+;;          ;; Split storing new values and restoring old ones so
+;;          ;; that we DTRT even if a variable is specified twice in
+;;          ;; VARS.
+;;          (dolist (,var ,v)
+;;            (terminal-setenv-internal ,var (getenv ,var) ,term))
+;;          (dolist (,var ,old-env)
+;;            (setenv (car ,var) (cdr ,var))))))))))
+
+(provide 'termdev)
+
+;;; arch-tag: 4c4df277-1ec1-4f56-bfde-7f156fe62fb2
+;;; termdev.el ends here
index a2da000..b5138fb 100644 (file)
@@ -47,7 +47,6 @@
 (defvar tmm-table-undef)
 
 ;;;###autoload (define-key global-map "\M-`" 'tmm-menubar)
-;;;###autoload (define-key global-map [f10] 'tmm-menubar)
 ;;;###autoload (define-key global-map [menu-bar mouse-1] 'tmm-menubar-mouse)
 
 ;;;###autoload
index 37d6044..e58114e 100644 (file)
@@ -55,22 +55,22 @@ conveniently adding tool bar items."
   :group 'mouse
   :group 'frames
   (and (display-images-p)
-       (let ((lines (if tool-bar-mode 1 0)))
-        ;; Alter existing frames...
-        (mapc (lambda (frame)
-                (modify-frame-parameters frame
-                                         (list (cons 'tool-bar-lines lines))))
-              (frame-list))
-        ;; ...and future ones.
-        (let ((elt (assq 'tool-bar-lines default-frame-alist)))
-          (if elt
-              (setcdr elt lines)
-            (add-to-list 'default-frame-alist (cons 'tool-bar-lines lines)))))
+       (modify-all-frames-parameters (list (cons 'tool-bar-lines
+                                                (if tool-bar-mode 1 0))))
        (if (and tool-bar-mode
-               (display-graphic-p)
-               (= 1 (length (default-value 'tool-bar-map)))) ; not yet setup
+               (display-graphic-p))
           (tool-bar-setup))))
 
+;;;###autoload
+;; Used in the Show/Hide menu, to have the toggle reflect the current frame.
+(defun toggle-tool-bar-mode-from-frame (&optional arg)
+  "Toggle tool bar on or off, based on the status of the current frame.
+See `tool-bar-mode' for more information."
+  (interactive (list (or current-prefix-arg 'toggle)))
+  (if (eq arg 'toggle)
+      (tool-bar-mode (if (> (frame-parameter nil 'tool-bar-lines) 0) 0 1))
+    (tool-bar-mode arg)))
+
 ;;;###autoload
 ;; We want to pretend the toolbar by standard is on, as this will make
 ;; customize consider disabling the toolbar a customization, and save
@@ -228,42 +228,47 @@ holds a keymap."
 
 ;;; Set up some global items.  Additions/deletions up for grabs.
 
-(defun tool-bar-setup ()
-  ;; People say it's bad to have EXIT on the tool bar, since users
-  ;; might inadvertently click that button.
-  ;;(tool-bar-add-item-from-menu 'save-buffers-kill-emacs "exit")
-  (tool-bar-add-item-from-menu 'find-file "new")
-  (tool-bar-add-item-from-menu 'menu-find-file-existing "open")
-  (tool-bar-add-item-from-menu 'dired "diropen")
-  (tool-bar-add-item-from-menu 'kill-this-buffer "close")
-  (tool-bar-add-item-from-menu 'save-buffer "save" nil
-                              :visible '(or buffer-file-name
-                                            (not (eq 'special
-                                                     (get major-mode
-                                                          'mode-class)))))
-  (tool-bar-add-item-from-menu 'write-file "saveas" nil
-                              :visible '(or buffer-file-name
-                                            (not (eq 'special
-                                                     (get major-mode
-                                                          'mode-class)))))
-  (tool-bar-add-item-from-menu 'undo "undo" nil
-                              :visible '(not (eq 'special (get major-mode
-                                                               'mode-class))))
-  (tool-bar-add-item-from-menu (lookup-key menu-bar-edit-menu [cut])
-                              "cut" nil
-                              :visible '(not (eq 'special (get major-mode
-                                                               'mode-class))))
-  (tool-bar-add-item-from-menu (lookup-key menu-bar-edit-menu [copy])
-                              "copy")
-  (tool-bar-add-item-from-menu (lookup-key menu-bar-edit-menu [paste])
-                              "paste" nil
-                              :visible '(not (eq 'special (get major-mode
-                                                               'mode-class))))
-  (tool-bar-add-item-from-menu 'nonincremental-search-forward "search")
-  ;;(tool-bar-add-item-from-menu 'ispell-buffer "spell")
-
-  ;; There's no icon appropriate for News and we need a command rather
-  ;; than a lambda for Read Mail.
+(defvar tool-bar-setup nil
+  "t if the tool-bar has been set up by `tool-bar-setup'.")
+
+(defun tool-bar-setup (&optional frame)
+  (unless tool-bar-setup
+    (with-selected-frame (or frame (selected-frame))
+      ;; People say it's bad to have EXIT on the tool bar, since users
+      ;; might inadvertently click that button.
+      ;;(tool-bar-add-item-from-menu 'save-buffers-kill-emacs "exit")
+      (tool-bar-add-item-from-menu 'find-file "new")
+      (tool-bar-add-item-from-menu 'menu-find-file-existing "open")
+      (tool-bar-add-item-from-menu 'dired "diropen")
+      (tool-bar-add-item-from-menu 'kill-this-buffer "close")
+      (tool-bar-add-item-from-menu 'save-buffer "save" nil
+                                  :visible '(or buffer-file-name
+                                                (not (eq 'special
+                                                         (get major-mode
+                                                              'mode-class)))))
+      (tool-bar-add-item-from-menu 'write-file "saveas" nil
+                                  :visible '(or buffer-file-name
+                                                (not (eq 'special
+                                                         (get major-mode
+                                                              'mode-class)))))
+      (tool-bar-add-item-from-menu 'undo "undo" nil
+                                  :visible '(not (eq 'special (get major-mode
+                                                                   'mode-class))))
+      (tool-bar-add-item-from-menu (lookup-key menu-bar-edit-menu [cut])
+                                  "cut" nil
+                                  :visible '(not (eq 'special (get major-mode
+                                                                   'mode-class))))
+      (tool-bar-add-item-from-menu (lookup-key menu-bar-edit-menu [copy])
+                                  "copy")
+      (tool-bar-add-item-from-menu (lookup-key menu-bar-edit-menu [paste])
+                                  "paste" nil
+                                  :visible '(not (eq 'special (get major-mode
+                                                                   'mode-class))))
+      (tool-bar-add-item-from-menu 'nonincremental-search-forward "search")
+      ;;(tool-bar-add-item-from-menu 'ispell-buffer "spell")
+
+      ;; There's no icon appropriate for News and we need a command rather
+      ;; than a lambda for Read Mail.
   ;;(tool-bar-add-item-from-menu 'compose-mail "mail/compose")
 
   (tool-bar-add-item-from-menu 'print-buffer "print")
@@ -281,9 +286,9 @@ holds a keymap."
                                (popup-menu menu-bar-help-menu))
                       'help
                       :help "Pop up the Help menu"))
-  )
+  (setq tool-bar-setup t))))
 
-(provide 'tool-bar)
 
+(provide 'tool-bar)
 ;;; arch-tag: 15f30f0a-d0d7-4d50-bbb7-f48fd0c8582f
 ;;; tool-bar.el ends here
index 144a776..d975d89 100644 (file)
@@ -27,7 +27,7 @@
 
 ;;; Code:
 
-(defconst emacs-version "22.0.91" "\
+(defconst emacs-version "23.0.51" "\
 Version numbers of this version of Emacs.")
 
 (defconst emacs-major-version
@@ -55,8 +55,8 @@ to the system configuration; look at `system-configuration' instead."
   (interactive "P")
   (let ((version-string
          (format (if (not (interactive-p))
-                    "GNU Emacs %s (%s%s%s)\n of %s on %s"
-                  "GNU Emacs %s (%s%s%s) of %s on %s")
+                    "GNU Emacs %s (%s%s%s%s)\n of %s on %s"
+                  "GNU Emacs %s (%s%s%s%s) of %s on %s")
                  emacs-version
                 system-configuration
                 (cond ((featurep 'motif)
@@ -72,6 +72,7 @@ to the system configuration; look at `system-configuration' instead."
                     (format ", %s scroll bars"
                             (capitalize (symbol-name x-toolkit-scroll-bars)))
                   "")
+                (if (featurep 'multi-tty) ", multi-tty" "")
                 (format-time-string "%Y-%m-%d" emacs-build-time)
                  emacs-build-system)))
     (if here
index c229b08..717fcf2 100644 (file)
@@ -121,14 +121,15 @@ any protocol specific data.")
 
 (defun x-dnd-init-frame (&optional frame)
   "Setup drag and drop for FRAME (i.e. create appropriate properties)."
-  (x-register-dnd-atom "DndProtocol" frame)
-  (x-register-dnd-atom "_MOTIF_DRAG_AND_DROP_MESSAGE" frame)
-  (x-register-dnd-atom "XdndEnter" frame)
-  (x-register-dnd-atom "XdndPosition" frame)
-  (x-register-dnd-atom "XdndLeave" frame)
-  (x-register-dnd-atom "XdndDrop" frame)
-  (x-dnd-init-xdnd-for-frame frame)
-  (x-dnd-init-motif-for-frame frame))
+  (when (eq 'x (window-system frame))
+    (x-register-dnd-atom "DndProtocol" frame)
+    (x-register-dnd-atom "_MOTIF_DRAG_AND_DROP_MESSAGE" frame)
+    (x-register-dnd-atom "XdndEnter" frame)
+    (x-register-dnd-atom "XdndPosition" frame)
+    (x-register-dnd-atom "XdndLeave" frame)
+    (x-register-dnd-atom "XdndDrop" frame)
+    (x-dnd-init-xdnd-for-frame frame)
+    (x-dnd-init-motif-for-frame frame)))
 
 (defun x-dnd-get-state-cons-for-frame (frame-or-window)
   "Return the entry in x-dnd-current-state for a frame or window."
index 96990ee..2d1710f 100644 (file)
@@ -43,6 +43,7 @@
 
 ;;; Code:
 
+;; XXX Perhaps this should be terminal-local instead. --lorentey
 (define-key function-key-map "\e[M" 'xterm-mouse-translate)
 
 (defvar xterm-mouse-last)
                (vector (list down-where down-data) down)
              (vector down))))))))
 
-(defvar xterm-mouse-x 0
-  "Position of last xterm mouse event relative to the frame.")
-
-(defvar xterm-mouse-y 0
-  "Position of last xterm mouse event relative to the frame.")
+;; These two variables have been converted to terminal parameters.
+;;
+;;(defvar xterm-mouse-x 0
+;;  "Position of last xterm mouse event relative to the frame.")
+;;
+;;(defvar xterm-mouse-y 0
+;;  "Position of last xterm mouse event relative to the frame.")
 
 ;; Indicator for the xterm-mouse mode.
 
 (defun xterm-mouse-position-function (pos)
   "Bound to `mouse-position-function' in XTerm mouse mode."
-  (setcdr pos (cons xterm-mouse-x xterm-mouse-y))
+  (when (terminal-parameter nil 'xterm-mouse-x)
+    (setcdr pos (cons (terminal-parameter nil 'xterm-mouse-x)
+                     (terminal-parameter nil 'xterm-mouse-y))))
   pos)
 
 ;; read xterm sequences above ascii 127 (#x7f)
          (left (nth 0 ltrb))
          (top (nth 1 ltrb)))
 
-    (setq xterm-mouse-x x
-         xterm-mouse-y y)
+    (set-terminal-parameter nil 'xterm-mouse-x x)
+    (set-terminal-parameter nil 'xterm-mouse-y y)
     (setq
      last-input-event
      (if w
@@ -164,7 +169,7 @@ down the SHIFT key while pressing the mouse button."
   :global t :group 'mouse
   (if xterm-mouse-mode
       ;; Turn it on
-      (unless window-system
+      (progn
        (setq mouse-position-function #'xterm-mouse-position-function)
        (turn-on-xterm-mouse-tracking))
     ;; Turn it off
@@ -173,15 +178,43 @@ down the SHIFT key while pressing the mouse button."
 
 (defun turn-on-xterm-mouse-tracking ()
   "Enable Emacs mouse tracking in xterm."
-  (if xterm-mouse-mode
-      (send-string-to-terminal "\e[?1000h")))
+  (dolist (f (frame-list))
+    (when (eq t (frame-live-p f))
+      (with-selected-frame f
+       (when xterm-mouse-mode
+         (send-string-to-terminal "\e[?1000h"))))))
 
 (defun turn-off-xterm-mouse-tracking (&optional force)
   "Disable Emacs mouse tracking in xterm."
-  (if (or force xterm-mouse-mode)
-      (send-string-to-terminal "\e[?1000l")))
+  (dolist (f (frame-list))
+    (when (eq t (frame-live-p f))
+      (with-selected-frame f
+       (when (or force xterm-mouse-mode)
+         (send-string-to-terminal "\e[?1000l"))))))
+
+(defun turn-on-xterm-mouse-tracking-on-terminal (terminal)
+  "Enable xterm mouse tracking on TERMINAL."
+  (when (and xterm-mouse-mode (eq t (terminal-live-p terminal)))
+    (send-string-to-terminal "\e[?1000h" terminal)))
+
+(defun turn-off-xterm-mouse-tracking-on-terminal (terminal)
+  "Disable xterm mouse tracking on TERMINAL."
+  (when (and xterm-mouse-mode (eq t (terminal-live-p terminal)))
+    (send-string-to-terminal "\e[?1000l" terminal)))
+
+(defun xterm-mouse-handle-delete-frame (frame)
+  "Turn off xterm mouse tracking if FRAME is the last frame on its device."
+  (when (and (eq t (frame-live-p frame))
+            (<= 1 (length (frames-on-display-list (frame-terminal frame)))))
+    (turn-off-xterm-mouse-tracking-on-terminal frame)))
+
+;; Frame creation and deletion.
+(add-hook 'after-make-frame-functions 'turn-on-xterm-mouse-tracking-on-terminal)
+(add-hook 'delete-frame-functions 'xterm-mouse-handle-delete-frame)
 
 ;; Restore normal mouse behaviour outside Emacs.
+(add-hook 'suspend-tty-functions 'turn-off-xterm-mouse-tracking-on-terminal)
+(add-hook 'resume-tty-functions 'turn-on-xterm-mouse-tracking-on-terminal)
 (add-hook 'suspend-hook 'turn-off-xterm-mouse-tracking)
 (add-hook 'suspend-resume-hook 'turn-on-xterm-mouse-tracking)
 (add-hook 'kill-emacs-hook 'turn-off-xterm-mouse-tracking)
diff --git a/lispref/elisp-covers.texi b/lispref/elisp-covers.texi
deleted file mode 100644 (file)
index 66c3a3b..0000000
+++ /dev/null
@@ -1,252 +0,0 @@
-\input texinfo    @c -*-texinfo-*-
-@comment %**start of header
-@setfilename covers.info
-@settitle GNU Emacs Lisp Reference Manual
-@comment %**end of header
-
-@titlepage
-@c ================ Volume 1 ================
-@w{ }
-@sp 2
-@center @titlefont{The}
-@sp 1
-@center @titlefont{GNU}
-@sp 1
-@center @titlefont{Emacs Lisp}
-@sp 1
-@center @titlefont{Reference}
-@sp 1
-@center @titlefont{Manual}
-@sp 2
-@center GNU Emacs Version 19
-@center for Unix Users
-@center Edition 2.3, June 1994
-@sp 2
-@center @titlefont{Volume 1}
-@sp 2
-@center by Bil Lewis, Dan LaLiberte,
-@center and the GNU Manual Group
-
-@page
-@c ================ Volume 2 ================
-@w{ }
-@sp 5
-@center @titlefont{The}
-@sp 1
-@center @titlefont{GNU}
-@sp 1
-@center @titlefont{Emacs Lisp}
-@sp 1
-@center @titlefont{Reference}
-@sp 1
-@center @titlefont{Manual}
-@sp 2
-@center GNU Emacs Version 19
-@center for Unix Users
-@center Edition 2.3, June 1994
-@sp 2
-@center @titlefont{Volume 2}
-@sp 2
-@center by Bil Lewis,
-@center Dan LaLiberte, and
-@center the GNU Manual Group
-
-@page
-@c ================ Volume 1 with baseline skip 16pt ================
-
-@tex
-\global\baselineskip = 16pt
-@end tex
-
-16 pts baseline skip:
-
-@w{ }
-@sp 2
-@center @titlefont{The}
-@sp 1
-@center @titlefont{GNU}
-@sp 1
-@center @titlefont{Emacs Lisp}
-@sp 1
-@center @titlefont{Reference}
-@sp 1
-@center @titlefont{Manual}
-@sp 2
-@center GNU Emacs Version 19
-@center for Unix Users
-@center Edition 2.3, June 1994
-@sp 2
-@center @titlefont{Volume 1}
-@sp 2
-@center by Bil Lewis, Dan LaLiberte,
-@center and the GNU Manual Group
-
-@page
-@c ================ Volume 1 with baseline skip 18pt ================
-
-@tex
-\global\baselineskip = 18pt
-@end tex
-
-18 pts baseline skip, with 15pts  between sections
-
-@w{ }
-@sp 2
-@center @titlefont{The}
-@sp 1
-@center @titlefont{GNU}
-@sp 1
-@center @titlefont{Emacs Lisp}
-@sp 1
-@center @titlefont{Reference}
-@sp 1
-@center @titlefont{Manual}
-@tex
-\global\baselineskip = 15pt
-@end tex
-
-@sp 2
-@center GNU Emacs Version 19
-@center for Unix Users
-@center Edition 2.3, June 1994
-@sp 2
-@center @titlefont{Volume 1}
-@sp 2
-@center by Bil Lewis,
-@center Dan LaLiberte, and
-@center the GNU Manual Group
-
-@page
-@c ================ Volume 1 with more baseline skip 24 pts ================
-
-@tex
-\global\baselineskip = 24pt
-@end tex
-
-24 pts baseline skip:
-
-@w{ }
-@sp 2
-@center @titlefont{The}
-@sp 1
-@center @titlefont{GNU}
-@sp 1
-@center @titlefont{Emacs Lisp}
-@sp 1
-@center @titlefont{Reference}
-@sp 1
-@center @titlefont{Manual}
-@sp 2
-@center GNU Emacs Version 19
-@center for Unix Users
-@center Edition 2.3, June 1994
-@sp 2
-@center @titlefont{Volume 1}
-@sp 2
-@center by Bil Lewis, Dan LaLiberte,
-@center and the GNU Manual Group
-
-@page
-@c ================ Volume 2 with more baseline skip 18 pts ================
-
-@tex
-\global\baselineskip = 18pt
-@end tex
-
-18 pts baseline skip:
-
-@w{ }
-@sp 5
-@center @titlefont{The}
-@sp 1
-@center @titlefont{GNU}
-@sp 1
-@center @titlefont{Emacs Lisp}
-@sp 1
-@center @titlefont{Reference}
-@sp 1
-@center @titlefont{Manual}
-@sp 2
-@center GNU Emacs Version 19
-@center for Unix Users
-@center Edition 2.3, June 1994
-@sp 2
-@center @titlefont{Volume 2}
-@sp 2
-@center by Bil Lewis, Dan LaLiberte,
-@center and the GNU Manual Group
-
-@page
-@c ================ Volume 2 with more baseline skip 24 pts ================
-
-@tex
-\global\baselineskip = 24pt
-@end tex
-
-24 pts baseline skip:
-
-@w{ }
-@sp 5
-@center @titlefont{The}
-@sp 1
-@center @titlefont{GNU}
-@sp 1
-@center @titlefont{Emacs Lisp}
-@sp 1
-@center @titlefont{Reference}
-@sp 1
-@center @titlefont{Manual}
-@sp 2
-@center GNU Emacs Version 19
-@center for Unix Users
-@center Edition 2.3, June 1994
-@sp 2
-@center @titlefont{Volume 2}
-@sp 2
-@center by Bil Lewis, Dan LaLiberte,
-@center and the GNU Manual Group
-
-
-@page
-@c ================  Spine 1 ================
-
-@w{@titlefont{The GNU Emacs Lisp Reference Manual --- Vol. 1}}
-@sp 4
-@center GNU Emacs Version 19
-@center for Unix Users
-@center Edition 2.3, June 1994
-@sp 4
-@center by Bil Lewis, Dan LaLiberte,
-@center and the GNU Manual Group
-
-@sp 4
-@author The GNU Emacs Lisp Reference Manual --- Vol. 1
-@sp 3
-@author FSF
-
-@author
-
-@page
-@c ================  Spine 2 ================
-
-@w{@titlefont{The GNU Emacs Lisp Reference Manual --- Vol. 2}}
-@sp 4
-@center GNU Emacs Version 19
-@center for Unix Users
-@center Edition 2.3, June 1994
-@sp 4
-@center by Bil Lewis, Dan LaLiberte,
-@center and the GNU Manual Group
-
-
-@sp 4
-@author The GNU Emacs Lisp Reference Manual --- Vol. 2
-@sp 3
-@author FSF
-
-@end titlepage
-@bye
-
-@ignore
-   arch-tag: 02d65d63-3b64-49bc-a5c0-bfd5eabb6c98
-@end ignore
index 77cc50e..b01569c 100644 (file)
@@ -1812,6 +1812,7 @@ XlwMenuRealize (w, valueMask, attributes)
   XlwMenuWidget mw = (XlwMenuWidget)w;
   XSetWindowAttributes xswa;
   int mask;
+  int count;
 
   (*xlwMenuWidgetClass->core_class.superclass->core_class.realize)
     (w, valueMask, attributes);
@@ -1819,7 +1820,16 @@ XlwMenuRealize (w, valueMask, attributes)
   xswa.save_under = True;
   xswa.cursor = mw->menu.cursor_shape;
   mask = CWSaveUnder | CWCursor;
+  /* I sometimes get random BadCursor errors while creating the first
+     frame on a display.  I can not find their reason, but they are
+     annoying so for now let's ignore any errors here.  -- lorentey  */
+#ifdef emacs
+  x_catch_errors (XtDisplay (w));
+#endif
   XChangeWindowAttributes (XtDisplay (w), XtWindow (w), mask, &xswa);
+#ifdef emacs
+  x_uncatch_errors ();
+#endif
 
   mw->menu.windows [0].window = XtWindow (w);
   mw->menu.windows [0].x = w->core.x;
index f0d8fdc..7f4c043 100644 (file)
@@ -118,6 +118,7 @@ EmacsObjects = 
        "{Src}sysdep.c.x" Â¶
        "{Src}term.c.x" Â¶
        "{Src}termcap.c.x" Â¶
+       "{Src}terminal.c.x" Â¶
        "{Src}textprop.c.x" Â¶
        "{Src}tparam.c.x" Â¶
        "{Src}undo.c.x" Â¶
@@ -260,8 +261,8 @@ buildobj.lst 
        {CONFIG_H_GROUP} Â¶
        "{Includes}sys:types.h" Â¶
        "{Includes}sys:file.h" Â¶
-               "{Includes}sys:types.h" Â¶
-               "{Includes}sys:stat.h" Â¶
+       "{Includes}sys:types.h" Â¶
+       "{Includes}sys:stat.h" Â¶
        "{Src}lisp.h" Â¶
        "{Src}commands.h" Â¶
        "{Src}buffer.h" Â¶
@@ -273,7 +274,9 @@ buildobj.lst 
        "{Src}process.h" Â¶
        "{Src}syssignal.h" Â¶
        "{Src}systty.h" Â¶
-               "{Includes}termio.h"
+       "{Includes}termio.h" Â¶
+       "{Src}frame.h" Â¶
+       "{Src}termhooks.h"
 
 {Src}casefiddle Ã„ Â¶
        {CONFIG_H_GROUP} Â¶
@@ -795,6 +798,16 @@ buildobj.lst 
        "{Src}lisp.h" Â¶
        "{Includes}sys:file.h"
 
+{Src}terminal.c.x Ã„ Â¶
+       {CONFIG_H_GROUP} Â¶
+       "{Src}lisp.h" Â¶
+       "{Src}frame.h" Â¶
+       "{Src}termchar.h" Â¶
+       "{Src}termhooks.h" Â¶
+       "{Src}charset.h" Â¶
+       "{Src}coding.h" Â¶
+       "{Src}keyboard.h"
+
 {Src}textproc.c.x Ã„ Â¶
        {CONFIG_H_GROUP} Â¶
        "{Src}lisp.h" Â¶
@@ -1011,6 +1024,7 @@ shortlisp = 
        {Lisp}abbrev.elc Â¶
        {Lisp}buff-menu.elc Â¶
        {Lisp}button.elc Â¶
+       {Lisp}server.elc Â¶
        {Lisp}emacs-lisp:byte-run.elc Â¶
        {Lisp}cus-face.elc Â¶
        {Lisp}cus-start.elc Â¶
@@ -1024,6 +1038,7 @@ shortlisp = 
        {Lisp}emacs-lisp:float-sup.elc Â¶
        {Lisp}format.elc Â¶
        {Lisp}frame.elc Â¶
+       {Lisp}termdev.elc Â¶
        {Lisp}help.elc Â¶
        {Lisp}indent.elc Â¶
        {Lisp}isearch.elc Â¶
diff --git a/s.diff b/s.diff
new file mode 100644 (file)
index 0000000..5fc53fa
--- /dev/null
+++ b/s.diff
@@ -0,0 +1,184 @@
+--- orig/lisp/server.el
++++ mod/lisp/server.el
+@@ -83,18 +83,54 @@
+   "Emacs running as a server process."
+   :group 'external)
++(defcustom server-use-tcp nil
++  "If non-nil, use TCP sockets instead of local sockets."
++  :set #'(lambda (sym val)
++           (unless (featurep 'make-network-process '(:family local))
++             (setq val t)
++             (unless load-in-progress
++               (message "Local sockets unsupported, using TCP sockets")))
++           (when val (random t))
++           (set-default sym val))
++  :group 'server
++  :type 'boolean
++  :version "22.1")
++
++(defcustom server-host nil
++  "The name or IP address to use as host address of the server process.
++If set, the server accepts remote connections; otherwise it is local."
++  :group 'server
++  :type '(choice
++          (string :tag "Name or IP address")
++          (const :tag "Local" nil))
++  :version "22.1")
++(put 'server-host 'risky-local-variable t)
++
++(defcustom server-auth-dir "~/.emacs.d/server/"
++  "Directory for server authentication files."
++  :group 'server
++  :type 'directory
++  :version "22.1")
++(put 'server-auth-dir 'risky-local-variable t)
++
++(defcustom server-raise-frame t
++  "If non-nil, raise frame when switching to a buffer."
++  :group 'server
++  :type 'boolean
++  :version "22.1")
++
+ (defcustom server-visit-hook nil
+-  "*Hook run when visiting a file for the Emacs server."
++  "Hook run when visiting a file for the Emacs server."
+   :group 'server
+   :type 'hook)
+ (defcustom server-switch-hook nil
+-  "*Hook run when switching to a buffer for the Emacs server."
++  "Hook run when switching to a buffer for the Emacs server."
+   :group 'server
+   :type 'hook)
+ (defcustom server-done-hook nil
+-  "*Hook run when done editing a buffer for the Emacs server."
++  "Hook run when done editing a buffer for the Emacs server."
+   :group 'server
+   :type 'hook)
+@@ -113,7 +149,7 @@
+ (put 'server-buffer-clients 'permanent-local t)
+ (defcustom server-window nil
+-  "*Specification of the window to use for selecting Emacs server buffers.
++  "Specification of the window to use for selecting Emacs server buffers.
+ If nil, use the selected window.
+ If it is a function, it should take one argument (a buffer) and
+ display and select it.  A common value is `pop-to-buffer'.
+@@ -132,14 +168,14 @@
+                (function :tag "Other function")))
+ (defcustom server-temp-file-regexp "^/tmp/Re\\|/draft$"
+-  "*Regexp matching names of temporary files.
++  "Regexp matching names of temporary files.
+ These are deleted and reused after each edit by the programs that
+ invoke the Emacs server."
+   :group 'server
+   :type 'regexp)
+ (defcustom server-kill-new-buffers t
+-  "*Whether to kill buffers when done with them.
++  "Whether to kill buffers when done with them.
+ If non-nil, kill a buffer unless it already existed before editing
+ it with Emacs server.  If nil, kill only buffers as specified by
+ `server-temp-file-regexp'.
+@@ -151,7 +187,7 @@
+   :version "21.1")
+ (or (assq 'server-buffer-clients minor-mode-alist)
+-    (setq minor-mode-alist (cons '(server-buffer-clients " Server") minor-mode-alist)))
++    (push '(server-buffer-clients " Server") minor-mode-alist))
+ (defvar server-existing-buffer nil
+   "Non-nil means the buffer existed before the server was asked to visit it.
+@@ -390,11 +426,12 @@
+   (setq dir (directory-file-name dir))
+   (let ((attrs (file-attributes dir)))
+     (unless attrs
+-      (letf (((default-file-modes) ?\700)) (make-directory dir))
++      (letf (((default-file-modes) ?\700)) (make-directory dir t))
+       (setq attrs (file-attributes dir)))
+     ;; Check that it's safe for use.
+     (unless (and (eq t (car attrs)) (eq (nth 2 attrs) (user-uid))
+-               (zerop (logand ?\077 (file-modes dir))))
++                 (or (eq system-type 'windows-nt)
++                     (zerop (logand ?\077 (file-modes dir)))))
+       (error "The directory %s is unsafe" dir))))
+ ;;;###autoload
+@@ -966,10 +1003,10 @@
+       (let ((version-control nil)
+             (buffer-backed-up nil))
+         (save-buffer))
+-      (if (and (buffer-modified-p)
+-             buffer-file-name
+-             (y-or-n-p (concat "Save file " buffer-file-name "? ")))
+-        (save-buffer)))
++      (when (and (buffer-modified-p)
++               buffer-file-name
++               (y-or-n-p (concat "Save file " buffer-file-name "? ")))
++      (save-buffer)))
+     (server-buffer-done (current-buffer))))
+ ;; Ask before killing a server buffer.
+@@ -1027,12 +1064,12 @@
+ starts server process and that is all.  Invoked by \\[server-edit]."
+   (interactive "P")
+   (cond
+-   ((or arg
+-      (not server-process)
+-      (memq (process-status server-process) '(signal exit)))
+-    (server-mode 1))
+-   (server-clients (apply 'server-switch-buffer (server-done)))
+-   (t (message "No server editing buffers exist"))))
++    ((or arg
++         (not server-process)
++         (memq (process-status server-process) '(signal exit)))
++     (server-mode 1))
++    (server-clients (apply 'server-switch-buffer (server-done)))
++    (t (message "No server editing buffers exist"))))
+ (defun server-switch-buffer (&optional next-buffer killed-one)
+   "Switch to another buffer, preferably one that has a client.
+@@ -1065,21 +1102,19 @@
+       (let ((win (get-buffer-window next-buffer 0)))
+         (if (and win (not server-window))
+             ;; The buffer is already displayed: just reuse the window.
+-            (let ((frame (window-frame win)))
+-              (if (eq (frame-visible-p frame) 'icon)
+-                  (raise-frame frame))
+-              (select-window win)
+-              (set-buffer next-buffer))
++              (progn
++                (select-window win)
++                (set-buffer next-buffer))
+           ;; Otherwise, let's find an appropriate window.
+           (cond ((and (windowp server-window)
+                       (window-live-p server-window))
+                  (select-window server-window))
+                 ((framep server-window)
+-                 (if (not (frame-live-p server-window))
+-                     (setq server-window (make-frame)))
++                 (unless (frame-live-p server-window)
++                   (setq server-window (make-frame)))
+                  (select-window (frame-selected-window server-window))))
+-          (if (window-minibuffer-p (selected-window))
+-              (select-window (next-window nil 'nomini 0)))
++          (when (window-minibuffer-p (selected-window))
++            (select-window (next-window nil 'nomini 0)))
+           ;; Move to a non-dedicated window, if we have one.
+           (when (window-dedicated-p (selected-window))
+             (select-window
+@@ -1093,7 +1128,9 @@
+               (switch-to-buffer next-buffer)
+             ;; After all the above, we might still have ended up with
+             ;; a minibuffer/dedicated-window (if there's no other).
+-            (error (pop-to-buffer next-buffer)))))))))
++            (error (pop-to-buffer next-buffer)))))))
++    (when server-raise-frame
++      (select-frame-set-input-focus (window-frame (selected-window))))))
+ ;;;###autoload
+ (defun server-save-buffers-kill-terminal (proc &optional arg)
index fe99529..c21e38d 100644 (file)
@@ -3,7 +3,10 @@ source ^\.(gdbinit|dbxinit)$
 
 # Auto-generated files, which ignore
 precious ^(config\.stamp|config\.h|epaths\.h|buildobj\.lst)$
+precious ^(TAGS-LISP)$
+precious ^(buildobj\.lst)$
 
 backup ^(stamp-oldxmenu|prefix-args|temacs|emacs|emacs-[0-9.]*)$
+backup ^(bootstrap-emacs)$
 
 # arch-tag: 277cc7ae-b3f5-44af-abf1-84c073164543
index a99b17e..5dc126f 100644 (file)
@@ -1067,7 +1067,7 @@ set print sevenbit-strings
 
 show environment DISPLAY
 show environment TERM
-set args -geometry 80x40+0+0
+#set args -geometry 80x40+0+0
 
 # People get bothered when they see messages about non-existent functions...
 xgetptr Vsystem_type
@@ -1095,7 +1095,7 @@ end
 tbreak init_sys_modes
 commands
   silent
-  xgetptr Vwindow_system
+  xgetptr Vinitial_window_system
   set $tem = (struct Lisp_Symbol *) $ptr
   xgetptr $tem->xname
   set $tem = (struct Lisp_String *) $ptr
index af4cb81..71eaead 100644 (file)
@@ -578,7 +578,7 @@ emacsappsrc = ${srcdir}/../mac/Emacs.app/
    whose initialized data areas should be dumped as pure by dump-emacs.  */
 obj=    dispnew.o frame.o scroll.o xdisp.o $(XMENU_OBJ) window.o \
        charset.o coding.o category.o ccl.o \
-       cm.o term.o xfaces.o $(XOBJ) $(GTK_OBJ)\
+       cm.o term.o terminal.o xfaces.o $(XOBJ) $(GTK_OBJ)\
        emacs.o keyboard.o macros.o keymap.o sysdep.o \
        buffer.o filelock.o insdel.o marker.o \
        minibuf.o fileio.o dired.o filemode.o \
@@ -720,6 +720,7 @@ otherobj= $(termcapobj) lastfile.o $(mallocobj) $(allocaobj) $(widgetobj) $(LIBO
 lisp= \
        ${lispsource}abbrev.elc \
        ${lispsource}buff-menu.elc \
+       ${lispsource}server.elc \
        ${lispsource}button.elc \
        ${lispsource}emacs-lisp/byte-run.elc \
        ${lispsource}cus-face.elc \
@@ -736,6 +737,7 @@ lisp= \
        MOUSE_SUPPORT \
        ${lispsource}emacs-lisp/float-sup.elc \
        ${lispsource}frame.elc \
+       ${lispsource}termdev.elc \
        ${lispsource}help.elc \
        ${lispsource}indent.elc \
        ${lispsource}isearch.elc \
@@ -819,6 +821,7 @@ lisp= \
 shortlisp= \
        ../lisp/abbrev.elc \
        ../lisp/buff-menu.elc \
+       ../lisp/server.elc \
        ../lisp/button.elc \
        ../lisp/emacs-lisp/byte-run.elc \
        ../lisp/cus-face.elc \
@@ -833,6 +836,7 @@ shortlisp= \
        ../lisp/emacs-lisp/float-sup.elc \
        ../lisp/format.elc \
        ../lisp/frame.elc \
+       ../lisp/termdev.elc \
        ../lisp/help.elc \
        ../lisp/indent.elc \
        ../lisp/isearch.elc \
@@ -922,7 +926,9 @@ SOME_MACHINE_LISP = ${dotdot}/lisp/mouse.elc \
   ${dotdot}/lisp/x-dnd.elc \
   ${dotdot}/lisp/international/ccl.elc \
   ${dotdot}/lisp/international/codepage.elc \
-  ${dotdot}/lisp/international/fontset.elc
+  ${dotdot}/lisp/international/fontset.elc \
+  ${dotdot}/lisp/mouse.elc \
+  ${dotdot}/lisp/term/x-win.elc
 
 /* Construct full set of libraries to be linked.
    Note that SunOS needs -lm to come before -lc; otherwise, you get
@@ -968,7 +974,7 @@ emacs${EXEEXT}: temacs${EXEEXT} ${etc}DOC ${lisp}
    for the first time, this prevents any variation between configurations
    in the contents of the DOC file.
    Likewise for ${SOME_MACHINE_LISP}.  */
-${etc}DOC: ${libsrc}make-docfile${EXEEXT} ${obj} ${shortlisp} ${SOME_MACHINE_LISP}
+${etc}DOC: ${libsrc}make-docfile ${obj} ${shortlisp} ${SOME_MACHINE_LISP}
        -rm -f ${etc}DOC
        ${libsrc}make-docfile -d ${srcdir} ${SOME_MACHINE_OBJECTS} ${obj} > ${etc}DOC
        ${libsrc}make-docfile -a ${etc}DOC -d ${srcdir} ${SOME_MACHINE_LISP} ${shortlisp}
@@ -1091,7 +1097,7 @@ callint.o: callint.c window.h commands.h buffer.h keymap.h \
    keyboard.h dispextern.h $(config_h)
 callproc.o: callproc.c epaths.h buffer.h commands.h $(config_h) \
        process.h systty.h syssignal.h charset.h coding.h ccl.h msdos.h \
-        composite.h w32.h blockinput.h atimer.h systime.h
+        composite.h w32.h blockinput.h atimer.h systime.h frame.h termhooks.h
 casefiddle.o: casefiddle.c syntax.h commands.h buffer.h composite.h \
        charset.h keymap.h $(config_h)
 casetab.o: casetab.c buffer.h $(config_h)
@@ -1100,8 +1106,8 @@ ccl.o: ccl.c ccl.h charset.h coding.h $(config_h)
 charset.o: charset.c charset.h buffer.h coding.h composite.h disptab.h \
        $(config_h)
 coding.o: coding.c coding.h ccl.h buffer.h charset.h intervals.h composite.h \
-       window.h dispextern.h $(config_h)
-cm.o: cm.c cm.h termhooks.h $(config_h)
+       window.h dispextern.h frame.h termhooks.h $(config_h)
+cm.o: cm.c frame.h cm.h termhooks.h termchar.h $(config_h)
 cmds.o: cmds.c syntax.h buffer.h charset.h commands.h window.h $(config_h) \
        msdos.h dispextern.h keyboard.h keymap.h
 pre-crt0.o: pre-crt0.c
@@ -1109,7 +1115,7 @@ ecrt0.o: ecrt0.c $(config_h)
        CRT0_COMPILE ${srcdir}/ecrt0.c
 dired.o: dired.c commands.h buffer.h $(config_h) charset.h coding.h regex.h \
    systime.h blockinput.h
-dispnew.o: dispnew.c  systty.h systime.h commands.h process.h frame.h \
+dispnew.o: dispnew.c systime.h commands.h process.h frame.h \
    window.h buffer.h dispextern.h termchar.h termopts.h termhooks.h cm.h \
    disptab.h indent.h intervals.h \
    xterm.h blockinput.h atimer.h charset.h msdos.h composite.h keyboard.h \
@@ -1129,10 +1135,10 @@ filelock.o: filelock.c buffer.h charset.h coding.h systime.h epaths.h $(config_h
 filemode.o: filemode.c  $(config_h)
 frame.o: frame.c xterm.h window.h frame.h termhooks.h commands.h keyboard.h \
    blockinput.h atimer.h systime.h buffer.h charset.h fontset.h \
-   msdos.h dosfns.h dispextern.h w32term.h macterm.h $(config_h)
-fringe.o: fringe.c dispextern.h frame.h window.h buffer.h $(config_h)
+   msdos.h dosfns.h dispextern.h w32term.h macterm.h termchar.h $(config_h)
+fringe.o: fringe.c dispextern.h frame.h window.h buffer.h termhooks.h $(config_h)
 fontset.o: dispextern.h fontset.h fontset.c ccl.h buffer.h charset.h frame.h \
-   keyboard.h $(config_h)
+   keyboard.h termhooks.h $(config_h)
 getloadavg.o: getloadavg.c $(config_h)
 image.o: image.c frame.h window.h dispextern.h blockinput.h atimer.h \
    systime.h xterm.h w32term.h w32gui.h macterm.h macgui.h $(config_h)
@@ -1143,7 +1149,7 @@ insdel.o: insdel.c window.h buffer.h $(INTERVAL_SRC) blockinput.h charset.h \
    dispextern.h atimer.h systime.h region-cache.h $(config_h)
 keyboard.o: keyboard.c termchar.h termhooks.h termopts.h buffer.h charset.h \
    commands.h frame.h window.h macros.h disptab.h keyboard.h syssignal.h \
-   systty.h systime.h dispextern.h syntax.h $(INTERVAL_SRC) blockinput.h \
+   systime.h dispextern.h syntax.h $(INTERVAL_SRC) blockinput.h \
    atimer.h xterm.h puresize.h msdos.h keymap.h w32term.h macterm.h $(config_h)
 keymap.o: keymap.c buffer.h commands.h keyboard.h termhooks.h blockinput.h \
    atimer.h systime.h puresize.h charset.h intervals.h keymap.h window.h \
@@ -1158,7 +1164,8 @@ vm-limit.o: vm-limit.c mem-limits.h $(config_h)
 marker.o: marker.c buffer.h charset.h $(config_h)
 md5.o: md5.c md5.h $(config_h)
 minibuf.o: minibuf.c syntax.h dispextern.h frame.h window.h keyboard.h \
-   buffer.h commands.h charset.h msdos.h $(INTERVAL_SRC) keymap.h $(config_h)
+   buffer.h commands.h charset.h msdos.h $(INTERVAL_SRC) keymap.h \
+   termhooks.h $(config_h)
 mktime.o: mktime.c $(config_h)
 msdos.o: msdos.c msdos.h dosfns.h systime.h termhooks.h dispextern.h frame.h \
    termopts.h termchar.h charset.h coding.h ccl.h disptab.h window.h \
@@ -1170,7 +1177,7 @@ process.o: process.c process.h buffer.h window.h termhooks.h termopts.h \
 regex.o: regex.c syntax.h buffer.h $(config_h) regex.h category.h charset.h
 region-cache.o: region-cache.c buffer.h region-cache.h $(config_h)
 scroll.o: scroll.c termchar.h dispextern.h frame.h msdos.h keyboard.h \
-   $(config_h)
+   termhooks.h $(config_h)
 search.o: search.c regex.h commands.h buffer.h region-cache.h syntax.h \
    blockinput.h atimer.h systime.h category.h charset.h composite.h \
    $(INTERVAL_SRC) $(config_h)
@@ -1179,11 +1186,13 @@ syntax.o: syntax.c syntax.h buffer.h commands.h category.h charset.h \
    composite.h keymap.h regex.h $(INTERVAL_SRC) $(config_h)
 sysdep.o: sysdep.c syssignal.h systty.h systime.h syswait.h blockinput.h \
    process.h dispextern.h termhooks.h termchar.h termopts.h \
-   frame.h atimer.h window.h msdos.h dosfns.h keyboard.h  $(config_h)
+   frame.h atimer.h window.h msdos.h dosfns.h keyboard.h cm.h $(config_h)
 term.o: term.c termchar.h termhooks.h termopts.h $(config_h) cm.h frame.h \
    disptab.h dispextern.h keyboard.h charset.h coding.h ccl.h msdos.h \
    window.h keymap.h
 termcap.o: termcap.c $(config_h)
+terminal.o: terminal.c frame.h termchar.h termhooks.h charset.h coding.h \
+   keyboard.h $(config_h)
 terminfo.o: terminfo.c $(config_h)
 tparam.o: tparam.c $(config_h)
 undo.o: undo.c buffer.h commands.h window.h $(config_h)
@@ -1196,7 +1205,7 @@ w16select.o: w16select.c dispextern.h frame.h blockinput.h atimer.h systime.h \
 widget.o: widget.c xterm.h frame.h dispextern.h widgetprv.h \
    $(srcdir)/../lwlib/lwlib.h $(config_h)
 window.o: window.c indent.h commands.h frame.h window.h buffer.h termchar.h \
-   termhooks.h disptab.h keyboard.h dispextern.h msdos.h composite.h \
+   disptab.h keyboard.h dispextern.h msdos.h composite.h \
    keymap.h blockinput.h $(INTERVAL_SRC) xterm.h w32term.h macterm.h $(config_h)
 xdisp.o: xdisp.c macros.h commands.h process.h indent.h buffer.h dispextern.h coding.h \
    termchar.h frame.h window.h disptab.h termhooks.h charset.h $(config_h) \
@@ -1204,10 +1213,11 @@ xdisp.o: xdisp.c macros.h commands.h process.h indent.h buffer.h dispextern.h co
    msdos.h composite.h fontset.h blockinput.h atimer.h systime.h keymap.h
 xfaces.o: xfaces.c dispextern.h frame.h xterm.h buffer.h blockinput.h \
    window.h charset.h msdos.h dosfns.h composite.h atimer.h systime.h \
-   keyboard.h fontset.h w32term.h macterm.h $(INTERVAL_SRC) $(config_h)
+   keyboard.h fontset.h w32term.h macterm.h $(INTERVAL_SRC) termchar.h \
+   termhooks.h $(config_h)
 xfns.o: xfns.c buffer.h frame.h window.h keyboard.h xterm.h dispextern.h \
    $(srcdir)/../lwlib/lwlib.h blockinput.h atimer.h systime.h epaths.h \
-   charset.h gtkutil.h $(config_h)
+   charset.h gtkutil.h termchar.h termhooks.h $(config_h)
 xmenu.o: xmenu.c xterm.h termhooks.h window.h dispextern.h frame.h buffer.h \
    keyboard.h $(srcdir)/../lwlib/lwlib.h blockinput.h atimer.h systime.h \
    gtkutil.h msdos.h coding.h $(config_h)
@@ -1216,7 +1226,7 @@ xterm.o: xterm.c xterm.h termhooks.h termopts.h termchar.h window.h buffer.h \
   keyboard.h gnu.h charset.h ccl.h fontset.h composite.h \
   coding.h process.h gtkutil.h $(config_h)
 xselect.o: xselect.c process.h dispextern.h frame.h xterm.h blockinput.h \
-  buffer.h atimer.h systime.h $(config_h)
+  buffer.h atimer.h systime.h termhooks.h $(config_h)
 xrdb.o: xrdb.c $(config_h) epaths.h
 xsmfns.o: xsmfns.c $(config_h) systime.h sysselect.h termhooks.h xterm.h \
   lisp.h termopts.h
@@ -1233,15 +1243,16 @@ alloc.o: alloc.c process.h frame.h window.h buffer.h  puresize.h syssignal.h key
  blockinput.h atimer.h systime.h charset.h dispextern.h $(config_h) $(INTERVAL_SRC)
 bytecode.o: bytecode.c buffer.h syntax.h charset.h window.h dispextern.h \
   frame.h xterm.h $(config_h)
-data.o: data.c buffer.h puresize.h charset.h syssignal.h keyboard.h frame.h $(config_h)
+data.o: data.c buffer.h puresize.h charset.h syssignal.h keyboard.h frame.h termhooks.h $(config_h)
 eval.o: eval.c commands.h keyboard.h blockinput.h atimer.h systime.h \
   dispextern.h $(config_h)
 floatfns.o: floatfns.c $(config_h)
 fns.o: fns.c commands.h $(config_h) frame.h buffer.h charset.h keyboard.h \
  keymap.h frame.h window.h dispextern.h $(INTERVAL_SRC) coding.h md5.h \
- blockinput.h xterm.h
+ blockinput.h xterm.h termhooks.h
 print.o: print.c process.h frame.h window.h buffer.h keyboard.h charset.h \
-   $(config_h) dispextern.h termchar.h $(INTERVAL_SRC) msdos.h composite.h
+   $(config_h) dispextern.h termchar.h $(INTERVAL_SRC) msdos.h composite.h \
+   termchar.h
 lread.o: lread.c commands.h keyboard.h buffer.h epaths.h charset.h \
  $(config_h) $(INTERVAL_SRC) termhooks.h coding.h msdos.h
 
@@ -1256,12 +1267,12 @@ composite.o: composite.c buffer.h  charset.h $(INTERVAL_SRC) $(config_h)
    OTHER_FILES and OBJECTS_MACHINE
    select which of these should be compiled.  */
 
-sunfns.o: sunfns.c buffer.h window.h dispextern.h $(config_h)
+sunfns.o: sunfns.c buffer.h window.h dispextern.h termhooks.h $(config_h)
 
 #ifdef HAVE_CARBON
 abbrev.o buffer.o callint.o cmds.o dispnew.o editfns.o fileio.o frame.o \
   fontset.o indent.o insdel.o keyboard.o macros.o minibuf.o msdos.o process.o \
-  scroll.o sysdep.o term.o widget.o window.o xdisp.o xfaces.o xfns.o xmenu.o \
+  scroll.o sysdep.o term.o terminal.o widget.o window.o xdisp.o xfaces.o xfns.o xmenu.o \
   xterm.o xselect.o sound.o: macgui.h
 mac.o: mac.c process.h sysselect.h blockinput.h atimer.h systime.h charset.h \
   coding.h ccl.h $(config_h)
index f3ca3e7..c49d3b5 100644 (file)
@@ -341,7 +341,9 @@ Lisp_Object Vgc_elapsed;    /* accumulated elapsed time in GC  */
 EMACS_INT gcs_done;            /* accumulated GCs  */
 
 static void mark_buffer P_ ((Lisp_Object));
+extern void mark_terminals P_ ((void));
 extern void mark_kboards P_ ((void));
+extern void mark_ttys P_ ((void));
 extern void mark_backtrace P_ ((void));
 static void gc_sweep P_ ((void));
 static void mark_glyph_matrix P_ ((struct glyph_matrix *));
@@ -1236,7 +1238,8 @@ emacs_blocked_malloc (size, ptr)
   BLOCK_INPUT_ALLOC;
   __malloc_hook = old_malloc_hook;
 #ifdef DOUG_LEA_MALLOC
-    mallopt (M_TOP_PAD, malloc_hysteresis * 4096);
+  /* Segfaults on my system.  --lorentey */
+  /* mallopt (M_TOP_PAD, malloc_hysteresis * 4096); */
 #else
     __malloc_extra_blocks = malloc_hysteresis;
 #endif
@@ -5160,7 +5163,9 @@ returns nil, because real GC can't be done.  */)
       mark_object (bind->symbol);
       mark_object (bind->old_value);
     }
+  mark_terminals ();
   mark_kboards ();
+  mark_ttys ();
 
 #ifdef USE_GTK
   {
@@ -5595,6 +5600,7 @@ mark_object (arg)
          mark_object (ptr->menu_bar_vector);
          mark_object (ptr->buffer_predicate);
          mark_object (ptr->buffer_list);
+         mark_object (ptr->buried_buffer_list);
          mark_object (ptr->menu_bar_window);
          mark_object (ptr->tool_bar_window);
          mark_face_cache (ptr->face_cache);
index 33a41b6..0555591 100644 (file)
@@ -215,25 +215,38 @@ frame parameter come first, followed by the rest of the buffers.  */)
      (frame)
      Lisp_Object frame;
 {
-  Lisp_Object framelist, general;
+  Lisp_Object general;
   general = Fmapcar (Qcdr, Vbuffer_alist);
 
   if (FRAMEP (frame))
     {
-      Lisp_Object tail;
+      Lisp_Object framelist, prevlist, tail;
+      Lisp_Object args[3];
 
       CHECK_FRAME (frame);
 
       framelist = Fcopy_sequence (XFRAME (frame)->buffer_list);
+      prevlist = Fnreverse (Fcopy_sequence (XFRAME (frame)->buried_buffer_list));
 
-      /* Remove from GENERAL any buffer that duplicates one in FRAMELIST.  */
+      /* Remove from GENERAL any buffer that duplicates one in
+         FRAMELIST or PREVLIST.  */
       tail = framelist;
-      while (! NILP (tail))
+      while (CONSP (tail))
        {
          general = Fdelq (XCAR (tail), general);
          tail = XCDR (tail);
        }
-      return nconc2 (framelist, general);
+      tail = prevlist;
+      while (CONSP (tail))
+       {
+         general = Fdelq (XCAR (tail), general);
+         tail = XCDR (tail);
+       }
+
+      args[0] = framelist;
+      args[1] = general;
+      args[2] = prevlist;
+      return Fnconc (3, args);
     }
 
   return general;
@@ -1574,6 +1587,23 @@ record_buffer (buf)
   XSETCDR (link, Vbuffer_alist);
   Vbuffer_alist = link;
 
+  /* Effectively do a delq on buried_buffer_list.  */
+  
+  prev = Qnil;
+  for (link = XFRAME (frame)->buried_buffer_list; CONSP (link);
+       link = XCDR (link))
+    {
+      if (EQ (XCAR (link), buf))
+        {
+          if (NILP (prev))
+            XFRAME (frame)->buried_buffer_list = XCDR (link);
+          else
+            XSETCDR (prev, XCDR (XCDR (prev)));
+          break;
+        }
+      prev = link;
+    }
+
   /* Now move this buffer to the front of frame_buffer_list also.  */
 
   prev = Qnil;
@@ -2054,10 +2084,10 @@ selected window if it is displayed there.  */)
       XSETCDR (link, Qnil);
       Vbuffer_alist = nconc2 (Vbuffer_alist, link);
 
-      /* Removing BUFFER from frame-specific lists
-        has the effect of putting BUFFER at the end
-        of the combined list in each frame.  */
-      frames_discard_buffer (buffer);
+      XFRAME (selected_frame)->buffer_list
+        = Fdelq (buffer, XFRAME (selected_frame)->buffer_list);
+      XFRAME (selected_frame)->buried_buffer_list
+        = Fcons (buffer, Fdelq (buffer, XFRAME (selected_frame)->buried_buffer_list));
     }
 
   return Qnil;
index b65ef14..0bd2ed6 100644 (file)
@@ -402,8 +402,8 @@ invoke it.  If KEYS is omitted or nil, the return value of
       real_this_command= save_real_this_command;
       current_kboard->Vlast_command = save_last_command;
 
-      single_kboard_state ();
-      return apply1 (function, specs);
+      temporarily_switch_to_single_kboard (NULL);
+      return unbind_to (speccount, apply1 (function, specs));
     }
 
   /* Here if function specifies a string to control parsing the defaults */
@@ -851,12 +851,11 @@ invoke it.  If KEYS is omitted or nil, the return value of
   real_this_command= save_real_this_command;
   current_kboard->Vlast_command = save_last_command;
 
-  single_kboard_state ();
-
   {
     Lisp_Object val;
     specbind (Qcommand_debug_status, Qnil);
 
+    temporarily_switch_to_single_kboard (NULL);
     val = Ffuncall (count + 1, args);
     UNGCPRO;
     return unbind_to (speccount, val);
index 7b8ba8f..2f0e569 100644 (file)
@@ -84,6 +84,8 @@ extern int errno;
 #include "syssignal.h"
 #include "systty.h"
 #include "blockinput.h"
+#include "frame.h"
+#include "termhooks.h"
 
 #ifdef MSDOS
 #include "msdos.h"
@@ -130,6 +132,7 @@ int synch_process_termsig;
 /* If synch_process_death is zero,
    this is exit code of synchronous subprocess.  */
 int synch_process_retcode;
+
 \f
 /* Clean up when exiting Fcall_process.
    On MSDOS, delete the temporary file on any kind of termination.
@@ -1177,6 +1180,40 @@ usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r
 
 static int relocate_fd ();
 
+static char **
+add_env (char **env, char **new_env, char *string)
+{
+  char **ep;
+  int ok = 1;
+  if (string == NULL)
+    return new_env;
+
+  /* See if this string duplicates any string already in the env.
+     If so, don't put it in.
+     When an env var has multiple definitions,
+     we keep the definition that comes first in process-environment.  */
+  for (ep = env; ok && ep != new_env; ep++)
+    {
+      char *p = *ep, *q = string;
+      while (ok)
+        {
+          if (*q != *p)
+            break;
+          if (*q == 0)
+            /* The string is a lone variable name; keep it for now, we
+               will remove it later.  It is a placeholder for a
+               variable that is not to be included in the environment.  */
+            break;
+          if (*q == '=')
+            ok = 0;
+          p++, q++;
+        }
+    }
+  if (ok)
+    *new_env++ = string;
+  return new_env;
+}
+
 /* This is the last thing run in a newly forked inferior
    either synchronous or asynchronous.
    Copy descriptors IN, OUT and ERR as descriptors 0, 1 and 2.
@@ -1278,14 +1315,23 @@ child_setup (in, out, err, new_argv, set_pgrp, current_dir)
       temp[--i] = 0;
   }
 
-  /* Set `env' to a vector of the strings in Vprocess_environment.  */
+  /* Set `env' to a vector of the strings in the environment.  */
   {
     register Lisp_Object tem;
     register char **new_env;
+    char **p, **q;
     register int new_length;
+    Lisp_Object local = get_frame_param (XFRAME (Fframe_with_environment (selected_frame)),
+                                         Qenvironment);
 
     new_length = 0;
+
     for (tem = Vprocess_environment;
+         CONSP (tem) && STRINGP (XCAR (tem));
+         tem = XCDR (tem))
+      new_length++;
+
+    for (tem = local;
         CONSP (tem) && STRINGP (XCAR (tem));
         tem = XCDR (tem))
       new_length++;
@@ -1295,39 +1341,33 @@ child_setup (in, out, err, new_argv, set_pgrp, current_dir)
 
     /* If we have a PWD envvar, pass one down,
        but with corrected value.  */
-    if (getenv ("PWD"))
+    if (egetenv ("PWD"))
       *new_env++ = pwd_var;
-
-    /* Copy the Vprocess_environment strings into new_env.  */
+    /* Overrides.  */
     for (tem = Vprocess_environment;
         CONSP (tem) && STRINGP (XCAR (tem));
         tem = XCDR (tem))
+      new_env = add_env (env, new_env, SDATA (XCAR (tem)));
+
+    /* Local part of environment.  */
+    for (tem = local;
+         CONSP (tem) && STRINGP (XCAR (tem));
+         tem = XCDR (tem))
+      new_env = add_env (env, new_env, SDATA (XCAR (tem)));
+
+    *new_env = 0;
+
+    /* Remove variable names without values.  */
+    p = q = env;
+    while (*p != 0)
       {
-       char **ep = env;
-       char *string = (char *) SDATA (XCAR (tem));
-       /* See if this string duplicates any string already in the env.
-          If so, don't put it in.
-          When an env var has multiple definitions,
-          we keep the definition that comes first in process-environment.  */
-       for (; ep != new_env; ep++)
-         {
-           char *p = *ep, *q = string;
-           while (1)
-             {
-               if (*q == 0)
-                 /* The string is malformed; might as well drop it.  */
-                 goto duplicate;
-               if (*q != *p)
-                 break;
-               if (*q == '=')
-                 goto duplicate;
-               p++, q++;
-             }
-         }
-       *new_env++ = string;
-      duplicate: ;
+        while (*q != 0 && strchr (*q, '=') == NULL)
+          *q++;
+        *p = *q++;
+        if (*p != 0)
+          p++;
       }
-    *new_env = 0;
   }
 #ifdef WINDOWSNT
   prepare_standard_handles (in, out, err, handles);
@@ -1442,29 +1482,69 @@ relocate_fd (fd, minfd)
 }
 
 static int
-getenv_internal (var, varlen, value, valuelen)
+getenv_internal (var, varlen, value, valuelen, frame)
      char *var;
      int varlen;
      char **value;
      int *valuelen;
+     Lisp_Object frame;
 {
   Lisp_Object scan;
 
-  for (scan = Vprocess_environment; CONSP (scan); scan = XCDR (scan))
+  if (NILP (frame))
+    {
+      /* Try to find VAR in Vprocess_environment first.  */
+      for (scan = Vprocess_environment; CONSP (scan); scan = XCDR (scan))
+        {
+          Lisp_Object entry = XCAR (scan);
+          if (STRINGP (entry)
+              && SBYTES (entry) >= varlen
+#ifdef WINDOWSNT
+              /* NT environment variables are case insensitive.  */
+              && ! strnicmp (SDATA (entry), var, varlen)
+#else  /* not WINDOWSNT */
+              && ! bcmp (SDATA (entry), var, varlen)
+#endif /* not WINDOWSNT */
+              )
+            {
+              if (SBYTES (entry) > varlen && SREF (entry, varlen) == '=')
+                {
+                  *value = (char *) SDATA (entry) + (varlen + 1);
+                  *valuelen = SBYTES (entry) - (varlen + 1);
+                  return 1;
+                }
+              else if (SBYTES (entry) == varlen)
+                {
+                  /* Lone variable names in Vprocess_environment mean that
+                     variable should be removed from the environment. */
+                  return 0;
+                }
+            }
+        }
+      frame = selected_frame;
+    }
+
+  /* Find the environment in which to search the variable. */
+  CHECK_FRAME (frame);
+  frame = Fframe_with_environment (frame);
+
+  for (scan = get_frame_param (XFRAME (frame), Qenvironment);
+       CONSP (scan);
+       scan = XCDR (scan))
     {
       Lisp_Object entry;
 
       entry = XCAR (scan);
       if (STRINGP (entry)
-         && SBYTES (entry) > varlen
-         && SREF (entry, varlen) == '='
+          && SBYTES (entry) > varlen
+          && SREF (entry, varlen) == '='
 #ifdef WINDOWSNT
-         /* NT environment variables are case insensitive.  */
-         && ! strnicmp (SDATA (entry), var, varlen)
+          /* NT environment variables are case insensitive.  */
+          && ! strnicmp (SDATA (entry), var, varlen)
 #else  /* not WINDOWSNT */
-         && ! bcmp (SDATA (entry), var, varlen)
+          && ! bcmp (SDATA (entry), var, varlen)
 #endif /* not WINDOWSNT */
-         )
+          )
        {
          *value    = (char *) SDATA (entry) + (varlen + 1);
          *valuelen = SBYTES (entry) - (varlen + 1);
@@ -1475,26 +1555,34 @@ getenv_internal (var, varlen, value, valuelen)
   return 0;
 }
 
-DEFUN ("getenv-internal", Fgetenv_internal, Sgetenv_internal, 1, 1, 0,
-       doc: /* Return the value of environment variable VAR, as a string.
-VAR should be a string.  Value is nil if VAR is undefined in the environment.
-This function consults the variable ``process-environment'' for its value.  */)
-     (var)
-     Lisp_Object var;
+DEFUN ("getenv-internal", Fgetenv_internal, Sgetenv_internal, 1, 2, 0,
+       doc: /* Get the value of environment variable VARIABLE.
+VARIABLE should be a string.  Value is nil if VARIABLE is undefined in
+the environment.  Otherwise, value is a string.
+
+This function searches `process-environment' for VARIABLE.  If it is
+not found there, then it continues the search in the environment list
+of the selected frame.
+
+If optional parameter FRAME is non-nil, then this function will ignore
+`process-environment' and will simply look up the variable in that
+frame's environment.  */)
+     (variable, frame)
+     Lisp_Object variable, frame;
 {
   char *value;
   int valuelen;
 
-  CHECK_STRING (var);
-  if (getenv_internal (SDATA (var), SBYTES (var),
-                      &value, &valuelen))
+  CHECK_STRING (variable);
+  if (getenv_internal (SDATA (variable), SBYTES (variable),
+                      &value, &valuelen, frame))
     return make_string (value, valuelen);
   else
     return Qnil;
 }
 
-/* A version of getenv that consults process_environment, easily
-   callable from C.  */
+/* A version of getenv that consults the Lisp environment lists,
+   easily callable from C.  */
 char *
 egetenv (var)
      char *var;
@@ -1502,7 +1590,7 @@ egetenv (var)
   char *value;
   int valuelen;
 
-  if (getenv_internal (var, strlen (var), &value, &valuelen))
+  if (getenv_internal (var, strlen (var), &value, &valuelen, Qnil))
     return value;
   else
     return 0;
@@ -1625,8 +1713,8 @@ init_callproc ()
     {
       char *dir = getenv ("TMPDIR");
       Vtemp_file_name_pattern
-       = Fexpand_file_name (build_string ("emacsXXXXXX"),
-                            build_string (dir));
+       = Fexpand_file_name (build_string ("emacsXXXXXX"),
+                            build_string (dir));
     }
   else
     Vtemp_file_name_pattern = build_string ("/tmp/emacsXXXXXX");
@@ -1642,17 +1730,18 @@ init_callproc ()
 }
 
 void
-set_process_environment ()
+set_initial_environment ()
 {
   register char **envp;
-
-  Vprocess_environment = Qnil;
+  Lisp_Object env = Qnil;
 #ifndef CANNOT_DUMP
   if (initialized)
 #endif
-    for (envp = environ; *envp; envp++)
-      Vprocess_environment = Fcons (build_string (*envp),
-                                   Vprocess_environment);
+    {
+      for (envp = environ; *envp; envp++)
+        env = Fcons (build_string (*envp), env);
+      store_frame_param (SELECTED_FRAME(), Qenvironment, env);
+    }
 }
 
 void
@@ -1711,15 +1800,27 @@ This is used by `call-process-region'.  */);
   /* This variable is initialized in init_callproc.  */
 
   DEFVAR_LISP ("process-environment", &Vprocess_environment,
-              doc: /* List of environment variables for subprocesses to inherit.
+              doc: /* List of overridden environment variables for subprocesses to inherit.
 Each element should be a string of the form ENVVARNAME=VALUE.
+
+Entries in this list take precedence to those in the frame-local
+environments.  Therefore, let-binding `process-environment' is an easy
+way to temporarily change the value of an environment variable,
+irrespective of where it comes from.  To use `process-environment' to
+remove an environment variable, include only its name in the list,
+without "=VALUE".
+
+This variable is set to nil when Emacs starts.
+
 If multiple entries define the same variable, the first one always
 takes precedence.
-The environment which Emacs inherits is placed in this variable
-when Emacs starts.
+
 Non-ASCII characters are encoded according to the initial value of
-`locale-coding-system', i.e. the elements must normally be decoded for use.
+`locale-coding-system', i.e. the elements must normally be decoded for
+use.
+
 See `setenv' and `getenv'.  */);
+  Vprocess_environment = Qnil;
 
 #ifndef VMS
   defsubr (&Scall_process);
index dd25c11..0d49ca4 100644 (file)
--- a/src/cm.c
+++ b/src/cm.c
@@ -23,8 +23,13 @@ Boston, MA 02110-1301, USA.  */
 
 #include <config.h>
 #include <stdio.h>
+
+#include "lisp.h"
+#include "frame.h"
 #include "cm.h"
 #include "termhooks.h"
+#include "termchar.h"
+
 
 /* For now, don't try to include termcap.h.  On some systems,
    configure finds a non-standard termcap.h that the main build
@@ -53,13 +58,16 @@ evalcost (c)
   return c;
 }
 
+/* The terminal to use for low-level output. */
+struct tty_display_info *current_tty;
+
 int
 cmputc (c)
      char c;
 {
-  if (termscript)
-    fputc (c & 0177, termscript);
-  putchar (c & 0177);
+  if (current_tty->termscript)
+    putc (c & 0177, current_tty->termscript);
+  putc (c & 0177, current_tty->output);
   return c;
 }
 
@@ -72,9 +80,9 @@ cmputc (c)
  */
 
 static
-at (row, col) {
-    curY = row;
-    curX = col;
+at (tty, row, col) {
+  curY (tty) = row;
+  curX (tty)  = col;
 }
 
 /*
@@ -82,8 +90,8 @@ at (row, col) {
  */
 
 static
-addcol (n) {
-    curX += n;
+addcol (tty, n) {
+  curX (tty) += n;
 
     /*
      * If cursor hit edge of screen, what happened?
@@ -93,21 +101,21 @@ addcol (n) {
      * of the last line.
      */
 
-    if (curX == Wcm.cm_cols) {
+  if (curX (tty) == tty->Wcm->cm_cols) {
        /*
         * Well, if magicwrap, still there, past the edge of the
         * screen (!).  If autowrap, on the col 0 of the next line.
         * Otherwise on last column.
         */
 
-       if (Wcm.cm_magicwrap)
+       if (tty->Wcm->cm_magicwrap)
            ;                   /* "limbo" */
-       else if (Wcm.cm_autowrap) {
-           curX = 0;
-           curY++;             /* Beware end of screen! */
+       else if (tty->Wcm->cm_autowrap) {
+          curX (tty) = 0;
+          curY (tty) ++;               /* Beware end of screen! */
        }
        else
-           curX--;
+          curX (tty)--;
     }
 }
 #endif
@@ -123,20 +131,20 @@ addcol (n) {
  * after we reach the last column; this takes us to a known state.
  */
 void
-cmcheckmagic ()
+cmcheckmagic (struct tty_display_info *tty)
 {
-  if (curX == FrameCols)
+  if (curX (tty) == FrameCols (tty))
     {
-      if (!MagicWrap || curY >= FrameRows - 1)
+      if (!MagicWrap (tty) || curY (tty) >= FrameRows (tty) - 1)
        abort ();
-      if (termscript)
-       putc ('\r', termscript);
-      putchar ('\r');
-      if (termscript)
-       putc ('\n', termscript);
-      putchar ('\n');
-      curX = 0;
-      curY++;
+      if (tty->termscript)
+       putc ('\r', tty->termscript);
+      putc ('\r', tty->output);
+      if (tty->termscript)
+       putc ('\n', tty->termscript);
+      putc ('\n', tty->output);
+      curX (tty) = 0;
+      curY (tty)++;
     }
 }
 
@@ -148,21 +156,21 @@ cmcheckmagic ()
  */
 
 void
-cmcostinit ()
+cmcostinit (struct tty_display_info *tty)
 {
     char *p;
 
 #define        COST(x,e)       (x ? (cost = 0, tputs (x, 1, e), cost) : BIG)
 #define CMCOST(x,e)    ((x == 0) ? BIG : (p = tgoto(x, 0, 0), COST(p ,e)))
 
-    Wcm.cc_up =                COST (Wcm.cm_up, evalcost);
-    Wcm.cc_down =      COST (Wcm.cm_down, evalcost);
-    Wcm.cc_left =      COST (Wcm.cm_left, evalcost);
-    Wcm.cc_right =     COST (Wcm.cm_right, evalcost);
-    Wcm.cc_home =      COST (Wcm.cm_home, evalcost);
-    Wcm.cc_cr =                COST (Wcm.cm_cr, evalcost);
-    Wcm.cc_ll =                COST (Wcm.cm_ll, evalcost);
-    Wcm.cc_tab =       Wcm.cm_tabwidth ? COST (Wcm.cm_tab, evalcost) : BIG;
+    tty->Wcm->cc_up =   COST (tty->Wcm->cm_up, evalcost);
+    tty->Wcm->cc_down =         COST (tty->Wcm->cm_down, evalcost);
+    tty->Wcm->cc_left =         COST (tty->Wcm->cm_left, evalcost);
+    tty->Wcm->cc_right = COST (tty->Wcm->cm_right, evalcost);
+    tty->Wcm->cc_home =         COST (tty->Wcm->cm_home, evalcost);
+    tty->Wcm->cc_cr =   COST (tty->Wcm->cm_cr, evalcost);
+    tty->Wcm->cc_ll =   COST (tty->Wcm->cm_ll, evalcost);
+    tty->Wcm->cc_tab =  tty->Wcm->cm_tabwidth ? COST (tty->Wcm->cm_tab, evalcost) : BIG;
 
     /*
      * These last three are actually minimum costs.  When (if) they are
@@ -173,9 +181,9 @@ cmcostinit ()
      * cursor motion seem to take straight numeric values.  --ACT)
      */
 
-    Wcm.cc_abs =  CMCOST (Wcm.cm_abs, evalcost);
-    Wcm.cc_habs = CMCOST (Wcm.cm_habs, evalcost);
-    Wcm.cc_vabs = CMCOST (Wcm.cm_vabs, evalcost);
+    tty->Wcm->cc_abs =  CMCOST (tty->Wcm->cm_abs, evalcost);
+    tty->Wcm->cc_habs = CMCOST (tty->Wcm->cm_habs, evalcost);
+    tty->Wcm->cc_vabs = CMCOST (tty->Wcm->cm_vabs, evalcost);
 
 #undef CMCOST
 #undef COST
@@ -188,8 +196,8 @@ cmcostinit ()
  */
 
 static int
-calccost (srcy, srcx, dsty, dstx, doit)
-     int srcy, srcx, dsty, dstx, doit;
+calccost (struct tty_display_info *tty,
+          int srcy, int srcx, int dsty, int dstx, int doit)
 {
     register int    deltay,
                     deltax,
@@ -206,16 +214,16 @@ calccost (srcy, srcx, dsty, dstx, doit)
        don't believe the cursor position: give up here
        and force use of absolute positioning.  */
 
-    if (curX == Wcm.cm_cols)
+    if (curX (tty) == tty->Wcm->cm_cols)
       goto fail;
 
     totalcost = 0;
     if ((deltay = dsty - srcy) == 0)
        goto x;
     if (deltay < 0)
-       p = Wcm.cm_up, c = Wcm.cc_up, deltay = -deltay;
+       p = tty->Wcm->cm_up, c = tty->Wcm->cc_up, deltay = -deltay;
     else
-       p = Wcm.cm_down, c = Wcm.cc_down;
+       p = tty->Wcm->cm_down, c = tty->Wcm->cc_down;
     if (c == BIG) {            /* caint get thar from here */
        if (doit)
            printf ("OOPS");
@@ -224,16 +232,16 @@ calccost (srcy, srcx, dsty, dstx, doit)
     totalcost = c * deltay;
     if (doit)
        while (--deltay >= 0)
-           tputs (p, 1, cmputc);
+          emacs_tputs (tty, p, 1, cmputc);
 x:
     if ((deltax = dstx - srcx) == 0)
        goto done;
     if (deltax < 0) {
-       p = Wcm.cm_left, c = Wcm.cc_left, deltax = -deltax;
+       p = tty->Wcm->cm_left, c = tty->Wcm->cc_left, deltax = -deltax;
        goto dodelta;           /* skip all the tab junk */
     }
     /* Tabs (the toughie) */
-    if (Wcm.cc_tab >= BIG || !Wcm.cm_usetabs)
+    if (tty->Wcm->cc_tab >= BIG || !tty->Wcm->cm_usetabs)
        goto olddelta;          /* forget it! */
 
     /*
@@ -244,12 +252,12 @@ x:
      * we will put into tabx (for ntabs) and tab2x (for n2tabs)).
      */
 
-    ntabs = (deltax + srcx % Wcm.cm_tabwidth) / Wcm.cm_tabwidth;
+    ntabs = (deltax + srcx % tty->Wcm->cm_tabwidth) / tty->Wcm->cm_tabwidth;
     n2tabs = ntabs + 1;
-    tabx = (srcx / Wcm.cm_tabwidth + ntabs) * Wcm.cm_tabwidth;
-    tab2x = tabx + Wcm.cm_tabwidth;
+    tabx = (srcx / tty->Wcm->cm_tabwidth + ntabs) * tty->Wcm->cm_tabwidth;
+    tab2x = tabx + tty->Wcm->cm_tabwidth;
 
-    if (tab2x >= Wcm.cm_cols)  /* too far (past edge) */
+    if (tab2x >= tty->Wcm->cm_cols)    /* too far (past edge) */
        n2tabs = 0;
 
     /*
@@ -257,12 +265,12 @@ x:
      * for using n2tabs, then pick the minimum.
      */
 
-                  /* cost for ntabs     +    cost for right motion */
-    tabcost = ntabs ? ntabs * Wcm.cc_tab + (dstx - tabx) * Wcm.cc_right
+                  /* cost for ntabs           +    cost for right motion */
+    tabcost = ntabs ? ntabs * tty->Wcm->cc_tab + (dstx - tabx) * tty->Wcm->cc_right
                    : BIG;
 
-                  /* cost for n2tabs    +    cost for left motion */
-    c = n2tabs  ?    n2tabs * Wcm.cc_tab + (tab2x - dstx) * Wcm.cc_left
+                  /* cost for n2tabs          +    cost for left motion */
+    c = n2tabs  ?    n2tabs * tty->Wcm->cc_tab + (tab2x - dstx) * tty->Wcm->cc_left
                : BIG;
 
     if (c < tabcost)           /* then cheaper to overshoot & back up */
@@ -275,11 +283,11 @@ x:
      * See if tabcost is less than just moving right
      */
 
-    if (tabcost < (deltax * Wcm.cc_right)) {
+    if (tabcost < (deltax * tty->Wcm->cc_right)) {
        totalcost += tabcost;   /* use the tabs */
        if (doit)
            while (--ntabs >= 0)
-               tputs (Wcm.cm_tab, 1, cmputc);
+              emacs_tputs (tty, tty->Wcm->cm_tab, 1, cmputc);
        srcx = tabx;
     }
 
@@ -292,9 +300,9 @@ newdelta:
        goto done;
 olddelta:
     if (deltax > 0)
-       p = Wcm.cm_right, c = Wcm.cc_right;
+       p = tty->Wcm->cm_right, c = tty->Wcm->cc_right;
     else
-       p = Wcm.cm_left, c = Wcm.cc_left, deltax = -deltax;
+       p = tty->Wcm->cm_left, c = tty->Wcm->cc_left, deltax = -deltax;
 
 dodelta:
     if (c == BIG) {            /* caint get thar from here */
@@ -306,7 +314,7 @@ fail:
     totalcost += c * deltax;
     if (doit)
        while (--deltax >= 0)
-           tputs (p, 1, cmputc);
+          emacs_tputs (tty, p, 1, cmputc);
 done:
     return totalcost;
 }
@@ -324,7 +332,8 @@ losecursor ()
 #define        USECR   3
 
 void
-cmgoto (row, col)
+cmgoto (tty, row, col)
+     struct tty_display_info *tty;
      int row, col;
 {
     int     homecost,
@@ -337,47 +346,47 @@ cmgoto (row, col)
            *dcm;
 
   /* First the degenerate case */
-  if (row == curY && col == curX) /* already there */
+    if (row == curY (tty) && col == curX (tty)) /* already there */
     return;
 
-  if (curY >= 0 && curX >= 0)
+    if (curY (tty) >= 0 && curX (tty) >= 0)
     {
       /* We may have quick ways to go to the upper-left, bottom-left,
        * start-of-line, or start-of-next-line.  Or it might be best to
        * start where we are.  Examine the options, and pick the cheapest.
        */
 
-      relcost = calccost (curY, curX, row, col, 0);
+      relcost = calccost (tty, curY (tty), curX (tty), row, col, 0);
       use = USEREL;
-      if ((homecost = Wcm.cc_home) < BIG)
-         homecost += calccost (0, 0, row, col, 0);
+      if ((homecost = tty->Wcm->cc_home) < BIG)
+          homecost += calccost (tty, 0, 0, row, col, 0);
       if (homecost < relcost)
-         relcost = homecost, use = USEHOME;
-      if ((llcost = Wcm.cc_ll) < BIG)
-         llcost += calccost (Wcm.cm_rows - 1, 0, row, col, 0);
+          relcost = homecost, use = USEHOME;
+      if ((llcost = tty->Wcm->cc_ll) < BIG)
+          llcost += calccost (tty, tty->Wcm->cm_rows - 1, 0, row, col, 0);
       if (llcost < relcost)
-         relcost = llcost, use = USELL;
-      if ((crcost = Wcm.cc_cr) < BIG) {
-         if (Wcm.cm_autolf)
-             if (curY + 1 >= Wcm.cm_rows)
-                 crcost = BIG;
+          relcost = llcost, use = USELL;
+      if ((crcost = tty->Wcm->cc_cr) < BIG) {
+         if (tty->Wcm->cm_autolf)
+            if (curY (tty) + 1 >= tty->Wcm->cm_rows)
+                crcost = BIG;
              else
-                 crcost += calccost (curY + 1, 0, row, col, 0);
+                crcost += calccost (tty, curY (tty) + 1, 0, row, col, 0);
          else
-             crcost += calccost (curY, 0, row, col, 0);
+            crcost += calccost (tty, curY (tty), 0, row, col, 0);
       }
       if (crcost < relcost)
          relcost = crcost, use = USECR;
-      directcost = Wcm.cc_abs, dcm = Wcm.cm_abs;
-      if (row == curY && Wcm.cc_habs < BIG)
-         directcost = Wcm.cc_habs, dcm = Wcm.cm_habs;
-      else if (col == curX && Wcm.cc_vabs < BIG)
-         directcost = Wcm.cc_vabs, dcm = Wcm.cm_vabs;
+      directcost = tty->Wcm->cc_abs, dcm = tty->Wcm->cm_abs;
+      if (row == curY (tty) && tty->Wcm->cc_habs < BIG)
+         directcost = tty->Wcm->cc_habs, dcm = tty->Wcm->cm_habs;
+      else if (col == curX (tty) && tty->Wcm->cc_vabs < BIG)
+         directcost = tty->Wcm->cc_vabs, dcm = tty->Wcm->cm_vabs;
     }
   else
     {
       directcost = 0, relcost = 100000;
-      dcm = Wcm.cm_abs;
+      dcm = tty->Wcm->cm_abs;
     }
 
   /*
@@ -388,13 +397,14 @@ cmgoto (row, col)
     {
       /* compute REAL direct cost */
       cost = 0;
-      p = dcm == Wcm.cm_habs ? tgoto (dcm, row, col) :
-                              tgoto (dcm, col, row);
-      tputs (p, 1, evalcost);
+      p = (dcm == tty->Wcm->cm_habs
+           ? tgoto (dcm, row, col)
+           : tgoto (dcm, col, row));
+      emacs_tputs (tty, p, 1, evalcost);
       if (cost <= relcost)
        {       /* really is cheaper */
-         tputs (p, 1, cmputc);
-         curY = row, curX = col;
+         emacs_tputs (tty, p, 1, cmputc);
+         curY (tty) = row, curX (tty) = col;
          return;
        }
     }
@@ -402,25 +412,25 @@ cmgoto (row, col)
   switch (use)
     {
     case USEHOME:
-      tputs (Wcm.cm_home, 1, cmputc);
-      curY = 0, curX = 0;
+      emacs_tputs (tty, tty->Wcm->cm_home, 1, cmputc);
+      curY (tty) = 0, curX (tty) = 0;
       break;
 
     case USELL:
-      tputs (Wcm.cm_ll, 1, cmputc);
-      curY = Wcm.cm_rows - 1, curX = 0;
+      emacs_tputs (tty, tty->Wcm->cm_ll, 1, cmputc);
+      curY (tty) = tty->Wcm->cm_rows - 1, curX (tty) = 0;
       break;
 
     case USECR:
-      tputs (Wcm.cm_cr, 1, cmputc);
-      if (Wcm.cm_autolf)
-       curY++;
-      curX = 0;
+      emacs_tputs (tty, tty->Wcm->cm_cr, 1, cmputc);
+      if (tty->Wcm->cm_autolf)
+       curY (tty)++;
+      curX (tty) = 0;
       break;
     }
 
-  (void) calccost (curY, curX, row, col, 1);
-  curY = row, curX = col;
+  (void) calccost (tty, curY (tty), curX (tty), row, col, 1);
+  curY (tty) = row, curX (tty) = col;
 }
 
 /* Clear out all terminal info.
@@ -428,9 +438,9 @@ cmgoto (row, col)
  */
 
 void
-Wcm_clear ()
+Wcm_clear (struct tty_display_info *tty)
 {
-  bzero (&Wcm, sizeof Wcm);
+  bzero (tty->Wcm, sizeof (struct cm));
   UP = 0;
   BC = 0;
 }
@@ -443,21 +453,21 @@ Wcm_clear ()
  */
 
 int
-Wcm_init ()
+Wcm_init (struct tty_display_info *tty)
 {
 #if 0
-  if (Wcm.cm_abs && !Wcm.cm_ds)
+  if (tty->Wcm->cm_abs && !tty->Wcm->cm_ds)
     return 0;
 #endif
-  if (Wcm.cm_abs)
+  if (tty->Wcm->cm_abs)
     return 0;
   /* Require up and left, and, if no absolute, down and right */
-  if (!Wcm.cm_up || !Wcm.cm_left)
+  if (!tty->Wcm->cm_up || !tty->Wcm->cm_left)
     return - 1;
-  if (!Wcm.cm_abs && (!Wcm.cm_down || !Wcm.cm_right))
+  if (!tty->Wcm->cm_abs && (!tty->Wcm->cm_down || !tty->Wcm->cm_right))
     return - 1;
   /* Check that we know the size of the screen.... */
-  if (Wcm.cm_rows <= 0 || Wcm.cm_cols <= 0)
+  if (tty->Wcm->cm_rows <= 0 || tty->Wcm->cm_cols <= 0)
     return - 2;
   return 0;
 }
index c94c0d4..b0d7f2c 100644 (file)
--- a/src/cm.h
+++ b/src/cm.h
@@ -99,76 +99,78 @@ struct cm
     int cc_vabs;
   };
 
-extern struct cm Wcm;          /* Terminal capabilities */
 extern char PC;                        /* Pad character */
 
 /* Shorthand */
 #ifndef NoCMShortHand
-#define curY           Wcm.cm_curY
-#define curX           Wcm.cm_curX
-#define Up             Wcm.cm_up
-#define Down           Wcm.cm_down
-#define Left           Wcm.cm_left
-#define Right          Wcm.cm_right
-#define Tab            Wcm.cm_tab
-#define BackTab                Wcm.cm_backtab
-#define TabWidth       Wcm.cm_tabwidth
-#define CR             Wcm.cm_cr
-#define Home           Wcm.cm_home
-#define LastLine       Wcm.cm_ll
-#define AbsPosition    Wcm.cm_abs
-#define ColPosition    Wcm.cm_habs
-#define RowPosition    Wcm.cm_vabs
-#define MultiUp                Wcm.cm_multiup
-#define MultiDown      Wcm.cm_multidown
-#define MultiLeft      Wcm.cm_multileft
-#define MultiRight     Wcm.cm_multiright
-#define AutoWrap       Wcm.cm_autowrap
-#define MagicWrap      Wcm.cm_magicwrap
-#define UseTabs                Wcm.cm_usetabs
-#define FrameRows      Wcm.cm_rows
-#define FrameCols      Wcm.cm_cols
-
-#define UpCost         Wcm.cc_up
-#define DownCost       Wcm.cc_down
-#define LeftCost       Wcm.cc_left
-#define RightCost      Wcm.cc_right
-#define HomeCost       Wcm.cc_home
-#define CRCost         Wcm.cc_cr
-#define LastLineCost   Wcm.cc_ll
-#define TabCost                Wcm.cc_tab
-#define BackTabCost    Wcm.cc_backtab
-#define AbsPositionCost        Wcm.cc_abs
-#define ColPositionCost        Wcm.cc_habs
-#define RowPositionCost        Wcm.cc_vabs
-#define MultiUpCost    Wcm.cc_multiup
-#define MultiDownCost  Wcm.cc_multidown
-#define MultiLeftCost  Wcm.cc_multileft
-#define MultiRightCost Wcm.cc_multiright
+#define curY(tty)              (tty)->Wcm->cm_curY
+#define curX(tty)              (tty)->Wcm->cm_curX
+#define Up(tty)                        (tty)->Wcm->cm_up
+#define Down(tty)              (tty)->Wcm->cm_down
+#define Left(tty)              (tty)->Wcm->cm_left
+#define Right(tty)             (tty)->Wcm->cm_right
+#define Tab(tty)               (tty)->Wcm->cm_tab
+#define BackTab(tty)           (tty)->Wcm->cm_backtab
+#define TabWidth(tty)          (tty)->Wcm->cm_tabwidth
+#define CR(tty)                        (tty)->Wcm->cm_cr
+#define Home(tty)              (tty)->Wcm->cm_home
+#define LastLine(tty)          (tty)->Wcm->cm_ll
+#define AbsPosition(tty)       (tty)->Wcm->cm_abs
+#define ColPosition(tty)       (tty)->Wcm->cm_habs
+#define RowPosition(tty)       (tty)->Wcm->cm_vabs
+#define MultiUp(tty)           (tty)->Wcm->cm_multiup
+#define MultiDown(tty)         (tty)->Wcm->cm_multidown
+#define MultiLeft(tty)         (tty)->Wcm->cm_multileft
+#define MultiRight(tty)                (tty)->Wcm->cm_multiright
+#define AutoWrap(tty)          (tty)->Wcm->cm_autowrap
+#define MagicWrap(tty)         (tty)->Wcm->cm_magicwrap
+#define UseTabs(tty)           (tty)->Wcm->cm_usetabs
+#define FrameRows(tty)         (tty)->Wcm->cm_rows
+#define FrameCols(tty)         (tty)->Wcm->cm_cols
+
+#define UpCost(tty)            (tty)->Wcm->cc_up
+#define DownCost(tty)          (tty)->Wcm->cc_down
+#define LeftCost(tty)          (tty)->Wcm->cc_left
+#define RightCost(tty)         (tty)->Wcm->cc_right
+#define HomeCost(tty)          (tty)->Wcm->cc_home
+#define CRCost(tty)            (tty)->Wcm->cc_cr
+#define LastLineCost(tty)      (tty)->Wcm->cc_ll
+#define TabCost(tty)           (tty)->Wcm->cc_tab
+#define BackTabCost(tty)       (tty)->Wcm->cc_backtab
+#define AbsPositionCost(tty)   (tty)->Wcm->cc_abs
+#define ColPositionCost(tty)   (tty)->Wcm->cc_habs
+#define RowPositionCost(tty)   (tty)->Wcm->cc_vabs
+#define MultiUpCost(tty)       (tty)->Wcm->cc_multiup
+#define MultiDownCost(tty)     (tty)->Wcm->cc_multidown
+#define MultiLeftCost(tty)     (tty)->Wcm->cc_multileft
+#define MultiRightCost(tty)    (tty)->Wcm->cc_multiright
 #endif
 
-#define cmat(row,col)  (curY = (row), curX = (col))
-#define cmplus(n)                                      \
-  {                                                    \
-    if ((curX += (n)) >= FrameCols && !MagicWrap)      \
-      {                                                        \
-       if (Wcm.cm_losewrap) losecursor ();             \
-       else if (AutoWrap) curX = 0, curY++;            \
-       else curX--;                                    \
-      }                                                        \
+#define cmat(tty,row,col)      (curY(tty) = (row), curX(tty) = (col))
+#define cmplus(tty,n)                                              \
+  {                                                                 \
+    if ((curX (tty) += (n)) >= FrameCols (tty) && !MagicWrap (tty)) \
+      {                                                             \
+       if ((tty)->Wcm->cm_losewrap) losecursor (tty);              \
+       else if (AutoWrap (tty)) curX (tty) = 0, curY (tty)++;      \
+       else curX (tty)--;                                          \
+      }                                                             \
   }
 
-#define losecursor()   (curX = -1, curY = -1)
+#define losecursor(tty)         (curX(tty) = -1, curY(tty) = -1)
 
 extern int cost;
 extern int evalcost ();
 
-extern void cmcheckmagic ();
-extern int cmputc ();
-extern void cmcostinit ();
-extern void cmgoto ();
-extern void Wcm_clear ();
-extern int Wcm_init ();
+#define emacs_tputs(tty, str, affcnt, putc) (current_tty = (tty), tputs (str, affcnt, putc))
+
+extern struct tty_display_info *current_tty;
+extern void cmcheckmagic P_ ((struct tty_display_info *));
+extern int cmputc P_ ((int));
+extern void cmcostinit P_ ((struct tty_display_info *));
+extern void cmgoto P_ ((struct tty_display_info *, int, int));
+extern void Wcm_clear P_ ((struct tty_display_info *));
+extern int Wcm_init P_ ((struct tty_display_info *));
 
 /* arch-tag: acc1535a-7136-49d6-b22d-9bc85702251b
    (do not change this comment) */
index cf6bab2..53661fc 100644 (file)
@@ -350,6 +350,8 @@ encode_coding_XXX (coding, source, destination, src_bytes, dst_bytes)
 #include "coding.h"
 #include "window.h"
 #include "intervals.h"
+#include "frame.h"
+#include "termhooks.h"
 
 #else  /* not emacs */
 
@@ -435,16 +437,10 @@ int inhibit_iso_escape_detection;
 /* Flag to make buffer-file-coding-system inherit from process-coding.  */
 int inherit_process_coding_system;
 
-/* Coding system to be used to encode text for terminal display.  */
-struct coding_system terminal_coding;
-
 /* Coding system to be used to encode text for terminal display when
    terminal coding system is nil.  */
 struct coding_system safe_terminal_coding;
 
-/* Coding system of what is sent from terminal keyboard.  */
-struct coding_system keyboard_coding;
-
 /* Default coding system to be used to write a file.  */
 struct coding_system default_buffer_file_coding;
 
@@ -7367,21 +7363,23 @@ Return the corresponding character code in Big5.  */)
 }
 \f
 DEFUN ("set-terminal-coding-system-internal", Fset_terminal_coding_system_internal,
-       Sset_terminal_coding_system_internal, 1, 1, 0,
+       Sset_terminal_coding_system_internal, 1, 2, 0,
        doc: /* Internal use only.  */)
-     (coding_system)
+     (coding_system, terminal)
      Lisp_Object coding_system;
+     Lisp_Object terminal;
 {
+  struct coding_system *terminal_coding = TERMINAL_TERMINAL_CODING (get_terminal (terminal, 1));
   CHECK_SYMBOL (coding_system);
-  setup_coding_system (Fcheck_coding_system (coding_system), &terminal_coding);
+  setup_coding_system (Fcheck_coding_system (coding_system), terminal_coding);
   /* We had better not send unsafe characters to terminal.  */
-  terminal_coding.mode |= CODING_MODE_INHIBIT_UNENCODABLE_CHAR;
+  terminal_coding->mode |= CODING_MODE_INHIBIT_UNENCODABLE_CHAR;
   /* Character composition should be disabled.  */
-  terminal_coding.composing = COMPOSITION_DISABLED;
+  terminal_coding->composing = COMPOSITION_DISABLED;
   /* Error notification should be suppressed.  */
-  terminal_coding.suppress_error = 1;
-  terminal_coding.src_multibyte = 1;
-  terminal_coding.dst_multibyte = 0;
+  terminal_coding->suppress_error = 1;
+  terminal_coding->src_multibyte = 1;
+  terminal_coding->dst_multibyte = 0;
   return Qnil;
 }
 
@@ -7404,32 +7402,42 @@ DEFUN ("set-safe-terminal-coding-system-internal", Fset_safe_terminal_coding_sys
 }
 
 DEFUN ("terminal-coding-system", Fterminal_coding_system,
-       Sterminal_coding_system, 0, 0, 0,
-       doc: /* Return coding system specified for terminal output.  */)
-     ()
+       Sterminal_coding_system, 0, 1, 0,
+       doc: /* Return coding system specified for terminal output on the given terminal.
+TERMINAL may be a terminal id, a frame, or nil for the selected
+frame's terminal device.  */)
+     (terminal)
+     Lisp_Object terminal;
 {
-  return terminal_coding.symbol;
+  return TERMINAL_TERMINAL_CODING (get_terminal (terminal, 1))->symbol;
 }
 
 DEFUN ("set-keyboard-coding-system-internal", Fset_keyboard_coding_system_internal,
-       Sset_keyboard_coding_system_internal, 1, 1, 0,
+       Sset_keyboard_coding_system_internal, 1, 2, 0,
        doc: /* Internal use only.  */)
-     (coding_system)
+     (coding_system, terminal)
      Lisp_Object coding_system;
+     Lisp_Object terminal;
 {
+  struct terminal *t = get_terminal (terminal, 1);
   CHECK_SYMBOL (coding_system);
-  setup_coding_system (Fcheck_coding_system (coding_system), &keyboard_coding);
+
+  setup_coding_system (Fcheck_coding_system (coding_system),
+                       TERMINAL_KEYBOARD_CODING (t));
   /* Character composition should be disabled.  */
-  keyboard_coding.composing = COMPOSITION_DISABLED;
+  TERMINAL_KEYBOARD_CODING (t)->composing = COMPOSITION_DISABLED;
   return Qnil;
 }
 
 DEFUN ("keyboard-coding-system", Fkeyboard_coding_system,
-       Skeyboard_coding_system, 0, 0, 0,
-       doc: /* Return coding system specified for decoding keyboard input.  */)
-     ()
+       Skeyboard_coding_system, 0, 1, 0,
+       doc: /* Return coding system for decoding keyboard input on TERMINAL.
+TERMINAL may be a terminal id, a frame, or nil for the selected
+frame's terminal device.  */)
+     (terminal)
+     Lisp_Object terminal;
 {
-  return keyboard_coding.symbol;
+  return TERMINAL_KEYBOARD_CODING (get_terminal (terminal, 1))->symbol;
 }
 
 \f
@@ -7692,8 +7700,6 @@ init_coding_once ()
   iso_code_class[ISO_CODE_SS3] = ISO_single_shift_3;
   iso_code_class[ISO_CODE_CSI] = ISO_control_sequence_introducer;
 
-  setup_coding_system (Qnil, &keyboard_coding);
-  setup_coding_system (Qnil, &terminal_coding);
   setup_coding_system (Qnil, &safe_terminal_coding);
   setup_coding_system (Qnil, &default_buffer_file_coding);
 
index 5727b57..81dcb7f 100644 (file)
@@ -695,20 +695,10 @@ extern Lisp_Object Vlocale_coding_system;
    the subprocess output.  */
 extern int inherit_process_coding_system;
 
-/* Coding-system to be used for encoding terminal output.  This
-   structure contains information of a coding-system specified by the
-   function `set-terminal-coding-system'.  */
-extern struct coding_system terminal_coding;
-
 /* Coding system to be used to encode text for terminal display when
    terminal coding system is nil.  */
 extern struct coding_system safe_terminal_coding;
 
-/* Coding-system of what is sent from terminal keyboard.  This
-   structure contains information of a coding-system specified by the
-   function `set-keyboard-coding-system'.  */
-extern struct coding_system keyboard_coding;
-
 /* Default coding system to be used to write a file.  */
 extern struct coding_system default_buffer_file_coding;
 
index 248515d..2105247 100644 (file)
@@ -913,6 +913,12 @@ Boston, MA 02110-1301, USA.  */
 #define HAVE_MOUSE
 #endif
 
+/* Multi-tty support relies on MULTI_KBOARD.  It seems safe to turn it
+   on unconditionally. */
+#ifndef MULTI_KBOARD
+#define MULTI_KBOARD
+#endif
+
 /* Define USER_FULL_NAME to return a string
    that is the user's full name.
    It can assume that the variable `pw'
index f362b02..cc0f967 100644 (file)
@@ -30,6 +30,7 @@ Boston, MA 02110-1301, USA.  */
 #include "keyboard.h"
 #include "frame.h"
 #include "syssignal.h"
+#include "termhooks.h"  /* For FRAME_KBOARD reference in y-or-n-p. */
 
 #ifdef STDC_HEADERS
 #include <float.h>
@@ -858,7 +859,18 @@ do_symval_forwarding (valcontents)
 
       case Lisp_Misc_Kboard_Objfwd:
        offset = XKBOARD_OBJFWD (valcontents)->offset;
-       return *(Lisp_Object *)(offset + (char *)current_kboard);
+        /* We used to simply use current_kboard here, but from Lisp
+           code, it's value is often unexpected.  It seems nicer to
+           allow constructions like this to work as intuitively expected:
+
+               (with-selected-frame frame
+                   (define-key local-function-map "\eOP" [f1]))
+
+           On the other hand, this affects the semantics of
+           last-command and real-last-command, and people may rely on
+           that.  I took a quick look at the Lisp codebase, and I
+           don't think anything will break.  --lorentey  */
+       return *(Lisp_Object *)(offset + (char *)FRAME_KBOARD (SELECTED_FRAME ()));
       }
   return valcontents;
 }
@@ -946,7 +958,7 @@ store_symval_forwarding (symbol, valcontents, newval, buf)
 
        case Lisp_Misc_Kboard_Objfwd:
          {
-           char *base = (char *) current_kboard;
+           char *base = (char *) FRAME_KBOARD (SELECTED_FRAME ());
            char *p = base + XKBOARD_OBJFWD (valcontents)->offset;
            *(Lisp_Object *) p = newval;
          }
@@ -1092,7 +1104,7 @@ find_symbol_value (symbol)
 
        case Lisp_Misc_Kboard_Objfwd:
          return *(Lisp_Object *)(XKBOARD_OBJFWD (valcontents)->offset
-                                 + (char *)current_kboard);
+                                 + (char *)FRAME_KBOARD (SELECTED_FRAME ()));
        }
     }
 
@@ -1853,6 +1865,51 @@ If the current binding is global (the default), the value is nil.  */)
 
   return Qnil;
 }
+
+/* This code is disabled now that we use the selected frame to return
+   keyboard-local-values. */
+#if 0
+extern struct terminal *get_terminal P_ ((Lisp_Object display, int));
+
+DEFUN ("terminal-local-value", Fterminal_local_value, Sterminal_local_value, 2, 2, 0,
+       doc: /* Return the terminal-local value of SYMBOL on TERMINAL.
+If SYMBOL is not a terminal-local variable, then return its normal
+value, like `symbol-value'.
+
+TERMINAL may be a terminal id, a frame, or nil (meaning the
+selected frame's terminal device).  */)
+  (symbol, terminal)
+     Lisp_Object symbol;
+     Lisp_Object terminal;
+{
+  Lisp_Object result;
+  struct terminal *t = get_terminal (terminal, 1);
+  push_kboard (t->kboard);
+  result = Fsymbol_value (symbol);
+  pop_kboard ();
+  return result;
+}
+
+DEFUN ("set-terminal-local-value", Fset_terminal_local_value, Sset_terminal_local_value, 3, 3, 0,
+       doc: /* Set the terminal-local binding of SYMBOL on TERMINAL to VALUE.
+If VARIABLE is not a terminal-local variable, then set its normal
+binding, like `set'.
+
+TERMINAL may be a terminal id, a frame, or nil (meaning the
+selected frame's terminal device).  */)
+  (symbol, terminal, value)
+     Lisp_Object symbol;
+     Lisp_Object terminal;
+     Lisp_Object value;
+{
+  Lisp_Object result;
+  struct terminal *t = get_terminal (terminal, 1);
+  push_kboard (d->kboard);
+  result = Fset (symbol, value);
+  pop_kboard ();
+  return result;
+}
+#endif
 \f
 /* Find the function at the end of a chain of symbol function indirections.  */
 
@@ -3310,6 +3367,10 @@ syms_of_data ()
   defsubr (&Slocal_variable_p);
   defsubr (&Slocal_variable_if_set_p);
   defsubr (&Svariable_binding_locus);
+#if 0                           /* XXX Remove this. --lorentey */
+  defsubr (&Sterminal_local_value);
+  defsubr (&Sset_terminal_local_value);
+#endif
   defsubr (&Saref);
   defsubr (&Saset);
   defsubr (&Snumber_to_string);
index 45a460b..1198838 100644 (file)
@@ -1029,13 +1029,8 @@ extern int fonts_changed_p;
 
 extern struct glyph space_glyph;
 
-/* Frame being updated by update_window/update_frame.  */
-
-extern struct frame *updating_frame;
-
 /* Window being updated by update_window.  This is non-null as long as
-   update_window has not finished, and null otherwise.  It's role is
-   analogous to updating_frame.  */
+   update_window has not finished, and null otherwise.  */
 
 extern struct window *updated_window;
 
@@ -1355,7 +1350,7 @@ struct glyph_string
        DESCENT = FONT->descent
        HEIGHT = FONT_HEIGHT (FONT)
        F_DESCENT = (FRAME_FONT (F)->descent
-                    - F->output_data.x->baseline_offset)
+                    - F->terminal->output_data.x->baseline_offset)
        F_HEIGHT = FRAME_LINE_HEIGHT (F)
 */
 
@@ -2184,16 +2179,16 @@ struct it
 /* Call produce_glyphs or produce_glyphs_hook, if set.  Shortcut to
    avoid the function call overhead.  */
 
-#define PRODUCE_GLYPHS(IT)                     \
-     do {                                      \
-       extern int inhibit_free_realized_faces; \
-       if (rif != NULL)                                \
-        rif->produce_glyphs ((IT));            \
-       else                                    \
-        produce_glyphs ((IT));                 \
-       if ((IT)->glyph_row != NULL)            \
-        inhibit_free_realized_faces = 1;       \
-     } while (0)
+#define PRODUCE_GLYPHS(IT)                              \
+  do {                                                  \
+    extern int inhibit_free_realized_faces;             \
+    if (FRAME_RIF ((IT)->f) != NULL)                    \
+      FRAME_RIF ((IT)->f)->produce_glyphs ((IT));       \
+    else                                                \
+      produce_glyphs ((IT));                            \
+    if ((IT)->glyph_row != NULL)                        \
+      inhibit_free_realized_faces = 1;                  \
+  } while (0)
 
 /* Bit-flags indicating what operation move_it_to should perform.  */
 
@@ -2367,10 +2362,6 @@ struct redisplay_interface
 #endif /* HAVE_WINDOW_SYSTEM */
 };
 
-/* The current interface for window-based redisplay.  */
-
-extern struct redisplay_interface *rif;
-
 \f
 /***********************************************************************
                                Images
@@ -2667,8 +2658,6 @@ void init_iterator_to_row_start P_ ((struct it *, struct window *,
                                     struct glyph_row *));
 int get_next_display_element P_ ((struct it *));
 void set_iterator_to_next P_ ((struct it *, int));
-void produce_glyphs P_ ((struct it *));
-void produce_special_glyphs P_ ((struct it *, enum display_element_type));
 void start_display P_ ((struct it *, struct window *, struct text_pos));
 void move_it_to P_ ((struct it *, int, int, int, int, int));
 void move_it_vertically P_ ((struct it *, int));
@@ -2815,11 +2804,11 @@ int image_ascent P_ ((struct image *, struct face *, struct glyph_slice *));
 
 /* Defined in sysdep.c */
 
-void get_frame_size P_ ((int *, int *));
+void get_tty_size P_ ((int, int *, int *));
 void request_sigio P_ ((void));
 void unrequest_sigio P_ ((void));
-int tabs_safe_p P_ ((void));
-void init_baud_rate P_ ((void));
+int tabs_safe_p P_ ((int));
+void init_baud_rate P_ ((int));
 void init_sigio P_ ((int));
 
 /* Defined in xfaces.c */
@@ -2958,8 +2947,6 @@ void clear_glyph_row P_ ((struct glyph_row *));
 void prepare_desired_row P_ ((struct glyph_row *));
 int line_hash_code P_ ((struct glyph_row *));
 void set_window_update_flags P_ ((struct window *, int));
-void write_glyphs P_ ((struct glyph *, int));
-void insert_glyphs P_ ((struct glyph *, int));
 void redraw_frame P_ ((struct frame *));
 void redraw_garbaged_frames P_ ((void));
 int scroll_cost P_ ((struct frame *, int, int, int));
@@ -2976,31 +2963,44 @@ void syms_of_display P_ ((void));
 extern Lisp_Object Qredisplay_dont_pause;
 GLYPH spec_glyph_lookup_face P_ ((struct window *, GLYPH));
 
-/* Defined in term.c */
+/* Defined in terminal.c */
 
-extern void ring_bell P_ ((void));
-extern void set_terminal_modes P_ ((void));
-extern void reset_terminal_modes P_ ((void));
+extern void ring_bell P_ ((struct frame *));
 extern void update_begin P_ ((struct frame *));
 extern void update_end P_ ((struct frame *));
-extern void set_terminal_window P_ ((int));
-extern void set_scroll_region P_ ((int, int));
-extern void turn_off_insert P_ ((void));
-extern void turn_off_highlight P_ ((void));
-extern void background_highlight P_ ((void));
-extern void clear_frame P_ ((void));
-extern void clear_end_of_line P_ ((int));
-extern void clear_end_of_line_raw P_ ((int));
-extern void delete_glyphs P_ ((int));
-extern void ins_del_lines P_ ((int, int));
+extern void set_terminal_window P_ ((struct frame *, int));
+extern void cursor_to P_ ((struct frame *, int, int));
+extern void raw_cursor_to P_ ((struct frame *, int, int));
+extern void clear_to_end P_ ((struct frame *));
+extern void clear_frame P_ ((struct frame *));
+extern void clear_end_of_line P_ ((struct frame *, int));
+extern void write_glyphs P_ ((struct frame *, struct glyph *, int));
+extern void insert_glyphs P_ ((struct frame *, struct glyph *, int));
+extern void delete_glyphs P_ ((struct frame *, int));
+extern void ins_del_lines P_ ((struct frame *, int, int));
+
+extern struct terminal *init_initial_terminal P_ ((void));
+
+
+/* Defined in term.c */
+
+extern void tty_set_terminal_modes P_ ((struct terminal *));
+extern void tty_reset_terminal_modes P_ ((struct terminal *));
+extern void tty_turn_off_insert P_ ((struct tty_display_info *));
+extern void tty_turn_off_highlight P_ ((struct tty_display_info *));
 extern int string_cost P_ ((char *));
 extern int per_line_cost P_ ((char *));
 extern void calculate_costs P_ ((struct frame *));
+extern void produce_glyphs P_ ((struct it *));
+extern void produce_special_glyphs P_ ((struct it *, enum display_element_type));
+extern int tty_capable_p P_ ((struct tty_display_info *, unsigned, unsigned long, unsigned long));
 extern void set_tty_color_mode P_ ((struct frame *, Lisp_Object));
-extern void tty_setup_colors P_ ((int));
-extern void term_init P_ ((char *));
-void cursor_to P_ ((int, int));
-extern int tty_capable_p P_ ((struct frame *, unsigned, unsigned long, unsigned long));
+extern struct terminal *get_tty_terminal P_ ((Lisp_Object, int));
+extern struct terminal *get_named_tty P_ ((char *));
+EXFUN (Ftty_type, 1);
+extern void create_tty_output P_ ((struct frame *));
+extern struct terminal *init_tty P_ ((char *, char *, int));
+
 
 /* Defined in scroll.c */
 
index d2c6368..5ace8ac 100644 (file)
@@ -32,7 +32,6 @@ Boston, MA 02110-1301, USA.  */
 #include "lisp.h"
 #include "termchar.h"
 #include "termopts.h"
-#include "termhooks.h"
 /* cm.h must come after dispextern.h on Windows.  */
 #include "dispextern.h"
 #include "cm.h"
@@ -40,6 +39,7 @@ Boston, MA 02110-1301, USA.  */
 #include "charset.h"
 #include "keyboard.h"
 #include "frame.h"
+#include "termhooks.h"
 #include "window.h"
 #include "commands.h"
 #include "disptab.h"
@@ -237,9 +237,9 @@ int inverse_video;
 EMACS_INT baud_rate;
 
 /* Either nil or a symbol naming the window system under which Emacs
-   is running.  */
+   creates the first frame.  */
 
-Lisp_Object Vwindow_system;
+Lisp_Object Vinitial_window_system;
 
 /* Version number of X windows: 10, 11 or nil.  */
 
@@ -281,14 +281,6 @@ Lisp_Object selected_frame;
 
 struct frame *last_nonminibuf_frame;
 
-/* Stdio stream being used for copy of all output.  */
-
-FILE *termscript;
-
-/* Structure for info on cursor positioning.  */
-
-struct cm Wcm;
-
 /* 1 means SIGWINCH happened when not safe.  */
 
 int delayed_size_change;
@@ -327,11 +319,6 @@ int glyph_pool_count;
 
 static struct frame *frame_matrix_frame;
 
-/* Current interface for window-based redisplay.  Set from init_xterm.
-   A null value means we are not using window-based redisplay.  */
-
-struct redisplay_interface *rif;
-
 /* Non-zero means that fonts have been loaded since the last glyph
    matrix adjustments.  Redisplay must stop, and glyph matrices must
    be adjusted when this flag becomes non-zero during display.  The
@@ -1422,7 +1409,7 @@ line_hash_code (row)
        {
          int c = glyph->u.ch;
          int face_id = glyph->face_id;
-         if (must_write_spaces)
+         if (FRAME_MUST_WRITE_SPACES (SELECTED_FRAME ())) /* XXX Is SELECTED_FRAME OK here? */
            c -= SPACEGLYPH;
          hash = (((hash << 4) + (hash >> 24)) & 0x0fffffff) + c;
          hash = (((hash << 4) + (hash >> 24)) & 0x0fffffff) + face_id;
@@ -1454,7 +1441,7 @@ line_draw_cost (matrix, vpos)
   int glyph_table_len = GLYPH_TABLE_LENGTH;
 
   /* Ignore trailing and leading spaces if we can.  */
-  if (!must_write_spaces)
+  if (!FRAME_MUST_WRITE_SPACES (SELECTED_FRAME ())) /* XXX Is SELECTED_FRAME OK here? */
     {
       /* Skip from the end over trailing spaces.  */
       while (end > beg && CHAR_GLYPH_SPACE_P (*(end - 1)))
@@ -1670,8 +1657,10 @@ realloc_glyph_pool (pool, matrix_dim)
 #if GLYPH_DEBUG
 
 
-/* Flush standard output.  This is sometimes useful to call from
-   the debugger.  */
+/* Flush standard output.  This is sometimes useful to call from the debugger.
+   XXX Maybe this should be changed to flush the current terminal instead of
+   stdout.
+*/
 
 void
 flush_stdout ()
@@ -3360,12 +3349,15 @@ DEFUN ("redraw-frame", Fredraw_frame, Sredraw_frame, 1, 1, 0,
     return Qnil;
 
   update_begin (f);
+#ifdef MSDOS
   if (FRAME_MSDOS_P (f))
-    set_terminal_modes ();
-  clear_frame ();
+    set_terminal_modes (FRAME_TERMINAL (f));
+#endif
+  clear_frame (f);
   clear_current_matrices (f);
   update_end (f);
-  fflush (stdout);
+  if (FRAME_TERMCAP_P (f))
+    fflush (FRAME_TTY (f)->output);
   windows_or_buffers_changed++;
   /* Mark all windows as inaccurate, so that every window will have
      its redisplay done.  */
@@ -3506,7 +3498,7 @@ direct_output_for_insert (g)
 
   /* If we can't insert glyphs, we can use this method only
      at the end of a line.  */
-  if (!char_ins_del_ok)
+  if (!FRAME_CHAR_INS_DEL_OK (f))
     if (PT != ZV && FETCH_BYTE (PT_BYTE) != '\n')
       return 0;
 
@@ -3656,24 +3648,24 @@ direct_output_for_insert (g)
   updated_row = glyph_row;
   updated_area = TEXT_AREA;
   update_begin (f);
-  if (rif)
+  if (FRAME_RIF (f))
     {
-      rif->update_window_begin_hook (w);
+      FRAME_RIF (f)->update_window_begin_hook (w);
 
       if (glyphs == end - n
          /* In front of a space added by append_space.  */
          || (glyphs == end - n - 1
              && (end - n)->charpos <= 0))
-       rif->write_glyphs (glyphs, n);
+       FRAME_RIF (f)->write_glyphs (glyphs, n);
       else
-       rif->insert_glyphs (glyphs, n);
+       FRAME_RIF (f)->insert_glyphs (glyphs, n);
     }
   else
     {
       if (glyphs == end - n)
-       write_glyphs (glyphs, n);
+       write_glyphs (f, glyphs, n);
       else
-       insert_glyphs (glyphs, n);
+       insert_glyphs (f, glyphs, n);
     }
 
   w->cursor.hpos += n;
@@ -3686,8 +3678,8 @@ direct_output_for_insert (g)
      a frame matrix is used, cursor_to expects frame coordinates,
      and the X and Y parameters are not used.  */
   if (window_redisplay_p)
-    rif->cursor_to (w->cursor.vpos, w->cursor.hpos,
-                   w->cursor.y, w->cursor.x);
+    FRAME_RIF (f)->cursor_to (w->cursor.vpos, w->cursor.hpos,
+                              w->cursor.y, w->cursor.x);
   else
     {
       int x, y;
@@ -3696,18 +3688,19 @@ direct_output_for_insert (g)
              ? XFASTINT (w->left_margin_cols)
              : 0));
       y = WINDOW_TO_FRAME_VPOS (w, w->cursor.vpos);
-      cursor_to (y, x);
+      cursor_to (f, y, x);
     }
 
 #ifdef HAVE_WINDOW_SYSTEM
   update_window_fringes (w, 0);
 #endif
 
-  if (rif)
-    rif->update_window_end_hook (w, 1, 0);
+  if (FRAME_RIF (f))
+    FRAME_RIF (f)->update_window_end_hook (w, 1, 0);
   update_end (f);
   updated_row = NULL;
-  fflush (stdout);
+  if (FRAME_TERMCAP_P (f))
+    fflush (FRAME_TTY (f)->output);
 
   TRACE ((stderr, "direct output for insert\n"));
   mark_window_display_accurate (it.window, 1);
@@ -3785,8 +3778,8 @@ direct_output_forward_char (n)
           && w->cursor.hpos < w->desired_matrix->matrix_w);
 
   if (FRAME_WINDOW_P (f))
-    rif->cursor_to (w->cursor.vpos, w->cursor.hpos,
-                   w->cursor.y, w->cursor.x);
+    FRAME_RIF (f)->cursor_to (w->cursor.vpos, w->cursor.hpos,
+                              w->cursor.y, w->cursor.x);
   else
     {
       int x, y;
@@ -3795,10 +3788,11 @@ direct_output_forward_char (n)
              ? XFASTINT (w->left_margin_cols)
              : 0));
       y = WINDOW_TO_FRAME_VPOS (w, w->cursor.vpos);
-      cursor_to (y, x);
+      cursor_to (f, y, x);
     }
 
-  fflush (stdout);
+  if (FRAME_TERMCAP_P (f))
+    fflush (FRAME_TTY (f)->output);
   redisplay_performed_directly_p = 1;
   return 1;
 }
@@ -3893,14 +3887,14 @@ update_frame (f, force_p, inhibit_hairy_id_p)
       update_end (f);
 
       /* This flush is a performance bottleneck under X,
-        and it doesn't seem to be necessary anyway (in general).
+        and it doesn't seem to be necessary anyway (in general).
          It is necessary when resizing the window with the mouse, or
-        at least the fringes are not redrawn in a timely manner.  ++kfs */
+        at least the fringes are not redrawn in a timely manner.  ++kfs */
       if (f->force_flush_display_p)
-       {
-         rif->flush_display (f);
-         f->force_flush_display_p = 0;
-       }
+       {
+         FRAME_RIF (f)->flush_display (f);
+         f->force_flush_display_p = 0;
+       }
     }
   else
     {
@@ -3916,9 +3910,12 @@ update_frame (f, force_p, inhibit_hairy_id_p)
       paused_p = update_frame_1 (f, force_p, inhibit_hairy_id_p);
       update_end (f);
 
-      if (termscript)
-       fflush (termscript);
-      fflush (stdout);
+      if (FRAME_TERMCAP_P (f))
+        {
+          if (FRAME_TTY (f)->termscript)
+            fflush (FRAME_TTY (f)->termscript);
+          fflush (FRAME_TTY (f)->output);
+        }
 
       /* Check window matrices for lost pointers.  */
 #if GLYPH_DEBUG
@@ -4019,7 +4016,8 @@ redraw_overlapped_rows (w, yb)
      int yb;
 {
   int i;
-
+  struct frame *f = XFRAME (WINDOW_FRAME (w));
+  
   /* If rows overlapping others have been changed, the rows being
      overlapped have to be redrawn.  This won't draw lines that have
      already been drawn in update_window_line because overlapped_p in
@@ -4042,10 +4040,12 @@ redraw_overlapped_rows (w, yb)
            {
              updated_row = row;
              updated_area = area;
-             rif->cursor_to (i, 0, row->y, area == TEXT_AREA ? row->x : 0);
+             FRAME_RIF (f)->cursor_to (i, 0, row->y,
+                                        area == TEXT_AREA ? row->x : 0);
              if (row->used[area])
-               rif->write_glyphs (row->glyphs[area], row->used[area]);
-             rif->clear_end_of_line (-1);
+               FRAME_RIF (f)->write_glyphs (row->glyphs[area],
+                                             row->used[area]);
+             FRAME_RIF (f)->clear_end_of_line (-1);
            }
 
          row->overlapped_p = 0;
@@ -4067,7 +4067,8 @@ redraw_overlapping_rows (w, yb)
 {
   int i, bottom_y;
   struct glyph_row *row;
-
+  struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w)));
+  
   for (i = 0; i < w->current_matrix->nrows; ++i)
     {
       row = w->current_matrix->rows + i;
@@ -4158,10 +4159,10 @@ update_window (w, force_p)
 #endif
   extern int input_pending;
   extern Lisp_Object do_mouse_tracking;
+  struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w)));
 #if GLYPH_DEBUG
   /* Check that W's frame doesn't have glyph matrices.  */
   xassert (FRAME_WINDOW_P (XFRAME (WINDOW_FRAME (w))));
-  xassert (updating_frame != NULL);
 #endif
 
   /* Check pending input the first time so that we can quickly return.  */
@@ -4351,6 +4352,7 @@ update_marginal_area (w, area, vpos)
      int area, vpos;
 {
   struct glyph_row *desired_row = MATRIX_ROW (w->desired_matrix, vpos);
+  struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w)));
 
   /* Let functions in xterm.c know what area subsequent X positions
      will be relative to.  */
@@ -4376,6 +4378,7 @@ update_text_area (w, vpos)
 {
   struct glyph_row *current_row = MATRIX_ROW (w->current_matrix, vpos);
   struct glyph_row *desired_row = MATRIX_ROW (w->desired_matrix, vpos);
+  struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w)));
   int changed_p = 0;
 
   /* Let functions in xterm.c know what area subsequent X positions
@@ -4609,6 +4612,7 @@ update_window_line (w, vpos, mouse_face_overwritten_p)
 {
   struct glyph_row *current_row = MATRIX_ROW (w->current_matrix, vpos);
   struct glyph_row *desired_row = MATRIX_ROW (w->desired_matrix, vpos);
+  struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w)));
   int changed_p = 0;
 
   /* Set the row being updated.  This is important to let xterm.c
@@ -4677,6 +4681,7 @@ set_window_cursor_after_update (w)
      struct window *w;
 {
   struct frame *f = XFRAME (w->frame);
+  struct redisplay_interface *rif = FRAME_RIF (f);
   int cx, cy, vpos, hpos;
 
   /* Not intended for frame matrix updates.  */
@@ -4900,6 +4905,7 @@ scrolling_window (w, header_line_p)
   int i, j, first_old, first_new, last_old, last_new;
   int nruns, nbytes, n, run_idx;
   struct row_entry *entry;
+  struct redisplay_interface *rif = FRAME_RIF (XFRAME (WINDOW_FRAME (w)));
 
   /* Skip over rows equal at the start.  */
   for (i = header_line_p ? 1 : 0; i < current_matrix->nrows - 1; ++i)
@@ -5229,7 +5235,7 @@ update_frame_1 (f, force_p, inhibit_id_p)
 #endif
 
   /* If we cannot insert/delete lines, it's no use trying it.  */
-  if (!line_ins_del_ok)
+  if (!FRAME_LINE_INS_DEL_OK (f))
     inhibit_id_p = 1;
 
   /* See if any of the desired lines are enabled; don't compute for
@@ -5257,18 +5263,18 @@ update_frame_1 (f, force_p, inhibit_id_p)
                 Also flush out if likely to have more than 1k buffered
                 otherwise.   I'm told that some telnet connections get
                 really screwed by more than 1k output at once.  */
-             int outq = PENDING_OUTPUT_COUNT (stdout);
+             int outq = PENDING_OUTPUT_COUNT (FRAME_TTY (f)->output);
              if (outq > 900
                  || (outq > 20 && ((i - 1) % preempt_count == 0)))
                {
-                 fflush (stdout);
+                 fflush (FRAME_TTY (f)->output);
                  if (preempt_count == 1)
                    {
 #ifdef EMACS_OUTQSIZE
                      if (EMACS_OUTQSIZE (0, &outq) < 0)
                        /* Probably not a tty.  Ignore the error and reset
                           the outq count.  */
-                       outq = PENDING_OUTPUT_COUNT (stdout);
+                       outq = PENDING_OUTPUT_COUNT (FRAME_TTY (f->output));
 #endif
                      outq *= 10;
                      if (baud_rate <= outq && baud_rate > 0)
@@ -5371,7 +5377,7 @@ update_frame_1 (f, force_p, inhibit_id_p)
                }
            }
 
-         cursor_to (row, col);
+         cursor_to (f, row, col);
        }
       else
        {
@@ -5393,7 +5399,7 @@ update_frame_1 (f, force_p, inhibit_id_p)
                x += XFASTINT (w->left_margin_cols);
 
              /* x = max (min (x, FRAME_TOTAL_COLS (f) - 1), 0); */
-             cursor_to (y, x);
+             cursor_to (f, y, x);
            }
        }
     }
@@ -5462,21 +5468,23 @@ scrolling (frame)
     }
 
   /* If changed lines are few, don't allow preemption, don't scroll.  */
-  if ((!scroll_region_ok && changed_lines < baud_rate / 2400)
+  if ((!FRAME_SCROLL_REGION_OK (frame)
+       && changed_lines < baud_rate / 2400)
       || unchanged_at_bottom == FRAME_LINES (frame))
     return 1;
 
   window_size = (FRAME_LINES (frame) - unchanged_at_top
                 - unchanged_at_bottom);
 
-  if (scroll_region_ok)
+  if (FRAME_SCROLL_REGION_OK (frame))
     free_at_end_vpos -= unchanged_at_bottom;
-  else if (memory_below_frame)
+  else if (FRAME_MEMORY_BELOW_FRAME (frame))
     free_at_end_vpos = -1;
 
   /* If large window, fast terminal and few lines in common between
      current frame and desired frame, don't bother with i/d calc.  */
-  if (!scroll_region_ok && window_size >= 18 && baud_rate > 2400
+  if (!FRAME_SCROLL_REGION_OK (frame)
+      && window_size >= 18 && baud_rate > 2400
       && (window_size >=
          10 * scrolling_max_lines_saved (unchanged_at_top,
                                          FRAME_LINES (frame) - unchanged_at_bottom,
@@ -5556,7 +5564,7 @@ update_frame_line (f, vpos)
   struct glyph_row *current_row = MATRIX_ROW (current_matrix, vpos);
   struct glyph_row *desired_row = MATRIX_ROW (desired_matrix, vpos);
   int must_write_whole_line_p;
-  int write_spaces_p = must_write_spaces;
+  int write_spaces_p = FRAME_MUST_WRITE_SPACES (f);
   int colored_spaces_p = (FACE_FROM_ID (f, DEFAULT_FACE_ID)->background
                          != FACE_TTY_DEFAULT_BG_COLOR);
 
@@ -5607,8 +5615,8 @@ update_frame_line (f, vpos)
       /* Write the contents of the desired line.  */
       if (nlen)
        {
-          cursor_to (vpos, 0);
-         write_glyphs (nbody, nlen);
+          cursor_to (f, vpos, 0);
+         write_glyphs (f, nbody, nlen);
        }
 
       /* Don't call clear_end_of_line if we already wrote the whole
@@ -5616,13 +5624,13 @@ update_frame_line (f, vpos)
         case but in the line below.  */
       if (nlen < FRAME_TOTAL_COLS (f))
        {
-         cursor_to (vpos, nlen);
-          clear_end_of_line (FRAME_TOTAL_COLS (f));
+         cursor_to (f, vpos, nlen);
+          clear_end_of_line (f, FRAME_TOTAL_COLS (f));
        }
       else
        /* Make sure we are in the right row, otherwise cursor movement
           with cmgoto might use `ch' in the wrong row.  */
-       cursor_to (vpos, 0);
+       cursor_to (f, vpos, 0);
 
       make_current (desired_matrix, current_matrix, vpos);
       return;
@@ -5635,7 +5643,7 @@ update_frame_line (f, vpos)
       nlen--;
 
   /* If there's no i/d char, quickly do the best we can without it.  */
-  if (!char_ins_del_ok)
+  if (!FRAME_CHAR_INS_DEL_OK (f))
     {
       int i, j;
 
@@ -5654,8 +5662,8 @@ update_frame_line (f, vpos)
                ++j;
 
              /* Output this run of non-matching chars.  */
-             cursor_to (vpos, i);
-             write_glyphs (nbody + i, j - i);
+             cursor_to (f, vpos, i);
+             write_glyphs (f, nbody + i, j - i);
              i = j - 1;
 
              /* Now find the next non-match.  */
@@ -5665,8 +5673,8 @@ update_frame_line (f, vpos)
       /* Clear the rest of the line, or the non-clear part of it.  */
       if (olen > nlen)
        {
-         cursor_to (vpos, nlen);
-         clear_end_of_line (olen);
+         cursor_to (f, vpos, nlen);
+         clear_end_of_line (f, olen);
        }
 
       /* Make current row = desired row.  */
@@ -5688,8 +5696,8 @@ update_frame_line (f, vpos)
 
       if (nlen > nsp)
        {
-         cursor_to (vpos, nsp);
-         write_glyphs (nbody + nsp, nlen - nsp);
+         cursor_to (f, vpos, nsp);
+         write_glyphs (f, nbody + nsp, nlen - nsp);
        }
 
       /* Exchange contents between current_frame and new_frame.  */
@@ -5738,7 +5746,8 @@ update_frame_line (f, vpos)
 
   tem = (nlen - nsp) - (olen - osp);
   if (endmatch && tem
-      && (!char_ins_del_ok || endmatch <= char_ins_del_cost (f)[tem]))
+      && (!FRAME_CHAR_INS_DEL_OK (f)
+          || endmatch <= char_ins_del_cost (f)[tem]))
     endmatch = 0;
 
   /* nsp - osp is the distance to insert or delete.
@@ -5747,7 +5756,7 @@ update_frame_line (f, vpos)
      Is it worth it?  */
 
   if (nsp != osp
-      && (!char_ins_del_ok
+      && (!FRAME_CHAR_INS_DEL_OK (f)
          || begmatch + endmatch <= char_ins_del_cost (f)[nsp - osp]))
     {
       begmatch = 0;
@@ -5760,8 +5769,8 @@ update_frame_line (f, vpos)
 
   if (osp > nsp)
     {
-      cursor_to (vpos, nsp);
-      delete_glyphs (osp - nsp);
+      cursor_to (f, vpos, nsp);
+      delete_glyphs (f, osp - nsp);
     }
   else if (nsp > osp)
     {
@@ -5770,12 +5779,12 @@ update_frame_line (f, vpos)
         must delete first to avoid losing data in the insert */
       if (endmatch && nlen < olen + nsp - osp)
        {
-         cursor_to (vpos, nlen - endmatch + osp - nsp);
-         delete_glyphs (olen + nsp - osp - nlen);
+         cursor_to (f, vpos, nlen - endmatch + osp - nsp);
+         delete_glyphs (f, olen + nsp - osp - nlen);
          olen = nlen - (nsp - osp);
        }
-      cursor_to (vpos, osp);
-      insert_glyphs (0, nsp - osp);
+      cursor_to (f, vpos, osp);
+      insert_glyphs (f, 0, nsp - osp);
     }
   olen += nsp - osp;
 
@@ -5796,8 +5805,8 @@ update_frame_line (f, vpos)
             unnecessary cursor movement.  */
          if (nlen - tem > 0)
            {
-             cursor_to (vpos, nsp + begmatch);
-             write_glyphs (nbody + nsp + begmatch, nlen - tem);
+             cursor_to (f, vpos, nsp + begmatch);
+             write_glyphs (f, nbody + nsp + begmatch, nlen - tem);
            }
        }
       else if (nlen > olen)
@@ -5812,27 +5821,27 @@ update_frame_line (f, vpos)
          int out = olen - tem; /* Columns to be overwritten originally.  */
          int del;
 
-         cursor_to (vpos, nsp + begmatch);
+         cursor_to (f, vpos, nsp + begmatch);
 
          /* Calculate columns we can actually overwrite.  */
          while (CHAR_GLYPH_PADDING_P (nbody[nsp + begmatch + out]))
            out--;
-         write_glyphs (nbody + nsp + begmatch, out);
+         write_glyphs (f, nbody + nsp + begmatch, out);
 
          /* If we left columns to be overwritten, we must delete them.  */
          del = olen - tem - out;
          if (del > 0)
-           delete_glyphs (del);
+           delete_glyphs (f, del);
 
          /* At last, we insert columns not yet written out.  */
-         insert_glyphs (nbody + nsp + begmatch + out, nlen - olen + del);
+         insert_glyphs (f, nbody + nsp + begmatch + out, nlen - olen + del);
          olen = nlen;
        }
       else if (olen > nlen)
        {
-         cursor_to (vpos, nsp + begmatch);
-         write_glyphs (nbody + nsp + begmatch, nlen - tem);
-         delete_glyphs (olen - nlen);
+         cursor_to (f, vpos, nsp + begmatch);
+         write_glyphs (f, nbody + nsp + begmatch, nlen - tem);
+         delete_glyphs (f, olen - nlen);
          olen = nlen;
        }
     }
@@ -5841,8 +5850,8 @@ update_frame_line (f, vpos)
   /* If any unerased characters remain after the new line, erase them.  */
   if (olen > nlen)
     {
-      cursor_to (vpos, nlen);
-      clear_end_of_line (olen);
+      cursor_to (f, vpos, nlen);
+      clear_end_of_line (f, olen);
     }
 
   /* Exchange contents between current_frame and new_frame.  */
@@ -6139,31 +6148,34 @@ window_change_signal (signalnum) /* If we don't have an argument, */
 #endif
   int old_errno = errno;
 
+  struct tty_display_info *tty;
+
   signal (SIGWINCH, window_change_signal);
   SIGNAL_THREAD_CHECK (signalnum);
 
-  get_frame_size (&width, &height);
-
-  /* The frame size change obviously applies to a termcap-controlled
-     frame.  Find such a frame in the list, and assume it's the only
-     one (since the redisplay code always writes to stdout, not a
-     FILE * specified in the frame structure).  Record the new size,
-     but don't reallocate the data structures now.  Let that be done
-     later outside of the signal handler.  */
+  /* The frame size change obviously applies to a single
+     termcap-controlled terminal, but we can't decide which.
+     Therefore, we resize the frames corresponding to each tty.
+  */
+  for (tty = tty_list; tty; tty = tty->next) {
 
-  {
-    Lisp_Object tail, frame;
+    if (! tty->term_initted)
+      continue;
 
-    FOR_EACH_FRAME (tail, frame)
-      {
-       if (FRAME_TERMCAP_P (XFRAME (frame)))
-         {
-           change_frame_size (XFRAME (frame), height, width, 0, 1, 0);
-           break;
-         }
-      }
+    get_tty_size (fileno (tty->input), &width, &height);
+    
+    if (width > 5 && height > 2) {
+      Lisp_Object tail, frame;
+      
+      FOR_EACH_FRAME (tail, frame)
+        if (FRAME_TERMCAP_P (XFRAME (frame)) && FRAME_TTY (XFRAME (frame)) == tty)
+          /* Record the new sizes, but don't reallocate the data
+             structures now.  Let that be done later outside of the
+             signal handler.  */
+          change_frame_size (XFRAME (frame), height, width, 0, 1, 0);
+    }
   }
-
+  
   errno = old_errno;
 }
 #endif /* SIGWINCH */
@@ -6217,10 +6229,11 @@ change_frame_size (f, newheight, newwidth, pretend, delay, safe)
 {
   Lisp_Object tail, frame;
 
-  if (! FRAME_WINDOW_P (f))
+  if (FRAME_MSDOS_P (f))
     {
-      /* When using termcap, or on MS-DOS, all frames use
-        the same screen, so a change in size affects all frames.  */
+      /* On MS-DOS, all frames use the same screen, so a change in
+         size affects all frames.  Termcap now supports multiple
+         ttys. */
       FOR_EACH_FRAME (tail, frame)
        if (! FRAME_WINDOW_P (XFRAME (frame)))
          change_frame_size_1 (XFRAME (frame), newheight, newwidth,
@@ -6300,7 +6313,7 @@ change_frame_size_1 (f, newheight, newwidth, pretend, delay, safe)
                           newheight - FRAME_TOP_MARGIN (f), 0);
 
       if (FRAME_TERMCAP_P (f) && !pretend)
-       FrameRows = newheight;
+       FrameRows (FRAME_TTY (f)) = newheight;
     }
 
   if (new_frame_total_cols != FRAME_TOTAL_COLS (f))
@@ -6310,7 +6323,7 @@ change_frame_size_1 (f, newheight, newwidth, pretend, delay, safe)
        set_window_width (FRAME_MINIBUF_WINDOW (f), new_frame_total_cols, 0);
 
       if (FRAME_TERMCAP_P (f) && !pretend)
-       FrameCols = newwidth;
+       FrameCols (FRAME_TTY (f)) = newwidth;
 
       if (WINDOWP (f->tool_bar_window))
        XSETFASTINT (XWINDOW (f->tool_bar_window)->total_cols, newwidth);
@@ -6360,14 +6373,22 @@ FILE = nil means just close any termscript file currently open.  */)
      (file)
      Lisp_Object file;
 {
-  if (termscript != 0) fclose (termscript);
-  termscript = 0;
+  struct tty_display_info *tty;
+
+  if (! FRAME_TERMCAP_P (SELECTED_FRAME ()))
+    error ("Current frame is not on a tty device");
+
+  tty = CURTTY ();
+
+  if (tty->termscript != 0)
+    fclose (tty->termscript);
+  tty->termscript = 0;
 
   if (! NILP (file))
     {
       file = Fexpand_file_name (file, Qnil);
-      termscript = fopen (SDATA (file), "w");
-      if (termscript == 0)
+      tty->termscript = fopen (SDATA (file), "w");
+      if (tty->termscript == 0)
        report_file_error ("Opening termscript", Fcons (file, Qnil));
     }
   return Qnil;
@@ -6375,22 +6396,35 @@ FILE = nil means just close any termscript file currently open.  */)
 
 
 DEFUN ("send-string-to-terminal", Fsend_string_to_terminal,
-       Ssend_string_to_terminal, 1, 1, 0,
+       Ssend_string_to_terminal, 1, 2, 0,
        doc: /* Send STRING to the terminal without alteration.
-Control characters in STRING will have terminal-dependent effects.  */)
-     (string)
+Control characters in STRING will have terminal-dependent effects.
+
+Optional parameter TERMINAL specifies the tty terminal device to use.
+It may be a terminal id, a frame, or nil for the terminal used by the
+currently selected frame.  */)
+  (string, terminal)
      Lisp_Object string;
+     Lisp_Object terminal;
 {
+  struct terminal *t = get_tty_terminal (terminal, 1);
+  struct tty_display_info *tty;
+
   /* ??? Perhaps we should do something special for multibyte strings here.  */
   CHECK_STRING (string);
-  fwrite (SDATA (string), 1, SBYTES (string), stdout);
-  fflush (stdout);
-  if (termscript)
+
+  if (!t)
+    error ("Unknown terminal device");
+
+  tty = t->display_info.tty;
+  
+  if (tty->termscript)
     {
-      fwrite (SDATA (string), 1, SBYTES (string),
-             termscript);
-      fflush (termscript);
+      fwrite (SDATA (string), 1, SBYTES (string), tty->termscript);
+      fflush (tty->termscript);
     }
+  fwrite (SDATA (string), 1, SBYTES (string), tty->output);
+  fflush (tty->output);
   return Qnil;
 }
 
@@ -6407,8 +6441,7 @@ terminate any keyboard macro currently executing.  */)
       if (noninteractive)
        putchar (07);
       else
-       ring_bell ();
-      fflush (stdout);
+       ring_bell (XFRAME (selected_frame));
     }
   else
     bitch_at_user ();
@@ -6424,8 +6457,7 @@ bitch_at_user ()
   else if (!INTERACTIVE)  /* Stop executing a keyboard macro.  */
     error ("Keyboard macro terminated by a command ringing the bell");
   else
-    ring_bell ();
-  fflush (stdout);
+    ring_bell (XFRAME (selected_frame));
 }
 
 
@@ -6708,8 +6740,6 @@ pass nil for VARIABLE.  */)
                            Initialization
 ***********************************************************************/
 
-char *terminal_type;
-
 /* Initialization done when Emacs fork is started, before doing stty.
    Determine terminal type and set terminal_driver.  Then invoke its
    decoding routine to set up variables in the terminal package.  */
@@ -6717,6 +6747,8 @@ char *terminal_type;
 void
 init_display ()
 {
+  char *terminal_type;
+
 #ifdef HAVE_X_WINDOWS
   extern int display_arg;
 #endif
@@ -6726,14 +6758,23 @@ init_display ()
   SET_CHAR_GLYPH_FROM_GLYPH (space_glyph, ' ');
   space_glyph.charpos = -1;
 
-  meta_key = 0;
   inverse_video = 0;
   cursor_in_echo_area = 0;
   terminal_type = (char *) 0;
 
   /* Now is the time to initialize this; it's used by init_sys_modes
      during startup.  */
-  Vwindow_system = Qnil;
+  Vinitial_window_system = Qnil;
+
+  /* SIGWINCH needs to be handled no matter what display we start
+     with.  Otherwise newly opened tty frames will not resize
+     automatically. */
+#ifdef SIGWINCH
+#ifndef CANNOT_DUMP
+  if (initialized)
+#endif /* CANNOT_DUMP */
+    signal (SIGWINCH, window_change_signal);
+#endif /* SIGWINCH */
 
   /* If the user wants to use a window system, we shouldn't bother
      initializing the terminal.  This is especially important when the
@@ -6769,7 +6810,7 @@ init_display ()
 #endif
      )
     {
-      Vwindow_system = intern ("x");
+      Vinitial_window_system = intern ("x");
 #ifdef HAVE_X11
       Vwindow_system_version = make_number (11);
 #else
@@ -6789,7 +6830,7 @@ init_display ()
 #ifdef HAVE_NTGUI
   if (!inhibit_window_system)
     {
-      Vwindow_system = intern ("w32");
+      Vinitial_window_system = intern ("w32");
       Vwindow_system_version = make_number (1);
       adjust_frame_glyphs_initially ();
       return;
@@ -6799,7 +6840,7 @@ init_display ()
 #ifdef MAC_OS
   if (!inhibit_window_system)
     {
-      Vwindow_system = intern ("mac");
+      Vinitial_window_system = intern ("mac");
       Vwindow_system_version = make_number (1);
       adjust_frame_glyphs_initially ();
       return;
@@ -6851,8 +6892,38 @@ For types not defined in VMS, use  define emacs_term \"TYPE\".\n\
   }
 #endif /* VMS */
 
-  term_init (terminal_type);
-
+  {
+    struct terminal *t;
+    struct frame *f = XFRAME (selected_frame);
+
+    /* Open a display on the controlling tty. */
+    t = init_tty (0, terminal_type, 1); /* Errors are fatal. */
+
+    /* Convert the initial frame to use the new display. */
+    if (f->output_method != output_initial)
+      abort ();
+    f->output_method = t->type;
+    f->terminal = t;
+
+    t->reference_count++;
+    t->display_info.tty->top_frame = selected_frame;
+    change_frame_size (XFRAME (selected_frame),
+                       FrameRows (t->display_info.tty),
+                       FrameCols (t->display_info.tty), 0, 0, 1);
+
+    /* Delete the initial terminal. */
+    if (--initial_terminal->reference_count == 0
+        && initial_terminal->delete_terminal_hook)
+      (*initial_terminal->delete_terminal_hook) (initial_terminal);
+
+    /* Update frame parameters to reflect the new type. */
+    Fmodify_frame_parameters (selected_frame, Fcons (Fcons (Qwindow_system, Qnil), Qnil));
+    Fmodify_frame_parameters
+      (selected_frame, Fcons (Fcons (Qtty_type,
+                                     Ftty_type (selected_frame)), Qnil));
+    Fmodify_frame_parameters (selected_frame, Fcons (Fcons (Qtty, Qnil), Qnil));
+  }
+  
   {
     struct frame *sf = SELECTED_FRAME ();
     int width = FRAME_TOTAL_COLS (sf);
@@ -6869,13 +6940,6 @@ For types not defined in VMS, use  define emacs_term \"TYPE\".\n\
   adjust_frame_glyphs_initially ();
   calculate_costs (XFRAME (selected_frame));
 
-#ifdef SIGWINCH
-#ifndef CANNOT_DUMP
-  if (initialized)
-#endif /* CANNOT_DUMP */
-    signal (SIGWINCH, window_change_signal);
-#endif /* SIGWINCH */
-
   /* Set up faces of the initial terminal frame of a dumped Emacs.  */
   if (initialized
       && !noninteractive
@@ -6886,7 +6950,7 @@ For types not defined in VMS, use  define emacs_term \"TYPE\".\n\
         and internal_terminal_init.  */
       && (strcmp (terminal_type, "internal") != 0 || inhibit_window_system)
 #endif
-      && NILP (Vwindow_system))
+      && NILP (Vinitial_window_system))
     {
       /* For the initial frame, we don't have any way of knowing what
         are the foreground and background colors of the terminal.  */
@@ -6998,8 +7062,8 @@ A non-nil value is useful if the terminal can automatically preserve
 Emacs's frame display when you reenter Emacs.
 It is up to you to set this variable if your terminal can do that.  */);
 
-  DEFVAR_LISP ("window-system", &Vwindow_system,
-              doc: /* Name of window system that Emacs is displaying through.
+  DEFVAR_LISP ("initial-window-system", &Vinitial_window_system,
+              doc: /* Name of the window system that Emacs uses for the first frame.
 The value is a symbol--for instance, `x' for X windows.
 The value is nil if Emacs is using a text-only terminal.  */);
 
@@ -7042,7 +7106,7 @@ If nil, never pre-empt redisplay.  */);
   if (noninteractive)
 #endif
     {
-      Vwindow_system = Qnil;
+      Vinitial_window_system = Qnil;
       Vwindow_system_version = Qnil;
     }
 }
index 1377a3d..76ad59c 100644 (file)
@@ -57,6 +57,7 @@ Boston, MA 02110-1301, USA.  */
 #include "blockinput.h"
 #include "syssignal.h"
 #include "process.h"
+#include "frame.h"
 #include "termhooks.h"
 #include "keyboard.h"
 #include "keymap.h"
@@ -214,7 +215,7 @@ static unsigned long heap_bss_diff;
 
 
 #ifdef HAVE_WINDOW_SYSTEM
-extern Lisp_Object Vwindow_system;
+extern Lisp_Object Vinitial_window_system;
 #endif /* HAVE_WINDOW_SYSTEM */
 
 extern Lisp_Object Vauto_save_list_file_name;
@@ -788,7 +789,7 @@ void (*__malloc_initialize_hook) () = malloc_initialize_hook;
 
 
 #define REPORT_EMACS_BUG_ADDRESS "bug-gnu-emacs@gnu.org"
-#define REPORT_EMACS_BUG_PRETEST_ADDRESS "emacs-pretest-bug@gnu.org"
+#define REPORT_EMACS_BUG_PRETEST_ADDRESS "multi-tty@lists.fnord.hu"
 
 /* This function is used to determine an address to which bug report should
    be sent.  */
@@ -1317,6 +1318,9 @@ main (argc, argv
         faces, and the face implementation uses some symbols as
         face names.  */
       syms_of_xfaces ();
+      /* XXX syms_of_keyboard uses some symbols in keymap.c.  It would
+         be better to arrange things not to have this dependency.  */
+      syms_of_keymap ();
       /* Call syms_of_keyboard before init_window_once because
         keyboard sets up symbols that include some face names that
         the X support will want to use.  This can happen when
@@ -1514,10 +1518,10 @@ main (argc, argv
   /* egetenv is a pretty low-level facility, which may get called in
      many circumstances; it seems flimsy to put off initializing it
      until calling init_callproc.  */
-  set_process_environment ();
+  set_initial_environment ();
   /* AIX crashes are reported in system versions 3.2.3 and 3.2.4
-     if this is not done.  Do it after set_process_environment so that we
-     don't pollute Vprocess_environment.  */
+     if this is not done.  Do it after set_global_environment so that we
+     don't pollute Vglobal_environment.  */
   /* Setting LANG here will defeat the startup locale processing...  */
 #ifdef AIX3_2
   putenv ("LANG=C");
@@ -1588,7 +1592,7 @@ main (argc, argv
 #endif /* CLASH_DETECTION */
       syms_of_indent ();
       syms_of_insdel ();
-      syms_of_keymap ();
+      /* syms_of_keymap (); */
       syms_of_macros ();
       syms_of_marker ();
       syms_of_minibuf ();
@@ -1599,6 +1603,7 @@ main (argc, argv
       syms_of_frame ();
 #endif
       syms_of_syntax ();
+      syms_of_terminal ();
       syms_of_term ();
       syms_of_undo ();
 #ifdef HAVE_SOUND
@@ -1683,13 +1688,7 @@ main (argc, argv
 #endif  /* HAVE_NTGUI */
     }
 
-  if (!noninteractive)
-    {
-#ifdef VMS
-      init_vms_input ();/* init_display calls get_frame_size, that needs this.  */
-#endif /* VMS */
-      init_display (); /* Determine terminal type.  init_sys_modes uses results.  */
-    }
+  init_process (); /* init_display uses add_keyboard_wait_descriptor. */
 #ifndef MAC_OS8
   /* Called before init_window_once for Mac OS Classic.  */
   init_keyboard ();    /* This too must precede init_sys_modes.  */
@@ -1697,7 +1696,13 @@ main (argc, argv
 #ifdef VMS
   init_vmsproc ();     /* And this too.  */
 #endif /* VMS */
-  init_sys_modes ();   /* Init system terminal modes (RAW or CBREAK, etc.).  */
+  if (!noninteractive)
+    {
+#ifdef VMS
+      init_vms_input ();/* init_display calls get_tty_size, that needs this.  */
+#endif /* VMS */
+      init_display (); /* Determine terminal type.  Calls init_sys_modes.  */
+    }
   init_fns ();
   init_xdisp ();
 #ifdef HAVE_WINDOW_SYSTEM
@@ -1710,7 +1715,6 @@ main (argc, argv
 #ifdef VMS
   init_vmsfns ();
 #endif /* VMS */
-  init_process ();
 #ifdef HAVE_SOUND
   init_sound ();
 #endif
@@ -2122,15 +2126,14 @@ shut_down_emacs (sig, no_x, stuff)
     if (EMACS_GET_TTY_PGRP (0, &tpgrp) != -1
        && tpgrp == pgrp)
       {
-       fflush (stdout);
-       reset_sys_modes ();
+       reset_all_sys_modes ();
        if (sig && sig != SIGTERM)
          fprintf (stderr, "Fatal error (%d)", sig);
       }
   }
 #else
   fflush (stdout);
-  reset_sys_modes ();
+  reset_all_sys_modes ();
 #endif
 
   stuff_buffered_input (stuff);
@@ -2152,9 +2155,9 @@ shut_down_emacs (sig, no_x, stuff)
 #if 0 /* This triggers a bug in XCloseDisplay and is not needed.  */
 #ifdef HAVE_X_WINDOWS
   /* It's not safe to call intern here.  Maybe we are crashing.  */
-  if (!noninteractive && SYMBOLP (Vwindow_system)
-      && SCHARS (SYMBOL_NAME (Vwindow_system)) == 1
-      && SREF (SYMBOL_NAME (Vwindow_system), 0) == 'x'
+  if (!noninteractive && SYMBOLP (Vinitial_window_system)
+      && SCHARS (SYMBOL_NAME (Vinitial_window_system)) == 1
+      && SREF (SYMBOL_NAME (Vinitial_window_system), 0) == 'x'
       && ! no_x)
     Fx_close_current_connection ();
 #endif /* HAVE_X_WINDOWS */
index 7e9b4b5..c587142 100644 (file)
@@ -1273,7 +1273,11 @@ unwind_to_catch (catch, value)
 #if HAVE_X_WINDOWS
   /* If x_catch_errors was done, turn it off now.
      (First we give unbind_to a chance to do that.)  */
+#if 0 /* This would disable x_catch_errors after x_connection_closed.
+       * The catch must remain in effect during that delicate
+       * state. --lorentey  */
   x_fully_uncatch_errors ();
+#endif
 #endif
 
   byte_stack_list = catch->byte_stack;
@@ -1451,9 +1455,11 @@ internal_condition_case (bfun, handlers, hfun)
 
   /* Since Fsignal will close off all calls to x_catch_errors,
      we will get the wrong results if some are not closed now.  */
+#if 0 /* Fsignal doesn't do that anymore.  --lorentey  */
 #if HAVE_X_WINDOWS
   if (x_catching_errors ())
     abort ();
+#endif
 #endif
 
   c.tag = Qnil;
@@ -1499,9 +1505,11 @@ internal_condition_case_1 (bfun, arg, handlers, hfun)
 
   /* Since Fsignal will close off all calls to x_catch_errors,
      we will get the wrong results if some are not closed now.  */
+#if 0 /* Fsignal doesn't do that anymore.  --lorentey  */
 #if HAVE_X_WINDOWS
   if (x_catching_errors ())
     abort ();
+#endif
 #endif
 
   c.tag = Qnil;
@@ -1550,9 +1558,11 @@ internal_condition_case_2 (bfun, nargs, args, handlers, hfun)
 
   /* Since Fsignal will close off all calls to x_catch_errors,
      we will get the wrong results if some are not closed now.  */
+#if 0 /* Fsignal doesn't do that anymore.  --lorentey  */
 #if HAVE_X_WINDOWS
   if (x_catching_errors ())
     abort ();
+#endif
 #endif
 
   c.tag = Qnil;
index d63828b..e6a4314 100644 (file)
@@ -78,6 +78,8 @@ extern int errno;
 #include "coding.h"
 #include "window.h"
 #include "blockinput.h"
+#include "frame.h"
+#include "dispextern.h"
 
 #ifdef WINDOWSNT
 #define NOMINMAX 1
@@ -5750,7 +5752,7 @@ auto_save_error (error)
   char *msgbuf;
   USE_SAFE_ALLOCA;
 
-  ring_bell ();
+  ring_bell (XFRAME (selected_frame));
 
   args[0] = build_string ("Auto-saving %s: %s");
   args[1] = current_buffer->name;
@@ -6306,7 +6308,7 @@ and `read-file-name-function'.  */)
   /* If dir starts with user's homedir, change that to ~. */
   homedir = (char *) egetenv ("HOME");
 #ifdef DOS_NT
-  /* homedir can be NULL in temacs, since Vprocess_environment is not
+  /* homedir can be NULL in temacs, since Vglobal_environment is not
      yet set up.  We shouldn't crash in that case.  */
   if (homedir != 0)
     {
index f653754..709b588 100644 (file)
--- a/src/fns.c
+++ b/src/fns.c
@@ -3236,7 +3236,8 @@ is nil and `use-dialog-box' is non-nil.  */)
     {
 
 #ifdef HAVE_MENUS
-      if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event))
+      if (FRAME_WINDOW_P (SELECTED_FRAME ())
+          && (NILP (last_nonmenu_event) || CONSP (last_nonmenu_event))
          && use_dialog_box
          && have_menus_p ())
        {
@@ -3275,6 +3276,7 @@ is nil and `use-dialog-box' is non-nil.  */)
          Fraise_frame (mini_frame);
        }
 
+      temporarily_switch_to_single_kboard (SELECTED_FRAME ());
       obj = read_filtered_event (1, 0, 0, 0, Qnil);
       cursor_in_echo_area = 0;
       /* If we need to quit, quit with cursor_in_echo_area = 0.  */
@@ -3367,7 +3369,8 @@ is nil, and `use-dialog-box' is non-nil.  */)
   CHECK_STRING (prompt);
 
 #ifdef HAVE_MENUS
-  if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event))
+  if (FRAME_WINDOW_P (SELECTED_FRAME ())
+      && (NILP (last_nonmenu_event) || CONSP (last_nonmenu_event))
       && use_dialog_box
       && have_menus_p ())
     {
index c8679a7..47cda7f 100644 (file)
@@ -47,6 +47,7 @@ Boston, MA 02110-1301, USA.  */
 #ifdef MAC_OS
 #include "macterm.h"
 #endif
+#include "termhooks.h"
 
 #ifdef FONTSET_DEBUG
 #undef xassert
@@ -1345,7 +1346,7 @@ DEFUN ("internal-char-font", Finternal_char_font, Sinternal_char_font, 1, 2, 0,
       STORE_XCHAR2B (&char2b, c1, c2);
     else
       STORE_XCHAR2B (&char2b, 0, c1);
-    rif->encode_char (c, &char2b, fontp, NULL);
+    FRAME_RIF (f)->encode_char (c, &char2b, fontp, NULL);
     code = (XCHAR2B_BYTE1 (&char2b) << 8) | XCHAR2B_BYTE2 (&char2b);
   }
   return Fcons (build_string (face->font_name), make_number (code));
index 7599282..b6f361b 100644 (file)
@@ -42,6 +42,7 @@ Boston, MA 02110-1301, USA.  */
 #include "fontset.h"
 #endif
 #include "blockinput.h"
+#include "termchar.h"
 #include "termhooks.h"
 #include "dispextern.h"
 #include "window.h"
@@ -75,6 +76,8 @@ Lisp_Object Qinhibit_default_face_x_resources;
 
 Lisp_Object Qx_frame_parameter;
 Lisp_Object Qx_resource_name;
+Lisp_Object Qterminal;
+Lisp_Object Qterminal_live_p;
 
 /* Frame parameters (set or reported).  */
 
@@ -104,15 +107,17 @@ Lisp_Object Qtitle, Qname;
 Lisp_Object Qunsplittable;
 Lisp_Object Qmenu_bar_lines, Qtool_bar_lines;
 Lisp_Object Qleft_fringe, Qright_fringe;
-Lisp_Object Qbuffer_predicate, Qbuffer_list;
+Lisp_Object Qbuffer_predicate, Qbuffer_list, Qburied_buffer_list;
 Lisp_Object Qtty_color_mode;
+Lisp_Object Qtty, Qtty_type;
+Lisp_Object Qwindow_system;
+Lisp_Object Qenvironment;
 
 Lisp_Object Qfullscreen, Qfullwidth, Qfullheight, Qfullboth;
 
 Lisp_Object Qinhibit_face_set_after_frame_default;
 Lisp_Object Qface_set_after_frame_default;
 
-
 Lisp_Object Vterminal_frame;
 Lisp_Object Vdefault_frame_alist;
 Lisp_Object Vdefault_frame_scroll_bars;
@@ -122,8 +127,8 @@ Lisp_Object Vdelete_frame_functions;
 \f
 static void
 set_menu_bar_lines_1 (window, n)
-  Lisp_Object window;
-  int n;
+     Lisp_Object window;
+     int n;
 {
   struct window *w = XWINDOW (window);
 
@@ -181,8 +186,6 @@ set_menu_bar_lines (f, value, oldval)
 Lisp_Object Vemacs_iconified;
 Lisp_Object Vframe_list;
 
-struct x_output tty_display;
-
 extern Lisp_Object Vminibuffer_list;
 extern Lisp_Object get_minibuffer ();
 extern Lisp_Object Fhandle_switch_frame ();
@@ -204,6 +207,7 @@ See also `frame-live-p'.  */)
     return Qnil;
   switch (XFRAME (object)->output_method)
     {
+    case output_initial: /* The initial frame is like a termcap frame. */
     case output_termcap:
       return Qt;
     case output_x_window:
@@ -222,7 +226,7 @@ See also `frame-live-p'.  */)
 DEFUN ("frame-live-p", Fframe_live_p, Sframe_live_p, 1, 1, 0,
        doc: /* Return non-nil if OBJECT is a frame which has not been deleted.
 Value is nil if OBJECT is not a live frame.  If object is a live
-frame, the return value indicates what sort of output device it is
+frame, the return value indicates what sort of terminal device it is
 displayed on.  See the documentation of `framep' for possible
 return values.  */)
      (object)
@@ -234,6 +238,30 @@ return values.  */)
          : Qnil);
 }
 
+DEFUN ("window-system", Fwindow_system, Swindow_system, 0, 1, 0,
+       doc: /* The name of the window system that FRAME is displaying through.
+The value is a symbol---for instance, 'x' for X windows.
+The value is nil if Emacs is using a text-only terminal.
+
+FRAME defaults to the currently selected frame.  */)
+  (frame)
+     Lisp_Object frame;
+{
+  Lisp_Object type;
+  if (NILP (frame))
+    frame = selected_frame;
+
+  type = Fframep (frame);
+
+  if (NILP (type))
+    wrong_type_argument (Qframep, frame);
+
+  if (EQ (type, Qt))
+    return Qnil;
+  else
+    return type;
+}      
+
 struct frame *
 make_frame (mini_p)
      int mini_p;
@@ -277,9 +305,7 @@ make_frame (mini_p)
   f->menu_bar_items_used = 0;
   f->buffer_predicate = Qnil;
   f->buffer_list = Qnil;
-#ifdef MULTI_KBOARD
-  f->kboard = initial_kboard;
-#endif
+  f->buried_buffer_list = Qnil;
   f->namebuf = 0;
   f->title = Qnil;
   f->menu_bar_window = Qnil;
@@ -399,8 +425,8 @@ make_frame_without_minibuffer (mini_window, kb, display)
 
 #ifdef MULTI_KBOARD
   if (!NILP (mini_window)
-      && XFRAME (XWINDOW (mini_window)->frame)->kboard != kb)
-    error ("Frame and minibuffer must be on the same display");
+      && FRAME_KBOARD (XFRAME (XWINDOW (mini_window)->frame)) != kb)
+    error ("Frame and minibuffer must be on the same terminal");
 #endif
 
   /* Make a frame containing just a root window.  */
@@ -476,18 +502,19 @@ make_minibuffer_frame ()
 }
 #endif /* HAVE_WINDOW_SYSTEM */
 \f
-/* Construct a frame that refers to the terminal (stdin and stdout).  */
+/* Construct a frame that refers to a terminal.  */
 
-static int terminal_frame_count;
+static int tty_frame_count;
 
 struct frame *
-make_terminal_frame ()
+make_initial_frame (void)
 {
-  register struct frame *f;
+  struct frame *f;
+  struct terminal *terminal;
   Lisp_Object frame;
-  char name[20];
 
 #ifdef MULTI_KBOARD
+  /* Create the initial keyboard. */
   if (!initial_kboard)
     {
       initial_kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
@@ -501,13 +528,51 @@ make_terminal_frame ()
   if (! (NILP (Vframe_list) || CONSP (Vframe_list)))
     Vframe_list = Qnil;
 
+  terminal = init_initial_terminal ();
+
+  f = make_frame (1);
+  XSETFRAME (frame, f);
+
+  Vframe_list = Fcons (frame, Vframe_list);
+
+  tty_frame_count = 1;
+  f->name = build_string ("F1");
+
+  f->visible = 1;
+  f->async_visible = 1;
+
+  f->output_method = terminal->type;
+  f->terminal = terminal;
+  f->terminal->reference_count++;
+  f->output_data.nothing = 0;
+  
+  FRAME_FOREGROUND_PIXEL (f) = FACE_TTY_DEFAULT_FG_COLOR;
+  FRAME_BACKGROUND_PIXEL (f) = FACE_TTY_DEFAULT_BG_COLOR;
+    
+  FRAME_CAN_HAVE_SCROLL_BARS (f) = 0;
+  FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none;
+
+  return f;
+}
+
+
+struct frame *
+make_terminal_frame (struct terminal *terminal)
+{
+  register struct frame *f;
+  Lisp_Object frame;
+  char name[20];
+
+  if (terminal->deleted)
+    error ("Terminal is being deleted, can't create new frames on it");
+
   f = make_frame (1);
 
   XSETFRAME (frame, f);
   Vframe_list = Fcons (frame, Vframe_list);
 
-  terminal_frame_count++;
-  sprintf (name, "F%d", terminal_frame_count);
+  tty_frame_count++;
+  sprintf (name, "F%d", tty_frame_count);
   f->name = build_string (name);
 
   f->visible = 1;              /* FRAME_SET_VISIBLE wd set frame_garbaged. */
@@ -527,11 +592,11 @@ make_terminal_frame ()
         for the black color.  Other frames all inherit their pixels
         from what's already in the_only_x_display.  */
       if ((!FRAMEP (selected_frame) || !FRAME_LIVE_P (XFRAME (selected_frame)))
-         && f->output_data.x->background_pixel == 0
-         && f->output_data.x->foreground_pixel == 0)
+         && FRAME_BACKGROUND_PIXEL (f) == 0
+         && FRAME_FOREGROUND_PIXEL (f) == 0)
        {
-         f->output_data.x->background_pixel = FACE_TTY_DEFAULT_BG_COLOR;
-         f->output_data.x->foreground_pixel = FACE_TTY_DEFAULT_FG_COLOR;
+         FRAME_BACKGROUND_PIXEL (f) = FACE_TTY_DEFAULT_BG_COLOR;
+         FRAME_FOREGROUND_PIXEL (f) = FACE_TTY_DEFAULT_FG_COLOR;
        }
     }
   else
@@ -539,12 +604,31 @@ make_terminal_frame ()
 #else
 #ifdef WINDOWSNT
   f->output_method = output_termcap;
-  f->output_data.x = &tty_display;
+  f->output_data.x = &tty_display; /* XXX ??? */
 #else
 #ifdef MAC_OS8
   make_mac_terminal_frame (f);
 #else
-  f->output_data.x = &tty_display;
+  {
+    f->output_method = output_termcap;
+    f->terminal = terminal;
+    f->terminal->reference_count++;
+    create_tty_output (f);
+    
+    FRAME_FOREGROUND_PIXEL (f) = FACE_TTY_DEFAULT_FG_COLOR;
+    FRAME_BACKGROUND_PIXEL (f) = FACE_TTY_DEFAULT_BG_COLOR;
+    
+    FRAME_CAN_HAVE_SCROLL_BARS (f) = 0;
+    FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none;
+
+    /* Set the top frame to the newly created frame. */
+    if (FRAME_TTY (f)->top_frame
+        && FRAME_LIVE_P (XFRAME (FRAME_TTY (f)->top_frame)))
+      XFRAME (FRAME_TTY (f)->top_frame)->async_visible = 2; /* obscured */
+    
+    FRAME_TTY (f)->top_frame = frame;
+  }
+  
 #ifdef CANNOT_DUMP
   FRAME_FOREGROUND_PIXEL(f) = FACE_TTY_DEFAULT_FG_COLOR;
   FRAME_BACKGROUND_PIXEL(f) = FACE_TTY_DEFAULT_BG_COLOR;
@@ -559,18 +643,55 @@ make_terminal_frame ()
   return f;
 }
 
+/* Get a suitable value for frame parameter PARAMETER for a newly
+   created frame, based on (1) the user-supplied frame parameter
+   alist SUPPLIED_PARMS, (2) CURRENT_VALUE, and finally, if all else
+   fails, (3) Vdefault_frame_alist.  */
+
+static Lisp_Object
+get_future_frame_param (Lisp_Object parameter,
+                        Lisp_Object supplied_parms,
+                        char *current_value)
+{
+  Lisp_Object result;
+
+  result = Fassq (parameter, supplied_parms);
+  if (NILP (result))
+    result = Fassq (parameter, XFRAME (selected_frame)->param_alist);
+  if (NILP (result) && current_value != NULL)
+    result = build_string (current_value);
+  if (NILP (result))
+    result = Fassq (parameter, Vdefault_frame_alist);
+  if (!NILP (result) && !STRINGP (result))
+    result = XCDR (result);
+  if (NILP (result) || !STRINGP (result))
+    result = Qnil;
+
+  return result;
+}
+
 DEFUN ("make-terminal-frame", Fmake_terminal_frame, Smake_terminal_frame,
        1, 1, 0,
-       doc: /* Create an additional terminal frame.
-You can create multiple frames on a text-only terminal in this way.
-Only the selected terminal frame is actually displayed.
+       doc: /* Create an additional terminal frame, possibly on another terminal.
 This function takes one argument, an alist specifying frame parameters.
-In practice, generally you don't need to specify any parameters.
-Note that changing the size of one terminal frame automatically affects all.  */)
+
+You can create multiple frames on a single text-only terminal, but
+only one of them (the selected terminal frame) is actually displayed.
+
+In practice, generally you don't need to specify any parameters,
+except when you want to create a new frame on another terminal.
+In that case, the `tty' parameter specifies the device file to open,
+and the `tty-type' parameter specifies the terminal type.  Example:
+
+   (make-terminal-frame '((tty . "/dev/pts/5") (tty-type . "xterm")))
+
+Note that changing the size of one terminal frame automatically
+affects all frames on the same terminal device.  */)
      (parms)
      Lisp_Object parms;
 {
   struct frame *f;
+  struct terminal *t = NULL;
   Lisp_Object frame, tem;
   struct frame *sf = SELECTED_FRAME ();
 
@@ -584,21 +705,78 @@ Note that changing the size of one terminal frame automatically affects all.  */
   if (sf->output_method != output_mac)
     error ("Not running on a Macintosh screen; cannot make a new Macintosh frame");
 #else
+#if 0                           /* This should work now! */
   if (sf->output_method != output_termcap)
     error ("Not using an ASCII terminal now; cannot make a new ASCII frame");
 #endif
+#endif
 #endif /* not MSDOS */
+  
+  {
+    Lisp_Object terminal;
+
+    terminal = Fassq (Qterminal, parms);
+    if (!NILP (terminal))
+      {
+        terminal = XCDR (terminal);
+        t = get_terminal (terminal, 1);
+      }
+  }
+  
+  if (!t)
+    { 
+      char *name = 0, *type = 0;
+      Lisp_Object tty, tty_type;
+
+      tty = get_future_frame_param
+        (Qtty, parms, (FRAME_TERMCAP_P (XFRAME (selected_frame))
+                       ? FRAME_TTY (XFRAME (selected_frame))->name
+                       : NULL));
+      if (!NILP (tty))
+        {
+          name = (char *) alloca (SBYTES (tty) + 1);
+          strncpy (name, SDATA (tty), SBYTES (tty));
+          name[SBYTES (tty)] = 0;
+        }
+      
+      tty_type = get_future_frame_param
+        (Qtty_type, parms, (FRAME_TERMCAP_P (XFRAME (selected_frame))
+                            ? FRAME_TTY (XFRAME (selected_frame))->type
+                            : NULL));
+      if (!NILP (tty_type))
+        {
+          type = (char *) alloca (SBYTES (tty_type) + 1);
+          strncpy (type, SDATA (tty_type), SBYTES (tty_type));
+          type[SBYTES (tty_type)] = 0;
+        }
+
+      t = init_tty (name, type, 0); /* Errors are not fatal. */
+    }
 
-  f = make_terminal_frame ();
+  f = make_terminal_frame (t);
 
-  change_frame_size (f, FRAME_LINES (sf),
-                    FRAME_COLS (sf), 0, 0, 0);
+  {
+    int width, height;
+    get_tty_size (fileno (FRAME_TTY (f)->input), &width, &height);
+    change_frame_size (f, height, width, 0, 0, 0);
+  }
+  
   adjust_glyphs (f);
   calculate_costs (f);
   XSETFRAME (frame, f);
   Fmodify_frame_parameters (frame, Vdefault_frame_alist);
   Fmodify_frame_parameters (frame, parms);
-
+  Fmodify_frame_parameters (frame, Fcons (Fcons (Qwindow_system, Qnil), Qnil));
+  Fmodify_frame_parameters (frame, Fcons (Fcons (Qtty_type,
+                                                 build_string (t->display_info.tty->type)),
+                                          Qnil));
+  if (t->display_info.tty->name != NULL)
+    Fmodify_frame_parameters (frame, Fcons (Fcons (Qtty,
+                                                   build_string (t->display_info.tty->name)),
+                                            Qnil));
+  else
+    Fmodify_frame_parameters (frame, Fcons (Fcons (Qtty, Qnil), Qnil));
+  
   /* Make the frame face alist be frame-specific, so that each
      frame could change its face definitions independently.  */
   f->face_alist = Fcopy_alist (sf->face_alist);
@@ -621,7 +799,7 @@ Note that changing the size of one terminal frame automatically affects all.  */
    frame's focus to FRAME instead.
 
    FOR_DELETION non-zero means that the selected frame is being
-   deleted, which includes the possibility that the frame's display
+   deleted, which includes the possibility that the frame's terminal
    is dead.  */
 
 Lisp_Object
@@ -696,6 +874,15 @@ do_switch_frame (frame, track, for_deletion)
   if (!for_deletion && FRAME_HAS_MINIBUF_P (sf))
     resize_mini_window (XWINDOW (FRAME_MINIBUF_WINDOW (sf)), 1);
 
+  if (FRAME_TERMCAP_P (XFRAME (selected_frame))
+      && FRAME_TERMCAP_P (XFRAME (frame))
+      && FRAME_TTY (XFRAME (selected_frame)) == FRAME_TTY (XFRAME (frame)))
+    {
+      XFRAME (selected_frame)->async_visible = 2; /* obscured */
+      XFRAME (frame)->async_visible = 1;
+      FRAME_TTY (XFRAME (frame))->top_frame = frame;
+    }
+
   selected_frame = frame;
   if (! FRAME_MINIBUF_ONLY_P (XFRAME (selected_frame)))
     last_nonminibuf_frame = XFRAME (selected_frame);
@@ -879,6 +1066,7 @@ If FRAME is the selected frame, this makes WINDOW the selected window.  */)
 
   return XFRAME (frame)->selected_window = window;
 }
+
 \f
 DEFUN ("frame-list", Fframe_list, Sframe_list,
        0, 0, 0,
@@ -926,7 +1114,10 @@ next_frame (frame, minibuf)
        f = XCAR (tail);
 
        if (passed
-           && FRAME_KBOARD (XFRAME (f)) == FRAME_KBOARD (XFRAME (frame)))
+           && ((!FRAME_TERMCAP_P (XFRAME (f)) && !FRAME_TERMCAP_P (XFRAME (frame))
+                 && FRAME_KBOARD (XFRAME (f)) == FRAME_KBOARD (XFRAME (frame)))
+                || (FRAME_TERMCAP_P (XFRAME (f)) && FRAME_TERMCAP_P (XFRAME (frame))
+                    && FRAME_TTY (XFRAME (f)) == FRAME_TTY (XFRAME (frame)))))
          {
            /* Decide whether this frame is eligible to be returned.  */
 
@@ -1003,7 +1194,10 @@ prev_frame (frame, minibuf)
       if (EQ (frame, f) && !NILP (prev))
        return prev;
 
-      if (FRAME_KBOARD (XFRAME (f)) == FRAME_KBOARD (XFRAME (frame)))
+      if ((!FRAME_TERMCAP_P (XFRAME (f)) && !FRAME_TERMCAP_P (XFRAME (frame))
+           && FRAME_KBOARD (XFRAME (f)) == FRAME_KBOARD (XFRAME (frame)))
+          || (FRAME_TERMCAP_P (XFRAME (f)) && FRAME_TERMCAP_P (XFRAME (frame))
+              && FRAME_TTY (XFRAME (f)) == FRAME_TTY (XFRAME (frame))))
        {
          /* Decide whether this frame is eligible to be returned,
             according to minibuf.  */
@@ -1137,6 +1331,14 @@ other_visible_frames (f)
   return 1;
 }
 
+/* Error handler for `delete-frame-functions'. */
+static Lisp_Object
+delete_frame_handler (Lisp_Object arg)
+{
+  add_to_log ("Error during `delete-frame': %s", arg, Qnil);
+  return Qnil;
+}
+
 DEFUN ("delete-frame", Fdelete_frame, Sdelete_frame, 0, 2, "",
        doc: /* Delete FRAME, permanently eliminating it from use.
 If omitted, FRAME defaults to the selected frame.
@@ -1152,6 +1354,8 @@ The functions are run with one arg, the frame to be deleted.  */)
 {
   struct frame *f;
   struct frame *sf = SELECTED_FRAME ();
+  struct kboard *kb;
+
   int minibuffer_selected;
 
   if (EQ (frame, Qnil))
@@ -1210,11 +1414,22 @@ The functions are run with one arg, the frame to be deleted.  */)
       && NILP (Fframe_parameter (frame, intern ("tooltip"))))
     {
       Lisp_Object args[2];
+      struct gcpro gcpro1, gcpro2;
+
+      /* Don't let a rogue function in `delete-frame-functions'
+        prevent the frame deletion. */
+      GCPRO2 (args[0], args[1]);
       args[0] = intern ("delete-frame-functions");
       args[1] = frame;
-      Frun_hook_with_args (2, args);
+      internal_condition_case_2 (Frun_hook_with_args, 2, args,
+                                Qt, delete_frame_handler);
+      UNGCPRO;
     }
 
+  /* The hook may sometimes (indirectly) cause the frame to be deleted.  */
+  if (! FRAME_LIVE_P (f))
+    return Qnil;
+
   minibuffer_selected = EQ (minibuf_window, selected_window);
 
   /* Don't let the frame remain selected.  */
@@ -1230,7 +1445,7 @@ The functions are run with one arg, the frame to be deleted.  */)
        {
          FOR_EACH_FRAME (tail, frame1)
            {
-             if (! EQ (frame, frame1))
+             if (! EQ (frame, frame1) && FRAME_LIVE_P (XFRAME (frame1)))
                break;
            }
        }
@@ -1256,6 +1471,24 @@ The functions are run with one arg, the frame to be deleted.  */)
   if (EQ (f->minibuffer_window, echo_area_window))
     echo_area_window = sf->minibuffer_window;
 
+  /* Don't allow other frames to refer to a deleted frame in their
+     'environment parameter.  */
+  {
+    Lisp_Object tail, frame1;
+    Lisp_Object env = get_frame_param (XFRAME (frame), Qenvironment);
+    FOR_EACH_FRAME (tail, frame1)
+      {
+        if (EQ (frame, frame1) || !FRAME_LIVE_P (XFRAME (frame1)))
+          continue;
+        if (EQ (frame, get_frame_param (XFRAME (frame1), Qenvironment)))
+          {
+            store_frame_param (XFRAME (frame1), Qenvironment, env);
+            if (!FRAMEP (env))
+              env = frame1;
+          }
+      }
+  }
+  
   /* Clear any X selections for this frame.  */
 #ifdef HAVE_X_WINDOWS
   if (FRAME_X_P (f))
@@ -1296,18 +1529,34 @@ The functions are run with one arg, the frame to be deleted.  */)
     xfree (FRAME_MESSAGE_BUF (f));
 
   /* Since some events are handled at the interrupt level, we may get
-     an event for f at any time; if we zero out the frame's display
+     an event for f at any time; if we zero out the frame's terminal
      now, then we may trip up the event-handling code.  Instead, we'll
-     promise that the display of the frame must be valid until we have
-     called the window-system-dependent frame destruction routine.  */
+     promise that the terminal of the frame must be valid until we
+     have called the window-system-dependent frame destruction
+     routine.  */
 
-  /* I think this should be done with a hook.  */
-#ifdef HAVE_WINDOW_SYSTEM
-  if (FRAME_WINDOW_P (f))
-    x_destroy_window (f);
-#endif
+  if (FRAME_TERMINAL (f)->delete_frame_hook)
+    (*FRAME_TERMINAL (f)->delete_frame_hook) (f);
 
-  f->output_data.nothing = 0;
+  {
+    struct terminal *terminal = FRAME_TERMINAL (f);
+    f->output_data.nothing = 0; 
+    f->terminal = 0;             /* Now the frame is dead. */
+
+    /* If needed, delete the terminal that this frame was on.
+       (This must be done after the frame is killed.) */
+    terminal->reference_count--;
+    if (terminal->reference_count == 0)
+      {
+        kb = NULL;
+        if (terminal->delete_terminal_hook)
+          (*terminal->delete_terminal_hook) (terminal);
+        else
+          delete_terminal (terminal);
+      }
+    else
+      kb = terminal->kboard;
+  }
 
   /* If we've deleted the last_nonminibuf_frame, then try to find
      another one.  */
@@ -1332,38 +1581,39 @@ The functions are run with one arg, the frame to be deleted.  */)
 
   /* If there's no other frame on the same kboard, get out of
      single-kboard state if we're in it for this kboard.  */
-  {
-    Lisp_Object frames;
-    /* Some frame we found on the same kboard, or nil if there are none.  */
-    Lisp_Object frame_on_same_kboard;
+  if (kb != NULL)
+    {
+      Lisp_Object frames;
+      /* Some frame we found on the same kboard, or nil if there are none.  */
+      Lisp_Object frame_on_same_kboard;
 
-    frame_on_same_kboard = Qnil;
+      frame_on_same_kboard = Qnil;
 
-    for (frames = Vframe_list;
-        CONSP (frames);
-        frames = XCDR (frames))
-      {
-       Lisp_Object this;
-       struct frame *f1;
+      for (frames = Vframe_list;
+          CONSP (frames);
+          frames = XCDR (frames))
+       {
+         Lisp_Object this;
+         struct frame *f1;
 
-       this = XCAR (frames);
-       if (!FRAMEP (this))
-         abort ();
-       f1 = XFRAME (this);
+         this = XCAR (frames);
+         if (!FRAMEP (this))
+           abort ();
+         f1 = XFRAME (this);
 
-       if (FRAME_KBOARD (f) == FRAME_KBOARD (f1))
-         frame_on_same_kboard = this;
-      }
+         if (kb == FRAME_KBOARD (f1))
+           frame_on_same_kboard = this;
+       }
 
-    if (NILP (frame_on_same_kboard))
-      not_single_kboard_state (FRAME_KBOARD (f));
-  }
+      if (NILP (frame_on_same_kboard))
+       not_single_kboard_state (kb);
+    }
 
 
   /* If we've deleted this keyboard's default_minibuffer_frame, try to
      find another one.  Prefer minibuffer-only frames, but also notice
      frames with other windows.  */
-  if (EQ (frame, FRAME_KBOARD (f)->Vdefault_minibuffer_frame))
+  if (kb != NULL && EQ (frame, kb->Vdefault_minibuffer_frame))
     {
       Lisp_Object frames;
 
@@ -1389,7 +1639,7 @@ The functions are run with one arg, the frame to be deleted.  */)
 
          /* Consider only frames on the same kboard
             and only those with minibuffers.  */
-         if (FRAME_KBOARD (f) == FRAME_KBOARD (f1)
+         if (kb == FRAME_KBOARD (f1)
              && FRAME_HAS_MINIBUF_P (f1))
            {
              frame_with_minibuf = this;
@@ -1397,7 +1647,7 @@ The functions are run with one arg, the frame to be deleted.  */)
                break;
            }
 
-         if (FRAME_KBOARD (f) == FRAME_KBOARD (f1))
+         if (kb == FRAME_KBOARD (f1))
            frame_on_same_kboard = this;
        }
 
@@ -1412,11 +1662,11 @@ The functions are run with one arg, the frame to be deleted.  */)
          if (NILP (frame_with_minibuf))
            abort ();
 
-         FRAME_KBOARD (f)->Vdefault_minibuffer_frame = frame_with_minibuf;
+         kb->Vdefault_minibuffer_frame = frame_with_minibuf;
        }
       else
        /* No frames left on this kboard--say no minibuffer either.  */
-       FRAME_KBOARD (f)->Vdefault_minibuffer_frame = Qnil;
+       kb->Vdefault_minibuffer_frame = Qnil;
     }
 
   /* Cause frame titles to update--necessary if we now have just one frame.  */
@@ -1453,11 +1703,11 @@ and returns whatever that function returns.  */)
 
 #ifdef HAVE_MOUSE
   /* It's okay for the hook to refrain from storing anything.  */
-  if (mouse_position_hook)
-    (*mouse_position_hook) (&f, -1,
-                           &lispy_dummy, &party_dummy,
-                           &x, &y,
-                           &long_dummy);
+  if (FRAME_TERMINAL (f)->mouse_position_hook)
+    (*FRAME_TERMINAL (f)->mouse_position_hook) (&f, -1,
+                                                &lispy_dummy, &party_dummy,
+                                                &x, &y,
+                                                &long_dummy);
   if (! NILP (x))
     {
       col = XINT (x);
@@ -1497,11 +1747,11 @@ and nil for X and Y.  */)
 
 #ifdef HAVE_MOUSE
   /* It's okay for the hook to refrain from storing anything.  */
-  if (mouse_position_hook)
-    (*mouse_position_hook) (&f, -1,
-                           &lispy_dummy, &party_dummy,
-                           &x, &y,
-                           &long_dummy);
+  if (FRAME_TERMINAL (f)->mouse_position_hook)
+    (*FRAME_TERMINAL (f)->mouse_position_hook) (&f, -1,
+                                                &lispy_dummy, &party_dummy,
+                                                &x, &y,
+                                                &long_dummy);
 #endif
   XSETFRAME (lispy_dummy, f);
   return Fcons (lispy_dummy, Fcons (x, y));
@@ -1774,16 +2024,19 @@ doesn't support multiple overlapping frames, this function does nothing.  */)
      (frame)
      Lisp_Object frame;
 {
+  struct frame *f;
   if (NILP (frame))
     frame = selected_frame;
 
   CHECK_LIVE_FRAME (frame);
 
+  f = XFRAME (frame);
+  
   /* Do like the documentation says. */
   Fmake_frame_visible (frame);
 
-  if (frame_raise_lower_hook)
-    (*frame_raise_lower_hook) (XFRAME (frame), 1);
+  if (FRAME_TERMINAL (f)->frame_raise_lower_hook)
+    (*FRAME_TERMINAL (f)->frame_raise_lower_hook) (f, 1);
 
   return Qnil;
 }
@@ -1797,13 +2050,17 @@ doesn't support multiple overlapping frames, this function does nothing.  */)
      (frame)
      Lisp_Object frame;
 {
+  struct frame *f;
+  
   if (NILP (frame))
     frame = selected_frame;
 
   CHECK_LIVE_FRAME (frame);
 
-  if (frame_raise_lower_hook)
-    (*frame_raise_lower_hook) (XFRAME (frame), 0);
+  f = XFRAME (frame);
+  
+  if (FRAME_TERMINAL (f)->frame_raise_lower_hook)
+    (*FRAME_TERMINAL (f)->frame_raise_lower_hook) (f, 0);
 
   return Qnil;
 }
@@ -1837,6 +2094,8 @@ The redirection lasts until `redirect-frame-focus' is called to change it.  */)
      (frame, focus_frame)
      Lisp_Object frame, focus_frame;
 {
+  struct frame *f;
+  
   /* Note that we don't check for a live frame here.  It's reasonable
      to redirect the focus of a frame you're about to delete, if you
      know what other frame should receive those keystrokes.  */
@@ -1845,10 +2104,12 @@ The redirection lasts until `redirect-frame-focus' is called to change it.  */)
   if (! NILP (focus_frame))
     CHECK_LIVE_FRAME (focus_frame);
 
-  XFRAME (frame)->focus_frame = focus_frame;
+  f = XFRAME (frame);
+  
+  f->focus_frame = focus_frame;
 
-  if (frame_rehighlight_hook)
-    (*frame_rehighlight_hook) (XFRAME (frame));
+  if (FRAME_TERMINAL (f)->frame_rehighlight_hook)
+    (*FRAME_TERMINAL (f)->frame_rehighlight_hook) (f);
 
   return Qnil;
 }
@@ -1910,7 +2171,7 @@ set_frame_buffer_list (frame, list)
   XFRAME (frame)->buffer_list = list;
 }
 
-/* Discard BUFFER from the buffer-list of each frame.  */
+/* Discard BUFFER from the buffer-list and buried-buffer-list of each frame.  */
 
 void
 frames_discard_buffer (buffer)
@@ -1922,6 +2183,8 @@ frames_discard_buffer (buffer)
     {
       XFRAME (frame)->buffer_list
        = Fdelq (buffer, XFRAME (frame)->buffer_list);
+      XFRAME (frame)->buried_buffer_list
+        = Fdelq (buffer, XFRAME (frame)->buried_buffer_list);
     }
 }
 
@@ -1980,8 +2243,8 @@ set_term_frame_name (f, name)
                            SBYTES (f->name)))
        return;
 
-      terminal_frame_count++;
-      sprintf (namebuf, "F%d", terminal_frame_count);
+      tty_frame_count++;
+      sprintf (namebuf, "F%d", tty_frame_count);
       name = build_string (namebuf);
     }
   else
@@ -2009,13 +2272,18 @@ store_frame_param (f, prop, val)
 {
   register Lisp_Object old_alist_elt;
 
-  /* The buffer-alist parameter is stored in a special place and is
-     not in the alist.  */
+  /* The buffer-list parameters are stored in a special place and not
+     in the alist.  */
   if (EQ (prop, Qbuffer_list))
     {
       f->buffer_list = val;
       return;
     }
+  if (EQ (prop, Qburied_buffer_list))
+    {
+      f->buried_buffer_list = val;
+      return;
+    }
 
   /* If PROP is a symbol which is supposed to have frame-local values,
      and it is set up based on this frame, switch to the global
@@ -2028,6 +2296,7 @@ store_frame_param (f, prop, val)
       if ((BUFFER_LOCAL_VALUEP (valcontents)
           || SOME_BUFFER_LOCAL_VALUEP (valcontents))
          && XBUFFER_LOCAL_VALUE (valcontents)->check_frame
+         && XBUFFER_LOCAL_VALUE (valcontents)->found_for_frame
          && XFRAME (XBUFFER_LOCAL_VALUE (valcontents)->frame) == f)
        swap_in_global_binding (prop);
     }
@@ -2155,6 +2424,7 @@ If FRAME is omitted, return information on the currently selected frame.  */)
                   : FRAME_MINIBUF_WINDOW (f)));
   store_in_alist (&alist, Qunsplittable, (FRAME_NO_SPLIT_P (f) ? Qt : Qnil));
   store_in_alist (&alist, Qbuffer_list, frame_buffer_list (frame));
+  store_in_alist (&alist, Qburied_buffer_list, XFRAME (frame)->buried_buffer_list);
 
   /* I think this should be done with a hook.  */
 #ifdef HAVE_WINDOW_SYSTEM
@@ -2334,6 +2604,43 @@ enabled such bindings for that variable with `make-variable-frame-local'.  */)
 
   return unbind_to (count, Qnil);
 }
+
+DEFUN ("frame-with-environment", Fframe_with_environment, Sframe_with_environment, 0, 1, 0,
+       doc: /* Return the frame that has the environment variable list for FRAME.
+
+The frame-local environment variable list is normally shared between
+frames that were created in the same Emacsclient session.  The
+environment list is stored in a single frame's 'environment parameter;
+the other frames' 'environment parameter is set to this frame.  This
+function follows the chain of 'environment references to reach the
+frame that stores the actual local environment list, and returns that
+frame.  */)
+     (frame)
+     Lisp_Object frame;
+{
+  Lisp_Object hare, tortoise;
+
+  if (NILP (frame))
+    frame = selected_frame;
+  CHECK_FRAME (frame);
+
+  hare = tortoise = get_frame_param (XFRAME (frame), Qenvironment);
+  while (!NILP (hare) && FRAMEP (hare))
+    {
+      frame = hare;
+      hare = get_frame_param (XFRAME (hare), Qenvironment);
+      if (NILP (hare) || !FRAMEP (hare))
+        break;
+      frame = hare;
+      hare = get_frame_param (XFRAME (hare), Qenvironment);
+      tortoise = get_frame_param (XFRAME (tortoise), Qenvironment);
+      if (EQ (hare, tortoise))
+        error ("Cyclic frame-local environment indirection");
+    }
+
+  return frame;
+}
+
 \f
 DEFUN ("frame-char-height", Fframe_char_height, Sframe_char_height,
        0, 1, 0,
@@ -2750,9 +3057,8 @@ x_set_frame_parameters (f, alist)
              if (NATNUMP (param_index)
                  && (XFASTINT (param_index)
                      < sizeof (frame_parms)/sizeof (frame_parms[0]))
-                 && rif->frame_parm_handlers[XINT (param_index)])
-               (*(rif->frame_parm_handlers[XINT (param_index)])) (f, val, old_value);
-
+                  && FRAME_RIF (f)->frame_parm_handlers[XINT (param_index)])
+                (*(FRAME_RIF (f)->frame_parm_handlers[XINT (param_index)])) (f, val, old_value);
              unbind_to (count, Qnil);
            }
        }
@@ -2796,8 +3102,8 @@ x_set_frame_parameters (f, alist)
          if (NATNUMP (param_index)
              && (XFASTINT (param_index)
                  < sizeof (frame_parms)/sizeof (frame_parms[0]))
-             && rif->frame_parm_handlers[XINT (param_index)])
-           (*(rif->frame_parm_handlers[XINT (param_index)])) (f, val, old_value);
+             && FRAME_RIF (f)->frame_parm_handlers[XINT (param_index)])
+           (*(FRAME_RIF (f)->frame_parm_handlers[XINT (param_index)])) (f, val, old_value);
        }
     }
 
@@ -3035,8 +3341,8 @@ x_set_fullscreen (f, new_value, old_value)
   else if (EQ (new_value, Qfullheight))
     f->want_fullscreen = FULLSCREEN_HEIGHT;
 
-  if (fullscreen_hook != NULL) 
-    fullscreen_hook (f);
+  if (FRAME_TERMINAL (f)->fullscreen_hook != NULL) 
+    FRAME_TERMINAL (f)->fullscreen_hook (f);
 }
 
 
@@ -4008,13 +4314,23 @@ syms_of_frame ()
   staticpro (&Qbuffer_predicate);
   Qbuffer_list = intern ("buffer-list");
   staticpro (&Qbuffer_list);
+  Qburied_buffer_list = intern ("buried-buffer-list");
+  staticpro (&Qburied_buffer_list);
   Qdisplay_type = intern ("display-type");
   staticpro (&Qdisplay_type);
   Qbackground_mode = intern ("background-mode");
   staticpro (&Qbackground_mode);
   Qtty_color_mode = intern ("tty-color-mode");
   staticpro (&Qtty_color_mode);
-
+  Qtty = intern ("tty");
+  staticpro (&Qtty);
+  Qtty_type = intern ("tty-type");
+  staticpro (&Qtty_type);
+  Qwindow_system = intern ("window-system");
+  staticpro (&Qwindow_system);
+  Qenvironment = intern ("environment");
+  staticpro (&Qenvironment);
+  
   Qface_set_after_frame_default = intern ("face-set-after-frame-default");
   staticpro (&Qface_set_after_frame_default);
 
@@ -4034,6 +4350,11 @@ syms_of_frame ()
   Qx_frame_parameter = intern ("x-frame-parameter");
   staticpro (&Qx_frame_parameter);
 
+  Qterminal = intern ("terminal");
+  staticpro (&Qterminal);
+  Qterminal_live_p = intern ("terminal-live-p");
+  staticpro (&Qterminal_live_p);
+  
   {
     int i;
 
@@ -4082,6 +4403,7 @@ These may be set in your init file, like this:
 These override values given in window system configuration data,
  including X Windows' defaults database.
 For values specific to the first Emacs frame, see `initial-frame-alist'.
+For window-system specific values, see `window-system-default-frame-alist'.
 For values specific to the separate minibuffer frame, see
  `minibuffer-frame-alist'.
 The `menu-bar-lines' element of the list controls whether new frames
@@ -4107,7 +4429,7 @@ Setting this variable does not affect existing frames, only new ones.  */);
   staticpro (&Qinhibit_default_face_x_resources);
 
   DEFVAR_LISP ("terminal-frame", &Vterminal_frame,
-              doc: /* The initial frame-object, which represents Emacs's stdout.  */);
+               doc: /* The initial frame-object, which represents Emacs's stdout.  */);
 
   DEFVAR_LISP ("emacs-iconified", &Vemacs_iconified,
               doc: /* Non-nil if all of Emacs is iconified and frame updates are not needed.  */);
@@ -4132,7 +4454,14 @@ when the mouse is over clickable text.  */);
   DEFVAR_LISP ("delete-frame-functions", &Vdelete_frame_functions,
               doc: /* Functions to be run before deleting a frame.
 The functions are run with one arg, the frame to be deleted.
-See `delete-frame'.  */);
+See `delete-frame'.
+
+Note that functions in this list may be called twice on the same
+frame.  In the second invocation, the frame is already deleted, and
+the function should do nothing.  (You can use `frame-live-p' to check
+for this.)  This wrinkle happens when an earlier function in
+`delete-frame-functions' (indirectly) calls delete-frame
+recursively.  */);
   Vdelete_frame_functions = Qnil;
 
   DEFVAR_KBOARD ("default-minibuffer-frame", Vdefault_minibuffer_frame,
@@ -4155,6 +4484,7 @@ This variable is local to the current terminal and cannot be buffer-local.  */);
   defsubr (&Sactive_minibuffer_window);
   defsubr (&Sframep);
   defsubr (&Sframe_live_p);
+  defsubr (&Swindow_system);
   defsubr (&Smake_terminal_frame);
   defsubr (&Shandle_switch_frame);
   defsubr (&Sselect_frame);
@@ -4188,6 +4518,7 @@ This variable is local to the current terminal and cannot be buffer-local.  */);
   defsubr (&Sframe_parameters);
   defsubr (&Sframe_parameter);
   defsubr (&Smodify_frame_parameters);
+  defsubr (&Sframe_with_environment);
   defsubr (&Sframe_char_height);
   defsubr (&Sframe_char_width);
   defsubr (&Sframe_pixel_height);
index 50e7c06..9e3813c 100644 (file)
@@ -29,9 +29,7 @@ Boston, MA 02110-1301, USA.  */
 \f
 /* Miscellanea.  */
 
-/* Nonzero means don't assume anything about current contents of
-   actual terminal frame */
-
+/* Nonzero means there is at least one garbaged frame. */
 extern int frame_garbaged;
 
 /* Nonzero means FRAME_MESSAGE_BUF (selected_frame) is being used by
@@ -44,6 +42,7 @@ extern int message_buf_print;
 
 enum output_method
 {
+  output_initial,
   output_termcap,
   output_x_window,
   output_msdos_raw,
@@ -68,30 +67,10 @@ enum text_cursor_kinds
   HBAR_CURSOR
 };
 
-#if !defined(MSDOS) && !defined(WINDOWSNT) && !defined(MAC_OS)
-
-#if !defined(HAVE_X_WINDOWS)
-
-#define PIX_TYPE int
-
-/* A (mostly empty) x_output structure definition for building Emacs
-   on Unix and GNU/Linux without X support.  */
-struct x_output
-{
-  PIX_TYPE background_pixel;
-  PIX_TYPE foreground_pixel;
-};
-
-#endif /* ! HAVE_X_WINDOWS */
-
+#define FRAME_FOREGROUND_PIXEL(f) ((f)->foreground_pixel)
+#define FRAME_BACKGROUND_PIXEL(f) ((f)->background_pixel)
 
-#define FRAME_FOREGROUND_PIXEL(f) ((f)->output_data.x->foreground_pixel)
-#define FRAME_BACKGROUND_PIXEL(f) ((f)->output_data.x->background_pixel)
-
-/* A structure describing a termcap frame display.  */
-extern struct x_output tty_display;
-
-#endif /* ! MSDOS && ! WINDOWSNT && ! MAC_OS */
+struct terminal;
 
 struct frame
 {
@@ -153,7 +132,7 @@ struct frame
      Actually, we don't specify exactly what is stored here at all; the
      scroll bar implementation code can use it to store anything it likes.
      This field is marked by the garbage collector.  It is here
-     instead of in the `display' structure so that the garbage
+     instead of in the `device' structure so that the garbage
      collector doesn't need to look inside the window-system-dependent
      structure.  */
   Lisp_Object scroll_bars;
@@ -182,6 +161,10 @@ struct frame
   /* List of buffers viewed in this frame, for other-buffer.  */
   Lisp_Object buffer_list;
 
+  /* List of buffers that were viewed, then buried in this frame.  The
+     most recently buried buffer is first.  For last-buffer.  */
+  Lisp_Object buried_buffer_list;
+  
   /* A dummy window used to display menu bars under X when no X
      toolkit support is available.  */
   Lisp_Object menu_bar_window;
@@ -283,20 +266,24 @@ struct frame
   /* Canonical Y unit.  Height of a line, in pixels.  */
   int line_height;
 
-  /* The output method says how the contents of this frame
-     are displayed.  It could be using termcap, or using an X window.  */
+  /* The output method says how the contents of this frame are
+     displayed.  It could be using termcap, or using an X window.
+     This must be the same as the terminal->type. */
   enum output_method output_method;
 
-  /* A structure of auxiliary data used for displaying the contents.
-     struct x_output is used for X window frames;
-     it is defined in xterm.h.
-     struct w32_output is used for W32 window frames;
-     it is defined in w32term.h.  */
+  /* The terminal device that this frame uses.  If this is NULL, then
+     the frame has been deleted. */
+  struct terminal *terminal;
+  
+  /* Device-dependent, frame-local auxiliary data used for displaying
+     the contents.  When the frame is deleted, this data is deleted as
+     well. */
   union output_data
   {
-    struct x_output *x;
-    struct w32_output *w32;
-    struct mac_output *mac;
+    struct tty_output *tty;     /* termchar.h */
+    struct x_output *x;         /* xterm.h */
+    struct w32_output *w32;     /* w32term.h */
+    struct mac_output *mac;     /* macterm.h */
     EMACS_INT nothing;
   }
   output_data;
@@ -311,13 +298,6 @@ struct frame
   /* The extra width (in pixels) currently allotted for fringes.  */
   int left_fringe_width, right_fringe_width;
 
-#ifdef MULTI_KBOARD
-  /* A pointer to the kboard structure associated with this frame.
-     For termcap frames, this points to initial_kboard.  For X frames,
-     it will be the same as display.x->display_info->kboard.  */
-  struct kboard *kboard;
-#endif
-
   /* See FULLSCREEN_ enum below */
   int want_fullscreen;
 
@@ -341,13 +321,13 @@ struct frame
      frame becomes visible again, it must be marked as garbaged.  The
      FRAME_SAMPLE_VISIBILITY macro takes care of this.
 
-     On Windows NT/9X, to avoid wasting effort updating visible frames
-     that are actually completely obscured by other windows on the
-     display, we bend the meaning of visible slightly: if greater than
-     1, then the frame is obscured - we still consider it to be
-     "visible" as seen from lisp, but we don't bother updating it.  We
-     must take care to garbage the frame when it ceaces to be obscured
-     though.  Note that these semantics are only used on NT/9X.
+     On ttys and on Windows NT/9X, to avoid wasting effort updating
+     visible frames that are actually completely obscured by other
+     windows on the display, we bend the meaning of visible slightly:
+     if greater than 1, then the frame is obscured - we still consider
+     it to be "visible" as seen from lisp, but we don't bother
+     updating it.  We must take care to garbage the frame when it
+     ceaces to be obscured though.
 
      iconified is nonzero if the frame is currently iconified.
 
@@ -441,7 +421,7 @@ struct frame
   /* The baud rate that was used to calculate costs for this frame.  */
   int cost_calculation_baud_rate;
 
-  /* Nonzero if the mouse has moved on this display
+  /* Nonzero if the mouse has moved on this display device
      since the last time we checked.  */
   char mouse_moved;
 
@@ -460,7 +440,11 @@ struct frame
   /* Set to non-zero in when we want for force a flush_display in
      update_frame, usually after resizing the frame.  */
   unsigned force_flush_display_p : 1;
-
+  
+  /* All display backends seem to need these two pixel values. */
+  unsigned long background_pixel;
+  unsigned long foreground_pixel;
+  
   /* Set to non-zero if the default face for the frame has been
      realized.  Reset to zero whenever the default face changes.
      Used to see the difference between a font change and face change.  */
@@ -475,7 +459,7 @@ struct frame
 };
 
 #ifdef MULTI_KBOARD
-#define FRAME_KBOARD(f) ((f)->kboard)
+#define FRAME_KBOARD(f) ((f)->terminal->kboard)
 #else
 #define FRAME_KBOARD(f) (&the_only_kboard)
 #endif
@@ -489,6 +473,7 @@ typedef struct frame *FRAME_PTR;
 #define WINDOW_FRAME(w) (w)->frame
 
 /* Test a frame for particular kinds of display methods.  */
+#define FRAME_INITIAL_P(f) ((f)->output_method == output_initial)
 #define FRAME_TERMCAP_P(f) ((f)->output_method == output_termcap)
 #define FRAME_X_P(f) ((f)->output_method == output_x_window)
 #define FRAME_W32_P(f) ((f)->output_method == output_w32)
@@ -512,7 +497,7 @@ typedef struct frame *FRAME_PTR;
 #endif
 
 /* Nonzero if frame F is still alive (not deleted).  */
-#define FRAME_LIVE_P(f) ((f)->output_data.nothing != 0)
+#define FRAME_LIVE_P(f) ((f)->terminal != 0)
 
 /* Nonzero if frame F is a minibuffer-only frame.  */
 #define FRAME_MINIBUF_ONLY_P(f) \
@@ -752,7 +737,10 @@ typedef struct frame *FRAME_PTR;
 
    Also, if a frame used to be invisible, but has just become visible,
    it must be marked as garbaged, since redisplay hasn't been keeping
-   up its contents.  */
+   up its contents.
+
+   Note that a tty frame is visible if and only if it is the topmost
+   frame. */
 
 #define FRAME_SAMPLE_VISIBILITY(f) \
   (((f)->async_visible && (f)->visible != (f)->async_visible) ? \
@@ -785,10 +773,14 @@ typedef struct frame *FRAME_PTR;
 
 
 extern Lisp_Object Qframep, Qframe_live_p;
+extern Lisp_Object Qtty, Qtty_type;
+extern Lisp_Object Qterminal, Qterminal_live_p;
+extern Lisp_Object Qenvironment;
 
 extern struct frame *last_nonminibuf_frame;
 
-extern struct frame *make_terminal_frame P_ ((void));
+extern struct frame *make_initial_frame P_ ((void));
+extern struct frame *make_terminal_frame P_ ((struct terminal *));
 extern struct frame *make_frame P_ ((int));
 #ifdef HAVE_WINDOW_SYSTEM
 extern struct frame *make_minibuffer_frame P_ ((void));
@@ -988,7 +980,7 @@ extern Lisp_Object selected_frame;
 
 extern Lisp_Object Qauto_raise, Qauto_lower;
 extern Lisp_Object Qborder_color, Qborder_width;
-extern Lisp_Object Qbuffer_predicate, Qbuffer_list;
+extern Lisp_Object Qbuffer_predicate, Qbuffer_list, Qburied_buffer_list;
 extern Lisp_Object Qcursor_color, Qcursor_type;
 extern Lisp_Object Qfont;
 extern Lisp_Object Qbackground_color, Qforeground_color;
@@ -1020,6 +1012,8 @@ extern Lisp_Object Qx_resource_name;
 extern Lisp_Object Qleft, Qright, Qtop, Qbox;
 extern Lisp_Object Qdisplay;
 
+extern Lisp_Object Qwindow_system;
+
 #ifdef HAVE_WINDOW_SYSTEM
 
 /* The class of this X application.  */
index 033832f..dd885be 100644 (file)
@@ -29,6 +29,7 @@ Boston, MA 02110-1301, USA.  */
 #include "dispextern.h"
 #include "buffer.h"
 #include "blockinput.h"
+#include "termhooks.h"
 
 #ifdef HAVE_WINDOW_SYSTEM
 
@@ -686,7 +687,7 @@ draw_fringe_bitmap_1 (w, row, left_p, overlay, which)
       break;
     }
 
-  rif->draw_fringe_bitmap (w, row, &p);
+  FRAME_RIF (f)->draw_fringe_bitmap (w, row, &p);
 }
 
 static int
@@ -1278,6 +1279,8 @@ destroy_fringe_bitmap (n)
   fbp = &fringe_bitmaps[n];
   if (*fbp && (*fbp)->dynamic)
     {
+      /* XXX Is SELECTED_FRAME OK here? */
+      struct redisplay_interface *rif = FRAME_RIF (SELECTED_FRAME ());
       if (rif && rif->destroy_fringe_bitmap)
        rif->destroy_fringe_bitmap (n);
       xfree (*fbp);
@@ -1383,6 +1386,9 @@ init_fringe_bitmap (which, fb, once_p)
 
   if (!once_p)
     {
+      /* XXX Is SELECTED_FRAME OK here? */
+      struct redisplay_interface *rif = FRAME_RIF (SELECTED_FRAME ());
+
       destroy_fringe_bitmap (which);
 
       if (rif && rif->define_fringe_bitmap)
index f7b9f8c..17bf2d2 100644 (file)
@@ -865,7 +865,7 @@ xg_create_frame_widgets (f)
 
   /* Since GTK clears its window by filling with the background color,
      we must keep X and GTK background in sync.  */
-  xg_pix_to_gcolor (wfixed, f->output_data.x->background_pixel, &bg);
+  xg_pix_to_gcolor (wfixed, FRAME_BACKGROUND_PIXEL (f), &bg);
   gtk_widget_modify_bg (wfixed, GTK_STATE_NORMAL, &bg);
 
   /* Also, do not let any background pixmap to be set, this looks very
@@ -2044,7 +2044,7 @@ xg_create_one_menuitem (item, f, select_cb, highlight_cb, cl_data, group)
   return w;
 }
 
-/* Callback called when keyboard traversal (started by menu-bar-open) ends.
+/* Callback called when keyboard traversal (started by x-menu-bar-open) ends.
    WMENU is the menu for which traversal has been done.  DATA points to the
    frame for WMENU.  We must release grabs, some bad interaction between GTK
    and Emacs makes the menus keep the grabs.  */
index f4616b6..8f13da3 100644 (file)
@@ -1826,7 +1826,7 @@ lookup_image (f, spec)
      struct frame *f;
      Lisp_Object spec;
 {
-  struct image_cache *c = FRAME_X_IMAGE_CACHE (f);
+  struct image_cache *c;
   struct image *img;
   int i;
   unsigned hash;
@@ -1838,6 +1838,8 @@ lookup_image (f, spec)
   xassert (FRAME_WINDOW_P (f));
   xassert (valid_image_p (spec));
 
+  c = FRAME_X_IMAGE_CACHE (f);
+
   GCPRO1 (spec);
 
   /* Look up SPEC in the hash table of the image cache.  */
index a30ef6e..e840599 100644 (file)
@@ -20,6 +20,8 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 Boston, MA 02110-1301, USA.  */
 
 #include <config.h>
+#include <stdio.h>
+
 #include "lisp.h"
 #include "buffer.h"
 #include "charset.h"
index 89b2644..052b55d 100644 (file)
@@ -88,7 +88,7 @@ struct interval
 
 #ifdef ENABLE_CHECKING
 #define NULL_INTERVAL_P(i) \
-   (CHECK (!INT_LISPLIKE (i), "non-interval"), (i) == NULL_INTERVAL)
+  ((void)CHECK (!INT_LISPLIKE (i), "non-interval"), (i) == NULL_INTERVAL)
 /* old #define NULL_INTERVAL_P(i) ((i) == NULL_INTERVAL || INT_LISPLIKE (i)) */
 #else
 #define NULL_INTERVAL_P(i) ((i) == NULL_INTERVAL)
index 384fc88..2f4879d 100644 (file)
@@ -23,13 +23,13 @@ Boston, MA 02110-1301, USA.  */
 #include <config.h>
 #include <signal.h>
 #include <stdio.h>
+#include "lisp.h"
 #include "termchar.h"
 #include "termopts.h"
-#include "lisp.h"
+#include "frame.h"
 #include "termhooks.h"
 #include "macros.h"
 #include "keyboard.h"
-#include "frame.h"
 #include "window.h"
 #include "commands.h"
 #include "buffer.h"
@@ -59,7 +59,6 @@ Boston, MA 02110-1301, USA.  */
 #endif /* not MSDOS */
 
 #include "syssignal.h"
-#include "systty.h"
 
 #include <sys/types.h>
 #ifdef HAVE_UNISTD_H
@@ -97,9 +96,6 @@ int interrupt_input_blocked;
 int interrupt_input_pending;
 
 
-/* File descriptor to use for input.  */
-extern int input_fd;
-
 #ifdef HAVE_WINDOW_SYSTEM
 /* Make all keyboard buffers much bigger when using X windows.  */
 #ifdef MAC_OS8
@@ -425,16 +421,6 @@ Lisp_Object Vecho_keystrokes;
 /* Form to evaluate (if non-nil) when Emacs is started.  */
 Lisp_Object Vtop_level;
 
-/* User-supplied table to translate input characters.  */
-Lisp_Object Vkeyboard_translate_table;
-
-/* Keymap mapping ASCII function key sequences onto their preferred forms.  */
-extern Lisp_Object Vfunction_key_map;
-
-/* Another keymap that maps key sequences into key sequences.
-   This one takes precedence over ordinary definitions.  */
-extern Lisp_Object Vkey_translation_map;
-
 /* If non-nil, this implements the current input method.  */
 Lisp_Object Vinput_method_function;
 Lisp_Object Qinput_method_function;
@@ -458,6 +444,12 @@ Lisp_Object Qpre_command_hook, Vpre_command_hook;
 Lisp_Object Qpost_command_hook, Vpost_command_hook;
 Lisp_Object Qcommand_hook_internal, Vcommand_hook_internal;
 
+/* Parent keymap of terminal-local function-key-map instances.  */
+Lisp_Object Vfunction_key_map;
+
+/* Parent keymap of terminal-local key-translation-map instances.  */
+Lisp_Object Vkey_translation_map;
+
 /* List of deferred actions to be performed at a later time.
    The precise format isn't relevant here; we just check whether it is nil.  */
 Lisp_Object Vdeferred_action_list;
@@ -475,11 +467,6 @@ FILE *dribble;
 /* Nonzero if input is available.  */
 int input_pending;
 
-/* 1 if should obey 0200 bit in input chars as "Meta", 2 if should
-   keep 0200 bit in input chars.  0 to ignore the 0200 bit.  */
-
-int meta_key;
-
 extern char *pending_malloc_warning;
 
 /* Circular buffer for pre-read keyboard input.  */
@@ -609,9 +596,6 @@ int interrupt_input;
 /* Nonzero while interrupts are temporarily deferred during redisplay.  */
 int interrupts_deferred;
 
-/* Nonzero means use ^S/^Q for flow control.  */
-int flow_control;
-
 /* Allow m- file to inhibit use of FIONREAD.  */
 #ifdef BROKEN_FIONREAD
 #undef FIONREAD
@@ -694,8 +678,9 @@ static void save_getcjmp ();
 static void restore_getcjmp P_ ((jmp_buf));
 static Lisp_Object apply_modifiers P_ ((int, Lisp_Object));
 static void clear_event P_ ((struct input_event *));
-static void any_kboard_state P_ ((void));
+static Lisp_Object restore_kboard_configuration P_ ((Lisp_Object));
 static SIGTYPE interrupt_signal P_ ((int signalnum));
+static void handle_interrupt P_ ((void));
 static void timer_start_idle P_ ((void));
 static void timer_stop_idle P_ ((void));
 static void timer_resume_idle P_ ((void));
@@ -1058,24 +1043,20 @@ This function is called by the editor initialization to begin editing.  */)
      like it is done in the splash screen display, we have to
      make sure that we restore single_kboard as command_loop_1
      would have done if it were left normally.  */
-  record_unwind_protect (recursive_edit_unwind,
-                        Fcons (buffer, single_kboard ? Qt : Qnil));
+  if (command_loop_level > 0)
+    temporarily_switch_to_single_kboard (SELECTED_FRAME ());
+  record_unwind_protect (recursive_edit_unwind, buffer);
 
   recursive_edit_1 ();
   return unbind_to (count, Qnil);
 }
 
 Lisp_Object
-recursive_edit_unwind (info)
-     Lisp_Object info;
+recursive_edit_unwind (buffer)
+     Lisp_Object buffer;
 {
-  if (BUFFERP (XCAR (info)))
-    Fset_buffer (XCAR (info));
-
-  if (NILP (XCDR (info)))
-    any_kboard_state ();
-  else
-    single_kboard_state ();
+  if (BUFFERP (buffer))
+    Fset_buffer (buffer);
 
   command_loop_level--;
   update_mode_lines = 1;
@@ -1083,6 +1064,8 @@ recursive_edit_unwind (info)
 }
 
 \f
+#if 0  /* These two functions are now replaced with
+          temporarily_switch_to_single_kboard. */
 static void
 any_kboard_state ()
 {
@@ -1113,6 +1096,7 @@ single_kboard_state ()
   single_kboard = 1;
 #endif
 }
+#endif
 
 /* If we're in single_kboard state for kboard KBOARD,
    get out of it.  */
@@ -1140,8 +1124,8 @@ struct kboard_stack
 static struct kboard_stack *kboard_stack;
 
 void
-push_frame_kboard (f)
-     FRAME_PTR f;
+push_kboard (k)
+     struct kboard *k;
 {
 #ifdef MULTI_KBOARD
   struct kboard_stack *p
@@ -1151,20 +1135,107 @@ push_frame_kboard (f)
   p->kboard = current_kboard;
   kboard_stack = p;
 
-  current_kboard = FRAME_KBOARD (f);
+  current_kboard = k;
 #endif
 }
 
 void
-pop_frame_kboard ()
+pop_kboard ()
 {
 #ifdef MULTI_KBOARD
+  struct terminal *t;
   struct kboard_stack *p = kboard_stack;
-  current_kboard = p->kboard;
+  int found = 0;
+  for (t = terminal_list; t; t = t->next_terminal)
+    {
+      if (t->kboard == p->kboard)
+        {
+          current_kboard = p->kboard;
+          found = 1;
+          break;
+        }
+    }
+  if (!found)
+    {
+      /* The terminal we remembered has been deleted.  */
+      current_kboard = FRAME_KBOARD (SELECTED_FRAME ());
+      single_kboard = 0;
+    }
   kboard_stack = p->next;
   xfree (p);
 #endif
 }
+
+/* Switch to single_kboard mode, making current_kboard the only KBOARD
+  from which further input is accepted.  If F is non-nil, set its
+  KBOARD as the current keyboard.
+
+  This function uses record_unwind_protect to return to the previous
+  state later.
+
+  If Emacs is already in single_kboard mode, and F's keyboard is
+  locked, then this function will throw an errow.  */
+
+void
+temporarily_switch_to_single_kboard (f)
+     struct frame *f;
+{
+#ifdef MULTI_KBOARD
+  int was_locked = single_kboard;
+  if (was_locked)
+    {
+      if (f != NULL && FRAME_KBOARD (f) != current_kboard)
+        /* We can not switch keyboards while in single_kboard mode.
+           In rare cases, Lisp code may call `recursive-edit' (or
+           `read-minibuffer' or `y-or-n-p') after it switched to a
+           locked frame.  For example, this is likely to happen
+           when server.el connects to a new terminal while Emacs is in
+           single_kboard mode.  It is best to throw an error instead
+           of presenting the user with a frozen screen.  */
+        error ("Terminal %d is locked, cannot read from it",
+               FRAME_TERMINAL (f)->id);
+      else
+        /* This call is unnecessary, but helps
+           `restore_kboard_configuration' discover if somebody changed
+           `current_kboard' behind our back.  */
+        push_kboard (current_kboard);
+    }
+  else if (f != NULL)
+    current_kboard = FRAME_KBOARD (f);
+  single_kboard = 1;
+  record_unwind_protect (restore_kboard_configuration,
+                         (was_locked ? Qt : Qnil));
+#endif
+}
+
+#if 0 /* This function is not needed anymore.  */
+void
+record_single_kboard_state ()
+{
+  if (single_kboard)
+    push_kboard (current_kboard);
+  record_unwind_protect (restore_kboard_configuration,
+                         (single_kboard ? Qt : Qnil));
+}
+#endif
+
+static Lisp_Object
+restore_kboard_configuration (was_locked)
+     Lisp_Object was_locked;
+{
+  if (NILP (was_locked))
+    single_kboard = 0;
+  else
+    {
+      struct kboard *prev = current_kboard;
+      single_kboard = 1;
+      pop_kboard ();
+      /* The pop should not change the kboard.  */
+      if (single_kboard && current_kboard != prev)
+        abort ();
+    }
+  return Qnil;
+}
 \f
 /* Handle errors that are not handled at inner levels
    by printing an error message and returning to the editor command loop.  */
@@ -1212,9 +1283,11 @@ cmd_error (data)
   Vquit_flag = Qnil;
 
   Vinhibit_quit = Qnil;
+#if 0 /* This shouldn't be necessary anymore. --lorentey */
 #ifdef MULTI_KBOARD
   if (command_loop_level == 0 && minibuf_level == 0)
     any_kboard_state ();
+#endif
 #endif
 
   return make_number (0);
@@ -1251,11 +1324,7 @@ cmd_error_internal (data, context)
   /* If the window system or terminal frame hasn't been initialized
      yet, or we're not interactive, write the message to stderr and exit.  */
   else if (!sf->glyphs_initialized_p
-          /* This is the case of the frame dumped with Emacs, when we're
-             running under a window system.  */
-          || (!NILP (Vwindow_system)
-              && !inhibit_window_system
-              && FRAME_TERMCAP_P (sf))
+          || FRAME_INITIAL_P (sf)
           || noninteractive)
     {
       print_error_message (data, Qexternal_debugging_output,
@@ -1298,10 +1367,12 @@ command_loop ()
     while (1)
       {
        internal_catch (Qtop_level, top_level_1, Qnil);
-       /* Reset single_kboard in case top-level set it while
-          evaluating an -f option, or we are stuck there for some
-          other reason.  */
-       any_kboard_state ();
+#if 0 /* This shouldn't be necessary anymore.  --lorentey  */
+        /* Reset single_kboard in case top-level set it while
+           evaluating an -f option, or we are stuck there for some
+           other reason. */
+        any_kboard_state ();
+#endif
        internal_catch (Qtop_level, command_loop_2, Qnil);
        executing_kbd_macro = Qnil;
 
@@ -1484,10 +1555,12 @@ command_loop_1 ()
   int no_direct;
   int prev_modiff = 0;
   struct buffer *prev_buffer = NULL;
+#if 0 /* This shouldn't be necessary anymore.  --lorentey  */
 #ifdef MULTI_KBOARD
   int was_locked = single_kboard;
 #endif
-  int already_adjusted;
+#endif  
+  int already_adjusted = 0;
 
   current_kboard->Vprefix_arg = Qnil;
   current_kboard->Vlast_prefix_arg = Qnil;
@@ -1946,10 +2019,11 @@ command_loop_1 ()
       if (!NILP (current_kboard->defining_kbd_macro)
          && NILP (current_kboard->Vprefix_arg))
        finalize_kbd_macro_chars ();
-
+#if 0 /* This shouldn't be necessary anymore.  --lorentey  */
 #ifdef MULTI_KBOARD
       if (!was_locked)
-       any_kboard_state ();
+        any_kboard_state ();
+#endif
 #endif
     }
 }
@@ -2188,7 +2262,10 @@ void
 start_polling ()
 {
 #ifdef POLL_FOR_INPUT
-  if (read_socket_hook && !interrupt_input)
+  /* XXX This condition was (read_socket_hook && !interrupt_input),
+     but read_socket_hook is not global anymore.  Let's pretend that
+     it's always set. */
+  if (!interrupt_input)
     {
       /* Turn alarm handling on unconditionally.  It might have
         been turned off in process.c.  */
@@ -2222,7 +2299,10 @@ int
 input_polling_used ()
 {
 #ifdef POLL_FOR_INPUT
-  return read_socket_hook && !interrupt_input;
+  /* XXX This condition was (read_socket_hook && !interrupt_input),
+     but read_socket_hook is not global anymore.  Let's pretend that
+     it's always set. */
+  return !interrupt_input;
 #else
   return 0;
 #endif
@@ -2234,7 +2314,10 @@ void
 stop_polling ()
 {
 #ifdef POLL_FOR_INPUT
-  if (read_socket_hook && !interrupt_input)
+  /* XXX This condition was (read_socket_hook && !interrupt_input),
+     but read_socket_hook is not global anymore.  Let's pretend that
+     it's always set. */
+  if (!interrupt_input)
     ++poll_suppress_count;
 #endif
 }
@@ -2435,10 +2518,6 @@ Lisp_Object print_help ();
 static Lisp_Object kbd_buffer_get_event ();
 static void record_char ();
 
-#ifdef MULTI_KBOARD
-static jmp_buf wrong_kboard_jmpbuf;
-#endif
-
 #define STOP_POLLING                                   \
 do { if (! polling_stopped_here) stop_polling ();      \
        polling_stopped_here = 1; } while (0)
@@ -2465,6 +2544,9 @@ do { if (polling_stopped_here) start_polling ();  \
    if we used a mouse menu to read the input, or zero otherwise.  If
    USED_MOUSE_MENU is null, we don't dereference it.
 
+   Value is -2 when we find input on another keyboard.  A second call
+   to read_char will read it. 
+
    If END_TIME is non-null, it is a pointer to an EMACS_TIME
    specifying the maximum time to wait until.  If no input arrives by
    that time, stop waiting and return nil.
@@ -2491,6 +2573,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
   volatile int reread;
   struct gcpro gcpro1, gcpro2;
   int polling_stopped_here = 0;
+  struct kboard *orig_kboard = current_kboard;
 
   also_record = Qnil;
 
@@ -2705,6 +2788,10 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
       && !detect_input_pending_run_timers (0))
     {
       c = read_char_minibuf_menu_prompt (commandflag, nmaps, maps);
+
+      if (INTEGERP (c) && XINT (c) == -2)
+        return c;               /* wrong_kboard_jmpbuf */
+
       if (! NILP (c))
        {
          key_already_recorded = 1;
@@ -2721,6 +2808,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
   jmpcount = SPECPDL_INDEX ();
   if (_setjmp (local_getcjmp))
     {
+      /* Handle quits while reading the keyboard.  */
       /* We must have saved the outer value of getcjmp here,
         so restore it now.  */
       restore_getcjmp (save_jump);
@@ -2758,7 +2846,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
            /* This is going to exit from read_char
               so we had better get rid of this frame's stuff.  */
            UNGCPRO;
-           longjmp (wrong_kboard_jmpbuf, 1);
+            return make_number (-2); /* wrong_kboard_jmpbuf */
          }
       }
 #endif
@@ -2895,6 +2983,19 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
        }
     }
 
+  /* Notify the caller if an autosave hook, or a timer, sentinel or
+     filter in the sit_for calls above have changed the current
+     kboard.  This could happen if they use the minibuffer or start a
+     recursive edit, like the fancy splash screen in server.el's
+     filter.  If this longjmp wasn't here, read_key_sequence would
+     interpret the next key sequence using the wrong translation
+     tables and function keymaps.  */
+  if (NILP (c) && current_kboard != orig_kboard)
+    {
+      UNGCPRO;
+      return make_number (-2);  /* wrong_kboard_jmpbuf */
+    }
+
   /* If this has become non-nil here, it has been set by a timer
      or sentinel or filter.  */
   if (CONSP (Vunread_command_events))
@@ -2943,7 +3044,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
            /* This is going to exit from read_char
               so we had better get rid of this frame's stuff.  */
            UNGCPRO;
-           longjmp (wrong_kboard_jmpbuf, 1);
+            return make_number (-2); /* wrong_kboard_jmpbuf */
          }
     }
 #endif
@@ -2999,7 +3100,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
          /* This is going to exit from read_char
             so we had better get rid of this frame's stuff.  */
          UNGCPRO;
-         longjmp (wrong_kboard_jmpbuf, 1);
+          return make_number (-2);
        }
 #endif
     }
@@ -3054,8 +3155,12 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
 
   if (!NILP (tem))
     {
+#if 0 /* This shouldn't be necessary anymore. --lorentey  */
       int was_locked = single_kboard;
-
+      int count = SPECPDL_INDEX ();
+      record_single_kboard_state ();
+#endif
+      
       last_input_char = c;
       Fcommand_execute (tem, Qnil, Fvector (1, &last_input_char), Qt);
 
@@ -3066,9 +3171,12 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
           example banishing the mouse under mouse-avoidance-mode.  */
        timer_resume_idle ();
 
+#if 0 /* This shouldn't be necessary anymore. --lorentey  */
       /* Resume allowing input from any kboard, if that was true before.  */
       if (!was_locked)
        any_kboard_state ();
+      unbind_to (count, Qnil);
+#endif
 
       goto retry;
     }
@@ -3080,15 +3188,15 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
       if (XINT (c) == -1)
        goto exit;
 
-      if ((STRINGP (Vkeyboard_translate_table)
-          && SCHARS (Vkeyboard_translate_table) > (unsigned) XFASTINT (c))
-         || (VECTORP (Vkeyboard_translate_table)
-             && XVECTOR (Vkeyboard_translate_table)->size > (unsigned) XFASTINT (c))
-         || (CHAR_TABLE_P (Vkeyboard_translate_table)
+      if ((STRINGP (current_kboard->Vkeyboard_translate_table)
+          && SCHARS (current_kboard->Vkeyboard_translate_table) > (unsigned) XFASTINT (c))
+         || (VECTORP (current_kboard->Vkeyboard_translate_table)
+             && XVECTOR (current_kboard->Vkeyboard_translate_table)->size > (unsigned) XFASTINT (c))
+         || (CHAR_TABLE_P (current_kboard->Vkeyboard_translate_table)
              && CHAR_VALID_P (XINT (c), 0)))
        {
          Lisp_Object d;
-         d = Faref (Vkeyboard_translate_table, c);
+         d = Faref (current_kboard->Vkeyboard_translate_table, c);
          /* nil in keyboard-translate-table means no translation.  */
          if (!NILP (d))
            c = d;
@@ -3699,12 +3807,10 @@ kbd_buffer_store_event_hold (event, hold_quit)
       if (c == quit_char)
        {
 #ifdef MULTI_KBOARD
-         KBOARD *kb;
+         KBOARD *kb = FRAME_KBOARD (XFRAME (event->frame_or_window));
          struct input_event *sp;
 
-         if (single_kboard
-             && (kb = FRAME_KBOARD (XFRAME (event->frame_or_window)),
-                 kb != current_kboard))
+         if (single_kboard && kb != current_kboard)
            {
              kb->kbd_queue
                = Fcons (make_lispy_switch_frame (event->frame_or_window),
@@ -3747,7 +3853,7 @@ kbd_buffer_store_event_hold (event, hold_quit)
          }
 
          last_event_timestamp = event->timestamp;
-         interrupt_signal (0 /* dummy */);
+         handle_interrupt ();
          return;
        }
 
@@ -4226,11 +4332,15 @@ kbd_buffer_get_event (kbp, used_mouse_menu, end_time)
       unsigned long time;
 
       *kbp = current_kboard;
-      /* Note that this uses F to determine which display to look at.
+      /* Note that this uses F to determine which terminal to look at.
         If there is no valid info, it does not store anything
         so x remains nil.  */
       x = Qnil;
-      (*mouse_position_hook) (&f, 0, &bar_window, &part, &x, &y, &time);
+
+      /* XXX Can f or mouse_position_hook be NULL here? */
+      if (f && FRAME_TERMINAL (f)->mouse_position_hook)
+        (*FRAME_TERMINAL (f)->mouse_position_hook) (&f, 0, &bar_window,
+                                                    &part, &x, &y, &time);
 
       obj = Qnil;
 
@@ -4527,10 +4637,14 @@ timer_check (do_it_now)
        {
          if (NILP (vector[0]))
            {
-             int was_locked = single_kboard;
              int count = SPECPDL_INDEX ();
              Lisp_Object old_deactivate_mark = Vdeactivate_mark;
 
+#if 0 /* This shouldn't be necessary anymore.  --lorentey  */
+             /* On unbind_to, resume allowing input from any kboard, if that
+                 was true before.  */
+              record_single_kboard_state ();
+#endif
              /* Mark the timer as triggered to prevent problems if the lisp
                 code fails to reschedule it right.  */
              vector[0] = Qt;
@@ -4542,10 +4656,6 @@ timer_check (do_it_now)
              timers_run++;
              unbind_to (count, Qnil);
 
-             /* Resume allowing input from any kboard, if that was true before.  */
-             if (!was_locked)
-               any_kboard_state ();
-
              /* Since we have handled the event,
                 we don't need to tell the caller to wake up and do it.  */
            }
@@ -6444,8 +6554,8 @@ modify_event_symbol (symbol_num, modifiers, symbol_kind, name_alist_or_stem,
        {
          int len = SBYTES (name_alist_or_stem);
          char *buf = (char *) alloca (len + 50);
-         sprintf (buf, "%s-%ld", SDATA (name_alist_or_stem),
-                  (long) XINT (symbol_int) + 1);
+          sprintf (buf, "%s-%ld", SDATA (name_alist_or_stem),
+                   (long) XINT (symbol_int) + 1);
          value = intern (buf);
        }
       else if (name_table != 0 && name_table[symbol_num])
@@ -6710,7 +6820,10 @@ gobble_input (expected)
     }
   else
 #ifdef POLL_FOR_INPUT
-  if (read_socket_hook && !interrupt_input && poll_suppress_count == 0)
+  /* XXX This condition was (read_socket_hook && !interrupt_input),
+     but read_socket_hook is not global anymore.  Let's pretend that
+     it's always set. */
+  if (!interrupt_input && poll_suppress_count == 0)
     {
       SIGMASKTYPE mask;
       mask = sigblock (sigmask (SIGALRM));
@@ -6787,146 +6900,217 @@ static int
 read_avail_input (expected)
      int expected;
 {
-  register int i;
   int nread = 0;
+  int err = 0;
+  struct terminal *t;
 
-  if (read_socket_hook)
+  /* Loop through the available terminals, and call their input hooks. */
+  t = terminal_list;
+  while (t)
     {
-      int nr;
-      struct input_event hold_quit;
+      struct terminal *next = t->next_terminal;
 
-      EVENT_INIT (hold_quit);
-      hold_quit.kind = NO_EVENT;
+      if (t->read_socket_hook)
+        {
+          int nr;
+          struct input_event hold_quit;
+
+          EVENT_INIT (hold_quit);
+          hold_quit.kind = NO_EVENT;
+
+          /* No need for FIONREAD or fcntl; just say don't wait.  */
+          while (nr = (*t->read_socket_hook) (t, expected, &hold_quit), nr > 0)
+            {
+              nread += nr;
+              expected = 0;
+            }
+          
+          if (nr == -1)          /* Not OK to read input now. */
+            {
+              err = 1;
+            }
+          else if (nr == -2)          /* Non-transient error. */
+            {
+              /* The terminal device terminated; it should be closed. */
+              
+              /* Kill Emacs if this was our last terminal. */
+              if (!terminal_list->next_terminal)
+                /* Formerly simply reported no input, but that
+                   sometimes led to a failure of Emacs to terminate.
+                   SIGHUP seems appropriate if we can't reach the
+                   terminal.  */
+                /* ??? Is it really right to send the signal just to
+                   this process rather than to the whole process
+                   group?  Perhaps on systems with FIONREAD Emacs is
+                   alone in its group.  */
+                kill (getpid (), SIGHUP);
+              
+              /* XXX Is calling delete_terminal safe here?  It calls Fdelete_frame. */
+              if (t->delete_terminal_hook)
+                (*t->delete_terminal_hook) (t);
+              else
+                delete_terminal (t);
+            }
+
+          if (hold_quit.kind != NO_EVENT)
+            kbd_buffer_store_event (&hold_quit);
+        }
 
-      /* No need for FIONREAD or fcntl; just say don't wait.  */
-      while (nr = (*read_socket_hook) (input_fd, expected, &hold_quit), nr > 0)
-       {
-         nread += nr;
-         expected = 0;
-       }
-      if (hold_quit.kind != NO_EVENT)
-       kbd_buffer_store_event (&hold_quit);
+      t = next;
     }
-  else
-    {
-      /* Using KBD_BUFFER_SIZE - 1 here avoids reading more than
-        the kbd_buffer can really hold.  That may prevent loss
-        of characters on some systems when input is stuffed at us.  */
-      unsigned char cbuf[KBD_BUFFER_SIZE - 1];
-      int n_to_read;
 
-      /* Determine how many characters we should *try* to read.  */
+  if (err && !nread)
+    nread = -1;
+
+  return nread;
+}
+
+/* This is the tty way of reading available input.
+
+   Note that each terminal device has its own `struct terminal' object,
+   and so this function is called once for each individual termcap
+   terminal.  The first parameter indicates which terminal to read from.  */
+
+int
+tty_read_avail_input (struct terminal *terminal,
+                      int expected,
+                      struct input_event *hold_quit)
+{
+  /* Using KBD_BUFFER_SIZE - 1 here avoids reading more than
+     the kbd_buffer can really hold.  That may prevent loss
+     of characters on some systems when input is stuffed at us.  */
+  unsigned char cbuf[KBD_BUFFER_SIZE - 1];
+  int n_to_read, i;
+  struct tty_display_info *tty = terminal->display_info.tty;
+  int nread = 0;
+
+  if (terminal->deleted)        /* Don't read from a deleted terminal. */
+    return;
+
+  if (terminal->type != output_termcap)
+    abort ();
+
+  /* XXX I think the following code should be moved to separate hook
+     functions in system-dependent files. */
 #ifdef WINDOWSNT
-      return 0;
+  return 0;
 #else /* not WINDOWSNT */
 #ifdef MSDOS
-      n_to_read = dos_keysns ();
-      if (n_to_read == 0)
-       return 0;
+  n_to_read = dos_keysns ();
+  if (n_to_read == 0)
+    return 0;
+
+  cbuf[0] = dos_keyread ();
+  nread = 1;
+
 #else /* not MSDOS */
+
+  if (! tty->term_initted)      /* In case we get called during bootstrap. */
+    return 0;
+
+  if (! tty->input)
+    return 0;                   /* The terminal is suspended. */
+
+  /* Determine how many characters we should *try* to read.  */
 #ifdef FIONREAD
-      /* Find out how much input is available.  */
-      if (ioctl (input_fd, FIONREAD, &n_to_read) < 0)
-       /* Formerly simply reported no input, but that sometimes led to
-          a failure of Emacs to terminate.
-          SIGHUP seems appropriate if we can't reach the terminal.  */
-       /* ??? Is it really right to send the signal just to this process
-          rather than to the whole process group?
-          Perhaps on systems with FIONREAD Emacs is alone in its group.  */
-       {
-         if (! noninteractive)
-           kill (getpid (), SIGHUP);
-         else
-           n_to_read = 0;
-       }
-      if (n_to_read == 0)
-       return 0;
-      if (n_to_read > sizeof cbuf)
-       n_to_read = sizeof cbuf;
+  /* Find out how much input is available.  */
+  if (ioctl (fileno (tty->input), FIONREAD, &n_to_read) < 0)
+    {
+      if (! noninteractive)
+        return -2;          /* Close this terminal. */
+      else
+        n_to_read = 0;
+    }
+  if (n_to_read == 0)
+    return 0;
+  if (n_to_read > sizeof cbuf)
+    n_to_read = sizeof cbuf;
 #else /* no FIONREAD */
 #if defined (USG) || defined (DGUX) || defined(CYGWIN)
-      /* Read some input if available, but don't wait.  */
-      n_to_read = sizeof cbuf;
-      fcntl (input_fd, F_SETFL, O_NDELAY);
+  /* Read some input if available, but don't wait.  */
+  n_to_read = sizeof cbuf;
+  fcntl (fileno (tty->input), F_SETFL, O_NDELAY);
 #else
-      you lose;
+  you lose;
 #endif
 #endif
-#endif /* not MSDOS */
-#endif /* not WINDOWSNT */
 
-      /* Now read; for one reason or another, this will not block.
-        NREAD is set to the number of chars read.  */
-      do
-       {
-#ifdef MSDOS
-         cbuf[0] = dos_keyread ();
-         nread = 1;
-#else
-         nread = emacs_read (input_fd, cbuf, n_to_read);
-#endif
-         /* POSIX infers that processes which are not in the session leader's
-            process group won't get SIGHUP's at logout time.  BSDI adheres to
-            this part standard and returns -1 from read (0) with errno==EIO
-            when the control tty is taken away.
-            Jeffrey Honig <jch@bsdi.com> says this is generally safe.  */
-         if (nread == -1 && errno == EIO)
-           kill (0, SIGHUP);
+  /* Now read; for one reason or another, this will not block.
+     NREAD is set to the number of chars read.  */
+  do
+    {
+      nread = emacs_read (fileno (tty->input), cbuf, n_to_read);
+      /* POSIX infers that processes which are not in the session leader's
+         process group won't get SIGHUP's at logout time.  BSDI adheres to
+         this part standard and returns -1 from read (0) with errno==EIO
+         when the control tty is taken away.
+         Jeffrey Honig <jch@bsdi.com> says this is generally safe. */
+      if (nread == -1 && errno == EIO)
+        return -2;          /* Close this terminal. */
 #if defined (AIX) && (! defined (aix386) && defined (_BSD))
-         /* The kernel sometimes fails to deliver SIGHUP for ptys.
-            This looks incorrect, but it isn't, because _BSD causes
-            O_NDELAY to be defined in fcntl.h as O_NONBLOCK,
-            and that causes a value other than 0 when there is no input.  */
-         if (nread == 0)
-           kill (0, SIGHUP);
-#endif
-       }
-      while (
-            /* We used to retry the read if it was interrupted.
-               But this does the wrong thing when O_NDELAY causes
-               an EAGAIN error.  Does anybody know of a situation
-               where a retry is actually needed?  */
+      /* The kernel sometimes fails to deliver SIGHUP for ptys.
+         This looks incorrect, but it isn't, because _BSD causes
+         O_NDELAY to be defined in fcntl.h as O_NONBLOCK,
+         and that causes a value other than 0 when there is no input.  */
+      if (nread == 0)
+        return -2;          /* Close this terminal. */
+#endif
+    }
+  while (
+         /* We used to retry the read if it was interrupted.
+            But this does the wrong thing when O_NDELAY causes
+            an EAGAIN error.  Does anybody know of a situation
+            where a retry is actually needed?  */
 #if 0
-            nread < 0 && (errno == EAGAIN
+         nread < 0 && (errno == EAGAIN
 #ifdef EFAULT
-                          || errno == EFAULT
+                       || errno == EFAULT
 #endif
 #ifdef EBADSLT
-                          || errno == EBADSLT
+                       || errno == EBADSLT
 #endif
-                          )
+                       )
 #else
-            0
+         0
 #endif
-            );
+         );
 
 #ifndef FIONREAD
 #if defined (USG) || defined (DGUX) || defined (CYGWIN)
-      fcntl (input_fd, F_SETFL, 0);
+  fcntl (fileno (tty->input), F_SETFL, 0);
 #endif /* USG or DGUX or CYGWIN */
 #endif /* no FIONREAD */
-      for (i = 0; i < nread; i++)
-       {
-         struct input_event buf;
-         EVENT_INIT (buf);
-         buf.kind = ASCII_KEYSTROKE_EVENT;
-         buf.modifiers = 0;
-         if (meta_key == 1 && (cbuf[i] & 0x80))
-           buf.modifiers = meta_modifier;
-         if (meta_key != 2)
-           cbuf[i] &= ~0x80;
-
-         buf.code = cbuf[i];
-         buf.frame_or_window = selected_frame;
-         buf.arg = Qnil;
-
-         kbd_buffer_store_event (&buf);
-         /* Don't look at input that follows a C-g too closely.
-            This reduces lossage due to autorepeat on C-g.  */
-         if (buf.kind == ASCII_KEYSTROKE_EVENT
-             && buf.code == quit_char)
-           break;
-       }
+
+  if (nread <= 0)
+    return nread;
+
+#endif /* not MSDOS */
+#endif /* not WINDOWSNT */
+
+  for (i = 0; i < nread; i++)
+    {
+      struct input_event buf;
+      EVENT_INIT (buf);
+      buf.kind = ASCII_KEYSTROKE_EVENT;
+      buf.modifiers = 0;
+      if (tty->meta_key == 1 && (cbuf[i] & 0x80))
+        buf.modifiers = meta_modifier;
+      if (tty->meta_key != 2)
+        cbuf[i] &= ~0x80;
+      
+      buf.code = cbuf[i];
+      /* Set the frame corresponding to the active tty.  Note that the
+         value of selected_frame is not reliable here, redisplay tends
+         to temporarily change it. */
+      buf.frame_or_window = tty->top_frame;
+      buf.arg = Qnil;
+      
+      kbd_buffer_store_event (&buf);
+      /* Don't look at input that follows a C-g too closely.
+         This reduces lossage due to autorepeat on C-g.  */
+      if (buf.kind == ASCII_KEYSTROKE_EVENT
+          && buf.code == quit_char)
+        break;
     }
 
   return nread;
@@ -8379,6 +8563,8 @@ read_char_minibuf_menu_prompt (commandflag, nmaps, maps)
 
       if (!INTEGERP (obj))
        return obj;
+      else if (XINT (obj) == -2)
+        return obj;
       else
        ch = XINT (obj);
 
@@ -8725,11 +8911,7 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
   last_nonmenu_event = Qnil;
 
   delayed_switch_frame = Qnil;
-  fkey.map = fkey.parent = Vfunction_key_map;
-  keytran.map = keytran.parent = Vkey_translation_map;
-  fkey.start = fkey.end = 0;
-  keytran.start = keytran.end = 0;
-
+  
   if (INTERACTIVE)
     {
       if (!NILP (prompt))
@@ -8769,6 +8951,13 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
      keybuf[0..mock_input] holds the sequence we should reread.  */
  replay_sequence:
 
+  /* We may switch keyboards between rescans, so we need to
+     reinitialize fkey and keytran before each replay.  */
+  fkey.map = fkey.parent = current_kboard->Vlocal_function_key_map;
+  keytran.map = keytran.parent = current_kboard->Vlocal_key_translation_map;
+  fkey.start = fkey.end = 0;
+  keytran.start = keytran.end = 0;
+
   starting_buffer = current_buffer;
   first_unbound = bufsize + 1;
 
@@ -8933,8 +9122,28 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
 #ifdef MULTI_KBOARD
            KBOARD *interrupted_kboard = current_kboard;
            struct frame *interrupted_frame = SELECTED_FRAME ();
-           if (setjmp (wrong_kboard_jmpbuf))
+#endif
+           key = read_char (NILP (prompt), nmaps,
+                            (Lisp_Object *) submaps, last_nonmenu_event,
+                            &used_mouse_menu, NULL);
+#ifdef MULTI_KBOARD
+           if (INTEGERP (key) && XINT (key) == -2) /* wrong_kboard_jmpbuf */
              {
+               int found = 0;
+               struct kboard *k;
+
+               for (k = all_kboards; k; k = k->next_kboard)
+                 if (k == interrupted_kboard)
+                   found = 1;
+
+               if (!found)
+                 {
+                   /* Don't touch interrupted_kboard when it's been
+                      deleted. */
+                   delayed_switch_frame = Qnil;
+                   goto replay_sequence;
+                 }
+
                if (!NILP (delayed_switch_frame))
                  {
                    interrupted_kboard->kbd_queue
@@ -8942,6 +9151,7 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
                               interrupted_kboard->kbd_queue);
                    delayed_switch_frame = Qnil;
                  }
+
                while (t > 0)
                  interrupted_kboard->kbd_queue
                    = Fcons (keybuf[--t], interrupted_kboard->kbd_queue);
@@ -8966,9 +9176,6 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
                goto replay_sequence;
              }
 #endif
-           key = read_char (NILP (prompt), nmaps,
-                            (Lisp_Object *) submaps, last_nonmenu_event,
-                            &used_mouse_menu, NULL);
          }
 
          /* read_char returns t when it shows a menu and the user rejects it.
@@ -10077,8 +10284,12 @@ detect_input_pending_run_timers (do_display)
         from an idle timer function.  The symptom of the bug is that
         the cursor sometimes doesn't become visible until the next X
         event is processed.  --gerd.  */
-      if (rif)
-       rif->flush_display (NULL);
+      {
+        Lisp_Object tail, frame;
+        FOR_EACH_FRAME (tail, frame)
+          if (FRAME_RIF (XFRAME (frame)))
+            FRAME_RIF (XFRAME (frame))->flush_display (XFRAME (frame));
+      }
     }
 
   return input_pending;
@@ -10324,6 +10535,9 @@ On such systems, Emacs starts a subshell instead of suspending.  */)
   int width, height;
   struct gcpro gcpro1;
 
+  if (tty_list && tty_list->next)
+    error ("There are other tty frames open; close them before suspending Emacs");
+
   if (!NILP (stuffstring))
     CHECK_STRING (stuffstring);
 
@@ -10332,11 +10546,11 @@ On such systems, Emacs starts a subshell instead of suspending.  */)
     call1 (Vrun_hooks, intern ("suspend-hook"));
 
   GCPRO1 (stuffstring);
-  get_frame_size (&old_width, &old_height);
-  reset_sys_modes ();
+  get_tty_size (fileno (CURTTY ()->input), &old_width, &old_height);
+  reset_all_sys_modes ();
   /* sys_suspend can get an error if it tries to fork a subshell
      and the system resources aren't available for that.  */
-  record_unwind_protect ((Lisp_Object (*) P_ ((Lisp_Object))) init_sys_modes,
+  record_unwind_protect ((Lisp_Object (*) P_ ((Lisp_Object))) init_all_sys_modes,
                         Qnil);
   stuff_buffered_input (stuffstring);
   if (cannot_suspend)
@@ -10348,7 +10562,7 @@ On such systems, Emacs starts a subshell instead of suspending.  */)
   /* Check if terminal/window size has changed.
      Note that this is not useful when we are running directly
      with a window system; but suspend should be disabled in that case.  */
-  get_frame_size (&width, &height);
+  get_tty_size (fileno (CURTTY ()->input), &width, &height);
   if (width != old_width || height != old_height)
     change_frame_size (SELECTED_FRAME (), height, width, 0, 0, 0);
 
@@ -10408,10 +10622,10 @@ set_waiting_for_input (time_to_clear)
 {
   input_available_clear_time = time_to_clear;
 
-  /* Tell interrupt_signal to throw back to read_char,  */
+  /* Tell handle_interrupt to throw back to read_char,  */
   waiting_for_input = 1;
 
-  /* If interrupt_signal was called before and buffered a C-g,
+  /* If handle_interrupt was called before and buffered a C-g,
      make it run again now, to avoid timing error. */
   if (!NILP (Vquit_flag))
     quit_throw_to_read_char ();
@@ -10420,48 +10634,82 @@ set_waiting_for_input (time_to_clear)
 void
 clear_waiting_for_input ()
 {
-  /* Tell interrupt_signal not to throw back to read_char,  */
+  /* Tell handle_interrupt not to throw back to read_char,  */
   waiting_for_input = 0;
   input_available_clear_time = 0;
 }
 
-/* This routine is called at interrupt level in response to C-g.
-
-   If interrupt_input, this is the handler for SIGINT.  Otherwise, it
-   is called from kbd_buffer_store_event, in handling SIGIO or
-   SIGTINT.
-
-   If `waiting_for_input' is non zero, then unless `echoing' is
-   nonzero, immediately throw back to read_char.
+/* The SIGINT handler.
 
-   Otherwise it sets the Lisp variable quit-flag not-nil.  This causes
-   eval to throw, when it gets a chance.  If quit-flag is already
-   non-nil, it stops the job right away.  */
+   If we have a frame on the controlling tty, we assume that the
+   SIGINT was generated by C-g, so we call handle_interrupt.
+   Otherwise, the handler kills Emacs.  */
 
 static SIGTYPE
 interrupt_signal (signalnum)   /* If we don't have an argument, */
      int signalnum;            /* some compilers complain in signal calls. */
 {
-  char c;
   /* Must preserve main program's value of errno.  */
   int old_errno = errno;
-  struct frame *sf = SELECTED_FRAME ();
+  struct terminal *terminal;
 
 #if defined (USG) && !defined (POSIX_SIGNALS)
-  if (!read_socket_hook && NILP (Vwindow_system))
-    {
-      /* USG systems forget handlers when they are used;
-        must reestablish each time */
-      signal (SIGINT, interrupt_signal);
-      signal (SIGQUIT, interrupt_signal);
-    }
+  /* USG systems forget handlers when they are used;
+     must reestablish each time */
+  signal (SIGINT, interrupt_signal);
+  signal (SIGQUIT, interrupt_signal);
 #endif /* USG */
 
   SIGNAL_THREAD_CHECK (signalnum);
+
+  /* See if we have an active terminal on our controlling tty. */
+  terminal = get_named_tty ("/dev/tty");
+  if (!terminal)
+    {
+      /* If there are no frames there, let's pretend that we are a
+         well-behaving UN*X program and quit. */
+      Fkill_emacs (Qnil);
+    }
+  else
+    {
+      /* Otherwise, the SIGINT was probably generated by C-g.  */
+
+      /* Set internal_last_event_frame to the top frame of the
+         controlling tty, if we have a frame there.  We disable the
+         interrupt key on secondary ttys, so the SIGINT must have come
+         from the controlling tty.  */
+      internal_last_event_frame = terminal->display_info.tty->top_frame;
+
+      handle_interrupt ();
+    }
+
+  errno = old_errno;
+}
+
+/* This routine is called at interrupt level in response to C-g.
+
+   It is called from the SIGINT handler or kbd_buffer_store_event.
+
+   If `waiting_for_input' is non zero, then unless `echoing' is
+   nonzero, immediately throw back to read_char.
+
+   Otherwise it sets the Lisp variable quit-flag not-nil.  This causes
+   eval to throw, when it gets a chance.  If quit-flag is already
+   non-nil, it stops the job right away. */
+
+static void
+handle_interrupt ()
+{
+  char c;
+
   cancel_echoing ();
 
+  /* XXX This code needs to be revised for multi-tty support. */
   if (!NILP (Vquit_flag)
-      && (FRAME_TERMCAP_P (sf) || FRAME_MSDOS_P (sf)))
+#ifndef MSDOS
+      && get_named_tty ("/dev/tty")
+#endif
+      )
     {
       /* If SIGINT isn't blocked, don't let us be interrupted by
         another SIGINT, it might be harmful due to non-reentrancy
@@ -10469,7 +10717,7 @@ interrupt_signal (signalnum)    /* If we don't have an argument, */
       sigblock (sigmask (SIGINT));
 
       fflush (stdout);
-      reset_sys_modes ();
+      reset_all_sys_modes ();
 
 #ifdef SIGTSTP                 /* Support possible in later USG versions */
 /*
@@ -10548,7 +10796,7 @@ interrupt_signal (signalnum)    /* If we don't have an argument, */
       printf ("Continuing...\n");
 #endif /* not MSDOS */
       fflush (stdout);
-      init_sys_modes ();
+      init_all_sys_modes ();
       sigfree ();
     }
   else
@@ -10576,9 +10824,7 @@ interrupt_signal (signalnum)    /* If we don't have an argument, */
     }
 
   if (waiting_for_input && !echoing)
-    quit_throw_to_read_char ();
-
-  errno = old_errno;
+      quit_throw_to_read_char ();
 }
 
 /* Handle a C-g by making read_char return C-g.  */
@@ -10611,75 +10857,202 @@ quit_throw_to_read_char ()
   _longjmp (getcjmp, 1);
 }
 \f
-DEFUN ("set-input-mode", Fset_input_mode, Sset_input_mode, 3, 4, 0,
-       doc: /* Set mode of reading keyboard input.
-First arg INTERRUPT non-nil means use input interrupts;
- nil means use CBREAK mode.
-Second arg FLOW non-nil means use ^S/^Q flow control for output to terminal
- (no effect except in CBREAK mode).
-Third arg META t means accept 8-bit input (for a Meta key).
- META nil means ignore the top bit, on the assumption it is parity.
- Otherwise, accept 8-bit input and don't use the top bit for Meta.
-Optional fourth arg QUIT if non-nil specifies character to use for quitting.
+DEFUN ("set-input-interrupt-mode", Fset_input_interrupt_mode, Sset_input_interrupt_mode, 1, 1, 0,
+       doc: /* Set interrupt mode of reading keyboard input.
+If INTERRUPT is non-nil, Emacs will use input interrupts;
+otherwise Emacs uses CBREAK mode.
+
 See also `current-input-mode'.  */)
-     (interrupt, flow, meta, quit)
-     Lisp_Object interrupt, flow, meta, quit;
+     (interrupt)
+     Lisp_Object interrupt;
 {
-  if (!NILP (quit)
-      && (!INTEGERP (quit) || XINT (quit) < 0 || XINT (quit) > 0400))
-    error ("set-input-mode: QUIT must be an ASCII character");
-
-#ifdef POLL_FOR_INPUT
-  stop_polling ();
-#endif
-
-#ifndef DOS_NT
-  /* this causes startup screen to be restored and messes with the mouse */
-  reset_sys_modes ();
-#endif
-
+  int new_interrupt_input;
 #ifdef SIGIO
 /* Note SIGIO has been undef'd if FIONREAD is missing.  */
-  if (read_socket_hook)
+#ifdef HAVE_X_WINDOWS
+  if (x_display_list != NULL)
     {
       /* When using X, don't give the user a real choice,
         because we haven't implemented the mechanisms to support it.  */
 #ifdef NO_SOCK_SIGIO
-      interrupt_input = 0;
+      new_interrupt_input = 0;
 #else /* not NO_SOCK_SIGIO */
-      interrupt_input = 1;
+      new_interrupt_input = 1;
 #endif /* NO_SOCK_SIGIO */
     }
   else
-    interrupt_input = !NILP (interrupt);
+#endif
+    new_interrupt_input = !NILP (interrupt);
 #else /* not SIGIO */
-  interrupt_input = 0;
+  new_interrupt_input = 0;
 #endif /* not SIGIO */
 
 /* Our VMS input only works by interrupts, as of now.  */
 #ifdef VMS
-  interrupt_input = 1;
+  new_interrupt_input = 1;
+#endif
+
+  if (new_interrupt_input != interrupt_input) 
+    {
+#ifdef POLL_FOR_INPUT
+      stop_polling ();
+#endif
+#ifndef DOS_NT
+      /* this causes startup screen to be restored and messes with the mouse */
+      reset_all_sys_modes ();
+#endif
+      interrupt_input = new_interrupt_input;
+#ifndef DOS_NT
+      init_all_sys_modes ();
+#endif
+
+#ifdef POLL_FOR_INPUT
+      poll_suppress_count = 1;
+      start_polling ();
+#endif
+    }
+  return Qnil;
+}
+
+DEFUN ("set-output-flow-control", Fset_output_flow_control, Sset_output_flow_control, 1, 2, 0,
+       doc: /* Enable or disable ^S/^Q flow control for output to TERMINAL.
+If FLOW is non-nil, flow control is enabled and you cannot use C-s or
+C-q in key sequences.
+
+This setting only has an effect on tty terminals and only when
+Emacs reads input in CBREAK mode; see `set-input-interrupt-mode'.
+
+See also `current-input-mode'.  */)
+       (flow, terminal)
+       Lisp_Object flow, terminal;
+{
+  struct terminal *t = get_terminal (terminal, 1);
+  struct tty_display_info *tty;
+  if (t == NULL || t->type != output_termcap)
+    return Qnil;
+  tty = t->display_info.tty;
+
+  if (tty->flow_control != !NILP (flow))
+    {
+#ifndef DOS_NT
+      /* this causes startup screen to be restored and messes with the mouse */
+      reset_sys_modes (tty);
 #endif
 
-  flow_control = !NILP (flow);
+      tty->flow_control = !NILP (flow);
+
+#ifndef DOS_NT
+      init_sys_modes (tty);
+#endif
+    }
+  return Qnil;
+}
+
+DEFUN ("set-input-meta-mode", Fset_input_meta_mode, Sset_input_meta_mode, 1, 2, 0,
+       doc: /* Enable or disable 8-bit input on TERMINAL.
+If META is t, Emacs will accept 8-bit input, and interpret the 8th
+bit as the Meta modifier.
+
+If META is nil, Emacs will ignore the top bit, on the assumption it is
+parity.
+
+Otherwise, Emacs will accept and pass through 8-bit input without
+specially interpreting the top bit.
+
+This setting only has an effect on tty terminal devices.
+
+Optional parameter TERMINAL specifies the tty terminal device to use.
+It may be a terminal id, a frame, or nil for the terminal used by the
+currently selected frame.
+
+See also `current-input-mode'.  */)
+       (meta, terminal)
+       Lisp_Object meta, terminal;
+{
+  struct terminal *t = get_terminal (terminal, 1);
+  struct tty_display_info *tty;
+  int new_meta;
+  
+  if (t == NULL || t->type != output_termcap)
+    return Qnil;
+  tty = t->display_info.tty;
+
   if (NILP (meta))
-    meta_key = 0;
+    new_meta = 0;
   else if (EQ (meta, Qt))
-    meta_key = 1;
+    new_meta = 1;
   else
-    meta_key = 2;
-  if (!NILP (quit))
-    /* Don't let this value be out of range.  */
-    quit_char = XINT (quit) & (meta_key ? 0377 : 0177);
+    new_meta = 2;
 
+  if (tty->meta_key != new_meta) 
+    {
 #ifndef DOS_NT
-  init_sys_modes ();
+      /* this causes startup screen to be restored and messes with the mouse */
+      reset_sys_modes (tty);
 #endif
 
-#ifdef POLL_FOR_INPUT
-  poll_suppress_count = 1;
-  start_polling ();
+      tty->meta_key = new_meta;
+  
+#ifndef DOS_NT
+      init_sys_modes (tty);
+#endif
+    }
+  return Qnil;
+}
+
+DEFUN ("set-quit-char", Fset_quit_char, Sset_quit_char, 1, 1, 0,
+       doc: /* Specify character used for quitting.
+QUIT must be an ASCII character.
+
+This function only has an effect on the controlling tty of the Emacs
+process.
+
+See also `current-input-mode'.  */)
+       (quit)
+       Lisp_Object quit;
+{
+  struct terminal *t = get_named_tty ("/dev/tty");
+  struct tty_display_info *tty;
+  if (t == NULL || t->type != output_termcap)
+    return Qnil;
+  tty = t->display_info.tty;
+
+  if (NILP (quit) || !INTEGERP (quit) || XINT (quit) < 0 || XINT (quit) > 0400)
+    error ("QUIT must be an ASCII character");
+
+#ifndef DOS_NT
+  /* this causes startup screen to be restored and messes with the mouse */
+  reset_sys_modes (tty);
 #endif
+  
+  /* Don't let this value be out of range.  */
+  quit_char = XINT (quit) & (tty->meta_key == 0 ? 0177 : 0377);
+
+#ifndef DOS_NT
+  init_sys_modes (tty);
+#endif
+
+  return Qnil;
+}
+       
+DEFUN ("set-input-mode", Fset_input_mode, Sset_input_mode, 3, 4, 0,
+       doc: /* Set mode of reading keyboard input.
+First arg INTERRUPT non-nil means use input interrupts;
+ nil means use CBREAK mode.
+Second arg FLOW non-nil means use ^S/^Q flow control for output to terminal
+ (no effect except in CBREAK mode).
+Third arg META t means accept 8-bit input (for a Meta key).
+ META nil means ignore the top bit, on the assumption it is parity.
+ Otherwise, accept 8-bit input and don't use the top bit for Meta.
+Optional fourth arg QUIT if non-nil specifies character to use for quitting.
+See also `current-input-mode'.  */)
+     (interrupt, flow, meta, quit)
+     Lisp_Object interrupt, flow, meta, quit;
+{
+  Fset_input_interrupt_mode (interrupt);
+  Fset_output_flow_control (flow, Qnil);
+  Fset_input_meta_mode (meta, Qnil);
+  Fset_quit_char (quit);
   return Qnil;
 }
 
@@ -10700,10 +11073,21 @@ The elements of this list correspond to the arguments of
      ()
 {
   Lisp_Object val[4];
+  struct frame *sf = XFRAME (selected_frame);
 
   val[0] = interrupt_input ? Qt : Qnil;
-  val[1] = flow_control ? Qt : Qnil;
-  val[2] = meta_key == 2 ? make_number (0) : meta_key == 1 ? Qt : Qnil;
+  if (FRAME_TERMCAP_P (sf))
+    {
+      val[1] = FRAME_TTY (sf)->flow_control ? Qt : Qnil;
+      val[2] = (FRAME_TTY (sf)->meta_key == 2
+                ? make_number (0)
+                : (CURTTY ()->meta_key == 1 ? Qt : Qnil));
+    }
+  else
+    {
+      val[1] = Qnil;
+      val[2] = Qt;
+    }
   XSETFASTINT (val[3], quit_char);
 
   return Flist (sizeof (val) / sizeof (val[0]), val);
@@ -10795,6 +11179,7 @@ init_kboard (kb)
   kb->Voverriding_terminal_local_map = Qnil;
   kb->Vlast_command = Qnil;
   kb->Vreal_last_command = Qnil;
+  kb->Vkeyboard_translate_table = Qnil;
   kb->Vprefix_arg = Qnil;
   kb->Vlast_prefix_arg = Qnil;
   kb->kbd_queue = Qnil;
@@ -10809,6 +11194,10 @@ init_kboard (kb)
   kb->reference_count = 0;
   kb->Vsystem_key_alist = Qnil;
   kb->system_key_syms = Qnil;
+  kb->Vlocal_function_key_map = Fmake_sparse_keymap (Qnil);
+  Fset_keymap_parent (kb->Vlocal_function_key_map, Vfunction_key_map);
+  kb->Vlocal_key_translation_map = Fmake_sparse_keymap (Qnil);
+  Fset_keymap_parent (kb->Vlocal_key_translation_map, Vkey_translation_map);
   kb->Vdefault_minibuffer_frame = Qnil;
 }
 
@@ -10845,7 +11234,8 @@ delete_kboard (kb)
       && FRAMEP (selected_frame)
       && FRAME_LIVE_P (XFRAME (selected_frame)))
     {
-      current_kboard = XFRAME (selected_frame)->kboard;
+      current_kboard = FRAME_KBOARD (XFRAME (selected_frame));
+      single_kboard = 0;
       if (current_kboard == kb)
        abort ();
     }
@@ -10886,8 +11276,14 @@ init_keyboard ()
   wipe_kboard (current_kboard);
   init_kboard (current_kboard);
 
-  if (!noninteractive && !read_socket_hook && NILP (Vwindow_system))
+  if (!noninteractive)
     {
+      /* Before multi-tty support, these handlers used to be installed
+         only if the current session was a tty session.  Now an Emacs
+         session may have multiple display types, so we always handle
+         SIGINT.  There is special code in interrupt_signal to exit
+         Emacs on SIGINT when there are no termcap frames on the
+         controlling terminal. */
       signal (SIGINT, interrupt_signal);
 #if defined (HAVE_TERMIO) || defined (HAVE_TERMIOS)
       /* For systems with SysV TERMIO, C-g is set up for both SIGINT and
@@ -11211,6 +11607,10 @@ syms_of_keyboard ()
   defsubr (&Stop_level);
   defsubr (&Sdiscard_input);
   defsubr (&Sopen_dribble_file);
+  defsubr (&Sset_input_interrupt_mode);
+  defsubr (&Sset_output_flow_control);
+  defsubr (&Sset_input_meta_mode);
+  defsubr (&Sset_quit_char);
   defsubr (&Sset_input_mode);
   defsubr (&Scurrent_input_mode);
   defsubr (&Sexecute_extended_command);
@@ -11277,7 +11677,10 @@ In other words, the present command is the event that made the previous
 command exit.
 
 The value `kill-region' is special; it means that the previous command
-was a kill command.  */);
+was a kill command.
+
+`last-command' has a separate binding for each terminal device.
+See Info node `(elisp)Multiple displays'.  */);
 
   DEFVAR_KBOARD ("real-last-command", Vreal_last_command,
                 doc: /* Same as `last-command', but never altered by Lisp code.  */);
@@ -11389,8 +11792,8 @@ for that character after that prefix key.  */);
 Useful to set before you dump a modified Emacs.  */);
   Vtop_level = Qnil;
 
-  DEFVAR_LISP ("keyboard-translate-table", &Vkeyboard_translate_table,
-              doc: /* Translate table for keyboard input, or nil.
+  DEFVAR_KBOARD ("keyboard-translate-table", Vkeyboard_translate_table,
+                 doc: /* Translate table for local keyboard input, or nil.
 If non-nil, the value should be a char-table.  Each character read
 from the keyboard is looked up in this char-table.  If the value found
 there is non-nil, then it is used instead of the actual input character.
@@ -11400,8 +11803,10 @@ If it is a string or vector of length N, character codes N and up are left
 untranslated.  In a vector, an element which is nil means "no translation".
 
 This is applied to the characters supplied to input methods, not their
-output.  See also `translation-table-for-input'.  */);
-  Vkeyboard_translate_table = Qnil;
+output.  See also `translation-table-for-input'.
+
+This variable has a separate binding for each terminal.  See Info node
+`(elisp)Multiple displays'.  */);
 
   DEFVAR_BOOL ("cannot-suspend", &cannot_suspend,
               doc: /* Non-nil means to always spawn a subshell instead of suspending.
@@ -11486,7 +11891,11 @@ buffer's local map, and the minor mode keymaps and text property keymaps.
 It also replaces `overriding-local-map'.
 
 This variable is intended to let commands such as `universal-argument'
-set up a different keymap for reading the next command.  */);
+set up a different keymap for reading the next command.
+
+`overriding-terminal-local-map' has a separate binding for each
+terminal device.
+See Info node `(elisp)Multiple displays'.  */);
 
   DEFVAR_LISP ("overriding-local-map", &Voverriding_local_map,
               doc: /* Keymap that overrides all other local keymaps.
@@ -11511,7 +11920,61 @@ and the minor mode maps regardless of `overriding-local-map'.  */);
                 doc: /* Alist of system-specific X windows key symbols.
 Each element should have the form (N . SYMBOL) where N is the
 numeric keysym code (sans the \"system-specific\" bit 1<<28)
-and SYMBOL is its name.  */);
+and SYMBOL is its name.
+
+`system-key-alist' has a separate binding for each terminal device.
+See Info node `(elisp)Multiple displays'.  */);
+
+  DEFVAR_KBOARD ("local-function-key-map", Vlocal_function_key_map,
+                 doc: /* Keymap that translates key sequences to key sequences during input.
+This is used mainly for mapping ASCII function key sequences into
+real Emacs function key events (symbols).
+
+The `read-key-sequence' function replaces any subsequence bound by
+`local-function-key-map' with its binding.  More precisely, when the
+active keymaps have no binding for the current key sequence but
+`local-function-key-map' binds a suffix of the sequence to a vector or
+string, `read-key-sequence' replaces the matching suffix with its
+binding, and continues with the new sequence.
+
+If the binding is a function, it is called with one argument (the prompt)
+and its return value (a key sequence) is used.
+
+The events that come from bindings in `local-function-key-map' are not
+themselves looked up in `local-function-key-map'.
+
+For example, suppose `local-function-key-map' binds `ESC O P' to [f1].
+Typing `ESC O P' to `read-key-sequence' would return [f1].  Typing
+`C-x ESC O P' would return [?\\C-x f1].  If [f1] were a prefix key,
+typing `ESC O P x' would return [f1 x].
+
+`local-function-key-map' has a separate binding for each terminal
+device.  See Info node `(elisp)Multiple displays'.  If you need to
+define a binding on all terminals, change `function-key-map'
+instead.  Initially, `local-function-key-map' is an empty keymap that
+has `function-key-map' as its parent on all terminal devices.  */);
+
+  DEFVAR_LISP ("function-key-map", &Vfunction_key_map,
+               doc: /* The parent keymap of all `local-function-key-map' instances.
+Function key definitions that apply to all terminal devices should go
+here.  If a mapping is defined in both the current
+`local-function-key-map' binding and this variable, then the local
+definition will take precendence.  */);
+  Vfunction_key_map = Fmake_sparse_keymap (Qnil);
+                    
+  DEFVAR_KBOARD ("local-key-translation-map", Vlocal_key_translation_map,
+              doc: /* Keymap of key translations that can override keymaps.
+This keymap works like `function-key-map', but comes after that,
+and its non-prefix bindings override ordinary bindings.
+
+`key-translation-map' has a separate binding for each terminal device.
+(See Info node `(elisp)Multiple displays'.)  If you need to set a key
+translation on all terminals, change `global-key-translation-map' instead.  */);
+
+  DEFVAR_LISP ("key-translation-map", &Vkey_translation_map,
+               doc: /* The parent keymap of all `local-key-translation-map' instances.
+Key translations that apply to all terminal devices should go here.  */);
+  Vkey_translation_map = Fmake_sparse_keymap (Qnil);
 
   DEFVAR_LISP ("deferred-action-list", &Vdeferred_action_list,
               doc: /* List of deferred actions to be performed at a later time.
@@ -11680,6 +12143,7 @@ mark_kboards ()
       mark_object (kb->Voverriding_terminal_local_map);
       mark_object (kb->Vlast_command);
       mark_object (kb->Vreal_last_command);
+      mark_object (kb->Vkeyboard_translate_table);
       mark_object (kb->Vprefix_arg);
       mark_object (kb->Vlast_prefix_arg);
       mark_object (kb->kbd_queue);
@@ -11687,6 +12151,8 @@ mark_kboards ()
       mark_object (kb->Vlast_kbd_macro);
       mark_object (kb->Vsystem_key_alist);
       mark_object (kb->system_key_syms);
+      mark_object (kb->Vlocal_function_key_map);
+      mark_object (kb->Vlocal_key_translation_map);
       mark_object (kb->Vdefault_minibuffer_frame);
       mark_object (kb->echo_string);
     }
index 96ac7d2..8f1c5dd 100644 (file)
@@ -23,8 +23,9 @@ Boston, MA 02110-1301, USA.  */
 
 /* Length of echobuf field in each KBOARD.  */
 
-/* Each KBOARD represents one logical input stream from which Emacs gets input.
-   If we are using an ordinary terminal, it has one KBOARD object.
+/* Each KBOARD represents one logical input stream from which Emacs
+   gets input.  If we are using ordinary terminals, it has one KBOARD
+   object for each terminal device.
    Usually each X display screen has its own KBOARD,
    but when two of them are on the same X server,
    we assume they share a keyboard and give them one KBOARD in common.
@@ -83,6 +84,9 @@ struct kboard
        other commands.  */
     Lisp_Object Vreal_last_command;
 
+    /* User-supplied table to translate input characters through.  */
+    Lisp_Object Vkeyboard_translate_table;
+    
     /* The prefix argument for the next command, in raw form.  */
     Lisp_Object Vprefix_arg;
 
@@ -123,6 +127,14 @@ struct kboard
     /* Cache for modify_event_symbol.  */
     Lisp_Object system_key_syms;
 
+    /* Keymap mapping ASCII function key sequences onto their
+       preferred forms.  Initialized by the terminal-specific lisp
+       files.  See the DEFVAR for more documentation.  */
+    Lisp_Object Vlocal_function_key_map;
+    
+    /* Keymap of key translations that can override keymaps.  */
+    Lisp_Object Vlocal_key_translation_map;
+
     /* Minibufferless frames on this display use this frame's minibuffer.  */
     Lisp_Object Vdefault_minibuffer_frame;
 
@@ -155,7 +167,7 @@ struct kboard
   };
 
 #ifdef MULTI_KBOARD
-/* Temporarily used before a frame has been opened, and for termcap frames */
+/* Temporarily used before a frame has been opened. */
 extern KBOARD *initial_kboard;
 
 /* In the single-kboard state, this is the kboard
@@ -190,10 +202,6 @@ extern EMACS_INT num_nonmacro_input_events;
 /* Nonzero means polling for input is temporarily suppressed.  */
 extern int poll_suppress_count;
 
-/* Keymap mapping ASCII function key sequences onto their preferred forms.
-   Initialized by the terminal-specific lisp files.  */
-extern Lisp_Object Vfunction_key_map;
-
 /* Vector holding the key sequence that invoked the current command.
    It is reused for each command, and it may be longer than the current
    sequence; this_command_key_count indicates how many elements
@@ -301,18 +309,24 @@ extern Lisp_Object parse_modifiers P_ ((Lisp_Object));
 extern Lisp_Object reorder_modifiers P_ ((Lisp_Object));
 extern Lisp_Object read_char P_ ((int, int, Lisp_Object *, Lisp_Object,
                                  int *, EMACS_TIME *));
-/* User-supplied string to translate input characters through.  */
-extern Lisp_Object Vkeyboard_translate_table;
+
+
+/* Parent keymap of terminal-local function-key-map instances.  */
+extern Lisp_Object Vfunction_key_map;
+
+/* Parent keymap of terminal-local key-translation-map instances.  */
+extern Lisp_Object Vkey_translation_map;
 
 extern int parse_menu_item P_ ((Lisp_Object, int, int));
 
 extern void echo_now P_ ((void));
 extern void init_kboard P_ ((KBOARD *));
 extern void delete_kboard P_ ((KBOARD *));
-extern void single_kboard_state P_ ((void));
 extern void not_single_kboard_state P_ ((KBOARD *));
+extern void push_kboard P_ ((struct kboard *));
 extern void push_frame_kboard P_ ((struct frame *));
-extern void pop_frame_kboard P_ ((void));
+extern void pop_kboard P_ ((void));
+extern void temporarily_switch_to_single_kboard P_ ((struct frame *));
 extern void record_asynch_buffer_change P_ ((void));
 extern SIGTYPE input_poll_signal P_ ((int));
 extern void start_polling P_ ((void));
@@ -345,5 +359,8 @@ extern void kbd_buffer_store_help_event P_ ((Lisp_Object, Lisp_Object));
 extern Lisp_Object menu_item_eval_property P_ ((Lisp_Object));
 extern int  kbd_buffer_events_waiting P_ ((int));
 
+extern int tty_read_avail_input P_ ((struct terminal *, int,
+                                     struct input_event *));
+
 /* arch-tag: 769cbade-1ba9-4950-b886-db265b061aa3
    (do not change this comment) */
index 11e3e34..065631c 100644 (file)
@@ -31,6 +31,7 @@ Boston, MA 02110-1301, USA.  */
 #include "buffer.h"
 #include "charset.h"
 #include "keyboard.h"
+#include "frame.h"
 #include "termhooks.h"
 #include "blockinput.h"
 #include "puresize.h"
@@ -90,14 +91,6 @@ Lisp_Object Vminor_mode_overriding_map_alist;
 /* List of emulation mode keymap alists.  */
 Lisp_Object Vemulation_mode_map_alists;
 
-/* Keymap mapping ASCII function key sequences onto their preferred forms.
-   Initialized by the terminal-specific lisp files.  See DEFVAR for more
-   documentation.  */
-Lisp_Object Vfunction_key_map;
-
-/* Keymap mapping ASCII function key sequences onto their preferred forms.  */
-Lisp_Object Vkey_translation_map;
-
 /* A list of all commands given new bindings since a certain time
    when nil was stored here.
    This is used to speed up recomputation of menu key equivalents
@@ -2996,11 +2989,11 @@ You type        Translation\n\
   outbuf = Fcurrent_buffer ();
 
   /* Report on alternates for keys.  */
-  if (STRINGP (Vkeyboard_translate_table) && !NILP (prefix))
+  if (STRINGP (current_kboard->Vkeyboard_translate_table) && !NILP (prefix))
     {
       int c;
-      const unsigned char *translate = SDATA (Vkeyboard_translate_table);
-      int translate_len = SCHARS (Vkeyboard_translate_table);
+      const unsigned char *translate = SDATA (current_kboard->Vkeyboard_translate_table);
+      int translate_len = SCHARS (current_kboard->Vkeyboard_translate_table);
 
       for (c = 0; c < translate_len; c++)
        if (translate[c] != c)
@@ -3023,14 +3016,14 @@ You type        Translation\n\
            insert ("\n", 1);
 
            /* Insert calls signal_after_change which may GC. */
-           translate = SDATA (Vkeyboard_translate_table);
+           translate = SDATA (current_kboard->Vkeyboard_translate_table);
          }
 
       insert ("\n", 1);
     }
 
-  if (!NILP (Vkey_translation_map))
-    describe_map_tree (Vkey_translation_map, 0, Qnil, prefix,
+  if (!NILP (current_kboard->Vlocal_key_translation_map))
+    describe_map_tree (current_kboard->Vlocal_key_translation_map, 0, Qnil, prefix,
                       "Key translations", nomenu, 1, 0, 0);
 
 
@@ -3119,8 +3112,8 @@ You type        Translation\n\
                     "\f\nGlobal Bindings", nomenu, 0, 1, 0);
 
   /* Print the function-key-map translations under this prefix.  */
-  if (!NILP (Vfunction_key_map))
-    describe_map_tree (Vfunction_key_map, 0, Qnil, prefix,
+  if (!NILP (current_kboard->Vlocal_function_key_map))
+    describe_map_tree (current_kboard->Vlocal_function_key_map, 0, Qnil, prefix,
                       "\f\nFunction key map translations", nomenu, 1, 0, 0);
 
   UNGCPRO;
@@ -4086,37 +4079,6 @@ the same way.  The "active" keymaps in each alist are used before
 `minor-mode-map-alist' and `minor-mode-overriding-map-alist'.  */);
   Vemulation_mode_map_alists = Qnil;
 
-
-  DEFVAR_LISP ("function-key-map", &Vfunction_key_map,
-              doc: /* Keymap that translates key sequences to key sequences during input.
-This is used mainly for mapping ASCII function key sequences into
-real Emacs function key events (symbols).
-
-The `read-key-sequence' function replaces any subsequence bound by
-`function-key-map' with its binding.  More precisely, when the active
-keymaps have no binding for the current key sequence but
-`function-key-map' binds a suffix of the sequence to a vector or string,
-`read-key-sequence' replaces the matching suffix with its binding, and
-continues with the new sequence.
-
-If the binding is a function, it is called with one argument (the prompt)
-and its return value (a key sequence) is used.
-
-The events that come from bindings in `function-key-map' are not
-themselves looked up in `function-key-map'.
-
-For example, suppose `function-key-map' binds `ESC O P' to [f1].
-Typing `ESC O P' to `read-key-sequence' would return [f1].  Typing
-`C-x ESC O P' would return [?\\C-x f1].  If [f1] were a prefix
-key, typing `ESC O P x' would return [f1 x].  */);
-  Vfunction_key_map = Fmake_sparse_keymap (Qnil);
-
-  DEFVAR_LISP ("key-translation-map", &Vkey_translation_map,
-              doc: /* Keymap of key translations that can override keymaps.
-This keymap works like `function-key-map', but comes after that,
-and its non-prefix bindings override ordinary bindings.  */);
-  Vkey_translation_map = Qnil;
-
   staticpro (&Vmouse_events);
   Vmouse_events = Fcons (intern ("menu-bar"),
                  Fcons (intern ("tool-bar"),
index b11f630..271a2e6 100644 (file)
@@ -38,6 +38,7 @@ EXFUN (Fcurrent_active_maps, 1);
 extern Lisp_Object access_keymap P_ ((Lisp_Object, Lisp_Object, int, int, int));
 extern Lisp_Object get_keyelt P_ ((Lisp_Object, int));
 extern Lisp_Object get_keymap P_ ((Lisp_Object, int, int));
+EXFUN (Fset_keymap_parent, 2);
 extern void describe_map_tree P_ ((Lisp_Object, int, Lisp_Object, Lisp_Object,
                                   char *, int, int, int, int));
 extern int current_minor_maps P_ ((Lisp_Object **, Lisp_Object **));
index 1eec267..f5d9360 100644 (file)
@@ -84,14 +84,14 @@ extern void die P_((const char *, const char *, int)) NO_RETURN;
 
 #ifdef ENABLE_CHECKING
 
-#define CHECK(check,msg) (((check) || suppress_checking                \
-                          ? (void) 0                           \
-                          : die ((msg), __FILE__, __LINE__)),  \
+#define CHECK(check,msg) ((void)((check) || suppress_checking           \
+                                 ? (void) 0                             \
+                                 : die ((msg), __FILE__, __LINE__)),   \
                          0)
 #else
 
 /* Produce same side effects and result, but don't complain.  */
-#define CHECK(check,msg) ((check),0)
+#define CHECK(check,msg) ((void)(check),0)
 
 #endif
 
@@ -2988,6 +2988,10 @@ extern Lisp_Object Qvertical_scroll_bar;
 extern void discard_mouse_events P_ ((void));
 EXFUN (Fevent_convert_list, 1);
 EXFUN (Fread_key_sequence, 5);
+EXFUN (Fset_input_interrupt_mode, 1);
+EXFUN (Fset_output_flow_control, 2);
+EXFUN (Fset_input_meta_mode, 2);
+EXFUN (Fset_quit_char, 1);
 EXFUN (Fset_input_mode, 4);
 extern int detect_input_pending P_ ((void));
 extern int detect_input_pending_ignore_squeezables P_ ((void));
@@ -3043,6 +3047,7 @@ EXFUN (Fvisible_frame_list, 0);
 EXFUN (Fframe_parameter, 2);
 EXFUN (Fframe_parameters, 1);
 EXFUN (Fmodify_frame_parameters, 2);
+EXFUN (Fframe_with_environment, 1);
 EXFUN (Fset_frame_height, 3);
 EXFUN (Fset_frame_width, 3);
 EXFUN (Fset_frame_size, 3);
@@ -3108,7 +3113,7 @@ EXFUN (Fcall_process, MANY);
 extern int child_setup P_ ((int, int, int, char **, int, Lisp_Object));
 extern void init_callproc_1 P_ ((void));
 extern void init_callproc P_ ((void));
-extern void set_process_environment P_ ((void));
+extern void set_global_environment P_ ((void));
 extern void syms_of_callproc P_ ((void));
 
 /* defined in doc.c */
@@ -3170,28 +3175,31 @@ EXFUN (Fx_popup_menu, 2);
 EXFUN (Fx_popup_dialog, 3);
 extern void syms_of_xmenu P_ ((void));
 
+/* defined in termchar.h */
+struct tty_display_info;
+
+/* defined in termhooks.h */
+struct terminal;
+
 /* defined in sysdep.c */
 #ifndef HAVE_GET_CURRENT_DIR_NAME
 extern char *get_current_dir_name P_ ((void));
 #endif
 extern void stuff_char P_ ((char c));
 extern void init_sigio P_ ((int));
-extern void request_sigio P_ ((void));
-extern void unrequest_sigio P_ ((void));
-extern void reset_sys_modes P_ ((void));
 extern void sys_subshell P_ ((void));
 extern void sys_suspend P_ ((void));
 extern void discard_tty_input P_ ((void));
-extern void init_sys_modes P_ ((void));
-extern void get_frame_size P_ ((int *, int *));
+extern void init_sys_modes P_ ((struct tty_display_info *));
+extern void reset_sys_modes P_ ((struct tty_display_info *));
+extern void init_all_sys_modes P_ ((void));
+extern void reset_all_sys_modes P_ ((void));
 extern void wait_for_termination P_ ((int));
 extern void flush_pending_output P_ ((int));
 extern void child_setup_tty P_ ((int));
 extern void setup_pty P_ ((int));
 extern int set_window_size P_ ((int, int, int));
 extern void create_process P_ ((Lisp_Object, char **, Lisp_Object));
-extern int tabs_safe_p P_ ((void));
-extern void init_baud_rate P_ ((void));
 extern int emacs_open P_ ((const char *, int, int));
 extern int emacs_close P_ ((int));
 extern int emacs_read P_ ((int, char *, unsigned int));
@@ -3226,6 +3234,9 @@ extern void syms_of_dired P_ ((void));
 extern void syms_of_term P_ ((void));
 extern void fatal () NO_RETURN;
 
+/* Defined in terminal.c */
+extern void syms_of_terminal P_ ((void));
+
 #ifdef HAVE_WINDOW_SYSTEM
 /* Defined in fontset.c */
 extern void syms_of_fontset P_ ((void));
index 6ce7c6a..596ba79 100644 (file)
@@ -27,6 +27,7 @@ Boston, MA 02110-1301, USA.  */
 #include <sys/stat.h>
 #include <sys/file.h>
 #include <errno.h>
+#include <setjmp.h>
 #include "lisp.h"
 #include "intervals.h"
 #include "buffer.h"
@@ -34,6 +35,7 @@ Boston, MA 02110-1301, USA.  */
 #include <epaths.h>
 #include "commands.h"
 #include "keyboard.h"
+#include "frame.h"
 #include "termhooks.h"
 #include "coding.h"
 
@@ -437,8 +439,6 @@ static void substitute_in_interval P_ ((INTERVAL, Lisp_Object));
 \f
 /* Get a character from the tty.  */
 
-extern Lisp_Object read_char ();
-
 /* Read input events until we get one that's acceptable for our purposes.
 
    If NO_SWITCH_FRAME is non-zero, switch-frame events are stashed
@@ -481,7 +481,7 @@ read_filtered_event (no_switch_frame, ascii_required, error_nonascii,
     {
       EMACS_TIME wait_time;
       int sec, usec;
-      double duration = extract_float (seconds);        
+      double duration = extract_float (seconds);
 
       sec  = (int) duration;
       usec = (duration - sec) * 1000000;
@@ -490,10 +490,12 @@ read_filtered_event (no_switch_frame, ascii_required, error_nonascii,
       EMACS_ADD_TIME (end_time, end_time, wait_time);
     }
 
-  /* Read until we get an acceptable event.  */
+/* Read until we get an acceptable event.  */
  retry:
-  val = read_char (0, 0, 0, (input_method ? Qnil : Qt), 0,
-                  NUMBERP (seconds) ? &end_time : NULL);
+  do 
+    val = read_char (0, 0, 0, (input_method ? Qnil : Qt), 0,
+                    NUMBERP (seconds) ? &end_time : NULL);
+  while (INTEGERP (val) && XINT (val) == -2); /* wrong_kboard_jmpbuf */
 
   if (BUFFERP (val))
     goto retry;
index 2df3b4e..14261f6 100644 (file)
@@ -1370,11 +1370,11 @@ x_set_mouse_color (f, arg, oldval)
   Cursor cursor, nontext_cursor, mode_cursor, hand_cursor;
   Cursor hourglass_cursor, horizontal_drag_cursor;
   unsigned long pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
-  unsigned long mask_color = x->background_pixel;
+  unsigned long mask_color = FRAME_BACKGROUND_PIXEL (f);
 
   /* Don't let pointers be invisible.  */
   if (mask_color == pixel)
-    pixel = x->foreground_pixel;
+    pixel = FRAME_FOREGROUND_PIXEL (f);
 
   f->output_data.mac->mouse_pixel = pixel;
 
@@ -2410,8 +2410,8 @@ x_make_gc (f)
     = (XCreatePixmapFromBitmapData
        (FRAME_X_DISPLAY (f), FRAME_X_DISPLAY_INFO (f)->root_window,
        gray_bits, gray_width, gray_height,
-       f->output_data.x->foreground_pixel,
-       f->output_data.x->background_pixel,
+       FRAME_FOREGROUND_PIXEL (f),
+       FRAME_BACKGROUND_PIXEL (f),
        DefaultDepth (FRAME_X_DISPLAY (f), FRAME_X_SCREEN_NUMBER (f))));
 #endif
 
index e36fafa..4739a52 100644 (file)
@@ -11545,19 +11545,20 @@ mac_initialize ()
   redeem_scroll_bar_hook = XTredeem_scroll_bar;
   judge_scroll_bars_hook = XTjudge_scroll_bars;
 
-  scroll_region_ok = 1;         /* we'll scroll partial frames */
-  char_ins_del_ok = 1;
-  line_ins_del_ok = 1;          /* we'll just blt 'em */
-  fast_clear_end_of_line = 1;   /* X does this well */
-  memory_below_frame = 0;       /* we don't remember what scrolls
-                                  off the bottom */
+  TTY_SCROLL_REGION_OK (CURTTY ()) = 1; /* we'll scroll partial frames */
+  TTY_CHAR_INS_DEL_OK (CURTTY ()) = 1;
+  TTY_LINE_INS_DEL_OK (CURTTY ()) = 1; /* we'll just blt 'em */
+  TTY_FAST_CLEAR_END_OF_LINE (CURTTY ()) = 1; /* X does this well */
+  TTY_MEMORY_BELOW_FRAME (CURTTY ()) = 0; /* we don't remember what
+                                                         scrolls off the
+                                                         bottom */
   baud_rate = 19200;
 
   last_tool_bar_item = -1;
   any_help_event_p = 0;
 
   /* Try to use interrupt input; if we can't, then start polling.  */
-  Fset_input_mode (Qt, Qnil, Qt, Qnil);
+  Fset_input_interrupt_mode (Qt);
 
   BLOCK_INPUT;
 
index cac90f1..33692a8 100644 (file)
@@ -348,9 +348,6 @@ typedef struct mac_output mac_output;
 #define FRAME_MAC_WINDOW(f) ((f)->output_data.mac->window_desc)
 #define FRAME_X_WINDOW(f) ((f)->output_data.mac->window_desc)
 
-#define FRAME_FOREGROUND_PIXEL(f) ((f)->output_data.x->foreground_pixel)
-#define FRAME_BACKGROUND_PIXEL(f) ((f)->output_data.x->background_pixel)
-
 #define FRAME_FONT(f) ((f)->output_data.mac->font)
 #define FRAME_FONTSET(f) ((f)->output_data.mac->fontset)
 
index d17e923..31c0fd1 100644 (file)
@@ -35,6 +35,7 @@ Boston, MA 02110-1301, USA.  */
 #include "syntax.h"
 #include "intervals.h"
 #include "keymap.h"
+#include "termhooks.h"
 
 extern int quit_char;
 
@@ -479,7 +480,6 @@ read_minibuf (map, initial, prompt, backup_n, expflag,
 
   specbind (Qminibuffer_default, defalt);
 
-  single_kboard_state ();
 #ifdef HAVE_X_WINDOWS
   if (display_hourglass_p)
     cancel_hourglass ();
@@ -563,6 +563,8 @@ read_minibuf (map, initial, prompt, backup_n, expflag,
   if (minibuffer_auto_raise)
     Fraise_frame (mini_frame);
 
+  temporarily_switch_to_single_kboard (XFRAME (mini_frame));
+
   /* We have to do this after saving the window configuration
      since that is what restores the current buffer.  */
 
@@ -738,8 +740,12 @@ read_minibuf (map, initial, prompt, backup_n, expflag,
       XWINDOW (minibuf_window)->cursor.x = 0;
       XWINDOW (minibuf_window)->must_be_updated_p = 1;
       update_frame (XFRAME (selected_frame), 1, 1);
-      if (rif && rif->flush_display)
-       rif->flush_display (XFRAME (XWINDOW (minibuf_window)->frame));
+      {
+        struct frame *f = XFRAME (XWINDOW (minibuf_window)->frame);
+        struct redisplay_interface *rif = FRAME_RIF (f);
+        if (rif && rif->flush_display)
+          rif->flush_display (f);
+      }
     }
 
   /* Make minibuffer contents into a string.  */
index 00ef84d..834a32d 100644 (file)
@@ -508,8 +508,8 @@ ScreenVisualBell (void)
 {
   /* This creates an xor-mask that will swap the default fore- and
      background colors.  */
-  do_visible_bell (((the_only_x_display.foreground_pixel
-                    ^ the_only_x_display.background_pixel)
+  do_visible_bell (((FRAME_FOREGROUND_PIXEL (SELECTED_FRAME ())
+                    ^ FRAME_BACKGROUND_PIXEL (SELECTED_FRAME ()))
                    * 0x11) & 0x7f);
 }
 #endif
@@ -2531,8 +2531,8 @@ internal_terminal_init ()
   initial_screen_colors[0] = initial_screen_colors[1] = -1;
 
   bzero (&the_only_x_display, sizeof the_only_x_display);
-  the_only_x_display.background_pixel = 7; /* White */
-  the_only_x_display.foreground_pixel = 0; /* Black */
+  FRAME_BACKGROUND_PIXEL (SELECTED_FRAME ()) = 7; /* White */
+  FRAME_FOREGROUND_PIXEL (SELECTED_FRAME ()) = 0; /* Black */
   bright_bg ();
   colors = getenv ("EMACSCOLORS");
   if (colors && strlen (colors) >= 2)
@@ -2543,13 +2543,13 @@ internal_terminal_init ()
       else if (isxdigit (colors[0]))
         colors[0] -= (isupper (colors[0]) ? 'A' : 'a') - 10;
       if (colors[0] >= 0 && colors[0] < 16)
-        the_only_x_display.foreground_pixel = colors[0];
+        FRAME_FOREGROUND_PIXEL (SELECTED_FRAME ()) = colors[0];
       if (isdigit (colors[1]))
         colors[1] -= '0';
       else if (isxdigit (colors[1]))
         colors[1] -= (isupper (colors[1]) ? 'A' : 'a') - 10;
       if (colors[1] >= 0 && colors[1] < 16)
-        the_only_x_display.background_pixel = colors[1];
+        FRAME_BACKGROUND_PIXEL (SELECTED_FRAME ()) = colors[1];
     }
   the_only_x_display.font = (XFontStruct *)1;   /* must *not* be zero */
   the_only_x_display.display_info.mouse_face_mouse_frame = NULL;
@@ -2583,7 +2583,7 @@ internal_terminal_init ()
   set_terminal_modes_hook = IT_set_terminal_modes;
   reset_terminal_modes_hook = IT_reset_terminal_modes;
   set_terminal_window_hook = IT_set_terminal_window;
-  char_ins_del_ok = 0;
+  TTY_CHAR_INS_DEL_OK (CURTTY ()) = 0;
 #endif
 }
 
@@ -4880,7 +4880,7 @@ croak (badfunc)
      char *badfunc;
 {
   fprintf (stderr, "%s not yet implemented\r\n", badfunc);
-  reset_sys_modes ();
+  reset_all_sys_modes ();
   exit (1);
 }
 \f
index 1a855e0..1f2632c 100644 (file)
@@ -45,6 +45,7 @@ Boston, MA 02110-1301, USA.  */
    I'm quitting and taking up gardening.  */
 
 #include <stdio.h>
+#include <stdlib.h>
 
 int
 main (argc, argv)
index c81f99f..5d65081 100644 (file)
@@ -1382,10 +1382,10 @@ print_preprocess (obj)
          for (i = 0; i < print_number_index; i++)
            if (EQ (PRINT_NUMBER_OBJECT (Vprint_number_table, i), obj))
              {
-               /* OBJ appears more than once.  Let's remember that.  */
+               /* OBJ appears more than once.  Let's remember that.  */
                PRINT_NUMBER_STATUS (Vprint_number_table, i) = Qt;
                 print_depth--;
-                return;
+               return;
              }
 
          /* OBJ is not yet recorded.  Let's add to the table.  */
index 512b231..7a8ad5c 100644 (file)
@@ -138,11 +138,11 @@ Boston, MA 02110-1301, USA.  */
 #include "charset.h"
 #include "coding.h"
 #include "process.h"
+#include "frame.h"
 #include "termhooks.h"
 #include "termopts.h"
 #include "commands.h"
 #include "keyboard.h"
-#include "frame.h"
 #include "blockinput.h"
 #include "dispextern.h"
 #include "composite.h"
@@ -328,11 +328,11 @@ extern int timers_run;
 
 static SELECT_TYPE input_wait_mask;
 
-/* Mask that excludes keyboard input descriptor (s).  */
+/* Mask that excludes keyboard input descriptor(s).  */
 
 static SELECT_TYPE non_keyboard_wait_mask;
 
-/* Mask that excludes process input descriptor (s).  */
+/* Mask that excludes process input descriptor(s).  */
 
 static SELECT_TYPE non_process_wait_mask;
 
@@ -3133,6 +3133,10 @@ usage: (make-network-process &rest ARGS)  */)
 
  open_socket:
 
+#ifdef __ultrix__
+  /* Previously this was compiled unconditionally, but that seems
+     unnecessary on modern systems, and `unrequest_sigio' was a noop
+     under X anyway. --lorentey */
   /* Kernel bugs (on Ultrix at least) cause lossage (not just EINTR)
      when connect is interrupted.  So let's not let it get interrupted.
      Note we do not turn off polling, because polling is only used
@@ -3149,6 +3153,7 @@ usage: (make-network-process &rest ARGS)  */)
       record_unwind_protect (unwind_request_sigio, Qnil);
       unrequest_sigio ();
     }
+#endif
 
   /* Do this in case we never enter the for-loop below.  */
   count1 = SPECPDL_INDEX ();
@@ -6837,20 +6842,12 @@ DEFUN ("process-filter-multibyte-p", Fprocess_filter_multibyte_p,
 
 
 \f
-/* The first time this is called, assume keyboard input comes from DESC
-   instead of from where we used to expect it.
-   Subsequent calls mean assume input keyboard can come from DESC
-   in addition to other places.  */
-
-static int add_keyboard_wait_descriptor_called_flag;
+/* Add DESC to the set of keyboard input descriptors.  */
 
 void
 add_keyboard_wait_descriptor (desc)
      int desc;
 {
-  if (! add_keyboard_wait_descriptor_called_flag)
-    FD_CLR (0, &input_wait_mask);
-  add_keyboard_wait_descriptor_called_flag = 1;
   FD_SET (desc, &input_wait_mask);
   FD_SET (desc, &non_process_wait_mask);
   if (desc > max_keyboard_desc)
@@ -6922,7 +6919,12 @@ init_process ()
   process_output_skip = 0;
 #endif
 
+  /* Don't do this, it caused infinite select loops.  The display
+     method should call add_keyboard_wait_descriptor on stdin if it
+     needs that.  */
+#if 0
   FD_SET (0, &input_wait_mask);
+#endif
 
   Vprocess_alist = Qnil;
 #ifdef SIGCHLD
index 5dd374a..bd8d74f 100644 (file)
@@ -43,7 +43,7 @@ Boston, MA 02110-1301, USA.  */
 #endif
 
 #ifndef BASE_PURESIZE
-#define BASE_PURESIZE (1120000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA)
+#define BASE_PURESIZE (1140000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA)
 #endif
 
 /* Increase BASE_PURESIZE by a ratio depending on the machine's word size.  */
index e8981fc..9b04f47 100644 (file)
@@ -23,12 +23,13 @@ Boston, MA 02110-1301, USA.  */
 #include <config.h>
 #include <stdio.h>
 #include <string.h>
-#include "termchar.h"
 #include "lisp.h"
+#include "termchar.h"
 #include "dispextern.h"
 #include "keyboard.h"
 #include "frame.h"
 #include "window.h"
+#include "termhooks.h"
 
 /* All costs measured in characters.
    So no cost can exceed the area of a frame, measured in characters.
@@ -58,10 +59,12 @@ struct matrix_elt
     unsigned char writecount;
   };
 
-static void do_direct_scrolling P_ ((struct glyph_matrix *,
+static void do_direct_scrolling P_ ((struct frame *,
+                                     struct glyph_matrix *,
                                     struct matrix_elt *,
                                     int, int));
-static void do_scrolling P_ ((struct glyph_matrix *,
+static void do_scrolling P_ ((struct frame *,
+                              struct glyph_matrix *,
                              struct matrix_elt *,
                              int, int));
 
@@ -101,7 +104,8 @@ calculate_scrolling (frame, matrix, window_size, lines_below,
   register struct matrix_elt *p, *p1;
   register int cost, cost1;
 
-  int lines_moved = window_size + (scroll_region_ok ? 0 : lines_below);
+  int lines_moved = window_size
+    + (FRAME_SCROLL_REGION_OK (frame) ? 0 : lines_below);
   /* first_insert_cost[I] is the cost of doing the first insert-line
      at the i'th line of the lines we are considering,
      where I is origin 1 (as it is below).  */
@@ -241,7 +245,8 @@ calculate_scrolling (frame, matrix, window_size, lines_below,
    of lines.  */
 
 static void
-do_scrolling (current_matrix, matrix, window_size, unchanged_at_top)
+do_scrolling (frame, current_matrix, matrix, window_size, unchanged_at_top)
+     struct frame *frame;
      struct glyph_matrix *current_matrix;
      struct matrix_elt *matrix;
      int window_size;
@@ -308,12 +313,12 @@ do_scrolling (current_matrix, matrix, window_size, unchanged_at_top)
          /* Set the terminal window, if not done already.  */
          if (! terminal_window_p)
            {
-             set_terminal_window (window_size + unchanged_at_top);
+             set_terminal_window (frame, window_size + unchanged_at_top);
              terminal_window_p = 1;
            }
 
          /* Delete lines on the terminal.  */
-         ins_del_lines (j + unchanged_at_top, - p->deletecount);
+         ins_del_lines (frame, j + unchanged_at_top, - p->deletecount);
        }
       else
        {
@@ -338,7 +343,7 @@ do_scrolling (current_matrix, matrix, window_size, unchanged_at_top)
       /* Set the terminal window if not yet done.  */
       if (!terminal_window_p)
        {
-         set_terminal_window (window_size + unchanged_at_top);
+         set_terminal_window (frame, window_size + unchanged_at_top);
          terminal_window_p = 1;
        }
 
@@ -347,7 +352,7 @@ do_scrolling (current_matrix, matrix, window_size, unchanged_at_top)
          --queue;
 
          /* Do the deletion on the terminal.  */
-         ins_del_lines (queue->pos, queue->count);
+         ins_del_lines (frame, queue->pos, queue->count);
 
          /* All lines in the range deleted become empty in the glyph
             matrix.  Assign to them glyph rows that are not retained.
@@ -380,7 +385,7 @@ do_scrolling (current_matrix, matrix, window_size, unchanged_at_top)
   CHECK_MATRIX (current_matrix);
 
   if (terminal_window_p)
-    set_terminal_window (0);
+    set_terminal_window (frame, 0);
 }
 
 \f
@@ -467,7 +472,8 @@ calculate_direct_scrolling (frame, matrix, window_size, lines_below,
   /* Overhead of setting the scroll window, plus the extra cost
      cost of scrolling by a distance of one.  The extra cost is
      added once for consistency with the cost vectors */
-  scroll_overhead = scroll_region_cost + extra_cost;
+  scroll_overhead
+    = FRAME_SCROLL_REGION_COST (frame) + extra_cost;
 
   /* initialize the top left corner of the matrix */
   matrix->writecost = 0;
@@ -650,8 +656,9 @@ calculate_direct_scrolling (frame, matrix, window_size, lines_below,
    the cost matrix for this approach is constructed. */
 
 static void
-do_direct_scrolling (current_matrix, cost_matrix, window_size,
-                    unchanged_at_top)
+do_direct_scrolling (frame, current_matrix, cost_matrix,
+                     window_size, unchanged_at_top)
+     struct frame *frame;
      struct glyph_matrix *current_matrix;
      struct matrix_elt *cost_matrix;
      int window_size;
@@ -742,9 +749,9 @@ do_direct_scrolling (current_matrix, cost_matrix, window_size,
          if (i > j)
            {
              /* Immediately insert lines */
-             set_terminal_window (i + unchanged_at_top);
+             set_terminal_window (frame, i + unchanged_at_top);
              terminal_window_p = 1;
-             ins_del_lines (j - n_to_write + unchanged_at_top, i - j);
+             ins_del_lines (frame, j - n_to_write + unchanged_at_top, i - j);
            }
          else if (i < j)
            {
@@ -774,9 +781,9 @@ do_direct_scrolling (current_matrix, cost_matrix, window_size,
          --queue;
          if (queue->count)
            {
-             set_terminal_window (queue->window);
+             set_terminal_window (frame, queue->window);
              terminal_window_p = 1;
-             ins_del_lines (queue->pos, queue->count);
+             ins_del_lines (frame, queue->pos, queue->count);
            }
          else
            {
@@ -799,7 +806,7 @@ do_direct_scrolling (current_matrix, cost_matrix, window_size,
                       copy_from, retained_p);
 
   if (terminal_window_p)
-    set_terminal_window (0);
+    set_terminal_window (frame, 0);
 }
 
 
@@ -819,13 +826,13 @@ scrolling_1 (frame, window_size, unchanged_at_top, unchanged_at_bottom,
   matrix = ((struct matrix_elt *)
            alloca ((window_size + 1) * (window_size + 1) * sizeof *matrix));
 
-  if (scroll_region_ok)
+  if (FRAME_SCROLL_REGION_OK (frame))
     {
       calculate_direct_scrolling (frame, matrix, window_size,
                                  unchanged_at_bottom,
                                  draw_cost, old_draw_cost,
                                  old_hash, new_hash, free_at_end);
-      do_direct_scrolling (frame->current_matrix,
+      do_direct_scrolling (frame, frame->current_matrix,
                           matrix, window_size, unchanged_at_top);
     }
   else
@@ -833,7 +840,8 @@ scrolling_1 (frame, window_size, unchanged_at_top, unchanged_at_bottom,
       calculate_scrolling (frame, matrix, window_size, unchanged_at_bottom,
                           draw_cost, old_hash, new_hash,
                           free_at_end);
-      do_scrolling (frame->current_matrix, matrix, window_size,
+      do_scrolling (frame,
+                    frame->current_matrix, matrix, window_size,
                    unchanged_at_top);
     }
 }
@@ -915,7 +923,7 @@ scroll_cost (frame, from, to, amount)
   if (amount == 0)
     return 0;
 
-  if (! scroll_region_ok)
+  if (! FRAME_SCROLL_REGION_OK (frame))
     limit = height;
   else if (amount > 0)
     limit += amount;
index 625b5d6..1068c7a 100644 (file)
@@ -46,6 +46,8 @@ extern void srandom P_ ((unsigned int));
 #endif
 #endif
 
+#include "sysselect.h"
+
 #include "blockinput.h"
 
 #ifdef MAC_OS8
@@ -176,6 +178,7 @@ extern int quit_char;
 #include "termopts.h"
 #include "dispextern.h"
 #include "process.h"
+#include "cm.h"  /* for reset_sys_modes */
 
 #ifdef WINDOWSNT
 #include <direct.h>
@@ -239,16 +242,11 @@ static int baud_convert[] =
 
 int emacs_ospeed;
 
-/* The file descriptor for Emacs's input terminal.
-   Under Unix, this is normally zero except when using X;
-   under VMS, we place the input channel number here.  */
-int input_fd;
-
 void croak P_ ((char *)) NO_RETURN;
 
 #ifdef AIXHFT
-void hft_init ();
-void hft_reset ();
+void hft_init P_ ((struct tty_display_info *));
+void hft_reset P_ ((struct tty_display_info *));
 #endif
 
 /* Temporary used by `sigblock' when defined in terms of signprocmask.  */
@@ -331,16 +329,7 @@ get_current_dir_name ()
 #endif
 
 \f
-/* Specify a different file descriptor for further input operations.  */
-
-void
-change_input_fd (fd)
-     int fd;
-{
-  input_fd = fd;
-}
-
-/* Discard pending input on descriptor input_fd.  */
+/* Discard pending input on all input descriptors.  */
 
 void
 discard_tty_input ()
@@ -351,54 +340,61 @@ discard_tty_input ()
   if (noninteractive)
     return;
 
-  /* Discarding input is not safe when the input could contain
-     replies from the X server.  So don't do it.  */
-  if (read_socket_hook)
-    return;
-
 #ifdef VMS
   end_kbd_input ();
-  SYS$QIOW (0, input_fd, IO$_READVBLK|IO$M_PURGE, input_iosb, 0, 0,
+  SYS$QIOW (0, fileno (CURTTY()->input), IO$_READVBLK|IO$M_PURGE, input_iosb, 0, 0,
            &buf.main, 0, 0, terminator_mask, 0, 0);
   queue_kbd_input ();
 #else /* not VMS */
 #ifdef APOLLO
   {
-    int zero = 0;
-    ioctl (input_fd, TIOCFLUSH, &zero);
+    struct tty_display_info *tty;
+    for (tty = tty_list; tty; tty = tty->next)
+      {
+        int zero = 0;
+        if (tty->input)
+          ioctl (fileno (tty->input), TIOCFLUSH, &zero);
+      }
   }
 #else /* not Apollo */
 #ifdef MSDOS    /* Demacs 1.1.1 91/10/16 HIRANO Satoshi */
   while (dos_keyread () != -1)
     ;
 #else /* not MSDOS */
-  EMACS_GET_TTY (input_fd, &buf);
-  EMACS_SET_TTY (input_fd, &buf, 0);
+  {
+    struct tty_display_info *tty;
+    for (tty = tty_list; tty; tty = tty->next)
+      {
+        if (tty->input)         /* Is the device suspended? */
+          {
+            EMACS_GET_TTY (fileno (tty->input), &buf);
+            EMACS_SET_TTY (fileno (tty->input), &buf, 0);
+          }
+      }
+  }
 #endif /* not MSDOS */
 #endif /* not Apollo */
 #endif /* not VMS */
 #endif /* not WINDOWSNT */
 }
 
+\f
 #ifdef SIGTSTP
 
 /* Arrange for character C to be read as the next input from
-   the terminal.  */
+   the terminal.
+   XXX What if we have multiple ttys?
+*/
 
 void
-#ifdef PROTOTYPES
 stuff_char (char c)
-#else
-stuff_char (c)
-     char c;
-#endif
 {
-  if (read_socket_hook)
+  if (! FRAME_TERMCAP_P (SELECTED_FRAME ()))
     return;
 
 /* Should perhaps error if in batch mode */
 #ifdef TIOCSTI
-  ioctl (input_fd, TIOCSTI, &c);
+  ioctl (fileno (CURTTY()->input), TIOCSTI, &c);
 #else /* no TIOCSTI */
   error ("Cannot stuff terminal input characters in this version of Unix");
 #endif /* no TIOCSTI */
@@ -407,7 +403,7 @@ stuff_char (c)
 #endif /* SIGTSTP */
 \f
 void
-init_baud_rate ()
+init_baud_rate (int fd)
 {
   if (noninteractive)
     emacs_ospeed = 0;
@@ -422,7 +418,7 @@ init_baud_rate ()
 #ifdef VMS
       struct sensemode sg;
 
-      SYS$QIOW (0, input_fd, IO$_SENSEMODE, &sg, 0, 0,
+      SYS$QIOW (0, fd, IO$_SENSEMODE, &sg, 0, 0,
                &sg.class, 12, 0, 0, 0, 0 );
       emacs_ospeed = sg.xmit_baud;
 #else /* not VMS */
@@ -430,7 +426,7 @@ init_baud_rate ()
       struct termios sg;
 
       sg.c_cflag = B9600;
-      tcgetattr (input_fd, &sg);
+      tcgetattr (fd, &sg);
       emacs_ospeed = cfgetospeed (&sg);
 #if defined (USE_GETOBAUD) && defined (getobaud)
       /* m88k-motorola-sysv3 needs this (ghazi@noc.rutgers.edu) 9/1/94. */
@@ -443,16 +439,16 @@ init_baud_rate ()
 
       sg.c_cflag = B9600;
 #ifdef HAVE_TCATTR
-      tcgetattr (input_fd, &sg);
+      tcgetattr (fd, &sg);
 #else
-      ioctl (input_fd, TCGETA, &sg);
+      ioctl (fd, TCGETA, &sg);
 #endif
       emacs_ospeed = sg.c_cflag & CBAUD;
 #else /* neither VMS nor TERMIOS nor TERMIO */
       struct sgttyb sg;
 
       sg.sg_ospeed = B9600;
-      if (ioctl (input_fd, TIOCGETP, &sg) < 0)
+      if (ioctl (fd, TIOCGETP, &sg) < 0)
        abort ();
       emacs_ospeed = sg.sg_ospeed;
 #endif /* not HAVE_TERMIO */
@@ -468,6 +464,7 @@ init_baud_rate ()
     baud_rate = 1200;
 }
 
+\f
 /*ARGSUSED*/
 void
 set_exclusive_use (fd)
@@ -729,7 +726,7 @@ child_setup_tty (out)
 
 #ifdef BSD4_1
   if (interrupt_input)
-    reset_sigio ();
+    reset_sigio (0);
 #endif /* BSD4_1 */
 #ifdef RTU
   {
@@ -986,53 +983,86 @@ restore_signal_handlers (saved_handlers)
     }
 }
 \f
+#ifndef SIGIO
+/* If SIGIO is broken, don't do anything. */
+void
+init_sigio (int fd)
+{
+}
+
+void
+reset_sigio (int fd)
+{
+}
+
+void
+request_sigio (void)
+{
+}
+
+void
+unrequest_sigio (void)
+{
+}
+
+#else
 #ifdef F_SETFL
 
-int old_fcntl_flags;
+int old_fcntl_flags[MAXDESC];
 
 void
 init_sigio (fd)
      int fd;
 {
 #ifdef FASYNC
-  old_fcntl_flags = fcntl (fd, F_GETFL, 0) & ~FASYNC;
-  fcntl (fd, F_SETFL, old_fcntl_flags | FASYNC);
+  old_fcntl_flags[fd] = fcntl (fd, F_GETFL, 0) & ~FASYNC;
+  fcntl (fd, F_SETFL, old_fcntl_flags[fd] | FASYNC);
 #endif
   interrupts_deferred = 0;
 }
 
 void
-reset_sigio ()
+reset_sigio (fd)
+     int fd;
 {
-  unrequest_sigio ();
+#ifdef FASYNC
+  fcntl (fd, F_SETFL, old_fcntl_flags[fd]);
+#endif
 }
 
 #ifdef FASYNC          /* F_SETFL does not imply existence of FASYNC */
+/* XXX Uhm, FASYNC is not used anymore here. */
+/* XXX Yeah, but you need it for SIGIO, don't you? */
 
 void
 request_sigio ()
 {
-  if (noninteractive || read_socket_hook)
+  if (noninteractive)
     return;
 
 #ifdef SIGWINCH
   sigunblock (sigmask (SIGWINCH));
 #endif
-  fcntl (input_fd, F_SETFL, old_fcntl_flags | FASYNC);
+  sigunblock (sigmask (SIGIO));
 
   interrupts_deferred = 0;
 }
 
 void
-unrequest_sigio ()
-{
-  if (noninteractive || read_socket_hook)
+unrequest_sigio (void)
+{ 
+  if (noninteractive)
     return;
 
+#if 0 /* XXX What's wrong with blocking SIGIO under X?  */
+  if (x_display_list)
+    return;
+#endif
+
 #ifdef SIGWINCH
   sigblock (sigmask (SIGWINCH));
 #endif
-  fcntl (input_fd, F_SETFL, old_fcntl_flags);
+  sigblock (sigmask (SIGIO));
   interrupts_deferred = 1;
 }
 
@@ -1047,7 +1077,8 @@ request_sigio ()
   if (noninteractive || read_socket_hook)
     return;
 
-  ioctl (input_fd, FIOASYNC, &on);
+  /* XXX CURTTY() is bogus here. */
+  ioctl (fileno (CURTTY ()->input), FIOASYNC, &on);
   interrupts_deferred = 0;
 }
 
@@ -1059,7 +1090,8 @@ unrequest_sigio ()
   if (noninteractive || read_socket_hook)
     return;
 
-  ioctl (input_fd, FIOASYNC, &off);
+  /* XXX CURTTY() is bogus here. */
+  ioctl (fileno (CURTTY ()->input), FIOASYNC, &off);
   interrupts_deferred = 1;
 }
 
@@ -1080,7 +1112,7 @@ request_sigio ()
 
   sigemptyset (&st);
   sigaddset (&st, SIGIO);
-  ioctl (input_fd, FIOASYNC, &on);
+  ioctl (0, FIOASYNC, &on);     /* XXX This fails for multiple ttys. */
   interrupts_deferred = 0;
   sigprocmask (SIG_UNBLOCK, &st, (sigset_t *)0);
 }
@@ -1093,7 +1125,7 @@ unrequest_sigio ()
   if (noninteractive || read_socket_hook)
     return;
 
-  ioctl (input_fd, FIOASYNC, &off);
+  ioctl (0, FIOASYNC, &off);  /* XXX This fails for multiple ttys. */
   interrupts_deferred = 1;
 }
 
@@ -1123,6 +1155,7 @@ unrequest_sigio ()
 #endif /* STRIDE */
 #endif /* FASYNC */
 #endif /* F_SETFL */
+#endif /* SIGIO */
 \f
 /* Saving and restoring the process group of Emacs's terminal.  */
 
@@ -1145,30 +1178,39 @@ unrequest_sigio ()
    the tty's pgroup just like any other terminal setting.  If
    inherited_group was not the tty's pgroup, then we'll get a
    SIGTTmumble when we try to change the tty's pgroup, and a CONT if
-   it goes foreground in the future, which is what should happen.  */
+   it goes foreground in the future, which is what should happen.
+
+   This variable is initialized in emacs.c.  */
 int inherited_pgroup;
 
-/* Split off the foreground process group to Emacs alone.
-   When we are in the foreground, but not started in our own process
-   group, redirect the TTY to point to our own process group.  We need
-   to be in our own process group to receive SIGIO properly.  */
+/* Split off the foreground process group to Emacs alone.  When we are
+   in the foreground, but not started in our own process group,
+   redirect the tty device handle FD to point to our own process
+   group.  We need to be in our own process group to receive SIGIO
+   properly.  */
 void
-narrow_foreground_group ()
+narrow_foreground_group (int fd)
 {
   int me = getpid ();
 
   setpgrp (0, inherited_pgroup);
+#if 0
+  /* XXX inherited_pgroup should not be zero here, but GTK seems to
+     mess this up. */
+  if (! inherited_pgroup)
+    abort ();                   /* Should not happen. */
+#endif
   if (inherited_pgroup != me)
-    EMACS_SET_TTY_PGRP (input_fd, &me);
+      EMACS_SET_TTY_PGRP (fd, &me); /* XXX This only works on the controlling tty. */
   setpgrp (0, me);
 }
 
 /* Set the tty to our original foreground group.  */
 void
-widen_foreground_group ()
+widen_foreground_group (int fd)
 {
   if (inherited_pgroup != getpid ())
-    EMACS_SET_TTY_PGRP (input_fd, &inherited_pgroup);
+    EMACS_SET_TTY_PGRP (fd, &inherited_pgroup);
   setpgrp (0, inherited_pgroup);
 }
 
@@ -1326,14 +1368,6 @@ emacs_set_tty (fd, settings, flushp)
 }
 
 \f
-/* The initial tty mode bits */
-struct emacs_tty old_tty;
-
-/* 1 if we have been through init_sys_modes.  */
-int term_initted;
-
-/* 1 if outer tty status has been recorded.  */
-int old_tty_valid;
 
 #ifdef BSD4_1
 /* BSD 4.1 needs to keep track of the lmode bits in order to start
@@ -1343,7 +1377,7 @@ int lmode;
 
 #ifndef F_SETOWN_BUG
 #ifdef F_SETOWN
-int old_fcntl_owner;
+int old_fcntl_owner[MAXDESC];
 #endif /* F_SETOWN */
 #endif /* F_SETOWN_BUG */
 
@@ -1368,8 +1402,22 @@ static struct ltchars new_ltchars = {-1,-1,-1,-1,-1,-1};
 static struct tchars new_tchars = {-1,-1,-1,-1,-1,-1};
 #endif
 
+/* Initialize the terminal mode on all tty devices that are currently
+   open. */
+
 void
-init_sys_modes ()
+init_all_sys_modes (void)
+{
+  struct tty_display_info *tty;
+  for (tty = tty_list; tty; tty = tty->next)
+    init_sys_modes (tty);
+}
+
+/* Initialize the terminal mode on the given tty device. */
+
+void
+init_sys_modes (tty_out)
+     struct tty_display_info *tty_out;
 {
   struct emacs_tty tty;
 
@@ -1385,6 +1433,9 @@ init_sys_modes ()
   if (noninteractive)
     return;
 
+  if (!tty_out->output)
+    return;                     /* The tty is suspended. */
+  
 #ifdef VMS
   if (!input_ef)
     input_ef = get_kbd_event_flag ();
@@ -1415,266 +1466,287 @@ init_sys_modes ()
 #ifndef VMS4_4
   sys_access_reinit ();
 #endif
-#endif /* not VMS */
+#endif /* VMS */
 
 #ifdef BSD_PGRPS
-  if (! read_socket_hook && EQ (Vwindow_system, Qnil))
-    narrow_foreground_group ();
+#if 0
+  /* read_socket_hook is not global anymore.  I think doing this
+     unconditionally will not cause any problems. */
+  if (! read_socket_hook && EQ (Vinitial_window_system, Qnil))
 #endif
-
-#ifdef HAVE_WINDOW_SYSTEM
-  /* Emacs' window system on MSDOG uses the `internal terminal' and therefore
-     needs the initialization code below.  */
-  if (!read_socket_hook && EQ (Vwindow_system, Qnil))
+    narrow_foreground_group (fileno (tty_out->input));
 #endif
-    {
-      EMACS_GET_TTY (input_fd, &old_tty);
 
-      old_tty_valid = 1;
+  if (! tty_out->old_tty)
+    tty_out->old_tty = (struct emacs_tty *) xmalloc (sizeof (struct emacs_tty));
+      
+  EMACS_GET_TTY (fileno (tty_out->input), tty_out->old_tty);
 
-      tty = old_tty;
+  tty = *tty_out->old_tty;
 
 #if defined (HAVE_TERMIO) || defined (HAVE_TERMIOS)
-      XSETINT (Vtty_erase_char, old_tty.main.c_cc[VERASE]);
+  XSETINT (Vtty_erase_char, tty.main.c_cc[VERASE]);
 
 #ifdef DGUX
-      /* This allows meta to be sent on 8th bit.  */
-      tty.main.c_iflag &= ~INPCK;      /* don't check input for parity */
+  /* This allows meta to be sent on 8th bit.  */
+  tty.main.c_iflag &= ~INPCK;  /* don't check input for parity */
 #endif
-      tty.main.c_iflag |= (IGNBRK);    /* Ignore break condition */
-      tty.main.c_iflag &= ~ICRNL;      /* Disable map of CR to NL on input */
+  tty.main.c_iflag |= (IGNBRK);        /* Ignore break condition */
+  tty.main.c_iflag &= ~ICRNL;  /* Disable map of CR to NL on input */
 #ifdef INLCR  /* I'm just being cautious,
                 since I can't check how widespread INLCR is--rms.  */
-      tty.main.c_iflag &= ~INLCR;      /* Disable map of NL to CR on input */
+  tty.main.c_iflag &= ~INLCR;  /* Disable map of NL to CR on input */
 #endif
 #ifdef ISTRIP
-      tty.main.c_iflag &= ~ISTRIP;     /* don't strip 8th bit on input */
+  tty.main.c_iflag &= ~ISTRIP; /* don't strip 8th bit on input */
 #endif
-      tty.main.c_lflag &= ~ECHO;       /* Disable echo */
-      tty.main.c_lflag &= ~ICANON;     /* Disable erase/kill processing */
+  tty.main.c_lflag &= ~ECHO;   /* Disable echo */
+  tty.main.c_lflag &= ~ICANON; /* Disable erase/kill processing */
 #ifdef IEXTEN
-      tty.main.c_lflag &= ~IEXTEN;     /* Disable other editing characters.  */
+  tty.main.c_lflag &= ~IEXTEN; /* Disable other editing characters.  */
 #endif
-      tty.main.c_lflag |= ISIG;        /* Enable signals */
-      if (flow_control)
-       {
-         tty.main.c_iflag |= IXON;     /* Enable start/stop output control */
+  tty.main.c_lflag |= ISIG;    /* Enable signals */
+  if (tty_out->flow_control)
+    {
+      tty.main.c_iflag |= IXON;        /* Enable start/stop output control */
 #ifdef IXANY
-         tty.main.c_iflag &= ~IXANY;
+      tty.main.c_iflag &= ~IXANY;
 #endif /* IXANY */
-       }
-      else
-       tty.main.c_iflag &= ~IXON;      /* Disable start/stop output control */
-      tty.main.c_oflag &= ~ONLCR;      /* Disable map of NL to CR-NL
-                                          on output */
-      tty.main.c_oflag &= ~TAB3;       /* Disable tab expansion */
+    }
+  else
+    tty.main.c_iflag &= ~IXON; /* Disable start/stop output control */
+  tty.main.c_oflag &= ~ONLCR;  /* Disable map of NL to CR-NL
+                                   on output */
+  tty.main.c_oflag &= ~TAB3;   /* Disable tab expansion */
 #ifdef CS8
-      if (meta_key)
-       {
-         tty.main.c_cflag |= CS8;      /* allow 8th bit on input */
-         tty.main.c_cflag &= ~PARENB;/* Don't check parity */
-       }
+  if (tty_out->meta_key)
+    {
+      tty.main.c_cflag |= CS8; /* allow 8th bit on input */
+      tty.main.c_cflag &= ~PARENB;/* Don't check parity */
+    }
 #endif
+  if (tty_out->input == stdin)
+    {
       tty.main.c_cc[VINTR] = quit_char;        /* C-g (usually) gives SIGINT */
       /* Set up C-g for both SIGQUIT and SIGINT.
-        We don't know which we will get, but we handle both alike
-        so which one it really gives us does not matter.  */
+         We don't know which we will get, but we handle both alike
+         so which one it really gives us does not matter.  */
       tty.main.c_cc[VQUIT] = quit_char;
-      tty.main.c_cc[VMIN] = 1; /* Input should wait for at least 1 char */
-      tty.main.c_cc[VTIME] = 0;        /* no matter how long that takes.  */
+    }
+  else
+    {
+      /* We normally don't get interrupt or quit signals from tty
+         devices other than our controlling terminal; therefore,
+         we must handle C-g as normal input.  Unfortunately, this
+         means that the interrupt and quit feature must be
+         disabled on secondary ttys, or we would not even see the
+         keypress.
+         
+         Note that even though emacsclient could have special code
+         to pass SIGINT to Emacs, we should _not_ enable
+         interrupt/quit keys for emacsclient frames.  This means
+         that we can't break out of loops in C code from a
+         secondary tty frame, but we can always decide what
+         display the C-g came from, which is more important from a
+         usability point of view.  (Consider the case when two
+         people work together using the same Emacs instance.)  */
+      tty.main.c_cc[VINTR] = CDISABLE;
+      tty.main.c_cc[VQUIT] = CDISABLE;
+    }
+  tty.main.c_cc[VMIN] = 1;     /* Input should wait for at least 1 char */
+  tty.main.c_cc[VTIME] = 0;    /* no matter how long that takes.  */
 #ifdef VSWTCH
-      tty.main.c_cc[VSWTCH] = CDISABLE;        /* Turn off shell layering use
+  tty.main.c_cc[VSWTCH] = CDISABLE;    /* Turn off shell layering use
                                           of C-z */
 #endif /* VSWTCH */
-
+  
 #if defined (mips) || defined (HAVE_TCATTR)
 #ifdef VSUSP
-      tty.main.c_cc[VSUSP] = CDISABLE; /* Turn off mips handling of C-z.  */
+  tty.main.c_cc[VSUSP] = CDISABLE;     /* Turn off mips handling of C-z.  */
 #endif /* VSUSP */
 #ifdef V_DSUSP
-      tty.main.c_cc[V_DSUSP] = CDISABLE; /* Turn off mips handling of C-y.  */
+  tty.main.c_cc[V_DSUSP] = CDISABLE; /* Turn off mips handling of C-y.  */
 #endif /* V_DSUSP */
 #ifdef VDSUSP /* Some systems have VDSUSP, some have V_DSUSP.  */
-      tty.main.c_cc[VDSUSP] = CDISABLE;
+  tty.main.c_cc[VDSUSP] = CDISABLE;
 #endif /* VDSUSP */
 #ifdef VLNEXT
-      tty.main.c_cc[VLNEXT] = CDISABLE;
+  tty.main.c_cc[VLNEXT] = CDISABLE;
 #endif /* VLNEXT */
 #ifdef VREPRINT
-      tty.main.c_cc[VREPRINT] = CDISABLE;
+  tty.main.c_cc[VREPRINT] = CDISABLE;
 #endif /* VREPRINT */
 #ifdef VWERASE
-      tty.main.c_cc[VWERASE] = CDISABLE;
+  tty.main.c_cc[VWERASE] = CDISABLE;
 #endif /* VWERASE */
 #ifdef VDISCARD
-      tty.main.c_cc[VDISCARD] = CDISABLE;
+  tty.main.c_cc[VDISCARD] = CDISABLE;
 #endif /* VDISCARD */
 
-      if (flow_control)
-       {
+  if (tty_out->flow_control)
+    {
 #ifdef VSTART
-         tty.main.c_cc[VSTART] = '\021';
+      tty.main.c_cc[VSTART] = '\021';
 #endif /* VSTART */
 #ifdef VSTOP
-         tty.main.c_cc[VSTOP] = '\023';
+      tty.main.c_cc[VSTOP] = '\023';
 #endif /* VSTOP */
-       }
-      else
-       {
+    }
+  else
+    {
 #ifdef VSTART
-         tty.main.c_cc[VSTART] = CDISABLE;
+      tty.main.c_cc[VSTART] = CDISABLE;
 #endif /* VSTART */
 #ifdef VSTOP
-         tty.main.c_cc[VSTOP] = CDISABLE;
+      tty.main.c_cc[VSTOP] = CDISABLE;
 #endif /* VSTOP */
-       }
+    }
 #endif /* mips or HAVE_TCATTR */
 
 #ifdef SET_LINE_DISCIPLINE
-      /* Need to explicitly request TERMIODISC line discipline or
-         Ultrix's termios does not work correctly.  */
-      tty.main.c_line = SET_LINE_DISCIPLINE;
+  /* Need to explicitly request TERMIODISC line discipline or
+     Ultrix's termios does not work correctly.  */
+  tty.main.c_line = SET_LINE_DISCIPLINE;
 #endif
 #ifdef AIX
 #ifndef IBMR2AIX
-      /* AIX enhanced edit loses NULs, so disable it.  */
-      tty.main.c_line = 0;
-      tty.main.c_iflag &= ~ASCEDIT;
+  /* AIX enhanced edit loses NULs, so disable it.  */
+  tty.main.c_line = 0;
+  tty.main.c_iflag &= ~ASCEDIT;
 #else
-      tty.main.c_cc[VSTRT] = CDISABLE;
-      tty.main.c_cc[VSTOP] = CDISABLE;
-      tty.main.c_cc[VSUSP] = CDISABLE;
-      tty.main.c_cc[VDSUSP] = CDISABLE;
+  tty.main.c_cc[VSTRT] = CDISABLE;
+  tty.main.c_cc[VSTOP] = CDISABLE;
+  tty.main.c_cc[VSUSP] = CDISABLE;
+  tty.main.c_cc[VDSUSP] = CDISABLE;
 #endif /* IBMR2AIX */
-      if (flow_control)
-       {
+  if (tty_out->flow_control)
+    {
 #ifdef VSTART
-         tty.main.c_cc[VSTART] = '\021';
+      tty.main.c_cc[VSTART] = '\021';
 #endif /* VSTART */
 #ifdef VSTOP
-         tty.main.c_cc[VSTOP] = '\023';
+      tty.main.c_cc[VSTOP] = '\023';
 #endif /* VSTOP */
-       }
-      /* Also, PTY overloads NUL and BREAK.
-        don't ignore break, but don't signal either, so it looks like NUL.
-        This really serves a purpose only if running in an XTERM window
-        or via TELNET or the like, but does no harm elsewhere.  */
-      tty.main.c_iflag &= ~IGNBRK;
-      tty.main.c_iflag &= ~BRKINT;
+    }
+  /* Also, PTY overloads NUL and BREAK.
+     don't ignore break, but don't signal either, so it looks like NUL.
+     This really serves a purpose only if running in an XTERM window
+     or via TELNET or the like, but does no harm elsewhere.  */
+  tty.main.c_iflag &= ~IGNBRK;
+  tty.main.c_iflag &= ~BRKINT;
 #endif
 #else /* if not HAVE_TERMIO */
 #ifdef VMS
-      tty.main.tt_char |= TT$M_NOECHO;
-      if (meta_key)
-       tty.main.tt_char |= TT$M_EIGHTBIT;
-      if (flow_control)
-       tty.main.tt_char |= TT$M_TTSYNC;
-      else
-       tty.main.tt_char &= ~TT$M_TTSYNC;
-      tty.main.tt2_char |= TT2$M_PASTHRU | TT2$M_XON;
+  tty.main.tt_char |= TT$M_NOECHO;
+  if (meta_key)
+    tty.main.tt_char |= TT$M_EIGHTBIT;
+  if (tty_out->flow_control)
+    tty.main.tt_char |= TT$M_TTSYNC;
+  else
+    tty.main.tt_char &= ~TT$M_TTSYNC;
+  tty.main.tt2_char |= TT2$M_PASTHRU | TT2$M_XON;
 #else /* not VMS (BSD, that is) */
 #ifndef DOS_NT
-      XSETINT (Vtty_erase_char, tty.main.sg_erase);
-      tty.main.sg_flags &= ~(ECHO | CRMOD | XTABS);
-      if (meta_key)
-       tty.main.sg_flags |= ANYP;
-      tty.main.sg_flags |= interrupt_input ? RAW : CBREAK;
+  XSETINT (Vtty_erase_char, tty.main.sg_erase);
+  tty.main.sg_flags &= ~(ECHO | CRMOD | XTABS);
+  if (meta_key)
+    tty.main.sg_flags |= ANYP;
+  tty.main.sg_flags |= interrupt_input ? RAW : CBREAK;
 #endif /* not DOS_NT */
 #endif /* not VMS (BSD, that is) */
 #endif /* not HAVE_TERMIO */
 
-      /* If going to use CBREAK mode, we must request C-g to interrupt
-        and turn off start and stop chars, etc.  If not going to use
-        CBREAK mode, do this anyway so as to turn off local flow
-        control for user coming over network on 4.2; in this case,
-        only t_stopc and t_startc really matter.  */
+  /* If going to use CBREAK mode, we must request C-g to interrupt
+     and turn off start and stop chars, etc.  If not going to use
+     CBREAK mode, do this anyway so as to turn off local flow
+     control for user coming over network on 4.2; in this case,
+     only t_stopc and t_startc really matter.  */
 #ifndef HAVE_TERMIO
 #ifdef HAVE_TCHARS
-      /* Note: if not using CBREAK mode, it makes no difference how we
-        set this */
-      tty.tchars = new_tchars;
-      tty.tchars.t_intrc = quit_char;
-      if (flow_control)
-       {
-         tty.tchars.t_startc = '\021';
-         tty.tchars.t_stopc = '\023';
-       }
-
-      tty.lmode = LDECCTQ | LLITOUT | LPASS8 | LNOFLSH | old_tty.lmode;
+  /* Note: if not using CBREAK mode, it makes no difference how we
+     set this */
+  tty.tchars = new_tchars;
+  tty.tchars.t_intrc = quit_char;
+  if (tty_out->flow_control)
+    {
+      tty.tchars.t_startc = '\021';
+      tty.tchars.t_stopc = '\023';
+    }
+  
+  tty.lmode = LDECCTQ | LLITOUT | LPASS8 | LNOFLSH | tty_out->old_tty.lmode;
 #ifdef ultrix
-      /* Under Ultrix 4.2a, leaving this out doesn't seem to hurt
-        anything, and leaving it in breaks the meta key.  Go figure.  */
-      tty.lmode &= ~LLITOUT;
+  /* Under Ultrix 4.2a, leaving this out doesn't seem to hurt
+     anything, and leaving it in breaks the meta key.  Go figure.  */
+  tty.lmode &= ~LLITOUT;
 #endif
-
+  
 #ifdef BSD4_1
-      lmode = tty.lmode;
+  lmode = tty.lmode;
 #endif
 
 #endif /* HAVE_TCHARS */
 #endif /* not HAVE_TERMIO */
 
 #ifdef HAVE_LTCHARS
-      tty.ltchars = new_ltchars;
+  tty.ltchars = new_ltchars;
 #endif /* HAVE_LTCHARS */
 #ifdef MSDOS   /* Demacs 1.1.2 91/10/20 Manabu Higashida, MW Aug 1993 */
-      if (!term_initted)
-       internal_terminal_init ();
-      dos_ttraw ();
+  if (!tty_out->term_initted)
+    internal_terminal_init ();
+  dos_ttraw ();
 #endif
 
-      EMACS_SET_TTY (input_fd, &tty, 0);
+  EMACS_SET_TTY (fileno (tty_out->input), &tty, 0);
 
-      /* This code added to insure that, if flow-control is not to be used,
-        we have an unlocked terminal at the start. */
+  /* This code added to insure that, if flow-control is not to be used,
+     we have an unlocked terminal at the start. */
 
 #ifdef TCXONC
-      if (!flow_control) ioctl (input_fd, TCXONC, 1);
+  if (!tty_out->flow_control) ioctl (fileno (tty_out->input), TCXONC, 1);
 #endif
 #ifndef APOLLO
 #ifdef TIOCSTART
-      if (!flow_control) ioctl (input_fd, TIOCSTART, 0);
+  if (!tty_out->flow_control) ioctl (fileno (tty_out->input), TIOCSTART, 0);
 #endif
 #endif
 
 #if defined (HAVE_TERMIOS) || defined (HPUX9)
 #ifdef TCOON
-      if (!flow_control) tcflow (input_fd, TCOON);
+  if (!tty_out->flow_control) tcflow (fileno (tty_out->input), TCOON);
 #endif
 #endif
 
 #ifdef AIXHFT
-      hft_init ();
+  hft_init (tty_out);
 #ifdef IBMR2AIX
-      {
-       /* IBM's HFT device usually thinks a ^J should be LF/CR.  We need it
-          to be only LF.  This is the way that is done. */
-       struct termio tty;
-
-       if (ioctl (1, HFTGETID, &tty) != -1)
-         write (1, "\033[20l", 5);
-      }
+  {
+    /* IBM's HFT device usually thinks a ^J should be LF/CR.  We need it
+       to be only LF.  This is the way that is done. */
+    struct termio tty;
+    
+    if (ioctl (1, HFTGETID, &tty) != -1)
+      write (1, "\033[20l", 5);
+  }
 #endif
 #endif /* AIXHFT */
 
 #ifdef VMS
 /*  Appears to do nothing when in PASTHRU mode.
-      SYS$QIOW (0, input_fd, IO$_SETMODE|IO$M_OUTBAND, 0, 0, 0,
+      SYS$QIOW (0, fileno (tty_out->input), IO$_SETMODE|IO$M_OUTBAND, 0, 0, 0,
                interrupt_signal, oob_chars, 0, 0, 0, 0);
 */
-      queue_kbd_input (0);
+  queue_kbd_input (0);
 #endif /* VMS */
-    }
 
 #ifdef F_SETFL
 #ifndef F_SETOWN_BUG
 #ifdef F_GETOWN                /* F_SETFL does not imply existence of F_GETOWN */
-  if (interrupt_input
-      && ! read_socket_hook && EQ (Vwindow_system, Qnil))
+  if (interrupt_input)
     {
-      old_fcntl_owner = fcntl (input_fd, F_GETOWN, 0);
-      fcntl (input_fd, F_SETOWN, getpid ());
-      init_sigio (input_fd);
+      old_fcntl_owner[fileno (tty_out->input)] =
+        fcntl (fileno (tty_out->input), F_GETOWN, 0);
+      fcntl (fileno (tty_out->input), F_SETOWN, getpid ());
+      init_sigio (fileno (tty_out->input));
     }
 #endif /* F_GETOWN */
 #endif /* F_SETOWN_BUG */
@@ -1682,7 +1754,7 @@ init_sys_modes ()
 
 #ifdef BSD4_1
   if (interrupt_input)
-    init_sigio (input_fd);
+    init_sigio (fileno (tty_out->input));
 #endif
 
 #ifdef VMS  /* VMS sometimes has this symbol but lacks setvbuf.  */
@@ -1692,53 +1764,56 @@ init_sys_modes ()
   /* This symbol is defined on recent USG systems.
      Someone says without this call USG won't really buffer the file
      even with a call to setbuf. */
-  setvbuf (stdout, (char *) _sobuf, _IOFBF, sizeof _sobuf);
+  setvbuf (tty_out->output, (char *) _sobuf, _IOFBF, sizeof _sobuf);
 #else
-  setbuf (stdout, (char *) _sobuf);
-#endif
-#ifdef HAVE_WINDOW_SYSTEM
-  /* Emacs' window system on MSDOG uses the `internal terminal' and therefore
-     needs the initialization code below.  */
-  if (EQ (Vwindow_system, Qnil)
-#ifndef WINDOWSNT
-      /* When running in tty mode on NT/Win95, we have a read_socket
-        hook, but still need the rest of the initialization code below.  */
-      && (! read_socket_hook)
-#endif
-      )
+  setbuf (tty_out->output, (char *) _sobuf);
 #endif
-    set_terminal_modes ();
 
-  if (!term_initted
-      && FRAMEP (Vterminal_frame)
-      && FRAME_TERMCAP_P (XFRAME (Vterminal_frame)))
-    init_frame_faces (XFRAME (Vterminal_frame));
+  tty_set_terminal_modes (tty_out->terminal);
+
+  if (!tty_out->term_initted)
+    {
+      Lisp_Object tail, frame;
+      FOR_EACH_FRAME (tail, frame)
+        {
+          /* XXX This needs to be revised. */
+          if (FRAME_TERMCAP_P (XFRAME (frame))
+              && FRAME_TTY (XFRAME (frame)) == tty_out)
+            init_frame_faces (XFRAME (frame));
+        }
+    }
 
-  if (term_initted && no_redraw_on_reenter)
+  if (tty_out->term_initted && no_redraw_on_reenter)
     {
+      /* XXX This seems wrong on multi-tty. */
       if (display_completed)
        direct_output_forward_char (0);
     }
   else
     {
+      Lisp_Object tail, frame;
       frame_garbaged = 1;
-      if (FRAMEP (Vterminal_frame))
-       FRAME_GARBAGED_P (XFRAME (Vterminal_frame)) = 1;
+      FOR_EACH_FRAME (tail, frame)
+        {
+          if (FRAME_TERMCAP_P (XFRAME (frame))
+              && FRAME_TTY (XFRAME (frame)) == tty_out)
+            FRAME_GARBAGED_P (XFRAME (frame)) = 1;
+        }
     }
 
-  term_initted = 1;
+  tty_out->term_initted = 1;
 }
 
 /* Return nonzero if safe to use tabs in output.
    At the time this is called, init_sys_modes has not been done yet.  */
 
 int
-tabs_safe_p ()
+tabs_safe_p (int fd)
 {
-  struct emacs_tty tty;
+  struct emacs_tty etty;
 
-  EMACS_GET_TTY (input_fd, &tty);
-  return EMACS_TTY_TABS_OK (&tty);
+  EMACS_GET_TTY (fd, &etty);
+  return EMACS_TTY_TABS_OK (&etty);
 }
 \f
 /* Get terminal size from system.
@@ -1746,8 +1821,7 @@ tabs_safe_p ()
    We store 0 if there's no valid information.  */
 
 void
-get_frame_size (widthp, heightp)
-     int *widthp, *heightp;
+get_tty_size (int fd, int *widthp, int *heightp)
 {
 
 #ifdef TIOCGWINSZ
@@ -1755,7 +1829,7 @@ get_frame_size (widthp, heightp)
   /* BSD-style.  */
   struct winsize size;
 
-  if (ioctl (input_fd, TIOCGWINSZ, &size) == -1)
+  if (ioctl (fd, TIOCGWINSZ, &size) == -1)
     *widthp = *heightp = 0;
   else
     {
@@ -1769,7 +1843,7 @@ get_frame_size (widthp, heightp)
   /* SunOS - style.  */
   struct ttysize size;
 
-  if (ioctl (input_fd, TIOCGSIZE, &size) == -1)
+  if (ioctl (fd, TIOCGSIZE, &size) == -1)
     *widthp = *heightp = 0;
   else
     {
@@ -1801,7 +1875,6 @@ get_frame_size (widthp, heightp)
   *widthp = 0;
   *heightp = 0;
 #endif
-
 #endif /* not VMS */
 #endif /* not SunOS-style */
 #endif /* not BSD-style */
@@ -1845,37 +1918,58 @@ set_window_size (fd, height, width)
 }
 
 \f
-/* Prepare the terminal for exiting Emacs; move the cursor to the
-   bottom of the frame, turn off interrupt-driven I/O, etc.  */
+
+/* Prepare all terminal devices for exiting Emacs. */
+
 void
-reset_sys_modes ()
+reset_all_sys_modes (void)
 {
-  struct frame *sf;
+  struct tty_display_info *tty;
+  for (tty = tty_list; tty; tty = tty->next)
+    reset_sys_modes (tty);
+}
+
+/* Prepare the terminal for closing it; move the cursor to the
+   bottom of the frame, turn off interrupt-driven I/O, etc.  */
 
+void
+reset_sys_modes (tty_out)
+     struct tty_display_info *tty_out;
+{
   if (noninteractive)
     {
       fflush (stdout);
       return;
     }
-  if (!term_initted)
+  if (!tty_out->term_initted)
     return;
-#ifdef HAVE_WINDOW_SYSTEM
-  /* Emacs' window system on MSDOG uses the `internal terminal' and therefore
-     needs the clean-up code below.  */
-  if (!EQ (Vwindow_system, Qnil)
-#ifndef WINDOWSNT
-      /* When running in tty mode on NT/Win95, we have a read_socket
-        hook, but still need the rest of the clean-up code below.  */
-      || read_socket_hook
-#endif
-      )
-    return;
-#endif
-  sf = SELECTED_FRAME ();
-  cursor_to (FRAME_LINES (sf) - 1, 0);
-  clear_end_of_line (FRAME_COLS (sf));
-  /* clear_end_of_line may move the cursor */
-  cursor_to (FRAME_LINES (sf) - 1, 0);
+
+  if (!tty_out->output)
+    return;                     /* The tty is suspended. */
+  
+  /* Go to and clear the last line of the terminal. */
+
+  cmgoto (tty_out, FrameRows (tty_out) - 1, 0);
+  
+  /* Code adapted from tty_clear_end_of_line. */
+  if (tty_out->TS_clr_line)
+    {
+      emacs_tputs (tty_out, tty_out->TS_clr_line, 1, cmputc);
+    }
+  else
+    {                  /* have to do it the hard way */
+      int i;
+      tty_turn_off_insert (tty_out);
+      
+      for (i = curX (tty_out); i < FrameCols (tty_out) - 1; i++)
+        {
+          fputc (' ', tty_out->output);
+        }
+    }
+  
+  cmgoto (tty_out, FrameRows (tty_out) - 1, 0);
+  fflush (tty_out->output);
+  
 #if defined (IBMR2AIX) && defined (AIXHFT)
   {
     /* HFT devices normally use ^J as a LF/CR.  We forced it to
@@ -1887,12 +1981,12 @@ reset_sys_modes ()
   }
 #endif
 
-  reset_terminal_modes ();
-  fflush (stdout);
+  tty_reset_terminal_modes (tty_out->terminal);
+
 #ifdef BSD_SYSTEM
 #ifndef BSD4_1
   /* Avoid possible loss of output when changing terminal modes.  */
-  fsync (fileno (stdout));
+  fsync (fileno (tty_out->output));
 #endif
 #endif
 
@@ -1901,22 +1995,25 @@ reset_sys_modes ()
 #ifdef F_SETOWN                /* F_SETFL does not imply existence of F_SETOWN */
   if (interrupt_input)
     {
-      reset_sigio ();
-      fcntl (input_fd, F_SETOWN, old_fcntl_owner);
+      reset_sigio (fileno (tty_out->input));
+      fcntl (fileno (tty_out->input), F_SETOWN,
+             old_fcntl_owner[fileno (tty_out->input)]);
     }
 #endif /* F_SETOWN */
 #endif /* F_SETOWN_BUG */
 #ifdef O_NDELAY
-  fcntl (input_fd, F_SETFL, fcntl (input_fd, F_GETFL, 0) & ~O_NDELAY);
+  fcntl (fileno (tty_out->input), F_SETFL,
+         fcntl (fileno (tty_out->input), F_GETFL, 0) & ~O_NDELAY);
 #endif
 #endif /* F_SETFL */
 #ifdef BSD4_1
   if (interrupt_input)
-    reset_sigio ();
+    reset_sigio (fileno (tty_out->input));
 #endif /* BSD4_1 */
 
-  if (old_tty_valid)
-    while (EMACS_SET_TTY (input_fd, &old_tty, 0) < 0 && errno == EINTR)
+  if (tty_out->old_tty)
+    while (EMACS_SET_TTY (fileno (tty_out->input),
+                          tty_out->old_tty, 0) < 0 && errno == EINTR)
       ;
 
 #ifdef MSDOS   /* Demacs 1.1.2 91/10/20 Manabu Higashida */
@@ -1927,7 +2024,7 @@ reset_sys_modes ()
   /* Ultrix's termios *ignores* any line discipline except TERMIODISC.
      A different old line discipline is therefore not restored, yet.
      Restore the old line discipline by hand.  */
-  ioctl (0, TIOCSETD, &old_tty.main.c_line);
+  ioctl (0, TIOCSETD, &tty_out->old_tty.main.c_line);
 #endif
 
 #ifdef AIXHFT
@@ -1935,7 +2032,7 @@ reset_sys_modes ()
 #endif
 
 #ifdef BSD_PGRPS
-  widen_foreground_group ();
+  widen_foreground_group (fileno (tty_out->input));
 #endif
 }
 \f
@@ -2000,9 +2097,9 @@ init_vms_input ()
 {
   int status;
 
-  if (input_fd == 0)
+  if (fileno (CURTTY ()->input)) == 0)
     {
-      status = SYS$ASSIGN (&input_dsc, &input_fd, 0, 0);
+      status = SYS$ASSIGN (&input_dsc, &fileno (CURTTY ()->input)), 0, 0);
       if (! (status & 1))
        LIB$STOP (status);
     }
@@ -2013,7 +2110,7 @@ init_vms_input ()
 void
 stop_vms_input ()
 {
-  return SYS$DASSGN (input_fd);
+  return SYS$DASSGN (fileno (CURTTY ()->input)));
 }
 
 short input_buffer;
@@ -2029,7 +2126,7 @@ queue_kbd_input ()
 
   waiting_for_ast = 0;
   stop_input = 0;
-  status = SYS$QIO (0, input_fd, IO$_READVBLK,
+  status = SYS$QIO (0, fileno (CURTTY()->input), IO$_READVBLK,
                    &input_iosb, kbd_input_ast, 1,
                    &input_buffer, 1, 0, terminator_mask, 0, 0);
 }
@@ -2146,7 +2243,7 @@ end_kbd_input ()
 #endif
   if (LIB$AST_IN_PROG ())  /* Don't wait if suspending from kbd_buffer_store_event! */
     {
-      SYS$CANCEL (input_fd);
+      SYS$CANCEL (fileno (CURTTY()->input));
       return;
     }
 
@@ -2155,7 +2252,7 @@ end_kbd_input ()
   SYS$CLREF (input_ef);
   waiting_for_ast = 1;
   stop_input = 1;
-  SYS$CANCEL (input_fd);
+  SYS$CANCEL (fileno (CURTTY()->input));
   SYS$SETAST (1);
   SYS$WAITFR (input_ef);
   waiting_for_ast = 0;
@@ -2217,7 +2314,8 @@ init_sigio (fd)
   request_sigio ();
 }
 
-reset_sigio ()
+reset_sigio (fd)
+     int fd;
 {
   unrequest_sigio ();
 }
@@ -2557,7 +2655,9 @@ sys_select (nfds, rfds, wfds, efds, timeout)
      SELECT_TYPE *rfds, *wfds, *efds;
      EMACS_TIME *timeout;
 {
-  int ravail = 0;
+  /* XXX This needs to be updated for multi-tty support.  Is there
+     anybody who needs to emulate select these days?  */ 
+ int ravail = 0;
   SELECT_TYPE orfds;
   int timeoutval;
   int *local_timeout;
@@ -2572,7 +2672,7 @@ sys_select (nfds, rfds, wfds, efds, timeout)
 #if defined (HAVE_SELECT) && defined (HAVE_X_WINDOWS)
   /* If we're using X, then the native select will work; we only need the
      emulation for non-X usage.  */
-  if (!NILP (Vwindow_system))
+  if (!NILP (Vinitial_window_system))
     return select (nfds, rfds, wfds, efds, timeout);
 #endif
   timeoutval = timeout ? EMACS_SECS (*timeout) : 100000;
@@ -2681,7 +2781,7 @@ sys_select (nfds, rfds, wfds, efds, timeout)
     }
   return ravail;
 }
-#endif /* not WINDOWSNT */
+#endif not WINDOWSNT
 
 /* Read keyboard input into the standard buffer,
    waiting for at least one character.  */
@@ -2689,6 +2789,8 @@ sys_select (nfds, rfds, wfds, efds, timeout)
 void
 read_input_waiting ()
 {
+  /* XXX This needs to be updated for multi-tty support.  Is there
+     anybody who needs to emulate select these days?  */
   int nread, i;
   extern int quit_char;
 
@@ -2742,6 +2844,10 @@ read_input_waiting ()
     }
 }
 
+#if !defined (HAVE_SELECT) || defined (BROKEN_SELECT_NON_X)
+#define select sys_select
+#endif
+
 #endif /* not HAVE_SELECT */
 #endif /* not VMS */
 #endif /* not MSDOS */
@@ -2758,12 +2864,13 @@ init_sigio (fd)
 }
 
 void
-reset_sigio ()
+reset_sigio (fd)
+     int fd;
 {
   if (noninteractive)
     return;
   lmode = ~LINTRUP & lmode;
-  ioctl (0, TIOCLSET, &lmode);
+  ioctl (fd, TIOCLSET, &lmode);
 }
 
 void
@@ -3219,7 +3326,7 @@ sys_getenv (name)
 #undef abort
 sys_abort ()
 {
-  reset_sys_modes ();
+  reset_all_sys_modes ();
   LIB$SIGNAL (SS$_DEBUG);
 }
 #endif /* abort */
@@ -3546,7 +3653,7 @@ croak (badfunc)
      char *badfunc;
 {
   printf ("%s not yet implemented\r\n", badfunc);
-  reset_sys_modes ();
+  reset_all_sys_modes ();
   exit (1);
 }
 
@@ -5133,7 +5240,7 @@ croak (badfunc)
      char *badfunc;
 {
   printf ("%s not yet implemented\r\n", badfunc);
-  reset_sys_modes ();
+  reset_all_sys_modes ();
   exit (1);
 }
 
@@ -5155,7 +5262,7 @@ srandom (seed)
 
 /* Called from init_sys_modes.  */
 void
-hft_init ()
+hft_init (struct tty_display_info *tty_out)
 {
   int junk;
 
@@ -5201,15 +5308,12 @@ hft_init ()
     keymap.hfkey[1].hf_char = 127;
     hftctl (0, HFSKBD, &buf);
   }
-  /* The HFT system on AIX doesn't optimize for scrolling, so it's really ugly
-     at times.  */
-  line_ins_del_ok = char_ins_del_ok = 0;
 }
 
 /* Reset the rubout key to backspace.  */
 
 void
-hft_reset ()
+hft_reset (struct tty_display_info *tty_out)
 {
   struct hfbuf buf;
   struct hfkeymap keymap;
index cc2212d..ac77759 100644 (file)
@@ -33,6 +33,7 @@ extern pthread_t main_thread;
    indicate that SIGIO doesn't work by #undef-ing SIGIO.  If this file
    #includes <signal.h>, then that will re-#define SIGIO and confuse
    things.  */
+/* XXX This is not correct anymore, there is a BROKEN_SIGIO macro. */
 
 #define SIGMASKTYPE sigset_t
 
index b39f86c..00c72ea 100644 (file)
@@ -25,10 +25,19 @@ Boston, MA 02110-1301, USA.  */
 #include <stdio.h>
 #include <ctype.h>
 #include <string.h>
+#include <errno.h>
+#include <sys/file.h>
+#include <unistd.h>             /* For isatty. */
 
+#if HAVE_TERMIOS_H
+#include <termios.h>           /* For TIOCNOTTY. */
+#endif
+
+#include <signal.h>
+
+#include "lisp.h"
 #include "termchar.h"
 #include "termopts.h"
-#include "lisp.h"
 #include "charset.h"
 #include "coding.h"
 #include "keyboard.h"
@@ -38,6 +47,8 @@ Boston, MA 02110-1301, USA.  */
 #include "dispextern.h"
 #include "window.h"
 #include "keymap.h"
+#include "syssignal.h"
+#include "systty.h"
 
 /* For now, don't try to include termcap.h.  On some systems,
    configure finds a non-standard termcap.h that the main build
@@ -60,240 +71,68 @@ extern int tgetnum P_ ((char *id));
 #include "macterm.h"
 #endif
 
+#ifndef O_RDWR
+#define O_RDWR 2
+#endif
+
+#ifndef O_NOCTTY
+#define O_NOCTTY 0
+#endif
+
+static void tty_set_scroll_region P_ ((struct frame *f, int start, int stop));
 static void turn_on_face P_ ((struct frame *, int face_id));
 static void turn_off_face P_ ((struct frame *, int face_id));
-static void tty_show_cursor P_ ((void));
-static void tty_hide_cursor P_ ((void));
+static void tty_show_cursor P_ ((struct tty_display_info *));
+static void tty_hide_cursor P_ ((struct tty_display_info *));
+static void tty_background_highlight P_ ((struct tty_display_info *tty));
+static void clear_tty_hooks P_ ((struct terminal *terminal));
+static void set_tty_hooks P_ ((struct terminal *terminal));
+static void dissociate_if_controlling_tty P_ ((int fd));
+static void delete_tty P_ ((struct terminal *));
+
+#define OUTPUT(tty, a)                                          \
+  emacs_tputs ((tty), a,                                        \
+               (int) (FRAME_LINES (XFRAME (selected_frame))     \
+                      - curY (tty)),                            \
+               cmputc)
+
+#define OUTPUT1(tty, a) emacs_tputs ((tty), a, 1, cmputc)
+#define OUTPUTL(tty, a, lines) emacs_tputs ((tty), a, lines, cmputc)
+
+#define OUTPUT_IF(tty, a)                                               \
+  do {                                                                  \
+    if (a)                                                              \
+      emacs_tputs ((tty), a,                                            \
+                   (int) (FRAME_LINES (XFRAME (selected_frame))         \
+                          - curY (tty) ),                               \
+                   cmputc);                                             \
+  } while (0)
+
+#define OUTPUT1_IF(tty, a) do { if (a) emacs_tputs ((tty), a, 1, cmputc); } while (0)
 
-#define OUTPUT(a) \
-     tputs (a, (int) (FRAME_LINES (XFRAME (selected_frame)) - curY), cmputc)
-#define OUTPUT1(a) tputs (a, 1, cmputc)
-#define OUTPUTL(a, lines) tputs (a, lines, cmputc)
-
-#define OUTPUT_IF(a)                                                   \
-     do {                                                              \
-       if (a)                                                          \
-         tputs (a, (int) (FRAME_LINES (XFRAME (selected_frame))        \
-                         - curY), cmputc);                             \
-     } while (0)
+/* If true, use "vs", otherwise use "ve" to make the cursor visible.  */
 
-#define OUTPUT1_IF(a) do { if (a) tputs (a, 1, cmputc); } while (0)
+static int visible_cursor;
 
 /* Display space properties */
 
 extern Lisp_Object Qspace, QCalign_to, QCwidth;
 
-/* Function to use to ring the bell.  */
+/* Functions to call after suspending a tty. */
+Lisp_Object Vsuspend_tty_functions;
 
-Lisp_Object Vring_bell_function;
+/* Functions to call after resuming a tty. */
+Lisp_Object Vresume_tty_functions;
 
-/* If true, use "vs", otherwise use "ve" to make the cursor visible.  */
-
-static int visible_cursor;
-
-/* Terminal characteristics that higher levels want to look at.
-   These are all extern'd in termchar.h */
-
-int must_write_spaces;         /* Nonzero means spaces in the text
-                                  must actually be output; can't just skip
-                                  over some columns to leave them blank.  */
-int min_padding_speed;         /* Speed below which no padding necessary */
-
-int line_ins_del_ok;           /* Terminal can insert and delete lines */
-int char_ins_del_ok;           /* Terminal can insert and delete chars */
-int scroll_region_ok;          /* Terminal supports setting the
-                                  scroll window */
-int scroll_region_cost;                /* Cost of setting a scroll window,
-                                  measured in characters */
-int memory_below_frame;                /* Terminal remembers lines
-                                  scrolled off bottom */
-int fast_clear_end_of_line;    /* Terminal has a `ce' string */
-
-/* Nonzero means no need to redraw the entire frame on resuming
-   a suspended Emacs.  This is useful on terminals with multiple pages,
-   where one page is used for Emacs and another for all else. */
+/* Chain of all tty device parameters. */
+struct tty_display_info *tty_list;
 
+/* Nonzero means no need to redraw the entire frame on resuming a
+   suspended Emacs.  This is useful on terminals with multiple
+   pages, where one page is used for Emacs and another for all
+   else. */
 int no_redraw_on_reenter;
 
-/* Hook functions that you can set to snap out the functions in this file.
-   These are all extern'd in termhooks.h  */
-
-void (*cursor_to_hook) P_ ((int, int));
-void (*raw_cursor_to_hook) P_ ((int, int));
-void (*clear_to_end_hook) P_ ((void));
-void (*clear_frame_hook) P_ ((void));
-void (*clear_end_of_line_hook) P_ ((int));
-
-void (*ins_del_lines_hook) P_ ((int, int));
-
-void (*delete_glyphs_hook) P_ ((int));
-
-void (*ring_bell_hook) P_ ((void));
-
-void (*reset_terminal_modes_hook) P_ ((void));
-void (*set_terminal_modes_hook) P_ ((void));
-void (*update_begin_hook) P_ ((struct frame *));
-void (*update_end_hook) P_ ((struct frame *));
-void (*set_terminal_window_hook) P_ ((int));
-void (*insert_glyphs_hook) P_ ((struct glyph *, int));
-void (*write_glyphs_hook) P_ ((struct glyph *, int));
-void (*delete_glyphs_hook) P_ ((int));
-
-int (*read_socket_hook) P_ ((int, int, struct input_event *));
-
-void (*frame_up_to_date_hook) P_ ((struct frame *));
-
-/* Return the current position of the mouse.
-
-   Set *f to the frame the mouse is in, or zero if the mouse is in no
-   Emacs frame.  If it is set to zero, all the other arguments are
-   garbage.
-
-   If the motion started in a scroll bar, set *bar_window to the
-   scroll bar's window, *part to the part the mouse is currently over,
-   *x to the position of the mouse along the scroll bar, and *y to the
-   overall length of the scroll bar.
-
-   Otherwise, set *bar_window to Qnil, and *x and *y to the column and
-   row of the character cell the mouse is over.
-
-   Set *time to the time the mouse was at the returned position.
-
-   This should clear mouse_moved until the next motion
-   event arrives.  */
-
-void (*mouse_position_hook) P_ ((FRAME_PTR *f, int insist,
-                                Lisp_Object *bar_window,
-                                enum scroll_bar_part *part,
-                                Lisp_Object *x,
-                                Lisp_Object *y,
-                                unsigned long *time));
-
-/* When reading from a minibuffer in a different frame, Emacs wants
-   to shift the highlight from the selected frame to the mini-buffer's
-   frame; under X, this means it lies about where the focus is.
-   This hook tells the window system code to re-decide where to put
-   the highlight.  */
-
-void (*frame_rehighlight_hook) P_ ((FRAME_PTR f));
-
-/* If we're displaying frames using a window system that can stack
-   frames on top of each other, this hook allows you to bring a frame
-   to the front, or bury it behind all the other windows.  If this
-   hook is zero, that means the device we're displaying on doesn't
-   support overlapping frames, so there's no need to raise or lower
-   anything.
-
-   If RAISE is non-zero, F is brought to the front, before all other
-   windows.  If RAISE is zero, F is sent to the back, behind all other
-   windows.  */
-
-void (*frame_raise_lower_hook) P_ ((FRAME_PTR f, int raise));
-
-/* If the value of the frame parameter changed, whis hook is called.
-   For example, if going from fullscreen to not fullscreen this hook
-   may do something OS dependent, like extended window manager hints on X11.  */
-void (*fullscreen_hook) P_ ((struct frame *f));
-
-/* Set the vertical scroll bar for WINDOW to have its upper left corner
-   at (TOP, LEFT), and be LENGTH rows high.  Set its handle to
-   indicate that we are displaying PORTION characters out of a total
-   of WHOLE characters, starting at POSITION.  If WINDOW doesn't yet
-   have a scroll bar, create one for it.  */
-
-void (*set_vertical_scroll_bar_hook)
-     P_ ((struct window *window,
-         int portion, int whole, int position));
-
-
-/* The following three hooks are used when we're doing a thorough
-   redisplay of the frame.  We don't explicitly know which scroll bars
-   are going to be deleted, because keeping track of when windows go
-   away is a real pain - can you say set-window-configuration?
-   Instead, we just assert at the beginning of redisplay that *all*
-   scroll bars are to be removed, and then save scroll bars from the
-   fiery pit when we actually redisplay their window.  */
-
-/* Arrange for all scroll bars on FRAME to be removed at the next call
-   to `*judge_scroll_bars_hook'.  A scroll bar may be spared if
-   `*redeem_scroll_bar_hook' is applied to its window before the judgment.
-
-   This should be applied to each frame each time its window tree is
-   redisplayed, even if it is not displaying scroll bars at the moment;
-   if the HAS_SCROLL_BARS flag has just been turned off, only calling
-   this and the judge_scroll_bars_hook will get rid of them.
-
-   If non-zero, this hook should be safe to apply to any frame,
-   whether or not it can support scroll bars, and whether or not it is
-   currently displaying them.  */
-
-void (*condemn_scroll_bars_hook) P_ ((FRAME_PTR frame));
-
-/* Unmark WINDOW's scroll bar for deletion in this judgement cycle.
-   Note that it's okay to redeem a scroll bar that is not condemned.  */
-
-void (*redeem_scroll_bar_hook) P_ ((struct window *window));
-
-/* Remove all scroll bars on FRAME that haven't been saved since the
-   last call to `*condemn_scroll_bars_hook'.
-
-   This should be applied to each frame after each time its window
-   tree is redisplayed, even if it is not displaying scroll bars at the
-   moment; if the HAS_SCROLL_BARS flag has just been turned off, only
-   calling this and condemn_scroll_bars_hook will get rid of them.
-
-   If non-zero, this hook should be safe to apply to any frame,
-   whether or not it can support scroll bars, and whether or not it is
-   currently displaying them.  */
-
-void (*judge_scroll_bars_hook) P_ ((FRAME_PTR FRAME));
-
-/* Strings, numbers and flags taken from the termcap entry.  */
-
-char *TS_ins_line;             /* "al" */
-char *TS_ins_multi_lines;      /* "AL" (one parameter, # lines to insert) */
-char *TS_bell;                 /* "bl" */
-char *TS_clr_to_bottom;                /* "cd" */
-char *TS_clr_line;             /* "ce", clear to end of line */
-char *TS_clr_frame;            /* "cl" */
-char *TS_set_scroll_region;    /* "cs" (2 params, first line and last line) */
-char *TS_set_scroll_region_1;   /* "cS" (4 params: total lines,
-                                  lines above scroll region, lines below it,
-                                  total lines again) */
-char *TS_del_char;             /* "dc" */
-char *TS_del_multi_chars;      /* "DC" (one parameter, # chars to delete) */
-char *TS_del_line;             /* "dl" */
-char *TS_del_multi_lines;      /* "DL" (one parameter, # lines to delete) */
-char *TS_delete_mode;          /* "dm", enter character-delete mode */
-char *TS_end_delete_mode;      /* "ed", leave character-delete mode */
-char *TS_end_insert_mode;      /* "ei", leave character-insert mode */
-char *TS_ins_char;             /* "ic" */
-char *TS_ins_multi_chars;      /* "IC" (one parameter, # chars to insert) */
-char *TS_insert_mode;          /* "im", enter character-insert mode */
-char *TS_pad_inserted_char;    /* "ip".  Just padding, no commands.  */
-char *TS_end_keypad_mode;      /* "ke" */
-char *TS_keypad_mode;          /* "ks" */
-char *TS_pad_char;             /* "pc", char to use as padding */
-char *TS_repeat;               /* "rp" (2 params, # times to repeat
-                                  and character to be repeated) */
-char *TS_end_standout_mode;    /* "se" */
-char *TS_fwd_scroll;           /* "sf" */
-char *TS_standout_mode;                /* "so" */
-char *TS_rev_scroll;           /* "sr" */
-char *TS_end_termcap_modes;    /* "te" */
-char *TS_termcap_modes;                /* "ti" */
-char *TS_visible_bell;         /* "vb" */
-char *TS_cursor_normal;                /* "ve" */
-char *TS_cursor_visible;       /* "vs" */
-char *TS_cursor_invisible;     /* "vi" */
-char *TS_set_window;           /* "wi" (4 params, start and end of window,
-                                  each as vpos and hpos) */
-
-/* Value of the "NC" (no_color_video) capability, or 0 if not
-   present.  */
-
-static int TN_no_color_video;
-
 /* Meaning of bits in no_color_video.  Each bit set means that the
    corresponding attribute cannot be combined with colors.  */
 
@@ -310,68 +149,6 @@ enum no_color_bit
   NC_ALT_CHARSET = 1 << 8
 };
 
-/* "md" -- turn on bold (extra bright mode).  */
-
-char *TS_enter_bold_mode;
-
-/* "mh" -- turn on half-bright mode.  */
-
-char *TS_enter_dim_mode;
-
-/* "mb" -- enter blinking mode.  */
-
-char *TS_enter_blink_mode;
-
-/* "mr" -- enter reverse video mode.  */
-
-char *TS_enter_reverse_mode;
-
-/* "us"/"ue" -- start/end underlining.  */
-
-char *TS_exit_underline_mode, *TS_enter_underline_mode;
-
-/* "as"/"ae" -- start/end alternate character set.  Not really
-   supported, yet.  */
-
-char *TS_enter_alt_charset_mode, *TS_exit_alt_charset_mode;
-
-/* "me" -- switch appearances off.  */
-
-char *TS_exit_attribute_mode;
-
-/* "Co" -- number of colors.  */
-
-int TN_max_colors;
-
-/* "pa" -- max. number of color pairs on screen.  Not handled yet.
-   Could be a problem if not equal to TN_max_colors * TN_max_colors.  */
-
-int TN_max_pairs;
-
-/* "op" -- SVr4 set default pair to its original value.  */
-
-char *TS_orig_pair;
-
-/* "AF"/"AB" or "Sf"/"Sb"-- set ANSI or SVr4 foreground/background color.
-   1 param, the color index.  */
-
-char *TS_set_foreground, *TS_set_background;
-
-int TF_hazeltine;      /* termcap hz flag. */
-int TF_insmode_motion; /* termcap mi flag: can move while in insert mode. */
-int TF_standout_motion;        /* termcap mi flag: can move while in standout mode. */
-int TF_underscore;     /* termcap ul flag: _ underlines if over-struck on
-                          non-blank position.  Must clear before writing _.  */
-int TF_teleray;                /* termcap xt flag: many weird consequences.
-                          For t1061. */
-
-static int RPov;       /* # chars to start a TS_repeat */
-
-static int delete_in_insert_mode;      /* delete mode == insert mode */
-
-static int se_is_so;   /* 1 if same string both enters and leaves
-                          standout mode */
-
 /* internal state */
 
 /* The largest frame width in any call to calculate_costs.  */
@@ -382,33 +159,14 @@ int max_frame_cols;
 
 int max_frame_lines;
 
-static int costs_set;    /* Nonzero if costs have been calculated. */
-
-int insert_mode;                       /* Nonzero when in insert mode.  */
-int standout_mode;                     /* Nonzero when in standout mode.  */
-
-/* Size of window specified by higher levels.
-   This is the number of lines, from the top of frame downwards,
-   which can participate in insert-line/delete-line operations.
-
-   Effectively it excludes the bottom frame_lines - specified_window_size
-   lines from those operations.  */
-
-int specified_window;
-
-/* Frame currently being redisplayed; 0 if not currently redisplaying.
-   (Direct output does not count).  */
-
-FRAME_PTR updating_frame;
+/* Non-zero if we have dropped our controlling tty and therefore
+   should not open a frame on stdout. */
+static int no_controlling_tty;
 
 /* Provided for lisp packages.  */
 
 static int system_uses_terminfo;
 
-/* Flag used in tty_show/hide_cursor.  */
-
-static int tty_cursor_hidden;
-
 char *tparam ();
 
 extern char *tgetstr ();
@@ -425,192 +183,174 @@ extern char *tgetstr ();
 #define FRAME_TERMCAP_P(_f_) 0
 #endif /* WINDOWSNT */
 
-void
-ring_bell ()
-{
-  if (!NILP (Vring_bell_function))
-    {
-      Lisp_Object function;
-
-      /* Temporarily set the global variable to nil
-        so that if we get an error, it stays nil
-        and we don't call it over and over.
 
-        We don't specbind it, because that would carefully
-        restore the bad value if there's an error
-        and make the loop of errors happen anyway.  */
+/* Ring the bell on a tty. */
 
-      function = Vring_bell_function;
-      Vring_bell_function = Qnil;
-
-      call0 (function);
+static void
+tty_ring_bell (struct frame *f)
+{
+  struct tty_display_info *tty = FRAME_TTY (f);
 
-      Vring_bell_function = function;
+  if (tty->output)
+    {
+      OUTPUT (tty, (tty->TS_visible_bell && visible_bell
+                    ? tty->TS_visible_bell
+                    : tty->TS_bell));
+      fflush (tty->output);
     }
-  else if (!FRAME_TERMCAP_P (XFRAME (selected_frame)))
-    (*ring_bell_hook) ();
-  else
-    OUTPUT (TS_visible_bell && visible_bell ? TS_visible_bell : TS_bell);
 }
 
+/* Set up termcap modes for Emacs. */
+
 void
-set_terminal_modes ()
+tty_set_terminal_modes (struct terminal *terminal)
 {
-  if (FRAME_TERMCAP_P (XFRAME (selected_frame)))
+  struct tty_display_info *tty = terminal->display_info.tty;
+  
+  if (tty->output)
     {
-      if (TS_termcap_modes)
-       OUTPUT (TS_termcap_modes);
+      if (tty->TS_termcap_modes)
+        OUTPUT (tty, tty->TS_termcap_modes);
       else
-       {
-         /* Output enough newlines to scroll all the old screen contents
-            off the screen, so it won't be overwritten and lost.  */
-         int i;
-         for (i = 0; i < FRAME_LINES (XFRAME (selected_frame)); i++)
-           putchar ('\n');
-       }
-
-      OUTPUT_IF (visible_cursor ? TS_cursor_visible : TS_cursor_normal);
-      OUTPUT_IF (TS_keypad_mode);
-      losecursor ();
+        {
+          /* Output enough newlines to scroll all the old screen contents
+             off the screen, so it won't be overwritten and lost.  */
+          int i;
+          current_tty = tty;
+          for (i = 0; i < FRAME_LINES (XFRAME (selected_frame)); i++)
+            cmputc ('\n');
+        }
+
+      OUTPUT_IF (tty, tty->TS_termcap_modes);
+      OUTPUT_IF (tty, visible_cursor ? tty->TS_cursor_visible : tty->TS_cursor_normal);
+      OUTPUT_IF (tty, tty->TS_keypad_mode);
+      losecursor (tty);
+      fflush (tty->output);
     }
-  else
-    (*set_terminal_modes_hook) ();
 }
 
+/* Reset termcap modes before exiting Emacs. */
+
 void
-reset_terminal_modes ()
+tty_reset_terminal_modes (struct terminal *terminal)
 {
-  if (FRAME_TERMCAP_P (XFRAME (selected_frame)))
+  struct tty_display_info *tty = terminal->display_info.tty;
+
+  if (tty->output)
     {
-      turn_off_highlight ();
-      turn_off_insert ();
-      OUTPUT_IF (TS_end_keypad_mode);
-      OUTPUT_IF (TS_cursor_normal);
-      OUTPUT_IF (TS_end_termcap_modes);
-      OUTPUT_IF (TS_orig_pair);
+      tty_turn_off_highlight (tty);
+      tty_turn_off_insert (tty);
+      OUTPUT_IF (tty, tty->TS_end_keypad_mode);
+      OUTPUT_IF (tty, tty->TS_cursor_normal);
+      OUTPUT_IF (tty, tty->TS_end_termcap_modes);
+      OUTPUT_IF (tty, tty->TS_orig_pair);
       /* Output raw CR so kernel can track the cursor hpos.  */
+      current_tty = tty;
       cmputc ('\r');
+      fflush (tty->output);
     }
-  else if (reset_terminal_modes_hook)
-    (*reset_terminal_modes_hook) ();
 }
 
-void
-update_begin (f)
-     struct frame *f;
-{
-  updating_frame = f;
-  if (!FRAME_TERMCAP_P (f))
-    update_begin_hook (f);
-}
+/* Flag the end of a display update on a termcap terminal. */
 
-void
-update_end (f)
-     struct frame *f;
+static void
+tty_update_end (struct frame *f)
 {
-  if (FRAME_TERMCAP_P (f))
-    {
-      if (!XWINDOW (selected_window)->cursor_off_p)
-       tty_show_cursor ();
-      turn_off_insert ();
-      background_highlight ();
-    }
-  else
-    update_end_hook (f);
+  struct tty_display_info *tty = FRAME_TTY (f);
 
-  updating_frame = NULL;
+  if (!XWINDOW (selected_window)->cursor_off_p)
+    tty_show_cursor (tty);
+  tty_turn_off_insert (tty);
+  tty_background_highlight (tty);
 }
 
-void
-set_terminal_window (size)
-     int size;
+/* The implementation of set_terminal_window for termcap frames. */
+
+static void
+tty_set_terminal_window (struct frame *f, int size)
 {
-  if (FRAME_TERMCAP_P (updating_frame))
-    {
-      specified_window = size ? size : FRAME_LINES (updating_frame);
-      if (scroll_region_ok)
-       set_scroll_region (0, specified_window);
-    }
-  else
-    set_terminal_window_hook (size);
+  struct tty_display_info *tty = FRAME_TTY (f);
+
+  tty->specified_window = size ? size : FRAME_LINES (f);
+  if (FRAME_SCROLL_REGION_OK (f))
+    tty_set_scroll_region (f, 0, tty->specified_window);
 }
 
-void
-set_scroll_region (start, stop)
-     int start, stop;
+static void
+tty_set_scroll_region (struct frame *f, int start, int stop)
 {
   char *buf;
-  struct frame *sf = XFRAME (selected_frame);
-
-  if (TS_set_scroll_region)
-    buf = tparam (TS_set_scroll_region, 0, 0, start, stop - 1);
-  else if (TS_set_scroll_region_1)
-    buf = tparam (TS_set_scroll_region_1, 0, 0,
-                 FRAME_LINES (sf), start,
-                 FRAME_LINES (sf) - stop,
-                 FRAME_LINES (sf));
+  struct tty_display_info *tty = FRAME_TTY (f);
+
+  if (tty->TS_set_scroll_region)
+    buf = tparam (tty->TS_set_scroll_region, 0, 0, start, stop - 1);
+  else if (tty->TS_set_scroll_region_1)
+    buf = tparam (tty->TS_set_scroll_region_1, 0, 0,
+                 FRAME_LINES (f), start,
+                 FRAME_LINES (f) - stop,
+                 FRAME_LINES (f));
   else
-    buf = tparam (TS_set_window, 0, 0, start, 0, stop, FRAME_COLS (sf));
+    buf = tparam (tty->TS_set_window, 0, 0, start, 0, stop, FRAME_COLS (f));
 
-  OUTPUT (buf);
+  OUTPUT (tty, buf);
   xfree (buf);
-  losecursor ();
+  losecursor (tty);
 }
 
 \f
 static void
-turn_on_insert ()
+tty_turn_on_insert (struct tty_display_info *tty)
 {
-  if (!insert_mode)
-    OUTPUT (TS_insert_mode);
-  insert_mode = 1;
+  if (!tty->insert_mode)
+    OUTPUT (tty, tty->TS_insert_mode);
+  tty->insert_mode = 1;
 }
 
 void
-turn_off_insert ()
+tty_turn_off_insert (struct tty_display_info *tty)
 {
-  if (insert_mode)
-    OUTPUT (TS_end_insert_mode);
-  insert_mode = 0;
+  if (tty->insert_mode)
+    OUTPUT (tty, tty->TS_end_insert_mode);
+  tty->insert_mode = 0;
 }
 \f
 /* Handle highlighting.  */
 
 void
-turn_off_highlight ()
+tty_turn_off_highlight (struct tty_display_info *tty)
 {
-  if (standout_mode)
-    OUTPUT_IF (TS_end_standout_mode);
-  standout_mode = 0;
+  if (tty->standout_mode)
+    OUTPUT_IF (tty, tty->TS_end_standout_mode);
+  tty->standout_mode = 0;
 }
 
 static void
-turn_on_highlight ()
+tty_turn_on_highlight (struct tty_display_info *tty)
 {
-  if (!standout_mode)
-    OUTPUT_IF (TS_standout_mode);
-  standout_mode = 1;
+  if (!tty->standout_mode)
+    OUTPUT_IF (tty, tty->TS_standout_mode);
+  tty->standout_mode = 1;
 }
 
 static void
-toggle_highlight ()
+tty_toggle_highlight (struct tty_display_info *tty)
 {
-  if (standout_mode)
-    turn_off_highlight ();
+  if (tty->standout_mode)
+    tty_turn_off_highlight (tty);
   else
-    turn_on_highlight ();
+    tty_turn_on_highlight (tty);
 }
 
 
 /* Make cursor invisible.  */
 
 static void
-tty_hide_cursor ()
+tty_hide_cursor (struct tty_display_info *tty)
 {
-  if (tty_cursor_hidden == 0)
+  if (tty->cursor_hidden == 0)
     {
-      tty_cursor_hidden = 1;
-      OUTPUT_IF (TS_cursor_invisible);
+      tty->cursor_hidden = 1;
+      OUTPUT_IF (tty, tty->TS_cursor_invisible);
     }
 }
 
@@ -618,14 +358,14 @@ tty_hide_cursor ()
 /* Ensure that cursor is visible.  */
 
 static void
-tty_show_cursor ()
+tty_show_cursor (struct tty_display_info *tty)
 {
-  if (tty_cursor_hidden)
+  if (tty->cursor_hidden)
     {
-      tty_cursor_hidden = 0;
-      OUTPUT_IF (TS_cursor_normal);
+      tty->cursor_hidden = 0;
+      OUTPUT_IF (tty, tty->TS_cursor_normal);
       if (visible_cursor)
-       OUTPUT_IF (TS_cursor_visible);
+        OUTPUT_IF (tty, tty->TS_cursor_visible);
     }
 }
 
@@ -634,180 +374,151 @@ tty_show_cursor ()
    empty space inside windows.  What this is,
    depends on the user option inverse-video.  */
 
-void
-background_highlight ()
+static void
+tty_background_highlight (struct tty_display_info *tty)
 {
   if (inverse_video)
-    turn_on_highlight ();
+    tty_turn_on_highlight (tty);
   else
-    turn_off_highlight ();
+    tty_turn_off_highlight (tty);
 }
 
 /* Set standout mode to the mode specified for the text to be output.  */
 
 static void
-highlight_if_desired ()
+tty_highlight_if_desired (struct tty_display_info *tty)
 {
   if (inverse_video)
-    turn_on_highlight ();
+    tty_turn_on_highlight (tty);
   else
-    turn_off_highlight ();
+    tty_turn_off_highlight (tty);
 }
 \f
 
 /* Move cursor to row/column position VPOS/HPOS.  HPOS/VPOS are
    frame-relative coordinates.  */
 
-void
-cursor_to (vpos, hpos)
-     int vpos, hpos;
+static void
+tty_cursor_to (struct frame *f, int vpos, int hpos)
 {
-  struct frame *f = updating_frame ? updating_frame : XFRAME (selected_frame);
-
-  if (! FRAME_TERMCAP_P (f) && cursor_to_hook)
-    {
-      (*cursor_to_hook) (vpos, hpos);
-      return;
-    }
+  struct tty_display_info *tty = FRAME_TTY (f);
 
   /* Detect the case where we are called from reset_sys_modes
      and the costs have never been calculated.  Do nothing.  */
-  if (! costs_set)
+  if (! tty->costs_set)
     return;
 
-  if (curY == vpos && curX == hpos)
+  if (curY (tty) == vpos
+      && curX (tty) == hpos)
     return;
-  if (!TF_standout_motion)
-    background_highlight ();
-  if (!TF_insmode_motion)
-    turn_off_insert ();
-  cmgoto (vpos, hpos);
+  if (!tty->TF_standout_motion)
+    tty_background_highlight (tty);
+  if (!tty->TF_insmode_motion)
+    tty_turn_off_insert (tty);
+  cmgoto (tty, vpos, hpos);
 }
 
 /* Similar but don't take any account of the wasted characters.  */
 
-void
-raw_cursor_to (row, col)
-     int row, col;
+static void
+tty_raw_cursor_to (struct frame *f, int row, int col)
 {
-  struct frame *f = updating_frame ? updating_frame : XFRAME (selected_frame);
-  if (! FRAME_TERMCAP_P (f))
-    {
-      (*raw_cursor_to_hook) (row, col);
-      return;
-    }
-  if (curY == row && curX == col)
+  struct tty_display_info *tty = FRAME_TTY (f);
+
+  if (curY (tty) == row
+      && curX (tty) == col)
     return;
-  if (!TF_standout_motion)
-    background_highlight ();
-  if (!TF_insmode_motion)
-    turn_off_insert ();
-  cmgoto (row, col);
+  if (!tty->TF_standout_motion)
+    tty_background_highlight (tty);
+  if (!tty->TF_insmode_motion)
+    tty_turn_off_insert (tty);
+  cmgoto (tty, row, col);
 }
 \f
 /* Erase operations */
 
-/* clear from cursor to end of frame */
-void
-clear_to_end ()
+/* Clear from cursor to end of frame on a termcap device. */
+
+static void
+tty_clear_to_end (struct frame *f)
 {
   register int i;
+  struct tty_display_info *tty = FRAME_TTY (f);
 
-  if (clear_to_end_hook && ! FRAME_TERMCAP_P (updating_frame))
-    {
-      (*clear_to_end_hook) ();
-      return;
-    }
-  if (TS_clr_to_bottom)
+  if (tty->TS_clr_to_bottom)
     {
-      background_highlight ();
-      OUTPUT (TS_clr_to_bottom);
+      tty_background_highlight (tty);
+      OUTPUT (tty, tty->TS_clr_to_bottom);
     }
   else
     {
-      for (i = curY; i < FRAME_LINES (XFRAME (selected_frame)); i++)
+      for (i = curY (tty); i < FRAME_LINES (f); i++)
        {
-         cursor_to (i, 0);
-         clear_end_of_line (FRAME_COLS (XFRAME (selected_frame)));
+         cursor_to (f, i, 0);
+         clear_end_of_line (f, FRAME_COLS (f));
        }
     }
 }
 
-/* Clear entire frame */
+/* Clear an entire termcap frame. */
 
-void
-clear_frame ()
+static void
+tty_clear_frame (struct frame *f)
 {
-  struct frame *sf = XFRAME (selected_frame);
+  struct tty_display_info *tty = FRAME_TTY (f);
 
-  if (clear_frame_hook
-      && ! FRAME_TERMCAP_P ((updating_frame ? updating_frame : sf)))
-    {
-      (*clear_frame_hook) ();
-      return;
-    }
-  if (TS_clr_frame)
+  if (tty->TS_clr_frame)
     {
-      background_highlight ();
-      OUTPUT (TS_clr_frame);
-      cmat (0, 0);
+      tty_background_highlight (tty);
+      OUTPUT (tty, tty->TS_clr_frame);
+      cmat (tty, 0, 0);
     }
   else
     {
-      cursor_to (0, 0);
-      clear_to_end ();
+      cursor_to (f, 0, 0);
+      clear_to_end (f);
     }
 }
 
-/* Clear from cursor to end of line.
-   Assume that the line is already clear starting at column first_unused_hpos.
+/* An implementation of clear_end_of_line for termcap frames.
 
    Note that the cursor may be moved, on terminals lacking a `ce' string.  */
 
-void
-clear_end_of_line (first_unused_hpos)
-     int first_unused_hpos;
+static void
+tty_clear_end_of_line (struct frame *f, int first_unused_hpos)
 {
   register int i;
-
-  if (clear_end_of_line_hook
-      && ! FRAME_TERMCAP_P ((updating_frame
-                              ? updating_frame
-                            : XFRAME (selected_frame))))
-    {
-      (*clear_end_of_line_hook) (first_unused_hpos);
-      return;
-    }
+  struct tty_display_info *tty = FRAME_TTY (f);
 
   /* Detect the case where we are called from reset_sys_modes
      and the costs have never been calculated.  Do nothing.  */
-  if (! costs_set)
+  if (! tty->costs_set)
     return;
 
-  if (curX >= first_unused_hpos)
+  if (curX (tty) >= first_unused_hpos)
     return;
-  background_highlight ();
-  if (TS_clr_line)
+  tty_background_highlight (tty);
+  if (tty->TS_clr_line)
     {
-      OUTPUT1 (TS_clr_line);
+      OUTPUT1 (tty, tty->TS_clr_line);
     }
   else
     {                  /* have to do it the hard way */
-      struct frame *sf = XFRAME (selected_frame);
-      turn_off_insert ();
+      tty_turn_off_insert (tty);
 
       /* Do not write in last row last col with Auto-wrap on. */
-      if (AutoWrap && curY == FRAME_LINES (sf) - 1
-         && first_unused_hpos == FRAME_COLS (sf))
+      if (AutoWrap (tty)
+          && curY (tty) == FrameRows (tty) - 1
+         && first_unused_hpos == FrameCols (tty))
        first_unused_hpos--;
 
-      for (i = curX; i < first_unused_hpos; i++)
+      for (i = curX (tty); i < first_unused_hpos; i++)
        {
-         if (termscript)
-           fputc (' ', termscript);
-         putchar (' ');
+         if (tty->termscript)
+           fputc (' ', tty->termscript);
+         fputc (' ', tty->output);
        }
-      cmplus (first_unused_hpos - curX);
+      cmplus (tty, first_unused_hpos - curX (tty));
     }
 }
 \f
@@ -929,43 +640,37 @@ encode_terminal_code (src, src_len, coding)
   return encode_terminal_buf + nbytes;
 }
 
-void
-write_glyphs (string, len)
-     register struct glyph *string;
-     register int len;
+
+/* An implementation of write_glyphs for termcap frames. */
+
+static void
+tty_write_glyphs (struct frame *f, struct glyph *string, int len)
 {
-  struct frame *sf = XFRAME (selected_frame);
-  struct frame *f = updating_frame ? updating_frame : sf;
   unsigned char *conversion_buffer;
   struct coding_system *coding;
 
-  if (write_glyphs_hook
-      && ! FRAME_TERMCAP_P (f))
-    {
-      (*write_glyphs_hook) (string, len);
-      return;
-    }
+  struct tty_display_info *tty = FRAME_TTY (f);
 
-  turn_off_insert ();
-  tty_hide_cursor ();
+  tty_turn_off_insert (tty);
+  tty_hide_cursor (tty);
 
   /* Don't dare write in last column of bottom line, if Auto-Wrap,
      since that would scroll the whole frame on some terminals.  */
 
-  if (AutoWrap
-      && curY + 1 == FRAME_LINES (sf)
-      && (curX + len) == FRAME_COLS (sf))
+  if (AutoWrap (tty)
+      && curY (tty) + 1 == FRAME_LINES (f)
+      && (curX (tty) + len) == FRAME_COLS (f))
     len --;
   if (len <= 0)
     return;
 
-  cmplus (len);
+  cmplus (tty, len);
 
   /* If terminal_coding does any conversion, use it, otherwise use
      safe_terminal_coding.  We can't use CODING_REQUIRE_ENCODING here
      because it always return 1 if the member src_multibyte is 1.  */
-  coding = (terminal_coding.common_flags & CODING_REQUIRE_ENCODING_MASK
-           ? &terminal_coding : &safe_terminal_coding);
+  coding = (FRAME_TERMINAL_CODING (f)->common_flags & CODING_REQUIRE_ENCODING_MASK
+           ? FRAME_TERMINAL_CODING (f) : &safe_terminal_coding);
   /* The mode bit CODING_MODE_LAST_BLOCK should be set to 1 only at
      the tail.  */
   coding->mode &= ~CODING_MODE_LAST_BLOCK;
@@ -981,7 +686,7 @@ write_glyphs (string, len)
          break;
 
       /* Turn appearance modes of the face of the run on.  */
-      highlight_if_desired ();
+      tty_highlight_if_desired (tty);
       turn_on_face (f, face_id);
 
       if (n == len)
@@ -990,61 +695,48 @@ write_glyphs (string, len)
       conversion_buffer = encode_terminal_code (string, n, coding);
       if (coding->produced > 0)
        {
-         fwrite (conversion_buffer, 1, coding->produced, stdout);
-         if (ferror (stdout))
-           clearerr (stdout);
-         if (termscript)
-           fwrite (conversion_buffer, 1, coding->produced, termscript);
+         fwrite (conversion_buffer, 1, coding->produced, tty->output);
+         if (ferror (tty->output))
+           clearerr (tty->output);
+         if (tty->termscript)
+           fwrite (conversion_buffer, 1, coding->produced, tty->termscript);
        }
       len -= n;
       string += n;
 
       /* Turn appearance modes off.  */
       turn_off_face (f, face_id);
-      turn_off_highlight ();
+      tty_turn_off_highlight (tty);
     }
 
-  cmcheckmagic ();
+  cmcheckmagic (tty);
 }
 
-/* If start is zero, insert blanks instead of a string at start */
+/* An implementation of insert_glyphs for termcap frames. */
 
-void
-insert_glyphs (start, len)
-     register struct glyph *start;
-     register int len;
+static void
+tty_insert_glyphs (struct frame *f, struct glyph *start, int len)
 {
   char *buf;
   struct glyph *glyph = NULL;
-  struct frame *f, *sf;
   unsigned char *conversion_buffer;
   unsigned char space[1];
   struct coding_system *coding;
 
-  if (len <= 0)
-    return;
-
-  if (insert_glyphs_hook)
-    {
-      (*insert_glyphs_hook) (start, len);
-      return;
-    }
-
-  sf = XFRAME (selected_frame);
-  f = updating_frame ? updating_frame : sf;
+  struct tty_display_info *tty = FRAME_TTY (f);
 
-  if (TS_ins_multi_chars)
+  if (tty->TS_ins_multi_chars)
     {
-      buf = tparam (TS_ins_multi_chars, 0, 0, len);
-      OUTPUT1 (buf);
+      buf = tparam (tty->TS_ins_multi_chars, 0, 0, len);
+      OUTPUT1 (tty, buf);
       xfree (buf);
       if (start)
-       write_glyphs (start, len);
+       write_glyphs (f, start, len);
       return;
     }
 
-  turn_on_insert ();
-  cmplus (len);
+  tty_turn_on_insert (tty);
+  cmplus (tty, len);
 
   if (! start)
     space[0] = SPACEGLYPH;
@@ -1052,15 +744,15 @@ insert_glyphs (start, len)
   /* If terminal_coding does any conversion, use it, otherwise use
      safe_terminal_coding.  We can't use CODING_REQUIRE_ENCODING here
      because it always return 1 if the member src_multibyte is 1.  */
-  coding = (terminal_coding.common_flags & CODING_REQUIRE_ENCODING_MASK
-           ? &terminal_coding : &safe_terminal_coding);
+  coding = (FRAME_TERMINAL_CODING (f)->common_flags & CODING_REQUIRE_ENCODING_MASK
+           ? FRAME_TERMINAL_CODING (f) : &safe_terminal_coding);
   /* The mode bit CODING_MODE_LAST_BLOCK should be set to 1 only at
      the tail.  */
   coding->mode &= ~CODING_MODE_LAST_BLOCK;
 
   while (len-- > 0)
     {
-      OUTPUT1_IF (TS_ins_char);
+      OUTPUT1_IF (tty, tty->TS_ins_char);
       if (!start)
        {
          conversion_buffer = space;
@@ -1068,7 +760,7 @@ insert_glyphs (start, len)
        }
       else
        {
-         highlight_if_desired ();
+         tty_highlight_if_desired (tty);
          turn_on_face (f, start->face_id);
          glyph = start;
          ++start;
@@ -1076,7 +768,7 @@ insert_glyphs (start, len)
             occupies more than one column.  */
          while (len && CHAR_GLYPH_PADDING_P (*start))
            {
-             OUTPUT1_IF (TS_ins_char);
+             OUTPUT1_IF (tty, tty->TS_ins_char);
              start++, len--;
            }
 
@@ -1084,87 +776,75 @@ insert_glyphs (start, len)
            /* This is the last glyph.  */
            coding->mode |= CODING_MODE_LAST_BLOCK;
 
-         conversion_buffer = encode_terminal_code (glyph, 1, coding);
+          conversion_buffer = encode_terminal_code (glyph, 1, coding);
        }
 
       if (coding->produced > 0)
        {
-         fwrite (conversion_buffer, 1, coding->produced, stdout);
-         if (ferror (stdout))
-           clearerr (stdout);
-         if (termscript)
-           fwrite (conversion_buffer, 1, coding->produced, termscript);
+         fwrite (conversion_buffer, 1, coding->produced, tty->output);
+         if (ferror (tty->output))
+           clearerr (tty->output);
+         if (tty->termscript)
+           fwrite (conversion_buffer, 1, coding->produced, tty->termscript);
        }
 
-      OUTPUT1_IF (TS_pad_inserted_char);
+      OUTPUT1_IF (tty, tty->TS_pad_inserted_char);
       if (start)
        {
          turn_off_face (f, glyph->face_id);
-         turn_off_highlight ();
+         tty_turn_off_highlight (tty);
        }
     }
 
-  cmcheckmagic ();
+  cmcheckmagic (tty);
 }
 
-void
-delete_glyphs (n)
-     register int n;
+/* An implementation of delete_glyphs for termcap frames. */
+
+static void
+tty_delete_glyphs (struct frame *f, int n)
 {
   char *buf;
   register int i;
 
-  if (delete_glyphs_hook && ! FRAME_TERMCAP_P (updating_frame))
-    {
-      (*delete_glyphs_hook) (n);
-      return;
-    }
+  struct tty_display_info *tty = FRAME_TTY (f);
 
-  if (delete_in_insert_mode)
+  if (tty->delete_in_insert_mode)
     {
-      turn_on_insert ();
+      tty_turn_on_insert (tty);
     }
   else
     {
-      turn_off_insert ();
-      OUTPUT_IF (TS_delete_mode);
+      tty_turn_off_insert (tty);
+      OUTPUT_IF (tty, tty->TS_delete_mode);
     }
 
-  if (TS_del_multi_chars)
+  if (tty->TS_del_multi_chars)
     {
-      buf = tparam (TS_del_multi_chars, 0, 0, n);
-      OUTPUT1 (buf);
+      buf = tparam (tty->TS_del_multi_chars, 0, 0, n);
+      OUTPUT1 (tty, buf);
       xfree (buf);
     }
   else
     for (i = 0; i < n; i++)
-      OUTPUT1 (TS_del_char);
-  if (!delete_in_insert_mode)
-    OUTPUT_IF (TS_end_delete_mode);
+      OUTPUT1 (tty, tty->TS_del_char);
+  if (!tty->delete_in_insert_mode)
+    OUTPUT_IF (tty, tty->TS_end_delete_mode);
 }
 \f
-/* Insert N lines at vpos VPOS.  If N is negative, delete -N lines.  */
+/* An implementation of ins_del_lines for termcap frames. */
 
-void
-ins_del_lines (vpos, n)
-     int vpos, n;
+static void
+tty_ins_del_lines (struct frame *f, int vpos, int n)
 {
-  char *multi = n > 0 ? TS_ins_multi_lines : TS_del_multi_lines;
-  char *single = n > 0 ? TS_ins_line : TS_del_line;
-  char *scroll = n > 0 ? TS_rev_scroll : TS_fwd_scroll;
-  struct frame *sf;
+  struct tty_display_info *tty = FRAME_TTY (f);
+  char *multi = n > 0 ? tty->TS_ins_multi_lines : tty->TS_del_multi_lines;
+  char *single = n > 0 ? tty->TS_ins_line : tty->TS_del_line;
+  char *scroll = n > 0 ? tty->TS_rev_scroll : tty->TS_fwd_scroll;
 
   register int i = n > 0 ? n : -n;
   register char *buf;
 
-  if (ins_del_lines_hook && ! FRAME_TERMCAP_P (updating_frame))
-    {
-      (*ins_del_lines_hook) (vpos, n);
-      return;
-    }
-
-  sf = XFRAME (selected_frame);
-
   /* If the lines below the insertion are being pushed
      into the end of the window, this is the same as clearing;
      and we know the lines are already clear, since the matching
@@ -1172,45 +852,49 @@ ins_del_lines (vpos, n)
   /* If the lines below the deletion are blank lines coming
      out of the end of the window, don't bother,
      as there will be a matching inslines later that will flush them. */
-  if (scroll_region_ok && vpos + i >= specified_window)
+  if (FRAME_SCROLL_REGION_OK (f)
+      && vpos + i >= tty->specified_window)
     return;
-  if (!memory_below_frame && vpos + i >= FRAME_LINES (sf))
+  if (!FRAME_MEMORY_BELOW_FRAME (f)
+      && vpos + i >= FRAME_LINES (f))
     return;
-
+  
   if (multi)
     {
-      raw_cursor_to (vpos, 0);
-      background_highlight ();
+      raw_cursor_to (f, vpos, 0);
+      tty_background_highlight (tty);
       buf = tparam (multi, 0, 0, i);
-      OUTPUT (buf);
+      OUTPUT (tty, buf);
       xfree (buf);
     }
   else if (single)
     {
-      raw_cursor_to (vpos, 0);
-      background_highlight ();
+      raw_cursor_to (f, vpos, 0);
+      tty_background_highlight (tty);
       while (--i >= 0)
-       OUTPUT (single);
-      if (TF_teleray)
-       curX = 0;
+        OUTPUT (tty, single);
+      if (tty->TF_teleray)
+        curX (tty) = 0;
     }
   else
     {
-      set_scroll_region (vpos, specified_window);
+      tty_set_scroll_region (f, vpos, tty->specified_window);
       if (n < 0)
-       raw_cursor_to (specified_window - 1, 0);
+        raw_cursor_to (f, tty->specified_window - 1, 0);
       else
-       raw_cursor_to (vpos, 0);
-      background_highlight ();
+        raw_cursor_to (f, vpos, 0);
+      tty_background_highlight (tty);
       while (--i >= 0)
-       OUTPUTL (scroll, specified_window - vpos);
-      set_scroll_region (0, specified_window);
+        OUTPUTL (tty, scroll, tty->specified_window - vpos);
+      tty_set_scroll_region (f, 0, tty->specified_window);
     }
-
-  if (!scroll_region_ok && memory_below_frame && n < 0)
+  
+  if (!FRAME_SCROLL_REGION_OK (f)
+      && FRAME_MEMORY_BELOW_FRAME (f)
+      && n < 0)
     {
-      cursor_to (FRAME_LINES (sf) + n, 0);
-      clear_to_end ();
+      cursor_to (f, FRAME_LINES (f) + n, 0);
+      clear_to_end (f);
     }
 }
 \f
@@ -1218,8 +902,7 @@ ins_del_lines (vpos, n)
    not counting any line-dependent padding.  */
 
 int
-string_cost (str)
-     char *str;
+string_cost (char *str)
 {
   cost = 0;
   if (str)
@@ -1231,8 +914,7 @@ string_cost (str)
    counting any line-dependent padding at one line.  */
 
 static int
-string_cost_one_line (str)
-     char *str;
+string_cost_one_line (char *str)
 {
   cost = 0;
   if (str)
@@ -1244,8 +926,7 @@ string_cost_one_line (str)
    in tenths of characters.  */
 
 int
-per_line_cost (str)
-     register char *str;
+per_line_cost (char *str)
 {
   cost = 0;
   if (str)
@@ -1268,26 +949,26 @@ int *char_ins_del_vector;
 
 /* ARGSUSED */
 static void
-calculate_ins_del_char_costs (frame)
-     FRAME_PTR frame;
+calculate_ins_del_char_costs (struct frame *f)
 {
+  struct tty_display_info *tty = FRAME_TTY (f);
   int ins_startup_cost, del_startup_cost;
   int ins_cost_per_char, del_cost_per_char;
   register int i;
   register int *p;
 
-  if (TS_ins_multi_chars)
+  if (tty->TS_ins_multi_chars)
     {
       ins_cost_per_char = 0;
-      ins_startup_cost = string_cost_one_line (TS_ins_multi_chars);
+      ins_startup_cost = string_cost_one_line (tty->TS_ins_multi_chars);
     }
-  else if (TS_ins_char || TS_pad_inserted_char
-          || (TS_insert_mode && TS_end_insert_mode))
+  else if (tty->TS_ins_char || tty->TS_pad_inserted_char
+          || (tty->TS_insert_mode && tty->TS_end_insert_mode))
     {
-      ins_startup_cost = (30 * (string_cost (TS_insert_mode)
-                               + string_cost (TS_end_insert_mode))) / 100;
-      ins_cost_per_char = (string_cost_one_line (TS_ins_char)
-                          + string_cost_one_line (TS_pad_inserted_char));
+      ins_startup_cost = (30 * (string_cost (tty->TS_insert_mode)
+                               + string_cost (tty->TS_end_insert_mode))) / 100;
+      ins_cost_per_char = (string_cost_one_line (tty->TS_ins_char)
+                          + string_cost_one_line (tty->TS_pad_inserted_char));
     }
   else
     {
@@ -1295,18 +976,18 @@ calculate_ins_del_char_costs (frame)
       ins_cost_per_char = 0;
     }
 
-  if (TS_del_multi_chars)
+  if (tty->TS_del_multi_chars)
     {
       del_cost_per_char = 0;
-      del_startup_cost = string_cost_one_line (TS_del_multi_chars);
+      del_startup_cost = string_cost_one_line (tty->TS_del_multi_chars);
     }
-  else if (TS_del_char)
+  else if (tty->TS_del_char)
     {
-      del_startup_cost = (string_cost (TS_delete_mode)
-                         + string_cost (TS_end_delete_mode));
-      if (delete_in_insert_mode)
+      del_startup_cost = (string_cost (tty->TS_delete_mode)
+                         + string_cost (tty->TS_end_delete_mode));
+      if (tty->delete_in_insert_mode)
        del_startup_cost /= 2;
-      del_cost_per_char = string_cost_one_line (TS_del_char);
+      del_cost_per_char = string_cost_one_line (tty->TS_del_char);
     }
   else
     {
@@ -1315,75 +996,80 @@ calculate_ins_del_char_costs (frame)
     }
 
   /* Delete costs are at negative offsets */
-  p = &char_ins_del_cost (frame)[0];
-  for (i = FRAME_COLS (frame); --i >= 0;)
+  p = &char_ins_del_cost (f)[0];
+  for (i = FRAME_COLS (f); --i >= 0;)
     *--p = (del_startup_cost += del_cost_per_char);
 
   /* Doing nothing is free */
-  p = &char_ins_del_cost (frame)[0];
+  p = &char_ins_del_cost (f)[0];
   *p++ = 0;
 
   /* Insert costs are at positive offsets */
-  for (i = FRAME_COLS (frame); --i >= 0;)
+  for (i = FRAME_COLS (f); --i >= 0;)
     *p++ = (ins_startup_cost += ins_cost_per_char);
 }
 
 void
-calculate_costs (frame)
-     FRAME_PTR frame;
+calculate_costs (struct frame *frame)
 {
-  register char *f = (TS_set_scroll_region
-                     ? TS_set_scroll_region
-                     : TS_set_scroll_region_1);
-
   FRAME_COST_BAUD_RATE (frame) = baud_rate;
 
-  scroll_region_cost = string_cost (f);
+  if (FRAME_TERMCAP_P (frame))
+    {
+      struct tty_display_info *tty = FRAME_TTY (frame);
+      register char *f = (tty->TS_set_scroll_region
+                          ? tty->TS_set_scroll_region
+                          : tty->TS_set_scroll_region_1);
 
-  /* These variables are only used for terminal stuff.  They are allocated
-     once for the terminal frame of X-windows emacs, but not used afterwards.
+      FRAME_SCROLL_REGION_COST (frame) = string_cost (f);
 
-     char_ins_del_vector (i.e., char_ins_del_cost) isn't used because
-     X turns off char_ins_del_ok. */
+      tty->costs_set = 1;
 
-  max_frame_lines = max (max_frame_lines, FRAME_LINES (frame));
-  max_frame_cols = max (max_frame_cols, FRAME_COLS (frame));
+      /* These variables are only used for terminal stuff.  They are
+         allocated once for the terminal frame of X-windows emacs, but not
+         used afterwards.
 
-  costs_set = 1;
+         char_ins_del_vector (i.e., char_ins_del_cost) isn't used because
+         X turns off char_ins_del_ok. */
 
-  if (char_ins_del_vector != 0)
-    char_ins_del_vector
-      = (int *) xrealloc (char_ins_del_vector,
-                         (sizeof (int)
-                          + 2 * max_frame_cols * sizeof (int)));
-  else
-    char_ins_del_vector
-      = (int *) xmalloc (sizeof (int)
-                        + 2 * max_frame_cols * sizeof (int));
-
-  bzero (char_ins_del_vector, (sizeof (int)
-                              + 2 * max_frame_cols * sizeof (int)));
-
-  if (f && (!TS_ins_line && !TS_del_line))
-    do_line_insertion_deletion_costs (frame,
-                                     TS_rev_scroll, TS_ins_multi_lines,
-                                     TS_fwd_scroll, TS_del_multi_lines,
-                                     f, f, 1);
-  else
-    do_line_insertion_deletion_costs (frame,
-                                     TS_ins_line, TS_ins_multi_lines,
-                                     TS_del_line, TS_del_multi_lines,
-                                     0, 0, 1);
+      max_frame_lines = max (max_frame_lines, FRAME_LINES (frame));
+      max_frame_cols = max (max_frame_cols, FRAME_COLS (frame));
 
-  calculate_ins_del_char_costs (frame);
+      if (char_ins_del_vector != 0)
+        char_ins_del_vector
+          = (int *) xrealloc (char_ins_del_vector,
+                              (sizeof (int)
+                               + 2 * max_frame_cols * sizeof (int)));
+      else
+        char_ins_del_vector
+          = (int *) xmalloc (sizeof (int)
+                             + 2 * max_frame_cols * sizeof (int));
+
+      bzero (char_ins_del_vector, (sizeof (int)
+                                   + 2 * max_frame_cols * sizeof (int)));
 
-  /* Don't use TS_repeat if its padding is worse than sending the chars */
-  if (TS_repeat && per_line_cost (TS_repeat) * baud_rate < 9000)
-    RPov = string_cost (TS_repeat);
-  else
-    RPov = FRAME_COLS (frame) * 2;
 
-  cmcostinit ();               /* set up cursor motion costs */
+      if (f && (!tty->TS_ins_line && !tty->TS_del_line))
+        do_line_insertion_deletion_costs (frame,
+                                          tty->TS_rev_scroll, tty->TS_ins_multi_lines,
+                                          tty->TS_fwd_scroll, tty->TS_del_multi_lines,
+                                          f, f, 1);
+      else
+        do_line_insertion_deletion_costs (frame,
+                                          tty->TS_ins_line, tty->TS_ins_multi_lines,
+                                          tty->TS_del_line, tty->TS_del_multi_lines,
+                                          0, 0, 1);
+
+      calculate_ins_del_char_costs (frame);
+
+      /* Don't use TS_repeat if its padding is worse than sending the chars */
+      if (tty->TS_repeat && per_line_cost (tty->TS_repeat) * baud_rate < 9000)
+        tty->RPov = string_cost (tty->TS_repeat);
+      else
+        tty->RPov = FRAME_COLS (frame) * 2;
+
+      cmcostinit (FRAME_TTY (frame)); /* set up cursor motion costs */
+    }
 }
 \f
 struct fkey_table {
@@ -1493,16 +1179,18 @@ static struct fkey_table keys[] =
   {"!3", "S-undo"}       /*shifted undo key*/
   };
 
-static char **term_get_fkeys_arg;
+static char **term_get_fkeys_address;
+static KBOARD *term_get_fkeys_kboard;
 static Lisp_Object term_get_fkeys_1 ();
 
 /* Find the escape codes sent by the function keys for Vfunction_key_map.
    This function scans the termcap function key sequence entries, and
    adds entries to Vfunction_key_map for each function key it finds.  */
 
-void
-term_get_fkeys (address)
+static void
+term_get_fkeys (address, kboard)
      char **address;
+     KBOARD *kboard;
 {
   /* We run the body of the function (term_get_fkeys_1) and ignore all Lisp
      errors during the call.  The only errors should be from Fdefine_key
@@ -1513,7 +1201,8 @@ term_get_fkeys (address)
      refusing to run at all on such a terminal.  */
 
   extern Lisp_Object Fidentity ();
-  term_get_fkeys_arg = address;
+  term_get_fkeys_address = address;
+  term_get_fkeys_kboard = kboard;
   internal_condition_case (term_get_fkeys_1, Qerror, Fidentity);
 }
 
@@ -1522,17 +1211,18 @@ term_get_fkeys_1 ()
 {
   int i;
 
-  char **address = term_get_fkeys_arg;
-
+  char **address = term_get_fkeys_address;
+  KBOARD *kboard = term_get_fkeys_kboard;
+  
   /* This can happen if CANNOT_DUMP or with strange options.  */
   if (!initialized)
-    Vfunction_key_map = Fmake_sparse_keymap (Qnil);
+    kboard->Vlocal_function_key_map = Fmake_sparse_keymap (Qnil);
 
   for (i = 0; i < (sizeof (keys)/sizeof (keys[0])); i++)
     {
       char *sequence = tgetstr (keys[i].cap, address);
       if (sequence)
-       Fdefine_key (Vfunction_key_map, build_string (sequence),
+       Fdefine_key (kboard->Vlocal_function_key_map, build_string (sequence),
                     Fmake_vector (make_number (1),
                                   intern (keys[i].name)));
     }
@@ -1552,13 +1242,13 @@ term_get_fkeys_1 ()
        if (k0)
          /* Define f0 first, so that f10 takes precedence in case the
             key sequences happens to be the same.  */
-         Fdefine_key (Vfunction_key_map, build_string (k0),
+         Fdefine_key (kboard->Vlocal_function_key_map, build_string (k0),
                       Fmake_vector (make_number (1), intern ("f0")));
-       Fdefine_key (Vfunction_key_map, build_string (k_semi),
+       Fdefine_key (kboard->Vlocal_function_key_map, build_string (k_semi),
                     Fmake_vector (make_number (1), intern ("f10")));
       }
     else if (k0)
-      Fdefine_key (Vfunction_key_map, build_string (k0),
+      Fdefine_key (kboard->Vlocal_function_key_map, build_string (k0),
                   Fmake_vector (make_number (1), intern (k0_name)));
   }
 
@@ -1581,7 +1271,7 @@ term_get_fkeys_1 ()
          if (sequence)
            {
              sprintf (fkey, "f%d", i);
-             Fdefine_key (Vfunction_key_map, build_string (sequence),
+             Fdefine_key (kboard->Vlocal_function_key_map, build_string (sequence),
                           Fmake_vector (make_number (1),
                                         intern (fkey)));
            }
@@ -1597,10 +1287,10 @@ term_get_fkeys_1 ()
       if (!tgetstr (cap1, address))                                    \
        {                                                               \
          char *sequence = tgetstr (cap2, address);                     \
-         if (sequence)                                                 \
-           Fdefine_key (Vfunction_key_map, build_string (sequence),    \
-                        Fmake_vector (make_number (1), \
-                                      intern (sym)));  \
+         if (sequence)                                                 \
+           Fdefine_key (kboard->Vlocal_function_key_map, build_string (sequence), \
+                        Fmake_vector (make_number (1),                 \
+                                      intern (sym)));                  \
        }
 
       /* if there's no key_next keycap, map key_npage to `next' keysym */
@@ -1956,10 +1646,10 @@ produce_special_glyphs (it, what)
    from them.  Some display attributes may not be used together with
    color; the termcap capability `NC' specifies which ones.  */
 
-#define MAY_USE_WITH_COLORS_P(ATTR)            \
-     (TN_max_colors > 0                                \
-      ? (TN_no_color_video & (ATTR)) == 0      \
-      : 1)
+#define MAY_USE_WITH_COLORS_P(tty, ATTR)                \
+  (tty->TN_max_colors > 0                              \
+   ? (tty->TN_no_color_video & (ATTR)) == 0             \
+   : 1)
 
 /* Turn appearances of face FACE_ID on tty frame F on.
    FACE_ID is a realized face ID number, in the face cache.  */
@@ -1972,12 +1662,13 @@ turn_on_face (f, face_id)
   struct face *face = FACE_FROM_ID (f, face_id);
   long fg = face->foreground;
   long bg = face->background;
+  struct tty_display_info *tty = FRAME_TTY (f);
 
   /* Do this first because TS_end_standout_mode may be the same
      as TS_exit_attribute_mode, which turns all appearances off. */
-  if (MAY_USE_WITH_COLORS_P (NC_REVERSE))
+  if (MAY_USE_WITH_COLORS_P (tty, NC_REVERSE))
     {
-      if (TN_max_colors > 0)
+      if (tty->TN_max_colors > 0)
        {
          if (fg >= 0 && bg >= 0)
            {
@@ -1991,13 +1682,13 @@ turn_on_face (f, face_id)
            {
              if (fg == FACE_TTY_DEFAULT_FG_COLOR
                  || bg == FACE_TTY_DEFAULT_BG_COLOR)
-               toggle_highlight ();
+               tty_toggle_highlight (tty);
            }
          else
            {
              if (fg == FACE_TTY_DEFAULT_BG_COLOR
                  || bg == FACE_TTY_DEFAULT_FG_COLOR)
-               toggle_highlight ();
+               tty_toggle_highlight (tty);
            }
        }
       else
@@ -2008,55 +1699,55 @@ turn_on_face (f, face_id)
            {
              if (fg == FACE_TTY_DEFAULT_FG_COLOR
                  || bg == FACE_TTY_DEFAULT_BG_COLOR)
-               toggle_highlight ();
+               tty_toggle_highlight (tty);
            }
          else
            {
              if (fg == FACE_TTY_DEFAULT_BG_COLOR
                  || bg == FACE_TTY_DEFAULT_FG_COLOR)
-               toggle_highlight ();
+               tty_toggle_highlight (tty);
            }
        }
     }
 
   if (face->tty_bold_p)
     {
-      if (MAY_USE_WITH_COLORS_P (NC_BOLD))
-       OUTPUT1_IF (TS_enter_bold_mode);
+      if (MAY_USE_WITH_COLORS_P (tty, NC_BOLD))
+       OUTPUT1_IF (tty, tty->TS_enter_bold_mode);
     }
   else if (face->tty_dim_p)
-    if (MAY_USE_WITH_COLORS_P (NC_DIM))
-      OUTPUT1_IF (TS_enter_dim_mode);
+    if (MAY_USE_WITH_COLORS_P (tty, NC_DIM))
+      OUTPUT1_IF (tty, tty->TS_enter_dim_mode);
 
   /* Alternate charset and blinking not yet used.  */
   if (face->tty_alt_charset_p
-      && MAY_USE_WITH_COLORS_P (NC_ALT_CHARSET))
-    OUTPUT1_IF (TS_enter_alt_charset_mode);
+      && MAY_USE_WITH_COLORS_P (tty, NC_ALT_CHARSET))
+    OUTPUT1_IF (tty, tty->TS_enter_alt_charset_mode);
 
   if (face->tty_blinking_p
-      && MAY_USE_WITH_COLORS_P (NC_BLINK))
-    OUTPUT1_IF (TS_enter_blink_mode);
+      && MAY_USE_WITH_COLORS_P (tty, NC_BLINK))
+    OUTPUT1_IF (tty, tty->TS_enter_blink_mode);
 
-  if (face->tty_underline_p && MAY_USE_WITH_COLORS_P (NC_UNDERLINE))
-    OUTPUT1_IF (TS_enter_underline_mode);
+  if (face->tty_underline_p && MAY_USE_WITH_COLORS_P (tty, NC_UNDERLINE))
+    OUTPUT1_IF (tty, tty->TS_enter_underline_mode);
 
-  if (TN_max_colors > 0)
+  if (tty->TN_max_colors > 0)
     {
       char *ts, *p;
 
-      ts = standout_mode ? TS_set_background : TS_set_foreground;
+      ts = tty->standout_mode ? tty->TS_set_background : tty->TS_set_foreground;
       if (fg >= 0 && ts)
        {
-         p = tparam (ts, NULL, 0, (int) fg);
-         OUTPUT (p);
+          p = tparam (ts, NULL, 0, (int) fg);
+         OUTPUT (tty, p);
          xfree (p);
        }
 
-      ts = standout_mode ? TS_set_foreground : TS_set_background;
+      ts = tty->standout_mode ? tty->TS_set_foreground : tty->TS_set_background;
       if (bg >= 0 && ts)
        {
-         p = tparam (ts, NULL, 0, (int) bg);
-         OUTPUT (p);
+          p = tparam (ts, NULL, 0, (int) bg);
+         OUTPUT (tty, p);
          xfree (p);
        }
     }
@@ -2071,10 +1762,11 @@ turn_off_face (f, face_id)
      int face_id;
 {
   struct face *face = FACE_FROM_ID (f, face_id);
+  struct tty_display_info *tty = FRAME_TTY (f);
 
   xassert (face != NULL);
 
-  if (TS_exit_attribute_mode)
+  if (tty->TS_exit_attribute_mode)
     {
       /* Capability "me" will turn off appearance modes double-bright,
         half-bright, reverse-video, standout, underline.  It may or
@@ -2086,32 +1778,32 @@ turn_off_face (f, face_id)
          || face->tty_blinking_p
          || face->tty_underline_p)
        {
-         OUTPUT1_IF (TS_exit_attribute_mode);
-         if (strcmp (TS_exit_attribute_mode, TS_end_standout_mode) == 0)
-           standout_mode = 0;
+         OUTPUT1_IF (tty, tty->TS_exit_attribute_mode);
+         if (strcmp (tty->TS_exit_attribute_mode, tty->TS_end_standout_mode) == 0)
+           tty->standout_mode = 0;
        }
 
       if (face->tty_alt_charset_p)
-       OUTPUT_IF (TS_exit_alt_charset_mode);
+       OUTPUT_IF (tty, tty->TS_exit_alt_charset_mode);
     }
   else
     {
       /* If we don't have "me" we can only have those appearances
         that have exit sequences defined.  */
       if (face->tty_alt_charset_p)
-       OUTPUT_IF (TS_exit_alt_charset_mode);
+       OUTPUT_IF (tty, tty->TS_exit_alt_charset_mode);
 
       if (face->tty_underline_p)
-       OUTPUT_IF (TS_exit_underline_mode);
+       OUTPUT_IF (tty, tty->TS_exit_underline_mode);
     }
 
   /* Switch back to default colors.  */
-  if (TN_max_colors > 0
+  if (tty->TN_max_colors > 0
       && ((face->foreground != FACE_TTY_DEFAULT_COLOR
           && face->foreground != FACE_TTY_DEFAULT_FG_COLOR)
          || (face->background != FACE_TTY_DEFAULT_COLOR
              && face->background != FACE_TTY_DEFAULT_BG_COLOR)))
-    OUTPUT1_IF (TS_orig_pair);
+    OUTPUT1_IF (tty, tty->TS_orig_pair);
 }
 
 
@@ -2120,46 +1812,61 @@ turn_off_face (f, face_id)
    colors FG and BG.  */
 
 int
-tty_capable_p (f, caps, fg, bg)
-     struct frame *f;
+tty_capable_p (tty, caps, fg, bg)
+     struct tty_display_info *tty;
      unsigned caps;
      unsigned long fg, bg;
 {
-#define TTY_CAPABLE_P_TRY(cap, TS, NC_bit)                             \
-  if ((caps & (cap)) && (!(TS) || !MAY_USE_WITH_COLORS_P(NC_bit)))     \
+#define TTY_CAPABLE_P_TRY(tty, cap, TS, NC_bit)                                \
+  if ((caps & (cap)) && (!(TS) || !MAY_USE_WITH_COLORS_P(tty, NC_bit)))        \
     return 0;
 
-  TTY_CAPABLE_P_TRY (TTY_CAP_INVERSE,  TS_standout_mode,        NC_REVERSE);
-  TTY_CAPABLE_P_TRY (TTY_CAP_UNDERLINE, TS_enter_underline_mode, NC_UNDERLINE);
-  TTY_CAPABLE_P_TRY (TTY_CAP_BOLD,     TS_enter_bold_mode,      NC_BOLD);
-  TTY_CAPABLE_P_TRY (TTY_CAP_DIM,      TS_enter_dim_mode,       NC_DIM);
-  TTY_CAPABLE_P_TRY (TTY_CAP_BLINK,    TS_enter_blink_mode,     NC_BLINK);
-  TTY_CAPABLE_P_TRY (TTY_CAP_ALT_CHARSET, TS_enter_alt_charset_mode, NC_ALT_CHARSET);
+  TTY_CAPABLE_P_TRY (tty, TTY_CAP_INVERSE,     tty->TS_standout_mode,          NC_REVERSE);
+  TTY_CAPABLE_P_TRY (tty, TTY_CAP_UNDERLINE,   tty->TS_enter_underline_mode,   NC_UNDERLINE);
+  TTY_CAPABLE_P_TRY (tty, TTY_CAP_BOLD,        tty->TS_enter_bold_mode,        NC_BOLD);
+  TTY_CAPABLE_P_TRY (tty, TTY_CAP_DIM,                 tty->TS_enter_dim_mode,         NC_DIM);
+  TTY_CAPABLE_P_TRY (tty, TTY_CAP_BLINK,       tty->TS_enter_blink_mode,       NC_BLINK);
+  TTY_CAPABLE_P_TRY (tty, TTY_CAP_ALT_CHARSET,         tty->TS_enter_alt_charset_mode, NC_ALT_CHARSET);
 
   /* We can do it!  */
   return 1;
 }
 
-
 /* Return non-zero if the terminal is capable to display colors.  */
 
 DEFUN ("tty-display-color-p", Ftty_display_color_p, Stty_display_color_p,
        0, 1, 0,
-       doc: /* Return non-nil if TTY can display colors on DISPLAY.  */)
-     (display)
-     Lisp_Object display;
+       doc: /* Return non-nil if the tty device TERMINAL can display colors.
+
+TERMINAL can be a terminal id, a frame or nil (meaning the selected
+frame's terminal).  This function always returns nil if TERMINAL
+is not on a tty device.  */)
+     (terminal)
+     Lisp_Object terminal;
 {
-  return TN_max_colors > 0 ? Qt : Qnil;
+  struct terminal *t = get_tty_terminal (terminal, 0);
+  if (!t)
+    return Qnil;
+  else
+    return t->display_info.tty->TN_max_colors > 0 ? Qt : Qnil;
 }
 
 /* Return the number of supported colors.  */
 DEFUN ("tty-display-color-cells", Ftty_display_color_cells,
        Stty_display_color_cells, 0, 1, 0,
-       doc: /* Return the number of colors supported by TTY on DISPLAY.  */)
-     (display)
-     Lisp_Object display;
+       doc: /* Return the number of colors supported by the tty device TERMINAL.
+
+TERMINAL can be a terminal id, a frame or nil (meaning the selected
+frame's terminal).  This function always returns 0 if TERMINAL
+is not on a tty device.  */)
+     (terminal)
+     Lisp_Object terminal;
 {
-  return make_number (TN_max_colors);
+  struct terminal *t = get_tty_terminal (terminal, 0);
+  if (!t)
+    return make_number (0);
+  else
+    return make_number (t->display_info.tty->TN_max_colors);
 }
 
 #ifndef WINDOWSNT
@@ -2167,8 +1874,7 @@ DEFUN ("tty-display-color-cells", Ftty_display_color_cells,
 /* Save or restore the default color-related capabilities of this
    terminal.  */
 static void
-tty_default_color_capabilities (save)
-     int save;
+tty_default_color_capabilities (struct tty_display_info *tty, int save)
 {
   static char
     *default_orig_pair, *default_set_foreground, *default_set_background;
@@ -2178,40 +1884,39 @@ tty_default_color_capabilities (save)
     {
       if (default_orig_pair)
        xfree (default_orig_pair);
-      default_orig_pair = TS_orig_pair ? xstrdup (TS_orig_pair) : NULL;
+      default_orig_pair = tty->TS_orig_pair ? xstrdup (tty->TS_orig_pair) : NULL;
 
       if (default_set_foreground)
        xfree (default_set_foreground);
-      default_set_foreground = TS_set_foreground ? xstrdup (TS_set_foreground)
+      default_set_foreground = tty->TS_set_foreground ? xstrdup (tty->TS_set_foreground)
                               : NULL;
 
       if (default_set_background)
        xfree (default_set_background);
-      default_set_background = TS_set_background ? xstrdup (TS_set_background)
+      default_set_background = tty->TS_set_background ? xstrdup (tty->TS_set_background)
                               : NULL;
 
-      default_max_colors = TN_max_colors;
-      default_max_pairs = TN_max_pairs;
-      default_no_color_video = TN_no_color_video;
+      default_max_colors = tty->TN_max_colors;
+      default_max_pairs = tty->TN_max_pairs;
+      default_no_color_video = tty->TN_no_color_video;
     }
   else
     {
-      TS_orig_pair = default_orig_pair;
-      TS_set_foreground = default_set_foreground;
-      TS_set_background = default_set_background;
-      TN_max_colors = default_max_colors;
-      TN_max_pairs = default_max_pairs;
-      TN_no_color_video = default_no_color_video;
+      tty->TS_orig_pair = default_orig_pair;
+      tty->TS_set_foreground = default_set_foreground;
+      tty->TS_set_background = default_set_background;
+      tty->TN_max_colors = default_max_colors;
+      tty->TN_max_pairs = default_max_pairs;
+      tty->TN_no_color_video = default_no_color_video;
     }
 }
 
 /* Setup one of the standard tty color schemes according to MODE.
    MODE's value is generally the number of colors which we want to
    support; zero means set up for the default capabilities, the ones
-   we saw at term_init time; -1 means turn off color support.  */
-void
-tty_setup_colors (mode)
-     int mode;
+   we saw at init_tty time; -1 means turn off color support.  */
+static void
+tty_setup_colors (struct tty_display_info *tty, int mode)
 {
   /* Canonicalize all negative values of MODE.  */
   if (mode < -1)
@@ -2220,27 +1925,27 @@ tty_setup_colors (mode)
   switch (mode)
     {
       case -1:  /* no colors at all */
-       TN_max_colors = 0;
-       TN_max_pairs = 0;
-       TN_no_color_video = 0;
-       TS_set_foreground = TS_set_background = TS_orig_pair = NULL;
+       tty->TN_max_colors = 0;
+       tty->TN_max_pairs = 0;
+       tty->TN_no_color_video = 0;
+       tty->TS_set_foreground = tty->TS_set_background = tty->TS_orig_pair = NULL;
        break;
       case 0:   /* default colors, if any */
       default:
-       tty_default_color_capabilities (0);
+       tty_default_color_capabilities (tty, 0);
        break;
       case 8:  /* 8 standard ANSI colors */
-       TS_orig_pair = "\033[0m";
+       tty->TS_orig_pair = "\033[0m";
 #ifdef TERMINFO
-       TS_set_foreground = "\033[3%p1%dm";
-       TS_set_background = "\033[4%p1%dm";
+       tty->TS_set_foreground = "\033[3%p1%dm";
+       tty->TS_set_background = "\033[4%p1%dm";
 #else
-       TS_set_foreground = "\033[3%dm";
-       TS_set_background = "\033[4%dm";
+       tty->TS_set_foreground = "\033[3%dm";
+       tty->TS_set_background = "\033[4%dm";
 #endif
-       TN_max_colors = 8;
-       TN_max_pairs = 64;
-       TN_no_color_video = 0;
+       tty->TN_max_colors = 8;
+       tty->TN_max_pairs = 64;
+       tty->TN_no_color_video = 0;
        break;
     }
 }
@@ -2291,7 +1996,7 @@ set_tty_color_mode (f, val)
 
   if (mode != old_mode)
     {
-      tty_setup_colors (mode);
+      tty_setup_colors (FRAME_TTY (f), mode);
       /*  This recomputes all the faces given the new color
          definitions.  */
       call0 (intern ("tty-set-up-initial-frame-faces"));
@@ -2302,85 +2007,569 @@ set_tty_color_mode (f, val)
 #endif /* !WINDOWSNT */
 
 \f
+
+/* Return the tty display object specified by TERMINAL. */
+
+struct terminal *
+get_tty_terminal (Lisp_Object terminal, int throw)
+{
+  struct terminal *t = get_terminal (terminal, throw);
+
+  if (t && t->type == output_initial)
+    return NULL;
+
+  if (t && t->type != output_termcap)
+    {
+      if (throw)
+        error ("Device %d is not a termcap terminal device", t->id);
+      else
+        return NULL;
+    }
+
+  return t;
+}
+
+/* Return an active termcap device that uses the tty device with the
+   given name.
+
+   This function ignores suspended devices.
+
+   Returns NULL if the named terminal device is not opened.  */
+struct terminal *
+get_named_tty (name)
+     char *name;
+{
+  struct terminal *t;
+
+  if (!name)
+    abort ();
+
+  for (t = terminal_list; t; t = t->next_terminal)
+    {
+      if (t->type == output_termcap
+          && !strcmp (t->display_info.tty->name, name)
+          && TERMINAL_ACTIVE_P (t))
+        return t;
+    }
+
+  return 0;
+}
+
+\f
+DEFUN ("tty-type", Ftty_type, Stty_type, 0, 1, 0,
+       doc: /* Return the type of the tty device that TERMINAL uses.
+Returns nil if TERMINAL is not on a tty device.
+
+TERMINAL can be a terminal id, a frame or nil (meaning the selected
+frame's terminal).  */)
+     (terminal)
+     Lisp_Object terminal;
+{
+  struct terminal *t = get_terminal (terminal, 1);
+
+  if (t->type != output_termcap)
+    return Qnil;
+
+  if (t->display_info.tty->type)
+    return build_string (t->display_info.tty->type);
+  else
+    return Qnil;
+}
+
+DEFUN ("controlling-tty-p", Fcontrolling_tty_p, Scontrolling_tty_p, 0, 1, 0,
+       doc: /* Return non-nil if TERMINAL is on the controlling tty of the Emacs process.
+
+TERMINAL can be a terminal id, a frame or nil (meaning the selected
+frame's terminal).  This function always returns nil if TERMINAL
+is not on a tty device.  */)
+     (terminal)
+     Lisp_Object terminal;
+{
+  struct terminal *t = get_terminal (terminal, 1);
+
+  if (t->type != output_termcap || strcmp (t->display_info.tty->name, "/dev/tty"))
+    return Qnil;
+  else
+    return Qt;
+}
+
+DEFUN ("tty-no-underline", Ftty_no_underline, Stty_no_underline, 0, 1, 0,
+       doc: /* Declare that the tty used by TERMINAL does not handle underlining.
+This is used to override the terminfo data, for certain terminals that
+do not really do underlining, but say that they do.  This function has
+no effect if used on a non-tty terminal.
+
+TERMINAL can be a terminal id, a frame or nil (meaning the selected
+frame's terminal).  This function always returns nil if TERMINAL
+is not on a tty device.  */)
+  (terminal)
+     Lisp_Object terminal;
+{
+  struct terminal *t = get_terminal (terminal, 1);
+
+  if (t->type == output_termcap)
+    t->display_info.tty->TS_enter_underline_mode = 0;
+  return Qnil;
+}
+
+\f
+
+DEFUN ("suspend-tty", Fsuspend_tty, Ssuspend_tty, 0, 1, 0,
+       doc: /* Suspend the terminal device TTY.
+
+The device is restored to its default state, and Emacs ceases all
+access to the tty device.  Frames that use the device are not deleted,
+but input is not read from them and if they change, their display is
+not updated.
+
+TTY may be a terminal id, a frame, or nil for the terminal device of
+the currently selected frame.
+
+This function runs `suspend-tty-functions' after suspending the
+device.  The functions are run with one arg, the id of the suspended
+terminal device.
+
+`suspend-tty' does nothing if it is called on a device that is already
+suspended.
+
+A suspended tty may be resumed by calling `resume-tty' on it.  */)
+     (tty)
+     Lisp_Object tty;
+{
+  struct terminal *t = get_tty_terminal (tty, 1);
+  FILE *f;
+  
+  if (!t)
+    error ("Unknown tty device");
+
+  f = t->display_info.tty->input;
+  
+  if (f)
+    {
+      reset_sys_modes (t->display_info.tty);
+
+      delete_keyboard_wait_descriptor (fileno (f));
+      
+      fclose (f);
+      if (f != t->display_info.tty->output)
+        fclose (t->display_info.tty->output);
+      
+      t->display_info.tty->input = 0;
+      t->display_info.tty->output = 0;
+
+      if (FRAMEP (t->display_info.tty->top_frame))
+        FRAME_SET_VISIBLE (XFRAME (t->display_info.tty->top_frame), 0);
+      
+      /* Run `suspend-tty-functions'.  */
+      if (!NILP (Vrun_hooks))
+        {
+          Lisp_Object args[2];
+          args[0] = intern ("suspend-tty-functions");
+          args[1] = make_number (t->id);
+          Frun_hook_with_args (2, args);
+        }
+    }
+
+  /* Clear display hooks to prevent further output.  */
+  clear_tty_hooks (t);
+
+  return Qnil;
+}
+
+DEFUN ("resume-tty", Fresume_tty, Sresume_tty, 0, 1, 0,
+       doc: /* Resume the previously suspended terminal device TTY.
+The terminal is opened and reinitialized.  Frames that are on the
+suspended terminal are revived.
+
+It is an error to resume a terminal while another terminal is active
+on the same device.
+
+This function runs `resume-tty-functions' after resuming the terminal.
+The functions are run with one arg, the id of the resumed terminal
+device.
+
+`resume-tty' does nothing if it is called on a device that is not
+suspended.
+
+TTY may be a terminal id, a frame, or nil for the terminal device of
+the currently selected frame. */)
+     (tty)
+     Lisp_Object tty;
+{
+  struct terminal *t = get_tty_terminal (tty, 1);
+  int fd;
+
+  if (!t)
+    error ("Unknown tty device");
+
+  if (!t->display_info.tty->input)
+    {
+      if (get_named_tty (t->display_info.tty->name))
+        error ("Cannot resume display while another display is active on the same device");
+
+      fd = emacs_open (t->display_info.tty->name, O_RDWR | O_NOCTTY, 0);
+
+      if (fd == -1)
+        error ("Can not reopen tty device %s: %s", t->display_info.tty->name, strerror (errno));
+
+      if (strcmp (t->display_info.tty->name, "/dev/tty"))
+        dissociate_if_controlling_tty (fd);
+      
+      t->display_info.tty->output = fdopen (fd, "w+");
+      t->display_info.tty->input = t->display_info.tty->output;
+    
+      add_keyboard_wait_descriptor (fd);
+
+      if (FRAMEP (t->display_info.tty->top_frame))
+        FRAME_SET_VISIBLE (XFRAME (t->display_info.tty->top_frame), 1);
+
+      init_sys_modes (t->display_info.tty);
+
+      /* Run `suspend-tty-functions'.  */
+      if (!NILP (Vrun_hooks))
+        {
+          Lisp_Object args[2];
+          args[0] = intern ("resume-tty-functions");
+          args[1] = make_number (t->id);
+          Frun_hook_with_args (2, args);
+        }
+    }
+
+  set_tty_hooks (t);
+
+  return Qnil;
+}
+
+\f
 /***********************************************************************
                            Initialization
  ***********************************************************************/
 
+/* Initialize the tty-dependent part of frame F.  The frame must
+   already have its device initialized. */
+
 void
-term_init (terminal_type)
-     char *terminal_type;
+create_tty_output (struct frame *f)
+{
+  struct tty_output *t;
+
+  if (! FRAME_TERMCAP_P (f))
+    abort ();
+
+  t = xmalloc (sizeof (struct tty_output));
+  bzero (t, sizeof (struct tty_output));
+
+  t->display_info = FRAME_TERMINAL (f)->display_info.tty;
+
+  f->output_data.tty = t;
+}
+
+/* Delete the tty-dependent part of frame F. */
+
+static void
+delete_tty_output (struct frame *f)
+{
+  if (! FRAME_TERMCAP_P (f))
+    abort ();
+
+  xfree (f->output_data.tty);
+}
+
+\f
+
+static void
+clear_tty_hooks (struct terminal *terminal)
 {
-  char *area;
+  terminal->rif = 0;
+  terminal->cursor_to_hook = 0;
+  terminal->raw_cursor_to_hook = 0;
+  terminal->clear_to_end_hook = 0;
+  terminal->clear_frame_hook = 0;
+  terminal->clear_end_of_line_hook = 0;
+  terminal->ins_del_lines_hook = 0;
+  terminal->insert_glyphs_hook = 0;
+  terminal->write_glyphs_hook = 0;
+  terminal->delete_glyphs_hook = 0;
+  terminal->ring_bell_hook = 0;
+  terminal->reset_terminal_modes_hook = 0;
+  terminal->set_terminal_modes_hook = 0;
+  terminal->update_begin_hook = 0;
+  terminal->update_end_hook = 0;
+  terminal->set_terminal_window_hook = 0;
+  terminal->mouse_position_hook = 0;
+  terminal->frame_rehighlight_hook = 0;
+  terminal->frame_raise_lower_hook = 0;
+  terminal->fullscreen_hook = 0;
+  terminal->set_vertical_scroll_bar_hook = 0;
+  terminal->condemn_scroll_bars_hook = 0;
+  terminal->redeem_scroll_bar_hook = 0;
+  terminal->judge_scroll_bars_hook = 0;
+  terminal->read_socket_hook = 0;
+  terminal->frame_up_to_date_hook = 0;
+
+  /* Leave these two set, or suspended frames are not deleted
+     correctly.  */
+  terminal->delete_frame_hook = &delete_tty_output;
+  terminal->delete_terminal_hook = &delete_tty;
+}
+
+static void
+set_tty_hooks (struct terminal *terminal)
+{
+  terminal->rif = 0; /* ttys don't support window-based redisplay. */
+
+  terminal->cursor_to_hook = &tty_cursor_to;
+  terminal->raw_cursor_to_hook = &tty_raw_cursor_to;
+
+  terminal->clear_to_end_hook = &tty_clear_to_end;
+  terminal->clear_frame_hook = &tty_clear_frame;
+  terminal->clear_end_of_line_hook = &tty_clear_end_of_line;
+
+  terminal->ins_del_lines_hook = &tty_ins_del_lines;
+
+  terminal->insert_glyphs_hook = &tty_insert_glyphs;
+  terminal->write_glyphs_hook = &tty_write_glyphs;
+  terminal->delete_glyphs_hook = &tty_delete_glyphs;
+
+  terminal->ring_bell_hook = &tty_ring_bell;
+  
+  terminal->reset_terminal_modes_hook = &tty_reset_terminal_modes;
+  terminal->set_terminal_modes_hook = &tty_set_terminal_modes;
+  terminal->update_begin_hook = 0; /* Not needed. */
+  terminal->update_end_hook = &tty_update_end;
+  terminal->set_terminal_window_hook = &tty_set_terminal_window;
+
+  terminal->mouse_position_hook = 0; /* Not needed. */
+  terminal->frame_rehighlight_hook = 0; /* Not needed. */
+  terminal->frame_raise_lower_hook = 0; /* Not needed. */
+
+  terminal->set_vertical_scroll_bar_hook = 0; /* Not needed. */
+  terminal->condemn_scroll_bars_hook = 0; /* Not needed. */
+  terminal->redeem_scroll_bar_hook = 0; /* Not needed. */
+  terminal->judge_scroll_bars_hook = 0; /* Not needed. */
+
+  terminal->read_socket_hook = &tty_read_avail_input; /* keyboard.c */
+  terminal->frame_up_to_date_hook = 0; /* Not needed. */
+  
+  terminal->delete_frame_hook = &delete_tty_output;
+  terminal->delete_terminal_hook = &delete_tty;
+}
+
+/* Drop the controlling terminal if fd is the same device. */
+static void
+dissociate_if_controlling_tty (int fd)
+{
+  int pgid;
+  EMACS_GET_TTY_PGRP (fd, &pgid); /* If tcgetpgrp succeeds, fd is the ctty. */
+  if (pgid != -1)
+    {
+#if defined (USG) && !defined (BSD_PGRPS)
+      setpgrp ();
+      no_controlling_tty = 1;
+#else
+#ifdef TIOCNOTTY                /* Try BSD ioctls. */
+      sigblock (sigmask (SIGTTOU));
+      fd = emacs_open ("/dev/tty", O_RDWR, 0);
+      if (fd != -1 && ioctl (fd, TIOCNOTTY, 0) != -1)
+        {
+          no_controlling_tty = 1;
+        }
+      if (fd != -1)
+        emacs_close (fd);
+      sigunblock (sigmask (SIGTTOU));
+#else
+      /* Unknown system. */
+      croak ();
+#endif  /* ! TIOCNOTTY */
+#endif  /* ! USG */
+    }
+}
+
+static void maybe_fatal();
+
+/* Create a termcap display on the tty device with the given name and
+   type.
+
+   If NAME is NULL, then use the controlling tty, i.e., "/dev/tty".
+   Otherwise NAME should be a path to the tty device file,
+   e.g. "/dev/pts/7".
+
+   TERMINAL_TYPE is the termcap type of the device, e.g. "vt100".
+
+   If MUST_SUCCEED is true, then all errors are fatal. */
+
+struct terminal *
+init_tty (char *name, char *terminal_type, int must_succeed)
+{
+  char *area = NULL;
   char **address = &area;
   char *buffer = NULL;
   int buffer_size = 4096;
-  register char *p;
+  register char *p = NULL;
   int status;
-  struct frame *sf = XFRAME (selected_frame);
+  struct tty_display_info *tty = NULL;
+  struct terminal *terminal = NULL;
+  int ctty = 0;                 /* 1 if asked to open controlling tty. */
+
+  if (!terminal_type)
+    maybe_fatal (must_succeed, 0, 0,
+                 "Unknown terminal type",
+                 "Unknown terminal type");
+
+  if (name == NULL)
+    name = "/dev/tty";
+  if (!strcmp (name, "/dev/tty"))
+    ctty = 1;
+
+  /* If we already have a terminal on the given device, use that.  If
+     all such terminals are suspended, create a new one instead.  */
+  /* XXX Perhaps this should be made explicit by having init_tty
+     always create a new terminal and separating terminal and frame
+     creation on Lisp level.  */
+  terminal = get_named_tty (name);
+  if (terminal)
+    return terminal;
+
+  terminal = create_terminal ();
+  tty = (struct tty_display_info *) xmalloc (sizeof (struct tty_display_info));
+  bzero (tty, sizeof (struct tty_display_info));
+  tty->next = tty_list;
+  tty_list = tty;
+
+  terminal->type = output_termcap;
+  terminal->display_info.tty = tty;
+  tty->terminal = terminal;
+
+  tty->Wcm = (struct cm *) xmalloc (sizeof (struct cm));
+  Wcm_clear (tty);
+
+  set_tty_hooks (terminal);
+  
+  {
+    int fd;
+    FILE *file;
+
+#ifdef O_IGNORE_CTTY
+    if (!ctty)
+      /* Open the terminal device.  Don't recognize it as our
+         controlling terminal, and don't make it the controlling tty
+         if we don't have one at the moment.  */
+      fd = emacs_open (name, O_RDWR | O_IGNORE_CTTY | O_NOCTTY, 0);
+    else
+#else
+      /* Alas, O_IGNORE_CTTY is a GNU extension that seems to be only
+         defined on Hurd.  On other systems, we need to explicitly
+         dissociate ourselves from the controlling tty when we want to
+         open a frame on the same terminal.  */
+      fd = emacs_open (name, O_RDWR | O_NOCTTY, 0);
+#endif /* O_IGNORE_CTTY */
+
+    if (fd < 0)
+      maybe_fatal (must_succeed, buffer, terminal,
+                   "Could not open file: %s",
+                   "Could not open file: %s",
+                   name);
+    if (!isatty (fd))
+      {
+        close (fd);
+        maybe_fatal (must_succeed, buffer, terminal,
+                     "Not a tty device: %s",
+                     "Not a tty device: %s",
+                     name);
+      }
+
+#ifndef O_IGNORE_CTTY
+    if (!ctty)
+      dissociate_if_controlling_tty (fd);
+#endif
+
+    file = fdopen (fd, "w+");
+    tty->name = xstrdup (name);
+    terminal->name = xstrdup (name);
+    tty->input = file;
+    tty->output = file;
+  }
+
+  tty->type = xstrdup (terminal_type);
+
+  add_keyboard_wait_descriptor (fileno (tty->input));
 
   encode_terminal_bufsize = 0;
 
 #ifdef WINDOWSNT
   initialize_w32_display ();
 
-  Wcm_clear ();
+  Wcm_clear (tty);
 
   area = (char *) xmalloc (2044);
 
-  FrameRows = FRAME_LINES (sf);
-  FrameCols = FRAME_COLS (sf);
-  specified_window = FRAME_LINES (sf);
+  FrameRows (tty) = FRAME_LINES (f); /* XXX */
+  FrameCols (tty) = FRAME_COLS (f);  /* XXX */
+  tty->specified_window = FRAME_LINES (f); /* XXX */
 
-  delete_in_insert_mode = 1;
+  tty->terminal->delete_in_insert_mode = 1;
 
-  UseTabs = 0;
-  scroll_region_ok = 0;
+  UseTabs (tty) = 0;
+  terminal->scroll_region_ok = 0;
 
-  /* Seems to insert lines when it's not supposed to, messing
-     up the display.  In doing a trace, it didn't seem to be
-     called much, so I don't think we're losing anything by
-     turning it off.  */
-
-  line_ins_del_ok = 0;
-  char_ins_del_ok = 1;
+  /* Seems to insert lines when it's not supposed to, messing up the
+     display.  In doing a trace, it didn't seem to be called much, so I
+     don't think we're losing anything by turning it off.  */
+  terminal->line_ins_del_ok = 0;
+  terminal->char_ins_del_ok = 1;
 
   baud_rate = 19200;
 
-  FRAME_CAN_HAVE_SCROLL_BARS (sf) = 0;
-  FRAME_VERTICAL_SCROLL_BAR_TYPE (sf) = vertical_scroll_bar_none;
+  FRAME_CAN_HAVE_SCROLL_BARS (f) = 0; /* XXX */
+  FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none; /* XXX */
   TN_max_colors = 16;  /* Required to be non-zero for tty-display-color-p */
 
-  return;
+  return terminal;
 #else  /* not WINDOWSNT */
 
-  Wcm_clear ();
+  Wcm_clear (tty);
 
   buffer = (char *) xmalloc (buffer_size);
+  
+  /* On some systems, tgetent tries to access the controlling
+     terminal. */
+  sigblock (sigmask (SIGTTOU));
   status = tgetent (buffer, terminal_type);
+  sigunblock (sigmask (SIGTTOU));
+  
   if (status < 0)
     {
 #ifdef TERMINFO
-      fatal ("Cannot open terminfo database file");
+      maybe_fatal (must_succeed, buffer, terminal,
+                   "Cannot open terminfo database file",
+                   "Cannot open terminfo database file");
 #else
-      fatal ("Cannot open termcap database file");
+      maybe_fatal (must_succeed, buffer, terminal,
+                   "Cannot open termcap database file",
+                   "Cannot open termcap database file");
 #endif
     }
   if (status == 0)
     {
 #ifdef TERMINFO
-      fatal ("Terminal type %s is not defined.\n\
+      maybe_fatal (must_succeed, buffer, terminal,
+                   "Terminal type %s is not defined",
+                   "Terminal type %s is not defined.\n\
 If that is not the actual type of terminal you have,\n\
 use the Bourne shell command `TERM=... export TERM' (C-shell:\n\
 `setenv TERM ...') to specify the correct type.  It may be necessary\n\
 to do `unset TERMINFO' (C-shell: `unsetenv TERMINFO') as well.",
-            terminal_type);
+                   terminal_type);
 #else
-      fatal ("Terminal type %s is not defined.\n\
+      maybe_fatal (must_succeed, buffer, terminal,
+                   "Terminal type %s is not defined",
+                   "Terminal type %s is not defined.\n\
 If that is not the actual type of terminal you have,\n\
 use the Bourne shell command `TERM=... export TERM' (C-shell:\n\
 `setenv TERM ...') to specify the correct type.  It may be necessary\n\
 to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.",
-            terminal_type);
+                   terminal_type);
 #endif
     }
 
@@ -2391,219 +2580,234 @@ to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.",
 #endif
   area = (char *) xmalloc (buffer_size);
 
-  TS_ins_line = tgetstr ("al", address);
-  TS_ins_multi_lines = tgetstr ("AL", address);
-  TS_bell = tgetstr ("bl", address);
-  BackTab = tgetstr ("bt", address);
-  TS_clr_to_bottom = tgetstr ("cd", address);
-  TS_clr_line = tgetstr ("ce", address);
-  TS_clr_frame = tgetstr ("cl", address);
-  ColPosition = NULL; /* tgetstr ("ch", address); */
-  AbsPosition = tgetstr ("cm", address);
-  CR = tgetstr ("cr", address);
-  TS_set_scroll_region = tgetstr ("cs", address);
-  TS_set_scroll_region_1 = tgetstr ("cS", address);
-  RowPosition = tgetstr ("cv", address);
-  TS_del_char = tgetstr ("dc", address);
-  TS_del_multi_chars = tgetstr ("DC", address);
-  TS_del_line = tgetstr ("dl", address);
-  TS_del_multi_lines = tgetstr ("DL", address);
-  TS_delete_mode = tgetstr ("dm", address);
-  TS_end_delete_mode = tgetstr ("ed", address);
-  TS_end_insert_mode = tgetstr ("ei", address);
-  Home = tgetstr ("ho", address);
-  TS_ins_char = tgetstr ("ic", address);
-  TS_ins_multi_chars = tgetstr ("IC", address);
-  TS_insert_mode = tgetstr ("im", address);
-  TS_pad_inserted_char = tgetstr ("ip", address);
-  TS_end_keypad_mode = tgetstr ("ke", address);
-  TS_keypad_mode = tgetstr ("ks", address);
-  LastLine = tgetstr ("ll", address);
-  Right = tgetstr ("nd", address);
-  Down = tgetstr ("do", address);
-  if (!Down)
-    Down = tgetstr ("nl", address); /* Obsolete name for "do" */
+  tty->TS_ins_line = tgetstr ("al", address);
+  tty->TS_ins_multi_lines = tgetstr ("AL", address);
+  tty->TS_bell = tgetstr ("bl", address);
+  BackTab (tty) = tgetstr ("bt", address);
+  tty->TS_clr_to_bottom = tgetstr ("cd", address);
+  tty->TS_clr_line = tgetstr ("ce", address);
+  tty->TS_clr_frame = tgetstr ("cl", address);
+  ColPosition (tty) = NULL; /* tgetstr ("ch", address); */
+  AbsPosition (tty) = tgetstr ("cm", address);
+  CR (tty) = tgetstr ("cr", address);
+  tty->TS_set_scroll_region = tgetstr ("cs", address);
+  tty->TS_set_scroll_region_1 = tgetstr ("cS", address);
+  RowPosition (tty) = tgetstr ("cv", address);
+  tty->TS_del_char = tgetstr ("dc", address);
+  tty->TS_del_multi_chars = tgetstr ("DC", address);
+  tty->TS_del_line = tgetstr ("dl", address);
+  tty->TS_del_multi_lines = tgetstr ("DL", address);
+  tty->TS_delete_mode = tgetstr ("dm", address);
+  tty->TS_end_delete_mode = tgetstr ("ed", address);
+  tty->TS_end_insert_mode = tgetstr ("ei", address);
+  Home (tty) = tgetstr ("ho", address);
+  tty->TS_ins_char = tgetstr ("ic", address);
+  tty->TS_ins_multi_chars = tgetstr ("IC", address);
+  tty->TS_insert_mode = tgetstr ("im", address);
+  tty->TS_pad_inserted_char = tgetstr ("ip", address);
+  tty->TS_end_keypad_mode = tgetstr ("ke", address);
+  tty->TS_keypad_mode = tgetstr ("ks", address);
+  LastLine (tty) = tgetstr ("ll", address);
+  Right (tty) = tgetstr ("nd", address);
+  Down (tty) = tgetstr ("do", address);
+  if (!Down (tty))
+    Down (tty) = tgetstr ("nl", address); /* Obsolete name for "do" */
 #ifdef VMS
   /* VMS puts a carriage return before each linefeed,
      so it is not safe to use linefeeds.  */
-  if (Down && Down[0] == '\n' && Down[1] == '\0')
-    Down = 0;
+  if (Down (tty) && Down (tty)[0] == '\n' && Down (tty)[1] == '\0')
+    Down (tty) = 0;
 #endif /* VMS */
   if (tgetflag ("bs"))
-    Left = "\b";                 /* can't possibly be longer! */
+    Left (tty) = "\b";           /* can't possibly be longer! */
   else                           /* (Actually, "bs" is obsolete...) */
-    Left = tgetstr ("le", address);
-  if (!Left)
-    Left = tgetstr ("bc", address); /* Obsolete name for "le" */
-  TS_pad_char = tgetstr ("pc", address);
-  TS_repeat = tgetstr ("rp", address);
-  TS_end_standout_mode = tgetstr ("se", address);
-  TS_fwd_scroll = tgetstr ("sf", address);
-  TS_standout_mode = tgetstr ("so", address);
-  TS_rev_scroll = tgetstr ("sr", address);
-  Wcm.cm_tab = tgetstr ("ta", address);
-  TS_end_termcap_modes = tgetstr ("te", address);
-  TS_termcap_modes = tgetstr ("ti", address);
-  Up = tgetstr ("up", address);
-  TS_visible_bell = tgetstr ("vb", address);
-  TS_cursor_normal = tgetstr ("ve", address);
-  TS_cursor_visible = tgetstr ("vs", address);
-  TS_cursor_invisible = tgetstr ("vi", address);
-  TS_set_window = tgetstr ("wi", address);
-
-  TS_enter_underline_mode = tgetstr ("us", address);
-  TS_exit_underline_mode = tgetstr ("ue", address);
-  TS_enter_bold_mode = tgetstr ("md", address);
-  TS_enter_dim_mode = tgetstr ("mh", address);
-  TS_enter_blink_mode = tgetstr ("mb", address);
-  TS_enter_reverse_mode = tgetstr ("mr", address);
-  TS_enter_alt_charset_mode = tgetstr ("as", address);
-  TS_exit_alt_charset_mode = tgetstr ("ae", address);
-  TS_exit_attribute_mode = tgetstr ("me", address);
-
-  MultiUp = tgetstr ("UP", address);
-  MultiDown = tgetstr ("DO", address);
-  MultiLeft = tgetstr ("LE", address);
-  MultiRight = tgetstr ("RI", address);
+    Left (tty) = tgetstr ("le", address);
+  if (!Left (tty))
+    Left (tty) = tgetstr ("bc", address); /* Obsolete name for "le" */
+  tty->TS_pad_char = tgetstr ("pc", address);
+  tty->TS_repeat = tgetstr ("rp", address);
+  tty->TS_end_standout_mode = tgetstr ("se", address);
+  tty->TS_fwd_scroll = tgetstr ("sf", address);
+  tty->TS_standout_mode = tgetstr ("so", address);
+  tty->TS_rev_scroll = tgetstr ("sr", address);
+  tty->Wcm->cm_tab = tgetstr ("ta", address);
+  tty->TS_end_termcap_modes = tgetstr ("te", address);
+  tty->TS_termcap_modes = tgetstr ("ti", address);
+  Up (tty) = tgetstr ("up", address);
+  tty->TS_visible_bell = tgetstr ("vb", address);
+  tty->TS_cursor_normal = tgetstr ("ve", address);
+  tty->TS_cursor_visible = tgetstr ("vs", address);
+  tty->TS_cursor_invisible = tgetstr ("vi", address);
+  tty->TS_set_window = tgetstr ("wi", address);
+
+  tty->TS_enter_underline_mode = tgetstr ("us", address);
+  tty->TS_exit_underline_mode = tgetstr ("ue", address);
+  tty->TS_enter_bold_mode = tgetstr ("md", address);
+  tty->TS_enter_dim_mode = tgetstr ("mh", address);
+  tty->TS_enter_blink_mode = tgetstr ("mb", address);
+  tty->TS_enter_reverse_mode = tgetstr ("mr", address);
+  tty->TS_enter_alt_charset_mode = tgetstr ("as", address);
+  tty->TS_exit_alt_charset_mode = tgetstr ("ae", address);
+  tty->TS_exit_attribute_mode = tgetstr ("me", address);
+
+  MultiUp (tty) = tgetstr ("UP", address);
+  MultiDown (tty) = tgetstr ("DO", address);
+  MultiLeft (tty) = tgetstr ("LE", address);
+  MultiRight (tty) = tgetstr ("RI", address);
 
   /* SVr4/ANSI color suppert.  If "op" isn't available, don't support
      color because we can't switch back to the default foreground and
      background.  */
-  TS_orig_pair = tgetstr ("op", address);
-  if (TS_orig_pair)
+  tty->TS_orig_pair = tgetstr ("op", address);
+  if (tty->TS_orig_pair)
     {
-      TS_set_foreground = tgetstr ("AF", address);
-      TS_set_background = tgetstr ("AB", address);
-      if (!TS_set_foreground)
+      tty->TS_set_foreground = tgetstr ("AF", address);
+      tty->TS_set_background = tgetstr ("AB", address);
+      if (!tty->TS_set_foreground)
        {
          /* SVr4.  */
-         TS_set_foreground = tgetstr ("Sf", address);
-         TS_set_background = tgetstr ("Sb", address);
+         tty->TS_set_foreground = tgetstr ("Sf", address);
+         tty->TS_set_background = tgetstr ("Sb", address);
        }
 
-      TN_max_colors = tgetnum ("Co");
-      TN_max_pairs = tgetnum ("pa");
+      tty->TN_max_colors = tgetnum ("Co");
+      tty->TN_max_pairs = tgetnum ("pa");
 
-      TN_no_color_video = tgetnum ("NC");
-      if (TN_no_color_video == -1)
-       TN_no_color_video = 0;
+      tty->TN_no_color_video = tgetnum ("NC");
+      if (tty->TN_no_color_video == -1)
+        tty->TN_no_color_video = 0;
     }
 
-  tty_default_color_capabilities (1);
+  tty_default_color_capabilities (tty, 1);
 
-  MagicWrap = tgetflag ("xn");
+  MagicWrap (tty) = tgetflag ("xn");
   /* Since we make MagicWrap terminals look like AutoWrap, we need to have
      the former flag imply the latter.  */
-  AutoWrap = MagicWrap || tgetflag ("am");
-  memory_below_frame = tgetflag ("db");
-  TF_hazeltine = tgetflag ("hz");
-  must_write_spaces = tgetflag ("in");
-  meta_key = tgetflag ("km") || tgetflag ("MT");
-  TF_insmode_motion = tgetflag ("mi");
-  TF_standout_motion = tgetflag ("ms");
-  TF_underscore = tgetflag ("ul");
-  TF_teleray = tgetflag ("xt");
-
-  term_get_fkeys (address);
+  AutoWrap (tty) = MagicWrap (tty) || tgetflag ("am");
+  terminal->memory_below_frame = tgetflag ("db");
+  tty->TF_hazeltine = tgetflag ("hz");
+  terminal->must_write_spaces = tgetflag ("in");
+  tty->meta_key = tgetflag ("km") || tgetflag ("MT");
+  tty->TF_insmode_motion = tgetflag ("mi");
+  tty->TF_standout_motion = tgetflag ("ms");
+  tty->TF_underscore = tgetflag ("ul");
+  tty->TF_teleray = tgetflag ("xt");
+
+#ifdef MULTI_KBOARD
+  terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
+  init_kboard (terminal->kboard);
+  terminal->kboard->next_kboard = all_kboards;
+  all_kboards = terminal->kboard;
+  terminal->kboard->reference_count++;
+  /* Don't let the initial kboard remain current longer than necessary.
+     That would cause problems if a file loaded on startup tries to
+     prompt in the mini-buffer.  */
+  if (current_kboard == initial_kboard)
+    current_kboard = terminal->kboard;
+#endif
+
+  term_get_fkeys (address, terminal->kboard);
 
   /* Get frame size from system, or else from termcap.  */
   {
     int height, width;
-    get_frame_size (&width, &height);
-    FRAME_COLS (sf) = width;
-    FRAME_LINES (sf) = height;
+    get_tty_size (fileno (tty->input), &width, &height);
+    FrameCols (tty) = width;
+    FrameRows (tty) = height;
   }
 
-  if (FRAME_COLS (sf) <= 0)
-    SET_FRAME_COLS (sf, tgetnum ("co"));
-  else
-    /* Keep width and external_width consistent */
-    SET_FRAME_COLS (sf, FRAME_COLS (sf));
-  if (FRAME_LINES (sf) <= 0)
-    FRAME_LINES (sf) = tgetnum ("li");
+  if (FrameCols (tty) <= 0)
+    FrameCols (tty) = tgetnum ("co");
+  if (FrameRows (tty) <= 0)
+    FrameRows (tty) = tgetnum ("li");
+
+  if (FrameRows (tty) < 3 || FrameCols (tty) < 3)
+    maybe_fatal (must_succeed, NULL, terminal,
+                 "Screen size %dx%d is too small"
+                 "Screen size %dx%d is too small",
+                 FrameCols (tty), FrameRows (tty));
 
-  if (FRAME_LINES (sf) < 3 || FRAME_COLS (sf) < 3)
-    fatal ("Screen size %dx%d is too small",
-          FRAME_LINES (sf), FRAME_COLS (sf));
+#if 0  /* This is not used anywhere. */
+  tty->terminal->min_padding_speed = tgetnum ("pb");
+#endif
 
-  min_padding_speed = tgetnum ("pb");
-  TabWidth = tgetnum ("tw");
+  TabWidth (tty) = tgetnum ("tw");
 
 #ifdef VMS
   /* These capabilities commonly use ^J.
      I don't know why, but sending them on VMS does not work;
      it causes following spaces to be lost, sometimes.
      For now, the simplest fix is to avoid using these capabilities ever.  */
-  if (Down && Down[0] == '\n')
-    Down = 0;
+  if (Down (tty) && Down (tty)[0] == '\n')
+    Down (tty) = 0;
 #endif /* VMS */
 
-  if (!TS_bell)
-    TS_bell = "\07";
+  if (!tty->TS_bell)
+    tty->TS_bell = "\07";
 
-  if (!TS_fwd_scroll)
-    TS_fwd_scroll = Down;
+  if (!tty->TS_fwd_scroll)
+    tty->TS_fwd_scroll = Down (tty);
 
-  PC = TS_pad_char ? *TS_pad_char : 0;
+  PC = tty->TS_pad_char ? *tty->TS_pad_char : 0;
 
-  if (TabWidth < 0)
-    TabWidth = 8;
+  if (TabWidth (tty) < 0)
+    TabWidth (tty) = 8;
 
 /* Turned off since /etc/termcap seems to have :ta= for most terminals
    and newer termcap doc does not seem to say there is a default.
-  if (!Wcm.cm_tab)
-    Wcm.cm_tab = "\t";
+  if (!tty->Wcm->cm_tab)
+    tty->Wcm->cm_tab = "\t";
 */
 
   /* We don't support standout modes that use `magic cookies', so
      turn off any that do.  */
-  if (TS_standout_mode && tgetnum ("sg") >= 0)
+  if (tty->TS_standout_mode && tgetnum ("sg") >= 0)
     {
-      TS_standout_mode = 0;
-      TS_end_standout_mode = 0;
+      tty->TS_standout_mode = 0;
+      tty->TS_end_standout_mode = 0;
     }
-  if (TS_enter_underline_mode && tgetnum ("ug") >= 0)
+  if (tty->TS_enter_underline_mode && tgetnum ("ug") >= 0)
     {
-      TS_enter_underline_mode = 0;
-      TS_exit_underline_mode = 0;
+      tty->TS_enter_underline_mode = 0;
+      tty->TS_exit_underline_mode = 0;
     }
 
   /* If there's no standout mode, try to use underlining instead.  */
-  if (TS_standout_mode == 0)
+  if (tty->TS_standout_mode == 0)
     {
-      TS_standout_mode = TS_enter_underline_mode;
-      TS_end_standout_mode = TS_exit_underline_mode;
+      tty->TS_standout_mode = tty->TS_enter_underline_mode;
+      tty->TS_end_standout_mode = tty->TS_exit_underline_mode;
     }
 
   /* If no `se' string, try using a `me' string instead.
      If that fails, we can't use standout mode at all.  */
-  if (TS_end_standout_mode == 0)
+  if (tty->TS_end_standout_mode == 0)
     {
       char *s = tgetstr ("me", address);
       if (s != 0)
-       TS_end_standout_mode = s;
+        tty->TS_end_standout_mode = s;
       else
-       TS_standout_mode = 0;
+        tty->TS_standout_mode = 0;
     }
 
-  if (TF_teleray)
+  if (tty->TF_teleray)
     {
-      Wcm.cm_tab = 0;
+      tty->Wcm->cm_tab = 0;
       /* We can't support standout mode, because it uses magic cookies.  */
-      TS_standout_mode = 0;
+      tty->TS_standout_mode = 0;
       /* But that means we cannot rely on ^M to go to column zero! */
-      CR = 0;
+      CR (tty) = 0;
       /* LF can't be trusted either -- can alter hpos */
       /* if move at column 0 thru a line with TS_standout_mode */
-      Down = 0;
+      Down (tty) = 0;
     }
 
   /* Special handling for certain terminal types known to need it */
 
   if (!strcmp (terminal_type, "supdup"))
     {
-      memory_below_frame = 1;
-      Wcm.cm_losewrap = 1;
+      terminal->memory_below_frame = 1;
+      tty->Wcm->cm_losewrap = 1;
     }
   if (!strncmp (terminal_type, "c10", 3)
       || !strcmp (terminal_type, "perq"))
@@ -2620,102 +2824,139 @@ to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.",
         It would be simpler if the :wi string could go in the termcap
         entry, but it can't because it is not fully valid.
         If it were in the termcap entry, it would confuse other programs.  */
-      if (!TS_set_window)
+      if (!tty->TS_set_window)
        {
-         p = TS_termcap_modes;
+         p = tty->TS_termcap_modes;
          while (*p && strcmp (p, "\033v  "))
            p++;
          if (*p)
-           TS_set_window = "\033v%C %C %C %C ";
+           tty->TS_set_window = "\033v%C %C %C %C ";
        }
       /* Termcap entry often fails to have :in: flag */
-      must_write_spaces = 1;
+      terminal->must_write_spaces = 1;
       /* :ti string typically fails to have \E^G! in it */
       /* This limits scope of insert-char to one line.  */
-      strcpy (area, TS_termcap_modes);
+      strcpy (area, tty->TS_termcap_modes);
       strcat (area, "\033\007!");
-      TS_termcap_modes = area;
+      tty->TS_termcap_modes = area;
       area += strlen (area) + 1;
-      p = AbsPosition;
+      p = AbsPosition (tty);
       /* Change all %+ parameters to %C, to handle
-        values above 96 correctly for the C100.  */
+         values above 96 correctly for the C100.  */
       while (*p)
-       {
-         if (p[0] == '%' && p[1] == '+')
-           p[1] = 'C';
-         p++;
-       }
+        {
+          if (p[0] == '%' && p[1] == '+')
+            p[1] = 'C';
+          p++;
+        }
     }
 
-  FrameRows = FRAME_LINES (sf);
-  FrameCols = FRAME_COLS (sf);
-  specified_window = FRAME_LINES (sf);
+  tty->specified_window = FrameRows (tty);
 
-  if (Wcm_init () == -1)       /* can't do cursor motion */
+  if (Wcm_init (tty) == -1)    /* can't do cursor motion */
+    {
+      maybe_fatal (must_succeed, NULL, terminal,
+                   "Terminal type \"%s\" is not powerful enough to run Emacs",
 #ifdef VMS
-    fatal ("Terminal type \"%s\" is not powerful enough to run Emacs.\n\
+                   "Terminal type \"%s\" is not powerful enough to run Emacs.\n\
 It lacks the ability to position the cursor.\n\
 If that is not the actual type of terminal you have, use either the\n\
 DCL command `SET TERMINAL/DEVICE= ...' for DEC-compatible terminals,\n\
 or `define EMACS_TERM \"terminal type\"' for non-DEC terminals.",
-           terminal_type);
 #else /* not VMS */
 # ifdef TERMINFO
-    fatal ("Terminal type \"%s\" is not powerful enough to run Emacs.\n\
+                   "Terminal type \"%s\" is not powerful enough to run Emacs.\n\
 It lacks the ability to position the cursor.\n\
 If that is not the actual type of terminal you have,\n\
 use the Bourne shell command `TERM=... export TERM' (C-shell:\n\
 `setenv TERM ...') to specify the correct type.  It may be necessary\n\
 to do `unset TERMINFO' (C-shell: `unsetenv TERMINFO') as well.",
-          terminal_type);
 # else /* TERMCAP */
-    fatal ("Terminal type \"%s\" is not powerful enough to run Emacs.\n\
+                   "Terminal type \"%s\" is not powerful enough to run Emacs.\n\
 It lacks the ability to position the cursor.\n\
 If that is not the actual type of terminal you have,\n\
 use the Bourne shell command `TERM=... export TERM' (C-shell:\n\
 `setenv TERM ...') to specify the correct type.  It may be necessary\n\
 to do `unset TERMCAP' (C-shell: `unsetenv TERMCAP') as well.",
-          terminal_type);
 # endif /* TERMINFO */
 #endif /*VMS */
-  if (FRAME_LINES (sf) <= 0
-      || FRAME_COLS (sf) <= 0)
-    fatal ("The frame size has not been specified");
+                   terminal_type);
+    }
 
-  delete_in_insert_mode
-    = TS_delete_mode && TS_insert_mode
-      && !strcmp (TS_delete_mode, TS_insert_mode);
+  if (FrameRows (tty) <= 0 || FrameCols (tty) <= 0)
+    maybe_fatal (must_succeed, NULL, terminal,
+                 "Could not determine the frame size",
+                 "Could not determine the frame size");
 
-  se_is_so = (TS_standout_mode
-             && TS_end_standout_mode
-             && !strcmp (TS_standout_mode, TS_end_standout_mode));
+  tty->delete_in_insert_mode
+    = tty->TS_delete_mode && tty->TS_insert_mode
+    && !strcmp (tty->TS_delete_mode, tty->TS_insert_mode);
 
-  UseTabs = tabs_safe_p () && TabWidth == 8;
+  tty->se_is_so = (tty->TS_standout_mode
+              && tty->TS_end_standout_mode
+              && !strcmp (tty->TS_standout_mode, tty->TS_end_standout_mode));
 
-  scroll_region_ok
-    = (Wcm.cm_abs
-       && (TS_set_window || TS_set_scroll_region || TS_set_scroll_region_1));
+  UseTabs (tty) = tabs_safe_p (fileno (tty->input)) && TabWidth (tty) == 8;
 
-  line_ins_del_ok = (((TS_ins_line || TS_ins_multi_lines)
-                     && (TS_del_line || TS_del_multi_lines))
-                    || (scroll_region_ok && TS_fwd_scroll && TS_rev_scroll));
+  terminal->scroll_region_ok
+    = (tty->Wcm->cm_abs
+       && (tty->TS_set_window || tty->TS_set_scroll_region || tty->TS_set_scroll_region_1));
 
-  char_ins_del_ok = ((TS_ins_char || TS_insert_mode
-                     || TS_pad_inserted_char || TS_ins_multi_chars)
-                    && (TS_del_char || TS_del_multi_chars));
+  terminal->line_ins_del_ok
+    = (((tty->TS_ins_line || tty->TS_ins_multi_lines)
+        && (tty->TS_del_line || tty->TS_del_multi_lines))
+       || (terminal->scroll_region_ok
+           && tty->TS_fwd_scroll && tty->TS_rev_scroll));
 
-  fast_clear_end_of_line = TS_clr_line != 0;
+  terminal->char_ins_del_ok
+    = ((tty->TS_ins_char || tty->TS_insert_mode
+        || tty->TS_pad_inserted_char || tty->TS_ins_multi_chars)
+       && (tty->TS_del_char || tty->TS_del_multi_chars));
 
-  init_baud_rate ();
-  if (read_socket_hook)                /* Baudrate is somewhat */
-                               /* meaningless in this case */
-    baud_rate = 9600;
+  terminal->fast_clear_end_of_line = tty->TS_clr_line != 0;
 
-  FRAME_CAN_HAVE_SCROLL_BARS (sf) = 0;
-  FRAME_VERTICAL_SCROLL_BAR_TYPE (sf) = vertical_scroll_bar_none;
-#endif /* WINDOWSNT */
+  init_baud_rate (fileno (tty->input));
+
+#ifdef AIXHFT
+  /* The HFT system on AIX doesn't optimize for scrolling, so it's
+     really ugly at times.  */
+  terminal->line_ins_del_ok = 0;
+  terminal->char_ins_del_ok = 0;
+#endif
+
+  /* Don't do this.  I think termcap may still need the buffer. */
+  /* xfree (buffer); */
+
+  /* Init system terminal modes (RAW or CBREAK, etc.).  */
+  init_sys_modes (tty);
+
+  return terminal;
+#endif /* not WINDOWSNT */
+}
 
-  xfree (buffer);
+/* Auxiliary error-handling function for init_tty.
+   Free BUFFER and delete TERMINAL, then call error or fatal
+   with str1 or str2, respectively, according to MUST_SUCCEED.  */
+
+static void
+maybe_fatal (must_succeed, buffer, terminal, str1, str2, arg1, arg2)
+     int must_succeed;
+     char *buffer;
+     struct terminal *terminal;
+     char *str1, *str2, *arg1, *arg2;
+{
+  if (buffer)
+    xfree (buffer);
+
+  if (terminal)
+    delete_tty (terminal);
+  
+  if (must_succeed)
+    fatal (str2, arg1, arg2);
+  else
+    error (str1, arg1, arg2);
+
+  abort ();
 }
 
 /* VARARGS 1 */
@@ -2730,16 +2971,108 @@ fatal (str, arg1, arg2)
   exit (1);
 }
 
-DEFUN ("tty-no-underline", Ftty_no_underline, Stty_no_underline, 0, 0, 0,
-       doc: /* Declare that this terminal does not handle underlining.
-This is used to override the terminfo data, for certain terminals that
-do not really do underlining, but say that they do.  */)
-  ()
+\f
+
+/* Delete the given tty terminal, closing all frames on it. */
+
+static void
+delete_tty (struct terminal *terminal)
 {
-  TS_enter_underline_mode = 0;
-  return Qnil;
+  struct tty_display_info *tty;
+  Lisp_Object tail, frame;
+  int last_terminal;
+  
+  /* Protect against recursive calls.  Fdelete_frame in
+     delete_terminal calls us back when it deletes our last frame.  */
+  if (terminal->deleted)
+    return;
+
+  if (terminal->type != output_termcap)
+    abort ();
+
+  tty = terminal->display_info.tty;
+  
+  last_terminal = 1;
+  FOR_EACH_FRAME (tail, frame)
+    {
+      struct frame *f = XFRAME (frame);
+      if (FRAME_LIVE_P (f) && (!FRAME_TERMCAP_P (f) || FRAME_TTY (f) != tty))
+        {
+          last_terminal = 0;
+          break;
+        }
+    }
+  if (last_terminal)
+      error ("Attempt to delete the sole terminal device with live frames");
+  
+  if (tty == tty_list)
+    tty_list = tty->next;
+  else
+    {
+      struct tty_display_info *p;
+      for (p = tty_list; p && p->next != tty; p = p->next)
+        ;
+
+      if (! p)
+        /* This should not happen. */
+        abort ();
+
+      p->next = tty->next;
+      tty->next = 0;
+    }
+
+  /* reset_sys_modes needs a valid device, so this call needs to be
+     before delete_terminal. */
+  reset_sys_modes (tty);
+
+  delete_terminal (terminal);
+
+  if (tty->name)
+    xfree (tty->name);
+
+  if (tty->type)
+    xfree (tty->type);
+
+  if (tty->input)
+    {
+      delete_keyboard_wait_descriptor (fileno (tty->input));
+      if (tty->input != stdin)
+        fclose (tty->input);
+    }
+  if (tty->output && tty->output != stdout && tty->output != tty->input)
+    fclose (tty->output);
+  if (tty->termscript)
+    fclose (tty->termscript);
+
+  if (tty->old_tty)
+    xfree (tty->old_tty);
+
+  if (tty->Wcm)
+    xfree (tty->Wcm);
+
+  bzero (tty, sizeof (struct tty_display_info));
+  xfree (tty);
 }
 
+\f
+
+/* Mark the pointers in the tty_display_info objects.
+   Called by the Fgarbage_collector.  */
+
+void
+mark_ttys (void)
+{
+  struct tty_display_info *tty;
+
+  for (tty = tty_list; tty; tty = tty->next)
+    {
+      if (tty->top_frame)
+        mark_object (tty->top_frame);
+    }
+}
+
+\f
+
 void
 syms_of_term ()
 {
@@ -2752,10 +3085,18 @@ This variable can be used by terminal emulator packages.  */);
   system_uses_terminfo = 0;
 #endif
 
-  DEFVAR_LISP ("ring-bell-function", &Vring_bell_function,
-    doc: /* Non-nil means call this function to ring the bell.
-The function should accept no arguments.  */);
-  Vring_bell_function = Qnil;
+  DEFVAR_LISP ("suspend-tty-functions", &Vsuspend_tty_functions,
+    doc: /* Functions to be run after suspending a tty.
+The functions are run with one argument, the terminal id to be suspended.
+See `suspend-tty'.  */);
+  Vsuspend_tty_functions = Qnil;
+
+
+  DEFVAR_LISP ("resume-tty-functions", &Vresume_tty_functions,
+    doc: /* Functions to be run after resuming a tty.
+The functions are run with one argument, the terminal id that was revived.
+See `resume-tty'.  */);
+  Vresume_tty_functions = Qnil;
 
   DEFVAR_BOOL ("visible-cursor", &visible_cursor,
               doc: /* Non-nil means to make the cursor very visible.
@@ -2767,9 +3108,13 @@ bigger, or it may make it blink, or it may do nothing at all.  */);
   defsubr (&Stty_display_color_p);
   defsubr (&Stty_display_color_cells);
   defsubr (&Stty_no_underline);
-
-  fullscreen_hook = NULL;
+  defsubr (&Stty_type);
+  defsubr (&Scontrolling_tty_p);
+  defsubr (&Ssuspend_tty);
+  defsubr (&Sresume_tty);
 }
 
+
+
 /* arch-tag: 498e7449-6f2e-45e2-91dd-b7d4ca488193
    (do not change this comment) */
index 3787e33..c0d9895 100644 (file)
@@ -19,32 +19,185 @@ along with GNU Emacs; see the file COPYING.  If not, write to
 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 Boston, MA 02110-1301, USA.  */
 
+/* Each termcap frame points to its own struct tty_output object in
+   the output_data.tty field.  The tty_output structure contains the
+   information that is specific to termcap frames. */
 
-/* extern EMACS_INT baud_rate; */              /* Output speed in baud */
-extern int must_write_spaces;  /* Nonzero means spaces in the text
-                                  must actually be output; can't just skip
-                                  over some columns to leave them blank.  */
-extern int min_padding_speed;  /* Speed below which no padding necessary */
-extern int fast_clear_end_of_line; /* Nonzero means terminal has
-                                     command for this */
-
-extern int line_ins_del_ok;    /* Terminal can insert and delete lines */
-extern int char_ins_del_ok;    /* Terminal can insert and delete chars */
-extern int scroll_region_ok;   /* Terminal supports setting the scroll
-                                  window */
-extern int scroll_region_cost; /* Cost of setting the scroll window,
-                                  measured in characters */
-extern int memory_below_frame; /* Terminal remembers lines scrolled
-                                  off bottom */
-extern int fast_clear_end_of_line; /* Terminal has a `ce' string */
-
-extern int dont_calculate_costs; /* Nonzero means don't bother computing
-                                   various cost tables; we won't use them. */
-
-/* Nonzero means no need to redraw the entire frame on resuming
-   a suspended Emacs.  This is useful on terminals with multiple pages,
-   where one page is used for Emacs and another for all else. */
-extern int no_redraw_on_reenter;
+struct tty_output
+{
+  /* The Emacs structure for the tty device this frame is on. */
+  struct tty_display_info *display_info;
+
+  /* There is nothing else here at the moment... */
+};
+
+/* Parameters that are shared between frames on the same tty device. */
+
+struct tty_display_info
+{
+  struct tty_display_info *next; /* Chain of all tty devices. */
+  
+  char *name;                   /* The name of the device file or 0 if
+                                   stdin/stdout. */
+  char *type;                   /* The type of the tty. */
+  
+  /* Input/output */
+  
+  FILE *input;                  /* The stream to be used for terminal input.
+                                   NULL if the terminal is suspended. */
+  FILE *output;                 /* The stream to be used for terminal output.
+                                   NULL if the terminal is suspended. */
+  
+  FILE *termscript;             /* If nonzero, send all terminal output
+                                   characters to this stream also.  */
+
+  struct emacs_tty *old_tty;    /* The initial tty mode bits */
+
+  int term_initted;             /* 1 if we have been through init_sys_modes. */
+
+
+  int reference_count;          /* Number of frames that are on this display. */
+
+  struct terminal *terminal;    /* Points back to the generic terminal
+                                   structure.  This is sometimes handy. */
+
+  /* Info on cursor positioning.  */
+  struct cm *Wcm;
+
+  /* Redisplay. */
+
+  Lisp_Object top_frame;        /* The topmost frame on this tty. */
+  
+  /* The previous frame we displayed on this tty.  */
+  struct frame *previous_frame;
+
+  /* Strings, numbers and flags taken from the termcap entry.  */
+
+  char *TS_ins_line;           /* "al" */
+  char *TS_ins_multi_lines;    /* "AL" (one parameter, # lines to insert) */
+  char *TS_bell;                /* "bl" */
+  char *TS_clr_to_bottom;       /* "cd" */
+  char *TS_clr_line;           /* "ce", clear to end of line */
+  char *TS_clr_frame;          /* "cl" */
+  char *TS_set_scroll_region;  /* "cs" (2 params, first line and last line) */
+  char *TS_set_scroll_region_1; /* "cS" (4 params: total lines,
+                                   lines above scroll region, lines below it,
+                                   total lines again) */
+  char *TS_del_char;           /* "dc" */
+  char *TS_del_multi_chars;    /* "DC" (one parameter, # chars to delete) */
+  char *TS_del_line;           /* "dl" */
+  char *TS_del_multi_lines;    /* "DL" (one parameter, # lines to delete) */
+  char *TS_delete_mode;                /* "dm", enter character-delete mode */
+  char *TS_end_delete_mode;    /* "ed", leave character-delete mode */
+  char *TS_end_insert_mode;    /* "ei", leave character-insert mode */
+  char *TS_ins_char;           /* "ic" */
+  char *TS_ins_multi_chars;    /* "IC" (one parameter, # chars to insert) */
+  char *TS_insert_mode;                /* "im", enter character-insert mode */
+  char *TS_pad_inserted_char;  /* "ip".  Just padding, no commands.  */
+  char *TS_end_keypad_mode;    /* "ke" */
+  char *TS_keypad_mode;                /* "ks" */
+  char *TS_pad_char;           /* "pc", char to use as padding */
+  char *TS_repeat;             /* "rp" (2 params, # times to repeat
+                                  and character to be repeated) */
+  char *TS_end_standout_mode;  /* "se" */
+  char *TS_fwd_scroll;         /* "sf" */
+  char *TS_standout_mode;       /* "so" */
+  char *TS_rev_scroll;          /* "sr" */
+  char *TS_end_termcap_modes;   /* "te" */
+  char *TS_termcap_modes;       /* "ti" */
+  char *TS_visible_bell;        /* "vb" */
+  char *TS_cursor_normal;       /* "ve" */
+  char *TS_cursor_visible;      /* "vs" */
+  char *TS_cursor_invisible;    /* "vi" */
+  char *TS_set_window;          /* "wi" (4 params, start and end of window,
+                                   each as vpos and hpos) */
+
+  char *TS_enter_bold_mode;     /* "md" -- turn on bold (extra bright mode).  */
+  char *TS_enter_dim_mode;      /* "mh" -- turn on half-bright mode.  */
+  char *TS_enter_blink_mode;    /* "mb" -- enter blinking mode.  */
+  char *TS_enter_reverse_mode;  /* "mr" -- enter reverse video mode.  */
+  char *TS_exit_underline_mode; /* "us" -- start underlining.  */
+  char *TS_enter_underline_mode; /* "ue" -- end underlining.  */
+
+  /* "as"/"ae" -- start/end alternate character set.  Not really
+     supported, yet.  */
+  char *TS_enter_alt_charset_mode;
+  char *TS_exit_alt_charset_mode;
+
+  char *TS_exit_attribute_mode; /* "me" -- switch appearances off.  */
+
+  /* Value of the "NC" (no_color_video) capability, or 0 if not present.  */
+  int TN_no_color_video;
+
+  int TN_max_colors;            /* "Co" -- number of colors.  */
+
+  /* "pa" -- max. number of color pairs on screen.  Not handled yet.
+     Could be a problem if not equal to TN_max_colors * TN_max_colors.  */
+  int TN_max_pairs;
+
+  /* "op" -- SVr4 set default pair to its original value.  */
+  char *TS_orig_pair;
+
+  /* "AF"/"AB" or "Sf"/"Sb"-- set ANSI or SVr4 foreground/background color.
+     1 param, the color index.  */
+  char *TS_set_foreground;
+  char *TS_set_background;
+
+  int TF_hazeltine;             /* termcap hz flag. */
+  int TF_insmode_motion;        /* termcap mi flag: can move while in insert mode. */
+  int TF_standout_motion;       /* termcap mi flag: can move while in standout mode. */
+  int TF_underscore;            /* termcap ul flag: _ underlines if over-struck on
+                                   non-blank position.  Must clear before writing _.  */
+  int TF_teleray;               /* termcap xt flag: many weird consequences.
+                                   For t1061. */
+
+  int RPov;                     /* # chars to start a TS_repeat */
+
+  int delete_in_insert_mode;    /* delete mode == insert mode */
+  
+  int se_is_so;                 /* 1 if same string both enters and leaves
+                                   standout mode */
+  
+  int costs_set;                /* Nonzero if costs have been calculated. */
+  
+  int insert_mode;              /* Nonzero when in insert mode.  */
+  int standout_mode;            /* Nonzero when in standout mode.  */
+
+
+
+  /* 1 if should obey 0200 bit in input chars as "Meta", 2 if should
+     keep 0200 bit in input chars.  0 to ignore the 0200 bit.  */
+
+  int meta_key;
+
+  /* Size of window specified by higher levels.
+   This is the number of lines, from the top of frame downwards,
+   which can participate in insert-line/delete-line operations.
+
+   Effectively it excludes the bottom frame_lines - specified_window_size
+   lines from those operations.  */
+
+  int specified_window;
+  
+  /* Flag used in tty_show/hide_cursor.  */
+
+  int cursor_hidden;
+
+  /* Nonzero means use ^S/^Q for flow control.  */
+  int flow_control;
+
+};
+
+/* A chain of structures for all tty devices currently in use. */
+extern struct tty_display_info *tty_list;
+
+
+#define FRAME_TTY(f)                            \
+  ((f)->output_method == output_termcap         \
+   ? (f)->terminal->display_info.tty            \
+   : (abort(), (struct tty_display_info *) 0))
+
+#define CURTTY() FRAME_TTY (SELECTED_FRAME())
 
 /* arch-tag: bf9f0d49-842b-42fb-9348-ec8759b27193
    (do not change this comment) */
index 2b9e947..98c4edb 100644 (file)
@@ -1,5 +1,4 @@
-/* Hooks by which low level terminal operations
-   can be made to call other routines.
+/* Parameters and display hooks for terminal devices.
    Copyright (C) 1985, 1986, 1993, 1994, 2002, 2003, 2004,
                  2005, 2006 Free Software Foundation, Inc.
 
@@ -26,40 +25,11 @@ Boston, MA 02110-1301, USA.  */
 struct glyph;
 struct frame;
 
-/* If nonzero, send all terminal output characters to this stream also.  */
-extern FILE *termscript;
-
 /* Only use prototypes when lisp.h has been included.  */
 #ifndef P_
 #define P_(X) ()
 #endif
 \f
-/* Text display hooks.  */
-
-extern void (*cursor_to_hook) P_ ((int vpos, int hpos));
-extern void (*raw_cursor_to_hook) P_ ((int, int));
-
-extern void (*clear_to_end_hook) P_ ((void));
-extern void (*clear_frame_hook) P_ ((void));
-extern void (*clear_end_of_line_hook) P_ ((int));
-
-extern void (*ins_del_lines_hook) P_ ((int, int));
-
-extern void (*insert_glyphs_hook) P_ ((struct glyph *s, int n));
-extern void (*write_glyphs_hook) P_ ((struct glyph *s, int n));
-extern void (*delete_glyphs_hook) P_ ((int));
-
-extern void (*ring_bell_hook) P_ ((void));
-
-extern void (*reset_terminal_modes_hook) P_ ((void));
-extern void (*set_terminal_modes_hook) P_ ((void));
-extern void (*update_begin_hook) P_ ((struct frame *));
-extern void (*update_end_hook) P_ ((struct frame *));
-extern void (*set_terminal_window_hook) P_ ((int));
-
-
-\f
-/* Multi-frame and mouse support hooks.  */
 
 enum scroll_bar_part {
   scroll_bar_above_handle,
@@ -73,131 +43,12 @@ enum scroll_bar_part {
   scroll_bar_move_ratio
 };
 
-/* Return the current position of the mouse.
-
-   Set *f to the frame the mouse is in, or zero if the mouse is in no
-   Emacs frame.  If it is set to zero, all the other arguments are
-   garbage.
-
-   If the motion started in a scroll bar, set *bar_window to the
-   scroll bar's window, *part to the part the mouse is currently over,
-   *x to the position of the mouse along the scroll bar, and *y to the
-   overall length of the scroll bar.
-
-   Otherwise, set *bar_window to Qnil, and *x and *y to the column and
-   row of the character cell the mouse is over.
-
-   Set *time to the time the mouse was at the returned position.
-
-   This should clear mouse_moved until the next motion
-   event arrives.  */
-extern void (*mouse_position_hook) P_ ((struct frame **f, int,
-                                       Lisp_Object *bar_window,
-                                       enum scroll_bar_part *part,
-                                       Lisp_Object *x,
-                                       Lisp_Object *y,
-                                       unsigned long *time));
-
-/* The window system handling code should set this if the mouse has
-   moved since the last call to the mouse_position_hook.  Calling that
-   hook should clear this.  */
-extern int mouse_moved;
-
-/* When a frame's focus redirection is changed, this hook tells the
-   window system code to re-decide where to put the highlight.  Under
-   X, this means that Emacs lies about where the focus is.  */
-extern void (*frame_rehighlight_hook) P_ ((struct frame *));
-
-/* If we're displaying frames using a window system that can stack
-   frames on top of each other, this hook allows you to bring a frame
-   to the front, or bury it behind all the other windows.  If this
-   hook is zero, that means the device we're displaying on doesn't
-   support overlapping frames, so there's no need to raise or lower
-   anything.
-
-   If RAISE is non-zero, F is brought to the front, before all other
-   windows.  If RAISE is zero, F is sent to the back, behind all other
-   windows.  */
-extern void (*frame_raise_lower_hook) P_ ((struct frame *f, int raise));
-
 /* If the value of the frame parameter changed, whis hook is called.
    For example, if going from fullscreen to not fullscreen this hook
    may do something OS dependent, like extended window manager hints on X11.  */
 extern void (*fullscreen_hook) P_ ((struct frame *f));
 
 \f
-/* Scroll bar hooks.  */
-
-/* The representation of scroll bars is determined by the code which
-   implements them, except for one thing: they must be represented by
-   lisp objects.  This allows us to place references to them in
-   Lisp_Windows without worrying about those references becoming
-   dangling references when the scroll bar is destroyed.
-
-   The window-system-independent portion of Emacs just refers to
-   scroll bars via their windows, and never looks inside the scroll bar
-   representation; it always uses hook functions to do all the
-   scroll bar manipulation it needs.
-
-   The `vertical_scroll_bar' field of a Lisp_Window refers to that
-   window's scroll bar, or is nil if the window doesn't have a
-   scroll bar.
-
-   The `scroll_bars' and `condemned_scroll_bars' fields of a Lisp_Frame
-   are free for use by the scroll bar implementation in any way it sees
-   fit.  They are marked by the garbage collector.  */
-
-
-/* Set the vertical scroll bar for WINDOW to have its upper left corner
-   at (TOP, LEFT), and be LENGTH rows high.  Set its handle to
-   indicate that we are displaying PORTION characters out of a total
-   of WHOLE characters, starting at POSITION.  If WINDOW doesn't yet
-   have a scroll bar, create one for it.  */
-extern void (*set_vertical_scroll_bar_hook)
-            P_ ((struct window *window,
-                int portion, int whole, int position));
-
-
-/* The following three hooks are used when we're doing a thorough
-   redisplay of the frame.  We don't explicitly know which scroll bars
-   are going to be deleted, because keeping track of when windows go
-   away is a real pain - can you say set-window-configuration?
-   Instead, we just assert at the beginning of redisplay that *all*
-   scroll bars are to be removed, and then save scroll bars from the
-   fiery pit when we actually redisplay their window.  */
-
-/* Arrange for all scroll bars on FRAME to be removed at the next call
-   to `*judge_scroll_bars_hook'.  A scroll bar may be spared if
-   `*redeem_scroll_bar_hook' is applied to its window before the judgement.
-
-   This should be applied to each frame each time its window tree is
-   redisplayed, even if it is not displaying scroll bars at the moment;
-   if the HAS_SCROLL_BARS flag has just been turned off, only calling
-   this and the judge_scroll_bars_hook will get rid of them.
-
-   If non-zero, this hook should be safe to apply to any frame,
-   whether or not it can support scroll bars, and whether or not it is
-   currently displaying them.  */
-extern void (*condemn_scroll_bars_hook) P_ ((struct frame *frame));
-
-/* Unmark WINDOW's scroll bar for deletion in this judgement cycle.
-   Note that it's okay to redeem a scroll bar that is not condemned.  */
-extern void (*redeem_scroll_bar_hook) P_ ((struct window *window));
-
-/* Remove all scroll bars on FRAME that haven't been saved since the
-   last call to `*condemn_scroll_bars_hook'.
-
-   This should be applied to each frame after each time its window
-   tree is redisplayed, even if it is not displaying scroll bars at the
-   moment; if the HAS_SCROLL_BARS flag has just been turned off, only
-   calling this and condemn_scroll_bars_hook will get rid of them.
-
-   If non-zero, this hook should be safe to apply to any frame,
-   whether or not it can support scroll bars, and whether or not it is
-   currently displaying them.  */
-extern void (*judge_scroll_bars_hook) P_ ((struct frame *FRAME));
-
-\f
 /* Input queue declarations and hooks.  */
 
 /* Expedient hack: only provide the below definitions to files that
@@ -390,13 +241,6 @@ struct input_event
 
 #define EVENT_INIT(event) bzero (&(event), sizeof (struct input_event))
 
-/* Called to read input events.  */
-extern int (*read_socket_hook) P_ ((int, int, struct input_event *));
-
-/* Called when a frame's display becomes entirely up to date.  */
-extern void (*frame_up_to_date_hook) P_ ((struct frame *));
-\f
-
 /* Bits in the modifiers member of the input_event structure.
    Note that reorder_modifiers assumes that the bits are in canonical
    order.
@@ -446,7 +290,334 @@ enum {
   meta_modifier        =  CHAR_META    /* Under X, the XK_Meta_[LR] keysyms.  */
 };
 
+#endif /* CONSP */
+
+\f
+/* Terminal-local parameters. */
+struct terminal
+{
+  /* Chain of all terminal devices. */
+  struct terminal *next_terminal;
+
+  /* Unique id for this terminal device. */
+  int id;
+
+  /* The number of frames that are on this terminal. */
+  int reference_count;
+
+  /* Nonzero while deleting this terminal.  Used to protect against
+     recursive calls to delete_terminal_hook.  */
+  int deleted;
+
+  /* The type of the terminal device. */
+  enum output_method type;
+
+  /* The name of the terminal device.  Do not use this to uniquely
+     identify a terminal; the same device may be opened multiple
+     times. */
+  char *name;
+
+#ifdef MULTI_KBOARD
+  /* The terminal's keyboard object. */
+  struct kboard *kboard;
+#endif
+
+  /* Device-type dependent data shared amongst all frames on this terminal. */
+  union display_info
+  {
+    struct tty_display_info *tty;     /* termchar.h */
+    struct x_display_info *x;         /* xterm.h */
+  } display_info;
+
+\f
+  /* Coding-system to be used for encoding terminal output.  This
+     structure contains information of a coding-system specified by
+     the function `set-terminal-coding-system'.  Also see
+     `safe_terminal_coding' in coding.h.  */
+  struct coding_system *terminal_coding;
+
+  /* Coding-system of what is sent from terminal keyboard.  This
+     structure contains information of a coding-system specified by
+     the function `set-keyboard-coding-system'.  */
+  struct coding_system *keyboard_coding;
+
+  /* Parameter alist of this terminal.  */
+  Lisp_Object param_alist;
+  
+  /* Terminal characteristics. */
+  /* XXX Are these really used on non-termcap displays? */
+  
+  int must_write_spaces;       /* Nonzero means spaces in the text must
+                                  actually be output; can't just skip over
+                                  some columns to leave them blank.  */
+  int fast_clear_end_of_line;   /* Nonzero means terminal has a `ce' string */
+  
+  int line_ins_del_ok;          /* Terminal can insert and delete lines */
+  int char_ins_del_ok;          /* Terminal can insert and delete chars */
+  int scroll_region_ok;         /* Terminal supports setting the scroll
+                                   window */
+  int scroll_region_cost;      /* Cost of setting the scroll window,
+                                   measured in characters. */
+  int memory_below_frame;      /* Terminal remembers lines scrolled
+                                   off bottom */
+
+#if 0  /* These are not used anywhere. */
+  /* EMACS_INT baud_rate; */   /* Output speed in baud */
+  int min_padding_speed;       /* Speed below which no padding necessary. */
+  int dont_calculate_costs;     /* Nonzero means don't bother computing
+                                   various cost tables; we won't use them. */
+#endif
+
+\f
+  /* Window-based redisplay interface for this device (0 for tty
+     devices). */
+  struct redisplay_interface *rif;
+
+  /* Frame-based redisplay interface. */
+  
+  /* Text display hooks.  */
+
+  void (*cursor_to_hook) P_ ((struct frame *f, int vpos, int hpos));
+  void (*raw_cursor_to_hook) P_ ((struct frame *, int, int));
+  
+  void (*clear_to_end_hook) P_ ((struct frame *));
+  void (*clear_frame_hook) P_ ((struct frame *));
+  void (*clear_end_of_line_hook) P_ ((struct frame *, int));
+  
+  void (*ins_del_lines_hook) P_ ((struct frame *f, int, int));
+  
+  void (*insert_glyphs_hook) P_ ((struct frame *f, struct glyph *s, int n));
+  void (*write_glyphs_hook) P_ ((struct frame *f, struct glyph *s, int n));
+  void (*delete_glyphs_hook) P_ ((struct frame *, int));
+  
+  void (*ring_bell_hook) P_ ((struct frame *f));
+  
+  void (*reset_terminal_modes_hook) P_ ((struct terminal *));
+  void (*set_terminal_modes_hook) P_ ((struct terminal *));
+
+  void (*update_begin_hook) P_ ((struct frame *));
+  void (*update_end_hook) P_ ((struct frame *));
+  void (*set_terminal_window_hook) P_ ((struct frame *, int));
+
+  /* Multi-frame and mouse support hooks.  */
+
+  /* Return the current position of the mouse.
+
+     Set *f to the frame the mouse is in, or zero if the mouse is in no
+     Emacs frame.  If it is set to zero, all the other arguments are
+     garbage.
+  
+     If the motion started in a scroll bar, set *bar_window to the
+     scroll bar's window, *part to the part the mouse is currently over,
+     *x to the position of the mouse along the scroll bar, and *y to the
+     overall length of the scroll bar.
+
+     Otherwise, set *bar_window to Qnil, and *x and *y to the column and
+     row of the character cell the mouse is over.
+
+     Set *time to the time the mouse was at the returned position.
+     
+     This should clear mouse_moved until the next motion
+     event arrives.  */
+  void (*mouse_position_hook) P_ ((struct frame **f, int,
+                                   Lisp_Object *bar_window,
+                                   enum scroll_bar_part *part,
+                                   Lisp_Object *x,
+                                   Lisp_Object *y,
+                                   unsigned long *time));
+
+  /* The window system handling code should set this if the mouse has
+     moved since the last call to the mouse_position_hook.  Calling that
+     hook should clear this.  */
+  int mouse_moved;
+
+  /* When a frame's focus redirection is changed, this hook tells the
+     window system code to re-decide where to put the highlight.  Under
+     X, this means that Emacs lies about where the focus is.  */
+  void (*frame_rehighlight_hook) P_ ((struct frame *));
+
+  /* If we're displaying frames using a window system that can stack
+     frames on top of each other, this hook allows you to bring a frame
+     to the front, or bury it behind all the other windows.  If this
+     hook is zero, that means the terminal we're displaying on doesn't
+     support overlapping frames, so there's no need to raise or lower
+     anything.
+     
+     If RAISE is non-zero, F is brought to the front, before all other
+     windows.  If RAISE is zero, F is sent to the back, behind all other
+     windows.  */
+  void (*frame_raise_lower_hook) P_ ((struct frame *f, int raise));
+
+  /* If the value of the frame parameter changed, whis hook is called.
+     For example, if going from fullscreen to not fullscreen this hook
+     may do something OS dependent, like extended window manager hints on X11.  */
+  void (*fullscreen_hook) P_ ((struct frame *f));
+    
+  \f
+  /* Scroll bar hooks.  */
+
+  /* The representation of scroll bars is determined by the code which
+     implements them, except for one thing: they must be represented by
+     lisp objects.  This allows us to place references to them in
+     Lisp_Windows without worrying about those references becoming
+     dangling references when the scroll bar is destroyed.
+     
+     The window-system-independent portion of Emacs just refers to
+     scroll bars via their windows, and never looks inside the scroll bar
+     representation; it always uses hook functions to do all the
+     scroll bar manipulation it needs.
+     
+     The `vertical_scroll_bar' field of a Lisp_Window refers to that
+     window's scroll bar, or is nil if the window doesn't have a
+     scroll bar.
+     
+     The `scroll_bars' and `condemned_scroll_bars' fields of a Lisp_Frame
+     are free for use by the scroll bar implementation in any way it sees
+     fit.  They are marked by the garbage collector.  */
+  
+  
+  /* Set the vertical scroll bar for WINDOW to have its upper left corner
+     at (TOP, LEFT), and be LENGTH rows high.  Set its handle to
+     indicate that we are displaying PORTION characters out of a total
+     of WHOLE characters, starting at POSITION.  If WINDOW doesn't yet
+     have a scroll bar, create one for it.  */
+  void (*set_vertical_scroll_bar_hook) P_ ((struct window *window,
+                                            int portion, int whole,
+                                            int position));
+
+
+  /* The following three hooks are used when we're doing a thorough
+     redisplay of the frame.  We don't explicitly know which scroll bars
+     are going to be deleted, because keeping track of when windows go
+     away is a real pain - can you say set-window-configuration?
+     Instead, we just assert at the beginning of redisplay that *all*
+     scroll bars are to be removed, and then save scroll bars from the
+     fiery pit when we actually redisplay their window.  */
+  
+  /* Arrange for all scroll bars on FRAME to be removed at the next call
+     to `*judge_scroll_bars_hook'.  A scroll bar may be spared if
+     `*redeem_scroll_bar_hook' is applied to its window before the judgement.
+     
+     This should be applied to each frame each time its window tree is
+     redisplayed, even if it is not displaying scroll bars at the moment;
+     if the HAS_SCROLL_BARS flag has just been turned off, only calling
+     this and the judge_scroll_bars_hook will get rid of them.
+     
+     If non-zero, this hook should be safe to apply to any frame,
+     whether or not it can support scroll bars, and whether or not it is
+     currently displaying them.  */
+  void (*condemn_scroll_bars_hook) P_ ((struct frame *frame));
+
+  /* Unmark WINDOW's scroll bar for deletion in this judgement cycle.
+     Note that it's okay to redeem a scroll bar that is not condemned.  */
+  void (*redeem_scroll_bar_hook) P_ ((struct window *window));
+
+  /* Remove all scroll bars on FRAME that haven't been saved since the
+     last call to `*condemn_scroll_bars_hook'.
+
+     This should be applied to each frame after each time its window
+     tree is redisplayed, even if it is not displaying scroll bars at the
+     moment; if the HAS_SCROLL_BARS flag has just been turned off, only
+     calling this and condemn_scroll_bars_hook will get rid of them.
+     
+     If non-zero, this hook should be safe to apply to any frame,
+     whether or not it can support scroll bars, and whether or not it is
+     currently displaying them.  */
+  void (*judge_scroll_bars_hook) P_ ((struct frame *FRAME));
+
+\f
+  /* Called to read input events.
+
+     TERMINAL indicates which terminal device to read from.  Input
+     events should be read into BUF, the size of which is given in
+     SIZE.  EXPECTED is non-zero if the caller suspects that new input
+     is available.
+
+     A positive return value indicates that that many input events
+     where read into BUF.
+     Zero means no events were immediately available.
+     A value of -1 means a transient read error, while -2 indicates
+     that the device was closed (hangup), and it should be deleted.
+
+     XXX Please note that a non-zero value of EXPECTED only means that
+     there is available input on at least one of the currently opened
+     terminal devices -- but not necessarily on this device.
+     Therefore, in most cases EXPECTED should be simply ignored.
+
+     XXX This documentation needs to be updated.  */
+  int (*read_socket_hook) P_ ((struct terminal *terminal,
+                               int expected,
+                               struct input_event *hold_quit));
+
+  /* Called when a frame's display becomes entirely up to date.  */
+  void (*frame_up_to_date_hook) P_ ((struct frame *));
+
+\f
+  /* Called to delete the device-specific portions of a frame that is
+     on this terminal device. */
+  void (*delete_frame_hook) P_ ((struct frame *));
+
+  /* Called after the last frame on this terminal is deleted, or when
+     the display device was closed (hangup).
+     
+     If this is NULL, then the generic delete_terminal is called
+     instead.  Otherwise the hook must call delete_terminal itself.
+
+     The hook must check for and close any live frames that are still
+     on the terminal.  Fdelete_frame ensures that there are no live
+     frames on the terminal when it calls this hook, so infinite
+     recursion is prevented.  */
+  void (*delete_terminal_hook) P_ ((struct terminal *));
+};
+
+
+/* Chain of all terminal devices currently in use. */
+extern struct terminal *terminal_list;
+
+#define FRAME_MUST_WRITE_SPACES(f) ((f)->terminal->must_write_spaces)
+#define FRAME_FAST_CLEAR_END_OF_LINE(f) ((f)->terminal->fast_clear_end_of_line)
+#define FRAME_LINE_INS_DEL_OK(f) ((f)->terminal->line_ins_del_ok)
+#define FRAME_CHAR_INS_DEL_OK(f) ((f)->terminal->char_ins_del_ok)
+#define FRAME_SCROLL_REGION_OK(f) ((f)->terminal->scroll_region_ok)
+#define FRAME_SCROLL_REGION_COST(f) ((f)->terminal->scroll_region_cost)
+#define FRAME_MEMORY_BELOW_FRAME(f) ((f)->terminal->memory_below_frame)
+
+#define FRAME_TERMINAL_CODING(f) ((f)->terminal->terminal_coding)
+#define FRAME_KEYBOARD_CODING(f) ((f)->terminal->keyboard_coding)
+
+#define TERMINAL_TERMINAL_CODING(d) ((d)->terminal_coding)
+#define TERMINAL_KEYBOARD_CODING(d) ((d)->keyboard_coding)
+
+#define FRAME_RIF(f) ((f)->terminal->rif)
+
+#define FRAME_TERMINAL(f) ((f)->terminal)
+
+/* FRAME_WINDOW_P tests whether the frame is a window, and is
+   defined to be the predicate for the window system being used.  */
+
+#ifdef HAVE_X_WINDOWS
+#define FRAME_WINDOW_P(f) FRAME_X_P (f)
 #endif
+#ifdef HAVE_NTGUI
+#define FRAME_WINDOW_P(f) FRAME_W32_P (f)
+#endif
+#ifdef MAC_OS
+#define FRAME_WINDOW_P(f) FRAME_MAC_P (f)
+#endif
+#ifndef FRAME_WINDOW_P
+#define FRAME_WINDOW_P(f) (0)
+#endif
+
+/* Return true if the terminal device is not suspended. */
+#define TERMINAL_ACTIVE_P(d) ((d)->type != output_termcap || (d)->display_info.tty->input)
+
+extern Lisp_Object get_terminal_param P_ ((struct terminal *, Lisp_Object));
+extern struct terminal *get_terminal P_ ((Lisp_Object terminal, int));
+extern struct terminal *create_terminal P_ ((void));
+extern void delete_terminal P_ ((struct terminal *));
+
+/* The initial terminal device, created by initial_term_init. */
+extern struct terminal *initial_terminal;
 
 /* arch-tag: 33a00ecc-52b5-4186-a410-8801ac9f087d
    (do not change this comment) */
diff --git a/src/terminal.c b/src/terminal.c
new file mode 100644 (file)
index 0000000..f3f0a17
--- /dev/null
@@ -0,0 +1,628 @@
+/* Functions related to terminal devices.
+   Copyright (C) 2005 Free Software Foundation, Inc.
+
+This file is part of GNU Emacs.
+
+GNU Emacs is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Emacs is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Emacs; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA.  */
+
+#include <config.h>
+#include <stdio.h>
+
+#include "lisp.h"
+#include "frame.h"
+#include "termchar.h"
+#include "termhooks.h"
+#include "charset.h"
+#include "coding.h"
+#include "keyboard.h"
+
+/* Chain of all terminals currently in use. */
+struct terminal *terminal_list;
+
+/* The first unallocated terminal id. */
+static int next_terminal_id;
+
+/* The initial terminal device, created by initial_term_init. */
+struct terminal *initial_terminal;
+
+/* Function to use to ring the bell.  */
+Lisp_Object Vring_bell_function;
+
+static void delete_initial_terminal P_ ((struct terminal *));
+
+\f
+
+void
+ring_bell (struct frame *f)
+{
+  if (!NILP (Vring_bell_function))
+    {
+      Lisp_Object function;
+
+      /* Temporarily set the global variable to nil
+        so that if we get an error, it stays nil
+        and we don't call it over and over.
+
+        We don't specbind it, because that would carefully
+        restore the bad value if there's an error
+        and make the loop of errors happen anyway.  */
+
+      function = Vring_bell_function;
+      Vring_bell_function = Qnil;
+
+      call0 (function);
+
+      Vring_bell_function = function;
+    }
+  else if (FRAME_TERMINAL (f)->ring_bell_hook)
+    (*FRAME_TERMINAL (f)->ring_bell_hook) (f);
+}
+
+void
+update_begin (struct frame *f)
+{
+  if (FRAME_TERMINAL (f)->update_begin_hook)
+    (*FRAME_TERMINAL (f)->update_begin_hook) (f);
+}
+
+void
+update_end (struct frame *f)
+{
+  if (FRAME_TERMINAL (f)->update_end_hook)
+    (*FRAME_TERMINAL (f)->update_end_hook) (f);
+}
+
+/* Specify how many text lines, from the top of the window,
+   should be affected by insert-lines and delete-lines operations.
+   This, and those operations, are used only within an update
+   that is bounded by calls to update_begin and update_end.  */
+
+void
+set_terminal_window (struct frame *f, int size)
+{
+  if (FRAME_TERMINAL (f)->set_terminal_window_hook)
+    (*FRAME_TERMINAL (f)->set_terminal_window_hook) (f, size);
+}
+
+/* Move cursor to row/column position VPOS/HPOS.  HPOS/VPOS are
+   frame-relative coordinates.  */
+
+void
+cursor_to (struct frame *f, int vpos, int hpos)
+{
+  if (FRAME_TERMINAL (f)->cursor_to_hook)
+    (*FRAME_TERMINAL (f)->cursor_to_hook) (f, vpos, hpos);
+}
+
+/* Similar but don't take any account of the wasted characters.  */
+
+void
+raw_cursor_to (struct frame *f, int row, int col)
+{
+  if (FRAME_TERMINAL (f)->raw_cursor_to_hook)
+    (*FRAME_TERMINAL (f)->raw_cursor_to_hook) (f, row, col);  
+}
+
+/* Erase operations */
+
+/* Clear from cursor to end of frame. */
+void
+clear_to_end (struct frame *f)
+{
+  if (FRAME_TERMINAL (f)->clear_to_end_hook)
+    (*FRAME_TERMINAL (f)->clear_to_end_hook) (f);
+}
+
+/* Clear entire frame */
+
+void
+clear_frame (struct frame *f)
+{
+  if (FRAME_TERMINAL (f)->clear_frame_hook)
+    (*FRAME_TERMINAL (f)->clear_frame_hook) (f);
+}
+
+/* Clear from cursor to end of line.
+   Assume that the line is already clear starting at column first_unused_hpos.
+
+   Note that the cursor may be moved, on terminals lacking a `ce' string.  */
+
+void
+clear_end_of_line (struct frame *f, int first_unused_hpos)
+{
+  if (FRAME_TERMINAL (f)->clear_end_of_line_hook)
+    (*FRAME_TERMINAL (f)->clear_end_of_line_hook) (f, first_unused_hpos);
+}
+
+/* Output LEN glyphs starting at STRING at the nominal cursor position.
+   Advance the nominal cursor over the text.  */
+
+void
+write_glyphs (struct frame *f, struct glyph *string, int len)
+{
+  if (FRAME_TERMINAL (f)->write_glyphs_hook)
+    (*FRAME_TERMINAL (f)->write_glyphs_hook) (f, string, len);
+}
+
+/* Insert LEN glyphs from START at the nominal cursor position.
+
+   If start is zero, insert blanks instead of a string at start */
+
+void
+insert_glyphs (struct frame *f, struct glyph *start, int len)
+{
+  if (len <= 0)
+    return;
+
+  if (FRAME_TERMINAL (f)->insert_glyphs_hook)
+    (*FRAME_TERMINAL (f)->insert_glyphs_hook) (f, start, len);
+}
+
+/* Delete N glyphs at the nominal cursor position. */
+
+void
+delete_glyphs (struct frame *f, int n)
+{
+  if (FRAME_TERMINAL (f)->delete_glyphs_hook)
+    (*FRAME_TERMINAL (f)->delete_glyphs_hook) (f, n);
+}
+
+/* Insert N lines at vpos VPOS.  If N is negative, delete -N lines.  */
+
+void
+ins_del_lines (struct frame *f, int vpos, int n)
+{
+  if (FRAME_TERMINAL (f)->ins_del_lines_hook)
+    (*FRAME_TERMINAL (f)->ins_del_lines_hook) (f, vpos, n);
+}
+
+
+\f
+
+/* Return the terminal object specified by TERMINAL.  TERMINAL may be a
+   terminal id, a frame, or nil for the terminal device of the current
+   frame.  If THROW is zero, return NULL for failure, otherwise throw
+   an error.  */
+
+struct terminal *
+get_terminal (Lisp_Object terminal, int throw)
+{
+  struct terminal *result = NULL;
+
+  if (NILP (terminal))
+    terminal = selected_frame;
+
+  if (INTEGERP (terminal))
+    {
+      struct terminal *t;
+
+      for (t = terminal_list; t; t = t->next_terminal)
+        {
+          if (t->id == XINT (terminal))
+            {
+              result = t;
+              break;
+            }
+        }
+    }
+  else if (FRAMEP (terminal))
+    {
+      result = FRAME_TERMINAL (XFRAME (terminal));
+    }
+
+  if (result == NULL && throw)
+    wrong_type_argument (Qterminal_live_p, terminal);
+
+  return result;
+}
+
+\f
+
+/* Create a new terminal object and add it to the terminal list. */
+
+struct terminal *
+create_terminal (void)
+{
+  struct terminal *terminal = (struct terminal *) xmalloc (sizeof (struct terminal));
+  
+  bzero (terminal, sizeof (struct terminal));
+  terminal->next_terminal = terminal_list;
+  terminal_list = terminal;
+
+  terminal->id = next_terminal_id++;
+
+  terminal->keyboard_coding =
+    (struct coding_system *) xmalloc (sizeof (struct coding_system));
+  terminal->terminal_coding =
+    (struct coding_system *) xmalloc (sizeof (struct coding_system));
+
+  setup_coding_system (Qnil, terminal->keyboard_coding);
+  setup_coding_system (Qnil, terminal->terminal_coding);
+
+  terminal->param_alist = Qnil;
+  return terminal;
+}
+
+/* Mark the Lisp pointers in the terminal objects.
+   Called by the Fgarbage_collector.  */
+
+void
+mark_terminals (void)
+{
+  struct terminal *t;
+  for (t = terminal_list; t; t = t->next_terminal)
+    {
+      mark_object (t->param_alist);
+    }
+}
+
+
+/* Low-level function to close all frames on a terminal, remove it
+   from the terminal list and free its memory.  */
+
+void
+delete_terminal (struct terminal *terminal)
+{
+  struct terminal **tp;
+  Lisp_Object tail, frame;
+
+  /* Protect against recursive calls.  Fdelete_frame calls the
+     delete_terminal_hook when we delete our last frame.  */
+  if (terminal->deleted)
+    return;
+  terminal->deleted = 1;
+
+  /* Check for live frames that are still on this terminal. */
+  FOR_EACH_FRAME (tail, frame)
+    {
+      struct frame *f = XFRAME (frame);
+      if (FRAME_LIVE_P (f) && f->terminal == terminal)
+        {
+          Fdelete_frame (frame, Qt);
+        }
+    }
+
+  for (tp = &terminal_list; *tp != terminal; tp = &(*tp)->next_terminal)
+    if (! *tp)
+      abort ();
+  *tp = terminal->next_terminal;
+
+  if (terminal->keyboard_coding)
+    xfree (terminal->keyboard_coding);
+  if (terminal->terminal_coding)
+    xfree (terminal->terminal_coding);
+  if (terminal->name)
+    xfree (terminal->name);
+  
+#ifdef MULTI_KBOARD
+  if (terminal->kboard && --terminal->kboard->reference_count == 0)
+    delete_kboard (terminal->kboard);
+#endif
+  
+  bzero (terminal, sizeof (struct terminal));
+  xfree (terminal);
+}
+
+DEFUN ("delete-terminal", Fdelete_terminal, Sdelete_terminal, 0, 2, 0,
+       doc: /* Delete TERMINAL by deleting all frames on it and closing the terminal.
+TERMINAL may be a terminal id, a frame, or nil (meaning the selected
+frame's terminal).
+
+Normally, you may not delete a display if all other displays are suspended,
+but if the second argument FORCE is non-nil, you may do so. */)
+  (terminal, force)
+     Lisp_Object terminal, force;
+{
+  struct terminal *t, *p;
+
+  t = get_terminal (terminal, 0);
+
+  if (!t)
+    return Qnil;
+
+  p = terminal_list;
+  while (p && (p == t || !TERMINAL_ACTIVE_P (p)))
+    p = p->next_terminal;
+  
+  if (NILP (force) && !p)
+    error ("Attempt to delete the sole active display terminal");
+
+  if (t->delete_terminal_hook)
+    (*t->delete_terminal_hook) (t);
+  else
+    delete_terminal (t);
+
+  return Qnil;
+}
+
+\f
+DEFUN ("frame-terminal", Fframe_terminal, Sframe_terminal, 0, 1, 0,
+       doc: /* Return the terminal that FRAME is displayed on.
+If FRAME is nil, the selected frame is used.
+
+The terminal device is represented by its integer identifier.  */)
+  (frame)
+     Lisp_Object frame;
+{
+  struct terminal *t;
+
+  if (NILP (frame))
+    frame = selected_frame;
+
+  CHECK_LIVE_FRAME (frame);
+
+  t = get_terminal (frame, 0);
+
+  if (!t)
+    return Qnil;
+  else
+    return make_number (t->id);
+}
+
+DEFUN ("terminal-live-p", Fterminal_live_p, Sterminal_live_p, 1, 1, 0,
+       doc: /* Return non-nil if OBJECT is a terminal which has not been deleted.
+Value is nil if OBJECT is not a live display terminal.
+If object is a live display terminal, the return value indicates what
+sort of output terminal it uses.  See the documentation of `framep' for
+possible return values.
+
+Display terminals are represented by their integer identifiers. */)
+     (object)
+     Lisp_Object object;
+{
+  struct terminal *t;
+  
+  if (!INTEGERP (object))
+    return Qnil;
+
+  t = get_terminal (object, 0);
+
+  if (!t)
+    return Qnil;
+
+  switch (t->type)
+    {
+    case output_initial: /* The initial frame is like a termcap frame. */
+    case output_termcap:
+      return Qt;
+    case output_x_window:
+      return Qx;
+    case output_w32:
+      return Qw32;
+    case output_msdos_raw:
+      return Qpc;
+    case output_mac:
+      return Qmac;
+    default:
+      abort ();
+    }
+}
+
+DEFUN ("terminal-list", Fterminal_list, Sterminal_list, 0, 0, 0,
+       doc: /* Return a list of all terminal devices.
+Terminal devices are represented by their integer identifiers. */)
+  ()
+{
+  Lisp_Object terminals = Qnil;
+  struct terminal *t;
+
+  for (t = terminal_list; t; t = t->next_terminal)
+    terminals = Fcons (make_number (t->id), terminals);
+
+  return terminals;
+}
+
+DEFUN ("terminal-name", Fterminal_name, Sterminal_name, 0, 1, 0,
+       doc: /* Return the name of the terminal device TERMINAL.
+It is not guaranteed that the returned value is unique among opened devices.
+
+TERMINAL may be a terminal id, a frame, or nil (meaning the
+selected frame's terminal). */)
+  (terminal)
+     Lisp_Object terminal;
+{
+  struct terminal *t = get_terminal (terminal, 1);
+
+  if (t->name)
+    return build_string (t->name);
+  else
+    return Qnil;
+}
+
+
+\f
+/* Return the value of terminal parameter PARAM in terminal T.  */
+Lisp_Object
+get_terminal_param (t, param)
+     struct terminal *t;
+     Lisp_Object param;
+{
+  Lisp_Object tem = Fassq (param, t->param_alist);
+  if (EQ (tem, Qnil))
+    return tem;
+  return Fcdr (tem);
+}
+
+/* Set the value of terminal parameter PARAMETER in terminal D to VALUE.
+   Return the previous value.  */
+
+Lisp_Object
+store_terminal_param (t, parameter, value)
+     struct terminal *t;
+     Lisp_Object parameter;
+     Lisp_Object value;
+{
+  Lisp_Object old_alist_elt = Fassq (parameter, t->param_alist);
+  if (EQ (old_alist_elt, Qnil))
+    {
+      t->param_alist = Fcons (Fcons (parameter, value), t->param_alist);
+      return Qnil;
+    }
+  else
+    {
+      Lisp_Object result = Fcdr (old_alist_elt);
+      Fsetcdr (old_alist_elt, value);
+      return result;
+    }
+}
+
+
+DEFUN ("terminal-parameters", Fterminal_parameters, Sterminal_parameters, 0, 1, 0,
+       doc: /* Return the parameter-alist of terminal TERMINAL.
+The value is a list of elements of the form (PARM . VALUE), where PARM
+is a symbol.
+
+TERMINAL can be a terminal id, a frame or nil (meaning the selected
+frame's terminal).  */)
+     (terminal)
+     Lisp_Object terminal;
+{
+  struct terminal *t = get_terminal (terminal, 1);
+  return Fcopy_alist (t->param_alist);
+}
+
+DEFUN ("terminal-parameter", Fterminal_parameter, Sterminal_parameter, 2, 2, 0,
+       doc: /* Return TERMINAL's value for parameter PARAMETER.
+TERMINAL can be a terminal id, a frame or nil (meaning the selected
+frame's terminal).  */)
+     (terminal, parameter)
+     Lisp_Object terminal;
+     Lisp_Object parameter;
+{
+  Lisp_Object value;
+  struct terminal *t = get_terminal (terminal, 1);
+  CHECK_SYMBOL (parameter);
+  value = Fcdr (Fassq (parameter, t->param_alist));
+  return value;
+}
+
+DEFUN ("modify-terminal-parameters", Fmodify_terminal_parameters,
+       Smodify_terminal_parameters, 2, 2, 0,
+       doc: /* Modify the parameters of terminal TERMINAL according to ALIST.
+ALIST is an alist of parameters to change and their new values.
+Each element of ALIST has the form (PARM . VALUE), where PARM is a symbol.
+
+TERMINAL can be a terminal id, a frame or nil (meaning the selected
+frame's terminal).  */)
+     (terminal, alist)
+     Lisp_Object terminal;
+     Lisp_Object alist;
+{
+  Lisp_Object tail, prop, val;
+  struct terminal *t = get_terminal (terminal, 1);
+  int length = XINT (Fsafe_length (alist));
+  int i;
+  Lisp_Object *parms = (Lisp_Object *) alloca (length * sizeof (Lisp_Object));
+  Lisp_Object *values = (Lisp_Object *) alloca (length * sizeof (Lisp_Object));
+
+  /* Extract parm names and values into those vectors.  */
+  
+  i = 0;
+  for (tail = alist; CONSP (tail); tail = Fcdr (tail))
+    {
+      Lisp_Object elt;
+      
+      elt = Fcar (tail);
+      parms[i] = Fcar (elt);
+      values[i] = Fcdr (elt);
+      i++;
+    }
+  
+  /* Now process them in reverse of specified order.  */
+  for (i--; i >= 0; i--)
+    {
+      prop = parms[i];
+      val = values[i];
+      store_terminal_param (t, prop, val);
+    }
+  return Qnil;
+}
+
+DEFUN ("set-terminal-parameter", Fset_terminal_parameter,
+       Sset_terminal_parameter, 3, 3, 0,
+       doc: /* Set TERMINAL's value for parameter PARAMETER to VALUE.
+Return the previous value of PARAMETER.
+
+TERMINAL can be a terminal id, a frame or nil (meaning the selected
+frame's terminal).  */)
+     (terminal, parameter, value)
+     Lisp_Object terminal;
+     Lisp_Object parameter;
+     Lisp_Object value;
+{
+  struct terminal *t = get_terminal (terminal, 1);
+  return store_terminal_param (t, parameter, value);
+}
+
+\f
+
+/* Create the bootstrap display terminal for the initial frame.
+   Returns a terminal of type output_initial.  */
+
+struct terminal *
+init_initial_terminal (void)
+{
+  if (initialized || terminal_list || tty_list)
+    abort ();
+
+  initial_terminal = create_terminal ();
+  initial_terminal->type = output_initial;
+  initial_terminal->name = xstrdup ("initial_terminal");
+  initial_terminal->kboard = initial_kboard;
+
+  initial_terminal->delete_terminal_hook = &delete_initial_terminal;
+  /* All other hooks are NULL. */
+
+  return initial_terminal;
+}
+
+/* Deletes the bootstrap terminal device.
+   Called through delete_terminal_hook. */
+
+static void
+delete_initial_terminal (struct terminal *terminal)
+{
+  if (terminal != initial_terminal)
+    abort ();
+
+  delete_terminal (terminal);
+  initial_terminal = NULL;
+}
+
+void
+syms_of_terminal ()
+{
+
+  DEFVAR_LISP ("ring-bell-function", &Vring_bell_function,
+    doc: /* Non-nil means call this function to ring the bell.
+The function should accept no arguments.  */);
+  Vring_bell_function = Qnil;
+
+  defsubr (&Sdelete_terminal);
+  defsubr (&Sframe_terminal);
+  defsubr (&Sterminal_live_p);
+  defsubr (&Sterminal_list);
+  defsubr (&Sterminal_name);
+  defsubr (&Sterminal_parameters);
+  defsubr (&Sterminal_parameter);
+  defsubr (&Smodify_terminal_parameters);
+  defsubr (&Sset_terminal_parameter);
+
+  Fprovide (intern ("multi-tty"), Qnil);
+}
+
+/* arch-tag: e9af6f27-b483-47dc-bb1a-730c1c5cab03
+   (do not change this comment) */
index 5d4059b..8d776b3 100644 (file)
@@ -41,5 +41,10 @@ extern int meta_key;
 /* Nonzero means truncate lines in all windows less wide than the frame */
 extern int truncate_partial_width_windows;
 
+/* Nonzero means no need to redraw the entire frame on resuming a suspended
+   Emacs.  This is useful on terminals with multiple pages, where one page is
+   used for Emacs and another for all else. */
+extern int no_redraw_on_reenter;
+
 /* arch-tag: 35d4d284-dc1a-4fff-97fa-0154a21aebdb
    (do not change this comment) */
index 985d775..bd3db15 100644 (file)
@@ -5846,8 +5846,8 @@ x_free_frame_resources (f)
 
   free_frame_menubar (f);
 
-  unload_color (f, f->output_data.x->foreground_pixel);
-  unload_color (f, f->output_data.x->background_pixel);
+  unload_color (f, FRAME_FOREGROUND_PIXEL (f));
+  unload_color (f, FRAME_BACKGROUND_PIXEL (f));
   unload_color (f, f->output_data.w32->cursor_pixel);
   unload_color (f, f->output_data.w32->cursor_foreground_pixel);
   unload_color (f, f->output_data.w32->border_pixel);
@@ -6345,12 +6345,13 @@ w32_initialize ()
   redeem_scroll_bar_hook = w32_redeem_scroll_bar;
   judge_scroll_bars_hook = w32_judge_scroll_bars;
 
-  scroll_region_ok = 1;         /* we'll scroll partial frames */
-  char_ins_del_ok = 1;
-  line_ins_del_ok = 1;          /* we'll just blt 'em */
-  fast_clear_end_of_line = 1;   /* X does this well */
-  memory_below_frame = 0;       /* we don't remember what scrolls
-                                  off the bottom */
+  TTY_SCROLL_REGION_OK (CURTTY ()) = 1; /* we'll scroll partial frames */
+  TTY_CHAR_INS_DEL_OK (CURTTY ()) = 1;
+  TTY_LINE_INS_DEL_OK (CURTTY ()) = 1; /* we'll just blt 'em */
+  TTY_FAST_CLEAR_END_OF_LINE (CURTTY ()) = 1; /* X does this well */
+  TTY_MEMORY_BELOW_FRAME (CURTTY ()) = 0; /* we don't remember what
+                                                            scrolls off the
+                                                            bottom */
   baud_rate = 19200;
 
   w32_system_caret_hwnd = NULL;
index 5dcd381..f587d74 100644 (file)
@@ -408,8 +408,6 @@ extern struct w32_output w32term_display;
 #define FRAME_W32_WINDOW(f) ((f)->output_data.w32->window_desc)
 #define FRAME_X_WINDOW(f) ((f)->output_data.w32->window_desc)
 
-#define FRAME_FOREGROUND_PIXEL(f) ((f)->output_data.x->foreground_pixel)
-#define FRAME_BACKGROUND_PIXEL(f) ((f)->output_data.x->background_pixel)
 #define FRAME_FONT(f) ((f)->output_data.w32->font)
 #define FRAME_FONTSET(f) ((f)->output_data.w32->fontset)
 #define FRAME_BASELINE_OFFSET(f) ((f)->output_data.w32->baseline_offset)
index 35bf563..2e99133 100644 (file)
@@ -659,10 +659,10 @@ update_from_various_frame_slots (ew)
   struct x_output *x = f->output_data.x;
   ew->core.height = FRAME_PIXEL_HEIGHT (f) - x->menubar_height;
   ew->core.width = FRAME_PIXEL_WIDTH (f);
-  ew->core.background_pixel = x->background_pixel;
+  ew->core.background_pixel = FRAME_BACKGROUND_PIXEL (f);
   ew->emacs_frame.internal_border_width = f->internal_border_width;
   ew->emacs_frame.font = x->font;
-  ew->emacs_frame.foreground_pixel = x->foreground_pixel;
+  ew->emacs_frame.foreground_pixel = FRAME_FOREGROUND_PIXEL (f);
   ew->emacs_frame.cursor_color = x->cursor_pixel;
   ew->core.border_pixel = x->border_pixel;
 }
index 0db51c5..c46df0e 100644 (file)
@@ -21,6 +21,8 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 Boston, MA 02110-1301, USA.  */
 
 #include <config.h>
+#include <stdio.h>
+
 #include "lisp.h"
 #include "buffer.h"
 #include "keyboard.h"
@@ -7243,7 +7245,7 @@ and scrolling positions.  */)
 void
 init_window_once ()
 {
-  struct frame *f = make_terminal_frame ();
+  struct frame *f = make_initial_frame ();
   XSETFRAME (selected_frame, f);
   Vterminal_frame = selected_frame;
   minibuf_window = f->minibuffer_window;
index ed4c872..03f416a 100644 (file)
@@ -744,7 +744,7 @@ extern Lisp_Object Vminibuf_scroll_window;
 /* Nil or a symbol naming the window system under which emacs is
    running ('x is the only current possibility) */
 
-extern Lisp_Object Vwindow_system;
+extern Lisp_Object Vinitial_window_system;
 
 /* Version number of X windows: 10, 11 or nil.  */
 
index 0a2b587..0928d01 100644 (file)
@@ -578,21 +578,12 @@ Lisp_Object Vmessage_log_max;
 
 static Lisp_Object Vmessages_buffer_name;
 
-/* Index 0 is the buffer that holds the current (desired) echo area message,
-   or nil if none is desired right now.
-
-   Index 1 is the buffer that holds the previously displayed echo area message,
-   or nil to indicate no message.  This is normally what's on the screen now.
-
-   These two can point to the same buffer.  That happens when the last
-   message output by the user (or made by echoing) has been displayed.  */
+/* Current, index 0, and last displayed echo area message.  Either
+   buffers from echo_buffers, or nil to indicate no message.  */
 
 Lisp_Object echo_area_buffer[2];
 
-/* Permanent pointers to the two buffers that are used for echo area
-   purposes.  Once the two buffers are made, and their pointers are
-   placed here, these two slots remain unchanged unless those buffers
-   need to be created afresh.  */
+/* The buffers referenced from echo_area_buffer.  */
 
 static Lisp_Object echo_buffer[2];
 
@@ -811,10 +802,6 @@ static int clear_face_cache_count;
 static int clear_image_cache_count;
 #endif
 
-/* Record the previous terminal frame we displayed.  */
-
-static struct frame *previous_terminal_frame;
-
 /* Non-zero while redisplay_internal is in progress.  */
 
 int redisplaying_p;
@@ -2506,7 +2493,7 @@ init_iterator (it, w, charpos, bytepos, row, base_face_id)
   XSETWINDOW (it->window, w);
   it->w = w;
   it->f = XFRAME (w->frame);
-
+  
   /* Extra space between lines (on window systems only).  */
   if (base_face_id == DEFAULT_FACE_ID
       && FRAME_WINDOW_P (it->f))
@@ -2523,9 +2510,9 @@ init_iterator (it, w, charpos, bytepos, row, base_face_id)
 
   /* If realized faces have been removed, e.g. because of face
      attribute changes of named faces, recompute them.  When running
-     in batch mode, the face cache of Vterminal_frame is null.  If
+     in batch mode, the face cache of the initial frame is null.  If
      we happen to get called, make a dummy face cache.  */
-  if (noninteractive && FRAME_FACE_CACHE (it->f) == NULL)
+  if (FRAME_FACE_CACHE (it->f) == NULL)
     init_frame_faces (it->f);
   if (FRAME_FACE_CACHE (it->f)->used == 0)
     recompute_basic_faces (it->f);
@@ -3950,7 +3937,7 @@ handle_single_display_spec (it, spec, object, position,
       && EQ (XCAR (spec), Qheight)
       && CONSP (XCDR (spec)))
     {
-      if (FRAME_TERMCAP_P (it->f) || FRAME_MSDOS_P (it->f))
+      if (!FRAME_WINDOW_P (it->f))
        return 0;
 
       it->font_height = XCAR (XCDR (spec));
@@ -4016,7 +4003,7 @@ handle_single_display_spec (it, spec, object, position,
       && EQ (XCAR (spec), Qspace_width)
       && CONSP (XCDR (spec)))
     {
-      if (FRAME_TERMCAP_P (it->f) || FRAME_MSDOS_P (it->f))
+      if (!FRAME_WINDOW_P (it->f))
        return 0;
 
       value = XCAR (XCDR (spec));
@@ -4032,7 +4019,7 @@ handle_single_display_spec (it, spec, object, position,
     {
       Lisp_Object tem;
 
-      if (FRAME_TERMCAP_P (it->f) || FRAME_MSDOS_P (it->f))
+      if (!FRAME_WINDOW_P (it->f))
        return 0;
 
       if (tem = XCDR (spec), CONSP (tem))
@@ -4058,7 +4045,7 @@ handle_single_display_spec (it, spec, object, position,
       && EQ (XCAR (spec), Qraise)
       && CONSP (XCDR (spec)))
     {
-      if (FRAME_TERMCAP_P (it->f) || FRAME_MSDOS_P (it->f))
+      if (!FRAME_WINDOW_P (it->f))
        return 0;
 
 #ifdef HAVE_WINDOW_SYSTEM
@@ -4099,7 +4086,7 @@ handle_single_display_spec (it, spec, object, position,
       int face_id = DEFAULT_FACE_ID;
       int fringe_bitmap;
 
-      if (FRAME_TERMCAP_P (it->f) || FRAME_MSDOS_P (it->f))
+      if (!FRAME_WINDOW_P (it->f))
        /* If we return here, POSITION has been advanced
           across the text with this property.  */
        return 0;
@@ -4148,7 +4135,7 @@ handle_single_display_spec (it, spec, object, position,
          it->left_user_fringe_face_id = face_id;
        }
       else
-       {
+        {
          it->right_user_fringe_bitmap = fringe_bitmap;
          it->right_user_fringe_face_id = face_id;
        }
@@ -4193,9 +4180,9 @@ handle_single_display_spec (it, spec, object, position,
 
   valid_p = (STRINGP (value)
 #ifdef HAVE_WINDOW_SYSTEM
-            || (!FRAME_TERMCAP_P (it->f) && valid_image_p (value))
+             || (FRAME_WINDOW_P (it->f) && valid_image_p (value))
 #endif /* not HAVE_WINDOW_SYSTEM */
-            || (CONSP (value) && EQ (XCAR (value), Qspace)));
+             || (CONSP (value) && EQ (XCAR (value), Qspace)));
 
   if (valid_p && !display_replaced_before_p)
     {
@@ -4265,7 +4252,7 @@ handle_single_display_spec (it, spec, object, position,
 }
 
 
-/* Check if SPEC is a display specification value whose text should be
+/* Check if SPEC is a display sub-property value whose text should be
    treated as intangible.  */
 
 static int
@@ -7522,8 +7509,8 @@ message2_nolog (m, nbytes, multibyte)
       do_pending_window_change (0);
       echo_area_display (1);
       do_pending_window_change (0);
-      if (frame_up_to_date_hook != 0 && ! gc_in_progress)
-       (*frame_up_to_date_hook) (f);
+      if (FRAME_TERMINAL (f)->frame_up_to_date_hook != 0 && ! gc_in_progress)
+       (*FRAME_TERMINAL (f)->frame_up_to_date_hook) (f);
     }
 }
 
@@ -7626,8 +7613,8 @@ message3_nolog (m, nbytes, multibyte)
       do_pending_window_change (0);
       echo_area_display (1);
       do_pending_window_change (0);
-      if (frame_up_to_date_hook != 0 && ! gc_in_progress)
-       (*frame_up_to_date_hook) (f);
+      if (FRAME_TERMINAL (f)->frame_up_to_date_hook != 0 && ! gc_in_progress)
+       (*FRAME_TERMINAL (f)->frame_up_to_date_hook) (f);
     }
 }
 
@@ -7865,6 +7852,10 @@ ensure_echo_area_buffers ()
    WHICH > 0 means use echo_area_buffer[1].  If that is nil, choose a
    suitable buffer from echo_buffer[] and clear it.
 
+   If WHICH < 0, set echo_area_buffer[1] to echo_area_buffer[0], so
+   that the current message becomes the last displayed one, make
+   choose a suitable buffer for echo_area_buffer[0], and clear it.
+
    Value is what FN returns.  */
 
 static int
@@ -7889,6 +7880,17 @@ with_echo_area_buffer (w, which, fn, a1, a2, a3, a4)
     this_one = 0, the_other = 1;
   else if (which > 0)
     this_one = 1, the_other = 0;
+  else
+    {
+      this_one = 0, the_other = 1;
+      clear_buffer_p = 1;
+
+      /* We need a fresh one in case the current echo buffer equals
+        the one containing the last displayed echo area message.  */
+      if (!NILP (echo_area_buffer[this_one])
+         && EQ (echo_area_buffer[this_one], echo_area_buffer[the_other]))
+       echo_area_buffer[this_one] = Qnil;
+    }
 
   /* Choose a suitable buffer from echo_buffer[] is we don't
      have one.  */
@@ -8526,7 +8528,7 @@ set_message (s, string, nbytes, multibyte_p)
     = ((s && multibyte_p)
        || (STRINGP (string) && STRING_MULTIBYTE (string)));
 
-  with_echo_area_buffer (0, 0, set_message_1,
+  with_echo_area_buffer (0, -1, set_message_1,
                         (EMACS_INT) s, string, nbytes, multibyte_p);
   message_buf_print = 0;
   help_echo_showing_p = 0;
@@ -8556,7 +8558,6 @@ set_message_1 (a1, a2, nbytes, multibyte_p)
 
   /* Insert new message at BEG.  */
   TEMP_SET_PT_BOTH (BEG, BEG_BYTE);
-  Ferase_buffer ();
 
   if (STRINGP (string))
     {
@@ -8652,11 +8653,11 @@ clear_garbaged_frames ()
     {
       Lisp_Object tail, frame;
       int changed_count = 0;
-
+      
       FOR_EACH_FRAME (tail, frame)
        {
          struct frame *f = XFRAME (frame);
-
+         
          if (FRAME_VISIBLE_P (f) && FRAME_GARBAGED_P (f))
            {
              if (f->resized_p)
@@ -8670,7 +8671,7 @@ clear_garbaged_frames ()
              f->resized_p = 0;
            }
        }
-
+      
       frame_garbaged = 0;
       if (changed_count)
        ++windows_or_buffers_changed;
@@ -8703,11 +8704,10 @@ echo_area_display (update_frame_p)
 /* The terminal frame is used as the first Emacs frame on the Mac OS.  */
 #ifndef MAC_OS8
 #ifdef HAVE_WINDOW_SYSTEM
-  /* When Emacs starts, selected_frame may be a visible terminal
-     frame, even if we run under a window system.  If we let this
-     through, a message would be displayed on the terminal.  */
-  if (EQ (selected_frame, Vterminal_frame)
-      && !NILP (Vwindow_system))
+  /* When Emacs starts, selected_frame may be the initial terminal
+     frame.  If we let this through, a message would be displayed on
+     the terminal.  */
+  if (FRAME_INITIAL_P (XFRAME (selected_frame)))
     return 0;
 #endif /* HAVE_WINDOW_SYSTEM */
 #endif
@@ -8758,7 +8758,7 @@ echo_area_display (update_frame_p)
                 Can do with a display update of the echo area,
                 unless we displayed some mode lines.  */
              update_single_window (w, 1);
-             rif->flush_display (f);
+             FRAME_RIF (f)->flush_display (f);
            }
          else
            update_frame (f, 1, 1);
@@ -8773,8 +8773,10 @@ echo_area_display (update_frame_p)
   else if (!EQ (mini_window, selected_window))
     windows_or_buffers_changed++;
 
-  /* The current message is now also the last one displayed.  */
+  /* Last displayed message is now the current message.  */
   echo_area_buffer[1] = echo_area_buffer[0];
+  /* Inform read_char that we're not echoing.  */
+  echo_message_buffer = Qnil;
 
   /* Prevent redisplay optimization in redisplay_internal by resetting
      this_line_start_pos.  This is done because the mini-buffer now
@@ -9328,8 +9330,8 @@ x_cursor_to (vpos, hpos, y, x)
     {
       BLOCK_INPUT;
       display_and_set_cursor (w, 1, hpos, vpos, x, y);
-      if (rif->flush_display_optional)
-       rif->flush_display_optional (SELECTED_FRAME ());
+      if (FRAME_RIF (SELECTED_FRAME ())->flush_display_optional)
+       FRAME_RIF (SELECTED_FRAME ())->flush_display_optional (SELECTED_FRAME ());
       UNBLOCK_INPUT;
     }
 }
@@ -10763,6 +10765,8 @@ select_frame_for_redisplay (frame)
   Lisp_Object tail, sym, val;
   Lisp_Object old = selected_frame;
 
+  xassert (FRAMEP (frame) && FRAME_LIVE_P (XFRAME (frame)));
+
   selected_frame = frame;
 
   for (tail = XFRAME (frame)->param_alist; CONSP (tail); tail = XCDR (tail))
@@ -10900,17 +10904,16 @@ redisplay_internal (preserve_echo_area)
   if (face_change_count)
     ++windows_or_buffers_changed;
 
-  if (! FRAME_WINDOW_P (sf)
-      && previous_terminal_frame != sf)
+  if (FRAME_TERMCAP_P (sf)
+      && FRAME_TTY (sf)->previous_frame != sf)
     {
-      /* Since frames on an ASCII terminal share the same display
-        area, displaying a different frame means redisplay the whole
-        thing.  */
+      /* Since frames on a single ASCII terminal share the same
+        display area, displaying a different frame means redisplay
+        the whole thing.  */
       windows_or_buffers_changed++;
       SET_FRAME_GARBAGED (sf);
-      XSETFRAME (Vterminal_frame, sf);
+      FRAME_TTY (sf)->previous_frame = sf;
     }
-  previous_terminal_frame = sf;
 
   /* Set the visible flags for all frames.  Do this before checking
      for resized or garbaged frames; they want to know if their frames
@@ -10932,6 +10935,7 @@ redisplay_internal (preserve_echo_area)
       }
   }
 
+  
   /* Notice any pending interrupt request to change frame size.  */
   do_pending_window_change (1);
 
@@ -11287,7 +11291,7 @@ redisplay_internal (preserve_echo_area)
        {
          struct frame *f = XFRAME (frame);
 
-         if (FRAME_WINDOW_P (f) || f == sf)
+         if (FRAME_WINDOW_P (f) || FRAME_TERMCAP_P (f) || f == sf)
            {
              if (! EQ (frame, selected_frame))
                /* Select the frame, for the sake of frame-local
@@ -11296,16 +11300,16 @@ redisplay_internal (preserve_echo_area)
 
              /* Mark all the scroll bars to be removed; we'll redeem
                 the ones we want when we redisplay their windows.  */
-             if (condemn_scroll_bars_hook)
-               condemn_scroll_bars_hook (f);
+             if (FRAME_TERMINAL (f)->condemn_scroll_bars_hook)
+               FRAME_TERMINAL (f)->condemn_scroll_bars_hook (f);
 
              if (FRAME_VISIBLE_P (f) && !FRAME_OBSCURED_P (f))
                redisplay_windows (FRAME_ROOT_WINDOW (f));
 
              /* Any scroll bars which redisplay_windows should have
                 nuked should now go away.  */
-             if (judge_scroll_bars_hook)
-               judge_scroll_bars_hook (f);
+             if (FRAME_TERMINAL (f)->judge_scroll_bars_hook)
+               FRAME_TERMINAL (f)->judge_scroll_bars_hook (f);
 
              /* If fonts changed, display again.  */
              /* ??? rms: I suspect it is a mistake to jump all the way
@@ -11352,12 +11356,12 @@ redisplay_internal (preserve_echo_area)
          FOR_EACH_FRAME (tail, frame)
            {
              struct frame *f = XFRAME (frame);
-             if (f->updated_p)
-               {
-                 mark_window_display_accurate (f->root_window, 1);
-                 if (frame_up_to_date_hook)
-                   frame_up_to_date_hook (f);
-               }
+              if (f->updated_p)
+                {
+                  mark_window_display_accurate (f->root_window, 1);
+                  if (FRAME_TERMINAL (f)->frame_up_to_date_hook)
+                    FRAME_TERMINAL (f)->frame_up_to_date_hook (f);
+                }
            }
        }
     }
@@ -11442,8 +11446,8 @@ redisplay_internal (preserve_echo_area)
          /* Say overlay arrows are up to date.  */
          update_overlay_arrows (1);
 
-         if (frame_up_to_date_hook != 0)
-           frame_up_to_date_hook (sf);
+         if (FRAME_TERMINAL (sf)->frame_up_to_date_hook != 0)
+           FRAME_TERMINAL (sf)->frame_up_to_date_hook (sf);
        }
 
       update_mode_lines = 0;
@@ -11553,8 +11557,9 @@ redisplay_preserve_echo_area (from_where)
   else
     redisplay_internal (1);
 
-  if (rif != NULL && rif->flush_display_optional)
-    rif->flush_display_optional (NULL);
+  if (FRAME_RIF (SELECTED_FRAME ()) != NULL
+      && FRAME_RIF (SELECTED_FRAME ())->flush_display_optional)
+    FRAME_RIF (SELECTED_FRAME ())->flush_display_optional (NULL);
 }
 
 
@@ -11562,7 +11567,8 @@ redisplay_preserve_echo_area (from_where)
    redisplay_internal.  Reset redisplaying_p to the value it had
    before redisplay_internal was called, and clear
    prevent_freeing_realized_faces_p.  It also selects the previously
-   selected frame.  */
+   selected frame, unless it has been deleted (by an X connection
+   failure during redisplay, for example).  */
 
 static Lisp_Object
 unwind_redisplay (val)
@@ -11573,7 +11579,8 @@ unwind_redisplay (val)
   old_redisplaying_p = XCAR (val);
   redisplaying_p = XFASTINT (old_redisplaying_p);
   old_frame = XCDR (val);
-  if (! EQ (old_frame, selected_frame))
+  if (! EQ (old_frame, selected_frame)
+      && FRAME_LIVE_P (XFRAME (old_frame)))
     select_frame_for_redisplay (old_frame);
   return Qnil;
 }
@@ -12722,7 +12729,9 @@ set_vertical_scroll_bar (w)
     start = end = whole = 0;
 
   /* Indicate what this scroll bar ought to be displaying now.  */
-  set_vertical_scroll_bar_hook (w, end - start, whole, start);
+  if (FRAME_TERMINAL (XFRAME (w->frame))->set_vertical_scroll_bar_hook)
+    (*FRAME_TERMINAL (XFRAME (w->frame))->set_vertical_scroll_bar_hook)
+      (w, end - start, whole, start);
 }
 
 
@@ -13442,17 +13451,19 @@ redisplay_window (window, just_this_one_p)
         display_menu_bar (w);
 
 #ifdef HAVE_WINDOW_SYSTEM
+      if (FRAME_WINDOW_P (f))
+        {
 #ifdef USE_GTK
-      redisplay_tool_bar_p = FRAME_EXTERNAL_TOOL_BAR (f);
+          redisplay_tool_bar_p = FRAME_EXTERNAL_TOOL_BAR (f);
 #else
-      redisplay_tool_bar_p = WINDOWP (f->tool_bar_window)
-        && (FRAME_TOOL_BAR_LINES (f) > 0
-            || auto_resize_tool_bars_p);
-
+          redisplay_tool_bar_p = WINDOWP (f->tool_bar_window)
+            && (FRAME_TOOL_BAR_LINES (f) > 0
+                || auto_resize_tool_bars_p);
 #endif
 
-      if (redisplay_tool_bar_p)
-        redisplay_tool_bar (f);
+          if (redisplay_tool_bar_p)
+            redisplay_tool_bar (f);
+        }
 #endif
     }
 
@@ -13486,7 +13497,8 @@ redisplay_window (window, just_this_one_p)
 
       /* Note that we actually used the scroll bar attached to this
         window, so it shouldn't be deleted at the end of redisplay.  */
-      redeem_scroll_bar_hook (w);
+      if (FRAME_TERMINAL (f)->redeem_scroll_bar_hook)
+        (*FRAME_TERMINAL (f)->redeem_scroll_bar_hook) (w);
     }
 
   /* Restore current_buffer and value of point in it.  */
@@ -13751,10 +13763,10 @@ try_window_reusing_current_matrix (w)
          if (run.height > 0 && run.current_y != run.desired_y)
            {
              update_begin (f);
-             rif->update_window_begin_hook (w);
-             rif->clear_window_mouse_face (w);
-             rif->scroll_run_hook (w, &run);
-             rif->update_window_end_hook (w, 0, 0);
+             FRAME_RIF (f)->update_window_begin_hook (w);
+             FRAME_RIF (f)->clear_window_mouse_face (w);
+             FRAME_RIF (f)->scroll_run_hook (w, &run);
+             FRAME_RIF (f)->update_window_end_hook (w, 0, 0);
              update_end (f);
            }
 
@@ -13923,10 +13935,10 @@ try_window_reusing_current_matrix (w)
       if (run.height)
        {
          update_begin (f);
-         rif->update_window_begin_hook (w);
-         rif->clear_window_mouse_face (w);
-         rif->scroll_run_hook (w, &run);
-         rif->update_window_end_hook (w, 0, 0);
+         FRAME_RIF (f)->update_window_begin_hook (w);
+         FRAME_RIF (f)->clear_window_mouse_face (w);
+         FRAME_RIF (f)->scroll_run_hook (w, &run);
+         FRAME_RIF (f)->update_window_end_hook (w, 0, 0);
          update_end (f);
        }
 
@@ -14376,7 +14388,7 @@ try_window_id (w)
 
   /* Window must either use window-based redisplay or be full width.  */
   if (!FRAME_WINDOW_P (f)
-      && (!line_ins_del_ok
+      && (!FRAME_LINE_INS_DEL_OK (f)
          || !WINDOW_FULL_WIDTH_P (w)))
     GIVE_UP (4);
 
@@ -14785,10 +14797,10 @@ try_window_id (w)
 
       if (FRAME_WINDOW_P (f))
        {
-         rif->update_window_begin_hook (w);
-         rif->clear_window_mouse_face (w);
-         rif->scroll_run_hook (w, &run);
-         rif->update_window_end_hook (w, 0, 0);
+         FRAME_RIF (f)->update_window_begin_hook (w);
+         FRAME_RIF (f)->clear_window_mouse_face (w);
+         FRAME_RIF (f)->scroll_run_hook (w, &run);
+         FRAME_RIF (f)->update_window_end_hook (w, 0, 0);
        }
       else
        {
@@ -14806,36 +14818,36 @@ try_window_id (w)
            {
              /* Scroll last_unchanged_at_beg_row to the end of the
                 window down dvpos lines.  */
-             set_terminal_window (end);
+             set_terminal_window (f, end);
 
              /* On dumb terminals delete dvpos lines at the end
                 before inserting dvpos empty lines.  */
-             if (!scroll_region_ok)
-               ins_del_lines (end - dvpos, -dvpos);
+             if (!FRAME_SCROLL_REGION_OK (f))
+               ins_del_lines (f, end - dvpos, -dvpos);
 
              /* Insert dvpos empty lines in front of
                  last_unchanged_at_beg_row.  */
-             ins_del_lines (from, dvpos);
+             ins_del_lines (f, from, dvpos);
            }
          else if (dvpos < 0)
            {
              /* Scroll up last_unchanged_at_beg_vpos to the end of
                 the window to last_unchanged_at_beg_vpos - |dvpos|.  */
-             set_terminal_window (end);
+             set_terminal_window (f, end);
 
              /* Delete dvpos lines in front of
                 last_unchanged_at_beg_vpos.  ins_del_lines will set
                 the cursor to the given vpos and emit |dvpos| delete
                 line sequences.  */
-             ins_del_lines (from + dvpos, dvpos);
+             ins_del_lines (f, from + dvpos, dvpos);
 
              /* On a dumb terminal insert dvpos empty lines at the
                  end.  */
-             if (!scroll_region_ok)
-               ins_del_lines (end + dvpos, -dvpos);
+             if (!FRAME_SCROLL_REGION_OK (f))
+               ins_del_lines (f, end + dvpos, -dvpos);
            }
 
-         set_terminal_window (0);
+         set_terminal_window (f, 0);
        }
 
       update_end (f);
@@ -16616,10 +16628,10 @@ display_mode_line (w, face_id, format)
   /* Temporarily make frame's keyboard the current kboard so that
      kboard-local variables in the mode_line_format will get the right
      values.  */
-  push_frame_kboard (it.f);
+  push_kboard (FRAME_KBOARD (it.f));
   record_unwind_save_match_data ();
   display_mode_element (&it, 0, 0, 0, format, Qnil, 0);
-  pop_frame_kboard ();
+  pop_kboard ();
 
   unbind_to (count, Qnil);
 
@@ -17334,9 +17346,9 @@ are the selected window and the window's buffer).  */)
        = (NILP (face) ? Qnil : Fcons (Qface, Fcons (face, Qnil)));
     }
 
-  push_frame_kboard (it.f);
+  push_kboard (FRAME_KBOARD (it.f));
   display_mode_element (&it, 0, 0, 0, format, Qnil, 0);
-  pop_frame_kboard ();
+  pop_kboard ();
 
   if (no_props)
     {
@@ -17960,8 +17972,8 @@ decode_mode_spec (w, c, field_width, precision, multibyte)
          {
            /* No need to mention EOL here--the terminal never needs
               to do EOL conversion.  */
-           p = decode_mode_spec_coding (keyboard_coding.symbol, p, 0);
-           p = decode_mode_spec_coding (terminal_coding.symbol, p, 0);
+           p = decode_mode_spec_coding (FRAME_KEYBOARD_CODING (f)->symbol, p, 0);
+           p = decode_mode_spec_coding (FRAME_TERMINAL_CODING (f)->symbol, p, 0);
          }
        p = decode_mode_spec_coding (b->buffer_file_coding_system,
                                     p, eol_flag);
@@ -18453,6 +18465,8 @@ calc_pixel_width_or_height (res, it, prop, font, width_p, align_to)
   if (NILP (prop))
     return OK_PIXELS (0);
 
+  xassert (FRAME_LIVE_P (it->f));
+
   if (SYMBOLP (prop))
     {
       if (SCHARS (SYMBOL_NAME (prop)) == 2)
@@ -18569,7 +18583,8 @@ calc_pixel_width_or_height (res, it, prop, font, width_p, align_to)
       if (SYMBOLP (car))
        {
 #ifdef HAVE_WINDOW_SYSTEM
-         if (valid_image_p (prop))
+         if (FRAME_WINDOW_P (it->f)
+             && valid_image_p (prop))
            {
              int id = lookup_image (it->f, prop);
              struct image *img = IMAGE_FROM_ID (it->f, id);
@@ -18810,7 +18825,7 @@ get_glyph_face_and_encoding (f, glyph, char2b, two_byte_p)
            = FONT_INFO_FROM_ID (f, face->font_info_id);
          if (font_info)
            glyph->font_type
-             = rif->encode_char (glyph->u.ch, char2b, font_info, two_byte_p);
+             = FRAME_RIF (f)->encode_char (glyph->u.ch, char2b, font_info, two_byte_p);
        }
     }
 
@@ -19043,7 +19058,7 @@ x_get_glyph_overhangs (glyph, f, left, right)
       font = face->font;
       font_info = FONT_INFO_FROM_ID (f, face->font_info_id);
       if (font  /* ++KFS: Should this be font_info ?  */
-         && (pcm = rif->per_char_metric (font, &char2b, glyph->font_type)))
+         && (pcm = FRAME_RIF (f)->per_char_metric (font, &char2b, glyph->font_type)))
        {
          if (pcm->rbearing > pcm->width)
            *right = pcm->rbearing - pcm->width;
@@ -19211,7 +19226,7 @@ get_char_face_and_encoding (f, c, face_id, char2b, multibyte_p, display_p)
          struct font_info *font_info
            = FONT_INFO_FROM_ID (f, face->font_info_id);
          if (font_info)
-           rif->encode_char (c, char2b, font_info, 0);
+           FRAME_RIF (f)->encode_char (c, char2b, font_info, 0);
        }
     }
 
@@ -19274,8 +19289,8 @@ compute_overhangs_and_x (s, x, backward_p)
     {
       while (s)
        {
-         if (rif->compute_glyph_string_overhangs)
-           rif->compute_glyph_string_overhangs (s);
+         if (FRAME_RIF (s->f)->compute_glyph_string_overhangs)
+           FRAME_RIF (s->f)->compute_glyph_string_overhangs (s);
          x -= s->width;
          s->x = x;
          s = s->prev;
@@ -19285,8 +19300,8 @@ compute_overhangs_and_x (s, x, backward_p)
     {
       while (s)
        {
-         if (rif->compute_glyph_string_overhangs)
-           rif->compute_glyph_string_overhangs (s);
+         if (FRAME_RIF (s->f)->compute_glyph_string_overhangs)
+           FRAME_RIF (s->f)->compute_glyph_string_overhangs (s);
          s->x = x;
          x += s->width;
          s = s->next;
@@ -19574,9 +19589,9 @@ draw_glyphs (w, x, row, area, start, end, hl, overlaps)
       struct glyph_string *h, *t;
 
       /* Compute overhangs for all glyph strings.  */
-      if (rif->compute_glyph_string_overhangs)
+      if (FRAME_RIF (f)->compute_glyph_string_overhangs)
        for (s = head; s; s = s->next)
-         rif->compute_glyph_string_overhangs (s);
+         FRAME_RIF (f)->compute_glyph_string_overhangs (s);
 
       /* Prepend glyph strings for glyphs in front of the first glyph
         string that are overwritten because of the first glyph
@@ -19654,7 +19669,7 @@ draw_glyphs (w, x, row, area, start, end, hl, overlaps)
 
   /* Draw all strings.  */
   for (s = head; s; s = s->next)
-    rif->draw_glyph_string (s);
+    FRAME_RIF (f)->draw_glyph_string (s);
 
   if (area == TEXT_AREA
       && !row->full_width_p
@@ -20349,20 +20364,20 @@ x_produce_glyphs (it)
 
          it->nglyphs = 1;
 
-         pcm = rif->per_char_metric (font, &char2b,
-                                     FONT_TYPE_FOR_UNIBYTE (font, it->char_to_display));
-
-         if (it->override_ascent >= 0)
-           {
-             it->ascent = it->override_ascent;
-             it->descent = it->override_descent;
-             boff = it->override_boff;
-           }
-         else
-           {
-             it->ascent = FONT_BASE (font) + boff;
-             it->descent = FONT_DESCENT (font) - boff;
-           }
+          pcm = FRAME_RIF (it->f)->per_char_metric
+            (font, &char2b, FONT_TYPE_FOR_UNIBYTE (font, it->char_to_display));
+
+         if (it->override_ascent >= 0)
+           {
+             it->ascent = it->override_ascent;
+             it->descent = it->override_descent;
+             boff = it->override_boff;
+           }
+         else
+           {
+             it->ascent = FONT_BASE (font) + boff;
+             it->descent = FONT_DESCENT (font) - boff;
+           }
 
          if (pcm)
            {
@@ -20580,8 +20595,8 @@ x_produce_glyphs (it)
             from the charset width; this is what old redisplay code
             did.  */
 
-         pcm = rif->per_char_metric (font, &char2b,
-                                     FONT_TYPE_FOR_MULTIBYTE (font, it->c));
+         pcm = FRAME_RIF (it->f)->per_char_metric (font, &char2b,
+                                                    FONT_TYPE_FOR_MULTIBYTE (font, it->c));
 
          if (font_not_found_p || !pcm)
            {
@@ -20712,8 +20727,8 @@ x_produce_glyphs (it)
 
          /* Initialize the bounding box.  */
          if (font_info
-             && (pcm = rif->per_char_metric (font, &char2b,
-                                             FONT_TYPE_FOR_MULTIBYTE (font, it->c))))
+             && (pcm = FRAME_RIF (it->f)->per_char_metric (font, &char2b,
+                                                            FONT_TYPE_FOR_MULTIBYTE (font, it->c))))
            {
              width = pcm->width;
              ascent = pcm->ascent;
@@ -20771,8 +20786,8 @@ x_produce_glyphs (it)
                }
 
              if (font_info
-                 && (pcm = rif->per_char_metric (font, &char2b,
-                                                 FONT_TYPE_FOR_MULTIBYTE (font, ch))))
+                 && (pcm = FRAME_RIF (it->f)->per_char_metric (font, &char2b,
+                                                                FONT_TYPE_FOR_MULTIBYTE (font, ch))))
                {
                  width = pcm->width;
                  ascent = pcm->ascent;
@@ -21012,8 +21027,8 @@ x_insert_glyphs (start, len)
   frame_x = window_box_left (w, updated_area) + output_cursor.x;
   frame_y = WINDOW_TO_FRAME_PIXEL_Y (w, output_cursor.y);
 
-  rif->shift_glyphs_for_insert (f, frame_x, frame_y, shifted_region_width,
-                               line_height, shift_by_width);
+  FRAME_RIF (f)->shift_glyphs_for_insert (f, frame_x, frame_y, shifted_region_width,
+                                          line_height, shift_by_width);
 
   /* Write the glyphs.  */
   hpos = start - row->glyphs[updated_area];
@@ -21095,8 +21110,8 @@ x_clear_end_of_line (to_x)
   if (to_x > from_x && to_y > from_y)
     {
       BLOCK_INPUT;
-      rif->clear_frame_area (f, from_x, from_y,
-                            to_x - from_x, to_y - from_y);
+      FRAME_RIF (f)->clear_frame_area (f, from_x, from_y,
+                                       to_x - from_x, to_y - from_y);
       UNBLOCK_INPUT;
     }
 }
@@ -21609,7 +21624,7 @@ erase_phys_cursor (w)
       x = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, max (x, left_x));
 
       if (width > 0)
-      rif->clear_frame_area (f, x, y, width, cursor_row->visible_height);
+       FRAME_RIF (f)->clear_frame_area (f, x, y, width, cursor_row->visible_height);
     }
 
   /* Erase the cursor by redrawing the character underneath it.  */
@@ -21706,9 +21721,9 @@ display_and_set_cursor (w, on, hpos, vpos, x, y)
       w->phys_cursor.vpos = vpos;
     }
 
-  rif->draw_window_cursor (w, glyph_row, x, y,
-                          new_cursor_type, new_cursor_width,
-                          on, active_cursor);
+  FRAME_RIF (f)->draw_window_cursor (w, glyph_row, x, y,
+                                     new_cursor_type, new_cursor_width,
+                                     on, active_cursor);
 }
 
 
@@ -21857,11 +21872,11 @@ show_mouse_face (dpyinfo, draw)
 
   /* Change the mouse cursor.  */
   if (draw == DRAW_NORMAL_TEXT)
-    rif->define_frame_cursor (f, FRAME_X_OUTPUT (f)->text_cursor);
+    FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->text_cursor);
   else if (draw == DRAW_MOUSE_FACE)
-    rif->define_frame_cursor (f, FRAME_X_OUTPUT (f)->hand_cursor);
+    FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->hand_cursor);
   else
-    rif->define_frame_cursor (f, FRAME_X_OUTPUT (f)->nontext_cursor);
+    FRAME_RIF (f)->define_frame_cursor (f, FRAME_X_OUTPUT (f)->nontext_cursor);
 }
 
 /* EXPORT:
@@ -22300,7 +22315,6 @@ on_hot_spot_p (hot_spot, x, y)
          return inside;
        }
     }
-  /* If we don't understand the format, pretend we're not in the hot-spot.  */
   return 0;
 }
 
@@ -22380,7 +22394,7 @@ define_frame_cursor1 (f, cursor, pointer)
     }
 
   if (cursor != No_Cursor)
-    rif->define_frame_cursor (f, cursor);
+    FRAME_RIF (f)->define_frame_cursor (f, cursor);
 }
 
 /* Take proper action when mouse has moved to the mode or header line
@@ -23343,8 +23357,8 @@ phys_cursor_in_rect_p (w, r)
         I assume the effect is the same -- and this is portable.  */
       return x_intersect_rectangles (&cr, r, &result);
     }
-  else
-    return 0;
+  /* If we don't understand the format, pretend we're not in the hot-spot.  */
+  return 0;
 }
 
 
@@ -23356,6 +23370,8 @@ void
 x_draw_vertical_border (w)
      struct window *w;
 {
+  struct frame *f = XFRAME (WINDOW_FRAME (w));
+  
   /* We could do better, if we knew what type of scroll-bar the adjacent
      windows (on either side) have...  But we don't :-(
      However, I think this works ok.  ++KFS 2003-04-25 */
@@ -23376,9 +23392,9 @@ x_draw_vertical_border (w)
       y1 -= 1;
 
       if (WINDOW_LEFT_FRINGE_WIDTH (w) == 0)
-       x1 -= 1;
+        x1 -= 1;
 
-      rif->draw_vertical_window_border (w, x1, y0, y1);
+      FRAME_RIF (f)->draw_vertical_window_border (w, x1, y0, y1);
     }
   else if (!WINDOW_LEFTMOST_P (w)
           && !WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w))
@@ -23389,9 +23405,9 @@ x_draw_vertical_border (w)
       y1 -= 1;
 
       if (WINDOW_LEFT_FRINGE_WIDTH (w) == 0)
-       x0 -= 1;
+        x0 -= 1;
 
-      rif->draw_vertical_window_border (w, x0, y0, y1);
+      FRAME_RIF (f)->draw_vertical_window_border (w, x0, y0, y1);
     }
 }
 
index e93531e..ec20445 100644 (file)
@@ -195,11 +195,13 @@ Boston, MA 02110-1301, USA.  */
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <stdio.h>              /* This needs to be before termchar.h */
 
 #include "lisp.h"
 #include "charset.h"
 #include "keyboard.h"
 #include "frame.h"
+#include "termhooks.h"
 
 #ifdef HAVE_WINDOW_SYSTEM
 #include "fontset.h"
@@ -242,6 +244,7 @@ Boston, MA 02110-1301, USA.  */
 #include "blockinput.h"
 #include "window.h"
 #include "intervals.h"
+#include "termchar.h"
 
 #ifdef HAVE_X_WINDOWS
 
@@ -3221,6 +3224,20 @@ push_named_merge_point (struct named_merge_point *new_named_merge_point,
 
 \f
 
+static Lisp_Object
+internal_resolve_face_name (nargs, args)
+     int nargs;
+     Lisp_Object *args;
+{
+  Fget (args[0], args[1]);
+}
+
+static Lisp_Object
+resolve_face_name_error (ignore)
+     Lisp_Object ignore;
+{
+  return Qnil;
+}
 
 /* Resolve face name FACE_NAME.  If FACE_NAME is a string, intern it
    to make it a symbol.  If FACE_NAME is an alias for another face,
@@ -6147,7 +6164,7 @@ tty_supports_face_attributes_p (f, attrs, def_face)
   /* See if the capabilities we selected above are supported, with the
      given colors.  */
   if (test_caps != 0 &&
-      ! tty_capable_p (f, test_caps, fg_tty_color.pixel, bg_tty_color.pixel))
+      ! tty_capable_p (FRAME_TTY (f), test_caps, fg_tty_color.pixel, bg_tty_color.pixel))
     return 0;
 
 
@@ -6951,7 +6968,8 @@ realize_basic_faces (f)
        {
          FRAME_FACE_CACHE (f)->menu_face_changed_p = 0;
 #ifdef USE_X_TOOLKIT
-         x_update_menu_appearance (f);
+          if (FRAME_WINDOW_P (f))
+            x_update_menu_appearance (f);
 #endif
        }
 
@@ -7038,7 +7056,7 @@ realize_default_face (f)
        LFACE_FOREGROUND (lface) = XCDR (color);
       else if (FRAME_WINDOW_P (f))
        return 0;
-      else if (FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f))
+      else if (FRAME_INITIAL_P (f) || FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f))
        LFACE_FOREGROUND (lface) = build_string (unspecified_fg);
       else
        abort ();
@@ -7053,7 +7071,7 @@ realize_default_face (f)
        LFACE_BACKGROUND (lface) = XCDR (color);
       else if (FRAME_WINDOW_P (f))
        return 0;
-      else if (FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f))
+      else if (FRAME_INITIAL_P (f) || FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f))
        LFACE_BACKGROUND (lface) = build_string (unspecified_bg);
       else
        abort ();
@@ -7070,17 +7088,17 @@ realize_default_face (f)
 
 #ifdef HAVE_WINDOW_SYSTEM
 #ifdef HAVE_X_WINDOWS
-  if (face->font != FRAME_FONT (f))
+  if (FRAME_X_P (f) && face->font != FRAME_FONT (f))
     {
       /* This can happen when making a frame on a display that does
-        not support the default font.  */
+        not support the default font.  */
       if (!face->font)
-       return 0;
-
+       return 0;
       /* Otherwise, the font specified for the frame was not
-        acceptable as a font for the default face (perhaps because
-        auto-scaled fonts are rejected), so we must adjust the frame
-        font.  */
+        acceptable as a font for the default face (perhaps because
+        auto-scaled fonts are rejected), so we must adjust the frame
+        font.  */
       x_set_font (f, build_string (face->font_name), Qnil);
     }
 #endif /* HAVE_X_WINDOWS */
@@ -7160,6 +7178,11 @@ realize_face (cache, attrs, c, base_face, former_face_id)
     face = realize_x_face (cache, attrs, c, base_face);
   else if (FRAME_TERMCAP_P (cache->f) || FRAME_MSDOS_P (cache->f))
     face = realize_tty_face (cache, attrs, c);
+  else if (FRAME_INITIAL_P (cache->f))
+    {
+      /* Create a dummy face. */
+      face = make_realized_face (attrs);
+    }
   else
     abort ();
 
index 8f03d90..8b4ab0c 100644 (file)
@@ -47,6 +47,7 @@ Boston, MA 02110-1301, USA.  */
 #include "systime.h"
 #include "termhooks.h"
 #include "atimer.h"
+#include "termchar.h"
 
 #ifdef HAVE_X_WINDOWS
 
@@ -250,17 +251,18 @@ check_x_frame (frame)
   return f;
 }
 
-/* Let the user specify an X display with a frame.
+/* Let the user specify an X display with a Lisp object.
+   OBJECT may be nil, a frame or a terminal id.
    nil stands for the selected frame--or, if that is not an X frame,
    the first X display on the list.  */
 
 struct x_display_info *
-check_x_display_info (frame)
-     Lisp_Object frame;
+check_x_display_info (object)
+     Lisp_Object object;
 {
   struct x_display_info *dpyinfo = NULL;
 
-  if (NILP (frame))
+  if (NILP (object))
     {
       struct frame *sf = XFRAME (selected_frame);
 
@@ -271,11 +273,20 @@ check_x_display_info (frame)
       else
        error ("X windows are not in use or not initialized");
     }
-  else if (STRINGP (frame))
-    dpyinfo = x_display_info_for_name (frame);
+  else if (INTEGERP (object))
+    {
+      struct terminal *t = get_terminal (XINT (object), 1);
+
+      if (t->type != output_x_window)
+        error ("Terminal %d is not an X display", XINT (object));
+
+      dpyinfo = t->display_info.x;
+    }
+  else if (STRINGP (object))
+    dpyinfo = x_display_info_for_name (object);
   else
     {
-      FRAME_PTR f = check_x_frame (frame);
+      FRAME_PTR f = check_x_frame (object);
       dpyinfo = FRAME_X_DISPLAY_INFO (f);
     }
 
@@ -856,8 +867,8 @@ x_set_foreground_color (f, arg, oldval)
   unsigned long fg, old_fg;
 
   fg = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
-  old_fg = x->foreground_pixel;
-  x->foreground_pixel = fg;
+  old_fg = FRAME_FOREGROUND_PIXEL (f);
+  FRAME_FOREGROUND_PIXEL (f) = fg;
 
   if (FRAME_X_WINDOW (f) != 0)
     {
@@ -894,8 +905,8 @@ x_set_background_color (f, arg, oldval)
   unsigned long bg;
 
   bg = x_decode_color (f, arg, WHITE_PIX_DEFAULT (f));
-  unload_color (f, x->background_pixel);
-  x->background_pixel = bg;
+  unload_color (f, FRAME_BACKGROUND_PIXEL (f));
+  FRAME_BACKGROUND_PIXEL (f) = bg;
 
   if (FRAME_X_WINDOW (f) != 0)
     {
@@ -943,13 +954,13 @@ x_set_mouse_color (f, arg, oldval)
   Cursor cursor, nontext_cursor, mode_cursor, hand_cursor;
   Cursor hourglass_cursor, horizontal_drag_cursor;
   unsigned long pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
-  unsigned long mask_color = x->background_pixel;
+  unsigned long mask_color = FRAME_BACKGROUND_PIXEL (f);
 
   /* Don't let pointers be invisible.  */
   if (mask_color == pixel)
     {
       x_free_colors (f, &pixel, 1);
-      pixel = x_copy_color (f, x->foreground_pixel);
+      pixel = x_copy_color (f, FRAME_FOREGROUND_PIXEL (f));
     }
 
   unload_color (f, x->mouse_pixel);
@@ -1092,13 +1103,13 @@ x_set_cursor_color (f, arg, oldval)
       fore_pixel_allocated_p = 1;
     }
   else
-    fore_pixel = x->background_pixel;
+    fore_pixel = FRAME_BACKGROUND_PIXEL (f);
 
   pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
   pixel_allocated_p = 1;
 
   /* Make sure that the cursor color differs from the background color.  */
-  if (pixel == x->background_pixel)
+  if (pixel == FRAME_BACKGROUND_PIXEL (f))
     {
       if (pixel_allocated_p)
        {
@@ -1114,7 +1125,7 @@ x_set_cursor_color (f, arg, oldval)
              x_free_colors (f, &fore_pixel, 1);
              fore_pixel_allocated_p = 0;
            }
-         fore_pixel = x->background_pixel;
+         fore_pixel = FRAME_BACKGROUND_PIXEL (f);
        }
     }
 
@@ -1399,10 +1410,8 @@ x_set_tool_bar_lines (f, value, oldval)
      below the menu bar.  */
   if (FRAME_X_WINDOW (f) && FRAME_TOOL_BAR_LINES (f) == 0)
     {
-      updating_frame = f;
-      clear_frame ();
+      clear_frame (f);
       clear_current_matrices (f);
-      updating_frame = NULL;
     }
 
   /* If the tool bar gets smaller, the internal border below it
@@ -1453,10 +1462,10 @@ x_set_scroll_bar_foreground (f, value, oldval)
   if (FRAME_X_WINDOW (f) && FRAME_VISIBLE_P (f))
     {
       /* Remove all scroll bars because they have wrong colors.  */
-      if (condemn_scroll_bars_hook)
-       (*condemn_scroll_bars_hook) (f);
-      if (judge_scroll_bars_hook)
-       (*judge_scroll_bars_hook) (f);
+      if (FRAME_TERMINAL (f)->condemn_scroll_bars_hook)
+       (*FRAME_TERMINAL (f)->condemn_scroll_bars_hook) (f);
+      if (FRAME_TERMINAL (f)->judge_scroll_bars_hook)
+       (*FRAME_TERMINAL (f)->judge_scroll_bars_hook) (f);
 
       update_face_from_frame_parameter (f, Qscroll_bar_foreground, value);
       redraw_frame (f);
@@ -1502,10 +1511,10 @@ x_set_scroll_bar_background (f, value, oldval)
   if (FRAME_X_WINDOW (f) && FRAME_VISIBLE_P (f))
     {
       /* Remove all scroll bars because they have wrong colors.  */
-      if (condemn_scroll_bars_hook)
-       (*condemn_scroll_bars_hook) (f);
-      if (judge_scroll_bars_hook)
-       (*judge_scroll_bars_hook) (f);
+      if (FRAME_TERMINAL (f)->condemn_scroll_bars_hook)
+       (*FRAME_TERMINAL (f)->condemn_scroll_bars_hook) (f);
+      if (FRAME_TERMINAL (f)->judge_scroll_bars_hook)
+       (*FRAME_TERMINAL (f)->judge_scroll_bars_hook) (f);
 
       update_face_from_frame_parameter (f, Qscroll_bar_background, value);
       redraw_frame (f);
@@ -2717,7 +2726,7 @@ x_window (f)
   XSetWindowAttributes attributes;
   unsigned long attribute_mask;
 
-  attributes.background_pixel = f->output_data.x->background_pixel;
+  attributes.background_pixel = FRAME_BACKGROUND_PIXEL (f);
   attributes.border_pixel = f->output_data.x->border_pixel;
   attributes.bit_gravity = StaticGravity;
   attributes.backing_store = NotUseful;
@@ -2905,8 +2914,8 @@ x_make_gc (f)
 
   /* Normal video */
   gc_values.font = FRAME_FONT (f)->fid;
-  gc_values.foreground = f->output_data.x->foreground_pixel;
-  gc_values.background = f->output_data.x->background_pixel;
+  gc_values.foreground = FRAME_FOREGROUND_PIXEL (f);
+  gc_values.background = FRAME_BACKGROUND_PIXEL (f);
   gc_values.line_width = 0;    /* Means 1 using fast algorithm.  */
   f->output_data.x->normal_gc
     = XCreateGC (FRAME_X_DISPLAY (f),
@@ -2915,8 +2924,8 @@ x_make_gc (f)
                 &gc_values);
 
   /* Reverse video style.  */
-  gc_values.foreground = f->output_data.x->background_pixel;
-  gc_values.background = f->output_data.x->foreground_pixel;
+  gc_values.foreground = FRAME_BACKGROUND_PIXEL (f);
+  gc_values.background = FRAME_FOREGROUND_PIXEL (f);
   f->output_data.x->reverse_gc
     = XCreateGC (FRAME_X_DISPLAY (f),
                 FRAME_X_WINDOW (f),
@@ -2924,7 +2933,7 @@ x_make_gc (f)
                 &gc_values);
 
   /* Cursor has cursor-color background, background-color foreground.  */
-  gc_values.foreground = f->output_data.x->background_pixel;
+  gc_values.foreground = FRAME_BACKGROUND_PIXEL (f);
   gc_values.background = f->output_data.x->cursor_pixel;
   gc_values.fill_style = FillOpaqueStippled;
   gc_values.stipple
@@ -2948,8 +2957,8 @@ x_make_gc (f)
     = (XCreatePixmapFromBitmapData
        (FRAME_X_DISPLAY (f), FRAME_X_DISPLAY_INFO (f)->root_window,
        gray_bits, gray_width, gray_height,
-       f->output_data.x->foreground_pixel,
-       f->output_data.x->background_pixel,
+       FRAME_FOREGROUND_PIXEL (f),
+       FRAME_BACKGROUND_PIXEL (f),
        DefaultDepth (FRAME_X_DISPLAY (f), FRAME_X_SCREEN_NUMBER (f))));
 
   UNBLOCK_INPUT;
@@ -3004,6 +3013,12 @@ unwind_create_frame (frame)
 {
   struct frame *f = XFRAME (frame);
 
+  /* If frame is already dead, nothing to do.  This can happen if the
+     display is disconnected after the frame has become official, but
+     before x_create_frame removes the unwind protect.  */
+  if (!FRAME_LIVE_P (f))
+    return Qnil;
+
   /* If frame is ``official'', nothing to do.  */
   if (!CONSP (Vframe_list) || !EQ (XCAR (Vframe_list), frame))
     {
@@ -3052,24 +3067,27 @@ This function is an internal primitive--use `make-frame' instead.  */)
   Lisp_Object parent;
   struct kboard *kb;
 
-  check_x ();
-
   parms = Fcopy_alist (parms);
 
   /* Use this general default value to start with
      until we know if this frame has a specified name.  */
   Vx_resource_name = Vinvocation_name;
 
-  display = x_get_arg (dpyinfo, parms, Qdisplay, 0, 0, RES_TYPE_STRING);
+  display = x_get_arg (dpyinfo, parms, Qterminal, 0, 0, RES_TYPE_NUMBER);
+  if (EQ (display, Qunbound))
+    display = x_get_arg (dpyinfo, parms, Qdisplay, 0, 0, RES_TYPE_STRING);
   if (EQ (display, Qunbound))
     display = Qnil;
   dpyinfo = check_x_display_info (display);
 #ifdef MULTI_KBOARD
-  kb = dpyinfo->kboard;
+  kb = dpyinfo->terminal->kboard;
 #else
   kb = &the_only_kboard;
 #endif
 
+  if (dpyinfo->terminal->deleted)
+    error ("Terminal is being deleted, can't create new frames on it");
+
   name = x_get_arg (dpyinfo, parms, Qname, "name", "Name", RES_TYPE_STRING);
   if (!STRINGP (name)
       && ! EQ (name, Qunbound)
@@ -3110,6 +3128,9 @@ This function is an internal primitive--use `make-frame' instead.  */)
   /* Note that X Windows does support scroll bars.  */
   FRAME_CAN_HAVE_SCROLL_BARS (f) = 1;
 
+  f->terminal = dpyinfo->terminal;
+  f->terminal->reference_count++;
+
   f->output_method = output_x_window;
   f->output_data.x = (struct x_output *) xmalloc (sizeof (struct x_output));
   bzero (f->output_data.x, sizeof (struct x_output));
@@ -3136,9 +3157,6 @@ This function is an internal primitive--use `make-frame' instead.  */)
   image_cache_refcount = FRAME_X_IMAGE_CACHE (f)->refcount;
   dpyinfo_refcount = dpyinfo->reference_count;
 #endif /* GLYPH_DEBUG */
-#ifdef MULTI_KBOARD
-  FRAME_KBOARD (f) = kb;
-#endif
 
   /* These colors will be set anyway later, but it's important
      to get the color reference counts right, so initialize them!  */
@@ -3149,8 +3167,8 @@ This function is an internal primitive--use `make-frame' instead.  */)
     /* Function x_decode_color can signal an error.  Make
        sure to initialize color slots so that we won't try
        to free colors we haven't allocated.  */
-    f->output_data.x->foreground_pixel = -1;
-    f->output_data.x->background_pixel = -1;
+    FRAME_FOREGROUND_PIXEL (f) = -1;
+    FRAME_BACKGROUND_PIXEL (f) = -1;
     f->output_data.x->cursor_pixel = -1;
     f->output_data.x->cursor_foreground_pixel = -1;
     f->output_data.x->border_pixel = -1;
@@ -3158,9 +3176,9 @@ This function is an internal primitive--use `make-frame' instead.  */)
 
     black = build_string ("black");
     GCPRO1 (black);
-    f->output_data.x->foreground_pixel
+    FRAME_FOREGROUND_PIXEL (f)
       = x_decode_color (f, black, BLACK_PIX_DEFAULT (f));
-    f->output_data.x->background_pixel
+    FRAME_BACKGROUND_PIXEL (f)
       = x_decode_color (f, black, BLACK_PIX_DEFAULT (f));
     f->output_data.x->cursor_pixel
       = x_decode_color (f, black, BLACK_PIX_DEFAULT (f));
@@ -3427,7 +3445,7 @@ This function is an internal primitive--use `make-frame' instead.  */)
     }
 
   /* Initialize `default-minibuffer-frame' in case this is the first
-     frame on this display device.  */
+     frame on this terminal.  */
   if (FRAME_HAS_MINIBUF_P (f)
       && (!FRAMEP (kb->Vdefault_minibuffer_frame)
           || !FRAME_LIVE_P (XFRAME (kb->Vdefault_minibuffer_frame))))
@@ -3439,6 +3457,8 @@ This function is an internal primitive--use `make-frame' instead.  */)
     if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem))))
       f->param_alist = Fcons (XCAR (tem), f->param_alist);
 
+  store_frame_param (f, Qwindow_system, Qx);
+
   UNGCPRO;
 
   /* Make sure windows on this frame appear in calls to next-window
@@ -3532,10 +3552,10 @@ DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0,
 
 DEFUN ("xw-display-color-p", Fxw_display_color_p, Sxw_display_color_p, 0, 1, 0,
        doc: /* Internal function called by `display-color-p', which see.  */)
-     (display)
-     Lisp_Object display;
+     (terminal)
+     Lisp_Object terminal;
 {
-  struct x_display_info *dpyinfo = check_x_display_info (display);
+  struct x_display_info *dpyinfo = check_x_display_info (terminal);
 
   if (dpyinfo->n_planes <= 2)
     return Qnil;
@@ -3557,13 +3577,13 @@ DEFUN ("x-display-grayscale-p", Fx_display_grayscale_p, Sx_display_grayscale_p,
        0, 1, 0,
        doc: /* Return t if the X display supports shades of gray.
 Note that color displays do support shades of gray.
-The optional argument DISPLAY specifies which display to ask about.
-DISPLAY should be either a frame or a display name (a string).
+The optional argument TERMINAL specifies which display to ask about.
+TERMINAL should be a terminal id, a frame or a display name (a string).
 If omitted or nil, that stands for the selected frame's display.  */)
-     (display)
-     Lisp_Object display;
+     (terminal)
+     Lisp_Object terminal;
 {
-  struct x_display_info *dpyinfo = check_x_display_info (display);
+  struct x_display_info *dpyinfo = check_x_display_info (terminal);
 
   if (dpyinfo->n_planes <= 1)
     return Qnil;
@@ -3585,56 +3605,56 @@ If omitted or nil, that stands for the selected frame's display.  */)
 
 DEFUN ("x-display-pixel-width", Fx_display_pixel_width, Sx_display_pixel_width,
        0, 1, 0,
-       doc: /* Returns the width in pixels of the X display DISPLAY.
-The optional argument DISPLAY specifies which display to ask about.
-DISPLAY should be either a frame or a display name (a string).
+       doc: /* Returns the width in pixels of the X display TERMINAL.
+The optional argument TERMINAL specifies which display to ask about.
+TERMINAL should be a terminal id, a frame or a display name (a string).
 If omitted or nil, that stands for the selected frame's display.  */)
-     (display)
-     Lisp_Object display;
+     (terminal)
+     Lisp_Object terminal;
 {
-  struct x_display_info *dpyinfo = check_x_display_info (display);
+  struct x_display_info *dpyinfo = check_x_display_info (terminal);
 
   return make_number (dpyinfo->width);
 }
 
 DEFUN ("x-display-pixel-height", Fx_display_pixel_height,
        Sx_display_pixel_height, 0, 1, 0,
-       doc: /* Returns the height in pixels of the X display DISPLAY.
-The optional argument DISPLAY specifies which display to ask about.
-DISPLAY should be either a frame or a display name (a string).
+       doc: /* Returns the height in pixels of the X display TERMINAL.
+The optional argument TERMINAL specifies which display to ask about.
+TERMINAL should be a terminal id, a frame or a display name (a string).
 If omitted or nil, that stands for the selected frame's display.  */)
-     (display)
-     Lisp_Object display;
+     (terminal)
+     Lisp_Object terminal;
 {
-  struct x_display_info *dpyinfo = check_x_display_info (display);
+  struct x_display_info *dpyinfo = check_x_display_info (terminal);
 
   return make_number (dpyinfo->height);
 }
 
 DEFUN ("x-display-planes", Fx_display_planes, Sx_display_planes,
        0, 1, 0,
-       doc: /* Returns the number of bitplanes of the X display DISPLAY.
-The optional argument DISPLAY specifies which display to ask about.
-DISPLAY should be either a frame or a display name (a string).
+       doc: /* Returns the number of bitplanes of the X display TERMINAL.
+The optional argument TERMINAL specifies which display to ask about.
+TERMINAL should be a terminal id, a frame or a display name (a string).
 If omitted or nil, that stands for the selected frame's display.  */)
-     (display)
-     Lisp_Object display;
+     (terminal)
+     Lisp_Object terminal;
 {
-  struct x_display_info *dpyinfo = check_x_display_info (display);
+  struct x_display_info *dpyinfo = check_x_display_info (terminal);
 
   return make_number (dpyinfo->n_planes);
 }
 
 DEFUN ("x-display-color-cells", Fx_display_color_cells, Sx_display_color_cells,
        0, 1, 0,
-       doc: /* Returns the number of color cells of the X display DISPLAY.
-The optional argument DISPLAY specifies which display to ask about.
-DISPLAY should be either a frame or a display name (a string).
+       doc: /* Returns the number of color cells of the X display TERMINAL.
+The optional argument TERMINAL specifies which display to ask about.
+TERMINAL should be a terminal id, a frame or a display name (a string).
 If omitted or nil, that stands for the selected frame's display.  */)
-     (display)
-     Lisp_Object display;
+     (terminal)
+     Lisp_Object terminal;
 {
-  struct x_display_info *dpyinfo = check_x_display_info (display);
+  struct x_display_info *dpyinfo = check_x_display_info (terminal);
 
   int nr_planes = DisplayPlanes (dpyinfo->display,
                                  XScreenNumberOfScreen (dpyinfo->screen));
@@ -3652,29 +3672,29 @@ If omitted or nil, that stands for the selected frame's display.  */)
 DEFUN ("x-server-max-request-size", Fx_server_max_request_size,
        Sx_server_max_request_size,
        0, 1, 0,
-       doc: /* Returns the maximum request size of the X server of display DISPLAY.
-The optional argument DISPLAY specifies which display to ask about.
-DISPLAY should be either a frame or a display name (a string).
+       doc: /* Returns the maximum request size of the X server of display TERMINAL.
+The optional argument TERMINAL specifies which display to ask about.
+TERMINAL should be a terminal id, a frame or a display name (a string).
 If omitted or nil, that stands for the selected frame's display.  */)
-     (display)
-     Lisp_Object display;
+     (terminal)
+     Lisp_Object terminal;
 {
-  struct x_display_info *dpyinfo = check_x_display_info (display);
+  struct x_display_info *dpyinfo = check_x_display_info (terminal);
 
   return make_number (MAXREQUEST (dpyinfo->display));
 }
 
 DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0,
-       doc: /* Returns the "vendor ID" string of the X server of display DISPLAY.
+       doc: /* Returns the "vendor ID" string of the X server of display TERMINAL.
 \(Labelling every distributor as a "vendor" embodies the false assumption
 that operating systems cannot be developed and distributed noncommercially.)
-The optional argument DISPLAY specifies which display to ask about.
-DISPLAY should be either a frame or a display name (a string).
+The optional argument TERMINAL specifies which display to ask about.
+TERMINAL should be a terminal id, a frame or a display name (a string).
 If omitted or nil, that stands for the selected frame's display.  */)
-     (display)
-     Lisp_Object display;
+     (terminal)
+     Lisp_Object terminal;
 {
-  struct x_display_info *dpyinfo = check_x_display_info (display);
+  struct x_display_info *dpyinfo = check_x_display_info (terminal);
   char *vendor = ServerVendor (dpyinfo->display);
 
   if (! vendor) vendor = "";
@@ -3682,18 +3702,18 @@ If omitted or nil, that stands for the selected frame's display.  */)
 }
 
 DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0,
-       doc: /* Returns the version numbers of the X server of display DISPLAY.
+       doc: /* Returns the version numbers of the X server of display TERMINAL.
 The value is a list of three integers: the major and minor
 version numbers of the X Protocol in use, and the distributor-specific release
 number.  See also the function `x-server-vendor'.
 
-The optional argument DISPLAY specifies which display to ask about.
-DISPLAY should be either a frame or a display name (a string).
+The optional argument TERMINAL specifies which display to ask about.
+TERMINAL should be a terminal id, a frame or a display name (a string).
 If omitted or nil, that stands for the selected frame's display.  */)
-     (display)
-     Lisp_Object display;
+     (terminal)
+     Lisp_Object terminal;
 {
-  struct x_display_info *dpyinfo = check_x_display_info (display);
+  struct x_display_info *dpyinfo = check_x_display_info (terminal);
   Display *dpy = dpyinfo->display;
 
   return Fcons (make_number (ProtocolVersion (dpy)),
@@ -3702,55 +3722,55 @@ If omitted or nil, that stands for the selected frame's display.  */)
 }
 
 DEFUN ("x-display-screens", Fx_display_screens, Sx_display_screens, 0, 1, 0,
-       doc: /* Return the number of screens on the X server of display DISPLAY.
-The optional argument DISPLAY specifies which display to ask about.
-DISPLAY should be either a frame or a display name (a string).
+       doc: /* Return the number of screens on the X server of display TERMINAL.
+The optional argument TERMINAL specifies which display to ask about.
+TERMINAL should be a terminal id, a frame or a display name (a string).
 If omitted or nil, that stands for the selected frame's display.  */)
-     (display)
-     Lisp_Object display;
+     (terminal)
+     Lisp_Object terminal;
 {
-  struct x_display_info *dpyinfo = check_x_display_info (display);
+  struct x_display_info *dpyinfo = check_x_display_info (terminal);
 
   return make_number (ScreenCount (dpyinfo->display));
 }
 
 DEFUN ("x-display-mm-height", Fx_display_mm_height, Sx_display_mm_height, 0, 1, 0,
-       doc: /* Return the height in millimeters of the X display DISPLAY.
-The optional argument DISPLAY specifies which display to ask about.
-DISPLAY should be either a frame or a display name (a string).
+       doc: /* Return the height in millimeters of the X display TERMINAL.
+The optional argument TERMINAL specifies which display to ask about.
+TERMINAL should be a terminal id, a frame or a display name (a string).
 If omitted or nil, that stands for the selected frame's display.  */)
-     (display)
-     Lisp_Object display;
+     (terminal)
+     Lisp_Object terminal;
 {
-  struct x_display_info *dpyinfo = check_x_display_info (display);
+  struct x_display_info *dpyinfo = check_x_display_info (terminal);
 
   return make_number (HeightMMOfScreen (dpyinfo->screen));
 }
 
 DEFUN ("x-display-mm-width", Fx_display_mm_width, Sx_display_mm_width, 0, 1, 0,
-       doc: /* Return the width in millimeters of the X display DISPLAY.
-The optional argument DISPLAY specifies which display to ask about.
-DISPLAY should be either a frame or a display name (a string).
+       doc: /* Return the width in millimeters of the X display TERMINAL.
+The optional argument TERMINAL specifies which display to ask about.
+TERMINAL should be a terminal id, a frame or a display name (a string).
 If omitted or nil, that stands for the selected frame's display.  */)
-     (display)
-     Lisp_Object display;
+     (terminal)
+     Lisp_Object terminal;
 {
-  struct x_display_info *dpyinfo = check_x_display_info (display);
+  struct x_display_info *dpyinfo = check_x_display_info (terminal);
 
   return make_number (WidthMMOfScreen (dpyinfo->screen));
 }
 
 DEFUN ("x-display-backing-store", Fx_display_backing_store,
        Sx_display_backing_store, 0, 1, 0,
-       doc: /* Returns an indication of whether X display DISPLAY does backing store.
+       doc: /* Returns an indication of whether X display TERMINAL does backing store.
 The value may be `always', `when-mapped', or `not-useful'.
-The optional argument DISPLAY specifies which display to ask about.
-DISPLAY should be either a frame or a display name (a string).
+The optional argument TERMINAL specifies which display to ask about.
+TERMINAL should be a terminal id, a frame or a display name (a string).
 If omitted or nil, that stands for the selected frame's display.  */)
-     (display)
-     Lisp_Object display;
+     (terminal)
+     Lisp_Object terminal;
 {
-  struct x_display_info *dpyinfo = check_x_display_info (display);
+  struct x_display_info *dpyinfo = check_x_display_info (terminal);
   Lisp_Object result;
 
   switch (DoesBackingStore (dpyinfo->screen))
@@ -3777,17 +3797,17 @@ If omitted or nil, that stands for the selected frame's display.  */)
 
 DEFUN ("x-display-visual-class", Fx_display_visual_class,
        Sx_display_visual_class, 0, 1, 0,
-       doc: /* Return the visual class of the X display DISPLAY.
+       doc: /* Return the visual class of the X display TERMINAL.
 The value is one of the symbols `static-gray', `gray-scale',
 `static-color', `pseudo-color', `true-color', or `direct-color'.
 
-The optional argument DISPLAY specifies which display to ask about.
-DISPLAY should be either a frame or a display name (a string).
+The optional argument TERMINAL specifies which display to ask about.
+TERMINAL should a terminal id, a frame or a display name (a string).
 If omitted or nil, that stands for the selected frame's display.  */)
-     (display)
-     Lisp_Object display;
+     (terminal)
+     Lisp_Object terminal;
 {
-  struct x_display_info *dpyinfo = check_x_display_info (display);
+  struct x_display_info *dpyinfo = check_x_display_info (terminal);
   Lisp_Object result;
 
   switch (dpyinfo->visual->class)
@@ -3820,14 +3840,14 @@ If omitted or nil, that stands for the selected frame's display.  */)
 
 DEFUN ("x-display-save-under", Fx_display_save_under,
        Sx_display_save_under, 0, 1, 0,
-       doc: /* Returns t if the X display DISPLAY supports the save-under feature.
-The optional argument DISPLAY specifies which display to ask about.
-DISPLAY should be either a frame or a display name (a string).
+       doc: /* Returns t if the X display TERMINAL supports the save-under feature.
+The optional argument TERMINAL specifies which display to ask about.
+TERMINAL should be a terminal id, a frame or a display name (a string).
 If omitted or nil, that stands for the selected frame's display.  */)
-     (display)
-     Lisp_Object display;
+     (terminal)
+     Lisp_Object terminal;
 {
-  struct x_display_info *dpyinfo = check_x_display_info (display);
+  struct x_display_info *dpyinfo = check_x_display_info (terminal);
 
   if (DoesSaveUnders (dpyinfo->screen) == True)
     return Qt;
@@ -4008,8 +4028,10 @@ x_display_info_for_name (name)
 
   CHECK_STRING (name);
 
-  if (! EQ (Vwindow_system, intern ("x")))
-    error ("Not using X Windows");
+#if 0
+  if (! EQ (Vinitial_window_system, intern ("x")))
+    error ("Not using X Windows"); /* That doesn't stop us anymore. */
+#endif
 
   for (dpyinfo = x_display_list, names = x_display_name_list;
        dpyinfo;
@@ -4056,8 +4078,10 @@ terminate Emacs if we can't open the connection.  */)
   if (! NILP (xrm_string))
     CHECK_STRING (xrm_string);
 
-  if (! EQ (Vwindow_system, intern ("x")))
-    error ("Not using X Windows");
+#if 0
+  if (! EQ (Vinitial_window_system, intern ("x")))
+    error ("Not using X Windows"); /* That doesn't stop us anymore. */
+#endif
 
   if (! NILP (xrm_string))
     xrm_option = (unsigned char *) SDATA (xrm_string);
@@ -4092,41 +4116,19 @@ An insecure way to solve the problem may be to use `xhost'.\n",
 
 DEFUN ("x-close-connection", Fx_close_connection,
        Sx_close_connection, 1, 1, 0,
-       doc: /* Close the connection to DISPLAY's X server.
-For DISPLAY, specify either a frame or a display name (a string).
-If DISPLAY is nil, that stands for the selected frame's display.  */)
-     (display)
-     Lisp_Object display;
+       doc: /* Close the connection to TERMINAL's X server.
+For TERMINAL, specify a terminal id, a frame or a display name (a
+string).  If TERMINAL is nil, that stands for the selected frame's
+terminal.  */)
+     (terminal)
+     Lisp_Object terminal;
 {
-  struct x_display_info *dpyinfo = check_x_display_info (display);
-  int i;
+  struct x_display_info *dpyinfo = check_x_display_info (terminal);
 
   if (dpyinfo->reference_count > 0)
     error ("Display still has frames on it");
 
-  BLOCK_INPUT;
-  /* Free the fonts in the font table.  */
-  for (i = 0; i < dpyinfo->n_fonts; i++)
-    if (dpyinfo->font_table[i].name)
-      {
-       XFreeFont (dpyinfo->display, dpyinfo->font_table[i].font);
-      }
-
-  x_destroy_all_bitmaps (dpyinfo);
-  XSetCloseDownMode (dpyinfo->display, DestroyAll);
-
-#ifdef USE_GTK
-  xg_display_close (dpyinfo->display);
-#else
-#ifdef USE_X_TOOLKIT
-  XtCloseDisplay (dpyinfo->display);
-#else
-  XCloseDisplay (dpyinfo->display);
-#endif
-#endif /* ! USE_GTK */
-
-  x_delete_display (dpyinfo);
-  UNBLOCK_INPUT;
+  x_delete_terminal (dpyinfo->terminal);
 
   return Qnil;
 }
@@ -4150,13 +4152,13 @@ If ON is nil, allow buffering of requests.
 Turning on synchronization prohibits the Xlib routines from buffering
 requests and seriously degrades performance, but makes debugging much
 easier.
-The optional second argument DISPLAY specifies which display to act on.
-DISPLAY should be either a frame or a display name (a string).
-If DISPLAY is omitted or nil, that stands for the selected frame's display.  */)
-     (on, display)
-    Lisp_Object display, on;
+The optional second argument TERMINAL specifies which display to act on.
+TERMINAL should be a terminal id, a frame or a display name (a string).
+If TERMINAL is omitted or nil, that stands for the selected frame's display.  */)
+     (on, terminal)
+    Lisp_Object terminal, on;
 {
-  struct x_display_info *dpyinfo = check_x_display_info (display);
+  struct x_display_info *dpyinfo = check_x_display_info (terminal);
 
   XSynchronize (dpyinfo->display, !EQ (on, Qnil));
 
@@ -4460,10 +4462,6 @@ start_hourglass ()
   EMACS_TIME delay;
   int secs, usecs = 0;
 
-  /* Don't bother for ttys.  */
-  if (NILP (Vwindow_system))
-    return;
-
   cancel_hourglass ();
 
   if (INTEGERP (Vhourglass_delay)
@@ -4675,20 +4673,16 @@ x_create_tip_frame (dpyinfo, parms, text)
   int width, height;
   int count = SPECPDL_INDEX ();
   struct gcpro gcpro1, gcpro2, gcpro3;
-  struct kboard *kb;
   int face_change_count_before = face_change_count;
   Lisp_Object buffer;
   struct buffer *old_buffer;
 
   check_x ();
 
-  parms = Fcopy_alist (parms);
+  if (dpyinfo->terminal->deleted)
+    error ("Terminal is being deleted, can't create new frames on it");
 
-#ifdef MULTI_KBOARD
-  kb = dpyinfo->kboard;
-#else
-  kb = &the_only_kboard;
-#endif
+  parms = Fcopy_alist (parms);
 
   /* Get the name of the frame to use for resource lookup.  */
   name = x_get_arg (dpyinfo, parms, Qname, "name", "Name", RES_TYPE_STRING);
@@ -4716,6 +4710,9 @@ x_create_tip_frame (dpyinfo, parms, text)
   FRAME_CAN_HAVE_SCROLL_BARS (f) = 0;
   record_unwind_protect (unwind_create_tip_frame, frame);
 
+  f->terminal = dpyinfo->terminal;
+  f->terminal->reference_count++;
+
   /* By setting the output method, we're essentially saying that
      the frame is live, as per FRAME_LIVE_P.  If we get a signal
      from this point on, x_destroy_window might screw up reference
@@ -4737,9 +4734,6 @@ x_create_tip_frame (dpyinfo, parms, text)
   image_cache_refcount = FRAME_X_IMAGE_CACHE (f)->refcount;
   dpyinfo_refcount = dpyinfo->reference_count;
 #endif /* GLYPH_DEBUG */
-#ifdef MULTI_KBOARD
-  FRAME_KBOARD (f) = kb;
-#endif
   f->output_data.x->parent_desc = FRAME_X_DISPLAY_INFO (f)->root_window;
   f->output_data.x->explicit_parent = 0;
 
@@ -4749,11 +4743,21 @@ x_create_tip_frame (dpyinfo, parms, text)
     Lisp_Object black;
     struct gcpro gcpro1;
 
+    /* Function x_decode_color can signal an error.  Make
+       sure to initialize color slots so that we won't try
+       to free colors we haven't allocated.  */
+    FRAME_FOREGROUND_PIXEL (f) = -1;
+    FRAME_BACKGROUND_PIXEL (f) = -1;
+    f->output_data.x->cursor_pixel = -1;
+    f->output_data.x->cursor_foreground_pixel = -1;
+    f->output_data.x->border_pixel = -1;
+    f->output_data.x->mouse_pixel = -1;
+
     black = build_string ("black");
     GCPRO1 (black);
-    f->output_data.x->foreground_pixel
+    FRAME_FOREGROUND_PIXEL (f)
       = x_decode_color (f, black, BLACK_PIX_DEFAULT (f));
-    f->output_data.x->background_pixel
+    FRAME_BACKGROUND_PIXEL (f)
       = x_decode_color (f, black, BLACK_PIX_DEFAULT (f));
     f->output_data.x->cursor_pixel
       = x_decode_color (f, black, BLACK_PIX_DEFAULT (f));
@@ -4939,6 +4943,8 @@ x_create_tip_frame (dpyinfo, parms, text)
                                              Qnil));
   }
 
+  Fmodify_frame_parameters (frame, Fcons (Fcons (Qwindow_system, Qx), Qnil));
+
   f->no_split = 1;
 
   UNGCPRO;
index 80565f3..b4665f8 100644 (file)
@@ -41,10 +41,10 @@ Boston, MA 02110-1301, USA.  */
 #include <stdio.h>
 
 #include "lisp.h"
-#include "termhooks.h"
 #include "keyboard.h"
 #include "keymap.h"
 #include "frame.h"
+#include "termhooks.h"
 #include "window.h"
 #include "blockinput.h"
 #include "buffer.h"
@@ -741,6 +741,9 @@ mouse_position_for_popup (f, x, y)
   Window root, dummy_window;
   int dummy;
 
+  if (! FRAME_X_P (f))
+    abort ();
+
   BLOCK_INPUT;
 
   XQueryPointer (FRAME_X_DISPLAY (f),
@@ -936,6 +939,9 @@ no quit occurs and `x-popup-menu' returns nil.  */)
       xpos += XINT (x);
       ypos += XINT (y);
 
+      if (! FRAME_X_P (f))
+        error ("Can not put X menu on non-X terminal");
+
       XSETFRAME (Vmenu_updating_frame, f);
     }
   else
@@ -1124,6 +1130,9 @@ for instance using the window manager, then this produces a quit and
        but I don't want to make one now.  */
     CHECK_WINDOW (window);
 
+  if (! FRAME_X_P (f))
+    error ("Can not put X dialog on non-X terminal");
+
 #if ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK)
   /* Display a menu with these alternatives
      in the middle of frame F.  */
@@ -1305,7 +1314,7 @@ popup_get_selection (initial_event, dpyinfo, id, do_timers)
     }
 }
 
-DEFUN ("menu-bar-open", Fmenu_bar_open, Smenu_bar_open, 0, 1, "i",
+DEFUN ("x-menu-bar-open-internal", Fx_menu_bar_open_internal, Sx_menu_bar_open_internal, 0, 1, "i",
        doc: /* Start key navigation of the menu bar in FRAME.
 This initially opens the first menu bar item and you can then navigate with the
 arrow keys, select a menu entry with the return key or cancel with the
@@ -1384,7 +1393,7 @@ If FRAME is nil or not given, use the selected frame.  */)
 
 
 #ifdef USE_GTK
-DEFUN ("menu-bar-open", Fmenu_bar_open, Smenu_bar_open, 0, 1, "i",
+DEFUN ("x-menu-bar-open-internal", Fx_menu_bar_open_internal, Sx_menu_bar_open_internal, 0, 1, "i",
        doc: /* Start key navigation of the menu bar in FRAME.
 This initially opens the first menu bar item and you can then navigate with the
 arrow keys, select a menu entry with the return key or cancel with the
@@ -1460,6 +1469,9 @@ void
 x_activate_menubar (f)
      FRAME_PTR f;
 {
+  if (! FRAME_X_P (f))
+    abort ();
+
   if (!f->output_data.x->saved_menu_event->type)
     return;
 
@@ -2094,9 +2106,14 @@ update_frame_menubar (f)
 #ifdef USE_GTK
   return xg_update_frame_menubar (f);
 #else
-  struct x_output *x = f->output_data.x;
+  struct x_output *x;
   int columns, rows;
 
+  if (! FRAME_X_P (f))
+    abort ();
+
+  x = f->output_data.x;
+
   if (!x->menubar_widget || XtIsManaged (x->menubar_widget))
     return 0;
 
@@ -2142,7 +2159,7 @@ set_frame_menubar (f, first_time, deep_p)
      int first_time;
      int deep_p;
 {
-  xt_or_gtk_widget menubar_widget = f->output_data.x->menubar_widget;
+  xt_or_gtk_widget menubar_widget;
 #ifdef USE_X_TOOLKIT
   LWLIB_ID id;
 #endif
@@ -2152,6 +2169,10 @@ set_frame_menubar (f, first_time, deep_p)
   int *submenu_start, *submenu_end;
   int *submenu_top_level_items, *submenu_n_panes;
 
+  if (! FRAME_X_P (f))
+    abort ();
+
+  menubar_widget = f->output_data.x->menubar_widget;
 
   XSETFRAME (Vmenu_updating_frame, f);
 
@@ -2504,6 +2525,9 @@ free_frame_menubar (f)
 {
   Widget menubar_widget;
 
+  if (! FRAME_X_P (f))
+    abort ();
+
   menubar_widget = f->output_data.x->menubar_widget;
 
   f->output_data.x->menubar_height = 0;
@@ -2656,6 +2680,9 @@ create_and_show_popup_menu (f, first_wv, x, y, for_click)
   struct next_popup_x_y popup_x_y;
   int specpdl_count = SPECPDL_INDEX ();
 
+  if (! FRAME_X_P (f))
+    abort ();
+
   xg_crazy_callback_abort = 1;
   menu = xg_create_widget ("popup", first_wv->name, f, first_wv,
                            G_CALLBACK (popup_selection_callback),
@@ -2764,6 +2791,9 @@ create_and_show_popup_menu (f, first_wv, x, y, for_click)
   LWLIB_ID menu_id;
   Widget menu;
 
+  if (! FRAME_X_P (f))
+    abort ();
+
   menu_id = widget_id_tick++;
   menu = lw_create_widget ("popup", first_wv->name, menu_id, first_wv,
                            f->output_data.x->widget, 1, 0,
@@ -2840,6 +2870,9 @@ xmenu_show (f, x, y, for_click, keymaps, title, error)
 
   int first_pane;
 
+  if (! FRAME_X_P (f))
+    abort ();
+
   *error = NULL;
 
   if (menu_items_used <= MENU_ITEMS_PANE_LENGTH)
@@ -3122,6 +3155,9 @@ create_and_show_dialog (f, first_wv)
 {
   GtkWidget *menu;
 
+  if (! FRAME_X_P (f))
+    abort ();
+
   menu = xg_create_widget ("dialog", first_wv->name, f, first_wv,
                            G_CALLBACK (dialog_selection_callback),
                            G_CALLBACK (popup_deactivate_callback),
@@ -3171,6 +3207,9 @@ create_and_show_dialog (f, first_wv)
 {
   LWLIB_ID dialog_id;
 
+  if (!FRAME_X_P (f))
+    abort();
+
   dialog_id = widget_id_tick++;
   lw_create_widget (first_wv->name, "dialog", dialog_id, first_wv,
                     f->output_data.x->widget, 1, 0,
@@ -3223,6 +3262,9 @@ xdialog_show (f, keymaps, title, header, error_name)
   /* 1 means we've seen the boundary between left-hand elts and right-hand.  */
   int boundary_seen = 0;
 
+  if (! FRAME_X_P (f))
+    abort ();
+
   *error_name = NULL;
 
   if (menu_items_n_panes > 1)
@@ -3490,6 +3532,9 @@ xmenu_show (f, x, y, for_click, keymaps, title, error)
   unsigned int dummy_uint;
   int specpdl_count = SPECPDL_INDEX ();
 
+  if (! FRAME_X_P (f))
+    abort ();
+
   *error = 0;
   if (menu_items_n_panes == 0)
     return Qnil;
@@ -3794,8 +3839,9 @@ syms_of_xmenu ()
   defsubr (&Smenu_or_popup_active_p);
 
 #if defined (USE_GTK) || defined (USE_X_TOOLKIT)
-  defsubr (&Smenu_bar_open);
-  Ffset (intern ("accelerate-menu"), intern (Smenu_bar_open.symbol_name));
+  defsubr (&Sx_menu_bar_open_internal);
+  Ffset (intern ("accelerate-menu"),
+        intern (Sx_menu_bar_open_internal.symbol_name));
 #endif
 
 #ifdef HAVE_MENUS
index 72d6aa0..54b20d8 100644 (file)
@@ -398,12 +398,19 @@ x_own_selection (selection_name, selection_value)
      Lisp_Object selection_name, selection_value;
 {
   struct frame *sf = SELECTED_FRAME ();
-  Window selecting_window = FRAME_X_WINDOW (sf);
-  Display *display = FRAME_X_DISPLAY (sf);
+  Window selecting_window;
+  Display *display;
   Time time = last_event_timestamp;
   Atom selection_atom;
-  struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (sf);
+  struct x_display_info *dpyinfo;
+
+  if (! FRAME_X_P (sf))
+    return;
 
+  selecting_window = FRAME_X_WINDOW (sf);
+  display = FRAME_X_DISPLAY (sf);
+  dpyinfo = FRAME_X_DISPLAY_INFO (sf);
+  
   CHECK_SYMBOL (selection_name);
   selection_atom = symbol_to_x_atom (dpyinfo, display, selection_name);
 
@@ -671,7 +678,8 @@ some_frame_on_display (dpyinfo)
 
   FOR_EACH_FRAME (list, frame)
     {
-      if (FRAME_X_DISPLAY_INFO (XFRAME (frame)) == dpyinfo)
+      if (FRAME_X_P (XFRAME (frame))
+          && FRAME_X_DISPLAY_INFO (XFRAME (frame)) == dpyinfo)
        return frame;
     }
 
@@ -1021,7 +1029,7 @@ x_handle_selection_clear (event)
      to see if this Emacs job now owns the selection
      through that display.  */
   for (t_dpyinfo = x_display_list; t_dpyinfo; t_dpyinfo = t_dpyinfo->next)
-    if (t_dpyinfo->kboard == dpyinfo->kboard)
+    if (t_dpyinfo->terminal->kboard == dpyinfo->terminal->kboard)
       {
        Window owner_window
          = XGetSelectionOwner (t_dpyinfo->display, selection);
@@ -1380,17 +1388,26 @@ x_get_foreign_selection (selection_symbol, target_type, time_stamp)
      Lisp_Object selection_symbol, target_type, time_stamp;
 {
   struct frame *sf = SELECTED_FRAME ();
-  Window requestor_window = FRAME_X_WINDOW (sf);
-  Display *display = FRAME_X_DISPLAY (sf);
-  struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (sf);
+  Window requestor_window;
+  Display *display;
+  struct x_display_info *dpyinfo;
   Time requestor_time = last_event_timestamp;
-  Atom target_property = dpyinfo->Xatom_EMACS_TMP;
-  Atom selection_atom = symbol_to_x_atom (dpyinfo, display, selection_symbol);
+  Atom target_property;
+  Atom selection_atom;
   Atom type_atom;
   int secs, usecs;
   int count = SPECPDL_INDEX ();
   Lisp_Object frame;
 
+  if (! FRAME_X_P (sf))
+    return Qnil;
+
+  requestor_window = FRAME_X_WINDOW (sf);
+  display = FRAME_X_DISPLAY (sf);
+  dpyinfo = FRAME_X_DISPLAY_INFO (sf);
+  target_property = dpyinfo->Xatom_EMACS_TMP;
+  selection_atom = symbol_to_x_atom (dpyinfo, display, selection_symbol);
+
   if (CONSP (target_type))
     type_atom = symbol_to_x_atom (dpyinfo, display, XCAR (target_type));
   else
@@ -2206,6 +2223,9 @@ Disowning it means there is no such selection.  */)
   struct frame *sf = SELECTED_FRAME ();
 
   check_x ();
+  if (! FRAME_X_P (sf))
+    return Qnil;
+
   display = FRAME_X_DISPLAY (sf);
   dpyinfo = FRAME_X_DISPLAY_INFO (sf);
   CHECK_SYMBOL (selection);
@@ -2367,6 +2387,10 @@ DEFUN ("x-get-cut-buffer-internal", Fx_get_cut_buffer_internal,
   struct frame *sf = SELECTED_FRAME ();
 
   check_x ();
+
+  if (! FRAME_X_P (sf))
+    return Qnil;
+
   display = FRAME_X_DISPLAY (sf);
   dpyinfo = FRAME_X_DISPLAY_INFO (sf);
   window = RootWindow (display, 0); /* Cut buffers are on screen 0 */
@@ -2407,6 +2431,10 @@ DEFUN ("x-store-cut-buffer-internal", Fx_store_cut_buffer_internal,
   struct frame *sf = SELECTED_FRAME ();
 
   check_x ();
+
+  if (! FRAME_X_P (sf))
+    return Qnil;
+
   display = FRAME_X_DISPLAY (sf);
   window = RootWindow (display, 0); /* Cut buffers are on screen 0 */
 
@@ -2463,8 +2491,12 @@ Positive means shift the values forward, negative means backward.  */)
   Atom props[8];
   Display *display;
   struct frame *sf = SELECTED_FRAME ();
-
+  
   check_x ();
+
+  if (! FRAME_X_P (sf))
+    return Qnil;
+
   display = FRAME_X_DISPLAY (sf);
   window = RootWindow (display, 0); /* Cut buffers are on screen 0 */
   CHECK_NUMBER (n);
index 4c250fe..1e4618e 100644 (file)
@@ -48,6 +48,7 @@ Boston, MA 02110-1301, USA.  */
 #include "lisp.h"
 #include "systime.h"
 #include "sysselect.h"
+#include "frame.h"
 #include "termhooks.h"
 #include "termopts.h"
 #include "xterm.h"
@@ -510,6 +511,14 @@ x_session_initialize (dpyinfo)
     }
 }
 
+/* Ensure that the session manager is not contacted again. */
+
+void
+x_session_close ()
+{
+  ice_fd = -1;
+}
+
 
 DEFUN ("handle-save-session", Fhandle_save_session,
        Shandle_save_session, 1, 1, "e",
index 75c22a7..7bbd273 100644 (file)
@@ -54,7 +54,6 @@ Boston, MA 02110-1301, USA.  */
 #include <sys/ioctl.h>
 #endif /* ! defined (BSD_SYSTEM) */
 
-#include "systty.h"
 #include "systime.h"
 
 #ifndef INCLUDED_FCNTL
@@ -318,6 +317,10 @@ static Lisp_Object Qalt, Qhyper, Qmeta, Qsuper, Qmodifier_value;
 static Lisp_Object Qvendor_specific_keysyms;
 static Lisp_Object Qlatin_1;
 
+/* Used in x_flush.  */
+
+extern Lisp_Object Vinhibit_redisplay;
+
 extern XrmDatabase x_load_resources P_ ((Display *, char *, char *, char *));
 extern int x_bitmap_mask P_ ((FRAME_PTR, int));
 
@@ -327,13 +330,15 @@ static const XColor *x_color_cells P_ ((Display *, int *));
 static void x_update_window_end P_ ((struct window *, int, int));
 
 static int x_io_error_quitter P_ ((Display *));
+static struct terminal *x_create_terminal P_ ((struct x_display_info *));
+void x_delete_terminal P_ ((struct terminal *));
 static void x_font_min_bounds P_ ((XFontStruct *, int *, int *));
 static int x_compute_min_glyph_bounds P_ ((struct frame *));
 static void x_update_end P_ ((struct frame *));
 static void XTframe_up_to_date P_ ((struct frame *));
-static void XTset_terminal_modes P_ ((void));
-static void XTreset_terminal_modes P_ ((void));
-static void x_clear_frame P_ ((void));
+static void XTset_terminal_modes P_ ((struct terminal *));
+static void XTreset_terminal_modes P_ ((struct terminal *));
+static void x_clear_frame P_ ((struct frame *));
 static void frame_highlight P_ ((struct frame *));
 static void frame_unhighlight P_ ((struct frame *));
 static void x_new_focus_frame P_ ((struct x_display_info *, struct frame *));
@@ -371,12 +376,18 @@ static void
 x_flush (f)
      struct frame *f;
 {
+  /* Don't call XFlush when it is not safe to redisplay; the X
+     connection may be broken.  */
+  if (!NILP (Vinhibit_redisplay))
+    return;
+
   BLOCK_INPUT;
   if (f == NULL)
     {
       Lisp_Object rest, frame;
       FOR_EACH_FRAME (rest, frame)
-       x_flush (XFRAME (frame));
+        if (FRAME_X_P (XFRAME (frame)))
+          x_flush (XFRAME (frame));
     }
   else if (FRAME_X_P (f))
     XFlush (FRAME_X_DISPLAY (f));
@@ -788,7 +799,7 @@ x_draw_fringe_bitmap (w, row, p)
    rarely happens).  */
 
 static void
-XTset_terminal_modes ()
+XTset_terminal_modes (struct terminal *terminal)
 {
 }
 
@@ -796,7 +807,7 @@ XTset_terminal_modes ()
    the X-windows go away, and suspending requires no action.  */
 
 static void
-XTreset_terminal_modes ()
+XTreset_terminal_modes (struct terminal *terminal)
 {
 }
 
@@ -1409,7 +1420,8 @@ x_frame_of_widget (widget)
   for (tail = Vframe_list; GC_CONSP (tail); tail = XCDR (tail))
     if (GC_FRAMEP (XCAR (tail))
        && (f = XFRAME (XCAR (tail)),
-           (f->output_data.nothing != 1
+           (FRAME_X_P (f)
+             && f->output_data.nothing != 1
             && FRAME_X_DISPLAY_INFO (f) == dpyinfo))
        && f->output_data.x->widget == widget)
       return f;
@@ -2786,7 +2798,8 @@ x_shift_glyphs_for_insert (f, x, y, width, height, shift_by)
    for X frames.  */
 
 static void
-x_delete_glyphs (n)
+x_delete_glyphs (f, n)
+     struct frame *f;
      register int n;
 {
   abort ();
@@ -2809,19 +2822,11 @@ x_clear_area (dpy, window, x, y, width, height, exposures)
 }
 
 
-/* Clear entire frame.  If updating_frame is non-null, clear that
-   frame.  Otherwise clear the selected frame.  */
+/* Clear an entire frame.  */
 
 static void
-x_clear_frame ()
+x_clear_frame (struct frame *f)
 {
-  struct frame *f;
-
-  if (updating_frame)
-    f = updating_frame;
-  else
-    f = SELECTED_FRAME ();
-
   /* Clearing the frame will erase any cursor, so mark them all as no
      longer visible.  */
   mark_window_cursors_off (XWINDOW (FRAME_ROOT_WINDOW (f)));
@@ -2900,8 +2905,8 @@ XTflash (f)
       XGCValues values;
 
       values.function = GXxor;
-      values.foreground = (f->output_data.x->foreground_pixel
-                          ^ f->output_data.x->background_pixel);
+      values.foreground = (FRAME_FOREGROUND_PIXEL (f)
+                          ^ FRAME_BACKGROUND_PIXEL (f));
 
       gc = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
                      GCFunction | GCForeground, &values);
@@ -3067,7 +3072,8 @@ XTset_terminal_window (n)
    lines or deleting -N lines at vertical position VPOS.  */
 
 static void
-x_ins_del_lines (vpos, n)
+x_ins_del_lines (f, vpos, n)
+     struct frame *f;
      int vpos, n;
 {
   abort ();
@@ -3704,7 +3710,8 @@ XTmouse_position (fp, insist, bar_window, part, x, y, time)
 
       /* Clear the mouse-moved flag for every frame on this display.  */
       FOR_EACH_FRAME (tail, frame)
-       if (FRAME_X_DISPLAY (XFRAME (frame)) == FRAME_X_DISPLAY (*fp))
+       if (FRAME_X_P (XFRAME (frame))
+            && FRAME_X_DISPLAY (XFRAME (frame)) == FRAME_X_DISPLAY (*fp))
          XFRAME (frame)->mouse_moved = 0;
 
       last_mouse_scroll_bar = Qnil;
@@ -3893,6 +3900,9 @@ x_window_to_scroll_bar (display, window_id)
       if (! GC_FRAMEP (frame))
        abort ();
 
+      if (! FRAME_X_P (XFRAME (frame)))
+        continue;
+      
       /* Scan this frame's scroll bar list for a scroll bar with the
          right window ID.  */
       condemned = FRAME_CONDEMNED_SCROLL_BARS (XFRAME (frame));
@@ -3927,11 +3937,14 @@ x_window_to_menu_bar (window)
        XGCTYPE (tail) == Lisp_Cons;
        tail = XCDR (tail))
     {
-      Lisp_Object frame = XCAR (tail);
-      Widget menu_bar = XFRAME (frame)->output_data.x->menubar_widget;
+      if (FRAME_X_P (XFRAME (XCAR (tail))))
+        {
+          Lisp_Object frame = XCAR (tail);
+          Widget menu_bar = XFRAME (frame)->output_data.x->menubar_widget;
 
-      if (menu_bar && xlwmenu_window_p (menu_bar, window))
-       return menu_bar;
+          if (menu_bar && xlwmenu_window_p (menu_bar, window))
+            return menu_bar;
+        }
     }
 
   return NULL;
@@ -4739,7 +4752,7 @@ x_scroll_bar_create (w, top, left, width, height)
 
     a.background_pixel = f->output_data.x->scroll_bar_background_pixel;
     if (a.background_pixel == -1)
-      a.background_pixel = f->output_data.x->background_pixel;
+      a.background_pixel = FRAME_BACKGROUND_PIXEL (f);
 
     a.event_mask = (ButtonPressMask | ButtonReleaseMask
                    | ButtonMotionMask | PointerMotionHintMask
@@ -4913,7 +4926,7 @@ x_scroll_bar_set_handle (bar, start, end, rebuild)
     /* Restore the foreground color of the GC if we changed it above.  */
     if (f->output_data.x->scroll_bar_foreground_pixel != -1)
       XSetForeground (FRAME_X_DISPLAY (f), gc,
-                     f->output_data.x->foreground_pixel);
+                     FRAME_FOREGROUND_PIXEL (f));
 
     /* Draw the empty space below the handle.  Note that we can't
        clear zero-height areas; that means "clear to end of window." */
@@ -5681,7 +5694,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
   int count = 0;
   int do_help = 0;
   int nbytes = 0;
-  struct frame *f;
+  struct frame *f = NULL;
   struct coding_system coding;
   XEvent event = *eventp;
 
@@ -6251,19 +6264,19 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
           bzero (&compose_status, sizeof (compose_status));
           orig_keysym = keysym;
 
-         /* Common for all keysym input events.  */
-         XSETFRAME (inev.ie.frame_or_window, f);
-         inev.ie.modifiers
-           = x_x_to_emacs_modifiers (FRAME_X_DISPLAY_INFO (f), modifiers);
-         inev.ie.timestamp = event.xkey.time;
-
-         /* First deal with keysyms which have defined
-            translations to characters.  */
-         if (keysym >= 32 && keysym < 128)
-           /* Avoid explicitly decoding each ASCII character.  */
-           {
-             inev.ie.kind = ASCII_KEYSTROKE_EVENT;
-             inev.ie.code = keysym;
+         /* Common for all keysym input events.  */
+         XSETFRAME (inev.ie.frame_or_window, f);
+         inev.ie.modifiers
+           = x_x_to_emacs_modifiers (FRAME_X_DISPLAY_INFO (f), modifiers);
+         inev.ie.timestamp = event.xkey.time;
+
+         /* First deal with keysyms which have defined
+            translations to characters.  */
+         if (keysym >= 32 && keysym < 128)
+           /* Avoid explicitly decoding each ASCII character.  */
+           {
+             inev.ie.kind = ASCII_KEYSTROKE_EVENT;
+             inev.ie.code = keysym;
              goto done_keysym;
            }
 
@@ -6308,18 +6321,18 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
          /* Now non-ASCII.  */
          if (HASH_TABLE_P (Vx_keysym_table)
              && (NATNUMP (c = Fgethash (make_number (keysym),
-                                        Vx_keysym_table,
-                                        Qnil))))
-           {
-             inev.ie.kind = (SINGLE_BYTE_CHAR_P (XFASTINT (c))
-                             ? ASCII_KEYSTROKE_EVENT
-                             : MULTIBYTE_CHAR_KEYSTROKE_EVENT);
-             inev.ie.code = XFASTINT (c);
-             goto done_keysym;
-           }
-
-         /* Random non-modifier sorts of keysyms.  */
-         if (((keysym >= XK_BackSpace && keysym <= XK_Escape)
+                                        Vx_keysym_table,
+                                        Qnil))))
+           {
+             inev.ie.kind = (SINGLE_BYTE_CHAR_P (XFASTINT (c))
+                              ? ASCII_KEYSTROKE_EVENT
+                              : MULTIBYTE_CHAR_KEYSTROKE_EVENT);
+             inev.ie.code = XFASTINT (c);
+             goto done_keysym;
+           }
+         /* Random non-modifier sorts of keysyms.  */
+         if (((keysym >= XK_BackSpace && keysym <= XK_Escape)
                         || keysym == XK_Delete
 #ifdef XK_ISO_Left_Tab
                         || (keysym >= XK_ISO_Left_Tab
@@ -6961,8 +6974,8 @@ x_dispatch_event (event, display)
    EXPECTED is nonzero if the caller knows input is available.  */
 
 static int
-XTread_socket (sd, expected, hold_quit)
-     register int sd;
+XTread_socket (terminal, expected, hold_quit)
+     struct terminal *terminal;
      int expected;
      struct input_event *hold_quit;
 {
@@ -6985,6 +6998,31 @@ XTread_socket (sd, expected, hold_quit)
 
   ++handling_signal;
 
+#ifdef HAVE_X_SM
+  /* Only check session manager input for the primary display. */
+  if (terminal->id == 1 && x_session_have_connection ())
+    {
+      struct input_event inev;
+      BLOCK_INPUT;
+      /* We don't need to EVENT_INIT (inev) here, as
+         x_session_check_input copies an entire input_event.  */
+      if (x_session_check_input (&inev))
+        {
+          kbd_buffer_store_event_hold (&inev, hold_quit);
+          count++;
+        }
+      UNBLOCK_INPUT;
+    }
+#endif
+
+  /* For debugging, this gives a way to fake an I/O error.  */
+  if (terminal->display_info.x == XTread_socket_fake_io_error)
+    {
+      XTread_socket_fake_io_error = 0;
+      x_io_error_quitter (dpyinfo->display);
+    }
+  
+#if 0 /* This loop is a noop now.  */
   /* Find the display we are supposed to read input for.
      It's the one communicating on descriptor SD.  */
   for (dpyinfo = x_display_list; dpyinfo; dpyinfo = dpyinfo->next)
@@ -7015,52 +7053,31 @@ XTread_socket (sd, expected, hold_quit)
 #endif /* HAVE_SELECT */
 #endif /* SIGIO */
 #endif
-
-      /* For debugging, this gives a way to fake an I/O error.  */
-      if (dpyinfo == XTread_socket_fake_io_error)
-       {
-         XTread_socket_fake_io_error = 0;
-         x_io_error_quitter (dpyinfo->display);
-       }
-
-#ifdef HAVE_X_SM
-      {
-       struct input_event inev;
-       BLOCK_INPUT;
-       /* We don't need to EVENT_INIT (inev) here, as
-          x_session_check_input copies an entire input_event.  */
-       if (x_session_check_input (&inev))
-         {
-           kbd_buffer_store_event_hold (&inev, hold_quit);
-           count++;
-         }
-       UNBLOCK_INPUT;
-      }
+    }
 #endif
 
 #ifndef USE_GTK
-      while (XPending (dpyinfo->display))
-       {
-          int finish;
+  while (XPending (terminal->display_info.x->display))
+    {
+      int finish;
 
-         XNextEvent (dpyinfo->display, &event);
+      XNextEvent (terminal->display_info.x->display, &event);
 
 #ifdef HAVE_X_I18N
-          /* Filter events for the current X input method.  */
-          if (x_filter_event (dpyinfo, &event))
-            break;
+      /* Filter events for the current X input method.  */
+      if (x_filter_event (terminal->display_info.x, &event))
+        break;
 #endif
-         event_found = 1;
+      event_found = 1;
 
-          count += handle_one_xevent (dpyinfo, &event, &finish, hold_quit);
+      count += handle_one_xevent (terminal->display_info.x,
+                                  &event, &finish, hold_quit);
 
-          if (finish == X_EVENT_GOTO_OUT)
-            goto out;
-        }
-#endif /* not USE_GTK */
+      if (finish == X_EVENT_GOTO_OUT)
+        goto out;
     }
 
-#ifdef USE_GTK
+#else /* USE_GTK */
 
   /* For GTK we must use the GTK event loop.  But XEvents gets passed
      to our filter function above, and then to the big event switch.
@@ -7371,8 +7388,7 @@ x_draw_window_cursor (w, glyph_row, x, y, cursor_type, cursor_width, on_p, activ
     }
 
 #ifndef XFlush
-  if (updating_frame != f)
-    XFlush (FRAME_X_DISPLAY (f));
+  XFlush (FRAME_X_DISPLAY (f));
 #endif
 }
 
@@ -7610,6 +7626,8 @@ x_clear_errors (dpy)
   x_error_message->string[0] = 0;
 }
 
+#if 0 /* See comment in unwind_to_catch why calling this is a bad
+       * idea.  --lorentey   */
 /* Close off all unclosed x_catch_errors calls.  */
 
 void
@@ -7618,6 +7636,7 @@ x_fully_uncatch_errors ()
   while (x_error_message)
     x_uncatch_errors ();
 }
+#endif
 
 /* Nonzero if x_catch_errors has been done and not yet canceled.  */
 
@@ -7683,6 +7702,7 @@ x_connection_closed (dpy, error_message)
 {
   struct x_display_info *dpyinfo = x_display_info_for_display (dpy);
   Lisp_Object frame, tail;
+  int index = SPECPDL_INDEX ();
 
   error_msg = (char *) alloca (strlen (error_message) + 1);
   strcpy (error_msg, error_message);
@@ -7694,6 +7714,44 @@ x_connection_closed (dpy, error_message)
      the original message here.  */
   x_catch_errors (dpy);
 
+  /* Inhibit redisplay while frames are being deleted. */
+  specbind (Qinhibit_redisplay, Qt);
+
+  if (dpyinfo)
+    {
+      /* Protect display from being closed when we delete the last
+         frame on it. */
+      dpyinfo->reference_count++;
+      dpyinfo->terminal->reference_count++;
+    }
+  
+  /* First delete frames whose mini-buffers are on frames
+     that are on the dead display.  */
+  FOR_EACH_FRAME (tail, frame)
+    {
+      Lisp_Object minibuf_frame;
+      minibuf_frame
+       = WINDOW_FRAME (XWINDOW (FRAME_MINIBUF_WINDOW (XFRAME (frame))));
+      if (FRAME_X_P (XFRAME (frame))
+         && FRAME_X_P (XFRAME (minibuf_frame))
+         && ! EQ (frame, minibuf_frame)
+         && FRAME_X_DISPLAY_INFO (XFRAME (minibuf_frame)) == dpyinfo)
+       Fdelete_frame (frame, Qt);
+    }
+
+  /* Now delete all remaining frames on the dead display.
+     We are now sure none of these is used as the mini-buffer
+     for another frame that we need to delete.  */
+  FOR_EACH_FRAME (tail, frame)
+    if (FRAME_X_P (XFRAME (frame))
+       && FRAME_X_DISPLAY_INFO (XFRAME (frame)) == dpyinfo)
+      {
+       /* Set this to t so that Fdelete_frame won't get confused
+          trying to find a replacement.  */
+       FRAME_KBOARD (XFRAME (frame))->Vdefault_minibuffer_frame = Qt;
+       Fdelete_frame (frame, Qt);
+      }
+
   /* We have to close the display to inform Xt that it doesn't
      exist anymore.  If we don't, Xt will continue to wait for
      events from the display.  As a consequence, a sequence of
@@ -7726,43 +7784,23 @@ x_connection_closed (dpy, error_message)
     xg_display_close (dpyinfo->display);
 #endif
 
-  /* Indicate that this display is dead.  */
   if (dpyinfo)
-    dpyinfo->display = 0;
-
-  /* First delete frames whose mini-buffers are on frames
-     that are on the dead display.  */
-  FOR_EACH_FRAME (tail, frame)
     {
-      Lisp_Object minibuf_frame;
-      minibuf_frame
-       = WINDOW_FRAME (XWINDOW (FRAME_MINIBUF_WINDOW (XFRAME (frame))));
-      if (FRAME_X_P (XFRAME (frame))
-         && FRAME_X_P (XFRAME (minibuf_frame))
-         && ! EQ (frame, minibuf_frame)
-         && FRAME_X_DISPLAY_INFO (XFRAME (minibuf_frame)) == dpyinfo)
-       Fdelete_frame (frame, Qt);
-    }
+      /* Indicate that this display is dead.  */
+      dpyinfo->display = 0;
 
-  /* Now delete all remaining frames on the dead display.
-     We are now sure none of these is used as the mini-buffer
-     for another frame that we need to delete.  */
-  FOR_EACH_FRAME (tail, frame)
-    if (FRAME_X_P (XFRAME (frame))
-       && FRAME_X_DISPLAY_INFO (XFRAME (frame)) == dpyinfo)
-      {
-       /* Set this to t so that Fdelete_frame won't get confused
-          trying to find a replacement.  */
-       FRAME_KBOARD (XFRAME (frame))->Vdefault_minibuffer_frame = Qt;
-       Fdelete_frame (frame, Qt);
-      }
+      dpyinfo->reference_count--;
+      dpyinfo->terminal->reference_count--;
+      if (dpyinfo->reference_count != 0)
+        /* We have just closed all frames on this display. */
+        abort ();
 
-  if (dpyinfo)
-    x_delete_display (dpyinfo);
+      x_delete_display (dpyinfo);
+    }
 
   x_uncatch_errors ();
 
-  if (x_display_list == 0)
+  if (terminal_list == 0)
     {
       fprintf (stderr, "%s\n", error_msg);
       shut_down_emacs (0, 0, Qnil);
@@ -7776,6 +7814,7 @@ x_connection_closed (dpy, error_message)
   sigunblock (sigmask (SIGALRM));
   TOTALLY_UNBLOCK_INPUT;
 
+  unbind_to (index, Qnil);
   clear_waiting_for_input ();
   error ("%s", error_msg);
 }
@@ -7986,7 +8025,7 @@ xim_destroy_callback (xim, client_data, call_data)
   FOR_EACH_FRAME (tail, frame)
     {
       struct frame *f = XFRAME (frame);
-      if (FRAME_X_DISPLAY_INFO (f) == dpyinfo)
+      if (FRAME_X_P (f) && FRAME_X_DISPLAY_INFO (f) == dpyinfo)
        {
          FRAME_XIC (f) = NULL;
           xic_free_xfontset (f);
@@ -8085,7 +8124,8 @@ xim_instantiate_callback (display, client_data, call_data)
        {
          struct frame *f = XFRAME (frame);
 
-         if (FRAME_X_DISPLAY_INFO (f) == xim_inst->dpyinfo)
+         if (FRAME_X_P (f)
+              && FRAME_X_DISPLAY_INFO (f) == xim_inst->dpyinfo)
            if (FRAME_XIC (f) == NULL)
              {
                create_frame_xic (f);
@@ -9213,8 +9253,8 @@ x_free_frame_resources (f)
        XDestroyWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f));
 #endif /* !USE_X_TOOLKIT */
 
-      unload_color (f, f->output_data.x->foreground_pixel);
-      unload_color (f, f->output_data.x->background_pixel);
+      unload_color (f, FRAME_FOREGROUND_PIXEL (f));
+      unload_color (f, FRAME_BACKGROUND_PIXEL (f));
       unload_color (f, f->output_data.x->cursor_pixel);
       unload_color (f, f->output_data.x->cursor_foreground_pixel);
       unload_color (f, f->output_data.x->border_pixel);
@@ -10380,6 +10420,7 @@ x_term_init (display_name, xrm_option, resource_name)
 {
   int connection;
   Display *dpy;
+  struct terminal *terminal;
   struct x_display_info *dpyinfo;
   XrmDatabase xrdb;
 
@@ -10399,14 +10440,26 @@ x_term_init (display_name, xrm_option, resource_name)
     char **argv2 = argv;
     GdkAtom atom;
 
+#ifndef HAVE_GTK_MULTIDISPLAY
+    if (!EQ (Vinitial_window_system, intern ("x")))
+      error ("Sorry, you cannot connect to X servers with the GTK toolkit");
+#endif
+
     if (x_initialized++ > 1)
       {
+#ifdef HAVE_GTK_MULTIDISPLAY
         /* Opening another display.  If xg_display_open returns less
            than zero, we are probably on GTK 2.0, which can only handle
            one display.  GTK 2.2 or later can handle more than one.  */
         if (xg_display_open (SDATA (display_name), &dpy) < 0)
           error ("Sorry, this version of GTK can only handle one display");
-     }
+#else
+        /* XXX Unfortunately, multiple display support is severely broken
+           in recent GTK versions, so HAVE_GTK_MULTIDISPLAY is
+           unconditionally disabled in configure.in.  */
+        error ("Sorry, multiple display support is broken in current GTK versions");
+#endif
+      }
     else
       {
         for (argc = 0; argc < NUM_ARGV; ++argc)
@@ -10510,6 +10563,8 @@ x_term_init (display_name, xrm_option, resource_name)
   dpyinfo = (struct x_display_info *) xmalloc (sizeof (struct x_display_info));
   bzero (dpyinfo, sizeof *dpyinfo);
 
+  terminal = x_create_terminal (dpyinfo);
+
 #ifdef MULTI_KBOARD
   {
     struct x_display_info *share;
@@ -10521,30 +10576,30 @@ x_term_init (display_name, xrm_option, resource_name)
                         SDATA (display_name)))
        break;
     if (share)
-      dpyinfo->kboard = share->kboard;
+      terminal->kboard = share->terminal->kboard;
     else
       {
-       dpyinfo->kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
-       init_kboard (dpyinfo->kboard);
+       terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD));
+       init_kboard (terminal->kboard);
        if (!EQ (XSYMBOL (Qvendor_specific_keysyms)->function, Qunbound))
          {
            char *vendor = ServerVendor (dpy);
            UNBLOCK_INPUT;
-           dpyinfo->kboard->Vsystem_key_alist
+           terminal->kboard->Vsystem_key_alist
              = call1 (Qvendor_specific_keysyms,
                       build_string (vendor ? vendor : ""));
            BLOCK_INPUT;
          }
 
-       dpyinfo->kboard->next_kboard = all_kboards;
-       all_kboards = dpyinfo->kboard;
+       terminal->kboard->next_kboard = all_kboards;
+       all_kboards = terminal->kboard;
        /* Don't let the initial kboard remain current longer than necessary.
           That would cause problems if a file loaded on startup tries to
           prompt in the mini-buffer.  */
        if (current_kboard == initial_kboard)
-         current_kboard = dpyinfo->kboard;
+         current_kboard = terminal->kboard;
       }
-    dpyinfo->kboard->reference_count++;
+    terminal->kboard->reference_count++;
   }
 #endif
 
@@ -10559,6 +10614,11 @@ x_term_init (display_name, xrm_option, resource_name)
 
   dpyinfo->display = dpy;
 
+  /* Set the name of the terminal. */
+  terminal->name = (char *) xmalloc (SBYTES (display_name) + 1);
+  strncpy (terminal->name, SDATA (display_name), SBYTES (display_name));
+  terminal->name[SBYTES (display_name)] = 0;
+  
 #if 0
   XSetAfterFunction (x_current_display, x_trace_wire);
 #endif /* ! 0 */
@@ -10850,8 +10910,10 @@ x_term_init (display_name, xrm_option, resource_name)
   }
 
 #ifdef HAVE_X_SM
-  /* Only do this for the first display.  */
-  if (!x_session_initialized++)
+  /* Only do this for the very first display in the Emacs session.
+     Ignore X session management when Emacs was first started on a
+     tty.  */
+  if (terminal->id == 1)
     x_session_initialize (dpyinfo);
 #endif
 
@@ -10860,7 +10922,7 @@ x_term_init (display_name, xrm_option, resource_name)
   return dpyinfo;
 }
 \f
-/* Get rid of display DPYINFO, assuming all frames are already gone,
+/* Get rid of display DPYINFO, deleting all frames on it,
    and without sending any more commands to the X server.  */
 
 void
@@ -10868,6 +10930,20 @@ x_delete_display (dpyinfo)
      struct x_display_info *dpyinfo;
 {
   int i;
+  struct terminal *t;
+
+  /* Close all frames and delete the generic struct terminal for this
+     X display.  */
+  for (t = terminal_list; t; t = t->next_terminal)
+    if (t->type == output_x_window && t->display_info.x == dpyinfo)
+      {
+        /* Close X session management when we close its display.  */
+        if (t->id == 1 && x_session_have_connection ())
+          x_session_close();
+
+        delete_terminal (t);
+        break;
+      }
 
   delete_keyboard_wait_descriptor (dpyinfo->connection);
 
@@ -10911,10 +10987,6 @@ x_delete_display (dpyinfo)
   XrmDestroyDatabase (dpyinfo->xrdb);
 #endif
 #endif
-#ifdef MULTI_KBOARD
-  if (--dpyinfo->kboard->reference_count == 0)
-    delete_kboard (dpyinfo->kboard);
-#endif
 #ifdef HAVE_X_I18N
   if (dpyinfo->xim)
     xim_close_dpy (dpyinfo);
@@ -10996,71 +11068,129 @@ x_activate_timeout_atimer ()
 extern frame_parm_handler x_frame_parm_handlers[];
 
 static struct redisplay_interface x_redisplay_interface =
-{
-  x_frame_parm_handlers,
-  x_produce_glyphs,
-  x_write_glyphs,
-  x_insert_glyphs,
-  x_clear_end_of_line,
-  x_scroll_run,
-  x_after_update_window_line,
-  x_update_window_begin,
-  x_update_window_end,
-  x_cursor_to,
-  x_flush,
+  {
+    x_frame_parm_handlers,
+    x_produce_glyphs,
+    x_write_glyphs,
+    x_insert_glyphs,
+    x_clear_end_of_line,
+    x_scroll_run,
+    x_after_update_window_line,
+    x_update_window_begin,
+    x_update_window_end,
+    x_cursor_to,
+    x_flush,
 #ifdef XFlush
-  x_flush,
+    x_flush,
 #else
-  0,  /* flush_display_optional */
-#endif
-  x_clear_window_mouse_face,
-  x_get_glyph_overhangs,
-  x_fix_overlapping_area,
-  x_draw_fringe_bitmap,
-  0, /* define_fringe_bitmap */
-  0, /* destroy_fringe_bitmap */
-  x_per_char_metric,
-  x_encode_char,
-  x_compute_glyph_string_overhangs,
-  x_draw_glyph_string,
-  x_define_frame_cursor,
-  x_clear_frame_area,
-  x_draw_window_cursor,
-  x_draw_vertical_window_border,
-  x_shift_glyphs_for_insert
-};
+    0,  /* flush_display_optional */
+#endif
+    x_clear_window_mouse_face,
+    x_get_glyph_overhangs,
+    x_fix_overlapping_area,
+    x_draw_fringe_bitmap,
+    0, /* define_fringe_bitmap */
+    0, /* destroy_fringe_bitmap */
+    x_per_char_metric,
+    x_encode_char,
+    x_compute_glyph_string_overhangs,
+    x_draw_glyph_string,
+    x_define_frame_cursor,
+    x_clear_frame_area,
+    x_draw_window_cursor,
+    x_draw_vertical_window_border,
+    x_shift_glyphs_for_insert
+  };
+
+
+/* This function is called when the last frame on a display is deleted. */
+void
+x_delete_terminal (struct terminal *terminal)
+{
+  struct x_display_info *dpyinfo = terminal->display_info.x;
+  int i;
+
+  /* Protect against recursive calls.  Fdelete_frame in
+     delete_terminal calls us back when it deletes our last frame.  */
+  if (terminal->deleted)
+    return;
+
+  BLOCK_INPUT;
+  /* Free the fonts in the font table.  */
+  for (i = 0; i < dpyinfo->n_fonts; i++)
+    if (dpyinfo->font_table[i].name)
+      {
+       XFreeFont (dpyinfo->display, dpyinfo->font_table[i].font);
+      }
+
+  x_destroy_all_bitmaps (dpyinfo);
+  XSetCloseDownMode (dpyinfo->display, DestroyAll);
+
+#ifdef USE_GTK
+  xg_display_close (dpyinfo->display);
+#else
+#ifdef USE_X_TOOLKIT
+  XtCloseDisplay (dpyinfo->display);
+#else
+  XCloseDisplay (dpyinfo->display);
+#endif
+#endif /* ! USE_GTK */
+
+  x_delete_display (dpyinfo);
+  UNBLOCK_INPUT;
+}
+
+
+static struct terminal *
+x_create_terminal (struct x_display_info *dpyinfo)
+{
+  struct terminal *terminal;
+  
+  terminal = create_terminal ();
+
+  terminal->type = output_x_window;
+  terminal->display_info.x = dpyinfo;
+  dpyinfo->terminal = terminal;
+
+  /* kboard is initialized in x_term_init. */
+  
+  terminal->clear_frame_hook = x_clear_frame;
+  terminal->ins_del_lines_hook = x_ins_del_lines;
+  terminal->delete_glyphs_hook = x_delete_glyphs;
+  terminal->ring_bell_hook = XTring_bell;
+  terminal->reset_terminal_modes_hook = XTreset_terminal_modes;
+  terminal->set_terminal_modes_hook = XTset_terminal_modes;
+  terminal->update_begin_hook = x_update_begin;
+  terminal->update_end_hook = x_update_end;
+  terminal->set_terminal_window_hook = XTset_terminal_window;
+  terminal->read_socket_hook = XTread_socket;
+  terminal->frame_up_to_date_hook = XTframe_up_to_date;
+  terminal->mouse_position_hook = XTmouse_position;
+  terminal->frame_rehighlight_hook = XTframe_rehighlight;
+  terminal->frame_raise_lower_hook = XTframe_raise_lower;
+  terminal->fullscreen_hook = XTfullscreen_hook;
+  terminal->set_vertical_scroll_bar_hook = XTset_vertical_scroll_bar;
+  terminal->condemn_scroll_bars_hook = XTcondemn_scroll_bars;
+  terminal->redeem_scroll_bar_hook = XTredeem_scroll_bar;
+  terminal->judge_scroll_bars_hook = XTjudge_scroll_bars;
+
+  terminal->delete_frame_hook = x_destroy_window;
+  terminal->delete_terminal_hook = x_delete_terminal;
+  
+  terminal->rif = &x_redisplay_interface;
+  terminal->scroll_region_ok = 1;    /* We'll scroll partial frames. */
+  terminal->char_ins_del_ok = 1;
+  terminal->line_ins_del_ok = 1;         /* We'll just blt 'em. */
+  terminal->fast_clear_end_of_line = 1;  /* X does this well. */
+  terminal->memory_below_frame = 0;   /* We don't remember what scrolls
+                                        off the bottom. */
+
+  return terminal;
+}
 
 void
 x_initialize ()
 {
-  rif = &x_redisplay_interface;
-
-  clear_frame_hook = x_clear_frame;
-  ins_del_lines_hook = x_ins_del_lines;
-  delete_glyphs_hook = x_delete_glyphs;
-  ring_bell_hook = XTring_bell;
-  reset_terminal_modes_hook = XTreset_terminal_modes;
-  set_terminal_modes_hook = XTset_terminal_modes;
-  update_begin_hook = x_update_begin;
-  update_end_hook = x_update_end;
-  set_terminal_window_hook = XTset_terminal_window;
-  read_socket_hook = XTread_socket;
-  frame_up_to_date_hook = XTframe_up_to_date;
-  mouse_position_hook = XTmouse_position;
-  frame_rehighlight_hook = XTframe_rehighlight;
-  frame_raise_lower_hook = XTframe_raise_lower;
-  set_vertical_scroll_bar_hook = XTset_vertical_scroll_bar;
-  condemn_scroll_bars_hook = XTcondemn_scroll_bars;
-  redeem_scroll_bar_hook = XTredeem_scroll_bar;
-  judge_scroll_bars_hook = XTjudge_scroll_bars;
-  fullscreen_hook = XTfullscreen_hook;
-
-  scroll_region_ok = 1;                /* we'll scroll partial frames */
-  char_ins_del_ok = 1;
-  line_ins_del_ok = 1;         /* we'll just blt 'em */
-  fast_clear_end_of_line = 1;  /* X does this well */
-  memory_below_frame = 0;      /* we don't remember what scrolls
-                                  off the bottom */
   baud_rate = 19200;
 
   x_noop_count = 0;
@@ -11076,7 +11206,7 @@ x_initialize ()
 #endif
 
   /* Try to use interrupt input; if we can't, then start polling.  */
-  Fset_input_mode (Qt, Qnil, Qt, Qnil);
+  Fset_input_interrupt_mode (Qt);
 
 #ifdef USE_X_TOOLKIT
   XtToolkitInitialize ();
@@ -11107,9 +11237,11 @@ x_initialize ()
   XSetIOErrorHandler (x_io_error_quitter);
 
   /* Disable Window Change signals;  they are handled by X events.  */
+#if 0              /* Don't.  We may want to open tty frames later. */
 #ifdef SIGWINCH
   signal (SIGWINCH, SIG_DFL);
 #endif /* SIGWINCH */
+#endif
 
   signal (SIGPIPE, x_connection_signal);
 }
index af4225a..1ea50b8 100644 (file)
@@ -149,6 +149,9 @@ struct x_display_info
   /* Chain of all x_display_info structures.  */
   struct x_display_info *next;
 
+  /* The generic display parameters corresponding to this X display. */
+  struct terminal *terminal;
+
   /* Connection number (normally a file descriptor number).  */
   int connection;
 
@@ -327,9 +330,6 @@ struct x_display_info
   /* Atom used in toolkit scroll bar client messages.  */
   Atom Xatom_Scrollbar;
 
-#ifdef MULTI_KBOARD
-  struct kboard *kboard;
-#endif
   int cut_buffers_initialized; /* Whether we're sure they all exist */
 
   /* The frame (if any) which has the X window that has keyboard focus.
@@ -529,8 +529,10 @@ struct x_output
 
   /* Pixel values used for various purposes.
      border_pixel may be -1 meaning use a gray tile.  */
+#if 0 /* These are also defined in struct frame.  Use that instead.  */
   unsigned long background_pixel;
   unsigned long foreground_pixel;
+#endif
   unsigned long cursor_pixel;
   unsigned long border_pixel;
   unsigned long mouse_pixel;
@@ -981,7 +983,6 @@ extern int x_had_errors_p P_ ((Display *));
 extern int x_catching_errors P_ ((void));
 extern void x_uncatch_errors P_ ((void));
 extern void x_clear_errors P_ ((Display *));
-extern void x_fully_uncatch_errors P_ ((void));
 extern void x_set_window_size P_ ((struct frame *, int, int, int));
 extern void x_set_mouse_position P_ ((struct frame *, int, int));
 extern void x_set_mouse_pixel_position P_ ((struct frame *, int, int));
@@ -996,6 +997,7 @@ extern void x_wm_set_size_hint P_ ((struct frame *, long, int));
 extern void x_wm_set_window_state P_ ((struct frame *, int));
 extern void x_wm_set_icon_pixmap P_ ((struct frame *, int));
 extern void x_delete_display P_ ((struct x_display_info *));
+extern void x_delete_terminal P_ ((struct terminal *terminal));
 extern void x_initialize P_ ((void));
 extern unsigned long x_copy_color P_ ((struct frame *, unsigned long));
 #ifdef USE_X_TOOLKIT
@@ -1096,6 +1098,7 @@ extern void widget_store_internal_border P_ ((Widget));
 extern void x_session_initialize P_ ((struct x_display_info *dpyinfo));
 extern int x_session_check_input P_ ((struct input_event *bufp));
 extern int x_session_have_connection P_ ((void));
+extern void x_session_close P_ ((void));
 #endif
 
 #define FONT_TYPE_FOR_UNIBYTE(font, ch) 0