XEmacs 21.2.36 "Notos"
authorkazuhiko <kazuhiko>
Thu, 5 Oct 2000 05:07:19 +0000 (05:07 +0000)
committerkazuhiko <kazuhiko>
Thu, 5 Oct 2000 05:07:19 +0000 (05:07 +0000)
369 files changed:
CHANGES-beta
ChangeLog
Makefile.in.in
PROBLEMS
aclocal.m4
configure
configure.in
configure.usage
dynodump/dynodump.c
etc/CHARSETS
etc/Emacs.ad
etc/NEWS
etc/OONEWS
etc/gnuserv.1
etc/xemacs-fe.sh
etc/xemacs.1
info/emodules.info
info/info.info
info/internals.info
info/internals.info-1
info/lispref.info
info/xemacs-faq.info
info/xemacs-faq.info-1
info/xemacs-faq.info-2
info/xemacs.info
info/xemacs.info-3
info/xemacs.info-4
lib-src/ChangeLog
lib-src/cvtmail.c
lib-src/ellcc.c
lib-src/etags.c
lib-src/fakemail.c
lib-src/gnuclient.c
lib-src/gnuserv.c
lib-src/hexl.c
lib-src/make-msgfile.c
lisp/ChangeLog
lisp/ChangeLog.1
lisp/auto-autoloads.el
lisp/autoload.el
lisp/build-report.el
lisp/byte-optimize.el
lisp/bytecomp.el
lisp/cl-macs.el
lisp/cl-seq.el
lisp/cl.el
lisp/cmdloop.el
lisp/code-files.el
lisp/code-process.el
lisp/cus-dep.el
lisp/cus-edit.el
lisp/cus-face.el
lisp/cus-file.el
lisp/custom-load.el
lisp/custom.el
lisp/dialog.el
lisp/dragdrop.el
lisp/dumped-lisp.el
lisp/easymenu.el
lisp/extents.el
lisp/faces.el
lisp/files.el
lisp/find-paths.el
lisp/finder.el
lisp/font-lock.el
lisp/glyphs.el
lisp/gpm.el
lisp/gutter-items.el
lisp/gutter.el
lisp/help.el
lisp/info.el
lisp/isearch-mode.el
lisp/keydefs.el
lisp/ldap.el
lisp/lisp-mode.el
lisp/menubar-items.el
lisp/menubar.el
lisp/minibuf.el
lisp/modeline.el
lisp/mouse.el
lisp/movemail.el
lisp/mule/mule-ccl.el
lisp/mule/mule-cmds.el
lisp/mule/mule-coding.el
lisp/obsolete.el
lisp/package-admin.el
lisp/package-get.el
lisp/package-ui.el
lisp/paths.el
lisp/printer.el
lisp/process.el
lisp/replace.el
lisp/select.el
lisp/simple.el
lisp/startup.el
lisp/subr.el
lisp/toolbar-items.el
lisp/update-elc.el
lisp/userlock.el
lisp/wid-edit.el
lisp/window-xemacs.el
lisp/window.el
lisp/x-faces.el
lisp/x-font-menu.el
lisp/x-init.el
lwlib/ChangeLog
lwlib/lwlib-Xaw.c
lwlib/lwlib-Xm.c
lwlib/lwlib-internal.h
lwlib/lwlib.c
lwlib/lwlib.h
lwlib/xlwcheckbox.c
lwlib/xlwgauge.c
lwlib/xlwgauge.h
lwlib/xlwgcs.c
lwlib/xlwgcs.h
lwlib/xlwmenu.c
lwlib/xlwradio.c
lwlib/xlwradioP.h
lwlib/xlwtabs.c
man/ChangeLog
man/emodules.texi
man/info.texi
man/internals/internals.texi
man/lispref/buffers.texi
man/lispref/consoles-devices.texi
man/lispref/databases.texi
man/lispref/hash-tables.texi
man/lispref/loading.texi
man/lispref/minibuf.texi
man/lispref/mule.texi
man/lispref/processes.texi
man/lispref/searching.texi
man/lispref/windows.texi
man/xemacs-faq.texi
man/xemacs/custom.texi
man/xemacs/glossary.texi
man/xemacs/help.texi
man/xemacs/mule.texi
man/xemacs/search.texi
man/xemacs/startup.texi
modules/sample/sample.c
nt/ChangeLog
nt/PROBLEMS
nt/README
nt/config.h
nt/xemacs.dsp
nt/xemacs.dsw
nt/xemacs.mak
src/ChangeLog
src/ChangeLog.1
src/ChangeLog.2
src/Makefile.in.in
src/alloc.c
src/alloca.c
src/buffer.c
src/buffer.h
src/bufslots.h
src/bytecode.c
src/callproc.c
src/config.h.in
src/console-msw.c
src/console-msw.h
src/console-tty.c
src/console-x.c
src/console-x.h
src/console.h
src/data.c
src/depend
src/device-msw.c
src/device-x.c
src/device.c
src/device.h
src/dialog-msw.c
src/dialog-x.c
src/dialog.c
src/dired-msw.c
src/dired.c
src/dumper.c
src/editfns.c
src/eldap.c
src/elhash.c
src/emacs.c
src/emodules.c
src/emodules.h
src/eval.c
src/event-Xt.c
src/event-msw.c
src/event-stream.c
src/events-mod.h
src/events.c
src/events.h
src/extents.c
src/file-coding.c
src/fileio.c
src/filelock.c
src/fns.c
src/font-lock.c
src/frame-msw.c
src/frame-tty.c
src/frame-x.c
src/frame.c
src/frame.h
src/general.c
src/getloadavg.c
src/glyphs-eimage.c
src/glyphs-msw.c
src/glyphs-widget.c
src/glyphs-x.c
src/glyphs-x.h
src/glyphs.c
src/glyphs.h
src/gpmevent.c
src/gui-msw.c
src/gui-x.c
src/gui-x.h
src/gui.c
src/gui.h
src/gutter.c
src/inline.c
src/input-method-xlib.c
src/insdel.c
src/keymap.c
src/keymap.h
src/line-number.c
src/lisp-disunion.h
src/lisp-union.h
src/lisp.h
src/lread.c
src/lrecord.h
src/lstream.h
src/m/acorn.h
src/m/alliant-2800.h
src/m/alliant.h
src/m/amdahl.h
src/m/apollo.h
src/m/arm.h
src/m/att3b.h
src/m/aviion.h
src/m/clipper.h
src/m/cnvrgnt.h
src/m/convex.h
src/m/cydra5.h
src/m/delta.h
src/m/delta88k.h
src/m/dpx2.h
src/m/elxsi.h
src/m/ews4800r.h
src/m/gould.h
src/m/hp800.h
src/m/hp9000s300.h
src/m/i860.h
src/m/ibmps2-aix.h
src/m/ibmrt.h
src/m/intel386.h
src/m/iris4d.h
src/m/iris5d.h
src/m/iris6d.h
src/m/irist.h
src/m/m68k.h
src/m/masscomp.h
src/m/mg1.h
src/m/mips-nec.h
src/m/mips-siemens.h
src/m/mips.h
src/m/nh3000.h
src/m/nh4000.h
src/m/ns32000.h
src/m/plexus.h
src/m/powerpc.h
src/m/sequent-ptx.h
src/m/sequent.h
src/m/sgi-challenge.h
src/m/stride.h
src/m/tad68k.h
src/m/targon31.h
src/m/tekxd88.h
src/m/template.h
src/m/tower32.h
src/m/tower32v3.h
src/m/ustation.h
src/m/wicat.h
src/m/windowsnt.h
src/m/xps100.h
src/make-src-depend
src/menubar-msw.c
src/menubar-x.c
src/menubar.c
src/menubar.h
src/mule-ccl.c
src/mule-charset.c
src/mule-charset.h
src/mule-wnnfns.c
src/nas.c
src/nt.c
src/ntproc.c
src/objects-msw.c
src/objects-msw.h
src/objects-x.c
src/objects-x.h
src/objects.c
src/offix.h
src/print.c
src/process-nt.c
src/process-unix.c
src/process.c
src/process.h
src/rangetab.c
src/redisplay-msw.c
src/redisplay-output.c
src/redisplay-tty.c
src/redisplay-x.c
src/redisplay.c
src/redisplay.h
src/regex.c
src/s/aix3-1.h
src/s/bsd386.h
src/s/cygwin32.h
src/s/freebsd.h
src/s/gnu.h
src/s/irix4-0.h
src/s/irix5-0.h
src/s/linux.h
src/s/mingw32.h
src/s/netbsd.h
src/s/sol2.h
src/s/windowsnt.h
src/scrollbar-msw.c
src/scrollbar-x.c
src/scrollbar.c
src/search.c
src/select-msw.c
src/select-x.c
src/select.c
src/select.h
src/sound.c
src/specifier.c
src/specifier.h
src/symbols.c
src/symeval.h
src/symsinit.h
src/syntax.c
src/syntax.h
src/sysdep.c
src/sysdll.c
src/sysdll.h
src/sysfile.h
src/sysproc.h
src/syssignal.h
src/systty.h
src/syswindows.h
src/termcap.c
src/toolbar-x.c
src/toolbar.c
src/tooltalk.c
src/unexcw.c
src/unexhp9k800.c
src/unexnt.c
src/vm-limit.c
src/window.c
src/winslots.h
tests/ChangeLog
tests/DLL/dltest.c
tests/automated/hash-table-tests.el
tests/automated/lisp-tests.el
tests/automated/mule-tests.el
tests/glyph-test.el
tests/gutter-test.el
version.sh

index 1819931..aefa0ef 100644 (file)
@@ -1,3 +1,26 @@
+to 21.2.36 "Notus"
+-- Fix build problems on AIX 4.3 -- Martin Buchholz
+-- Fix build problems on HP-UX 10.20 -- Alexandre Oliva and Martin Buchholz
+-- Fix build problems on SunOS 4.1.4 -- Martin Buchholz
+-- Fix build problems on IA64/Linux -- Martin Buchholz
+-- Fix build problems on Alpha/Linux -- Steve Baur
+-- Fix build problems on Unixware -- Martin Buchholz
+-- Support pty input lines longer than 512 bytes on HP-UX 10.20. -- Martin Buchholz
+-- `equal' of hash tables is now the same as `eq'. -- Martin Buchholz
+-- ucs fixes - Daiki Ueno
+-- Lots of little doc fixes. -- Martin Buchholz
+-- Process-signaling code rewritten -- Martin Buchholz
+-- pty allocation code rewritten -- Martin Buchholz
+-- The byte compiler generates more efficient code -- Martin Buchholz
+-- build-report fixes -- Adrian Aichner
+-- next-window/next-frame functions rewritten -- Martin Buchholz
+-- Windows fixes -- Jonathan Harris
+-- Multiple info buffer support -- Golubev I. N.
+-- regex crash fixes -- Yoshiki Hayashi
+-- Widget/windows fixes -- Andy Piper
+-- structured lisp errors -- Ben Wing
+-- allow modules to define their own lisp object types -- Andrew Begel
+
 to 21.2.35 "Nike"
 -- You now again build XEmacs in a directory containing a predefined
    CPP symbol -- Martin Buchholz
@@ -29,7 +52,7 @@ to 21.2.34 "Molpe"
 to 21.2.33 "Melpomene"
 -- Yet more progress gauge and gutter redisplay fixes from Andy Piper
 -- glyph error checking from Andy Piper
--- Proper implementation of string glyps makes them Mule safe (IKEYAMA Tomonori)
+-- Proper implementation of string glyphs makes them Mule safe (IKEYAMA Tomonori)
 -- Bug fixes from the usual suspects
 -- --with-clash-detection now defaults to `yes', at least for betas.
 -- Autoconf support for detecting how to #include header files
@@ -50,7 +73,7 @@ to 21.2.32 "Kastor & Polydeukes"
 -- Internal Postgres RDBMS support from Steve Baur
 -- Improve gutter useability
 -- Fix window geometry with gutters
--- Fix async updates so that they only occur when neccessary
+-- Fix async updates so that they only occur when necessary
 -- Gutter documentation from Stephen Turnbull
 -- redisplay-gutter-area fixes from Andy Piper
 -- pdump file in MS-Windows executable from Mike Alexander
@@ -62,7 +85,7 @@ to 21.2.31 "Iris"
 -- Make XEmacs work on Windows again.
 
 to 21.2.30 "Hygeia"
--- Make (find-tag-other-window) always use other window, 
+-- Make (find-tag-other-window) always use other window,
    even if tag is found in buffer of current window, Samuel Mikes
 -- Make configure complain about broken compiler versions (Jan Vroonhof, Yoshiki Hayashi, Bill Perry)
 -- `write-region' now deals properly with non-ASCII file names, Martin Buchholz
@@ -77,7 +100,7 @@ to 21.2.30 "Hygeia"
 
 to 21.2.29 "Hestia"
 -- Fix compile errors on pre-X11R6 systems, introduced in 21.2.28.
--- Fix autodetection of Berkeley DB on Linux Glibc 2 systems.  
+-- Fix autodetection of Berkeley DB on Linux Glibc 2 systems.
    (but more work needed)
 -- Allow non-symbols (anything compared with `eq') in object plists.
 -- Cleanup of property frobbing code.
index d3cc540..40a41b4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,91 @@
+2000-10-04  Martin Buchholz <martin@xemacs.org>
+
+       * XEmacs 21.2.36 is released.
+
+2000-08-29  Robert Pluim  <rpluim@bigfoot.com>
+
+       *  etc/NEWS: fix reference to progress-feedback-use-echo-area
+
+2000-09-27  Martin Buchholz  <martin@xemacs.org>
+
+       * configure.in: Big signal/process handling overhaul.
+       Autoconfiscate lots of functions and headers:
+       getpt _getpt grantpt unlockpt ptsname killpg tcgetpgrp
+       openpty pty.h libutil.h sys/stropts.h sys/strtio.h isastream
+
+2000-09-20  Martin Buchholz  <martin@xemacs.org>
+
+       * etc/xemacs.1: Spelling fixes.  Remove stuff that doesn't belong.
+
+2000-09-19  Martin Buchholz  <martin@xemacs.org>
+
+       * *: Spelling mega-patch
+
+2000-09-16  Martin Buchholz  <martin@xemacs.org>
+
+       * configure.in: Remove strcasecmp.
+
+       * etc/Emacs.ad: Remove Energize from comments.
+
+2000-09-16  Martin Buchholz  <martin@xemacs.org>
+
+       * configure.in: Add -Kalloca to $c_switch_system when using
+       Unixware native compiler (if necessary).
+
+2000-09-15  Martin Buchholz  <martin@xemacs.org>
+
+       * configure.in: Prevent spurious "No" in configure output when not
+       using gcc.  Oh, and it's "no", not "No".  Oh, and it's "yes", not "Yes".
+
+2000-09-14  Martin Buchholz  <martin@xemacs.org>
+
+       * configure.in: Save 2 sed process invocations per Makefile.
+
+2000-08-22  SL Baur  <steve@turbolinux.co.jp>
+
+       * configure.in (after_morecore_hook_exists): Don't add /usr/shlib
+       to link path if compiling on Alpha/Linux.
+
+2000-09-01  Martin Buchholz  <martin@xemacs.org>
+
+       * Makefile.in.in (depend): cd to the correct directory.
+
+2000-08-31  Martin Buchholz  <martin@xemacs.org>
+
+       * configure.in: with_widgets is incompatible with X11 R4.
+
+       * configure.in: Make Balloon Help conditional on finding shape.h
+
+2000-08-02  Stephen J. Turnbull <stephen@xemacs.org>
+
+       * etc/Emacs.ad: Document usage of FontSet resource for menubar.
+
+2000-08-09  Vin Shelton  <acs@xemacs.org>
+
+       * configure.in: Check for UNIX98 PTYs.  Patch from Florian Weimer
+       <Florian.Weimer@RUS.Uni-Stuttgart.DE>.
+
+2000-07-31  Yoshiki Hayashi  <yoshiki@xemacs.org>
+
+       * configure.usage: Remove lockdir document.
+
+2000-07-31  Martin Buchholz  <martin@xemacs.org>
+
+       * configure.in:
+       Make knowledge of machine and opsys optional.
+       Make existence of s&m files optional.
+       Rely on configure alone if s&m files not found.
+
+       * configure.in:
+       Use only configure-time tests to detect getloadavg().
+       Don't check for kstat.h if we have getloadavg().
+       Check for sys/loadavg.h if we have getloadavg().
+
+2000-07-15  Ben Wing  <ben@xemacs.org>
+
+       * Makefile.in.in (configure):
+       all-elcs target now uses update-elc-2.el not update-elc.sh
+
 2000-07-19  Martin Buchholz <martin@xemacs.org>
 
        * XEmacs 21.2.35 is released.
index e6e0eac..2ccb3c0 100644 (file)
@@ -283,13 +283,14 @@ ${srcdir}/configure : ${srcdir}/configure.in
 ${srcdir}/lib-src/config.values.in : ${srcdir}/configure
        cd ${srcdir} && $(SHELL) lib-src/config.values.sh
 
-depend ${srcdir}/src/depend :
-       cd ${srcdir}/src && $(RECURSIVE_MAKE) depend
+depend ${srcdir}/src/depend:
+       cd ./src && $(RECURSIVE_MAKE) depend
 
 ## Build XEmacs and recompile out-of-date and missing .elc files along
 ## the way.
 all-elc all-elcs: lib-src lwlib dump-elcs src
-       MAKE='$(MAKE)' EMACS='./src/$(PROGNAME)' $(SHELL) ${srcdir}/lib-src/update-elc.sh
+       ${blddir}/src/${PROGNAME} -batch -vanilla \
+               -l update-elc-2.el -f batch-update-elc-2 lisp
 
 ## Sub-target for all-elc.
 dump-elc dump-elcs: ${GENERATED_HEADERS} FRC.dump-elcs
index 0000084..0648a24 100644 (file)
--- a/PROBLEMS
+++ b/PROBLEMS
@@ -523,7 +523,7 @@ correctly if you are using ash instead of bash (see below).
 
 This is usually because xmkmf is not in your path or because you are
 using the default cygwin shell. The default cygwin shell (/bin/sh.exe)
-is ash which appears to work in most circumstances but has some wierd
+is ash which appears to work in most circumstances but has some weird
 failure modes. I recommend replacing sh.exe with bash.exe, this will
 mean configure is slower but more reliable.
 
@@ -1045,7 +1045,7 @@ it only if it is undefined.
 Or you could set TERMCAP only when you set TERM--which should not
 happen in a non-login shell.
 
-*** The popup menu appears at the buttom/right of my screen.
+*** The popup menu appears at the bottom/right of my screen.
 
 You probably have something like the following in your ~/.Xdefaults
 
@@ -1427,7 +1427,7 @@ Richard Cognot <cognot@ensg.u-nancy.fr> writes:
   launched. Forcing a static link of libc.a alone by adding
   /usr/lib/libc.a at the end of the link line solves this. Note that
   my 9.07 build of 19.14b17 and my (old) build of 19.13 both exhibit
-  the same behaviour. I've tried various hpux patches to no avail. If
+  the same behavior. I've tried various hpux patches to no avail. If
   this problem cannot be solved before the release date, binary kits
   for HP *must* be linked statically against libc, otherwise this
   problem will show up. (This is directed at whoever will volunteer
index 1cfb91f..9dd7ecf 100644 (file)
@@ -173,7 +173,7 @@ fi
 
 if test -n "$dll_cflags"; then
   AC_MSG_RESULT([${dll_cflags}])
-  
+
   # Check to make sure the dll_cflags actually works.
   AC_MSG_CHECKING([if PIC flag ${dll_cflags} really works])
   save_CFLAGS="$CFLAGS"
@@ -200,13 +200,13 @@ dnl Now comes the LD trickery. We do things differently to libtool here.
 dnl I believe that libtool is incorrect in trying to drive the linker
 dnl directly. This can cause considerable problems if the module you are
 dnl compiling has C++ or other static initializers. If we use ld directly,
-dnl we dont end up with the crt stuff being linked in, and we dont end up
+dnl we don't end up with the crt stuff being linked in, and we don't end up
 dnl with any .init or .fini sections (or the moral equivalent thereof).
-dnl gcc takes great care to do this propperly when invoked in -shared
-dnl mode, and we really do want this behaviour. Perhaps the libtool folks
+dnl gcc takes great care to do this properly when invoked in -shared
+dnl mode, and we really do want this behavior. Perhaps the libtool folks
 dnl are not aware that any SVR4 based dynamic loader will automatically
 dnl execute code in the .init section before dlopen() returns. This is
-dnl vital, as the module may have been compiled to rely on that behaviour.
+dnl vital, as the module may have been compiled to rely on that behavior.
 dnl
 dnl So, having said all of that, we diverge from libtool significantly
 dnl here. We want to try and use the C compiler as much as possible. Only
@@ -219,7 +219,7 @@ dnl version of XEmacs. With the libtool way, it picks up the linker that
 dnl gcc uses, which can be the internal collect2 that comes with gcc.
 dnl If the user ever changes their compiler version, the paths will no
 dnl longer be correct, and ellcc will break. This is clearly unacceptable.
-dnl By using the compiler driver on the path, we dont have this problem.
+dnl By using the compiler driver on the path, we don't have this problem.
 dnl If that is not clear, consider that gcc -print-prog-name=ld can
 dnl produce something along the lines of:
 dnl   /usr/local/lib/gcc-lib/OS-NAME/GCC-VERSION/ld
@@ -231,7 +231,7 @@ dnl If we are not using gcc, but the system C compiler can produce
 dnl shared objects, we try that. Only if all of that fails do we revert
 dnl back to the libtool ld trickery.
 dnl
-dnl We dont do ANY of this if we can't produce shared objects.
+dnl We don't do ANY of this if we can't produce shared objects.
 dnl
 if test "$can_build_shared" = "yes"; then
 cc_produces_so=no
@@ -513,7 +513,7 @@ dnl
 dnl Last thing, check how to get a linked executable to have its symbols
 dnl exported, so that the modules have access to them.
 dnl
-dnl XEmacs FIXME - we need to set ld_dynamic_link_flags propperly for
+dnl XEmacs FIXME - we need to set ld_dynamic_link_flags properly for
 dnl most of these systems, which was missing from libtool. I know they
 dnl all have a way of doing this, but someone needs to look at this
 dnl for each OS and make sure it is correct. Remember that the arguments
index 73fe0f6..0de4081 100755 (executable)
--- a/configure
+++ b/configure
@@ -1127,7 +1127,6 @@ case "$canonical" in
   clipper-*        ) machine=clipper ;;
   arm*             ) machine=arm ;;
   ns32k-*          ) machine=ns32000 ;;
-  s390-*           ) machine=s390 ;;
 esac
 
 case "$canonical" in
@@ -1495,13 +1494,40 @@ EOF
 
 esac
 
-if test -z "$machine" -o -z "$opsys"; then
-  (echo "$progname: XEmacs hasn't been ported to \`$canonical' systems."
-   echo "$progname: Check \`etc/MACHINES' for recognized configuration names."
-  ) >&2
-  exit 1
+test -z "$machine" && machine=`echo $canonical | sed 's/-.*$//'`
+test -z "$opsys"   && opsys=`echo $canonical | sed 's/^^-*-^-*-//'`
+
+if test -r "${srcdir}/src/m/${machine}.h"; then
+  machfile="m/${machine}.h"
+  { test "$extra_verbose" = "yes" && cat << EOF
+    Defining config_machfile = "$machfile"
+EOF
+cat >> confdefs.h <<EOF
+#define config_machfile "$machfile"
+EOF
+}
+
+else
+  echo "XEmacs has no builtin knowledge of \`$machine' machines."
+  echo "Using configure-time autodetection only."
 fi
 
+if test -r "${srcdir}/src/s/${opsys}.h"; then
+  opsysfile="s/${opsys}.h"
+  { test "$extra_verbose" = "yes" && cat << EOF
+    Defining config_opsysfile = "$opsysfile"
+EOF
+cat >> confdefs.h <<EOF
+#define config_opsysfile "$opsysfile"
+EOF
+}
+
+else
+  echo "XEmacs has no builtin knowledge of \`$opsys' operating systems."
+  echo "Using configure-time autodetection only."
+fi
+
+
 if test -z "$dynamic"; then
   case "$opsys" in
     hpux* | sunos4* ) dynamic=no ;;
@@ -1535,9 +1561,6 @@ EOF
 }
 
 
-machfile="m/${machine}.h"
-opsysfile="s/${opsys}.h"
-
 
 test "$with_sparcworks" = "yes" && with_workshop=yes # compatibility alias
 if test "$with_workshop $with_tooltalk" = "yes no"; then
@@ -1591,7 +1614,7 @@ xe_save_CFLAGS="$CFLAGS"
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1595: checking for $ac_word" >&5
+echo "configure:1618: checking for $ac_word" >&5
 
 if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1618,7 +1641,7 @@ 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1622: checking for $ac_word" >&5
+echo "configure:1645: checking for $ac_word" >&5
 
 if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1666,7 +1689,7 @@ fi
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1670: checking for $ac_word" >&5
+echo "configure:1693: checking for $ac_word" >&5
 
 if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1695,7 +1718,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1699: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1722: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
@@ -1708,12 +1731,12 @@ cross_compiling=no
 
 cat > conftest.$ac_ext << EOF
 
-#line 1712 "configure"
+#line 1735 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:1717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1740: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1741,19 +1764,19 @@ if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1745: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1768: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1750: checking whether we are using GNU C" >&5
+echo "configure:1773: checking whether we are using GNU C" >&5
 
 cat > conftest.c <<EOF
 #ifdef __GNUC__
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1757: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1780: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1771,7 +1794,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1775: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1798: checking whether ${CC-cc} accepts -g" >&5
 
 echo 'void f(){}' > conftest.c
 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
@@ -1804,7 +1827,7 @@ if   test "$with_gcc" = "no"  -a "$GCC" = "yes"; then
   # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1808: checking for $ac_word" >&5
+echo "configure:1831: checking for $ac_word" >&5
 
 if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1831,7 +1854,7 @@ 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1835: checking for $ac_word" >&5
+echo "configure:1858: checking for $ac_word" >&5
 
 if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1879,7 +1902,7 @@ fi
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1883: checking for $ac_word" >&5
+echo "configure:1906: checking for $ac_word" >&5
 
 if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -1908,7 +1931,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1912: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1935: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
@@ -1921,12 +1944,12 @@ cross_compiling=no
 
 cat > conftest.$ac_ext << EOF
 
-#line 1925 "configure"
+#line 1948 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:1930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -1954,19 +1977,19 @@ if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1958: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1981: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1963: checking whether we are using GNU C" >&5
+echo "configure:1986: checking whether we are using GNU C" >&5
 
 cat > conftest.c <<EOF
 #ifdef __GNUC__
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1970: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1993: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -1984,7 +2007,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:1988: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:2011: checking whether ${CC-cc} accepts -g" >&5
 
 echo 'void f(){}' > conftest.c
 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
@@ -2017,7 +2040,7 @@ elif test "$with_gcc" = "yes" -a "$GCC" != "yes" ; then
   # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2021: checking for $ac_word" >&5
+echo "configure:2044: checking for $ac_word" >&5
 
 if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -2044,7 +2067,7 @@ 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2048: checking for $ac_word" >&5
+echo "configure:2071: checking for $ac_word" >&5
 
 if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -2092,7 +2115,7 @@ fi
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2096: checking for $ac_word" >&5
+echo "configure:2119: checking for $ac_word" >&5
 
 if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
@@ -2121,7 +2144,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:2125: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:2148: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
@@ -2134,12 +2157,12 @@ cross_compiling=no
 
 cat > conftest.$ac_ext << EOF
 
-#line 2138 "configure"
+#line 2161 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:2143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -2167,19 +2190,19 @@ if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:2171: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:2194: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:2176: checking whether we are using GNU C" >&5
+echo "configure:2199: checking whether we are using GNU C" >&5
 
 cat > conftest.c <<EOF
 #ifdef __GNUC__
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2183: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2206: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -2197,7 +2220,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:2201: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:2224: checking whether ${CC-cc} accepts -g" >&5
 
 echo 'void f(){}' > conftest.c
 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
@@ -2234,7 +2257,7 @@ test -n "$CPP" -a -d "$CPP" && CPP=
 test -n "$NON_GNU_CPP" -a "$GCC" != "yes" -a -z "$CPP" && CPP="$NON_GNU_CPP"
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:2238: checking how to run the C preprocessor" >&5
+echo "configure:2261: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -2247,13 +2270,13 @@ if test -z "$CPP"; then
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 2251 "configure"
+#line 2274 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2257: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2280: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -2264,13 +2287,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 2268 "configure"
+#line 2291 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2274: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2297: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -2281,13 +2304,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 2285 "configure"
+#line 2308 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2291: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2314: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   :
@@ -2313,9 +2336,9 @@ echo "$ac_t""$CPP" 1>&6
 
 
 echo $ac_n "checking for AIX""... $ac_c" 1>&6
-echo "configure:2317: checking for AIX" >&5
+echo "configure:2340: checking for AIX" >&5
 cat > conftest.$ac_ext <<EOF
-#line 2319 "configure"
+#line 2342 "configure"
 #include "confdefs.h"
 #ifdef _AIX
   yes
@@ -2342,9 +2365,9 @@ rm -f conftest*
  
 
 echo $ac_n "checking for GNU libc""... $ac_c" 1>&6
-echo "configure:2346: checking for GNU libc" >&5
+echo "configure:2369: checking for GNU libc" >&5
 cat > conftest.$ac_ext <<EOF
-#line 2348 "configure"
+#line 2371 "configure"
 #include "confdefs.h"
 #include <features.h>
 int main() {
@@ -2356,7 +2379,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2360: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2383: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   have_glibc=yes
 else
@@ -2433,19 +2456,21 @@ EOF
 esac
 
 cat > conftest.$ac_ext <<EOF
-#line 2437 "configure"
+#line 2460 "configure"
 #include "confdefs.h"
 int main () {
 #if defined __SUNPRO_C
 return 11;
 #elif defined __DECC
 return 12;
+#elif defined __USLC__ && defined __SCO_VERSION__
+return 13;
 #else
 return 0;
 #endif
 }
 EOF
-if { (eval echo configure:2449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:2474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   :
 else
@@ -2456,6 +2481,7 @@ else
   case "$conftest_rc" in
   11) echo "You appear to be using the SunPro C compiler."; __SUNPRO_C=yes ;;
   12) echo "You appear to be using the DEC C compiler."   ; __DECC=yes ;;
+  13) echo "You appear to be using the SCO C compiler."   ; __USLC__=yes ;;
 esac
 fi
 rm -fr conftest*
@@ -2469,7 +2495,8 @@ tempcname="conftest.c"
 
 
 
-cat > $tempcname <<EOF
+cat > $tempcname < confdefs.h
+cat >> $tempcname <<EOF
 #define NOT_C_CODE
 #define C_SWITCH_SITE
 #define C_SWITCH_X_SITE
@@ -2477,8 +2504,14 @@ cat > $tempcname <<EOF
 #define LD_SWITCH_X_SITE
 #define LD_SWITCH_X_SITE_AUX
 #define OS_RELEASE $os_release
+
+#ifdef config_opsysfile
 #include "$srcdir/src/$opsysfile"
+#endif
+
+#ifdef config_machfile
 #include "$srcdir/src/$machfile"
+#endif
 
 #ifndef LIBS_MACHINE
 #define LIBS_MACHINE
@@ -2661,8 +2694,54 @@ esac
 
 test "$ordinary_link" = "no" -a -z "$libs_standard" && libs_standard="-lc"
 
+
 test "$__DECC" = "yes" && c_switch_site="$c_switch_site -std1" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-std1\" to \$c_switch_site"; fi
 
+if test "$__USLC__" = yes; then
+  echo $ac_n "checking for whether the -Kalloca compiler flag is needed""... $ac_c" 1>&6
+echo "configure:2703: checking for whether the -Kalloca compiler flag is needed" >&5
+  need_kalloca=no
+  cat > conftest.$ac_ext <<EOF
+#line 2706 "configure"
+#include "confdefs.h"
+
+int main() {
+void *x = alloca(4);
+; return 0; }
+EOF
+if { (eval echo configure:2713: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  :
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  
+    xe_save_c_switch_system="$c_switch_system"
+    c_switch_system="$c_switch_system -Kalloca"
+    cat > conftest.$ac_ext <<EOF
+#line 2724 "configure"
+#include "confdefs.h"
+
+int main() {
+void *x = alloca(4);
+; return 0; }
+EOF
+if { (eval echo configure:2731: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+   need_kalloca=yes 
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+fi
+rm -f conftest*
+    c_switch_system="$xe_save_c_switch_system"
+fi
+rm -f conftest*
+  echo "$ac_t""$need_kalloca" 1>&6
+  test "$need_kalloca" = "yes" && c_switch_system="$c_switch_system -Kalloca" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-Kalloca\" to \$c_switch_system"; fi
+fi
+
 if test "$cflags_specified" = "no"; then
       if   test "$GCC" = "yes"; then
     CFLAGS="-g -O3 -Wall -Wno-switch -Wpointer-arith -Winline -Wmissing-prototypes -Wshadow"
@@ -2681,7 +2760,7 @@ fi
 
 if test "$GCC" = "yes"; then
 echo $ac_n "checking for buggy gcc versions""... $ac_c" 1>&6
-echo "configure:2685: checking for buggy gcc versions" >&5
+echo "configure:2764: checking for buggy gcc versions" >&5
 GCC_VERSION=`$CC --version`
 case `uname -s`:`uname -m`:$GCC_VERSION in
                    *:sun4*:2.8.1|*:sun4*:egcs-2.90.*)
@@ -2690,7 +2769,7 @@ case `uname -s`:`uname -m`:$GCC_VERSION in
                 case "$CFLAGS" in
                     *-fno-schedule-insns*) ;;
                     *)
-                        echo "$ac_t""Yes" 1>&6
+                        echo "$ac_t""yes" 1>&6
                         echo "configure: warning: Don't use -O2 with gcc 2.8.1 and egcs 1.0 under SPARC architectures" 1>&2
                         echo "configure: warning: without also using -fno-schedule-insns." 1>&2
                         { echo "configure: error: Aborting due to known problem" 1>&2; exit 1; }
@@ -2700,7 +2779,7 @@ case `uname -s`:`uname -m`:$GCC_VERSION in
         esac
         ;;
                    Linux:alpha:egcs-2.91.*)
-        echo "$ac_t""Yes" 1>&6
+        echo "$ac_t""yes" 1>&6
         echo "configure: warning: There have been reports of egcs-1.1 not compiling XEmacs correctly on" 1>&2
         echo "configure: warning: Alpha Linux.  There have also been reports that egcs-1.0.3a is O.K." 1>&2
         { echo "configure: error: Aborting due to known problem" 1>&2; exit 1; }
@@ -2713,7 +2792,7 @@ case `uname -s`:`uname -m`:$GCC_VERSION in
                        case "$CFLAGS" in
                            *-fno-strength-reduce*) ;;
                            *)
-                                echo "$ac_t""Yes" 1>&6
+                                echo "$ac_t""yes" 1>&6
                                echo "configure: warning: Don't use -O2 with gcc 2.7.2 under Intel/XXX without also using" 1>&2
                                echo "configure: warning: -fno-strength-reduce." 1>&2
                                { echo "configure: error: Aborting due to known problem" 1>&2; exit 1; }
@@ -2726,7 +2805,7 @@ case `uname -s`:`uname -m`:$GCC_VERSION in
         case "$CFLAGS" in
         *-fno-caller-saves*) ;;
         *)
-            echo "$ac_t""Yes" 1>&6
+            echo "$ac_t""yes" 1>&6
            echo "configure: warning: Don't use -O2 with gcc 2.7.2 under Intel/XXX without also using" 1>&2
            echo "configure: warning: -fno-caller-saves." 1>&2
             { echo "configure: error: Aborting due to known problem" 1>&2; exit 1; }
@@ -2734,8 +2813,8 @@ case `uname -s`:`uname -m`:$GCC_VERSION in
         esac
        ;;
 esac
+echo "$ac_t""no" 1>&6
 fi
-echo "$ac_t""No" 1>&6
 
 
 if test "$GCC" = "yes"; then
@@ -2804,7 +2883,7 @@ test "$pdump" = "yes" && extra_objs="$extra_objs dumper.o" &&  if test "$extra_v
  fi
 
 echo $ac_n "checking for dynodump""... $ac_c" 1>&6
-echo "configure:2808: checking for dynodump" >&5
+echo "configure:2887: checking for dynodump" >&5
 if test "$unexec" != "unexsol2.o"; then
   echo "$ac_t""no" 1>&6
 else
@@ -2842,12 +2921,12 @@ if test "$unexec" = "unexaix.o"; then
   done
   
 echo $ac_n "checking for terminateAndUnload in -lC""... $ac_c" 1>&6
-echo "configure:2846: checking for terminateAndUnload in -lC" >&5
+echo "configure:2925: checking for terminateAndUnload in -lC" >&5
 ac_lib_var=`echo C'_'terminateAndUnload | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lC "
 cat > conftest.$ac_ext <<EOF
-#line 2851 "configure"
+#line 2930 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2858,7 +2937,7 @@ int main() {
 terminateAndUnload()
 ; return 0; }
 EOF
-if { (eval echo configure:2862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2966,7 +3045,7 @@ fi
 
 if test "$add_runtime_path" = "yes"; then
       echo $ac_n "checking "for runtime libraries flag"""... $ac_c" 1>&6
-echo "configure:2970: checking "for runtime libraries flag"" >&5
+echo "configure:3049: checking "for runtime libraries flag"" >&5
   case "$opsys" in
     sol2 ) dash_r="-R" ;;
     decosf* | linux* | irix*) dash_r="-rpath " ;;
@@ -2988,14 +3067,14 @@ if test "$GCC" = "yes"; then
   done
 fi
         cat > conftest.$ac_ext <<EOF
-#line 2992 "configure"
+#line 3071 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2999: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3078: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   dash_r="$try_dash_r"
 else
@@ -3097,10 +3176,10 @@ else
 fi
 after_morecore_hook_exists=yes
 echo $ac_n "checking for malloc_set_state""... $ac_c" 1>&6
-echo "configure:3101: checking for malloc_set_state" >&5
+echo "configure:3180: checking for malloc_set_state" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3104 "configure"
+#line 3183 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char malloc_set_state(); below.  */
@@ -3123,7 +3202,7 @@ malloc_set_state();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3127: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_malloc_set_state=yes"
 else
@@ -3143,16 +3222,16 @@ doug_lea_malloc=no
 fi
 
 echo $ac_n "checking whether __after_morecore_hook exists""... $ac_c" 1>&6
-echo "configure:3147: checking whether __after_morecore_hook exists" >&5
+echo "configure:3226: checking whether __after_morecore_hook exists" >&5
 cat > conftest.$ac_ext <<EOF
-#line 3149 "configure"
+#line 3228 "configure"
 #include "confdefs.h"
 extern void (* __after_morecore_hook)();
 int main() {
 __after_morecore_hook = 0
 ; return 0; }
 EOF
-if { (eval echo configure:3156: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 else
@@ -3208,7 +3287,7 @@ fi
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3212: checking for $ac_word" >&5
+echo "configure:3291: checking for $ac_word" >&5
 
 if test -n "$RANLIB"; then
   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
@@ -3263,7 +3342,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:3267: checking for a BSD compatible install" >&5
+echo "configure:3346: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 
   IFS="${IFS=  }"; ac_save_IFS="$IFS"; IFS=":"
@@ -3317,7 +3396,7 @@ 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3321: checking for $ac_word" >&5
+echo "configure:3400: checking for $ac_word" >&5
 
 if test -n "$YACC"; then
   ac_cv_prog_YACC="$YACC" # Let the user override the test.
@@ -3345,19 +3424,19 @@ done
 test -n "$YACC" || YACC="yacc"
 
 
-for ac_hdr in   a.out.h   cygwin/version.h   fcntl.h   inttypes.h   libgen.h   locale.h   mach/mach.h   sys/param.h   sys/pstat.h   sys/stropts.h   sys/time.h   sys/timeb.h   sys/un.h   kstat.h   ulimit.h   unistd.h   utime.h 
+for ac_hdr in   a.out.h   cygwin/version.h   fcntl.h   inttypes.h   libgen.h   locale.h   mach/mach.h   sys/param.h   sys/pstat.h   sys/time.h   sys/timeb.h   sys/un.h   ulimit.h   unistd.h   utime.h 
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3353: checking for $ac_hdr" >&5
+echo "configure:3432: checking for $ac_hdr" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3356 "configure"
+#line 3435 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3361: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3440: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3387,10 +3466,10 @@ fi
 done
 
 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:3391: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:3470: checking for sys/wait.h that is POSIX.1 compatible" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3394 "configure"
+#line 3473 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/wait.h>
@@ -3406,7 +3485,7 @@ wait (&s);
 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
 ; return 0; }
 EOF
-if { (eval echo configure:3410: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3489: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_sys_wait_h=yes
 else
@@ -3430,10 +3509,10 @@ EOF
 fi
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:3434: checking for ANSI C header files" >&5
+echo "configure:3513: checking for ANSI C header files" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3437 "configure"
+#line 3516 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -3441,7 +3520,7 @@ cat > conftest.$ac_ext <<EOF
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3445: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3524: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3458,7 +3537,7 @@ rm -f conftest*
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 3462 "configure"
+#line 3541 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -3476,7 +3555,7 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 3480 "configure"
+#line 3559 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -3494,7 +3573,7 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
 cat > conftest.$ac_ext <<EOF
-#line 3498 "configure"
+#line 3577 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -3505,7 +3584,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:3509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:3588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   :
 else
@@ -3531,10 +3610,10 @@ EOF
 fi
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:3535: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:3614: checking whether time.h and sys/time.h may both be included" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3538 "configure"
+#line 3617 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -3543,7 +3622,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:3547: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3626: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -3567,10 +3646,10 @@ EOF
 fi
 
 echo $ac_n "checking for sys_siglist declaration in signal.h or unistd.h""... $ac_c" 1>&6
-echo "configure:3571: checking for sys_siglist declaration in signal.h or unistd.h" >&5
+echo "configure:3650: checking for sys_siglist declaration in signal.h or unistd.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3574 "configure"
+#line 3653 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -3582,7 +3661,7 @@ int main() {
 char *msg = *(sys_siglist + 1);
 ; return 0; }
 EOF
-if { (eval echo configure:3586: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3665: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_decl_sys_siglist=yes
 else
@@ -3607,9 +3686,9 @@ fi
 
 
 echo $ac_n "checking for struct utimbuf""... $ac_c" 1>&6
-echo "configure:3611: checking for struct utimbuf" >&5
+echo "configure:3690: checking for struct utimbuf" >&5
 cat > conftest.$ac_ext <<EOF
-#line 3613 "configure"
+#line 3692 "configure"
 #include "confdefs.h"
 #ifdef TIME_WITH_SYS_TIME
 #include <sys/time.h>
@@ -3628,7 +3707,7 @@ int main() {
 static struct utimbuf x; x.actime = x.modtime;
 ; return 0; }
 EOF
-if { (eval echo configure:3632: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3711: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
    { test "$extra_verbose" = "yes" && cat << \EOF
@@ -3648,10 +3727,10 @@ fi
 rm -f conftest*
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:3652: checking return type of signal handlers" >&5
+echo "configure:3731: checking return type of signal handlers" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3655 "configure"
+#line 3734 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -3668,7 +3747,7 @@ int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:3672: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3751: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -3690,10 +3769,10 @@ EOF
 
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:3694: checking for size_t" >&5
+echo "configure:3773: checking for size_t" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3697 "configure"
+#line 3776 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3724,10 +3803,10 @@ EOF
 fi
 
 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:3728: checking for pid_t" >&5
+echo "configure:3807: checking for pid_t" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3731 "configure"
+#line 3810 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3758,10 +3837,10 @@ EOF
 fi
 
 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:3762: checking for uid_t in sys/types.h" >&5
+echo "configure:3841: checking for uid_t in sys/types.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3765 "configure"
+#line 3844 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 EOF
@@ -3797,10 +3876,10 @@ EOF
 fi
 
 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
-echo "configure:3801: checking for mode_t" >&5
+echo "configure:3880: checking for mode_t" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3804 "configure"
+#line 3883 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3831,10 +3910,10 @@ EOF
 fi
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:3835: checking for off_t" >&5
+echo "configure:3914: checking for off_t" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3838 "configure"
+#line 3917 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3865,10 +3944,10 @@ EOF
 fi
 
 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
-echo "configure:3869: checking for ssize_t" >&5
+echo "configure:3948: checking for ssize_t" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 3872 "configure"
+#line 3951 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -3900,9 +3979,9 @@ fi
 
 
 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
-echo "configure:3904: checking for socklen_t" >&5
+echo "configure:3983: checking for socklen_t" >&5
 cat > conftest.$ac_ext <<EOF
-#line 3906 "configure"
+#line 3985 "configure"
 #include "confdefs.h"
 #include <sys/socket.h>
 socklen_t x;
@@ -3911,7 +3990,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:3915: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3994: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
 else
@@ -3920,7 +3999,7 @@ else
   rm -rf conftest*
   
 cat > conftest.$ac_ext <<EOF
-#line 3924 "configure"
+#line 4003 "configure"
 #include "confdefs.h"
 #include <sys/socket.h>
 int accept (int, struct sockaddr *, size_t *);
@@ -3929,7 +4008,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:3933: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4012: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
 echo "$ac_t""size_t" 1>&6
@@ -3961,9 +4040,9 @@ fi
 rm -f conftest*
 
 echo $ac_n "checking for struct timeval""... $ac_c" 1>&6
-echo "configure:3965: checking for struct timeval" >&5
+echo "configure:4044: checking for struct timeval" >&5
 cat > conftest.$ac_ext <<EOF
-#line 3967 "configure"
+#line 4046 "configure"
 #include "confdefs.h"
 #ifdef TIME_WITH_SYS_TIME
 #include <sys/time.h>
@@ -3979,7 +4058,7 @@ int main() {
 static struct timeval x; x.tv_sec = x.tv_usec;
 ; return 0; }
 EOF
-if { (eval echo configure:3983: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4062: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
   HAVE_TIMEVAL=yes
@@ -4001,10 +4080,10 @@ fi
 rm -f conftest*
 
 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:4005: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:4084: checking whether struct tm is in sys/time.h or time.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 4008 "configure"
+#line 4087 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
@@ -4012,7 +4091,7 @@ int main() {
 struct tm *tp; tp->tm_sec;
 ; return 0; }
 EOF
-if { (eval echo configure:4016: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4095: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm=time.h
 else
@@ -4036,10 +4115,10 @@ EOF
 fi
 
 echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
-echo "configure:4040: checking for tm_zone in struct tm" >&5
+echo "configure:4119: checking for tm_zone in struct tm" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 4043 "configure"
+#line 4122 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_cv_struct_tm>
@@ -4047,7 +4126,7 @@ int main() {
 struct tm tm; tm.tm_zone;
 ; return 0; }
 EOF
-if { (eval echo configure:4051: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4130: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm_zone=yes
 else
@@ -4070,10 +4149,10 @@ EOF
 
 else
   echo $ac_n "checking for tzname""... $ac_c" 1>&6
-echo "configure:4074: checking for tzname" >&5
+echo "configure:4153: checking for tzname" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 4077 "configure"
+#line 4156 "configure"
 #include "confdefs.h"
 #include <time.h>
 #ifndef tzname /* For SGI.  */
@@ -4083,7 +4162,7 @@ int main() {
 atoi(*tzname);
 ; return 0; }
 EOF
-if { (eval echo configure:4087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_var_tzname=yes
 else
@@ -4109,10 +4188,10 @@ fi
 
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:4113: checking for working const" >&5
+echo "configure:4192: checking for working const" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 4116 "configure"
+#line 4195 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -4161,7 +4240,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:4165: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4244: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -4186,7 +4265,7 @@ fi
 
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:4190: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:4269: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 
 cat > conftestmake <<\EOF
@@ -4211,12 +4290,12 @@ fi
 
 
 echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:4215: checking whether byte ordering is bigendian" >&5
+echo "configure:4294: checking whether byte ordering is bigendian" >&5
 
 ac_cv_c_bigendian=unknown
 # See if sys/param.h defines the BYTE_ORDER macro.
 cat > conftest.$ac_ext <<EOF
-#line 4220 "configure"
+#line 4299 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -4227,11 +4306,11 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:4231: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4310: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   # It does; now see whether it defined to BIG_ENDIAN or not.
 cat > conftest.$ac_ext <<EOF
-#line 4235 "configure"
+#line 4314 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -4242,7 +4321,7 @@ int main() {
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:4246: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4325: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_bigendian=yes
 else
@@ -4259,7 +4338,7 @@ fi
 rm -f conftest*
 if test $ac_cv_c_bigendian = unknown; then
 cat > conftest.$ac_ext <<EOF
-#line 4263 "configure"
+#line 4342 "configure"
 #include "confdefs.h"
 main () {
   /* Are we little or big endian?  From Harbison&Steele.  */
@@ -4272,7 +4351,7 @@ main () {
   exit (u.c[sizeof (long) - 1] == 1);
 }
 EOF
-if { (eval echo configure:4276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:4355: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   ac_cv_c_bigendian=no
 else
@@ -4299,10 +4378,10 @@ fi
 
 
 echo $ac_n "checking size of short""... $ac_c" 1>&6
-echo "configure:4303: checking size of short" >&5
+echo "configure:4382: checking size of short" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 4306 "configure"
+#line 4385 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -4313,7 +4392,7 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:4317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:4396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   ac_cv_sizeof_short=`cat conftestval`
 else
@@ -4341,10 +4420,10 @@ if test "$ac_cv_sizeof_short" = 0; then
   exit 1
 fi
 echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:4345: checking size of int" >&5
+echo "configure:4424: checking size of int" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 4348 "configure"
+#line 4427 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -4355,7 +4434,7 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:4359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:4438: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   ac_cv_sizeof_int=`cat conftestval`
 else
@@ -4377,10 +4456,10 @@ EOF
 
 
 echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:4381: checking size of long" >&5
+echo "configure:4460: checking size of long" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 4384 "configure"
+#line 4463 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -4391,7 +4470,7 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:4395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:4474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   ac_cv_sizeof_long=`cat conftestval`
 else
@@ -4413,10 +4492,10 @@ EOF
 
 
 echo $ac_n "checking size of long long""... $ac_c" 1>&6
-echo "configure:4417: checking size of long long" >&5
+echo "configure:4496: checking size of long long" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 4420 "configure"
+#line 4499 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -4427,7 +4506,7 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:4431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:4510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   ac_cv_sizeof_long_long=`cat conftestval`
 else
@@ -4449,10 +4528,10 @@ EOF
 
 
 echo $ac_n "checking size of void *""... $ac_c" 1>&6
-echo "configure:4453: checking size of void *" >&5
+echo "configure:4532: checking size of void *" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 4456 "configure"
+#line 4535 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -4463,7 +4542,7 @@ main()
   exit(0);
 }
 EOF
-if { (eval echo configure:4467: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:4546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   ac_cv_sizeof_void_p=`cat conftestval`
 else
@@ -4486,7 +4565,7 @@ EOF
 
 
 echo $ac_n "checking for long file names""... $ac_c" 1>&6
-echo "configure:4490: checking for long file names" >&5
+echo "configure:4569: checking for long file names" >&5
 
 ac_cv_sys_long_file_names=yes
 # Test for long file names in all the places we know might matter:
@@ -4532,10 +4611,10 @@ fi
 
 
 echo $ac_n "checking for sin""... $ac_c" 1>&6
-echo "configure:4536: checking for sin" >&5
+echo "configure:4615: checking for sin" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 4539 "configure"
+#line 4618 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char sin(); below.  */
@@ -4558,7 +4637,7 @@ sin();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4562: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4641: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_sin=yes"
 else
@@ -4576,12 +4655,12 @@ else
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6
-echo "configure:4580: checking for sin in -lm" >&5
+echo "configure:4659: checking for sin in -lm" >&5
 ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lm "
 cat > conftest.$ac_ext <<EOF
-#line 4585 "configure"
+#line 4664 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4592,7 +4671,7 @@ int main() {
 sin()
 ; return 0; }
 EOF
-if { (eval echo configure:4596: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4636,14 +4715,14 @@ EOF
 
 
 cat > conftest.$ac_ext <<EOF
-#line 4640 "configure"
+#line 4719 "configure"
 #include "confdefs.h"
 #include <math.h>
 int main() {
 return atanh(1.0) + asinh(1.0) + acosh(1.0); 
 ; return 0; }
 EOF
-if { (eval echo configure:4647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4726: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_INVERSE_HYPERBOLIC
@@ -4660,14 +4739,14 @@ fi
 rm -f conftest*
 
 echo "checking type of mail spool file locking" 1>&6
-echo "configure:4664: checking type of mail spool file locking" >&5
+echo "configure:4743: checking type of mail spool file locking" >&5
 for ac_func in lockf flock
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4668: checking for $ac_func" >&5
+echo "configure:4747: checking for $ac_func" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 4671 "configure"
+#line 4750 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4690,7 +4769,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4773: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4772,12 +4851,12 @@ test "$mail_locking" = "locking" -a "$ac_cv_func_locking" != "yes" && \
 case "$opsys" in decosf*)
   
 echo $ac_n "checking for cma_open in -lpthreads""... $ac_c" 1>&6
-echo "configure:4776: checking for cma_open in -lpthreads" >&5
+echo "configure:4855: checking for cma_open in -lpthreads" >&5
 ac_lib_var=`echo pthreads'_'cma_open | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lpthreads "
 cat > conftest.$ac_ext <<EOF
-#line 4781 "configure"
+#line 4860 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4788,7 +4867,7 @@ int main() {
 cma_open()
 ; return 0; }
 EOF
-if { (eval echo configure:4792: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4871: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -4824,7 +4903,7 @@ fi
 esac
 
 echo $ac_n "checking whether the -xildoff compiler flag is required""... $ac_c" 1>&6
-echo "configure:4828: checking whether the -xildoff compiler flag is required" >&5
+echo "configure:4907: checking whether the -xildoff compiler flag is required" >&5
 if   ${CC-cc} '-###' -xildon  no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ; then
   if ${CC-cc} '-###' -xildoff no_such_file.c 2>&1 | grep '^[^ ]*/ild ' > /dev/null ;
     then echo "$ac_t""no" 1>&6;
@@ -4836,7 +4915,7 @@ fi
 if test "$opsys" = "sol2"; then
   if test "$os_release" -ge 56; then
     echo $ac_n "checking for \"-z ignore\" linker flag""... $ac_c" 1>&6
-echo "configure:4840: checking for \"-z ignore\" linker flag" >&5
+echo "configure:4919: checking for \"-z ignore\" linker flag" >&5
     case "`ld -h 2>&1`" in
       *-z\ ignore\|record* ) echo "$ac_t""yes" 1>&6
         ld_switch_site="-z ignore $ld_switch_site" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-z ignore\" to \$ld_switch_site"; fi ;;
@@ -4847,7 +4926,7 @@ fi
 
 
 echo "checking "for specified window system"" 1>&6
-echo "configure:4851: checking "for specified window system"" >&5
+echo "configure:4930: checking "for specified window system"" >&5
 
 if test "$with_x11" != "no"; then
     test "$x_includes $x_libraries" != "NONE NONE" && \
@@ -4880,7 +4959,7 @@ if test "$with_x11" != "no"; then
 # Uses ac_ vars as temps to allow command line to override cache and checks.
 # --without-x overrides everything else, but does not touch the cache.
 echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:4884: checking for X" >&5
+echo "configure:4963: checking for X" >&5
 
 # Check whether --with-x or --without-x was given.
 if test "${with_x+set}" = set; then
@@ -4940,12 +5019,12 @@ if test "$ac_x_includes" = NO; then
 
   # First, try using that file with no special directory specified.
 cat > conftest.$ac_ext <<EOF
-#line 4944 "configure"
+#line 5023 "configure"
 #include "confdefs.h"
 #include <$x_direct_test_include>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4949: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5028: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5014,14 +5093,14 @@ if test "$ac_x_libraries" = NO; then
   ac_save_LIBS="$LIBS"
   LIBS="-l$x_direct_test_library $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5018 "configure"
+#line 5097 "configure"
 #include "confdefs.h"
 
 int main() {
 ${x_direct_test_function}()
 ; return 0; }
 EOF
-if { (eval echo configure:5025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5104: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   LIBS="$ac_save_LIBS"
 # We can link X programs with no special library path.
@@ -5130,17 +5209,17 @@ else
     case "`(uname -sr) 2>/dev/null`" in
     "SunOS 5"*)
       echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
-echo "configure:5134: checking whether -R must be followed by a space" >&5
+echo "configure:5213: checking whether -R must be followed by a space" >&5
       ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
       cat > conftest.$ac_ext <<EOF
-#line 5137 "configure"
+#line 5216 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5144: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_R_nospace=yes
 else
@@ -5156,14 +5235,14 @@ rm -f conftest*
       else
        LIBS="$ac_xsave_LIBS -R $x_libraries"
        cat > conftest.$ac_ext <<EOF
-#line 5160 "configure"
+#line 5239 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_R_space=yes
 else
@@ -5199,12 +5278,12 @@ ac_cv_lib_dnet_dnet_ntoa=no
 else
 
 echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
-echo "configure:5203: checking for dnet_ntoa in -ldnet" >&5
+echo "configure:5282: checking for dnet_ntoa in -ldnet" >&5
 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ldnet "
 cat > conftest.$ac_ext <<EOF
-#line 5208 "configure"
+#line 5287 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5215,7 +5294,7 @@ int main() {
 dnet_ntoa()
 ; return 0; }
 EOF
-if { (eval echo configure:5219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5239,12 +5318,12 @@ fi
     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
       
 echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
-echo "configure:5243: checking for dnet_ntoa in -ldnet_stub" >&5
+echo "configure:5322: checking for dnet_ntoa in -ldnet_stub" >&5
 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ldnet_stub "
 cat > conftest.$ac_ext <<EOF
-#line 5248 "configure"
+#line 5327 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5255,7 +5334,7 @@ int main() {
 dnet_ntoa()
 ; return 0; }
 EOF
-if { (eval echo configure:5259: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5338: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5284,10 +5363,10 @@ fi
     # The nsl library prevents programs from opening the X display
     # on Irix 5.2, according to dickey@clark.net.
     echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:5288: checking for gethostbyname" >&5
+echo "configure:5367: checking for gethostbyname" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 5291 "configure"
+#line 5370 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gethostbyname(); below.  */
@@ -5310,7 +5389,7 @@ gethostbyname();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5314: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5393: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_gethostbyname=yes"
 else
@@ -5331,12 +5410,12 @@ fi
     if test $ac_cv_func_gethostbyname = no; then
       
 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:5335: checking for gethostbyname in -lnsl" >&5
+echo "configure:5414: checking for gethostbyname in -lnsl" >&5
 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lnsl "
 cat > conftest.$ac_ext <<EOF
-#line 5340 "configure"
+#line 5419 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5347,7 +5426,7 @@ int main() {
 gethostbyname()
 ; return 0; }
 EOF
-if { (eval echo configure:5351: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5430: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5377,10 +5456,10 @@ fi
     # -lsocket must be given before -lnsl if both are needed.
     # We assume that if connect needs -lnsl, so does gethostbyname.
     echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:5381: checking for connect" >&5
+echo "configure:5460: checking for connect" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 5384 "configure"
+#line 5463 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char connect(); below.  */
@@ -5403,7 +5482,7 @@ connect();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5486: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_connect=yes"
 else
@@ -5426,12 +5505,12 @@ fi
 xe_msg_checking="for connect in -lsocket"
 test -n "$X_EXTRA_LIBS" && xe_msg_checking="$xe_msg_checking using extra libs $X_EXTRA_LIBS"
 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
-echo "configure:5430: checking "$xe_msg_checking"" >&5
+echo "configure:5509: checking "$xe_msg_checking"" >&5
 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lsocket $X_EXTRA_LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5435 "configure"
+#line 5514 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5442,7 +5521,7 @@ int main() {
 connect()
 ; return 0; }
 EOF
-if { (eval echo configure:5446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5525: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5466,10 +5545,10 @@ fi
 
     # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
     echo $ac_n "checking for remove""... $ac_c" 1>&6
-echo "configure:5470: checking for remove" >&5
+echo "configure:5549: checking for remove" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 5473 "configure"
+#line 5552 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char remove(); below.  */
@@ -5492,7 +5571,7 @@ remove();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5496: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_remove=yes"
 else
@@ -5513,12 +5592,12 @@ fi
     if test $ac_cv_func_remove = no; then
       
 echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
-echo "configure:5517: checking for remove in -lposix" >&5
+echo "configure:5596: checking for remove in -lposix" >&5
 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lposix "
 cat > conftest.$ac_ext <<EOF
-#line 5522 "configure"
+#line 5601 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5529,7 +5608,7 @@ int main() {
 remove()
 ; return 0; }
 EOF
-if { (eval echo configure:5533: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5553,10 +5632,10 @@ fi
 
     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
     echo $ac_n "checking for shmat""... $ac_c" 1>&6
-echo "configure:5557: checking for shmat" >&5
+echo "configure:5636: checking for shmat" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 5560 "configure"
+#line 5639 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char shmat(); below.  */
@@ -5579,7 +5658,7 @@ shmat();
 
 ; return 0; }
 EOF
-if { (eval echo configure:5583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_shmat=yes"
 else
@@ -5600,12 +5679,12 @@ fi
     if test $ac_cv_func_shmat = no; then
       
 echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
-echo "configure:5604: checking for shmat in -lipc" >&5
+echo "configure:5683: checking for shmat in -lipc" >&5
 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lipc "
 cat > conftest.$ac_ext <<EOF
-#line 5609 "configure"
+#line 5688 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5616,7 +5695,7 @@ int main() {
 shmat()
 ; return 0; }
 EOF
-if { (eval echo configure:5620: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5652,12 +5731,12 @@ fi
 xe_msg_checking="for IceConnectionNumber in -lICE"
 test -n "$X_EXTRA_LIBS" && xe_msg_checking="$xe_msg_checking using extra libs $X_EXTRA_LIBS"
 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
-echo "configure:5656: checking "$xe_msg_checking"" >&5
+echo "configure:5735: checking "$xe_msg_checking"" >&5
 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lICE $X_EXTRA_LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5661 "configure"
+#line 5740 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5668,7 +5747,7 @@ int main() {
 IceConnectionNumber()
 ; return 0; }
 EOF
-if { (eval echo configure:5672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5751: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5743,7 +5822,9 @@ EOF
       break;     fi
   done
 
-    if test "$GCC" = yes -a -d /usr/shlib; then X_LIBS="$X_LIBS -L/usr/shlib" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-L/usr/shlib\" to \$X_LIBS"; fi; fi
+    case "$opsys" in
+  decosf*) if test "$GCC" = yes -a -d /usr/shlib; then X_LIBS="$X_LIBS -L/usr/shlib" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-L/usr/shlib\" to \$X_LIBS"; fi; fi ;;
+  esac
 
   ld_switch_x_site="$X_LIBS"
 
@@ -5837,7 +5918,7 @@ EOF
 
 
     echo "checking for X defines extracted by xmkmf" 1>&6
-echo "configure:5841: checking for X defines extracted by xmkmf" >&5
+echo "configure:5922: checking for X defines extracted by xmkmf" >&5
   rm -fr conftestdir
   if mkdir conftestdir; then
     cd conftestdir
@@ -5884,15 +5965,15 @@ EOF
 
     ac_safe=`echo "X11/Intrinsic.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for X11/Intrinsic.h""... $ac_c" 1>&6
-echo "configure:5888: checking for X11/Intrinsic.h" >&5
+echo "configure:5969: checking for X11/Intrinsic.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 5891 "configure"
+#line 5972 "configure"
 #include "confdefs.h"
 #include <X11/Intrinsic.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5896: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5977: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -5916,12 +5997,12 @@ fi
 
       
 echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6
-echo "configure:5920: checking for XOpenDisplay in -lX11" >&5
+echo "configure:6001: checking for XOpenDisplay in -lX11" >&5
 ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lX11 "
 cat > conftest.$ac_ext <<EOF
-#line 5925 "configure"
+#line 6006 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5932,7 +6013,7 @@ int main() {
 XOpenDisplay()
 ; return 0; }
 EOF
-if { (eval echo configure:5936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6017: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -5957,12 +6038,12 @@ fi
 xe_msg_checking="for XGetFontProperty in -lX11"
 test -n "-b i486-linuxaout" && xe_msg_checking="$xe_msg_checking using extra libs -b i486-linuxaout"
 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
-echo "configure:5961: checking "$xe_msg_checking"" >&5
+echo "configure:6042: checking "$xe_msg_checking"" >&5
 ac_lib_var=`echo X11'_'XGetFontProperty | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lX11 -b i486-linuxaout"
 cat > conftest.$ac_ext <<EOF
-#line 5966 "configure"
+#line 6047 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5973,7 +6054,7 @@ int main() {
 XGetFontProperty()
 ; return 0; }
 EOF
-if { (eval echo configure:5977: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6000,12 +6081,12 @@ fi
 
     
 echo $ac_n "checking for XShapeSelectInput in -lXext""... $ac_c" 1>&6
-echo "configure:6004: checking for XShapeSelectInput in -lXext" >&5
+echo "configure:6085: checking for XShapeSelectInput in -lXext" >&5
 ac_lib_var=`echo Xext'_'XShapeSelectInput | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lXext "
 cat > conftest.$ac_ext <<EOF
-#line 6009 "configure"
+#line 6090 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6016,7 +6097,7 @@ int main() {
 XShapeSelectInput()
 ; return 0; }
 EOF
-if { (eval echo configure:6020: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6101: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6039,12 +6120,12 @@ fi
 
     
 echo $ac_n "checking for XtOpenDisplay in -lXt""... $ac_c" 1>&6
-echo "configure:6043: checking for XtOpenDisplay in -lXt" >&5
+echo "configure:6124: checking for XtOpenDisplay in -lXt" >&5
 ac_lib_var=`echo Xt'_'XtOpenDisplay | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lXt "
 cat > conftest.$ac_ext <<EOF
-#line 6048 "configure"
+#line 6129 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6055,7 +6136,7 @@ int main() {
 XtOpenDisplay()
 ; return 0; }
 EOF
-if { (eval echo configure:6059: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6140: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6078,14 +6159,14 @@ fi
 
 
   echo $ac_n "checking the version of X11 being used""... $ac_c" 1>&6
-echo "configure:6082: checking the version of X11 being used" >&5
+echo "configure:6163: checking the version of X11 being used" >&5
   cat > conftest.$ac_ext <<EOF
-#line 6084 "configure"
+#line 6165 "configure"
 #include "confdefs.h"
 #include <X11/Intrinsic.h>
     int main(int c, char *v[]) { return c>1 ? XlibSpecificationRelease : 0; }
 EOF
-if { (eval echo configure:6089: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:6170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   ./conftest foobar; x11_release=$?
 else
@@ -6106,13 +6187,20 @@ EOF
 }
 
 
+  if test "${x11_release}" = "4"; then
+    case "$with_widgets" in
+      "" | "no") with_widgets=no ;;
+      *) { echo "Error:" "Widget support requires X11R5 or greater" >&2; exit 1; } ;;
+    esac
+  fi
+
   for ac_func in XConvertCase
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6113: checking for $ac_func" >&5
+echo "configure:6201: checking for $ac_func" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 6116 "configure"
+#line 6204 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -6135,7 +6223,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:6139: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -6167,15 +6255,15 @@ done
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6171: checking for $ac_hdr" >&5
+echo "configure:6259: checking for $ac_hdr" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 6174 "configure"
+#line 6262 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6179: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6267: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6206,7 +6294,7 @@ done
 
 
     echo $ac_n "checking for XFree86""... $ac_c" 1>&6
-echo "configure:6210: checking for XFree86" >&5
+echo "configure:6298: checking for XFree86" >&5
   if test -d "/usr/X386/include" -o \
           -f "/etc/XF86Config"    -o \
          -f "/etc/X11/XF86Config" -o \
@@ -6226,12 +6314,12 @@ EOF
 
     test -z "$with_xmu" && { 
 echo $ac_n "checking for XmuReadBitmapDataFromFile in -lXmu""... $ac_c" 1>&6
-echo "configure:6230: checking for XmuReadBitmapDataFromFile in -lXmu" >&5
+echo "configure:6318: checking for XmuReadBitmapDataFromFile in -lXmu" >&5
 ac_lib_var=`echo Xmu'_'XmuReadBitmapDataFromFile | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lXmu "
 cat > conftest.$ac_ext <<EOF
-#line 6235 "configure"
+#line 6323 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6242,7 +6330,7 @@ int main() {
 XmuReadBitmapDataFromFile()
 ; return 0; }
 EOF
-if { (eval echo configure:6246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6281,19 +6369,19 @@ EOF
 
       
 echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6
-echo "configure:6285: checking for main in -lXbsd" >&5
+echo "configure:6373: checking for main in -lXbsd" >&5
 ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lXbsd "
 cat > conftest.$ac_ext <<EOF
-#line 6290 "configure"
+#line 6378 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:6297: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6330,22 +6418,22 @@ fi
 fi 
 if test "$with_msw" != "no"; then
   echo "checking for MS-Windows" 1>&6
-echo "configure:6334: checking for MS-Windows" >&5
+echo "configure:6422: checking for MS-Windows" >&5
   
 echo $ac_n "checking for main in -lgdi32""... $ac_c" 1>&6
-echo "configure:6337: checking for main in -lgdi32" >&5
+echo "configure:6425: checking for main in -lgdi32" >&5
 ac_lib_var=`echo gdi32'_'main | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lgdi32 "
 cat > conftest.$ac_ext <<EOF
-#line 6342 "configure"
+#line 6430 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:6349: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6437: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6411,12 +6499,12 @@ EOF
  fi
     fi
         cat > conftest.$ac_ext <<EOF
-#line 6415 "configure"
+#line 6503 "configure"
 #include "confdefs.h"
 #include <fcntl.h>
     int main() { return (open("/dev/windows", O_RDONLY, 0) > 0)? 0 : 1; }
 EOF
-if { (eval echo configure:6420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:6508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_MSG_SELECT
@@ -6477,6 +6565,50 @@ if test "$with_x11" != "yes"; then
   done
 fi
 
+if test "$with_x11" = "yes"; then
+  ac_safe=`echo "X11/extensions/shape.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for X11/extensions/shape.h""... $ac_c" 1>&6
+echo "configure:6572: checking for X11/extensions/shape.h" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 6575 "configure"
+#include "confdefs.h"
+#include <X11/extensions/shape.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:6580: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  
+   { test "$extra_verbose" = "yes" && cat << \EOF
+    Defining HAVE_BALLOON_HELP
+EOF
+cat >> confdefs.h <<\EOF
+#define HAVE_BALLOON_HELP 1
+EOF
+}
+
+   extra_objs="$extra_objs balloon_help.o balloon-x.o" &&  if test "$extra_verbose" = "yes"; then
+   echo "    xemacs will be linked with \"balloon_help.o balloon-x.o\""
+ fi
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+
 bitmapdir=
 
 case "$window_system" in
@@ -6491,7 +6623,7 @@ case "$x_libraries" in *X11R4* )
 esac
 
 echo "checking for WM_COMMAND option" 1>&6
-echo "configure:6495: checking for WM_COMMAND option" >&5;
+echo "configure:6627: checking for WM_COMMAND option" >&5;
 if test "$with_wmcommand" != "no"; then
   { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_WMCOMMAND
@@ -6506,15 +6638,15 @@ fi
 test -z "$with_xauth" && test "$window_system" = "none" && with_xauth=no
 test -z "$with_xauth" && { ac_safe=`echo "X11/Xauth.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for X11/Xauth.h""... $ac_c" 1>&6
-echo "configure:6510: checking for X11/Xauth.h" >&5
+echo "configure:6642: checking for X11/Xauth.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 6513 "configure"
+#line 6645 "configure"
 #include "confdefs.h"
 #include <X11/Xauth.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6518: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6650: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6537,12 +6669,12 @@ fi
  }
 test -z "$with_xauth" && { 
 echo $ac_n "checking for XauGetAuthByAddr in -lXau""... $ac_c" 1>&6
-echo "configure:6541: checking for XauGetAuthByAddr in -lXau" >&5
+echo "configure:6673: checking for XauGetAuthByAddr in -lXau" >&5
 ac_lib_var=`echo Xau'_'XauGetAuthByAddr | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lXau "
 cat > conftest.$ac_ext <<EOF
-#line 6546 "configure"
+#line 6678 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6553,7 +6685,7 @@ int main() {
 XauGetAuthByAddr()
 ; return 0; }
 EOF
-if { (eval echo configure:6557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6598,15 +6730,15 @@ if test "$with_tooltalk" != "no" ; then
       for dir in "" "Tt/" "desktop/" ; do
     ac_safe=`echo "${dir}tt_c.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for ${dir}tt_c.h""... $ac_c" 1>&6
-echo "configure:6602: checking for ${dir}tt_c.h" >&5
+echo "configure:6734: checking for ${dir}tt_c.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 6605 "configure"
+#line 6737 "configure"
 #include "confdefs.h"
 #include <${dir}tt_c.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6610: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6742: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6642,12 +6774,12 @@ if test "$with_tooltalk" != "no" ; then
 xe_msg_checking="for tt_message_create in -ltt"
 test -n "$extra_libs" && xe_msg_checking="$xe_msg_checking using extra libs $extra_libs"
 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
-echo "configure:6646: checking "$xe_msg_checking"" >&5
+echo "configure:6778: checking "$xe_msg_checking"" >&5
 ac_lib_var=`echo tt'_'tt_message_create | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ltt $extra_libs"
 cat > conftest.$ac_ext <<EOF
-#line 6651 "configure"
+#line 6783 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6658,7 +6790,7 @@ int main() {
 tt_message_create()
 ; return 0; }
 EOF
-if { (eval echo configure:6662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6715,15 +6847,15 @@ fi
 
 test -z "$with_cde" && { ac_safe=`echo "Dt/Dt.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for Dt/Dt.h""... $ac_c" 1>&6
-echo "configure:6719: checking for Dt/Dt.h" >&5
+echo "configure:6851: checking for Dt/Dt.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 6722 "configure"
+#line 6854 "configure"
 #include "confdefs.h"
 #include <Dt/Dt.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6727: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6859: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6746,12 +6878,12 @@ fi
  }
 test -z "$with_cde" && { 
 echo $ac_n "checking for DtDndDragStart in -lDtSvc""... $ac_c" 1>&6
-echo "configure:6750: checking for DtDndDragStart in -lDtSvc" >&5
+echo "configure:6882: checking for DtDndDragStart in -lDtSvc" >&5
 ac_lib_var=`echo DtSvc'_'DtDndDragStart | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lDtSvc "
 cat > conftest.$ac_ext <<EOF
-#line 6755 "configure"
+#line 6887 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6762,7 +6894,7 @@ int main() {
 DtDndDragStart()
 ; return 0; }
 EOF
-if { (eval echo configure:6766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6831,7 +6963,7 @@ EOF
 fi
 
 echo $ac_n "checking if drag and drop API is needed""... $ac_c" 1>&6
-echo "configure:6835: checking if drag and drop API is needed" >&5
+echo "configure:6967: checking if drag and drop API is needed" >&5
 if test "$with_dragndrop" != "no" ; then
   if test -n "$dragndrop_proto" ; then
     with_dragndrop=yes
@@ -6852,18 +6984,18 @@ EOF
 fi
 
 echo "checking for LDAP" 1>&6
-echo "configure:6856: checking for LDAP" >&5
+echo "configure:6988: checking for LDAP" >&5
 test -z "$with_ldap" && { ac_safe=`echo "ldap.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for ldap.h""... $ac_c" 1>&6
-echo "configure:6859: checking for ldap.h" >&5
+echo "configure:6991: checking for ldap.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 6862 "configure"
+#line 6994 "configure"
 #include "confdefs.h"
 #include <ldap.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6867: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6999: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6886,15 +7018,15 @@ fi
  }
 test -z "$with_ldap" && { ac_safe=`echo "lber.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for lber.h""... $ac_c" 1>&6
-echo "configure:6890: checking for lber.h" >&5
+echo "configure:7022: checking for lber.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 6893 "configure"
+#line 7025 "configure"
 #include "confdefs.h"
 #include <lber.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6898: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7030: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -6918,12 +7050,12 @@ fi
 if test "$with_ldap" != "no"; then
   
 echo $ac_n "checking for ldap_search in -lldap""... $ac_c" 1>&6
-echo "configure:6922: checking for ldap_search in -lldap" >&5
+echo "configure:7054: checking for ldap_search in -lldap" >&5
 ac_lib_var=`echo ldap'_'ldap_search | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lldap "
 cat > conftest.$ac_ext <<EOF
-#line 6927 "configure"
+#line 7059 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6934,7 +7066,7 @@ int main() {
 ldap_search()
 ; return 0; }
 EOF
-if { (eval echo configure:6938: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -6959,12 +7091,12 @@ fi
 xe_msg_checking="for ldap_open in -lldap"
 test -n "-llber" && xe_msg_checking="$xe_msg_checking using extra libs -llber"
 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
-echo "configure:6963: checking "$xe_msg_checking"" >&5
+echo "configure:7095: checking "$xe_msg_checking"" >&5
 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lldap -llber"
 cat > conftest.$ac_ext <<EOF
-#line 6968 "configure"
+#line 7100 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6975,7 +7107,7 @@ int main() {
 ldap_open()
 ; return 0; }
 EOF
-if { (eval echo configure:6979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7111: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7000,12 +7132,12 @@ fi
 xe_msg_checking="for ldap_open in -lldap"
 test -n "-llber -lkrb" && xe_msg_checking="$xe_msg_checking using extra libs -llber -lkrb"
 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
-echo "configure:7004: checking "$xe_msg_checking"" >&5
+echo "configure:7136: checking "$xe_msg_checking"" >&5
 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lldap -llber -lkrb"
 cat > conftest.$ac_ext <<EOF
-#line 7009 "configure"
+#line 7141 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7016,7 +7148,7 @@ int main() {
 ldap_open()
 ; return 0; }
 EOF
-if { (eval echo configure:7020: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7041,12 +7173,12 @@ fi
 xe_msg_checking="for ldap_open in -lldap"
 test -n "-llber -lkrb -ldes" && xe_msg_checking="$xe_msg_checking using extra libs -llber -lkrb -ldes"
 echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
-echo "configure:7045: checking "$xe_msg_checking"" >&5
+echo "configure:7177: checking "$xe_msg_checking"" >&5
 ac_lib_var=`echo ldap'_'ldap_open | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lldap -llber -lkrb -ldes"
 cat > conftest.$ac_ext <<EOF
-#line 7050 "configure"
+#line 7182 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7057,7 +7189,7 @@ int main() {
 ldap_open()
 ; return 0; }
 EOF
-if { (eval echo configure:7061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7108,10 +7240,10 @@ EOF
   for ac_func in ldap_set_option ldap_get_lderrno ldap_result2error ldap_parse_result
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:7112: checking for $ac_func" >&5
+echo "configure:7244: checking for $ac_func" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 7115 "configure"
+#line 7247 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -7134,7 +7266,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -7165,20 +7297,20 @@ fi
 
 if test "$with_postgresql" != "no"; then
   echo "checking for PostgreSQL" 1>&6
-echo "configure:7169: checking for PostgreSQL" >&5
+echo "configure:7301: checking for PostgreSQL" >&5
 
   for header_dir in "" "pgsql/" "postgresql/"; do
     ac_safe=`echo "${header_dir}libpq-fe.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for ${header_dir}libpq-fe.h""... $ac_c" 1>&6
-echo "configure:7174: checking for ${header_dir}libpq-fe.h" >&5
+echo "configure:7306: checking for ${header_dir}libpq-fe.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 7177 "configure"
+#line 7309 "configure"
 #include "confdefs.h"
 #include <${header_dir}libpq-fe.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7182: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7314: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7202,12 +7334,12 @@ fi
 
   test -n "$libpq_fe_h_file" && { 
 echo $ac_n "checking for PQconnectdb in -lpq""... $ac_c" 1>&6
-echo "configure:7206: checking for PQconnectdb in -lpq" >&5
+echo "configure:7338: checking for PQconnectdb in -lpq" >&5
 ac_lib_var=`echo pq'_'PQconnectdb | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lpq "
 cat > conftest.$ac_ext <<EOF
-#line 7211 "configure"
+#line 7343 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7218,7 +7350,7 @@ int main() {
 PQconnectdb()
 ; return 0; }
 EOF
-if { (eval echo configure:7222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7251,12 +7383,12 @@ EOF
 
     
 echo $ac_n "checking for PQconnectStart in -lpq""... $ac_c" 1>&6
-echo "configure:7255: checking for PQconnectStart in -lpq" >&5
+echo "configure:7387: checking for PQconnectStart in -lpq" >&5
 ac_lib_var=`echo pq'_'PQconnectStart | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lpq "
 cat > conftest.$ac_ext <<EOF
-#line 7260 "configure"
+#line 7392 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7267,7 +7399,7 @@ int main() {
 PQconnectStart()
 ; return 0; }
 EOF
-if { (eval echo configure:7271: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7315,15 +7447,15 @@ fi
 
 if test "$window_system" != "none"; then
   echo "checking for graphics libraries" 1>&6
-echo "configure:7319: checking for graphics libraries" >&5
+echo "configure:7451: checking for graphics libraries" >&5
 
     xpm_problem=""
   if test -z "$with_xpm"; then
     echo $ac_n "checking for Xpm - no older than 3.4f""... $ac_c" 1>&6
-echo "configure:7324: checking for Xpm - no older than 3.4f" >&5
+echo "configure:7456: checking for Xpm - no older than 3.4f" >&5
     xe_check_libs=-lXpm
     cat > conftest.$ac_ext <<EOF
-#line 7327 "configure"
+#line 7459 "configure"
 #include "confdefs.h"
 #define XPM_NUMBERS
 #include <X11/xpm.h>
@@ -7332,7 +7464,7 @@ echo "configure:7324: checking for Xpm - no older than 3.4f" >&5
       XpmIncludeVersion != XpmLibraryVersion() ? 1 :
       XpmIncludeVersion < 30406 ? 2 : 0 ;}
 EOF
-if { (eval echo configure:7336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:7468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   ./conftest dummy_arg; xpm_status=$?;
       if test "$xpm_status" = "0"; then
@@ -7374,17 +7506,17 @@ EOF
 
     libs_x="-lXpm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXpm\" to \$libs_x"; fi
     echo $ac_n "checking for \"FOR_MSW\" xpm""... $ac_c" 1>&6
-echo "configure:7378: checking for \"FOR_MSW\" xpm" >&5
+echo "configure:7510: checking for \"FOR_MSW\" xpm" >&5
     xe_check_libs=-lXpm
     cat > conftest.$ac_ext <<EOF
-#line 7381 "configure"
+#line 7513 "configure"
 #include "confdefs.h"
 
 int main() {
 XpmCreatePixmapFromData()
 ; return 0; }
 EOF
-if { (eval echo configure:7388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7520: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   xpm_for_msw=no
 else
@@ -7410,15 +7542,15 @@ EOF
 
     test -z "$with_xface" && { ac_safe=`echo "compface.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for compface.h""... $ac_c" 1>&6
-echo "configure:7414: checking for compface.h" >&5
+echo "configure:7546: checking for compface.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 7417 "configure"
+#line 7549 "configure"
 #include "confdefs.h"
 #include <compface.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7422: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7554: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7441,12 +7573,12 @@ fi
  }
   test -z "$with_xface" && { 
 echo $ac_n "checking for UnGenFace in -lcompface""... $ac_c" 1>&6
-echo "configure:7445: checking for UnGenFace in -lcompface" >&5
+echo "configure:7577: checking for UnGenFace in -lcompface" >&5
 ac_lib_var=`echo compface'_'UnGenFace | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lcompface "
 cat > conftest.$ac_ext <<EOF
-#line 7450 "configure"
+#line 7582 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7457,7 +7589,7 @@ int main() {
 UnGenFace()
 ; return 0; }
 EOF
-if { (eval echo configure:7461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7509,12 +7641,12 @@ EOF
       if test "$with_png $with_tiff" != "no no"; then
     
 echo $ac_n "checking for inflate in -lc""... $ac_c" 1>&6
-echo "configure:7513: checking for inflate in -lc" >&5
+echo "configure:7645: checking for inflate in -lc" >&5
 ac_lib_var=`echo c'_'inflate | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lc "
 cat > conftest.$ac_ext <<EOF
-#line 7518 "configure"
+#line 7650 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7525,7 +7657,7 @@ int main() {
 inflate()
 ; return 0; }
 EOF
-if { (eval echo configure:7529: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7544,12 +7676,12 @@ else
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for inflate in -lz""... $ac_c" 1>&6
-echo "configure:7548: checking for inflate in -lz" >&5
+echo "configure:7680: checking for inflate in -lz" >&5
 ac_lib_var=`echo z'_'inflate | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lz "
 cat > conftest.$ac_ext <<EOF
-#line 7553 "configure"
+#line 7685 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7560,7 +7692,7 @@ int main() {
 inflate()
 ; return 0; }
 EOF
-if { (eval echo configure:7564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7579,12 +7711,12 @@ else
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for inflate in -lgz""... $ac_c" 1>&6
-echo "configure:7583: checking for inflate in -lgz" >&5
+echo "configure:7715: checking for inflate in -lgz" >&5
 ac_lib_var=`echo gz'_'inflate | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lgz "
 cat > conftest.$ac_ext <<EOF
-#line 7588 "configure"
+#line 7720 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7595,7 +7727,7 @@ int main() {
 inflate()
 ; return 0; }
 EOF
-if { (eval echo configure:7599: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7731: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7625,15 +7757,15 @@ fi
 
     test -z "$with_jpeg" && { ac_safe=`echo "jpeglib.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for jpeglib.h""... $ac_c" 1>&6
-echo "configure:7629: checking for jpeglib.h" >&5
+echo "configure:7761: checking for jpeglib.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 7632 "configure"
+#line 7764 "configure"
 #include "confdefs.h"
 #include <jpeglib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7637: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7769: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7656,12 +7788,12 @@ fi
  }
   test -z "$with_jpeg" && { 
 echo $ac_n "checking for jpeg_destroy_decompress in -ljpeg""... $ac_c" 1>&6
-echo "configure:7660: checking for jpeg_destroy_decompress in -ljpeg" >&5
+echo "configure:7792: checking for jpeg_destroy_decompress in -ljpeg" >&5
 ac_lib_var=`echo jpeg'_'jpeg_destroy_decompress | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ljpeg "
 cat > conftest.$ac_ext <<EOF
-#line 7665 "configure"
+#line 7797 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7672,7 +7804,7 @@ int main() {
 jpeg_destroy_decompress()
 ; return 0; }
 EOF
-if { (eval echo configure:7676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7708,10 +7840,10 @@ EOF
 
     png_problem=""
   test -z "$with_png" && { echo $ac_n "checking for pow""... $ac_c" 1>&6
-echo "configure:7712: checking for pow" >&5
+echo "configure:7844: checking for pow" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 7715 "configure"
+#line 7847 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char pow(); below.  */
@@ -7734,7 +7866,7 @@ pow();
 
 ; return 0; }
 EOF
-if { (eval echo configure:7738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_pow=yes"
 else
@@ -7755,15 +7887,15 @@ fi
  }
   test -z "$with_png" && { ac_safe=`echo "png.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for png.h""... $ac_c" 1>&6
-echo "configure:7759: checking for png.h" >&5
+echo "configure:7891: checking for png.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 7762 "configure"
+#line 7894 "configure"
 #include "confdefs.h"
 #include <png.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7767: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7899: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7786,12 +7918,12 @@ fi
  }
   test -z "$with_png" && { 
 echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6
-echo "configure:7790: checking for png_read_image in -lpng" >&5
+echo "configure:7922: checking for png_read_image in -lpng" >&5
 ac_lib_var=`echo png'_'png_read_image | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lpng "
 cat > conftest.$ac_ext <<EOF
-#line 7795 "configure"
+#line 7927 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7802,7 +7934,7 @@ int main() {
 png_read_image()
 ; return 0; }
 EOF
-if { (eval echo configure:7806: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7938: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7825,10 +7957,10 @@ fi
  }
   if test -z "$with_png"; then
     echo $ac_n "checking for workable png version information""... $ac_c" 1>&6
-echo "configure:7829: checking for workable png version information" >&5
+echo "configure:7961: checking for workable png version information" >&5
     xe_check_libs="-lpng -lz"
     cat > conftest.$ac_ext <<EOF
-#line 7832 "configure"
+#line 7964 "configure"
 #include "confdefs.h"
 #include <png.h>
     int main(int c, char **v) {
@@ -7836,7 +7968,7 @@ echo "configure:7829: checking for workable png version information" >&5
     if (strcmp(png_libpng_ver, PNG_LIBPNG_VER_STRING) != 0) return 1;
     return (PNG_LIBPNG_VER < 10002) ? 2 : 0 ;}
 EOF
-if { (eval echo configure:7840: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:7972: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   ./conftest dummy_arg; png_status=$?;
       if test "$png_status" = "0"; then
@@ -7879,15 +8011,15 @@ EOF
 
     test -z "$with_tiff" && { ac_safe=`echo "tiffio.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for tiffio.h""... $ac_c" 1>&6
-echo "configure:7883: checking for tiffio.h" >&5
+echo "configure:8015: checking for tiffio.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 7886 "configure"
+#line 8018 "configure"
 #include "confdefs.h"
 #include <tiffio.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7891: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8023: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -7910,12 +8042,12 @@ fi
  }
   test -z "$with_tiff" && { 
 echo $ac_n "checking for TIFFClientOpen in -ltiff""... $ac_c" 1>&6
-echo "configure:7914: checking for TIFFClientOpen in -ltiff" >&5
+echo "configure:8046: checking for TIFFClientOpen in -ltiff" >&5
 ac_lib_var=`echo tiff'_'TIFFClientOpen | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ltiff "
 cat > conftest.$ac_ext <<EOF
-#line 7919 "configure"
+#line 8051 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7926,7 +8058,7 @@ int main() {
 TIFFClientOpen()
 ; return 0; }
 EOF
-if { (eval echo configure:7930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8062: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -7965,10 +8097,10 @@ fi
 if test "$with_x11" = "yes"; then
 
   echo "checking for X11 graphics libraries" 1>&6
-echo "configure:7969: checking for X11 graphics libraries" >&5
+echo "configure:8101: checking for X11 graphics libraries" >&5
 
   echo "checking for the Athena widgets" 1>&6
-echo "configure:7972: checking for the Athena widgets" >&5
+echo "configure:8104: checking for the Athena widgets" >&5
 
     case "$with_athena" in
         "xaw" | "")    athena_variant=Xaw      athena_3d=no  ;;
@@ -7982,12 +8114,12 @@ echo "configure:7972: checking for the Athena widgets" >&5
     if test "$athena_3d" = "no"; then
     
 echo $ac_n "checking for XawScrollbarSetThumb in -l$athena_variant""... $ac_c" 1>&6
-echo "configure:7986: checking for XawScrollbarSetThumb in -l$athena_variant" >&5
+echo "configure:8118: checking for XawScrollbarSetThumb in -l$athena_variant" >&5
 ac_lib_var=`echo $athena_variant'_'XawScrollbarSetThumb | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -l$athena_variant "
 cat > conftest.$ac_ext <<EOF
-#line 7991 "configure"
+#line 8123 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -7998,7 +8130,7 @@ int main() {
 XawScrollbarSetThumb()
 ; return 0; }
 EOF
-if { (eval echo configure:8002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8134: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8014,12 +8146,12 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
   echo "$ac_t""yes" 1>&6
           
 echo $ac_n "checking for threeDClassRec in -l$athena_variant""... $ac_c" 1>&6
-echo "configure:8018: checking for threeDClassRec in -l$athena_variant" >&5
+echo "configure:8150: checking for threeDClassRec in -l$athena_variant" >&5
 ac_lib_var=`echo $athena_variant'_'threeDClassRec | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -l$athena_variant "
 cat > conftest.$ac_ext <<EOF
-#line 8023 "configure"
+#line 8155 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8030,7 +8162,7 @@ int main() {
 threeDClassRec()
 ; return 0; }
 EOF
-if { (eval echo configure:8034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8061,12 +8193,12 @@ fi
   else
         
 echo $ac_n "checking for threeDClassRec in -l$athena_variant""... $ac_c" 1>&6
-echo "configure:8065: checking for threeDClassRec in -l$athena_variant" >&5
+echo "configure:8197: checking for threeDClassRec in -l$athena_variant" >&5
 ac_lib_var=`echo $athena_variant'_'threeDClassRec | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -l$athena_variant "
 cat > conftest.$ac_ext <<EOF
-#line 8070 "configure"
+#line 8202 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8077,7 +8209,7 @@ int main() {
 threeDClassRec()
 ; return 0; }
 EOF
-if { (eval echo configure:8081: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8213: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8095,12 +8227,12 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for threeDClassRec in -lXaw""... $ac_c" 1>&6
-echo "configure:8099: checking for threeDClassRec in -lXaw" >&5
+echo "configure:8231: checking for threeDClassRec in -lXaw" >&5
 ac_lib_var=`echo Xaw'_'threeDClassRec | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lXaw "
 cat > conftest.$ac_ext <<EOF
-#line 8104 "configure"
+#line 8236 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8111,7 +8243,7 @@ int main() {
 threeDClassRec()
 ; return 0; }
 EOF
-if { (eval echo configure:8115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8142,15 +8274,15 @@ fi
     if test "$athena_3d" = "no"; then
     ac_safe=`echo "X11/Xaw/ThreeD.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for X11/Xaw/ThreeD.h""... $ac_c" 1>&6
-echo "configure:8146: checking for X11/Xaw/ThreeD.h" >&5
+echo "configure:8278: checking for X11/Xaw/ThreeD.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 8149 "configure"
+#line 8281 "configure"
 #include "confdefs.h"
 #include <X11/Xaw/ThreeD.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8154: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8286: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8170,15 +8302,15 @@ else
   echo "$ac_t""no" 1>&6
 ac_safe=`echo "X11/Xaw/XawInit.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for X11/Xaw/XawInit.h""... $ac_c" 1>&6
-echo "configure:8174: checking for X11/Xaw/XawInit.h" >&5
+echo "configure:8306: checking for X11/Xaw/XawInit.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 8177 "configure"
+#line 8309 "configure"
 #include "confdefs.h"
 #include <X11/Xaw/XawInit.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8182: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8314: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8204,15 +8336,15 @@ fi
   else
             ac_safe=`echo "X11/$athena_variant/XawInit.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for X11/$athena_variant/XawInit.h""... $ac_c" 1>&6
-echo "configure:8208: checking for X11/$athena_variant/XawInit.h" >&5
+echo "configure:8340: checking for X11/$athena_variant/XawInit.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 8211 "configure"
+#line 8343 "configure"
 #include "confdefs.h"
 #include <X11/$athena_variant/XawInit.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8216: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8348: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8229,15 +8361,15 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   ac_safe=`echo "X11/$athena_variant/ThreeD.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for X11/$athena_variant/ThreeD.h""... $ac_c" 1>&6
-echo "configure:8233: checking for X11/$athena_variant/ThreeD.h" >&5
+echo "configure:8365: checking for X11/$athena_variant/ThreeD.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 8236 "configure"
+#line 8368 "configure"
 #include "confdefs.h"
 #include <X11/$athena_variant/ThreeD.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8241: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8373: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8265,15 +8397,15 @@ fi
         if test -z "$athena_h_path"; then
       ac_safe=`echo "$athena_variant/XawInit.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $athena_variant/XawInit.h""... $ac_c" 1>&6
-echo "configure:8269: checking for $athena_variant/XawInit.h" >&5
+echo "configure:8401: checking for $athena_variant/XawInit.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 8272 "configure"
+#line 8404 "configure"
 #include "confdefs.h"
 #include <$athena_variant/XawInit.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8277: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8409: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8290,15 +8422,15 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   ac_safe=`echo "$athena_variant/ThreeD.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $athena_variant/ThreeD.h""... $ac_c" 1>&6
-echo "configure:8294: checking for $athena_variant/ThreeD.h" >&5
+echo "configure:8426: checking for $athena_variant/ThreeD.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 8297 "configure"
+#line 8429 "configure"
 #include "confdefs.h"
 #include <$athena_variant/ThreeD.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8302: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8434: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8327,15 +8459,15 @@ fi
         if test -z "$athena_h_path" -a "$athena_variant" != "Xaw3d"; then
       ac_safe=`echo "X11/Xaw3d/XawInit.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for X11/Xaw3d/XawInit.h""... $ac_c" 1>&6
-echo "configure:8331: checking for X11/Xaw3d/XawInit.h" >&5
+echo "configure:8463: checking for X11/Xaw3d/XawInit.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 8334 "configure"
+#line 8466 "configure"
 #include "confdefs.h"
 #include <X11/Xaw3d/XawInit.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8339: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8471: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8352,15 +8484,15 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   ac_safe=`echo "X11/Xaw3d/ThreeD.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for X11/Xaw3d/ThreeD.h""... $ac_c" 1>&6
-echo "configure:8356: checking for X11/Xaw3d/ThreeD.h" >&5
+echo "configure:8488: checking for X11/Xaw3d/ThreeD.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 8359 "configure"
+#line 8491 "configure"
 #include "confdefs.h"
 #include <X11/Xaw3d/ThreeD.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8364: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8496: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8392,15 +8524,15 @@ fi
         if test -z "$athena_h_path" -a "$athena_variant" != "Xaw3d"; then
       ac_safe=`echo "Xaw3d/XawInit.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for Xaw3d/XawInit.h""... $ac_c" 1>&6
-echo "configure:8396: checking for Xaw3d/XawInit.h" >&5
+echo "configure:8528: checking for Xaw3d/XawInit.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 8399 "configure"
+#line 8531 "configure"
 #include "confdefs.h"
 #include <Xaw3d/XawInit.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8404: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8536: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8417,15 +8549,15 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   ac_safe=`echo "Xaw3d/ThreeD.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for Xaw3d/ThreeD.h""... $ac_c" 1>&6
-echo "configure:8421: checking for Xaw3d/ThreeD.h" >&5
+echo "configure:8553: checking for Xaw3d/ThreeD.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 8424 "configure"
+#line 8556 "configure"
 #include "confdefs.h"
 #include <Xaw3d/ThreeD.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8429: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8561: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8457,15 +8589,15 @@ fi
             if test -z "$athena_h_path"; then
       ac_safe=`echo "X11/Xaw/ThreeD.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for X11/Xaw/ThreeD.h""... $ac_c" 1>&6
-echo "configure:8461: checking for X11/Xaw/ThreeD.h" >&5
+echo "configure:8593: checking for X11/Xaw/ThreeD.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 8464 "configure"
+#line 8596 "configure"
 #include "confdefs.h"
 #include <X11/Xaw/ThreeD.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8469: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8601: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8500,15 +8632,15 @@ fi
 
     ac_safe=`echo "Xm/Xm.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for Xm/Xm.h""... $ac_c" 1>&6
-echo "configure:8504: checking for Xm/Xm.h" >&5
+echo "configure:8636: checking for Xm/Xm.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 8507 "configure"
+#line 8639 "configure"
 #include "confdefs.h"
 #include <Xm/Xm.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8512: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8644: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -8525,12 +8657,12 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   
 echo $ac_n "checking for XmStringFree in -lXm""... $ac_c" 1>&6
-echo "configure:8529: checking for XmStringFree in -lXm" >&5
+echo "configure:8661: checking for XmStringFree in -lXm" >&5
 ac_lib_var=`echo Xm'_'XmStringFree | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lXm "
 cat > conftest.$ac_ext <<EOF
-#line 8534 "configure"
+#line 8666 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -8541,7 +8673,7 @@ int main() {
 XmStringFree()
 ; return 0; }
 EOF
-if { (eval echo configure:8545: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8677: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -8570,9 +8702,9 @@ fi
 
   if test "$have_motif" = "yes"; then
         echo $ac_n "checking for Lesstif""... $ac_c" 1>&6
-echo "configure:8574: checking for Lesstif" >&5
+echo "configure:8706: checking for Lesstif" >&5
     cat > conftest.$ac_ext <<EOF
-#line 8576 "configure"
+#line 8708 "configure"
 #include "confdefs.h"
 #include <Xm/Xm.h>
 #ifdef LESSTIF_VERSION
@@ -8978,7 +9110,7 @@ fi
 
 if test "$with_mule" = "yes" ; then
   echo "checking for Mule-related features" 1>&6
-echo "configure:8982: checking for Mule-related features" >&5
+echo "configure:9114: checking for Mule-related features" >&5
   { test "$extra_verbose" = "yes" && cat << \EOF
     Defining MULE
 EOF
@@ -9003,15 +9135,15 @@ EOF
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:9007: checking for $ac_hdr" >&5
+echo "configure:9139: checking for $ac_hdr" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 9010 "configure"
+#line 9142 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9015: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9147: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9042,12 +9174,12 @@ done
 
   
 echo $ac_n "checking for strerror in -lintl""... $ac_c" 1>&6
-echo "configure:9046: checking for strerror in -lintl" >&5
+echo "configure:9178: checking for strerror in -lintl" >&5
 ac_lib_var=`echo intl'_'strerror | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lintl "
 cat > conftest.$ac_ext <<EOF
-#line 9051 "configure"
+#line 9183 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -9058,7 +9190,7 @@ int main() {
 strerror()
 ; return 0; }
 EOF
-if { (eval echo configure:9062: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9091,18 +9223,18 @@ fi
 
 
   echo "checking for Mule input methods" 1>&6
-echo "configure:9095: checking for Mule input methods" >&5
+echo "configure:9227: checking for Mule input methods" >&5
         case "$with_xim" in "" | "yes" )
     echo "checking for XIM" 1>&6
-echo "configure:9098: checking for XIM" >&5
+echo "configure:9230: checking for XIM" >&5
     
 echo $ac_n "checking for XOpenIM in -lX11""... $ac_c" 1>&6
-echo "configure:9101: checking for XOpenIM in -lX11" >&5
+echo "configure:9233: checking for XOpenIM in -lX11" >&5
 ac_lib_var=`echo X11'_'XOpenIM | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lX11 "
 cat > conftest.$ac_ext <<EOF
-#line 9106 "configure"
+#line 9238 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -9113,7 +9245,7 @@ int main() {
 XOpenIM()
 ; return 0; }
 EOF
-if { (eval echo configure:9117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9249: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9137,12 +9269,12 @@ fi
         if test "$have_motif $have_lesstif" = "yes no"; then
       
 echo $ac_n "checking for XmImMbLookupString in -lXm""... $ac_c" 1>&6
-echo "configure:9141: checking for XmImMbLookupString in -lXm" >&5
+echo "configure:9273: checking for XmImMbLookupString in -lXm" >&5
 ac_lib_var=`echo Xm'_'XmImMbLookupString | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lXm "
 cat > conftest.$ac_ext <<EOF
-#line 9146 "configure"
+#line 9278 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -9153,7 +9285,7 @@ int main() {
 XmImMbLookupString()
 ; return 0; }
 EOF
-if { (eval echo configure:9157: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9289: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9218,15 +9350,15 @@ EOF
 
     if test "$with_xfs" = "yes" ; then
     echo "checking for XFontSet" 1>&6
-echo "configure:9222: checking for XFontSet" >&5
+echo "configure:9354: checking for XFontSet" >&5
     
 echo $ac_n "checking for XmbDrawString in -lX11""... $ac_c" 1>&6
-echo "configure:9225: checking for XmbDrawString in -lX11" >&5
+echo "configure:9357: checking for XmbDrawString in -lX11" >&5
 ac_lib_var=`echo X11'_'XmbDrawString | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lX11 "
 cat > conftest.$ac_ext <<EOF
-#line 9230 "configure"
+#line 9362 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -9237,7 +9369,7 @@ int main() {
 XmbDrawString()
 ; return 0; }
 EOF
-if { (eval echo configure:9241: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9277,15 +9409,15 @@ EOF
     test "$with_wnn6" = "yes" && with_wnn=yes # wnn6 implies wnn support
   test -z "$with_wnn" && { ac_safe=`echo "wnn/jllib.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for wnn/jllib.h""... $ac_c" 1>&6
-echo "configure:9281: checking for wnn/jllib.h" >&5
+echo "configure:9413: checking for wnn/jllib.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 9284 "configure"
+#line 9416 "configure"
 #include "confdefs.h"
 #include <wnn/jllib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9289: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9421: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9310,10 +9442,10 @@ fi
     for ac_func in crypt
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9314: checking for $ac_func" >&5
+echo "configure:9446: checking for $ac_func" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 9317 "configure"
+#line 9449 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -9336,7 +9468,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:9340: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -9365,12 +9497,12 @@ done
 
     test "$ac_cv_func_crypt" != "yes" && { 
 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
-echo "configure:9369: checking for crypt in -lcrypt" >&5
+echo "configure:9501: checking for crypt in -lcrypt" >&5
 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lcrypt "
 cat > conftest.$ac_ext <<EOF
-#line 9374 "configure"
+#line 9506 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -9381,7 +9513,7 @@ int main() {
 crypt()
 ; return 0; }
 EOF
-if { (eval echo configure:9385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9416,12 +9548,12 @@ fi
     if test -z "$with_wnn" -o "$with_wnn" = "yes"; then
     
 echo $ac_n "checking for jl_dic_list_e in -lwnn""... $ac_c" 1>&6
-echo "configure:9420: checking for jl_dic_list_e in -lwnn" >&5
+echo "configure:9552: checking for jl_dic_list_e in -lwnn" >&5
 ac_lib_var=`echo wnn'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lwnn "
 cat > conftest.$ac_ext <<EOF
-#line 9425 "configure"
+#line 9557 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -9432,7 +9564,7 @@ int main() {
 jl_dic_list_e()
 ; return 0; }
 EOF
-if { (eval echo configure:9436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9568: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9450,12 +9582,12 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for jl_dic_list_e in -lwnn4""... $ac_c" 1>&6
-echo "configure:9454: checking for jl_dic_list_e in -lwnn4" >&5
+echo "configure:9586: checking for jl_dic_list_e in -lwnn4" >&5
 ac_lib_var=`echo wnn4'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lwnn4 "
 cat > conftest.$ac_ext <<EOF
-#line 9459 "configure"
+#line 9591 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -9466,7 +9598,7 @@ int main() {
 jl_dic_list_e()
 ; return 0; }
 EOF
-if { (eval echo configure:9470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9602: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9484,12 +9616,12 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for jl_dic_list_e in -lwnn6""... $ac_c" 1>&6
-echo "configure:9488: checking for jl_dic_list_e in -lwnn6" >&5
+echo "configure:9620: checking for jl_dic_list_e in -lwnn6" >&5
 ac_lib_var=`echo wnn6'_'jl_dic_list_e | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lwnn6 "
 cat > conftest.$ac_ext <<EOF
-#line 9493 "configure"
+#line 9625 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -9500,7 +9632,7 @@ int main() {
 jl_dic_list_e()
 ; return 0; }
 EOF
-if { (eval echo configure:9504: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9636: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9518,12 +9650,12 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for dic_list_e in -lwnn6_fromsrc""... $ac_c" 1>&6
-echo "configure:9522: checking for dic_list_e in -lwnn6_fromsrc" >&5
+echo "configure:9654: checking for dic_list_e in -lwnn6_fromsrc" >&5
 ac_lib_var=`echo wnn6_fromsrc'_'dic_list_e | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lwnn6_fromsrc "
 cat > conftest.$ac_ext <<EOF
-#line 9527 "configure"
+#line 9659 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -9534,7 +9666,7 @@ int main() {
 dic_list_e()
 ; return 0; }
 EOF
-if { (eval echo configure:9538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9582,12 +9714,12 @@ EOF
     if test "$with_wnn6" != "no"; then
       
 echo $ac_n "checking for jl_fi_dic_list in -l$libwnn""... $ac_c" 1>&6
-echo "configure:9586: checking for jl_fi_dic_list in -l$libwnn" >&5
+echo "configure:9718: checking for jl_fi_dic_list in -l$libwnn" >&5
 ac_lib_var=`echo $libwnn'_'jl_fi_dic_list | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -l$libwnn "
 cat > conftest.$ac_ext <<EOF
-#line 9591 "configure"
+#line 9723 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -9598,7 +9730,7 @@ int main() {
 jl_fi_dic_list()
 ; return 0; }
 EOF
-if { (eval echo configure:9602: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9734: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9633,15 +9765,15 @@ EOF
   if test "$with_canna" != "no"; then
     ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6
-echo "configure:9637: checking for canna/jrkanji.h" >&5
+echo "configure:9769: checking for canna/jrkanji.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 9640 "configure"
+#line 9772 "configure"
 #include "confdefs.h"
 #include <canna/jrkanji.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9645: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9777: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9668,15 +9800,15 @@ fi
     c_switch_site="$c_switch_site -I/usr/local/canna/include"
     ac_safe=`echo "canna/jrkanji.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for canna/jrkanji.h""... $ac_c" 1>&6
-echo "configure:9672: checking for canna/jrkanji.h" >&5
+echo "configure:9804: checking for canna/jrkanji.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 9675 "configure"
+#line 9807 "configure"
 #include "confdefs.h"
 #include <canna/jrkanji.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9680: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9812: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9704,15 +9836,15 @@ fi
 
   test -z "$with_canna" && { ac_safe=`echo "canna/RK.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for canna/RK.h""... $ac_c" 1>&6
-echo "configure:9708: checking for canna/RK.h" >&5
+echo "configure:9840: checking for canna/RK.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 9711 "configure"
+#line 9843 "configure"
 #include "confdefs.h"
 #include <canna/RK.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:9716: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:9848: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -9735,12 +9867,12 @@ fi
  }
   test -z "$with_canna" && { 
 echo $ac_n "checking for RkBgnBun in -lRKC""... $ac_c" 1>&6
-echo "configure:9739: checking for RkBgnBun in -lRKC" >&5
+echo "configure:9871: checking for RkBgnBun in -lRKC" >&5
 ac_lib_var=`echo RKC'_'RkBgnBun | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lRKC "
 cat > conftest.$ac_ext <<EOF
-#line 9744 "configure"
+#line 9876 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -9751,7 +9883,7 @@ int main() {
 RkBgnBun()
 ; return 0; }
 EOF
-if { (eval echo configure:9755: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9774,12 +9906,12 @@ fi
  }
   test -z "$with_canna" && { 
 echo $ac_n "checking for jrKanjiControl in -lcanna""... $ac_c" 1>&6
-echo "configure:9778: checking for jrKanjiControl in -lcanna" >&5
+echo "configure:9910: checking for jrKanjiControl in -lcanna" >&5
 ac_lib_var=`echo canna'_'jrKanjiControl | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lcanna "
 cat > conftest.$ac_ext <<EOF
-#line 9783 "configure"
+#line 9915 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -9790,7 +9922,7 @@ int main() {
 jrKanjiControl()
 ; return 0; }
 EOF
-if { (eval echo configure:9794: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -9839,12 +9971,12 @@ if test "$need_motif" = "yes" ; then
   libs_x="-lXm $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-lXm\" to \$libs_x"; fi
     
 echo $ac_n "checking for layout_object_getvalue in -li18n""... $ac_c" 1>&6
-echo "configure:9843: checking for layout_object_getvalue in -li18n" >&5
+echo "configure:9975: checking for layout_object_getvalue in -li18n" >&5
 ac_lib_var=`echo i18n'_'layout_object_getvalue | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -li18n "
 cat > conftest.$ac_ext <<EOF
-#line 9848 "configure"
+#line 9980 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -9855,7 +9987,7 @@ int main() {
 layout_object_getvalue()
 ; return 0; }
 EOF
-if { (eval echo configure:9859: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:9991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
 
 fi
 
-for ac_func in cbrt closedir dup2 eaccess fmod fpathconf frexp ftime getaddrinfo gethostname getnameinfo getpagesize gettimeofday getcwd getpt getwd logb lrand48 matherr mkdir mktime perror poll random rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask snprintf stpcpy strcasecmp strerror tzset ulimit usleep utimes waitpid vsnprintf fsync ftruncate umask
+for ac_func in cbrt closedir dup2 eaccess fmod fpathconf frexp ftime getaddrinfo gethostname getnameinfo getpagesize gettimeofday getcwd getwd logb lrand48 matherr mkdir mktime perror poll random rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask snprintf stpcpy strerror tzset ulimit usleep utimes waitpid vsnprintf fsync ftruncate umask
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:9945: checking for $ac_func" >&5
+echo "configure:10077: checking for $ac_func" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 9948 "configure"
+#line 10080 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -9967,7 +10099,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:9971: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10103: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
 done
 
 
+for ac_func in getpt _getpt grantpt unlockpt ptsname killpg tcgetpgrp
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:10134: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 10137 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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();
+
+int main() {
+
+/* 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
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:10160: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  { test "$extra_verbose" = "yes" && cat << EOF
+    Defining $ac_tr_func
+EOF
+cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+}
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+
+echo $ac_n "checking for openpty""... $ac_c" 1>&6
+echo "configure:10189: checking for openpty" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 10192 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char openpty(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char openpty();
+
+int main() {
+
+/* 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_openpty) || defined (__stub___openpty)
+choke me
+#else
+openpty();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:10215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_openpty=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_openpty=no"
+fi
+rm -f conftest*
+
+if eval "test \"`echo '$ac_cv_func_'openpty`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  have_openpty=yes
+else
+  echo "$ac_t""no" 1>&6
+
+  
+echo $ac_n "checking for openpty in -lutil""... $ac_c" 1>&6
+echo "configure:10234: checking for openpty in -lutil" >&5
+ac_lib_var=`echo util'_'openpty | sed 'y%./+-%__p_%'`
+
+xe_check_libs=" -lutil "
+cat > conftest.$ac_ext <<EOF
+#line 10239 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char openpty();
+
+int main() {
+openpty()
+; return 0; }
+EOF
+if { (eval echo configure:10250: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+xe_check_libs=""
+
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
+  echo "$ac_t""yes" 1>&6
+  have_openpty=yes need_libutil=yes
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+fi
+
+if test "$have_openpty" = "yes"; then
+  { test "$extra_verbose" = "yes" && cat << \EOF
+    Defining HAVE_OPENPTY
+EOF
+cat >> confdefs.h <<\EOF
+#define HAVE_OPENPTY 1
+EOF
+}
+
+  for ac_hdr in pty.h libutil.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:10285: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 10288 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:10293: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  { test "$extra_verbose" = "yes" && cat << EOF
+    Defining $ac_tr_hdr
+EOF
+cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+}
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+  test "$need_libutil" = "yes" && libs_system="$libs_system -lutil" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"-lutil\" to \$libs_system"; fi
+fi
+
+for ac_hdr in sys/stropts.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:10329: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 10332 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:10337: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  { test "$extra_verbose" = "yes" && cat << EOF
+    Defining $ac_tr_hdr
+EOF
+cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+}
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+if test "$ac_cv_header_sys_stropts_h" = "yes"; then
+  for ac_func in isastream
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:10370: checking for $ac_func" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 10373 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* 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();
+
+int main() {
+
+/* 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
+$ac_func();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:10396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_$ac_func=no"
+fi
+rm -f conftest*
+
+if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+  { test "$extra_verbose" = "yes" && cat << EOF
+    Defining $ac_tr_func
+EOF
+cat >> confdefs.h <<EOF
+#define $ac_tr_func 1
+EOF
+}
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+  for ac_hdr in sys/strtio.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:10427: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 10430 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:10435: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  { test "$extra_verbose" = "yes" && cat << EOF
+    Defining $ac_tr_hdr
+EOF
+cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+}
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+ fi
+
 extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
    echo "    xemacs will be linked with \"realpath.o\""
  fi
@@ -10002,10 +10468,10 @@ extra_objs="$extra_objs realpath.o" &&  if test "$extra_verbose" = "yes"; then
 for ac_func in getloadavg
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:10006: checking for $ac_func" >&5
+echo "configure:10472: checking for $ac_func" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 10009 "configure"
+#line 10475 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -10028,7 +10494,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:10032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
 done
 
 
-if test "$ac_cv_func_getloadavg" != "yes"
-then
-  extra_objs="$extra_objs getloadavg.o" &&  if test "$extra_verbose" = "yes"; then
+if test "$ac_cv_func_getloadavg" = "yes"; then
+        for ac_hdr in sys/loadavg.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:10531: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 10534 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:10539: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  { test "$extra_verbose" = "yes" && cat << EOF
+    Defining $ac_tr_hdr
+EOF
+cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+}
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+else
+    extra_objs="$extra_objs getloadavg.o" &&  if test "$extra_verbose" = "yes"; then
    echo "    xemacs will be linked with \"getloadavg.o\""
  fi
 
     
 echo $ac_n "checking for kstat_open in -lkstat""... $ac_c" 1>&6
-echo "configure:10068: checking for kstat_open in -lkstat" >&5
+echo "configure:10575: checking for kstat_open in -lkstat" >&5
 ac_lib_var=`echo kstat'_'kstat_open | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lkstat "
 cat > conftest.$ac_ext <<EOF
-#line 10073 "configure"
+#line 10580 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -10080,7 +10587,7 @@ int main() {
 kstat_open()
 ; return 0; }
 EOF
-if { (eval echo configure:10084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10591: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -10111,15 +10618,56 @@ else
 fi
 
 
+  for ac_hdr in kstat.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:10626: checking for $ac_hdr" >&5
+
+cat > conftest.$ac_ext <<EOF
+#line 10629 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:10634: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  { test "$extra_verbose" = "yes" && cat << EOF
+    Defining $ac_tr_hdr
+EOF
+cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+}
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
 
     
 echo $ac_n "checking for kvm_read in -lkvm""... $ac_c" 1>&6
-echo "configure:10118: checking for kvm_read in -lkvm" >&5
+echo "configure:10666: checking for kvm_read in -lkvm" >&5
 ac_lib_var=`echo kvm'_'kvm_read | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lkvm "
 cat > conftest.$ac_ext <<EOF
-#line 10123 "configure"
+#line 10671 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -10130,7 +10678,7 @@ int main() {
 kvm_read()
 ; return 0; }
 EOF
-if { (eval echo configure:10134: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10682: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
 fi
 
 echo $ac_n "checking whether netdb declares h_errno""... $ac_c" 1>&6
-echo "configure:10168: checking whether netdb declares h_errno" >&5
+echo "configure:10716: checking whether netdb declares h_errno" >&5
 cat > conftest.$ac_ext <<EOF
-#line 10170 "configure"
+#line 10718 "configure"
 #include "confdefs.h"
 #include <netdb.h>
 int main() {
 return h_errno;
 ; return 0; }
 EOF
-if { (eval echo configure:10177: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
    { test "$extra_verbose" = "yes" && cat << \EOF
 rm -f conftest*
 
 echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6
-echo "configure:10197: checking for sigsetjmp" >&5
+echo "configure:10745: checking for sigsetjmp" >&5
 cat > conftest.$ac_ext <<EOF
-#line 10199 "configure"
+#line 10747 "configure"
 #include "confdefs.h"
 #include <setjmp.h>
 int main() {
 sigjmp_buf bar; sigsetjmp (bar, 0);
 ; return 0; }
 EOF
-if { (eval echo configure:10206: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10754: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6
    { test "$extra_verbose" = "yes" && cat << \EOF
 rm -f conftest*
 
 echo $ac_n "checking whether localtime caches TZ""... $ac_c" 1>&6
-echo "configure:10226: checking whether localtime caches TZ" >&5
+echo "configure:10774: checking whether localtime caches TZ" >&5
 
 if test "$ac_cv_func_tzset" = "yes"; then
 cat > conftest.$ac_ext <<EOF
-#line 10230 "configure"
+#line 10778 "configure"
 #include "confdefs.h"
 #include <time.h>
 #if STDC_HEADERS
@@ -10261,7 +10809,7 @@ main()
   exit (0);
 }
 EOF
-if { (eval echo configure:10265: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:10813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   emacs_cv_localtime_cache=no
 else
@@ -10291,9 +10839,9 @@ fi
 
 if test "$HAVE_TIMEVAL" = "yes"; then
 echo $ac_n "checking whether gettimeofday accepts one or two arguments""... $ac_c" 1>&6
-echo "configure:10295: checking whether gettimeofday accepts one or two arguments" >&5
+echo "configure:10843: checking whether gettimeofday accepts one or two arguments" >&5
 cat > conftest.$ac_ext <<EOF
-#line 10297 "configure"
+#line 10845 "configure"
 #include "confdefs.h"
 
 #ifdef TIME_WITH_SYS_TIME
@@ -10314,7 +10862,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:10318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   echo "$ac_t""two" 1>&6
 else
 
 
 echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:10340: checking for inline" >&5
+echo "configure:10888: checking for inline" >&5
 
 ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
   cat > conftest.$ac_ext <<EOF
-#line 10345 "configure"
+#line 10893 "configure"
 #include "confdefs.h"
 
 int main() {
 } $ac_kw foo() {
 ; return 0; }
 EOF
-if { (eval echo configure:10352: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:10900: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline=$ac_kw; break
 else
@@ -10388,17 +10936,17 @@ test "$ac_cv_c_inline" != "no" -a "$GCC" = "yes" && extra_objs="$extra_objs inli
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:10392: checking for working alloca.h" >&5
+echo "configure:10940: checking for working alloca.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 10395 "configure"
+#line 10943 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if { (eval echo configure:10402: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:10950: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_header_alloca_h=yes
 else
@@ -10422,10 +10970,10 @@ EOF
 fi
 
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:10426: checking for alloca" >&5
+echo "configure:10974: checking for alloca" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 10429 "configure"
+#line 10977 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -10453,7 +11001,7 @@ int main() {
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if { (eval echo configure:10457: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_func_alloca_works=yes
 else
@@ -10492,10 +11040,10 @@ EOF
 
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:10496: checking whether alloca needs Cray hooks" >&5
+echo "configure:11044: checking whether alloca needs Cray hooks" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 10499 "configure"
+#line 11047 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -10519,10 +11067,10 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
 if test $ac_cv_os_cray = yes; then
 for ac_func in _getb67 GETB67 getb67; do
   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:10523: checking for $ac_func" >&5
+echo "configure:11071: checking for $ac_func" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 10526 "configure"
+#line 11074 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -10545,7 +11093,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:10549: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11097: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -10575,10 +11123,10 @@ done
 fi
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:10579: checking stack direction for C alloca" >&5
+echo "configure:11127: checking stack direction for C alloca" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 10582 "configure"
+#line 11130 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -10597,7 +11145,7 @@ main ()
   exit (find_stack_direction() < 0);
 }
 EOF
-if { (eval echo configure:10601: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:11149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   ac_cv_c_stack_direction=1
 else
@@ -10626,15 +11174,15 @@ test -n "$ALLOCA" && extra_objs="$extra_objs $ALLOCA" &&  if test "$extra_verbos
 
 ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
-echo "configure:10630: checking for vfork.h" >&5
+echo "configure:11178: checking for vfork.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 10633 "configure"
+#line 11181 "configure"
 #include "confdefs.h"
 #include <vfork.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:10638: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11186: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -10662,10 +11210,10 @@ else
 fi
 
 echo $ac_n "checking for working vfork""... $ac_c" 1>&6
-echo "configure:10666: checking for working vfork" >&5
+echo "configure:11214: checking for working vfork" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 10669 "configure"
+#line 11217 "configure"
 #include "confdefs.h"
 /* Thanks to Paul Eggert for this test.  */
 #include <stdio.h>
@@ -10760,7 +11308,7 @@ main() {
   }
 }
 EOF
-if { (eval echo configure:10764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:11312: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   ac_cv_func_vfork_works=yes
 else
 
 
 echo $ac_n "checking for working strcoll""... $ac_c" 1>&6
-echo "configure:10790: checking for working strcoll" >&5
+echo "configure:11338: checking for working strcoll" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 10793 "configure"
+#line 11341 "configure"
 #include "confdefs.h"
 #include <string.h>
 main ()
@@ -10799,7 +11347,7 @@ main ()
        strcoll ("123", "456") >= 0);
 }
 EOF
-if { (eval echo configure:10803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:11351: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   ac_cv_func_strcoll_works=yes
 else
 for ac_func in getpgrp
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:10831: checking for $ac_func" >&5
+echo "configure:11379: checking for $ac_func" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 10834 "configure"
+#line 11382 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -10853,7 +11401,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:10857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
 done
 
 echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6
-echo "configure:10885: checking whether getpgrp takes no argument" >&5
+echo "configure:11433: checking whether getpgrp takes no argument" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 10888 "configure"
+#line 11436 "configure"
 #include "confdefs.h"
 
 /*
@@ -10939,7 +11487,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:10943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:11491: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   ac_cv_func_getpgrp_void=yes
 else
 
 
 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:10970: checking for working mmap" >&5
+echo "configure:11518: checking for working mmap" >&5
 case "$opsys" in ultrix* ) have_mmap=no ;; *)
 cat > conftest.$ac_ext <<EOF
-#line 10973 "configure"
+#line 11521 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 #include <unistd.h>
@@ -11002,7 +11550,7 @@ int main (int argc, char *argv[])
   return 1;
 }
 EOF
-if { (eval echo configure:11006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:11554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   have_mmap=yes
 else
@@ -11028,9 +11576,9 @@ test "$GNU_MALLOC" != "yes" -a "$have_mmap" != "yes" && rel_alloc=no
 if test "$rel_alloc $have_mmap" = "default yes"; then
   if test "$doug_lea_malloc" = "yes"; then
         echo $ac_n "checking for M_MMAP_THRESHOLD""... $ac_c" 1>&6
-echo "configure:11032: checking for M_MMAP_THRESHOLD" >&5
+echo "configure:11580: checking for M_MMAP_THRESHOLD" >&5
     cat > conftest.$ac_ext <<EOF
-#line 11034 "configure"
+#line 11582 "configure"
 #include "confdefs.h"
 #include <malloc.h>
 int main() {
@@ -11042,7 +11590,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:11046: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:11594: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   rel_alloc=no; echo "$ac_t""yes" 1>&6;
 else
@@ -11067,15 +11615,15 @@ EOF
 
 ac_safe=`echo "termios.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for termios.h""... $ac_c" 1>&6
-echo "configure:11071: checking for termios.h" >&5
+echo "configure:11619: checking for termios.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 11074 "configure"
+#line 11622 "configure"
 #include "confdefs.h"
 #include <termios.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11079: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11627: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -11118,15 +11666,15 @@ else
   echo "$ac_t""no" 1>&6
 ac_safe=`echo "termio.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for termio.h""... $ac_c" 1>&6
-echo "configure:11122: checking for termio.h" >&5
+echo "configure:11670: checking for termio.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 11125 "configure"
+#line 11673 "configure"
 #include "confdefs.h"
 #include <termio.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11130: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11678: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
 
 
 echo $ac_n "checking for socket""... $ac_c" 1>&6
-echo "configure:11162: checking for socket" >&5
+echo "configure:11710: checking for socket" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 11165 "configure"
+#line 11713 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char socket(); below.  */
@@ -11184,7 +11732,7 @@ socket();
 
 ; return 0; }
 EOF
-if { (eval echo configure:11188: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_socket=yes"
 else
@@ -11199,15 +11747,15 @@ if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   ac_safe=`echo "netinet/in.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for netinet/in.h""... $ac_c" 1>&6
-echo "configure:11203: checking for netinet/in.h" >&5
+echo "configure:11751: checking for netinet/in.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 11206 "configure"
+#line 11754 "configure"
 #include "confdefs.h"
 #include <netinet/in.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11211: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11759: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -11224,15 +11772,15 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   ac_safe=`echo "arpa/inet.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for arpa/inet.h""... $ac_c" 1>&6
-echo "configure:11228: checking for arpa/inet.h" >&5
+echo "configure:11776: checking for arpa/inet.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 11231 "configure"
+#line 11779 "configure"
 #include "confdefs.h"
 #include <arpa/inet.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11236: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11784: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -11257,9 +11805,9 @@ EOF
 }
 
       echo $ac_n "checking "for sun_len member in struct sockaddr_un"""... $ac_c" 1>&6
-echo "configure:11261: checking "for sun_len member in struct sockaddr_un"" >&5
+echo "configure:11809: checking "for sun_len member in struct sockaddr_un"" >&5
       cat > conftest.$ac_ext <<EOF
-#line 11263 "configure"
+#line 11811 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -11270,7 +11818,7 @@ int main() {
 static struct sockaddr_un x; x.sun_len = 1;
 ; return 0; }
 EOF
-if { (eval echo configure:11274: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11822: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_SOCKADDR_SUN_LEN
@@ -11288,9 +11836,9 @@ else
 fi
 rm -f conftest*
       echo $ac_n "checking "for ip_mreq struct in netinet/in.h"""... $ac_c" 1>&6
-echo "configure:11292: checking "for ip_mreq struct in netinet/in.h"" >&5
+echo "configure:11840: checking "for ip_mreq struct in netinet/in.h"" >&5
       cat > conftest.$ac_ext <<EOF
-#line 11294 "configure"
+#line 11842 "configure"
 #include "confdefs.h"
 
 #include <sys/types.h>
@@ -11300,7 +11848,7 @@ int main() {
 static struct ip_mreq x;
 ; return 0; }
 EOF
-if { (eval echo configure:11304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11852: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   echo "$ac_t""yes" 1>&6; { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_MULTICAST
 
 
 echo $ac_n "checking for msgget""... $ac_c" 1>&6
-echo "configure:11335: checking for msgget" >&5
+echo "configure:11883: checking for msgget" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 11338 "configure"
+#line 11886 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char msgget(); below.  */
@@ -11357,7 +11905,7 @@ msgget();
 
 ; return 0; }
 EOF
-if { (eval echo configure:11361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:11909: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_msgget=yes"
 else
@@ -11372,15 +11920,15 @@ if eval "test \"`echo '$ac_cv_func_'msgget`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   ac_safe=`echo "sys/ipc.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for sys/ipc.h""... $ac_c" 1>&6
-echo "configure:11376: checking for sys/ipc.h" >&5
+echo "configure:11924: checking for sys/ipc.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 11379 "configure"
+#line 11927 "configure"
 #include "confdefs.h"
 #include <sys/ipc.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11384: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11932: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -11397,15 +11945,15 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   ac_safe=`echo "sys/msg.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for sys/msg.h""... $ac_c" 1>&6
-echo "configure:11401: checking for sys/msg.h" >&5
+echo "configure:11949: checking for sys/msg.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 11404 "configure"
+#line 11952 "configure"
 #include "confdefs.h"
 #include <sys/msg.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11409: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:11957: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
 
 ac_safe=`echo "dirent.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for dirent.h""... $ac_c" 1>&6
-echo "configure:11447: checking for dirent.h" >&5
+echo "configure:11995: checking for dirent.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 11450 "configure"
+#line 11998 "configure"
 #include "confdefs.h"
 #include <dirent.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11455: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12003: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -11478,15 +12026,15 @@ else
   echo "$ac_t""no" 1>&6
 ac_safe=`echo "sys/dir.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for sys/dir.h""... $ac_c" 1>&6
-echo "configure:11482: checking for sys/dir.h" >&5
+echo "configure:12030: checking for sys/dir.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 11485 "configure"
+#line 12033 "configure"
 #include "confdefs.h"
 #include <sys/dir.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11490: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12038: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
 
 ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for nlist.h""... $ac_c" 1>&6
-echo "configure:11523: checking for nlist.h" >&5
+echo "configure:12071: checking for nlist.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 11526 "configure"
+#line 12074 "configure"
 #include "confdefs.h"
 #include <nlist.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11531: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12079: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
 
 
 echo "checking "for sound support"" 1>&6
-echo "configure:11561: checking "for sound support"" >&5
+echo "configure:12109: checking "for sound support"" >&5
 test -z "$with_native_sound" -a -n "$native_sound_lib" && with_native_sound=yes
 
 if test "$with_native_sound" != "no"; then
     if test -n "$native_sound_lib"; then
     ac_safe=`echo "multimedia/audio_device.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for multimedia/audio_device.h""... $ac_c" 1>&6
-echo "configure:11568: checking for multimedia/audio_device.h" >&5
+echo "configure:12116: checking for multimedia/audio_device.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 11571 "configure"
+#line 12119 "configure"
 #include "confdefs.h"
 #include <multimedia/audio_device.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11576: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12124: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
       if test -z "$native_sound_lib"; then
         
 echo $ac_n "checking for ALopenport in -laudio""... $ac_c" 1>&6
-echo "configure:11624: checking for ALopenport in -laudio" >&5
+echo "configure:12172: checking for ALopenport in -laudio" >&5
 ac_lib_var=`echo audio'_'ALopenport | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -laudio "
 cat > conftest.$ac_ext <<EOF
-#line 11629 "configure"
+#line 12177 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -11636,7 +12184,7 @@ int main() {
 ALopenport()
 ; return 0; }
 EOF
-if { (eval echo configure:11640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12188: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
       if test -z "$native_sound_lib"; then
        
 echo $ac_n "checking for AOpenAudio in -lAlib""... $ac_c" 1>&6
-echo "configure:11671: checking for AOpenAudio in -lAlib" >&5
+echo "configure:12219: checking for AOpenAudio in -lAlib" >&5
 ac_lib_var=`echo Alib'_'AOpenAudio | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lAlib "
 cat > conftest.$ac_ext <<EOF
-#line 11676 "configure"
+#line 12224 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -11683,7 +12231,7 @@ int main() {
 AOpenAudio()
 ; return 0; }
 EOF
-if { (eval echo configure:11687: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
     for dir in "machine" "sys" "linux"; do
       ac_safe=`echo "${dir}/soundcard.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for ${dir}/soundcard.h""... $ac_c" 1>&6
-echo "configure:11725: checking for ${dir}/soundcard.h" >&5
+echo "configure:12273: checking for ${dir}/soundcard.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 11728 "configure"
+#line 12276 "configure"
 #include "confdefs.h"
 #include <${dir}/soundcard.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11733: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12281: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
 if test "$with_nas_sound" != "no"; then
   ac_safe=`echo "audio/audiolib.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for audio/audiolib.h""... $ac_c" 1>&6
-echo "configure:11794: checking for audio/audiolib.h" >&5
+echo "configure:12342: checking for audio/audiolib.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 11797 "configure"
+#line 12345 "configure"
 #include "confdefs.h"
 #include <audio/audiolib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:11802: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12350: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -11816,12 +12364,12 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   
     
 echo $ac_n "checking for AuOpenServer in -laudio""... $ac_c" 1>&6
-echo "configure:11820: checking for AuOpenServer in -laudio" >&5
+echo "configure:12368: checking for AuOpenServer in -laudio" >&5
 ac_lib_var=`echo audio'_'AuOpenServer | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -laudio "
 cat > conftest.$ac_ext <<EOF
-#line 11825 "configure"
+#line 12373 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -11832,7 +12380,7 @@ int main() {
 AuOpenServer()
 ; return 0; }
 EOF
-if { (eval echo configure:11836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12384: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -11871,7 +12419,7 @@ EOF
  fi
     libs_x="-laudio $libs_x" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"-laudio\" to \$libs_x"; fi
             cat > conftest.$ac_ext <<EOF
-#line 11875 "configure"
+#line 12423 "configure"
 #include "confdefs.h"
 #include <audio/Xtutil.h>
 EOF
@@ -11902,7 +12450,7 @@ if test "$with_esd_sound" != "no"; then
   # Extract the first word of "esd-config", so it can be a program name with args.
 set dummy esd-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:11906: checking for $ac_word" >&5
+echo "configure:12454: checking for $ac_word" >&5
 
 if test -n "$have_esd_config"; then
   ac_cv_prog_have_esd_config="$have_esd_config" # Let the user override the test.
     c_switch_site="$c_switch_site `esd-config --cflags`" &&  if test "$extra_verbose" = "yes"; then echo "    Appending \"`esd-config --cflags`\" to \$c_switch_site"; fi
     LIBS="`esd-config --libs` $LIBS" &&  if test "$extra_verbose" = "yes"; then echo "    Prepending \"`esd-config --libs`\" to \$LIBS"; fi
     echo $ac_n "checking for esd_play_stream""... $ac_c" 1>&6
-echo "configure:11935: checking for esd_play_stream" >&5
+echo "configure:12483: checking for esd_play_stream" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 11938 "configure"
+#line 12486 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char esd_play_stream(); below.  */
@@ -11957,7 +12505,7 @@ esd_play_stream();
 
 ; return 0; }
 EOF
-if { (eval echo configure:11961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_esd_play_stream=yes"
 else
@@ -12008,7 +12556,7 @@ test -z "$with_tty" && with_tty=yes
 
 if test "$with_tty" = "yes"  ; then
   echo "checking for TTY-related features" 1>&6
-echo "configure:12012: checking for TTY-related features" >&5
+echo "configure:12560: checking for TTY-related features" >&5
   { test "$extra_verbose" = "yes" && cat << \EOF
     Defining HAVE_TTY
 EOF
@@ -12024,12 +12572,12 @@ EOF
     if test -z "$with_ncurses"; then
     
 echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
-echo "configure:12028: checking for tgetent in -lncurses" >&5
+echo "configure:12576: checking for tgetent in -lncurses" >&5
 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lncurses "
 cat > conftest.$ac_ext <<EOF
-#line 12033 "configure"
+#line 12581 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -12040,7 +12588,7 @@ int main() {
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:12044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -12073,15 +12621,15 @@ EOF
 
     ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
-echo "configure:12077: checking for ncurses/curses.h" >&5
+echo "configure:12625: checking for ncurses/curses.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 12080 "configure"
+#line 12628 "configure"
 #include "confdefs.h"
 #include <ncurses/curses.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:12085: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12633: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
 
     ac_safe=`echo "ncurses/term.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for ncurses/term.h""... $ac_c" 1>&6
-echo "configure:12107: checking for ncurses/term.h" >&5
+echo "configure:12655: checking for ncurses/term.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 12110 "configure"
+#line 12658 "configure"
 #include "confdefs.h"
 #include <ncurses/term.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:12115: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12663: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
       c_switch_site="$c_switch_site -I/usr/include/ncurses"
       ac_safe=`echo "ncurses/curses.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for ncurses/curses.h""... $ac_c" 1>&6
-echo "configure:12145: checking for ncurses/curses.h" >&5
+echo "configure:12693: checking for ncurses/curses.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 12148 "configure"
+#line 12696 "configure"
 #include "confdefs.h"
 #include <ncurses/curses.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:12153: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12701: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
        for lib in curses termlib termcap; do
          
 echo $ac_n "checking for tgetent in -l$lib""... $ac_c" 1>&6
-echo "configure:12188: checking for tgetent in -l$lib" >&5
+echo "configure:12736: checking for tgetent in -l$lib" >&5
 ac_lib_var=`echo $lib'_'tgetent | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -l$lib "
 cat > conftest.$ac_ext <<EOF
-#line 12193 "configure"
+#line 12741 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -12200,7 +12748,7 @@ int main() {
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:12204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
       else
        
 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
-echo "configure:12235: checking for tgetent in -lcurses" >&5
+echo "configure:12783: checking for tgetent in -lcurses" >&5
 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lcurses "
 cat > conftest.$ac_ext <<EOF
-#line 12240 "configure"
+#line 12788 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -12247,7 +12795,7 @@ int main() {
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:12251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -12265,12 +12813,12 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes" ; then
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
-echo "configure:12269: checking for tgetent in -ltermcap" >&5
+echo "configure:12817: checking for tgetent in -ltermcap" >&5
 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ltermcap "
 cat > conftest.$ac_ext <<EOF
-#line 12274 "configure"
+#line 12822 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -12281,7 +12829,7 @@ int main() {
 tgetent()
 ; return 0; }
 EOF
-if { (eval echo configure:12285: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -12329,15 +12877,15 @@ EOF
 
     test -z "$with_gpm" && { ac_safe=`echo "gpm.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for gpm.h""... $ac_c" 1>&6
-echo "configure:12333: checking for gpm.h" >&5
+echo "configure:12881: checking for gpm.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 12336 "configure"
+#line 12884 "configure"
 #include "confdefs.h"
 #include <gpm.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:12341: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12889: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
  }
   test -z "$with_gpm" && { 
 echo $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>&6
-echo "configure:12364: checking for Gpm_Open in -lgpm" >&5
+echo "configure:12912: checking for Gpm_Open in -lgpm" >&5
 ac_lib_var=`echo gpm'_'Gpm_Open | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lgpm "
 cat > conftest.$ac_ext <<EOF
-#line 12369 "configure"
+#line 12917 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -12376,7 +12924,7 @@ int main() {
 Gpm_Open()
 ; return 0; }
 EOF
-if { (eval echo configure:12380: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:12928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -12426,20 +12974,20 @@ test "$with_x11" = "yes" -o "$with_tty" = "yes" && extra_objs="$extra_objs event
 
 test "$with_database_gdbm $with_database_dbm $with_database_berkdb" \
   != "no no no" && echo "checking for database support" 1>&6
-echo "configure:12430: checking for database support" >&5
+echo "configure:12978: checking for database support" >&5
 
 if test "$with_database_gdbm $with_database_dbm" != "no no"; then
   ac_safe=`echo "ndbm.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for ndbm.h""... $ac_c" 1>&6
-echo "configure:12435: checking for ndbm.h" >&5
+echo "configure:12983: checking for ndbm.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 12438 "configure"
+#line 12986 "configure"
 #include "confdefs.h"
 #include <ndbm.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:12443: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:12991: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
 if test "$with_database_gdbm" != "no"; then
   
 echo $ac_n "checking for dbm_open in -lgdbm""... $ac_c" 1>&6
-echo "configure:12473: checking for dbm_open in -lgdbm" >&5
+echo "configure:13021: checking for dbm_open in -lgdbm" >&5
 ac_lib_var=`echo gdbm'_'dbm_open | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lgdbm "
 cat > conftest.$ac_ext <<EOF
-#line 12478 "configure"
+#line 13026 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -12485,7 +13033,7 @@ int main() {
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:12489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13037: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
 
 if test "$with_database_dbm" != "no"; then
   echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
-echo "configure:12517: checking for dbm_open" >&5
+echo "configure:13065: checking for dbm_open" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 12520 "configure"
+#line 13068 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char dbm_open(); below.  */
@@ -12539,7 +13087,7 @@ dbm_open();
 
 ; return 0; }
 EOF
-if { (eval echo configure:12543: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_dbm_open=yes"
 else
@@ -12558,12 +13106,12 @@ else
 
     
 echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
-echo "configure:12562: checking for dbm_open in -ldbm" >&5
+echo "configure:13110: checking for dbm_open in -ldbm" >&5
 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ldbm "
 cat > conftest.$ac_ext <<EOF
-#line 12567 "configure"
+#line 13115 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -12574,7 +13122,7 @@ int main() {
 dbm_open()
 ; return 0; }
 EOF
-if { (eval echo configure:12578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13126: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -12615,10 +13163,10 @@ EOF
 
 if test "$with_database_berkdb" != "no"; then
   echo $ac_n "checking for Berkeley db.h""... $ac_c" 1>&6
-echo "configure:12619: checking for Berkeley db.h" >&5
+echo "configure:13167: checking for Berkeley db.h" >&5
   for header in "db/db.h" "db.h"; do
     cat > conftest.$ac_ext <<EOF
-#line 12622 "configure"
+#line 13170 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -12640,7 +13188,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:12644: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:13192: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   db_h_file="$header"; break
 else
@@ -12656,9 +13204,9 @@ rm -f conftest*
 
   if test "$with_database_berkdb" != "no"; then
     echo $ac_n "checking for Berkeley DB version""... $ac_c" 1>&6
-echo "configure:12660: checking for Berkeley DB version" >&5
+echo "configure:13208: checking for Berkeley DB version" >&5
     cat > conftest.$ac_ext <<EOF
-#line 12662 "configure"
+#line 13210 "configure"
 #include "confdefs.h"
 #include <$db_h_file>
 #if DB_VERSION_MAJOR > 1
 rm -f conftest*
 
     echo $ac_n "checking for $dbfunc""... $ac_c" 1>&6
-echo "configure:12681: checking for $dbfunc" >&5
+echo "configure:13229: checking for $dbfunc" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 12684 "configure"
+#line 13232 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $dbfunc(); below.  */
@@ -12703,7 +13251,7 @@ $dbfunc();
 
 ; return 0; }
 EOF
-if { (eval echo configure:12707: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$dbfunc=yes"
 else
@@ -12722,12 +13270,12 @@ else
 
     
 echo $ac_n "checking for $dbfunc in -ldb""... $ac_c" 1>&6
-echo "configure:12726: checking for $dbfunc in -ldb" >&5
+echo "configure:13274: checking for $dbfunc in -ldb" >&5
 ac_lib_var=`echo db'_'$dbfunc | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ldb "
 cat > conftest.$ac_ext <<EOF
-#line 12731 "configure"
+#line 13279 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -12738,7 +13286,7 @@ int main() {
 $dbfunc()
 ; return 0; }
 EOF
-if { (eval echo configure:12742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13290: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
 if test "$with_socks" = "yes"; then
   
 echo $ac_n "checking for SOCKSinit in -lsocks""... $ac_c" 1>&6
-echo "configure:12806: checking for SOCKSinit in -lsocks" >&5
+echo "configure:13354: checking for SOCKSinit in -lsocks" >&5
 ac_lib_var=`echo socks'_'SOCKSinit | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lsocks "
 cat > conftest.$ac_ext <<EOF
-#line 12811 "configure"
+#line 13359 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -12818,7 +13366,7 @@ int main() {
 SOCKSinit()
 ; return 0; }
 EOF
-if { (eval echo configure:12822: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
 
 if test "$with_modules" != "no"; then
   echo "checking for module support" 1>&6
-echo "configure:12877: checking for module support" >&5
+echo "configure:13425: checking for module support" >&5
 
     if test "$with_msw" = "yes"; then
     have_dl=yes;
   else
         ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6
-echo "configure:12884: checking for dlfcn.h" >&5
+echo "configure:13432: checking for dlfcn.h" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 12887 "configure"
+#line 13435 "configure"
 #include "confdefs.h"
 #include <dlfcn.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:12892: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:13440: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -12906,12 +13454,12 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   
       
 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:12910: checking for dlopen in -ldl" >&5
+echo "configure:13458: checking for dlopen in -ldl" >&5
 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ldl "
 cat > conftest.$ac_ext <<EOF
-#line 12915 "configure"
+#line 13463 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -12922,7 +13470,7 @@ int main() {
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:12926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -12941,12 +13489,12 @@ else
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for dlopen in -lc""... $ac_c" 1>&6
-echo "configure:12945: checking for dlopen in -lc" >&5
+echo "configure:13493: checking for dlopen in -lc" >&5
 ac_lib_var=`echo c'_'dlopen | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -lc "
 cat > conftest.$ac_ext <<EOF
-#line 12950 "configure"
+#line 13498 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -12957,7 +13505,7 @@ int main() {
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:12961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -12996,12 +13544,12 @@ EOF
     else
       
 echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
-echo "configure:13000: checking for shl_load in -ldld" >&5
+echo "configure:13548: checking for shl_load in -ldld" >&5
 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ldld "
 cat > conftest.$ac_ext <<EOF
-#line 13005 "configure"
+#line 13553 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -13012,7 +13560,7 @@ int main() {
 shl_load()
 ; return 0; }
 EOF
-if { (eval echo configure:13016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -13039,12 +13587,12 @@ else
   echo "$ac_t""no" 1>&6
 
 echo $ac_n "checking for dld_init in -ldld""... $ac_c" 1>&6
-echo "configure:13043: checking for dld_init in -ldld" >&5
+echo "configure:13591: checking for dld_init in -ldld" >&5
 ac_lib_var=`echo dld'_'dld_init | sed 'y%./+-%__p_%'`
 
 xe_check_libs=" -ldld "
 cat > conftest.$ac_ext <<EOF
-#line 13048 "configure"
+#line 13596 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -13055,7 +13603,7 @@ int main() {
 dld_init()
 ; return 0; }
 EOF
-if { (eval echo configure:13059: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -13100,7 +13648,7 @@ xehost=$canonical
 xealias=$internal_configuration
 
 echo "checking how to build dynamic libraries for ${xehost}" 1>&6
-echo "configure:13104: checking how to build dynamic libraries for ${xehost}" >&5
+echo "configure:13652: checking how to build dynamic libraries for ${xehost}" >&5
 # Transform *-*-linux* to *-*-linux-gnu*, to support old configure scripts.
 case "$xehost" in
 *-*-linux-gnu*) ;;
@@ -13128,9 +13676,9 @@ if test "$GCC" = "yes"; then
   XEGCC=yes
 else
   echo $ac_n "checking checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:13132: checking checking whether we are using GNU C" >&5
+echo "configure:13680: checking checking whether we are using GNU C" >&5
   cat > conftest.$ac_ext <<EOF
-#line 13134 "configure"
+#line 13682 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -13152,7 +13700,7 @@ rm -f conftest*
 fi
 
 echo $ac_n "checking how to produce PIC code""... $ac_c" 1>&6
-echo "configure:13156: checking how to produce PIC code" >&5
+echo "configure:13704: checking how to produce PIC code" >&5
 wl=
 
 can_build_shared=yes
 
 if test -n "$dll_cflags"; then
   echo "$ac_t""${dll_cflags}" 1>&6
-  
+
   # Check to make sure the dll_cflags actually works.
   echo $ac_n "checking if PIC flag ${dll_cflags} really works""... $ac_c" 1>&6
-echo "configure:13252: checking if PIC flag ${dll_cflags} really works" >&5
+echo "configure:13800: checking if PIC flag ${dll_cflags} really works" >&5
   save_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS $dll_cflags -DPIC"
   cat > conftest.$ac_ext <<EOF
-#line 13256 "configure"
+#line 13804 "configure"
 #include "confdefs.h"
 
 int main() {
 int x=0;
 ; return 0; }
 EOF
-if { (eval echo configure:13263: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:13811: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   
     # On HP-UX, the stripped-down bundled CC doesn't accept +Z, but also
@@ -13290,7 +13838,7 @@ cc_produces_so=no
 xldf=
 xcldf=
 echo $ac_n "checking if C compiler can produce shared libraries""... $ac_c" 1>&6
-echo "configure:13294: checking if C compiler can produce shared libraries" >&5
+echo "configure:13842: checking if C compiler can produce shared libraries" >&5
 if test "$XEGCC" = yes; then
   xcldf="-shared"
   xldf="-shared"
@@ -13341,14 +13889,14 @@ if test -n "$xcldf"; then
   xe_libs=
   ac_link='${CC-cc} -o conftest $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' 1>&5'
   cat > conftest.$ac_ext <<EOF
-#line 13345 "configure"
+#line 13893 "configure"
 #include "confdefs.h"
 
 int main() {
 int x=0;
 ; return 0; }
 EOF
-if { (eval echo configure:13352: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:13900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   cc_produces_so=yes
 else
@@ -13373,7 +13921,7 @@ if test -z "$LTLD"; then
   if test "$XEGCC" = yes; then
     # Check if gcc -print-prog-name=ld gives a path.
     echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
-echo "configure:13377: checking for ld used by GCC" >&5
+echo "configure:13925: checking for ld used by GCC" >&5
     ac_prog=`($CC -print-prog-name=ld) 2>&5`
     case "$ac_prog" in
     # Accept absolute paths.
@@ -13398,7 +13946,7 @@ echo "configure:13377: checking for ld used by GCC" >&5
     esac
   else
     echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
-echo "configure:13402: checking for GNU ld" >&5
+echo "configure:13950: checking for GNU ld" >&5
   fi
 
   if test -z "$LTLD"; then
@@ -13436,7 +13984,7 @@ ld_dynamic_link_flags=
 
 # Check to see if it really is or isn't GNU ld.
 echo $ac_n "checking if the linker is GNU ld""... $ac_c" 1>&6
-echo "configure:13440: checking if the linker is GNU ld" >&5
+echo "configure:13988: checking if the linker is GNU ld" >&5
 # I'd rather use --version here, but apparently some GNU ld's only accept -v.
 if $LTLD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
   xe_gnu_ld=yes
@@ -13464,7 +14012,7 @@ else
   # OK - only NOW do we futz about with ld.
   # See if the linker supports building shared libraries.
   echo $ac_n "checking whether the linker supports shared libraries""... $ac_c" 1>&6
-echo "configure:13468: checking whether the linker supports shared libraries" >&5
+echo "configure:14016: checking whether the linker supports shared libraries" >&5
   dll_ld=$CC
   dll_ldflags=$LDFLAGS
   ld_shlibs=yes
@@ -13679,10 +14227,10 @@ EOF
     for ac_func in dlerror _dlerror
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:13683: checking for $ac_func" >&5
+echo "configure:14231: checking for $ac_func" >&5
 
 cat > conftest.$ac_ext <<EOF
-#line 13686 "configure"
+#line 14234 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -13705,7 +14253,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:13709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:14257: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -13744,11 +14292,11 @@ done
 fi
 
 cat > conftest.$ac_ext <<EOF
-#line 13748 "configure"
+#line 14296 "configure"
 #include "confdefs.h"
 int main(int c,char *v[]){return 0;}
 EOF
-if { (eval echo configure:13752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
+if { (eval echo configure:14300: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit $?) 2>&5
 then
   :
 else
@@ -14146,22 +14694,6 @@ cat >> confdefs.h <<EOF
 EOF
 }
 
-{ test "$extra_verbose" = "yes" && cat << EOF
-    Defining config_machfile = "$machfile"
-EOF
-cat >> confdefs.h <<EOF
-#define config_machfile "$machfile"
-EOF
-}
-
-{ test "$extra_verbose" = "yes" && cat << EOF
-    Defining config_opsysfile = "$opsysfile"
-EOF
-cat >> confdefs.h <<EOF
-#define config_opsysfile "$opsysfile"
-EOF
-}
-
 
 
 null_string=""
 if test -n "$runpath"; then
   echo "  Runtime library search path:       $runpath"
 fi
-echo "  Operating system description file: \`$opsysfile'"
-echo "  Machine description file:          \`$machfile'"
+
+if test -n "$opsysfile"
+then echo "  Operating system description file: \`$opsysfile'"
+else echo "  Not using any operating system description file"
+fi
+if test -n "$machfile"
+then echo "  Machine description file:          \`$machfile'"
+else echo "  Not using any machine description file"
+fi
+
 echo "  Compiler:                          $CC $CFLAGS"
 echo "  Relocating allocator for buffers:  $rel_alloc"
 echo "  GNU version of malloc:             ${GNU_MALLOC}${GNU_MALLOC_reason}"
@@ -14977,8 +15517,8 @@ $CPP -I. -I${top_srcdir}/src  junk.c \
   | sed -e 's/^\#.*//'         \
        -e 's/^[        ][      ]*$//'\
        -e 's/^ /       /'              \
-  | sed -n -e '/^..*$/p'       \
-  | sed '/^\"/ {
+       -e '/^[ \f]*$/d' \
+       -e '/^\"/ {
        s/\\\([\"]\)/\1/g
        s/^[    ]*\"//
        s/\"[   ]*$//
@@ -14991,8 +15531,8 @@ $CPP -I. -I${top_srcdir}/src -DUSE_GNU_MAKE junk.c \
   | sed -e 's/^\#.*//'         \
        -e 's/^[        ][      ]*$//'\
        -e 's/^ /       /'              \
-  | sed -n -e '/^..*$/p'       \
-  | sed '/^\"/ {
+       -e '/^[ \f]*$/d' \
+       -e '/^\"/ {
        s/\\\([\"]\)/\1/g
        s/^[    ]*\"//
        s/\"[   ]*$//
index aabd639..dbbcaf6 100644 (file)
@@ -637,7 +637,7 @@ The default is to autodetect all sound support."])
          done
         ;;
 
-        dnl Has the user specified a prefered Athena widget set?
+        dnl Has the user specified a preferred Athena widget set?
         dnl This bit expands any alias names out for us...
         "with_athena" )
          case "$val" in
@@ -1093,7 +1093,6 @@ case "$canonical" in
   clipper-*        ) machine=clipper ;;
   arm*             ) machine=arm ;;
   ns32k-*          ) machine=ns32000 ;;
-  s390-*           ) machine=s390 ;;
 esac
 
 dnl Straightforward OS determination
@@ -1552,13 +1551,28 @@ case "$canonical" in
 
 esac
 
-if test -z "$machine" -o -z "$opsys"; then
-  (echo "$progname: XEmacs hasn't been ported to \`$canonical' systems."
-   echo "$progname: Check \`etc/MACHINES' for recognized configuration names."
-  ) >&2
-  exit 1
+dnl Initialize machine and opsys from $canonical if not in our database above.
+test -z "$machine" && machine=`echo $canonical | sed 's/-.*$//'`
+test -z "$opsys"   && opsys=`echo $canonical | sed 's/^[^-]*-[^-]*-//'`
+
+dnl Use configure-time autodetection if s&m not available
+if test -r "${srcdir}/src/m/${machine}.h"; then
+  machfile="m/${machine}.h"
+  AC_DEFINE_UNQUOTED(config_machfile, "$machfile")
+else
+  echo "XEmacs has no builtin knowledge of \`$machine' machines."
+  echo "Using configure-time autodetection only."
+fi
+
+if test -r "${srcdir}/src/s/${opsys}.h"; then
+  opsysfile="s/${opsys}.h"
+  AC_DEFINE_UNQUOTED(config_opsysfile, "$opsysfile")
+else
+  echo "XEmacs has no builtin knowledge of \`$opsys' operating systems."
+  echo "Using configure-time autodetection only."
 fi
 
+
 if test -z "$dynamic"; then
   case "$opsys" in
     hpux* | sunos4* ) dynamic=no ;;
@@ -1587,9 +1601,6 @@ case "$opsys" in aix*) NON_GNU_CC=xlc ;; esac
 stack_trace_eye_catcher=`echo ${PROGNAME}_${version}_${canonical} | sed 'y/.-/__/'`
 AC_DEFINE_UNQUOTED(STACK_TRACE_EYE_CATCHER, $stack_trace_eye_catcher)
 
-machfile="m/${machine}.h"
-opsysfile="s/${opsys}.h"
-
 dnl --------------------------------------------------
 dnl Determine the compiler, set up for feature testing
 dnl --------------------------------------------------
@@ -1696,6 +1707,8 @@ AC_TRY_RUN([int main () {
 return 11;
 #elif defined __DECC
 return 12;
+#elif defined __USLC__ && defined __SCO_VERSION__
+return 13;
 #else
 return 0;
 #endif
@@ -1703,6 +1716,7 @@ return 0;
 [case "$conftest_rc" in
   11) echo "You appear to be using the SunPro C compiler."; __SUNPRO_C=yes ;;
   12) echo "You appear to be using the DEC C compiler."   ; __DECC=yes ;;
+  13) echo "You appear to be using the SCO C compiler."   ; __USLC__=yes ;;
 esac])
 
 
@@ -1738,7 +1752,8 @@ configure___ [$2]=no
 [#]endif
 ])dnl CPP_boolean_to_sh
 
-cat > $tempcname <<EOF
+cat > $tempcname < confdefs.h
+cat >> $tempcname <<EOF
 #define NOT_C_CODE
 #define C_SWITCH_SITE
 #define C_SWITCH_X_SITE
@@ -1746,8 +1761,14 @@ cat > $tempcname <<EOF
 #define LD_SWITCH_X_SITE
 #define LD_SWITCH_X_SITE_AUX
 #define OS_RELEASE $os_release
+
+#ifdef config_opsysfile
 #include "$srcdir/src/$opsysfile"
+#endif
+
+#ifdef config_machfile
 #include "$srcdir/src/$machfile"
+#endif
 
 CPP_to_sh(LIBS_MACHINE, libs_machine)
 CPP_to_sh(LIBS_SYSTEM,  libs_system)
@@ -1852,10 +1873,26 @@ esac
 dnl Non-ordinary link usually requires -lc
 test "$ordinary_link" = "no" -a -z "$libs_standard" && libs_standard="-lc"
 
+dnl -----------------------
 dnl Compiler-specific hacks
+dnl -----------------------
+
 dnl DEC C `-std1' means ANSI C mode
 test "$__DECC" = "yes" && XE_APPEND(-std1, c_switch_site)
 
+dnl Some versions of SCO native compiler need -Kalloca
+if test "$__USLC__" = yes; then
+  AC_MSG_CHECKING(for whether the -Kalloca compiler flag is needed)
+  need_kalloca=no
+  AC_TRY_LINK([], [void *x = alloca(4);], [:], [
+    xe_save_c_switch_system="$c_switch_system"
+    c_switch_system="$c_switch_system -Kalloca"
+    AC_TRY_LINK([], [void *x = alloca(4);], [ need_kalloca=yes ])
+    c_switch_system="$xe_save_c_switch_system"])
+  AC_MSG_RESULT($need_kalloca)
+  test "$need_kalloca" = "yes" && XE_APPEND(-Kalloca,c_switch_system)
+fi
+
 dnl Calculalate value of CFLAGS:
 dnl Use either command line flag, environment var, or autodetection
 if test "$cflags_specified" = "no"; then
@@ -1896,7 +1933,7 @@ case `uname -s`:`uname -m`:$GCC_VERSION in
                 case "$CFLAGS" in
                     *-fno-schedule-insns*) ;;
                     *)
-                        AC_MSG_RESULT(Yes)
+                        AC_MSG_RESULT(yes)
                         AC_MSG_WARN(Don't use -O2 with gcc 2.8.1 and egcs 1.0 under SPARC architectures)
                         AC_MSG_WARN(without also using -fno-schedule-insns.)
                         AC_MSG_ERROR(Aborting due to known problem)
@@ -1908,7 +1945,7 @@ case `uname -s`:`uname -m`:$GCC_VERSION in
        dnl egcs-2.91.57 (egcs-1.1 release)
        dnl egcs-2.91.66 (egcs-1.1.2 release)
     Linux:alpha:egcs-2.91.*)
-        AC_MSG_RESULT(Yes)
+        AC_MSG_RESULT(yes)
         AC_MSG_WARN(There have been reports of egcs-1.1 not compiling XEmacs correctly on)
         AC_MSG_WARN(Alpha Linux.  There have also been reports that egcs-1.0.3a is O.K.)
         AC_MSG_ERROR(Aborting due to known problem)
@@ -1921,7 +1958,7 @@ case `uname -s`:`uname -m`:$GCC_VERSION in
                        case "$CFLAGS" in
                            *-fno-strength-reduce*) ;;
                            *)
-                                AC_MSG_RESULT(Yes)
+                                AC_MSG_RESULT(yes)
                                AC_MSG_WARN(Don't use -O2 with gcc 2.7.2 under Intel/XXX without also using)
                                AC_MSG_WARN(-fno-strength-reduce.)
                                AC_MSG_ERROR(Aborting due to known problem)
@@ -1934,7 +1971,7 @@ case `uname -s`:`uname -m`:$GCC_VERSION in
         case "$CFLAGS" in
         *-fno-caller-saves*) ;;
         *)
-            AC_MSG_RESULT(Yes)
+            AC_MSG_RESULT(yes)
            AC_MSG_WARN(Don't use -O2 with gcc 2.7.2 under Intel/XXX without also using)
            AC_MSG_WARN(-fno-caller-saves.)
             AC_MSG_ERROR(Aborting due to known problem)
@@ -1942,8 +1979,8 @@ case `uname -s`:`uname -m`:$GCC_VERSION in
         esac
        ;;
 esac
+AC_MSG_RESULT(no)
 fi
-AC_MSG_RESULT(No)
 
 dnl Inform compiler that certain flags are meant for the linker
 dnl XE_PROTECT_LINKER_FLAGS(shell_var)
@@ -2308,11 +2345,9 @@ AC_CHECK_HEADERS(dnl
   mach/mach.h dnl
   sys/param.h dnl
   sys/pstat.h dnl
-  sys/stropts.h dnl
   sys/time.h dnl
   sys/timeb.h dnl
   sys/un.h dnl
-  kstat.h dnl
   ulimit.h dnl
   unistd.h dnl
   utime.h dnl
@@ -2568,7 +2603,9 @@ if test "$with_x11" = "yes"; then
   done
 
   dnl Avoid version mismatch for shared library libXm.so on osf4
-  if test "$GCC" = yes -a -d /usr/shlib; then XE_APPEND(-L/usr/shlib, X_LIBS); fi
+  case "$opsys" in
+  decosf*) if test "$GCC" = yes -a -d /usr/shlib; then XE_APPEND(-L/usr/shlib, X_LIBS); fi ;;
+  esac
 
   ld_switch_x_site="$X_LIBS"
 
@@ -2662,6 +2699,13 @@ dnl Avoid re-AC_DEFINE-ing xmkmf symbols we've already defined above.
   AC_MSG_RESULT(R${x11_release})
   AC_DEFINE_UNQUOTED(THIS_IS_X11R${x11_release})
 
+  if test "${x11_release}" = "4"; then
+    case "$with_widgets" in
+      "" | "no") with_widgets=no ;;
+      *) XE_DIE("Widget support requires X11R5 or greater") ;;
+    esac
+  fi
+
   AC_CHECK_FUNCS(XConvertCase)
 
   AC_CHECK_HEADERS(X11/Xlocale.h)
@@ -2790,6 +2834,14 @@ if test "$with_x11" != "yes"; then
   done
 fi
 
+dnl Balloon Help requires the Shape extension, not available everywhere,
+dnl for example not on AIX 4.3.
+if test "$with_x11" = "yes"; then
+  AC_CHECK_HEADER(X11/extensions/shape.h, [
+   AC_DEFINE(HAVE_BALLOON_HELP)
+   XE_ADD_OBJS(balloon_help.o balloon-x.o)])
+fi
+
 dnl FSF 19.29 has some bitmapdir stuff here.
 bitmapdir=
 
@@ -3502,20 +3554,50 @@ if test "$need_motif" = "yes" ; then
   XE_COMPUTE_RUNPATH()
 fi
 
-AC_CHECK_FUNCS(cbrt closedir dup2 eaccess fmod fpathconf frexp ftime getaddrinfo gethostname getnameinfo getpagesize gettimeofday getcwd getpt getwd logb lrand48 matherr mkdir mktime perror poll random rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask snprintf stpcpy strcasecmp strerror tzset ulimit usleep utimes waitpid vsnprintf fsync ftruncate umask)
+AC_CHECK_FUNCS(cbrt closedir dup2 eaccess fmod fpathconf frexp ftime getaddrinfo gethostname getnameinfo getpagesize gettimeofday getcwd getwd logb lrand48 matherr mkdir mktime perror poll random rename res_init rint rmdir select setitimer setpgid setlocale setsid sigblock sighold sigprocmask snprintf stpcpy strerror tzset ulimit usleep utimes waitpid vsnprintf fsync ftruncate umask)
+
+dnl Check for PTY support functions.
+dnl  getpt is the preferred pty allocation method on glibc systems.
+dnl _getpt is the preferred pty allocation method on SGI systems.
+dnl grantpt, unlockpt, ptsname are defined by Unix98.
+AC_CHECK_FUNCS(getpt _getpt grantpt unlockpt ptsname killpg tcgetpgrp)
+
+dnl openpty is the preferred pty allocation method on BSD and Tru64 systems.
+dnl openpty might be declared in pty.h or in libutil.h.
+AC_CHECK_FUNC(openpty, have_openpty=yes, [
+  AC_CHECK_LIB(util, openpty, have_openpty=yes need_libutil=yes)])
+if test "$have_openpty" = "yes"; then
+  AC_DEFINE(HAVE_OPENPTY)
+  AC_CHECK_HEADERS(pty.h libutil.h)
+  test "$need_libutil" = "yes" && XE_APPEND(-lutil, libs_system)
+fi
+
+dnl Check for STREAM support functions.
+dnl Confusingly, "str" means both "string" and "SysV Streams".
+AC_CHECK_HEADERS(sys/stropts.h)
+if test "$ac_cv_header_sys_stropts_h" = "yes"; then
+  AC_CHECK_FUNCS(isastream)
+  AC_CHECK_HEADERS(sys/strtio.h) dnl TIOCSIGNAL
+fi
 
 dnl Use our own realpath always.
 XE_ADD_OBJS(realpath.o)
 
-dnl Check whether the system provides getloadavg (Solaris 7 has it)
+dnl Check whether the system provides getloadavg().
 AC_CHECK_FUNCS(getloadavg)
 
-if test "$ac_cv_func_getloadavg" != "yes"
-then
+if test "$ac_cv_func_getloadavg" = "yes"; then
+  dnl Solaris 8 declares getloadavg() in <sys/loadavg.h>.
+  dnl glibc 2.2 declares getloadavg() in <stdlib.h>...
+  dnl   ...if we #define _GNU_SOURCE, which we do.
+  AC_CHECK_HEADERS(sys/loadavg.h)
+else
+  dnl We define our own getloadavg() using lower level functions.
   XE_ADD_OBJS(getloadavg.o)
 
   dnl Used by getloadavg() - does not require root priveleges
   AC_CHECK_LIB(kstat, kstat_open)
+  AC_CHECK_HEADERS(kstat.h)
 
   dnl Another way to get the load average
   AC_CHECK_LIB(kvm, kvm_read)
@@ -4426,8 +4508,6 @@ fi
 XE_SPACE(ac_configure_args, $ac_configure_args)
 AC_DEFINE_UNQUOTED(EMACS_CONFIGURATION, "$configuration")
 AC_DEFINE_UNQUOTED(EMACS_CONFIG_OPTIONS, "$ac_configure_args")
-AC_DEFINE_UNQUOTED(config_machfile,  "$machfile")
-AC_DEFINE_UNQUOTED(config_opsysfile, "$opsysfile")
 
 dnl Following are deprecated
 
@@ -4508,8 +4588,16 @@ fi
 if test -n "$runpath"; then
   echo "  Runtime library search path:       $runpath"
 fi
-echo "  Operating system description file: \`$opsysfile'"
-echo "  Machine description file:          \`$machfile'"
+
+if test -n "$opsysfile"
+then echo "  Operating system description file: \`$opsysfile'"
+else echo "  Not using any operating system description file"
+fi
+if test -n "$machfile"
+then echo "  Machine description file:          \`$machfile'"
+else echo "  Not using any machine description file"
+fi
+
 echo "  Compiler:                          $CC $CFLAGS"
 echo "  Relocating allocator for buffers:  $rel_alloc"
 echo "  GNU version of malloc:             ${GNU_MALLOC}${GNU_MALLOC_reason}"
@@ -4734,9 +4822,9 @@ dnl Delete spurious blanks inserted by $CPP
        -e 's/^[ TAB][ TAB]*$//'\
        -e 's/^ /TAB/'          \
 dnl Delete blank lines
-  | sed -n -e '/^..*$/p'       \
+       -e '/^[ \f]*$/d' \
 dnl Restore lines quoted above to original contents.
-  | sed '/^\"/ {
+       -e '/^\"/ {
        s/\\\([\"]\)/\1/g
        s/^[ TAB]*\"//
        s/\"[ TAB]*$//
index a3ec3a3..d7e9f6c 100644 (file)
@@ -252,9 +252,6 @@ Other options:
 --with-debug-malloc     Use the debugging malloc package.
 --with-clash-detection  Use lock files to detect multiple edits of the same
                         file.  The default is to do clash detection.
---lockdir=DIR           The directory to put clash detection files in, such as
-                        `/var/lock/emacs'.
-                        Defaults to `${statedir}/xemacs/lock'.
 
 You may also specify any of the `path' variables found in Makefile.in,
 including --bindir, --libdir, --docdir, --lispdir, --sitelispdir,
index ff4477d..b39f93b 100644 (file)
  *             Note. under this mechanism, any data item that undergoes
  *             relocation and is then further modified during the execution of
  *             the image before dynodump(3x) is called will lose the
- *             modification that occured during the applications execution.
+ *             modification that occurred during the applications execution.
  *
  * N.B. The above commentary is not quite correct in the flags have been hardwired
  *      to RTLD_SAVREL.
  */
-#pragma ident  "@(#) $Id: dynodump.c,v 1.6 1998/03/31 20:10:55 steve Exp $ - SMI"
+#pragma ident  "@(#) $Id: dynodump.c,v 1.6.2.2 2000/09/20 02:39:17 martinb Exp $ - SMI"
 
 #define __EXTENSIONS__ 1
 
@@ -301,7 +301,7 @@ dynodump(const char * file)
      * If we had a .heap section, then its size is part of the program
      * headers notion of data size.  Because we're only going to output one
      * heap section (ignoring the one in the running binary) we need to
-     * subract the size of that which we're ignoring.
+     * subtract the size of that which we're ignoring.
      */
     if (heap_cache) {
        edata = S_ROUND((data_phdr->p_vaddr
index dd2d083..d71e593 100644 (file)
@@ -16,7 +16,7 @@
 tibetan-1-column:241:2:94:4:1:0:56:0:Tibetan 1 column glyph
 tibetan:252:2:94:4:2:0:55:0:Tibetan characters
 lao:167:1:94:3:1:0:49:0:Lao characters (ISO10646 0E80..0EDF)
-indian-1-column:240:2:94:4:1:0:54:0:Indian charset for 2-column width glypps
+indian-1-column:240:2:94:4:1:0:54:0:Indian charset for 2-column width glyphs
 indian-2-column:251:2:94:4:2:0:53:0:Indian charset for 2-column width glyphs
 indian-is13194:225:1:94:3:2:0:53:1:Generic Indian charset for data exchange with IS 13194
 ascii-right-to-left:166:1:94:3:1:1:66:0:ASCII (left half of ISO8859-1) with right-to-left direction
index 65773f1..2dda0f9 100644 (file)
@@ -17,9 +17,6 @@
 ! 
 ! See the NEWS file (C-h n) or XEmacs manual (C-h i) for a description of
 ! the various resources and the syntax for setting them.
-! 
-! Energize users: note that this is not the same app-defaults file that is
-! used with the Energize-specific version of XEmacs.
 
 
 ! Colors and backgrounds.
 ! Note that the menubar resources do not use the `face' syntax, since they
 ! are X toolkit widgets and thus outside the domain of XEmacs proper.
 ! 
+! When X Font Sets are enabled with ./configure --with-xfs (eg, for
+! multilingual menubars and XIM), some .font resources (those specific to
+! the Lucid widget set) are ignored in favor of .fontSet resources.  This
+! example shows how to add fonts for Japanese menubars:
+!
+! *menubar*FontSet:    -*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-*, \
+!                      -*-*-*-*-*-*-*-120-*-jisx0208.1983-0
+!
 *menubar*Font:                         -*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-*
 *popup*Font:                   -*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-*
 
index 39d5e6d..856fc15 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -187,8 +187,8 @@ clipboard can be made; the kill-ring and friends will be updated as
 per X.
 
 The only thing selection doesn't do is set the clipboard automatically
-as this would break the MS-Windows model.  If you want this behaviour
-then set `selection-sets-clipboard' to t
+as this would break the MS-Windows model.  If you want this behavior
+then set `selection-sets-clipboard' to t.
 
 ** Mail spool locking now works correctly.
 XEmacs has always come with a little auxiliary program, movemail,
@@ -252,12 +252,12 @@ menus.
 ** Pixel-based scrolling has been implemented.
 By default this will attempt to scroll in increments equal to the
 height of the default face.  Set `window-pixel-scroll-increment' to
-modify this behaviour.
+modify this behavior.
 
 ** Operation progress can be displayed using graphical widgets.
 See `lprogress-display' for details.  This support has been switched
 on by default for font-lock and some web browsing functions.  If you
-do not like this behaviour set `progress-display-use-echo-area'.
+do not like this behavior set `progress-feedback-use-echo-area'.
 
 ** The PostgreSQL Relational Database Management System is now supported.
 It is now possible to build XEmacs so that the programming interface
@@ -380,7 +380,7 @@ to (concat "~" init-file-user).  This turned out to be too complicated
 for most packages (and some core Lisp files) to use correctly.  Also,
 the `init-file-user' variable has been obsoleted in the process.
 
-The user-visible options like `-u' have not changed their behaviour.
+The user-visible options like `-u' have not changed their behavior.
 
 ** XEmacs finally has an automated test suite!
 Although this is not yet very sophisticated, it is already responsible
@@ -509,7 +509,7 @@ interned in the global obarray.  For example:
     (keywordp (intern ":foo"))       ; The same as (keywordp :foo)
       => t
 
-This behaviour is compatible with other code which treats symbols
+This behavior is compatible with other code which treats symbols
 beginning with colon as keywords only if they are interned in the
 global obarray.  `keywordp' used to wrongly return t in both cases
 above.
index 5ed4498..3c2f4d3 100644 (file)
@@ -801,7 +801,7 @@ as a set of built-in Lisp function in C) by a flexible and
 customizable Common Lisp like one (implemented entirely in Emacs
 Lisp). During reading of Emacs Lisp source files, it is about 40%
 slower than the built-in reader, but there is no difference in
-loading byte compiled files - they dont contain any syntactic sugar
+loading byte compiled files - they don't contain any syntactic sugar
 and are loaded with the built in subroutine `load'.
 
 ** ediff        - Compare and merge files with graphical difference display
index 781d24e..09f213b 100644 (file)
@@ -24,7 +24,7 @@ One typical use for this is with a dialup connection to a machine on
 which an XEmacs process is currently running.
 .PP
 \fIgnudoit\fP is a shell script frontend to ``gnuclient -batch -eval form''.
-Its use is depreciated. Try to get used to calling gnuclient directly.
+Its use is deprecated. Try to get used to calling gnuclient directly.
 .PP
 \fIgnuserv\fP is the server program that is set running by XEmacs to
 handle all incoming and outgoing requests. It is not usually invoked
index 881ad07..3b61e27 100755 (executable)
@@ -109,7 +109,7 @@ esac
 #
 # The largish sed script prefixes all version numbers with a sort key.
 # That key is constructed by padding out any single or double digits to 3
-# digits from the version number, then converting all occurences of `.' to
+# digits from the version number, then converting all occurrences of `.' to
 # `0', and prefixing and suffixing the entire result with an additional
 # zero.  After sorting, the sort key is stripped from the output.
 # We do all this because `sort' cannot numerically sort decimal numbers and
index c912a1c..7e99828 100644 (file)
@@ -1,4 +1,4 @@
-.TH XEMACS 1 "1998 January 13"
+.TH XEMACS 1 "2000-09-20"
 .UC 4
 .SH NAME
 xemacs \- Emacs: The Next Generation
@@ -151,7 +151,7 @@ Load no extra files at startup.  Equivalent to the combination of
 ,
 .B \-no-site-file
 , and
-.B \-no-packages
+.B \-no-early-packages
 \.
 .TP
 .BI \-u " user, " \-user " user"
@@ -197,16 +197,13 @@ Exit
 (useful with
 .BR \-batch ).
 .PP
-.SM Using XEmacs with X
+.SM Using XEmacs with X Windows
 .PP
 .I XEmacs
 has been tailored to work well with the X window system.
 If you run
 .I XEmacs
-from under X windows, it will create its own X window to
-display in.  You will probably want to start the editor
-as a background process
-so that you can continue using your original window.
+from under X windows, it will create its own X window to display in.
 .PP
 .I XEmacs
 can be started with the following standard X options:
@@ -223,9 +220,11 @@ for a 24bit TrueColor visual) See
 for more information.
 .TP
 .B -privateColormap
-Require XEmacs to create and use a private colormap for display.  This will keep
-XEmacs from taking colors from the default colormap and keeping them from other
-clients.
+Require XEmacs to create and use a private colormap for display.  This
+will keep XEmacs from taking colors from the default colormap and
+keeping them from other clients, at the cost of causing annoying
+flicker when the focus changes.  Use this option only if your X server
+does not support 24 bit visuals.
 .TP
 .BI \-geometry " ##x##+##+##"
 Specify the geometry of the initial window.  The ##'s represent a number;
@@ -318,7 +317,7 @@ this option.
 .BI \-xrm " argument"
 This allows you to set an arbitrary resource on the command line.
 .I argument
-should be a resource specification, as might as in your
+should be a resource specification, as might be found in your
 .I \.Xresources
 or
 .I \.Xdefaults
@@ -439,7 +438,7 @@ If set to
 .IR on ,
 the window will be displayed in reverse video.  Consider
 explicitly setting the foreground and background colors instead
-of using this resources.
+of using this resource.
 .TP
 .B borderWidth (\fPclass\fB BorderWidth)
 Sets the window's border width in pixels.
@@ -462,7 +461,7 @@ Sets the default visual
 will try to use (as described above).
 .TP
 .B privateColormap (\fPclass\fB PrivateColormap)
-If set, 
+If set,
 .I XEmacs
 will default to using a private colormap.
 .TP
@@ -511,7 +510,7 @@ means no horizontal scrollbars.
 Sets the position of vertical and horizontal scrollbars.   Should be one
 of the strings "top-left", "bottom-left", "top-right", or "bottom-right".
 The default is "bottom-right" for the Motif and Lucid scrollbars and
-"buttom-left" for the Athena scrollbars.
+"bottom-left" for the Athena scrollbars.
 .TP
 .B topToolBarHeight (\fPclass\fB TopToolBarHeight)
 Sets the height of the top toolbar, in pixels.  0 means no top toolbar.
@@ -642,9 +641,6 @@ is included in a convenient tree structured form.
 
 /usr/local/lib/xemacs-$VERSION/info - the Info files may be here instead.
 
-/usr/local/lib/xemacs-$VERSION/src - C source files and object files.
-(May not be present.)
-
 /usr/local/lib/xemacs-$VERSION/lisp/* - Lisp source files and compiled files
 that define most editing commands.  The files are contained in subdirectories,
 categorized by function or individual package.  Some are preloaded;
@@ -661,19 +657,7 @@ contains the documentation strings for the Lisp primitives and
 preloaded Lisp functions of \fIXEmacs\fP.
 They are stored here to reduce the size of \fIXEmacs\fP proper.
 
-.br
-/usr/local/lib/xemacs-$VERSION/etc/SERVICE - lists people offering
-various services to assist users of \fIXEmacs\fP,
-including education, troubleshooting, porting and customization.
-
-/usr/local/lib/xemacs/lock - holds lock files that are made for all
-files being modified in
-.IR XEmacs ,
-to prevent simultaneous modification of one file by two users.
-
 /usr/local/lib/xemacs/site-lisp - locally-provided Lisp files.
-
-/usr/lib/X11/rgb.txt - list of valid X color names.
 .PP
 .SH BUGS AND HELP
 There is a newsgroup, comp.emacs.xemacs, for reporting
index 97f2f4c..2fc6147 100644 (file)
@@ -41,7 +41,7 @@ support documentation.
 * Menu:
 
 * Introduction::                Introducing Emacs Modules
-* Annatomy of a Module::        Basic module layout and technology
+* Anatomy of a Module::         Basic module layout and technology
 * Using ellcc::                 How to use the module compiler
 * Defining Functions::          Creating new Lisp primitives
 * Defining Variables::          Creating new Lisp variables
@@ -49,12 +49,12 @@ support documentation.
 
  --- The Detailed Node Listing ---
 
-Annatomy of a Module
+Anatomy of a Module
 
 * Required Header File::        Always include <emodules.h>
 * Required Functions::          Functions you must always provide
 * Required Variables::          Variables whose values you must provide
-* Loading other Modules::       How to load dependant modules
+* Loading other Modules::       How to load dependent modules
 
 Using `ellcc'
 
@@ -70,7 +70,7 @@ Defining Functions
 * Declaring Functions::         Declaring functions to the Lisp reader
 
 \1f
-File: emodules.info,  Node: Introduction,  Next: Annatomy of a Module,  Prev: Top,  Up: Top
+File: emodules.info,  Node: Introduction,  Next: Anatomy of a Module,  Prev: Top,  Up: Top
 
 Introduction
 ************
@@ -95,8 +95,8 @@ suited to a wider range of applications, especially those that require
 low level access to a system or need to be as quick as possible.
 
    This manual describes a new way of extending XEmacs, by using dynamic
-loadable modules (also knows as dynamicaly loadable libraries (DLLs),
-dynamic shared objects (DSOs) or just simply shared objectcs), which can
+loadable modules (also known as dynamically loadable libraries (DLLs),
+dynamic shared objects (DSOs) or just simply shared objects), which can
 be written in C or C++ and loaded into XEmacs at any time.  I sometimes
 refer to this technology as "CEmacs", which is short for "C Extensible
 Emacs".
@@ -121,7 +121,7 @@ perspective though, a lot more is provided.
      XEmacs.
 
    *   CEmacs also makes all of the relevant XEmacs internal header
-     files availible for module authors to use.  This is often required
+     files available for module authors to use.  This is often required
      to get data structure definitions and external variable
      declarations.  The header files installed include the module
      specific header file `emodules.h'.  Due to the nature of dynamic
@@ -154,13 +154,13 @@ deal to look at the actual XEmacs source code to see how things are
 done.
 
 \1f
-File: emodules.info,  Node: Annatomy of a Module,  Next: Using ellcc,  Prev: Introduction,  Up: Top
+File: emodules.info,  Node: Anatomy of a Module,  Next: Using ellcc,  Prev: Introduction,  Up: Top
 
-Annatomy of a Module
-********************
+Anatomy of a Module
+*******************
 
-   Each dynamically loadable XEmacs extension (hereafter refered to as a
-module) has a certain compulsory format, and must contain several
+   Each dynamically loadable XEmacs extension (hereafter referred to as
+a module) has a certain compulsory format, and must contain several
 pieces of information and several mandatory functions.  This chapter
 describes the basic layout of a module, and provides a very simple
 sample.  The source for this sample can be found in the file
@@ -171,10 +171,10 @@ sample.  The source for this sample can be found in the file
 * Required Header File::        Always include <emodules.h>
 * Required Functions::          Functions you must always provide
 * Required Variables::          Variables whose values you must provide
-* Loading other Modules::       How to load dependant modules
+* Loading other Modules::       How to load dependent modules
 
 \1f
-File: emodules.info,  Node: Required Header File,  Next: Required Functions,  Prev: Annatomy of a Module,  Up: Annatomy of a Module
+File: emodules.info,  Node: Required Header File,  Next: Required Functions,  Prev: Anatomy of a Module,  Up: Anatomy of a Module
 
 Required Header File
 ====================
@@ -200,7 +200,7 @@ files included are:
      variable declarations.
 
 `sysdep.h'
-     All system dependant declarations and abstraction macros live
+     All system dependent declarations and abstraction macros live
      here.  You should never call low level system functions directly.
      Rather, you should use the abstraction macros provided in this
      header file.
@@ -223,14 +223,14 @@ files included are:
      manipulating XEmacs frames.
 
 \1f
-File: emodules.info,  Node: Required Functions,  Next: Required Variables,  Prev: Required Header File,  Up: Annatomy of a Module
+File: emodules.info,  Node: Required Functions,  Next: Required Variables,  Prev: Required Header File,  Up: Anatomy of a Module
 
 Required Functions
 ==================
 
    Every module requires several initialization functions.  It is the
-responsibility of these functions to load in any dependant modules, and
-to declare all variables and functions which are to be made visibile to
+responsibility of these functions to load in any dependent modules, and
+to declare all variables and functions which are to be made visible to
 the XEmacs Lisp reader.  Each of these functions performs a very
 specific task, and they are executed in the correct order by XEmacs.
 All of these functions are `void' functions which take no arguments.
@@ -268,7 +268,7 @@ place-holder, not an actual function name.
      functions and variables declared in your module.
 
 \1f
-File: emodules.info,  Node: Required Variables,  Next: Loading other Modules,  Prev: Required Functions,  Up: Annatomy of a Module
+File: emodules.info,  Node: Required Variables,  Next: Loading other Modules,  Prev: Required Functions,  Up: Anatomy of a Module
 
 Required Variables
 ==================
@@ -296,7 +296,7 @@ discussed here simply for the sake of completeness.
      This is a short (typically 10 characters or less) name for the
      module, and it is used as a suffix for all of the required
      functions.  This is also the name by which the module is
-     recognised when loading dependant modules.  The name does not
+     recognized when loading dependent modules.  The name does not
      necessarily have to be the same as the physical file name,
      although keeping the two names in sync is a pretty good idea.  The
      name must not be empty, and it must be a valid part of a C
@@ -322,7 +322,7 @@ discussed here simply for the sake of completeness.
      module.  The value is set by the `--mod-title' argument to `ellcc'.
 
 \1f
-File: emodules.info,  Node: Loading other Modules,  Prev: Required Variables,  Up: Annatomy of a Module
+File: emodules.info,  Node: Loading other Modules,  Prev: Required Variables,  Up: Anatomy of a Module
 
 Loading other Modules
 =====================
@@ -331,7 +331,7 @@ Loading other Modules
 function `modules_of_module' to load in any modules which the current
 module depends on.  If the module is stand-alone, and does not depend
 on other modules, then this function can be left empty or even
-undeclared.  However, if it does have dependnacies, it must call
+undeclared.  However, if it does have dependencies, it must call
 `emodules_load':
 
      int emodules_load (const char *module,
@@ -365,7 +365,7 @@ their parents will also fail to load.  This does not include previous
 successful calls to `emodules_load' at the top level.
 
 \1f
-File: emodules.info,  Node: Using ellcc,  Next: Defining Functions,  Prev: Annatomy of a Module,  Up: Top
+File: emodules.info,  Node: Using ellcc,  Next: Defining Functions,  Prev: Anatomy of a Module,  Up: Top
 
 Using `ellcc'
 *************
@@ -462,8 +462,8 @@ trickery in the module loading code.  This is all done using the
    The result of running `ellcc' in initialization mode is a C source
 file which you compile with (you guessed it) `ellcc' in compile mode.
 Initialization mode is where you set the module name, version, title
-and gather together all of the documentaion strings for the functions
-and vairables in your module.  There are several options that you are
+and gather together all of the documentation strings for the functions
+and variables in your module.  There are several options that you are
 required to pass `ellcc' in initialization mode, the first of which is
 the mode switch itself, `--mode=init'.
 
@@ -542,7 +542,7 @@ option.  This directory is treated the same way as the main module
 directory.  Each sub-directory within it is searched for a given module
 when the user attempts to load it.  The valid extensions that the
 loader attempts to use are `.so', `.ell' and `.dll'.  You can use any
-of these extensions, although `.ell' is the prefered extension.
+of these extensions, although `.ell' is the preferred extension.
 
 \1f
 File: emodules.info,  Node: Link Mode,  Next: Other ellcc options,  Prev: Initialization Mode,  Up: Using ellcc
@@ -551,10 +551,10 @@ Link Mode
 =========
 
    Once all of your source code files have been compiled (including the
-generated init file) you need to link them all together to created the
+generated init file) you need to link them all together to create the
 loadable module.  To do this, you invoke `ellcc' in link mode, by
-pasing the `--mode-link' command.  You need to specify the final output
-file using the `--mod-output=NAME' command, but other than that all
+passing the `--mode-link' option.  You need to specify the final output
+file using the `--mod-output=NAME' option, but other than that all
 other arguments are passed on directly to the system compiler or
 linker, along with any other required arguments to create the loadable
 module.
@@ -599,8 +599,8 @@ variables.  Here is the complete list of options that `ellcc' accepts.
      is displayed.
 
 `--mod-name=NAME'
-     Sets the short internaml module NAME to the string specified,
-     which must consist only of valid C identifiers.  Required during
+     Sets the short internal module NAME to the string specified, which
+     must consist only of valid C identifiers.  Required during
      initialization mode.
 
 `--mod-version=VERSION'
@@ -629,8 +629,8 @@ variables.  Here is the complete list of options that `ellcc' accepts.
      exit.
 
 `--mod-archdir'
-     Prints the name of the root of the architecture-dependant
-     directory that XEmacs searches for architecture-dependant files.
+     Prints the name of the root of the architecture-dependent
+     directory that XEmacs searches for architecture-dependent files.
 
 `--mod-config'
      Prints the name of the configuration for which XEmacs and `ellcc'
@@ -647,7 +647,7 @@ flags that were determined at the time XEmacs was configured.  In
 certain rare circumstances you may wish to over-ride the flags passed to
 the compiler or linker, and you can do so using environment variables.
 The table below lists all of the environment variables that `ellcc'
-recognises.
+recognizes.
 
 `ELLCC'
      This is used to over-ride the name of the C compiler that is
@@ -737,7 +737,7 @@ module.  This is done using the `DEFUN' macro.  Here is a small example:
      DEFUN ("my-function", Fmy_function, 1, 1, "FFile name: ", /*
      Sample Emacs primitive function.
      
-     The specified FILE is frobricated before it is fnozzled.
+     The specified FILE is frobnicated before it is fnozzled.
      */
          (file))
      {
@@ -773,7 +773,7 @@ Declaring Functions
 ===================
 
    Simply writing the code for a function is not enough to make it
-availible to the Lisp reader.  You have to, during module
+available to the Lisp reader.  You have to, during module
 initialization, let the Lisp reader know about the new function.  This
 is done by calling `DEFSUBR' with the name of the function.  This is
 the sole purpose of the initialization function `syms_of_module'.
@@ -805,7 +805,7 @@ Defining Variables
 
    Rarely will you write a module that only contains functions.  It is
 common to also provide variables which can be used to control the
-behaviour of the function, or store the results of the function being
+behavior of the function, or store the results of the function being
 executed.  The actual C variable types are the same for modules and
 internal XEmacs primitives, and the declaration of the variables is
 identical.
@@ -823,7 +823,7 @@ internals manual.
    One _very_ important difference between XEmacs variables and module
 variables is how you use pure space.  Simply put, you *never* use pure
 space in XEmacs modules.  The pure space storage is of a limited size,
-and is initialized propperly during the dumping of XEmacs.  Because
+and is initialized properly during the dumping of XEmacs.  Because
 variables are being added dynamically to an already running XEmacs when
 you load a module, you cannot use pure space.  Be warned: *do not use
 pure space in modules.  Repeat, do not use pure space in modules.*
@@ -862,7 +862,7 @@ Index
 
 * Menu:
 
-* annatomy:                              Annatomy of a Module.
+* anatomy:                               Anatomy of a Module.
 * compiler:                              Introduction.
 * compiling:                             Compile Mode.
 * config.h:                              Required Header File.
@@ -874,7 +874,7 @@ Index
 * DEFVAR_BOOL:                           Defining Variables.
 * DEFVAR_INT:                            Defining Variables.
 * DEFVAR_LISP:                           Defining Variables.
-* dependancies:                          Loading other Modules.
+* dependencies:                          Loading other Modules.
 * DLL:                                   Introduction.
 * docs_of_module:                        Required Functions.
 * documentation <1>:                     Initialization Mode.
@@ -893,7 +893,7 @@ Index
 * emodules.h:                            Required Header File.
 * emodules_load:                         Loading other Modules.
 * environment variables:                 Environment Variables.
-* format, module:                        Annatomy of a Module.
+* format, module:                        Anatomy of a Module.
 * functions, declaring:                  Declaring Functions.
 * functions, defining:                   Using DEFUN.
 * functions, Lisp:                       Using DEFUN.
@@ -907,8 +907,8 @@ Index
 * linker:                                Introduction.
 * linking:                               Link Mode.
 * module compiler:                       Using ellcc.
-* module format:                         Annatomy of a Module.
-* module skeleton:                       Annatomy of a Module.
+* module format:                         Anatomy of a Module.
+* module skeleton:                       Anatomy of a Module.
 * modules_of_module <1>:                 Loading other Modules.
 * modules_of_module:                     Required Functions.
 * objects, defining:                     Defining Variables.
@@ -919,7 +919,7 @@ Index
 * required variables:                    Required Variables.
 * samples:                               Introduction.
 * shared object:                         Introduction.
-* skeleton, module:                      Annatomy of a Module.
+* skeleton, module:                      Anatomy of a Module.
 * subrs:                                 Using DEFUN.
 * syms_of_module:                        Required Functions.
 * variables, defining:                   Defining Variables.
@@ -931,22 +931,22 @@ Index
 \1f
 Tag Table:
 Node: Top\7f1536
-Node: Introduction\7f2884
-Node: Annatomy of a Module\7f7393
-Node: Required Header File\7f8209
-Node: Required Functions\7f10130
-Node: Required Variables\7f12379
-Node: Loading other Modules\7f15066
-Node: Using ellcc\7f17124
-Node: Compile Mode\7f18919
-Node: Initialization Mode\7f20287
-Node: Link Mode\7f25319
-Node: Other ellcc options\7f26466
-Node: Environment Variables\7f29046
-Node: Defining Functions\7f30737
-Node: Using DEFUN\7f32748
-Node: Declaring Functions\7f34459
-Node: Defining Variables\7f35802
-Node: Index\7f38047
+Node: Introduction\7f2883
+Node: Anatomy of a Module\7f7391
+Node: Required Header File\7f8205
+Node: Required Functions\7f10124
+Node: Required Variables\7f12371
+Node: Loading other Modules\7f15057
+Node: Using ellcc\7f17114
+Node: Compile Mode\7f18908
+Node: Initialization Mode\7f20276
+Node: Link Mode\7f25310
+Node: Other ellcc options\7f26455
+Node: Environment Variables\7f29034
+Node: Defining Functions\7f30725
+Node: Using DEFUN\7f32736
+Node: Declaring Functions\7f34447
+Node: Defining Variables\7f35790
+Node: Index\7f38033
 \1f
 End Tag Table
index ba26c19..2158835 100644 (file)
@@ -776,7 +776,7 @@ File: info.info,  Node: Emacs Info Variables,  Prev: Checking,  Up: Advanced Inf
 Emacs Info-mode Variables
 =========================
 
-   The following variables may modify the behaviour of Info-mode in
+   The following variables may modify the behavior of Info-mode in
 Emacs; you may wish to set one or several of these variables
 interactively, or in your `~/.emacs' init file.  *Note Examining and
 Setting Variables: (xemacs)Examining.
@@ -835,6 +835,6 @@ Node: Cross-refs\7f29271
 Node: Tags\7f29973
 Node: Checking\7f31275
 Node: Emacs Info Variables\7f32228
-Node: Creating an Info File\7f33218
+Node: Creating an Info File\7f33217
 \1f
 End Tag Table
index e7379aa..4acd152 100644 (file)
@@ -40,13 +40,13 @@ Foundation instead of in the original English.
 \1f
 Indirect:
 internals.info-1: 1776
-internals.info-2: 46628
-internals.info-3: 94463
-internals.info-4: 143504
-internals.info-5: 193454
-internals.info-6: 243017
-internals.info-7: 286634
-internals.info-8: 335501
+internals.info-2: 46627
+internals.info-3: 94462
+internals.info-4: 144159
+internals.info-5: 194051
+internals.info-6: 243653
+internals.info-7: 287720
+internals.info-8: 336587
 \1f
 Tag Table:
 (Indirect)
@@ -61,129 +61,129 @@ Node: XEmacs From the Outside\7f20810
 Node: The Lisp Language\7f22577
 Node: XEmacs From the Perspective of Building\7f32120
 Node: XEmacs From the Inside\7f38245
-Node: The XEmacs Object System (Abstractly Speaking)\7f46628
-Node: How Lisp Objects Are Represented in C\7f60714
-Node: Rules When Writing New C Code\7f65391
-Node: General Coding Rules\7f66195
-Node: Writing Lisp Primitives\7f71915
-Node: Adding Global Lisp Variables\7f83084
-Node: Coding for Mule\7f86722
-Node: Character-Related Data Types\7f87701
-Node: Working With Character and Byte Positions\7f90698
-Node: Conversion to and from External Data\7f94463
-Node: General Guidelines for Writing Mule-Aware Code\7f100604
-Node: An Example of Mule-Aware Code\7f103292
-Node: Techniques for XEmacs Developers\7f105273
-Node: A Summary of the Various XEmacs Modules\7f113220
-Node: Low-Level Modules\7f114040
-Node: Basic Lisp Modules\7f121610
-Node: Modules for Standard Editing Operations\7f128220
-Node: Editor-Level Control Flow Modules\7f134108
-Node: Modules for the Basic Displayable Lisp Objects\7f137554
-Node: Modules for other Display-Related Lisp Objects\7f140076
-Node: Modules for the Redisplay Mechanism\7f141153
-Node: Modules for Interfacing with the File System\7f143504
-Node: Modules for Other Aspects of the Lisp Interpreter and Object System\7f147202
-Node: Modules for Interfacing with the Operating System\7f152655
-Node: Modules for Interfacing with X Windows\7f160316
-Node: Modules for Internationalization\7f163752
-Node: Allocation of Objects in XEmacs Lisp\7f166389
-Node: Introduction to Allocation\7f166910
-Node: Garbage Collection\7f170596
-Node: GCPROing\7f171752
-Node: Garbage Collection - Step by Step\7f178756
-Node: Invocation\7f179148
-Node: garbage_collect_1\7f182162
-Node: mark_object\7f191642
-Node: gc_sweep\7f193454
-Node: sweep_lcrecords_1\7f198517
-Node: compact_string_chars\7f199512
-Node: sweep_strings\7f201692
-Node: sweep_bit_vectors_1\7f202657
-Node: Integers and Characters\7f203333
-Node: Allocation from Frob Blocks\7f204085
-Node: lrecords\7f205689
-Node: Low-level allocation\7f217424
-Node: Cons\7f221531
-Node: Vector\7f222257
-Node: Bit Vector\7f222834
-Node: Symbol\7f223327
-Node: Marker\7f223681
-Node: String\7f224236
-Node: Compiled Function\7f227849
-Node: Dumping\7f228018
-Node: Overview\7f230239
-Node: Data descriptions\7f230809
-Node: Dumping phase\7f232814
-Node: Object inventory\7f233217
-Node: Address allocation\7f236071
-Node: The header\7f237458
-Node: Data dumping\7f237966
-Node: Pointers dumping\7f238627
-Node: Reloading phase\7f239845
-Node: Remaining issues\7f241606
-Node: Events and the Event Loop\7f242567
-Node: Introduction to Events\7f243017
-Node: Main Loop\7f244966
-Node: Specifics of the Event Gathering Mechanism\7f248541
-Node: Specifics About the Emacs Event\7f260994
-Node: The Event Stream Callback Routines\7f261249
-Node: Other Event Loop Functions\7f261494
-Node: Converting Events\7f262634
-Node: Dispatching Events; The Command Builder\7f263243
-Node: Evaluation; Stack Frames; Bindings\7f263478
-Node: Evaluation\7f263820
-Node: Dynamic Binding; The specbinding Stack; Unwind-Protects\7f270375
-Node: Simple Special Forms\7f272759
-Node: Catch and Throw\7f273542
-Node: Symbols and Variables\7f276117
-Node: Introduction to Symbols\7f276381
-Node: Obarrays\7f277449
-Node: Symbol Values\7f280982
-Node: Buffers and Textual Representation\7f283270
-Node: Introduction to Buffers\7f283928
-Node: The Text in a Buffer\7f286634
-Node: Buffer Lists\7f293784
-Node: Markers and Extents\7f295735
-Node: Bufbytes and Emchars\7f298000
-Node: The Buffer Object\7f298215
-Node: MULE Character Sets and Encodings\7f301695
-Node: Character Sets\7f302757
-Node: Encodings\7f306242
-Node: Japanese EUC (Extended Unix Code)\7f307309
-Node: JIS7\7f308141
-Node: Internal Mule Encodings\7f309491
-Node: Internal String Encoding\7f311321
-Node: Internal Character Encoding\7f313466
-Node: CCL\7f315190
-Node: The Lisp Reader and Compiler\7f321943
-Node: Lstreams\7f322156
-Node: Creating an Lstream\7f323187
-Node: Lstream Types\7f324414
-Node: Lstream Functions\7f324666
-Node: Lstream Methods\7f328232
-Node: Consoles; Devices; Frames; Windows\7f331374
-Node: Introduction to Consoles; Devices; Frames; Windows\7f331689
-Node: Point\7f334222
-Node: Window Hierarchy\7f335501
-Node: The Window Object\7f339949
-Node: The Redisplay Mechanism\7f343386
-Node: Critical Redisplay Sections\7f344178
-Node: Line Start Cache\7f345165
-Node: Redisplay Piece by Piece\7f348401
-Node: Extents\7f350438
-Node: Introduction to Extents\7f350972
-Node: Extent Ordering\7f352114
-Node: Format of the Extent Info\7f353355
-Node: Zero-Length Extents\7f355242
-Node: Mathematics of Extent Ordering\7f356640
-Node: Extent Fragments\7f361397
-Node: Faces\7f362483
-Node: Glyphs\7f362599
-Node: Specifiers\7f365616
-Node: Menus\7f365745
-Node: Subprocesses\7f368003
-Node: Interface to X Windows\7f369979
-Node: Index\7f370150
+Node: The XEmacs Object System (Abstractly Speaking)\7f46627
+Node: How Lisp Objects Are Represented in C\7f60713
+Node: Rules When Writing New C Code\7f65390
+Node: General Coding Rules\7f66194
+Node: Writing Lisp Primitives\7f71914
+Node: Adding Global Lisp Variables\7f83083
+Node: Coding for Mule\7f86721
+Node: Character-Related Data Types\7f87700
+Node: Working With Character and Byte Positions\7f90697
+Node: Conversion to and from External Data\7f94462
+Node: General Guidelines for Writing Mule-Aware Code\7f100603
+Node: An Example of Mule-Aware Code\7f103291
+Node: Techniques for XEmacs Developers\7f105272
+Node: A Summary of the Various XEmacs Modules\7f113219
+Node: Low-Level Modules\7f114039
+Node: Basic Lisp Modules\7f121500
+Node: Modules for Standard Editing Operations\7f128094
+Node: Editor-Level Control Flow Modules\7f133982
+Node: Modules for the Basic Displayable Lisp Objects\7f137493
+Node: Modules for other Display-Related Lisp Objects\7f140446
+Node: Modules for the Redisplay Mechanism\7f141787
+Node: Modules for Interfacing with the File System\7f144159
+Node: Modules for Other Aspects of the Lisp Interpreter and Object System\7f147857
+Node: Modules for Interfacing with the Operating System\7f153310
+Node: Modules for Interfacing with X Windows\7f160866
+Node: Modules for Internationalization\7f164349
+Node: Allocation of Objects in XEmacs Lisp\7f166986
+Node: Introduction to Allocation\7f167507
+Node: Garbage Collection\7f171193
+Node: GCPROing\7f172349
+Node: Garbage Collection - Step by Step\7f179353
+Node: Invocation\7f179745
+Node: garbage_collect_1\7f182759
+Node: mark_object\7f192239
+Node: gc_sweep\7f194051
+Node: sweep_lcrecords_1\7f199114
+Node: compact_string_chars\7f200109
+Node: sweep_strings\7f202289
+Node: sweep_bit_vectors_1\7f203254
+Node: Integers and Characters\7f203930
+Node: Allocation from Frob Blocks\7f204682
+Node: lrecords\7f206286
+Node: Low-level allocation\7f218510
+Node: Cons\7f222617
+Node: Vector\7f223343
+Node: Bit Vector\7f223920
+Node: Symbol\7f224413
+Node: Marker\7f224767
+Node: String\7f225322
+Node: Compiled Function\7f228935
+Node: Dumping\7f229104
+Node: Overview\7f231325
+Node: Data descriptions\7f231895
+Node: Dumping phase\7f233900
+Node: Object inventory\7f234303
+Node: Address allocation\7f237157
+Node: The header\7f238544
+Node: Data dumping\7f239052
+Node: Pointers dumping\7f239713
+Node: Reloading phase\7f240931
+Node: Remaining issues\7f242692
+Node: Events and the Event Loop\7f243653
+Node: Introduction to Events\7f244103
+Node: Main Loop\7f246052
+Node: Specifics of the Event Gathering Mechanism\7f249627
+Node: Specifics About the Emacs Event\7f262080
+Node: The Event Stream Callback Routines\7f262335
+Node: Other Event Loop Functions\7f262580
+Node: Converting Events\7f263720
+Node: Dispatching Events; The Command Builder\7f264329
+Node: Evaluation; Stack Frames; Bindings\7f264564
+Node: Evaluation\7f264906
+Node: Dynamic Binding; The specbinding Stack; Unwind-Protects\7f271461
+Node: Simple Special Forms\7f273845
+Node: Catch and Throw\7f274628
+Node: Symbols and Variables\7f277203
+Node: Introduction to Symbols\7f277467
+Node: Obarrays\7f278535
+Node: Symbol Values\7f282068
+Node: Buffers and Textual Representation\7f284356
+Node: Introduction to Buffers\7f285014
+Node: The Text in a Buffer\7f287720
+Node: Buffer Lists\7f294870
+Node: Markers and Extents\7f296821
+Node: Bufbytes and Emchars\7f299086
+Node: The Buffer Object\7f299301
+Node: MULE Character Sets and Encodings\7f302781
+Node: Character Sets\7f303843
+Node: Encodings\7f307328
+Node: Japanese EUC (Extended Unix Code)\7f308395
+Node: JIS7\7f309227
+Node: Internal Mule Encodings\7f310577
+Node: Internal String Encoding\7f312407
+Node: Internal Character Encoding\7f314552
+Node: CCL\7f316276
+Node: The Lisp Reader and Compiler\7f323029
+Node: Lstreams\7f323242
+Node: Creating an Lstream\7f324273
+Node: Lstream Types\7f325500
+Node: Lstream Functions\7f325752
+Node: Lstream Methods\7f329318
+Node: Consoles; Devices; Frames; Windows\7f332460
+Node: Introduction to Consoles; Devices; Frames; Windows\7f332775
+Node: Point\7f335308
+Node: Window Hierarchy\7f336587
+Node: The Window Object\7f341035
+Node: The Redisplay Mechanism\7f344472
+Node: Critical Redisplay Sections\7f345264
+Node: Line Start Cache\7f346251
+Node: Redisplay Piece by Piece\7f349487
+Node: Extents\7f351524
+Node: Introduction to Extents\7f352058
+Node: Extent Ordering\7f353200
+Node: Format of the Extent Info\7f354441
+Node: Zero-Length Extents\7f356328
+Node: Mathematics of Extent Ordering\7f357726
+Node: Extent Fragments\7f362483
+Node: Faces\7f363569
+Node: Glyphs\7f363685
+Node: Specifiers\7f366704
+Node: Menus\7f366833
+Node: Subprocesses\7f369091
+Node: Interface to X Windows\7f371067
+Node: Index\7f371238
 \1f
 End Tag Table
index 51dd8c1..f57d28d 100644 (file)
@@ -1069,7 +1069,7 @@ function by setting its name as the value of the Lisp variable
 
    When the Lisp initialization code is done, the C code enters the
 event loop, and stays there for the duration of the XEmacs process.
-The code for the event loop is contained in `keyboard.c', and is called
+The code for the event loop is contained in `cmdloop.c', and is called
 `Fcommand_loop_1()'.  Note that this event loop could very well be
 written in Lisp, and in fact a Lisp version exists; but apparently,
 doing this makes XEmacs run noticeably slower.
index d679dc0..f7da7ad 100644 (file)
@@ -67,37 +67,37 @@ lispref.info-13: 584130
 lispref.info-14: 632353
 lispref.info-15: 680607
 lispref.info-16: 726799
-lispref.info-17: 775532
-lispref.info-18: 825530
-lispref.info-19: 875221
-lispref.info-20: 924062
-lispref.info-21: 973599
-lispref.info-22: 1021180
-lispref.info-23: 1067504
-lispref.info-24: 1116677
-lispref.info-25: 1165729
-lispref.info-26: 1215204
-lispref.info-27: 1260830
-lispref.info-28: 1310115
-lispref.info-29: 1357965
-lispref.info-30: 1406189
-lispref.info-31: 1455866
-lispref.info-32: 1504191
-lispref.info-33: 1553489
-lispref.info-34: 1594822
-lispref.info-35: 1641127
-lispref.info-36: 1690344
-lispref.info-37: 1727315
-lispref.info-38: 1776245
-lispref.info-39: 1826066
-lispref.info-40: 1872993
-lispref.info-41: 1921090
-lispref.info-42: 1969207
-lispref.info-43: 2017600
-lispref.info-44: 2066304
-lispref.info-45: 2115864
-lispref.info-46: 2158450
-lispref.info-47: 2187663
+lispref.info-17: 775533
+lispref.info-18: 825531
+lispref.info-19: 875222
+lispref.info-20: 924063
+lispref.info-21: 973600
+lispref.info-22: 1021181
+lispref.info-23: 1067505
+lispref.info-24: 1116678
+lispref.info-25: 1165730
+lispref.info-26: 1215205
+lispref.info-27: 1260832
+lispref.info-28: 1310121
+lispref.info-29: 1357971
+lispref.info-30: 1406195
+lispref.info-31: 1455872
+lispref.info-32: 1504421
+lispref.info-33: 1553719
+lispref.info-34: 1595052
+lispref.info-35: 1641357
+lispref.info-36: 1690574
+lispref.info-37: 1727545
+lispref.info-38: 1776475
+lispref.info-39: 1825715
+lispref.info-40: 1874374
+lispref.info-41: 1922471
+lispref.info-42: 1970588
+lispref.info-43: 2018981
+lispref.info-44: 2067685
+lispref.info-45: 2117245
+lispref.info-46: 2159831
+lispref.info-47: 2189044
 \1f
 Tag Table:
 (Indirect)
@@ -390,528 +390,528 @@ Node: Basic Completion\7f718193
 Node: Minibuffer Completion\7f723222
 Node: Completion Commands\7f726799
 Node: High-Level Completion\7f731456
-Node: Reading File Names\7f736198
-Node: Programmed Completion\7f739890
-Node: Yes-or-No Queries\7f742272
-Node: Multiple Queries\7f748009
-Node: Reading a Password\7f752076
-Node: Minibuffer Misc\7f753413
-Node: Command Loop\7f758283
-Node: Command Overview\7f759627
-Node: Defining Commands\7f762905
-Node: Using Interactive\7f763653
-Node: Interactive Codes\7f768426
-Node: Interactive Examples\7f774218
-Node: Interactive Call\7f775532
-Node: Command Loop Info\7f780933
-Node: Events\7f785912
-Node: Event Types\7f787372
-Node: Event Contents\7f789295
-Node: Event Predicates\7f793771
-Node: Accessing Mouse Event Positions\7f795096
-Node: Frame-Level Event Position Info\7f795795
-Node: Window-Level Event Position Info\7f796835
-Node: Event Text Position Info\7f798599
-Node: Event Glyph Position Info\7f801091
-Node: Event Toolbar Position Info\7f802414
-Node: Other Event Position Info\7f803085
-Node: Accessing Other Event Info\7f803494
-Node: Working With Events\7f805114
-Node: Converting Events\7f811102
-Node: Reading Input\7f814054
-Node: Key Sequence Input\7f815056
-Node: Reading One Event\7f817010
-Node: Dispatching an Event\7f819827
-Node: Quoted Character Input\7f820278
-Node: Peeking and Discarding\7f821626
-Node: Waiting\7f825530
-Node: Quitting\7f827838
-Node: Prefix Command Arguments\7f832246
-Node: Recursive Editing\7f837333
-Node: Disabling Commands\7f842129
-Node: Command History\7f844197
-Node: Keyboard Macros\7f845934
-Node: Keymaps\7f848151
-Node: Keymap Terminology\7f849728
-Node: Format of Keymaps\7f852657
-Node: Creating Keymaps\7f853068
-Node: Inheritance and Keymaps\7f855147
-Node: Key Sequences\7f857519
-Node: Prefix Keys\7f862315
-Node: Active Keymaps\7f865900
-Node: Key Lookup\7f875221
-Node: Functions for Key Lookup\7f880384
-Node: Changing Key Bindings\7f886081
-Node: Key Binding Commands\7f892978
-Node: Scanning Keymaps\7f895043
-Node: Other Keymap Functions\7f903554
-Node: Menus\7f904176
-Node: Menu Format\7f904768
-Node: Menubar Format\7f913414
-Node: Menubar\7f914039
-Node: Modifying Menus\7f917152
-Node: Menu Filters\7f922166
-Node: Pop-Up Menus\7f924062
-Node: Menu Accelerators\7f926267
-Node: Creating Menu Accelerators\7f927023
-Node: Keyboard Menu Traversal\7f928383
-Node: Menu Accelerator Functions\7f929110
-Node: Buffers Menu\7f932187
-Node: Dialog Boxes\7f933481
-Node: Dialog Box Format\7f933648
-Node: Dialog Box Functions\7f935073
-Node: Toolbar\7f935470
-Node: Toolbar Intro\7f935905
-Node: Creating Toolbar\7f938305
-Node: Toolbar Descriptor Format\7f939222
-Node: Specifying the Toolbar\7f943719
-Node: Other Toolbar Variables\7f947324
-Node: Gutter\7f951750
-Node: Gutter Intro\7f952339
-Node: Creating Gutter\7f954342
-Node: Gutter Descriptor Format\7f957225
-Node: Specifying a Gutter\7f961682
-Node: Other Gutter Variables\7f965215
-Node: Common Gutter Widgets\7f969600
-Node: Buffer Tabs\7f970592
-Node: Progress Bars\7f970733
-Node: Scrollbars\7f970878
-Node: Drag and Drop\7f971013
-Node: Supported Protocols\7f972089
-Node: OffiX DND\7f972592
-Node: CDE dt\7f973599
-Node: MSWindows OLE\7f974190
-Node: Loose ends\7f974361
-Node: Drop Interface\7f974753
-Node: Drag Interface\7f975775
-Node: Modes\7f975949
-Node: Major Modes\7f976900
-Node: Major Mode Conventions\7f979815
-Node: Example Major Modes\7f985770
-Node: Auto Major Mode\7f993803
-Node: Mode Help\7f1001251
-Node: Derived Modes\7f1002352
-Node: Minor Modes\7f1004543
-Node: Minor Mode Conventions\7f1005845
-Node: Keymaps and Minor Modes\7f1008708
-Node: Modeline Format\7f1009543
-Node: Modeline Data\7f1011311
-Node: Modeline Variables\7f1016464
-Node: %-Constructs\7f1021180
-Node: Hooks\7f1024167
-Node: Documentation\7f1030929
-Node: Documentation Basics\7f1032352
-Node: Accessing Documentation\7f1035402
-Node: Keys in Documentation\7f1041681
-Node: Describing Characters\7f1045160
-Node: Help Functions\7f1047509
-Node: Obsoleteness\7f1053960
-Node: Files\7f1056954
-Node: Visiting Files\7f1058879
-Node: Visiting Functions\7f1060384
-Node: Subroutines of Visiting\7f1065431
-Node: Saving Buffers\7f1067504
-Node: Reading from Files\7f1073597
-Node: Writing to Files\7f1075754
-Node: File Locks\7f1078471
-Node: Information about Files\7f1081524
-Node: Testing Accessibility\7f1082285
-Node: Kinds of Files\7f1086025
-Node: Truenames\7f1087706
-Node: File Attributes\7f1088708
-Node: Changing File Attributes\7f1093847
-Node: File Names\7f1099253
-Node: File Name Components\7f1100862
-Node: Directory Names\7f1103963
-Node: Relative File Names\7f1107416
-Node: File Name Expansion\7f1108494
-Node: Unique File Names\7f1112401
-Node: File Name Completion\7f1114016
-Node: User Name Completion\7f1116677
-Node: Contents of Directories\7f1118017
-Node: Create/Delete Dirs\7f1121330
-Node: Magic File Names\7f1122436
-Node: Partial Files\7f1128066
-Node: Intro to Partial Files\7f1128294
-Node: Creating a Partial File\7f1129534
-Node: Detached Partial Files\7f1130469
-Node: Format Conversion\7f1131591
-Node: Files and MS-DOS\7f1138107
-Node: Backups and Auto-Saving\7f1140171
-Node: Backup Files\7f1140846
-Node: Making Backups\7f1142243
-Node: Rename or Copy\7f1144992
-Node: Numbered Backups\7f1147485
-Node: Backup Names\7f1149720
-Node: Auto-Saving\7f1153012
-Node: Reverting\7f1161154
-Node: Buffers\7f1164312
-Node: Buffer Basics\7f1165729
-Node: Current Buffer\7f1167782
-Node: Buffer Names\7f1172470
-Node: Buffer File Name\7f1175675
-Node: Buffer Modification\7f1179794
-Node: Modification Time\7f1181987
-Node: Read Only Buffers\7f1185362
-Node: The Buffer List\7f1187780
-Node: Creating Buffers\7f1192610
-Node: Killing Buffers\7f1194756
-Node: Indirect Buffers\7f1198487
-Node: Windows\7f1201059
-Node: Basic Windows\7f1202537
-Node: Splitting Windows\7f1205635
-Node: Deleting Windows\7f1212524
-Node: Selecting Windows\7f1215204
-Node: Cyclic Window Ordering\7f1218333
-Node: Buffers and Windows\7f1222957
-Node: Displaying Buffers\7f1224798
-Node: Choosing Window\7f1229974
-Node: Window Point\7f1237690
-Node: Window Start\7f1239736
-Node: Vertical Scrolling\7f1244226
-Node: Horizontal Scrolling\7f1250363
-Node: Size of Window\7f1253872
-Node: Position of Window\7f1258590
-Node: Resizing Windows\7f1260830
-Node: Window Configurations\7f1266259
-Node: Frames\7f1269684
-Node: Creating Frames\7f1272025
-Node: Frame Properties\7f1273366
-Node: Property Access\7f1274182
-Node: Initial Properties\7f1275031
-Node: X Frame Properties\7f1277517
-Node: Size and Position\7f1282151
-Node: Frame Name\7f1284147
-Node: Frame Titles\7f1285061
-Node: Deleting Frames\7f1286885
-Node: Finding All Frames\7f1287485
-Node: Frames and Windows\7f1289479
-Node: Minibuffers and Frames\7f1291184
-Node: Input Focus\7f1292102
-Node: Visibility of Frames\7f1295179
-Node: Raising and Lowering\7f1297098
-Node: Frame Configurations\7f1299474
-Node: Frame Hooks\7f1300068
-Node: Consoles and Devices\7f1301873
-Node: Basic Console Functions\7f1304616
-Node: Basic Device Functions\7f1305039
-Node: Console Types and Device Classes\7f1305755
-Node: Connecting to a Console or Device\7f1307952
-Node: The Selected Console and Device\7f1310115
-Node: Console and Device I/O\7f1311141
-Node: Positions\7f1311905
-Node: Point\7f1312874
-Node: Motion\7f1315964
-Node: Character Motion\7f1316731
-Node: Word Motion\7f1318968
-Node: Buffer End Motion\7f1320469
-Node: Text Lines\7f1321966
-Node: Screen Lines\7f1326561
-Node: List Motion\7f1330624
-Node: Skipping Characters\7f1334032
-Node: Excursions\7f1336251
-Node: Narrowing\7f1339283
-Node: Markers\7f1344608
-Node: Overview of Markers\7f1345514
-Node: Predicates on Markers\7f1350206
-Node: Creating Markers\7f1351452
-Node: Information from Markers\7f1355489
-Node: Changing Markers\7f1356587
-Node: The Mark\7f1357965
-Node: The Region\7f1366459
-Node: Text\7f1372145
-Node: Near Point\7f1374844
-Node: Buffer Contents\7f1379031
-Node: Comparing Text\7f1380437
-Node: Insertion\7f1381845
-Node: Commands for Insertion\7f1385687
-Node: Deletion\7f1388643
-Node: User-Level Deletion\7f1392238
-Node: The Kill Ring\7f1396399
-Node: Kill Ring Concepts\7f1398573
-Node: Kill Functions\7f1399627
-Node: Yank Commands\7f1401532
-Node: Low-Level Kill Ring\7f1403403
-Node: Internals of Kill Ring\7f1406189
-Node: Undo\7f1408969
-Node: Maintaining Undo\7f1413298
-Node: Filling\7f1415918
-Node: Margins\7f1421912
-Node: Auto Filling\7f1425841
-Node: Sorting\7f1427022
-Node: Columns\7f1436322
-Node: Indentation\7f1438838
-Node: Primitive Indent\7f1439617
-Node: Mode-Specific Indent\7f1440861
-Node: Region Indent\7f1443372
-Node: Relative Indent\7f1446320
-Node: Indent Tabs\7f1448702
-Node: Motion by Indent\7f1450023
-Node: Case Changes\7f1450802
-Node: Text Properties\7f1454053
-Node: Examining Properties\7f1455866
-Node: Changing Properties\7f1457733
-Node: Property Search\7f1461324
-Node: Special Properties\7f1466035
-Node: Saving Properties\7f1466316
-Node: Substitution\7f1469458
-Node: Registers\7f1472728
-Node: Transposition\7f1475271
-Node: Change Hooks\7f1476165
-Node: Transformations\7f1478205
-Node: Searching and Matching\7f1482590
-Node: String Search\7f1483721
-Node: Regular Expressions\7f1488445
-Node: Syntax of Regexps\7f1489812
-Node: Regexp Example\7f1504191
-Node: Regexp Search\7f1506361
-Node: POSIX Regexps\7f1512449
-Node: Search and Replace\7f1514284
-Node: Match Data\7f1517649
-Node: Simple Match Data\7f1518779
-Node: Replacing Match\7f1523044
-Node: Entire Match Data\7f1525378
-Node: Saving Match Data\7f1527369
-Node: Searching and Case\7f1528750
-Node: Standard Regexps\7f1530784
-Node: Syntax Tables\7f1532982
-Node: Syntax Basics\7f1534096
-Node: Syntax Descriptors\7f1537068
-Node: Syntax Class Table\7f1538918
-Node: Syntax Flags\7f1544956
-Node: Syntax Table Functions\7f1548173
-Node: Motion and Syntax\7f1552037
-Node: Parsing Expressions\7f1553489
-Node: Standard Syntax Tables\7f1559558
-Node: Syntax Table Internals\7f1560402
-Node: Abbrevs\7f1561428
-Node: Abbrev Mode\7f1563231
-Node: Abbrev Tables\7f1563951
-Node: Defining Abbrevs\7f1565484
-Node: Abbrev Files\7f1567389
-Node: Abbrev Expansion\7f1569162
-Node: Standard Abbrev Tables\7f1573793
-Node: Extents\7f1574952
-Node: Intro to Extents\7f1576195
-Node: Creating and Modifying Extents\7f1580187
-Node: Extent Endpoints\7f1581694
-Node: Finding Extents\7f1584957
-Node: Mapping Over Extents\7f1588705
-Node: Extent Properties\7f1594822
-Node: Detached Extents\7f1604966
-Node: Extent Parents\7f1606825
-Node: Duplicable Extents\7f1608519
-Node: Extents and Events\7f1611740
-Node: Atomic Extents\7f1613647
-Node: Specifiers\7f1614094
-Node: Introduction to Specifiers\7f1616207
-Node: Specifiers In-Depth\7f1618517
-Node: Specifier Instancing\7f1623429
-Node: Specifier Types\7f1626691
-Node: Adding Specifications\7f1631765
-Node: Retrieving Specifications\7f1641127
-Node: Specifier Tag Functions\7f1644862
-Node: Specifier Instancing Functions\7f1648096
-Node: Specifier Example\7f1651503
-Node: Creating Specifiers\7f1654659
-Node: Specifier Validation Functions\7f1658976
-Node: Other Specification Functions\7f1661360
-Node: Faces and Window-System Objects\7f1665179
-Node: Faces\7f1665503
-Node: Merging Faces\7f1667120
-Node: Basic Face Functions\7f1669081
-Node: Face Properties\7f1671179
-Node: Face Convenience Functions\7f1681421
-Node: Other Face Display Functions\7f1684551
-Node: Fonts\7f1685364
-Node: Font Specifiers\7f1686065
-Node: Font Instances\7f1687250
-Node: Font Instance Names\7f1688217
-Node: Font Instance Size\7f1689058
-Node: Font Instance Characteristics\7f1690344
-Node: Font Convenience Functions\7f1691513
-Node: Colors\7f1692803
-Node: Color Specifiers\7f1693243
-Node: Color Instances\7f1695601
-Node: Color Instance Properties\7f1696345
-Node: Color Convenience Functions\7f1696971
-Node: Glyphs\7f1698024
-Node: Glyph Functions\7f1699625
-Node: Creating Glyphs\7f1700032
-Node: Glyph Properties\7f1712672
-Node: Glyph Convenience Functions\7f1721839
-Node: Glyph Dimensions\7f1725786
-Node: Images\7f1726866
-Node: Image Specifiers\7f1727315
-Node: Image Instantiator Conversion\7f1742661
-Node: Image Instances\7f1744026
-Node: Image Instance Types\7f1744777
-Node: Image Instance Functions\7f1747540
-Node: Glyph Types\7f1754591
-Node: Mouse Pointer\7f1756363
-Node: Redisplay Glyphs\7f1759366
-Node: Subwindows\7f1760399
-Node: Annotations\7f1760642
-Node: Annotation Basics\7f1761658
-Node: Annotation Primitives\7f1765596
-Node: Annotation Properties\7f1766925
-Node: Locating Annotations\7f1769965
-Node: Margin Primitives\7f1770802
-Node: Annotation Hooks\7f1772696
-Node: Display\7f1773356
-Node: Refresh Screen\7f1774334
-Node: Truncation\7f1776245
-Node: The Echo Area\7f1778770
-Node: Warnings\7f1785205
-Node: Invisible Text\7f1789641
-Node: Selective Display\7f1792220
-Node: Overlay Arrow\7f1796346
-Node: Temporary Displays\7f1797699
-Node: Blinking\7f1801820
-Node: Usual Display\7f1804005
-Node: Display Tables\7f1806554
-Node: Display Table Format\7f1807358
-Node: Active Display Table\7f1808800
-Node: Character Descriptors\7f1812795
-Node: Beeping\7f1813552
-Node: Hash Tables\7f1818318
-Node: Introduction to Hash Tables\7f1818926
-Node: Working With Hash Tables\7f1824949
-Node: Weak Hash Tables\7f1826066
-Node: Range Tables\7f1827865
-Node: Introduction to Range Tables\7f1828554
-Node: Working With Range Tables\7f1828985
-Node: Databases\7f1829870
-Node: Connecting to a Database\7f1830169
-Node: Working With a Database\7f1831260
-Node: Other Database Functions\7f1832118
-Node: Processes\7f1832692
-Node: Subprocess Creation\7f1834916
-Node: Synchronous Processes\7f1838205
-Node: MS-DOS Subprocesses\7f1844923
-Node: Asynchronous Processes\7f1845997
-Node: Deleting Processes\7f1849710
-Node: Process Information\7f1851581
-Node: Input to Processes\7f1855507
-Node: Signals to Processes\7f1857797
-Node: Output from Processes\7f1862217
-Node: Process Buffers\7f1863029
-Node: Filter Functions\7f1865896
-Node: Accepting Output\7f1871466
-Node: Sentinels\7f1872993
-Node: Process Window Size\7f1876483
-Node: Transaction Queues\7f1876832
-Node: Network\7f1878530
-Node: System Interface\7f1880364
-Node: Starting Up\7f1881634
-Node: Start-up Summary\7f1882228
-Node: Init File\7f1885782
-Node: Terminal-Specific\7f1888163
-Node: Command Line Arguments\7f1891322
-Node: Getting Out\7f1894811
-Node: Killing XEmacs\7f1895380
-Node: Suspending XEmacs\7f1897049
-Node: System Environment\7f1900391
-Node: User Identification\7f1907058
-Node: Time of Day\7f1910587
-Node: Time Conversion\7f1913374
-Node: Timers\7f1918414
-Node: Terminal Input\7f1920587
-Node: Input Modes\7f1921090
-Node: Translating Input\7f1923503
-Node: Recording Input\7f1927668
-Node: Terminal Output\7f1929768
-Node: Flow Control\7f1933391
-Node: Batch Mode\7f1937183
-Node: X-Windows\7f1938565
-Node: X Selections\7f1939436
-Node: X Server\7f1941646
-Node: Resources\7f1942097
-Node: Server Data\7f1947406
-Node: Grabs\7f1948613
-Node: X Miscellaneous\7f1950193
-Node: ToolTalk Support\7f1952578
-Node: XEmacs ToolTalk API Summary\7f1952795
-Node: Sending Messages\7f1954095
-Node: Example of Sending Messages\7f1954346
-Node: Elisp Interface for Sending Messages\7f1955408
-Node: Receiving Messages\7f1961800
-Node: Example of Receiving Messages\7f1962023
-Node: Elisp Interface for Receiving Messages\7f1962859
-Node: LDAP Support\7f1966684
-Node: Building XEmacs with LDAP support\7f1967178
-Node: XEmacs LDAP API\7f1968155
-Node: LDAP Variables\7f1969207
-Node: The High-Level LDAP API\7f1971807
-Node: The Low-Level LDAP API\7f1975270
-Node: The LDAP Lisp Object\7f1976101
-Node: Opening and Closing a LDAP Connection\7f1976654
-Node: Low-level Operations on a LDAP Server\7f1978454
-Node: LDAP Internationalization\7f1981148
-Node: LDAP Internationalization Variables\7f1982053
-Node: Encoder/Decoder Functions\7f1983782
-Node: Syntax of Search Filters\7f1984821
-Node: PostgreSQL Support\7f1986119
-Node: Building XEmacs with PostgreSQL support\7f1986514
-Node: XEmacs PostgreSQL libpq API\7f1987861
-Node: libpq Lisp Variables\7f1989740
-Node: libpq Lisp Symbols and DataTypes\7f1992704
-Node: Synchronous Interface Functions\7f2005944
-Node: Asynchronous Interface Functions\7f2010435
-Node: Large Object Support\7f2013938
-Node: Other libpq Functions\7f2014565
-Node: Unimplemented libpq Functions\7f2017600
-Node: XEmacs PostgreSQL libpq Examples\7f2022919
-Node: Internationalization\7f2029010
-Node: I18N Levels 1 and 2\7f2029353
-Node: I18N Level 3\7f2030059
-Node: Level 3 Basics\7f2030340
-Node: Level 3 Primitives\7f2031173
-Node: Dynamic Messaging\7f2032779
-Node: Domain Specification\7f2033242
-Node: Documentation String Extraction\7f2035145
-Node: I18N Level 4\7f2036063
-Node: MULE\7f2036255
-Node: Internationalization Terminology\7f2037304
-Node: Charsets\7f2049503
-Node: Charset Properties\7f2050199
-Node: Basic Charset Functions\7f2054914
-Node: Charset Property Functions\7f2057095
-Node: Predefined Charsets\7f2059137
-Node: MULE Characters\7f2062057
-Node: Composite Characters\7f2062904
-Node: Coding Systems\7f2064164
-Node: Coding System Types\7f2066304
-Node: ISO 2022\7f2070288
-Node: EOL Conversion\7f2082563
-Node: Coding System Properties\7f2083735
-Node: Basic Coding System Functions\7f2088052
-Node: Coding System Property Functions\7f2090086
-Node: Encoding and Decoding Text\7f2090644
-Node: Detection of Textual Encoding\7f2091780
-Node: Big5 and Shift-JIS Functions\7f2093316
-Node: Predefined Coding Systems\7f2094442
-Node: CCL\7f2106536
-Node: CCL Syntax\7f2109640
-Node: CCL Statements\7f2111216
-Node: CCL Expressions\7f2115864
-Node: Calling CCL\7f2118403
-Node: CCL Examples\7f2121392
-Node: Category Tables\7f2121529
-Node: Tips\7f2123887
-Node: Style Tips\7f2124528
-Node: Compilation Tips\7f2134047
-Node: Documentation Tips\7f2135961
-Node: Comment Tips\7f2141470
-Node: Library Headers\7f2144472
-Node: Building XEmacs and Object Allocation\7f2148444
-Node: Building XEmacs\7f2149327
-Node: Pure Storage\7f2155662
-Node: Garbage Collection\7f2158450
-Node: Standard Errors\7f2169589
-Node: Standard Buffer-Local Variables\7f2173798
-Node: Standard Keymaps\7f2176431
-Node: Standard Hooks\7f2180163
-Node: Index\7f2187663
+Node: Reading File Names\7f736199
+Node: Programmed Completion\7f739891
+Node: Yes-or-No Queries\7f742273
+Node: Multiple Queries\7f748010
+Node: Reading a Password\7f752077
+Node: Minibuffer Misc\7f753414
+Node: Command Loop\7f758284
+Node: Command Overview\7f759628
+Node: Defining Commands\7f762906
+Node: Using Interactive\7f763654
+Node: Interactive Codes\7f768427
+Node: Interactive Examples\7f774219
+Node: Interactive Call\7f775533
+Node: Command Loop Info\7f780934
+Node: Events\7f785913
+Node: Event Types\7f787373
+Node: Event Contents\7f789296
+Node: Event Predicates\7f793772
+Node: Accessing Mouse Event Positions\7f795097
+Node: Frame-Level Event Position Info\7f795796
+Node: Window-Level Event Position Info\7f796836
+Node: Event Text Position Info\7f798600
+Node: Event Glyph Position Info\7f801092
+Node: Event Toolbar Position Info\7f802415
+Node: Other Event Position Info\7f803086
+Node: Accessing Other Event Info\7f803495
+Node: Working With Events\7f805115
+Node: Converting Events\7f811103
+Node: Reading Input\7f814055
+Node: Key Sequence Input\7f815057
+Node: Reading One Event\7f817011
+Node: Dispatching an Event\7f819828
+Node: Quoted Character Input\7f820279
+Node: Peeking and Discarding\7f821627
+Node: Waiting\7f825531
+Node: Quitting\7f827839
+Node: Prefix Command Arguments\7f832247
+Node: Recursive Editing\7f837334
+Node: Disabling Commands\7f842130
+Node: Command History\7f844198
+Node: Keyboard Macros\7f845935
+Node: Keymaps\7f848152
+Node: Keymap Terminology\7f849729
+Node: Format of Keymaps\7f852658
+Node: Creating Keymaps\7f853069
+Node: Inheritance and Keymaps\7f855148
+Node: Key Sequences\7f857520
+Node: Prefix Keys\7f862316
+Node: Active Keymaps\7f865901
+Node: Key Lookup\7f875222
+Node: Functions for Key Lookup\7f880385
+Node: Changing Key Bindings\7f886082
+Node: Key Binding Commands\7f892979
+Node: Scanning Keymaps\7f895044
+Node: Other Keymap Functions\7f903555
+Node: Menus\7f904177
+Node: Menu Format\7f904769
+Node: Menubar Format\7f913415
+Node: Menubar\7f914040
+Node: Modifying Menus\7f917153
+Node: Menu Filters\7f922167
+Node: Pop-Up Menus\7f924063
+Node: Menu Accelerators\7f926268
+Node: Creating Menu Accelerators\7f927024
+Node: Keyboard Menu Traversal\7f928384
+Node: Menu Accelerator Functions\7f929111
+Node: Buffers Menu\7f932188
+Node: Dialog Boxes\7f933482
+Node: Dialog Box Format\7f933649
+Node: Dialog Box Functions\7f935074
+Node: Toolbar\7f935471
+Node: Toolbar Intro\7f935906
+Node: Creating Toolbar\7f938306
+Node: Toolbar Descriptor Format\7f939223
+Node: Specifying the Toolbar\7f943720
+Node: Other Toolbar Variables\7f947325
+Node: Gutter\7f951751
+Node: Gutter Intro\7f952340
+Node: Creating Gutter\7f954343
+Node: Gutter Descriptor Format\7f957226
+Node: Specifying a Gutter\7f961683
+Node: Other Gutter Variables\7f965216
+Node: Common Gutter Widgets\7f969601
+Node: Buffer Tabs\7f970593
+Node: Progress Bars\7f970734
+Node: Scrollbars\7f970879
+Node: Drag and Drop\7f971014
+Node: Supported Protocols\7f972090
+Node: OffiX DND\7f972593
+Node: CDE dt\7f973600
+Node: MSWindows OLE\7f974191
+Node: Loose ends\7f974362
+Node: Drop Interface\7f974754
+Node: Drag Interface\7f975776
+Node: Modes\7f975950
+Node: Major Modes\7f976901
+Node: Major Mode Conventions\7f979816
+Node: Example Major Modes\7f985771
+Node: Auto Major Mode\7f993804
+Node: Mode Help\7f1001252
+Node: Derived Modes\7f1002353
+Node: Minor Modes\7f1004544
+Node: Minor Mode Conventions\7f1005846
+Node: Keymaps and Minor Modes\7f1008709
+Node: Modeline Format\7f1009544
+Node: Modeline Data\7f1011312
+Node: Modeline Variables\7f1016465
+Node: %-Constructs\7f1021181
+Node: Hooks\7f1024168
+Node: Documentation\7f1030930
+Node: Documentation Basics\7f1032353
+Node: Accessing Documentation\7f1035403
+Node: Keys in Documentation\7f1041682
+Node: Describing Characters\7f1045161
+Node: Help Functions\7f1047510
+Node: Obsoleteness\7f1053961
+Node: Files\7f1056955
+Node: Visiting Files\7f1058880
+Node: Visiting Functions\7f1060385
+Node: Subroutines of Visiting\7f1065432
+Node: Saving Buffers\7f1067505
+Node: Reading from Files\7f1073598
+Node: Writing to Files\7f1075755
+Node: File Locks\7f1078472
+Node: Information about Files\7f1081525
+Node: Testing Accessibility\7f1082286
+Node: Kinds of Files\7f1086026
+Node: Truenames\7f1087707
+Node: File Attributes\7f1088709
+Node: Changing File Attributes\7f1093848
+Node: File Names\7f1099254
+Node: File Name Components\7f1100863
+Node: Directory Names\7f1103964
+Node: Relative File Names\7f1107417
+Node: File Name Expansion\7f1108495
+Node: Unique File Names\7f1112402
+Node: File Name Completion\7f1114017
+Node: User Name Completion\7f1116678
+Node: Contents of Directories\7f1118018
+Node: Create/Delete Dirs\7f1121331
+Node: Magic File Names\7f1122437
+Node: Partial Files\7f1128067
+Node: Intro to Partial Files\7f1128295
+Node: Creating a Partial File\7f1129535
+Node: Detached Partial Files\7f1130470
+Node: Format Conversion\7f1131592
+Node: Files and MS-DOS\7f1138108
+Node: Backups and Auto-Saving\7f1140172
+Node: Backup Files\7f1140847
+Node: Making Backups\7f1142244
+Node: Rename or Copy\7f1144993
+Node: Numbered Backups\7f1147486
+Node: Backup Names\7f1149721
+Node: Auto-Saving\7f1153013
+Node: Reverting\7f1161155
+Node: Buffers\7f1164313
+Node: Buffer Basics\7f1165730
+Node: Current Buffer\7f1167783
+Node: Buffer Names\7f1172471
+Node: Buffer File Name\7f1175676
+Node: Buffer Modification\7f1179795
+Node: Modification Time\7f1181988
+Node: Read Only Buffers\7f1185363
+Node: The Buffer List\7f1187781
+Node: Creating Buffers\7f1192611
+Node: Killing Buffers\7f1194757
+Node: Indirect Buffers\7f1198488
+Node: Windows\7f1201060
+Node: Basic Windows\7f1202538
+Node: Splitting Windows\7f1205636
+Node: Deleting Windows\7f1212525
+Node: Selecting Windows\7f1215205
+Node: Cyclic Window Ordering\7f1218334
+Node: Buffers and Windows\7f1222958
+Node: Displaying Buffers\7f1224799
+Node: Choosing Window\7f1229975
+Node: Window Point\7f1237691
+Node: Window Start\7f1239738
+Node: Vertical Scrolling\7f1244228
+Node: Horizontal Scrolling\7f1250365
+Node: Size of Window\7f1253874
+Node: Position of Window\7f1258592
+Node: Resizing Windows\7f1260832
+Node: Window Configurations\7f1266261
+Node: Frames\7f1269686
+Node: Creating Frames\7f1272027
+Node: Frame Properties\7f1273368
+Node: Property Access\7f1274184
+Node: Initial Properties\7f1275033
+Node: X Frame Properties\7f1277519
+Node: Size and Position\7f1282153
+Node: Frame Name\7f1284149
+Node: Frame Titles\7f1285063
+Node: Deleting Frames\7f1286887
+Node: Finding All Frames\7f1287487
+Node: Frames and Windows\7f1289481
+Node: Minibuffers and Frames\7f1291186
+Node: Input Focus\7f1292104
+Node: Visibility of Frames\7f1295181
+Node: Raising and Lowering\7f1297100
+Node: Frame Configurations\7f1299476
+Node: Frame Hooks\7f1300070
+Node: Consoles and Devices\7f1301875
+Node: Basic Console Functions\7f1304618
+Node: Basic Device Functions\7f1305041
+Node: Console Types and Device Classes\7f1305757
+Node: Connecting to a Console or Device\7f1307958
+Node: The Selected Console and Device\7f1310121
+Node: Console and Device I/O\7f1311147
+Node: Positions\7f1311911
+Node: Point\7f1312880
+Node: Motion\7f1315970
+Node: Character Motion\7f1316737
+Node: Word Motion\7f1318974
+Node: Buffer End Motion\7f1320475
+Node: Text Lines\7f1321972
+Node: Screen Lines\7f1326567
+Node: List Motion\7f1330630
+Node: Skipping Characters\7f1334038
+Node: Excursions\7f1336257
+Node: Narrowing\7f1339289
+Node: Markers\7f1344614
+Node: Overview of Markers\7f1345520
+Node: Predicates on Markers\7f1350212
+Node: Creating Markers\7f1351458
+Node: Information from Markers\7f1355495
+Node: Changing Markers\7f1356593
+Node: The Mark\7f1357971
+Node: The Region\7f1366465
+Node: Text\7f1372151
+Node: Near Point\7f1374850
+Node: Buffer Contents\7f1379037
+Node: Comparing Text\7f1380443
+Node: Insertion\7f1381851
+Node: Commands for Insertion\7f1385693
+Node: Deletion\7f1388649
+Node: User-Level Deletion\7f1392244
+Node: The Kill Ring\7f1396405
+Node: Kill Ring Concepts\7f1398579
+Node: Kill Functions\7f1399633
+Node: Yank Commands\7f1401538
+Node: Low-Level Kill Ring\7f1403409
+Node: Internals of Kill Ring\7f1406195
+Node: Undo\7f1408975
+Node: Maintaining Undo\7f1413304
+Node: Filling\7f1415924
+Node: Margins\7f1421918
+Node: Auto Filling\7f1425847
+Node: Sorting\7f1427028
+Node: Columns\7f1436328
+Node: Indentation\7f1438844
+Node: Primitive Indent\7f1439623
+Node: Mode-Specific Indent\7f1440867
+Node: Region Indent\7f1443378
+Node: Relative Indent\7f1446326
+Node: Indent Tabs\7f1448708
+Node: Motion by Indent\7f1450029
+Node: Case Changes\7f1450808
+Node: Text Properties\7f1454059
+Node: Examining Properties\7f1455872
+Node: Changing Properties\7f1457739
+Node: Property Search\7f1461330
+Node: Special Properties\7f1466041
+Node: Saving Properties\7f1466322
+Node: Substitution\7f1469464
+Node: Registers\7f1472734
+Node: Transposition\7f1475277
+Node: Change Hooks\7f1476171
+Node: Transformations\7f1478211
+Node: Searching and Matching\7f1482596
+Node: String Search\7f1483727
+Node: Regular Expressions\7f1488451
+Node: Syntax of Regexps\7f1489818
+Node: Regexp Example\7f1504421
+Node: Regexp Search\7f1506591
+Node: POSIX Regexps\7f1512679
+Node: Search and Replace\7f1514514
+Node: Match Data\7f1517879
+Node: Simple Match Data\7f1519009
+Node: Replacing Match\7f1523274
+Node: Entire Match Data\7f1525608
+Node: Saving Match Data\7f1527599
+Node: Searching and Case\7f1528980
+Node: Standard Regexps\7f1531014
+Node: Syntax Tables\7f1533212
+Node: Syntax Basics\7f1534326
+Node: Syntax Descriptors\7f1537298
+Node: Syntax Class Table\7f1539148
+Node: Syntax Flags\7f1545186
+Node: Syntax Table Functions\7f1548403
+Node: Motion and Syntax\7f1552267
+Node: Parsing Expressions\7f1553719
+Node: Standard Syntax Tables\7f1559788
+Node: Syntax Table Internals\7f1560632
+Node: Abbrevs\7f1561658
+Node: Abbrev Mode\7f1563461
+Node: Abbrev Tables\7f1564181
+Node: Defining Abbrevs\7f1565714
+Node: Abbrev Files\7f1567619
+Node: Abbrev Expansion\7f1569392
+Node: Standard Abbrev Tables\7f1574023
+Node: Extents\7f1575182
+Node: Intro to Extents\7f1576425
+Node: Creating and Modifying Extents\7f1580417
+Node: Extent Endpoints\7f1581924
+Node: Finding Extents\7f1585187
+Node: Mapping Over Extents\7f1588935
+Node: Extent Properties\7f1595052
+Node: Detached Extents\7f1605196
+Node: Extent Parents\7f1607055
+Node: Duplicable Extents\7f1608749
+Node: Extents and Events\7f1611970
+Node: Atomic Extents\7f1613877
+Node: Specifiers\7f1614324
+Node: Introduction to Specifiers\7f1616437
+Node: Specifiers In-Depth\7f1618747
+Node: Specifier Instancing\7f1623659
+Node: Specifier Types\7f1626921
+Node: Adding Specifications\7f1631995
+Node: Retrieving Specifications\7f1641357
+Node: Specifier Tag Functions\7f1645092
+Node: Specifier Instancing Functions\7f1648326
+Node: Specifier Example\7f1651733
+Node: Creating Specifiers\7f1654889
+Node: Specifier Validation Functions\7f1659206
+Node: Other Specification Functions\7f1661590
+Node: Faces and Window-System Objects\7f1665409
+Node: Faces\7f1665733
+Node: Merging Faces\7f1667350
+Node: Basic Face Functions\7f1669311
+Node: Face Properties\7f1671409
+Node: Face Convenience Functions\7f1681651
+Node: Other Face Display Functions\7f1684781
+Node: Fonts\7f1685594
+Node: Font Specifiers\7f1686295
+Node: Font Instances\7f1687480
+Node: Font Instance Names\7f1688447
+Node: Font Instance Size\7f1689288
+Node: Font Instance Characteristics\7f1690574
+Node: Font Convenience Functions\7f1691743
+Node: Colors\7f1693033
+Node: Color Specifiers\7f1693473
+Node: Color Instances\7f1695831
+Node: Color Instance Properties\7f1696575
+Node: Color Convenience Functions\7f1697201
+Node: Glyphs\7f1698254
+Node: Glyph Functions\7f1699855
+Node: Creating Glyphs\7f1700262
+Node: Glyph Properties\7f1712902
+Node: Glyph Convenience Functions\7f1722069
+Node: Glyph Dimensions\7f1726016
+Node: Images\7f1727096
+Node: Image Specifiers\7f1727545
+Node: Image Instantiator Conversion\7f1742891
+Node: Image Instances\7f1744256
+Node: Image Instance Types\7f1745007
+Node: Image Instance Functions\7f1747770
+Node: Glyph Types\7f1754821
+Node: Mouse Pointer\7f1756593
+Node: Redisplay Glyphs\7f1759596
+Node: Subwindows\7f1760629
+Node: Annotations\7f1760872
+Node: Annotation Basics\7f1761888
+Node: Annotation Primitives\7f1765826
+Node: Annotation Properties\7f1767155
+Node: Locating Annotations\7f1770195
+Node: Margin Primitives\7f1771032
+Node: Annotation Hooks\7f1772926
+Node: Display\7f1773586
+Node: Refresh Screen\7f1774564
+Node: Truncation\7f1776475
+Node: The Echo Area\7f1779000
+Node: Warnings\7f1785435
+Node: Invisible Text\7f1789871
+Node: Selective Display\7f1792450
+Node: Overlay Arrow\7f1796576
+Node: Temporary Displays\7f1797929
+Node: Blinking\7f1802050
+Node: Usual Display\7f1804235
+Node: Display Tables\7f1806784
+Node: Display Table Format\7f1807588
+Node: Active Display Table\7f1809030
+Node: Character Descriptors\7f1813025
+Node: Beeping\7f1813782
+Node: Hash Tables\7f1818548
+Node: Introduction to Hash Tables\7f1819156
+Node: Working With Hash Tables\7f1825715
+Node: Weak Hash Tables\7f1826832
+Node: Range Tables\7f1828849
+Node: Introduction to Range Tables\7f1829538
+Node: Working With Range Tables\7f1829969
+Node: Databases\7f1830854
+Node: Connecting to a Database\7f1831153
+Node: Working With a Database\7f1832245
+Node: Other Database Functions\7f1833103
+Node: Processes\7f1833677
+Node: Subprocess Creation\7f1835901
+Node: Synchronous Processes\7f1839190
+Node: MS-DOS Subprocesses\7f1845908
+Node: Asynchronous Processes\7f1846982
+Node: Deleting Processes\7f1850695
+Node: Process Information\7f1852566
+Node: Input to Processes\7f1856492
+Node: Signals to Processes\7f1858782
+Node: Output from Processes\7f1863598
+Node: Process Buffers\7f1864410
+Node: Filter Functions\7f1867277
+Node: Accepting Output\7f1872847
+Node: Sentinels\7f1874374
+Node: Process Window Size\7f1877864
+Node: Transaction Queues\7f1878213
+Node: Network\7f1879911
+Node: System Interface\7f1881745
+Node: Starting Up\7f1883015
+Node: Start-up Summary\7f1883609
+Node: Init File\7f1887163
+Node: Terminal-Specific\7f1889544
+Node: Command Line Arguments\7f1892703
+Node: Getting Out\7f1896192
+Node: Killing XEmacs\7f1896761
+Node: Suspending XEmacs\7f1898430
+Node: System Environment\7f1901772
+Node: User Identification\7f1908439
+Node: Time of Day\7f1911968
+Node: Time Conversion\7f1914755
+Node: Timers\7f1919795
+Node: Terminal Input\7f1921968
+Node: Input Modes\7f1922471
+Node: Translating Input\7f1924884
+Node: Recording Input\7f1929049
+Node: Terminal Output\7f1931149
+Node: Flow Control\7f1934772
+Node: Batch Mode\7f1938564
+Node: X-Windows\7f1939946
+Node: X Selections\7f1940817
+Node: X Server\7f1943027
+Node: Resources\7f1943478
+Node: Server Data\7f1948787
+Node: Grabs\7f1949994
+Node: X Miscellaneous\7f1951574
+Node: ToolTalk Support\7f1953959
+Node: XEmacs ToolTalk API Summary\7f1954176
+Node: Sending Messages\7f1955476
+Node: Example of Sending Messages\7f1955727
+Node: Elisp Interface for Sending Messages\7f1956789
+Node: Receiving Messages\7f1963181
+Node: Example of Receiving Messages\7f1963404
+Node: Elisp Interface for Receiving Messages\7f1964240
+Node: LDAP Support\7f1968065
+Node: Building XEmacs with LDAP support\7f1968559
+Node: XEmacs LDAP API\7f1969536
+Node: LDAP Variables\7f1970588
+Node: The High-Level LDAP API\7f1973188
+Node: The Low-Level LDAP API\7f1976651
+Node: The LDAP Lisp Object\7f1977482
+Node: Opening and Closing a LDAP Connection\7f1978035
+Node: Low-level Operations on a LDAP Server\7f1979835
+Node: LDAP Internationalization\7f1982529
+Node: LDAP Internationalization Variables\7f1983434
+Node: Encoder/Decoder Functions\7f1985163
+Node: Syntax of Search Filters\7f1986202
+Node: PostgreSQL Support\7f1987500
+Node: Building XEmacs with PostgreSQL support\7f1987895
+Node: XEmacs PostgreSQL libpq API\7f1989242
+Node: libpq Lisp Variables\7f1991121
+Node: libpq Lisp Symbols and DataTypes\7f1994085
+Node: Synchronous Interface Functions\7f2007325
+Node: Asynchronous Interface Functions\7f2011816
+Node: Large Object Support\7f2015319
+Node: Other libpq Functions\7f2015946
+Node: Unimplemented libpq Functions\7f2018981
+Node: XEmacs PostgreSQL libpq Examples\7f2024300
+Node: Internationalization\7f2030391
+Node: I18N Levels 1 and 2\7f2030734
+Node: I18N Level 3\7f2031440
+Node: Level 3 Basics\7f2031721
+Node: Level 3 Primitives\7f2032554
+Node: Dynamic Messaging\7f2034160
+Node: Domain Specification\7f2034623
+Node: Documentation String Extraction\7f2036526
+Node: I18N Level 4\7f2037444
+Node: MULE\7f2037636
+Node: Internationalization Terminology\7f2038685
+Node: Charsets\7f2050884
+Node: Charset Properties\7f2051580
+Node: Basic Charset Functions\7f2056295
+Node: Charset Property Functions\7f2058476
+Node: Predefined Charsets\7f2060518
+Node: MULE Characters\7f2063438
+Node: Composite Characters\7f2064285
+Node: Coding Systems\7f2065545
+Node: Coding System Types\7f2067685
+Node: ISO 2022\7f2071669
+Node: EOL Conversion\7f2083944
+Node: Coding System Properties\7f2085116
+Node: Basic Coding System Functions\7f2089433
+Node: Coding System Property Functions\7f2091467
+Node: Encoding and Decoding Text\7f2092025
+Node: Detection of Textual Encoding\7f2093161
+Node: Big5 and Shift-JIS Functions\7f2094697
+Node: Predefined Coding Systems\7f2095823
+Node: CCL\7f2107917
+Node: CCL Syntax\7f2111021
+Node: CCL Statements\7f2112597
+Node: CCL Expressions\7f2117245
+Node: Calling CCL\7f2119784
+Node: CCL Examples\7f2122773
+Node: Category Tables\7f2122910
+Node: Tips\7f2125268
+Node: Style Tips\7f2125909
+Node: Compilation Tips\7f2135428
+Node: Documentation Tips\7f2137342
+Node: Comment Tips\7f2142851
+Node: Library Headers\7f2145853
+Node: Building XEmacs and Object Allocation\7f2149825
+Node: Building XEmacs\7f2150708
+Node: Pure Storage\7f2157043
+Node: Garbage Collection\7f2159831
+Node: Standard Errors\7f2170970
+Node: Standard Buffer-Local Variables\7f2175179
+Node: Standard Keymaps\7f2177812
+Node: Standard Hooks\7f2181544
+Node: Index\7f2189044
 \1f
 End Tag Table
index 38b167d..99ec491 100644 (file)
@@ -9,257 +9,257 @@ END-INFO-DIR-ENTRY
 \1f
 Indirect:
 xemacs-faq.info-1: 205
-xemacs-faq.info-2: 50085
-xemacs-faq.info-3: 99258
-xemacs-faq.info-4: 149252
-xemacs-faq.info-5: 196331
+xemacs-faq.info-2: 50174
+xemacs-faq.info-3: 99767
+xemacs-faq.info-4: 149758
+xemacs-faq.info-5: 199303
 \1f
 Tag Table:
 (Indirect)
 Node: Top\7f205
-Node: Introduction\7f16702
-Node: Q1.0.1\7f20105
-Node: Q1.0.2\7f20641
-Node: Q1.0.3\7f21136
-Node: Q1.0.4\7f21398
-Node: Q1.0.5\7f22848
-Node: Q1.0.6\7f23537
-Node: Q1.0.7\7f24543
-Node: Q1.0.8\7f24792
-Node: Q1.0.9\7f25007
-Node: Q1.0.10\7f25285
-Node: Q1.0.11\7f25528
-Node: Q1.0.12\7f25917
-Node: Q1.0.13\7f26285
-Node: Q1.0.14\7f26534
-Node: Q1.1.1\7f27008
-Node: Q1.1.2\7f28085
-Node: Q1.1.3\7f28478
-Node: Q1.2.1\7f29429
-Node: Q1.2.2\7f30485
-Node: Q1.2.3\7f30919
-Node: Q1.3.1\7f32003
-Node: Q1.3.2\7f35919
-Node: Q1.3.3\7f36474
-Node: Q1.3.4\7f36715
-Node: Q1.3.5\7f37503
-Node: Q1.3.6\7f39918
-Node: Q1.3.7\7f41455
-Node: Q1.4.1\7f42390
-Node: Q1.4.2\7f43252
-Node: Q1.4.3\7f43593
-Node: Q1.4.4\7f44012
-Node: Q1.4.5\7f45552
-Node: Q1.4.6\7f45856
-Node: Installation\7f46849
-Node: Q2.0.1\7f49212
-Node: Q2.0.2\7f50085
-Node: Q2.0.3\7f57537
-Node: Q2.0.4\7f58835
-Node: Q2.0.5\7f59427
-Node: Q2.0.6\7f59795
-Node: Q2.0.7\7f60176
-Node: Q2.0.8\7f60557
-Node: Q2.0.9\7f62134
-Node: Q2.0.10\7f63572
-Node: Q2.0.11\7f64416
-Node: Q2.0.12\7f65357
-Node: Q2.1.1\7f66879
-Node: Q2.1.2\7f69621
-Node: Q2.1.3\7f70798
-Node: Q2.1.4\7f72091
-Node: Q2.1.5\7f72890
-Node: Q2.1.6\7f73252
-Node: Q2.1.7\7f73729
-Node: Q2.1.8\7f74082
-Node: Q2.1.9\7f75616
-Node: Q2.1.10\7f76038
-Node: Q2.1.11\7f76795
-Node: Q2.1.12\7f77660
-Node: Q2.1.13\7f78615
-Node: Q2.1.14\7f79646
-Node: Q2.1.15\7f80757
-Node: Q2.1.16\7f87789
-Node: Q2.1.17\7f88483
-Node: Q2.1.18\7f89080
-Node: Q2.1.19\7f89207
-Node: Q2.1.20\7f89737
-Node: Q2.1.21\7f90119
-Node: Q2.1.22\7f90312
-Node: Q2.1.23\7f91609
-Node: Q2.1.24\7f92277
-Node: Customization\7f92733
-Node: Q3.0.1\7f97571
-Node: Q3.0.2\7f98277
-Node: Q3.0.3\7f98841
-Node: Q3.0.4\7f99258
-Node: Q3.0.5\7f100091
-Node: Q3.0.6\7f100872
-Node: Q3.0.7\7f101452
-Node: Q3.0.8\7f102116
-Node: Q3.0.9\7f103074
-Node: Q3.1.1\7f103635
-Node: Q3.1.2\7f104372
-Node: Q3.1.3\7f104803
-Node: Q3.1.4\7f104992
-Node: Q3.1.5\7f105181
-Node: Q3.1.6\7f105565
-Node: Q3.1.7\7f106274
-Node: Q3.1.8\7f108498
-Node: Q3.2.1\7f109040
-Node: Q3.2.2\7f110693
-Node: Q3.2.3\7f111492
-Node: Q3.2.4\7f112094
-Node: Q3.2.5\7f113128
-Node: Q3.2.6\7f113595
-Node: Q3.3.1\7f114520
-Node: Q3.3.2\7f114950
-Node: Q3.3.3\7f115581
-Node: Q3.3.4\7f115962
-Node: Q3.3.5\7f117063
-Node: Q3.4.1\7f118557
-Node: Q3.4.2\7f119200
-Node: Q3.5.1\7f119712
-Node: Q3.5.2\7f121161
-Node: Q3.5.3\7f121579
-Node: Q3.5.4\7f122417
-Node: Q3.5.5\7f123249
-Node: Q3.5.6\7f124389
-Node: Q3.5.7\7f125379
-Node: Q3.5.8\7f126819
-Node: Q3.5.9\7f127566
-Node: Q3.5.10\7f128346
-Node: Q3.5.11\7f128982
-Node: Q3.6.1\7f129535
-Node: Q3.6.2\7f130280
-Node: Q3.6.3\7f130708
-Node: Q3.7.1\7f131208
-Node: Q3.7.2\7f132096
-Node: Q3.7.3\7f132755
-Node: Q3.7.4\7f133177
-Node: Q3.7.5\7f133520
-Node: Q3.7.6\7f133988
-Node: Q3.7.7\7f134703
-Node: Q3.7.8\7f135723
-Node: Q3.8.1\7f136142
-Node: Q3.8.2\7f136602
-Node: Q3.8.3\7f137065
-Node: Q3.8.4\7f137671
-Node: Q3.8.5\7f138390
-Node: Q3.9.1\7f139175
-Node: Q3.9.2\7f140115
-Node: Q3.9.3\7f140713
-Node: Q3.9.4\7f141375
-Node: Q3.10.1\7f142254
-Node: Q3.10.2\7f143072
-Node: Q3.10.3\7f144077
-Node: Q3.10.4\7f144805
-Node: Q3.10.5\7f145188
-Node: Subsystems\7f146240
-Node: Q4.0.1\7f148727
-Node: Q4.0.2\7f149252
-Node: Q4.0.3\7f149810
-Node: Q4.0.4\7f150131
-Node: Q4.0.5\7f150373
-Node: Q4.0.6\7f150604
-Node: Q4.0.7\7f151192
-Node: Q4.0.8\7f151517
-Node: Q4.0.9\7f152744
-Node: Q4.0.10\7f154782
-Node: Q4.0.11\7f155271
-Node: Q4.0.12\7f156149
-Node: Q4.1.1\7f157122
-Node: Q4.1.2\7f157525
-Node: Q4.1.3\7f157852
-Node: Q4.2.1\7f158161
-Node: Q4.2.2\7f158791
-Node: Q4.2.3\7f159031
-Node: Q4.2.4\7f159575
-Node: Q4.3.1\7f160228
-Node: Q4.3.2\7f160812
-Node: Q4.3.3\7f162293
-Node: Q4.3.4\7f162565
-Node: Q4.3.5\7f163242
-Node: Q4.4.1\7f163870
-Node: Q4.4.2\7f165356
-Node: Q4.5.1\7f166560
-Node: Q4.6.1\7f167329
-Node: Q4.7.1\7f172589
-Node: Q4.7.2\7f173544
-Node: Q4.7.3\7f173841
-Node: Q4.7.4\7f174027
-Node: Q4.7.5\7f174911
-Node: Q4.7.6\7f176552
-Node: Miscellaneous\7f176841
-Node: Q5.0.1\7f180258
-Node: Q5.0.2\7f180997
-Node: Q5.0.3\7f181851
-Node: Q5.0.4\7f182553
-Node: Q5.0.5\7f183492
-Node: Q5.0.6\7f185472
-Node: Q5.0.7\7f186129
-Node: Q5.0.8\7f186734
-Node: Q5.0.9\7f187253
-Node: Q5.0.10\7f187767
-Node: Q5.0.11\7f188015
-Node: Q5.0.12\7f188553
-Node: Q5.0.13\7f189470
-Node: Q5.0.14\7f190154
-Node: Q5.0.15\7f190919
-Node: Q5.0.16\7f191216
-Node: Q5.0.17\7f191728
-Node: Q5.0.18\7f191993
-Node: Q5.0.19\7f192187
-Node: Q5.0.20\7f192611
-Node: Q5.1.1\7f193526
-Node: Q5.1.2\7f195595
-Node: Q5.1.3\7f196331
-Node: Q5.1.4\7f199725
-Node: Q5.1.5\7f200260
-Node: Q5.1.6\7f202384
-Node: Q5.1.7\7f203870
-Node: Q5.1.8\7f205471
-Node: Q5.1.9\7f206023
-Node: Q5.1.10\7f206908
-Node: Q5.1.11\7f208039
-Node: Q5.2.1\7f208588
-Node: Q5.2.2\7f209158
-Node: Q5.2.3\7f209575
-Node: Q5.2.4\7f209810
-Node: Q5.3.1\7f210720
-Node: Q5.3.2\7f211941
-Node: Q5.3.3\7f212717
-Node: Q5.3.4\7f213201
-Node: Q5.3.5\7f213868
-Node: Q5.3.6\7f214737
-Node: Q5.3.7\7f214982
-Node: Q5.3.8\7f217172
-Node: Q5.3.9\7f217419
-Node: Q5.3.10\7f218372
-Node: Q5.3.11\7f220456
-Node: Q5.3.12\7f222047
-Node: MS Windows\7f223321
-Node: Q6.0.1\7f224798
-Node: Q6.0.2\7f225545
-Node: Q6.0.3\7f226010
-Node: Q6.0.4\7f226290
-Node: Q6.1.1\7f228569
-Node: Q6.1.2\7f229440
-Node: Q6.1.3\7f229895
-Node: Q6.1.4\7f230177
-Node: Q6.1.5\7f230555
-Node: Q6.1.6\7f231423
-Node: Q6.2.1\7f233729
-Node: Q6.2.2\7f234630
-Node: Q6.2.3\7f235042
-Node: Q6.3.1\7f235331
-Node: Q6.3.2\7f236425
-Node: Q6.3.3\7f239606
-Node: Q6.4.1\7f239875
-Node: Current Events\7f241210
-Node: Q7.0.1\7f241864
-Node: Q7.0.2\7f242503
-Node: Q7.0.3\7f243576
-Node: Q7.0.4\7f243804
+Node: Introduction\7f16499
+Node: Q1.0.1\7f19941
+Node: Q1.0.2\7f20477
+Node: Q1.0.3\7f21022
+Node: Q1.0.4\7f21284
+Node: Q1.0.5\7f22734
+Node: Q1.0.6\7f23423
+Node: Q1.0.7\7f24429
+Node: Q1.0.8\7f24682
+Node: Q1.0.9\7f24897
+Node: Q1.0.10\7f25175
+Node: Q1.0.11\7f25418
+Node: Q1.0.12\7f25807
+Node: Q1.0.13\7f26175
+Node: Q1.0.14\7f26424
+Node: Q1.1.1\7f26934
+Node: Q1.1.2\7f27976
+Node: Q1.1.3\7f28369
+Node: Q1.2.1\7f29320
+Node: Q1.2.2\7f30376
+Node: Q1.2.3\7f30810
+Node: Q1.3.1\7f31894
+Node: Q1.3.2\7f32545
+Node: Q1.3.3\7f33009
+Node: Q1.3.4\7f33250
+Node: Q1.3.5\7f34023
+Node: Q1.3.6\7f36428
+Node: Q1.3.7\7f37959
+Node: Q1.4.1\7f38894
+Node: Q1.4.2\7f39756
+Node: Q1.4.3\7f40097
+Node: Q1.4.4\7f40516
+Node: Q1.4.5\7f42056
+Node: Q1.4.6\7f42360
+Node: Installation\7f43353
+Node: Q2.0.1\7f45716
+Node: Q2.0.2\7f46516
+Node: Q2.0.3\7f48284
+Node: Q2.0.4\7f49582
+Node: Q2.0.5\7f50174
+Node: Q2.0.6\7f50522
+Node: Q2.0.7\7f50903
+Node: Q2.0.8\7f51284
+Node: Q2.0.9\7f52861
+Node: Q2.0.10\7f54299
+Node: Q2.0.11\7f55143
+Node: Q2.0.12\7f56084
+Node: Q2.1.1\7f57606
+Node: Q2.1.2\7f60348
+Node: Q2.1.3\7f61525
+Node: Q2.1.4\7f62818
+Node: Q2.1.5\7f63617
+Node: Q2.1.6\7f63979
+Node: Q2.1.7\7f64456
+Node: Q2.1.8\7f64809
+Node: Q2.1.9\7f66343
+Node: Q2.1.10\7f66765
+Node: Q2.1.11\7f67522
+Node: Q2.1.12\7f68387
+Node: Q2.1.13\7f69342
+Node: Q2.1.14\7f70373
+Node: Q2.1.15\7f71484
+Node: Q2.1.16\7f78516
+Node: Q2.1.17\7f79210
+Node: Q2.1.18\7f79807
+Node: Q2.1.19\7f79934
+Node: Q2.1.20\7f80464
+Node: Q2.1.21\7f80846
+Node: Q2.1.22\7f81039
+Node: Q2.1.23\7f82336
+Node: Q2.1.24\7f83004
+Node: Customization\7f83460
+Node: Q3.0.1\7f88298
+Node: Q3.0.2\7f89004
+Node: Q3.0.3\7f89568
+Node: Q3.0.4\7f89985
+Node: Q3.0.5\7f90818
+Node: Q3.0.6\7f91599
+Node: Q3.0.7\7f92179
+Node: Q3.0.8\7f92843
+Node: Q3.0.9\7f93801
+Node: Q3.1.1\7f94362
+Node: Q3.1.2\7f95099
+Node: Q3.1.3\7f95530
+Node: Q3.1.4\7f95719
+Node: Q3.1.5\7f95908
+Node: Q3.1.6\7f96292
+Node: Q3.1.7\7f97001
+Node: Q3.1.8\7f99225
+Node: Q3.2.1\7f99767
+Node: Q3.2.2\7f101420
+Node: Q3.2.3\7f102219
+Node: Q3.2.4\7f102821
+Node: Q3.2.5\7f103855
+Node: Q3.2.6\7f104322
+Node: Q3.3.1\7f105247
+Node: Q3.3.2\7f105677
+Node: Q3.3.3\7f106308
+Node: Q3.3.4\7f106689
+Node: Q3.3.5\7f107790
+Node: Q3.4.1\7f109284
+Node: Q3.4.2\7f109927
+Node: Q3.5.1\7f110439
+Node: Q3.5.2\7f111888
+Node: Q3.5.3\7f112306
+Node: Q3.5.4\7f113144
+Node: Q3.5.5\7f113976
+Node: Q3.5.6\7f115116
+Node: Q3.5.7\7f116106
+Node: Q3.5.8\7f117546
+Node: Q3.5.9\7f118293
+Node: Q3.5.10\7f119073
+Node: Q3.5.11\7f119709
+Node: Q3.6.1\7f120262
+Node: Q3.6.2\7f121007
+Node: Q3.6.3\7f121435
+Node: Q3.7.1\7f121935
+Node: Q3.7.2\7f122823
+Node: Q3.7.3\7f123482
+Node: Q3.7.4\7f123904
+Node: Q3.7.5\7f124247
+Node: Q3.7.6\7f124715
+Node: Q3.7.7\7f125430
+Node: Q3.7.8\7f126450
+Node: Q3.8.1\7f126869
+Node: Q3.8.2\7f127329
+Node: Q3.8.3\7f127792
+Node: Q3.8.4\7f128398
+Node: Q3.8.5\7f129117
+Node: Q3.9.1\7f129902
+Node: Q3.9.2\7f130842
+Node: Q3.9.3\7f131440
+Node: Q3.9.4\7f132102
+Node: Q3.10.1\7f132981
+Node: Q3.10.2\7f133799
+Node: Q3.10.3\7f134804
+Node: Q3.10.4\7f135532
+Node: Q3.10.5\7f135915
+Node: Subsystems\7f136967
+Node: Q4.0.1\7f139454
+Node: Q4.0.2\7f139979
+Node: Q4.0.3\7f140537
+Node: Q4.0.4\7f140858
+Node: Q4.0.5\7f141100
+Node: Q4.0.6\7f141331
+Node: Q4.0.7\7f141919
+Node: Q4.0.8\7f142244
+Node: Q4.0.9\7f143471
+Node: Q4.0.10\7f145509
+Node: Q4.0.11\7f145998
+Node: Q4.0.12\7f146876
+Node: Q4.1.1\7f147849
+Node: Q4.1.2\7f148252
+Node: Q4.1.3\7f148579
+Node: Q4.2.1\7f148888
+Node: Q4.2.2\7f149518
+Node: Q4.2.3\7f149758
+Node: Q4.2.4\7f150302
+Node: Q4.3.1\7f150955
+Node: Q4.3.2\7f151539
+Node: Q4.3.3\7f153020
+Node: Q4.3.4\7f153292
+Node: Q4.3.5\7f153969
+Node: Q4.4.1\7f154597
+Node: Q4.4.2\7f156083
+Node: Q4.5.1\7f157287
+Node: Q4.6.1\7f158056
+Node: Q4.7.1\7f163316
+Node: Q4.7.2\7f164271
+Node: Q4.7.3\7f164568
+Node: Q4.7.4\7f164754
+Node: Q4.7.5\7f165638
+Node: Q4.7.6\7f167279
+Node: Miscellaneous\7f167568
+Node: Q5.0.1\7f170981
+Node: Q5.0.2\7f171720
+Node: Q5.0.3\7f172574
+Node: Q5.0.4\7f173276
+Node: Q5.0.5\7f174215
+Node: Q5.0.6\7f176195
+Node: Q5.0.7\7f176852
+Node: Q5.0.8\7f177457
+Node: Q5.0.9\7f177976
+Node: Q5.0.10\7f178490
+Node: Q5.0.11\7f178738
+Node: Q5.0.12\7f179276
+Node: Q5.0.13\7f180193
+Node: Q5.0.14\7f180877
+Node: Q5.0.15\7f181642
+Node: Q5.0.16\7f181939
+Node: Q5.0.17\7f182451
+Node: Q5.0.18\7f182716
+Node: Q5.0.19\7f182910
+Node: Q5.0.20\7f183334
+Node: Q5.1.1\7f184249
+Node: Q5.1.2\7f186318
+Node: Q5.1.3\7f187054
+Node: Q5.1.4\7f190448
+Node: Q5.1.5\7f190983
+Node: Q5.1.6\7f193107
+Node: Q5.1.7\7f194593
+Node: Q5.1.8\7f196186
+Node: Q5.1.9\7f196738
+Node: Q5.1.10\7f197623
+Node: Q5.1.11\7f198754
+Node: Q5.2.1\7f199303
+Node: Q5.2.2\7f199873
+Node: Q5.2.3\7f200290
+Node: Q5.2.4\7f200525
+Node: Q5.3.1\7f201435
+Node: Q5.3.2\7f202656
+Node: Q5.3.3\7f203432
+Node: Q5.3.4\7f203916
+Node: Q5.3.5\7f204583
+Node: Q5.3.6\7f205452
+Node: Q5.3.7\7f205697
+Node: Q5.3.8\7f207887
+Node: Q5.3.9\7f208134
+Node: Q5.3.10\7f209087
+Node: Q5.3.11\7f211171
+Node: Q5.3.12\7f212762
+Node: MS Windows\7f214036
+Node: Q6.0.1\7f215513
+Node: Q6.0.2\7f216260
+Node: Q6.0.3\7f216725
+Node: Q6.0.4\7f217005
+Node: Q6.1.1\7f219284
+Node: Q6.1.2\7f220155
+Node: Q6.1.3\7f220610
+Node: Q6.1.4\7f220892
+Node: Q6.1.5\7f221270
+Node: Q6.1.6\7f222138
+Node: Q6.2.1\7f224444
+Node: Q6.2.2\7f225345
+Node: Q6.2.3\7f225757
+Node: Q6.3.1\7f226046
+Node: Q6.3.2\7f227140
+Node: Q6.3.3\7f230321
+Node: Q6.4.1\7f230590
+Node: Current Events\7f231925
+Node: Q7.0.1\7f232579
+Node: Q7.0.2\7f233218
+Node: Q7.0.3\7f234291
+Node: Q7.0.4\7f234519
 \1f
 End Tag Table
index a37306e..6401a38 100644 (file)
@@ -17,20 +17,14 @@ Introduction
 
    This is the guide to the XEmacs Frequently Asked Questions list--a
 compendium of questions and answers pertaining to one of the finest
-programs ever written.  It is much more than just a Text Editor.
+programs ever written.  XEmacs is much more than just a Text Editor.
 
-   This FAQ is freely redistributable.  I take no liability for the
-correctness and safety of any procedures or advice given here.  This
-FAQ 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.
+   This FAQ is freely redistributable.  This FAQ 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.
 
    If you have a Web browser, the official hypertext version is at
-`http://www.xemacs.org/faq/xemacs-faq.html'.
-
-   This version is somewhat nicer than the unofficial hypertext versions
-that are archived at Utrecht, Oxford, Smart Pages, and other FAQ
-archives.
+`http://www.xemacs.org/faq/xemacs-faq.html'
 
 * Menu:
 
@@ -53,7 +47,7 @@ Introduction, Policy, Credits
 * Q1.0.4::      Why Another Version of Emacs?
 * Q1.0.5::      Why Haven't XEmacs and GNU Emacs Merged?
 * Q1.0.6::      Where can I get help?
-* Q1.0.7::      Where is the mailing list archived?
+* Q1.0.7::      Where are the mailing lists archived?
 * Q1.0.8::      How do you pronounce XEmacs?
 * Q1.0.9::      What does XEmacs look like?
 * Q1.0.10::     Is there a port of XEmacs to Microsoft ('95 or NT)?
@@ -73,12 +67,12 @@ Credits:
 * Q1.2.3::      Who contributed to the FAQ in the past?
 
 Internationalization:
-* Q1.3.1::      What is the status of XEmacs v20?
-* Q1.3.2::      What is the status of Asian-language support, aka MULE?
+* Q1.3.1::      What is the status of internationalization support aka MULE (including Asian language support?
+* Q1.3.2::      How can I help with internationalization?
 * Q1.3.3::      How do I type non-ASCII characters?
 * Q1.3.4::      Can XEmacs messages come out in a different language?
-* Q1.3.5::      Please explain the various input methods in MULE/XEmacs 20.0
-* Q1.3.6::      How do I portably code for MULE/XEmacs 20.0?
+* Q1.3.5::      Please explain the various input methods in MULE/XEmacs
+* Q1.3.6::      How do I portably code for MULE/XEmacs?
 * Q1.3.7::      How about Cyrillic Modes?
 
 Getting Started:
@@ -300,7 +294,7 @@ Emacs Lisp Programming Techniques:
 * Q5.1.4::      What is the performance hit of `let'?
 * Q5.1.5::      What is the recommended use of `setq'?
 * Q5.1.6::      What is the typical misuse of `setq' ?
-* Q5.1.7::      I like the the `do' form of cl, does it slow things down?
+* Q5.1.7::      I like the `do' form of cl, does it slow things down?
 * Q5.1.8::      I like recursion, does it slow things down?
 * Q5.1.9::      How do I put a glyph as annotation in a buffer?
 * Q5.1.10::     `map-extents' won't traverse all of my extents!
@@ -402,7 +396,7 @@ Introduction:
 * Q1.0.4::      Why Another Version of Emacs?
 * Q1.0.5::      Why Haven't XEmacs and GNU Emacs Merged?
 * Q1.0.6::      Where can I get help?
-* Q1.0.7::      Where is the mailing list archived?
+* Q1.0.7::      Where are the mailing lists archived?
 * Q1.0.8::      How do you pronounce XEmacs?
 * Q1.0.9::      What does XEmacs look like?
 * Q1.0.10::     Is there a port of XEmacs to Microsoft ('95 or NT)?
@@ -422,12 +416,12 @@ Credits:
 * Q1.2.3::      Who contributed to the FAQ in the past?
 
 Internationalization:
-* Q1.3.1::      What is the status of XEmacs v20?
-* Q1.3.2::      What is the status of Asian-language support, aka MULE?
+* Q1.3.1::      What is the status of internationalization support aka MULE (including Asian language support?
+* Q1.3.2::      How can I help with internationalization?
 * Q1.3.3::      How do I type non-ASCII characters?
 * Q1.3.4::      Can XEmacs messages come out in a different language?
-* Q1.3.5::      Please explain the various input methods in MULE/XEmacs 20.0
-* Q1.3.6::      How do I portably code for MULE/XEmacs 20.0?
+* Q1.3.5::      Please explain the various input methods in MULE/XEmacs
+* Q1.3.6::      How do I portably code for MULE/XEmacs?
 * Q1.3.7::      How about Cyrillic Modes?
 
 Getting Started:
@@ -460,10 +454,10 @@ File: xemacs-faq.info,  Node: Q1.0.2,  Next: Q1.0.3,  Prev: Q1.0.1,  Up: Introdu
 Q1.0.2: What is the current version of XEmacs?
 ----------------------------------------------
 
-   XEmacs 21.1.8 is the current stable version of XEmacs.
-
-   XEmacs 20.4 is a minor upgrade from 20.3, containing many bugfixes.
-It was released in February 1998.
+   XEmacs versions 21.1.* are releases made from the current stable
+sources.  XEmacs versions 21.2.* are releases made from the development
+sources.  Check at `http://www.xemacs.org' for the current minor
+version.
 
    XEmacs 19.16 was the last release of v19, released in November, 1997,
 which was also the last version without international language support.
@@ -574,8 +568,8 @@ a message with a subject of `unsubscribe' to be removed.
 \1f
 File: xemacs-faq.info,  Node: Q1.0.7,  Next: Q1.0.8,  Prev: Q1.0.6,  Up: Introduction
 
-Q1.0.7: Where is the mailing list archived?
--------------------------------------------
+Q1.0.7: Where are the mailing lists archived?
+---------------------------------------------
 
    The archives can be found at `http://www.xemacs.org/Lists/Archive'
 
@@ -642,7 +636,7 @@ Q1.0.14: Where can I obtain a printed copy of the XEmacs users manual?
 TeX, you can generate your own manual from the XEmacs sources.
 
    HTML and Postscript versions of XEmacs manuals may be available from
-the XEmacs web site in the future.
+the XEmacs web site in the future.  Send requests to <faq@xemacs.org>.
 
 \1f
 File: xemacs-faq.info,  Node: Q1.1.1,  Next: Q1.1.2,  Prev: Q1.0.14,  Up: Introduction
@@ -662,12 +656,11 @@ maintainers <faq@xemacs.org>.
    Please make sure that `XEmacs FAQ' appears on the Subject: line.  If
 you think you have a better way of answering a question, or think a
 question should be included, we'd like to hear about it.  Questions and
-answers included into the FAQ will be edited for spelling and grammar,
+answers included into the FAQ will be edited for spelling and grammar
 and will be attributed.  Answers appearing without attribution are
-either from versions of the FAQ dated before May 1996, or are from one
-of the four people listed at the top of this document.  Answers quoted
-from Usenet news articles will always be attributed, regardless of the
-author.
+either from versions of the FAQ dated before May 1996 or are from
+previous FAQ maintainers.  Answers quoted from Usenet news articles will
+always be attributed, regardless of the author.
 
 \1f
 File: xemacs-faq.info,  Node: Q1.1.2,  Next: Q1.1.3,  Prev: Q1.1.1,  Up: Introduction
@@ -819,84 +812,20 @@ File: xemacs-faq.info,  Node: Q1.3.1,  Next: Q1.3.2,  Prev: Q1.2.3,  Up: Introdu
 1.3: Internationalization
 =========================
 
-Q1.3.1: What is the status of XEmacs v20?
------------------------------------------
+Q1.3.1: What is the status of internationalization support aka MULE (including Asian language support?
+------------------------------------------------------------------------------------------------------
 
-   XEmacs v20 is the version of XEmacs that includes MULE
-(Asian-language) support.  XEmacs 20.0 was released in February 1997,
-followed by XEmacs 20.2 in May, XEmacs 20.3 in November and XEmacs 20.4
-in February 1998.  When compiled without MULE support, 20.4 is
-approximately as stable as 19.16, and probably faster (due to
-additional optimization work.)
-
-   As of XEmacs 20.3, version 20 is _the_ supported version of XEmacs.
-This means that 19.16 will optionally receive stability fixes (if any),
-but that all the real development work will be done on the v20 tree.
-
-   The incompatible changes in XEmacs 20 include the additional
-byte-codes, new primitive data types (`character', `char-table', and
-`range-table').  This means that the character-integer equivalence
-inherent to all the previous Emacs and XEmacs releases no longer
-applies.
-
-   However, to avoid breaking old code, many functions that should
-normally accept characters work with integers, and vice versa.  For more
-information, see the Lisp reference manual.  Here is a relevant excerpt,
-for your convenience.
-
-       In XEmacs version 19, and in all versions of FSF GNU Emacs, a
-     "character" in XEmacs Lisp is nothing more than an integer.  This
-     is yet another holdover from XEmacs Lisp's derivation from
-     vintage-1980 Lisps; modern versions of Lisp consider this
-     equivalence a bad idea, and have separate character types.  In
-     XEmacs version 20, the modern convention is followed, and
-     characters are their own primitive types. (This change was
-     necessary in order for MULE, i.e. Asian-language, support to be
-     correctly implemented.)
-
-     Even in XEmacs version 20, remnants of the equivalence between
-     characters and integers still exist; this is termed the "char-int
-     confoundance disease".  In particular, many functions such as `eq',
-     `equal', and `memq' have equivalent functions (`old-eq',
-     `old-equal', `old-memq', etc.) that pretend like characters are
-     integers are the same.  Byte code compiled under any version 19
-     Emacs will have all such functions mapped to their `old-'
-     equivalents when the byte code is read into XEmacs 20.  This is to
-     preserve compatibility--Emacs 19 converts all constant characters
-     to the equivalent integer during byte-compilation, and thus there
-     is no other way to preserve byte-code compatibility even if the
-     code has specifically been written with the distinction between
-     characters and integers in mind.
-
-     Every character has an equivalent integer, called the "character
-     code".  For example, the character `A' is represented as the
-     integer 65, following the standard ASCII representation of
-     characters.  If XEmacs was not compiled with MULE support, the
-     range of this integer will always be 0 to 255--eight bits, or one
-     byte. (Integers outside this range are accepted but silently
-     truncated; however, you should most decidedly _not_ rely on this,
-     because it will not work under XEmacs with MULE support.)  When
-     MULE support is present, the range of character codes is much
-     larger. (Currently, 19 bits are used.)
-
-     FSF GNU Emacs uses kludgy character codes above 255 to represent
-     keyboard input of ASCII characters in combination with certain
-     modifiers.  XEmacs does not use this (a more general mechanism is
-     used that does not distinguish between ASCII keys and other keys),
-     so you will never find character codes above 255 in a non-MULE
-     XEmacs.
-
-     Individual characters are not often used in programs.  It is far
-     more common to work with _strings_, which are sequences composed of
-     characters.
+   Both the stable and development versions of XEmacs include
+internationalization support (aka MULE).  MULE currently works on UNIX
+and Linux systems; work for supporting MULE on Windows operating systems
+is in progress.  Binaries compiled without MULE support run faster than
+MULE capable XEmacsen.
 
 \1f
 File: xemacs-faq.info,  Node: Q1.3.2,  Next: Q1.3.3,  Prev: Q1.3.1,  Up: Introduction
 
-Q1.3.2: What is the status of Asian-language support, aka MULE?
----------------------------------------------------------------
-
-   MULE support is now available for UNIX versions of XEmacs.
+Q1.3.2: How can I help with internationalization?
+-------------------------------------------------
 
    If you would like to help, you may want to join the
 <xemacs-mule@xemacs.org> mailing list.  Especially needed are people
@@ -921,8 +850,8 @@ Q1.3.4: Can XEmacs messages come out in a different language?
 
    The message-catalog support has mostly been written but doesn't
 currently work.  The first release of XEmacs 20 will _not_ support it.
-However, menubar localization _does_ work, even in 19.14.  To enable
-it, add to your `Emacs' file entries like this:
+However, menubar localization _does_ work.  To enable it, add to your
+`Emacs' file entries like this:
 
      Emacs*XlwMenu.resourceLabels:                   True
      Emacs*XlwMenu.file.labelString:                 Fichier
@@ -934,8 +863,8 @@ removing punctuation and capitalizing as above.
 \1f
 File: xemacs-faq.info,  Node: Q1.3.5,  Next: Q1.3.6,  Prev: Q1.3.4,  Up: Introduction
 
-Q1.3.5: Please explain the various input methods in MULE/XEmacs 20.0
---------------------------------------------------------------------
+Q1.3.5: Please explain the various input methods in MULE/XEmacs
+---------------------------------------------------------------
 
    MORIOKA Tomohiko <morioka@jaist.ac.jp> writes:
 
@@ -984,8 +913,8 @@ Q1.3.5: Please explain the various input methods in MULE/XEmacs 20.0
 \1f
 File: xemacs-faq.info,  Node: Q1.3.6,  Next: Q1.3.7,  Prev: Q1.3.5,  Up: Introduction
 
-Q1.3.6: How do I portably code for MULE/XEmacs 20?
---------------------------------------------------
+Q1.3.6: How do I portably code for MULE/XEmacs?
+-----------------------------------------------
 
    MORIOKA Tomohiko <morioka@jaist.ac.jp> writes:
 
@@ -1222,8 +1151,7 @@ File: xemacs-faq.info,  Node: Q2.0.1,  Next: Q2.0.2,  Prev: Installation,  Up: I
 Q2.0.1: Running XEmacs without installing
 -----------------------------------------
 
-   The `INSTALL' file says that up to 108 MB of space is needed
-temporarily during installation!  How can I just try it out?
+   How can I just try XEmacs without installing it?
 
    XEmacs will run in place without requiring installation and copying
 of the Lisp directories, and without having to specify a special
@@ -1239,3 +1167,90 @@ tree to instead of `/i/xemacs-20.2').
 
    This will let you run XEmacs without massive copying.
 
+\1f
+File: xemacs-faq.info,  Node: Q2.0.2,  Next: Q2.0.3,  Prev: Q2.0.1,  Up: Installation
+
+Q2.0.2: XEmacs is too big
+-------------------------
+
+   The space required by the installation directories can be reduced
+dramatically if desired.  Gzip all the .el files.  Remove all the
+packages you'll never want to use.  Remove the TexInfo manuals.  Remove
+the Info (and use just hardcopy versions of the manual).  Remove most
+of the stuff in etc.  Remove or gzip all the source code.  Gzip or
+remove the C source code.  Configure it so that copies are not made of
+the support lisp.
+
+   These are all Emacs Lisp source code and bytecompiled object code.
+You may safely gzip everything named *.el here.  You may remove any
+package you don't use.  _Nothing bad will happen if you delete a package
+that you do not use_.  You must be sure you do not use it though, so be
+conservative at first.
+
+   Possible candidates for deletion include w3, games, hyperbole, mh-e,
+hm-html-menus, vm, viper, oobr, gnus, etc.  Ask yourself, _Do I ever
+want to use this package?_  If the answer is no, then it is a candidate
+for removal.
+
+   First, gzip all the .el files.  Then go about package by package and
+start gzipping the .elc files.  Then run XEmacs and do whatever it is
+you normally do.  If nothing bad happens, then delete the directory.  Be
+conservative about deleting directories, and it would be handy to have a
+backup around in case you get too zealous.
+
+   `prim', `modes', `packages', and `utils' are four directories you
+definitely do *not* want to delete, although certain packages can be
+removed from them if you do not use them.
+
+   Online texinfo sources in the `info' can either be compressed them
+or remove them.  In either case, `C-h i' (info mode) will no longer
+work.
+
+\1f
+File: xemacs-faq.info,  Node: Q2.0.3,  Next: Q2.0.4,  Prev: Q2.0.2,  Up: Installation
+
+Q2.0.3: Compiling XEmacs with Netaudio.
+---------------------------------------
+
+   What is the best way to compile XEmacs with the netaudio system,
+since I have got the netaudio system compiled but installed at a weird
+place, I am not root.  Also in the READMEs it does not say anything
+about compiling with the audioserver?
+
+   You should only need to add some stuff to the configure command line.
+To tell it to compile in netaudio support: `--with-sound=both', or
+`--with-sound=nas' if you don't want native sound support for some
+reason.) To tell it where to find the netaudio includes and libraries:
+
+     --site-libraries=WHATEVER
+     --site-includes=WHATEVER
+
+   Then (fingers crossed) it should compile and it will use netaudio if
+you have a server running corresponding to the X server. The netaudio
+server has to be there when XEmacs starts. If the netaudio server goes
+away and another is run, XEmacs should cope (fingers crossed, error
+handling in netaudio isn't perfect).
+
+   BTW, netaudio has been renamed as it has a name clash with something
+else, so if you see references to NAS or Network Audio System, it's the
+same thing.  It also might be found at
+`ftp://ftp.x.org/contrib/audio/nas/'.
+
+\1f
+File: xemacs-faq.info,  Node: Q2.0.4,  Next: Q2.0.5,  Prev: Q2.0.3,  Up: Installation
+
+Q2.0.4: Problems with Linux and ncurses.
+----------------------------------------
+
+   On Linux 1.3.98 with termcap 2.0.8 and the ncurses that came with
+libc 5.2.18, XEmacs 20.0b20 is unable to open a tty device:
+
+     src/xemacs -nw -q
+     Initialization error:
+     Terminal type `xterm' undefined (or can't access database?)
+
+   Ben Wing <ben@xemacs.org> writes:
+
+     Your ncurses configuration is messed up.  Your /usr/lib/terminfo
+     is a bad pointer, perhaps to a CD-ROM that is not inserted.
+
index fca60a8..6f1f39f 100644 (file)
@@ -7,230 +7,14 @@ START-INFO-DIR-ENTRY
 END-INFO-DIR-ENTRY
 
 \1f
-File: xemacs-faq.info,  Node: Q2.0.2,  Next: Q2.0.3,  Prev: Q2.0.1,  Up: Installation
-
-Q2.0.2: XEmacs is too big
--------------------------
-
-   Although this entry has been written for XEmacs 19.13, most of it
-still stands true.
-
-   Steve Baur <steve@xemacs.org> writes:
-
-     The 45MB of space required by the installation directories can be
-     reduced dramatically if desired.  Gzip all the .el files.  Remove
-     all the packages you'll never want to use (or even ones you do
-     like the two obsolete mailcrypts and Gnus 4 in 19.13).  Remove the
-     TexInfo manuals.  Remove the Info (and use just hardcopy versions
-     of the manual).  Remove most of the stuff in etc.  Remove or gzip
-     all the source code.  Gzip or remove the C source code.  Configure
-     it so that copies are not made of the support lisp.  I'm not
-     advocating any of these things, just pointing out ways to reduce
-     the disk requirements if desired.
-
-     Now examine the space used by directory:
-
-     0       /usr/local/bin/xemacs
-     2048    /usr/local/bin/xemacs-19.13
-     
-     1546    /usr/local/lib/xemacs-19.13/i486-miranova-sco3.2v4.2
-     1158    /usr/local/lib/xemacs-19.13/i486-unknown-linux1.2.13
-
-     You need to keep these.  XEmacs isn't stripped by default in
-     installation, you should consider stripping.  That will save you
-     about 5MB right there.
-
-     207     /usr/local/lib/xemacs-19.13/etc/w3
-     122     /usr/local/lib/xemacs-19.13/etc/sounds
-     18      /usr/local/lib/xemacs-19.13/etc/sparcworks
-     159     /usr/local/lib/xemacs-19.13/etc/vm
-     6       /usr/local/lib/xemacs-19.13/etc/e
-     21      /usr/local/lib/xemacs-19.13/etc/eos
-     172     /usr/local/lib/xemacs-19.13/etc/toolbar
-     61      /usr/local/lib/xemacs-19.13/etc/ns
-     43      /usr/local/lib/xemacs-19.13/etc/gnus
-
-     These are support directories for various packages.  In general
-     they match a directory under
-     ./xemacs-19.13/lib/xemacs-19.13/lisp/.  If you do not require the
-     package, you may delete or gzip the support too.
-
-     1959    /usr/local/lib/xemacs-19.13/etc
-     175     /usr/local/lib/xemacs-19.13/lisp/bytecomp
-     340     /usr/local/lib/xemacs-19.13/lisp/calendar
-     342     /usr/local/lib/xemacs-19.13/lisp/comint
-     517     /usr/local/lib/xemacs-19.13/lisp/dired
-     42      /usr/local/lib/xemacs-19.13/lisp/electric
-     212     /usr/local/lib/xemacs-19.13/lisp/emulators
-     238     /usr/local/lib/xemacs-19.13/lisp/energize
-     289     /usr/local/lib/xemacs-19.13/lisp/gnus
-     457     /usr/local/lib/xemacs-19.13/lisp/ilisp
-     1439    /usr/local/lib/xemacs-19.13/lisp/modes
-     2276    /usr/local/lib/xemacs-19.13/lisp/packages
-     1040    /usr/local/lib/xemacs-19.13/lisp/prim
-     176     /usr/local/lib/xemacs-19.13/lisp/pcl-cvs
-     154     /usr/local/lib/xemacs-19.13/lisp/rmail
-     3       /usr/local/lib/xemacs-19.13/lisp/epoch
-     45      /usr/local/lib/xemacs-19.13/lisp/term
-     860     /usr/local/lib/xemacs-19.13/lisp/utils
-     851     /usr/local/lib/xemacs-19.13/lisp/vm
-     13      /usr/local/lib/xemacs-19.13/lisp/vms
-     157     /usr/local/lib/xemacs-19.13/lisp/x11
-     19      /usr/local/lib/xemacs-19.13/lisp/tooltalk
-     14      /usr/local/lib/xemacs-19.13/lisp/sunpro
-     291     /usr/local/lib/xemacs-19.13/lisp/games
-     198     /usr/local/lib/xemacs-19.13/lisp/edebug
-     619     /usr/local/lib/xemacs-19.13/lisp/w3
-     229     /usr/local/lib/xemacs-19.13/lisp/eos
-     55      /usr/local/lib/xemacs-19.13/lisp/iso
-     59      /usr/local/lib/xemacs-19.13/lisp/mailcrypt
-     187     /usr/local/lib/xemacs-19.13/lisp/eterm
-     356     /usr/local/lib/xemacs-19.13/lisp/ediff
-     408     /usr/local/lib/xemacs-19.13/lisp/hyperbole/kotl
-     1262    /usr/local/lib/xemacs-19.13/lisp/hyperbole
-     247     /usr/local/lib/xemacs-19.13/lisp/hm--html-menus
-     161     /usr/local/lib/xemacs-19.13/lisp/mh-e
-     299     /usr/local/lib/xemacs-19.13/lisp/viper
-     53      /usr/local/lib/xemacs-19.13/lisp/oobr/tree-x
-     4       /usr/local/lib/xemacs-19.13/lisp/oobr/tree-nx/English.lproj/DocWindow.nib
-     3       /usr/local/lib/xemacs-19.13/lisp/oobr/tree-nx/English.lproj/InfoPanel.nib
-     3       /usr/local/lib/xemacs-19.13/lisp/oobr/tree-nx/English.lproj/TreeView.nib
-     11      /usr/local/lib/xemacs-19.13/lisp/oobr/tree-nx/English.lproj
-     53      /usr/local/lib/xemacs-19.13/lisp/oobr/tree-nx
-     466     /usr/local/lib/xemacs-19.13/lisp/oobr
-     14142   /usr/local/lib/xemacs-19.13/lisp
-
-     These are all Emacs Lisp source code and bytecompiled object code.
-     You may safely gzip everything named *.el here.  You may remove
-     any package you don't use.  _Nothing bad will happen if you delete
-     a package that you do not use_.  You must be sure you do not use
-     it though, so be conservative at first.
-
-     Possible candidates for deletion include w3 (newer versions exist,
-     or you may just use Lynx or Netscape for web browsing), games,
-     hyperbole, mh-e, hm-html-menus (better packages exist), vm, viper,
-     oobr, gnus (new versions exist), etc.  Ask yourself, _Do I ever
-     want to use this package?_  If the answer is no, then it is a
-     candidate for removal.
-
-     First, gzip all the .el files.  Then go about package by package
-     and start gzipping the .elc files.  Then run XEmacs and do
-     whatever it is you normally do.  If nothing bad happens, then
-     delete the directory.  Be conservative about deleting directories,
-     and it would be handy to have a backup tape around in case you get
-     too zealous.
-
-     `prim', `modes', `packages', and `utils' are four directories you
-     definitely do *not* want to delete, although certain packages can
-     be removed from them if you do not use them.
-
-          1972    /usr/local/lib/xemacs-19.13/info
-
-     These are online texinfo sources.  You may either gzip them or
-     remove them.  In either case, `C-h i' (info mode) will no longer
-     work.
-
-          20778   /usr/local/lib/xemacs-19.13
-
-     The 20MB achieved is less than half of what the full distribution
-     takes up, *and* can be achieved without deleting a single file.
-
-   Giacomo Boffi <boffi@hp735.stru.polimi.it> provides this procedure:
-
-     Substitute `/usr/local/lib/' with the path where the xemacs tree is
-     rooted, then use this script:
-
-          #!/bin/sh
-          
-          r=/usr/local/lib/xemacs-19.13/lisp
-          
-          cd $r ; rm -f cmpr ; touch cmpr
-          
-          du -s .
-          
-          for d in * ; do
-            if test -d $d ; then
-              cd $d
-              for f in *.el ; do
-          #     compress (remove) only (ONLY) the sources that have a
-          #     corresponding compiled file --- do not (DO NOT)
-          #     touch other sources
-                if test -f ${f}c ; then gzip -v9 $f >> $r/cmpr ; fi
-              done
-              cd ..
-            fi
-          done
-          
-          du -s .
-
-     A step beyond would be substituting `rm -f' for `gzip -v9', but
-     you have to be desperate for removing the sources (remember that
-     emacs can access compressed files transparently).
-
-     Also, a good megabyte could easily be trimmed from the $r/../etc
-     directory, e.g., the termcap files, some O+NEWS, others that I
-     don't remember as well.
-
-     XEmacs 21.0 will unbundle the lisp hierarchy and allow the
-     installer to choose exactly how much support code gets installed.
-
-\1f
-File: xemacs-faq.info,  Node: Q2.0.3,  Next: Q2.0.4,  Prev: Q2.0.2,  Up: Installation
-
-Q2.0.3: Compiling XEmacs with Netaudio.
----------------------------------------
-
-   What is the best way to compile XEmacs with the netaudio system,
-since I have got the netaudio system compiled but installed at a weird
-place, I am not root.  Also in the READMEs it does not say anything
-about compiling with the audioserver?
-
-   You should only need to add some stuff to the configure command line.
-To tell it to compile in netaudio support: `--with-sound=both', or
-`--with-sound=nas' if you don't want native sound support for some
-reason.) To tell it where to find the netaudio includes and libraries:
-
-     --site-libraries=WHATEVER
-     --site-includes=WHATEVER
-
-   Then (fingers crossed) it should compile and it will use netaudio if
-you have a server running corresponding to the X server. The netaudio
-server has to be there when XEmacs starts. If the netaudio server goes
-away and another is run, XEmacs should cope (fingers crossed, error
-handling in netaudio isn't perfect).
-
-   BTW, netaudio has been renamed as it has a name clash with something
-else, so if you see references to NAS or Network Audio System, it's the
-same thing.  It also might be found at
-`ftp://ftp.x.org/contrib/audio/nas/'.
-
-\1f
-File: xemacs-faq.info,  Node: Q2.0.4,  Next: Q2.0.5,  Prev: Q2.0.3,  Up: Installation
-
-Q2.0.4: Problems with Linux and ncurses.
-----------------------------------------
-
-   On Linux 1.3.98 with termcap 2.0.8 and the ncurses that came with
-libc 5.2.18, XEmacs 20.0b20 is unable to open a tty device:
-
-     src/xemacs -nw -q
-     Initialization error:
-     Terminal type `xterm' undefined (or can't access database?)
-
-   Ben Wing <ben@xemacs.org> writes:
-
-     Your ncurses configuration is messed up.  Your /usr/lib/terminfo
-     is a bad pointer, perhaps to a CD-ROM that is not inserted.
-
-\1f
 File: xemacs-faq.info,  Node: Q2.0.5,  Next: Q2.0.6,  Prev: Q2.0.4,  Up: Installation
 
 Q2.0.5: Do I need X11 to run XEmacs?
 ------------------------------------
 
    No.  The name "XEmacs" is unfortunate in the sense that it is *not*
-an X Window System-only version of Emacs.  Starting with 19.14 XEmacs
-has full color support on a color-capable character terminal.
+an X Window System-only version of Emacs.  XEmacs has full color
+support on a color-capable character terminal.
 
 \1f
 File: xemacs-faq.info,  Node: Q2.0.6,  Next: Q2.0.7,  Prev: Q2.0.5,  Up: Installation
@@ -1248,3 +1032,275 @@ works fine!! How strange.
 
    Use `setq-default' instead, since `tab-width' is all-buffer-local.
 
+\1f
+File: xemacs-faq.info,  Node: Q3.0.4,  Next: Q3.0.5,  Prev: Q3.0.3,  Up: Customization
+
+Q3.0.4: How can I add directories to the `load-path'?
+-----------------------------------------------------
+
+   Here are two ways to do that, one that puts your directories at the
+front of the load-path, the other at the end:
+
+     ;;; Add things at the beginning of the load-path, do not add
+     ;;; duplicate directories:
+     (pushnew "bar" load-path :test 'equal)
+     
+     (pushnew "foo" load-path :test 'equal)
+     
+     ;;; Add things at the end, unconditionally
+     (setq load-path (nconc load-path '("foo" "bar")))
+
+   keith (k.p.) hanlan <keithh@nortel.ca> writes:
+
+     To add directories using Unix shell metacharacters use
+     `expand-file-name' like this:
+
+          (push (expand-file-name "~keithh/.emacsdir") load-path)
+
+\1f
+File: xemacs-faq.info,  Node: Q3.0.5,  Next: Q3.0.6,  Prev: Q3.0.4,  Up: Customization
+
+Q3.0.5: How to check if a lisp function is defined?
+---------------------------------------------------
+
+   Use the following elisp:
+
+     (fboundp 'foo)
+
+   It's almost always a mistake to test `emacs-version' or any similar
+variables.
+
+   Instead, use feature-tests, such as `featurep', `boundp', `fboundp',
+or even simple behavioral tests, eg.:
+
+     (defvar foo-old-losing-code-p
+       (condition-case nil (progn (losing-code t) nil)
+         (wrong-number-of-arguments t)))
+
+   There is an incredible amount of broken code out there which could
+work much better more often in more places if it did the above instead
+of trying to divine its environment from the value of one variable.
+
+\1f
+File: xemacs-faq.info,  Node: Q3.0.6,  Next: Q3.0.7,  Prev: Q3.0.5,  Up: Customization
+
+Q3.0.6: Can I force the output of `(face-list)' to a buffer?
+------------------------------------------------------------
+
+   It would be good having it in a buffer, as the output of
+`(face-list)' is too wide to fit to a minibuffer.
+
+   Evaluate the expression in the `*scratch*' buffer with point after
+the rightmost paren and typing `C-j'.
+
+   If the minibuffer smallness is the only problem you encounter, you
+can simply press `C-h l' to get the former minibuffer contents in a
+buffer.
+
+\1f
+File: xemacs-faq.info,  Node: Q3.0.7,  Next: Q3.0.8,  Prev: Q3.0.6,  Up: Customization
+
+Q3.0.7: Font selections in don't get saved after `Save Options'.
+----------------------------------------------------------------
+
+   For XEmacs 19.14 and previous:
+
+   John Mann <mannj@ll.mit.edu> writes:
+
+     You have to go to Options->Frame Appearance and unselect
+     `Frame-Local Font Menu'.  If this option is selected, font changes
+     are only applied to the _current_ frame and do _not_ get saved
+     when you save options.
+
+   For XEmacs 19.15 and later:
+
+   Implement the above as well as set the following in your `.emacs'
+
+     (setq options-save-faces t)
+
+\1f
+File: xemacs-faq.info,  Node: Q3.0.8,  Next: Q3.0.9,  Prev: Q3.0.7,  Up: Customization
+
+Q3.0.8: How do I get a single minibuffer frame?
+-----------------------------------------------
+
+   Vin Shelton <acs@acm.org> writes:
+
+     (setq initial-frame-plist '(minibuffer nil))
+     (setq default-frame-plist '(minibuffer nil))
+     (setq default-minibuffer-frame
+           (make-frame
+            '(minibuffer only
+                         width 86
+                         height 1
+                         menubar-visible-p nil
+                         default-toolbar-visible-p nil
+                         name "minibuffer"
+                         top -2
+                         left -2
+                         has-modeline-p nil)))
+     (frame-notice-user-settings)
+
+   *Please note:* The single minibuffer frame may not be to everyone's
+taste, and there any number of other XEmacs options settings that may
+make it difficult or inconvenient to use.
+
+\1f
+File: xemacs-faq.info,  Node: Q3.0.9,  Next: Q3.1.1,  Prev: Q3.0.8,  Up: Customization
+
+Q3.0.9: What is `Customize'?
+----------------------------
+
+   Starting with XEmacs 20.2 there is new system 'Customize' for
+customizing XEmacs options.
+
+   You can access `Customize' from the `Options' menu or invoking one
+of customize commands by typing eg.  `M-x customize', `M-x
+customize-face', `M-x customize-variable' or `M-x customize-apropos'.
+
+   Starting with XEmacs 20.3 there is also new `browser' mode for
+Customize.  Try it out with `M-x customize-browse'
+
+\1f
+File: xemacs-faq.info,  Node: Q3.1.1,  Next: Q3.1.2,  Prev: Q3.0.9,  Up: Customization
+
+3.1: X Window System & Resources
+================================
+
+Q3.1.1: Where is a list of X resources?
+---------------------------------------
+
+   Search through the `NEWS' file for `X Resources'.  A fairly
+comprehensive list is given after it.
+
+   In addition, an `app-defaults' file is supplied, `etc/Emacs.ad'
+listing the defaults.  The file `etc/sample.Xdefaults' gives a set of
+defaults that you might consider.  It is essentially the same as
+`etc/Emacs.ad' but some entries are slightly altered.  Be careful about
+installing the contents of this file into your `.Xdefaults' or
+`.Xresources' file if you use GNU Emacs under X11 as well.
+
+\1f
+File: xemacs-faq.info,  Node: Q3.1.2,  Next: Q3.1.3,  Prev: Q3.1.1,  Up: Customization
+
+Q3.1.2: How can I detect a color display?
+-----------------------------------------
+
+   You can test the return value of the function `(device-class)', as
+in:
+
+     (when (eq (device-class) 'color)
+       (set-face-foreground  'font-lock-comment-face "Grey")
+       (set-face-foreground  'font-lock-string-face  "Red")
+       ....
+       )
+
+\1f
+File: xemacs-faq.info,  Node: Q3.1.3,  Next: Q3.1.4,  Prev: Q3.1.2,  Up: Customization
+
+Q3.1.3: [This question intentionally left blank]
+------------------------------------------------
+
+\1f
+File: xemacs-faq.info,  Node: Q3.1.4,  Next: Q3.1.5,  Prev: Q3.1.3,  Up: Customization
+
+Q3.1.4: [This question intentionally left blank]
+------------------------------------------------
+
+\1f
+File: xemacs-faq.info,  Node: Q3.1.5,  Next: Q3.1.6,  Prev: Q3.1.4,  Up: Customization
+
+Q3.1.5: How can I get the icon to just say `XEmacs'?
+----------------------------------------------------
+
+   I'd like the icon to just say `XEmacs', and not include the name of
+the current file in it.
+
+   Add the following line to your `.emacs':
+
+     (setq frame-icon-title-format "XEmacs")
+
+\1f
+File: xemacs-faq.info,  Node: Q3.1.6,  Next: Q3.1.7,  Prev: Q3.1.5,  Up: Customization
+
+Q3.1.6: How can I have the window title area display the full path?
+-------------------------------------------------------------------
+
+   I'd like to have the window title area display the full
+directory/name of the current buffer file and not just the name.
+
+   Add the following line to your `.emacs':
+
+     (setq frame-title-format "%S: %f")
+
+   A more sophisticated title might be:
+
+     (setq frame-title-format
+           '("%S: " (buffer-file-name "%f"
+                                      (dired-directory dired-directory "%b"))))
+
+   That is, use the file name, or the dired-directory, or the buffer
+name.
+
+\1f
+File: xemacs-faq.info,  Node: Q3.1.7,  Next: Q3.1.8,  Prev: Q3.1.6,  Up: Customization
+
+Q3.1.7: `xemacs -name junk' doesn't work?
+-----------------------------------------
+
+   When I run `xterm -name junk', I get an xterm whose class name
+according to xprop, is `junk'.  This is the way it's supposed to work,
+I think.  When I run `xemacs -name junk' the class name is not set to
+`junk'.  It's still `emacs'.  What does `xemacs -name' really do?  The
+reason I ask is that my window manager (fvwm) will make a window sticky
+and I use XEmacs to read my mail.  I want that XEmacs window to be
+sticky, without having to use the window manager's function to set the
+window sticky.  What gives?
+
+   `xemacs -name' sets the application name for the program (that is,
+the thing which normally comes from `argv[0]').  Using `-name' is the
+same as making a copy of the executable with that new name.  The
+`WM_CLASS' property on each frame is set to the frame-name, and the
+application-class.  So, if you did `xemacs -name FOO' and then created
+a frame named BAR, you'd get an X window with WM_CLASS = `( "BAR",
+"Emacs")'.  However, the resource hierarchy for this widget would be:
+
+     Name:    FOO   .shell             .container   .BAR
+     Class:   Emacs .TopLevelEmacsShell.EmacsManager.EmacsFrame
+
+   instead of the default
+
+     Name:    xemacs.shell             .container   .emacs
+     Class:   Emacs .TopLevelEmacsShell.EmacsManager.EmacsFrame
+
+   It is arguable that the first element of WM_CLASS should be set to
+the application-name instead of the frame-name, but I think that's less
+flexible, since it does not give you the ability to have multiple frames
+with different WM_CLASS properties.  Another possibility would be for
+the default frame name to come from the application name instead of
+simply being `emacs'.  However, at this point, making that change would
+be troublesome: it would mean that many users would have to make yet
+another change to their resource files (since the default frame name
+would suddenly change from `emacs' to `xemacs', or whatever the
+executable happened to be named), so we'd rather avoid it.
+
+   To make a frame with a particular name use:
+
+     (make-frame '((name . "the-name")))
+
+\1f
+File: xemacs-faq.info,  Node: Q3.1.8,  Next: Q3.2.1,  Prev: Q3.1.7,  Up: Customization
+
+Q3.1.8: `-iconic' doesn't work.
+-------------------------------
+
+   When I start up XEmacs using `-iconic' it doesn't work right.  Using
+`-unmapped' on the command line, and setting the `initiallyUnmapped' X
+Resource don't seem to help much either...
+
+   Ben Wing <ben@xemacs.org> writes:
+
+     Ugh, this stuff is such an incredible mess that I've about given up
+     getting it to work.  The principal problem is numerous
+     window-manager bugs...
+
index 12c76de..b753711 100644 (file)
@@ -34,25 +34,25 @@ Indirect:
 xemacs.info-1: 1350
 xemacs.info-2: 48878
 xemacs.info-3: 98489
-xemacs.info-4: 147823
-xemacs.info-5: 197420
-xemacs.info-6: 246860
-xemacs.info-7: 296797
-xemacs.info-8: 343612
-xemacs.info-9: 392237
-xemacs.info-10: 441337
-xemacs.info-11: 489981
-xemacs.info-12: 539920
-xemacs.info-13: 581720
-xemacs.info-14: 631497
-xemacs.info-15: 681144
-xemacs.info-16: 730284
-xemacs.info-17: 778697
-xemacs.info-18: 826295
-xemacs.info-19: 857208
-xemacs.info-20: 888862
-xemacs.info-21: 938210
-xemacs.info-22: 980796
+xemacs.info-4: 147801
+xemacs.info-5: 197397
+xemacs.info-6: 246837
+xemacs.info-7: 296794
+xemacs.info-8: 345041
+xemacs.info-9: 392811
+xemacs.info-10: 442411
+xemacs.info-11: 490852
+xemacs.info-12: 538047
+xemacs.info-13: 586228
+xemacs.info-14: 636005
+xemacs.info-15: 685652
+xemacs.info-16: 734792
+xemacs.info-17: 783205
+xemacs.info-18: 830803
+xemacs.info-19: 862297
+xemacs.info-20: 893951
+xemacs.info-21: 943355
+xemacs.info-22: 985941
 \1f
 Tag Table:
 (Indirect)
@@ -87,335 +87,335 @@ Node: Entering Emacs\7f95592
 Node: Exiting\7f98489
 Node: Command Switches\7f102962
 Node: Startup Paths\7f112326
-Node: Basic\7f119675
-Node: Inserting Text\7f121084
-Node: Moving Point\7f124080
-Node: Erasing\7f127686
-Node: Basic Files\7f128991
-Node: Basic Help\7f130913
-Node: Blank Lines\7f131508
-Node: Continuation Lines\7f133084
-Node: Position Info\7f134751
-Node: Arguments\7f138167
-Node: Undo\7f142266
-Node: Minibuffer\7f145213
-Node: Minibuffer File\7f147823
-Node: Minibuffer Edit\7f149628
-Node: Completion\7f152569
-Node: Completion Example\7f154500
-Node: Completion Commands\7f155595
-Node: Strict Completion\7f158571
-Node: Completion Options\7f160352
-Node: Minibuffer History\7f161860
-Node: Repetition\7f165044
-Node: M-x\7f167889
-Node: Help\7f172983
-Node: Help Summary\7f174393
-Node: Key Help\7f177179
-Node: Name Help\7f178138
-Node: Apropos\7f180783
-Node: Library Keywords\7f183902
-Node: Help Mode\7f186223
-Node: Misc Help\7f186720
-Node: Mark\7f189869
-Node: Setting Mark\7f191723
-Node: Using Region\7f194845
-Node: Marking Objects\7f195582
-Node: Mark Ring\7f197420
-Node: Mouse Selection\7f199136
-Node: Additional Mouse Operations\7f201143
-Node: Killing\7f205347
-Node: Yanking\7f210983
-Node: Kill Ring\7f211786
-Node: Appending Kills\7f213388
-Node: Earlier Kills\7f215425
-Node: Using X Selections\7f218038
-Node: X Clipboard Selection\7f219288
-Node: X Selection Commands\7f221465
-Node: X Cut Buffers\7f222551
-Node: Active Regions\7f223910
-Node: Accumulating Text\7f228490
-Node: Rectangles\7f231563
-Node: Registers\7f235082
-Node: RegPos\7f236536
-Node: RegText\7f237692
-Node: RegRect\7f238798
-Node: RegConfig\7f239677
-Node: RegNumbers\7f240617
-Node: RegFiles\7f241335
-Node: Bookmarks\7f241993
-Node: Display\7f245365
-Node: Scrolling\7f246860
-Node: Horizontal Scrolling\7f251003
-Node: Selective Display\7f252198
-Node: Display Vars\7f253417
-Node: Search\7f256095
-Node: Incremental Search\7f257288
-Node: Non-Incremental Search\7f266215
-Node: Word Search\7f267657
-Node: Regexp Search\7f269275
-Node: Regexps\7f270811
-Node: Search Case\7f281112
-Node: Replace\7f281893
-Node: Unconditional Replace\7f282841
-Node: Regexp Replace\7f283976
-Node: Replacement and Case\7f284911
-Node: Query Replace\7f285891
-Node: Other Repeating Search\7f289118
-Node: Fixit\7f290373
-Node: Kill Errors\7f290953
-Node: Transpose\7f292286
-Node: Fixing Case\7f294690
-Node: Spelling\7f295336
-Node: Files\7f296797
-Node: File Names\7f298107
-Node: Visiting\7f302444
-Node: Saving\7f309130
-Node: Backup\7f314053
-Node: Backup Names\7f315449
-Node: Backup Deletion\7f316932
-Node: Backup Copying\7f318082
-Node: Interlocking\7f319788
-Node: Reverting\7f323916
-Node: Auto Save\7f325828
-Node: Auto Save Files\7f326795
-Node: Auto Save Control\7f328636
-Node: Recover\7f330474
-Node: Version Control\7f331629
-Node: Concepts of VC\7f333667
-Node: Editing with VC\7f335277
-Node: Variables for Check-in/out\7f340533
-Node: Log Entries\7f342432
-Node: Change Logs and VC\7f343612
-Node: Old Versions\7f346879
-Node: VC Status\7f348882
-Node: Renaming and VC\7f350596
-Node: Snapshots\7f351275
-Node: Making Snapshots\7f351776
-Node: Snapshot Caveats\7f353069
-Node: Version Headers\7f354878
-Node: ListDir\7f357577
-Node: Comparing Files\7f359626
-Node: Dired\7f361159
-Node: Dired Enter\7f361830
-Node: Dired Edit\7f362655
-Node: Dired Deletion\7f364402
-Node: Dired Immed\7f367625
-Node: Misc File Ops\7f368901
-Node: Buffers\7f371389
-Node: Select Buffer\7f373547
-Node: List Buffers\7f375342
-Node: Misc Buffer\7f377100
-Node: Kill Buffer\7f378743
-Node: Several Buffers\7f379873
-Node: Windows\7f383740
-Node: Basic Window\7f384451
-Node: Split Window\7f386170
-Node: Other Window\7f388303
-Node: Pop Up Window\7f390732
-Node: Change Window\7f392237
-Node: Mule\7f395145
-Node: Mule Intro\7f396408
-Node: Language Environments\7f397424
-Node: Input Methods\7f399531
-Node: Select Input Method\7f403251
-Node: Coding Systems\7f405406
-Node: Recognize Coding\7f409592
-Node: Specify Coding\7f412918
-Node: Major Modes\7f417849
-Node: Choosing Modes\7f420068
-Node: Indentation\7f422458
-Node: Indentation Commands\7f424553
-Node: Tab Stops\7f427282
-Node: Just Spaces\7f429131
-Node: Text\7f429946
-Node: Text Mode\7f431929
-Node: Nroff Mode\7f434008
-Node: TeX Mode\7f435651
-Node: TeX Editing\7f437903
-Node: TeX Print\7f441337
-Node: Outline Mode\7f444556
-Node: Outline Format\7f446037
-Node: Outline Motion\7f448837
-Node: Outline Visibility\7f450390
-Node: Words\7f453311
-Node: Sentences\7f456258
-Node: Paragraphs\7f458454
-Node: Pages\7f460742
-Node: Filling\7f463342
-Node: Auto Fill\7f463913
-Node: Fill Commands\7f466060
-Node: Fill Prefix\7f468225
-Node: Case\7f470413
-Node: Programs\7f472441
-Node: Program Modes\7f474991
-Node: Lists\7f477223
-Node: Defuns\7f483063
-Node: Grinding\7f485716
-Node: Basic Indent\7f486344
-Node: Multi-line Indent\7f488365
-Node: Lisp Indent\7f489981
-Node: C Indent\7f493431
-Node: Matching\7f498671
-Node: Comments\7f500193
-Node: Balanced Editing\7f506645
-Node: Lisp Completion\7f507659
-Node: Documentation\7f508674
-Node: Change Log\7f509913
-Node: Tags\7f512491
-Node: Tag Syntax\7f514140
-Node: Create Tags Table\7f518084
-Node: Etags Regexps\7f522144
-Node: Select Tags Table\7f526802
-Node: Find Tag\7f530575
-Node: Tags Search\7f533539
-Node: List Tags\7f536995
-Node: Fortran\7f538024
-Node: Fortran Motion\7f539100
-Node: Fortran Indent\7f539920
-Node: ForIndent Commands\7f540605
-Node: ForIndent Num\7f541750
-Node: ForIndent Conv\7f543024
-Node: ForIndent Vars\7f543800
-Node: Fortran Comments\7f544968
-Node: Fortran Columns\7f548566
-Node: Fortran Abbrev\7f549989
-Node: Asm Mode\7f550898
-Node: Running\7f551450
-Node: Compilation\7f552420
-Node: Lisp Modes\7f557270
-Node: Lisp Libraries\7f558543
-Node: Loading\7f559097
-Node: Compiling Libraries\7f563557
-Node: Mocklisp\7f566448
-Node: Lisp Eval\7f567125
-Node: Lisp Debug\7f570765
-Node: Lisp Interaction\7f576192
-Node: External Lisp\7f577547
-Node: Packages\7f579621
-Node: Package Terminology\7f580362
-Node: Using Packages\7f581720
-Node: Building Packages\7f590598
-Node: Abbrevs\7f593120
-Node: Defining Abbrevs\7f595320
-Node: Expanding Abbrevs\7f597767
-Node: Editing Abbrevs\7f600469
-Node: Saving Abbrevs\7f602342
-Node: Dynamic Abbrevs\7f604297
-Node: Picture\7f605599
-Node: Basic Picture\7f608032
-Node: Insert in Picture\7f610317
-Node: Tabs in Picture\7f611739
-Node: Rectangles in Picture\7f613260
-Node: Sending Mail\7f615168
-Node: Mail Format\7f616879
-Node: Mail Headers\7f618229
-Node: Mail Mode\7f624637
-Node: Reading Mail\7f628250
-Node: Calendar/Diary\7f629825
-Node: Calendar Motion\7f631497
-Node: Calendar Unit Motion\7f632380
-Node: Move to Beginning or End\7f634703
-Node: Specified Dates\7f635836
-Node: Scroll Calendar\7f636724
-Node: Mark and Region\7f638515
-Node: General Calendar\7f640421
-Node: LaTeX Calendar\7f642029
-Node: Holidays\7f644043
-Node: Sunrise/Sunset\7f647145
-Node: Lunar Phases\7f650184
-Node: Other Calendars\7f651569
-Node: Calendar Systems\7f653056
-Node: To Other Calendar\7f656167
-Node: From Other Calendar\7f658158
-Node: Mayan Calendar\7f660463
-Node: Diary\7f663658
-Node: Diary Commands\7f665407
-Node: Format of Diary File\7f668730
-Node: Date Formats\7f671600
-Node: Adding to Diary\7f674174
-Node: Special Diary Entries\7f675805
-Node: Calendar Customization\7f681144
-Node: Calendar Customizing\7f682006
-Node: Holiday Customizing\7f685241
-Node: Date Display Format\7f691728
-Node: Time Display Format\7f692686
-Node: Daylight Savings\7f693824
-Node: Diary Customizing\7f697012
-Node: Hebrew/Islamic Entries\7f701633
-Node: Fancy Diary Display\7f704973
-Node: Included Diary Files\7f706889
-Node: Sexp Diary Entries\7f707870
-Node: Appt Customizing\7f712960
-Node: Sorting\7f714006
-Node: Shell\7f718812
-Node: Single Shell\7f720105
-Node: Interactive Shell\7f721719
-Node: Shell Mode\7f725484
-Node: Terminal emulator\7f727975
-Node: Term Mode\7f730284
-Node: Paging in Term\7f731198
-Node: Narrowing\7f731996
-Node: Hardcopy\7f733946
-Node: Recursive Edit\7f734918
-Node: Dissociated Press\7f737905
-Node: CONX\7f740468
-Node: Amusements\7f741492
-Node: Emulation\7f741972
-Node: Customization\7f743832
-Node: Minor Modes\7f745648
-Node: Variables\7f747280
-Node: Examining\7f749236
-Node: Easy Customization\7f750697
-Node: Customization Groups\7f751711
-Node: Changing an Option\7f754640
-Node: Face Customization\7f760910
-Node: Specific Customization\7f762674
-Node: Edit Options\7f765281
-Node: Locals\7f766865
-Node: File Variables\7f770044
-Node: Keyboard Macros\7f774594
-Node: Basic Kbd Macro\7f776765
-Node: Save Kbd Macro\7f778697
-Node: Kbd Macro Query\7f780355
-Node: Key Bindings\7f782297
-Node: Keymaps\7f783171
-Node: Rebinding\7f787021
-Node: Interactive Rebinding\7f787720
-Node: Programmatic Rebinding\7f789909
-Node: Key Bindings Using Strings\7f792716
-Node: Disabling\7f794343
-Node: Syntax\7f796122
-Node: Syntax Entry\7f797003
-Node: Syntax Change\7f801087
-Node: Init File\7f803256
-Node: Init Syntax\7f804720
-Node: Init Examples\7f807071
-Node: Terminal Init\7f811261
-Node: Audible Bell\7f812998
-Node: Faces\7f816429
-Node: Frame Components\7f821271
-Node: X Resources\7f821716
-Node: Geometry Resources\7f823375
-Node: Iconic Resources\7f825823
-Node: Resource List\7f826295
-Node: Face Resources\7f832802
-Node: Widgets\7f836479
-Node: Menubar Resources\7f837418
-Node: Quitting\7f838351
-Node: Lossage\7f841329
-Node: Stuck Recursive\7f841973
-Node: Screen Garbled\7f842679
-Node: Text Garbled\7f843813
-Node: Unasked-for Search\7f844452
-Node: Emergency Escape\7f845237
-Node: Total Frustration\7f847016
-Node: Bugs\7f847647
-Node: Glossary\7f857208
-Node: Manifesto\7f888862
-Node: Key Index\7f912339
-Node: Command Index\7f938210
-Node: Variable Index\7f980796
-Node: Concept Index\7f996882
+Node: Basic\7f119653
+Node: Inserting Text\7f121062
+Node: Moving Point\7f124058
+Node: Erasing\7f127664
+Node: Basic Files\7f128969
+Node: Basic Help\7f130891
+Node: Blank Lines\7f131486
+Node: Continuation Lines\7f133062
+Node: Position Info\7f134729
+Node: Arguments\7f138145
+Node: Undo\7f142244
+Node: Minibuffer\7f145191
+Node: Minibuffer File\7f147801
+Node: Minibuffer Edit\7f149606
+Node: Completion\7f152547
+Node: Completion Example\7f154478
+Node: Completion Commands\7f155573
+Node: Strict Completion\7f158549
+Node: Completion Options\7f160330
+Node: Minibuffer History\7f161838
+Node: Repetition\7f165022
+Node: M-x\7f167867
+Node: Help\7f172961
+Node: Help Summary\7f174371
+Node: Key Help\7f177157
+Node: Name Help\7f178116
+Node: Apropos\7f180761
+Node: Library Keywords\7f183880
+Node: Help Mode\7f186201
+Node: Misc Help\7f186698
+Node: Mark\7f189846
+Node: Setting Mark\7f191700
+Node: Using Region\7f194822
+Node: Marking Objects\7f195559
+Node: Mark Ring\7f197397
+Node: Mouse Selection\7f199113
+Node: Additional Mouse Operations\7f201120
+Node: Killing\7f205324
+Node: Yanking\7f210960
+Node: Kill Ring\7f211763
+Node: Appending Kills\7f213365
+Node: Earlier Kills\7f215402
+Node: Using X Selections\7f218015
+Node: X Clipboard Selection\7f219265
+Node: X Selection Commands\7f221442
+Node: X Cut Buffers\7f222528
+Node: Active Regions\7f223887
+Node: Accumulating Text\7f228467
+Node: Rectangles\7f231540
+Node: Registers\7f235059
+Node: RegPos\7f236513
+Node: RegText\7f237669
+Node: RegRect\7f238775
+Node: RegConfig\7f239654
+Node: RegNumbers\7f240594
+Node: RegFiles\7f241312
+Node: Bookmarks\7f241970
+Node: Display\7f245342
+Node: Scrolling\7f246837
+Node: Horizontal Scrolling\7f250980
+Node: Selective Display\7f252175
+Node: Display Vars\7f253394
+Node: Search\7f256072
+Node: Incremental Search\7f257265
+Node: Non-Incremental Search\7f266193
+Node: Word Search\7f267635
+Node: Regexp Search\7f269253
+Node: Regexps\7f271623
+Node: Search Case\7f285620
+Node: Replace\7f286401
+Node: Unconditional Replace\7f287349
+Node: Regexp Replace\7f288484
+Node: Replacement and Case\7f289419
+Node: Query Replace\7f290399
+Node: Other Repeating Search\7f293626
+Node: Fixit\7f294881
+Node: Kill Errors\7f295461
+Node: Transpose\7f296794
+Node: Fixing Case\7f299198
+Node: Spelling\7f299844
+Node: Files\7f301305
+Node: File Names\7f302615
+Node: Visiting\7f306952
+Node: Saving\7f313638
+Node: Backup\7f318561
+Node: Backup Names\7f319957
+Node: Backup Deletion\7f321440
+Node: Backup Copying\7f322590
+Node: Interlocking\7f324296
+Node: Reverting\7f328424
+Node: Auto Save\7f330336
+Node: Auto Save Files\7f331303
+Node: Auto Save Control\7f333144
+Node: Recover\7f334982
+Node: Version Control\7f336137
+Node: Concepts of VC\7f338175
+Node: Editing with VC\7f339785
+Node: Variables for Check-in/out\7f345041
+Node: Log Entries\7f346940
+Node: Change Logs and VC\7f348120
+Node: Old Versions\7f351387
+Node: VC Status\7f353390
+Node: Renaming and VC\7f355104
+Node: Snapshots\7f355783
+Node: Making Snapshots\7f356284
+Node: Snapshot Caveats\7f357577
+Node: Version Headers\7f359386
+Node: ListDir\7f362085
+Node: Comparing Files\7f364134
+Node: Dired\7f365667
+Node: Dired Enter\7f366338
+Node: Dired Edit\7f367163
+Node: Dired Deletion\7f368910
+Node: Dired Immed\7f372133
+Node: Misc File Ops\7f373409
+Node: Buffers\7f375897
+Node: Select Buffer\7f378055
+Node: List Buffers\7f379850
+Node: Misc Buffer\7f381608
+Node: Kill Buffer\7f383251
+Node: Several Buffers\7f384381
+Node: Windows\7f388248
+Node: Basic Window\7f388959
+Node: Split Window\7f390678
+Node: Other Window\7f392811
+Node: Pop Up Window\7f395240
+Node: Change Window\7f396745
+Node: Mule\7f399653
+Node: Mule Intro\7f400916
+Node: Language Environments\7f401932
+Node: Input Methods\7f404039
+Node: Select Input Method\7f407759
+Node: Coding Systems\7f409914
+Node: Recognize Coding\7f414100
+Node: Specify Coding\7f417426
+Node: Major Modes\7f422357
+Node: Choosing Modes\7f424576
+Node: Indentation\7f426966
+Node: Indentation Commands\7f429061
+Node: Tab Stops\7f431790
+Node: Just Spaces\7f433639
+Node: Text\7f434454
+Node: Text Mode\7f436437
+Node: Nroff Mode\7f438516
+Node: TeX Mode\7f440159
+Node: TeX Editing\7f442411
+Node: TeX Print\7f445845
+Node: Outline Mode\7f449064
+Node: Outline Format\7f450545
+Node: Outline Motion\7f453345
+Node: Outline Visibility\7f454898
+Node: Words\7f457819
+Node: Sentences\7f460766
+Node: Paragraphs\7f462962
+Node: Pages\7f465250
+Node: Filling\7f467850
+Node: Auto Fill\7f468421
+Node: Fill Commands\7f470568
+Node: Fill Prefix\7f472733
+Node: Case\7f474921
+Node: Programs\7f476949
+Node: Program Modes\7f479499
+Node: Lists\7f481731
+Node: Defuns\7f487571
+Node: Grinding\7f490224
+Node: Basic Indent\7f490852
+Node: Multi-line Indent\7f492873
+Node: Lisp Indent\7f494489
+Node: C Indent\7f497939
+Node: Matching\7f503179
+Node: Comments\7f504701
+Node: Balanced Editing\7f511153
+Node: Lisp Completion\7f512167
+Node: Documentation\7f513182
+Node: Change Log\7f514421
+Node: Tags\7f516999
+Node: Tag Syntax\7f518648
+Node: Create Tags Table\7f522592
+Node: Etags Regexps\7f526652
+Node: Select Tags Table\7f531310
+Node: Find Tag\7f535083
+Node: Tags Search\7f538047
+Node: List Tags\7f541503
+Node: Fortran\7f542532
+Node: Fortran Motion\7f543608
+Node: Fortran Indent\7f544428
+Node: ForIndent Commands\7f545113
+Node: ForIndent Num\7f546258
+Node: ForIndent Conv\7f547532
+Node: ForIndent Vars\7f548308
+Node: Fortran Comments\7f549476
+Node: Fortran Columns\7f553074
+Node: Fortran Abbrev\7f554497
+Node: Asm Mode\7f555406
+Node: Running\7f555958
+Node: Compilation\7f556928
+Node: Lisp Modes\7f561778
+Node: Lisp Libraries\7f563051
+Node: Loading\7f563605
+Node: Compiling Libraries\7f568065
+Node: Mocklisp\7f570956
+Node: Lisp Eval\7f571633
+Node: Lisp Debug\7f575273
+Node: Lisp Interaction\7f580700
+Node: External Lisp\7f582055
+Node: Packages\7f584129
+Node: Package Terminology\7f584870
+Node: Using Packages\7f586228
+Node: Building Packages\7f595106
+Node: Abbrevs\7f597628
+Node: Defining Abbrevs\7f599828
+Node: Expanding Abbrevs\7f602275
+Node: Editing Abbrevs\7f604977
+Node: Saving Abbrevs\7f606850
+Node: Dynamic Abbrevs\7f608805
+Node: Picture\7f610107
+Node: Basic Picture\7f612540
+Node: Insert in Picture\7f614825
+Node: Tabs in Picture\7f616247
+Node: Rectangles in Picture\7f617768
+Node: Sending Mail\7f619676
+Node: Mail Format\7f621387
+Node: Mail Headers\7f622737
+Node: Mail Mode\7f629145
+Node: Reading Mail\7f632758
+Node: Calendar/Diary\7f634333
+Node: Calendar Motion\7f636005
+Node: Calendar Unit Motion\7f636888
+Node: Move to Beginning or End\7f639211
+Node: Specified Dates\7f640344
+Node: Scroll Calendar\7f641232
+Node: Mark and Region\7f643023
+Node: General Calendar\7f644929
+Node: LaTeX Calendar\7f646537
+Node: Holidays\7f648551
+Node: Sunrise/Sunset\7f651653
+Node: Lunar Phases\7f654692
+Node: Other Calendars\7f656077
+Node: Calendar Systems\7f657564
+Node: To Other Calendar\7f660675
+Node: From Other Calendar\7f662666
+Node: Mayan Calendar\7f664971
+Node: Diary\7f668166
+Node: Diary Commands\7f669915
+Node: Format of Diary File\7f673238
+Node: Date Formats\7f676108
+Node: Adding to Diary\7f678682
+Node: Special Diary Entries\7f680313
+Node: Calendar Customization\7f685652
+Node: Calendar Customizing\7f686514
+Node: Holiday Customizing\7f689749
+Node: Date Display Format\7f696236
+Node: Time Display Format\7f697194
+Node: Daylight Savings\7f698332
+Node: Diary Customizing\7f701520
+Node: Hebrew/Islamic Entries\7f706141
+Node: Fancy Diary Display\7f709481
+Node: Included Diary Files\7f711397
+Node: Sexp Diary Entries\7f712378
+Node: Appt Customizing\7f717468
+Node: Sorting\7f718514
+Node: Shell\7f723320
+Node: Single Shell\7f724613
+Node: Interactive Shell\7f726227
+Node: Shell Mode\7f729992
+Node: Terminal emulator\7f732483
+Node: Term Mode\7f734792
+Node: Paging in Term\7f735706
+Node: Narrowing\7f736504
+Node: Hardcopy\7f738454
+Node: Recursive Edit\7f739426
+Node: Dissociated Press\7f742413
+Node: CONX\7f744976
+Node: Amusements\7f746000
+Node: Emulation\7f746480
+Node: Customization\7f748340
+Node: Minor Modes\7f750156
+Node: Variables\7f751788
+Node: Examining\7f753744
+Node: Easy Customization\7f755205
+Node: Customization Groups\7f756219
+Node: Changing an Option\7f759148
+Node: Face Customization\7f765418
+Node: Specific Customization\7f767182
+Node: Edit Options\7f769789
+Node: Locals\7f771373
+Node: File Variables\7f774552
+Node: Keyboard Macros\7f779102
+Node: Basic Kbd Macro\7f781273
+Node: Save Kbd Macro\7f783205
+Node: Kbd Macro Query\7f784863
+Node: Key Bindings\7f786805
+Node: Keymaps\7f787679
+Node: Rebinding\7f791529
+Node: Interactive Rebinding\7f792228
+Node: Programmatic Rebinding\7f794417
+Node: Key Bindings Using Strings\7f797224
+Node: Disabling\7f798851
+Node: Syntax\7f800630
+Node: Syntax Entry\7f801511
+Node: Syntax Change\7f805595
+Node: Init File\7f807764
+Node: Init Syntax\7f809228
+Node: Init Examples\7f811579
+Node: Terminal Init\7f815769
+Node: Audible Bell\7f817506
+Node: Faces\7f820937
+Node: Frame Components\7f825779
+Node: X Resources\7f826224
+Node: Geometry Resources\7f827883
+Node: Iconic Resources\7f830331
+Node: Resource List\7f830803
+Node: Face Resources\7f837310
+Node: Widgets\7f840987
+Node: Menubar Resources\7f841926
+Node: Quitting\7f843440
+Node: Lossage\7f846418
+Node: Stuck Recursive\7f847062
+Node: Screen Garbled\7f847768
+Node: Text Garbled\7f848902
+Node: Unasked-for Search\7f849541
+Node: Emergency Escape\7f850326
+Node: Total Frustration\7f852105
+Node: Bugs\7f852736
+Node: Glossary\7f862297
+Node: Manifesto\7f893951
+Node: Key Index\7f917428
+Node: Command Index\7f943355
+Node: Variable Index\7f985941
+Node: Concept Index\7f1002027
 \1f
 End Tag Table
index a8f9c3b..80127b0 100644 (file)
@@ -428,9 +428,9 @@ hierarchies: the hierarchy where XEmacs was or will be installed, and
 the one where it is being built.)  Such a directory containing a
 hierarchy is called a "root".  Whenever this section refers to a
 directory using the shorthand `<root>', it means that XEmacs searches
-for it under all hierarchies under all hierarchies XEmacs was able to
-scrounge up.  In a running XEmacs, the hierarchy roots are stored in
-the variable `emacs-roots'.
+for it under all hierarchies XEmacs was able to scrounge up.  In a
+running XEmacs, the hierarchy roots are stored in the variable
+`emacs-roots'.
 
 Package Hierarchies
 -------------------
@@ -468,8 +468,8 @@ hierarchy.
    It is possible to specify at configure-time the location of the
 various package hierarchies with the `--package-path' option to
 configure.  The early, late, and last components of the package path
-are separated by double instead of single colons.  If three components
-are present, they are locate the early, late, and last package
+are separated by double instead of single colons.  If all three
+components are present, they locate the early, late, and last package
 hierarchies respectively.  If two components are present, they locate
 the early and late hierarchies.  If only one component is present, it
 locates the late hierarchy.  At run time, the package path may also be
index f43814a..75997b9 100644 (file)
@@ -1030,7 +1030,7 @@ complete absence of warranty for XEmacs.  `C-h n' (`view-emacs-news')
 displays the file `xemacs/etc/NEWS', which contains documentation on
 XEmacs changes arranged chronologically.  `C-h F' (`xemacs-local-faq')
 displays local version of the XEmacs
-frequentliy-answered-questions-list.  `C-h t' (`help-with-tutorial')
+frequently-answered-questions-list.  `C-h t' (`help-with-tutorial')
 displays the learn-by-doing XEmacs tutorial. `C-h C-c'
 (`describe-copying') displays the file `xemacs/etc/COPYING', which
 tells you the conditions you must obey in distributing copies of
index 7abe91d..cf05b9a 100644 (file)
@@ -1,3 +1,34 @@
+2000-10-04  Martin Buchholz <martin@xemacs.org>
+
+       * XEmacs 21.2.36 is released.
+
+2000-09-30  Martin Buchholz  <martin@xemacs.org>
+
+       * gnuserv.c (main): Warning removal.
+
+2000-09-27  Martin Buchholz  <martin@xemacs.org>
+
+       * ellcc.c: Make global variables static.  Avoids warnings on AIX.
+
+       * fakemail.c (make_file_preface): Use standard type time_t.
+       Actually check that the 25th char returned from ctime is '\n'.
+
+2000-09-19  Martin Buchholz  <martin@xemacs.org>
+
+       * *: Spelling mega-patch
+
+2000-09-12  Martin Buchholz  <martin@xemacs.org>
+
+       * gnuclient.c (main):
+       * hexl.c (usage):
+       Use `Usage', not `usage', in Usage messages.
+
+2000-07-15  Ben Wing  <ben@xemacs.org>
+
+       * etags.c (add_regex): added commented out code for use figuring
+       out Windows quoting problems.
+       * hexl.c (main): fixed warnings about possible used uninitialized.
+
 2000-07-19  Martin Buchholz <martin@xemacs.org>
 
        * XEmacs 21.2.35 is released.
index 15099ce..a34434c 100644 (file)
@@ -24,13 +24,13 @@ Boston, MA 02111-1307, USA.  */
  * exist in your home directory, containing individual mail messages in
  * separate files in the standard gosling emacs mail reader format.
  *
- * Program takes one argument: an output file.  THis file will contain
+ * Program takes one argument: an output file.  This file will contain
  * all the messages in Messages directory, in berkeley mail format.
  * If no output file is mentioned, messages are put in ~/OMAIL.
  *
  * In order to get rmail to read the messages, the resulting file must
  * be mv'ed to ~/mbox, and then have rmail invoked on them.
- * 
+ *
  * Author: Larry Kolodney, 1985
  */
 
@@ -106,7 +106,7 @@ main (int argc, char *argv[])
      fclose (cff);
     }
   fclose (mddf);
-  fclose (mfilef);    
+  fclose (mfilef);
   return 0;
 }
 
index 54a2c8b..53bd780 100644 (file)
@@ -61,6 +61,7 @@ See the samples for more details.
 #include <config.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <stddef.h>
 #include <string.h>
 #include <ctype.h>
 #include <errno.h>
@@ -120,16 +121,19 @@ static void do_init_mode (void);
 #define ELLCC_LINK_MODE         1
 #define ELLCC_INIT_MODE         2
 
-int ellcc_mode = ELLCC_COMPILE_MODE;
-char *progname;
-char *mod_name = (char *)0, *mod_version = (char *)0, *mod_title = (char *)0;
-char *mod_output = (char *)0;
-int verbose = 0;
-char **exec_argv;
-int exec_argc = 1, *exec_args;
-int real_argc = 0;
-int prog_argc;
-char **prog_argv;
+static int ellcc_mode = ELLCC_COMPILE_MODE;
+static char *progname;
+static char *mod_name = NULL;
+static char *mod_version = NULL;
+static char *mod_title = NULL;
+static char *mod_output = NULL;
+static int verbose = 0;
+static char **exec_argv;
+static int exec_argc = 1;
+static int *exec_args;
+static int real_argc = 0;
+static int prog_argc;
+static char **prog_argv;
 
 /*
  * We allow the user to over-ride things in the environment
index d3cff3f..ce7d1c2 100644 (file)
@@ -4840,6 +4840,10 @@ add_regex (regexp_pattern, ignore_case, lang)
   patbuf->buffer = NULL;
   patbuf->allocated = 0;
 
+#if 0 /* useful when debugging windows quoting convention problems */
+  printf ("Compiling regex pattern: %s\n", regexp_pattern);
+#endif
+
   err = re_compile_pattern (regexp_pattern, strlen (regexp_pattern), patbuf);
   if (err != NULL)
     {
index 0bf4ca4..a074fa8 100644 (file)
@@ -302,7 +302,7 @@ static line_list
 make_file_preface (void)
 {
   char *the_string, *temp;
-  long idiotic_interface;
+  time_t idiotic_interface;
   long prefix_length;
   long user_length;
   long date_length;
@@ -313,7 +313,8 @@ make_file_preface (void)
   the_date = ctime (&idiotic_interface);
   /* the_date has an unwanted newline at the end */
   date_length = strlen (the_date) - 1;
-  the_date[date_length] = '\0';
+  if (the_date[date_length] == '\n')
+    the_date[date_length] = '\0';
 #ifdef WIN32_NATIVE
   temp = "(null)";
 #else
index 0f57c85..58588f6 100644 (file)
@@ -225,7 +225,7 @@ filename_expand (char *fullpath, char *filename)
       /* Assume relative Unix style path.  Get the current directory
        and prepend it.  FIXME: need to fix the case of DOS paths like
        "\foo", where we need to get the current drive. */
-      
+
       strcat (fullpath, get_current_working_directory ());
       len = strlen (fullpath);
 
@@ -461,11 +461,11 @@ main (int argc, char *argv[])
     {
       fprintf (stderr,
 #ifdef INTERNET_DOMAIN_SOCKETS
-              "usage: %s [-nw] [-display display] [-q] [-v] [-l library]\n"
+              "Usage: %s [-nw] [-display display] [-q] [-v] [-l library]\n"
                "       [-batch] [-f function] [-eval form]\n"
               "       [-h host] [-p port] [-r remote-path] [[+line] file] ...\n",
 #else /* !INTERNET_DOMAIN_SOCKETS */
-              "usage: %s [-nw] [-q] [-v] [-l library] [-f function] [-eval form] "
+              "Usage: %s [-nw] [-q] [-v] [-l library] [-f function] [-eval form] "
               "[[+line] path] ...\n",
 #endif /* !INTERNET_DOMAIN_SOCKETS */
               progname);
@@ -573,7 +573,7 @@ main (int argc, char *argv[])
                       progname);
              exit (1);
            }
-      /* Don't do disconnect_from_server becasue we have already read
+      /* Don't do disconnect_from_server because we have already read
         data, and disconnect doesn't do anything else. */
 #ifndef INTERNET_DOMAIN_SOCKETS
          if (connect_type == (int) CONN_IPC)
index f792f74..419baa8 100644 (file)
@@ -889,7 +889,7 @@ main (int argc, char *argv[])
       {
        perror(progname);
        fprintf(stderr,"%s: unable to select\n",progname);
-       exit(1);
+       return 1;
       } /* if */
 
 #ifdef UNIX_DOMAIN_SOCKETS
@@ -905,9 +905,7 @@ main (int argc, char *argv[])
     if (FD_ISSET(fileno(stdin), &rmask))      /* from stdin (gnu process) */
       handle_response();
 #endif /* NOT SYSV_IPC */
-  } /* while */
-
-  return 0;
+  } /* while (1) */
 } /* main */
 
 #endif /* SYSV_IPC || UNIX_DOMAIN_SOCKETS || INTERNET_DOMAIN_SOCKETS */
index b254d85..2389bad 100644 (file)
@@ -149,7 +149,7 @@ main (int argc, char *argv[])
 #endif
          for (;;)
            {
-             register int i, c, d;
+             register int i, c = 0, d;
 
 #define hexchar(x) (isdigit (x) ? x - '0' : x - 'a' + 10)
 
@@ -195,7 +195,7 @@ main (int argc, char *argv[])
          string[17] = '\0';
          for (;;)
            {
-             register int i, c;
+             register int i, c = 0;
 
              for (i=0; i < 16; ++i)
                {
@@ -246,6 +246,6 @@ main (int argc, char *argv[])
 void
 usage (void)
 {
-  (void) fprintf (stderr, "usage: %s [-de] [-iso]\n", progname);
+  fprintf (stderr, "Usage: %s [-de] [-iso]\n", progname);
   exit (1);
 }
index 31b9379..ed02e6e 100644 (file)
@@ -1,10 +1,10 @@
-/* 
-   
-   
+/*
+
+
    PROPOSAL FOR HOW THIS ALL OUGHT TO WORK
    this isn't implemented yet, but this is the plan-in-progress
 
-   
+
    In general, it's accepted that the best way to internationalize is for all
    messages to be referred to by a symbolic name (or number) and come out of a
    table or tables, which are easy to change.
    something has gone wrong.  (Except to do things like remove assumptions
    about the order of words within a sentence, or how pluralization works.)
 
-   There are two parts to the task of displaying translated strings to the 
+   There are two parts to the task of displaying translated strings to the
    user: the first is to extract the strings which need to be translated from
    the sources; and the second is to make some call which will translate those
    strings before they are presented to the user.
-   
+
    The old way was to use the same form to do both, that is, GETTEXT() was both
    the tag that we searched for to build a catalog, and was the form which did
    the translation.  The new plan is to separate these two things more: the
    already, and the translation will get done in some more centralized, lower
    level place.
 
-   This program (make-msgfile.c) addresses the first part, extracting the 
+   This program (make-msgfile.c) addresses the first part, extracting the
    strings.
-   
+
    For the emacs C code, we need to recognize the following patterns:
-   
+
      message ("string" ... )
      error ("string")
      report_file_error ("string" ... )
      signal_simple_error ("string" ... )
      signal_simple_error_2 ("string" ... )
-     
+
      build_translated_string ("string")
      #### add this and use it instead of build_string() in some places.
-     
+
      yes_or_no_p ("string" ... )
      #### add this instead of funcalling Qyes_or_no_p directly.
 
      barf_or_query_if_file_exists      #### restructure this
      check all callers of Fsignal      #### restructure these
      signal_error (Qerror ... )                #### change all of these to error()
-     
+
      And we also parse out the `interactive' prompts from DEFUN() forms.
-     
+
      #### When we've got a string which is a candidate for translation, we
      should ignore it if it contains only format directives, that is, if
      there are no alphabetic characters in it that are not a part of a `%'
      directive.  (Careful not to translate either "%s%s" or "%s: ".)
 
    For the emacs Lisp code, we need to recognize the following patterns:
-   
+
      (message "string" ... )
      (error "string" ... )
      (format "string" ... )
      (read-file-name "string" ... )
      (temp-minibuffer-message "string")
      (query-replace-read-args "string" ... )
-     
+
    I expect there will be a lot like the above; basically, any function which
    is a commonly used wrapper around an eventual call to `message' or
    `read-from-minibuffer' needs to be recognized by this program.
 
 
      (dgettext "domain-name" "string")         #### do we still need this?
-     
+
      things that should probably be restructured:
        `princ' in cmdloop.el
        `insert' in debug.el
        face-interactive
        help.el, syntax.el all messed up
-     
+
 
    Menu descriptors: one way to extract the strings in menu labels would be
    to teach this program about "^(defvar .*menu\n" forms; that's probably
 
      "string" ... ;###translate
 
-   where the magic token ";###translate" on a line means that the string 
-   constant on this line should go into the message catalog.  This is analagous
+   where the magic token ";###translate" on a line means that the string
+   constant on this line should go into the message catalog.  This is analogous
    to the magic ";###autoload" comments, and to the magic comments used in the
    EPSF structuring conventions.
 
   translations, there are hooks in a small number of low level places in
   emacs.
 
-  Assume the existence of a C function gettext(str) which returns the 
+  Assume the existence of a C function gettext(str) which returns the
   translation of `str' if there is one, otherwise returns `str'.
 
   - message() takes a char* as its argument, and always filters it through
   Solving the "translating too much" problem:
   The concern has been raised that in this situation:
    - "Help" is a string for which we know a translation;
-   - someone visits a file called Help, and someone does something 
+   - someone visits a file called Help, and someone does something
      contrived like (error buffer-file-name)
   then we would display the translation of Help, which would not be correct.
   We can solve this by adding a bit to Lisp_String objects which identifies
   them as having been read as literal constants from a .el or .elc file (as
-  opposed to having been constructed at run time as it would in the above 
+  opposed to having been constructed at run time as it would in the above
   case.)  To solve this:
 
     - Fmessage() takes a lisp string as its first argument.
@@ -306,7 +306,7 @@ void scan_file (char *filename)
   else
     process_Lisp_file ();
   fputc ('\n', outfile);
-  
+
   fclose (infile);
 }
 
index ade3a4c..a37b66e 100644 (file)
@@ -1,3 +1,642 @@
+2000-10-04  Martin Buchholz <martin@xemacs.org>
+
+       * XEmacs 21.2.36 is released.
+
+2000-09-22  Martin Buchholz  <martin@xemacs.org>
+
+       * byte-optimize.el (byte-optimize-lapcode): Add an optimizer pass.
+       Optimize the compiled-function-constants vector by byte-code
+       reference counts.
+
+2000-09-25  Robert Pluim  <rpluim@bigfoot.com>
+
+       * build-report.el (build-report-delete-regexp): quote value in
+       defcustom
+
+2000-09-24  Adrian Aichner  <aichner@ecf.teradyne.com>
+
+       * build-report.el (build-report): Don't bind srcdir which we don't
+       use in `multiple-value-bind' to avoid the only byte-compiler
+       warning.
+
+2000-09-23  Adrian Aichner  <aichner@ecf.teradyne.com>
+
+       * build-report.el: Requires cl and custom now.
+       build-report-version is determined by XEmacs version -- remove
+       build-report-version*.
+       * build-report.el (build-report-version): Removed.
+       * build-report.el (build-report-installation-version-regexp): New.
+       * build-report.el (build-report-version-file-regexp): New.
+       * build-report.el (build-report-installation-srcdir-regexp): New.
+       * build-report.el (build-report-destination): Offer
+       xemacs-build-reports and xemacs-beta.
+       * build-report.el (build-report-keep-regexp): Adjusted.
+       * build-report.el (build-report-delete-regexp): Adjusted.
+       * build-report.el (build-report-make-output-dir): New.
+       * build-report.el (build-report-installation-file): Replace use of
+       `concat' with `expand-file-name'.
+       * build-report.el (build-report-make-output-file): Removed.
+       * build-report.el (build-report-make-output-files): New.
+       * build-report.el (build-report-subject): Identify as
+       user-variable with "*...".
+       * build-report.el (build-report-prompts): Ditto.
+       * build-report.el (build-report-version-file): New.
+       * build-report.el (build-report-file-encoding): Identify as
+       user-variable with "*...".
+       * build-report.el (build-report-make-output-get): New.
+       * build-report.el (build-report-insert-header): Report
+       emacs-version and system-configuration instead of
+       build-report-version.
+       * build-report.el (build-report-insert-make-output): Add file
+       argument.
+       * build-report.el (build-report-insert-installation-file):
+       Re-indent.
+       * build-report.el (build-report-keep): Change docstring,
+       re-indent.
+       * build-report.el (build-report-delete): Ditto.
+       * build-report.el (build-report-installation-data): New.
+       * build-report.el (build-report-version-file-data): New.
+
+2000-09-20  Martin Buchholz  <martin@xemacs.org>
+
+       * byte-optimize.el (byte-optimize-lapcode):
+       Fix the optimization of using the first 5 elements of the
+       constants vector for variables.
+       (byte-optimize-lapcode): Fix another ancient broken optimization.
+
+2000-09-19  Martin Buchholz  <martin@xemacs.org>
+
+       * *: Spelling mega-patch
+
+2000-09-19  Martin Buchholz  <martin@xemacs.org>
+
+       * easymenu.el: doc fixes.
+       (easy-menu-do-define): Use backquote.
+       (easy-menu-change): 
+       (easy-menu-add): 
+       `when' seems much clearer than `if' here.
+       (easy-menu-remove):
+       (easy-menu-add-item): 
+       (easy-menu-item-present-p): 
+       (easy-menu-remove-item): 
+       Wrap using (when (featurep 'menubar) ...)
+
+2000-09-16  Martin Buchholz  <martin@xemacs.org>
+
+       * bytecomp.el (displaying-byte-compile-warnings):
+       Revert Ben's change to this function below so that the compile log
+       is displayed properly for users of the "popper" package.
+
+2000-09-12  Martin Buchholz  <martin@xemacs.org>
+
+       * window.el (save-selected-window): Use backquote.
+
+       * bytecomp.el (byte-compile-file-form-defvar-or-defconst): 
+       Renamed from `byte-compile-file-form-defvar'.
+       * bytecomp.el (byte-compile-defvar-or-defconst):
+       Only cons onto current-load-list in top-level forms.
+       Else this leaks a cons cell every time a defun is called.
+       Renamed from `byte-compile-defvar', for clarity.
+       Warn when docstring of defvar is not a string.
+       Use consistent error messages.
+       Better comments.
+
+2000-09-11  Martin Buchholz  <martin@xemacs.org>
+
+       * simple.el (set-variable):
+       Remove unneeded defvar by rearranging order of let* forms.
+
+       * mule/mule-ccl.el (ccl-get-next-code):
+       * menubar-items.el (bookmark-menu-filter): 
+       (language-environment-menu-filter): 
+       (tutorials-menu-filter): 
+       * toolbar-items.el (toolbar-compile):
+       * byte-optimize.el (disassemble-offset):
+       Use (declare (special ...)) instead of `defvar'.
+
+       * cl-macs.el (cl-do-proclaim):
+       Fix (declare (special ...)) warning suppression syntax.
+
+2000-07-22  Golubev I. N. <gin@mo.msk.ru>
+
+       * info.el (Info-tag-table-marker):
+       (Info-tag-table-buffer):
+       (Info-find-file-node):
+       (Info-read-subfile):
+       (Info-build-node-completions):
+       (Info-search):
+       (Info-mode):
+       Multiple info buffer support.
+
+2000-08-28  Oscar Figueiredo  <oscar@cpe.fr>
+
+       * ldap.el (ldap-decode-entry): New defun
+       (ldap-search-entries): Use it in order to decode DN-prefixed
+       entries properly
+
+2000-08-23  Daniel Pittman <daniel@danann.net>
+
+       * mule/mule-cmds.el (coding-system-change-eol-conversion):
+       Use `eq', not `=', to compare symbols.
+
+2000-07-30  Ben Wing  <ben@xemacs.org>
+
+       * bytecomp.el (byte-compile-report-error):
+       * bytecomp.el (displaying-byte-compile-warnings):
+       if stack-trace-on-error is set, send out a backtrace when
+       an error is encountered that stops byte compilation.  this
+       should make it much much easier to track down those curious
+       problems.  also undo the kludge of using a separate "*Show*"
+       buffer for display when there's a temp-buffer-show-function;
+       we can avoid this by just being a little smarter.
+       
+       * dialog-items.el:
+       * dialog-items.el (search-dialog-regexp): New.
+       * dialog-items.el (search-dialog-callback):
+       * dialog-items.el (make-search-dialog):
+       add a regexp option to the dialog and clean up a bit.
+       
+       * dialog.el:
+       * dialog.el (yes-or-no-p-dialog-box):
+       * dialog.el (get-dialog-box-response):
+       * dialog.el (make-dialog-box):
+       * dialog.el (dialog-box-finish): New.
+       * dialog.el (dialog-box-cancel): New.
+       * dialog.el (internal-make-dialog-box-exit): New.
+       implement [properly!] the :modal property of the new dialog box
+       interface.  this is the first time xemacs has ever had *proper*
+       modal dialog boxes, giving the standard window-system feedback.
+       (e.g. under windows, clicking on a disabled frame causes a beep
+       and makes the dialog box flash three times.)
+       
+       * dragdrop.el: header keyword frobbing.
+       
+       * dumped-lisp.el (preloaded-file-list):
+       renamed winnt.el to win32-native.el.
+       
+       * faces.el (face-property):
+       * faces.el (set-face-property):
+       * faces.el (frob-face-property):
+       * faces.el (frob-face-font-2):
+       * faces.el (make-face-bold):
+       * faces.el (make-face-italic):
+       * faces.el (make-face-bold-italic):
+       * faces.el (make-face-unbold):
+       * faces.el (make-face-unitalic):
+       * faces.el (make-face-smaller):
+       * faces.el (make-face-larger):
+       clean up the implementation of these so that window-system-specific
+       methods are called only on objects belonging to that window system.
+       previously, you could have [e.g.] mswindows-make-face-bold called
+       on font object of device type `stream', which is not good and
+       explains the subtle errors Adrian was getting when byte-compiling
+       something that required 'term. (Adrian, now you can use stack-trace-
+       on-error to find the exact place where things are going wrong instead
+       of having to laboriously binary-search your way through.)
+       
+       * finder.el (finder-known-keywords):
+       cleaned up -- properly sorted, clarified the meanings of many of
+       the keywords, and added a few -- mswin, gui, content, build, www,
+       user, services.  the last two try to distinguish between a package
+       that's used directly by the user, and a package that provides
+       support services to other packages.
+       
+       * font-lock.el (lisp-font-lock-keywords-2):
+       update list of lisp control structures to include everything,
+       including new ones i introduced.
+       
+       * gutter.el: header keyword frobbing.
+       
+       * isearch-mode.el (isearch-ring-adjust1): M-p to recall the most
+       recent isearch element was not doing so!  you got the second-most-
+       recent instead.
+
+       * lisp-mode.el (construct-lisp-mode-menu):
+       more menubar cleanups.
+       * lisp-mode.el (with-selected-window):
+       make it indent properly.
+       
+       * menubar-items.el (default-menubar): lots of menubar cleanups.
+       rearranged the options menu the most, e.g. splitting up the
+       Keyboard/Mouse menu into a new Editing menu and combining the
+       separate Scrollbar/Gutter/Toolbar submenus into Display.
+       Got rid of General, moved items to Editing or new Troubleshooting.
+       Moved Packages to Tools; doesn't seem to belong under Options.
+       Added stuff to the Cmds menu, e.g. Change Case.
+
+       NB please don't complain about these periodic menubar changes.
+       Anything like this is necessarily incremental in its construction
+       -- By constant use you gradually become more and more aware of
+       better and better ways to group menu items.  When we eventually
+       move the options menu to a property sheet, the existing structure
+       will probably be preserved fairly well.
+       
+       * minibuf.el (next-history-element): fix problems with pressing
+       down arrow in repeat-complex-command.
+
+       * modeline.el:
+       * modeline.el (modeline-3d-p): New.
+       added custom variable for controlling the 3d modeline.  the
+       corresponding Options item has been present for a long time,
+       but commented out with "fix me!" comments.  it's fixed now.
+       
+       * obsolete.el (add-menu):
+       remove bogus gettexts.
+       
+       * process.el (shell-quote-argument):
+       handle this correctly under Windows native with COMMAND.COM/CMD.EXE.
+       For bash under Windows native, see below.
+       
+       * simple.el:
+       * simple.el (display-warning-buffer):
+       Fixed the handling of warning display to eliminate the annoying
+       *Show* buffer, like was done for byte-compiler output above.
+       
+       * simple.el (debug-print): New.
+       Simple function for sending debug messages to the console and/or
+       other debug places.
+
+       * subr.el (replace-in-string):
+       Rewrite this function to avoid N^2 behavior with large strings --
+       catastrophic with the new Windows selection code! (Apparently the
+       author of this function didn't realize there was a fun
+       replace-match that could make his life much easier, because we
+       duplicated the entire logic.  The new version is smaller, easier
+       to understand, much more robust, and has extended features --
+       those of replace-match.)
+       
+       * window.el:
+       * window.el (with-selected-window): New.
+       An obvious complement to the existing `with-selected-frame' and
+       `with-current-buffer'.
+
+       * win32-native.el: Renamed from winnt.el.
+       Added a great deal of stuff for properly handling process quoting,
+       somewhat modeled on Kirill's original model (which i later threw
+       away).  We should now finally have correctly working process arg
+       quoting/dequoting so that the final app gets exactly what we
+       intended.  Because the mechanism is in Lisp, it's easily
+       extendible. (For those running bash and running the native
+       version, I tried hard to do what I thought was correct.  But more
+       thought is needed, and ideally the volunteer work of people with
+       these configurations that they generally run on.)
+       
+       * x-font-menu.el (x-font-menu-font-data):
+       Put in defvar's to fix byte-compiler warnings.
+
+2000-08-01 Alastair J. Houghton <ajhoughton@lineone.net>
+
+       * select.el (selection-coercion-alist): Initialise.
+       * select.el (select-coerce-to-text): New.
+       * select.el (select-coerce): New.
+       New functions to perform type and value coercion.
+
+       * select.el (select-buffer-killed-default): Keep data if it was
+       on the clipboard.
+
+2000-08-02  Martin Buchholz  <martin@xemacs.org>
+
+       * menubar-items.el (default-menubar): Fix typo.
+       (default-menubar): `lambda' was mispelled as `lamda'.
+
+2000-07-31  Yoshiki Hayashi  <yoshiki@xemacs.org>
+
+       * window.el (shrink-window-if-larger-than-buffer): Remove
+       edge checking code.
+
+2000-07-31  Yoshiki Hayashi  <yoshiki@xemacs.org>
+
+       * paths.el (gnus-local-domain): Removed.
+       (gnus-local-organization): Ditto.
+       (gnus-startup-file): Ditto.
+
+2000-07-13  Yoshiki Hayashi  <yoshiki@xemacs.org>
+
+       * files.el (auto-mode-alist): Add .spec for RPM.
+
+2000-07-31  Andy Piper  <andy@xemacs.org>
+       
+       * gutter-items.el (update-tab-in-gutter): deprecate :properties.
+
+2000-07-31  Yoshiki Hayashi  <yoshiki@xemacs.org>
+
+       * dragdrop.el (experimental-dragdrop-drop-url-default): Use function
+       browse-url.
+       * help.el (xemacs-www-page): Ditto.
+       (xemacs-www-faq): Ditto.
+       * menubar-items.el (default-menubar): Ditto.
+
+       * wid-edit.el (widget-url-link-action): Ditto.
+       From: Kenichi OKADA <okada@opaopa.org>.
+
+2000-07-31  Martin Buchholz  <martin@xemacs.org>
+
+       * finder.el (finder-commentary): Add autoload cookie.
+
+2000-07-28  Adrian Aichner  <aichner@ecf.teradyne.com>
+
+       * files.el (insert-file-contents-literally): Fix second let
+       binding for `coding-system-for-read' to `coding-system-for-write'
+       as suggested by Dan Holmsand <dan@innehallsbolaget.com>.
+
+1999-06-15  Jan Vroonhof  <vroonhof@math.ethz.ch>
+
+       * files.el (insert-file-contents-literally): Use binary coding
+       system (from Morioka san).
+       (insert-file-contents-literally): Make file-name-handler method.
+
+2000-07-26  Martin Buchholz  <martin@xemacs.org>
+
+       * cl-macs.el (get-selection): Add defsetf.
+
+2000-07-25  Steve Youngs  <youngs_s@ozlinx.com.au>
+
+       * x-init.el (x-activate-region-as-selection): replace obsolete
+       function x-own-selection with own-selection.
+       (ow-find): replace obsolete functions x-get-selection and
+       x-get-clipboard with get-selection and get-clipboard.
+       (init-post-x-win): replace obsolete function x-disown-selection
+       with disown-selection.
+
+2000-07-20  Mike Sperber  <mike@xemacs.org>
+
+       * startup.el (load-user-init-file): Only try to load init file if
+       it exists.
+
+2000-07-10  Andy Piper  <andy@xemacs.org>
+
+       * dialog-items.el: sync with Ben's patch.
+       
+       * gutter-items.el (buffers-tab-switch-to-buffer): remove now-bogus
+       comment.
+       (progress-text-glyph): deleted.
+       (progress-layout-glyph): make completely minimal.
+       (progress-gauge-glyph): ditto.
+       (progress-display-style): fix to handle dynamic instantiator
+       changes.
+       (progress-text-instantiator): new.
+       (progress-layout-instantiator): new.
+       (progress-gauge-instantiator): new.
+       (set-progress-display-instantiator): renamed and changed from
+       set-progress-display-style.
+       (progress-abort-glyph): use instantiator not glyph.
+       (append-progress-display): use set-progress-display-instantiator
+       and set-glyph-image.
+       (abort-progress-display): ditto.
+       (raw-append-progress-display): ditto.
+
+2000-07-20  Ben Wing  <ben@xemacs.org>
+
+       * code-files.el: Move Mule-specific code to mule-coding.el.
+
+2000-07-15  Ben Wing  <ben@xemacs.org>
+
+        * autoload.el:
+        Fixed comments.
+
+        * cmdloop.el:
+        * cmdloop.el (yes-or-no-p):
+        * cmdloop.el (y-or-n-p):
+        Make these functions use should-use-dialog-box-p and not be
+        overridden in dialog.el.
+
+        * cus-dep.el:
+        * cus-dep.el (Custom-make-dependencies): Removed.
+        * cus-dep.el (Custom-make-dependencies-1): New.
+        * cus-dep.el (Custom-make-one-dependency): New.
+        New entry point for use in Makefiles, to avoid excessive
+        invocations.
+
+        * cus-edit.el (custom-variable-reset-saved):
+        * cus-edit.el (custom-variable-reset-standard):
+        * cus-edit.el (custom-save-resets):
+        Fix bytecompiler warnings.
+
+        * dialog.el:
+        * dialog.el (yes-or-no-p-dialog-box):
+        * dialog.el (yes-or-no-p-maybe-dialog-box): Removed.
+        * dialog.el (y-or-n-p-maybe-dialog-box): Removed.
+        * dialog.el (get-dialog-box-response):
+        * dialog.el (message-or-box):
+        * dialog.el (make-dialog-box):
+        * dialog.el (popup-dialog-box): New.
+        Avoid yes-or-no-p bogosities.
+        Create a general function `make-dialog-box' to encapsulate all
+        dialog box methods; easily extendible.  popup-dialog-box now obsolete.
+
+        * dumped-lisp.el (preloaded-file-list):
+        Add dialog-items.  Clean up.  Group files by types.
+
+        * easymenu.el (easy-menu-add):
+        * easymenu.el (easy-menu-remove):
+        Account for accelerators.
+
+        * extents.el:
+        * extents.el (extent-list): New args, like in map-extents.
+        * extents.el (extent-at-event): New.
+        * extents.el (extents-at-event): New.
+
+        * font-lock.el:
+        * font-lock.el (font-lock-mode):
+        * font-lock.el (font-lock-default-fontify-buffer):
+        * font-lock.el (font-lock-default-unfontify-region):
+        * font-lock.el (font-lock-fontify-syntactically-region):
+        * font-lock.el (font-lock-fontify-keywords-region):
+        Use new progress-feedback names.
+
+        * font-lock.el (java-font-lock-identifier-regexp):
+        * font-lock.el (java-font-lock-class-name-regexp):
+        Fix bytecompiler warnings.
+
+        * gutter-items.el:
+        * gutter-items.el (progress-display-use-echo-area): Removed.
+        * gutter-items.el (progress-feedback-use-echo-area): New.
+        * gutter-items.el (progress-display-popup-period): Removed.
+        * gutter-items.el (progress-feedback-popup-period): New.
+        * gutter-items.el (set-progress-display-style): Removed.
+        * gutter-items.el (set-progress-feedback-style): New.
+        * gutter-items.el (progress-display-style): Removed.
+        * gutter-items.el (progress-feedback-style): New.
+        * gutter-items.el (progress-stack):
+        * gutter-items.el (progress-displayed-p): Removed.
+        * gutter-items.el (progress-feedbacked-p): New.
+        * gutter-items.el (clear-progress-display): Removed.
+        * gutter-items.el (clear-progress-feedback): New.
+        * gutter-items.el (progress-display-clear-when-idle): Removed.
+        * gutter-items.el (progress-feedback-clear-when-idle): New.
+        * gutter-items.el (remove-progress-display): Removed.
+        * gutter-items.el (remove-progress-feedback): New.
+        * gutter-items.el (progress-display-dispatch-non-command-events): Removed.
+        * gutter-items.el (progress-feedback-dispatch-non-command-events): New.
+        * gutter-items.el (append-progress-display): Removed.
+        * gutter-items.el (append-progress-feedback): New.
+        * gutter-items.el (abort-progress-display): Removed.
+        * gutter-items.el (abort-progress-feedback): New.
+        * gutter-items.el (raw-append-progress-display): Removed.
+        * gutter-items.el (raw-append-progress-feedback): New.
+        * gutter-items.el (display-progress-display): Removed.
+        * gutter-items.el (display-progress-feedback): New.
+        * gutter-items.el (current-progress-display): Removed.
+        * gutter-items.el (current-progress-feedback): New.
+        * gutter-items.el (current-progress-display-label): Removed.
+        * gutter-items.el (current-progress-feedback-label): New.
+        * gutter-items.el (progress-display): Removed.
+        * gutter-items.el (progress-feedback): New.
+        Replace "progress-display" with "progress-feedback" globally.
+
+        * gutter-items.el (lprogress-display): Removed.
+        * gutter-items.el (progress-feedback-with-label): New.
+        Rename lprogress-display ==> progress-feedback-with-label.
+
+        * gutter-items.el (search-dialog-direction): Removed.
+        * gutter-items.el (search-dialog-text): Removed.
+        * gutter-items.el (search-dialog-callback): Removed.
+        * gutter-items.el (make-search-dialog): Removed.
+        Move to dialog-items.el.
+
+        * help.el:
+        * help.el (help-mode-quit):
+        * help.el (mode-for-help): New.
+        * help.el (help-sticky-window): New.
+        * help.el (help-window-config): New.
+        * help.el (with-displaying-help-buffer):
+        * help.el (function-at-event): New.
+        * help.el (help-symbol-regexp): New.
+        * help.el (help-symbol-run-function-1): New.
+        * help.el (help-symbol-run-function): New.
+        * help.el (help-symbol-function-context-menu): New.
+        * help.el (help-symbol-variable-context-menu): New.
+        * help.el (help-symbol-function-and-variable-context-menu): New.
+        * help.el (frob-help-extents): New.
+        * help.el (describe-function-1):
+        * help.el (variable-at-point):
+        * help.el (variable-at-event): New.
+        * help.el (describe-variable):
+        Major overhaul.  
+        - Make functions and variables be mousable.  
+        - Middle button hyperlinks.  
+        - New context-menu entries.
+
+        * keydefs.el:
+        * keydefs.el (global-map): 
+        New key bindings to move lines up and down.
+
+        * lisp-mode.el:
+        * lisp-mode.el (construct-lisp-mode-menu): New.
+        * lisp-mode.el (emacs-lisp-mode-popup-menu):
+        * lisp-mode.el (lisp-interaction-mode-menubar-menu):
+        * lisp-mode.el (emacs-lisp-mode-menubar-menu):
+        * lisp-mode.el (lisp-indent-function): Indent "flet" entries better.
+        Make popup and menubar menus be different.  Popup menu uses
+        clicked location and automatically assumes symbol under the mouse
+        for various commands.
+
+        * menubar-items.el:
+        * menubar-items.el (bookmark-menu-filter): Add accelerators.
+        * menubar-items.el (buffers-menu-omit-chars-list): Include 'd'.
+
+        * menubar-items.el (global-popup-menu): Removed.
+        * menubar-items.el (mode-popup-menu): Removed.
+        * menubar-items.el (activate-popup-menu-hook): Removed.
+        * menubar-items.el (popup-mode-menu): Removed.
+        * menubar-items.el (popup-buffer-menu): Removed.
+        * menubar-items.el (popup-menubar-menu): Removed.
+        Move to menubar.el.
+        
+        * menubar.el:
+        * menubar.el (global-popup-menu): New.
+        * menubar.el (mode-popup-menu): New.
+        * menubar.el (activate-popup-menu-hook): New.
+        * menubar.el (last-popup-menu-event): New.
+        * menubar.el (popup-mode-menu): New.
+        * menubar.el (popup-buffer-menu): New.
+        * menubar.el (popup-menubar-menu): New.
+        * menubar.el (menu-call-at-event): New.
+        Move non-content functions here.  Add support for context menu
+        items on extents.
+
+        * minibuf.el (minibuffer-history-uniquify): 
+        Typo fix.
+
+        * minibuf.el (read-file-name-1): 
+        Call new file dialog box if it exists.
+
+        * minibuf.el (mouse-rfn-setup-vars):
+        Clean up "chop" action.
+
+        * mouse.el:
+        * mouse.el (button2): Now bound to mouse-track.
+        * mouse.el (click-inside-extent-p):
+        * mouse.el (point-inside-extent-p):
+        * mouse.el (point-inside-selection-p):
+        * mouse.el (mouse-drag-or-yank): Removed.
+        * mouse.el (mouse-begin-drag-n-drop): New.
+        * mouse.el (mouse-eval-sexp):
+        * mouse.el (mouse-track-activate-strokes): New.
+        * mouse.el (mouse-track-do-activate): New.
+        * mouse.el (mouse-track):
+        * mouse.el (default-mouse-track-event-is-with-button): New.
+        * mouse.el (default-mouse-track-cleanup-hook):
+        * mouse.el (default-mouse-track-drag-hook):
+        * mouse.el (default-mouse-track-drag-up-hook):
+        * mouse.el (default-mouse-track-click-hook):
+        Merge drag-n-drop into mouse-track.
+        Add general "activate" support to replace specific button2 kludges.
+        Use "button modifier" support in mouse-track.
+
+        * package-get.el (package-get-dependencies): Fix bytecompiler warnings.
+
+        * package-ui.el:
+        * package-ui.el (pui-menu):
+        * package-ui.el (pui-popup-context-sensitive): Removed.
+        Fix bytecompiler warnings.
+        Clean up popup code a bit.
+
+        * select.el (get-selection-no-error): Fix bytecompiler warnings.
+
+        * simple.el:
+        * simple.el (transpose-lines):
+        * simple.el (transpose-line-up): New.
+        * simple.el (transpose-line-down): New.
+        * simple.el (transpose-subr):
+        * simple.el (transpose-subr-1): Removed.
+        Clean up, add functions to move lines up and down.
+
+        * startup.el (mail-host-address):
+        * startup.el (user-mail-address):
+        Customize.
+
+        * subr.el:
+        * subr.el (set-symbol-value-in-buffer): New.
+        * subr.el (error):
+        * subr.el (check-argument-type):
+        * subr.el (defined-error-p): New.
+        Add structured error support.
+
+        * toolbar-items.el (toolbar-compile):
+        Use new make-dialog-box.
+
+        * update-elc.el:
+
+        * userlock.el (ask-user-about-lock-dbox):
+        * userlock.el (ask-user-about-supersession-threat-dbox):
+        * userlock.el (ask-user-about-lock):
+        * userlock.el (ask-user-about-supersession-threat):
+        Use new make-dialog-box.
+        Add safety checks; use should use-dialog-box-p.
+
+        * window-xemacs.el:
+        * window-xemacs.el (__buffer-dedicated-frame):
+        * window-xemacs.el (buffer-dedicated-frame): New.
+        * window-xemacs.el (set-buffer-dedicated-frame): New.
+        Move dedicated-frame stuff into lisp.
+
+2000-07-18  Kirill 'Big K' Katsnelson  <kkm@dtmx.com>
+
+       * printer.el (generic-print-region): Do not require that
+       `printer-name' be set.
+       (printer-name): Commentary clarification.
+
 2000-07-19  Martin Buchholz <martin@xemacs.org>
 
        * XEmacs 21.2.35 is released.
 
 2000-04-14  Andy Piper  <andy@xemacs.org>
 
-       * gutter-items.el (make-search-dialog): avoid unneccessary futzing
+       * gutter-items.el (make-search-dialog): avoid unnecessary futzing
        by using the new widget-callback-current-channel.
        (search-dialog-callback): ditto.
 
        (select-safe-coding-system): New function.
        (set-language-info): New optional args DESCRIBE-MAP and SETUP-MAP.
        (set-language-info-alist): New optionla arg PARENTS.  Call
-       set-language-info with apropriate DESCRIBE-MAP and SETUP-MAP args.
+       set-language-info with appropriate DESCRIBE-MAP and SETUP-MAP args.
        (set-language-environment-coding-systems): New function.
 
        * mule/chinese.el: Remove setting up of
          Added interactive function `package-get-delete-package', for
          use by users for deleting a package.
 
-         Also modified to not require the prescence of efs.
+         Also modified to not require the presence of efs.
 
 1998-09-22  Hrvoje Niksic  <hniksic@srce.hr>
 
 
        * find-paths.el (paths-emacs-root-p):
          Relaxed emacs-root checking of an in-place installation to
-         also accomodate the flat layout used on MS Windows.
+         also accommodate the flat layout used on MS Windows.
 
 1998-06-29  John Jones  <jj@asu.edu>
 
@@ -5648,7 +6287,7 @@ Wed May 27, 1998  Darryl Okahata  <darrylo@sr.hp.com>
        * faces.el: move definition of xpm-color-symbols from x-faces.el
        to faces. Predicate x-get-resource on the presence of x.
 
-       * msw-faces.el: set 3d-object face rather than modeline. Specifiy
+       * msw-faces.el: set 3d-object face rather than modeline. Specify
        faces as specfier defaults.
 
        * package-get.el: don't use package-admin-add-single-file-package.
@@ -6947,7 +7586,7 @@ Sun Mar 29 1998  Andy Piper  <andyp@parallax.co.uk>
 
 1998-03-27  Kyle Jones  <kyle_jones@wonderworks.com>
 
-       * faces.el: Separated face intializations based on
+       * faces.el: Separated face initializations based on
          device classes into device type specific (tag set,
          instantiator) pairs.
 
@@ -7384,7 +8023,7 @@ Tue Feb 17 12:50:37 1998  Andy Piper  <andyp@parallax.co.uk>
 1998-02-21  Greg Klanderman  <greg@alphatech.com>
 
        * (with-displaying-help-buffer): there is no need to kill the buffer
-       if it exists, becasuse with-output-to-temp-buffer will clear it.
+       if it exists, because with-output-to-temp-buffer will clear it.
        further, killing the buffer violates the rule that
        temp-buffer-show-function, if set, has the full responsibility of
        showing the temp buffer.  killing the buffer fucks with the window
index df5627e..3ad71dd 100644 (file)
        instead of 1000.
        (find-tag-internal): Use `letf'.
        (tags-delete): Removed -- was unused.
-       (set-buffer-tag-table): Use `expland-file-name'.
+       (set-buffer-tag-table): Use `expand-file-name'.
        (get-tag-table-buffer): Use `ecase'.
        (add-to-tag-completion-table): Mark the filename messages with
        progress.
@@ -998,7 +998,7 @@ Sun Nov 01 12:00:00 1997 Jonathan Harris  <jhar@tardis.ed.ac.uk>
 
        * modes/lazy-shot.el (lazy-shot-mode): Unstall lazy-shot only if
        needed.
-       (lazy-shot-fontify-internal): Functionality put in seperate function.
+       (lazy-shot-fontify-internal): Functionality put in separate function.
        (lazy-shot-lock-extent): Use it.
        (lazy-shot-fontify-region): Dumb implementation added.
        (lazy-shot-unstall-after-fontify): Needed to disable lazy
index 0eb08b0..b303ad3 100644 (file)
@@ -559,12 +559,6 @@ and then returning foo." nil 'macro)
 
 ;;;***
 \f
-;;;### (autoloads (batch-remove-old-elc) "cleantree" "lisp/cleantree.el")
-
-(autoload 'batch-remove-old-elc "cleantree" nil nil nil)
-
-;;;***
-\f
 ;;;### (autoloads (config-value config-value-hash-table) "config" "lisp/config.el")
 
 (autoload 'config-value-hash-table "config" "\
@@ -765,7 +759,7 @@ FACE.  Nil otherwise." nil nil)
 
 (autoload 'custom-reset-faces "cus-face" "\
 Reset the value of the face to values previously defined.
-Assosiate this setting with the 'user' theme.
+Associate this setting with the 'user' theme.
 
 ARGS is defined as for `custom-theme-reset-faces'" nil nil)
 
@@ -952,7 +946,11 @@ This function pops (and moves to) the tag at the top of this stack." t nil)
 
 ;;;***
 \f
-;;;### (autoloads (finder-by-keyword) "finder" "lisp/finder.el")
+;;;### (autoloads (finder-by-keyword finder-commentary) "finder" "lisp/finder.el")
+
+(autoload 'finder-commentary "finder" "\
+Display FILE's commentary section.
+FILE should be in a form suitable for passing to `locate-library'." t nil)
 
 (autoload 'finder-by-keyword "finder" "\
 Find packages matching a given keyword." t nil)
@@ -1273,7 +1271,7 @@ Interactively set the variable on the current line." t nil)
 
 ;;;***
 \f
-;;;### (autoloads (Info-elisp-ref Info-emacs-key Info-goto-emacs-key-command-node Info-goto-emacs-command-node Info-emacs-command Info-search Info-visit-file Info-goto-node Info-batch-rebuild-dir Info-query info) "info" "lisp/info.el")
+;;;### (autoloads (Info-elisp-ref Info-emacs-key Info-goto-emacs-key-command-node Info-goto-emacs-command-node Info-emacs-command Info-search Info-visit-file Info-goto-node Info-batch-rebuild-dir Info-find-node Info-query info) "info" "lisp/info.el")
 
 (defvar Info-directory-list nil "\
 List of directories to search for Info documentation files.
@@ -1300,6 +1298,13 @@ to read a file name from the minibuffer." t nil)
 (autoload 'Info-query "info" "\
 Enter Info, the documentation browser.  Prompt for name of Info file." t nil)
 
+(autoload 'Info-find-node "info" "\
+Go to an info node specified as separate FILENAME and NODENAME.
+Look for a plausible filename, or if not found then look for URL's and
+dispatch to the appropriate fn.  NO-GOING-BACK is non-nil if
+recovering from an error in this function; it says do not attempt
+further (recursive) error recovery.  TRYFILE is ??" nil nil)
+
 (autoload 'Info-batch-rebuild-dir "info" "\
 (Re)build info `dir' files in the directories remaining on the command line.
 Use this from the command line, with `-batch';
@@ -1891,7 +1896,7 @@ If you don't like the lazy invocation of this function, you can add it to
 when they are selected for the first time.  If you add fonts to your system, 
 or if you change your font path, you can call this to re-initialize the menus." nil nil)
 
-(defun* x-font-menu-font-data (face dcache) (let* ((case-fold-search t) (domain (if font-menu-this-frame-only-p (selected-frame) (selected-device))) (name (font-instance-name (face-font-instance face domain))) (truename (font-instance-truename (face-font-instance face domain (if (featurep 'mule) 'ascii)))) family size weight entry slant) (when (string-match x-font-regexp-foundry-and-family name) (setq family (capitalize (match-string 1 name))) (setq entry (vassoc family (aref dcache 0)))) (when (and (null entry) (string-match x-font-regexp-foundry-and-family truename)) (setq family (capitalize (match-string 1 truename))) (setq entry (vassoc family (aref dcache 0)))) (when (null entry) (return-from x-font-menu-font-data (make-vector 5 nil))) (when (string-match x-font-regexp name) (setq weight (capitalize (match-string 1 name))) (setq size (string-to-int (match-string 6 name)))) (when (string-match x-font-regexp truename) (when (not (member weight (aref entry 1))) (setq weight (capitalize (match-string 1 truename)))) (when (not (member size (aref entry 2))) (setq size (string-to-int (match-string 6 truename)))) (setq slant (capitalize (match-string 2 truename)))) (vector entry family size weight slant)))
+(defun* x-font-menu-font-data (face dcache) (defvar x-font-regexp) (defvar x-font-regexp-foundry-and-family) (let* ((case-fold-search t) (domain (if font-menu-this-frame-only-p (selected-frame) (selected-device))) (name (font-instance-name (face-font-instance face domain))) (truename (font-instance-truename (face-font-instance face domain (if (featurep 'mule) 'ascii)))) family size weight entry slant) (when (string-match x-font-regexp-foundry-and-family name) (setq family (capitalize (match-string 1 name))) (setq entry (vassoc family (aref dcache 0)))) (when (and (null entry) (string-match x-font-regexp-foundry-and-family truename)) (setq family (capitalize (match-string 1 truename))) (setq entry (vassoc family (aref dcache 0)))) (when (null entry) (return-from x-font-menu-font-data (make-vector 5 nil))) (when (string-match x-font-regexp name) (setq weight (capitalize (match-string 1 name))) (setq size (string-to-int (match-string 6 name)))) (when (string-match x-font-regexp truename) (when (not (member weight (aref entry 1))) (setq weight (capitalize (match-string 1 truename)))) (when (not (member size (aref entry 2))) (setq size (string-to-int (match-string 6 truename)))) (setq slant (capitalize (match-string 2 truename)))) (vector entry family size weight slant)))
 
 ;;;***
 \f
index 965d550..f1ee483 100644 (file)
@@ -2,7 +2,7 @@
 
 ;; Copyright (C) 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc.
 ;; Copyright (C) 1995 Tinker Systems and INS Engineering Corp.
-;; Copyright (C) 1996 Ben Wing.
+;; Copyright (C) 1996, 2000 Ben Wing.
 
 ;; Author: Roland McGrath <roland@gnu.ai.mit.edu>
 ;; Keywords: maint
@@ -121,7 +121,7 @@ the section of autoloads for a file.")
                             (directory-file-name
                              (file-name-directory file))))
    "\\\\" "/"))
-  
+
 ;;;###autoload
 (defun generate-file-autoloads (file &optional funlist)
   "Insert at point a loaddefs autoload section for FILE.
@@ -360,8 +360,8 @@ generally the file named `autoload-file-name' in the directory being
 updated.")
 
 (defconst cusload-file-name "custom-load.el"
-  "Generic filename ot put custom loads into.
-Unless you are an XEmacs maintainr, it is probably unwise to change this.")
+  "Generic filename to put custom loads into.
+Unless you are an XEmacs maintainer, it is probably unwise to change this.")
 
 ;;;###autoload
 (defun update-file-autoloads (file)
@@ -542,10 +542,13 @@ on the command line."
          (goto-char (point-max))
          (insert "\n(provide '" sym ")\n")))))
 
-;; #### this function is almost identical, but subtly different,
-;; from batch-update-autoloads.  Steve, it's your responsibility to
-;; clean this up.  The two should be merged, but I'm not sure what
-;; package-creation scripts out there might be using this. --ben
+(defvar autoload-package-name nil)
+
+;; #### this function is almost identical to, but subtly different from,
+;; batch-update-autoloads.  Both of these functions, unfortunately, are
+;; used in various build scripts in xemacs-packages.  They should be
+;; merged. (However, it looks like no scripts pass more than one arg,
+;; making merging easy.) --ben
 
 ;;;###autoload
 (defun batch-update-directory ()
@@ -576,7 +579,7 @@ be used only with -batch."
     (setq command-line-args-left nil)))
 
 ;; #### i created the following.  this one and the last should be merged into
-;; batch-update-autoloads. --ben
+;; batch-update-autoloads and batch-update-one-directory. --ben
 
 ;;;###autoload
 (defun batch-update-one-directory ()
index 26b63bd..b3797f3 100644 (file)
@@ -3,8 +3,8 @@
 ;; Copyright (C) 1997 Adrian Aichner
 
 ;; Author: Adrian Aichner <adrian@xemacs.org>
-;; Date: Sun., Apr. 20, 1997, 1998, 1999.
-;; Version: 1.35
+;; Date: Sun., Apr. 20, 1997-2000.
+;; Version: $Revision: 1.5.2.6 $
 ;; Keywords: internal
 
 ;; This file is part of XEmacs.
 ;;; Code:
 
 (require 'config)
+(require 'custom)
+(require 'cl)
 (provide 'build-report)
 
-;; Due to recommendation by developers on xemacs-beta@xemacs.org,
-;; release versions are to be checked out using `co -u -kv ...'.
-(defconst build-report-version
-  "1.35"
-  "Version number of build-report.")
+;;; Constant definitions used internally by `build-report'.  These are not
+;;; anticipated to be changed by users of `build-report'.
+;;; If users do need to change the value of any of these, they need to do
+;;; it after `build-report' has been loaded (not just required).  Please
+;;; report it to the maintainers of `build-report' when you think you
+;;; need to do this.
+(defconst build-report-installation-version-regexp
+  "XEmacs\\s-+\\([0-9]+\\)\\.\\([0-9]+\\)\\(\\(-b\\|\\.\\)\\([0-9]+\\)\\)?\\s-+\\\\?\"\\([^\\\"]+\\)\\\\?\"\\s-+configured\\s-+for\\s-+`\\(.+\\)'\\."
+  "*REGEXP matching XEmacs Beta Version string in
+`build-report-installation-file' file.  This variable is used by
+`build-report-installation-data'.")
+
+(defconst build-report-version-file-regexp
+  "emacs_major_version\\s-*=\\s-*\\([0-9]+\\)
+emacs_minor_version\\s-*=\\s-*\\([0-9]+\\)
+emacs_beta_version\\s-*=\\s-*\\([0-9]+\\)?
+xemacs_codename\\s-*=\\s-*\"\\([^\"]+\\)\""
+  "*REGEXP matching XEmacs Beta Version variable assignments in
+`build-report-version-file' file.  This variable is used by
+`build-report-version-file-data'.")
+
+(defconst build-report-installation-srcdir-regexp
+  "\\s-*Where should the build process find the source code\\?\\s-*\\(.*\\)$"
+  "REGEXP matching XEmacs Beta srcdir as the first substring match in
+`build-report-installation-file' file.  This variable is used by
+`build-report-installation-data'.")
+
+;;; Customization support for build-report starts here.
 
 (defgroup build-report nil
-  "Package automating the process of sending XEmacs Build Reports."
+  "Standardizes the Creation of XEmacs Build Reports."
+  :load 'build-report
   :group 'build)
 
 (defcustom build-report-destination
-  "xemacs-build-reports@xemacs.org"
-  "The mail address XEmacs Build Reports should go to."
-  :type 'string
+  (quote ("XEmacs Build Reports List <xemacs-build-reports@xemacs.org>"
+          "XEmacs Beta List <xemacs-beta@xemacs.org>"))
+  "*The list of mail addresses XEmacs Build Reports should most likely
+go to."
+  :type '(repeat
+          :custom-show t
+          :documentation-shown t
+          string)
   :group 'build-report)
 
 (defcustom build-report-keep-regexp
-  (list
-   "make\\["
-   "error"
-   "warn"
-   "pure.*\\(space\\|size\\)"
-   "hides\\b"
-   "strange"
-   "shadowings"
-   "^Compilation"
-   "not\\s-+found")
-  "Regexp of make process output lines to keep in the report."
-  :type '(repeat regexp)
+  (quote ("^\\(cd\\|n?make\\)\\s-" "errors?" "warnings?"
+          "pure.*\\(space\\|size\\)" "hides\\b" "strange" "shadowings"
+          "^Compil\\(ing\\s-+in\\|ation\\)" "^Using" "not\\s-+found"
+          "^While\\s-+compiling.*\\(\n\\s-+.+\\)*" "^Note:"
+          "Installing" "[Ff]ile(s) copied"
+          "\\s-+tests\\s-+"))
+  "*Regexp of make process output lines to keep in the report."
+  :type '(repeat
+          :custom-show t
+          :documentation-shown t
+          regexp)
   :group 'build-report)
 
 (defcustom build-report-delete-regexp
-  (list
-   "confl.*with.*auto-inlining"
-   (concat (regexp-quote (gethash 'blddir (config-value-hash-table))) "/lisp/[^ \t\n]+ hides "))
-  "Regexp of make process output lines to delete from the report."
-  :type '(repeat regexp)
+  (quote ("confl.*with.*auto-inlining" "^Formatting:"))
+  "*Regexp of make process output lines to delete from the report."
+  :type '(repeat
+          :custom-show t
+          :documentation-shown t
+          regexp)
   :group 'build-report)
 
-(defcustom build-report-make-output-file
-  (concat (gethash 'blddir (config-value-hash-table)) "/beta.err")
-  "Filename where stdout and stderr of XEmacs make process have been stored.
-mk.err will not be created automatically. You'll have to run make with
-output redirection. I use an alias
+(defcustom build-report-make-output-dir
+  (cond 
+   ((equal system-type 'windows-nt)
+    (expand-file-name "nt"
+                      (gethash 'blddir (config-value-hash-table))))
+   (t
+    (gethash 'blddir (config-value-hash-table))))
+  "*Directory where the build report file is found.
+  If this is empty or nil, the default, it is replaced by the value of
+  the XEmacs build directory."
+  :type '(directory
+          :custom-show t
+          :documentation-shown t)
+  :group 'build-report)
+
+(defcustom build-report-make-output-files
+  (quote ("beta.err"))
+  "*List of Filenames where stdout and stderr of XEmacs make process
+have been stored.  These are relative to
+`build-report-make-output-dir`.  You'll have to run make with output
+redirection or use the `build' XEmacs package to save this output. You
+may use following alias
+
 alias mk 'make \!* >>&\! \!$.err &'
-for that, so that I get beta.err went I run `mk beta'."
-  :type 'file
+
+under csh, so that you get beta.err went you run `mk beta'."
+  :type '(repeat
+          :custom-show t
+          :documentation-shown t
+          file)
   :group 'build-report)
 
 (defcustom build-report-installation-file
-  (concat (gethash 'blddir (config-value-hash-table)) "/Installation")
-  "Installation file produced by XEmacs configure process."
-  :type 'file
+  (expand-file-name "Installation"
+                    (gethash 'blddir (config-value-hash-table)))
+  "*Installation file produced by XEmacs configure process."
+  :type '(file
+          :custom-show t
+          :documentation-shown t)
   :group 'build-report)
 
-(defcustom build-report-installation-insert-all nil
-  "Tell build-report to insert the whole Installation file
-instead of just the last report."
+(defcustom build-report-version-file
+  (expand-file-name
+   "version.sh"
+   (gethash 'blddir (config-value-hash-table)))
+  "*version.sh file identifying XEmacs (Beta) Distribution."
+  :type '(file
+          :custom-show t
+          :documentation-shown t)
+  :group 'build-report)
+
+(defcustom build-report-installation-insert-all
+  nil
+  "*Tell build-report to insert the whole Installation file
+  instead of just the last report."
   :type 'boolean
   :group 'build-report)
 
 (defcustom build-report-subject
   (concat "[%s] " emacs-version " on " system-configuration)
-  "XEmacs Build Report Subject Line. %s-sequences will be substituted
-with user input through `build-report' according to
-`build-report-prompts' using `format'."
-  :type 'string
+  "*XEmacs Build Report Subject Line. %s-sequences will be substituted
+  with user input through `build-report' according to
+  `build-report-prompts' using `format'."
+  :type '(string
+          :custom-show t
+          :documentation-shown t)
   :group 'build-report)
 
 (defcustom build-report-prompts
-  '(("Status?: "  "Success" "Failure"))
-  "XEmacs Build Report Prompt(s). This is a list of prompt-string
-lists used by `build-report' in conjunction with
-`build-report-subject'. Each list consists of a prompt string
-followed by any number of strings which can be chosen via the history
-mechanism."
+  (quote (("Status?: "  ("Success" "Failure"))))
+  "*XEmacs Build Report Prompt(s). This is a list of prompt-string
+  lists used by `build-report' in conjunction with
+  `build-report-subject'. Each list consists of a prompt string
+  followed by any number of strings which can be chosen via the history
+  mechanism."
+  :type '(repeat
+          :custom-show t
+          :documentation-shown t
+          (list
+           :tag "Prompt"
+           string
+           (repeat
+            :tag "Values"
+            string)))
   :group 'build-report)
 
 (defcustom build-report-file-encoding
   "7bit"
-  "XEmacs Build Report File Encoding to be used when MIME support is
-available."
+  "*XEmacs Build Report File Encoding to be used when MIME support is
+  available."
   :group 'build-report)
 
 ;; Symbol Name mappings from TM to SEMI serving as Compatibility
@@ -151,45 +229,113 @@ available."
     (defalias 'mime-edit-insert-binary-file
       'mime-editor/insert-binary-file)))
 
+(defun build-report-make-output-get ()
+  "Returns the filename the XEmacs make output is saved in."
+  (interactive)
+  (if (or (string-equal build-report-make-output-dir "")
+          (null build-report-make-output-dir))
+      (mapcar
+       (function
+        (lambda (f)
+          (expand-file-name
+           f
+           (file-name-as-directory
+            (gethash 'blddir (config-value-hash-table))))))
+       build-report-make-output-files)
+    (mapcar
+     (function
+      (lambda (f)
+        (expand-file-name
+         f
+         (file-name-as-directory build-report-make-output-dir))))
+     build-report-make-output-files)))
+
 ;;;###autoload
 (defun build-report (&rest args)
-  "Initializes a fresh mail composition buffer using `compose-mail'
-with the contents of XEmacs Installation file and excerpts from XEmacs
-make output and errors and leaves point at the beginning of the mail text.
- See also
-`compose-mail', `mail-user-agent',
-`build-report-destination',
-`build-report-keep-regexp',
-`build-report-delete-regexp',
-`build-report-make-output-file' and
-`build-report-installation-file'."
+  "Composes a fresh mail message with the contents of the built XEmacs
+Installation file and excerpts from XEmacs make output.
+`compose-mail' is used to create the mail message.  Point is left at
+the beginning of the mail text.  You may add some personal notes if
+you like and send the report.
+See also
+  `compose-mail', `mail-user-agent',
+  `build-report-destination',
+  `build-report-keep-regexp',
+  `build-report-delete-regexp',
+  `build-report-make-output-dir',
+  `build-report-make-output-files', and
+  `build-report-installation-file'."
+  ;; `interactive' form returns value for formal parameter `args'.
   (interactive
    (let (prompt
-        hist
-        arg
-        (prompts build-report-prompts))
+         hist
+         arg
+         (prompts build-report-prompts))
      (progn
        (while prompts
-        (defvar hist)
-        (setq prompt (caar prompts))
-        (setq hist (cdar prompts))
-        (setq prompts (cdr prompts))
-        (setq arg (cons (read-string prompt "" 'hist) arg)))
+         (defvar hist)
+         (setq prompt (caar prompts))
+         (setq hist (cdar prompts))
+         ;; `build-report-prompts' used to be a list of lists, the
+         ;; first element of each list being the prompt, the rest being
+         ;; the history.  The history is now in a separate list.  We
+         ;; better check for that.
+         (if (listp (car hist))
+             (setq hist (car hist)))
+         (setq prompts (cdr prompts))
+         (setq arg (cons (read-string prompt "" 'hist) arg)))
        arg)))
   (save-excursion
+    (if (file-exists-p build-report-installation-file)
+        (multiple-value-bind
+            (major minor beta codename configuration)
+            (build-report-installation-data build-report-installation-file)
+          (setq build-report-subject
+                (format "[%%s] XEmacs %s.%s%s \"%s\", %s"
+                        major minor beta codename configuration)))
+      (multiple-value-bind
+          (major minor beta codename)
+          (build-report-version-file-data build-report-version-file)
+        (setq build-report-subject
+              (format "[%%s] XEmacs %s.%s%s \"%s\", %s"
+                      major minor beta codename system-configuration))))
     (compose-mail
-     build-report-destination
+     ;; `build-report-destination' used to be a single string, so
+     ;; let's test if we really get a list of destinations.
+     (if (listp build-report-destination)
+         (read-string
+          "Build Report Destination: "
+          (car build-report-destination)
+          'build-report-destination)
+       (read-string
+        "Build Report Destination: "
+        build-report-destination)
+       )
      (apply 'format build-report-subject args)
      nil
      nil
      nil
      nil
      nil)
-    (let ((report-begin (point)))
-      (insert (build-report-insert-make-output report-begin))
-      (insert (build-report-insert-installation-file
-              report-begin
-              build-report-installation-insert-all))
+    (let* ((report-begin (point))
+           (files (reverse (build-report-make-output-get)))
+           (file (car files)))
+      (while file
+        (if (file-exists-p file)
+            (insert (build-report-insert-make-output report-begin file))
+          (insert (format "%s not found!\n" file)))
+        (insert "\n")
+        (setq files (cdr files))
+        (setq file (car files)))
+      (if (file-exists-p build-report-installation-file)
+          (insert (build-report-insert-installation-file
+                   report-begin
+                   build-report-installation-insert-all))
+        (insert (format "%s not found!\n" build-report-installation-file)))
+;;;       (when (and (>= major 21) (>= minor 2) (or (null beta) (>= beta 32)))
+;;;         (insert "\n")
+;;;         (insert (build-report-insert-config-inc report-begin)))
+      (insert "\n")
       (insert (build-report-insert-header report-begin))
       (goto-char report-begin))))
 
@@ -197,48 +343,69 @@ make output and errors and leaves point at the beginning of the mail text.
   "Inserts the build-report-header at the point specified by `where'."
   (goto-char where)
   (with-temp-buffer
-    (insert "\n> XEmacs Build Report as generated\n> by"
-           " build-report-version "
-           build-report-version " follows:\n\n")
+    (insert
+     (format "
+> XEmacs Build Report generated by emacs-version
+> %s
+> with system-configuration
+> %s
+> follows:\n\n" emacs-version system-configuration))
     (buffer-string)))
 
-(defun build-report-insert-make-output (where)
-  "Inserts the output of the XEmacs Beta make run.
+(defun build-report-insert-make-output (where file)
+  "Inserts the output of the XEmacs Beta make run in the
+current buffer at position WHERE.
 The make process output must have been saved in
-`build-report-make-output-file' during the XEmacs Beta building."
+`build-report-make-output-files' during the XEmacs Beta building."
   (goto-char where)
   (with-temp-buffer
-    (if (file-exists-p build-report-make-output-file)
-       (progn
-         (if (featurep 'mime-setup)
-             (progn
-               (mime-edit-insert-tag
-                "text"
-                "plain"
-                (concat
-                 "\nContent-Disposition: attachment;"
-                 " filename=\""
-                 (file-name-nondirectory
-                  build-report-make-output-file)
-                 "\""))
-               (mime-edit-insert-binary-file
-                build-report-make-output-file
-                build-report-file-encoding))
-           (insert-file-contents build-report-make-output-file))
-         (goto-char (point-min))
-         (delete-non-matching-lines (build-report-keep))
-         (goto-char (point-min))
-         (delete-matching-lines (build-report-delete))
-         (goto-char (point-min))
-         (insert "> Contents of "
-                 build-report-make-output-file
-                 "\n> keeping lines matching\n> \""
-                 (build-report-keep)
-                 "\"\n> and then deleting lines matching\n> \""
-                 (build-report-delete)
-                 "\"\n\n"))
-      (insert "> " build-report-make-output-file
-             " does not exist!\n\n"))
+    (if (file-exists-p file)
+        (progn
+          (if (featurep 'mime-setup)
+              (progn
+                (mime-edit-insert-tag
+                 "text"
+                 "plain"
+                 (concat
+                  "\nContent-Disposition: attachment;"
+                  " filename=\""
+                  (file-name-nondirectory
+                   file)
+                  "\""))
+                (mime-edit-insert-binary-file
+                 file
+                 build-report-file-encoding))
+            (insert-file-contents file))
+          (when build-report-keep-regexp
+            (goto-char (point-min))
+            (delete-non-matching-lines (build-report-keep)))
+          (when build-report-delete-regexp
+            (goto-char (point-min))
+            (delete-matching-lines (build-report-delete)))
+          (goto-char (point-min))
+          (if build-report-keep-regexp
+              (insert
+               (format
+                "> keeping lines matching
+> \"%s\"
+"
+                (build-report-keep))))
+          (if build-report-delete-regexp
+              (insert
+               (format
+                "> %sdeleting lines matching
+> \"%s\"
+"
+                (if build-report-keep-regexp
+                    "and then "
+                  "")
+                (build-report-delete))))
+          (insert "\n")
+          (goto-char (point-min))
+          (insert
+           (format "> Contents of %s\n" file)))
+      (insert "> " file
+              " does not exist!\n\n"))
     (buffer-string)))
 
 (defun build-report-insert-installation-file (where all)
@@ -247,50 +414,116 @@ created by the XEmacs Beta configure process."
   (goto-char where)
   (with-temp-buffer
     (if (file-exists-p build-report-installation-file)
-       (let (file-begin last-configure)
-         (insert "> Contents of "
-                 build-report-installation-file
-                 ":\n")
-         (insert
-          (format
-           "> (Output from %s of ./configure)\n\n"
-           (if all "all runs" "most recent run")))
-         (if (featurep 'mime-setup)
-             (progn
-               (mime-edit-insert-tag
-                "text"
-                "plain"
-                (concat
-                 "\nContent-Disposition: attachment;"
-                 " filename=\""
-                 (file-name-nondirectory
-                  build-report-installation-file)
-                 "\""))
-               (mime-edit-insert-binary-file
-                build-report-installation-file
-                build-report-file-encoding)
-               (setq file-begin (mime-edit-content-beginning)))
-           (setq file-begin (point))
-           (insert-file-contents
-            build-report-installation-file))
-         (unless all
-           (setq last-configure
-                 (search-backward-regexp
-                  "^\\(uname.*\\|osversion\\):\\s-+" file-begin t))
-           (if (and file-begin last-configure)
-               (delete-region file-begin last-configure))))
+        (let (file-begin last-configure)
+          (insert "> Contents of "
+                  build-report-installation-file
+                  ":\n")
+          (insert
+           (format
+            "> (Output from %s of ./configure)\n\n"
+            (if all "all runs" "most recent run")))
+          (if (featurep 'mime-setup)
+              (progn
+                (mime-edit-insert-tag
+                 "text"
+                 "plain"
+                 (concat
+                  "\nContent-Disposition: attachment;"
+                  " filename=\""
+                  (file-name-nondirectory
+                   build-report-installation-file)
+                  "\""))
+                (mime-edit-insert-binary-file
+                 build-report-installation-file
+                 build-report-file-encoding)
+                (setq file-begin (mime-edit-content-beginning)))
+            (setq file-begin (point))
+            (insert-file-contents
+             build-report-installation-file))
+          (unless all
+            (setq last-configure
+                  (search-backward-regexp
+                   "^\\(uname.*\\|osversion\\|OS\\):\\s-+" file-begin t))
+            (if (and file-begin last-configure)
+                (delete-region file-begin last-configure))))
       (insert "> " build-report-installation-file
-             " does not exist!\n\n"))
+              " does not exist!\n\n"))
     (buffer-string)))
 
 (defun build-report-keep ()
-  "build-report-internal function of no general value."
+  "Concatenate elements of `build-report-keep-regexp' and a general
+MIME tag REGEXP.  The result is a REGEXP string matching either of the
+REGEXPs in `build-report-keep-regexp' or a general MIME tag REGEXP."
   (mapconcat #'identity
-            (cons "^--\\[\\[\\|\\]\\]$" build-report-keep-regexp) "\\|"))
+             (cons "^--\\[\\[\\|\\]\\]$" build-report-keep-regexp) "\\|"))
 
 (defun build-report-delete ()
-  "build-report-internal function of no general value."
-  (mapconcat #'identity
-            build-report-delete-regexp "\\|"))
+  "Concatenate elements of `build-report-delete-regexp' and a general
+MIME tag REGEXP.  The result is a REGEXP string matching either of the
+REGEXPs in `build-report-delete-regexp' or a general MIME tag REGEXP."
+  (mapconcat '(lambda (item) item)
+             build-report-delete-regexp "\\|"))
+
+(defun build-report-installation-data (&optional file)
+  "Return a list of XEmacs installation data containing MAJOR_NUMBER
+MINOR_NUMBER BETA_STRING CODENAME CONFIGURATION SRCDIR from FILE,
+which defaults to `build-report-installation-file'."
+  (interactive "fInstallation file: ")
+  (unless file
+    (setq file build-report-installation-file))
+  (let
+      (major minor beta codename configuration srcdir)
+    (save-window-excursion
+      (find-file-read-only file)
+      (goto-char (point-min))
+      (while (< (point) (point-max))
+        (cond
+         ((looking-at build-report-installation-version-regexp)
+          (goto-char (match-end 0))
+          (setq major (match-string 1))
+          (setq minor (match-string 2))
+          (setq beta (match-string 3))
+          (setq codename (match-string 6))
+          (setq configuration (match-string 7)))
+         ((looking-at build-report-installation-srcdir-regexp)
+          (goto-char (match-end 0))
+          (setq srcdir (match-string 1)))
+         ;; We avoid matching a potentially zero-length string to avoid
+         ;; infinite looping.
+         ((looking-at
+           "^.+$")
+          (goto-char (match-end 0)))
+         ((looking-at "\n")
+          (goto-char (match-end 0)))))
+      (values major minor (or beta "") codename configuration srcdir))))
+
+(defun build-report-version-file-data (&optional file)
+  "Return a list of XEmacs version information containing
+MAJOR_NUMBER MINOR_NUMBER BETA_STRING CODENAME from FILE, which
+defaults to `build-report-version-file'." 
+  (interactive "fversion.sh file: ")
+  (unless file
+    (setq file build-report-version-file))
+  (let
+      (major minor beta codename)
+    (save-window-excursion
+      (find-file-read-only file)
+      (goto-char (point-min))
+      (while (< (point) (point-max))
+        (cond
+         ((looking-at build-report-version-file-regexp)
+          (goto-char (match-end 0))
+          (setq major (match-string 1))
+          (setq minor (match-string 2))
+          (setq beta (match-string 3))
+          (setq codename (match-string 4)))
+         ;; We avoid matching a potentially zero-length string to avoid
+         ;; infinite looping.
+         ((looking-at
+           "^.+$")
+          (goto-char (match-end 0)))
+         ((looking-at "\n")
+          (goto-char (match-end 0)))))
+      (values major minor (or beta "") codename))))
 
 ;;; build-report.el ends here
index 2ab79db..b18664b 100644 (file)
   ;; fetch and return the offset for the current opcode.
   ;; return NIL if this opcode has no offset
   ;; OP, PTR and BYTES are used and set dynamically
-  (defvar op)
-  (defvar ptr)
-  (defvar bytes)
+  (declare (special op ptr bytes))
   (cond ((< op byte-nth)
         (let ((tem (logand op 7)))
           (setq op (logand op 248))
 
 (defun byte-optimize-lapcode (lap &optional for-effect)
   "Simple peephole optimizer.  LAP is both modified and returned."
-  (let (lap0 ;; off0 unused
-       lap1 ;; off1
-       lap2 ;; off2
+  (let (lap0
+       lap1
+       lap2
+       variable-frequency
        (keep-going 'first-time)
        (add-depth 0)
        rest tmp tmp2 tmp3
     ;; Rebuild byte-compile-constants / byte-compile-variables.
     ;; Simple optimizations that would inhibit other optimizations if they
     ;; were done in the optimizing loop, and optimizations which there is no
-    ;;  need to do more than once.
+    ;; need to do more than once.
     (setq byte-compile-constants nil
-         byte-compile-variables nil)
+         byte-compile-variables nil
+         variable-frequency (make-hash-table :test 'eq))
     (setq rest lap)
     (while rest
       (setq lap0 (car rest)
            lap1 (nth 1 rest))
-      (if (memq (car lap0) byte-constref-ops)
-         (if (eq (cdr lap0) 'byte-constant)
-             (or (memq (cdr lap0) byte-compile-variables)
-                 (setq byte-compile-variables (cons (cdr lap0)
-                                                    byte-compile-variables)))
-           (or (memq (cdr lap0) byte-compile-constants)
-               (setq byte-compile-constants (cons (cdr lap0)
-                                                  byte-compile-constants)))))
+      (case (car lap0)
+       ((byte-varref byte-varset byte-varbind)
+        (incf (gethash (cdr lap0) variable-frequency 0))
+        (unless (memq (cdr lap0) byte-compile-variables)
+          (push (cdr lap0) byte-compile-variables)))
+       ((byte-constant)
+        (unless (memq (cdr lap0) byte-compile-constants)
+          (push (cdr lap0) byte-compile-constants))))
       (cond (;;
-            ;; const-C varset-X const-C  -->  const-C dup varset-X
+            ;; const-C varset-X  const-C  -->  const-C dup varset-X
             ;; const-C varbind-X const-C  -->  const-C dup varbind-X
             ;;
             (and (eq (car lap0) 'byte-constant)
                  (eq (car (nth 2 rest)) 'byte-constant)
-                 (eq (cdr lap0) (car (nth 2 rest)))
+                 (eq (cdr lap0) (cdr (nth 2 rest)))
                  (memq (car lap1) '(byte-varbind byte-varset)))
             (byte-compile-log-lap "  %s %s %s\t-->\t%s dup %s"
                                   lap0 lap1 lap0 lap0 lap1)
             (setcdr lap1 (+ (cdr lap1) (cdr lap0))))
            )
       (setq rest (cdr rest)))
+    ;; Since the first 6 entries of the compiled-function constants
+    ;; vector are most efficient for varref/set/bind ops, we sort by
+    ;; reference count.  This generates maximally space efficient and
+    ;; pretty time-efficient byte-code.  See `byte-compile-constants-vector'.
+    (setq byte-compile-variables
+         (sort byte-compile-variables
+               #'(lambda (v1 v2)
+                   (< (gethash v1 variable-frequency)
+                      (gethash v2 variable-frequency)))))
+    ;; Another hack - put the most used variable in position 6, for
+    ;; better locality of reference with adjoining constants.
+    (let ((tail (last byte-compile-variables 6)))
+      (setq byte-compile-variables
+           (append (nbutlast byte-compile-variables 6)
+                   (nreverse tail))))
     (setq byte-compile-maxdepth (+ byte-compile-maxdepth add-depth)))
   lap)
 
index 28ad928..2fc251a 100644 (file)
@@ -3,13 +3,14 @@
 ;;; Copyright (C) 1985-1987, 1991-1994 Free Software Foundation, Inc.
 ;;; Copyright (C) 1996 Ben Wing.
 
-;; Author: Jamie Zawinski <jwz@jwz.org>
+;; Authors: Jamie Zawinski <jwz@jwz.org>
 ;;     Hallvard Furuseth <hbf@ulrik.uio.no>
-;; Keywords: internal
+;;     Ben Wing <ben@xemacs.org>
+;;     Martin Buchholz <martin@xemacs.org>
+;;     Richard Stallman <rms@gnu.org>
+;; Keywords: internal lisp
 
-;; Subsequently modified by RMS and others.
-
-(defconst byte-compile-version (purecopy  "2.26 XEmacs; 1998-10-07."))
+(defconst byte-compile-version (purecopy  "2.27 XEmacs; 2000-09-12."))
 
 ;; This file is part of XEmacs.
 
 ;;; Commentary:
 
 ;; The Emacs Lisp byte compiler.  This crunches lisp source into a
-;; sort of p-code which takes up less space and can be interpreted
-;; faster.  The user entry points are byte-compile-file,
+;; sort of p-code (`bytecode') which takes up less space and can be
+;; interpreted faster.  First, the source code forms are converted to
+;; an intermediate form, `lapcode' [`LAP' == `Lisp Assembly Program']
+;; which is much easier to manipulate than bytecode.  Then the lapcode
+;; is converted to bytecode, which can be considered to be actual
+;; machine language.  Optimizations can occur at either the source
+;; level or the lapcode level.
+
+;; The user entry points are byte-compile-file,
 ;; byte-recompile-directory and byte-compile-buffer.
 
 ;;; Code:
@@ -938,7 +946,9 @@ otherwise pop it")
    (concat "!! "
           (format (if (cdr error-info) "%s (%s)" "%s")
                   (get (car error-info) 'error-message)
-                  (prin1-to-string (cdr error-info))))))
+                  (prin1-to-string (cdr error-info)))))
+  (if stack-trace-on-error
+      (backtrace nil t)))
 
 ;;; Used by make-obsolete.
 (defun byte-compile-obsolete (form)
@@ -1320,11 +1330,11 @@ otherwise pop it")
              (point-max byte-compile-log-buffer))))
 
        (unwind-protect
-          (condition-case error-info
-              (progn ,@body)
-            (error
-             (byte-compile-report-error error-info)))
-
+          (call-with-condition-handler
+              #'(lambda (error-info)
+                  (byte-compile-report-error error-info))
+              #'(lambda ()
+                  (progn ,@body)))
         ;; Always set point in log to start of interesting output.
         (with-current-buffer byte-compile-log-buffer
           (let ((show-begin
@@ -1986,12 +1996,14 @@ list that represents a doc string reference.
     ;; No doc string, so we can compile this as a normal form.
     (byte-compile-keep-pending form 'byte-compile-normal-call)))
 
-(put 'defvar   'byte-hunk-handler 'byte-compile-file-form-defvar)
-(put 'defconst 'byte-hunk-handler 'byte-compile-file-form-defvar)
-(defun byte-compile-file-form-defvar (form)
+(put 'defvar   'byte-hunk-handler 'byte-compile-file-form-defvar-or-defconst)
+(put 'defconst 'byte-hunk-handler 'byte-compile-file-form-defvar-or-defconst)
+(defun byte-compile-file-form-defvar-or-defconst (form)
+  ;; (defvar|defconst VAR [VALUE [DOCSTRING]])
   (if (> (length form) 4)
-      (byte-compile-warn "%s used with too many args (%s)"
-                        (car form) (nth 1 form)))
+      (byte-compile-warn
+       "%s %s called with %d arguments, but accepts only %s"
+       (car form) (nth 1 form) (length (cdr form)) 3))
   (if (and (> (length form) 3) (not (stringp (nth 3 form))))
       (byte-compile-warn "Third arg to %s %s is not a string: %s"
                         (car form) (nth 1 form) (nth 3 form)))
@@ -3711,7 +3723,8 @@ If FORM is a lambda or a macro, byte-compile it as a function."
 (byte-defop-compiler-1 defun)
 (byte-defop-compiler-1 defmacro)
 (byte-defop-compiler-1 defvar)
-(byte-defop-compiler-1 defconst byte-compile-defvar)
+(byte-defop-compiler-1 defvar   byte-compile-defvar-or-defconst)
+(byte-defop-compiler-1 defconst byte-compile-defvar-or-defconst)
 (byte-defop-compiler-1 autoload)
 ;; According to Mly this can go now that lambda is a macro
 ;(byte-defop-compiler-1 lambda byte-compile-lambda-form)
@@ -3739,32 +3752,38 @@ If FORM is a lambda or a macro, byte-compile it as a function."
                   (list 'quote (cons 'macro (eval code))))))
         (list 'quote (nth 1 form)))))
 
-(defun byte-compile-defvar (form)
-  ;; This is not used for file-level defvar/consts with doc strings:
-  ;; byte-compile-file-form-defvar will be used in that case.
-  (let ((var (nth 1 form))
+(defun byte-compile-defvar-or-defconst (form)
+  ;; This is not used for file-level defvar/defconsts with doc strings:
+  ;; byte-compile-file-form-defvar-or-defconst will be used in that case.
+  ;; (defvar|defconst VAR [VALUE [DOCSTRING]])
+  (let ((fun (nth 0 form))
+       (var (nth 1 form))
        (value (nth 2 form))
        (string (nth 3 form)))
-    (if (> (length form) 4)
-       (byte-compile-warn "%s used with too many args" (car form)))
-    (if (memq 'free-vars byte-compile-warnings)
-       (setq byte-compile-bound-variables
-             (cons (cons var byte-compile-global-bit)
-                   byte-compile-bound-variables)))
+    (when (> (length form) 4)
+      (byte-compile-warn
+       "%s %s called with %d arguments, but accepts only %s"
+       fun var (length (cdr form)) 3))
+    (when (memq 'free-vars byte-compile-warnings)
+      (push (cons var byte-compile-global-bit) byte-compile-bound-variables))
     (byte-compile-body-do-effect
-     (list (if (cdr (cdr form))
-              (if (eq (car form) 'defconst)
-                  (list 'setq var value)
-                (list 'or (list 'boundp (list 'quote var))
-                      (list 'setq var value))))
-          ;; Put the defined variable in this library's load-history entry
-          ;; just as a real defvar would.
-          (list 'setq 'current-load-list
-                (list 'cons (list 'quote var)
-                      'current-load-list))
-          (if string
-              (list 'put (list 'quote var) ''variable-documentation string))
-          (list 'quote var)))))
+     (list
+      ;; Put the defined variable in this library's load-history entry
+      ;; just as a real defvar would, but only in top-level forms.
+      (when (null byte-compile-current-form)
+       `(push ',var current-load-list))
+      (when (> (length form) 3)
+       (when (and string (not (stringp string)))
+         (byte-compile-warn "Third arg to %s %s is not a string: %s"
+                            fun var string))
+       `(put ',var 'variable-documentation ,string))
+      (if (cdr (cdr form))             ; `value' provided
+         (if (eq fun 'defconst)
+             ;; `defconst' sets `var' unconditionally.
+             `(setq ,var ,value)
+           ;; `defvar' sets `var' only when unbound.
+           `(if (not (boundp ',var)) (setq ,var ,value))))
+      `',var))))
 
 (defun byte-compile-autoload (form)
   (and (byte-compile-constp (nth 1 form))
index 9a9d3a0..3299793 100644 (file)
@@ -1413,10 +1413,10 @@ values.  For compatibility, (values A B C) is a synonym for (list A B C)."
   (cond ((eq (car-safe spec) 'special)
         (if (boundp 'byte-compile-bound-variables)
             (setq byte-compile-bound-variables
-                  ;; todo: this should compute correct binding bits vs. 0
-                  (append (mapcar #'(lambda (v) (cons v 0))
-                                  (cdr spec))
-                          byte-compile-bound-variables))))
+                  (append
+                   (mapcar #'(lambda (v) (cons v byte-compile-global-bit))
+                           (cdr spec))
+                   byte-compile-bound-variables))))
 
        ((eq (car-safe spec) 'inline)
         (while (setq spec (cdr spec))
@@ -1769,6 +1769,7 @@ Example: (defsetf nth (n x) (v) (list 'setcar (list 'nthcdr n x) v))."
 (defsetf x-get-cut-buffer x-store-cut-buffer t)   ; groan.
 (defsetf x-get-secondary-selection x-own-secondary-selection t)
 (defsetf x-get-selection x-own-selection t)
+(defsetf get-selection own-selection t)
 
 ;;; More complex setf-methods.
 ;;; These should take &environment arguments, but since full arglists aren't
index 3f0ed88..c97378f 100644 (file)
@@ -355,7 +355,7 @@ Also see: `remove*', `delete', `delete*'"
   (remove* cl-item cl-seq ':test 'equal))
 
 (defun remq (cl-elt cl-list)
-  "Remove all occurances of ELT in LIST, comparing with `eq'.
+  "Remove all occurrences of ELT in LIST, comparing with `eq'.
 This is a non-destructive function; it makes a copy of LIST to avoid
 corrupting the original LIST.
 Also see: `delq', `delete', `delete*', `remove', `remove*'."
index e2ec4c5..03cfdf1 100644 (file)
@@ -269,7 +269,7 @@ If FORM is not a macro call, it is returned unchanged.
 Otherwise, the macro is expanded and the expansion is considered
 in place of FORM.  When a non-macro-call results, it is returned.
 
-The second optional arg ENVIRONMENT species an environment of macro
+The second optional arg ENVIRONMENT specifies an environment of macro
 definitions to shadow the loaded ones for use in file byte-compilation."
   (let ((cl-macro-environment cl-env))
     (while (progn (setq cl-macro (funcall cl-old-macroexpand cl-macro cl-env))
index 215fc8d..17989d0 100644 (file)
@@ -462,9 +462,28 @@ and can edit it until it has been confirmed."
                (sleep-for 2))))
       ans)))
 
-;; these may be redefined later, but make the original def easily encapsulable
-(define-function 'yes-or-no-p 'yes-or-no-p-minibuf)
-(define-function 'y-or-n-p 'y-or-n-p-minibuf)
+(defun yes-or-no-p (prompt)
+  "Ask user a yes-or-no question.  Return t if answer is yes.
+The question is asked with a dialog box or the minibuffer, as appropriate.
+Takes one argument, which is the string to display to ask the question.
+It should end in a space; `yes-or-no-p' adds `(yes or no) ' to it.
+The user must confirm the answer with RET,
+and can edit it until it as been confirmed."
+  (if (should-use-dialog-box-p)
+      (yes-or-no-p-dialog-box prompt)
+    (yes-or-no-p-minibuf prompt)))
+
+(defun y-or-n-p (prompt)
+  "Ask user a \"y or n\" question.  Return t if answer is \"y\".
+Takes one argument, which is the string to display to ask the question.
+The question is asked with a dialog box or the minibuffer, as appropriate.
+It should end in a space; `y-or-n-p' adds `(y or n) ' to it.
+No confirmation of the answer is requested; a single character is enough.
+Also accepts Space to mean yes, or Delete to mean no."
+  (if (should-use-dialog-box-p)
+      (yes-or-no-p-dialog-box prompt)
+    (y-or-n-p-minibuf prompt)))
+
 \f
 
 (defun read-char ()
index d854348..f3d138a 100644 (file)
@@ -551,9 +551,4 @@ See also `write-region-pre-hook' and `write-region-post-hook'."
                        start end filename append visit lockname
                        coding-system)))
 
-;;; The following was all that remained in mule-files.el, so I moved it
-;;; here for neatness.  -sb
-(when (featurep 'mule)
-  (setq-default buffer-file-coding-system 'iso-2022-8))
-
 ;;; code-files.el ends here
index a60b620..1b248dc 100644 (file)
@@ -211,7 +211,7 @@ Fifth argument PROTOCOL is a network protocol.  Currently 'tcp
  (Transmission Control Protocol) and 'udp (User Datagram Protocol) are
  supported.  When omitted, 'tcp is assumed.
 
-Ouput via `process-send-string' and input via buffer or filter (see
+Output via `process-send-string' and input via buffer or filter (see
 `set-process-filter') are stream-oriented.  That means UDP datagrams are
 not guaranteed to be sent and received in discrete packets. (But small
 datagrams around 500 bytes that are not truncated by `process-send-string'
index fb14885..98c8048 100644 (file)
@@ -31,7 +31,8 @@
 ;;; Commentary:
 
 ;; This file generates the custom-load files, loaded by cus-load.el.
-;; The only entry point is `Custom-make-dependencies'.
+;; Entry points are `Custom-make-dependencies' and
+;; `Custom-make-one-dependency'.
 
 ;; It works by scanning all the `.el' files in a directory, and
 ;; evaluates any `defcustom', `defgroup', or `defface' expression that
 ;; understand, but is in fact very easy to break.  Be sure to read and
 ;; understand the commentary above!
 
-;;;###autoload
-(defun Custom-make-dependencies (&optional subdirs)
-  "Extract custom dependencies from .el files in SUBDIRS.
-SUBDIRS is a list of directories.  If it is nil, the command-line
-arguments are used.  If it is a string, only that directory is
-processed.  This function is especially useful in batch mode.
-
-Batch usage: xemacs -batch -l cus-dep.el -f Custom-make-dependencies DIRS"
-  (interactive "DDirectory: ")
-  (and (stringp subdirs)
-       (setq subdirs (list subdirs)))
-  (or subdirs
-      ;; Usurp the command-line-args
-      (setq subdirs command-line-args-left
-           command-line-args-left nil))
+(defun Custom-make-dependencies-1 (subdirs)
   (setq subdirs (mapcar #'expand-file-name subdirs))
   (with-temp-buffer
     (let ((enable-local-eval nil)
@@ -182,6 +169,31 @@ Batch usage: xemacs -batch -l cus-dep.el -f Custom-make-dependencies DIRS"
                (insert "\n;;; custom-load.el ends here\n"))
              (clrhash hash)))))))))
 
+(defun Custom-make-one-dependency ()
+  "Extract custom dependencies from .el files in one dir, on the command line.
+Like `Custom-make-dependencies' but snarfs only one command-line argument,
+making it useful in a chain of batch commands in a single XEmacs invocation."
+  (let ((subdir (car command-line-args-left)))
+    (setq command-line-args-left (cdr command-line-args-left))
+    (Custom-make-dependencies-1 (list subdir))))
+
+;;;###autoload
+(defun Custom-make-dependencies (&optional subdirs)
+  "Extract custom dependencies from .el files in SUBDIRS.
+SUBDIRS is a list of directories.  If it is nil, the command-line
+arguments are used.  If it is a string, only that directory is
+processed.  This function is especially useful in batch mode.
+
+Batch usage: xemacs -batch -l cus-dep.el -f Custom-make-dependencies DIRS"
+  (interactive "DDirectory: ")
+  (and (stringp subdirs)
+       (setq subdirs (list subdirs)))
+  (or subdirs
+      ;; Usurp the command-line-args
+      (setq subdirs command-line-args-left
+           command-line-args-left nil))
+  (Custom-make-dependencies-1 subdirs))
+
 (provide 'cus-dep)
 
 ;;; cus-dep.el ends here
index 681f8bc..1d528c7 100644 (file)
@@ -3344,6 +3344,7 @@ Leave point at the location of the call, or after the last expression."
 
 (defun custom-save-resets (property setter special)
   (let (started-writing ignored-special)
+    (setq ignored-special ignored-special) ;; suppress byte-compiler warning
     ;; (custom-save-delete setter) Done by caller 
     (let ((standard-output (current-buffer))
          (mapper `(lambda (object)
@@ -3367,7 +3368,8 @@ Leave point at the location of the call, or after the last expression."
       (setq ignored-special special)
       (mapatoms mapper)
       (when started-writing
-       (princ ")\n")))))
+       (princ ")\n"))))
+    )
                        
 
 (defun custom-save-loaded-themes ()
index 36e2d32..656f710 100644 (file)
@@ -309,7 +309,7 @@ FACE.  Nil otherwise."
 (defun custom-theme-reset-faces (theme &rest args)
   (custom-check-theme theme)
   "Reset the value of the face to values previously defined.
-Assosiate this setting with THEME.
+Associate this setting with THEME.
 
 ARGS is a list of lists of the form
 
@@ -324,7 +324,7 @@ This means reset face to its value in to-theme."
 ;;;###autoload
 (defun custom-reset-faces (&rest args)
   "Reset the value of the face to values previously defined.
-Assosiate this setting with the 'user' theme.
+Associate this setting with the 'user' theme.
 
 ARGS is defined as for `custom-theme-reset-faces'"
   (apply #'custom-theme-reset-faces 'user args))
index c01635e..dcd1165 100644 (file)
@@ -47,10 +47,10 @@ explicitly load that file for the settings to take effect.")
 (defun make-custom-file-name (init-file &optional force-new)
   "Construct the default custom file name from the init file name.
 If FORCE-NEW is non-nil, force post-migration location."
-  (let* ((init-file (or init-file user-init-file))
-        (init-file-directory (file-name-directory init-file)))
+  (let ((init-file (or init-file user-init-file)))
     (if (or force-new
-           (string= init-file-directory
+           (not init-file)
+           (string= (file-name-directory init-file)
                     (expand-file-name
                      (file-name-as-directory user-init-directory))))
        (expand-file-name custom-file-base user-init-directory)
index 1e0645a..61699b3 100644 (file)
 (custom-add-loads 'menu '("menubar-items"))
 (custom-add-loads 'minibuffer '("simple" "minibuf"))
 (custom-add-loads 'log-message '("simple"))
-(custom-add-loads 'environment '("frame" "keydefs" "minibuf" "modeline" "window-xemacs" "menubar" "gutter" "x-init" "toolbar-items" "cus-edit" "gnuserv" "sound"))
+(custom-add-loads 'environment '("frame" "keydefs" "minibuf" "modeline" "window-xemacs" "menubar" "gutter" "toolbar-items" "x-init" "cus-edit" "gnuserv" "sound"))
 (custom-add-loads 'sound '("sound"))
 (custom-add-loads 'pui '("package-ui"))
 (custom-add-loads 'terminals '("gnuserv"))
 (custom-add-loads 'auto-save '("files" "auto-save"))
-(custom-add-loads 'mail '("simple"))
+(custom-add-loads 'mail '("simple" "startup"))
 (custom-add-loads 'custom-menu '("cus-edit"))
 (custom-add-loads 'docs '("hyper-apropos" "info"))
 (custom-add-loads 'tools '("etags" "hyper-apropos"))
@@ -72,7 +72,7 @@
 (custom-add-loads 'languages '("lisp-mode" "cus-edit" "font-lock"))
 (custom-add-loads 'fill '("simple" "fill"))
 (custom-add-loads 'custom-magic-faces '("cus-edit"))
-(custom-add-loads 'display '("toolbar" "scrollbar" "auto-show"))
+(custom-add-loads 'display '("modeline" "toolbar" "scrollbar" "auto-show"))
 (custom-add-loads 'faces '("faces" "cus-edit" "font-lock" "font" "hyper-apropos" "info" "wid-edit"))
 (custom-add-loads 'emacs '("faces" "help" "files" "cus-edit" "package-get"))
 (custom-add-loads 'processes '("process" "gnuserv"))
index 29486f5..20f02ab 100644 (file)
@@ -185,7 +185,7 @@ The following KEYWORD's are defined:
         the current value for that symbol.  The default is
         `default-value'.
 :require VALUE should be a feature symbol.  Each feature will be
-        required after initialization, of the the user have saved this
+        required after initialization, of the user have saved this
         option.
 
 Read the section about customization in the Emacs Lisp manual for more
@@ -395,7 +395,7 @@ LOAD should be either a library file name, or a feature name."
   "(deftheme THEME &optional DOC &key KEYWORDS)
 
 Define a theme labeled by SYMBOL THEME. The optional argument DOC is a
-doc string describing the the theme. It is optionally followed by the
+doc string describing the theme. It is optionally followed by the
 following keyboard arguments
 
 :short-description DESC
@@ -535,7 +535,7 @@ See `custom-set-variables' for a description of the arguments ARGS."
 
 (defun custom-theme-load-themes (by-theme &rest body)
   "Load the themes specified by BODY and record them as required by
-theme BY-THEME. BODY is a secuence of
+theme BY-THEME. BODY is a sequence of
        - a SYMBOL
             require the theme SYMBOL
        - a list (reset THEME)
@@ -565,7 +565,7 @@ BODY is as with custom-theme-load-themes."
 
 
 (defsubst copy-upto-last (elt list)
-  "Copy all the elements of the list upto the last occurence of elt"
+  "Copy all the elements of the list upto the last occurrence of elt"
   ;; Is it faster to do more work in C than to do less in elisp?
   (nreverse (cdr (member elt (reverse list)))))
 
@@ -614,7 +614,7 @@ VARIABLE.  Nil otherwise."
 
 (defun custom-theme-reset-variables (theme &rest args)
   "Reset the value of the variables to values previously defined.
-Assosiate this setting with THEME.
+Associate this setting with THEME.
 
 ARGS is a list of lists of the form
 
@@ -629,7 +629,7 @@ This means reset variable to its value in to-theme."
 
 (defun custom-reset-variables (&rest args)
     "Reset the value of the variables to values previously defined.
-Assosiate this setting with the `user' theme.
+Associate this setting with the `user' theme.
 
 The ARGS are as in `custom-theme-reset-variables'."
     (apply #'custom-theme-reset-variables 'user args))
index bd94eaa..cdfbe55 100644 (file)
@@ -1,6 +1,7 @@
 ;;; dialog.el --- Dialog-box support for XEmacs
 
 ;; Copyright (C) 1991-4, 1997 Free Software Foundation, Inc.
+;; Copyright (C) 2000 Ben Wing.
 
 ;; Maintainer: XEmacs Development Team
 ;; Keywords: extensions, internal, dumped
 Return t if the answer is \"yes\".
 Takes one argument, which is the string to display to ask the question."
   (save-selected-frame
-    (popup-dialog-box
-     (list prompt ["Yes" yes t] ["No" no t] nil ["Cancel" cancel t]))
-    (let (event)
-      (catch 'ynp-done
-       (while t
-         (setq event (next-command-event event))
-         (when (misc-user-event-p event)
-           (message "%s" (event-object event))
-           (case (event-object event)
-             ((yes) (throw 'ynp-done t))
-             ((no)  (throw 'ynp-done nil))
-             ((cancel menu-no-selection-hook) (signal 'quit nil))))
-         (unless (button-release-event-p event) ; don't beep twice
-           (beep)
-           (message "please answer the dialog box")))))))
-
-(defun yes-or-no-p-maybe-dialog-box (prompt)
-  "Ask user a yes-or-no question.  Return t if answer is yes.
-The question is asked with a dialog box or the minibuffer, as appropriate.
-Takes one argument, which is the string to display to ask the question.
-It should end in a space; `yes-or-no-p' adds `(yes or no) ' to it.
-The user must confirm the answer with RET,
-and can edit it until it as been confirmed."
-  (if (should-use-dialog-box-p)
-      (yes-or-no-p-dialog-box prompt)
-    (yes-or-no-p-minibuf prompt)))
-
-(defun y-or-n-p-maybe-dialog-box (prompt)
-  "Ask user a \"y or n\" question.  Return t if answer is \"y\".
-Takes one argument, which is the string to display to ask the question.
-The question is asked with a dialog box or the minibuffer, as appropriate.
-It should end in a space; `y-or-n-p' adds `(y or n) ' to it.
-No confirmation of the answer is requested; a single character is enough.
-Also accepts Space to mean yes, or Delete to mean no."
-  (if (should-use-dialog-box-p)
-      (yes-or-no-p-dialog-box prompt)
-    (y-or-n-p-minibuf prompt)))
-
-(when (fboundp 'popup-dialog-box)
-  (fset 'yes-or-no-p 'yes-or-no-p-maybe-dialog-box)
-  (fset 'y-or-n-p 'y-or-n-p-maybe-dialog-box))
+    (make-dialog-box 'question
+                    :question prompt
+                    :modal t
+                    :buttons '(["Yes" (dialog-box-finish t)]
+                               ["No" (dialog-box-finish nil)]
+                               nil
+                               ["Cancel" (dialog-box-cancel)]))))
 
-;; this is call-compatible with the horribly-named FSF Emacs function
-;; `x-popup-dialog'.  I refuse to use that name.
+;; FSF has a similar function `x-popup-dialog'.
 (defun get-dialog-box-response (position contents)
-  ;; by Stig@hackvan.com
-  ;; modified by pez@atlantic2.sbi.com
   "Pop up a dialog box and return user's selection.
 POSITION specifies which frame to use.
 This is normally an event or a window or frame.
@@ -110,21 +74,20 @@ on the left of the dialog box and all following items on the right."
     (select-frame position))
    ((windowp position)
     (select-window position)))
-  (let ((dbox (cons (car contents)
-                   (mapcar #'(lambda (x)
-                               (cond
-                                ((null x)
-                                 nil)
-                                ((stringp x)
-                                 `[,x 'ignore nil]) ;this will never get
-                                                    ;selected
-                                (t
-                                 `[,(car x) (throw 'result ',(cdr x)) t])))
-                           (cdr contents))
-                   )))
-    (catch 'result
-      (popup-dialog-box dbox)
-      (dispatch-event (next-command-event)))))
+  (make-dialog-box 'question
+                  :question (car contents)
+                  :modal t
+                  :buttons
+                  (mapcar #'(lambda (x)
+                              (cond
+                               ((null x)
+                                nil)
+                               ((stringp x)
+                                ;;this will never get selected
+                                `[,x 'ignore nil])
+                               (t
+                                `[,(car x) (dialog-box-finish ',(cdr x)) t])))
+                          (cdr contents))))
 
 (defun message-box (fmt &rest args)
   "Display a message, in a dialog box if possible.
@@ -144,8 +107,8 @@ minibuffer contents show."
       str)))
 
 (defun message-or-box (fmt &rest args)
-  "Display a message in a dialog box or in the echo area.\n\
-If this command was invoked with the mouse, use a dialog box.\n\
+  "Display a message in a dialog box or in the echo area.
+If this command was invoked with the mouse, use a dialog box.
 Otherwise, use the echo area.
 The arguments are the same as to `format'.
 
@@ -155,63 +118,582 @@ minibuffer contents show."
       (apply 'message-box fmt args)
     (apply 'message fmt args)))
 
-(defun make-dialog-box (&optional spec props parent)
-  "Create a frame suitable for use as a general dialog box.
-The frame is made a child of PARENT (defaults to the selected frame),
-and has additional properties PROPS, as well as `dialog-frame-plist'.
-SPEC is a string or glyph to be placed in the gutter. If INVISIBLE is
-non-nil then the frame is initially unmapped.
-Normally the created frame has no modelines, menubars, scrollbars,
-minibuffer or toolbars and is entirely covered by its gutter."
-  (or parent (setq parent (selected-frame)))
-  (let* ((ftop (frame-property parent 'top))
-        (fleft (frame-property parent 'left))
-        (fwidth (frame-pixel-width parent))
-        (fheight (frame-pixel-height parent))
-        (fonth (font-height (face-font 'default)))
-        (fontw (font-width (face-font 'default)))
-        (props (append props dialog-frame-plist))
-        (dfheight (plist-get props 'height))
-        (dfwidth (plist-get props 'width))
-        (unmapped (plist-get props 'initially-unmapped))
-        (gutter-spec spec)
-        (name (or (plist-get props 'name) "XEmacs"))
-        (frame nil))
-    (plist-remprop props 'initially-unmapped)
-    ;; allow the user to just provide a glyph
-    (when (glyphp spec)
-      (setq gutter-spec (copy-sequence "\n"))
-      (set-extent-begin-glyph (make-extent 0 1 gutter-spec) spec))
-    ;; under FVWM at least, if I don't specify the initial position,
-    ;; it ends up always at (0, 0).  xwininfo doesn't tell me
-    ;; that there are any program-specified position hints, so
-    ;; it must be an FVWM bug.  So just be smashing and position
-    ;; in the center of the selected frame.
-    (setq frame (make-frame
-                (append props
-                        `(popup ,parent initially-unmapped t
-                                menubar-visible-p nil
-                                has-modeline-p nil
-                                default-toolbar-visible-p nil
-                                top-gutter-visible-p t
-                                top-gutter-height ,(* dfheight fonth)
-                                top-gutter ,gutter-spec
-                                minibuffer none
-                                name ,name
-                                modeline-shadow-thickness 0
-                                vertical-scrollbar-visible-p nil
-                                horizontal-scrollbar-visible-p nil
-                                unsplittable t
-                                left ,(+ fleft (- (/ fwidth 2)
-                                                  (/ (* dfwidth fontw)
-                                                     2)))
-                                top ,(+ ftop (- (/ fheight 2)
-                                                (/ (* dfheight fonth)
-                                                   2)))))))
-    (set-face-foreground 'modeline [default foreground] frame)
-    (set-face-background 'modeline [default background] frame)
-    (unless unmapped (make-frame-visible frame))
-    frame))
+(defun make-dialog-box (type &rest cl-keys)
+  "Pop up a dialog box.
+TYPE is a symbol, the type of dialog box.  Remaining arguments are
+keyword-value pairs, specifying the particular characteristics of the
+dialog box.  The allowed keywords are particular to each type, but
+some standard keywords are common to many types:
+
+:title
+  The title of the dialog box's window.
+
+:modal
+  If true, indicates that XEmacs will wait until the user is \"done\"
+  with the dialog box (usually, this means that a response has been
+  given).  Typically, the response is returned.  NOTE: Some dialog
+  boxes are always modal.  If the dialog box is modal, `make-dialog-box'
+  returns immediately.  The return value will be either nil or a
+  dialog box handle of some sort, e.g. a frame for type `general'.
+
+---------------------------------------------------------------------------
+
+Recognized types are
+
+general
+  A dialog box consisting of an XEmacs glyph, typically a `layout'
+  widget specifying a dialog box arrangement.  This is the most
+  general and powerful dialog box type, but requires more work than
+  the other types below.
+
+question
+  A simple dialog box that displays a question and contains one or
+  more user-defined buttons to specify possible responses. (This is
+  compatible with the old built-in dialog boxes formerly specified
+  using `popup-dialog-box'.)
+
+file
+  A file dialog box, of the type typically used in the window system
+  XEmacs is running on.
+
+color
+  A color picker.
+
+find
+  A find dialog box.
+
+font
+  A font chooser.
+
+print
+  A dialog box used when printing (e.g. number of pages, printer).
+
+page-setup
+  A dialog box for setting page options (e.g. margins) for printing.
+
+replace
+  A find/replace dialog box.
+
+mswindows-message
+  An MS Windows-specific standard dialog box type similar to `question'.
+
+---------------------------------------------------------------------------
+
+For type `general':
+
+This type creates a frame and puts the specified widget layout in it.
+\(Currently this is done by eliminating all areas but the gutter and placing
+the layout there; but this is an implementation detail and may change.)
+
+The keywords allowed for `general' are
+
+:spec
+  The widget spec -- anything that can be passed to `make-glyph'.
+
+:title
+  The title of the frame.
+:parent
+  The frame is made a child of this frame (defaults to the selected frame).
+
+:properties
+  Additional properties of the frame, as well as `dialog-frame-plist'.
+
+---------------------------------------------------------------------------
+
+For type `question':
+
+The keywords allowed are
+
+:modal
+  t or nil.  When t, the dialog box callback should exit the dialog box
+  using the functions `dialog-box-finish' or `dialog-box-cancel'.
+:title
+  The title of the frame.
+:question
+  A string, the question.
+:buttons
+  A list, describing the buttons below the question.  Each of these is a
+  vector, the syntax of which is essentially the same as that of popup menu
+  items.  They may have any of the following forms:
+
+   [ \"name\" callback <active-p> ]
+   [ \"name\" callback <active-p> \"suffix\" ]
+   [ \"name\" callback :<keyword> <value>  :<keyword> <value> ... ]
+  
+  The name is the string to display on the button; it is filtered through the
+  resource database, so it is possible for resources to override what string
+  is actually displayed.
+  
+  Accelerators can be indicated in the string by putting the sequence
+  \"%_\" before the character corresponding to the key that will invoke
+  the button.  Uppercase and lowercase accelerators are equivalent.  The
+  sequence \"%%\" is also special, and is translated into a single %.
+  
+  If the `callback' of a button is a symbol, then it must name a command.
+  It will be invoked with `call-interactively'.  If it is a list, then it is
+  evaluated with `eval'.
+  
+  One (and only one) of the buttons may be `nil'.  This marker means that all
+  following buttons should be flushright instead of flushleft.
+  
+  Though the keyword/value syntax is supported for dialog boxes just as in
+  popup menus, the only keyword which is both meaningful and fully implemented
+  for dialog box buttons is `:active'.
+
+---------------------------------------------------------------------------
+
+For type `file':
+
+The keywords allowed are
+
+:initial-filename
+  The initial filename to be placed in the dialog box (defaults to nothing).
+:initial-directory
+  The initial directory to be selected in the dialog box (defaults to the
+  current buffer's `default-directory).
+:filter-list
+  A list of                     (filter-desc filter ...)
+:title
+  The title of the dialog box (defaults to \"Open\").
+:allow-multi-select             t or nil
+:create-prompt-on-nonexistent   t or nil
+:overwrite-prompt               t or nil
+:file-must-exist                t or nil
+:no-network-button              t or nil
+:no-read-only-return            t or nil
+
+---------------------------------------------------------------------------
+
+For type `print':
+
+This invokes the Windows standard Print dialog.
+This dialog is usually invoked when the user selects the Print command.
+After the user presses OK, the program should start actual printout.
+
+The keywords allowed are
+
+:device
+  An 'msprinter device.
+:print-settings
+  A printer settings object.
+
+Exactly one of these keywords must be given.
+
+The function brings up the Print dialog, where the user can
+select a different printer and/or change printer options. Connection
+name can change as a result of selecting a different printer device.  If
+a printer is specified, then changes are stored into the settings object
+currently selected into that printer.  If a settings object is supplied,
+then changes are recorded into it, and, it it is selected into a
+printer, then changes are propagated to that printer 
+too.
+
+Return value is nil if the user has canceled the dialog.  Otherwise, it
+is a new plist, with the following properties:
+  name       Printer device name, even if unchanged by the user.
+  from-page  First page to print, 1-based. If not specified by the user,
+             then this value is not included in the plist.
+  to-page    Last page to print, inclusive, 1-based. If not specified by
+             the user, then this value is not included in the plist.
+  copies     Number of copies to print.  Always returned.
+
+The DEVICE is destroyed and an error is signaled in case of
+initialization problem with the new printer.
+
+See also the `page-setup' and `print-setup' dialog boxes.
+
+---------------------------------------------------------------------------
+
+For type `page-setup':
+
+This invokes the Windows standard Page Setup dialog.
+This dialog is usually invoked in response to the Page Setup command, and
+used to chose such parameters as page orientation, print margins etc.
+Note that this dialog contains the \"Printer\" button, which invokes
+the Printer Setup dialog (see `msprinter-print-setup-dialog') so that the
+user can update the printer options or even select a different printer
+as well.
+
+The keywords allowed are
+
+:device
+  An 'msprinter device.
+:print-settings
+  A printer settings object.
+:properties
+  A plist of job properties.
+
+Exactly one of these keywords must be given.
+
+The function brings up the Page Setup dialog, where the user
+can select a different printer and/or change printer options.
+Connection name can change as a result of selecting a different printer
+device.  If a printer is specified, then changes are stored into the
+settings object currently selected into that printer.  If a settings
+object is supplied, then changes are recorded into it, and, it it is
+selected into a printer, then changes are propagated to that printer
+too.
+
+:properties specifies a plist of job properties;
+see `default-msprinter-frame-plist' for the complete list.  The plist
+is used to initialize the dialog.
+
+Return value is nil if the user has canceled the dialog.  Otherwise,
+it is a new plist, containing the new list of properties.
+
+The DEVICE is destroyed and an error is signaled in case of
+initialization problem with the new printer.
+
+See also the `print' and `print-setup' dialogs.
+
+---------------------------------------------------------------------------
+
+For type `print-setup':
+
+This invokes the Windows standard Print Setup dialog.
+This dialog is usually invoked when the user selects the Printer Setup
+command.
+
+The keywords allowed are
+
+:device
+  An 'msprinter device.
+:print-settings
+  A printer settings object.
+
+Exactly one of these keywords must be given.
+
+The function brings up the Print Setup dialog, where the user
+can select a different printer and/or change printer options.
+Connection name can change as a result of selecting a different printer
+device.  If a printer is specified, then changes are stored into the
+settings object currently selected into that printer.  If a settings
+object is supplied, then changes are recorded into it, and, it it is
+selected into a printer, then changes are propagated to that printer
+too.
+
+Return value is nil if the user has canceled the dialog.  Otherwise, it
+is a new plist, with the following properties:
+  name       Printer device name, even if unchanged by the user.
+
+The printer device is destroyed and an error is signaled if new printer
+is selected by the user, but cannot be initialized.
+
+See also the `print' and `page-setup' dialogs.
+
+---------------------------------------------------------------------------
+
+For type `mswindows-message':
+
+The keywords allowed are
+
+:title
+  The title of the dialog box.
+:message
+  The string to display.
+:flags
+  A symbol or list of symbols:
+
+    -- To specify the buttons in the message box:
+    
+    abortretryignore 
+      The message box contains three push buttons: Abort, Retry, and Ignore. 
+    ok 
+      The message box contains one push button: OK. This is the default. 
+    okcancel 
+      The message box contains two push buttons: OK and Cancel. 
+    retrycancel 
+      The message box contains two push buttons: Retry and Cancel. 
+    yesno 
+      The message box contains two push buttons: Yes and No. 
+    yesnocancel 
+      The message box contains three push buttons: Yes, No, and Cancel. 
+    
+    
+    -- To display an icon in the message box:
+     
+    iconexclamation, iconwarning
+      An exclamation-point icon appears in the message box. 
+    iconinformation, iconasterisk
+      An icon consisting of a lowercase letter i in a circle appears in
+      the message box. 
+    iconquestion
+      A question-mark icon appears in the message box. 
+    iconstop, iconerror, iconhand
+      A stop-sign icon appears in the message box. 
+    
+    
+    -- To indicate the default button: 
+    
+    defbutton1
+      The first button is the default button.  This is the default.
+    defbutton2
+      The second button is the default button. 
+    defbutton3
+      The third button is the default button. 
+    defbutton4
+      The fourth button is the default button. 
+    
+    
+    -- To indicate the modality of the dialog box:
+     
+    applmodal
+      The user must respond to the message box before continuing work in
+      the window identified by the hWnd parameter. However, the user can
+      move to the windows of other applications and work in those windows.
+      Depending on the hierarchy of windows in the application, the user
+      may be able to move to other windows within the application. All
+      child windows of the parent of the message box are automatically
+      disabled, but popup windows are not.  This is the default.
+    systemmodal
+      Same as applmodal except that the message box has the WS_EX_TOPMOST
+      style. Use system-modal message boxes to notify the user of serious,
+      potentially damaging errors that require immediate attention (for
+      example, running out of memory). This flag has no effect on the
+      user's ability to interact with windows other than those associated
+      with hWnd.
+    taskmodal
+      Same as applmodal except that all the top-level windows belonging to
+      the current task are disabled if the hWnd parameter is NULL. Use
+      this flag when the calling application or library does not have a
+      window handle available but still needs to prevent input to other
+      windows in the current application without suspending other
+      applications.
+    
+    
+    In addition, you can specify the following flags: 
+    
+    default-desktop-only 
+      The desktop currently receiving input must be a default desktop;
+      otherwise, the function fails. A default desktop is one an
+      application runs on after the user has logged on.
+    help 
+      Adds a Help button to the message box. Choosing the Help button or
+      pressing F1 generates a Help event.
+    right 
+      The text is right-justified. 
+    rtlreading 
+      Displays message and caption text using right-to-left reading order
+      on Hebrew and Arabic systems.
+    setforeground 
+      The message box becomes the foreground window. Internally, Windows
+      calls the SetForegroundWindow function for the message box.
+    topmost 
+      The message box is created with the WS_EX_TOPMOST window style. 
+    service-notification 
+      Windows NT only: The caller is a service notifying the user of an
+      event. The function displays a message box on the current active
+      desktop, even if there is no user logged on to the computer.  If
+      this flag is set, the hWnd parameter must be NULL. This is so the
+      message box can appear on a desktop other than the desktop
+      corresponding to the hWnd.
+    
+
+  The return value is one of the following menu-item values returned by
+  the dialog box:
+   
+  abort
+    Abort button was selected. 
+  cancel
+    Cancel button was selected. 
+  ignore
+    Ignore button was selected. 
+  no
+    No button was selected. 
+  ok
+    OK button was selected. 
+  retry
+    Retry button was selected. 
+  yes
+    Yes button was selected. 
+  
+  If a message box has a Cancel button, the function returns the
+  `cancel' value if either the ESC key is pressed or the Cancel button
+  is selected.  If the message box has no Cancel button, pressing ESC has
+  no effect."
+  (flet ((dialog-box-modal-loop (thunk)
+          (let* ((frames (frame-list))
+                 (result
+                  ;; ok, this is extremely tricky.  normally a modal
+                  ;; dialog will pop itself down using (dialog-box-finish)
+                  ;; or (dialog-box-cancel), which throws back to this
+                  ;; catch.  but question dialog boxes pop down themselves
+                  ;; regardless, so a badly written question dialog box
+                  ;; that does not use (dialog-box-finish) could seriously
+                  ;; wedge us.  furthermore, we disable all other frames
+                  ;; in order to implement modality; we need to restore
+                  ;; them before the dialog box is destroyed, because
+                  ;; otherwise windows at least will notice that no top-
+                  ;; level window can have the focus and will shift the
+                  ;; focus to a different app, raising it and obscuring us.
+                  ;; so we create `delete-dialog-box-hook', which is
+                  ;; called right *before* the dialog box gets destroyed.
+                  ;; here, we put a hook on it, and when it's our dialog
+                  ;; box and not someone else's that's being destroyed,
+                  ;; we reenable all the frames and remove the hook.
+                  ;; BUT ...  we still have to deal with exiting the
+                  ;; modal loop in case it doesn't happen before us.
+                  ;; we can't do this until after the callbacks for this
+                  ;; dialog box get executed, and that doesn't happen until
+                  ;; after the dialog box is destroyed.  so to keep things
+                  ;; synchronous, we enqueue an eval event, which goes into
+                  ;; the same queue as the misc-user events encapsulating
+                  ;; the dialog callbacks and will go after it (because
+                  ;; destroying the dialog box happens after processing
+                  ;; its selection).  if the dialog boxes are written
+                  ;; properly, we don't see this eval event, because we've
+                  ;; already exited our modal loop. (Thus, we make sure the
+                  ;; function given in this eval event is actually defined
+                  ;; and does nothing.) If we do see it, though, we know
+                  ;; that we encountered a badly written dialog box and
+                  ;; need to exit now.  Currently we just return nil, but
+                  ;; maybe we should signal an error or issue a warning.
+                  (catch 'internal-dialog-box-finish
+                    (let ((id (eval thunk))
+                          (sym (gensym)))
+                      (fset sym
+                            `(lambda (did)
+                               (when (eq ',id did)
+                                 (mapc 'enable-frame ',frames)
+                                 (enqueue-eval-event
+                                  'internal-make-dialog-box-exit did)
+                                 (remove-hook 'delete-dialog-box-hook
+                                              ',sym))))
+                      (add-hook 'delete-dialog-box-hook sym)
+                      (mapc 'disable-frame frames)
+                      (block nil
+                        (while t
+                          (let ((event (next-event)))
+                            (if (and (eval-event-p event)
+                                     (eq (event-function event)
+                                         'internal-make-dialog-box-exit)
+                                     (eq (event-object event) id))
+                                (return '(nil))
+                              (dispatch-event event)))))))))
+            (if (listp result)
+                (car result)
+              (signal 'quit nil)))))
+    (case type
+      (general
+       (cl-parsing-keywords
+           ((:title "XEmacs")
+            (:parent (selected-frame))
+            :modal
+            :properties
+            :spec)
+           ()
+         (flet ((create-dialog-box-frame ()
+                  (let* ((ftop (frame-property cl-parent 'top))
+                         (fleft (frame-property cl-parent 'left))
+                         (fwidth (frame-pixel-width cl-parent))
+                         (fheight (frame-pixel-height cl-parent))
+                         (fonth (font-height (face-font 'default)))
+                         (fontw (font-width (face-font 'default)))
+                         (cl-properties (append cl-properties
+                                                dialog-frame-plist))
+                         (dfheight (plist-get cl-properties 'height))
+                         (dfwidth (plist-get cl-properties 'width))
+                         (unmapped (plist-get cl-properties
+                                              'initially-unmapped))
+                         (gutter-spec cl-spec)
+                         (name (or (plist-get cl-properties 'name) "XEmacs"))
+                         (frame nil))
+                    (plist-remprop cl-properties 'initially-unmapped)
+                    ;; allow the user to just provide a glyph
+                    (or (glyphp cl-spec) (setq cl-spec (make-glyph cl-spec)))
+                    (setq gutter-spec (copy-sequence "\n"))
+                    (set-extent-begin-glyph (make-extent 0 1 gutter-spec)
+                                            cl-spec)
+                    ;; under FVWM at least, if I don't specify the
+                    ;; initial position, it ends up always at (0, 0).
+                    ;; xwininfo doesn't tell me that there are any
+                    ;; program-specified position hints, so it must be
+                    ;; an FVWM bug.  So just be smashing and position in
+                    ;; the center of the selected frame.
+                    (setq frame
+                          (make-frame
+                           (append cl-properties
+                                   `(popup ,cl-parent initially-unmapped t
+                                           menubar-visible-p nil
+                                           has-modeline-p nil
+                                           default-toolbar-visible-p nil
+                                           top-gutter-visible-p t
+                                           top-gutter-height ,
+                                           (* dfheight fonth)
+                                           top-gutter ,gutter-spec
+                                           minibuffer none
+                                           name ,name
+                                           modeline-shadow-thickness 0
+                                           vertical-scrollbar-visible-p nil
+                                           horizontal-scrollbar-visible-p nil
+                                           unsplittable t
+                                           left ,(+ fleft (- (/ fwidth 2)
+                                                             (/ (* dfwidth
+                                                                   fontw)
+                                                                2)))
+                                           top ,(+ ftop (- (/ fheight 2)
+                                                           (/ (* dfheight
+                                                                 fonth)
+                                                              2)))))))
+                    (set-face-foreground 'modeline [default foreground] frame)
+                    (set-face-background 'modeline [default background] frame)
+                    (unless unmapped (make-frame-visible frame))
+                    (let ((newbuf (generate-new-buffer " *dialog box*")))
+                      (set-buffer-dedicated-frame newbuf frame)
+                      (set-frame-property frame 'dialog-box-buffer newbuf)
+                      (with-current-buffer newbuf
+                        (setq frame-title-format cl-title)
+                        (make-local-hook 'delete-frame-hook)
+                        (add-hook 'delete-frame-hook
+                                  #'(lambda (frame)
+                                      (kill-buffer
+                                       (frame-property
+                                        frame
+                                        'dialog-box-buffer))))))
+                    frame)))
+           (if cl-modal
+               (dialog-box-modal-loop '(create-dialog-box-frame))
+             (create-dialog-box-frame)))))
+      (question
+       (cl-parsing-keywords
+           ((:modal nil))
+           t
+         (remf cl-keys :modal)
+         (if cl-modal
+             (dialog-box-modal-loop `(make-dialog-box-internal ',type
+                                                               ',cl-keys))
+           (make-dialog-box-internal type cl-keys))))
+      (t
+       (make-dialog-box-internal type cl-keys)))))
+
+(defun dialog-box-finish (result)
+  "Exit a modal dialog box, returning RESULT.
+This is meant to be executed from a dialog box callback function."
+  (throw 'internal-dialog-box-finish (list result)))
+
+(defun dialog-box-cancel ()
+  "Cancel a modal dialog box.
+This is meant to be executed from a dialog box callback function."
+  (throw 'internal-dialog-box-finish 'cancel))
+
+;; an eval event, used as a trigger inside of the dialog modal loop.
+(defun internal-make-dialog-box-exit (did)
+  nil)
+
+(make-obsolete 'popup-dialog-box 'make-dialog-box)
+(defun popup-dialog-box (desc)
+  "Obsolete equivalent of (make-dialog-box 'question ...).
+
+\(popup-dialog-box (QUESTION BUTTONS ...)
+
+is equivalent to
 
+\(make-dialog-box 'question :question QUESTION :buttons BUTTONS)"
+  (check-argument-type 'stringp (car desc))
+  (or (consp (cdr desc))
+      (error 'syntax-error
+            "Dialog descriptor must supply at least one button"
+            desc))
+  (make-dialog-box 'question :question (car desc) :buttons (cdr desc)))
 
 ;;; dialog.el ends here
index 9c46f55..1250482 100644 (file)
@@ -3,7 +3,7 @@
 ;; Copyright (C) 1998 Oliver Graf <ograf@fga.de>
 
 ;; Maintainer: XEmacs Development Team, Oliver Graf <ograf@fga.de>
-;; Keywords: drag, drop, dumped
+;; Keywords: mouse, gui, dumped
 
 ;; This file is part of XEmacs.
 
@@ -244,8 +244,8 @@ Finds files and URLs. Returns nil if object does not contain URL data."
                   ;; to-do: open ftp URLs with efs...
                   (t 
                    ;; some other URL, try to fire up some browser for it
-                   (if (boundp 'browse-url-browser-function)
-                       (funcall browse-url-browser-function (car data))
+                   (if (fboundp 'browse-url)
+                       (browse-url (car data))
                      (display-message 'error 
                        "Can't show URL, no browser selected"))))
             (undo-boundary)
index 884c9a0..7b7d338 100644 (file)
        "fill"
        "auto-save"             ; Added for 20.4
        "movemail"              ; Added for 21.2
-       (when-feature windows-nt "winnt")
+       (when-feature windows-nt "win32-native")
        (when-feature lisp-float-type "float-sup")
        "itimer"                ; for vars auto-save-timeout and
                                ; auto-gc-threshold
        "itimer-autosave"
        "printer"
+
+       ;;;;;;;;;;;;;;;;;; GUI support
+       (when-feature window-system "gui")
+       (when-feature window-system "mouse")
+       (when-feature window-system "mode-motion")
        (when-feature toolbar "toolbar")
        (when-feature scrollbar "scrollbar")
        (when-feature menubar "menubar")
        (when-feature dialog "dialog")
-       (when-feature mule "mule-charset")
+       (when-feature gutter "gutter")
+       (when-feature dragdrop-api "dragdrop")
+       "select"
+
+       ;;;;;;;;;;;;;;;;;; Content for GUI's
+       ;; There used to be window-system inserted in the when-feature,
+       ;; but IMHO your configure script should turn off the menubar,
+       ;; toolbar, etc. features when there is no window system.  We
+       ;; should just be able to assume that, if (featurep 'menubar),
+       ;; the menubar should work and if items are added, they can be
+       ;; seen clearly and usefully.
+       (when-feature (and (not infodock) menubar) "menubar-items")
+       (when-feature (and gutter) "gutter-items")
+       (when-feature (and (not infodock) toolbar) "toolbar-items")
+       (when-feature (and (not infodock) dialog) "dialog-items")
+
+       ;;;;;;;;;;;;;;;;;; Coding-system support
        (when-feature file-coding "coding")
-       (when-feature mule "mule-coding")
-;; Handle I/O of files with extended characters.
        (when-feature file-coding "code-files")
-;; Handle process with encoding/decoding non-ascii coding-system.
        (when-feature file-coding "code-process")
+
+       ;;;;;;;;;;;;;;;;;; MULE support
+       (when-feature mule "mule-charset")
+       (when-feature mule "mule-coding")
+       ;; All files after this can have extended characters in them.
        (when-feature mule "mule-help")
-;; Load the remaining basic files.
        (when-feature mule "mule-category")
        (when-feature mule "mule-ccl")
        (when-feature mule "mule-misc")
 ;; Moved to sunpro-load.el - the default only for Sun.
 ;;(pureload "mime-setup")
 ;;; mule-load.el ends here
-       (when-feature (and gutter window-system) "gutter")
-       (when-feature window-system "gui")
-       (when-feature window-system "mode-motion")
-       (when-feature window-system "mouse")
-       "select"
-       (when-feature dragdrop-api "dragdrop")
-;; preload the X code, for faster startup.
-       (when-feature (and (not infodock)
-                          (or x mswindows) menubar) "menubar-items")
+
+;; preload InfoDock stuff.  should almost certainly not be here if
+;; id-menus is not here.  infodock needs to figure out a clever way to
+;; advise this stuff or we need to export a clean way for infodock or
+;; others to control this programmatically.
        (when-feature (and infodock (or x mswindows) menubar) "id-menus")
-       (when-feature (and gutter window-system) "gutter-items")
+;; preload the X code.
        (when-feature x "x-faces")
        (when-feature x "x-iso8859-1")
        (when-feature x "x-mouse")
        (when-feature (and x scrollbar) "x-scrollbar")
        (when-feature x "x-misc")
        (when-feature x "x-init")
-       (when-feature (and (not infodock)
-                          window-system toolbar) "toolbar-items")
        (when-feature x "x-win-xfree86")
        (when-feature x "x-win-sun")
 ;; preload the mswindows code.
index 8059470..6673789 100644 (file)
@@ -24,7 +24,7 @@
 ;; 02111-1307, USA.
 
 ;;; Synched up with: Not synched with FSF but coordinated with the FSF
-;;;                  easymenu maintor for compatibility with FSF 20.4.
+;;;                  easymenu maintainer for compatibility with FSF 20.4.
 ;;; Please: Coordinate changes with Inge Frick <inge@nada.kth.se>
 
 ;; Commentary:
 
 ;; Easymenu allows you to define menus for both Emacs 19 and XEmacs.
 
-;; This file 
+;; This file
 ;; The advantages of using easymenu are:
 
 ;; - Easier to use than either the Emacs 19 and XEmacs menu syntax.
 
-;; - Common interface for Emacs 18, Emacs 19, and XEmacs.  
+;; - Common interface for Emacs 18, Emacs 19, and XEmacs.
 ;;   (The code does nothing when run under Emacs 18).
 
 ;; The public functions are:
 
 ;; - Function: easy-menu-define SYMBOL MAPS DOC MENU
 ;;     SYMBOL is both the name of the variable that holds the menu and
-;;            the name of a function that will present a the menu.
+;;            the name of a function that will present the menu.
 ;;     MAPS is a list of keymaps where the menu should appear in the menubar.
 ;;     DOC is the documentation string for the variable.
-;;     MENU is an XEmacs style menu description.  
+;;     MENU is an XEmacs style menu description.
 
 ;;     See the documentation for easy-menu-define for details.
 
 ;; - Function: easy-menu-change PATH NAME ITEMS
 ;;     Change an existing menu.
 ;;     The menu must already exist and be visible on the menu bar.
-;;     PATH is a list of strings used for locating the menu on the menu bar. 
-;;     NAME is the name of the menu.  
+;;     PATH is a list of strings used for locating the menu on the menu bar.
+;;     NAME is the name of the menu.
 ;;     ITEMS is a list of menu items, as defined in `easy-menu-define'.
 
 ;; - Function: easy-menu-add MENU [ MAP ]
@@ -105,7 +105,7 @@ or a list to evaluate when the item is chosen.
 ENABLE is an expression; the item is enabled for selection
 whenever this expression's value is non-nil.
 
-Alternatively, a menu item may have the form: 
+Alternatively, a menu item may have the form:
 
    [ NAME CALLBACK [ KEYWORD ARG ] ... ]
 
@@ -125,13 +125,13 @@ whenever this expression's value is non-nil.
 NAME is a string; the name of an argument to CALLBACK.
 
    :style STYLE
-   
+
 STYLE is a symbol describing the type of menu item.  The following are
-defined:  
+defined:
 
-toggle: A checkbox.  
+toggle: A checkbox.
         Currently just prepend the name with the string \"Toggle \".
-radio: A radio button. 
+radio: A radio button.
 nil: An ordinary menu item.
 
    :selected SELECTED
@@ -153,15 +153,14 @@ is a list of menu items, as above."
      (easy-menu-do-define (quote ,symbol) ,maps ,doc ,menu)))
 
 (defun easy-menu-do-define (symbol maps doc menu)
-  (if (featurep 'menubar)
-      (progn
-       (set symbol menu)
-       (fset symbol (list 'lambda '(e)
-                          doc
-                          '(interactive "@e")
-                          '(run-hooks 'activate-menubar-hook)
-                          '(setq zmacs-region-stays 't)
-                          (list 'popup-menu symbol))))))
+  (when (featurep 'menubar)
+    (set symbol menu)
+    (fset symbol `(lambda (e)
+                   ,doc
+                   (interactive "@e")
+                   (run-hooks 'activate-menubar-hook)
+                   (setq zmacs-region-stays 't)
+                   (popup-menu ,symbol)))))
 
 (defun easy-menu-change (&rest args)
   (when (featurep 'menubar)
@@ -174,42 +173,48 @@ is a list of menu items, as above."
 
 (defun easy-menu-add (menu &optional map)
   "Add MENU to the current menu bar."
-  (if (featurep 'menubar)
-      (progn
-       (unless (member menu easy-menu-all-popups)
-         (push menu easy-menu-all-popups))
-       (setq mode-popup-menu (if (> (length easy-menu-all-popups) 1)
-                                 (cons (easy-menu-title)
-                                       (reverse easy-menu-all-popups))
-                               (car easy-menu-all-popups)))
-
-       (cond ((null current-menubar)
-              ;; Don't add it to a non-existing menubar.
-              nil)
-             ((assoc (car menu) current-menubar)
-              ;; Already present.
-              nil)
-             ((equal current-menubar '(nil))
-              ;; Set at left if only contains right marker.
-              (set-buffer-menubar (list menu nil)))
-             (t
-              ;; Add at right.
-              (set-buffer-menubar (copy-sequence current-menubar))
-              (add-menu nil (car menu) (cdr menu)))))))
+  (when (featurep 'menubar)
+    (unless (member menu easy-menu-all-popups)
+      (push menu easy-menu-all-popups))
+    (setq mode-popup-menu (if (> (length easy-menu-all-popups) 1)
+                             (cons (easy-menu-title)
+                                   (reverse easy-menu-all-popups))
+                           (let ((same-as-menu
+                                  (car easy-menu-all-popups)))
+                             (cons (normalize-menu-item-name
+                                    (car same-as-menu))
+                                   (cdr same-as-menu)))))
+
+    (cond ((null current-menubar)
+          ;; Don't add it to a non-existing menubar.
+          nil)
+         ((assoc (car menu) current-menubar)
+          ;; Already present.
+          nil)
+         ((equal current-menubar '(nil))
+          ;; Set at left if only contains right marker.
+          (set-buffer-menubar (list menu nil)))
+         (t
+          ;; Add at right.
+          (set-buffer-menubar (copy-sequence current-menubar))
+          (add-menu nil (car menu) (cdr menu))))))
 
 (defun easy-menu-remove (menu)
   "Remove MENU from the current menu bar."
-  (if (featurep 'menubar)
-      (progn
-       (setq easy-menu-all-popups (delq menu easy-menu-all-popups)
-             mode-popup-menu (if (< (length easy-menu-all-popups) 1)
-                                 (cons (easy-menu-title)
-                                       (reverse easy-menu-all-popups))
-                               (car easy-menu-all-popups)))
-
-       (and current-menubar
-            (assoc (car menu) current-menubar)
-            (delete-menu-item (list (car menu)))))))
+  (when (featurep 'menubar)
+    (setq easy-menu-all-popups (delq menu easy-menu-all-popups)
+         mode-popup-menu (if (< (length easy-menu-all-popups) 1)
+                             (cons (easy-menu-title)
+                                   (reverse easy-menu-all-popups))
+                           (let ((same-as-menu
+                                  (car easy-menu-all-popups)))
+                             (cons (normalize-menu-item-name
+                                    (car same-as-menu))
+                                   (cdr same-as-menu)))))
+
+    (and current-menubar
+        (assoc (car menu) current-menubar)
+        (delete-menu-item (list (car menu))))))
 
 (defsubst easy-menu-normalize (menu)
   (if (symbolp menu)
@@ -217,14 +222,14 @@ is a list of menu items, as above."
     menu))
 
 (defun easy-menu-add-item (menu path item &optional before)
-  "At the end of the submenu of MENU with path PATH add ITEM.
+  "At the end of the submenu of MENU with path PATH, add ITEM.
 If ITEM is already present in this submenu, then this item will be changed.
 otherwise ITEM will be added at the end of the submenu, unless the optional
 argument BEFORE is present, in which case ITEM will instead be added
 before the item named BEFORE.
 MENU is either a symbol, which have earlier been used as the first
 argument in a call to `easy-menu-define', or the value of such a symbol
-i.e. a menu, or nil which stands for the current menubar.
+i.e. a menu, or nil, which stands for the current menubar.
 PATH is a list of strings for locating the submenu where ITEM is to be
 added.  If PATH is nil, MENU itself is used.  Otherwise, the first
 element should be the name of a submenu directly under MENU.  This
@@ -232,26 +237,30 @@ submenu is then traversed recursively with the remaining elements of PATH.
 ITEM is either defined as in `easy-menu-define', a menu defined earlier
 by `easy-menu-define' or `easy-menu-create-menu' or an item returned
 from `easy-menu-item-present-p' or `easy-menu-remove-item'."
-  (add-menu-button path item before (easy-menu-normalize menu)))                  
+  (when (featurep 'menubar)
+    (add-menu-button path item before (easy-menu-normalize menu))))
 
 (defun easy-menu-item-present-p (menu path name)
   "In submenu of MENU with path PATH, return true iff item NAME is present.
 MENU and PATH are defined as in `easy-menu-add-item'.
 NAME should be a string, the name of the element to be looked for.
 
-The return value can be used as as an argument to `easy-menu-add-item'."
-  (car (find-menu-item (or (easy-menu-normalize menu) current-menubar)
-                      (append path (list name)))))
+The return value can be used as an argument to `easy-menu-add-item'."
+  (if (featurep 'menubar)
+      (car (find-menu-item (or (easy-menu-normalize menu) current-menubar)
+                          (append path (list name))))
+    nil))
 
 (defun easy-menu-remove-item (menu path name)
-  "From submenu of MENU with path PATH remove item NAME.
+  "From submenu of MENU with path PATH, remove item NAME.
 MENU and PATH are defined as in `easy-menu-add-item'.
 NAME should be a string, the name of the element to be removed.
 
-The return value can be used as as an argument to `easy-menu-add-item'."
-  (delete-menu-item (append path (list name))
-                   (easy-menu-normalize menu)))
-  
+The return value can be used as an argument to `easy-menu-add-item'."
+  (when (featurep 'menubar)
+    (delete-menu-item (append path (list name))
+                     (easy-menu-normalize menu))))
+
 
 
 
index 37f0752..4647b44 100644 (file)
@@ -1,6 +1,7 @@
 ;;; extents.el --- miscellaneous extent functions not written in C
 
 ;; Copyright (C) 1993-4, 1997 Free Software Foundation, Inc.
+;; Copyright (C) 2000 Ben Wing.
 
 ;; Keywords: internal, dumped
 
 
 ;;; Commentary:
 
-;; some help from stig@hackvan.com here.
+;;; Authorship:
+
+;; Created 1995 Ben Wing.
+;; mapcar-extents (and extent-list?) from stig@hackvan.com, c. 1996.
 
 ;;; Code:
 
@@ -53,7 +57,7 @@ PREDICATE or FUNCTION.  See also `map-extents'."
                  buffer-or-string from to nil flags property value)
     (nreverse *result*)))
 
-(defun extent-list (&optional buffer-or-string from to flags)
+(defun extent-list (&optional buffer-or-string from to flags property value)
   "Return a list of the extents in BUFFER-OR-STRING.
 BUFFER-OR-STRING defaults to the current buffer if omitted.
 FROM and TO can be used to limit the range over which extents are
@@ -65,11 +69,28 @@ are included in the list.  FROM and TO default to the beginning and
 end of BUFFER-OR-STRING, respectively.
 
 FLAGS controls how end cases are treated.  For a discussion of this,
-and exactly what ``overlap'' means, see `map-extents'.
+and exactly what ``overlap'' means, see `map-extents'.  PROPERTY and VALUE
+are also as in `map-extents'.
 
 If you want to map a function over the extents in a buffer or string,
-consider using `map-extents' or `mapcar-extents' instead."
-  (mapcar-extents 'identity nil buffer-or-string from to flags))
+consider using `map-extents' or `mapcar-extents' instead.
+
+See also `extents-at'."
+  (mapcar-extents 'identity nil buffer-or-string from to flags property value))
+
+(defun extent-at-event (event &optional property before at-flag)
+  "Return the smallest extent under EVENT, if any.
+PROPERTY, BEFORE, and AT-FLAG are as in `extent-at'."
+  (let* ((win (event-window event))
+        (p (event-point event)))
+    (and win p (extent-at p (window-buffer win) property before at-flag))))
+
+(defun extents-at-event (event &optional property before at-flag)
+  "Return a list of all extents under EVENT.
+PROPERTY, BEFORE, and AT-FLAG are as in `extent-at'."
+  (let* ((win (event-window event))
+        (p (event-point event)))
+    (and win p (extents-at p (window-buffer win) property before at-flag))))
 
 (defun extent-string (extent)
   "Return the string delimited by the bounds of EXTENT."
index 156de24..eff6c16 100644 (file)
@@ -117,19 +117,20 @@ The return value will be a list of instantiators (e.g. strings
 The specifications in a specifier determine what the value of
   PROPERTY will be in a particular \"domain\" or set of circumstances,
   which is typically a particular Emacs window along with the buffer
-  it contains and the frame and device it lies within.  The value
-  is derived from the instantiator associated with the most specific
+  it contains and the frame and device it lies within.  The value is
+  derived from the instantiator associated with the most specific
   locale (in the order buffer, window, frame, device, and 'global)
   that matches the domain in question.  In other words, given a domain
-  (i.e. an Emacs window, usually), the specifier for PROPERTY will first
-  be searched for a specification whose locale is the buffer contained
-  within that window; then for a specification whose locale is the window
-  itself; then for a specification whose locale is the frame that the
-  window is contained within; etc.  The first instantiator that is
-  valid for the domain (usually this means that the instantiator is
-  recognized by the device [i.e. the X server or TTY device] that the
-  domain is on.  The function `face-property-instance' actually does
-  all this, and is used to determine how to display the face.
+  (i.e. an Emacs window, usually), the specifier for PROPERTY will
+  first be searched for a specification whose locale is the buffer
+  contained within that window; then for a specification whose locale
+  is the window itself; then for a specification whose locale is the
+  frame that the window is contained within; etc.  The first
+  instantiator that is valid for the domain (usually this means that
+  the instantiator is recognized by the device [i.e. MS Windows, the X
+  server or TTY device] that the domain is on.  The function
+  `face-property-instance' actually does all this, and is used to
+  determine how to display the face.
 
 See `set-face-property' for the built-in property-names."
 
@@ -304,7 +305,7 @@ The following symbols have predefined meanings:
                     This should be a vector of 256 elements.
 
  background-pixmap  The pixmap displayed in the background of the face.
-                    Only used by faces on X devices.
+                    Only used by faces on X and MS Windows devices.
                     For valid instantiators, see `make-image-specifier'.
 
  underline          Underline all text covered by this face.
@@ -794,7 +795,8 @@ See `face-property-instance' for the semantics of the DOMAIN argument."
 ;; WE DEMAND LEXICAL SCOPING!!!
 ;; WE DEMAND LEXICAL SCOPING!!!
 ;; WE DEMAND LEXICAL SCOPING!!!
-(defun frob-face-property (face property func &optional locale tags)
+(defun frob-face-property (face property func device-tags &optional
+locale tags)
   "Change the specifier for FACE's PROPERTY according to FUNC, in LOCALE.
 This function is ugly and messy and is primarily used as an internal
 helper function for `make-face-bold' et al., so you probably don't
@@ -813,13 +815,19 @@ until a non-nil result is found (if there is no such result, the
 first valid instantiator is used), and that result substituted for
 the specification; otherwise, the process just outlined is
 iterated over each existing device and the concatenated results
-substituted for the specification."
+substituted for the specification.
+
+DEVICE-TAGS is a list of tags that each device must match in order for
+the function to be called on it."
   (let ((sp (face-property face property))
        temp-sp)
     (if (valid-specifier-domain-p locale)
        ;; this is easy.
        (let* ((inst (face-property-instance face property locale))
-              (name (and inst (funcall func inst (dfw-device locale)))))
+              (name (and inst
+                         (device-matches-specifier-tag-set-p
+                          (dfw-device locale) device-tags)
+                         (funcall func inst (dfw-device locale)))))
          (when name
            (add-spec-to-specifier sp name locale tags)))
       ;; otherwise, map over all specifications ...
@@ -852,10 +860,15 @@ substituted for the specification."
                ;; Otherwise map frob-face-property-1 over each device.
                (result
                 (if device
-                    (list (frob-face-property-1 sp-arg device inst-list func))
+                    (list (and (device-matches-specifier-tag-set-p
+                                device device-tags)
+                               (frob-face-property-1 sp-arg device inst-list
+                                                     func)))
                   (mapcar (lambda (device)
-                            (frob-face-property-1 sp-arg device
-                                                  inst-list func))
+                            (and (device-matches-specifier-tag-set-p
+                                  device device-tags)
+                                 (frob-face-property-1 sp-arg device
+                                                       inst-list func)))
                           (device-list))))
                new-result)
           ;; remove duplicates and nils from the obtained list of
@@ -866,7 +879,7 @@ substituted for the specification."
                           (setq arg (cons tags arg))
                         (setcar arg (append tags (delete 'default
                                                          (car arg))))))
-                    (when (and arg (not (member arg new-result)))                     
+                    (when (and arg (not (member arg new-result)))
                       (setq new-result (cons arg new-result))))
                   result)
           ;; add back in.
@@ -895,14 +908,14 @@ substituted for the specification."
     (or result first-valid)))
 
 (defun frob-face-font-2 (face locale tags unfrobbed-face frobbed-face
-                             tty-thunk x-thunk standard-face-mapping)
+                             tty-thunk ws-thunk standard-face-mapping)
   ;; another kludge to make things more intuitive.  If we're
   ;; inheriting from a standard face in this locale, frob the
-  ;; inheritance as appropriate.  Else, if, after the first X frobbing
-  ;; pass, the face hasn't changed and still looks like the standard
-  ;; unfrobbed face (e.g. 'default), make it inherit from the standard
-  ;; frobbed face (e.g. 'bold).  Regardless of things, do the TTY
-  ;; frobbing.
+  ;; inheritance as appropriate.  Else, if, after the first
+  ;; window-system frobbing pass, the face hasn't changed and still
+  ;; looks like the standard unfrobbed face (e.g. 'default), make it
+  ;; inherit from the standard frobbed face (e.g. 'bold).  Regardless
+  ;; of things, do the TTY frobbing.
 
   ;; yuck -- The LOCALE argument to make-face-bold is not actually a locale,
   ;; but is a "locale, locale-type, or nil for all".  So ...  do our extra
@@ -930,7 +943,7 @@ substituted for the specification."
                           (t nil)))
             (inst (and domain (face-property-instance face 'font domain))))
        (funcall tty-thunk)
-       (funcall x-thunk)
+       (funcall ws-thunk)
        ;; If it's reasonable to do the inherit-from-standard-face trick,
        ;; and it's called for, then do it now.
        (or (null domain)
@@ -946,7 +959,7 @@ substituted for the specification."
 
 (defun make-face-bold (face &optional locale tags)
   "Make FACE bold in LOCALE, if possible.
-This will attempt to make the font bold for X locales and will set the
+This will attempt to make the font bold for X/MSW locales and will set the
 highlight flag for TTY locales.
 
 If LOCALE is nil, omitted, or `all', this will attempt to frob all
@@ -979,11 +992,13 @@ circumstances."
      (when (featurep 'tty)
        (set-face-highlight-p face t locale (cons 'tty tags))))
    (lambda ()
-     ;; handle X specific entries
+     ;; handle X/MS Windows specific entries
      (when (featurep 'x)
-       (frob-face-property face 'font 'x-make-font-bold locale tags))
+       (frob-face-property face 'font 'x-make-font-bold
+                          '(x) locale tags))
      (when (featurep 'mswindows)
-       (frob-face-property face 'font 'mswindows-make-font-bold locale tags))
+       (frob-face-property face 'font 'mswindows-make-font-bold
+                          '(mswindows) locale tags))
      )
    '(([default] . [bold])
      ([bold] . t)
@@ -992,10 +1007,10 @@ circumstances."
 
 (defun make-face-italic (face &optional locale tags)
   "Make FACE italic in LOCALE, if possible.
-This will attempt to make the font italic for X locales and will set
-the underline flag for TTY locales.
-See `make-face-bold' for the semantics of the LOCALE argument and
-for more specifics on exactly how this function works."
+This will attempt to make the font italic for X/MS Windows locales and
+will set the underline flag for TTY locales.  See `make-face-bold' for
+the semantics of the LOCALE argument and for more specifics on exactly
+how this function works."
   (interactive (list (read-face-name "Make which face italic: ")))
   (frob-face-font-2
    face locale tags 'default 'italic
@@ -1006,9 +1021,11 @@ for more specifics on exactly how this function works."
    (lambda ()
      ;; handle X specific entries
      (when (featurep 'x)
-       (frob-face-property face 'font 'x-make-font-italic locale tags))
+       (frob-face-property face 'font 'x-make-font-italic
+                          '(x) locale tags))
      (when (featurep 'mswindows)
-       (frob-face-property face 'font 'mswindows-make-font-italic locale tags))
+       (frob-face-property face 'font 'mswindows-make-font-italic
+                          '(mswindows) locale tags))
      )
    '(([default] . [italic])
      ([bold] . [bold-italic])
@@ -1017,10 +1034,10 @@ for more specifics on exactly how this function works."
 
 (defun make-face-bold-italic (face &optional locale tags)
   "Make FACE bold and italic in LOCALE, if possible.
-This will attempt to make the font bold-italic for X locales and will
-set the highlight and underline flags for TTY locales.
-See `make-face-bold' for the semantics of the LOCALE argument and
-for more specifics on exactly how this function works."
+This will attempt to make the font bold-italic for X/MS Windows
+locales and will set the highlight and underline flags for TTY
+locales.  See `make-face-bold' for the semantics of the LOCALE
+argument and for more specifics on exactly how this function works."
   (interactive (list (read-face-name "Make which face bold-italic: ")))
   (frob-face-font-2
    face locale tags 'default 'bold-italic
@@ -1032,9 +1049,11 @@ for more specifics on exactly how this function works."
    (lambda ()
      ;; handle X specific entries
      (when (featurep 'x)
-       (frob-face-property face 'font 'x-make-font-bold-italic locale tags))
+       (frob-face-property face 'font 'x-make-font-bold-italic
+                          '(x) locale tags))
      (when (featurep 'mswindows)
-       (frob-face-property face 'font 'mswindows-make-font-bold-italic locale tags))
+       (frob-face-property face 'font 'mswindows-make-font-bold-italic
+                          '(mswindows) locale tags))
      )
    '(([default] . [italic])
      ([bold] . [bold-italic])
@@ -1043,10 +1062,10 @@ for more specifics on exactly how this function works."
 
 (defun make-face-unbold (face &optional locale tags)
   "Make FACE non-bold in LOCALE, if possible.
-This will attempt to make the font non-bold for X locales and will
-unset the highlight flag for TTY locales.
-See `make-face-bold' for the semantics of the LOCALE argument and
-for more specifics on exactly how this function works."
+This will attempt to make the font non-bold for X/MS Windows locales
+and will unset the highlight flag for TTY locales.  See
+`make-face-bold' for the semantics of the LOCALE argument and for more
+specifics on exactly how this function works."
   (interactive (list (read-face-name "Make which face non-bold: ")))
   (frob-face-font-2
    face locale tags 'bold 'default
@@ -1057,9 +1076,11 @@ for more specifics on exactly how this function works."
    (lambda ()
      ;; handle X specific entries
      (when (featurep 'x)
-       (frob-face-property face 'font 'x-make-font-unbold locale tags))
+       (frob-face-property face 'font 'x-make-font-unbold
+                          '(x) locale tags))
      (when (featurep 'mswindows)
-       (frob-face-property face 'font 'mswindows-make-font-unbold locale tags))
+       (frob-face-property face 'font 'mswindows-make-font-unbold
+                          '(mswindows) locale tags))
      )
    '(([default] . t)
      ([bold] . [default])
@@ -1068,10 +1089,10 @@ for more specifics on exactly how this function works."
 
 (defun make-face-unitalic (face &optional locale tags)
   "Make FACE non-italic in LOCALE, if possible.
-This will attempt to make the font non-italic for X locales and will
-unset the underline flag for TTY locales.
-See `make-face-bold' for the semantics of the LOCALE argument and
-for more specifics on exactly how this function works."
+This will attempt to make the font non-italic for X/MS Windows locales
+and will unset the underline flag for TTY locales.  See
+`make-face-bold' for the semantics of the LOCALE argument and for more
+specifics on exactly how this function works."
   (interactive (list (read-face-name "Make which face non-italic: ")))
   (frob-face-font-2
    face locale tags 'italic 'default
@@ -1082,9 +1103,11 @@ for more specifics on exactly how this function works."
    (lambda ()
      ;; handle X specific entries
      (when (featurep 'x)
-       (frob-face-property face 'font 'x-make-font-unitalic locale tags))
+       (frob-face-property face 'font 'x-make-font-unitalic
+                          '(x) locale tags))
      (when (featurep 'mswindows)
-       (frob-face-property face 'font 'mswindows-make-font-unitalic locale tags))
+       (frob-face-property face 'font 'mswindows-make-font-unitalic
+                          '(mswindows) locale tags))
      )
    '(([default] . t)
      ([bold] . t)
@@ -1103,9 +1126,11 @@ because they don't make sense in this context."
   (interactive (list (read-face-name "Shrink which face: ")))
   ;; handle X specific entries
   (when (featurep 'x)
-    (frob-face-property face 'font 'x-find-smaller-font locale))
+    (frob-face-property face 'font 'x-find-smaller-font
+                       '(x) locale))
   (when (featurep 'mswindows)
-    (frob-face-property face 'font 'mswindows-find-smaller-font locale)))
+    (frob-face-property face 'font 'mswindows-find-smaller-font
+                       '(mswindows) locale)))
 
 (defun make-face-larger (face &optional locale)
   "Make the font of FACE be larger, if possible.
@@ -1113,9 +1138,11 @@ See `make-face-smaller' for the semantics of the LOCALE argument."
   (interactive (list (read-face-name "Enlarge which face: ")))
   ;; handle X specific entries
   (when (featurep 'x)
-    (frob-face-property face 'font 'x-find-larger-font locale))
+    (frob-face-property face 'font 'x-find-larger-font
+                       '(x) locale))
   (when (featurep 'mswindows)
-    (frob-face-property face 'font 'mswindows-find-larger-font locale)))
+    (frob-face-property face 'font 'mswindows-find-larger-font
+                       '(mswindows) locale)))
 
 (defun invert-face (face &optional locale)
   "Swap the foreground and background colors of the face."
@@ -1248,7 +1275,7 @@ See `defface' for information about SPEC."
 
 (defvar default-custom-frame-properties nil
   "The frame properties used for the global faces.
-Frames not matching these propertiess should have frame local faces.
+Frames not matching these properties should have frame local faces.
 The value should be nil, if uninitialized, or a plist otherwise.
 See `defface' for a list of valid keys and values for the plist.")
 
index 796d49e..af78d9b 100644 (file)
@@ -873,23 +873,31 @@ If there is no such live buffer, return nil."
 (defun insert-file-contents-literally (filename &optional visit beg end replace)
   "Like `insert-file-contents', q.v., but only reads in the file.
 A buffer may be modified in several ways after reading into the buffer due
-to advanced Emacs features, such as file-name-handlers, format decoding,
-find-file-hooks, etc.
+to advanced Emacs features, such as format decoding, character code
+conversion,find-file-hooks, automatic uncompression, etc.
+
   This function ensures that none of these modifications will take place."
-  (let ((file-name-handler-alist nil)
-       (format-alist nil)
-       (after-insert-file-functions nil)
-       (find-buffer-file-type-function
-        (if (fboundp 'find-buffer-file-type)
-            (symbol-function 'find-buffer-file-type)
-          nil)))
-    (unwind-protect
-       (progn
-         (fset 'find-buffer-file-type (lambda (filename) t))
-         (insert-file-contents filename visit beg end replace))
-      (if find-buffer-file-type-function
-         (fset 'find-buffer-file-type find-buffer-file-type-function)
-       (fmakunbound 'find-buffer-file-type)))))
+  (let ((wrap-func (find-file-name-handler filename
+                                          'insert-file-contents-literally)))
+    (if wrap-func 
+       (funcall wrap-func 'insert-file-contents-literally filename
+                visit beg end replace)
+      (let ((file-name-handler-alist nil)
+           (format-alist nil)
+           (after-insert-file-functions nil)
+           (coding-system-for-read 'binary)
+           (coding-system-for-write 'binary)
+           (find-buffer-file-type-function
+            (if (fboundp 'find-buffer-file-type)
+                (symbol-function 'find-buffer-file-type)
+              nil)))
+       (unwind-protect
+           (progn
+             (fset 'find-buffer-file-type (lambda (filename) t))
+             (insert-file-contents filename visit beg end replace))
+         (if find-buffer-file-type-function
+             (fset 'find-buffer-file-type find-buffer-file-type-function)
+           (fmakunbound 'find-buffer-file-type)))))))
 
 (defun find-file-noselect (filename &optional nowarn rawfile)
   "Read file FILENAME into a buffer and return the buffer.
@@ -1170,6 +1178,7 @@ run `normal-mode' explicitly."
     ("/\\.\\(?:bash_\\|z\\)?\\(profile\\|login\\|logout\\)\\'" . sh-mode)
     ("/\\.\\(?:[ckz]sh\\|bash\\|tcsh\\|es\\|xinit\\|startx\\)rc\\'" . sh-mode)
     ("/\\.\\(?:[kz]shenv\\|xsession\\)\\'" . sh-mode)
+    ("\\.m?spec$" .sh-mode)
     ;; The following come after the ChangeLog pattern for the sake of
     ;; ChangeLog.1, etc. and after the .scm.[0-9] pattern too.
     ("\\.[12345678]\\'" . nroff-mode)
index fdd3cc2..cc16201 100644 (file)
@@ -280,7 +280,7 @@ If ENFORCE-VERSION is non-nil, the directory must contain the XEmacs version."
 
 (defun paths-decode-directory-path (string &optional drop-empties)
   "Split STRING at path separators into a directory list.
-Non-\"\" comonents are converted into directory form.
+Non-\"\" components are converted into directory form.
 If DROP-EMPTIES is non-NIL, \"\" components are dropped from the output.
 Otherwise, they are left alone."
   (let* ((components (split-path string))
index 6967e45..cbed603 100644 (file)
@@ -78,41 +78,48 @@ directories to view or extract information from package source code.")
   `(
     (abbrev    . "abbreviation handling, typing shortcuts, macros")
     (bib       . "code related to the `bib' bibliography processor")
+    (build     . "code used to build XEmacs")
     (c         . "C, C++, and Objective-C language support")
     (calendar  . "calendar and time management support")
     (comm      . "communications, networking, remote access to files")
+    (content    . "contains content (menu/dialog box descs, text, images, &c)")
     (data      . "support for editing files of data")
-    (docs      . "support for Emacs documentation")
-    (dumped     . "files preloaded into Emacs")
+    (docs      . "support for XEmacs documentation")
+    (dumped     . "files preloaded into XEmacs")
     (emulations        . "emulations of other editors")
     (extensions        . "Emacs Lisp language extensions")
     (faces     . "support for multiple fonts")
-    (frames    . "support for Emacs frames and window systems")
+    (frames    . "support for XEmacs frames and window systems")
     (games     . "games, jokes and amusements")
+    (gui       . "support for menubars, dialog boxes, and other GUI features")
     (hardware  . "support for interfacing with exotic hardware")
     (help      . "support for on-line help systems")
     (hypermedia        . "support for links between text or other media types")
     (i18n      . "internationalization and alternate character-set support")
-    (internal  . "code for Emacs internals, build process, defaults")
+    (internal  . "code implementing core functionality in XEmacs")
     (languages . "specialized modes for editing programming languages")
     (lisp      . "Lisp support, including Emacs Lisp")
     (local     . "code local to your site")
-    (maint     . "maintenance aids for the Emacs development group")
     (mail      . "modes for electronic-mail handling")
+    (maint     . "maintenance aids for the Emacs development group")
     (matching  . "various sorts of searching and matching")
     (mouse     . "mouse support")
+    (mswin     . "support for anything running on MS Windows")
     ,(when (featurep 'mule)
        (cons 'mule "multi-language extensions"))
     (news      . "support for netnews reading and posting")
     (oop       . "support for object-oriented programming")
     (outlines  . "support for hierarchical outlining")
     (processes . "process, subshell, compilation, and job control support")
+    (services  . "provides services for use by other programs (cf `user')")
     (terminals . "support for terminal types")
     (tex       . "code related to the TeX formatter")
     (tools     . "programming tools")
     (unix      . "front-ends/assistants for, or emulators of, UNIX features")
+    (user      . "program interacts directly with the user (cf `services'")
     (vms       . "support code for vms")
     (wp                . "word processing")
+    (www       . "support for the Web (WWW, the World Wide Web)")
     ))
 
 (defvar finder-mode-map nil)
@@ -286,6 +293,7 @@ arguments compiles from `load-path'."
        (setq dirs (cdr dirs)))
       found)))
 
+;;;###autoload
 (defun finder-commentary (file)
   "Display FILE's commentary section.
 FILE should be in a form suitable for passing to `locate-library'."
@@ -397,7 +405,7 @@ FILE should be in a form suitable for passing to `locate-library'."
     "\\<finder-mode-map>\\[finder-select] = select, \\[finder-list-keywords] = keywords, \\[finder-edit] = edit, \\[finder-view] = view, \\[finder-exit] = quit, \\[finder-summary] = help")))
 
 (defun finder-exit ()
-  "Exit Finder mode and kill the buffer"
+  "Exit Finder mode and kill the buffer."
   (interactive)
   ;; XEmacs change
   (or (one-window-p t 0)
index 297f15d..ee880bb 100644 (file)
@@ -2,7 +2,7 @@
 
 ;; Copyright (C) 1992-1995, 1997 Free Software Foundation, Inc.
 ;; Copyright (C) 1995 Amdahl Corporation.
-;; Copyright (C) 1996 Ben Wing.
+;; Copyright (C) 1996, 2000 Ben Wing.
 
 ;; Author: Jamie Zawinski <jwz@jwz.org>, for the LISPM Preservation Society.
 ;; Minimally merged with FSF 19.34 by Barry Warsaw <bwarsaw@python.org>
@@ -893,9 +893,10 @@ See the variable `font-lock-keywords' for customization."
                 ((or (null maximum-size) (<= (buffer-size) maximum-size))
                  (font-lock-fontify-buffer))
                 (font-lock-verbose
-                 (lprogress-display 'font-lock
-                            "Fontifying %s... buffer too big." 'abort
-                            (buffer-name)))))
+                 (progress-feedback-with-label
+                  'font-lock
+                  "Fontifying %s... buffer too big." 'abort
+                  (buffer-name)))))
          (font-lock-fontified
           (setq font-lock-fontified nil)
           (font-lock-unfontify-region (point-min) (point-max))
@@ -1060,8 +1061,8 @@ This can take a while for large buffers."
            (font-lock-mode 0)))
       (set (make-local-variable 'font-lock-fontified) t)
       (when (and aborted font-lock-verbose)
-       (lprogress-display 'font-lock "Fontifying %s... aborted."
-                          'abort (buffer-name))))
+       (progress-feedback-with-label 'font-lock "Fontifying %s... aborted."
+                                     'abort (buffer-name))))
     (run-hooks 'font-lock-after-fontify-buffer-hook)))
 
 (defun font-lock-default-unfontify-buffer ()
@@ -1100,7 +1101,8 @@ This can take a while for large buffers."
 (defun font-lock-default-unfontify-region (beg end &optional maybe-loudly)
   (when (and maybe-loudly font-lock-verbose
             (>= (- end beg) font-lock-message-threshold))
-    (lprogress-display 'font-lock "Fontifying %s..." 0 (buffer-name)))
+    (progress-feedback-with-label 'font-lock "Fontifying %s..." 0
+                                 (buffer-name)))
   (let ((modified (buffer-modified-p))
        (buffer-undo-list t) (inhibit-read-only t)
        buffer-file-name buffer-file-truename)
@@ -1347,8 +1349,9 @@ START should be at the beginning of a line."
       nil
     (when (and font-lock-verbose
               (>= (- end start) font-lock-message-threshold))
-      (lprogress-display 'font-lock "Fontifying %s... (syntactically)" 5
-                (buffer-name)))
+      (progress-feedback-with-label 'font-lock
+                                   "Fontifying %s... (syntactically)" 5
+                                   (buffer-name)))
     (font-lock-unfontify-region start end loudly)
     (goto-char start)
     (if (> end (point-max)) (setq end (point-max)))
@@ -1560,8 +1563,9 @@ START should be at the beginning of a line."
                (+ (/ (* (- (point) start) 95) (* (- end start) nkeywords))
                   (/ (* iter 95) nkeywords) 5))
          (when (and loudly (> progress old-progress))
-           (lprogress-display 'font-lock "Fontifying %s... (regexps)"
-                              progress bufname))
+           (progress-feedback-with-label 'font-lock
+                                         "Fontifying %s... (regexps)"
+                                         progress bufname))
          (setq old-progress progress)
          ;; Apply each highlight to this instance of `matcher', which may be
          ;; specific highlights or more keywords anchored to `matcher'.
@@ -1578,7 +1582,9 @@ START should be at the beginning of a line."
            (setq highlights (cdr highlights))))
        (setq iter (1+ iter))
        (setq keywords (cdr keywords))))
-    (if loudly (lprogress-display 'font-lock "Fontifying %s... " 100 (buffer-name)))))
+    (if loudly
+       (progress-feedback-with-label 'font-lock "Fontifying %s... " 100
+                                     (buffer-name)))))
 
 \f
 ;; Various functions.
@@ -1881,30 +1887,39 @@ START should be at the beginning of a line."
     ;;
     ;; Control structures.  ELisp and CLisp combined.
     ;;
-    ;;(regexp-opt
-    ;;  '("cond" "if" "while" "let" "let*" "prog" "progn" "prog1"
-    ;;    "prog2" "progv" "catch" "throw" "save-restriction"
-    ;;    "save-excursion" "save-window-excursion"
-    ;;    "save-current-buffer" "with-current-buffer"
-    ;;    "with-temp-file" "with-temp-buffer" "with-output-to-string"
-    ;;    "with-string-as-buffer-contents"
-    ;;    "save-selected-window" "save-match-data" "unwind-protect"
-    ;;    "condition-case" "track-mouse" "autoload"
-    ;;    "eval-after-load" "eval-and-compile" "eval-when-compile"
-    ;;    "when" "unless" "do" "dolist" "dotimes" "flet" "labels"
-    ;;    "lambda" "return" "return-from"))
     (cons
      (concat
       "(\\("
-      "autoload\\|c\\(atch\\|ond\\(ition-case\\)?\\)\\|do\\(list\\|"
-      "times\\)?\\|eval-\\(a\\(fter-load\\|nd-compile\\)\\|when-compile\\)\\|"
-      "flet\\|if\\|l\\(a\\(bels\\|mbda\\)\\|et\\*?\\)\\|"
-      "prog[nv12\\*]?\\|return\\(-from\\)?\\|save-\\(current-buffer\\|"
-      "excursion\\|match-data\\|restriction\\|selected-window\\|"
-      "window-excursion\\)\\|t\\(hrow\\|rack-mouse\\)\\|un\\(less\\|"
-      "wind-protect\\)\\|w\\(h\\(en\\|ile\\)\\|ith-\\(current-buffer\\|"
-      "output-to-string\\|string-as-buffer-contents\\|temp-\\(buffer\\|"
-      "file\\)\\)\\)"
+      ;; beginning of generated stuff
+      ;; to regenerate, use the regexp-opt below, then delete the outermost
+      ;; grouping, then use the macro below to break up the string.
+      ;; (regexp-opt
+      ;;   '("cond" "if" "while" "let" "let*" "prog" "progn" "prog1"
+      ;;     "prog2" "progv" "catch" "throw" "save-restriction"
+      ;;     "save-excursion" "save-window-excursion"
+      ;;     "save-current-buffer" "with-current-buffer"
+      ;;     "save-selected-window" "with-selected-window"
+      ;;     "save-selected-frame" "with-selected-frame"
+      ;;     "with-temp-file" "with-temp-buffer" "with-output-to-string"
+      ;;     "with-string-as-buffer-contents"
+      ;;     "save-match-data" "unwind-protect" "call-with-condition-handler"
+      ;;     "condition-case" "track-mouse" "autoload"
+      ;;     "eval-after-load" "eval-and-compile" "eval-when-compile"
+      ;;     "when" "unless" "do" "dolist" "dotimes" "flet" "labels"
+      ;;     "lambda" "block" "return" "return-from" "loop") t)
+      ;; (setq last-kbd-macro
+      ;;   (read-kbd-macro "\" C-7 C-1 <right> C-r \\\\| 3*<right> \" RET"))
+      "autoload\\|block\\|c\\(?:a\\(?:ll-with-condition-handler\\|tch\\)\\|"
+      "ond\\(?:ition-case\\)?\\)\\|do\\(?:list\\|times\\)?\\|"
+      "eval-\\(?:a\\(?:fter-load\\|nd-compile\\)\\|when-compile\\)\\|flet\\|"
+      "if\\|l\\(?:a\\(?:bels\\|mbda\\)\\|et\\*?\\|oop\\)\\|prog[12nv]?\\|"
+      "return\\(?:-from\\)?\\|save-\\(?:current-buffer\\|excursion\\|"
+      "match-data\\|restriction\\|selected-\\(?:frame\\|window\\)\\|"
+      "window-excursion\\)\\|t\\(?:hrow\\|rack-mouse\\)\\|un\\(?:less\\|"
+      "wind-protect\\)\\|w\\(?:h\\(?:en\\|ile\\)\\|ith-\\(?:current-buffer\\|"
+      "output-to-string\\|s\\(?:elected-\\(?:frame\\|window\\)\\|"
+      "tring-as-buffer-contents\\)\\|temp-\\(?:buffer\\|file\\)\\)\\)"
+      ;; end of generated stuff
       "\\)\\>") 1)
     ;;
     ;; Feature symbols as references.
@@ -2336,19 +2351,19 @@ This adds highlighting of Java documentation tags, such as @see.")
          "\\|long\\|short\\|void\\)\\>")
   "Regexp which should match a primitive type.")
 
-(let ((capital-letter "A-Z\300-\326\330-\337")
-      (letter "a-zA-Z_$\300-\326\330-\366\370-\377")
-      (digit  "0-9"))
 (defvar java-font-lock-identifier-regexp
-  (concat "\\<\\([" letter "][" letter digit "]*\\)\\>")
+  (let ((letter "a-zA-Z_$\300-\326\330-\366\370-\377")
+       (digit  "0-9"))
+    (concat "\\<\\([" letter "][" letter digit "]*\\)\\>"))
   "Regexp which should match all Java identifiers.")
 
 (defvar java-font-lock-class-name-regexp
-  (concat "\\<\\([" capital-letter "][" letter digit "]*\\)\\>")
+  (let ((capital-letter "A-Z\300-\326\330-\337")
+       (letter "a-zA-Z_$\300-\326\330-\366\370-\377")
+       (digit  "0-9"))
+    (concat "\\<\\([" capital-letter "][" letter digit "]*\\)\\>"))
   "Regexp which should match a class or an interface name.
 The name is assumed to begin with a capital letter.")
-)
-
 
 (let ((java-modifier-regexp
        (concat "\\<\\(abstract\\|const\\|final\\|native\\|"
index dc3b882..4e31321 100644 (file)
@@ -543,6 +543,14 @@ Normally DOMAIN will be a window or nil (meaning the selected window),
 See `glyph-property-instance' for more information."
   (glyph-property-instance glyph 'image domain default no-fallback))
 
+(defun glyph-image-property (glyph prop &optional domain default no-fallback)
+  "Return property PROP of the instance of GLYPH's image in DOMAIN.
+
+Normally DOMAIN will be a window or nil (meaning the selected window).
+The value returned is dependent on the image instance type."
+  (image-instance-property
+   (glyph-image-instance glyph domain default no-fallback) prop))
+
 (defun set-glyph-image (glyph spec &optional locale tag-set how-to-add)
   "Change the image of GLYPH in LOCALE.
 
@@ -746,7 +754,7 @@ Once you have created a glyph, you specify where it will be used as follows:
    `modeline-pointer-glyph' for the pointer used over the modeline, etc.
    Do an apropos over `*-pointer-glyph' to find all of them. (Note also
    that you can temporarily set the mouse pointer to some specific shape
-   by using `set-frame-pointer', which takes an image instace, as obtained
+   by using `set-frame-pointer', which takes an image instance, as obtained
    from calling `glyph-image-instance' on a glyph of type `pointer' --
    either one of the above-mentioned variables or one you created yourself.
    (See below for what it means to create a glyph of type `pointer'.)
index 3ffd2de..3afb68e 100644 (file)
@@ -72,7 +72,7 @@ With prefix arg, turn GPM mouse mode on if and only if arg is positive."
                           (device-console device))))
       (turn-off-gpm-mouse-tracking device)))
 
-;; Restore normal mouse behaviour outside Emacs
+;; Restore normal mouse behavior outside Emacs
 
 (add-hook 'suspend-hook 'turn-off-gpm-mouse-tracking)
 (add-hook 'suspend-resume-hook 'turn-on-gpm-mouse-tracking)
index 777ddc3..b1c75df 100644 (file)
@@ -2,6 +2,7 @@
 
 ;; Copyright (C) 1999 Free Software Foundation, Inc.
 ;; Copyright (C) 1999, 2000 Andy Piper.
+;; Copyright (C) 2000 Ben Wing.
 
 ;; Maintainer: XEmacs Development Team
 ;; Keywords: frames, extensions, internal, dumped
@@ -154,9 +155,6 @@ If this is 0, then the full buffer name will be shown."
     ;; that the current buffer is at the front of the buffers list.
     ;; for example, select an item and then do M-C-l
     ;; (switch-to-other-buffer).  Things get way confused.
-    ;;
-    ;; Andy, if you want to maintain the current look, you must
-    ;; *uncouple* the gutter order and buffers order.
     (if (> (length (windows-of-buffer buffer)) 0)
        (select-window (car (windows-of-buffer buffer)))
       (switch-to-buffer buffer))))
@@ -334,9 +332,7 @@ items by redefining the function `format-buffers-menu-line'."
                 (if (or (eq gutter-buffers-tab-orientation 'top)
                         (eq gutter-buffers-tab-orientation 'bottom))
                     '(gutter-pixel-width) '(gutter-pixel-height))
-                :properties
-                (list :items
-                      (buffers-tab-items nil frame force-selection)))
+                :items (buffers-tab-items nil frame force-selection))
         frame)))))
 
 ;; A myriad of different update hooks all doing slightly different things
@@ -356,7 +352,7 @@ items by redefining the function `format-buffers-menu-line'."
 ;; progress display
 ;; ripped off from message display
 ;;
-(defcustom progress-display-use-echo-area nil
+(defcustom progress-feedback-use-echo-area nil
   "*Whether progress gauge display should display in the echo area.
 If NIL then progress gauges will be displayed with whatever native widgets
 are available on the current console. If non-NIL then progress display will be
@@ -367,84 +363,78 @@ textual and displayed in the echo area."
 (defvar progress-glyph-height 24
   "Height of the progress gauge glyph.")
 
-(defvar progress-display-popup-period 0.5
+(defvar progress-feedback-popup-period 0.5
   "The time that the progress gauge should remain up after completion")
 
-;; private variables
-(defvar progress-text-glyph
-  (make-glyph [string :data ""]))
-
-(defvar progress-layout-glyph nil)
-(defvar progress-gauge-glyph
-  (make-glyph
-   `[progress-gauge
-     :pixel-height (eval progress-glyph-height)
-     :pixel-width 250
-     :descriptor "Progress"]))
-
-(defun set-progress-display-style (style)
-  "Control the appearance of the progress gauge.
-If STYLE is 'large, the default, then the progress-display text is
-displayed above the gauge itself. If STYLE is 'small then the gauge
-and text are arranged side-by-side."  
-  (cond
-   ((eq style 'small)
-    (setq progress-glyph-height 16)
-    (setq progress-layout-glyph
-         (make-glyph
-          `[layout
-            :orientation horizontal
-            :margin-width 4
-            :items (,progress-gauge-glyph
-                    [button
-                     :pixel-height (eval progress-glyph-height)
-                     ;; 'quit is special and acts "asynchronously".
-                     :descriptor "Stop" :callback 'quit]
-                    ,progress-text-glyph)])))
-   (t 
-    (setq progress-glyph-height 24)
-    (setq progress-layout-glyph
-         (make-glyph
-          `[layout 
-            :orientation vertical :justify left
-            :margin-width 4
-            :items (,progress-text-glyph
-                    [layout 
-                     :orientation horizontal
-                     :items (,progress-gauge-glyph
-                             [button 
-                              :pixel-height (eval progress-glyph-height)
-                              :descriptor " Stop "
-                              ;; 'quit is special and acts "asynchronously".
-                              :callback 'quit])])])))))
-
-(defcustom progress-display-style 'large
+(defcustom progress-feedback-style 'large
   "*Control the appearance of the progress gauge.
-If 'large, the default, then the progress-display text is displayed
+If 'large, the default, then the progress-feedback text is displayed
 above the gauge itself. If 'small then the gauge and text are arranged
 side-by-side."
   :group 'gutter
   :type '(choice (const :tag "large" large)
-                (const :tag "small" small))
-  :set #'(lambda (var val)
-          (set-progress-display-style val)))
+                (const :tag "small" small)))
+
+;; private variables
+(defvar progress-text-instantiator [string :data ""])
+(defvar progress-layout-glyph (make-glyph))
+(defvar progress-layout-instantiator nil)
+
+(defvar progress-gauge-instantiator
+  [progress-gauge
+   :value 0
+   :pixel-height (eval progress-glyph-height)
+   :pixel-width 250
+   :descriptor "Progress"])
+
+(defun set-progress-feedback-instantiator (&optional locale)
+  (cond
+   ((eq progress-feedback-style 'small)
+    (setq progress-glyph-height 16)
+    (setq progress-layout-instantiator
+         `[layout
+           :orientation horizontal
+           :margin-width 4
+           :items (,progress-gauge-instantiator
+                   [button
+                    :pixel-height (eval progress-glyph-height)
+                    ;; 'quit is special and acts "asynchronously".
+                    :descriptor "Stop" :callback 'quit]
+                   ,progress-text-instantiator)])
+    (set-glyph-image progress-layout-glyph progress-layout-instantiator locale))
+   (t 
+    (setq progress-glyph-height 24)
+    (setq progress-layout-instantiator
+         `[layout 
+           :orientation vertical :justify left
+           :margin-width 4
+           :items (,progress-text-instantiator
+                   [layout 
+                    :orientation horizontal
+                    :items (,progress-gauge-instantiator
+                            [button 
+                             :pixel-height (eval progress-glyph-height)
+                             :descriptor " Stop "
+                             ;; 'quit is special and acts "asynchronously".
+                             :callback 'quit])])])
+    (set-glyph-image progress-layout-glyph progress-layout-instantiator locale))))
 
 (defvar progress-stack nil
   "An alist of label/string pairs representing active progress gauges.
 The first element in the list is currently displayed in the gutter area.
-Do not modify this directly--use the `progress-display' or
-`display-progress-display'/`clear-progress-display' functions.")
+Do not modify this directly--use the `progress-feedback' or
+`display-progress-feedback'/`clear-progress-feedback' functions.")
 
 (defvar progress-abort-glyph
   (make-glyph
    `[layout :orientation vertical :justify left
-           :items (,progress-text-glyph
+           :items (,progress-text-instantiator
                    [layout
                     :margin-width 4
                     :pixel-height progress-glyph-height
                     :orientation horizontal])]))
 
-(defun progress-displayed-p (&optional return-string frame)
+(defun progress-feedback-displayed-p (&optional return-string frame)
   "Return a non-nil value if a progress gauge is presently displayed in the
 gutter area.  If optional argument RETURN-STRING is non-nil,
 return a string containing the message, otherwise just return t."
@@ -456,7 +446,7 @@ return a string containing the message, otherwise just return t."
 
 ;;; Returns the string which remains in the echo area, or nil if none.
 ;;; If label is nil, the whole message stack is cleared.
-(defun clear-progress-display (&optional label frame no-restore)
+(defun clear-progress-feedback (&optional label frame no-restore)
   "Remove any progress gauge with LABEL from the progress gauge-stack,
 erasing it from the gutter area if it's currently displayed there.
 If a message remains at the head of the progress-stack and NO-RESTORE
@@ -467,10 +457,10 @@ If LABEL is nil, the entire progress-stack is cleared.
 Unless you need the return value or you need to specify a label,
 you should just use (progress nil)."
   (if (or (not (valid-image-instantiator-format-p 'progress-gauge frame))
-         progress-display-use-echo-area)
+         progress-feedback-use-echo-area)
       (clear-message label frame nil no-restore)
     (or frame (setq frame (selected-frame)))
-    (remove-progress-display label frame)
+    (remove-progress-feedback label frame)
     (let ((inhibit-read-only t)
          (zmacs-region-stays zmacs-region-stays)) ; preserve from change
       (erase-buffer (get-buffer-create " *Gutter Area*")))
@@ -478,19 +468,19 @@ you should just use (progress nil)."
        nil                     ; just preparing to put another msg up
       (if progress-stack
          (let ((oldmsg (cdr (car progress-stack))))
-           (raw-append-progress-display oldmsg nil frame)
+           (raw-append-progress-feedback oldmsg nil frame)
            oldmsg)
        ;; nothing to display so get rid of the gauge
        (set-specifier bottom-gutter-border-width 0 frame)
        (set-gutter-element-visible-p bottom-gutter-visible-p 
                                      'progress nil frame)))))
 
-(defun progress-display-clear-when-idle (&optional label)
+(defun progress-feedback-clear-when-idle (&optional label)
   (add-one-shot-hook 'pre-idle-hook
                     `(lambda ()
-                       (clear-progress-display ',label))))
+                       (clear-progress-feedback ',label))))
 
-(defun remove-progress-display (&optional label frame)
+(defun remove-progress-feedback (&optional label frame)
   ;; If label is nil, we want to remove all matching progress gauges.
   (while (and progress-stack
              (or (null label)  ; null label means clear whole stack
@@ -504,7 +494,7 @@ you should just use (progress nil)."
              (setcdr s (cdr (cdr s))))
          (setq s (cdr s)))))))
 
-(defun progress-display-dispatch-non-command-events ()
+(defun progress-feedback-dispatch-non-command-events ()
   ;; don't allow errors to hose things
   (condition-case t 
       ;; (sit-for 0) is too agressive and cause more display than we
@@ -512,7 +502,7 @@ you should just use (progress nil)."
       (dispatch-non-command-events)
     nil))
 
-(defun append-progress-display (label message &optional value frame)
+(defun append-progress-feedback (label message &optional value frame)
   (or frame (setq frame (selected-frame)))
   ;; Add a new entry to the message-stack, or modify an existing one
   (let* ((top (car progress-stack))
@@ -521,25 +511,22 @@ you should just use (progress nil)."
        (progn
          (setcdr top message)
          (if (equal tmsg message)
-             ;; #### use of set-image-instance-property is wrong.
-             ;; use set-glyph-image instead.
-             (set-image-instance-property 
-              (glyph-image-instance progress-gauge-glyph
-                                    (frame-selected-window frame))
-              :value value)
-           (raw-append-progress-display message value frame))
+             (progn 
+               (set-instantiator-property progress-gauge-instantiator :value value)
+               (set-progress-feedback-instantiator (frame-selected-window frame)))
+           (raw-append-progress-feedback message value frame))
          (redisplay-gutter-area))
       (push (cons label message) progress-stack)
-      (raw-append-progress-display message value frame))
-    (progress-display-dispatch-non-command-events)
+      (raw-append-progress-feedback message value frame))
+    (progress-feedback-dispatch-non-command-events)
     ;; either get command events or sit waiting for them
     (when (eq value 100)
-;      (sit-for progress-display-popup-period nil)
-      (clear-progress-display label))))
+;      (sit-for progress-feedback-popup-period nil)
+      (clear-progress-feedback label))))
 
-(defun abort-progress-display (label message &optional frame)
+(defun abort-progress-feedback (label message &optional frame)
   (if (or (not (valid-image-instantiator-format-p 'progress-gauge frame))
-         progress-display-use-echo-area)
+         progress-feedback-use-echo-area)
       (display-message label (concat message "aborted.") frame)
     (or frame (setq frame (selected-frame)))
     ;; Add a new entry to the message-stack, or modify an existing one
@@ -558,24 +545,21 @@ you should just use (progress nil)."
          ;; fixup the gutter specifiers
          (set-gutter-element bottom-gutter 'progress gutter-string frame)
          (set-specifier bottom-gutter-border-width 2 frame)
-         ;; #### use of set-image-instance-property is wrong.
-         ;; use set-glyph-image instead.
-         (set-image-instance-property 
-          (glyph-image-instance progress-text-glyph
-                                (frame-selected-window frame)) :data message)
+         (set-instantiator-property progress-text-instantiator :datat message)
+         (set-progress-feedback-instantiator (frame-selected-window frame))
          (set-specifier bottom-gutter-height 'autodetect frame)
          (set-gutter-element-visible-p bottom-gutter-visible-p 
                                        'progress t frame)
          ;; we have to do this so redisplay is up-to-date and so
          ;; redisplay-gutter-area performs optimally.
          (redisplay-gutter-area)
-         (sit-for progress-display-popup-period nil)
-         (clear-progress-display label frame)
+         (sit-for progress-feedback-popup-period nil)
+         (clear-progress-feedback label frame)
          (set-extent-begin-glyph ext progress-layout-glyph)
          (set-gutter-element bottom-gutter 'progress gutter-string frame)
          )))))
 
-(defun raw-append-progress-display (message &optional value frame)
+(defun raw-append-progress-feedback (message &optional value frame)
   (unless (equal message "")
     (let* ((inhibit-read-only t)
          (zmacs-region-stays zmacs-region-stays)
@@ -588,15 +572,11 @@ you should just use (progress nil)."
       ;; fixup the gutter specifiers
       (set-gutter-element bottom-gutter 'progress gutter-string frame)
       (set-specifier bottom-gutter-border-width 2 frame)
-      ;; #### use of set-image-instance-property is wrong.
-      ;; use set-glyph-image instead.
-      (set-image-instance-property 
-       (glyph-image-instance progress-gauge-glyph 
-                            (frame-selected-window frame))
-       :value val)
-      (set-image-instance-property 
-       (glyph-image-instance progress-text-glyph (frame-selected-window frame))
-       :data message)
+      (set-instantiator-property progress-gauge-instantiator :value val)
+      (set-progress-feedback-instantiator (frame-selected-window frame))
+
+      (set-instantiator-property progress-text-instantiator :data message)
+      (set-progress-feedback-instantiator (frame-selected-window frame))
       (if (and (eq (specifier-instance bottom-gutter-height frame)
                   'autodetect)
               (gutter-element-visible-p bottom-gutter-visible-p
@@ -605,7 +585,7 @@ you should just use (progress nil)."
          ;; checking for user events
          (progn
            (redisplay-gutter-area)
-           (progress-display-dispatch-non-command-events))
+           (progress-feedback-dispatch-non-command-events))
        ;; otherwise make the gutter visible and redraw the frame
        (set-specifier bottom-gutter-height 'autodetect frame)
        (set-gutter-element-visible-p bottom-gutter-visible-p
@@ -613,36 +593,36 @@ you should just use (progress nil)."
        ;; we have to do this so redisplay is up-to-date and so
        ;; redisplay-gutter-area performs optimally. This may also
        ;; make sure the frame geometry looks ok.
-       (progress-display-dispatch-non-command-events)
+       (progress-feedback-dispatch-non-command-events)
        (redisplay-frame frame)
        ))))
 
-(defun display-progress-display (label message &optional value frame)
+(defun display-progress-feedback (label message &optional value frame)
   "Display a progress gauge and message in the bottom gutter area.
  First argument LABEL is an identifier for this message.  MESSAGE is
-the string to display.  Use `clear-progress-display' to remove a labelled
+the string to display.  Use `clear-progress-feedback' to remove a labelled
 message."
   (cond ((eq value 'abort)
-        (abort-progress-display label message frame))
+        (abort-progress-feedback label message frame))
        ((or (not (valid-image-instantiator-format-p 'progress-gauge frame))
-            progress-display-use-echo-area)
+            progress-feedback-use-echo-area)
         (display-message label 
           (concat message (if (eq value 100) "done."
                             (make-string (/ value 5) ?.)))
           frame))
        (t
-        (append-progress-display label message value frame))))
+        (append-progress-feedback label message value frame))))
 
-(defun current-progress-display (&optional frame)
+(defun current-progress-feedback (&optional frame)
   "Return the current progress gauge in the gutter area, or nil.
 The FRAME argument is currently unused."
   (cdr (car progress-stack)))
 
 ;;; may eventually be frame-dependent
-(defun current-progress-display-label (&optional frame)
+(defun current-progress-feedback-label (&optional frame)
   (car (car progress-stack)))
 
-(defun progress-display (fmt &optional value &rest args)
+(defun progress-feedback (fmt &optional value &rest args)
   "Print a progress gauge and message in the bottom gutter area of the frame.
 The arguments are the same as to `format'.
 
@@ -650,12 +630,12 @@ If the only argument is nil, clear any existing progress gauge."
   (save-excursion
     (if (and (null fmt) (null args))
        (prog1 nil
-         (clear-progress-display nil))
+         (clear-progress-feedback nil))
       (let ((str (apply 'format fmt args)))
-       (display-progress-display 'progress str value)
+       (display-progress-feedback 'progress str value)
        str))))
 
-(defun lprogress-display (label fmt &optional value &rest args)
+(defun progress-feedback-with-label (label fmt &optional value &rest args)
   "Print a progress gauge and message in the bottom gutter area of the frame.
 First argument LABEL is an identifier for this progress gauge.  The rest of the
 arguments are the same as to `format'."
@@ -664,75 +644,10 @@ arguments are the same as to `format'."
   (save-excursion
     (if (and (null fmt) (null args))
        (prog1 nil
-         (clear-progress-display label nil))
+         (clear-progress-feedback label nil))
       (let ((str (apply 'format fmt args)))
-       (display-progress-display label str value)
+       (display-progress-feedback label str value)
        str))))
 
-;;
-;; Simple search dialog
-;;
-(defvar search-dialog-direction t)
-(defvar search-dialog-text 
-  (make-glyph 
-   [edit-field :width 15 :descriptor "" :active t :face default]))
-
-(defun search-dialog-callback (parent image-instance event)
-  (save-selected-frame
-    (select-frame parent)
-    (funcall (if search-dialog-direction
-                'search-forward 'search-backward)
-            (image-instance-property
-             (glyph-image-instance search-dialog-text 
-                                   (frame-selected-window 
-                                    (event-channel event))) :text))
-    (isearch-highlight (match-beginning 0) (match-end 0))))
-  
-(defun make-search-dialog ()
-  "Popup a search dialog box."
-  (interactive)
-  (let* ((parent (selected-frame)))
-    (set-buffer-dedicated-frame 
-     (get-buffer-create "Dialog")
-     (make-dialog-box 
-      (make-glyph
-       `[layout 
-        :orientation horizontal :justify left
-        :height 10 :width 40
-        :border [string :data "Search"]
-        :items 
-        ([layout :orientation vertical :justify left
-                 :items 
-                 ([string :data "Search for:"]
-                  [button :descriptor "Match case"
-                          :style toggle
-                          :selected (not case-fold-search)
-                          :callback (setq case-fold-search
-                                          (not case-fold-search))]
-                  [button :descriptor "Forwards"
-                          :style radio
-                          :selected search-dialog-direction
-                          :callback (setq search-dialog-direction t)]
-                  [button :descriptor "Backwards"
-                          :style radio
-                          :selected (not search-dialog-direction)
-                          :callback (setq search-dialog-direction nil)]
-                  )]
-         [layout :orientation vertical :justify left
-                 :items 
-                 (search-dialog-text
-                  [button :width 10 :descriptor "Find Next"
-                          :callback-ex
-                          (lambda (image-instance event)
-                            (search-dialog-callback ,parent
-                                                    image-instance event))]
-                  [button :width 10 :descriptor "Cancel"
-                          :callback-ex
-                          (lambda (image-instance event)
-                            (isearch-dehighlight)
-                            (delete-frame 
-                             (event-channel event)))])])])
-      '(height 10 width 40)))))
-
 (provide 'gutter-items)
 ;;; gutter-items.el ends here.
index b5c8ab8..44df9a0 100644 (file)
@@ -4,7 +4,7 @@
 ;; Copyright (C) 1999, 2000 Andy Piper.
 
 ;; Maintainer: XEmacs Development Team
-;; Keywords: frames, extensions, internal, dumped
+;; Keywords: frames, gui, internal, dumped
 
 ;; This file is part of XEmacs.
 
@@ -30,7 +30,7 @@
   "Input from the gutters."
   :group 'environment)
 
-;; Although these customizations appear bogus, they are neccessary in
+;; Although these customizations appear bogus, they are necessary in
 ;; order to be able to save options through the options menu.
 (defcustom default-gutter-position
   (default-gutter-position)
@@ -69,7 +69,7 @@ created to put the glyph into."
     (when (glyphp val)
       (setq spec (copy-sequence "\n"))
       (set-extent-begin-glyph (make-extent 0 1 spec) val))
-    (map-extents #'(lambda (extent arg) 
+    (map-extents #'(lambda (extent arg)
                     (set-extent-property extent 'duplicable t)) spec)
     (modify-specifier-instances gutter-specifier #'plist-put (list prop spec)
                                'force nil locale tag-set)))
@@ -85,13 +85,13 @@ This is a convenience function for removing gutter elements."
                                     locale tag-set)
   "Change the visibility of gutter elements.
 Set the visibility of element PROP to VISIBLE-P for
-GUTTER-SPECIFIER-VISIBLE-P in optional LOCALE.  
+GUTTER-SPECIFIER-VISIBLE-P in optional LOCALE.
 This is a convenience function for hiding and showing gutter elements."
-  (modify-specifier-instances 
+  (modify-specifier-instances
    gutter-visible-specifier-p #'(lambda (spec prop visible-p)
                                  (if (consp spec)
-                                     (if visible-p 
-                                         (if (memq prop spec) spec  
+                                     (if visible-p
+                                         (if (memq prop spec) spec
                                            (cons prop spec))
                                        (delq prop spec))
                                    (if visible-p (list prop))))
@@ -139,7 +139,7 @@ always gutter-size specifiers.
 
 Valid gutter-size instantiators are either integers or the special
 symbol 'autodetect. If a gutter-size is set to 'autodetect them the
-size of the gutter will be adjusted to just accomodate the gutters
+size of the gutter will be adjusted to just accommodate the gutters
 contents. 'autodetect only works for top and bottom gutters."
   (make-specifier-and-init 'gutter-size spec-list))
 
@@ -158,7 +158,7 @@ gutter-visible specifiers.
 
 Valid gutter-visible instantiators are t, nil or a list of symbols.
 If a gutter-visible instantiator is set to a list of symbols, and the
-correspondong gutter specification is a property-list strings, then
+corresponding gutter specification is a property-list strings, then
 elements of the gutter specification will only be visible if the
 corresponding symbol occurs in the gutter-visible instantiator."
   (make-specifier-and-init 'gutter-visible spec-list))
index 901724b..ab95b37 100644 (file)
@@ -240,10 +240,8 @@ If the optional argument BURY is non-nil, the help buffer is buried,
 otherwise it is killed."
   (interactive)
   (let ((buf (current-buffer)))
-    (cond ((frame-property (selected-frame) 'help-window-config)
-          (set-window-configuration
-           (frame-property (selected-frame) 'help-window-config))
-          (set-frame-property  (selected-frame) 'help-window-config nil))
+    (cond (help-window-config
+          (set-window-configuration help-window-config))
          ((not (one-window-p))
           (delete-window)))
     (if bury
@@ -480,6 +478,21 @@ You should never set this directory, only let-bind it.")
 ;; another name (which is a shame, because w-d-h-b is a perfect name
 ;; for a macro) that uses with-displaying-help-buffer internally.
 
+(defcustom mode-for-help 'help-mode
+  "*Mode that help buffers are put into.")
+
+(defvar help-sticky-window nil
+;; Window into which help buffers will be displayed, rather than
+;; always searching for a new one.  This is INTERNAL and liable to
+;; change its interface and/or name at any moment.  It should be
+;; bound, not set.
+)
+
+(defvar help-window-config nil)
+
+(make-variable-buffer-local 'help-window-config)
+(put 'help-window-config 'permanent-local t)
+
 (defun with-displaying-help-buffer (thunk &optional name)
   "Form which makes a help buffer with given NAME and evaluates BODY there.
 The actual name of the buffer is generated by the function `help-buffer-name'."
@@ -492,19 +505,28 @@ The actual name of the buffer is generated by the function `help-buffer-name'."
                          (mapcar 'window-frame
                                  (windows-of-buffer buffer-name)))))))
     (help-register-and-maybe-prune-excess buffer-name)
-    (prog1 (with-output-to-temp-buffer buffer-name
-            (prog1 (funcall thunk)
-              (save-excursion
-                (set-buffer standard-output)
-                (help-mode))))
+    ;; if help-sticky-window is bogus or deleted, get rid of it.
+    (if (and help-sticky-window (or (not (windowp help-sticky-window))
+                                   (not (window-live-p help-sticky-window))))
+       (setq help-sticky-window nil))
+    (prog1
+       (let ((temp-buffer-show-function
+              (if help-sticky-window
+                  #'(lambda (buffer)
+                      (set-window-buffer help-sticky-window buffer))
+                temp-buffer-show-function)))
+         (with-output-to-temp-buffer buffer-name
+           (prog1 (funcall thunk)
+             (save-excursion
+               (set-buffer standard-output)
+               (funcall mode-for-help)))))
       (let ((helpwin (get-buffer-window buffer-name)))
        (when helpwin
-         (with-current-buffer (window-buffer helpwin)
-           ;; If the *Help* buffer is already displayed on this
-           ;; frame, don't override the previous configuration
-           (when help-not-visible
-             (set-frame-property (selected-frame)
-                                 'help-window-config winconfig)))
+         ;; If the *Help* buffer is already displayed on this
+         ;; frame, don't override the previous configuration
+         (when help-not-visible
+           (with-current-buffer (window-buffer helpwin)
+             (setq help-window-config winconfig)))
          (when help-selects-help-window
            (select-window helpwin))
          (cond ((eq helpwin (selected-window))
@@ -745,16 +767,15 @@ of the key sequence that ran this command."
 (defun xemacs-www-page ()
   "Go to the XEmacs World Wide Web page."
   (interactive)
-  (if (boundp 'browse-url-browser-function)
-      (funcall browse-url-browser-function "http://www.xemacs.org/")
+  (if (fboundp 'browse-url)
+      (browse-url "http://www.xemacs.org/")
     (error "xemacs-www-page requires browse-url")))
 
 (defun xemacs-www-faq ()
   "View the latest and greatest XEmacs FAQ using the World Wide Web."
   (interactive)
-  (if (boundp 'browse-url-browser-function)
-      (funcall browse-url-browser-function
-              "http://www.xemacs.org/faq/index.html")
+  (if (fboundp 'browse-url)
+      (browse-url "http://www.xemacs.org/faq/index.html")
     (error "xemacs-www-faq requires browse-url")))
 
 (defun xemacs-local-faq ()
@@ -922,6 +943,21 @@ list containing point.  If that doesn't give a function, return nil."
              (setq obj (read (current-buffer)))
              (and (symbolp obj) (fboundp obj) obj)))))))
 
+(defun function-at-event (event)
+  "Return the function whose name is around the position of EVENT.
+EVENT should be a mouse event.  When calling from a popup or context menu,
+use `last-popup-menu-event' to find out where the mouse was clicked.
+\(You cannot use (interactive \"e\"), unfortunately.  This returns a
+misc-user event.)
+
+If the event contains no position, or the position is not over text, or
+there is no function around that point, nil is returned."
+  (if (and event (event-buffer event) (event-point event))
+      (save-excursion
+       (set-buffer (event-buffer event))
+       (goto-char (event-point event))
+       (function-at-point))))
+
 ;; Default to nil for the non-hackers?  Not until we find a way to
 ;; distinguish hackers from non-hackers automatically!
 (defcustom describe-function-show-arglist t
@@ -1065,6 +1101,119 @@ part of the documentation of internal subroutines."
             (string-match "[\n\t ]*\narguments: ?(\\(.*\\))\n?\\'" doc))
        (setq doc (substring doc 0 (match-beginning 0))))
     doc))
+;  (let ((name-char "[-+a-zA-Z0-9_*]") (sym-char "[-+a-zA-Z0-9_:*]"))
+;    (list
+;     ;;
+;     ;; The symbol itself.
+;     (list (concat "\\`\\(" name-char "+\\)\\(:\\)?")
+;         '(1 (if (match-beginning 2)
+;                 'font-lock-function-name-face
+;               'font-lock-variable-name-face)
+;             nil t))
+;     ;;
+;     ;; Words inside `' which tend to be symbol names.
+;     (list (concat "`\\(" sym-char sym-char "+\\)'")
+;         1 '(prog1
+;                'font-lock-reference-face
+;              (add-list-mode-item (match-beginning 1)
+;                             (match-end 1)
+;                             nil
+;                             'help-follow-reference))
+;         t)
+;     ;;
+;     ;; CLisp `:' keywords as references.
+;     (list (concat "\\<:" sym-char "+\\>") 0 'font-lock-reference-face t)))
+
+(defvar help-symbol-regexp
+  (let ((sym-char "[+a-zA-Z0-9_:*]")
+       (sym-char-no-dash "[-+a-zA-Z0-9_:*]"))
+    (concat "\\("
+           ;; a symbol with a - in it.
+           "\\<\\(" sym-char-no-dash "+\\(-" sym-char-no-dash "+\\)+\\)\\>"
+           "\\|"
+           "`\\(" sym-char "+\\)'"
+           "\\)")))
+
+(defun help-symbol-run-function-1 (ev ex fun)
+  (let ((help-sticky-window
+        ;; if we were called from a help buffer, make sure the new help
+        ;; goes in the same window.
+        (if (and (event-buffer ev)
+                 (symbol-value-in-buffer 'help-window-config
+                                         (event-buffer ev)))
+            (event-window ev)
+          help-sticky-window)))
+    (funcall fun (extent-property ex 'help-symbol))))
+
+(defun help-symbol-run-function (fun)
+  (let ((ex (extent-at-event last-popup-menu-event 'help-symbol)))
+    (when ex
+      (help-symbol-run-function-1 last-popup-menu-event ex fun))))
+
+(defvar help-symbol-function-context-menu
+  '("---"
+    ["View %_Documentation" (help-symbol-run-function 'describe-function)]
+    ["Find %_Function Source" (help-symbol-run-function 'find-function)]
+    ))
+
+(defvar help-symbol-variable-context-menu
+  '("---"
+    ["View %_Documentation" (help-symbol-run-function 'describe-variable)]
+    ["Find %_Variable Source" (help-symbol-run-function 'find-variable)]
+    ))
+
+(defvar help-symbol-function-and-variable-context-menu
+  '("---"
+    ["View Function %_Documentation" (help-symbol-run-function 
+                                     'describe-function)]
+    ["View Variable D%_ocumentation" (help-symbol-run-function
+                                     'describe-variable)]
+    ["Find %_Function Source" (help-symbol-run-function 'find-function)]
+    ["Find %_Variable Source" (help-symbol-run-function 'find-variable)]
+    ))
+
+(defun frob-help-extents (buffer)
+  ;; Look through BUFFER, starting at the buffer's point and continuing
+  ;; till end of file, and find documented functions and variables.
+  ;; any such symbol found is tagged with an extent, that sets up these
+  ;; properties:
+  ;; 1. mouse-face is 'highlight (so the extent gets highlighted on mouse over)
+  ;; 2. help-symbol is the name of the symbol.
+  ;; 3. context-menu is a list of context menu items, specific to whether
+  ;;    the symbol is a function, variable, or both.
+  ;; 4. activate-function will cause the function or variable to be described,
+  ;;    replacing the existing help contents.
+  (save-excursion
+    (set-buffer buffer)
+    (let (b e name)
+      (while (re-search-forward help-symbol-regexp nil t)
+       (setq b (or (match-beginning 2) (match-beginning 4)))
+       (setq e (or (match-end 2) (match-end 4)))
+       (setq name (buffer-substring b e))
+       (let* ((sym (intern-soft name))
+              (var (and sym (boundp sym)
+                        (documentation-property sym
+                                                'variable-documentation t)))
+              (fun (and sym (fboundp sym)
+                        (documentation sym t))))
+         (when (or var fun)
+           (let ((ex (make-extent b e)))
+             (set-extent-property ex 'mouse-face 'highlight)
+             (set-extent-property ex 'help-symbol sym)
+             (set-extent-property
+              ex 'context-menu
+              (cond ((and var fun)
+                     help-symbol-function-and-variable-context-menu)
+                    (var help-symbol-variable-context-menu)
+                    (fun help-symbol-function-context-menu)))
+             (set-extent-property
+              ex 'activate-function
+              (if fun
+                  #'(lambda (ev ex)
+                      (help-symbol-run-function-1 ev ex 'describe-function))
+                #'(lambda (ev ex)
+                    (help-symbol-run-function-1 ev ex 'describe-variable))))
+             ))))))) ;; 11 parentheses!
 
 (defun describe-function-1 (function &optional nodoc)
   "This function does the work for `describe-function'."
@@ -1161,7 +1310,13 @@ part of the documentation of internal subroutines."
             (unless (and obsolete aliases)
               (let ((doc (function-documentation function t)))
                 (princ "Documentation:\n")
-                (princ doc)
+                (let ((oldp (point standard-output))
+                      newp)
+                  (princ doc)
+                  (setq newp (point standard-output))
+                  (goto-char oldp standard-output)
+                  (frob-help-extents standard-output)
+                  (goto-char newp standard-output))
                 (unless (or (equal doc "")
                             (eq ?\n (aref doc (1- (length doc)))))
                   (terpri)))))))))
@@ -1175,7 +1330,6 @@ part of the documentation of internal subroutines."
   (message nil)
   (message (function-arglist function)))
 
-
 (defun variable-at-point ()
   (ignore-errors
     (with-syntax-table emacs-lisp-mode-syntax-table
@@ -1188,6 +1342,21 @@ part of the documentation of internal subroutines."
        (let ((obj (read (current-buffer))))
          (and (symbolp obj) (boundp obj) obj))))))
 
+(defun variable-at-event (event)
+  "Return the variable whose name is around the position of EVENT.
+EVENT should be a mouse event.  When calling from a popup or context menu,
+use `last-popup-menu-event' to find out where the mouse was clicked.
+\(You cannot use (interactive \"e\"), unfortunately.  This returns a
+misc-user event.)
+
+If the event contains no position, or the position is not over text, or
+there is no variable around that point, nil is returned."
+  (if (and event (event-buffer event) (event-point event))
+      (save-excursion
+       (set-buffer (event-buffer event))
+       (goto-char (event-point event))
+       (variable-at-point))))
+
 (defun variable-obsolete-p (variable)
   "Return non-nil if VARIABLE is obsolete."
   (not (null (get variable 'byte-obsolete-variable))))
@@ -1316,7 +1485,13 @@ part of the documentation of internal subroutines."
         (when (or (not obsolete) (not aliases))
           (if doc
               ;; note: documentation-property calls substitute-command-keys.
-              (princ doc)
+              (let ((oldp (point standard-output))
+                    newp)
+                (princ doc)
+                (setq newp (point standard-output))
+                (goto-char oldp standard-output)
+                (frob-help-extents standard-output)
+                (goto-char newp standard-output))
             (princ "not documented as a variable."))))
        (terpri)))
    (format "variable `%s'" variable)))
@@ -1449,5 +1624,4 @@ after the listing is made.)"
        (with-displaying-help-buffer
         (insert string)))))
 
-
 ;;; help.el ends here
index b9d4aaf..b2e266e 100644 (file)
@@ -494,10 +494,12 @@ or nil if current info file is not split into subfiles.")
 (defvar Info-current-node nil
   "Name of node that Info is now looking at, or nil.")
 
-(defvar Info-tag-table-marker (make-marker)
+(defvar Info-tag-table-marker nil
   "Marker pointing at beginning of current Info file's tag table.
 Marker points nowhere if file has no tag table.")
 
+(defvar Info-tag-table-buffer nil)
+
 (defvar Info-current-file-completions nil
   "Cached completion list for current Info file.")
 
@@ -651,7 +653,8 @@ further (recursive) error recovery.  TRYFILE is ??"
   ;; should be locked up where they can't do any more harm.
 
   ;; Go into info buffer.
-  (switch-to-buffer "*info*")
+  (or (eq major-mode 'Info-mode)
+      (switch-to-buffer "*info*"))
   (buffer-disable-undo (current-buffer))
   (run-hooks 'Info-startup-hook)
   (or (eq major-mode 'Info-mode)
@@ -660,7 +663,7 @@ further (recursive) error recovery.  TRYFILE is ??"
       (equal Info-current-file filename)
       (not Info-novice)
       (string= "dir" (file-name-nondirectory Info-current-file))
-      (if (y-or-n-p-maybe-dialog-box
+      (if (y-or-n-p
           (format "Leave Info file `%s'? "
                   (file-name-nondirectory Info-current-file)))
          (message "")
@@ -704,16 +707,20 @@ further (recursive) error recovery.  TRYFILE is ??"
                          (looking-at "(Indirect)\n"))
                        ;; It is indirect.  Copy it to another buffer
                        ;; and record that the tag table is in that buffer.
-                       (save-excursion
-                         (let ((buf (current-buffer)))
-                           (set-buffer
-                            (get-buffer-create " *info tag table*"))
-                           (buffer-disable-undo (current-buffer))
-                           (setq case-fold-search t)
-                           (erase-buffer)
-                           (insert-buffer-substring buf)
-                           (set-marker Info-tag-table-marker
-                                       (match-end 0))))
+                         (let ((buf (current-buffer))
+                               (m Info-tag-table-marker))
+                           (or
+                            Info-tag-table-buffer
+                            (setq
+                             Info-tag-table-buffer
+                             (generate-new-buffer " *info tag table*")))
+                           (save-excursion
+                             (set-buffer Info-tag-table-buffer)
+                             (buffer-disable-undo (current-buffer))
+                             (setq case-fold-search t)
+                             (erase-buffer)
+                             (insert-buffer-substring buf)
+                             (set-marker m (match-end 0))))
                     (set-marker Info-tag-table-marker pos))))
              (setq Info-current-file
                    (file-name-sans-versions buffer-file-name))))
@@ -730,18 +737,21 @@ further (recursive) error recovery.  TRYFILE is ??"
            ;; Also, if this is an indirect info file,
            ;; read the proper subfile into this buffer.
            (if (marker-position Info-tag-table-marker)
-               (save-excursion
-                 (set-buffer (marker-buffer Info-tag-table-marker))
-                 (goto-char Info-tag-table-marker)
-                 (if (re-search-forward regexp nil t)
-                     (progn
-                       (setq guesspos (read (current-buffer)))
-                       ;; If this is an indirect file,
-                       ;; determine which file really holds this node
-                       ;; and read it in.
-                       (if (not (eq (current-buffer) (get-buffer "*info*")))
-                           (setq guesspos
-                                 (Info-read-subfile guesspos)))))))
+               (let (foun found-mode (m Info-tag-table-marker))
+                 (save-excursion
+                   (set-buffer (marker-buffer Info-tag-table-marker))
+                   (goto-char m)
+                   (setq foun (re-search-forward regexp nil t))
+                   (if foun 
+                       (setq guesspos (read (current-buffer))))
+                   (setq found-mode major-mode))
+                 (if foun 
+                     ;; If this is an indirect file,
+                     ;; determine which file really holds this node
+                     ;; and read it in.
+                     (if (not (eq major-mode found-mode))
+                         (setq guesspos
+                               (Info-read-subfile guesspos))))))
            (goto-char (max (point-min) (- guesspos 1000)))
            ;; Now search from our advised position (or from beg of buffer)
            ;; to find the actual node.
@@ -1311,30 +1321,30 @@ For example, invoke \"xemacs -batch -f Info-batch-rebuild-dir /usr/local/info\""
     (if p (file-name-nondirectory file) file)))
 
 (defun Info-read-subfile (nodepos)
-  (set-buffer (marker-buffer Info-tag-table-marker))
-  (goto-char (point-min))
-  (search-forward "\n\^_")
   (let (lastfilepos
        lastfilename)
-    (forward-line 2)
-    (catch 'foo
-      (while (not (looking-at "\^_"))
-       (if (not (eolp))
-           (let ((beg (point))
-                 thisfilepos thisfilename)
-             (search-forward ": ")
-             (setq thisfilename  (buffer-substring beg (- (point) 2)))
-             (setq thisfilepos (read (current-buffer)))
-             ;; read in version 19 stops at the end of number.
-             ;; Advance to the next line.
-             (if (eolp)
-                 (forward-line 1))
-             (if (> thisfilepos nodepos)
-                 (throw 'foo t))
-             (setq lastfilename thisfilename)
-             (setq lastfilepos thisfilepos))
-         (throw 'foo t))))
-    (set-buffer (get-buffer "*info*"))
+    (save-excursion
+      (set-buffer (marker-buffer Info-tag-table-marker))
+      (goto-char (point-min))
+      (search-forward "\n\^_")
+      (forward-line 2)
+      (catch 'foo
+       (while (not (looking-at "\^_"))
+         (if (not (eolp))
+             (let ((beg (point))
+                   thisfilepos thisfilename)
+               (search-forward ": ")
+               (setq thisfilename  (buffer-substring beg (- (point) 2)))
+               (setq thisfilepos (read (current-buffer)))
+               ;; read in version 19 stops at the end of number.
+               ;; Advance to the next line.
+               (if (eolp)
+                   (forward-line 1))
+               (if (> thisfilepos nodepos)
+                   (throw 'foo t))
+               (setq lastfilename thisfilename)
+               (setq lastfilepos thisfilepos))
+           (throw 'foo t)))))
     (or (equal Info-current-subfile lastfilename)
        (let ((buffer-read-only nil))
          (setq buffer-file-name nil)
@@ -1568,14 +1578,15 @@ annotation for any node of any file.  (See `a' and `x' commands.)"
 
 (defun Info-build-node-completions ()
   (or Info-current-file-completions
-      (let ((compl (Info-build-annotation-completions)))
+      (let ((m Info-tag-table-marker)
+           (compl (Info-build-annotation-completions)))
        (save-excursion
          (save-restriction
            (widen)
            (if (marker-buffer Info-tag-table-marker)
                (progn
                  (set-buffer (marker-buffer Info-tag-table-marker))
-                 (goto-char Info-tag-table-marker)
+                 (goto-char m)
                  (while (re-search-forward "\nNode: \\(.*\\)\177" nil t)
                    (setq compl
                          (cons (list (buffer-substring (match-beginning 1)
@@ -1626,26 +1637,27 @@ annotation for any node of any file.  (See `a' and `x' commands.)"
       (if (not found)                   ;can only happen in subfile case -- else would have erred
           (unwind-protect
               (let ((list ()))
-                (set-buffer (marker-buffer Info-tag-table-marker))
-                (goto-char (point-min))
-                (search-forward "\n\^_\nIndirect:")
-                (save-restriction
-                  (narrow-to-region (point)
-                                    (progn (search-forward "\n\^_")
-                                           (1- (point))))
-                  (goto-char (point-min))
-                  (search-forward (concat "\n" osubfile ": "))
-                  (beginning-of-line)
-                  (while (not (eobp))
-                    (re-search-forward "\\(^.*\\): [0-9]+$")
-                    (goto-char (+ (match-end 1) 2))
-                    (setq list (cons (cons (read (current-buffer))
-                                           (buffer-substring (match-beginning 1)
-                                                             (match-end 1)))
-                                     list))
-                    (goto-char (1+ (match-end 0))))
-                  (setq list (nreverse list)
-                        list (cdr list)))
+                (save-excursion
+                 (set-buffer (marker-buffer Info-tag-table-marker))
+                 (goto-char (point-min))
+                 (search-forward "\n\^_\nIndirect:")
+                 (save-restriction
+                   (narrow-to-region (point)
+                                     (progn (search-forward "\n\^_")
+                                            (1- (point))))
+                   (goto-char (point-min))
+                   (search-forward (concat "\n" osubfile ": "))
+                   (beginning-of-line)
+                   (while (not (eobp))
+                     (re-search-forward "\\(^.*\\): [0-9]+$")
+                     (goto-char (+ (match-end 1) 2))
+                     (setq list (cons (cons (read (current-buffer))
+                                            (buffer-substring (match-beginning 1)
+                                                              (match-end 1)))
+                                      list))
+                     (goto-char (1+ (match-end 0))))
+                   (setq list (nreverse list)
+                         list (cdr list))))
                 (while list
                   (message "Searching subfile %s..." (cdr (car list)))
                   (Info-read-subfile (car (car list)))
@@ -2814,6 +2826,9 @@ e Edit the contents of the current node."
   (make-local-variable 'Info-current-subfile)
   (make-local-variable 'Info-current-node)
   (make-local-variable 'Info-tag-table-marker)
+  (setq Info-tag-table-marker (make-marker))
+  (make-local-variable 'Info-tag-table-buffer)
+  (setq Info-tag-table-buffer nil)
   (make-local-variable 'Info-current-file-completions)
   (make-local-variable 'Info-current-annotation-completions)
   (make-local-variable 'Info-index-alternatives)
@@ -2879,7 +2894,7 @@ Allowed only if variable `Info-enable-edit' is non-nil."
   (interactive)
   ;; Do this first, so nothing has changed if user C-g's at query.
   (and (buffer-modified-p)
-       (y-or-n-p-maybe-dialog-box "Save the file? ")
+       (y-or-n-p "Save the file? ")
        (save-buffer))
   (use-local-map Info-mode-map)
   (setq major-mode 'Info-mode)
index f42dc35..492bacd 100644 (file)
@@ -1210,7 +1210,8 @@ Obsolete."
       (set yank-pointer-name
           (setq yank-pointer
                 (mod (+ (or yank-pointer 0)
-                        (if advance -1 1))
+                        ;; XEmacs change
+                        (if advance -1 (if yank-pointer 1 0)))
                      length)))
       (setq isearch-string (nth yank-pointer ring)
            isearch-message (mapconcat 'isearch-text-char-description
index 765ee58..17f2e66 100644 (file)
@@ -272,6 +272,10 @@ Keymap for characters following C-c.")
 (define-key global-map "\M-\C-t" 'transpose-sexps)
 (define-key global-map "\C-x\C-t" 'transpose-lines)
 
+;; XEmacs: much more reasonable and useful key definitions.
+(define-key global-map '(control T) 'transpose-line-down)
+(define-key global-map '(meta T) 'transpose-line-up)
+
 (define-key global-map "\M-;" 'indent-for-comment)
 (define-key global-map "\M-j" 'indent-new-comment-line)
 (define-key global-map "\M-\C-j" 'indent-new-comment-line)
index c27747a..4f5e9a9 100644 (file)
@@ -5,7 +5,7 @@
 ;; Author: Oscar Figueiredo <Oscar.Figueiredo@di.epfl.ch>
 ;; Maintainer: Oscar Figueiredo <Oscar.Figueiredo@di.epfl.ch>
 ;; Created: Jan 1998
-;; Version: $Revision: 1.7.2.7 $
+;; Version: $Revision: 1.7.2.8 $
 ;; Keywords: help comm
 
 ;; This file is part of XEmacs
@@ -444,7 +444,19 @@ and the corresponding decoder is then retrieved from
     (if decoder
        (cons name (mapcar decoder values))
       attr)))
-    
+
+(defun ldap-decode-entry (entry)
+  "Decode the attributes of ENTRY according to LDAP rules."
+  (let (dn decoded)
+    (setq dn (car entry))
+    (if (stringp dn)
+       (setq entry (cdr entry))
+      (setq dn nil))
+    (setq decoded (mapcar 'ldap-decode-attribute entry))
+    (if dn
+       (cons dn decoded)
+      decoded)))
+
 (defun ldap-search (arg1 &rest args)
   "Perform an LDAP search."  
       (apply (if (ldapp arg1)
@@ -490,10 +502,7 @@ entry according to the value of WITHDN."
     (ldap-close ldap)
     (if ldap-ignore-attribute-codings
        result
-      (mapcar (function 
-              (lambda (record)
-                (mapcar 'ldap-decode-attribute record)))
-             result))))
+      (mapcar 'ldap-decode-entry result))))
 
 (defun ldap-add-entries (entries &optional host binddn passwd)
   "Add entries to an LDAP directory.
index 502a93c..d0278b1 100644 (file)
 (defvar emacs-lisp-mode-syntax-table nil)
 (defvar lisp-mode-abbrev-table nil)
 
-;; XEmacs change
-(defvar lisp-interaction-mode-popup-menu
-  (purecopy '("Lisp-Interaction"
-             ["Evaluate Last %_S-expression" eval-last-sexp]
-             ["Evaluate %_Whole Buffer"     eval-current-buffer]
-             ["Evaluate Re%_gion"      eval-region
-              :active (region-exists-p)]
-             "---"
-             ["%_Evaluate This Defun"      eval-defun]
-             ["%_Instrument This Defun for Debugging" edebug-defun]
-             "---"
-             ["Find %_Function Source..." find-function
+(defun construct-lisp-mode-menu (popup-p emacs-lisp-p)
+  (flet ((popup-wrap (form)
+          (if popup-p `(menu-call-at-event ',form) form)))
+    `(,@(if emacs-lisp-p
+         `(["%_Byte-Compile This File" ,(popup-wrap
+                                         'emacs-lisp-byte-compile)]
+           ["B%_yte-Compile/Load This File"
+            ,(popup-wrap 'emacs-lisp-byte-compile-and-load)]
+           ["Byte-%_Recompile Directory..."
+            ,(popup-wrap 'byte-recompile-directory)]
+           "---"))
+       ["%_Evaluate Region or Defun"
+        ,(popup-wrap '(if (region-exists-p)
+                          (call-interactively 'eval-region)
+                        (call-interactively 'eval-defun)))]
+       ["Evaluate %_Whole Buffer" ,(popup-wrap 'eval-current-buffer)]
+       ["Evaluate Last %_S-expression" ,(popup-wrap 'eval-last-sexp)]
+       "---"
+       ,@(if popup-p
+           '(["%_Find Function"
+              (find-function (menu-call-at-event '(function-at-point)))
+              :suffix (let ((fun (menu-call-at-event '(function-at-point))))
+                        (if fun (symbol-name fun) ""))
+              :active (and (fboundp 'find-function)
+                           (menu-call-at-event '(function-at-point)))]
+             ["%_Find Variable"
+              (find-variable (menu-call-at-event '(variable-at-point)))
+              :suffix (let ((fun (menu-call-at-event '(variable-at-point))))
+                        (if fun (symbol-name fun) ""))
+              :active (and (fboundp 'find-variable)
+                           (menu-call-at-event '(variable-at-point)))]
+             ["%_Help on Function"
+              (describe-function (menu-call-at-event '(function-at-point)))
+              :suffix (let ((fun (menu-call-at-event '(function-at-point))))
+                        (if fun (symbol-name fun) ""))
+              :active (and (fboundp 'describe-function)
+                           (menu-call-at-event '(function-at-point)))]
+             ["%_Help on Variable"
+              (describe-variable (menu-call-at-event '(variable-at-point)))
+              :suffix (let ((fun (menu-call-at-event '(variable-at-point))))
+                        (if fun (symbol-name fun) ""))
+              :active (and (fboundp 'describe-variable)
+                           (menu-call-at-event '(variable-at-point)))])
+           '(["Find %_Function..." find-function
               :active (fboundp 'find-function)]
-             ["Find %_Variable Source..." find-variable
+             ["Find %_Variable..." find-variable
               :active (fboundp 'find-variable)]
-             ["%_Trace Function..."   trace-function-background]
-             ["%_Untrace All Functions"    untrace-all
-              :active (fboundp 'untrace-all)]
-             "---"
-             ["%_Comment Out Region"   comment-region
-              :active (region-exists-p)]
-             "---"
-             ["Indent %_Line or Region"
-              (if (region-exists-p)
-                  (call-interactively 'indent-region)
-                (call-interactively 'lisp-indent-line))]
-             ["Indent B%_alanced Expression"   indent-sexp]
-             ["Indent %_Defun"
-              (progn
-                (beginning-of-defun)
-                (indent-sexp))]
-             "---"
-             "Look for debug-on-error under Options->General"
-             )))
+             ["%_Help on Function..." describe-function
+              :active (fboundp 'describe-function)]
+             ["Hel%_p on Variable..." describe-variable
+              :active (fboundp 'describe-variable)]))
+       "---"
+       ["Instrument This Defun for %_Debugging" ,(popup-wrap 'edebug-defun)]
+       ["%_Trace Function..." trace-function-background]
+       ["%_Untrace All Functions" untrace-all
+        :active (fboundp 'untrace-all)]
+       "---"
+       ["%_Comment Out Region" comment-region :active (region-exists-p)]
+       "---"
+       ["%_Indent Region or Balanced Expression"
+        ,(popup-wrap '(if (region-exists-p)
+                          (call-interactively 'indent-region)
+                        (call-interactively 'indent-sexp)))]
+       ["I%_ndent Defun"
+        ,(popup-wrap '(progn
+                        (beginning-of-defun)
+                        (indent-sexp)))]
+       "---"
+       "Look for debug-on-error under Options->Troubleshooting"
+       )))
+
+(defvar lisp-interaction-mode-popup-menu
+  (cons "Lisp-Interaction" (construct-lisp-mode-menu t nil)))
 
 (defvar emacs-lisp-mode-popup-menu
-  (purecopy
-   (nconc
-    '("Emacs-Lisp"
-      ["%_Byte-Compile This File" emacs-lisp-byte-compile]
-      ["B%_yte-Compile/Load This File" emacs-lisp-byte-compile-and-load]
-      ["Byte-%_Recompile Directory..." byte-recompile-directory]
-      "---")
-    (cdr lisp-interaction-mode-popup-menu))))
+  (cons "Emacs-Lisp" (construct-lisp-mode-menu t t)))
 
 ;Don't have a menubar entry in Lisp Interaction mode.  Otherwise, the
 ;*scratch* buffer has a Lisp menubar item!  Very confusing.
 ;Jan Vroonhof really wants this, so it's back.  --ben
 (defvar lisp-interaction-mode-menubar-menu
-  (purecopy (cons "%_Lisp" (cdr lisp-interaction-mode-popup-menu))))
+  (cons "%_Lisp" (construct-lisp-mode-menu nil nil)))
 
 (defvar emacs-lisp-mode-menubar-menu
-  (purecopy (cons "%_Lisp" (cdr emacs-lisp-mode-popup-menu))))
+  (cons "%_Lisp" (construct-lisp-mode-menu nil t)))
 
 (if (not emacs-lisp-mode-syntax-table)
     (let ((i 0))
@@ -667,8 +699,16 @@ of the start of the containing expression."
       (let ((function (buffer-substring (point)
                                        (progn (forward-sexp 1) (point))))
            method)
-       (setq method (or (get (intern-soft function) 'lisp-indent-function)
-                        (get (intern-soft function) 'lisp-indent-hook)))
+       (if (condition-case nil
+               (save-excursion
+                 (backward-up-list 1)
+                 (backward-up-list 1)
+                 (backward-up-list 1)
+                 (looking-at "(flet\\s-"))
+             (error nil))
+           (setq method 'defun)
+         (setq method (or (get (intern-soft function) 'lisp-indent-function)
+                          (get (intern-soft function) 'lisp-indent-hook))))
        (cond ((or (eq method 'defun)
                   (and (null method)
                        (> (length function) 3)
@@ -749,6 +789,7 @@ of the start of the containing expression."
 (put 'save-excursion 'lisp-indent-function 0)
 (put 'save-window-excursion 'lisp-indent-function 0)
 (put 'save-selected-window 'lisp-indent-function 0)
+(put 'with-selected-window 'lisp-indent-function 1)
 (put 'save-selected-frame 'lisp-indent-function 0)
 (put 'with-selected-frame 'lisp-indent-function 1)
 (put 'save-restriction 'lisp-indent-function 0)
index c61764c..11f695f 100644 (file)
 
 ;;; Code:
 
-;;; Warning-free compile
-(eval-when-compile
-  (defvar language-environment-list)
-  (defvar bookmark-alist)
-  (defvar language-info-alist)
-  (defvar current-language-environment)
-  (defvar tutorial-supported-languages))
-
 (defun menu-truncate-list (list n)
   (if (<= (length list) n)
       list
@@ -147,12 +139,13 @@ which will not be used as accelerators."
       ["Save %_As..." write-file]
       ["Save So%_me Buffers" save-some-buffers]
       "-----"
-      ["%_Print Buffer" generic-print-buffer
+      ["%_Print" generic-print-buffer
        :active (or (valid-specifier-tag-p 'msprinter)
                   (and (not (eq system-type 'windows-nt))
                        (fboundp 'lpr-buffer)))
-       :suffix (if put-buffer-names-in-file-menu (buffer-name) "")]
-      ["Prett%_y-Print Buffer" ps-print-buffer-with-faces
+       :suffix (if put-buffer-names-in-file-menu (concat (buffer-name) "...")
+                "...")]
+      ["Prett%_y-Print" ps-print-buffer-with-faces
        :active (fboundp 'ps-print-buffer-with-faces)
        :suffix (if put-buffer-names-in-file-menu (buffer-name) "")]
       "-----"
@@ -194,15 +187,12 @@ which will not be used as accelerators."
        :active (selection-owner-p)]
       "----"
       ["Select %_All" mark-whole-buffer]
-      ["Select %_Page" mark-page]
-      "----"
-      ["%_Search..." make-search-dialog]
-      ["%_1 Replace..." query-replace]
+      ["Select Pa%_ge" mark-page]
       "----"
-      ["%_2 Search (Regexp)..." isearch-forward-regexp]
-      ["%_3 Search Backward (Regexp)..." isearch-backward-regexp]
-      ["%_4 Replace (Regexp)..." query-replace-regexp]
-
+      ["%_Find..." make-search-dialog]
+      ["R%_eplace..." query-replace]
+      ["Replace (Rege%_xp)..." query-replace-regexp]
+      ["%_List Matching Lines..." list-matching-lines]
       ,@(when (featurep 'mule)
         '("----"
           ("%_Multilingual (\"Mule\")"
@@ -363,13 +353,20 @@ which will not be used as accelerators."
        :style toggle :selected mouse-track-rectangle-p]
        )
       ("%_Sort"
-       ["%_Lines" sort-lines :active (region-exists-p)]
-       ["%_Paragraphs" sort-paragraphs :active (region-exists-p)]
-       ["P%_ages" sort-pages :active (region-exists-p)]
-       ["%_Columns" sort-columns :active (region-exists-p)]
+       ["%_Lines in Region" sort-lines :active (region-exists-p)]
+       ["%_Paragraphs in Region" sort-paragraphs :active (region-exists-p)]
+       ["P%_ages in Region" sort-pages :active (region-exists-p)]
+       ["%_Columns in Region" sort-columns :active (region-exists-p)]
        ["%_Regexp..." sort-regexp-fields :active (region-exists-p)]
        )
-      ("%_Center"
+      ("%_Change Case"
+       ["%_Upcase Region" upcase-region :active (region-exists-p)]
+       ["%_Downcase Region" downcase-region :active (region-exists-p)]
+       ["%_Capitalize Region" capitalize-region :active (region-exists-p)]
+       ["%_Title-Case Region" capitalize-region-as-title
+       :active (region-exists-p)]
+       )
+      ("Ce%_nter"
        ["%_Line" center-line]
        ["%_Paragraph" center-paragraph]
        ["%_Region" center-region :active (region-exists-p)]
@@ -393,6 +390,25 @@ which will not be used as accelerators."
       )
 
      ("%_Tools"
+      ("%_Packages"
+       ("%_Add Download Site"
+        :filter (lambda (&rest junk)
+                  (submenu-generate-accelerator-spec
+                  (package-get-download-menu))))
+       ["%_Update Package Index" package-get-update-base]
+       ["%_List and Install" pui-list-packages]
+       ["U%_pdate Installed Packages" package-get-update-all]
+       ;; hack-o-matic, we can't force a load of package-base here
+       ;; since it triggers dialog box interactions which we can't
+       ;; deal with while using a menu
+       ("Using %_Custom" 
+       :filter (lambda (&rest junk)
+                 (if package-get-base
+                     (submenu-generate-accelerator-spec
+                      (cdr (custom-menu-create 'packages)))
+                   '("Please load Package Index"))))
+       
+       ["%_Help" (Info-goto-node "(xemacs)Packages")])
       ("%_Internet"
        ["Read Mail %_1 (VM)..." vm
        :active (fboundp 'vm)]
@@ -631,38 +647,10 @@ which will not be used as accelerators."
        ["Se%_t..." customize-customized]
        ["%_Apropos..." customize-apropos]
        ["%_Browse..." customize-browse])
-      ("Manage %_Packages"
-       ("%_Add Download Site"
-        :filter (lambda (&rest junk)
-                  (submenu-generate-accelerator-spec
-                  (package-get-download-menu))))
-       ["%_Update Package Index" package-get-update-base]
-       ["%_List and Install" pui-list-packages]
-       ["U%_pdate Installed Packages" package-get-update-all]
-       ;; hack-o-matic, we can't force a load of package-base here
-       ;; since it triggers dialog box interactions which we can't
-       ;; deal with while using a menu
-       ("Using %_Custom" 
-       :filter (lambda (&rest junk)
-                 (if package-get-base
-                     (submenu-generate-accelerator-spec
-                      (cdr (custom-menu-create 'packages)))
-                   '(["Please load Package Index"
-                      (lamda (&rest junk) ()) nil]))))
-       
-       ["%_Help" (Info-goto-node "(xemacs)Packages")])
       "---"
-      ("%_Keyboard and Mouse"
-       ["%_Abbrev Mode"
-       (customize-set-variable 'abbrev-mode
-                               (not (default-value 'abbrev-mode)))
-       :style toggle
-       :selected (default-value 'abbrev-mode)]
-       ["%_Delete Key Deletes Selection"
-       (customize-set-variable 'pending-delete-mode (not pending-delete-mode))
-       :style toggle
-       :selected (and (boundp 'pending-delete-mode) pending-delete-mode)
-       :active (boundp 'pending-delete-mode)]
+      ("%_Editing"
+       ["This Buffer %_Read Only" (toggle-read-only)
+       :style toggle :selected buffer-read-only]
        ["%_Yank/Kill Interact With Clipboard"
        (if (eq interprogram-cut-function 'own-clipboard)
            (progn
@@ -677,38 +665,20 @@ which will not be used as accelerators."
          (setq overwrite-mode (if overwrite-mode nil 'overwrite-mode-textual))
          (customize-set-variable 'overwrite-mode overwrite-mode))
        :style toggle :selected overwrite-mode]
-       ("`%_kill-line' Behavior..."
-       ["Kill %_Whole Line"
-        (customize-set-variable 'kill-whole-line 'always)
-        :style radio :selected (eq kill-whole-line 'always)]
-       ["Kill to %_End of Line"
-        (customize-set-variable 'kill-whole-line nil)
-        :style radio :selected (eq kill-whole-line nil)]
-       ["Kill Whole Line at %_Beg, Otherwise to End"
-        (customize-set-variable 'kill-whole-line t)
-        :style radio :selected (eq kill-whole-line t)])
-       ["Size for %_Block-Movement Commands..."
-       (customize-set-variable 'block-movement-size
-                               (read-number "Block Movement Size: "
-                                             t block-movement-size))]
-       ["%_VI Emulation"
-       (progn
-         (toggle-viper-mode)
-         (customize-set-variable 'viper-mode viper-mode))
-       :style toggle :selected (and (boundp 'viper-mode) viper-mode)
-       :active (fboundp 'toggle-viper-mode)]
+       ["%_Abbrev Mode"
+       (customize-set-variable 'abbrev-mode
+                               (not (default-value 'abbrev-mode)))
+       :style toggle
+       :selected (default-value 'abbrev-mode)]
        ["Active Re%_gions"
        (customize-set-variable 'zmacs-regions (not zmacs-regions))
        :style toggle :selected zmacs-regions]
-       "----"
-       ["%_Set Key..." global-set-key]
-       ["%_Unset Key..." global-unset-key]
        "---"
        ["%_Case Sensitive Search"
        (customize-set-variable 'case-fold-search
                                (setq case-fold-search (not case-fold-search)))
        :style toggle :selected (not case-fold-search)]
-       ["Case Matching %_Replace"
+       ["Case %_Matching Replace"
        (customize-set-variable 'case-replace (not case-replace))
        :style toggle :selected case-replace]
        "---"
@@ -726,43 +696,46 @@ which will not be used as accelerators."
        ["Add Newline When Moving Past %_End"
        (customize-set-variable 'next-line-add-newlines
                                (not next-line-add-newlines))
-       :style toggle :selected next-line-add-newlines]
+       :style toggle :selected next-line-add-newlines])
+      ("%_Keyboard and Mouse"
+       ["%_Delete Key Deletes Selection"
+       (customize-set-variable 'pending-delete-mode (not pending-delete-mode))
+       :style toggle
+       :selected (and (boundp 'pending-delete-mode) pending-delete-mode)
+       :active (boundp 'pending-delete-mode)]
+       ("`%_kill-line' Behavior..."
+       ["Kill %_Whole Line"
+        (customize-set-variable 'kill-whole-line 'always)
+        :style radio :selected (eq kill-whole-line 'always)]
+       ["Kill to %_End of Line"
+        (customize-set-variable 'kill-whole-line nil)
+        :style radio :selected (eq kill-whole-line nil)]
+       ["Kill Whole Line at %_Beg, Otherwise to End"
+        (customize-set-variable 'kill-whole-line t)
+        :style radio :selected (eq kill-whole-line t)])
+       ["Size for %_Block-Movement Commands..."
+       (customize-set-variable 'block-movement-size
+                               (read-number "Block Movement Size: "
+                                             t block-movement-size))]
+       ["%_VI Emulation"
+       (progn
+         (toggle-viper-mode)
+         (customize-set-variable 'viper-mode viper-mode))
+       :style toggle :selected (and (boundp 'viper-mode) viper-mode)
+       :active (fboundp 'toggle-viper-mode)]
+       "----"
+       ["%_Set Key..." global-set-key]
+       ["%_Unset Key..." global-unset-key]
        "---"
-       ["%_Mouse Paste at Text Cursor"
+       ["%_Mouse Paste at Text Cursor (not Clicked Location)"
        (customize-set-variable 'mouse-yank-at-point (not mouse-yank-at-point))
        :style toggle :selected mouse-yank-at-point]
-       ["A%_void Text..."
-       (customize-set-variable 'mouse-avoidance-mode
-                               (if mouse-avoidance-mode nil 'banish))
-       :style toggle
-       :selected (and (boundp 'mouse-avoidance-mode) mouse-avoidance-mode)
-       :active (and (boundp 'mouse-avoidance-mode)
-                    (device-on-window-system-p))]
-       ["%_Strokes Mode"
-       (customize-set-variable 'strokes-mode (not strokes-mode))
-       :style toggle
-       :selected (and (boundp 'strokes-mode) strokes-mode)
-       :active (and (boundp 'strokes-mode)
-                    (device-on-window-system-p))]
-       )
-      ("%_General"
-       ["This Buffer %_Read Only" (toggle-read-only)
-       :style toggle :selected buffer-read-only]
+       "---"
        ["%_Teach Extended Commands"
        (customize-set-variable 'teach-extended-commands-p
                                (not teach-extended-commands-p))
        :style toggle :selected teach-extended-commands-p]
-       ["Debug on %_Error"
-       (customize-set-variable 'debug-on-error (not debug-on-error))
-       :style toggle :selected debug-on-error]
-       ["Debug on %_Quit"
-       (customize-set-variable 'debug-on-quit (not debug-on-quit))
-       :style toggle :selected debug-on-quit]
-       ["Debug on %_Signal"
-       (customize-set-variable 'debug-on-signal (not debug-on-signal))
-       :style toggle :selected debug-on-signal]
        )
-      
       ("%_Printing"
        ["Set Printer %_Name for Generic Print Support..."
        (customize-set-variable
@@ -967,46 +940,113 @@ which will not be used as accelerators."
                        (eq browse-url-browser-function 'browse-url-kfm))
         :active (and (boundp 'browse-url-browser-function)
                      (fboundp 'browse-url-kfm))]
-       ))
-
-
+       ))      
+      ("%_Troubleshooting"
+       ["%_Debug on Error"
+       (customize-set-variable 'debug-on-error (not debug-on-error))
+       :style toggle :selected debug-on-error]
+       ["Debug on %_Quit"
+       (customize-set-variable 'debug-on-quit (not debug-on-quit))
+       :style toggle :selected debug-on-quit]
+       ["Debug on S%_ignal"
+       (customize-set-variable 'debug-on-signal (not debug-on-signal))
+       :style toggle :selected debug-on-signal]
+       ["%_Stack Trace on Error"
+       (customize-set-variable 'stack-trace-on-error
+                               (not stack-trace-on-error))
+       :style toggle :selected stack-trace-on-error]
+       ["Stack Trace on Si%_gnal"
+       (customize-set-variable 'stack-trace-on-signal
+                               (not stack-trace-on-signal))
+       :style toggle :selected stack-trace-on-signal]
+       )
       "-----"
-      ("Display"
+      ("%_Display"
        ,@(if (featurep 'scrollbar)
             '(["%_Scrollbars"
                (customize-set-variable 'scrollbars-visible-p
                                        (not scrollbars-visible-p))
                :style toggle
                :selected scrollbars-visible-p]))
-       ;; I don't think this is of any interest. - dverna apr. 98
-       ;; #### I beg to differ!  Many FSFmacs converts hate the 3D
-       ;; modeline, and it was perfectly fine to be able to turn them
-       ;; off through the Options menu.  I would have uncommented this
-       ;; source, but the code for saving options would not save the
-       ;; modeline 3D-ness.  Grrr.  --hniksic
-       ;;       ["%_3D Modeline"
-       ;;        (progn
-       ;;          (if (zerop (specifier-instance modeline-shadow-thickness))
-       ;;              (set-specifier modeline-shadow-thickness 2)
-       ;;            (set-specifier modeline-shadow-thickness 0))
-       ;;          (redraw-modeline t))
-       ;;        :style toggle
-       ;;        :selected (let ((thickness
-       ;;                         (specifier-instance modeline-shadow-thickness)))
-       ;;                    (and (integerp thickness)
-       ;;                         (> thickness 0)))]
-       ["%_Truncate Lines"
+       ["%_3D Modeline"
+       (customize-set-variable 'modeline-3d-p
+                               (not modeline-3d-p))
+       :style toggle
+       :selected modeline-3d-p]
+       ["%_Wrap Long Lines"
        (progn;; becomes buffer-local
          (setq truncate-lines (not truncate-lines))
          (customize-set-variable 'truncate-lines truncate-lines))
        :style toggle
-       :selected truncate-lines]
+       :selected (not truncate-lines)]
+       ,@(if (featurep 'toolbar)
+            '("---"
+              ["%_Toolbars Visible"
+               (customize-set-variable 'toolbar-visible-p
+                                       (not toolbar-visible-p))
+               :style toggle
+               :selected toolbar-visible-p]
+              ["Toolbars Ca%_ptioned"
+               (customize-set-variable 'toolbar-captioned-p
+                                       (not toolbar-captioned-p))
+               :style toggle
+               :active toolbar-visible-p
+               :selected toolbar-captioned-p]
+              ("Default Toolba%_r Location"
+               ["%_Top"
+                (customize-set-variable 'default-toolbar-position 'top)
+                :style radio
+                :active toolbar-visible-p
+                :selected (eq default-toolbar-position 'top)]
+               ["%_Bottom"
+                (customize-set-variable 'default-toolbar-position 'bottom)
+                :style radio
+                :active toolbar-visible-p
+                :selected (eq default-toolbar-position 'bottom)]
+               ["%_Left"
+                (customize-set-variable 'default-toolbar-position 'left)
+                :style radio
+                :active toolbar-visible-p
+                :selected (eq default-toolbar-position 'left)]
+               ["%_Right"
+                (customize-set-variable 'default-toolbar-position 'right)
+                :style radio
+                :active toolbar-visible-p
+                :selected (eq default-toolbar-position 'right)]
+               )
+              ))
+       ,@(if (featurep 'gutter)
+            '("---"
+              ["B%_uffers Tab Visible"
+               (customize-set-variable 'gutter-buffers-tab-visible-p
+                                       (not gutter-buffers-tab-visible-p))
+               :style toggle
+               :selected gutter-buffers-tab-visible-p]
+              ("Default %_Gutter Location"
+               ["%_Top"
+                (customize-set-variable 'default-gutter-position 'top)
+                :style radio
+                :selected (eq default-gutter-position 'top)]
+               ["%_Bottom"
+                (customize-set-variable 'default-gutter-position 'bottom)
+                :style radio
+                :selected (eq default-gutter-position 'bottom)]
+               ["%_Left"
+                (customize-set-variable 'default-gutter-position 'left)
+                :style radio
+                :selected (eq default-gutter-position 'left)]
+               ["%_Right"
+                (customize-set-variable 'default-gutter-position 'right)
+                :style radio
+                :selected (eq default-gutter-position 'right)]
+               )
+              ))
+       "-----"
        ["%_Blinking Cursor"
        (customize-set-variable 'blink-cursor-mode (not blink-cursor-mode))
        :style toggle
        :selected (and (boundp 'blink-cursor-mode) blink-cursor-mode)
        :active (boundp 'blink-cursor-mode)]
-       "-----"
        ["Bl%_ock Cursor"
        (progn
          (customize-set-variable 'bar-cursor nil)
@@ -1025,6 +1065,34 @@ which will not be used as accelerators."
          (force-cursor-redisplay))
        :style radio
        :selected (and bar-cursor (not (eq bar-cursor t)))]
+       "----"
+       ("Pa%_ren Highlighting"
+       ["%_None"
+       (customize-set-variable 'paren-mode nil)
+       :style radio
+       :selected (and (boundp 'paren-mode) (not paren-mode))
+       :active (boundp 'paren-mode)]
+       ["%_Blinking Paren"
+       (customize-set-variable 'paren-mode 'blink-paren)
+       :style radio
+       :selected (and (boundp 'paren-mode) (eq paren-mode 'blink-paren))
+       :active (boundp 'paren-mode)]
+       ["%_Steady Paren"
+       (customize-set-variable 'paren-mode 'paren)
+       :style radio
+       :selected (and (boundp 'paren-mode) (eq paren-mode 'paren))
+       :active (boundp 'paren-mode)]
+       ["%_Expression"
+       (customize-set-variable 'paren-mode 'sexp)
+       :style radio
+       :selected (and (boundp 'paren-mode) (eq paren-mode 'sexp))
+       :active (boundp 'paren-mode)]
+       ;;       ["Nes%_ted Shading"
+       ;;        (customize-set-variable 'paren-mode 'nested)
+       ;;        :style radio
+       ;;        :selected (and (boundp 'paren-mode) (eq paren-mode 'nested))
+       ;;        :active (boundp 'paren-mode)]
+       )
        "------"
        ["%_Line Numbers"
        (progn
@@ -1045,23 +1113,28 @@ which will not be used as accelerators."
         :style radio
         :selected (null get-frame-for-buffer-default-instance-limit)]
        ["Other Frame (%_2 Frames Max)"
-        (customize-set-variable 'get-frame-for-buffer-default-instance-limit 2)
+        (customize-set-variable 'get-frame-for-buffer-default-instance-limit
+                                2)
         :style radio
         :selected (eq 2 get-frame-for-buffer-default-instance-limit)]
        ["Other Frame (%_3 Frames Max)"
-        (customize-set-variable 'get-frame-for-buffer-default-instance-limit 3)
+        (customize-set-variable 'get-frame-for-buffer-default-instance-limit
+                                3)
         :style radio
         :selected (eq 3 get-frame-for-buffer-default-instance-limit)]
        ["Other Frame (%_4 Frames Max)"
-        (customize-set-variable 'get-frame-for-buffer-default-instance-limit 4)
+        (customize-set-variable 'get-frame-for-buffer-default-instance-limit
+                                4)
         :style radio
         :selected (eq 4 get-frame-for-buffer-default-instance-limit)]
        ["Other Frame (%_5 Frames Max)"
-        (customize-set-variable 'get-frame-for-buffer-default-instance-limit 5)
+        (customize-set-variable 'get-frame-for-buffer-default-instance-limit
+                                5)
         :style radio
         :selected (eq 5 get-frame-for-buffer-default-instance-limit)]
        ["Always Create %_New Frame"
-        (customize-set-variable 'get-frame-for-buffer-default-instance-limit 0)
+        (customize-set-variable 'get-frame-for-buffer-default-instance-limit
+                                0)
         :style radio
         :selected (eq 0 get-frame-for-buffer-default-instance-limit)]
        "-----"
@@ -1077,7 +1150,8 @@ which will not be used as accelerators."
         :selected (null temp-buffer-show-function)]
        "-----"
        ["%_Make Current Frame Gnuserv Target"
-        (customize-set-variable 'gnuserv-frame (if (eq gnuserv-frame t) nil t))
+        (customize-set-variable 'gnuserv-frame (if (eq gnuserv-frame t) nil
+                                                 t))
         :style toggle
         :selected (and (boundp 'gnuserv-frame) (eq gnuserv-frame t))
         :active (boundp 'gnuserv-frame)]
@@ -1159,64 +1233,6 @@ which will not be used as accelerators."
        :selected (and (boundp 'font-menu-ignore-scaled-fonts)
                       font-menu-ignore-scaled-fonts)]
        )
-      ,@(if (featurep 'toolbar)
-           '(("%_Toolbars"
-              ["%_Visible"
-               (customize-set-variable 'toolbar-visible-p
-                                       (not toolbar-visible-p))
-               :style toggle
-               :selected toolbar-visible-p]
-              ["%_Captioned"
-               (customize-set-variable 'toolbar-captioned-p
-                                       (not toolbar-captioned-p))
-               :style toggle
-               :selected toolbar-captioned-p]
-              ("%_Default Location"
-               ["%_Top"
-                (customize-set-variable 'default-toolbar-position 'top)
-                :style radio
-                :selected (eq default-toolbar-position 'top)]
-               ["%_Bottom"
-                (customize-set-variable 'default-toolbar-position 'bottom)
-                :style radio
-                :selected (eq default-toolbar-position 'bottom)]
-               ["%_Left"
-                (customize-set-variable 'default-toolbar-position 'left)
-                :style radio
-                :selected (eq default-toolbar-position 'left)]
-               ["%_Right"
-                (customize-set-variable 'default-toolbar-position 'right)
-                :style radio
-                :selected (eq default-toolbar-position 'right)]
-               )
-              )))
-      ,@(if (featurep 'gutter)
-           '(("G%_utters"
-              ["Buffers Tab %_Visible"
-               (customize-set-variable 'gutter-buffers-tab-visible-p
-                                       (not gutter-buffers-tab-visible-p))
-               :style toggle
-               :selected gutter-buffers-tab-visible-p]
-              ("%_Default Location"
-               ["%_Top"
-                (customize-set-variable 'default-gutter-position 'top)
-                :style radio
-                :selected (eq default-gutter-position 'top)]
-               ["%_Bottom"
-                (customize-set-variable 'default-gutter-position 'bottom)
-                :style radio
-                :selected (eq default-gutter-position 'bottom)]
-               ["%_Left"
-                (customize-set-variable 'default-gutter-position 'left)
-                :style radio
-                :selected (eq default-gutter-position 'left)]
-               ["%_Right"
-                (customize-set-variable 'default-gutter-position 'right)
-                :style radio
-                :selected (eq default-gutter-position 'right)]
-               )
-              )))
-      "-----"
       ("S%_yntax Highlighting"
        ["%_In This Buffer"
        (progn;; becomes buffer local
@@ -1232,6 +1248,13 @@ which will not be used as accelerators."
        :selected (and (boundp 'font-lock-auto-fontify) font-lock-auto-fontify)
        :active (fboundp 'font-lock-mode)]
        "-----"
+       ["Force %_Rehighlight in this Buffer"
+       (customize-set-variable 'font-lock-auto-fontify
+                               (not font-lock-auto-fontify))
+       :style toggle
+       :selected (and (boundp 'font-lock-auto-fontify) font-lock-auto-fontify)
+       :active (fboundp 'font-lock-mode)]
+       "-----"
        ["%_Fonts"
        (progn
          (require 'font-lock)
@@ -1253,7 +1276,7 @@ which will not be used as accelerators."
        :selected (and (boundp 'font-lock-use-colors) font-lock-use-colors)
        :active (boundp 'font-lock-mode)]
        "-----"
-       ["%_Least"
+       ["%_1 Least"
        (progn
          (require 'font-lock)
          (if (or (and (not (integerp font-lock-maximum-decoration))
@@ -1265,12 +1288,12 @@ which will not be used as accelerators."
            (font-lock-recompute-variables)))
        :style radio
        :active (fboundp 'font-lock-mode)
-       :selected (and (boundp 'font-lock-maximium-decoration)
+       :selected (and (boundp 'font-lock-maximum-decoration)
                       (or (and (not (integerp font-lock-maximum-decoration))
                                (not (eq t font-lock-maximum-decoration)))
                           (and (integerp font-lock-maximum-decoration)
                                (<= font-lock-maximum-decoration 0))))]
-       ["M%_ore"
+       ["%_2 More"
        (progn
          (require 'font-lock)
          (if (and (integerp font-lock-maximum-decoration)
@@ -1280,10 +1303,10 @@ which will not be used as accelerators."
            (font-lock-recompute-variables)))
        :style radio
        :active (fboundp 'font-lock-mode)
-       :selected (and (boundp 'font-lock-maximium-decoration)
+       :selected (and (boundp 'font-lock-maximum-decoration)
                       (integerp font-lock-maximum-decoration)
                       (= 1 font-lock-maximum-decoration))]
-       ["%_Even More"
+       ["%_3 Even More"
        (progn
          (require 'font-lock)
          (if (and (integerp font-lock-maximum-decoration)
@@ -1296,7 +1319,7 @@ which will not be used as accelerators."
        :selected (and (boundp 'font-lock-maximum-decoration)
                       (integerp font-lock-maximum-decoration)
                       (= 2 font-lock-maximum-decoration))]
-       ["%_Most"
+       ["%_4 Most"
        (progn
          (require 'font-lock)
          (if (or (eq font-lock-maximum-decoration t)
@@ -1312,7 +1335,19 @@ which will not be used as accelerators."
                           (and (integerp font-lock-maximum-decoration)
                                (>= font-lock-maximum-decoration 3))))]
        "-----"
-       ["La%_zy"
+       ["Lazy %_Lock"
+       (progn;; becomes buffer local
+         (lazy-lock-mode)
+         (customize-set-variable 'lazy-lock-mode lazy-lock-mode)
+         ;; this shouldn't be necessary so there has to
+         ;; be a redisplay bug lurking somewhere (or
+         ;; possibly another event handler bug)
+         (redraw-modeline))
+       :active (and (boundp 'font-lock-mode) (boundp 'lazy-lock-mode)
+                    font-lock-mode)
+       :style toggle
+       :selected (and (boundp 'lazy-lock-mode) lazy-lock-mode)]
+       ["Lazy %_Shot"
        (progn;; becomes buffer local
          (lazy-shot-mode)
          (customize-set-variable 'lazy-shot-mode lazy-shot-mode)
@@ -1337,46 +1372,18 @@ which will not be used as accelerators."
        :style toggle
        :selected (and (boundp 'fast-lock-mode) fast-lock-mode)]
        )
-      ("Pa%_ren Highlighting"
-       ["%_None"
-       (customize-set-variable 'paren-mode nil)
-       :style radio
-       :selected (and (boundp 'paren-mode) (not paren-mode))
-       :active (boundp 'paren-mode)]
-       ["%_Blinking Paren"
-       (customize-set-variable 'paren-mode 'blink-paren)
-       :style radio
-       :selected (and (boundp 'paren-mode) (eq paren-mode 'blink-paren))
-       :active (boundp 'paren-mode)]
-       ["%_Steady Paren"
-       (customize-set-variable 'paren-mode 'paren)
-       :style radio
-       :selected (and (boundp 'paren-mode) (eq paren-mode 'paren))
-       :active (boundp 'paren-mode)]
-       ["%_Expression"
-       (customize-set-variable 'paren-mode 'sexp)
-       :style radio
-       :selected (and (boundp 'paren-mode) (eq paren-mode 'sexp))
-       :active (boundp 'paren-mode)]
-       ;;       ["Nes%_ted Shading"
-       ;;        (customize-set-variable 'paren-mode 'nested)
-       ;;        :style radio
-       ;;        :selected (and (boundp 'paren-mode) (eq paren-mode 'nested))
-       ;;        :active (boundp 'paren-mode)]
-       )
-      "-----"
+      ("%_Font" :filter font-menu-family-constructor)
+      ("Font Si%_ze" :filter font-menu-size-constructor)
+      ;;      ("Font Weig%_ht" :filter font-menu-weight-constructor)
       ["Edit Fa%_ces..." (customize-face nil)]
-      ("Fo%_nt" :filter font-menu-family-constructor)
-      ("Si%_ze"        :filter font-menu-size-constructor)
-      ;;      ("Weig%_ht" :filter font-menu-weight-constructor)
       "-----"
-      ["%_Edit Init (.emacs) File"
+      ["Edit I%_nit File"
        ;; #### there should be something that holds the name that the init
        ;; file should be created as, when it's not present.
-       (progn (find-file (or user-init-file "~/.emacs"))
+       (progn (find-file (or user-init-file "~/.xemacs/init.el"))
              (or (eq major-mode 'emacs-lisp-mode)
                  (emacs-lisp-mode)))]
-      ["%_Save Options to .emacs File" customize-save-customized]
+      ["%_Save Options to Init File" customize-save-customized]
       )
 
      ("%_Buffers"
@@ -1407,9 +1414,9 @@ which will not be used as accelerators."
       ("XEmacs %_FAQ"
        ["%_FAQ (local)" xemacs-local-faq]
        ["FAQ via %_WWW" xemacs-www-faq
-       :active (boundp 'browse-url-browser-function)]
+       :active (fboundp 'browse-url)]
        ["%_Home Page" xemacs-www-page
-       :active (boundp 'browse-url-browser-function)])
+       :active (fboundp 'browse-url)])
       ("%_Tutorials"
        :filter tutorials-menu-filter)
       ("%_Samples"
@@ -1477,15 +1484,17 @@ Adds `Load .emacs' button to menubar when starting up with -q."
 ;;; The Bookmarks menu
 
 (defun bookmark-menu-filter (&rest ignore)
+  (declare (special bookmark-alist))
   (let ((definedp (and (boundp 'bookmark-alist)
                       bookmark-alist
                       t)))
     `(,(if definedp
           '("%_Jump to Bookmark"
             :filter (lambda (&rest junk)
-                      (mapcar #'(lambda (bmk)
-                                  `[,bmk (bookmark-jump ',bmk)])
-                              (bookmark-all-names))))
+                      (submenu-generate-accelerator-spec
+                       (mapcar #'(lambda (bmk)
+                                   `[,bmk (bookmark-jump ',bmk)])
+                               (bookmark-all-names)))))
         ["%_Jump to Bookmark" nil nil])
       ["Set %_Bookmark" bookmark-set
        :active (fboundp 'bookmark-set)]
@@ -1500,9 +1509,10 @@ Adds `Load .emacs' button to menubar when starting up with -q."
       ,(if definedp
           '("%_Delete Bookmark"
             :filter (lambda (&rest junk)
-                      (mapcar #'(lambda (bmk)
-                                  `[,bmk (bookmark-delete ',bmk)])
-                              (bookmark-all-names))))
+                      (submenu-generate-accelerator-spec
+                       (mapcar #'(lambda (bmk)
+                                   `[,bmk (bookmark-delete ',bmk)])
+                               (bookmark-all-names)))))
         ["%_Delete Bookmark" nil nil])
       ["%_Edit Bookmark List" bookmark-bmenu-list      ,definedp]
       "---"
@@ -1517,7 +1527,7 @@ Adds `Load .emacs' button to menubar when starting up with -q."
   "Customization of `Buffers' menu."
   :group 'menu)
 
-(defvar buffers-menu-omit-chars-list '(?b ?p ?l))
+(defvar buffers-menu-omit-chars-list '(?b ?p ?l ?d))
 
 (defcustom buffers-menu-max-size 25
   "*Maximum number of entries which may appear on the \"Buffers\" menu.
@@ -1806,6 +1816,7 @@ items by redefining the function `format-buffers-menu-line'."
 
 (defun language-environment-menu-filter (menu)
   "This is the menu filter for the \"Language Environment\" submenu."
+  (declare (special language-environment-list))
   (let ((n 0))
     (mapcar (lambda (env-sym)
              (setq n (1+ n))
@@ -1847,35 +1858,37 @@ If this is a relative filename, it is put into the same directory as your
 ;;; The Help menu
 
 (defun tutorials-menu-filter (menu-items)
-   (append
+  (declare (special language-info-alist
+                   current-language-environment
+                   tutorial-supported-languages))
+  (append
+   (if (featurep 'mule)
+       (if (assq 'tutorial
+                (assoc current-language-environment language-info-alist))
+          `([,(concat "%_Default (" current-language-environment ")")
+             help-with-tutorial]))
+     '(["%_English" help-with-tutorial]))
+   (submenu-generate-accelerator-spec
     (if (featurep 'mule)
-       (if (assq 'tutorial
-                 (assoc current-language-environment language-info-alist))
-           `([,(concat "%_Default (" current-language-environment ")")
-              help-with-tutorial]))
-      '(["%_English" help-with-tutorial]))
-    (submenu-generate-accelerator-spec
-     (if (featurep 'mule)
-        ;; Mule tutorials.
-        (mapcan #'(lambda (lang)
-                    (let ((tut (assq 'tutorial lang)))
-                      (and tut
-                           (not (string= (car lang) "ASCII"))
-                           ;; skip current language, since we already
-                           ;; included it first
-                           (not (string= (car lang)
-                                         current-language-environment))
-                           `([,(car lang)
-                              (help-with-tutorial nil ,(cdr tut))]))))
-                language-info-alist)
-       ;; Non mule tutorials.
-       (mapcar #'(lambda (lang)
-                  `[,(car lang)
-                    (help-with-tutorial ,(format "TUTORIAL.%s"
-                                                 (cadr lang)))])
-              tutorial-supported-languages)))))
+       ;; Mule tutorials.
+       (mapcan #'(lambda (lang)
+                   (let ((tut (assq 'tutorial lang)))
+                     (and tut
+                          (not (string= (car lang) "ASCII"))
+                          ;; skip current language, since we already
+                          ;; included it first
+                          (not (string= (car lang)
+                                        current-language-environment))
+                          `([,(car lang)
+                             (help-with-tutorial nil ,(cdr tut))]))))
+               language-info-alist)
+      ;; Non mule tutorials.
+      (mapcar #'(lambda (lang)
+                 `[,(car lang)
+                   (help-with-tutorial ,(format "TUTORIAL.%s"
+                                                (cadr lang)))])
+             tutorial-supported-languages)))))
 
-\f
 (set-menubar default-menubar)
 
 \f
@@ -1903,133 +1916,12 @@ If this is a relative filename, it is put into the same directory as your
     ["U%_nsplit Window" delete-other-windows]
     ))
 
-(defvar global-popup-menu nil
-  "The global popup menu.  This is present in all modes.
-See the function `popup-menu' for a description of menu syntax.")
-
-(defvar mode-popup-menu nil
-  "The mode-specific popup menu.  Automatically buffer local.
-This is appended to the default items in `global-popup-menu'.
-See the function `popup-menu' for a description of menu syntax.")
-(make-variable-buffer-local 'mode-popup-menu)
-
 ;; In an effort to avoid massive menu clutter, this mostly worthless menu is
 ;; superseded by any local popup menu...
 (setq-default mode-popup-menu default-popup-menu)
 
-(defvar activate-popup-menu-hook nil
-  "Function or functions run before a mode-specific popup menu is made visible.
-These functions are called with no arguments, and should interrogate and
-modify the value of `global-popup-menu' or `mode-popup-menu' as desired.
-Note: this hook is only run if you use `popup-mode-menu' for activating the
-global and mode-specific commands; if you have your own binding for button3,
-this hook won't be run.")
-
-(defun popup-mode-menu ()
-  "Pop up a menu of global and mode-specific commands.
-The menu is computed by combining `global-popup-menu' and `mode-popup-menu'."
-  (interactive "@_")
-  (run-hooks 'activate-popup-menu-hook)
-  (popup-menu
-   (cond ((and global-popup-menu mode-popup-menu)
-         ;; Merge global-popup-menu and mode-popup-menu
-         (check-menu-syntax mode-popup-menu)
-         (let* ((title (car mode-popup-menu))
-                (items (cdr mode-popup-menu))
-                mode-filters)
-           ;; Strip keywords from local menu for attaching them at the top
-           (while (and items
-                       (keywordp (car items)))
-             ;; Push both keyword and its argument.
-             (push (pop items) mode-filters)
-             (push (pop items) mode-filters))
-           (setq mode-filters (nreverse mode-filters))
-           ;; If mode-filters contains a keyword already present in
-           ;; `global-popup-menu', you will probably lose.
-           (append (list (car global-popup-menu))
-                   mode-filters
-                   (cdr global-popup-menu)
-                   '("---" "---")
-                   (if popup-menu-titles (list title))
-                   (if popup-menu-titles '("---" "---"))
-                   items)))
-        (t
-         (or mode-popup-menu
-             global-popup-menu
-             (error "No menu defined in this buffer"))))))
-
-(defun popup-buffer-menu (event)
-  "Pop up a copy of the Buffers menu (from the menubar) where the mouse is clicked."
-  (interactive "e")
-  (let ((window (and (event-over-text-area-p event) (event-window event)))
-       (bmenu nil))
-    (or window
-       (error "Pointer must be in a normal window"))
-    (select-window window)
-    (if current-menubar
-       (setq bmenu (assoc "%_Buffers" current-menubar)))
-    (if (null bmenu)
-       (setq bmenu (assoc "%_Buffers" default-menubar)))
-    (if (null bmenu)
-       (error "Can't find the Buffers menu"))
-    (popup-menu bmenu)))
-
-(defun popup-menubar-menu (event)
-  "Pop up a copy of menu that also appears in the menubar."
-  (interactive "e")
-  (let ((window (and (event-over-text-area-p event) (event-window event)))
-       popup-menubar)
-    (or window
-       (error "Pointer must be in a normal window"))
-    (select-window window)
-    (and current-menubar (run-hooks 'activate-menubar-hook))
-    ;; #### Instead of having to copy this just to safely get rid of
-    ;; any nil what we should really do is fix up the internal menubar
-    ;; code to just ignore nil if generating a popup menu
-    (setq popup-menubar (delete nil (copy-sequence (or current-menubar
-                                                      default-menubar))))
-    (popup-menu (cons "%_Menubar Menu" popup-menubar))
-    ))
-
-(global-set-key 'button3 'popup-mode-menu)
-;; shift button3 and shift button2 are reserved for Hyperbole
-(global-set-key '(meta control button3) 'popup-buffer-menu)
-;; The following command is way too dangerous with Custom.
-;; (global-set-key '(meta shift button3) 'popup-menubar-menu)
-
-;; Here's a test of the cool new menu features (from Stig).
-
-;;(setq mode-popup-menu
-;;      '("Test Popup Menu"
-;;        :filter cdr
-;;        ["this item won't appear because of the menu filter" ding t]
-;;        "--:singleLine"
-;;        "singleLine"
-;;        "--:doubleLine"
-;;        "doubleLine"
-;;        "--:singleDashedLine"
-;;        "singleDashedLine"
-;;        "--:doubleDashedLine"
-;;        "doubleDashedLine"
-;;        "--:noLine"
-;;        "noLine"
-;;        "--:shadowEtchedIn"
-;;        "shadowEtchedIn"
-;;        "--:shadowEtchedOut"
-;;        "shadowEtchedOut"
-;;        "--:shadowDoubleEtchedIn"
-;;        "shadowDoubleEtchedIn"
-;;        "--:shadowDoubleEtchedOut"
-;;        "shadowDoubleEtchedOut"
-;;        "--:shadowEtchedInDash"
-;;        "shadowEtchedInDash"
-;;        "--:shadowEtchedOutDash"
-;;        "shadowEtchedOutDash"
-;;        "--:shadowDoubleEtchedInDash"
-;;        "shadowDoubleEtchedInDash"
-;;        "--:shadowDoubleEtchedOutDash"
-;;        "shadowDoubleEtchedOutDash"
-;;        ))
+\f
+;; misc
 
 (defun xemacs-splash-buffer ()
   "Redisplay XEmacs splash screen in a buffer."
index cdf247b..de084e1 100644 (file)
@@ -461,6 +461,199 @@ menu item called \"Item\" under the \"Foo\" submenu of \"Menu\"."
   (enable-menu-item-1 path t nil))
 
 \f
+
+;;;;;;; popup menus
+
+(defvar global-popup-menu nil
+  "The global popup menu.  This is present in all modes.
+See the function `popup-menu' for a description of menu syntax.")
+
+(defvar mode-popup-menu nil
+  "The mode-specific popup menu.  Automatically buffer local.
+This is appended to the default items in `global-popup-menu'.
+See the function `popup-menu' for a description of menu syntax.")
+(make-variable-buffer-local 'mode-popup-menu)
+
+(defvar activate-popup-menu-hook nil
+  "Function or functions run before a mode-specific popup menu is made visible.
+These functions are called with no arguments, and should interrogate and
+modify the value of `global-popup-menu' or `mode-popup-menu' as desired.
+Note: this hook is only run if you use `popup-mode-menu' for activating the
+global and mode-specific commands; if you have your own binding for button3,
+this hook won't be run.")
+
+(defvar last-popup-menu-event nil
+  "The mouse event that invoked the last popup menu.
+NOTE: This is EXPERIMENTAL and may change at any time.")
+
+(defun popup-mode-menu (&optional event)
+  "Pop up a menu of global and mode-specific commands.
+The menu is computed by combining `global-popup-menu' and `mode-popup-menu'
+with any items derived from the `context-menu' property of the extent where the
+button was clicked."
+  (interactive "_e")
+  (setq last-popup-menu-event
+       (or (and event (button-event-p event) event)
+           (let* ((mouse-pos (mouse-position))
+                  (win (car mouse-pos))
+                  (x (cadr mouse-pos))
+                  (y (cddr mouse-pos))
+                  (edges (window-pixel-edges win))
+                  (winx (first edges))
+                  (winy (second edges))
+                  (x (+ x winx))
+                  (y (+ y winy)))
+             (make-event 'button-press
+                         `(button 3 x ,x y ,y channel ,(window-frame win)
+                                  timestamp ,(current-event-timestamp
+                                              (cdfw-console win)))))))
+  (run-hooks 'activate-popup-menu-hook)
+  (let* ((context-window (and event (event-window event)))
+        (context-point (and event (event-point event)))
+        (context-extents (and context-window
+                              context-point
+                              (extents-at context-point
+                                          (window-buffer context-window)
+                                          'context-menu)))
+        (context-menu-items
+         (apply 'append (mapcar #'(lambda (extent)
+                                    (extent-property extent 'context-menu))
+                                context-extents))))
+    (popup-menu
+     (cond ((and global-popup-menu mode-popup-menu)
+           ;; Merge global-popup-menu and mode-popup-menu
+           (check-menu-syntax mode-popup-menu)
+           (let* ((title (car mode-popup-menu))
+                  (items (cdr mode-popup-menu))
+                  mode-filters)
+             ;; Strip keywords from local menu for attaching them at the top
+             (while (and items
+                         (keywordp (car items)))
+               ;; Push both keyword and its argument.
+               (push (pop items) mode-filters)
+               (push (pop items) mode-filters))
+             (setq mode-filters (nreverse mode-filters))
+             ;; If mode-filters contains a keyword already present in
+             ;; `global-popup-menu', you will probably lose.
+             (append (list (car global-popup-menu))
+                     mode-filters
+                     (cdr global-popup-menu)
+                     '("---" "---")
+                     (if popup-menu-titles (list title))
+                     (if popup-menu-titles '("---" "---"))
+                     items
+                     context-menu-items)))
+          (t
+           (append
+            (or mode-popup-menu
+                global-popup-menu
+                (error "No menu defined in this buffer"))
+            context-menu-items))))
+
+    (while (popup-up-p)
+      (dispatch-event (next-event)))
+
+    ))
+  
+(defun popup-buffer-menu (event)
+  "Pop up a copy of the Buffers menu (from the menubar) where the mouse is clicked."
+  (interactive "e")
+  (let ((window (and (event-over-text-area-p event) (event-window event)))
+       (bmenu nil))
+    (or window
+       (error "Pointer must be in a normal window"))
+    (select-window window)
+    (if current-menubar
+       (setq bmenu (assoc "%_Buffers" current-menubar)))
+    (if (null bmenu)
+       (setq bmenu (assoc "%_Buffers" default-menubar)))
+    (if (null bmenu)
+       (error "Can't find the Buffers menu"))
+    (popup-menu bmenu)))
+
+(defun popup-menubar-menu (event)
+  "Pop up a copy of menu that also appears in the menubar."
+  (interactive "e")
+  (let ((window (and (event-over-text-area-p event) (event-window event)))
+       popup-menubar)
+    (or window
+       (error "Pointer must be in a normal window"))
+    (select-window window)
+    (and current-menubar (run-hooks 'activate-menubar-hook))
+    ;; #### Instead of having to copy this just to safely get rid of
+    ;; any nil what we should really do is fix up the internal menubar
+    ;; code to just ignore nil if generating a popup menu
+    (setq popup-menubar (delete nil (copy-sequence (or current-menubar
+                                                      default-menubar))))
+    (popup-menu (cons "%_Menubar Menu" popup-menubar))
+    ))
+
+(defun menu-call-at-event (form &optional event default-behavior-fallback)
+  "Call FORM while temporarily setting point to the position in EVENT.
+NOTE: This is EXPERIMENTAL and may change at any time.
+
+FORM is called the way forms in menu specs are: i.e. if a symbol, it's called
+with `call-interactively', otherwise with `eval'.  EVENT defaults to
+`last-popup-menu-event', making this function especially useful in popup
+menus.  The buffer and point are set temporarily within a `save-excursion'.
+If EVENT is not a mouse event, or was not over a buffer, nothing
+happens unless DEFAULT-BEHAVIOR-FALLBACK is non-nil, in which case the
+FORM is called normally."
+  (or event (setq event last-popup-menu-event))
+  (let ((buf (event-buffer event))
+       (p (event-closest-point event)))
+    (cond ((and buf p (> p 0))
+          (save-excursion
+            (set-buffer buf)
+            (goto-char p)
+            (if (symbolp form)
+                (call-interactively form)
+              (eval form))))
+         (default-behavior-fallback
+           (if (symbolp form)
+               (call-interactively form)
+             (eval form))))))
+
+(global-set-key 'button3 'popup-mode-menu)
+;; shift button3 and shift button2 are reserved for Hyperbole
+(global-set-key '(meta control button3) 'popup-buffer-menu)
+;; The following command is way too dangerous with Custom.
+;; (global-set-key '(meta shift button3) 'popup-menubar-menu)
+
+;; Here's a test of the cool new menu features (from Stig).
+
+;;(setq mode-popup-menu
+;;      '("Test Popup Menu"
+;;        :filter cdr
+;;        ["this item won't appear because of the menu filter" ding t]
+;;        "--:singleLine"
+;;        "singleLine"
+;;        "--:doubleLine"
+;;        "doubleLine"
+;;        "--:singleDashedLine"
+;;        "singleDashedLine"
+;;        "--:doubleDashedLine"
+;;        "doubleDashedLine"
+;;        "--:noLine"
+;;        "noLine"
+;;        "--:shadowEtchedIn"
+;;        "shadowEtchedIn"
+;;        "--:shadowEtchedOut"
+;;        "shadowEtchedOut"
+;;        "--:shadowDoubleEtchedIn"
+;;        "shadowDoubleEtchedIn"
+;;        "--:shadowDoubleEtchedOut"
+;;        "shadowDoubleEtchedOut"
+;;        "--:shadowEtchedInDash"
+;;        "shadowEtchedInDash"
+;;        "--:shadowEtchedOutDash"
+;;        "shadowEtchedOutDash"
+;;        "--:shadowDoubleEtchedInDash"
+;;        "shadowDoubleEtchedInDash"
+;;        "--:shadowDoubleEtchedOutDash"
+;;        "shadowDoubleEtchedOutDash"
+;;        ))
+
 (defun get-popup-menu-response (menu-desc &optional event)
   "Pop up the given menu and wait for a response.
 This blocks until the response is received, and returns the misc-user
index 6343c2d..34d2ddb 100644 (file)
@@ -52,7 +52,7 @@
 
 (defcustom minibuffer-history-uniquify t
   "*Non-nil means when adding an item to a minibuffer history, remove
-previous occurances of the same item from the history list first,
+previous occurrences of the same item from the history list first,
 rather than just consing the new element onto the front of the list."
   :type 'boolean
   :group 'minibuffer)
@@ -1329,6 +1329,15 @@ If N is negative, find the previous or Nth previous match."
            current-minibuffer-point (point)))
     (let ((narg (- minibuffer-history-position n))
          (minimum (if minibuffer-default -1 0)))
+      ;; a weird special case here; when in repeat-complex-command, we're
+      ;; trying to edit the top command, and minibuffer-history-position
+      ;; points to 1, the next-to-top command.  in this case, the top
+      ;; command in the history is suppressed in favor of the one being
+      ;; edited, and there is no more command below it, except maybe the
+      ;; default.
+      (if (and (zerop narg) (eq minibuffer-history-position
+                               initial-minibuffer-history-position))
+         (setq minimum (1+ minimum)))
       (cond ((< narg minimum)
             (error (if minibuffer-default
                        "No following item in %s"
@@ -1342,7 +1351,7 @@ If N is negative, find the previous or Nth previous match."
          (progn
            (insert current-minibuffer-contents)
            (goto-char current-minibuffer-point))
-       (let ((elt (if (>= narg 0)
+       (let ((elt (if (> narg 0)
                       (nth (1- minibuffer-history-position)
                            (symbol-value minibuffer-history-variable))
                     minibuffer-default)))
@@ -1660,9 +1669,29 @@ If DEFAULT-VALUE is non-nil, return that if user enters an empty
                                 must-match initial-contents
                                 completer)
   (if (should-use-dialog-box-p)
-      ;; this calls read-file-name-2
-      (mouse-read-file-name-1 history prompt dir default must-match
-                             initial-contents completer)
+      (condition-case nil
+         (let ((file
+                (apply #'make-dialog-box
+                       'file `(:title ,(capitalize-string-as-title
+                                        ;; Kludge: Delete ": " off the end.
+                                        (replace-in-string prompt ": $" ""))
+                                      ,@(and dir (list :initial-directory
+                                                       dir))
+                                      :file-must-exist ,must-match
+                                      ,@(and initial-contents
+                                             (list :initial-filename
+                                                   initial-contents))))))
+           ;; hack -- until we implement reading a directory properly,
+           ;; allow a file as indicating the directory it's in
+           (if (and (eq completer 'read-directory-name-internal)
+                    (not (file-directory-p file)))
+               (file-name-directory file)
+             file))
+       (unimplemented
+        ;; this calls read-file-name-2
+        (mouse-read-file-name-1 history prompt dir default must-match
+                                initial-contents completer)
+        ))
     (add-one-shot-hook
      'minibuffer-setup-hook
      (lambda ()
@@ -1946,13 +1975,8 @@ whether it is a file(/result) or a directory (/result/)."
   ;; a specifier would be nice.
   (set (make-local-variable 'frame-title-format)
        (capitalize-string-as-title
-       ;; Delete ": " off the end.  There must be an easier way!
-       (let ((end-pos (length prompt)))
-         (if (and (> end-pos 0) (eq (aref prompt (1- end-pos)) ? ))
-             (setq end-pos (1- end-pos)))
-         (if (and (> end-pos 0) (eq (aref prompt (1- end-pos)) ?:))
-             (setq end-pos (1- end-pos)))
-         (substring prompt 0 end-pos))))
+       ;; Kludge: Delete ": " off the end.
+       (replace-in-string prompt ": $" "")))
   ;; ensure that killing the frame works right,
   ;; instead of leaving us in the minibuffer.
   (add-local-hook 'delete-frame-hook
index 18baacd..c6e6a09 100644 (file)
   "Modeline customizations."
   :group 'environment)
 
+(defcustom modeline-3d-p ;; added for the options menu
+  (let ((thickness
+        (specifier-instance modeline-shadow-thickness)))
+    (and (integerp thickness)
+        (> thickness 0)))
+  "Whether the default toolbar is globally visible. This option can be
+customized through the options menu."
+  :group 'display
+  :type 'boolean
+  :set #'(lambda (var val)
+          (if val
+              (set-specifier modeline-shadow-thickness 2)
+            (set-specifier modeline-shadow-thickness 0))
+          (redraw-modeline t)
+          (setq modeline-3d-p val))
+  )
+
 (defcustom drag-divider-event-lag 150
   "*The pause (in msecs) between divider drag events before redisplaying.
 If this value is too small, dragging will be choppy because redisplay cannot
index 9cdab7b..3fdc75a 100644 (file)
@@ -2,7 +2,7 @@
 
 ;; Copyright (C) 1988, 1992-4, 1997 Free Software Foundation, Inc.
 ;; Copyright (C) 1995 Tinker Systems
-;; Copyright (C) 1995, 1996 Ben Wing.
+;; Copyright (C) 1995, 1996, 2000 Ben Wing.
 
 ;; Maintainer: XEmacs Development Team
 ;; Keywords: mouse, dumped
 
 ;; This file is dumped with XEmacs (when window system support is compiled in).
 
+;;; Authorship:
+
+;; Probably originally derived from FSF 19 pre-release.
+;; much hacked upon by Jamie Zawinski and crew, pre-1994.
+;;   (only mouse-motion stuff currently remains from that era)
+;; all mouse-track stuff completely rewritten by Ben Wing, 1995-1996.
+;; mouse-eval-sexp and *-inside-extent-p from Stig, 1995.
+;; vertical divider code c. 1998 from ?.
+
 ;;; Code:
 
 (provide 'mouse)
 (global-set-key '(control button1) 'mouse-track-insert)
 (global-set-key '(control shift button1) 'mouse-track-delete-and-insert)
 (global-set-key '(meta button1) 'mouse-track-do-rectangle)
-
-;; drops are now handled in dragdrop.el (ograf@fga.de)
-
-;; enable drag regions (ograf@fga.de)
-;; if button2 is dragged from within a region, this becomes a drop
-;;
-;; this must be changed to the new api
-(if (featurep '(or offix cde mswindows))
-    (global-set-key 'button2 'mouse-drag-or-yank)
-  (global-set-key 'button2 'mouse-yank))
+(global-set-key 'button2 'mouse-track)
 
 (defgroup mouse nil
   "Window system-independent mouse support."
@@ -185,7 +185,6 @@ location."
 (defun click-inside-extent-p (click extent)
   "Return non-nil if the button event is within the primary selection-extent.
 Return nil otherwise."
-  ;; stig@hackvan.com
   (let ((ewin (event-window click))
        (epnt (event-point click)))
     (and ewin
@@ -206,7 +205,6 @@ Return nil otherwise."
   "Return t if point is within the bounds of the primary selection extent.
 Return t is point is at the end position of the extent.
 Return nil otherwise."
-  ;; stig@hackvan.com
   (and extent
        (eq (current-buffer)
           (extent-object extent))
@@ -214,35 +212,27 @@ Return nil otherwise."
        (>= (extent-end-position extent) (point))))
 
 (defun point-inside-selection-p ()
-  ;; by Stig@hackvan.com
   (or (point-inside-extent-p primary-selection-extent)
       (point-inside-extent-p zmacs-region-extent)))
 
-(defun mouse-drag-or-yank (event)
-  "Either drag or paste the current selection.
-If the variable `mouse-yank-at-point' is non-nil,
-move the cursor to the location of the click before pasting.
-This functions has to be improved.  Currently it is just a (working) test."
-  ;; by Oliver Graf <ograf@fga.de>
-  (interactive "e")
-  (if (click-inside-extent-p event zmacs-region-extent)
-      ;; okay, this is a drag
-      (cond ((featurep 'offix)
-            (offix-start-drag-region 
-             event
-             (extent-start-position zmacs-region-extent)
-             (extent-end-position zmacs-region-extent)))
-           ((featurep 'cde)
-            ;; should also work with CDE
-            (cde-start-drag-region event
-                                   (extent-start-position zmacs-region-extent)
-                                   (extent-end-position zmacs-region-extent)))
-           (t (error "No offix or CDE support compiled in")))
-    ;; no drag, call region-funct
-    (and (not mouse-yank-at-point)
-        (mouse-set-point event))
-    (funcall mouse-yank-function))
-  )
+(defun mouse-begin-drag-n-drop (event)
+  "Begin a drag-n-drop operation.
+EVENT should be the button event that initiated the drag.
+Returns whether a drag was begun."
+  ;; #### barely implemented.
+  (when (click-inside-selection-p event)
+    (cond ((featurep 'offix)
+          (offix-start-drag-region 
+           event
+           (extent-start-position zmacs-region-extent)
+           (extent-end-position zmacs-region-extent))
+          t)
+         ((featurep 'cde)
+          ;; should also work with CDE
+          (cde-start-drag-region event
+                                 (extent-start-position zmacs-region-extent)
+                                 (extent-end-position zmacs-region-extent))
+          t))))
 
 (defun mouse-eval-sexp (click force-window)
   "Evaluate the sexp under the mouse.  Usually, this is the last sexp before
@@ -257,7 +247,6 @@ click, but to the current window and the current position of point.  Thus,
 you can use `mouse-eval-sexp' to interactively test code that acts upon a
 buffer...something you cannot do with the standard `eval-last-sexp' function.
 It's also fantastic for debugging regular expressions."
-  ;; by Stig@hackvan.com
   (interactive "e\nP")
   (let (exp val result-str)
     (setq exp (save-window-excursion
@@ -503,6 +492,36 @@ A value of nil disables the timeout feature."
   :type '(choice integer (const :tag "Disabled" nil))
   :group 'mouse)
 
+(defcustom mouse-track-activate-strokes '(button1-double-click button2-click)
+  "List of mouse strokes that can cause \"activation\" of the text extent
+under the mouse.  The exact meaning of \"activation\" is dependent on the
+text clicked on and the mode of the buffer, but typically entails actions
+such as following a hyperlink or selecting an entry in a completion buffer.
+
+Possible list entries are
+
+button1-click
+button1-double-click
+button1-triple-click
+button1-down
+button2-click
+button2-double-click
+button2-triple-click
+button2-down
+
+As a general rule, you should not use the \"-down\" values, because this
+makes it impossible to have other simultaneous actions, such as selection."
+  :type '(set
+         button1-click
+         button1-double-click
+         button1-triple-click
+         button1-down
+         button2-click
+         button2-double-click
+         button2-triple-click
+         button2-down)
+  :group 'mouse)
+
 (defvar mouse-track-x-threshold '(face-width 'default)
   "Minimum number of pixels in the X direction for a drag to be initiated.
 If the mouse is moved more than either the X or Y threshold while the
@@ -539,6 +558,15 @@ produce a number.")
                         'mouse-track-scroll-undefined
                         (copy-event event)))))
 
+(defun mouse-track-do-activate (event)
+  "Execute the activate function under EVENT, if any.
+Return true if the function was activated."
+  (let ((ex (extent-at-event event 'activate-function)))
+    (when ex
+      (funcall (extent-property ex 'activate-function)
+              event ex)
+      t)))
+
 (defun mouse-track-run-hook (hook event &rest args)
   ;; ugh, can't use run-hook-with-args-until-success because we have
   ;; to get the value using symbol-value-in-buffer.  Doing a
@@ -585,9 +613,9 @@ produce a number.")
 )
 
 (defun mouse-track (event)
-  "Make a selection with the mouse.  This should be bound to a mouse button.
-The behavior of XEmacs during mouse selection is customizable using various
-hooks and variables: see `mouse-track-click-hook', `mouse-track-drag-hook',
+  "Generalized mouse-button handler.  This should be bound to a mouse button.
+The behavior of this function is customizable using various hooks and
+variables: see `mouse-track-click-hook', `mouse-track-drag-hook',
 `mouse-track-drag-up-hook', `mouse-track-down-hook', `mouse-track-up-hook',
 `mouse-track-cleanup-hook', `mouse-track-multi-click-time',
 `mouse-track-scroll-delay', `mouse-track-x-threshold', and
@@ -1110,9 +1138,26 @@ at the initial click position."
                   (disown-selection)))))
       (setq default-mouse-track-down-event nil))))
 
+;; return t if the button or motion event involved the specified button.
+(defun default-mouse-track-event-is-with-button (event n)
+  (cond ((button-event-p event)
+        (= n (event-button event)))
+       ((motion-event-p event)
+        (memq (cdr
+               (assq n '((1 . button1) (2 . button2) (3 . button3)
+                         (4 . button4) (5 . button5))))
+              (event-modifiers event)))))
+
 (defun default-mouse-track-down-hook (event click-count)
-  (setq default-mouse-track-down-event (copy-event event))
-  nil)
+  (cond ((default-mouse-track-event-is-with-button event 1)
+        (if (and (memq 'button1-down mouse-track-activate-strokes)
+                 (mouse-track-do-activate event))
+            t
+          (setq default-mouse-track-down-event (copy-event event))
+          nil))
+       ((default-mouse-track-event-is-with-button event 2)
+        (and (memq 'button2-down mouse-track-activate-strokes)
+             (mouse-track-do-activate event)))))
 
 (defun default-mouse-track-cleanup-extents-hook ()
   (remove-hook 'pre-command-hook 'default-mouse-track-cleanup-extents-hook)
@@ -1133,7 +1178,8 @@ at the initial click position."
       (if (consp extent)               ; rectangle-p
          (mapcar func extent)
        (if extent
-           (funcall func extent))))))
+           (funcall func extent)))))
+  t)
 
 (defun default-mouse-track-cleanup-extent ()
   (let ((dead-func
@@ -1153,13 +1199,16 @@ at the initial click position."
          (setq default-mouse-track-extent nil)))))
 
 (defun default-mouse-track-drag-hook (event click-count was-timeout)
-  (default-mouse-track-deal-with-down-event click-count)
-  (default-mouse-track-set-point event default-mouse-track-window)
-  (default-mouse-track-cleanup-extent)
-  (default-mouse-track-next-move default-mouse-track-min-anchor
-    default-mouse-track-max-anchor
-    default-mouse-track-extent)
-  t)
+  (cond ((default-mouse-track-event-is-with-button event 1)
+        (default-mouse-track-deal-with-down-event click-count)
+        (default-mouse-track-set-point event default-mouse-track-window)
+        (default-mouse-track-cleanup-extent)
+        (default-mouse-track-next-move default-mouse-track-min-anchor
+          default-mouse-track-max-anchor
+          default-mouse-track-extent)
+        t)
+       ((default-mouse-track-event-is-with-button event 2)
+        (mouse-begin-drag-n-drop event))))
 
 (defun default-mouse-track-return-dragged-selection (event)
   (default-mouse-track-cleanup-extent)
@@ -1210,15 +1259,45 @@ at the initial click position."
     result))
 
 (defun default-mouse-track-drag-up-hook (event click-count)
-  (let ((result (default-mouse-track-return-dragged-selection event)))
-    (if result
-       (default-mouse-track-maybe-own-selection result 'PRIMARY)))
-  t)
+  (when (default-mouse-track-event-is-with-button event 1)
+    (let ((result (default-mouse-track-return-dragged-selection event)))
+      (if result
+         (default-mouse-track-maybe-own-selection result 'PRIMARY)))
+    t))
 
 (defun default-mouse-track-click-hook (event click-count)
-  (default-mouse-track-drag-hook event click-count nil)
-  (default-mouse-track-drag-up-hook event click-count)
-  t)
+  (cond ((default-mouse-track-event-is-with-button event 1)
+        (if (and
+             (or (and (= click-count 1)
+                      (memq 'button1-click
+                            mouse-track-activate-strokes))
+                 (and (= click-count 2)
+                      (memq 'button1-double-click
+                            mouse-track-activate-strokes))
+                 (and (= click-count 3)
+                      (memq 'button1-triple-click
+                            mouse-track-activate-strokes)))
+             (mouse-track-do-activate event))
+            t
+          (default-mouse-track-drag-hook event click-count nil)
+          (default-mouse-track-drag-up-hook event click-count)
+          t))
+       ((default-mouse-track-event-is-with-button event 2)
+        (if (and
+             (or (and (= click-count 1)
+                      (memq 'button2-click
+                            mouse-track-activate-strokes))
+                 (and (= click-count 2)
+                      (memq 'button2-double-click
+                            mouse-track-activate-strokes))
+                 (and (= click-count 3)
+                      (memq 'button2-triple-click
+                            mouse-track-activate-strokes)))
+             (mouse-track-do-activate event))
+            t
+          (mouse-yank event)
+          t))))
+
 
 (add-hook 'mouse-track-down-hook 'default-mouse-track-down-hook)
 (add-hook 'mouse-track-drag-hook 'default-mouse-track-drag-hook)
@@ -1471,7 +1550,7 @@ and `mode-motion-hook'."
 ;;
 (defun drag-window-divider (event)
   "Handle resizing windows by dragging window dividers.
-This is an intenal function, normally bound to button1 event in
+This is an internal function, normally bound to button1 event in
 window-divider-map. You would not call it, but you may bind it to
 other mouse buttons."
   (interactive "e")
index 5d4c18e..1b183b8 100644 (file)
@@ -41,7 +41,7 @@
     (if stuff
        (intern stuff)
       configure-mail-lock-method))
-  "mail spool locking method used by thios instance of XEmacs.
+  "mail spool locking method used by this instance of XEmacs.
 This must be one of the symbols in MAIL-LOCK-METHODS.")
 
 (defun move-mail-spool (from to &optional buffer pop-password)
index ae0a188..1f24a55 100644 (file)
 ;;       (setq args (cdr args)))))
 
 \f
-;;; CCL dump staffs
-
-;; To avoid byte-compiler warning.
-(defvar ccl-code)
+;;; CCL dump stuff
 
 ;;;###autoload
 (defun ccl-dump (ccl-code)
 
 ;; Return a CCL code in `ccl-code' at `ccl-current-ic'.
 (defun ccl-get-next-code ()
+  (declare (special ccl-code))
   (prog1
       (aref ccl-code ccl-current-ic)
     (setq ccl-current-ic (1+ ccl-current-ic))))
index 546dd8c..2b6ad0e 100644 (file)
@@ -97,7 +97,7 @@ They means `lf', `crlf', and `cr' respectively."
       (let ((base (coding-system-base coding-system)))
         (if (not eol-type)
             base
-          (if (= eol-type orig-eol-type)
+          (if (eq eol-type orig-eol-type)
               coding-system
             (setq orig-eol-type (coding-system-eol-type base))
             (if (null orig-eol-type)
@@ -996,7 +996,7 @@ at point in the current buffer.
 But, if this flag is non-nil, it displays them in echo area instead.")
 
 (defvar input-method-exit-on-invalid-key nil
-  "This flag controls the behaviour of an input method on invalid key input.
+  "This flag controls the behavior of an input method on invalid key input.
 Usually, when a user types a key which doesn't start any character
 handled by the input method, the key is handled by turning off the
 input method temporarily.  After that key, the input method is re-enabled.
index 3880c18..7ea0183 100644 (file)
 (set-coding-category-system 'iso-lock-shift 'iso-2022-lock)
 (set-coding-category-system 'no-conversion 'no-conversion)
 
+(setq-default buffer-file-coding-system 'iso-2022-8)
+
 ;;; mule-coding.el ends here
index 335a016..635f368 100644 (file)
@@ -219,8 +219,8 @@ set Info-directory-list.")
 
 (defun add-menu (menu-path menu-name menu-items &optional before)
   "See the function `add-submenu'."
-  (or menu-name (error (gettext "must specify a menu name")))
-  (or menu-items (error (gettext "must specify some menu items")))
+  (or menu-name (error "must specify a menu name"))
+  (or menu-items (error "must specify some menu items"))
   (add-submenu menu-path (cons menu-name menu-items) before))
 ;; Can't make this obsolete.  easymenu depends on it.
 (make-compatible 'add-menu 'add-submenu)
index 5b732c5..333d303 100644 (file)
@@ -441,7 +441,8 @@ PACKAGE is a symbol, not a string."
            ;; Delete empty directories.
            (if dirs
                (let ( (orig-default-directory default-directory)
-                      directory files file )
+                      ;; directory files file
+                      )
                  ;; Make sure we preserve the existing `default-directory'.
                  ;; JV, why does this change the default directory? Does it indeed?
                  (unwind-protect
index bbb1886..b837861 100644 (file)
@@ -639,7 +639,6 @@ required by PACKAGES."
                              (mapcar
                               #'(lambda (reqd)
                                   (let* ((reqd-package (package-get-package-provider reqd))
-                                         (reqd-version (cadr reqd-package))
                                          (reqd-name    (car reqd-package)))
                                     (if (null reqd-name)
                                         (error "Unable to find a provider for %s" reqd))
index 32dce7b..806bcf0 100644 (file)
@@ -521,17 +521,6 @@ Designed to be called interactively (from a keypress)."
          (error "No package under cursor!")))
       )))
 
-;;; "Why is there no standard function to do this?"
-(defun pui-popup-context-sensitive (event)
-  (interactive "e")
-  (save-excursion
-    (set-buffer (event-buffer event))
-    (goto-char (event-point event))
-    (popup-menu pui-menu event)
-    ;; I agree with dired.el - this is seriously bogus.
-    (while (popup-menu-up-p)
-      (dispatch-event (next-event)))))
-
 (defvar pui-menu
   '("Packages"
     ["Toggle install " pui-toggle-package-key :active (pui-current-package) :suffix (format "`%s'" (or (pui-current-package) "..."))]
@@ -547,6 +536,16 @@ Designed to be called interactively (from a keypress)."
     ["Help" pui-help t]
     ["Quit" pui-quit t]))
 
+;;; "Why is there no standard function to do this?"
+(defun pui-popup-context-sensitive (event)
+  (interactive "e")
+  (save-excursion
+    (set-buffer (event-buffer event))
+    (goto-char (event-point event))
+    (popup-menu pui-menu event)
+    ;; I agree with dired.el - this is seriously bogus.
+    (while (popup-up-p)
+      (dispatch-event (next-event)))))
 
 (defun list-packages-mode ()
     "Symbols in the leftmost column:
index 094087b..1636a56 100644 (file)
 ;Go to a local news spool if its value is nil, in which case `gnus-nntp-server'
 ;should be set to `(system-name)'.")
 
-(defvar gnus-local-domain nil
-  "*Your domain name without a host name: for example, \"ai.mit.edu\".
-The DOMAINNAME environment variable is used instead if defined.
-If the function `system-name' returns a fully qualified domain name,
-there is no need to set this variable.")
-
-(defvar gnus-local-organization nil
-  "*The name of your organization, as a string.
-The `ORGANIZATION' environment variable is used instead if defined.")
-
 (defvar mh-progs nil
   "Directory containing MH commands.")
 
@@ -104,10 +94,6 @@ The `ORGANIZATION' environment variable is used instead if defined.")
 (defvar rmail-file-name (purecopy "~/RMAIL")
   "Name of user's primary mail file.")
 
-(defvar gnus-startup-file (purecopy "~/.newsrc")
-  "The file listing groups to which user is subscribed.
-Will use `gnus-startup-file'-SERVER instead if exists.")
-
 (defconst rmail-spool-directory nil
   "Name of directory used by system mailer for delivering new mail.
 Its name should end with a slash.")
index 20211bf..8a12a5a 100644 (file)
   "Generic printing support."
   :group 'wp)
 
-(defcustom printer-name nil ; "Okidata OL610e/PS PostScript"
+(defcustom printer-name nil
   "*Name of printer to print to.
 If nil, use default.
-Under MS Windows, this can have the form `\\\\STOLI\\HP-345-PS'."
+Under Windows, use `mswindows-printer-list' to get names of installed
+printers."
   :type 'string
   :group 'printing)
 
@@ -151,8 +152,6 @@ Under Unix, `lpr' is normally used to spool out a no-frills version of the
 buffer, or the `ps-print' package is used to pretty-print the buffer to a
 PostScript printer.  Under MS Windows, the built-in printing support is used."
   (cond ((valid-specifier-tag-p 'msprinter)
-        (or (stringp printer-name)
-            (error "Please set `printer-name'"))
         (let (d f)
           (setq buf (decode-buffer buf))
           (unwind-protect
index 4605e98..e078009 100644 (file)
@@ -421,7 +421,7 @@ Fifth argument PROTOCOL is a network protocol.  Currently 'tcp
  (Transmission Control Protocol) and 'udp (User Datagram Protocol) are
  supported.  When omitted, 'tcp is assumed.
 
-Ouput via `process-send-string' and input via buffer or filter (see
+Output via `process-send-string' and input via buffer or filter (see
 `set-process-filter') are stream-oriented.  That means UDP datagrams are
 not guaranteed to be sent and received in discrete packets. (But small
 datagrams around 500 bytes that are not truncated by `process-send-string'
@@ -432,13 +432,20 @@ lost packets."
 (defun shell-quote-argument (argument)
   "Quote an argument for passing as argument to an inferior shell."
   (if (and (eq system-type 'windows-nt)
-          ;; #### this is a temporary hack.  a better solution needs
-          ;; futzing with the c code.  i'll do this shortly.
           (let ((progname (downcase (file-name-nondirectory
                                      shell-file-name))))
             (or (equal progname "command.com")
                 (equal progname "cmd.exe"))))
-      argument
+      ;; the expectation is that you can take the result of
+      ;; shell-quote-argument and pass it to as an arg to
+      ;; (start-process shell-quote-argument ...) and have it end
+      ;; up as-is in the program's argv[] array.  to do this, we
+      ;; need to protect against both the shell's and the program's
+      ;; quoting conventions (and our own conventions in
+      ;; mswindows-construct-process-command-line!).  Putting quotes
+      ;; around shell metachars gets through the last two, and applying
+      ;; the normal VC runtime quoting works with practically all apps.
+      (mswindows-quote-one-vc-runtime-arg argument t)
     ;; Quote everything except POSIX filename characters.
     ;; This should be safe enough even for really weird shells.
     (let ((result "") (start 0) end)
index 71b8054..990625b 100644 (file)
@@ -604,7 +604,7 @@ The valid answers include `act', `skip', `act-and-show',
 
 ;; XEmacs
 (defun perform-replace-next-event (event)
-  (if isearch-highlight
+  (if search-highlight
       (let ((aborted t))
        (unwind-protect
            (progn
index 1a9a20a..479e548 100644 (file)
@@ -87,7 +87,7 @@ This will do nothing under anything other than X.")
 The argument TYPE (default `PRIMARY') says which selection,
 and the argument DATA-TYPE (default `STRING', or `COMPOUND_TEXT' under Mule)
 says how to convert the data. Returns NIL if there is no selection"
-  (condition-case err (get-selection type data-type) (t nil)))
+  (condition-case nil (get-selection type data-type) (t nil)))
 
 (defun get-selection (&optional type data-type)
   "Return the value of a window-system selection.
@@ -116,7 +116,7 @@ and DATA specifies the contents.  DATA may be any lisp data type
 that can be converted using the function corresponding to DATA-TYPE
 in `select-converter-alist'---strings are the usual choice, but
 other types may be permissible depending on the DATA-TYPE parameter
-(if DATA-TYPE is not supplied, the default behaviour is window
+(if DATA-TYPE is not supplied, the default behavior is window
 system specific, but strings are always accepted).
 HOW-TO-ADD may be any of the following:
 
@@ -131,7 +131,7 @@ The selection may also be a cons of two markers pointing to the same buffer,
 or an overlay.  In these cases, the selection is considered to be the text
 between the markers *at whatever time the selection is examined* (note
 that the window system clipboard does not necessarily duplicate this
-behaviour - it doesn't on mswindows for example).
+behavior - it doesn't on mswindows for example).
 Thus, editing done in the buffer after you specify the selection
 can alter the effective value of the selection.
 
@@ -364,7 +364,7 @@ any more, because just about anything could be a valid selection now."
 ;;; Functions to convert the selection into various other selection
 ;;; types.
 
-;; These two functions get called by C code...
+;; These next three functions get called by C code...
 (defun select-convert-in (selection type value)
   "Attempt to convert the specified external VALUE to the specified DATA-TYPE,
 for the specified SELECTION. Return nil if this is impossible, or a
@@ -383,6 +383,15 @@ representation otherwise."
       (when handler-fn
        (apply handler-fn (list selection type value))))))
 
+(defun select-coerce (selection type value)
+  "Attempt to convert the specified internal VALUE to a representation
+suitable for return from `get-selection' in the specified DATA-TYPE. Return
+nil if this is impossible, or a suitable representation otherwise."
+  (when value
+    (let ((handler-fn (cdr (assq type selection-coercion-alist))))
+      (when handler-fn
+       (apply handler-fn (list selection type value))))))
+
 ;; The rest of the functions on this "page" are conversion handlers,
 ;; append handlers and buffer-kill handlers.
 (defun select-convert-to-text (selection type value)
@@ -410,13 +419,17 @@ representation otherwise."
             (buffer-substring (car value) (cdr value)))))
        (t nil)))
 
+(defun select-coerce-to-text (selection type value)
+  (select-convert-to-text selection type value))
+
 (defun select-convert-from-text (selection type value)
   (when (stringp value)
     value))
 
 (defun select-convert-to-string (selection type value)
   (let ((outval (select-convert-to-text selection type value)))
-    ;; force the string to be not in Compound Text format.
+    ;; force the string to be not in Compound Text format. This grubby
+    ;; hack will go soon, to be replaced by a more general mechanism.
     (if (stringp outval)
        (cons 'STRING outval)
       outval)))
@@ -585,7 +598,7 @@ representation otherwise."
   (user-full-name))
 
 (defun select-convert-to-class (selection type size)
-  x-emacs-application-class)
+  (symbol-value 'x-emacs-application-class))
 
 ;; We do not try to determine the name Emacs was invoked with,
 ;; because it is not clean for a program's behavior to depend on that.
@@ -694,13 +707,18 @@ representation otherwise."
 
 ;;; Buffer kill handlers
 
-;; #### Should this function take the text *out* of the buffer that's
-;; being killed? Or should it do what the original code did and just
-;; destroy the selection?
 (defun select-buffer-killed-default (selection type value buffer)
 ;; This handler gets used if the type is "nil".
   (cond ((extentp value)
-        (unless (eq (extent-object value) buffer)
+        (if (eq (extent-object value) buffer)
+            ; If this selection is on the clipboard, grab it quick
+            (when (eq selection 'CLIPBOARD)
+              (save-excursion
+                (set-buffer (extent-object value))
+                (save-restriction
+                 (widen)
+                 (buffer-substring (extent-start-position value)
+                                   (extent-end-position value)))))
           value))
        ((markerp value)
         (unless (eq (marker-buffer value) buffer)
@@ -708,9 +726,16 @@ representation otherwise."
        ((and (consp value)
              (markerp (car value))
              (markerp (cdr value)))
-        (unless (or (eq (marker-buffer (car value)) buffer)
-                    (eq (marker-buffer (cdr value)) buffer))
-          value))
+        (if (or (eq (marker-buffer (car value)) buffer)
+                (eq (marker-buffer (cdr value)) buffer))
+            ; If this selection is on the clipboard, grab it quick
+            (when (eq selection 'CLIPBOARD)
+              (save-excursion
+                (set-buffer (marker-buffer (car value)))
+                (save-restriction
+                  (widen)
+                  (buffer-substring (car value) (cdr value)))))
+            value))
        (t value)))
 
 (defun select-buffer-killed-text (selection type value buffer)
@@ -758,6 +783,22 @@ representation otherwise."
        (CF_TEXT . select-convert-from-cf-text)
        ))
 
+;; Types listed here have special coercion functions that can munge
+;; other types. This can also be used to add special features - e.g.
+;; being able to pass a region or a cons of markers to own-selection,
+;; but getting the *current* text in the region back when calling
+;; get-selection.
+;;
+;; Any function listed in here *will be called* whenever a value of
+;; its type is retrieved from the internal selection cache, or when
+;; no suitable values could be found in which case XEmacs looks for
+;; values with types listed in selection-coercible-types.
+(setq selection-coercion-alist
+      '((TEXT . select-coerce-to-text)
+       (STRING . select-coerce-to-text)
+       (COMPOUND_TEXT . select-coerce-to-text)
+       (CF_TEXT . select-coerce-to-text)))
+
 ;; Types listed here can be appended by own-selection
 (setq selection-appender-alist
       '((nil . select-append-default)
index f198f8e..c8d5e1f 100644 (file)
@@ -2393,67 +2393,86 @@ With argument 0, interchanges line point is in with line mark is in."
                       (forward-line arg)))
                  arg))
 
-(eval-when-compile
-  ;; avoid byte-compiler warnings...
-  (defvar start1)
-  (defvar start2)
-  (defvar end1)
-  (defvar end2))
+(defun transpose-line-up (arg)
+  "Move current line one line up, leaving point at beginning of that line.
+This can be run repeatedly to move to current line up a number of lines."
+  (interactive "*p")
+  ;; Move forward over a line,
+  ;; but create a newline if none exists yet.
+  (end-of-line)
+  (if (eobp)
+      (newline)
+    (forward-char 1))
+  (transpose-lines (- arg))
+  (forward-line -1))
+
+(defun transpose-line-down (arg)
+  "Move current line one line down, leaving point at beginning of that line.
+This can be run repeatedly to move to current line down a number of lines."
+  (interactive "*p")
+  ;; Move forward over a line,
+  ;; but create a newline if none exists yet.
+  (end-of-line)
+  (if (eobp)
+      (newline)
+    (forward-char 1))
+  (transpose-lines arg)
+  (forward-line -1))
 
-; start[12] and end[12] used in transpose-subr-1 below
 (defun transpose-subr (mover arg)
   (let (start1 end1 start2 end2)
-    (if (= arg 0)
-       (progn
-         (save-excursion
-           (funcall mover 1)
-           (setq end2 (point))
-           (funcall mover -1)
-           (setq start2 (point))
-           (goto-char (mark t)) ; XEmacs
-           (funcall mover 1)
-           (setq end1 (point))
-           (funcall mover -1)
-           (setq start1 (point))
-           (transpose-subr-1))
-         (exchange-point-and-mark t))) ; XEmacs
-    (while (> arg 0)
-      (funcall mover -1)
-      (setq start1 (point))
-      (funcall mover 1)
-      (setq end1 (point))
-      (funcall mover 1)
-      (setq end2 (point))
-      (funcall mover -1)
-      (setq start2 (point))
-      (transpose-subr-1)
-      (goto-char end2)
-      (setq arg (1- arg)))
-    (while (< arg 0)
-      (funcall mover -1)
-      (setq start2 (point))
-      (funcall mover -1)
-      (setq start1 (point))
-      (funcall mover 1)
-      (setq end1 (point))
-      (funcall mover 1)
-      (setq end2 (point))
-      (transpose-subr-1)
-      (setq arg (1+ arg)))))
-
-; start[12] and end[12] used free
-(defun transpose-subr-1 ()
-  (if (> (min end1 end2) (max start1 start2))
-      (error "Don't have two things to transpose"))
-  (let ((word1 (buffer-substring start1 end1))
-       (word2 (buffer-substring start2 end2)))
-    (delete-region start2 end2)
-    (goto-char start2)
-    (insert word1)
-    (goto-char (if (< start1 start2) start1
-                (+ start1 (- (length word1) (length word2)))))
-    (delete-char (length word1))
-    (insert word2)))
+    ;; XEmacs -- use flet instead of defining a separate function and
+    ;; relying on dynamic scope!!!
+    (flet ((transpose-subr-1 ()
+            (if (> (min end1 end2) (max start1 start2))
+                (error "Don't have two things to transpose"))
+            (let ((word1 (buffer-substring start1 end1))
+                  (word2 (buffer-substring start2 end2)))
+              (delete-region start2 end2)
+              (goto-char start2)
+              (insert word1)
+              (goto-char (if (< start1 start2) start1
+                           (+ start1 (- (length word1) (length word2)))))
+              (delete-char (length word1))
+              (insert word2))))
+      (if (= arg 0)
+         (progn
+           (save-excursion
+             (funcall mover 1)
+             (setq end2 (point))
+             (funcall mover -1)
+             (setq start2 (point))
+             (goto-char (mark t)) ; XEmacs
+             (funcall mover 1)
+             (setq end1 (point))
+             (funcall mover -1)
+             (setq start1 (point))
+             (transpose-subr-1))
+           (exchange-point-and-mark t))) ; XEmacs
+      (while (> arg 0)
+       (funcall mover -1)
+       (setq start1 (point))
+       (funcall mover 1)
+       (setq end1 (point))
+       (funcall mover 1)
+       (setq end2 (point))
+       (funcall mover -1)
+       (setq start2 (point))
+       (transpose-subr-1)
+       (goto-char end2)
+       (setq arg (1- arg)))
+      (while (< arg 0)
+       (funcall mover -1)
+       (setq start2 (point))
+       (funcall mover -1)
+       (setq start1 (point))
+       (funcall mover 1)
+       (setq end1 (point))
+       (funcall mover 1)
+       (setq end2 (point))
+       (transpose-subr-1)
+       (setq arg (1+ arg))))))
+
 \f
 (defcustom comment-column 32
   "*Column to indent right-margin comments to.
@@ -3373,7 +3392,6 @@ when it is off screen."
 ;Turned off because it makes dbx bomb out.
 (setq blink-paren-function 'blink-matching-open)
 \f
-(eval-when-compile (defvar myhelp))    ; suppress compiler warning
 
 ;; XEmacs: Some functions moved to cmdloop.el:
 ;; keyboard-quit
@@ -3557,8 +3575,6 @@ it were the arg to `interactive' (which see) to interactively read the value."
    (let* ((var (read-variable "Set variable: "))
          ;; #### - yucky code replication here.  This should use something
          ;; from help.el or hyper-apropos.el
-         (minibuffer-help-form
-          '(funcall myhelp))
          (myhelp
           #'(lambda ()
              (with-output-to-temp-buffer "*Help*"
@@ -3573,7 +3589,9 @@ it were the arg to `interactive' (which see) to interactively read the value."
                (save-excursion
                  (set-buffer standard-output)
                  (help-mode))
-               nil))))
+               nil)))
+         (minibuffer-help-form
+          '(funcall myhelp)))
      (list var
           (let ((prop (get var 'variable-interactive)))
             (if prop
@@ -4359,17 +4377,10 @@ The C code calls this periodically, right before redisplay."
       (setq warning-marker (make-marker))
       (set-marker warning-marker 1 buffer))
     (if temp-buffer-show-function
-        (let ((show-buffer (get-buffer-create "*Warnings-Show*")))
-          (save-excursion
-            (set-buffer show-buffer)
-            (setq buffer-read-only nil)
-            (erase-buffer))
-          (save-excursion
-            (set-buffer buffer)
-            (copy-to-buffer show-buffer
-                            (marker-position warning-marker)
-                            (point-max)))
-          (funcall temp-buffer-show-function show-buffer))
+        (progn
+          (funcall temp-buffer-show-function buffer)
+         (mapc #'(lambda (win) (set-window-start win warning-marker))
+               (windows-of-buffer buffer nil t)))
       (set-window-start (display-buffer buffer) warning-marker))
     (set-marker warning-marker (point-max buffer) buffer)))
 
@@ -4383,5 +4394,10 @@ The C code calls this periodically, right before redisplay."
   (cond ((featurep 'infodock) "InfoDock")
        ((featurep 'xemacs) "XEmacs")
        (t "Emacs")))
+
+(defun debug-print (format &rest args)
+  "Send a string to the debugging output.
+The string is formatted using (apply #'format FORMAT ARGS)."
+  (princ (apply #'format format args) 'external-debugging-output))
          
 ;;; simple.el ends here
index 14e0c66..e3473aa 100644 (file)
@@ -159,13 +159,17 @@ is less convenient.")
 ;;We do that if this regexp matches the locale name
 ;;specified by the LC_ALL, LC_CTYPE and LANG environment variables.")
 
-(defvar mail-host-address nil
-  "*Name of this machine, for purposes of naming users.")
+(defcustom mail-host-address nil
+  "*Name of this machine, for purposes of naming users."
+  :type 'string
+  :group 'mail)
 
-(defvar user-mail-address nil
+(defcustom user-mail-address nil
   "*Full mailing address of this user.
 This is initialized based on `mail-host-address',
-after your init file is read, in case it sets `mail-host-address'.")
+after your init file is read, in case it sets `mail-host-address'."
+  :type 'string
+  :group 'mail)
 
 (defvar auto-save-list-file-prefix "~/.saves-"
   "Prefix for generating auto-save-list-file-name.
@@ -662,7 +666,7 @@ If this is nil, no message will be displayed.")
     (catch 'found
       (dolist (file user-init-file-base-list)
        (let ((expanded (expand-file-name file init-directory)))
-         (when (file-exists-p expanded)
+         (when (file-readable-p expanded)
            (throw 'found expanded)))))))
 
 (defun find-user-home-directory-init-file (&optional home-directory)
@@ -671,7 +675,7 @@ If this is nil, no message will be displayed.")
     (catch 'found
       (dolist (file user-home-init-file-base-list)
        (let ((expanded (expand-file-name file home-directory)))
-         (when (file-exists-p expanded)
+         (when (file-readable-p expanded)
            (throw 'found expanded))))
       nil)))
 
@@ -686,7 +690,8 @@ If this is nil, no message will be displayed.")
   "Ask user if she wants to migrate the init file(s) to new location."
   (if (and (not load-home-init-file)
           (not (find-user-init-directory-init-file user-init-directory))
-          (file-exists-p user-init-file))
+          (stringp user-init-file)
+          (file-readable-p user-init-file))
       (if (with-output-to-temp-buffer (help-buffer-name nil)
            (progn
              (princ "XEmacs recommends that the initialization code in
@@ -730,13 +735,18 @@ perform the migration at any time with M-x migrate-user-init-file.")
 
 (defun load-user-init-file ()
   "This function actually reads the init file."
-  (if (or user-init-file
-          (setq user-init-file (find-user-init-file user-init-directory)))
+  (if (not user-init-file)
+      (setq user-init-file
+           (find-user-init-file user-init-directory)))
+  (if (and user-init-file
+          (file-readable-p user-init-file))
       (load user-init-file t t t))
   (if (not custom-file)
       (setq custom-file (make-custom-file-name user-init-file)))
-  (if (and (not (string= custom-file user-init-file))
-          (file-exists-p custom-file))
+  (if (and custom-file
+          (or (not user-init-file)
+              (not (string= custom-file user-init-file)))
+          (file-readable-p custom-file))
       (load custom-file t t t))
   (unless inhibit-default-init
     (let ((inhibit-startup-message nil))
index fa38653..fd65346 100644 (file)
@@ -351,6 +351,15 @@ SYMBOL's value, function, and property lists."
       (setplist new (copy-list (symbol-plist symbol))))
     new))
 
+(defun set-symbol-value-in-buffer (sym val buffer)
+  "Set the value of SYM to VAL in BUFFER.  Useful with buffer-local variables.
+If SYM has a buffer-local value in BUFFER, or will have one if set, this
+function allows you to set the local value.
+
+NOTE: At some point, this will be moved into C and will be very fast."
+  (with-current-buffer buffer
+    (set sym val)))
+      
 ;;;; String functions.
 
 ;; XEmacs
@@ -358,48 +367,31 @@ SYMBOL's value, function, and property lists."
   "Replace all matches in STR for REGEXP with NEWTEXT string,
  and returns the new string.
 Optional LITERAL non-nil means do a literal replacement.
-Otherwise treat \\ in NEWTEXT string as special:
-  \\& means substitute original matched text,
-  \\N means substitute match for \(...\) number N,
-  \\\\ means insert one \\."
+Otherwise treat `\\' in NEWTEXT as special:
+  `\\&' in NEWTEXT means substitute original matched text.
+  `\\N' means substitute what matched the Nth `\\(...\\)'.
+       If Nth parens didn't match, substitute nothing.
+  `\\\\' means insert one `\\'.
+  `\\u' means upcase the next character.
+  `\\l' means downcase the next character.
+  `\\U' means begin upcasing all following characters.
+  `\\L' means begin downcasing all following characters.
+  `\\E' means terminate the effect of any `\\U' or `\\L'."
   (check-argument-type 'stringp str)
   (check-argument-type 'stringp newtext)
-  (let ((rtn-str "")
-       (start 0)
-       (special)
-       match prev-start)
-    (while (setq match (string-match regexp str start))
-      (setq prev-start start
-           start (match-end 0)
-           rtn-str
-           (concat
-             rtn-str
-             (substring str prev-start match)
-             (cond (literal newtext)
-                   (t (mapconcat
-                       (lambda (c)
-                         (if special
-                             (progn
-                               (setq special nil)
-                               (cond ((eq c ?\\) "\\")
-                                     ((eq c ?&)
-                                      (substring str
-                                                 (match-beginning 0)
-                                                 (match-end 0)))
-                                     ((and (>= c ?0) (<= c ?9))
-                                      (if (> c (+ ?0 (length
-                                                      (match-data))))
-                                          ;; Invalid match num
-                                          (error "Invalid match num: %c" c)
-                                        (setq c (- c ?0))
-                                        (substring str
-                                                   (match-beginning c)
-                                                   (match-end c))))
-                                     (t (char-to-string c))))
-                           (if (eq c ?\\) (progn (setq special t) nil)
-                             (char-to-string c))))
-                        newtext ""))))))
-    (concat rtn-str (substring str start))))
+  (if (> (length str) 50)
+      (with-temp-buffer
+       (insert str)
+       (goto-char 1)
+         (while (re-search-forward regexp nil t)
+           (replace-match newtext t literal))
+         (buffer-string))
+  (let ((start 0) newstr)
+    (while (string-match regexp str start)
+      (setq newstr (replace-match newtext t literal str)
+           start (+ (match-end 0) (- (length newstr) (length str)))
+           str newstr))
+    str)))
 
 (defun split-string (string &optional pattern)
   "Return a list of substrings of STRING which are separated by PATTERN.
@@ -596,25 +588,126 @@ Analogous to (setq LAX-PLIST (lax-plist-remprop LAX-PLIST PROP))."
 \f
 ;;; Error functions
 
-(defun error (&rest args)
-  "Signal an error, making error message by passing all args to `format'.
-This error is not continuable: you cannot continue execution after the
-error using the debugger `r' command.  See also `cerror'."
-  (while t
-    (apply 'cerror args)))
+(defun error (datum &rest args)
+  "Signal a non-continuable error.
+DATUM should normally be an error symbol, i.e. a symbol defined using
+`define-error'.  ARGS will be made into a list, and DATUM and ARGS passed
+as the two arguments to `signal', the most basic error handling function.
 
-(defun cerror (&rest args)
+This error is not continuable: you cannot continue execution after the
+error using the debugger `r' command.  See also `cerror'.
+
+The correct semantics of ARGS varies from error to error, but for most
+errors that need to be generated in Lisp code, the first argument
+should be a string describing the *context* of the error (i.e. the
+exact operation being performed and what went wrong), and the remaining
+arguments or \"frobs\" (most often, there is one) specify the
+offending object(s) and/or provide additional details such as the exact
+error when a file error occurred, e.g.:
+
+-- the buffer in which an editing error occurred.
+-- an invalid value that was encountered. (In such cases, the string
+   should describe the purpose or \"semantics\" of the value [e.g. if the
+   value is an argument to a function, the name of the argument; if the value
+   is the value corresponding to a keyword, the name of the keyword; if the
+   value is supposed to be a list length, say this and say what the purpose
+   of the list is; etc.] as well as specifying why the value is invalid, if
+   that's not self-evident.)
+-- the file in which an error occurred. (In such cases, there should be a
+   second frob, probably a string, specifying the exact error that occurred.
+   This does not occur in the string that precedes the first frob, because
+   that frob describes the exact operation that was happening.
+
+For historical compatibility, DATUM can also be a string.  In this case,
+DATUM and ARGS are passed together as the arguments to `format', and then
+an error is signalled using the error symbol `error' and formatted string.
+Although this usage of `error' is very common, it is deprecated because it
+totally defeats the purpose of having structured errors.  There is now
+a rich set of defined errors you can use:
+
+error
+  syntax-error
+    invalid-read-syntax
+    list-formation-error
+      malformed-list
+        malformed-property-list
+      circular-list
+        circular-property-list
+
+  invalid-argument
+    wrong-type-argument
+    args-out-of-range
+    wrong-number-of-arguments
+    invalid-function
+    no-catch
+
+  invalid-state
+    void-function
+    cyclic-function-indirection
+    void-variable
+    cyclic-variable-indirection
+
+  invalid-operation
+    invalid-change
+      setting-constant
+    editing-error
+      beginning-of-buffer
+      end-of-buffer
+      buffer-read-only
+    io-error
+      end-of-file
+    arith-error
+      range-error
+      domain-error
+      singularity-error
+      overflow-error
+      underflow-error
+
+The five most common errors you will probably use or base your new
+errors off of are `syntax-error', `invalid-argument', `invalid-state',
+`invalid-operation', and `invalid-change'.  Note the semantic differences:
+
+-- `syntax-error' is for errors in complex structures: parsed strings, lists,
+   and the like.
+-- `invalid-argument' is for errors in a simple value.  Typically, the entire
+   value, not just one part of it, is wrong.
+-- `invalid-state' means that some settings have been changed in such a way
+   that their current state is unallowable.  More and more, code is being
+   written more carefully, and catches the error when the settings are being
+   changed, rather than afterwards.  This leads us to the next error:
+-- `invalid-change' means that an attempt is being made to change some settings
+   into an invalid state.  `invalid-change' is a type of `invalid-operation'.
+-- `invalid-operation' refers to all cases where code is trying to do something
+   that's disallowed.  This includes file errors, buffer errors (e.g. running
+   off the end of a buffer), `invalid-change' as just mentioned, and
+   arithmetic errors.
+
+See also `cerror', `signal', and `signal-error'."
+  (while t (apply
+           'cerror datum args)))
+
+(defun cerror (datum &rest args)
   "Like `error' but signals a continuable error."
-  (signal 'error (list (apply 'format args))))
+  (cond ((stringp datum)
+        (signal 'error (list (apply 'format datum args))))
+       ((defined-error-p datum)
+        (signal datum args))
+       (t
+        (error 'invalid-argument "datum not string or error symbol" datum))))
 
 (defmacro check-argument-type (predicate argument)
   "Check that ARGUMENT satisfies PREDICATE.
-If not, signal a continuable `wrong-type-argument' error until the
-returned value satisfies PREDICATE, and assign the returned value
-to ARGUMENT."
-  `(if (not (,(eval predicate) ,argument))
-       (setq ,argument
-            (wrong-type-argument ,predicate ,argument))))
+This is a macro, and ARGUMENT is not evaluated.  If ARGUMENT is an lvalue,
+this function signals a continuable `wrong-type-argument' error until the
+returned value satisfies PREDICATE, and assigns the returned value
+to ARGUMENT.  Otherwise, this function signals a non-continuable
+`wrong-type-argument' error if the returned value does not satisfy PREDICATE."
+  (if (symbolp argument)
+      `(if (not (,(eval predicate) ,argument))
+          (setq ,argument
+                (wrong-type-argument ,predicate ,argument)))
+    `(if (not (,(eval predicate) ,argument))
+        (signal-error 'wrong-type-argument (list ,predicate ,argument)))))
 
 (defun signal-error (error-symbol data)
   "Signal a non-continuable error.  Args are ERROR-SYMBOL, and associated DATA.
@@ -646,6 +739,10 @@ yourself.]"
     (or conds (signal-error 'error (list "Not an error symbol" error-sym)))
     (put error-sym 'error-conditions (cons error-sym conds))))
 
+(defun defined-error-p (sym)
+  "Returns non-nil if SYM names a currently-defined error."
+  (and (symbolp sym) (not (null (get sym 'error-conditions)))))
+
 ;;;; Miscellanea.
 
 ;; This is now in C.
index 171141b..afe876a 100644 (file)
@@ -297,23 +297,22 @@ Mail readers known by default are vm, gnus, rmail, mh, pine, elm,
     (require 'gdbsrc)
     (call-interactively 'gdbsrc)))
 
-(defvar compile-command)
-(defvar toolbar-compile-already-run nil)
-
 (defun toolbar-compile ()
   "Run compile without having to touch the keyboard."
   (interactive)
+  (declare (special compile-command toolbar-compile-already-run))
   (require 'compile)
-  (if toolbar-compile-already-run
+  (if (boundp 'toolbar-compile-already-run)
       (compile compile-command)
     (setq toolbar-compile-already-run t)
     (if (should-use-dialog-box-p)
-       (popup-dialog-box
-        `(,(concat "Compile:\n        " compile-command)
-          ["Compile" (compile compile-command) t]
-          ["Edit command" compile t]
-          nil
-          ["Cancel" (message "Quit") t]))
+       (make-dialog-box 'question
+                       :question (concat "Compile:\n        " compile-command)
+                       :buttons
+                       '(["Compile" (compile compile-command) t]
+                         ["Edit command" compile t]
+                         nil
+                         ["Cancel" (message "Quit") t]))
       (compile compile-command))))
 
 ;;
index c27378e..777017a 100644 (file)
@@ -1,8 +1,9 @@
 ;;; update-elc.el --- Bytecompile out-of-date dumped files
 
 ;; Copyright (C) 1997 Free Software Foundation, Inc.
-;; Copyright (C) 1996 Unknown
+;; Copyright (C) 1996 Sun Microsystems, Inc.
 
+;; Author: Ben Wing <ben@xemacs.org>, Steven L Baur <steve@xemacs.org>
 ;; Maintainer: XEmacs Development Team
 ;; Keywords: internal
 
@@ -39,6 +40,8 @@
 ;; (the idea here is that you can bootstrap if your .ELC files
 ;; are missing or badly out-of-date)
 
+;; See also update-elc-2.el
+
 ;;; Code:
 
 (defvar processed nil)
index 446c326..ff7f344 100644 (file)
@@ -132,31 +132,38 @@ to get the latest version of the file, then make the change again.")
 ;;; dialog-box versions [XEmacs]
 
 (defun ask-user-about-lock-dbox (fn opponent)
-  (let ((echo-keystrokes 0)
-       (dbox
-        (cons
-         (format "%s is locking %s\n
+  (let ((echo-keystrokes 0))
+    (make-dialog-box
+     'question
+     :question (format "%s is locking %s\n
        It has been detected that you want to modify a file that
        someone else has already started modifying in XEmacs."
-                 opponent fn)
-         '(["Steal Lock\n\nThe other user will\nbecome the intruder" steal t]
-           ["Proceed\n\nEdit file at your own\n\(and the other user's) risk"
-            proceed t]
-           nil
-           ["Abort\n\nDon't modify the buffer\n" yield t]))))
-    (popup-dialog-box dbox)
+                      opponent fn)
+     :buttons
+     '(["Steal Lock\n\nThe other user will\nbecome the intruder" steal t]
+       ["Proceed\n\nEdit file at your own\n\(and the other user's) risk"
+       proceed t]
+       nil
+       ["Abort\n\nDon't modify the buffer\n" yield t]))
     (catch 'aual-done
       (while t
        (let ((event (next-command-event)))
-         (cond ((and (misc-user-event-p event) (eq (event-object event) 'proceed))
+         (cond ((and (misc-user-event-p event)
+                     (eq (event-object event) 'proceed))
                 (throw 'aual-done nil))
-               ((and (misc-user-event-p event) (eq (event-object event) 'steal))
+               ((and (misc-user-event-p event)
+                     (eq (event-object event) 'steal))
                 (throw 'aual-done t))
-               ((and (misc-user-event-p event) (eq (event-object event) 'yield))
+               ((and (misc-user-event-p event)
+                     (eq (event-object event) 'yield))
                 (signal 'file-locked (list "File is locked" fn opponent)))
                ((and (misc-user-event-p event)
                      (eq (event-object event) 'menu-no-selection-hook))
                 (signal 'quit nil))
+               ;; safety check, so we're not endlessly stuck when no
+               ;; dialog box up
+               ((not (popup-up-p))
+                (signal 'quit nil))
                ((button-release-event-p event) ;; don't beep twice
                 nil)
                (t
@@ -164,20 +171,21 @@ to get the latest version of the file, then make the change again.")
                 (message "please answer the dialog box"))))))))
 
 (defun ask-user-about-supersession-threat-dbox (fn)
-  (let ((echo-keystrokes 0)
-       (dbox
-        (cons
-         (format "File %s has changed on disk
+  (let ((echo-keystrokes 0))
+    (make-dialog-box
+     'question
+     :question
+     (format "File %s has changed on disk
 since its buffer was last read in or saved.
 
 Do you really want to edit the buffer? " fn)
-         '(["Yes\n\nEdit the buffer anyway,\nignoring the disk file"
-            proceed t]
-           ["No\n\nDon't modify the buffer\n" yield t]
-           nil
-           ["No\n\nDon't modify the buffer\nbut revert it" revert t]
-           ))))
-    (popup-dialog-box dbox)
+     :buttons
+     '(["Yes\n\nEdit the buffer anyway,\nignoring the disk file"
+       proceed t]
+       ["No\n\nDon't modify the buffer\n" yield t]
+       nil
+       ["No\n\nDon't modify the buffer\nbut revert it" revert t]
+       ))
     (catch 'auast-done
       (while t
        (let ((event (next-command-event)))
@@ -195,6 +203,10 @@ Do you really want to edit the buffer? " fn)
                ((and (misc-user-event-p event)
                      (eq (event-object event) 'menu-no-selection-hook))
                 (signal 'quit nil))
+               ;; safety check, so we're not endlessly stuck when no
+               ;; dialog box up
+               ((not (popup-up-p))
+                (signal 'quit nil))
                ((button-release-event-p event) ;; don't beep twice
                 nil)
                (t
@@ -214,10 +226,7 @@ This function has a choice of three things to do:
   return nil (edit the file even though it is locked).
 You can rewrite it to use any criterion you like to choose which one to do."
   (discard-input)
-  (if (and (fboundp 'popup-dialog-box)
-          (or (button-press-event-p last-command-event)
-              (button-release-event-p last-command-event)
-              (misc-user-event-p last-command-event)))
+  (if (should-use-dialog-box-p)
       (ask-user-about-lock-dbox fn opponent)
     (ask-user-about-lock-minibuf fn opponent)))
 
@@ -231,10 +240,7 @@ in which case the proposed buffer modification will not be made.
 You can rewrite this to use any criterion you like to choose which one to do.
 The buffer in question is current when this function is called."
   (discard-input)
-  (if (and (fboundp 'popup-dialog-box)
-          (or (button-press-event-p last-command-event)
-              (button-release-event-p last-command-event)
-              (misc-user-event-p last-command-event)))
+  (if (should-use-dialog-box-p)
       (ask-user-about-supersession-threat-dbox fn)
     (ask-user-about-supersession-threat-minibuf fn)))
 
index 4507542..b84901d 100644 (file)
@@ -1986,8 +1986,8 @@ If END is omitted, it defaults to the length of LIST."
 
 (defun widget-url-link-action (widget &optional event)
   "Open the url specified by WIDGET."
-  (if (boundp 'browse-url-browser-function)
-      (funcall browse-url-browser-function (widget-value widget))
+  (if (fboundp 'browse-url)
+      (browse-url (widget-value widget))
     (error "Cannot follow URLs in this XEmacs")))
 
 ;;; The `function-link' Widget.
index 554ec53..3418047 100644 (file)
@@ -191,6 +191,29 @@ Each frame has its own window-config and \"unpop\" stack."
 \f
 ;;;;;;;;;;;;; display-buffer, moved here from C.  Hallelujah.
 
+(make-variable-buffer-local '__buffer-dedicated-frame)
+
+(defun buffer-dedicated-frame (&optional buffer)
+  "Return the frame dedicated to this BUFFER, or nil if there is none.
+No argument or nil as argument means use current buffer as BUFFER."
+  (let ((buffer (decode-buffer buffer)))
+    (let ((frame (symbol-value-in-buffer '__buffer-dedicated-frame buffer)))
+      ;; XEmacs addition: if the frame is dead, silently make it go away.
+      (when (and (framep frame) (not (frame-live-p frame)))
+           (with-current-buffer buffer
+             (setq __buffer-dedicated-frame nil))
+           (setq frame nil))
+      frame)))
+
+(defun set-buffer-dedicated-frame (buffer frame)
+  "For this BUFFER, set the FRAME dedicated to it.
+FRAME must be a frame or nil."
+  (let ((buffer (decode-buffer buffer)))
+    (and frame
+        (check-argument-type #'frame-live-p frame))
+    (with-current-buffer buffer
+      (setq __buffer-dedicated-frame frame))))
+
 (defvar display-buffer-function nil
   "If non-nil, function to call to handle `display-buffer'.
 It will receive three args: the same as those to `display-buffer'.")
index 8c4bba4..4687c8a 100644 (file)
@@ -120,13 +120,19 @@ Otherwise, include frames only on the selected device."
 
 (defmacro save-selected-window (&rest body)
   "Execute BODY, then select the window that was selected before BODY."
-  (list 'let
-       '((save-selected-window-window (selected-window)))
-       (list 'unwind-protect
-             (cons 'progn body)
-             (list 'and ; XEmacs
-                   (list 'window-live-p 'save-selected-window-window)
-                   (list 'select-window 'save-selected-window-window)))))
+  `(let ((save-selected-window-window (selected-window)))
+     (unwind-protect
+        (progn ,@body)
+       (when (window-live-p save-selected-window-window)
+        (select-window save-selected-window-window)))))
+
+(defmacro with-selected-window (window &rest body)
+  "Execute forms in BODY with WINDOW as the selected window.
+The value returned is the value of the last form in BODY."
+  `(save-selected-window
+     (select-window ,window)
+     ,@body))
+
 \f
 (defun count-windows (&optional minibuf)
    "Return the number of visible windows.
@@ -286,8 +292,7 @@ or if the window is the only window of its frame."
              (if (and (not (eobp))
                       (eq ?\n (char-after (1- (point-max)))))
                  1 0)))
-         (mini (frame-property (window-frame window) 'minibuffer))
-         (edges (window-pixel-edges (selected-window))))
+         (mini (frame-property (window-frame window) 'minibuffer)))
       (if (and (< 1 (let ((frame (selected-frame)))
                      (select-frame (window-frame window))
                      (unwind-protect
@@ -297,7 +302,6 @@ or if the window is the only window of its frame."
               ;; of the frame
               (window-leftmost-p window)
               (window-rightmost-p window)
-              (zerop (nth 0 edges))
               ;; The whole buffer must be visible.
               (pos-visible-in-window-p (point-min) window)
               ;; The frame must not be minibuffer-only.
index c3e35d7..5dddded 100644 (file)
@@ -203,7 +203,7 @@ If it fails, it returns nil."
   "Given an X font specification, this attempts to make a `bold-italic' font.
 If it fails, it returns nil."
   ;; This is haired up to avoid loading the "intermediate" fonts.
-  (if *try-oblique-before-italic-fonts*
+  (if try-oblique-before-italic-fonts
       (or (try-font-name
           (x-frob-font-slant (x-frob-font-weight font "bold") "o") device)
          (try-font-name
index 54f4c66..03b4092 100644 (file)
@@ -185,6 +185,8 @@ or if you change your font path, you can call this to re-initialize the menus."
 ;; get the truename and use the possibly suboptimal data from that.
 ;;;###autoload
 (defun* x-font-menu-font-data (face dcache)
+  (defvar x-font-regexp)
+  (defvar x-font-regexp-foundry-and-family)
   (let* ((case-fold-search t)
         (domain (if font-menu-this-frame-only-p
                                  (selected-frame)
index cfeaf46..0d642cc 100644 (file)
@@ -55,7 +55,7 @@
 
 (defun x-activate-region-as-selection ()
   (if (marker-buffer (mark-marker t))
-      (x-own-selection (cons (point-marker t) (mark-marker t)))))
+      (own-selection (cons (point-marker t) (mark-marker t)))))
 
 ;; OpenWindows-like "find" processing.  These functions are really Sunisms,
 ;; but we put them here instead of in x-win-sun.el in case someone wants
@@ -68,8 +68,8 @@
 (defun ow-find (&optional backward-p)
   "Search forward the next occurrence of the text of the selection."
   (interactive)
-  (let ((sel (condition-case () (x-get-selection) (error nil)))
-       (clip (condition-case () (x-get-clipboard) (error nil)))
+  (let ((sel  (ignore-errors (get-selection)))
+       (clip (ignore-errors (get-clipboard)))
        text)
     (setq text (cond
                (sel)
     (add-hook 'zmacs-deactivate-region-hook
              (lambda ()
                (when (console-on-window-system-p)
-                 (x-disown-selection))))
+                 (disown-selection))))
     (add-hook 'zmacs-activate-region-hook
              (lambda ()
                (when (console-on-window-system-p)
index 8731e47..c530488 100644 (file)
@@ -1,3 +1,38 @@
+2000-10-04  Martin Buchholz <martin@xemacs.org>
+
+       * XEmacs 21.2.36 is released.
+
+2000-09-19  Martin Buchholz  <martin@xemacs.org>
+
+       * *: Spelling mega-patch
+
+2000-09-16  Martin Buchholz  <martin@xemacs.org>
+
+       * lwlib.c (ascii_strcasecmp): New.
+       * lwlib.c (find_in_table): Use ascii_strcasecmp.
+       Avoid using non-standard non-portable strcasecmp.
+
+2000-08-02  Stephen J. Turnbull <stephen@xemacs.org>
+
+       * xlwmenu.c (XlwMenuInitialize): make comment on algorithm for
+       setting fontList match code.  Suggest using same algorithm for
+       X Font Set resources in native lw code.
+
+2000-07-30  Ben Wing  <ben@xemacs.org>
+
+       * lwlib-Xaw.c (xaw_update_one_widget):
+       Remove accelerator specs from buttons, since Athena doesn't handle
+       them.
+       
+       * lwlib.c (lw_remove_accelerator_spec):
+       * lwlib.h:
+       Define function and prototype to do this.
+
+2000-07-15  Ben Wing  <ben@xemacs.org>
+
+       * xlwradioP.h:
+       Remove duplicate definition of streq().
+
 2000-07-19  Martin Buchholz <martin@xemacs.org>
 
        * XEmacs 21.2.35 is released.
index ff8771a..5544c24 100644 (file)
@@ -179,6 +179,7 @@ xaw_update_one_widget (widget_instance *instance, Widget widget,
        }
 #endif /* ! LWLIB_DIALOGS_ATHENA3D */
 
+      lw_remove_accelerator_spec (val->value);
       XtSetArg (al [0], XtNlabel,     val->value);
       XtSetArg (al [1], XtNsensitive, val->enabled);
       /* Force centered button text.  See above. */
index 410af34..c3580e7 100644 (file)
@@ -255,18 +255,18 @@ xm_update_label (widget_instance* instance, Widget widget, widget_value* val)
            {
              name_string =
                XmStringCreateLtoR (res_name, XmSTRING_DEFAULT_CHARSET);
-             
+
              value_name = XtMalloc (strlen (val->value) + 2);
              *value_name = 0;
              strcat (value_name, " ");
              strcat (value_name, val->value);
-             
+
              val_string =
                XmStringCreateLtoR (value_name, XmSTRING_DEFAULT_CHARSET);
-             
+
              built_string =
                XmStringConcat (name_string, val_string);
-             
+
              XtFree (value_name);
            }
        }
@@ -927,7 +927,7 @@ xm_update_one_value (widget_instance* instance, Widget widget,
          val->edited = True;
        }
     }
-  else if (class == xmListWidgetClass 
+  else if (class == xmListWidgetClass
 #if defined (LWLIB_WIDGETS_MOTIF) && XmVERSION > 1
           || class == xmComboBoxWidgetClass
 #endif
@@ -1140,7 +1140,7 @@ make_dialog (char* name, Widget parent, Boolean pop_up_p,
       n_children++;
     }
 
-  /* invisible seperator button */
+  /* invisible separator button */
   ac = 0;
   XtSetArg (al[ac], XmNmappedWhenManaged, FALSE); ac++;
   children [n_children] = XmCreateLabel (row, "separator_button",
@@ -1256,7 +1256,7 @@ make_dialog (char* name, Widget parent, Boolean pop_up_p,
       XtSetArg(al[ac], XmNrightOffset, 13);                    ac++;
       value = XmCreateScrolledList (form, "list", al, ac);
 
-      /* this is the easiest way I found to have the dble click in the
+      /* this is the easiest way I found to have the double click in the
         list activate the default button */
       XtAddCallback (value, XmNdefaultActionCallback, activate_button, button);
     }
index 5ec3bc9..85dff5a 100644 (file)
@@ -44,7 +44,7 @@ typedef struct _widget_creation_entry
 } widget_creation_entry;
 
 /* update all other instances of a widget.  Can be used in a callback when
-   a wiget has been used by the user */
+   a widget has been used by the user */
 void
 lw_internal_update_other_instances (Widget widget, XtPointer closure,
                                    XtPointer call_data);
index bf9bd3a..bd6e900 100644 (file)
@@ -272,7 +272,7 @@ merge_widget_value_args (widget_value *old, widget_value *new)
 /* Make a complete copy of a widget_value tree.  Store CHANGE into
    the widget_value tree's `change' field. */
 
-static widget_value *
+widget_value *
 copy_widget_value_tree (widget_value *val, change_type change)
 {
   widget_value *copy;
@@ -824,13 +824,28 @@ initialize_widget_instance (widget_instance *instance)
     val->change = NO_CHANGE;
 }
 
+/* strcasecmp() is not sufficiently portable or standard,
+   and it's easier just to write our own. */
+static int
+ascii_strcasecmp (const char *s1, const char *s2)
+{
+  while (1)
+    {
+      char c1 = *s1++;
+      char c2 = *s2++;
+      if (c1 >= 'A' && c1 <= 'Z') c1 += 'a' - 'A';
+      if (c2 >= 'A' && c2 <= 'Z') c2 += 'a' - 'A';
+      if (c1 != c2) return c1 - c2;
+      if (c1 == '\0') return 0;
+    }
+}
 
 static widget_creation_function
 find_in_table (const char *type, widget_creation_entry *table)
 {
   widget_creation_entry *cur;
   for (cur = table; cur->type; cur++)
-    if (!strcasecmp (type, cur->type))
+    if (!ascii_strcasecmp (type, cur->type))
       return cur->function;
   return NULL;
 }
@@ -1431,3 +1446,24 @@ void lw_copy_widget_value_args (widget_value* val, widget_value* copy)
     }
 }
 
+/* Remove %_ and convert %% to %.  We can do this in-place because we
+   are always shortening, never lengthening, the string. */
+void
+lw_remove_accelerator_spec (char *val)
+{
+  char *foo = val, *bar = val;
+
+  while (*bar)
+    {
+      if (*bar == '%' && *(bar+1) == '_')
+       bar += 2;
+      else if (*bar == '%' && *(bar+1) == '%')
+       {
+         *foo++ = *bar++;
+         bar++;
+       }
+      else
+       *foo++ = *bar++;
+    }
+  *foo = '\0';
+}
index 458e499..76d3241 100644 (file)
@@ -212,6 +212,7 @@ void lw_pop_down_all_widgets (LWLIB_ID id);
 void lw_add_value_args_to_args (widget_value* wv, ArgList addto, int* offset);
 void lw_add_widget_value_arg (widget_value* wv, String name, XtArgVal value);
 void lw_copy_widget_value_args (widget_value* copy, widget_value* val);
+widget_value * copy_widget_value_tree (widget_value *val, change_type change);
 
 widget_value *malloc_widget_value (void);
 void free_widget_value (widget_value *);
@@ -226,4 +227,6 @@ void lw_set_keyboard_focus (Widget parent, Widget w);
  /* Silly Energize hack to invert the "sheet" button */
 void lw_show_busy (Widget w, Boolean busy);
 
+void lw_remove_accelerator_spec (char *val);
+
 #endif /* INCLUDED_lwlib_h_ */
index 7f0585e..686d86f 100644 (file)
@@ -25,7 +25,7 @@ Boston, MA 02111-1307, USA.  */
  *
  * Author: Edward A. Falk
  *         falk@falconer.vip.best.com
- *  
+ *
  * Date:   June 30, 1997
  *
  * Overview:  This widget is identical to the Radio widget in behavior,
@@ -126,7 +126,7 @@ static      XtActionsRec    actionsList[] =
 
 CheckboxClassRec checkboxClassRec = {
   {
-    (WidgetClass) SuperClass,          /* superclass           */      
+    (WidgetClass) SuperClass,          /* superclass           */
     "Checkbox",                                /* class_name           */
     sizeof(CheckboxRec),               /* size                 */
     CheckboxClassInit,                 /* class_initialize     */
@@ -170,7 +170,7 @@ CheckboxClassRec checkboxClassRec = {
     NULL                               /* extension            */
   },  /* CoreClass fields initialization */
   {
-    XtInheritChangeSensitive           /* change_sensitive     */ 
+    XtInheritChangeSensitive           /* change_sensitive     */
   },  /* SimpleClass fields initialization */
 #ifdef _ThreeDP_h
   {
@@ -271,7 +271,7 @@ CheckboxRealize(Widget w,
 /*     Function Name: CheckboxDestroy
  *     Description: Destroy Callback for checkbox widget.
  *     Arguments: w - the checkbox widget that is being destroyed.
- *                 junk, grabage - not used.
+ *                 junk, garbage - not used.
  *     Returns: none.
  */
 
index ffd93ab..de71df0 100644 (file)
@@ -1,4 +1,4 @@
-/* Gauge Widget for XEmacs. 
+/* Gauge Widget for XEmacs.
    Copyright (C) 1999 Edward A. Falk
 
 This file is part of XEmacs.
@@ -25,7 +25,7 @@ Boston, MA 02111-1307, USA.  */
  *
  * Author: Edward A. Falk
  *         falk@falconer.vip.best.com
- *  
+ *
  * Date:   July 9, 1997
  *
  * Note: for fun and demonstration purposes, I have added selection
@@ -160,7 +160,7 @@ static      XtActionsRec    actionsList[] =
 
 GaugeClassRec gaugeClassRec = {
   {
-/* core_class fields */        
+/* core_class fields */
     /* superclass              */      (WidgetClass) &labelClassRec,
     /* class_name              */      "Gauge",
     /* widget_size             */      sizeof(GaugeRec),
@@ -334,7 +334,7 @@ GaugeResize (Widget w)
          }
          else
          {
-           gw->gauge.margin0 = 
+           gw->gauge.margin0 =
            gw->gauge.margin1 = lh / 2 ;
            size += lwm + vmargin ;
          }
@@ -404,7 +404,7 @@ register Window     win = XtWindow(w) ;
        }
 
        /* if the gauge is selected, signify by drawing the background
-        * in a constrasting color.
+        * in a contrasting color.
         */
 
        if( gw->gauge.selected )
@@ -540,7 +540,7 @@ GaugeSetValues (Widget   old,
          else
            GaugeResize(new) ;
        }
-       
+
        if( gw->gauge.update != oldgw->gauge.update )
          {
            if( gw->gauge.update > 0 )
@@ -674,7 +674,7 @@ GaugeConvert (Widget        w,
          return True ;
        }
 
-       else 
+       else
 #endif
          if( *target == XA_INTEGER )
        {
@@ -685,10 +685,10 @@ GaugeConvert (Widget      w,
          return True ;
        }
 
-       else if( *target == XA_STRING 
+       else if( *target == XA_STRING
 #ifdef HAVE_XMU
-                || 
-                *target == XA_TEXT(XtDisplay(w)) 
+                ||
+                *target == XA_TEXT(XtDisplay(w))
 #endif
                 )
        {
@@ -707,7 +707,7 @@ GaugeConvert (Widget        w,
          if( XmuConvertStandardSelection(w, req->time, selection, target,
                type, (XPointer *) value, length, format) )
            return True ;
-         else 
+         else
 #endif
            {
            printf(
@@ -787,12 +787,12 @@ GaugeGetSelCB (Widget    w,
          XawGaugeSetValue(w, *iptr) ;
        }
 
-       else if( *type == XA_STRING  
+       else if( *type == XA_STRING
 #ifdef HAVE_XMU
                 ||
-                *type == XA_TEXT(dpy) 
+                *type == XA_TEXT(dpy)
 #endif
-                ) 
+                )
          {
          cptr = (char *)value ;
          XawGaugeSetValue(w, atoi(cptr)) ;
index 876cd24..ceb21ef 100644 (file)
@@ -25,7 +25,7 @@ Boston, MA 02111-1307, USA.  */
  *
  * Author: Edward A. Falk
  *         falk@falconer.vip.best.com
- *  
+ *
  * Date:   July 8, 1997
  */
 
@@ -89,7 +89,7 @@ Boston, MA 02111-1307, USA.  */
  +++ Labels is an array of nul-terminated strings to be used as labels.
      If this field is NULL but nlabels is > 0, then numeric labels will be
      provided.  NOTE: the labels are not copied to any internal memory; they
-     must be stored in static memory provided by the appliction.
+     must be stored in static memory provided by the application.
  ++++ AutoScale allows the gauge to set its own value limits.  Default is
       False unless upper & lower limits are both 0.
 
@@ -102,7 +102,7 @@ Boston, MA 02111-1307, USA.  */
        {
          *(Cardinal *)rval = value ;
        }
-       
+
 */
 
 /*
index f720522..ed5c480 100644 (file)
@@ -1,25 +1,25 @@
  /* Tabs Widget for XEmacs.
     Copyright (C) 1999 Edward A. Falk
-  
+
  This file is part of XEmacs.
+
  XEmacs 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.
+
  XEmacs 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 XEmacs; see the file COPYING.  If not, write to
  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  Boston, MA 02111-1307, USA.  */
+
 /* Synched up with: Gcs.c 1.7 */
+
  /* #### This code is duplicated many times within lwlib and XEmacs. It
     should be modularised. */
 
         *
         * If the widget's background is solid white or solid black,
         * this code just picks some numbers.  (The choice is designed
-        * to be compatibile with ThreeD interface.)
+        * to be compatible with ThreeD interface.)
         */
 
 
@@ -342,7 +342,7 @@ AllocArmGC(Widget w, int contrast, Bool be_nice_to_cmap)
              GCFont|GCSubwindowMode|GCGraphicsExposures|
                  GCDashOffset|GCDashList|GCArcMode) ;
        }
-       else 
+       else
 #endif
          {
          values.foreground = AllocShadowPixel(w, 100-contrast) ;
index 6ecedac..aed49d4 100644 (file)
@@ -1,25 +1,25 @@
  /* Tabs Widget for XEmacs.
     Copyright (C) 1999 Edward A. Falk
+
  This file is part of XEmacs.
+
  XEmacs 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.
+
  XEmacs 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 XEmacs; see the file COPYING.  If not, write to
  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  Boston, MA 02111-1307, USA.  */
+
  /* Synched up with: Gcs 1.7 */
+
 
 #ifndef        GCS_H
 #define        GCS_H
@@ -35,7 +35,7 @@
  * AllocShadeGC()
  *     Given foreground, background, a contrast value & be_nice_to_colormap
  *     flag, return a GC suitable for rendering in an intermediate color,
- *     as determined by constrast.  May return a dither pattern or a
+ *     as determined by contrast.  May return a dither pattern or a
  *     solid color, as appropriate.
  *
  *     Contrast 0 = background color, 100 = foreground color.  It is legal
index b903917..5fadadf 100644 (file)
@@ -51,7 +51,7 @@ Boston, MA 02111-1307, USA.  */
 #include <dmalloc.h>
 #endif
 
-/* simple, naieve integer maximum */
+/* simple, naive integer maximum */
 #ifndef max
 #define max(a,b) ((a)>(b)?(a):(b))
 #endif
@@ -88,6 +88,8 @@ xlwMenuResources[] =
   {XtNfont,  XtCFont, XtRFontStruct, sizeof(XFontStruct *),
      offset(menu.font), XtRString, (XtPointer) "XtDefaultFont"},
 # ifdef USE_XFONTSET
+  /* #### Consider using the same method as for Motif; see the comment in
+     XlwMenuInitialize(). */
   {XtNfontSet,  XtCFontSet, XtRFontSet, sizeof(XFontSet),
      offset(menu.font_set), XtRString, (XtPointer) "XtDefaultFontSet"},
 # endif
@@ -688,7 +690,7 @@ resource_widget_value (XlwMenuWidget mw, widget_value *val)
 
 /* Unused */
 #if 0
-/* These two routines should be a seperate file..djw */
+/* These two routines should be a separate file..djw */
 static char *
 xlw_create_localized_string (Widget w,
                             char *name,
@@ -1519,7 +1521,7 @@ menu_item_type (widget_value *val)
   else
     return TEXT_TYPE;
 #else
-  else 
+  else
     abort();
   return UNSPECIFIED_TYPE; /* Not reached */
 #endif
@@ -2491,7 +2493,7 @@ remap_menubar (XlwMenuWidget mw)
 
   mw->menu.old_depth = new_depth;
 
-  /* refresh the last seletion */
+  /* refresh the last selection */
   selection_position.x = 0;
   selection_position.y = 0;
   display_menu (mw, last_same, new_selection == old_selection,
@@ -3017,10 +3019,12 @@ XlwMenuInitialize (Widget request, Widget new, ArgList args,
                                 gray_width, gray_height, 1, 0, 1);
 
 #ifdef NEED_MOTIF
+  /* #### Even if it's a kludge!!!, we should consider doing the same for
+     X Font Sets. */
   /* The menu.font_list slot came from the *fontList resource (Motif standard.)
      The menu.font_list_2 slot came from the *font resource, for backward
      compatibility with older versions of this code, and consistency with the
-     rest of emacs.  If both font and fontList are specified, we use font.
+     rest of emacs.  If both font and fontList are specified, we use fontList.
      If only one is specified, we use that.  If neither are specified, we
      use the "fallback" value.  What a kludge!!!
 
index 32561c1..a6430b9 100644 (file)
@@ -25,7 +25,7 @@ Boston, MA 02111-1307, USA.  */
  *
  * Author: Edward A. Falk
  *         falk@falconer.vip.best.com
- *  
+ *
  * Date:   June 30, 1997
  *
  *
@@ -120,7 +120,7 @@ static XtActionsRec actionsList[] =
 
 RadioClassRec radioClassRec = {
   {
-    (WidgetClass) SuperClass,          /* superclass           */      
+    (WidgetClass) SuperClass,          /* superclass           */
     "Radio",                           /* class_name           */
     sizeof(RadioRec),                  /* size                 */
     RadioClassInit,                    /* class_initialize     */
@@ -154,7 +154,7 @@ RadioClassRec radioClassRec = {
     NULL                               /* extension            */
   },  /* CoreClass fields initialization */
   {
-    XtInheritChangeSensitive           /* change_sensitive     */ 
+    XtInheritChangeSensitive           /* change_sensitive     */
   },  /* SimpleClass fields initialization */
 #ifdef _ThreeDP_h
   {
@@ -241,7 +241,7 @@ RadioInit (Widget   request,
 /*     Function Name: RadioDestroy
  *     Description: Destroy Callback for radio widget.
  *     Arguments: w - the radio widget that is being destroyed.
- *                 junk, grabage - not used.
+ *                 junk, garbage - not used.
  *     Returns: none.
  */
 
@@ -374,8 +374,8 @@ RadioSetValues (Widget   current,
     {
       RadioSize(newrw, &newrw->core.width, &newrw->core.height) ;
     }
-    
-    /* The label set values routine can resize the widget. We need to 
+
+    /* The label set values routine can resize the widget. We need to
      * recalculate if this is true.
      */
     if (newrw->label.label_x != oldrw->label.label_x)
@@ -423,7 +423,7 @@ RadioQueryGeometry (Widget w,
  * border.
  */
 
-static void 
+static void
 DrawHighlight (Widget w,
               GC gc)
 {
@@ -473,7 +473,7 @@ RadioUnhighlight (Widget   w,
 
 
 /* ARGSUSED */
-void 
+void
 RadioSet (Widget   w,
          XEvent   *event,
          String   *params,     /* unused */
@@ -492,7 +492,7 @@ RadioSet (Widget   w,
 
 
 /* ARGSUSED */
-void 
+void
 RadioUnset (Widget   w,
            XEvent   *event,
            String   *params,     /* unused */
index e239816..d45fecc 100644 (file)
@@ -40,7 +40,9 @@ Boston, MA 02111-1307, USA.  */
  *
  ***********************************************************************/
 
-#define streq(a, b) ( strcmp((a), (b)) == 0 )
+/* Already in Xaw/ToggleP.h, and not used by us.
+  #define streq(a, b) ( strcmp((a), (b)) == 0 )
+*/
 
 typedef void (*XawDiamondProc) (Widget);
 
index 303d149..aa96450 100644 (file)
@@ -1,25 +1,25 @@
  /* Tabs Widget for XEmacs.
     Copyright (C) 1999 Edward A. Falk
+
  This file is part of XEmacs.
+
  XEmacs 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.
+
  XEmacs 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 XEmacs; see the file COPYING.  If not, write to
  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  Boston, MA 02111-1307, USA.  */
+
  /* Synched up with: Tabs.c 1.27 */
+
  /*
  * Tabs.c - Index Tabs composite widget
  *
@@ -655,7 +655,7 @@ TabsSetValues(Widget current, Widget request, Widget new,
         * Window system will handle the redraws.
         */
 
-       if( tw->tabs.topWidget != curtw->tabs.topWidget ) 
+       if( tw->tabs.topWidget != curtw->tabs.topWidget )
        {
          if( XtIsRealized(tw->tabs.topWidget) )
          {
@@ -757,7 +757,7 @@ TabsAcceptFocus(Widget w, Time *t)
 /*
  * Return preferred size.  Happily accept anything >= our preferred size.
  * (TODO: is that the right thing to do?  Should we always return "almost"
- * if offerred more than we need?)
+ * if offered more than we need?)
  */
 
 static XtGeometryResult
@@ -1385,7 +1385,7 @@ DrawTabs(TabsWidget tw, Bool labels)
 
        if( !XtIsRealized((Widget)tw))
          return ;
+
        /* draw tabs and frames by row except for the top tab, which
         * is drawn last.  (This is inefficiently written, but should not
         * be too slow as long as there are not a lot of rows.)
@@ -1749,7 +1749,7 @@ TabLayout(TabsWidget tw, int wid, int hgt, Dimension *reply_height, Bool query_o
              if (!query_only)
                tw->tabs.displayChildren++;
            }
-         /* If there was only one row, increse the height by TABDELTA */
+         /* If there was only one row, increase the height by TABDELTA */
          if( ++row == 1 )
          {
            y = TABDELTA ;
index 8e69333..959ddd5 100644 (file)
@@ -1,3 +1,61 @@
+2000-10-04  Martin Buchholz <martin@xemacs.org>
+
+       * XEmacs 21.2.36 is released.
+
+2000-09-27  Martin Buchholz  <martin@xemacs.org>
+
+       * lispref/processes.texi (Signals to Processes): Many corrections.
+
+2000-09-20  Martin Buchholz  <martin@xemacs.org>
+
+       * xemacs/startup.texi (Startup Paths): Minor fixes.
+
+2000-09-19  Martin Buchholz  <martin@xemacs.org>
+
+       * *: Spelling mega-patch
+
+2000-09-16  Martin Buchholz  <martin@xemacs.org>
+
+       * internals/internals.texi (Low-Level Modules):
+       Correct the list of source files.
+
+2000-08-24  Adrian Aichner  <aichner@ecf.teradyne.com>
+
+       * emodules.texi (Introduction): Trivial typo fix.
+
+2000-08-24  Martin Buchholz  <martin@xemacs.org>
+
+       * emodules.texi (Initialization Mode): Spell-Check.
+
+2000-08-24  Martin Buchholz  <martin@xemacs.org>
+
+       * lispref/databases.texi (Connecting to a Database):
+       s/berkeley_db/berkeley-db/.  Too much C programming.
+
+2000-08-02  Stephen J. Turnbull  <stephen@xemacs.org>
+
+       * xemacs/custom.texi (Menubar Resources): Document FontSet resource.
+
+2000-07-30  Ben Wing  <ben@xemacs.org>
+
+       * xemacs\search.texi (Regexp Search):
+       * xemacs\search.texi (Regexps):
+       Synch up with updated docs below (describing non-greedy
+       operators and such).
+
+2000-07-30  Ben Wing  <ben@xemacs.org>
+
+       * lispref\searching.texi (Syntax of Regexps):
+       Document ??, which we've supported since 20.4.
+
+2000-07-31  Sandra Wambold  <wambold@cygnus.com>
+
+       * xemacs-faq.texi: Minor updates in first two sections
+
+2000-07-27  Andy Piper  <andy@xemacs.org>
+
+       * lispref/hash-tables.texi: add new hash table type.
+
 2000-07-19  Martin Buchholz <martin@xemacs.org>
 
        * XEmacs 21.2.35 is released.
        * info.texi: Fixed @setfilename and a typo.
        * standards.texi: Added NEXT to @node Preface. See ALL.
        * texinfo.texi: Fixed section names, quoted usage of @TeX{},
-       changed some occurences of `:' to `colon'.
+       changed some occurrences of `:' to `colon'.
        * xemacs-faq.texi: See ALL.
        * internals/internals.texi: See ALL.
        * lispref/back.texi: Fixed @setfilename.
index 5ca73df..415caee 100644 (file)
@@ -117,7 +117,7 @@ This Info file contains v1.0 of the @value{emacs} dynamic loadable module
 support documentation.
 @menu
 * Introduction::                Introducing Emacs Modules
-* Annatomy of a Module::        Basic module layout and technology
+* Anatomy of a Module::         Basic module layout and technology
 * Using ellcc::                 How to use the module compiler
 * Defining Functions::          Creating new Lisp primitives
 * Defining Variables::          Creating new Lisp variables
@@ -125,12 +125,12 @@ support documentation.
 
  --- The Detailed Node Listing ---
 
-Annatomy of a Module
+Anatomy of a Module
 
 * Required Header File::        Always include <emodules.h>
 * Required Functions::          Functions you must always provide
 * Required Variables::          Variables whose values you must provide
-* Loading other Modules::       How to load dependant modules
+* Loading other Modules::       How to load dependent modules
 
 Using @code{ellcc}
 
@@ -148,7 +148,7 @@ Defining Functions
 
 @end ifinfo
 
-@node Introduction, Annatomy of a Module, Top, Top
+@node Introduction, Anatomy of a Module, Top, Top
 @chapter Introduction
 
   @value{emacs} is a powerful, extensible editor.  The traditional way of
@@ -161,12 +161,12 @@ ways than you can imagine, it does have its short-comings.
 implications.  Like all other interpreted languages (like Java), Elisp
 is often suitable only for certain types of application or extension.
 So although Elisp is a general purpose language, and very high level,
-there are times when it is desirable to descend to a lower level compiled 
+there are times when it is desirable to descend to a lower level compiled
 language for speed purposes.
 
   Secondly, Elisp (or Lisp in general) is not a very common language any
 more, except for certain circles in the computer industry.  C is a far
-more commonly known language, and because it is compiled, more suited to 
+more commonly known language, and because it is compiled, more suited to
 a wider range of applications, especially those that require low level
 access to a system or need to be as quick as possible.
 
@@ -175,8 +175,8 @@ access to a system or need to be as quick as possible.
 @cindex DSO
 @cindex shared object
   This manual describes a new way of extending @value{emacs}, by using dynamic
-loadable modules (also knows as dynamicaly loadable libraries (DLLs),
-dynamic shared objects (DSOs) or just simply shared objectcs), which can 
+loadable modules (also known as dynamically loadable libraries (DLLs),
+dynamic shared objects (DSOs) or just simply shared objects), which can
 be written in C or C++ and loaded into @value{emacs} at any time.  I sometimes
 refer to this technology as @dfn{CEmacs}, which is short for @dfn{C
 Extensible Emacs}.
@@ -199,7 +199,7 @@ specific characteristics from the developer.  This program is called to
 compile and link all objects that will make up the final shared object,
 and accepts all common C compiler flags.  @code{ellcc} also sets up the
 correct environment for compiling modules by enabling any special
-compiler modes (such as PIC mode), setting the correct include paths for 
+compiler modes (such as PIC mode), setting the correct include paths for
 the location of @value{emacs} internal header files etc.  The program will also
 invoke the linker correctly to created the final shared object which is
 loaded into @value{emacs}.
@@ -207,13 +207,13 @@ loaded into @value{emacs}.
 @item
 @cindex header files
   CEmacs also makes all of the relevant @value{emacs} internal header files
-availible for module authors to use.  This is often required to get data 
+available for module authors to use.  This is often required to get data
 structure definitions and external variable declarations.  The header
 files installed include the module specific header file
 @file{emodules.h}.  Due to the nature of dynamic modules, most of the
 internals of @value{emacs} are exposed.
-@xref{Top,,,internals,@value{emacs} Internals Manual}, for a 
-more complete discussion on how to extend and understand @value{emacs}.  All of 
+@xref{Top,,,internals,@value{emacs} Internals Manual}, for a
+more complete discussion on how to extend and understand @value{emacs}.  All of
 the rules for C modules are discussed there.
 
 @item
@@ -245,17 +245,17 @@ should be considered the final authority.  It will also help a great
 deal to look at the actual @value{emacs} source code to see how things are
 done.
 
-@node Annatomy of a Module, Using ellcc, Introduction, Top
-@chapter Annatomy of a Module
-@cindex annatomy
+@node Anatomy of a Module, Using ellcc, Introduction, Top
+@chapter Anatomy of a Module
+@cindex anatomy
 @cindex module skeleton
 @cindex skeleton, module
 @cindex module format
 @cindex format, module
 
-  Each dynamically loadable @value{emacs} extension (hereafter refered to as a
-module) has a certain compulsory format, and must contain several 
-pieces of information and several mandatory functions.  This chapter 
+  Each dynamically loadable @value{emacs} extension (hereafter referred to as a
+module) has a certain compulsory format, and must contain several
+pieces of information and several mandatory functions.  This chapter
 describes the basic layout of a module, and provides a very simple
 sample.  The source for this sample can be found in the file
 @file{modules/simple/sample.c} in the main @value{emacs} source code tree.
@@ -264,10 +264,10 @@ sample.  The source for this sample can be found in the file
 * Required Header File::        Always include <emodules.h>
 * Required Functions::          Functions you must always provide
 * Required Variables::          Variables whose values you must provide
-* Loading other Modules::       How to load dependant modules
+* Loading other Modules::       How to load dependent modules
 @end menu
 
-@node Required Header File, Required Functions, Annatomy of a Module, Annatomy of a Module
+@node Required Header File, Required Functions, Anatomy of a Module, Anatomy of a Module
 @section Required Header File
 @cindex required header
 @cindex include files
@@ -275,7 +275,7 @@ sample.  The source for this sample can be found in the file
 @cindex emodules.h
 @cindex config.h
   Every module must include the file @file{<emodules.h>}.  This
-will include several other @value{emacs} internal header files, and will set up 
+will include several other @value{emacs} internal header files, and will set up
 certain vital macros.  One of the most important files included by
 @file{emodules.h} is the generated @file{config.h} file, which contains
 all of the required system abstraction macros and definitions.  Most
@@ -283,20 +283,20 @@ modules will probably require some pre-processor conditionals based on
 constants defined in @file{config.h}.  Please read that file to
 familiarize yourself with the macros defined there.
 
-  Depending on exactly what your module will be doing, you will probably 
+  Depending on exactly what your module will be doing, you will probably
 need to include one or more of the @value{emacs} internal header files.  When
-you @code{#include <emodules.h>}, you will get a few of the most important 
+you @code{#include <emodules.h>}, you will get a few of the most important
 @value{emacs} header files included automatically for you.  The files included
 are:
 
 @table @file
 @item lisp.h
-This file contains most of the macros required for declaring Lisp object 
+This file contains most of the macros required for declaring Lisp object
 types, macros for accessing Lisp objects, and global variable
 declarations.
 
 @item sysdep.h
-All system dependant declarations and abstraction macros live here.  You 
+All system dependent declarations and abstraction macros live here.  You
 should never call low level system functions directly.  Rather, you
 should use the abstraction macros provided in this header file.
 
@@ -317,15 +317,15 @@ Provides the required structure, macro and function definitions for
 manipulating @value{emacs} frames.
 @end table
 
-@node Required Functions, Required Variables, Required Header File, Annatomy of a Module
+@node Required Functions, Required Variables, Required Header File, Anatomy of a Module
 @section Required Functions
 @cindex initialization
 @cindex functions, required
 @cindex required functions
 
 Every module requires several initialization functions.  It is the
-responsibility of these functions to load in any dependant modules, and to 
-declare all variables and functions which are to be made visibile to the 
+responsibility of these functions to load in any dependent modules, and to
+declare all variables and functions which are to be made visible to the
 @value{emacs} Lisp reader.  Each of these functions performs a very specific
 task, and they are executed in the correct order by @value{emacs}.  All of
 these functions are @code{void} functions which take no arguments.
@@ -339,7 +339,7 @@ place-holder, not an actual function name.
 @table @code
 @item syms_of_module
 @findex syms_of_module
-This required function is responsible for introducing to the Lisp reader 
+This required function is responsible for introducing to the Lisp reader
 all functions that you have defined in your module using
 @code{DEFUN()}.  Note that @emph{only} functions are declared here, using
 the @code{DEFSUBR()} macro.  No variables are declared.
@@ -355,7 +355,7 @@ all internal @value{emacs} source code.
 @item modules_of_module
 @findex modules_of_module
 This optional function should be used to load in any modules which your
-module depends on.  The @value{emacs} module loading code makes sure that the 
+module depends on.  The @value{emacs} module loading code makes sure that the
 same module is not loaded twice, so several modules can safely call the
 module load function for the same module.  Only one copy of each module
 (at a given version) will ever be loaded.
@@ -368,7 +368,7 @@ initialization code is produced.  It is required to document all
 functions and variables declared in your module.
 @end table
 
-@node Required Variables, Loading other Modules, Required Functions, Annatomy of a Module
+@node Required Variables, Loading other Modules, Required Functions, Anatomy of a Module
 @section Required Variables
 @cindex initialization
 @cindex variables, required
@@ -376,7 +376,7 @@ functions and variables declared in your module.
 
 Not only does a module need to declare the initialization functions
 mentioned above, it is also required to provide certain variables which
-the module loading code searches for in order to determine the viability 
+the module loading code searches for in order to determine the viability
 of a module.  You are @emph{not} required to provide these variables in
 your source files.  They are automatically set up in the module
 initialization file by the @code{ellcc} compiler.  These variables are
@@ -388,7 +388,7 @@ This is a variable of type @code{long}, and is used to indicate the
 version of the @value{emacs} loading technology that was used to produce the
 module being loaded.  This version number is completely unrelated to
 the @value{emacs} version number, as a given module may quite well work
-regardless of the version of @value{emacs} that was installed at the time the 
+regardless of the version of @value{emacs} that was installed at the time the
 module was created.
 
 The @value{emacs} modules version is used to differentiate between major
@@ -397,11 +397,11 @@ changes in the module loading technology, not versions of @value{emacs}.
 @item emodules_name
 This is a short (typically 10 characters or less) name for the module,
 and it is used as a suffix for all of the required functions.  This is
-also the name by which the module is recognised when loading dependant
+also the name by which the module is recognized when loading dependent
 modules.  The name does not necessarily have to be the same as the
 physical file name, although keeping the two names in sync is a pretty
-good idea.  The name must not be empty, and it must be a valid part of a 
-C function name.  The value of this variable is appended to the function 
+good idea.  The name must not be empty, and it must be a valid part of a
+C function name.  The value of this variable is appended to the function
 names @code{syms_of_}, @code{vars_of_}, @code{modules_of_} and
 @code{docs_of_} to form the actual function names that the module
 loading code looks for when loading a module.
@@ -423,9 +423,9 @@ and does not affect the loading of the module.  The value is set by the
 @code{--mod-title} argument to @code{ellcc}.
 @end table
 
-@node Loading other Modules,  , Required Variables, Annatomy of a Module
+@node Loading other Modules,  , Required Variables, Anatomy of a Module
 @section Loading other Modules
-@cindex dependancies
+@cindex dependencies
 @findex modules_of_module
 @findex emodules_load
 
@@ -433,7 +433,7 @@ During the loading of a module, it is the responsibility of the function
 @code{modules_of_module} to load in any modules which the current module
 depends on.  If the module is stand-alone, and does not depend on other
 modules, then this function can be left empty or even undeclared.
-However, if it does have dependnacies, it must call
+However, if it does have dependencies, it must call
 @code{emodules_load}:
 
 @example
@@ -444,18 +444,18 @@ int emodules_load (const char *module,
 @end cartouche
 @end example
 
-The first argument @var{module} is the name of the actual shared object 
+The first argument @var{module} is the name of the actual shared object
 or DLL.  You can omit the @file{.so}, @file{.ell} or @file{.dll}
 extension of you wish.  If you do not specify an absolute path name,
 then the same rules as apply to loading Lisp modules are applied when
 searching for the module.  If the module cannot be found in any of the
 standard places, and an absolute path name was not specified,
-@code{emodules_load} will signal an error and loading of the module 
+@code{emodules_load} will signal an error and loading of the module
 will stop.
 
 The second argument (@var{modname}) is the module name to load, and
 must match the contents of the variable @var{emodule_name} in the
-module to be loaded. A mis-match will cause the module load to fail.  If 
+module to be loaded. A mis-match will cause the module load to fail.  If
 this parameter is @code{NULL} or empty, then no checks are performed
 against the target module's @var{emodule_name} variable.
 
@@ -465,13 +465,13 @@ to load, and is compared to the target module's
 or empty, and the match fails, then the load of the module will fail.
 
 @code{emodules_load} can be called recursively.  If, at any point
-during the loading of modules a failure is encountered, then all modules 
+during the loading of modules a failure is encountered, then all modules
 that were loaded since the top level call to @code{emodules_load}
 will be unloaded.  This means that if any child modules fail to load,
 then their parents will also fail to load.  This does not include
 previous successful calls to @code{emodules_load} at the top level.
 
-@node Using ellcc, Defining Functions, Annatomy of a Module, Top
+@node Using ellcc, Defining Functions, Anatomy of a Module, Top
 @chapter Using @code{ellcc}
 @cindex @code{ellcc}
 @cindex module compiler
@@ -494,7 +494,7 @@ variable @code{CC} to @code{ellcc} and your code will be compiled as
 an Emacs module rather than a static C object.
 
 @code{ellcc} has three distinct modes of operation.  It can be run in
-compile, link or initialization mode.  These modes are discussed in more 
+compile, link or initialization mode.  These modes are discussed in more
 detail below.  If you want @code{ellcc} to show the commands it is
 executing, you can specify the option @code{--mode=verbose} to
 @code{ellcc}.  Specifying this option twice will enable certain extra
@@ -513,7 +513,7 @@ debugging messages to be displayed on the standard output.
 @cindex compiling
 
 By default, @code{ellcc} is in @dfn{compile} mode.  This means that it
-assumes that all of the command line arguments are C compiler arguments, 
+assumes that all of the command line arguments are C compiler arguments,
 and that you want to compile the specified source file or files.  You
 can force compile mode by specifying the @code{--mode=compile} argument
 to @code{ellcc}.
@@ -526,7 +526,7 @@ then invoke the C compiler to compile your module, and will return the
 same exit codes and messages that your C compiler does.
 
 By far the easiest way to compile modules is to construct a
-@file{Makefile} as you would for a normal program, and simply insert, at 
+@file{Makefile} as you would for a normal program, and simply insert, at
 some appropriate place something similar to:
 
 @example
@@ -554,14 +554,14 @@ functions.  Rather than have the documentation for compiled functions
 and variables passed as static strings in the source code, the
 documentation is included as a C comment.  A special program, called
 @file{make-docfile}, is used to scan the source code files and extract
-the documentation from these comments, producing the @value{emacs} @file{DOC} 
+the documentation from these comments, producing the @value{emacs} @file{DOC}
 file, which the internal help engine scans when the documentation for a
 function or variable is requested.
 
 Due to the internal construction of Lisp objects, subrs and other such
 things, adding documentation for a compiled function or variable in a
 compiled module, at any time after @value{emacs} has been @dfn{dumped} is
-somewhat problematic.  Fortunately, as a module writer you are insulated 
+somewhat problematic.  Fortunately, as a module writer you are insulated
 from the difficulties thanks to your friend @code{ellcc} and some
 internal trickery in the module loading code.  This is all done using
 the @dfn{initialization} mode of @code{ellcc}.
@@ -569,8 +569,8 @@ the @dfn{initialization} mode of @code{ellcc}.
 The result of running @code{ellcc} in initialization mode is a C source
 file which you compile with (you guessed it) @code{ellcc} in compile
 mode.  Initialization mode is where you set the module name, version,
-title and gather together all of the documentaion strings for the
-functions and vairables in your module.  There are several options that
+title and gather together all of the documentation strings for the
+functions and variables in your module.  There are several options that
 you are required to pass @code{ellcc} in initialization mode, the first
 of which is the mode switch itself, @code{--mode=init}.
 
@@ -602,8 +602,8 @@ This string should be brief, as it has to be formatted to fit the
 screen.
 
 Following all of these parameters, you need to provide the list of all
-source code modules that make up your module.  These are the files which 
-are scanned by @file{make-docfile}, and provide the information required 
+source code modules that make up your module.  These are the files which
+are scanned by @file{make-docfile}, and provide the information required
 to populate the @code{docs_of_module} function.  Below is a sample
 @file{Makefile} fragment which indicates how all of this is used.
 
@@ -656,17 +656,17 @@ way as the main module directory.  Each sub-directory within it is
 searched for a given module when the user attempts to load it.  The
 valid extensions that the loader attempts to use are @file{.so},
 @file{.ell} and @file{.dll}.  You can use any of these extensions,
-although @file{.ell} is the prefered extension.
+although @file{.ell} is the preferred extension.
 
 @node Link Mode, Other ellcc options, Initialization Mode, Using ellcc
 @section Link Mode
 @cindex linking
 
 Once all of your source code files have been compiled (including the
-generated init file) you need to link them all together to created the
+generated init file) you need to link them all together to create the
 loadable module.  To do this, you invoke @code{ellcc} in link mode, by
-pasing the @code{--mode-link} command.  You need to specify the final
-output file using the @code{--mod-output=NAME} command, but other than
+passing the @code{--mode-link} option.  You need to specify the final
+output file using the @code{--mod-output=NAME} option, but other than
 that all other arguments are passed on directly to the system compiler
 or linker, along with any other required arguments to create the
 loadable module.
@@ -686,7 +686,7 @@ sure you invoke it correctly in the @file{Makefile}.  See the sample
 
 Aside from the three main @code{ellcc} modes described above,
 @code{ellcc} can accept several other options.  These are typically used
-in a @file{Makefile} to determine installation paths.  @code{ellcc} also 
+in a @file{Makefile} to determine installation paths.  @code{ellcc} also
 allows you to over-ride several of its built-in compiler and linker
 options using environment variables.  Here is the complete list of
 options that @code{ellcc} accepts.
@@ -700,16 +700,16 @@ Enabled link edit mode.  Use this to create the final module.
 
 @item --mode=init
 Used to create the documentation function and to initialize other
-required variables.  Produces a C source file that must be compiled with 
+required variables.  Produces a C source file that must be compiled with
 @code{ellcc} in compile mode before linking the final module.
 
 @item --mode=verbose
 Enables verbose mode.  This will show you the commands that are being
-executed, as well as the version number of @code{ellcc}.  If you specify 
+executed, as well as the version number of @code{ellcc}.  If you specify
 this option twice, then some extra debugging information is displayed.
 
 @item --mod-name=NAME
-Sets the short internaml module @var{NAME} to the string specified,
+Sets the short internal module @var{NAME} to the string specified,
 which must consist only of valid C identifiers.  Required during
 initialization mode.
 
@@ -729,7 +729,7 @@ created to @var{FILENAME}.  During link mode, it sets the name of the
 final loadable module to @var{FILENAME}.
 
 @item --mod-location
-This will print the name of the standard module installation path on the 
+This will print the name of the standard module installation path on the
 standard output and immediately exit @code{ellcc}.  Use this option to
 determine the directory prefix of where you should install your modules.
 
@@ -737,11 +737,11 @@ determine the directory prefix of where you should install your modules.
 This will print the name of the site specific module location and exit.
 
 @item --mod-archdir
-Prints the name of the root of the architecture-dependant directory that 
-@value{emacs} searches for architecture-dependant files.
+Prints the name of the root of the architecture-dependent directory that
+@value{emacs} searches for architecture-dependent files.
 
 @item --mod-config
-Prints the name of the configuration for which @value{emacs} and @code{ellcc} 
+Prints the name of the configuration for which @value{emacs} and @code{ellcc}
 were compiled.
 @end table
 
@@ -751,10 +751,10 @@ were compiled.
 
 During its normal operation, @code{ellcc} uses the compiler and linker
 flags that were determined at the time @value{emacs} was configured.  In
-certain rare circumstances you may wish to over-ride the flags passed to 
+certain rare circumstances you may wish to over-ride the flags passed to
 the compiler or linker, and you can do so using environment variables.
-The table below lists all of the environment variables that @code{ellcc} 
-recognises.
+The table below lists all of the environment variables that @code{ellcc}
+recognizes.
 
 @table @code
 @item ELLCC
@@ -802,17 +802,17 @@ Used during the compile phase of @value{emacs} itself.
 
   One of the main reasons you would ever write a module is to
 provide one or more @dfn{functions} for the user or the editor to use.
-The term 
+The term
 @dfn{function} is a bit overloaded here, as it refers to both a C
 function and the way it appears to Lisp, which is a @dfn{subroutine}, or
 simply a @dfn{subr}.  A Lisp subr is also known as a Lisp primitive, but
 that term applies less to dynamic modules.  @xref{Writing Lisp
 Primitives,,,internals,@value{emacs} Internals Manual}, for details on how to
 declare functions.  You should familiarize yourself with the
-instructions there.  The format of the function declaration is identical 
+instructions there.  The format of the function declaration is identical
 in modules.
 
-  Normal Lisp primitives document the functions they defining by including 
+  Normal Lisp primitives document the functions they defining by including
 the documentation as a C comment.  During the build process, a program
 called @file{make-docfile} is run, which will extract all of these
 comments, build up a single large documentation file, and will store
@@ -826,7 +826,7 @@ macro @code{CDOCSUBR} is used for, and this is used extensively during
   When using @code{DEFUN} in normal @value{emacs} C code, the sixth
 ``parameter'' is a C comment which documents the function.  For a
 dynamic module, we of course need to convert the C comment to a usable
-string, and we need to set the documentation pointer of the subr to this 
+string, and we need to set the documentation pointer of the subr to this
 string.  As a module programmer, you don't actually need to do any work
 for this to happen.  It is all taken care of in the
 @code{docs_of_module} function created by @code{ellcc}.
@@ -843,7 +843,7 @@ for this to happen.  It is all taken care of in the
 @cindex functions, Lisp
 @cindex functions, defining
 
-  Although the full syntax of a function declaration is discussed in the 
+  Although the full syntax of a function declaration is discussed in the
 @value{emacs} internals manual in greater depth, what follows is a brief
 description of how to define and implement a new Lisp primitive in a
 module.  This is done using the @code{DEFUN} macro.  Here is a small
@@ -854,7 +854,7 @@ example:
 DEFUN ("my-function", Fmy_function, 1, 1, "FFile name: ", /*
 Sample Emacs primitive function.
 
-The specified FILE is frobricated before it is fnozzled.
+The specified FILE is frobnicated before it is fnozzled.
 */
     (file))
 @{
@@ -871,9 +871,9 @@ The specified FILE is frobricated before it is fnozzled.
 @end example
 
 The first argument is the name of the function as it will appear to the
-Lisp reader.  This must be provided as a string.  The second argument is 
+Lisp reader.  This must be provided as a string.  The second argument is
 the name of the actual C function that will be created.  This is
-typically the Lisp function name with a preceding capital @code{F}, with 
+typically the Lisp function name with a preceding capital @code{F}, with
 hyphens converted to underscores.  This must be a valid C function
 name.  Next come the minimum and maximum number of arguments,
 respectively.  This is used to ensure that the correct number of
@@ -891,7 +891,7 @@ function argument names, if any.
 @cindex functions, declaring
 
 Simply writing the code for a function is not enough to make it
-availible to the Lisp reader.  You have to, during module
+available to the Lisp reader.  You have to, during module
 initialization, let the Lisp reader know about the new function.  This
 is done by calling @code{DEFSUBR} with the name of the function.  This
 is the sole purpose of the initialization function
@@ -933,25 +933,25 @@ internals manual for more details.
 
   Rarely will you write a module that only contains functions.  It is
 common to also provide variables which can be used to control the
-behaviour of the function, or store the results of the function being
+behavior of the function, or store the results of the function being
 executed.  The actual C variable types are the same for modules
 and internal @value{emacs} primitives, and the declaration of the variables
 is identical.
 
-  @xref{Adding Global Lisp Variables,,,internals,XEmacs Internals Manual}, 
+  @xref{Adding Global Lisp Variables,,,internals,XEmacs Internals Manual},
 for more information on variables and naming conventions.
 
   Once your variables are defined, you need to initialize them and make
 the Lisp reader aware of them.  This is done in the
 @code{vars_of_module} initialization function using special @value{emacs}
-macros such as @code{DEFVAR_LISP}, @code{DEFVAR_BOOL}, @code{DEFVAR_INT} 
-etc.  The best way to see how to use these macros is to look at existing 
+macros such as @code{DEFVAR_LISP}, @code{DEFVAR_BOOL}, @code{DEFVAR_INT}
+etc.  The best way to see how to use these macros is to look at existing
 source code, or read the internals manual.
 
   One @emph{very} important difference between @value{emacs} variables and
 module variables is how you use pure space.  Simply put, you
 @strong{never} use pure space in @value{emacs} modules.  The pure space
-storage is of a limited size, and is initialized propperly during the
+storage is of a limited size, and is initialized properly during the
 dumping of @value{emacs}.  Because variables are being added dynamically to
 an already running @value{emacs} when you load a module, you cannot use pure
 space.  Be warned: @strong{do not use pure space in modules.  Repeat, do
index bd827ee..6a12f76 100644 (file)
@@ -3,7 +3,7 @@
 @setfilename ../info/info.info
 @settitle Info
 @comment %**end of header
-@comment $Id: info.texi,v 1.4.2.4 2000/01/18 07:27:42 yoshiki Exp $
+@comment $Id: info.texi,v 1.4.2.5 2000/09/13 10:57:18 martinb Exp $
 
 @dircategory Texinfo documentation system
 @direntry
@@ -853,7 +853,7 @@ node of the file with Emacs Info mode.
 @node Emacs Info Variables, , Checking, Advanced Info
 @section Emacs Info-mode Variables
 
-The following variables may modify the behaviour of Info-mode in Emacs;
+The following variables may modify the behavior of Info-mode in Emacs;
 you may wish to set one or several of these variables interactively, or
 in your @file{~/.emacs} init file.  @xref{Examining, Examining and
 Setting Variables, Examining and Setting Variables, xemacs, XEmacs
index 499bc58..5b8d38e 100644 (file)
@@ -1218,7 +1218,7 @@ name as the value of the Lisp variable @code{top-level}.
 
   When the Lisp initialization code is done, the C code enters the event
 loop, and stays there for the duration of the XEmacs process.  The code
-for the event loop is contained in @file{keyboard.c}, and is called
+for the event loop is contained in @file{cmdloop.c}, and is called
 @code{Fcommand_loop_1()}.  Note that this event loop could very well be
 written in Lisp, and in fact a Lisp version exists; but apparently,
 doing this makes XEmacs run noticeably slower.
@@ -2910,7 +2910,7 @@ chosen by @file{configure}.
 
 
 @example
-crt0.c
+ecrt0.c
 lastfile.c
 pre-crt0.c
 @end example
@@ -3045,14 +3045,6 @@ provided by the @samp{--error-check-*} configuration options.
 
 
 @example
-prefix-args.c
-@end example
-
-This is actually the source for a small, self-contained program
-used during building.
-
-
-@example
 universe.h
 @end example
 
@@ -3064,7 +3056,6 @@ This is not currently used.
 @section Basic Lisp Modules
 
 @example
-emacsfns.h
 lisp-disunion.h
 lisp-union.h
 lisp.h
@@ -3410,8 +3401,12 @@ Most of this could be implemented in Lisp.
 
 @example
 event-Xt.c
+event-msw.c
 event-stream.c
 event-tty.c
+events-mod.h
+gpmevent.c
+gpmevent.h
 events.c
 events.h
 @end example
@@ -3466,10 +3461,10 @@ relevant keymaps.)
 
 
 @example
-keyboard.c
+cmdloop.c
 @end example
 
-@file{keyboard.c} contains functions that implement the actual editor
+@file{cmdloop.c} contains functions that implement the actual editor
 command loop---i.e. the event loop that cyclically retrieves and
 dispatches events.  This code is also rather tricky, just like
 @file{event-stream.c}.
@@ -3507,13 +3502,31 @@ code is loaded).
 @section Modules for the Basic Displayable Lisp Objects
 
 @example
-device-ns.h
-device-stream.c
-device-stream.h
+console-msw.c
+console-msw.h
+console-stream.c
+console-stream.h
+console-tty.c
+console-tty.h
+console-x.c
+console-x.h
+console.c
+console.h
+@end example
+
+These modules implement the @dfn{console} Lisp object type.  A console
+contains multiple display devices, but only one keyboard and mouse.
+Most of the time, a console will contain exactly one device.
+
+Consoles are the top of a lisp object inclusion hierarchy.  Consoles
+contain devices, which contain frames, which contain windows.
+
+
+
+@example
+device-msw.c
 device-tty.c
-device-tty.h
 device-x.c
-device-x.h
 device.c
 device.h
 @end example
@@ -3534,10 +3547,9 @@ subtypes (X, TTY, NeXTstep, Microsoft Windows, etc.) as devices do.
 
 
 @example
-frame-ns.h
+frame-msw.c
 frame-tty.c
 frame-x.c
-frame-x.h
 frame.c
 frame.h
 @end example
@@ -3589,7 +3601,10 @@ faces.h
 
 @example
 bitmaps.h
-glyphs-ns.h
+glyphs-eimage.c
+glyphs-msw.c
+glyphs-msw.h
+glyphs-widget.c
 glyphs-x.c
 glyphs-x.h
 glyphs.c
@@ -3599,7 +3614,8 @@ glyphs.h
 
 
 @example
-objects-ns.h
+objects-msw.c
+objects-msw.h
 objects-tty.c
 objects-tty.h
 objects-x.c
@@ -3611,13 +3627,18 @@ objects.h
 
 
 @example
+menubar-msw.c
+menubar-msw.h
 menubar-x.c
 menubar.c
+menubar.h
 @end example
 
 
 
 @example
+scrollbar-msw.c
+scrollbar-msw.h
 scrollbar-x.c
 scrollbar-x.h
 scrollbar.c
@@ -3627,6 +3648,7 @@ scrollbar.h
 
 
 @example
+toolbar-msw.c
 toolbar-x.c
 toolbar.c
 toolbar.h
@@ -3653,6 +3675,7 @@ gifalloc.c
 @end example
 
 These modules decode GIF-format image files, for use with glyphs.
+These files were removed due to Unisys patent infringement concerns.
 
 
 
@@ -3661,6 +3684,7 @@ These modules decode GIF-format image files, for use with glyphs.
 
 @example
 redisplay-output.c
+redisplay-msw.c
 redisplay-tty.c
 redisplay-x.c
 redisplay.c
@@ -3755,7 +3779,7 @@ streams and C++ I/O streams.
 Similar to other subsystems in XEmacs, lstreams are separated into
 generic functions and a set of methods for the different types of
 lstreams.  @file{lstream.c} provides implementations of many different
-types of streams; others are provided, e.g., in @file{mule-coding.c}.
+types of streams; others are provided, e.g., in @file{file-coding.c}.
 
 
 
@@ -4220,16 +4244,6 @@ AIX prior to 4.1.
 
 
 
-@example
-msdos.c
-msdos.h
-@end example
-
-These modules are used for MS-DOS support, which does not work in
-XEmacs.
-
-
-
 @node Modules for Interfacing with X Windows, Modules for Internationalization, Modules for Interfacing with the Operating System, A Summary of the Various XEmacs Modules
 @section Modules for Interfacing with X Windows
 
@@ -4297,7 +4311,10 @@ needs to be rewritten.
 
 
 @example
-xselect.c
+select-msw.c
+select-x.c
+select.c
+select.h
 @end example
 
 @cindex selections
@@ -4380,8 +4397,8 @@ mule-canna.c
 mule-ccl.c
 mule-charset.c
 mule-charset.h
-mule-coding.c
-mule-coding.h
+file-coding.c
+file-coding.h
 mule-mcpath.c
 mule-mcpath.h
 mule-wnnfns.c
@@ -4393,13 +4410,13 @@ actually provides a general interface for all sorts of languages, not
 just Asian languages (although they are generally the most complicated
 to support).  This code is still in beta.
 
-@file{mule-charset.*} and @file{mule-coding.*} provide the heart of the
+@file{mule-charset.*} and @file{file-coding.*} provide the heart of the
 XEmacs MULE support.  @file{mule-charset.*} implements the @dfn{charset}
 Lisp object type, which encapsulates a character set (an ordered one- or
 two-dimensional set of characters, such as US ASCII or JISX0208 Japanese
 Kanji).
 
-@file{mule-coding.*} implements the @dfn{coding-system} Lisp object
+@file{file-coding.*} implements the @dfn{coding-system} Lisp object
 type, which encapsulates a method of converting between different
 encodings.  An encoding is a representation of a stream of characters,
 possibly from multiple character sets, using a stream of bytes or words,
@@ -5355,6 +5372,15 @@ included by @file{inline.c}.
 file.  To create one of these, copy an existing model and modify as
 necessary.
 
+  @strong{Please note:} If you define an lrecord in an external
+dynamically-loaded module, you must use @code{DECLARE_EXTERNAL_LRECORD},
+@code{DEFINE_EXTERNAL_LRECORD_IMPLEMENTATION}, and
+@code{DEFINE_EXTERNAL_LRECORD_SEQUENCE_IMPLEMENTATION} instead of the
+non-EXTERNAL forms. These macros will dynamically add new type numbers
+to the global enum that records them, whereas the non-EXTERNAL forms
+assume that the programmer has already inserted the correct type numbers
+into the enum's code at compile-time.
+
   The various methods in the lrecord implementation structure are:
 
 @enumerate
@@ -8748,7 +8774,7 @@ from its corresponding widget_instance by walking the widget_instance
 tree recursively.
 
 This has desirable properties such as lw_modify_all_widgets which is
-called from glyphs-x.c and updates all the properties of a widget
+called from @file{glyphs-x.c} and updates all the properties of a widget
 without having to know what the widget is or what toolkit it is from.
 Unfortunately this also has hairy properties such as making the lwlib
 code quite complex. And of course lwlib has to know at some level what
index 24008a5..cc95f52 100644 (file)
@@ -46,7 +46,7 @@ not be displayed in any windows.
 
   Buffers in Emacs editing are objects that have distinct names and hold
 text that can be edited.  Buffers appear to Lisp programs as a special
-data type.  You can think of the contents of a buffer as an extendable
+data type.  You can think of the contents of a buffer as an extendible
 string; insertions and deletions may occur in any part of the buffer.
 @xref{Text}.
 
index def33d0..67f5f07 100644 (file)
@@ -152,12 +152,12 @@ is a symbol whose name is one of the device classes mentioned above.
 
 @defun valid-device-type-p device-type
 This function returns whether @var{device-type} (which should be a symbol)
-species a valid device type.
+specifies a valid device type.
 @end defun
 
 @defun valid-device-class-p device-class
 This function returns whether @var{device-class} (which should be a symbol)
-species a valid device class.
+specifies a valid device class.
 @end defun
 
 @defvar terminal-device
index fdc5c74..b3106e3 100644 (file)
@@ -26,16 +26,16 @@ This function opens database @var{file}, using database method
 permissions @var{mode}.  @var{access} can be any combination of @code{r}
 @code{w} and @code{+}, for read, write, and creation flags.
 
-@var{type} can have the value @code{'dbm} or @code{'berkeley_db} to
+@var{type} can have the value @code{'dbm} or @code{'berkeley-db} to
 select the type of database file to use.  (Note:  XEmacs may not
 support both of these types.)
 
 For a @var{type} of @code{'dbm}, there are no subtypes, so
 @var{subtype} should be @code{nil}.
 
-For a @var{type} of @code{'berkeley_db}, the following subtypes are
+For a @var{type} of @code{'berkeley-db}, the following subtypes are
 available:  @code{'hash}, @code{'btree}, and @code{'recno}.  See the
-manpages for the Berkeley DB functions to more information about these 
+manpages for the Berkeley DB functions for more information about these 
 types.
 @end defun
 
index 6d0b646..5702072 100644 (file)
@@ -89,15 +89,17 @@ the factor by which to increase the size of the hash table when enlarging.
 Keyword @code{:rehash-threshold} must be a float between 0.0 and 1.0,
 and specifies the load factor of the hash table which triggers enlarging.
 
-Keyword @code{:weakness} can be @code{nil} (default), @code{t},
-@code{key} or @code{value}.
-
-A weak hash table is one whose pointers do not count as GC referents:
-for any key-value pair in the hash table, if the only remaining pointer
-to either the key or the value is in a weak hash table, then the pair
-will be removed from the hash table, and the key and value collected.
-A non-weak hash table (or any other pointer) would prevent the object
-from being collected.
+Non-standard keyword @code{:weakness} can be @code{nil} (default),
+@code{t}, @code{key-and-value}, @code{key}, @code{value} or
+@code{key-or-value}.  @code{t} is an alias for @code{key-and-value}.
+
+A key-and-value-weak hash table, also known as a fully-weak or simply
+as a weak hash table, is one whose pointers do not count as GC
+referents: for any key-value pair in the hash table, if the only
+remaining pointer to either the key or the value is in a weak hash
+table, then the pair will be removed from the hash table, and the key
+and value collected.  A non-weak hash table (or any other pointer)
+would prevent the object from being collected.
 
 A key-weak hash table is similar to a fully-weak hash table except that
 a key-value pair will be removed only if the key remains unmarked
@@ -110,6 +112,12 @@ that a key-value pair will be removed only if the value remains
 unmarked outside of weak hash tables.  The pair will remain in the
 hash table if the value is pointed to by something other than a weak
 hash table, even if the key is not.
+
+A key-or-value-weak hash table is similar to a fully-weak hash table except
+that a key-value pair will be removed only if the value and the key remain
+unmarked outside of weak hash tables.  The pair will remain in the
+hash table if the value or key are pointed to by something other than a weak
+hash table, even if the other is not.
 @end defun
 
 @defun copy-hash-table hash-table
@@ -204,18 +212,22 @@ remaining around forever, long past their actual period of use.
 (Otherwise, you'd have to explicitly map over the hash table every so
 often and remove unnecessary elements.)
 
-There are three types of weak hash tables:
+There are four types of weak hash tables:
 
 @table @asis
-@item fully weak hash tables
-In these hash tables, a pair disappears if either the key or the value
-is unreferenced outside of the table.
+@item key-and-value-weak hash tables
+In these hash tables, also known as fully weak or simply as weak hash
+tables, a pair disappears if either the key or the value is unreferenced
+outside of the table.
 @item key-weak hash tables
 In these hash tables, a pair disappears if the key is unreferenced outside
 of the table, regardless of how the value is referenced.
 @item value-weak hash tables
 In these hash tables, a pair disappears if the value is unreferenced outside
 of the table, regardless of how the key is referenced.
+@item key-or-value-weak hash tables
+In these hash tables, a pair disappears if both the key and the value
+are unreferenced outside of the table.
 @end table
 
 Also see @ref{Weak Lists}.
index 18bc574..e533588 100644 (file)
@@ -673,7 +673,7 @@ reclaim memory for other Lisp objects.  To do this, use the function
 This command unloads the library that provided feature @var{feature}.
 It undefines all functions, macros, and variables defined in that
 library with @code{defconst}, @code{defvar}, @code{defun},
-@code{defmacro}, @code{defsubst}, @code{definf-function} and
+@code{defmacro}, @code{defsubst}, @code{define-function} and
 @code{defalias}.  It then restores any autoloads formerly associated
 with those symbols.  (Loading saves these in the @code{autoload}
 property of the symbol.)
index 23508f7..ac8b10d 100644 (file)
@@ -852,7 +852,7 @@ Buffer name? (default foo) @point{}
 @end example
 @end defun
 
-@defun read-command prompt &optinal default-value
+@defun read-command prompt &optional default-value
 This function reads the name of a command and returns it as a Lisp
 symbol.  The argument @var{prompt} is used as in
 @code{read-from-minibuffer}.  Recall that a command is anything for
index d46ab25..d227bcc 100644 (file)
@@ -192,7 +192,7 @@ encoded by doing the same but also prefixing the character with the
 byte 0x8F.
 
   The advantage of a modal encoding is that it is generally more
-space-efficient, and is easily extendable because there are essentially
+space-efficient, and is easily extendible because there are essentially
 an arbitrary number of escape sequences that can be created.  The
 disadvantage, however, is that it is much more difficult to work with
 if it is not being processed in a sequential manner.  In the non-modal
index fbc71b6..f664474 100644 (file)
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the XEmacs Lisp Reference Manual.
-@c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. 
+@c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
 @c See the file lispref.texi for copying conditions.
 @setfilename ../../info/processes.info
 @node Processes, System Interface, Databases, Top
@@ -92,7 +92,7 @@ intermixed randomly.
 argument, @var{args}.  The @var{args} must all be strings, and they are
 supplied to @var{program} as separate command line arguments.  Wildcard
 characters and other shell constructs are not allowed in these strings,
-since they are passed directly to the specified program.  
+since they are passed directly to the specified program.
 
   @strong{Please note:} The argument @var{program} contains only the
 name of the program; it may not contain any command-line arguments.  You
@@ -106,7 +106,7 @@ must use @var{args} to provide those.
 specify overrides for it with @code{process-environment}.  @xref{System
 Environment}.
 
-@defvar exec-directory 
+@defvar exec-directory
 @pindex wakeup
 The value of this variable is the name of a directory (a string) that
 contains programs that come with XEmacs, that are intended for XEmacs
@@ -296,8 +296,8 @@ inputinput@point{}
 
 @smallexample
 @group
-(call-process-region 
- start end         
+(call-process-region
+ start end
  shell-file-name      ; @r{Name of program.}
  nil                  ; @r{Do not delete region.}
  buffer               ; @r{Send output to @code{buffer}.}
@@ -704,25 +704,26 @@ defined.  XEmacs can send signals only to its own subprocesses.
 section.  XEmacs also sends signals automatically at certain times:
 killing a buffer sends a @code{SIGHUP} signal to all its associated
 processes; killing XEmacs sends a @code{SIGHUP} signal to all remaining
-processes.  (@code{SIGHUP} is a signal that usually indicates that the
-user hung up the phone.)
+processes.  (@code{SIGHUP} is a signal that indicates that the
+connection between the user and the process is broken, for example if a
+connection via a telephone line is hung up.)
 
   Each of the signal-sending functions takes two optional arguments:
-@var{process-name} and @var{current-group}.
+@var{process} and @var{current-group}.
 
-  The argument @var{process-name} must be either a process, the name of
-one, or @code{nil}.  If it is @code{nil}, the process defaults to the
-process associated with the current buffer.  An error is signaled if
-@var{process-name} does not identify a process.
+  The argument @var{process} must be either a process or a buffer,
+the name of one, or @code{nil}.  If it is @code{nil}, the process
+defaults to the process associated with the current buffer.  An error is
+signaled if @var{process} does not identify a process.
 
   The argument @var{current-group} is a flag that makes a difference
 when you are running a job-control shell as an XEmacs subprocess.  If it
-is non-@code{nil}, then the signal is sent to the current process-group
-of the terminal that XEmacs uses to communicate with the subprocess.  If
-the process is a job-control shell, this means the shell's current
-subjob.  If it is @code{nil}, the signal is sent to the process group of
-the immediate subprocess of XEmacs.  If the subprocess is a job-control
-shell, this is the shell itself.
+is non-@code{nil}, then the signal is sent to the current foreground
+process group of the terminal that XEmacs uses to communicate with the
+subprocess.  If the process is a job-control shell, this means the
+shell's current subjob.  If it is @code{nil}, the signal is sent to the
+process group of the immediate subprocess of XEmacs.  If the subprocess
+is a job-control shell, this is the shell itself.
 
   The flag @var{current-group} has no effect when a pipe is used to
 communicate with the subprocess, because the operating system does not
@@ -730,30 +731,39 @@ support the distinction in the case of pipes.  For the same reason,
 job-control shells won't work when a pipe is used.  See
 @code{process-connection-type} in @ref{Asynchronous Processes}.
 
-@defun interrupt-process &optional process-name current-group
-This function interrupts the process @var{process-name} by sending the
-signal @code{SIGINT}.  Outside of XEmacs, typing the ``interrupt
-character'' (normally @kbd{C-c} on some systems, and @code{DEL} on
-others) sends this signal.  When the argument @var{current-group} is
-non-@code{nil}, you can think of this function as ``typing @kbd{C-c}''
-on the terminal by which XEmacs talks to the subprocess.
+  Some of the functions below take a @var{signal} argument, which
+identifies a signal to be sent.  It must be either an integer or a
+symbol which names the signal, like @code{SIGSEGV}.
+
+@defun process-send-signal signal &optional process current-group
+This function sends the signal @var{signal} to the process @var{process}.
+The following functions can be implemented in terms of
+@code{process-send-signal}.
+@end defun
+
+@defun interrupt-process &optional process current-group
+This function interrupts the process @var{process} by sending the signal
+@code{SIGINT}.  Outside of XEmacs, typing the ``interrupt character''
+(normally @kbd{C-c}) sends this signal.  When the argument
+@var{current-group} is non-@code{nil}, you can think of this function as
+``typing @kbd{C-c}'' on the terminal by which XEmacs talks to the
+subprocess.
 @end defun
 
-@defun kill-process &optional process-name current-group
-This function kills the process @var{process-name} by sending the
+@defun kill-process &optional process current-group
+This function kills the process @var{process} by sending the
 signal @code{SIGKILL}.  This signal kills the subprocess immediately,
 and cannot be handled by the subprocess.
 @end defun
 
-@defun quit-process &optional process-name current-group
+@defun quit-process &optional process current-group
 This function sends the signal @code{SIGQUIT} to the process
-@var{process-name}.  This signal is the one sent by the ``quit
-character'' (usually @kbd{C-b} or @kbd{C-\}) when you are not inside
-XEmacs.
+@var{process}.  This signal is the one sent by the ``quit
+character'' (usually @kbd{C-\}) when you are not inside XEmacs.
 @end defun
 
-@defun stop-process &optional process-name current-group
-This function stops the process @var{process-name} by sending the
+@defun stop-process &optional process current-group
+This function stops the process @var{process} by sending the
 signal @code{SIGTSTP}.  Use @code{continue-process} to resume its
 execution.
 
@@ -763,17 +773,16 @@ non-@code{nil}, you can think of this function as ``typing @kbd{C-z}''
 on the terminal XEmacs uses to communicate with the subprocess.
 @end defun
 
-@defun continue-process &optional process-name current-group
+@defun continue-process &optional process current-group
 This function resumes execution of the process @var{process} by sending
-it the signal @code{SIGCONT}.  This presumes that @var{process-name} was
+it the signal @code{SIGCONT}.  This presumes that @var{process} was
 stopped previously.
 @end defun
 
-@c Emacs 19 feature
 @defun signal-process pid signal
-This function sends a signal to process @var{pid}, which need not be
-a child of XEmacs.  The argument @var{signal} specifies which signal
-to send; it should be an integer.
+This function sends a signal to the process with process id @var{pid},
+which need not be a child of XEmacs.  The argument @var{signal}
+specifies which signal to send.
 @end defun
 
 @node Output from Processes
@@ -1096,7 +1105,7 @@ of event.
   The string describing the event looks like one of the following:
 
 @itemize @bullet
-@item 
+@item
 @code{"finished\n"}.
 
 @item
index db7eadc..2436514 100644 (file)
@@ -273,17 +273,21 @@ match, it matches the shortest match.  @samp{*?} is known as a
 @dfn{non-greedy} quantifier, a regexp construct borrowed from Perl.
 @c Did perl get this from somewhere?  What's the real history of *? ?
 
-This construct very useful for when you want to match the text inside a
-pair of delimiters.  For instance, @samp{/\*.*?\*/} will match C
-comments in a string.  This could not be achieved without the use of
-greedy quantifier.
+This construct is very useful for when you want to match the text inside
+a pair of delimiters.  For instance, @samp{/\*.*?\*/} will match C
+comments in a string.  This could not easily be achieved without the use
+of a non-greedy quantifier.
 
 This construct has not been available prior to XEmacs 20.4.  It is not
 available in FSF Emacs.
 
 @item +?
 @cindex @samp{+?} in regexp
-is the @samp{+} analog to @samp{*?}.
+is the non-greedy version of @samp{+}.
+
+@item ??
+@cindex @samp{??} in regexp
+is the non-greedy version of @samp{?}.
 
 @item \@{n,m\@}
 @c Note the spacing after the close brace is deliberate.
@@ -293,6 +297,9 @@ specifies that the expression must match at least @var{n} times, but no
 more than @var{m} times.  This syntax is supported by most Unix regexp
 utilities, and has been introduced to XEmacs for the version 20.3.
 
+Unfortunately, the non-greedy version of this quantifier does not exist
+currently, although it does in Perl.
+
 @item [ @dots{} ]
 @cindex character set (in regexp)
 @cindex @samp{[} in regexp
@@ -462,8 +469,9 @@ is called a @dfn{shy} grouping operator, and it is used just like
 substring to be recorded for future reference.
 
 This is useful when you need a lot of grouping @samp{\( @dots{} \)}
-constructs, but only want to remember one or two.  Then you can use 
-not want to remember them for later use with @code{match-string}.
+constructs, but only want to remember one or two -- or if you have
+more than nine groupings and need to use backreferences to refer to
+the groupings at the end.
 
 Using @samp{\(?: @dots{} \)} rather than @samp{\( @dots{} \)} when you
 don't need the captured substrings ought to speed up your programs some,
@@ -472,7 +480,7 @@ engine, as well as the amount of memory allocation and string copying it
 must do.  The actual performance gain to be observed has not been
 measured or quantified as of this writing.
 @c This is used to good advantage by the font-locking code, and by
-@c `regexp-opt.el'.  ... It will be.  It's not yet, but will be.
+@c `regexp-opt.el'.
 
 The shy grouping operator has been borrowed from Perl, and has not been
 available prior to XEmacs 20.3, nor is it available in FSF Emacs.
index 45ca496..287184b 100644 (file)
@@ -1041,7 +1041,7 @@ position of point in that buffer.
 
 @defun window-point window
 This function returns the current position of point in @var{window}.
-For a nonselected window, this is the value point would have (in that
+For a non-selected window, this is the value point would have (in that
 window's buffer) if that window were selected.
 
 When @var{window} is the selected window and its buffer is also the
index 5c9cd6f..7014895 100644 (file)
@@ -7,7 +7,7 @@
 @finalout
 @titlepage
 @title XEmacs FAQ
-@subtitle Frequently asked questions about XEmacs @* Last Modified: $Date: 2000/07/08 09:14:11 $
+@subtitle Frequently asked questions about XEmacs @* Last Modified: $Date: 2000/09/19 07:50:41 $
 @sp 1
 @author Tony Rossini <rossini@@biostat.washington.edu>
 @author Ben Wing <ben@@xemacs.org>
 
 This is the guide to the XEmacs Frequently Asked Questions list---a
 compendium of questions and answers pertaining to one of the finest
-programs ever written.  It is much more than just a Text Editor.
+programs ever written.  XEmacs is much more than just a Text Editor.
 
-This FAQ is freely redistributable.  I take no liability for the
-correctness and safety of any procedures or advice given here.  This
-FAQ 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.
+This FAQ is freely redistributable.  This FAQ 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.
 
 If you have a Web browser, the official hypertext version is at
 @iftex
 @*
 @end iftex
-@uref{http://www.xemacs.org/faq/xemacs-faq.html}.
-
-This version is somewhat nicer than the unofficial hypertext versions
-that are archived at Utrecht, Oxford, Smart Pages, and other FAQ
-archives.
+@uref{http://www.xemacs.org/faq/xemacs-faq.html}
 
 @ifset CANONICAL
 @html
@@ -104,7 +98,7 @@ Introduction, Policy, Credits
 * Q1.0.4::      Why Another Version of Emacs?
 * Q1.0.5::      Why Haven't XEmacs and GNU Emacs Merged?
 * Q1.0.6::      Where can I get help?
-* Q1.0.7::      Where is the mailing list archived?
+* Q1.0.7::      Where are the mailing lists archived?
 * Q1.0.8::      How do you pronounce XEmacs?
 * Q1.0.9::      What does XEmacs look like?
 * Q1.0.10::     Is there a port of XEmacs to Microsoft ('95 or NT)?
@@ -124,12 +118,12 @@ Credits:
 * Q1.2.3::      Who contributed to the FAQ in the past?
 
 Internationalization:
-* Q1.3.1::      What is the status of XEmacs v20?
-* Q1.3.2::      What is the status of Asian-language support, aka @var{mule}?
+* Q1.3.1::      What is the status of internationalization support aka MULE (including Asian language support?
+* Q1.3.2::      How can I help with internationalization?
 * Q1.3.3::      How do I type non-ASCII characters?
 * Q1.3.4::      Can XEmacs messages come out in a different language?
-* Q1.3.5::      Please explain the various input methods in MULE/XEmacs 20.0
-* Q1.3.6::      How do I portably code for MULE/XEmacs 20.0?
+* Q1.3.5::      Please explain the various input methods in MULE/XEmacs
+* Q1.3.6::      How do I portably code for MULE/XEmacs?
 * Q1.3.7::      How about Cyrillic Modes?
 
 Getting Started:
@@ -351,7 +345,7 @@ Emacs Lisp Programming Techniques:
 * Q5.1.4::      What is the performance hit of @code{let}?
 * Q5.1.5::      What is the recommended use of @code{setq}?
 * Q5.1.6::      What is the typical misuse of @code{setq} ?
-* Q5.1.7::      I like the the @code{do} form of cl, does it slow things down?
+* Q5.1.7::      I like the @code{do} form of cl, does it slow things down?
 * Q5.1.8::      I like recursion, does it slow things down?
 * Q5.1.9::      How do I put a glyph as annotation in a buffer?
 * Q5.1.10::     @code{map-extents} won't traverse all of my extents!
@@ -452,7 +446,7 @@ Introduction:
 * Q1.0.4::      Why Another Version of Emacs?
 * Q1.0.5::      Why Haven't XEmacs and GNU Emacs Merged?
 * Q1.0.6::      Where can I get help?
-* Q1.0.7::      Where is the mailing list archived?
+* Q1.0.7::      Where are the mailing lists archived?
 * Q1.0.8::      How do you pronounce XEmacs?
 * Q1.0.9::      What does XEmacs look like?
 * Q1.0.10::     Is there a port of XEmacs to Microsoft ('95 or NT)?
@@ -472,12 +466,12 @@ Credits:
 * Q1.2.3::      Who contributed to the FAQ in the past?
 
 Internationalization:
-* Q1.3.1::      What is the status of XEmacs v20?
-* Q1.3.2::      What is the status of Asian-language support, aka @var{mule}?
+* Q1.3.1::      What is the status of internationalization support aka MULE (including Asian language support?
+* Q1.3.2::      How can I help with internationalization?
 * Q1.3.3::      How do I type non-ASCII characters?
 * Q1.3.4::      Can XEmacs messages come out in a different language?
-* Q1.3.5::      Please explain the various input methods in MULE/XEmacs 20.0
-* Q1.3.6::      How do I portably code for MULE/XEmacs 20.0?
+* Q1.3.5::      Please explain the various input methods in MULE/XEmacs
+* Q1.3.6::      How do I portably code for MULE/XEmacs?
 * Q1.3.7::      How about Cyrillic Modes?
 
 Getting Started:
@@ -503,10 +497,10 @@ track changes to GNU Emacs while also working to add new features.
 @node Q1.0.2, Q1.0.3, Q1.0.1, Introduction
 @unnumberedsubsec Q1.0.2: What is the current version of XEmacs?
 
-XEmacs 21.1.8 is the current stable version of XEmacs.
-
-XEmacs 20.4 is a minor upgrade from 20.3, containing many bugfixes. It
-was released in February 1998.
+XEmacs versions 21.1.* are releases made from the current stable
+sources.  XEmacs versions 21.2.* are releases made from the development
+sources.  Check at @uref{http://www.xemacs.org} for the current minor
+version.
 
 XEmacs 19.16 was the last release of v19, released in November, 1997,
 which was also the last version without international language support.
@@ -631,7 +625,7 @@ xemacs-request address.  Send a message with a subject of
 @samp{unsubscribe} to be removed.
 
 @node Q1.0.7, Q1.0.8, Q1.0.6, Introduction
-@unnumberedsubsec Q1.0.7: Where is the mailing list archived?
+@unnumberedsubsec Q1.0.7: Where are the mailing lists archived?
 
 The archives can be found at @uref{http://www.xemacs.org/Lists/Archive}
 
@@ -722,8 +716,7 @@ Pre-printed manuals are not available.  If you are familiar with
 TeX, you can generate your own manual from the XEmacs sources.
 
 HTML and Postscript versions of XEmacs manuals may be available from the
-XEmacs web site in the future.
-
+XEmacs web site in the future.  Send requests to @email{faq@@xemacs.org}.
 
 @node Q1.1.1, Q1.1.2, Q1.0.14, Introduction
 @unnumberedsec 1.1: Policies
@@ -738,12 +731,11 @@ maintainers}.
 Please make sure that @samp{XEmacs FAQ} appears on the Subject: line.
 If you think you have a better way of answering a question, or think a
 question should be included, we'd like to hear about it.  Questions and
-answers included into the FAQ will be edited for spelling and grammar,
+answers included into the FAQ will be edited for spelling and grammar
 and will be attributed.  Answers appearing without attribution are
-either from versions of the FAQ dated before May 1996, or are from one
-of the four people listed at the top of this document.  Answers quoted
-from Usenet news articles will always be attributed, regardless of the
-author.
+either from versions of the FAQ dated before May 1996 or are from
+previous FAQ maintainers.  Answers quoted from Usenet news articles will
+always be attributed, regardless of the author.
 
 @node Q1.1.2, Q1.1.3, Q1.1.1, Introduction
 @unnumberedsubsec Q1.1.2: How do I become a Beta Tester?
@@ -913,80 +905,16 @@ crash some time ago.
 
 @node Q1.3.1, Q1.3.2, Q1.2.3, Introduction
 @unnumberedsec 1.3: Internationalization
-@unnumberedsubsec Q1.3.1: What is the status of XEmacs v20?
-
-XEmacs v20 is the version of XEmacs that includes MULE (Asian-language)
-support.  XEmacs 20.0 was released in February 1997, followed by XEmacs
-20.2 in May, XEmacs 20.3 in November and XEmacs 20.4 in February 1998.  When compiled without MULE
-support, 20.4 is approximately as stable as 19.16, and probably faster
-(due to additional optimization work.)
-
-As of XEmacs 20.3, version 20 is @emph{the} supported version of
-XEmacs.  This means that 19.16 will optionally receive stability fixes
-(if any), but that all the real development work will be done on the v20
-tree.
-
-The incompatible changes in XEmacs 20 include the additional byte-codes,
-new primitive data types (@code{character}, @code{char-table}, and
-@code{range-table}).  This means that the character-integer equivalence
-inherent to all the previous Emacs and XEmacs releases no longer
-applies.
-
-However, to avoid breaking old code, many functions that should normally
-accept characters work with integers, and vice versa.  For more
-information, see the Lisp reference manual.  Here is a relevant excerpt,
-for your convenience.
+@unnumberedsubsec Q1.3.1: What is the status of internationalization support aka MULE (including Asian language support?
 
-@quotation
-  In XEmacs version 19, and in all versions of FSF GNU Emacs, a
-@dfn{character} in XEmacs Lisp is nothing more than an integer.
-This is yet another holdover from XEmacs Lisp's derivation from
-vintage-1980 Lisps; modern versions of Lisp consider this equivalence
-a bad idea, and have separate character types.  In XEmacs version 20,
-the modern convention is followed, and characters are their own
-primitive types. (This change was necessary in order for @sc{mule},
-i.e. Asian-language, support to be correctly implemented.)
-
-  Even in XEmacs version 20, remnants of the equivalence between
-characters and integers still exist; this is termed the @dfn{char-int
-confoundance disease}.  In particular, many functions such as @code{eq},
-@code{equal}, and @code{memq} have equivalent functions (@code{old-eq},
-@code{old-equal}, @code{old-memq}, etc.) that pretend like characters
-are integers are the same.  Byte code compiled under any version 19
-Emacs will have all such functions mapped to their @code{old-} equivalents
-when the byte code is read into XEmacs 20.  This is to preserve
-compatibility---Emacs 19 converts all constant characters to the equivalent
-integer during byte-compilation, and thus there is no other way to preserve
-byte-code compatibility even if the code has specifically been written
-with the distinction between characters and integers in mind.
-
-  Every character has an equivalent integer, called the @dfn{character
-code}.  For example, the character @kbd{A} is represented as the
-@w{integer 65}, following the standard @sc{ascii} representation of
-characters.  If XEmacs was not compiled with @sc{mule} support, the
-range of this integer will always be 0 to 255---eight bits, or one
-byte. (Integers outside this range are accepted but silently truncated;
-however, you should most decidedly @emph{not} rely on this, because it
-will not work under XEmacs with @sc{mule} support.)  When @sc{mule}
-support is present, the range of character codes is much
-larger. (Currently, 19 bits are used.)
-
-  FSF GNU Emacs uses kludgy character codes above 255 to represent
-keyboard input of @sc{ascii} characters in combination with certain
-modifiers.  XEmacs does not use this (a more general mechanism is
-used that does not distinguish between @sc{ascii} keys and other
-keys), so you will never find character codes above 255 in a
-non-@sc{mule} XEmacs.
-
-  Individual characters are not often used in programs.  It is far more
-common to work with @emph{strings}, which are sequences composed of
-characters.
-@end quotation
+Both the stable and development versions of XEmacs include
+internationalization support (aka MULE).  MULE currently works on UNIX
+and Linux systems; work for supporting MULE on Windows operating systems
+is in progress.  Binaries compiled without MULE support run faster than
+MULE capable XEmacsen.
 
 @node Q1.3.2, Q1.3.3, Q1.3.1, Introduction
-@unnumberedsubsec Q1.3.2: What is the status of Asian-language support, aka MULE?
-
-MULE support is now available for UNIX versions of XEmacs.
+@unnumberedsubsec Q1.3.2: How can I help with internationalization?
 
 If you would like to help, you may want to join the
 @email{xemacs-mule@@xemacs.org} mailing list.  Especially needed are
@@ -1005,7 +933,7 @@ See question 3.5.7 (@pxref{Q3.5.7}) in part 3 of this FAQ.
 
 The message-catalog support has mostly been written but doesn't
 currently work.  The first release of XEmacs 20 will @emph{not} support
-it.  However, menubar localization @emph{does} work, even in 19.14.  To
+it.  However, menubar localization @emph{does} work.  To
 enable it, add to your @file{Emacs} file entries like this:
 
 @example
@@ -1018,7 +946,7 @@ The name of the resource is derived from the non-localized entry by
 removing punctuation and capitalizing as above.
 
 @node Q1.3.5, Q1.3.6, Q1.3.4, Introduction
-@unnumberedsubsec Q1.3.5: Please explain the various input methods in MULE/XEmacs 20.0
+@unnumberedsubsec Q1.3.5: Please explain the various input methods in MULE/XEmacs
 
 @email{morioka@@jaist.ac.jp, MORIOKA Tomohiko} writes:
 
@@ -1069,7 +997,7 @@ it will be continued.
 @end quotation
 
 @node Q1.3.6, Q1.3.7, Q1.3.5, Introduction
-@unnumberedsubsec Q1.3.6: How do I portably code for MULE/XEmacs 20?
+@unnumberedsubsec Q1.3.6: How do I portably code for MULE/XEmacs?
 
 @email{morioka@@jaist.ac.jp, MORIOKA Tomohiko} writes:
 
@@ -1315,8 +1243,8 @@ Trouble Shooting:
 @node Q2.0.1, Q2.0.2, Installation, Installation
 @unnumberedsec 2.0: Installation
 @unnumberedsubsec Q2.0.1: Running XEmacs without installing
-The @file{INSTALL} file says that up to 108 MB of space is needed
-temporarily during installation!  How can I just try it out?
+
+How can I just try XEmacs without installing it?
 
 XEmacs will run in place without requiring installation and copying of
 the Lisp directories, and without having to specify a special build-time
@@ -1337,98 +1265,13 @@ This will let you run XEmacs without massive copying.
 @node Q2.0.2, Q2.0.3, Q2.0.1, Installation
 @unnumberedsubsec Q2.0.2: XEmacs is too big
 
-Although this entry has been written for XEmacs 19.13, most of it still
-stands true.
-
-@email{steve@@xemacs.org, Steve Baur} writes:
-
-@quotation
-The 45MB of space required by the installation directories can be
+The space required by the installation directories can be
 reduced dramatically if desired.  Gzip all the .el files.  Remove all
-the packages you'll never want to use (or even ones you do like the two
-obsolete mailcrypts and Gnus 4 in 19.13).  Remove the TexInfo manuals.
+the packages you'll never want to use.  Remove the TexInfo manuals.
 Remove the Info (and use just hardcopy versions of the manual).  Remove
 most of the stuff in etc.  Remove or gzip all the source code.  Gzip or
 remove the C source code.  Configure it so that copies are not made of
-the support lisp.  I'm not advocating any of these things, just pointing
-out ways to reduce the disk requirements if desired.
-
-Now examine the space used by directory:
-
-@format
-0       /usr/local/bin/xemacs
-2048    /usr/local/bin/xemacs-19.13
-
-1546    /usr/local/lib/xemacs-19.13/i486-miranova-sco3.2v4.2
-1158    /usr/local/lib/xemacs-19.13/i486-unknown-linux1.2.13
-@end format
-
-You need to keep these.  XEmacs isn't stripped by default in
-installation, you should consider stripping.  That will save you about
-5MB right there.
-
-@format
-207     /usr/local/lib/xemacs-19.13/etc/w3
-122     /usr/local/lib/xemacs-19.13/etc/sounds
-18      /usr/local/lib/xemacs-19.13/etc/sparcworks
-159     /usr/local/lib/xemacs-19.13/etc/vm
-6       /usr/local/lib/xemacs-19.13/etc/e
-21      /usr/local/lib/xemacs-19.13/etc/eos
-172     /usr/local/lib/xemacs-19.13/etc/toolbar
-61      /usr/local/lib/xemacs-19.13/etc/ns
-43      /usr/local/lib/xemacs-19.13/etc/gnus
-@end format
-
-These are support directories for various packages.  In general they
-match a directory under ./xemacs-19.13/lib/xemacs-19.13/lisp/.  If you
-do not require the package, you may delete or gzip the support too.
-
-@format
-1959    /usr/local/lib/xemacs-19.13/etc
-175     /usr/local/lib/xemacs-19.13/lisp/bytecomp
-340     /usr/local/lib/xemacs-19.13/lisp/calendar
-342     /usr/local/lib/xemacs-19.13/lisp/comint
-517     /usr/local/lib/xemacs-19.13/lisp/dired
-42      /usr/local/lib/xemacs-19.13/lisp/electric
-212     /usr/local/lib/xemacs-19.13/lisp/emulators
-238     /usr/local/lib/xemacs-19.13/lisp/energize
-289     /usr/local/lib/xemacs-19.13/lisp/gnus
-457     /usr/local/lib/xemacs-19.13/lisp/ilisp
-1439    /usr/local/lib/xemacs-19.13/lisp/modes
-2276    /usr/local/lib/xemacs-19.13/lisp/packages
-1040    /usr/local/lib/xemacs-19.13/lisp/prim
-176     /usr/local/lib/xemacs-19.13/lisp/pcl-cvs
-154     /usr/local/lib/xemacs-19.13/lisp/rmail
-3       /usr/local/lib/xemacs-19.13/lisp/epoch
-45      /usr/local/lib/xemacs-19.13/lisp/term
-860     /usr/local/lib/xemacs-19.13/lisp/utils
-851     /usr/local/lib/xemacs-19.13/lisp/vm
-13      /usr/local/lib/xemacs-19.13/lisp/vms
-157     /usr/local/lib/xemacs-19.13/lisp/x11
-19      /usr/local/lib/xemacs-19.13/lisp/tooltalk
-14      /usr/local/lib/xemacs-19.13/lisp/sunpro
-291     /usr/local/lib/xemacs-19.13/lisp/games
-198     /usr/local/lib/xemacs-19.13/lisp/edebug
-619     /usr/local/lib/xemacs-19.13/lisp/w3
-229     /usr/local/lib/xemacs-19.13/lisp/eos
-55      /usr/local/lib/xemacs-19.13/lisp/iso
-59      /usr/local/lib/xemacs-19.13/lisp/mailcrypt
-187     /usr/local/lib/xemacs-19.13/lisp/eterm
-356     /usr/local/lib/xemacs-19.13/lisp/ediff
-408     /usr/local/lib/xemacs-19.13/lisp/hyperbole/kotl
-1262    /usr/local/lib/xemacs-19.13/lisp/hyperbole
-247     /usr/local/lib/xemacs-19.13/lisp/hm--html-menus
-161     /usr/local/lib/xemacs-19.13/lisp/mh-e
-299     /usr/local/lib/xemacs-19.13/lisp/viper
-53      /usr/local/lib/xemacs-19.13/lisp/oobr/tree-x
-4       /usr/local/lib/xemacs-19.13/lisp/oobr/tree-nx/English.lproj/DocWindow.nib
-3       /usr/local/lib/xemacs-19.13/lisp/oobr/tree-nx/English.lproj/InfoPanel.nib
-3       /usr/local/lib/xemacs-19.13/lisp/oobr/tree-nx/English.lproj/TreeView.nib
-11      /usr/local/lib/xemacs-19.13/lisp/oobr/tree-nx/English.lproj
-53      /usr/local/lib/xemacs-19.13/lisp/oobr/tree-nx
-466     /usr/local/lib/xemacs-19.13/lisp/oobr
-14142   /usr/local/lib/xemacs-19.13/lisp
-@end format
+the support lisp.  
 
 These are all Emacs Lisp source code and bytecompiled object code.  You
 may safely gzip everything named *.el here.  You may remove any package
@@ -1436,81 +1279,24 @@ you don't use.  @emph{Nothing bad will happen if you delete a package
 that you do not use}.  You must be sure you do not use it though, so be
 conservative at first.
 
-Possible candidates for deletion include w3 (newer versions exist, or
-you may just use Lynx or Netscape for web browsing), games, hyperbole,
-mh-e, hm--html-menus (better packages exist), vm, viper, oobr, gnus (new
-versions exist), etc.  Ask yourself, @emph{Do I ever want to use this
-package?}  If the answer is no, then it is a candidate for removal.
+Possible candidates for deletion include w3, games, hyperbole, mh-e,
+hm-html-menus, vm, viper, oobr, gnus, etc.  Ask yourself, @emph{Do I
+ever want to use this package?}  If the answer is no, then it is a
+candidate for removal.
 
 First, gzip all the .el files.  Then go about package by package and
 start gzipping the .elc files.  Then run XEmacs and do whatever it is
 you normally do.  If nothing bad happens, then delete the directory.  Be
 conservative about deleting directories, and it would be handy to have a
-backup tape around in case you get too zealous.
+backup around in case you get too zealous.
 
 @file{prim}, @file{modes}, @file{packages}, and @file{utils} are four
 directories you definitely do @strong{not} want to delete, although
 certain packages can be removed from them if you do not use them.
 
-@example
-1972    /usr/local/lib/xemacs-19.13/info
-@end example
-
-These are online texinfo sources.  You may either gzip them or remove
-them.  In either case, @kbd{C-h i} (info mode) will no longer work.
-
-@example
-20778   /usr/local/lib/xemacs-19.13
-@end example
-
-The 20MB achieved is less than half of what the full distribution takes up,
-@strong{and} can be achieved without deleting a single file.
-@end quotation
-
-@email{boffi@@hp735.stru.polimi.it, Giacomo Boffi} provides this procedure:
-
-@quotation
-Substitute @file{/usr/local/lib/} with the path where the xemacs tree is
-rooted, then use this script:
-
-@example
-#!/bin/sh
-
-r=/usr/local/lib/xemacs-19.13/lisp
-
-cd $r ; rm -f cmpr ; touch cmpr
-
-du -s .
-
-for d in * ; do
-  if test -d $d ; then
-    cd $d
-    for f in *.el ; do
-#     compress (remove) only (ONLY) the sources that have a
-#     corresponding compiled file --- do not (DO NOT)
-#     touch other sources
-      if test -f $@{f@}c ; then gzip -v9 $f >> $r/cmpr ; fi
-    done
-    cd ..
-  fi
-done
-
-du -s .
-@end example
-
-A step beyond would be substituting @samp{rm -f} for @samp{gzip -v9},
-but you have to be desperate for removing the sources (remember that
-emacs can access compressed files transparently).
-
-Also, a good megabyte could easily be trimmed from the $r/../etc
-directory, e.g., the termcap files, some O+NEWS, others that I don't
-remember as well.
-@end quotation
-
-@quotation
-XEmacs 21.0 will unbundle the lisp hierarchy and allow the installer
-to choose exactly how much support code gets installed.
-@end quotation
+Online texinfo sources in the @file{info} can either be compressed them
+or remove them.  In either case, @kbd{C-h i} (info mode) will no longer
+work.
 
 @node Q2.0.3, Q2.0.4, Q2.0.2, Installation
 @unnumberedsubsec Q2.0.3: Compiling XEmacs with Netaudio.
@@ -1567,9 +1353,8 @@ bad pointer, perhaps to a CD-ROM that is not inserted.
 @unnumberedsubsec Q2.0.5: Do I need X11 to run XEmacs?
 
 No.  The name @dfn{XEmacs} is unfortunate in the sense that it is
-@strong{not} an X Window System-only version of Emacs.  Starting with
-19.14 XEmacs has full color support on a color-capable character
-terminal.
+@strong{not} an X Window System-only version of Emacs.  XEmacs has
+full color support on a color-capable character terminal.
 
 @node Q2.0.6, Q2.0.7, Q2.0.5, Installation
 @unnumberedsubsec Q2.0.6: I'm having strange crashes.  What do I do?
@@ -4871,7 +4656,7 @@ Emacs Lisp Programming Techniques:
 * Q5.1.4::      What is the performance hit of @code{let}?
 * Q5.1.5::      What is the recommended use of @code{setq}?
 * Q5.1.6::      What is the typical misuse of @code{setq}?
-* Q5.1.7::      I like the the @code{do} form of cl, does it slow things down?
+* Q5.1.7::      I like the @code{do} form of cl, does it slow things down?
 * Q5.1.8::      I like recursion, does it slow things down?
 * Q5.1.9::      How do I put a glyph as annotation in a buffer?
 * Q5.1.10::     @code{map-extents} won't traverse all of my extents!
@@ -5521,7 +5306,7 @@ While compiling toplevel forms:
 @end lisp
 
 @node Q5.1.7, Q5.1.8, Q5.1.6, Miscellaneous
-@unnumberedsubsec Q5.1.7: I like the the @code{do} form of cl, does it slow things down?
+@unnumberedsubsec Q5.1.7: I like the @code{do} form of cl, does it slow things down?
 
 It shouldn't.  Here is what Dave Gillespie has to say about cl.el
 performance:
index 71d0aa5..5be3610 100644 (file)
@@ -749,7 +749,7 @@ long file that contains no page markers and has no local variables list.
 list.  That is inappropriate.  Whether you use Auto Fill mode or not is
 a matter of personal taste, not a matter of the contents of particular
 files.  If you want to use Auto Fill, set up major mode hooks with your
-file file to turn it on (when appropriate) for you alone
+init file to turn it on (when appropriate) for you alone
 (@pxref{Init File}).  Don't try to use a local variable list that would
 impose your taste on everyone working with the file.
 
@@ -2493,13 +2493,27 @@ proper, it does not use the face mechanism for specifying fonts and
 colors: It uses whatever resources are appropriate to the type of widget
 which is used to implement it.
 
-If Emacs was compiled to use only the Motif-lookalike menu widgets, then one
-way to specify the font of the menubar would be
+If Emacs was compiled to use only the Lucid Motif-lookalike menu widgets,
+then one way to specify the font of the menubar would be
 
 @example
 Emacs*menubar*font: *-courier-medium-r-*-*-*-120-*-*-*-*-*-*
 @end example
 
+If both the Lucid Motif-lookalike menu widgets and X Font Sets are 
+configured to allow multilingual menubars, then one uses
+
+@example
+*menubar*FontSet:       -*-helvetica-bold-r-*-*-*-120-*-*-*-*-iso8859-*, \
+                        -*-*-*-*-*-*-*-120-*-jisx0208.1983-0
+@end example
+
+That would specify fonts for a Japanese menubar.  Specifying only one
+XLFD is acceptable; specifying more than one for a given registry
+(language) is also allowed.  When X Font Sets are configured, some .font
+resources (eg, menubars) are ignored in favor of the corresponding
+.fontSet resources.
+
 If the Motif library is being used, then one would have to use 
 
 @example
index cc748b6..83281b3 100644 (file)
@@ -261,7 +261,7 @@ echo area, accompanied by a beep.
 keyboards lacking a @key{META} key.  Unlike the @key{META} key (which,
 like the @key{SHIFT} key, is held down while another character is
 typed), the @key{ESC} key is pressed and released, and applies to the
-next character typed. 
+next character typed.
 
 @item Fill Prefix
 The fill prefix is a string that Emacs enters at the beginning
@@ -621,7 +621,7 @@ Emacs, you have to save it.  @xref{Saving}.
 
 @item Scrolling
 Scrolling means shifting the text in the Emacs window to make a
-different part ot the buffer visible.  @xref{Display,Scrolling}.
+different part of the buffer visible.  @xref{Display,Scrolling}.
 
 @item Searching
 Searching means moving point to the next occurrence of a specified
@@ -682,7 +682,7 @@ definitions in one or more other files.  @xref{Tags}.
 A termscript file contains a record of all characters Emacs sent to
 the terminal.  It is used for tracking down bugs in Emacs redisplay.
 Emacs does not make a termscript file unless explicitly instructed to do
-so. 
+so.
 @xref{Bugs}.
 
 @item Text
@@ -749,7 +749,7 @@ display the contents of one buffer (q.v.@:) at any time.
 @xref{Windows}, for commands to control the use of windows. Note that if
 you are running Emacs under X, terminology can be confusing: Each Emacs
 frame occupies a separate X window and can, in turn, be divided into
-different subwindows. 
+different subwindows.
 
 @item Word Abbrev
 Synonymous with `abbrev'.
index 3d6f187..a6c62f6 100644 (file)
@@ -441,7 +441,7 @@ full details on the complete absence of warranty for XEmacs.  @kbd{C-h
 n} (@code{view-emacs-news}) displays the file @file{xemacs/etc/NEWS},
 which contains documentation on XEmacs changes arranged chronologically.
 @kbd{C-h F} (@code{xemacs-local-faq}) displays local version of the
-XEmacs frequentliy-answered-questions-list.  @kbd{C-h t}
+XEmacs frequently-answered-questions-list.  @kbd{C-h t}
 (@code{help-with-tutorial}) displays the learn-by-doing XEmacs
 tutorial. @kbd{C-h C-c} (@code{describe-copying}) displays the file
 @file{xemacs/etc/COPYING}, which tells you the conditions you must obey
index 66cb453..1eaa18b 100644 (file)
@@ -19,7 +19,7 @@ world scripts, including Latin script, as well as Arabic script,
 Simplified Chinese script (for mainland of China), Traditional Chinese
 script (for Taiwan and Hong-Kong), Greek script, Hebrew script, IPA
 symbols, Japanese scripts (Hiragana, Katakana and Kanji), Korean scripts
-(Hangul and Hanja) and Cyrillic script (for Beylorussian, Bulgarian,
+(Hangul and Hanja) and Cyrillic script (for Byelorussian, Bulgarian,
 Russian, Serbian and Ukrainian).  These features have been merged from
 the modified version of Emacs known as MULE (for ``MULti-lingual
 Enhancement to GNU Emacs'').
index ab72126..ea892d0 100644 (file)
@@ -77,7 +77,7 @@ only if the next command you want to type is a printing character,
 within searches (@kbd{C-q}, @kbd{C-w}, @kbd{C-r}, @kbd{C-s}, or @kbd{C-y}).
 
   Sometimes you search for @samp{FOO} and find it, but were actually
-looking for a different occurence of it.  To move to the next occurrence
+looking for a different occurrence of it.  To move to the next occurrence
 of the search string, type another @kbd{C-s}.  Do this as often as
 necessary.  If you overshoot, you can cancel some @kbd{C-s}
 characters with @key{DEL}.
@@ -330,12 +330,30 @@ is the traditional Emacs sequence of keys for word search.
 @cindex regexp
 
   A @dfn{regular expression} (@dfn{regexp}, for short) is a pattern that
-denotes a set of strings, possibly an infinite set.  Searching for matches
+denotes a (possibly infinite) set of strings.  Searching for matches
 for a regexp is a powerful operation that editors on Unix systems have
-traditionally offered.  In XEmacs, you can search for the next match for
-a regexp either incrementally or not.
+traditionally offered.
+
+ To gain a thorough understanding of regular expressions and how to use
+them to best advantage, we recommend that you study @cite{Mastering
+Regular Expressions, by Jeffrey E.F. Friedl, O'Reilly and Associates,
+1997}. (It's known as the "Hip Owls" book, because of the picture on its
+cover.)  You might also read the manuals to @ref{(gawk)Top},
+@ref{(ed)Top}, @cite{sed}, @cite{grep}, @ref{(perl)Top},
+@ref{(regex)Top}, @ref{(rx)Top}, @cite{pcre}, and @ref{(flex)Top}, which
+also make good use of regular expressions.
+
+ The XEmacs regular expression syntax most closely resembles that of
+@cite{ed}, or @cite{grep}, the GNU versions of which all utilize the GNU
+@cite{regex} library.  XEmacs' version of @cite{regex} has recently been
+extended with some Perl--like capabilities, described in the next
+section.
+
+ In XEmacs, you can search for the next match for a regexp either
+incrementally or not.
 
 @kindex M-C-s
+@kindex M-C-r
 @findex isearch-forward-regexp
 @findex isearch-backward-regexp
   Incremental search for a regexp is done by typing @kbd{M-C-s}
@@ -344,7 +362,7 @@ incrementally just like @kbd{C-s}, but it treats the search string as a
 regexp rather than looking for an exact match against the text in the
 buffer.  Each time you add text to the search string, you make the regexp
 longer, and the new regexp is searched for.  A reverse regexp search command
-@code{isearch-backward-regexp} also exists, but no key runs it.
+@code{isearch-backward-regexp} also exists, bound to @kbd{M-C-r}.
 
   All of the control characters that do special things within an ordinary
 incremental search have the same functionality in incremental regexp search.
@@ -358,151 +376,227 @@ incremental regexp and non-regexp searches have independent defaults.
 @code{re-search-forward} and @code{re-search-backward}.  You can invoke
 them with @kbd{M-x} or bind them to keys.  You can also call
 @code{re-search-forward} by way of incremental regexp search with
-@kbd{M-C-s @key{RET}}.
+@kbd{M-C-s @key{RET}}; similarly for @code{re-search-backward} with
+@kbd{M-C-r @key{RET}}.
 
 @node Regexps, Search Case, Regexp Search, Search
 @section Syntax of Regular Expressions
 
-Regular expressions have a syntax in which a few characters are special
-constructs and the rest are @dfn{ordinary}.  An ordinary character is a
-simple regular expression which matches that character and nothing else.
-The special characters are @samp{$}, @samp{^}, @samp{.}, @samp{*},
-@samp{+}, @samp{?}, @samp{[}, @samp{]} and @samp{\}; no new special
-characters will be defined.  Any other character appearing in a regular
-expression is ordinary, unless a @samp{\} precedes it.@refill
+  Regular expressions have a syntax in which a few characters are
+special constructs and the rest are @dfn{ordinary}.  An ordinary
+character is a simple regular expression that matches that character and
+nothing else.  The special characters are @samp{.}, @samp{*}, @samp{+},
+@samp{?}, @samp{[}, @samp{]}, @samp{^}, @samp{$}, and @samp{\}; no new
+special characters will be defined in the future.  Any other character
+appearing in a regular expression is ordinary, unless a @samp{\}
+precedes it.
 
 For example, @samp{f} is not a special character, so it is ordinary, and
-therefore @samp{f} is a regular expression that matches the string @samp{f}
-and no other string.  (It does @i{not} match the string @samp{ff}.)  Likewise,
-@samp{o} is a regular expression that matches only @samp{o}.@refill
+therefore @samp{f} is a regular expression that matches the string
+@samp{f} and no other string.  (It does @emph{not} match the string
+@samp{ff}.)  Likewise, @samp{o} is a regular expression that matches
+only @samp{o}.@refill
 
 Any two regular expressions @var{a} and @var{b} can be concatenated.  The
-result is a regular expression which matches a string if @var{a} matches
+result is a regular expression that matches a string if @var{a} matches
 some amount of the beginning of that string and @var{b} matches the rest of
 the string.@refill
 
-As a simple example, you can concatenate the regular expressions @samp{f}
+As a simple example, we can concatenate the regular expressions @samp{f}
 and @samp{o} to get the regular expression @samp{fo}, which matches only
-the string @samp{fo}.  To do something nontrivial, you
-need to use one of the following special characters:
+the string @samp{fo}.  Still trivial.  To do something more powerful, you
+need to use one of the special characters.  Here is a list of them:
 
+@need 1200
 @table @kbd
 @item .@: @r{(Period)}
+@cindex @samp{.} in regexp
 is a special character that matches any single character except a newline.
-Using concatenation, you can make regular expressions like @samp{a.b}, which
-matches any three-character string which begins with @samp{a} and ends with
+Using concatenation, we can make regular expressions like @samp{a.b}, which
+matches any three-character string that begins with @samp{a} and ends with
 @samp{b}.@refill
 
 @item *
-is not a construct by itself; it is a suffix, which means the
-preceding regular expression is to be repeated as many times as
+@cindex @samp{*} in regexp
+is not a construct by itself; it is a quantifying suffix operator that
+means to repeat the preceding regular expression as many times as
 possible.  In @samp{fo*}, the @samp{*} applies to the @samp{o}, so
 @samp{fo*} matches one @samp{f} followed by any number of @samp{o}s.
 The case of zero @samp{o}s is allowed: @samp{fo*} does match
 @samp{f}.@refill
 
-@samp{*} always applies to the @i{smallest} possible preceding
+@samp{*} always applies to the @emph{smallest} possible preceding
 expression.  Thus, @samp{fo*} has a repeating @samp{o}, not a
 repeating @samp{fo}.@refill
 
-The matcher processes a @samp{*} construct by immediately matching
-as many repetitions as it can find.  Then it continues with the rest
-of the pattern.  If that fails, backtracking occurs, discarding some
-of the matches of the @samp{*}-modified construct in case that makes
-it possible to match the rest of the pattern.  For example, matching
-@samp{ca*ar} against the string @samp{caaar}, the @samp{a*} first
-tries to match all three @samp{a}s; but the rest of the pattern is
-@samp{ar} and there is only @samp{r} left to match, so this try fails.
-The next alternative is for @samp{a*} to match only two @samp{a}s.
-With this choice, the rest of the regexp matches successfully.@refill
+The matcher processes a @samp{*} construct by matching, immediately, as
+many repetitions as can be found; it is "greedy".  Then it continues
+with the rest of the pattern.  If that fails, backtracking occurs,
+discarding some of the matches of the @samp{*}-modified construct in
+case that makes it possible to match the rest of the pattern.  For
+example, in matching @samp{ca*ar} against the string @samp{caaar}, the
+@samp{a*} first tries to match all three @samp{a}s; but the rest of the
+pattern is @samp{ar} and there is only @samp{r} left to match, so this
+try fails.  The next alternative is for @samp{a*} to match only two
+@samp{a}s.  With this choice, the rest of the regexp matches
+successfully.@refill
+
+Nested repetition operators can be extremely slow if they specify
+backtracking loops.  For example, it could take hours for the regular
+expression @samp{\(x+y*\)*a} to match the sequence
+@samp{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxz}.  The slowness is because
+Emacs must try each imaginable way of grouping the 35 @samp{x}'s before
+concluding that none of them can work.  To make sure your regular
+expressions run fast, check nested repetitions carefully.
 
 @item +
-is a suffix character similar to @samp{*} except that it requires that
-the preceding expression be matched at least once.  For example,
-@samp{ca+r} will match the strings @samp{car} and @samp{caaaar}
-but not the string @samp{cr}, whereas @samp{ca*r} would match all
-three strings.@refill
+@cindex @samp{+} in regexp
+is a quantifying suffix operator similar to @samp{*} except that the
+preceding expression must match at least once.  It is also "greedy".
+So, for example, @samp{ca+r} matches the strings @samp{car} and
+@samp{caaaar} but not the string @samp{cr}, whereas @samp{ca*r} matches
+all three strings.
 
 @item ?
-is a suffix character similar to @samp{*} except that it can match the
-preceding expression either once or not at all.  For example,
-@samp{ca?r} will match @samp{car} or @samp{cr}; nothing else.
+@cindex @samp{?} in regexp
+is a quantifying suffix operator similar to @samp{*}, except that the
+preceding expression can match either once or not at all.  For example,
+@samp{ca?r} matches @samp{car} or @samp{cr}, but does not match anything
+else.
+
+@item *?
+@cindex @samp{*?} in regexp
+works just like @samp{*}, except that rather than matching the longest
+match, it matches the shortest match.  @samp{*?} is known as a
+@dfn{non-greedy} quantifier, a regexp construct borrowed from Perl.
+@c Did perl get this from somewhere?  What's the real history of *? ?
+
+This construct is very useful for when you want to match the text inside
+a pair of delimiters.  For instance, @samp{/\*.*?\*/} will match C
+comments in a string.  This could not easily be achieved without the use
+of a non-greedy quantifier.
+
+This construct has not been available prior to XEmacs 20.4.  It is not
+available in FSF Emacs.
+
+@item +?
+@cindex @samp{+?} in regexp
+is the non-greedy version of @samp{+}.
+
+@item ??
+@cindex @samp{??} in regexp
+is the non-greedy version of @samp{?}.
+
+@item \@{n,m\@}
+@c Note the spacing after the close brace is deliberate.
+@cindex @samp{\@{n,m\@} }in regexp
+serves as an interval quantifier, analogous to @samp{*} or @samp{+}, but
+specifies that the expression must match at least @var{n} times, but no
+more than @var{m} times.  This syntax is supported by most Unix regexp
+utilities, and has been introduced to XEmacs for the version 20.3.
+
+Unfortunately, the non-greedy version of this quantifier does not exist
+currently, although it does in Perl.
 
 @item [ @dots{} ]
+@cindex character set (in regexp)
+@cindex @samp{[} in regexp
+@cindex @samp{]} in regexp
 @samp{[} begins a @dfn{character set}, which is terminated by a
-@samp{]}.  In the simplest case, the characters between the two form
-the set.  Thus, @samp{[ad]} matches either one @samp{a} or one
-@samp{d}, and @samp{[ad]*} matches any string composed of just
-@samp{a}s and @samp{d}s (including the empty string), from which it
-follows that @samp{c[ad]*r} matches @samp{cr}, @samp{car}, @samp{cdr},
+@samp{]}.  In the simplest case, the characters between the two brackets
+form the set.  Thus, @samp{[ad]} matches either one @samp{a} or one
+@samp{d}, and @samp{[ad]*} matches any string composed of just @samp{a}s
+and @samp{d}s (including the empty string), from which it follows that
+@samp{c[ad]*r} matches @samp{cr}, @samp{car}, @samp{cdr},
 @samp{caddaar}, etc.@refill
 
-You can include character ranges in a character set by writing two
+The usual regular expression special characters are not special inside a
+character set.  A completely different set of special characters exists
+inside character sets: @samp{]}, @samp{-} and @samp{^}.@refill
+
+@samp{-} is used for ranges of characters.  To write a range, write two
 characters with a @samp{-} between them.  Thus, @samp{[a-z]} matches any
-lower-case letter.  Ranges may be intermixed freely with individual
-characters, as in @samp{[a-z$%.]}, which matches any lower-case letter
-or @samp{$}, @samp{%}, or period.
-@refill
+lower case letter.  Ranges may be intermixed freely with individual
+characters, as in @samp{[a-z$%.]}, which matches any lower case letter
+or @samp{$}, @samp{%}, or a period.@refill
 
-Note that inside a character set the usual special characters are not
-special any more.  A completely different set of special characters
-exists inside character sets: @samp{]}, @samp{-}, and @samp{^}.@refill
+To include a @samp{]} in a character set, make it the first character.
+For example, @samp{[]a]} matches @samp{]} or @samp{a}.  To include a
+@samp{-}, write @samp{-} as the first character in the set, or put it
+immediately after a range.  (You can replace one individual character
+@var{c} with the range @samp{@var{c}-@var{c}} to make a place to put the
+@samp{-}.)  There is no way to write a set containing just @samp{-} and
+@samp{]}.
 
-To include a @samp{]} in a character set, you must make it the first
-character.  For example, @samp{[]a]} matches @samp{]} or @samp{a}.  To
-include a @samp{-}, write @samp{---}, which is a range containing only
-@samp{-}.  To include @samp{^}, make it other than the first character
-in the set.@refill
+To include @samp{^} in a set, put it anywhere but at the beginning of
+the set.
 
 @item [^ @dots{} ]
+@cindex @samp{^} in regexp
 @samp{[^} begins a @dfn{complement character set}, which matches any
 character except the ones specified.  Thus, @samp{[^a-z0-9A-Z]}
-matches all characters @i{except} letters and digits.@refill
+matches all characters @emph{except} letters and digits.@refill
 
 @samp{^} is not special in a character set unless it is the first
 character.  The character following the @samp{^} is treated as if it
-were first (@samp{-} and @samp{]} are not special there).
+were first (thus, @samp{-} and @samp{]} are not special there).
 
 Note that a complement character set can match a newline, unless
 newline is mentioned as one of the characters not to match.
 
 @item ^
-is a special character that matches the empty string, but only if at
-the beginning of a line in the text being matched.  Otherwise, it fails
-to match anything.  Thus, @samp{^foo} matches a @samp{foo} that occurs
-at the beginning of a line.
+@cindex @samp{^} in regexp
+@cindex beginning of line in regexp
+is a special character that matches the empty string, but only at the
+beginning of a line in the text being matched.  Otherwise it fails to
+match anything.  Thus, @samp{^foo} matches a @samp{foo} that occurs at
+the beginning of a line.
+
+When matching a string instead of a buffer, @samp{^} matches at the
+beginning of the string or after a newline character @samp{\n}.
 
 @item $
+@cindex @samp{$} in regexp
 is similar to @samp{^} but matches only at the end of a line.  Thus,
-@samp{xx*$} matches a string of one @samp{x} or more at the end of a line.
+@samp{x+$} matches a string of one @samp{x} or more at the end of a line.
+
+When matching a string instead of a buffer, @samp{$} matches at the end
+of the string or before a newline character @samp{\n}.
 
 @item \
-does two things: it quotes the special characters (including
+@cindex @samp{\} in regexp
+has two functions: it quotes the special characters (including
 @samp{\}), and it introduces additional special constructs.
 
 Because @samp{\} quotes special characters, @samp{\$} is a regular
 expression that matches only @samp{$}, and @samp{\[} is a regular
-expression that matches only @samp{[}, and so on.@refill
+expression that matches only @samp{[}, and so on.
+
+@c Removed a paragraph here in lispref about doubling backslashes inside
+@c of Lisp strings.
+
 @end table
 
-Note: for historical compatibility, special characters are treated as
-ordinary ones if they are in contexts where their special meanings make no
-sense.  For example, @samp{*foo} treats @samp{*} as ordinary since there is
-no preceding expression on which the @samp{*} can act.  It is poor practice
-to depend on this behavior; better to quote the special character anyway,
-regardless of where is appears.@refill
+@strong{Please note:} For historical compatibility, special characters
+are treated as ordinary ones if they are in contexts where their special
+meanings make no sense.  For example, @samp{*foo} treats @samp{*} as
+ordinary since there is no preceding expression on which the @samp{*}
+can act.  It is poor practice to depend on this behavior; quote the
+special character anyway, regardless of where it appears.@refill
 
-Usually, @samp{\} followed by any character matches only
+For the most part, @samp{\} followed by any character matches only
 that character.  However, there are several exceptions: characters
-which, when preceded by @samp{\}, are special constructs.  Such
+that, when preceded by @samp{\}, are special constructs.  Such
 characters are always ordinary when encountered on their own.  Here
-is a table of @samp{\} constructs.
+is a table of @samp{\} constructs:
 
 @table @kbd
 @item \|
+@cindex @samp{|} in regexp
+@cindex regexp alternative
 specifies an alternative.
 Two regular expressions @var{a} and @var{b} with @samp{\|} in
-between form an expression that matches anything @var{a} or
+between form an expression that matches anything that either @var{a} or
 @var{b} matches.@refill
 
 Thus, @samp{foo\|bar} matches either @samp{foo} or @samp{bar}
@@ -515,6 +609,9 @@ surrounding @samp{\( @dots{} \)} grouping can limit the grouping power of
 Full backtracking capability exists to handle multiple uses of @samp{\|}.
 
 @item \( @dots{} \)
+@cindex @samp{(} in regexp
+@cindex @samp{)} in regexp
+@cindex regexp grouping
 is a grouping construct that serves three purposes:
 
 @enumerate
@@ -523,78 +620,126 @@ To enclose a set of @samp{\|} alternatives for other operations.
 Thus, @samp{\(foo\|bar\)x} matches either @samp{foox} or @samp{barx}.
 
 @item
-To enclose a complicated expression for the postfix @samp{*} to operate on.
-Thus, @samp{ba\(na\)*} matches @samp{bananana}, etc., with any (zero or
-more) number of @samp{na} strings.@refill
+To enclose an expression for a suffix operator such as @samp{*} to act
+on.  Thus, @samp{ba\(na\)*} matches @samp{bananana}, etc., with any
+(zero or more) number of @samp{na} strings.@refill
 
 @item
-To mark a matched substring for future reference.
-
+To record a matched substring for future reference.
 @end enumerate
 
 This last application is not a consequence of the idea of a
-parenthetical grouping; it is a separate feature which happens to be
+parenthetical grouping; it is a separate feature that happens to be
 assigned as a second meaning to the same @samp{\( @dots{} \)} construct
-because in practice there is no conflict between the two meanings.
-Here is an explanation:
+because there is no conflict in practice between the two meanings.
+Here is an explanation of this feature:
 
 @item \@var{digit}
-after the end of a @samp{\( @dots{} \)} construct, the matcher remembers the
-beginning and end of the text matched by that construct.  Then, later on
-in the regular expression, you can use @samp{\} followed by @var{digit}
-to mean ``match the same text matched the @var{digit}'th time by the
-@samp{\( @dots{} \)} construct.''@refill
-
-The strings matching the first nine @samp{\( @dots{} \)} constructs appearing
-in a regular expression are assigned numbers 1 through 9 in order that the
-open-parentheses appear in the regular expression.  @samp{\1} through
-@samp{\9} may be used to refer to the text matched by the corresponding
+matches the same text that matched the @var{digit}th occurrence of a
 @samp{\( @dots{} \)} construct.
 
+In other words, after the end of a @samp{\( @dots{} \)} construct.  the
+matcher remembers the beginning and end of the text matched by that
+construct.  Then, later on in the regular expression, you can use
+@samp{\} followed by @var{digit} to match that same text, whatever it
+may have been.
+
+The strings matching the first nine @samp{\( @dots{} \)} constructs
+appearing in a regular expression are assigned numbers 1 through 9 in
+the order that the open parentheses appear in the regular expression.
+So you can use @samp{\1} through @samp{\9} to refer to the text matched
+by the corresponding @samp{\( @dots{} \)} constructs.
+
 For example, @samp{\(.*\)\1} matches any newline-free string that is
 composed of two identical halves.  The @samp{\(.*\)} matches the first
 half, which may be anything, but the @samp{\1} that follows must match
 the same exact text.
 
+@item \(?: @dots{} \)
+@cindex @samp{\(?:} in regexp
+@cindex regexp grouping
+is called a @dfn{shy} grouping operator, and it is used just like
+@samp{\( @dots{} \)}, except that it does not cause the matched
+substring to be recorded for future reference.
+
+This is useful when you need a lot of grouping @samp{\( @dots{} \)}
+constructs, but only want to remember one or two -- or if you have
+more than nine groupings and need to use backreferences to refer to
+the groupings at the end.
+
+Using @samp{\(?: @dots{} \)} rather than @samp{\( @dots{} \)} when you
+don't need the captured substrings ought to speed up your programs some,
+since it shortens the code path followed by the regular expression
+engine, as well as the amount of memory allocation and string copying it
+must do.  The actual performance gain to be observed has not been
+measured or quantified as of this writing.
+@c This is used to good advantage by the font-locking code, and by
+@c `regexp-opt.el'.
+
+The shy grouping operator has been borrowed from Perl, and has not been
+available prior to XEmacs 20.3, nor is it available in FSF Emacs.
+
+@item \w
+@cindex @samp{\w} in regexp
+matches any word-constituent character.  The editor syntax table
+determines which characters these are.  @xref{Syntax}.
+
+@item \W
+@cindex @samp{\W} in regexp
+matches any character that is not a word constituent.
+
+@item \s@var{code}
+@cindex @samp{\s} in regexp
+matches any character whose syntax is @var{code}.  Here @var{code} is a
+character that represents a syntax code: thus, @samp{w} for word
+constituent, @samp{-} for whitespace, @samp{(} for open parenthesis,
+etc.  @xref{Syntax}, for a list of syntax codes and the characters that
+stand for them.
+
+@item \S@var{code}
+@cindex @samp{\S} in regexp
+matches any character whose syntax is not @var{code}.
+@end table
+
+  The following regular expression constructs match the empty string---that is,
+they don't use up any characters---but whether they match depends on the
+context.
+
+@table @kbd
 @item \`
-matches the empty string, provided it is at the beginning
-of the buffer.
+@cindex @samp{\`} in regexp
+matches the empty string, but only at the beginning
+of the buffer or string being matched against.
 
 @item \'
-matches the empty string, provided it is at the end of
-the buffer.
+@cindex @samp{\'} in regexp
+matches the empty string, but only at the end of
+the buffer or string being matched against.
+
+@item \=
+@cindex @samp{\=} in regexp
+matches the empty string, but only at point.
+(This construct is not defined when matching against a string.)
 
 @item \b
-matches the empty string, provided it is at the beginning or
+@cindex @samp{\b} in regexp
+matches the empty string, but only at the beginning or
 end of a word.  Thus, @samp{\bfoo\b} matches any occurrence of
 @samp{foo} as a separate word.  @samp{\bballs?\b} matches
 @samp{ball} or @samp{balls} as a separate word.@refill
 
 @item \B
-matches the empty string, provided it is @i{not} at the beginning or
+@cindex @samp{\B} in regexp
+matches the empty string, but @emph{not} at the beginning or
 end of a word.
 
 @item \<
-matches the empty string, provided it is at the beginning of a word.
+@cindex @samp{\<} in regexp
+matches the empty string, but only at the beginning of a word.
 
 @item \>
-matches the empty string, provided it is at the end of a word.
-
-@item \w
-matches any word-constituent character.  The editor syntax table
-determines which characters these are.
-
-@item \W
-matches any character that is not a word-constituent.
-
-@item \s@var{code}
-matches any character whose syntax is @var{code}.  @var{code} is a
-character which represents a syntax code: thus, @samp{w} for word
-constituent, @samp{-} for whitespace, @samp{(} for open-parenthesis,
-etc.  @xref{Syntax}.@refill
-
-@item \S@var{code}
-matches any character whose syntax is not @var{code}.
+@cindex @samp{\>} in regexp
+matches the empty string, but only at the end of a word.
 @end table
 
   Here is a complicated regexp used by Emacs to recognize the end of a
index 65bc279..f7bd171 100644 (file)
@@ -39,7 +39,7 @@ hierarchy is called a @dfn{root}.
 @cindex root of a hierarchy
 Whenever this section refers to a directory using the shorthand
 @code{<root>}, it means that XEmacs searches for it under all
-hierarchies under all hierarchies XEmacs was able to scrounge up.  In a
+hierarchies XEmacs was able to scrounge up.  In a
 running XEmacs, the hierarchy roots are stored in the variable
 @code{emacs-roots}.
 @vindex emacs-roots
@@ -85,12 +85,12 @@ It is possible to specify at configure-time the location of the various
 package hierarchies with the @code{--package-path} option to configure.
 @cindex package path
 The early, late, and last components of the package path are separated
-by double instead of single colons.  If three components are present,
-they are locate the early, late, and last package hierarchies
+by double instead of single colons.  If all three components are
+present, they locate the early, late, and last package hierarchies
 respectively.  If two components are present, they locate the early and
-late hierarchies.  If only one component is present, it locates the late
-hierarchy.  At run time, the package path may also be specified via the
-@code{EMACSPACKAGEPATH} environment variable.
+late hierarchies.  If only one component is present, it locates the
+late hierarchy.  At run time, the package path may also be specified via
+the @code{EMACSPACKAGEPATH} environment variable.
 
 An XEmacs package is laid out just like a normal installed XEmacs lisp
 directory.  It may have @file{lisp}, @file{etc}, @file{info}, and
index 1f519fc..1c43811 100644 (file)
@@ -31,9 +31,9 @@ version of Emacs.
 /*
  * Each dynamically loaded Emacs module is given a name at compile
  * time. This is a short name, and must be a valid part of a C
- * identifier.  This name is used to contruct the name of several
+ * identifier.  This name is used to construct the name of several
  * functions which must appear in the module source code.
- * The first such function, modules_of_XXXX, should load in any dependant
+ * The first such function, modules_of_XXXX, should load in any dependent
  * modules. This function is optional, and the module will still load if
  * it is not present in the module.
  *
@@ -60,8 +60,8 @@ modules_of_sample()
 {
   /*
    * This function isn't actually required as we will not be loading
-   * in any dependant modules, but if we were, we would do something like:
-   * emodules_load ("dependant.ell", "sample2", "1.0.0");
+   * in any dependent modules, but if we were, we would do something like:
+   * emodules_load ("dependent.ell", "sample2", "1.0.0");
    */
 }
 
index 0d92960..d91476c 100644 (file)
@@ -1,3 +1,52 @@
+2000-10-04  Martin Buchholz <martin@xemacs.org>
+
+       * XEmacs 21.2.36 is released.
+
+2000-09-30  Martin Buchholz  <martin@xemacs.org>
+
+       * config.h (HAVE_STRCASECMP): Remove.
+
+2000-09-07  Jonathan Harris  <jhar@tardis.ed.ac.uk>
+
+       * xemacs.mak:
+       Make src\depend parsing recognise "#if defined" instead of "#ifdef".
+       Use matching single quotes to keep 4dos shell happy.
+
+2000-08-07  Ben Wing  <ben@xemacs.org>
+
+       * xemacs.mak: add getloadavg.c.
+
+2000-07-30  Ben Wing  <ben@xemacs.org>
+
+       * README (NOTE):
+       Improve X documentation.
+       Document nascent Mule support.
+       Document current MS Windows contributors.
+
+2000-07-15  Ben Wing  <ben@xemacs.org>
+
+       * xemacs.mak:
+       added new file win32.c.
+       took out unused alloca.c.
+       * xemacs.mak (update-elc-2): added new target for rebuilding the
+       remaining .elcs after dumped.  its dependency is added for target
+       all.
+       * xemacs.mak (update-auto-and-custom):
+       cleaned up ; now it byte-compiles custom-load.el.
+       * xemacs.mak (mostlyclean):
+       * xemacs.mak (clean):
+       * xemacs.mak (nicenclean):
+       * xemacs.mak (distclean):
+       * xemacs.mak (realclean):
+       * xemacs.mak (versionclean):
+       Redid all the clean targets, to be similar to what's in the
+       standard Makefile.
+
+2000-07-18  Kirill 'Big K' Katsnelson  <kkm@dtmx.com>
+
+       * xemacs.mak ($(PROGNAME)): Do check error code from temacs during
+       dumping.
+
 2000-07-19  Martin Buchholz <martin@xemacs.org>
 
        * XEmacs 21.2.35 is released.
index 899d0e3..6a345fb 100644 (file)
@@ -99,11 +99,11 @@ example, to bind C-z to undo:
 Rebindind C-x and C-c is trickier because by default these are prefix
 keys in XEmacs. See the "Key Bindings" node in the XEmacs manual.
 
-** Behaviour of selected regions
+** Behavior of selected regions
 
 Selected regions behave differently in XEmacs from typical Windows
 programs. The pc-select package provides various functions to enable
-the standard Windows behaviour for selected regions (eg mark via
+the standard Windows behavior for selected regions (eg mark via
 shift-arrow, self-inserting deletes region, etc).
 
 ** Limitations on the use of the AltGr key.
index 62ad352..dba6c22 100644 (file)
--- a/nt/README
+++ b/nt/README
@@ -1,13 +1,17 @@
-Building and Installing XEmacs on Windows 95/98/NT        -*- mode:outline -*-
+Building and Installing XEmacs on Windows 95/98/NT/2000    -*- mode:outline -*-
 
                             David Hobley
                             Marc Paquette
                            Jonathan Harris
                               Ben Wing
 
-This is a port of XEmacs to Windows 95/98/NT.  If you are looking for a port
-of GNU Emacs, see http://www.cs.washington.edu/homes/voelker/ntemacs.html.
-
+This is a port of XEmacs to Windows 95/98/NT/2000.  If you are looking for a
+port of GNU Emacs, see http://www.cs.washington.edu/homes/voelker/ntemacs.html.
+NT 3.51 or later is required for building on Windows NT.  Note that the
+developers typically use NT 4.0 and Windows 2000, and there may possibly be
+problems under Windows 95/98 and NT 3.51.  If so, please report them to
+xemacs-nt@xemacs.org; we are committed to maintaining compatibility with all
+systems listed.
 
 * Required tools and sources
 ============================
@@ -20,31 +24,42 @@ of GNU Emacs, see http://www.cs.washington.edu/homes/voelker/ntemacs.html.
     Your PATH environment variable also needs to include the DevStudio
     vc\bin and sharedide\bin directories.
 
-    Visual C++ V5.0 installs a batch file called vcvars32.bat in
+    Visual C++ V5.0 and later install a batch file called vcvars32.bat in
     c:\Program Files\DevStudio\VC\bin\ (or wherever you installed it) that you
     can run before building to set up all of these environment variables.
+    Alternatively, you can choose at setup time to have these
+    environment variables automatically set up in the registry, which
+    is generally a good idea.
+
 
 2.  Grab the latest XEmacs source from
 
       ftp://ftp.xemacs.org/pub/xemacs/
 
-    or one of its mirrors listed at http://www.xemacs.org/Download/index.html .
+    or one of its mirrors listed at http://www.xemacs.org/Download/index.html.
+
+    (NOTE: If you are behind a firewall and have problems with FTP access,
+    the URL http://ftp.xemacs.org/pub/xemacs/ works just as well.)
 
     You'll also need the packages.  You probably want to get the unified
     packages bundle from
 
       ftp://ftp.xemacs.org/pub/xemacs/packages/xemacs-sumo.tar.gz
 
+    If you are building with international support, you also need
+
+      ftp://ftp.xemacs.org/pub/xemacs/packages/xemacs-mule-sumo.tar.gz
+
     Although we don't recommend it, you can also retrieve just the packages
     you really need if you have an extremely slow net connection or are very
     short on disk space.  You can find the various packages in
-    ftp://ftp.xemacs.org/pub/xemacs/packages/.  You will need the
-    xemacs-base package.  You'll also need the texinfo package unless you
-    have a copy of makeinfo.exe on your machine.  If you want to download
-    additional or updated packages from within XEmacs you'll need the efs,
-    dired and vm packages.  You'll probably also want at least the
-    edit-utils, text-modes, fsf-compat, cc-mode, prog-modes and xemacs-devel
-    packages.
+    ftp://ftp.xemacs.org/pub/xemacs/packages/.  You will need the xemacs-base
+    package (and mule-base, if building with international support).  You'll
+    also need the texinfo package unless you have a copy of makeinfo.exe on
+    your machine.  If you want to download additional or updated packages
+    from within XEmacs you'll need the efs, dired and vm packages.  You'll
+    probably also want at least the edit-utils, text-modes, fsf-compat,
+    cc-mode, prog-modes and xemacs-devel packages.
 
     Unpack the packages into "x:\your\choice\XEmacs\xemacs-packages",
     for example "c:\Program Files\XEmacs\xemacs-packages".
@@ -56,12 +71,34 @@ of GNU Emacs, see http://www.cs.washington.edu/homes/voelker/ntemacs.html.
 
 ** Extra tools and sources required for X
 
+NOTE: XEmacs has not been tested with X support under the native
+Windows build for a long, long time!  It may not even compile any
+more.  If you are interested in X support, you're better off compiling
+the Cygwin version of XEmacs, which can handle both Win32 native and X
+frames (in the same binary, in fact, but not at the same time), and is
+actively tested with X support.
+
 If you want support for X you will also need:
 
-1.  An X server. MI/X is available on the Internet as trialware; it is 
-    available from: http://www.microimages.com/www/html/mix/
+1.  An X server.  XEmacs has been tested and runs well under MI/X,
+    available from: http://www.microimages.com/mix/. (International aka
+    "Mule" support even works under this X server!) Unfortunately, this is
+    not free, but is trialware; you have to pay $25 if you want to use it
+    for more than 15 days.  XEmacs also runs (barely) under the free XWin
+    server that comes as part of the Cygwin XFree86 package, available at
+
+    ftp://sources.redhat.com/pub/cygwin/xfree/
 
-2.  Source for the MIT X11R6.3 libraries, available from: ftp.x.org
+    or numerous mirrors, such as
+
+    ftp://ftp.freesoftware.com/pub/sourceware/cygwin/xfree/
+
+    There are numerous other X servers available in the same package or at
+    the same location, but unfortunately most of them behave even worse
+    than XWin.  If you have any luck with any of these, *PLEASE* email
+    the maintainers at xemacs-nt@xemacs.org, and we'll add the info here.
+
+2.  Source for the MIT X11R6.3 libraries, available from ftp.x.org.
 
 3.  You'll need to compile the MIT libraries without multi-thread support.
     To do this, there is an example Win32.cf and site.def provided which set
@@ -121,6 +158,15 @@ If you want support for X you will also need:
     config.inc.samp to config.inc.  Make any necessary modifications.  This
     file controls the options that XEmacs is built with:
 
+    -- If you want international (aka "Mule") support, modify the appropriate
+       line in config.inc as follows:
+
+       HAVE_MULE=1
+
+       NOTE: This support is still quite raw under the Win32 native GUI,
+       but works well if you compile the Cygwin version with X support
+       and disable native Win32 support (--with-msw=no).
+    
     -- If you're building with XPM support, modify the appropriate lines in
        config.inc as follows:
 
@@ -182,7 +228,7 @@ If you want support for X you will also need:
     (By default, XEmacs will be installed in directories under the directory
     "c:\Program Files\XEmacs\XEmacs-21.2".)
 
-2.  If you want to build xemacs on the command line, use
+3.  If you want to build xemacs on the command line, use
     `nmake install -f xemacs.mak', or just `nmake -f xemacs.mak' if you want
     to run XEmacs from its build directory.  nmake will build temacs, the DOC
     file, update the elc's, dump xemacs and (optionally) install the relevant
@@ -198,14 +244,15 @@ If you want support for X you will also need:
     You may want to create a shortcut to the file from your Desktop or
     Start Menu.
 
-3.  To build using MS Developer Studio, you can use the workspace file
-    `nt/xemacs.dsw'.  This was prepared for Visual C++ 5.0; if you have
-    a different version and this file doesn't work, just open up
-    `nt/xemacs.mak' from within MS Developer Studio and it will offer to
-    wrap this Makefile in a workspace file, from which you can build.
-    Assuming you want to run from the build directory (which you will
-    want to do if you are planning on doing any development work on XEmacs),
-    use the following settings in Project/Settings...:
+4.  To build using MS Developer Studio, you can use the workspace file
+    `nt/xemacs.dsw'.  This was prepared for Visual C++ 6.0.  If you are using
+    Visual C++ 5.0, you can use the workspace file `nt/xemacs-vc50.dsw'.  If
+    you have a different version and neither file works, just open up
+    `nt/xemacs.mak' from within MS Developer Studio and it will offer to wrap
+    this Makefile in a workspace file, from which you can build.  Assuming
+    you want to run from the build directory (which you will want to do if
+    you are planning on doing any development work on XEmacs), use the
+    following settings in Project/Settings...:
 
     Under the General tab:
 
@@ -255,10 +302,17 @@ assistance we can:
 The XEmacs NT Mailing List: xemacs-nt@xemacs.org
 Subscribe address:          xemacs-nt-request@xemacs.org
 
-David Hobley
-Marc Paquette
-August Hill
-Jonathan Harris
-Ben Wing
+Ben Wing (current primary MS Windows maintainer; author of the MS Windows
+          Mule code and some of the dialog box code)
+Andy Piper (MS Windows contributor; author of the Cygwin support and the
+            MS Windows glyph and widget code)
+Jonathan Harris (MS Windows contributor; author of the MS Windows redisplay
+                 and underlying GUI code)
+Kirill Katsnelson (MS Windows contributor; author of the MS Windows process
+                   and printing code and some of the dialog box code;
+                   general guru on obscure MS Windows programming topics)
+David Hobley (early MS Windows contributor)
+Marc Paquette (early MS Windows contributor)
+August Hill (early MS Windows contributor)
 
 and others.
index 718e0c7..34ac06b 100644 (file)
@@ -257,7 +257,6 @@ Boston, MA 02111-1307, USA.  */
 #undef HAVE_SIGHOLD
 #undef HAVE_SIGPROCMASK
 #undef HAVE_SIGSETJMP
-#undef HAVE_STRCASECMP
 #define HAVE_STRERROR
 #undef HAVE_TZSET
 #undef HAVE_UTIMES
@@ -499,7 +498,7 @@ Boston, MA 02111-1307, USA.  */
 
 /* If you wish to compile with support for the Network Audio System
    system define HAVE_NAS_SOUND.
-   NAS_NO_ERROR_JUMP means that the NAS libraries don't inlcude some
+   NAS_NO_ERROR_JUMP means that the NAS libraries don't include some
    error handling changes.
  */
 #undef HAVE_NAS_SOUND
index f3dc0de..3438f45 100644 (file)
@@ -1,5 +1,5 @@
 # Microsoft Developer Studio Project File - Name="xemacs" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 5.00
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
 # ** DO NOT EDIT **
 
 # TARGTYPE "Win32 (x86) External Target" 0x0106
@@ -22,6 +22,7 @@ CFG=xemacs - Win32 Debug
 !MESSAGE 
 
 # Begin Project
+# PROP AllowPerConfigDependencies 0
 # PROP Scc_ProjName ""
 # PROP Scc_LocalPath ""
 
index e9a8ca9..4b158e1 100644 (file)
@@ -1,9 +1,9 @@
-Microsoft Developer Studio Workspace File, Format Version 5.00
+Microsoft Developer Studio Workspace File, Format Version 6.00
 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
 
 ###############################################################################
 
-Project: "xemacs"=".\xemacs.dsp" - Package Owner=<4>
+Project: "xemacs"=.\xemacs.dsp - Package Owner=<4>
 
 Package=<5>
 {{{
index bc7c917..b0ffd19 100644 (file)
@@ -1,6 +1,6 @@
 #   Makefile for Microsoft NMAKE
 #   Copyright (C) 1995 Board of Trustees, University of Illinois.
-#   Copyright (C) 1995, 1996 Ben Wing.
+#   Copyright (C) 1995, 1996, 2000 Ben Wing.
 #   Copyright (C) 1995 Sun Microsystems, Inc.
 #   Copyright (C) 1998 Free Software Foundation, Inc.
 #
@@ -300,7 +300,7 @@ DEPEND=0
 # #### here, it doesn't seem to matter if we double ^'s!
 # results are the same with all single ^ and all double ^^!
 # see comment below.
-! if [perl -p -e "s/^\x23ifdef (.+)/!if defined($$1)/; s/^\x23e/!e/;" \
+! if [perl -p -e "s/^\x23if defined(.+)/!if defined$$1/; s/^\x23e/!e/;" \
        -e "s/([\s=^])([\w\d\.\-^]+\.[ch^])/$$1$(SRC:\=\\)\\$$2/g;" \
        -e "s/^(.+)\.o:(.+)/$(OUTDIR:\=\\)\\$$1.obj:$$2 $(NT:\=\\)\\config.inc/;" \
        < $(SRC)\depend > $(OUTDIR)\depend.tmp]
@@ -630,7 +630,6 @@ DOC=$(LIB_SRC)\DOC
 DOC_SRC1=\
  $(SRC)\abbrev.c \
  $(SRC)\alloc.c \
- $(SRC)\alloca.c \
  $(SRC)\blocktype.c \
  $(SRC)\buffer.c \
  $(SRC)\bytecode.c \
@@ -668,6 +667,7 @@ DOC_SRC3=\
  $(SRC)\font-lock.c \
  $(SRC)\frame.c \
  $(SRC)\general.c \
+ $(SRC)\getloadavg.c \
  $(SRC)\glyphs.c \
  $(SRC)\glyphs-eimage.c \
  $(SRC)\glyphs-widget.c \
@@ -717,6 +717,7 @@ DOC_SRC5=\
  $(SRC)\tparam.c \
  $(SRC)\undo.c \
  $(SRC)\window.c \
+ $(SRC)\win32.c \
  $(SRC)\widget.c
 
 !if $(HAVE_X_WINDOWS)
@@ -917,7 +918,6 @@ TEMACS_OBJS= \
        $(TEMACS_DUMP_OBJS)\
        $(OUTDIR)\abbrev.obj \
        $(OUTDIR)\alloc.obj \
-       $(OUTDIR)\alloca.obj \
        $(OUTDIR)\blocktype.obj \
        $(OUTDIR)\buffer.obj \
        $(OUTDIR)\bytecode.obj \
@@ -953,6 +953,7 @@ TEMACS_OBJS= \
        $(OUTDIR)\font-lock.obj \
        $(OUTDIR)\frame.obj \
        $(OUTDIR)\general.obj \
+       $(OUTDIR)\getloadavg.obj \
        $(OUTDIR)\glyphs.obj \
        $(OUTDIR)\glyphs-eimage.obj \
        $(OUTDIR)\glyphs-widget.obj \
@@ -999,7 +1000,8 @@ TEMACS_OBJS= \
        $(OUTDIR)\tparam.obj \
        $(OUTDIR)\undo.obj \
        $(OUTDIR)\widget.obj \
-       $(OUTDIR)\window.obj
+       $(OUTDIR)\window.obj \
+       $(OUTDIR)\win32.obj
 
 # Rules
 
@@ -1290,11 +1292,11 @@ makeinfo-test:
 if exist "$(MAKEINFO)" goto test_done
 @$(XEMACS_BATCH) -eval "(condition-case nil (require (quote texinfo)) (t (kill-emacs 1)))"
 @if not errorlevel 1 goto suggest_makeinfo
-@echo XEmacs `info' cannot be built!
-@echo Install XEmacs package `texinfo' (see README.packages).
+@echo XEmacs 'info' cannot be built!
+@echo Install XEmacs package 'texinfo' (see README.packages).
 :suggest_makeinfo
 @echo Consider specifying path to makeinfo program: MAKEINFO=path
-@echo as this will build info docs faster than XEmacs using `texinfo'.
+@echo as this will build info docs faster than XEmacs using 'texinfo'.
 @if errorlevel 1 exit 1
 :test_done
 <<NOKEEP
@@ -1346,7 +1348,7 @@ $(PROGNAME) : $(TEMACS) $(TEMACS_DIR)\NEEDTODUMP
        cd $(TEMACS_DIR)
        set EMACSBOOTSTRAPLOADPATH=$(LISP);$(PACKAGE_PATH)
        set EMACSBOOTSTRAPMODULEPATH=$(MODULES)
-       -1 $(TEMACS_BATCH) -l $(TEMACS_DIR)\..\lisp\loadup.el dump
+       $(TEMACS_BATCH) -l $(TEMACS_DIR)\..\lisp\loadup.el dump
 !if $(USE_PORTABLE_DUMPER)
        rc -d INCLUDE_DUMP -Fo $(OUTDIR)\xemacs.res $(NT)\xemacs.rc
        link.exe @<<
@@ -1364,7 +1366,7 @@ $(PROGNAME) : $(TEMACS) $(TEMACS_DIR)\NEEDTODUMP
 # use this rule to build the complete system
 all:   installation $(OUTDIR)\nul $(LASTFILE) $(LWLIB) \
        $(LIB_SRC_TOOLS) $(TEMACS) update-elc $(DOC) $(PROGNAME) \
-       update-auto-and-custom info
+       update-elc-2 update-auto-and-custom info
 
 temacs: $(LASTFILE) $(TEMACS)
 
@@ -1392,43 +1394,42 @@ install:        all
        @$(DEL) "$(PACKAGE_PREFIX)\xemacs-packages\PlaceHolder"
        @$(DEL) PlaceHolder
 
-distclean:
-       $(DEL) *.bak
-       $(DEL) *.orig
-       $(DEL) *.rej
-       $(DEL) *.tmp
+mostlyclean:
        $(DEL) $(XEMACS)\Installation
-       cd $(OUTDIR)
-       $(DEL) *.lib
-       $(DEL) *.obj
-       $(DEL) *.pdb
-       $(DEL) *.res
-       $(DEL) *.sbr
-       cd $(XEMACS)\$(TEMACS_DIR)
-       $(DEL) config.h
-       $(DEL) paths.h
-       $(DEL) Emacs.ad.h
-       $(DEL) *.bak
-       $(DEL) *.orig
-       $(DEL) *.rej
-       $(DEL) *.exe
-       $(DEL) *.map
-       $(DEL) *.bsc
-       $(DEL) *.pdb
-       cd $(LIB_SRC)
-       $(DEL) DOC
-       $(DEL) *.bak
-       $(DEL) *.orig
-       $(DEL) *.rej
-       $(DEL) *.exe
-       $(DEL) *.obj
-       $(DEL) *.pdb
-       $(DEL) *.res
-       $(DEL) $(CONFIG_VALUES)
-       cd $(LISP)
-       $(DEL) /s /q *.bak *.elc *.orig *.rej
-       cd $(INFODIR)
-       $(DEL) *.info*
+       $(DEL) $(OUTDIR)\*.lib $(OUTDIR)\*.obj $(OUTDIR)\*.pdb
+       $(DEL) $(OUTDIR)\*.res $(OUTDIR)\*.sbr
+       $(DEL) $(SRC)\*.exe $(SRC)\*.map $(SRC)\*.bsc $(SRC)\*.pdb
+       $(DEL) $(LIB_SRC)\*.exe $(LIB_SRC)\*.obj $(LIB_SRC)\*.pdb
+       $(DEL) $(LIB_SRC)\*.res
+
+clean: mostlyclean versionclean
+       $(DEL) $(XEMACS)\TAGS
+
+nicenclean: clean
+       $(DEL) $(NT)\*.bak $(NT)\*.orig $(NT)\*.rej $(NT)\*.tmp
+       $(DEL) $(LIB_SRC)\*.bak $(LIB_SRC)\*.orig $(LIB_SRC)\*.rej
+       $(DEL) $(LIB_SRC)\*.tmp
+       $(DEL) $(SRC)\*.bak $(SRC)\*.orig $(SRC)\*.rej $(SRC)\*.tmp
+       $(DEL) /s $(LISP)\*.bak $(LISP)\*.orig $(LISP)\*.rej $(LISP)\*.tmp
+
+## This is used in making a distribution.
+## Do not use it on development directories!
+distclean: nicenclean
+       $(DEL) $(SRC)\config.h $(SRC)\paths.h $(SRC)\Emacs.ad.h
+       $(DEL) $(LIB_SRC)\$(CONFIG_VALUES)
+       $(DEL) $(INFODIR)\*.info*
+       $(DEL) /s /q $(LISP)\*.elc
+
+realclean: distclean
+
+versionclean:
+       $(DEL) $(SRC)\xemacs.exe $(LIB_SRC)\DOC
+
+#not sure about those wildcards.  DOS wildcards are stupid compared to Unix,
+#and could end up deleting *everything* instead of just backup files or
+#whatever.
+#extraclean: realclean
+#      $(DEL) *~ *.*~ #* m\*~ m\#* s\*~ s\#*
 
 depend:
        cd $(SRC)
@@ -1545,16 +1546,23 @@ XEmacs $(XEMACS_VERSION_STRING) $(xemacs_codename:"=\") configured for `$(EMACS_
        @type $(XEMACS)\Installation
        @echo --------------------------------------------------------------------
 
-# Update auto-autoloads.el and custom-load.el similar to what
-# XEmacs.rules does for xemacs-packages.
+# Update out-of-date .elcs, other than needed for dumping.
+update-elc-2:
+       $(XEMACS_BATCH) -l update-elc-2.el -f batch-update-elc-2 $(LISP)
+
+# Update auto-autoloads.el and custom-load.el, similar to what
+# XEmacs.rules does for xemacs-packages.  This used to delete
+# auto-autoloads.el first, but that's a bad idea, because it forces
+# rebuilding from scratch, which is time-consuming; and the autoload
+# code is specifically written to do in-place updating.  However, if
+# your auto-autoload file is messed up and you want it rebuilt from
+# scratch, delete it from the command line and then nmake with this
+# target.
 update-auto-and-custom:
-#       Don't delete this, because it forces rebuilding from scratch,
-#       which is time-consuming; and the autoload code is specifically
-#       written to do in-place updating.
-#      @$(DEL) $(LISP)\auto-autoloads.el
 #       Combine into one invocation to avoid repeated startup penalty.
-       $(XEMACS_BATCH) -l autoload -f batch-update-one-directory $(LISP) -f batch-byte-compile-one-file $(LISP)\auto-autoloads.el -l cus-dep -f Custom-make-dependencies $(LISP)
+       $(XEMACS_BATCH) -l autoload -f batch-update-one-directory $(LISP) -f batch-byte-compile-one-file $(LISP)\auto-autoloads.el -l cus-dep -f Custom-make-one-dependency $(LISP) -f batch-byte-compile-one-file $(LISP)\custom-load.el
        @$(DEL) $(LISP)\auto-autoloads.el~
+       @$(DEL) $(LISP)\custom-load.el~
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
index 932f8bc..3c85350 100644 (file)
+2000-10-04  Martin Buchholz <martin@xemacs.org>
+
+       * XEmacs 21.2.36 is released.
+
+2000-08-31   Daiki Ueno  <ueno@unixuser.org>
+
+       * lread.c (locate_file): Check the path element is non-nil.
+
+2000-10-02  Martin Buchholz  <martin@xemacs.org>
+
+       * lisp.h: Warning suppression for SCO compilers.
+
+       * redisplay-tty.c (reset_tty_modes): Fix crash.
+       E.g. from xemacs running on X: (delete-device (make-device 'tty nil))
+
+2000-09-27  Martin Buchholz  <martin@xemacs.org>
+
+       Big signal/process handling overhaul.  Bugs fixed:
+       M-x shell, type `sleep 10000', M-x comint-interrupt-subjob and
+       M-x comint-kill-subjob should work for both values nil and t of
+       process-connection-type. It was broken on most platforms.
+       Testing on Irix and Cygwin still needed.  Other plaforms tested.
+       * sysdep.c: Move #include of stropts.h into sysproc.h.  Use pid_t.
+       * process-unix.c: Signal/Process handling overhaul.
+       (pty_name): make 64 bytes, as `expect' does, for paranoia.
+       (allocate_pty): Use all available modern methods of allocating
+       ptys, falling back to old style BSD allocation as a last resort.
+       Use allegedly more secure Unix98 pty allocation by default.
+       (allocate_pty_the_old_fashioned_way): New. the last resort.
+       (unix_create_process): Push ptem, ldterm, ttcompat where
+       available.  Autoconfiscate.
+       (try_to_initialize_subtty): New.
+       (unix_kill_child_process): Proper signal handling for ptys on most
+       platforms, using special knowledge of AIX, BSD, etc...
+       (unix_create_process): Always disconnect_controlling_terminal() for
+       subprocesses, whether using ptys or not.
+       * process.h: Remove old getpt-dependent PTY code.
+       * process.c (Fprocess_send_signal): New, obvious generic function.
+       (decode_signal): New.
+       (Finterrupt_process):
+       (Fkill_process):
+       (Fquit_process):
+       (Fstop_process):
+       (Fcontinue_process):
+       (Fsignal_process): Use decode_signal.
+       (process_send_signal):
+       Many docstring corrections.
+       Allow any signal to be sent to a process object.
+       * config.h.in: Add symbols for big signal/process overhaul.
+       * syssignal.h (EMACS_KILLPG): Use HAVE_KILLPG. Use `pid', not `gid'.
+       * sysproc.h: Include process-related headers, where available:
+       sys/stropts.h sys/strtio.h pty.h libutil.h
+       * s/irix4-0.h:
+       * s/irix5-0.h:
+       * s/cygwin32.h:
+       * s/gnu.h:
+       * s/linux.h:
+       * s/hpux.h:
+       * s/aix3-1.h:
+       Remove old S&M pty stuff.
+       * console-tty.c (tty_init_console): Use pid_t, not int, for pids.
+       * systty.h: Simplify cpp hackery, improve comments.
+       Favor BSD ioctl(TIOCGPGRP) over Posix tcgetpgrp().
+
+       * editfns.c (Fformat_time_string):
+       Be a little more paranoid with the return value of ctime.
+
+       * fileio.c (check_executable):
+       (check_writable):
+       Use symbolic constants X_OK, W_OK.
+
+       * console-x.c (split_up_display_spec): Fix a warning.
+
+2000-10-02  Martin Buchholz  <martin@xemacs.org>
+
+       * gui-x.c (add_accel_and_to_external): strlen ==> XSTRING_LENGTH
+       * ntproc.c (sys_spawnve): make_string ==> build_string
+       Small clarity improvements.
+
+2000-09-30  Martin Buchholz  <martin@xemacs.org>
+
+       * events.c (WRONG_EVENT_TYPE_FOR_PROPERTY): Warning removal.
+
+       * s/windowsnt.h (HAVE_STRCASECMP): Remove.
+
+       * config.h.in (HAVE_STRCASECMP): Remove.
+
+2000-09-29  Martin Buchholz  <martin@xemacs.org>
+
+       * redisplay-output.c (redisplay_output_pixmap):
+       Cleaner and possibly more 64-bit correct code.
+
+2000-09-28  Stephen J. Turnbull  <stephen@xemacs.org>
+
+       * dumper.c (pdump_load_finish): move restoration of
+       `noninteractive1' to emacs.c (main_1).
+       * emacs.c (main_1): protect LISP-visible command-line flags
+       from pdump_load().
+
+2000-09-26  Stephen J. Turnbull  <stephen@xemacs.org>
+
+       * Makefile.in.in (versionclean):  Use EXE_TARGET and
+       DUMP_TARGET instead of literal program names.
+
+2000-09-20  Martin Buchholz  <martin@xemacs.org>
+
+       * Makefile.in.in: Recent purify's require absolute paths for cache-dir.
+
+2000-09-19  Martin Buchholz  <martin@xemacs.org>
+
+       * *: Spelling mega-patch
+
+2000-09-19  Martin Buchholz  <martin@xemacs.org>
+
+       * fns.c (bad_bad_turtle):
+       Delete "Eek!" comment, since we fixed the bug to which it refers.
+
+2000-09-16  Martin Buchholz  <martin@xemacs.org>
+
+       * alloca.c: Replace REGISTER with register.
+
+2000-09-16   Daiki Ueno  <ueno@unixuser.org>
+
+       * file-coding.c (ucs_to_char): Use countof.
+
+2000-09-16  Martin Buchholz  <martin@xemacs.org>
+
+       * file-coding.c: (ucs_to_char):
+       (complex_vars_of_file_coding):
+       Use countof instead of sizeof.
+       Use CHECK_NATNUM instead of CHECK_INT.
+
+       * sysdep.c (strcasecmp): Remove.
+       * device-x.c (ascii_strcasecmp): New.
+       * device-x.c (Fx_get_resource): Use ascii_strcasecmp.
+       Avoid using non-standard non-portable strcasecmp.
+
+2000-09-16  Martin Buchholz  <martin@xemacs.org>
+
+       * Makefile.in.in (mostlyclean): remove reference to prefix-args.
+       * font-lock.c: remove reference to emacsfns.h.
+       * search.c: small doc improvement.
+       * event-Xt.c: correct file names in comments.
+       * console-x.h Correct file names in comments.
+       * frame.c: Correct file names in comments.
+       * event-stream.c: remove Energize from comments.
+
+2000-09-15  Martin Buchholz  <martin@xemacs.org>
+
+       * symeval.h (DEFERROR_STANDARD):
+       (DEFERROR):
+       (DEFSYMBOL):
+       (DEFSYMBOL_NO_DUMP):
+       (DEFSYMBOL_MULTIWORD_PREDICATE):
+       (DEFSYMBOL_MULTIWORD_PREDICATE_NO_DUMP):
+       (DEFKEYWORD):
+       The construct &##name is not sensible C.
+       Fixes compilation errors with Unixware native compiler.
+
+2000-09-14  Martin Buchholz  <martin@xemacs.org>
+
+       * frame.c (device_matches_console_spec): no longer takes a `frame' arg
+       (next_frame_internal): Removed.  We now just have next_frame.
+       (next_frame):
+       Write a simpler and cleaner one-pass algorithm.
+       Remove called_from_delete_device arg and #ifdefed-out code.
+       (previous_frame):
+       Renamed from prev_frame.  Update callers.
+       Cleaned up to have an analogous implementation to next_frame.
+       (other_visible_frames_internal): Remove the
+       called_from_delete_device bogus arg, and hence, remove this
+       function.  Just use other_visible_frames().
+
+       * window.c (Fnext_window): 
+       Prettify docstring.
+       Since next_frame() is guaranteed to return a frame, remove check
+       for nil inserted in previous patch.
+       (Fprevious_window): 
+       Prettify docstring.  
+       Make code look more like Fnext_window.
+       (window_loop):
+       Respect the `console' arg when iterating through windows.
+       Fixes bug: (get-buffer-window buffer t device) not respecting
+       the `device' arg.
+       This function needs more work, as others have pointed out.
+
+       * frame.h: Rename prev_frame to previous_frame.
+       device_matches_console_spec no longer takes a `frame' arg.
+
+       * s/gnu.h:
+       * s/linux.h:
+       * s/hpux.h:
+       Use EMACS_BLOCK_SIGNAL instead of sigblock.
+       From "Golubev I. N." <gin@mo.msk.ru>.
+
+       * make-src-depend: Fix typo.
+
+2000-09-13  Martin Buchholz  <martin@xemacs.org>
+
+       * window.c (Fnext_window):
+       next_frame() might return nil, not a frame.
+       Fixes this crash:
+       (gdb) run -eval '(progn  (make-device (quote x) "polgar:0") (next-window (minibuffer-window) t (quote visible) (second (device-list))))'
+
+       * frame.c (next_frame_internal):
+       We've passed a frame if we've passed its device.
+       Fixes this crash:
+       (gdb) run -eval '(progn (make-frame nil (make-device (quote x) "polgar:0")) (next-window (minibuffer-window) t (quote visible) (second (device-list))))'
+Fatal error: assertion failed, file /project/xemacs/ws/dev/src/frame.h, line 245, RECORD_TYPEP (obj, lrecord_type_frame)
+
+2000-09-11  Jonathan Harris  <jhar@tardis.ed.ac.uk>
+
+       * menubar-msw.c (mswindows_translate_menu_or_dialog_item):
+       Allow option to suppress accelerators in menu/dialog items.
+       (populate_or_checksum_helper): Pass dialog title through above.
+
+2000-09-10  Jonathan Harris  <jhar@tardis.ed.ac.uk>
+
+       * event-msw.c (mswindows_key_to_emacs_keysym):
+       Add "pause" key, fix "menu" key.
+
+2000-09-09  Martin Buchholz  <martin@xemacs.org>
+
+       * eval.c (reinit_vars_of_eval):
+       Increase max_lisp_eval_depth to 1000,
+       required for thai-xtis.el to byte-compile under some circumstances.
+
+2000-09-04  Martin Buchholz  <martin@xemacs.org>
+
+       * event-Xt.c (x_to_emacs_keysym): Increase size of `buffer' to 513.
+       From Kenichi Handa.
+
+2000-09-01  Martin Buchholz  <martin@xemacs.org>
+
+       * make-src-depend: Make the generated Makefiles smaller.
+
+       * s/hpux.h (SETUP_SLAVE_PTY):
+       Provide a %d in the format string for the errno argument.
+
+       * editfns.c (Ftemp_directory):
+       Warning fix.
+       Avoid buffer overrun on very long file name.
+
+       * input-method-xlib.c (XIM_init_device): 
+       6th parameter of XRegisterIMInstantiateCallback has different
+       pointer types on different OSes, so simply cast to (void *).
+
+       * unexhp9k800.c: Warning fixes.  Fiddly changes.
+
+       * sysdll.c (dll_open):
+       shl_load will hang hard if passed a NULL filename.
+       Simply return NULL for compatibility with dlopen.
+       * sysdll.c: Conform to XEmacs coding standards.
+
+       * sysdep.c (get_pty_max_bytes): 
+       Support pty input lines longer than 512 bytes on HP-UX 10.20.
+
+2000-08-31  Martin Buchholz  <martin@xemacs.org>
+
+       * tooltalk.c: Add #include <syssignal.h>
+
+2000-08-12  Alexandre Oliva  <aoliva@redhat.com>
+
+       * s/hpux.h: Don't use undefined function sigunblock().
+
+2000-08-31  Martin Buchholz  <martin@xemacs.org>
+
+       * config.h.in: Add HAVE_BALLOON_HELP.
+       * emacs.c: Use HAVE_BALLOON_HELP.
+       * Makefile.in.in (x_objs):
+       Make Balloon Help conditional on finding shape.h.
+
+2000-08-23  Yoshiki Hayashi  <yoshiki@xemacs.org>
+
+       * syntax.c (regex_emacs_buffer_p): New variable.
+       * syntax.h (regex_emacs_buffer_p): extern.
+       * search.c (looking_at_1):
+       (string_match_1):
+       (fast_string_match):
+       (search_buffer): Set regex_emacs_buffer_p.
+       * regex.c (re_match_2_internal): Reference regex_emacs_buffer_p
+       when before_dot, at_dot, after_dot.
+
+2000-08-23  Andy Piper  <andy@xemacs.org>
+
+       * gui-x.c (popup_selection_callback): Only set action_occurred
+       when we really have an image instance.
+       * gui-msw.c (mswindows_handle_gui_wm_command): ditto.
+
+2000-08-23  Andy Piper  <andy@xemacs.org>
+
+       * gui-msw.c (mswindows_handle_gui_wm_command): set
+       action_occurred.
+       * gui-x.c (popup_selection_callback): ditto.
+
+       * glyphs.h (IMAGE_INSTANCE_WIDGET_ACTION_OCCURRED): new accessor.
+       (XIMAGE_INSTANCE_WIDGET_ACTION_OCCURRED): ditto.
+       (struct Lisp_Image_Instance): add action_occurred flag.
+
+       * glyphs.c (redisplay_subwindow): use action_occurred flag.
+       (image_instance_changed): ditto.
+       (reset_frame_subwindow_instance_cache): only unmap windows - do
+       not remove them from the cache also.
+
+       * glyphs-widget.c (tab_control_update): better debug.
+       (progress_gauge_update): ditto.
+       (layout_update): ditto.
+       (layout_instantiate): ditto.
+       (tab_control_order_only_changed): cope with null pending items.
+
+       * glyphs-msw.c (mswindows_tab_control_redisplay): add better
+       debug. Force selection of an item when an action occurred. Cope
+       with null pending_items.
+       (mswindows_progress_gauge_redisplay): better debug.
+       * glyphs-x.c (x_tab_control_redisplay): ditto.
+
+       * redisplay.c (redisplay_frame): reset the frame cache if the
+       frame is garbaged.
+
+       * window.c (Fset_window_configuration): potentially re-enable
+       frame cache reset.
+       (window_unmap_subwindows): need to finalize instances here since
+       it is only used in mark_window_as_deleted.
+
+2000-08-22  Stephen J. Turnbull  <stephen@xemacs.org>
+
+       * nas.c (SndOpenDataForReading):
+       nas.c (WaveOpenDataForReading):
+       nas.c (readChunk): {BIG,LITTLE}_ENDIAN -> NAS_{BIG,LITTLE}_ENDIAN.
+       Somehow escaped from the 2000-08-14 patch.
+
+2000-08-14  Stephen J. Turnbull  <stephen@xemacs.org>
+
+       * nas.c:  Preprocessor trickery to use NAS_LITTLE_ENDIAN instead
+       of LITTLE_ENDIAN (conflicts with glibc, at least) in NAS <= 1.2p5.
+
+2000-08-21  Andy Piper  <andy@xemacs.org>
+
+       * glyphs-x.c (x_map_subwindow): Minor optimization - only map the
+       window if it is not already displayed.
+
+       * glyphs-msw.c (mswindows_map_subwindow): only map the window if
+       it is not already displayed.
+
+       * window.c (Fset_window_configuration): don't reset the frame
+       cache.
+
+       * glyphs.c (unmap_subwindow_instance_cache_mapper): only remove
+       instances from the frame cache if we are actually finalizing them.
+       (reset_frame_subwindow_instance_cache): reset frame cache only
+       after unmapping everything.
+       (map_subwindow): set displayed flag after mapping.
+
+2000-08-21  Martin Buchholz  <martin@xemacs.org>
+
+       * data.c (indirect_function):
+       Rename ERRORP to non-misleading VOID_FUNCTION_ERRORP.
+
+       * eval.c (function_argcount): 
+       Use original function when signaling errors.
+
+2000-08-18  Andy Piper  <andy@xemacs.org>
+
+       * frame.c (delete_frame_internal): use new
+       free_frame_subwindow_instances name.
+
+       * glyphs-msw.c (mswindows_tab_control_instantiate): verify index.
+       (add_tab_item): make return type correct.
+       (mswindows_tab_control_instantiate): assert index of tab.
+       (mswindows_tab_control_redisplay): Re-code to use
+       gui_item_equal_sans_selected and gui_item_list_find_selected.
+
+       * glyphs-widget.c (tab_control_update): Correct comment.
+
+       * window.c (window_unmap_subwindows): use new
+       unmap_subwindow_instance_cache_mapper.
+       (window_unmap_subwindows_cache_mapper): deleted.
+       (Fset_window_configuration): comparisons should now be with
+       EQ. Preserve the subwindow instance cache across configuration
+       changes.
+       (allocate_window): ditto.
+       (make_dummy_parent): ditto.
+
+       * glyphs.c (free_frame_subwindow_instances): rename from
+       free_frame_subwindow_instance_cache. finalize all instances rather
+       than just those in the display cache.
+       (finalize_all_subwindow_instances): walk windows unmapping and
+       finalizing subwindows.
+       (unmap_subwindow_instance_cache_mapper): moved from
+       window.c. Allow finalization as well as unmapping.
+
+       * gui.c (gui_item_list_find_selected): new function.
+
+       * gui.h (gui_item_list_find_selected): declare.
+
+       * glyphs-x.c (x_tab_control_redisplay): pick tab
+       explicitly. Re-code to use gui_item_equal_sans_selected and
+       gui_item_list_find_selected.
+
+       * glyphs-x.h: add lwlib-utils.h
+
+       * buffer.c (Frecord_buffer): undo previous change.
+
+2000-08-09  Vin Shelton  <acs@xemacs.org>
+
+       * config.h.in, s/gnu.h, s/hpux.h, s/linux.h: Use UNIX98 PTYs if
+       possible.  Create temporary files more securely.  The patch was
+       generated by Torsten Duwe <duwe@caldera.de>, Florian Weimer
+       <Florian.Weimer@RUS.Uni-Stuttgart.DE> and Olaf Kirch.  See
+       http://www.xemacs.org/list-archives/xemacs-patches/200007/msg00123.html
+       for details.
+
+2000-08-07  Ben Wing  <ben@xemacs.org>
+
+       * getloadavg.c: remove duplicate (and windows-breaking)
+       includes of fcntl.h and sys/file.h.
+
+       * nt.c: remove duplicate getloadavg() definition.
+
+       * sysdll.h (Qdll_filename_encoding): add missing stand-in
+       encodings.
+
+2000-08-07  Gunnar Evermann  <ge204@eng.cam.ac.uk>
+
+       * eval.c (function_argcount): If function needs to be autoloaded
+       actually use the loaded definition.
+       GCPRO function.
+
+2000-08-05  Ben Wing  <ben@xemacs.org>
+
+       * getloadavg.c: add prototype for getloadavg().  remove
+       duplicate WIN32_NATIVE/CYGWIN code (already in the middle
+       of the code).  remove duplicate header includes.
+
+       * s\cygwin32.h, s\mingw32.h: remove stray NO_ARG_ARRAY.
+       
+       * s\cygwin32.h, s\mingw32.h, m\windowsnt.h:
+       don't define LOAD_AVE_TYPE/LOAD_AVE_CVT because we have no
+       useful load average.
+
+       * alloc.c (reinit_alloc_once_early): removed references to
+       VIRT_ADDR_VARIES, malloc_sbrk_used/free, and data-bytes-used/free.
+       the lisp vars are the only things referencing the malloc_sbrk_*
+       vars, and they were already if 0'd out.  these vars only exist
+       in the older malloc.c, which is basically unused, and they're
+       only for informational purposes.
+
+       * m\*.h: removed useless VIRT_ADDR_VARIES.
+
+       * m\powerpc.h: removed stray NO_ARG_ARRAY.
+
+2000-04-26  IKEYAMA Tomonori  <tomonori@suiyokai.org>
+
+        * redisplay-msw.c (mswindows_output_dibitmap): Set foreground
+        color if the image is a mono pixmap.
+
+2000-07-30  Ben Wing  <ben@xemacs.org>
+
+       * Makefile.in.in (release):
+       Remove stray @.
+       
+       * buffer.c (directory_is_current_directory):
+       * dired-msw.c (mswindows_get_files):
+       * dired.c:
+       * dired.c (Fdirectory_files):
+       * dired.c (file_name_completion_stat):
+       * dired.c (Ffile_attributes):
+       [[[[1]]]]: Rename stat() -> xemacs_stat() and eliminate nasty
+       preprocessor tricks, to avoid problems on some machines
+       (e.g. SCO).
+
+       * callproc.c (egetenv): GC docs.
+       
+       * console-msw.h:
+       * console-msw.h (struct mswindows_dialog_id):
+       * lrecord.h (lrecord_type):
+       New object for use with MSW dialogs.
+       
+       * console.h (struct console_methods):
+       New enable/disable frame methods, for proper modal dialogs.
+       
+       * device-msw.c (msprinter_default_printer): Fix to follow
+       proper Mule conventions.
+       
+       * device-msw.c:
+       * device-msw.c (signal_open_printer_error):
+       * device-msw.c (msprinter_init_device):
+       * device-msw.c (ensure_not_printing):
+       * device-msw.c (plist_get_margin):
+       * device-msw.c (Fmsprinter_select_settings):
+       * device-msw.c (finalize_devmode):
+       * device-msw.c (Fmsprinter_settings_despecialize):
+       * device-msw.c (signal_enum_priner_error):
+       * extents.c (decode_extent):
+       * extents.c (decode_map_extents_flags):
+       * extents.c (decode_extent_at_flag):
+       * extents.c (Fextent_at):
+       * extents.c (Fextents_at):
+       * extents.c (symbol_to_glyph_layout):
+       [[[[2]]]] Use structured errors.
+       
+       * dialog-msw.c:
+       * dialog-msw.c (mswindows_is_dialog_msg):
+       * dialog-msw.c (mark_mswindows_dialog_id):
+       * dialog-msw.c (dialog_proc):
+       * dialog-msw.c (handle_question_dialog_box):
+       * dialog-msw.c (syms_of_dialog_mswindows):
+       Define new object to clean up marking; use it as a dialog identifier.
+       Call new delete-dialog-box-hook.
+       
+       * dialog-x.c (dbox_selection_callback):
+       * dialog-x.c (dbox_descriptor_to_widget_value):
+       * dialog-x.c (x_make_dialog_box_internal):
+       Call new delete-dialog-box-hook.
+       Return an id.
+
+       * dialog.c:
+       * dialog.c (syms_of_dialog):
+       * dialog.c (vars_of_dialog):
+       Define new delete-dialog-box-hook, for use w/modal dialog boxes.
+       
+       * eval.c:
+       * eval.c (signal_call_debugger):
+       when noninteractive, output stack traces on the console instead
+       of in a (never-seen) buffer.
+       
+       * eval.c (signal_type_error):
+       * eval.c (invalid_argument_2):
+       * lisp.h:
+       new funs for use w/structured errors.
+       
+       * event-Xt.c:
+       * event-Xt.c (x_to_emacs_keysym):
+       * event-Xt.c (describe_event):
+       * event-Xt.c (emacs_Xt_event_handler):
+       * event-Xt.c (vars_of_event_Xt):
+       * event-msw.c:
+       * event-msw.c (mswindows_wnd_proc):
+       * event-msw.c (vars_of_event_mswindows):
+       rename {x,mswindows}-debug-events to debug-{}-events for
+       consistency with other debug-foo variables.
+       
+       * event-stream.c:
+       document next-event more clearly.
+       
+       * fileio.c (Ffile_name_directory):
+       * fileio.c (Ffile_name_nondirectory):
+       * fileio.c (Funhandled_file_name_directory):
+       * fileio.c (file_name_as_directory):
+       * fileio.c (Ffile_name_as_directory):
+       * fileio.c (directory_file_name):
+       * fileio.c (Fdirectory_file_name):
+       * fileio.c (Fmake_temp_name):
+       * fileio.c (Ffile_truename):
+       * fileio.c (Fsubstitute_in_file_name):
+       * fileio.c (expand_and_dir_to_file):
+       * fileio.c (barf_or_query_if_file_exists):
+       * fileio.c (check_executable):
+       * fileio.c (Ffile_exists_p):
+       * fileio.c (Ffile_writable_p):
+       * fileio.c (Ffile_directory_p):
+       * fileio.c (Ffile_regular_p):
+       * fileio.c (Ffile_modes):
+       * fileio.c (Ffile_newer_than_file_p):
+       * fileio.c (Fverify_visited_file_modtime):
+       * fileio.c (Fset_visited_file_modtime):
+       * fileio.c (auto_save_1):
+       (1). (2).
+       fix up gcpro's.
+       
+       * frame-msw.c:
+       * frame-msw.c (mswindows_init_frame_1):
+       * frame-msw.c (mswindows_enable_frame):
+       * frame-msw.c (error_frame_unsizable):
+       * frame-msw.c (msprinter_init_frame_1):
+       * frame-msw.c (msprinter_init_frame_3):
+       * frame-msw.c (console_type_create_frame_mswindows):
+       (2).
+       implement new enable/disable frame methods.
+       
+       * frame-x.c:
+       * frame-x.c (x_enable_frame):
+       * frame-x.c (console_type_create_frame_x):
+       implement new enable/disable frame methods.
+       
+       * frame.c:
+       * frame.c (Fdisable_frame):
+       * frame.c (syms_of_frame):
+       * frame.h (struct frame):
+       implement new enable/disable frame methods/functions.
+       
+       * general-slots.h:
+       add initial-focus.
+       
+       * glyphs-msw.c (mswindows_widget_instantiate):
+       comment that initial-focus should be implemented.
+       
+       * glyphs-widget.c:
+       * glyphs-widget.c (check_valid_instantiator):
+       * glyphs-widget.c (check_valid_orientation):
+       * glyphs-widget.c (check_valid_tab_orientation):
+       * glyphs-widget.c (check_valid_justification):
+       * glyphs-widget.c (check_valid_border):
+       * glyphs-widget.c (check_valid_callback):
+       * glyphs-widget.c (check_valid_int_or_function):
+       * glyphs-widget.c (check_valid_string_or_vector):
+       * glyphs-widget.c (check_valid_item_list_1):
+       * glyphs-widget.c (widget_validate):
+       * glyphs-widget.c (combo_box_validate):
+       * glyphs-widget.c (widget_instantiate):
+       * glyphs-widget.c (syms_of_glyphs_widget):
+       * glyphs-widget.c (VALID_WIDGET_KEYWORDS):
+       * glyphs-widget.c (image_instantiator_combo_box):
+       * glyphs-widget.c (image_instantiator_scrollbar):
+       * glyphs-widget.c (image_instantiator_tab_control):
+       * glyphs-widget.c (VALID_LAYOUT_KEYWORDS):
+       (2).
+       support (unimplemented) keyword initial-focus.
+       reindent long macros.
+       
+       * glyphs-x.c (x_redisplay_widget):
+       * glyphs-x.c (x_button_instantiate):
+       * glyphs-x.c (x_button_redisplay):
+       * glyphs-x.c (x_progress_gauge_instantiate):
+       * glyphs-x.c (x_edit_field_instantiate):
+       * glyphs-x.c (x_combo_box_instantiate):
+       * glyphs-x.c (x_tab_control_instantiate):
+       * glyphs-x.c (x_label_instantiate):
+       * gui-x.c:
+       * gui-x.c (button_item_to_widget_value):
+       * gui-x.c (gui_items_to_widget_values_1):
+       * gui-x.c (gui_item_children_to_widget_values):
+       * gui-x.c (gui_items_to_widget_values):
+       * gui-x.h:
+       * menubar-x.c (menu_item_descriptor_to_widget_value_1):
+       add new flag to gui-parsing routines to indicate whether
+       accelerator specs should be supported.
+       
+       * glyphs.c (syms_of_glyphs): use DEFSYMBOL.
+       
+       * glyphs.h (struct Lisp_Image_Instance):
+       * glyphs.h (IMAGE_INSTANCE_WANTS_INITIAL_FOCUS):
+       add initial-focus flag.
+       
+       * gui.c:
+       * gui.c (syms_of_gui):
+       * gui.c (vars_of_gui):
+       clean up menu-no-selection-hook.
+       
+       * gui.h:
+       support delete-dialog-box-hook.
+       
+       * lread.c (Fload_internal):
+       * lread.c (locate_file_in_directory_mapper):
+       (1).
+       
+       * lrecord.h:
+       * lrecord.h (struct toolbar_button):
+       * lrecord.h (syms_of_toolbar):
+       document how to create a new object.
+       
+       * menubar-msw.c (mswindows_char_is_accelerator):
+       may be called on frames w/o menus.
+
+       * menubar.c (vars_of_menubar):
+       clean up :filter docs.
+       
+       * nt.c (readdir):
+       * ntproc.c:
+       (1).
+       
+       * process-nt.c:
+       * process-nt.c (validate_signal_number):
+       * process-nt.c (signal_cannot_launch):
+       * process-nt.c (nt_create_process):
+       * process-nt.c (nt_send_process):
+       * process-nt.c (nt_kill_child_process):
+       * process-nt.c (nt_open_network_stream):
+       * process-nt.c (syms_of_process_nt):
+       (2).
+       delete quote-handling.  call new lisp code that does it better.
+       
+       * process-unix.c (connect_to_file_descriptor):
+       * process-unix.c (allocate_pty):
+       * process-unix.c (unix_send_process):
+       * process-unix.c (unix_kill_child_process):
+       * process-unix.c (unix_open_network_stream):
+       * process-unix.c (unix_open_multicast_group):
+       (1). (2).
+       
+       * process.c:
+       * process.c (Fstart_process_internal):
+       (2).  need to canonicalize process path even if absolute.
+       
+       * select-msw.c (symbol_to_ms_cf):
+       * select-msw.c (ms_cf_to_symbol):
+       * select-msw.c (cf_is_autofreed):
+       * select-msw.c (mswindows_destroy_selection):
+       * select.c:
+       * select.c (syms_of_select):
+       * select.h:
+       support dibv5, fix bugs. (from Mike Alexander)
+       
+       * select.c (Fget_selection_internal):
+       * select.c (select_convert_out):
+       
+       * sysdep.c:
+       * sysdep.c (xemacs_stat):
+       renamed.
+       
+       * sysdep.c (mkdir):
+       * sysdep.c (rmdir):
+       but keep original stat() here because we provide encapsulation
+       around these funs.
+       
+       * sysfile.h:
+       * sysfile.h (fstat):
+       remove stat garbage.
+       
+       * syswindows.h:
+       fix X/MSW conflict.
+       don't include tchar.h.  it's inappropriate because it makes
+       compile-time distinctions when we want runtime distinctions.
+       (we provide our own tchar replacements)
+       
+       * toolbar.c:
+       use default object printer for toolbar-button.
+       
+       * unexcw.c:
+       make sure we don't encapsulate.
+       
+       * window.c (vars_of_window):
+       emphasize that temp-buffer-show-hook is obsolete.
+
+2000-08-05  Martin Buchholz  <martin@xemacs.org>
+
+       * glyphs.c (image_instance_hash): HASH2 wants EMACS_INT args.
+       (Fimage_instance_subwindow_id): make_int wants EMACS_INT arg.
+
+       * events.c (Fevent_timestamp_lessp): 
+       Not 64-bit clean.  Use EMACS_INT, not int.
+
+2000-06-05  Andrew Begel <abegel@cs.berkeley.edu>
+
+       * lrecord.h (lrecord_types): Changed lrecord_type_count to an
+       unsigned int and changed the last enum to
+       lrecord_type_last_built_in_type. 
+       (lrecord_implementations_table): changed prototype to know how
+       long the array is supposed to be. 
+       (lrecord_type_count): new unsigned int to keep track of the
+       current number of lisp lrecord types.
+       (DEFINE_EXTERNAL_LRECORD):
+       (DECLARE_EXTERNAL_LRECORD): Added these two for external
+       dynamic-modules to declare new lisp types. They are the same
+       as the non-EXTERNAL forms, but declare an lrecord_type unsigned
+       int for each new type, and increment lrecord_type_count by 1.
+
+       * alloc.c (lrecord_implementations_table): Changed to reference
+       lrecord_type_last_built_in_type for the size of the array.
+       Moved MODULE_DEFINABLE_TYPE_COUNT to lrecord.h.
+
+2000-08-03  Yoshiki Hayashi  <yoshiki@xemacs.org>
+
+       * glyphs.h (check_valid_item_list): Renamed from
+       check_valid_item_list_1.
+
+2000-08-01 Alastair J. Houghton <ajhoughton@lineone.net>
+
+       * select.c (Qselect_coerce): New.
+       * select.c (Vselection_coercion_alist): New.
+       * select.c (syms_of_select): Declare.
+       * select.c (get-selection-internal): Use it.
+       Use the new select-coerce functionality.
+
+       * select.c (select_coerce): New.
+       * select.h (select_coerce): Declare.
+       New function to coerce one type of data into another.
+
+2000-08-03  Martin Buchholz  <martin@xemacs.org>
+
+       * callproc.c (Fcall_process_internal): 
+       (Fcall_process_internal): 
+       * process-unix.c (unix_create_process):
+       Save and restore the value of errno, so that error messages are accurate.
+
+2000-08-01  Martin Buchholz  <martin@xemacs.org>
+
+       * elhash.c (print_hash_table): 
+       Fix printing of hash tables to also use `key-and-value' instead of `t'.
+       Prettify docstrings and indentation.
+
+2000-07-31  Yoshiki Hayashi  <yoshiki@xemacs.org>
+
+       * window.c (Fwindow_pixel_edges): Subtract frame border and
+       gutter size.
+
+2000-07-31  Andy Piper  <andy@xemacs.org>
+
+       * buffer.c (Frecord_buffer): make absolutely sure that redisplay
+       will acknowledge the change.
+
+       * glyphs.h: declare tab_control_order_only_changed.
+
+       * glyphs-x.c (x_tab_control_redisplay): use
+       tab_control_order_only_changed.
+
+       * glyphs-widget.c (tab_control_order_only_changed): new function.
+
+       * glyphs-msw.c (mswindows_tab_control_redisplay): use
+       tab_control_order_only_changed.
+
+       * gui.c (gui_item_equal_sans_selected): new function.
+       (gui_item_equal): use it.
+
+       * glyphs-msw.c (mswindows_combo_box_instantiate): deprecate
+       :properties in favor of :items..
+
+       * glyphs-widget.c (check_valid_item_list): rename from
+       check_valid_item_list_1.
+       (check_valid_item_list_1): renamed.
+       (combo_box_validate): deprecate :properties in favor of :items.
+       (widget_instantiate): ditto.
+       (tab_control_update): ditto.
+       (image_instantiator_combo_box): ditto.
+       (image_instantiator_tree_view): ditto.
+       (image_instantiator_tab_control): ditto.
+       (layout_post_instantiate): remove dead code.
+
+       * print.c (debug_print_no_newline): only write to debugger if in
+       WIN32_NATIVE.
+
+       * elhash.c (Fmake_hash_table): update doc string.
+
+       * event-msw.c (mswindows_wnd_proc): don't allow processing of
+       messages whilst in GC. This at least stops XEmacs crashing but has
+       the potential for wierd behaviour.
+
+2000-07-31  Martin Buchholz  <martin@xemacs.org>
+
+       * config.h.in:
+       Make existence of s&m files optional.
+       
+       * s/bsd386.h: Remove HAVE_GETLOADAVG.
+       * s/freebsd.h: Remove HAVE_GETLOADAVG.
+       * s/gnu.h: Remove HAVE_GETLOADAVG.
+       * s/netbsd.h: Remove HAVE_GETLOADAVG.
+       * s/sol2.h: Remove HAVE_GETLOADAVG.
+       * lisp.h: Remove getloadavg() declaration.
+       * fns.c:
+       Include <sys/loadavg.h> if available.
+       Don't declare our own getloadavg() if HAVE_GETLOADAVG.
+       * config.h.in:  Group together getloadavg()-related macros.
+       Use only configure-time tests to detect getloadavg().
+
+2000-07-30  Martin Buchholz  <martin@xemacs.org>
+
+       * Makefile.in.in (TransientEmacsShell.o): Fix race condition.
+
+2000-07-25  Andy Piper  <andy@xemacs.org>
+
+       * syswindows.h: add tchar.h for native builds.
+
+       * frame.c (syms_of_frame): remove set-glyph-image.
+
+       * general-slots.h: add Qset_glyph_image.
+
+       * glyphs-widget.c (layout_update): add domain arg to
+       set-glyph-image.
+       (syms_of_glyphs_widget): remove set-glyph-image.
+
+2000-07-23  Ben Wing  <ben@xemacs.org>
+
+       * dialog-msw.c (vars_of_dialog_mswindows): need to staticpro
+       Vpopup_frame_list.
+
+2000-07-22  Andy Piper  <andy@xemacs.org>
+
+       * symsinit.h: add syms_of_win32().
+
+       * gui-msw.c (syms_of_gui_mswindows): remove
+       Fmswindows_shell_execute.
+       (Fmswindows_shell_execute): moved to win32.c.
+
+       * emacs.c (main_1): add syms_of_win32 ().
+
+       * win32.c (init_potentially_nonexistent_functions): rewrite in
+       compiler-friendly terms.
+       (Fmswindows_shell_execute): move here from gui-msw.c.
+       (syms_of_win32): new.
+
+       * device-msw.c (Fmswindows_printer_list): clean up args to
+       EnumPrinters.
+       Don't include tchar under cygwin or mingw.
+       (msprinter_default_printer): make cygwin-friendly.
+
+2000-07-21  Andy Piper  <andy@xemacs.org>
+
+       * glyphs-widget.c (image_instantiator_tree_view): use tab
+       control's update function.
+       (layout_property): new function. Retrieve items.
+
+       * glyphs-msw.c (mswindows_tree_view_redisplay): new
+       function. Re-populate the tree view from the pending items.
+
+       * glyphs.c (instantiate_image_instantiator): Make sure the domain
+       is designated the parent if the domain is an image instance. This
+       is needed so that dirtiness can be cascade up the hierarchy and
+       thus for layout children to be redisplayed correctly.
+       (allocate_image_instance): rename glyph -> parent.
+
+       * redisplay.h: change redisplay_output_layout signature.
+
+       * redisplay-msw.c (mswindows_output_display_block): use domain
+       arg.
+
+       * redisplay-x.c (x_output_display_block): use domain arg.
+
+2000-07-10  Andy Piper  <andy@xemacs.org>
+
+       * window.c (Fset_window_configuration): add comment.
+
+       * redisplay-output.c (compare_runes): 
+       (redisplay_output_subwindow): redisplay rather than update subwindow.
+       (redisplay_output_layout): ditto.
+
+       * redisplay-msw.c (mswindows_frame_output_end):
+       (mswindows_frame_output_end): make defer window pos optional.
+
+       * lisp.h: add Flast.
+
+       * glyphs.h (struct image_instantiator_methods): add dest_mask top
+       normalize method. Change update method to be for changed
+       instantiators. Add redisplay method. Change signature of layout
+       method.
+       (struct Lisp_Image_Instance): add instantiator.
+       (IMAGE_INSTANCE_INSTANTIATOR): new.
+       (IMAGE_INSTANCE_SUBWINDOW_FACE): new.
+       (XIMAGE_INSTANCE_INSTANTIATOR): new.
+       (XIMAGE_INSTANCE_SUBWINDOW_FACE): new.
+
+       * glyphs.c:
+       (find_instantiator_differences): new function.
+       (Fset_instantiator_property): new convenience function.
+       (check_image_instance_structure): strictly check for vector
+       instantiators.
+       (normalize_image_instantiator): make non-static.
+       (instantiate_image_instantiator): pass on dest_mask and use new
+       signatures for image_instance_layout and friends.
+       (mark_image_instance): mark the instantiator. Mark the subwindow
+       face not the widget face.
+       (image_instance_equal): add instantiator.
+       (image_instance_hash): ditto.
+       (allocate_image_instance): ditto.
+       (Fset_image_instance_property): removed.
+       (Fimage_instance_file_name): ditto.
+       (Fcolorize_image_instance): ditto.
+       (image_instance_layout): add offsets to be set.
+       (update_image_instance): new function. update an image instance
+       from its changed instantiator.
+       (inherit_normalize): add dest_mask.
+       (xbm_normalize): ditto.
+       (xface_normalize): ditto.
+       (xpm_normalize): ditto.
+       (text_update): set_property -> update.
+       (image_instantiate): use the glyph identity as a hash key, not the
+       instantiator.
+       (glyph_width): use new image_instance_layout signature.
+       (glyph_ascent): ditto.
+       (glyph_descent): ditto.
+       (glyph_height): ditto.
+       (glyph_query_geometry): ressurrect.
+       (glyph_layout): ditto.
+       (redisplay_subwindow): update -> redisplay.
+       (syms_of_glyphs): add Fset_instantiator_property.
+       (image_instantiator_format_create): set_property -> update.
+
+       * glyphs-x.c:
+       (autodetect_normalize): add dest_maks to signature.
+       (x_redisplay_subwindow): update -> redisplay.
+       (x_redisplay_widget): ditto.
+       (x_button_redisplay): ditto.
+       (x_progress_gauge_redisplay): ditto.
+       (x_tab_control_redisplay): ditto. Rewrite to cope with changed
+       stacking order.
+       (console_type_create_glyphs_x): update -> redisplay.
+       (image_instantiator_format_create_glyphs_x): ditto.
+
+       * glyphs-widget.c:
+       (check_valid_instantiator): disallow glyphs in the instantiator,
+       they must now be vectors.
+       (check_valid_instantiator_list): ditto.
+       (glyph_instantiator_to_glyph): use internal symbol rather than
+       intern.
+       (widget_update): renamed from widget_set_property. Call cascaded
+       update methods.
+       (redisplay_widget): renamed from update_widget.
+       (widget_layout): image_instance_layout now takes position as well
+       as size.
+       (widget_normalize): ditto.
+       (widget_instantiate): ditto.
+       (tab_control_query_geometry) ditto.:
+       (tab_control_update): renamed from tab_control_set_property.
+       (progress_gauge_update): set_property -> update.
+       (layout_normalize): rewrite so that child instantiators are
+       normalized also.
+       (layout_update): new function. Create glyphs from the normalized
+       children and cope with any other layout keywords. We do not
+       instantiate children here that will be take care of by
+       redisplay_output_layout.
+       (layout_instantiate): call layout_update and not much else.
+       (layout_post_instantiate): not sure whether this is needed
+       anymore.
+       (layout_query_geometry): query glyph geometry rather than
+       image_instance geometry.
+       (layout_layout): set offsets from pass in parameters. Use glyph
+       geometry and layout functions rather than image instance ones.
+       (native_layout_layout): ditto.
+       (syms_of_glyphs_widget): add make-glyph and set-glyph-image.
+       (image_instantiator_widget): set_property -> update.
+       (image_instantiator_buttons): ditto.
+       (image_instantiator_progress_guage): ditto.
+       (image_instantiator_tab_control): ditto.
+       (VALID_LAYOUT_KEYWORDS): instantiators must now be vectors.
+       (image_instantiator_layout): add update method.
+
+       * glyphs-msw.c (bmp_normalize):
+       (mswindows_resource_normalize): add dest_mask so that it can be
+       proprogated by layout_normalize.
+       (begin_defer_window_pos): make optional because it may not be the
+       right thing to do and it introduces differences with X.
+       (mswindows_unmap_subwindow): ditto.
+       (mswindows_map_subwindow): ditto.
+       (mswindows_redisplay_subwindow): renamed from
+       mswindows_update_subwindow.
+       (mswindows_redisplay_widget): ditto.
+       (mswindows_button_redisplay): renamed from
+       mswindows_button_update. Update is now what the instantiation
+       function does for a changed instantiator.
+       (mswindows_progress_gauge_instantiate): set the progress value
+       here if appropriate.
+       (mswindows_tab_control_redisplay): cope with re-ordering of the
+       members of the tab widget by simply selecting the new top
+       widget. This makes things appear ok if you click on a tab.
+       (mswindows_combo_box_instantiate): image_instance_layout now takes
+       position as well as size.
+       (mswindows_progress_gauge_redisplay): renamed from
+       mswindows_progress_gauge_update.
+       (console_type_create_glyphs_mswindows): fix update -> redisplay.
+       (image_instantiator_format_create_glyphs_mswindows): ditto.
+
+       * glyphs-eimage.c (jpeg_normalize):
+       (gif_normalize):
+       (png_normalize):
+       (tiff_normalize): add dest_mask so that it can be proprogated by
+       layout_normalize.
+
+       * elhash.c:
+       (print_hash_table):
+       (hash_table_weakness_validate):
+       (decode_hash_table_weakness):
+       (Fhash_table_weakness):
+       (Fhash_table_type):
+       (syms_of_elhash): use Ben's naming scheme for hashtable types..
+
+       * console.h (struct console_methods): move update_* to
+       redisplay_*.
+
+2000-07-20  Ben Wing  <ben@xemacs.org>
+
+       * *.[ch] (XSETOBJ): remove unused middle argument.
+       lisp-disunion.h: correct wrap_object() to one argument.
+       
+2000-07-15  Ben Wing  <ben@xemacs.org>
+
+        * s/cygwin32.h:
+        * s/cygwin32.h (CYGWIN_CONV_PATH):
+        Add missing logb prototype for v1.1.
+        Use post-b20 names and alias to pre-b20 names when pre-b20.
+
+        * s/windowsnt.h: [5].
+
+2000-07-15  Ben Wing  <ben@xemacs.org>
+
+       * Makefile.in.in (x_objs):
+       * Makefile.in.in (sheap_objs):
+       * Makefile.in.in (objs):
+       added win32.o, cosmetic cleanups.
+       
+        * alloc.c (Fmake_byte_code):
+        [[[1]]]: Changes for new LIST_LOOP, EXTERNAL_LIST_LOOP,
+        etc. macros which declare their own args now.
+
+        * alloc.c (syms_of_alloc):
+        [[[2]]]: Use DEFSYMBOL, DEFKEYWORD, DEFERROR and friends.
+
+        * buffer.c:
+        Moved buffer-dedicated-frame, set-buffer-dedicated-frame into lisp.
+
+        * buffer.c (Fget_file_buffer):
+        Fixed GCPRO problem.
+
+        * buffer.c (get_truename_buffer):
+        Fixed comment about GC checking.
+
+        * buffer.c (syms_of_buffer):
+        Undeclared those dedicated frame funs.
+        [2].
+
+        * buffer.h:
+        Define convenience macros for internal/external conversions.
+       [[[3]]]: Define codesys aliases Qcommand_argument_encoding
+        and Qenvironment_variable_encoding for cleaner code.
+
+        * bufslots.h:
+        Remove dedicated-frame; in lisp.
+
+        * bytecode.c (funcall_compiled_function):
+        [1].
+
+        * bytecode.c (syms_of_bytecode):
+        [2].
+
+        * console-msw.c:
+        * console-msw.c (mswindows_show_console): Rewrote.
+
+        * console-msw.c (Fmswindows_debugging_output): New.
+        Sends to OutputDebugString (special MSWin debugger interface).
+
+        * console-msw.c (Fmswindows_message_box):
+        Fixed stupid bugs so it works when called from kill-emacs.
+
+        * console-msw.c (syms_of_console_mswindows):
+        Declare Fmswindows_debugging_output.
+
+        * console-msw.h:
+        New MSWin prototypes.
+
+        * console-msw.h (struct mswindows_frame):
+        New entry last-click-mods for improved button-modifier support.
+
+        * console-msw.h (FRAME_MSWINDOWS_POPUP):
+        New struct entry `popup' with corresponding accessor.
+
+        * console-x.c:
+        * console-x.c (split_up_display_spec):
+        * console-x.c (get_display_arg_connection):
+        * console-x.c (x_semi_canonicalize_console_connection):
+        * console-x.c (x_canonicalize_device_connection):
+        [[[6]]]: Change char to more specific type.
+        [[[8]]]: Make use of abstracting codesys aliases defined in [3], [4];
+
+        * console-x.c (x_semi_canonicalize_console_connection):
+        * console-x.c (x_canonicalize_device_connection):
+        [[[9]]]: Fix up error signalling to use new structured error system.
+
+        * console-x.h:
+        [[[4]]]: Define codesys aliases:
+        Qlwlib_encoding, Qx_atom_name_encoding, Qx_font_name_encoding,
+        Qx_color_name_encoding, Qx_display_name_encoding.
+
+        * console.h (struct console_methods):
+        New method make_dialog_box_internal supersedes older
+        popup_dialog_box method.
+
+        * data.c:
+        Define many new errors, part of new structured errors.
+
+        * data.c (init_errors_once_early):
+        * data.c (syms_of_data):
+        [2].
+
+        * device-msw.c (mswindows_init_device):
+        [[[5]]]: Cleanup to support NT 3.51.
+
+        * device-msw.c (decode_devmode): Cleanup.
+
+        * device-msw.c (mswindows_handle_print_setup_dialog_box):
+        * device-msw.c (mswindows_handle_print_dialog_box):
+        * device-msw.c (mswindows_handle_page_setup_dialog_box):
+        * device-msw.c (syms_of_device_mswindows):
+        Delete the dialog box primitives recently introduced by Kirill and
+       instead interface to general dialog box interface.
+
+        * device-x.c:
+        * device-x.c (compute_x_app_name):
+        * device-x.c (x_init_device):
+        * device-x.c (Fx_valid_keysym_name_p):
+        * device-x.c (Fx_set_font_path):
+        [6].
+        [7].
+
+        * device.h (wrap_device): New.
+        First of its kind; meant to replace XSETDEVICE.
+
+        * dialog-msw.c: Many file-dialog symbols.
+
+        * dialog-msw.c (mswindows_register_popup_frame): New.
+        * dialog-msw.c (mswindows_is_dialog_msg): New.
+        For supporting kbd traversal in dialog boxes.
+
+        * dialog-msw.c (dialog_proc):
+        Support hitting ESC in dialogs.
+
+        * dialog-msw.c (struct):
+        Common dialog box errors.
+
+        * dialog-msw.c (handle_file_dialog_box): New.
+        Add file dialog code.
+
+        * dialog-msw.c (handle_question_dialog_box):
+        Redo existing code to support new question dialog syntax.
+
+        * dialog-msw.c (console_type_create_dialog_mswindows):
+        We support new dialog console method.
+
+        * dialog-msw.c (syms_of_dialog_mswindows):
+        * dialog-msw.c (vars_of_dialog_mswindows):
+        New file dialog symbols, vars.
+
+        * dialog-x.c:
+        * dialog-x.c (maybe_run_dbox_text_callback):
+        * dialog-x.c (dbox_descriptor_to_widget_value):
+        * dialog-x.c (x_make_dialog_box_internal):
+        * dialog-x.c (console_type_create_dialog_x):
+        Mule-ize entire file.
+        Redo to support question dialog syntax.
+        [6].
+
+        * dialog.c:
+        * dialog.c (Fmake_dialog_box_internal):
+        * dialog.c (syms_of_dialog):
+        Kill old popup-dialog-box, replace with new primitive.
+        Just call device method or signal error.
+
+        * eldap.c (Fldap_open):
+        * eldap.c (Fldap_search_basic):
+        * eldap.c (Fldap_add):
+        * eldap.c (Fldap_modify):
+        [1].
+        [7].
+
+        * emacs.c:
+        * emacs.c (make_arg_list_1):
+        * emacs.c (make_arg_list):
+        Mule-ize call to dll_init().
+        [6].
+        [8].
+
+        * emacs.c (make_argc_argv):
+        * emacs.c (free_argc_argv):
+        * emacs.c (init_cmdargs):
+        * emacs.c (main_1):
+        * emacs.c (Fkill_emacs):
+        * emacs.c (Fdump_emacs):
+        Update comments about what can be used in syms_* etc.
+        Call init_win32() when necessary.
+        Fix up MS Win dialog box in kill-buffer to actually work right.
+        [7].
+
+        * eval.c:
+        * eval.c (For):
+        * eval.c (Fand):
+        * eval.c (Fprogn):
+        * eval.c (Fprog1):
+        * eval.c (Fprog2):
+        * eval.c (FletX):
+        * eval.c (Flet):
+        * eval.c (condition_case_3):
+        * eval.c (Feval):
+        * eval.c (function_argcount):
+        * eval.c (funcall_lambda):
+        [1].
+
+        * eval.c (type_error): New.
+        * eval.c (maybe_type_error): New.
+        * eval.c (continuable_type_error): New.
+        * eval.c (maybe_continuable_type_error): New.
+        * eval.c (type_error_with_frob): New.
+        * eval.c (maybe_type_error_with_frob): New.
+        * eval.c (continuable_type_error_with_frob): New.
+        * eval.c (maybe_continuable_type_error_with_frob): New.
+        New functions for use with structured errors.
+
+        * event-Xt.c:
+        * event-Xt.c (x_event_to_emacs_event):
+        Buttons are now modifiers too.
+
+        * event-Xt.c (emacs_Xt_current_event_timestamp):
+        Implement new event method.
+        * event-Xt.c (reinit_vars_of_event_Xt): Set it.
+
+        * event-msw.c:
+        * event-msw.c (ntpipe_shove_writer): [5].
+        * event-msw.c (mswindows_enqueue_mouse_button_event):
+        * event-msw.c (mswindows_drain_windows_queue):
+        * event-msw.c (mswindows_wnd_proc): [7].
+        * event-msw.c (mswindows_current_layout_has_AltGr): [5].
+        * event-msw.c (mswindows_modifier_state):
+        Throughout: support new button modifiers.
+
+        * event-msw.c (emacs_mswindows_current_event_timestamp):
+        Implement new event method.
+        * event-msw.c (reinit_vars_of_event_mswindows): Set it.
+
+        * event-stream.c:
+        * event-stream.c (event_stream_current_event_timestamp): New.
+        * event-stream.c (maybe_kbd_translate): New functionality.
+        * event-stream.c (vars_of_event_stream):
+        Document new kbd-translate-table functionality.
+
+        * event-stream.c (Fcurrent_event_timestamp): New.
+        New primitive for use in fabricated events.
+        * event-stream.c (syms_of_event_stream): [2]. Declare new primitive.
+
+        * events-mod.h (XEMACS_MOD_BUTTON1): new button modifiers.
+
+        * events.c:
+        * events.c (Fmake_event):
+        * events.c (WRONG_EVENT_TYPE_FOR_PROPERTY):
+        [1].
+        [9].
+
+        * events.c (format_event_object): fix gcc warnings.
+
+        * events.c (Fevent_timestamp): Document new primitives.
+
+        * events.c (TIMESTAMP_HALFSPACE): New.
+
+        * events.c (Fevent_timestamp_lessp): New.  New primitive for
+       comparing timestamps correctly (half-space algorithm).
+
+        * events.c (Fevent_modifier_bits): Doc fix.
+
+        * events.c (Fevent_modifiers): Major doc addition.
+        * events.c (event_x_y_pixel_internal): Typo fix.
+        * events.c (syms_of_events): Declare new primitives.
+
+        * events.h:
+        Update long comment for button modifiers, timestamps.
+
+        * events.h (struct event_stream):
+        New current_event_timestamp method.
+
+        * extents.c:
+        * extents.c (extent_in_region_p):
+        * extents.c (decode_extent):
+        * extents.c (Fset_extent_parent):
+        * extents.c (decode_map_extents_flags):
+        Fix gcc warnings.
+        [9].
+
+        * extents.c (struct extent_at_arg):
+        * extents.c (decode_extent_at_flag):
+        * extents.c (extent_at_mapper):
+        * extents.c (extent_at_bytind):
+        * extents.c (Fextent_at): Adapt to new lower-level interface. [9].
+        * extents.c (Fextents_at): New primitive. [9].
+        * extents.c (symbol_to_glyph_layout): [9].
+        Support new primitive `extents-at'.
+
+
+        * extents.c (get_text_property_bytind):
+        extent_at_bytind has another arg.
+        [9].
+
+        * extents.c (syms_of_extents): New primitive.
+
+        * file-coding.c (Fmake_coding_system): [1].
+        * file-coding.c (subsidiary_coding_system): fix gcc warning
+        * file-coding.c (syms_of_file_coding): [2].
+
+        * fileio.c (Fexpand_file_name):
+        * fileio.c (Fsysnetunam):
+        * fileio.c (Ffile_exists_p):
+        * fileio.c (Ffile_executable_p):
+        * fileio.c (Fverify_visited_file_modtime):
+        Clean up GCPROing.
+
+        * fileio.c (syms_of_fileio): [2].
+
+        * filelock.c (lock_file_1):
+        * filelock.c (current_lock_owner):
+        * filelock.c (lock_if_free):
+        * filelock.c (lock_file):
+        * filelock.c (unlock_file):
+        Clean up GCPROing.
+
+        * fns.c (concat): Fix gcc warning.
+
+        * fns.c (Fmember):
+        * fns.c (Fold_member):
+        * fns.c (Fmemq):
+        * fns.c (Fold_memq):
+        * fns.c (memq_no_quit):
+        * fns.c (Fassoc):
+        * fns.c (Fold_assoc):
+        * fns.c (Fassq):
+        * fns.c (Fold_assq):
+        * fns.c (assq_no_quit):
+        * fns.c (Frassoc):
+        * fns.c (Fold_rassoc):
+        * fns.c (Frassq):
+        * fns.c (Fold_rassq):
+        * fns.c (rassq_no_quit):
+        * fns.c (Fdelete):
+        * fns.c (Fold_delete):
+        * fns.c (Fdelq):
+        * fns.c (Fold_delq):
+        * fns.c (delq_no_quit):
+        * fns.c (Fremassoc):
+        * fns.c (Fremassq):
+        * fns.c (remassq_no_quit):
+        * fns.c (Fremrassoc):
+        * fns.c (Fremrassq):
+        * fns.c (remrassq_no_quit):
+        * fns.c (Freverse):
+        * fns.c (mapcar1):
+        [1].
+
+        * frame-msw.c (mswindows_init_frame_1):
+        * frame-msw.c (mswindows_delete_frame):
+        Register popups with dialog code so keyboard traversing works.
+
+        * frame-tty.c (tty_raise_frame_no_select): [1].
+
+        * frame-x.c:
+        * frame-x.c (x_set_frame_text_value):
+        * frame-x.c (x_set_frame_properties):
+        * frame-x.c (x_create_widgets):
+        [7].
+
+        * frame.c:
+        * frame.c (Fmouse_pixel_position): Minor doc fixes.
+
+        * frame.h (wrap_frame): New.
+        Macro like wrap_device.
+
+        * general.c:
+        * general.c (SYMBOL):
+        * general.c (syms_of_general):
+        Major reorg.  This is now just a wrapper and symbols themselves
+        are listed in general-slots.h.
+
+        * glyphs-eimage.c (tiff_instantiate): Need cast to fix warning.
+        * glyphs-msw.c (mswindows_resource_instantiate): [5].
+
+        * glyphs-msw.c (mswindows_native_layout_instantiate):
+        Add DS_CONTROL so keyboard traversal will work.
+
+        * glyphs-widget.c:
+        * glyphs-widget.c (syms_of_glyphs_widget):
+        Move some symbols to general-slots.h.
+
+        * glyphs-x.c:
+        * glyphs-x.c (xbm_instantiate_1):
+        * glyphs-x.c (x_xbm_instantiate):
+        * glyphs-x.c (x_xface_instantiate):
+        * glyphs-x.c (autodetect_instantiate):
+        * glyphs-x.c (cursor_font_instantiate):
+        * glyphs-x.c (x_update_widget):
+        * glyphs-x.c (x_widget_instantiate):
+        * glyphs.c (bitmap_to_lisp_data):
+        * glyphs.c (pixmap_to_lisp_data):
+        [7].
+
+        * glyphs.c (syms_of_glyphs):
+        [2].
+
+        * gui-x.c:
+        * gui-x.c (print_widget_value):
+        * gui-x.c (menu_separator_style_and_to_external):
+        * gui-x.c (add_accel_and_to_external):
+        * gui-x.c (button_item_to_widget_value):
+        * gui-x.c (gui_items_to_widget_values_1):
+        * gui-x.c (gui_items_to_widget_values):
+        * gui-x.c (syms_of_gui_x):
+        * gui-x.c (vars_of_gui_x):
+        Mule-ize entire file.  Move menu-no-selection-hook to gui.c.
+        [9].
+
+        * gui-x.h:
+        Muleize, prototype changes matching gui-x.c.
+
+        * gui.c:
+        * gui.c (separator_string_p):
+        * gui.c (gui_item_add_keyval_pair):
+        * gui.c (make_gui_item_from_keywords_internal):
+        * gui.c (signal_too_long_error):
+        * gui.c (parse_gui_item_tree_item):
+        * gui.c (syms_of_gui):
+        * gui.c (vars_of_gui):
+        * gui.h:
+        menu-no-selection-hook moved here (used by MSWin).
+        Move some symbols to general-slots.h.
+        [6].
+        [9].
+
+        * insdel.c (get_buffer_pos_char):
+        * insdel.c (get_buffer_range_char):
+        Add GC comments.
+
+        * keymap.c (keymap_lookup_directly):
+        * keymap.c (keymap_store):
+        * keymap.c (ensure_meta_prefix_char_keymapp):
+        * keymap.c (describe_map):
+        * keymap.h:
+        Support new button modifiers.
+
+        * lisp-disunion.h (wrap_object):
+        * lisp-disunion.h (XSETOBJ):
+        Rename make_obj to wrap_object.
+
+        * lisp-union.h:
+        * lisp-union.h (make_int):
+        * lisp-union.h (make_char):
+        Support wrap_object.
+
+        * lisp.h:
+        * lisp.h (LIST_LOOP):
+        * lisp.h (EXTERNAL_LIST_LOOP):
+        * lisp.h (LIST_LOOP_2):
+        * lisp.h (EXTERNAL_LIST_LOOP_1):
+        * lisp.h (EXTERNAL_LIST_LOOP_2):
+        * lisp.h (EXTERNAL_LIST_LOOP_3):
+        * lisp.h (EXTERNAL_LIST_LOOP_4_NO_DECLARE):
+        * lisp.h (PRIVATE_EXTERNAL_LIST_LOOP_6):
+        * lisp.h (GET_EXTERNAL_LIST_LENGTH):
+        * lisp.h (EXTERNAL_ALIST_LOOP_5):
+        * lisp.h (EXTERNAL_ALIST_LOOP_6):
+        * lisp.h (EXTERNAL_ALIST_LOOP_6_NO_DECLARE):
+        * lisp.h (EXTERNAL_PROPERTY_LIST_LOOP_5_NO_DECLARE):
+        * lisp.h (EXTERNAL_PROPERTY_LIST_LOOP_7):
+        * lisp.h (struct Lisp_Symbol):
+        * lisp.h (maybe_continuable_error_with_frob):
+        Fix up section comments.
+        Add new types for char to indicate usage.
+        Delete symbols auto-generated from general-slots.h.
+        Add prototypes for structured error functions.
+        Add long comments describing looping macros and change interface
+        so that lvalues are automatically declared.
+       Add NO_DECLARE macro in case callers want to declare lvalues
+       themselves.
+
+        * lread.c (read_syntax_error):
+        * lread.c (continuable_read_syntax_error):
+        * lread.c (read_structure):
+        * lread.c (sequence_reader):
+        * lread.c (read_list_conser):
+        * lread.c (read_compiled_function):
+        Rename syntax_error and continuable_syntax_error to avoid clash
+        with same-named structured error functions.
+
+        * menubar-msw.c (mswindows_translate_menu_or_dialog_item):
+        * menubar-msw.c (populate_menu_add_item):
+        * menubar-msw.c (populate_or_checksum_helper):
+        [5].
+        [9].
+
+        * menubar-x.c:
+        * menubar-x.c (menu_item_descriptor_to_widget_value_1):
+        Mule-ize whole file.
+
+        * menubar.c (Fnormalize_menu_item_name): Add optimization.
+
+        * mule-charset.c (Fmake_charset):
+        * mule-wnnfns.c (Fwnn_set_param):
+        [1].
+
+        * ntproc.c (create_child):
+        * ntproc.c (Fwin32_set_current_locale):
+        Add comments portending doom.
+
+        * objects-msw.c:
+        * objects-msw.c (old_font_enum_callback_2):
+        * objects-msw.c (font_enum_callback_1):
+        * objects-msw.c (mswindows_enumerate_fonts):
+        [5].
+
+        * objects-x.c:
+        * objects-x.c (allocate_nearest_color):
+        * objects-x.c (x_parse_nearest_color):
+        * objects-x.c (x_initialize_color_instance):
+        * objects-x.c (x_print_color_instance):
+        * objects-x.c (x_finalize_color_instance):
+        * objects-x.c (x_valid_color_name_p):
+        * objects-x.c (x_initialize_font_instance):
+        * objects-x.c (x_print_font_instance):
+        * objects-x.c (valid_x_font_name_p):
+        * objects-x.c (truename_via_FONT_prop):
+        * objects-x.c (truename_via_random_props):
+        * objects-x.c (truename_via_XListFonts):
+        * objects-x.c (x_font_truename):
+        * objects-x.c (x_font_instance_truename):
+        * objects-x.c (x_font_instance_properties):
+        * objects-x.c (x_list_fonts):
+        * objects-x.c (x_find_charset_font):
+        Mule-ize entire file.
+        [7].
+
+        * objects-x.h:
+        Mule-verify.
+
+        * print.c:
+        * print.c (std_handle_out_external):
+        * print.c (debug_print_no_newline):
+        * print.c (syms_of_print):
+        Output to all debugger kinds in debug-print.
+        Fix console-output code under MSWin to actually work.
+
+        * process-nt.c (send_signal):
+        * process-nt.c (nt_create_process):
+        Use newer Unicode macros.
+
+        * process-unix.c (unix_create_process):
+        * process-unix.c (unix_canonicalize_host_name):
+        * process-unix.c (unix_open_network_stream):
+        [7].
+
+        * scrollbar-x.c:
+        Mule-verify.
+
+        * search.c (syms_of_search):
+        [2].
+
+        * select-msw.c (mswindows_destroy_selection):
+        Use LIST_LOOP_2.
+
+        * select-x.c (symbol_to_x_atom):
+        [7].
+
+        * select.c (syms_of_select):
+        [2].
+
+        * sound.c (Fplay_sound_file):
+        [7].
+
+        * specifier.c:
+        * specifier.c (decode_specifier_type):
+        * specifier.c (Fvalid_specifier_locale_type_p):
+        * specifier.c (check_valid_locale_or_locale_type):
+        * specifier.c (decode_locale):
+        * specifier.c (decode_locale_type):
+        * specifier.c (decode_locale_list):
+        * specifier.c (check_valid_domain):
+        * specifier.c (decode_specifier_tag_set):
+        * specifier.c (Fcanonicalize_tag_set):
+        * specifier.c (Fdefine_specifier_tag):
+        * specifier.c (Fspecifier_tag_predicate):
+        * specifier.c (check_valid_inst_list):
+        * specifier.c (check_valid_spec_list):
+        * specifier.c (decode_how_to_add_specification):
+        * specifier.c (check_modifiable_specifier):
+        * specifier.c (specifier_add_spec):
+        * specifier.c (boolean_validate):
+        * specifier.c (display_table_validate):
+        [9].
+
+        * specifier.c (syms_of_specifier):
+        Move some symbols to general-slots.h.
+        [2].
+
+        * symbols.c:
+        * symbols.c (Fmapatoms):
+        * symbols.c (Fapropos_internal):
+        Add GCPROs.
+
+        * symbols.c (set_default_buffer_slot_variable):
+        * symbols.c (set_default_console_slot_variable):
+        [1].
+
+        * symbols.c (defsymbol_massage_name_1):
+        * symbols.c (defkeyword_massage_name):
+        * symbols.c (deferror_1):
+        * symbols.c (deferror):
+        * symbols.c (deferror_massage_name_and_message):
+        * symeval.h:
+        * symeval.h (DEFSYMBOL):
+        Support DEFSYMBOL*, DEFKEYWORD, DEFERROR
+
+        * symbols.c (syms_of_symbols):
+        [2].
+
+        * symsinit.h:
+        * symsinit.h (init_win32): New.
+        Also new is syms_of_dialog_mswindows.
+
+        * syswindows.h:
+       Add new Unicode macros, missing Cygwin wide-char functions,
+       convenience conversion macros for Qmswindows_tstr, macros for
+       encapsulating required MSWin <-> Cygwin filename conversions,
+       prototype for dynamically-extracted (not in NT 3.51) functions.
+
+        * toolbar-x.c:
+        Mule-verify.
+
+        * tooltalk.c (Fadd_tooltalk_message_arg):
+        * tooltalk.c (Fadd_tooltalk_pattern_attribute):
+        * tooltalk.c (Fadd_tooltalk_pattern_arg):
+        [7].
+
+        * tooltalk.c (syms_of_tooltalk):
+        [2].
+
+        * unexnt.c:
+        * unexnt.c (unexec):
+        Fix up headers, declaration of unexec() to be more standard.
+
+2000-07-20  Martin Buchholz  <martin@xemacs.org>
+
+       * offix.h: Revert change to guard macros - they're used in offix.c!
+
+2000-07-18  Kirill 'Big K' Katsnelson  <kkm@dtmx.com>
+
+       * lisp.h: Defsubred Fdelete.
+
+       * console-msw.h:  (msprinter_default_printer): Added.
+
+       * console-msw.c (msprinter_canonicalize_console_connection):
+       (msprinter_canonicalize_device_connection): Added.
+
+       * device-msw.c (msprinter_default_printer):
+       (Fmswingows_get_default_printer): 
+       (signal_enum_priner_error): 
+       (Fmswingows_printer_list): Added.
+
 2000-07-19  Martin Buchholz <martin@xemacs.org>
 
        * XEmacs 21.2.35 is released.
        * glyphs.h (IIFORMAT_METH_OR_GIVEN): cope with null meths.
 
        * glyphs-widget.c (widget_layout): return something.
-       (layout_layout): return something. Fail if not intialized.
+       (layout_layout): return something. Fail if not initialized.
        (layout_query_geometry): ditto.
        (image_instantiator_native_layout): new function. Initialized the
        native layout type.
        minibuffer being the selected window when the gutter content is
        instantiated.
 
-       * gui.c (parse_gui_item_tree_list): add probably unneccessary
+       * gui.c (parse_gui_item_tree_list): add probably unnecessary
        gcpros.
        (parse_gui_item_tree_children): ditto.
        (parse_gui_item_tree_item): ditto.
 
        * redisplay.c (generate_modeline): don't take gutters into account.
        (generate_modeline): ditto.
-       (redisplay_frame): small gutter display optimisation.
+       (redisplay_frame): small gutter display optimization.
 
        * redisplay-x.c (x_output_vertical_divider): don't take gutters into account.
 
        (end_of_text):
        (end_of_data): Do not compile in if using PDUMP.
 
-       * symsinit.h: Protptyped vars_of_nt().
+       * symsinit.h: Prototyped vars_of_nt().
 
        * ntproc.c (windows9x_p): Added, instead of os_subtype.
        (find_child_console): Use it.
        xnew_array_and_zero, thereby simplifying the code.
 
        * mule-charset.c (make_charset): Make sure entire object is
-       intialized, to avoid Purify warnings.
+       initialized, to avoid Purify warnings.
 
        * alloc.c (resize_string): Fix unlikely crash with big strings.
 
 
 2000-01-23  Martin Buchholz  <martin@xemacs.org>
 
-       * alloc.c (make_float): Make sure entire object is intialized, to
+       * alloc.c (make_float): Make sure entire object is initialized, to
        avoid Purify warnings.
        (pdump_register_sub): Remove useless assignment.
        (pdump): Use xmalloc, not malloc.
        (image_instantiator_tab_control):
        (image_instantiator_labels):
        (image_instantiator_layout): ditto.
-       (image_instantiator_format_create_glyphs_widget): Call preceeding
+       (image_instantiator_format_create_glyphs_widget): Call preceding
        functions.
 
 2000-01-22  Martin Buchholz  <martin@xemacs.org>
index 89cd18b..8db6521 100644 (file)
@@ -3547,7 +3547,7 @@ Tue Feb 17 12:50:37 1998  Andy Piper  <andyp@parallax.co.uk>
        * redisplay.c:
        (generate_formatted_string_db): new flag to distinguish a modeline
        string from a title or icon one, plus use a negative first pos to
-       indicate the modeline hscroll ammount.
+       indicate the modeline hscroll amount.
        (add_string_to_fstring_db_runes): completely rewrote this function
        to handle the case of scrolled modelines.
        (add_glyph_to_fstring_db_runes): handle the case of scrolled
@@ -3555,7 +3555,7 @@ Tue Feb 17 12:50:37 1998  Andy Piper  <andyp@parallax.co.uk>
 
        * window.c:
        (Fmodeline_hscroll): new function to return the modeline current
-       horizontal scroll ammount.
+       horizontal scroll amount.
        (Fset_modeline_hscroll): new function to scroll the modeline
        horizontaly.
        Plus some updates related to this new functionality (windows
@@ -3842,7 +3842,7 @@ Wed Jan 28 13:41:22 1998  Andy Piper  <andyp@parallax.co.uk>
        HEAP_IN_DATA is defined. beef up error message about what to do if
        sheap space runs out.
 
-       * sysdep.c: make start_of_data reurn something sensible for
+       * sysdep.c: make start_of_data return something sensible for
        HEAP_IN_DATA.
 
        * systime.h: don't use itimer stuff on cygwin b19.
@@ -4456,7 +4456,7 @@ Thu Jan 08 09:42:36 1998  Andy Piper  <andyp@parallax.co.uk>
 
        * opaque.c: opaque objects given hash and equal methods, so they
          can be compared with 'equal. Menubar uses opaque pointers as
-         hash keys in an 'equal style hastable.
+         hash keys in an 'equal style hashtable.
 
        * Most of the above touched files: Eliminated compiler warnings.
 
@@ -7648,7 +7648,7 @@ Fri Mar 21 18:54:04 1997  David Moore  <dmoore@ucsd.edu>
        (Ffile_newer_than_file_p): ditto
        (Fset_visited_file_modtime): ditto
 
-       *fileio.c (Ffile_truename): Unneccessary GC protection.
+       *fileio.c (Ffile_truename): Unnecessary GC protection.
        (Fdelete_directory): Fix broken caller-must-GC-protect call.
 
        * filelock.c (lock_file): New comments warning that this function
@@ -7907,7 +7907,7 @@ Sun Feb 16 14:53:58 1997  Steven L Baur  <steve@altair.xemacs.org>
 
        * keymap.c (lookup_keys): Wrong sense in test.
 
-       * Makefile.in.in: Dont dump font.elc.
+       * Makefile.in.in: Don't dump font.elc.
 
 Sat Feb 15 02:30:51 1997  Steven L Baur  <steve@altair.xemacs.org>
 
index ff81570..aab648a 100644 (file)
        (mswindows_tab_control_instantiate): ditto.
        (mswindows_tab_control_set_property): ditto.
        (image_instantiator_format_create_glyphs_mswindows): predicate
-       existance of widgets on HAVE_WIDGETS.
+       existence of widgets on HAVE_WIDGETS.
 
        * frame.h (struct frame): add subwindow_exposures variables.
 
        * systime.h: ditto.
        * systty.h: ditto.
 
-       * config.h.in: dont turn on DEBUG_ENCAPSULATION by default because
+       * config.h.in: don't turn on DEBUG_ENCAPSULATION by default because
        some systems don't have all of the encapsulated system calls.
 
        * callproc.c: warning elimination.
        subwindows on a msw frame.
        (mswindows_map_subwindow): ditto.
        (mswindows_register_image_instance): register instantiated widgets
-       with the widget hastable.
+       with the widget hashtable.
        (mswindows_button_instantiate): instantiate a button type widget
        on an msw frame.
        (mswindows_subwindow_instantiate): instanttiate a subwindow on a
 
        * fileio.c: (expand_file_name): under win32: Don't treat names
        as UNC names if a drive letter has been specified.  If a drive
-       has been specified, strip out extra directory-seperators that
+       has been specified, strip out extra directory-separators that
        reportedly cause problems under Win95.
 
 1998-07-09  Jonathan Harris  <jhar@tardis.ed.ac.uk>
 
        * fileio.c: (expand_file_name): under win32: Don't treat names as
        UNC names if a drive letter has been specified.  If a drive has
-       been specified, strip out extra directory-seperators that
+       been specified, strip out extra directory-separators that
        reportedly cause problems under Win95.
 
 1998-07-05  Andy Piper  <andyp@parallax.co.uk>
 
 1998-06-24  Jonathan Harris  <jhar@tardis.ed.ac.uk>
 
-       * fileio.c: Don't do directory seperator canonicalisation in
+       * fileio.c: Don't do directory separator canonicalisation in
          substitute-in-file-name because we don't know that the
          filename refers to a local file.
 
        * objects-msw.c: Added helper function match_font used by
          mswindows_initialize_font_instance and mswindows_list_fonts.
          Allow a charset to be specified in a font string, even if
-         previous fields havn't been specified.
+         previous fields haven't been specified.
 
 1998-06-23  Greg Klanderman  <greg@alphatech.com>
 
        * objects-msw.c: Added helper function match_font used by
          mswindows_initialize_font_instance and mswindows_list_fonts.
          Allow a charset to be specified in a font string, even if
-         previous fields havn't been specified.
+         previous fields haven't been specified.
 
 1998-06-15  Jonathan Harris  <jhar@tardis.ed.ac.uk>
 
        parameters. define macors to access it.
 
        * frame-msw.c (mswindows_init_frame_1): use new target_rect
-       parameter to intialise desired sizing. (mswindows_init_frame_2):
+       parameter to initialize desired sizing. (mswindows_init_frame_2):
        enable and size the frame to something sensible when we get
        here. (mswindows_set_frame_properites): use new
        mswindows_size_frame_internal function and size frame if frame
@@ -8081,7 +8081,7 @@ Wed May 27, 1998  Darryl Okahata  <darrylo@sr.hp.com>
        (set_frame_toolbar): Removed allocation of toolbar_data lrecord.
        (update_frame_toolbars): Do not check for changed buffer
        here. Toolbar information is provided by cached specs in
-       windows. The check for buffer is eliminated becuase toolbars are
+       windows. The check for buffer is eliminated because toolbars are
        marked changed in set_frame_selected_window() in frame.c
        Added check for changed toolbars geometry.
        (compute_frame_toolbars_data): Removed unused second parameter;
index ef3d9da..f6e2be0 100644 (file)
@@ -124,7 +124,7 @@ lwlib_deps = $(lwlib_libs)
 $(lwlib_libs) :
        cd ../lwlib && $(RECURSIVE_MAKE)
 
-x_objs=balloon_help.o balloon-x.o console-x.o device-x.o event-Xt.o frame-x.o\
+x_objs=console-x.o device-x.o event-Xt.o frame-x.o\
  glyphs-x.o objects-x.o redisplay-x.o select-x.o xgccache.o
 
 #ifdef AIX4
@@ -134,12 +134,12 @@ LIBI18N = -li18n
 X11_libs = $(LIBI18N)
 #endif /* HAVE_X_WINDOWS */
 
-#if defined (HEAP_IN_DATA) && !defined(PDUMP)
-sheap_obj=sheap.o
+#if defined (HEAP_IN_DATA) && !defined (PDUMP)
+sheap_objs=sheap.o
 #endif
 
-#if defined(MINGW) || defined(CYGWIN)
-res_obj=xemacs_res.o
+#if defined (WIN32_NATIVE) || defined (CYGWIN)
+win32_objs=win32.o xemacs_res.o
 #endif
 
 ## -Demacs is needed to make some files produce the correct version
@@ -193,9 +193,9 @@ objs=\
  macros.o marker.o md5.o minibuf.o objects.o opaque.o\
  print.o process.o profile.o\
  rangetab.o redisplay.o redisplay-output.o regex.o\
- search.o select.o $(sheap_obj) signal.o sound.o\
+ search.o select.o $(sheap_objs) signal.o sound.o\
  specifier.o strftime.o symbols.o syntax.o sysdep.o\
- undo.o $(x_objs) widget.o window.o $(res_obj)
+ undo.o $(x_objs) widget.o window.o $(win32_objs)
 
 obj_rtl = $(objs:.o=.c.rtl)
 
@@ -346,7 +346,7 @@ ${DUMP_TARGET}: ${EXE_TARGET} ${libsrc}DOC $(mo_file) ${other_files} update-elc.
                ./${PROGNAME} -batch -vanilla -f list-load-path-shadows; fi; \
                $(RM) SATISFIED; exit 0; fi; \
        if test -f SATISFIED; then $(RM) SATISFIED; exit 1; fi; \
-       @$(RM) $@; \
+       $(RM) $@; \
        $(RECURSIVE_MAKE) $@;
 #else
        @$(RM) $@
@@ -513,7 +513,7 @@ PURIFY_FLAGS =\
  -search-mmaps=yes\
 #endif
  -chain-length=32 -ignore-signals=SIGPOLL -threads=yes\
- -cache-dir=./purecache -always-use-cache-dir=yes
+ -cache-dir=${srcdir}/purecache -always-use-cache-dir=yes
 
 PURIFY_LIBS  = -lpthread
 puremacs: $(temacs_deps)
@@ -555,6 +555,10 @@ TransientEmacsShell.c.rtl : ${srcdir}/EmacsShell-sub.c TopLevelEmacsShell.o conf
        $(CC) -dr -c $(cflags) -DDEFINE_TRANSIENT_EMACS_SHELL ${srcdir}/EmacsShell-sub.c
        mv EmacsShell-sub.c.rtl TransientEmacsShell.c.rtl
 
+## The above rules are subject to a race condition if using a parallel make.
+TransientEmacsShell.o : TopLevelEmacsShell.o
+TransientEmacsShell.c.rtl : TopLevelEmacsShell.c.rtl
+
 ## Position-independent code for shared library creation
 #if USE_GCC
 pic_arg = -fpic
@@ -703,7 +707,7 @@ xemacs_res.o: ${srcdir}/../nt/xemacs.rc
 
 .PHONY: mostlyclean clean distclean realclean versionclean extraclean
 mostlyclean:
-       $(RM) temacs puremacs quantmacs prefix-args *.o *.i  \
+       $(RM) temacs puremacs quantmacs *.o *.i  \
          core temacs.exe sheap-adjust.h
 clean: mostlyclean versionclean
        $(RM) libextcli* update-elc.stamp
@@ -714,7 +718,7 @@ distclean: clean
          GNUmakefile Makefile Makefile.in TAGS ${PROGNAME}.*
 realclean: distclean
 versionclean:
-       $(RM) ${PROGNAME} ${PROGNAME}.exe ${libsrc}DOC
+       $(RM) ${EXE_TARGET} ${DUMP_TARGET} ${libsrc}DOC
 extraclean: realclean
        $(RM) *~ \#* m/*~ m/\#* s/*~ s/\#*
 
index aa39388..008689b 100644 (file)
@@ -159,16 +159,6 @@ Lisp_Object Vgc_pointer_glyph;
 static const char gc_default_message[] = "Garbage collecting";
 Lisp_Object Qgarbage_collecting;
 
-#ifndef VIRT_ADDR_VARIES
-extern
-#endif /* VIRT_ADDR_VARIES */
- EMACS_INT malloc_sbrk_used;
-
-#ifndef VIRT_ADDR_VARIES
-extern
-#endif /* VIRT_ADDR_VARIES */
- EMACS_INT malloc_sbrk_unused;
-
 /* Non-zero means we're in the process of doing the dump */
 int purify_flag;
 
@@ -1451,7 +1441,6 @@ This is terrible behavior which is retained for compatibility with old
   /* Check for valid formal parameter list now, to allow us to use
      SPECBIND_FAST_UNSAFE() later in funcall_compiled_function(). */
   {
-    Lisp_Object symbol, tail;
     EXTERNAL_LIST_LOOP_3 (symbol, arglist, tail)
       {
        CHECK_SYMBOL (symbol);
@@ -2296,8 +2285,7 @@ allocate_managed_lcrecord (Lisp_Object lcrecord_list)
     {
       Lisp_Object val;
 
-      XSETOBJ (val, Lisp_Type_Record,
-              alloc_lcrecord (list->size, list->implementation));
+      XSETOBJ (val, alloc_lcrecord (list->size, list->implementation));
       return val;
     }
 }
@@ -2349,9 +2337,8 @@ Does not copy symbols.
 /* All the built-in lisp object types are enumerated in `enum lrecord_type'.
    Additional ones may be defined by a module (none yet).  We leave some
    room in `lrecord_implementations_table' for such new lisp object types. */
-#define MODULE_DEFINABLE_TYPE_COUNT 32
-const struct lrecord_implementation *lrecord_implementations_table[lrecord_type_count + MODULE_DEFINABLE_TYPE_COUNT];
-
+const struct lrecord_implementation *lrecord_implementations_table[(unsigned int)lrecord_type_last_built_in_type + MODULE_DEFINABLE_TYPE_COUNT];
+unsigned int lrecord_type_count = (unsigned int)lrecord_type_last_built_in_type;
 /* Object marker functions are in the lrecord_implementation structure.
    But copying them to a parallel array is much more cache-friendly.
    This hack speeds up (garbage-collect) by about 5%. */
@@ -3922,10 +3909,6 @@ reinit_alloc_once_early (void)
 #else
   gc_cons_threshold = 15000; /* debugging */
 #endif
-#ifdef VIRT_ADDR_VARIES
-  malloc_sbrk_unused = 1<<22;  /* A large number */
-  malloc_sbrk_used = 100000;   /* as reasonable as any number */
-#endif /* VIRT_ADDR_VARIES */
   lrecord_uid_counter = 259;
   debug_string_purity = 0;
   gcprolist = 0;
@@ -3974,9 +3957,9 @@ reinit_alloc (void)
 void
 syms_of_alloc (void)
 {
-  defsymbol (&Qpre_gc_hook, "pre-gc-hook");
-  defsymbol (&Qpost_gc_hook, "post-gc-hook");
-  defsymbol (&Qgarbage_collecting, "garbage-collecting");
+  DEFSYMBOL (Qpre_gc_hook);
+  DEFSYMBOL (Qpost_gc_hook);
+  DEFSYMBOL (Qgarbage_collecting);
 
   DEFSUBR (Fcons);
   DEFSUBR (Flist);
@@ -4020,16 +4003,6 @@ See also `consing-since-gc'.
 Number of bytes of sharable Lisp data allocated so far.
 */ );
 
-#if 0
-  DEFVAR_INT ("data-bytes-used", &malloc_sbrk_used /*
-Number of bytes of unshared memory allocated in this session.
-*/ );
-
-  DEFVAR_INT ("data-bytes-free", &malloc_sbrk_unused /*
-Number of bytes of unshared memory remaining available in this session.
-*/ );
-#endif
-
 #ifdef DEBUG_XEMACS
   DEFVAR_INT ("debug-allocation", &debug_allocation /*
 If non-zero, print out information to stderr about all objects allocated.
index bbbcae6..c1eecff 100644 (file)
@@ -23,7 +23,7 @@
 
 /* Synched up with: FSF 19.30. */
 
-/* Authorsip:
+/* Authorship:
 
    FSF: A long time ago.
    Very few changes for XEmacs.
@@ -193,7 +193,7 @@ alloca (size)
      unsigned size;
 {
   auto char probe;             /* Probes stack depth: */
-  REGISTER char *depth = ADDRESS_FUNCTION (probe);
+  register char *depth = ADDRESS_FUNCTION (probe);
 
 #if STACK_DIRECTION == 0
   if (STACK_DIR == 0)          /* Unknown growth direction.  */
@@ -204,13 +204,13 @@ alloca (size)
      was allocated from deeper in the stack than currently. */
 
   {
-    REGISTER header *hp;       /* Traverses linked list.  */
+    register header *hp;       /* Traverses linked list.  */
 
     for (hp = last_alloca_header; hp != NULL;)
       if ((STACK_DIR > 0 && hp->h.deep > depth)
          || (STACK_DIR < 0 && hp->h.deep < depth))
        {
-         REGISTER header *np = hp->h.next;
+         register header *np = hp->h.next;
 
          free ((pointer) hp);  /* Collect garbage.  */
 
@@ -228,7 +228,7 @@ alloca (size)
   /* Allocate combined header + user data storage.  */
 
   {
-    REGISTER pointer new = malloc (sizeof (header) + size);
+    register pointer new = malloc (sizeof (header) + size);
     /* Address of header.  */
 
     ((header *) new)->h.next = last_alloca_header;
index eb440de..2a97d62 100644 (file)
@@ -439,7 +439,7 @@ the search will still be done on `buffer-file-name'.
 */
        (filename))
 {
-  /* This function can GC.  GC checked 1997.04.06. */
+  /* This function can GC.  GC checked and fixed 7-11-2000 ben. */
   REGISTER Lisp_Object buf;
   struct gcpro gcpro1;
 
@@ -474,15 +474,17 @@ the search will still be done on `buffer-file-name'.
          dn = Ffile_name_directory (filename);
          fn = Ffile_truename (dn, Qnil);
          if (! NILP (fn)) dn = fn;
-         fn = Fexpand_file_name (Ffile_name_nondirectory (filename),
-                                 dn);
+         /* Formerly the two calls below were combined, but that is
+            not GC-safe because the first call returns unprotected
+            data and the second call can GC. --ben */
+         fn = Ffile_name_nondirectory (filename);
+         fn = Fexpand_file_name (fn, dn);
        }
       filename = fn;
       NUNGCPRO;
     }
 
   {
-    Lisp_Object elt;
     LIST_LOOP_2 (elt, Vbuffer_alist)
       {
        buf = Fcdr (elt);
@@ -534,6 +536,7 @@ delete_from_buffer_alist (Lisp_Object buf)
 Lisp_Object
 get_truename_buffer (REGISTER Lisp_Object filename)
 {
+  /* This function can GC.  GC correct 7-11-00 ben */
   /* FSFmacs has its own code here and doesn't call get-file-buffer.
      That's because their equivalent of find-file-compare-truenames
      (find-file-existing-other-name) isn't looked at in get-file-buffer.
@@ -869,37 +872,6 @@ No argument or nil as argument means use current buffer as BUFFER.
   return result;
 }
 
-DEFUN ("buffer-dedicated-frame", Fbuffer_dedicated_frame, 0, 1, 0, /*
-Return the frame dedicated to this BUFFER, or nil if there is none.
-No argument or nil as argument means use current buffer as BUFFER.
-*/
-       (buffer))
-{
-  struct buffer *buf = decode_buffer (buffer, 0);
-
-  /* XEmacs addition: if the frame is dead, silently make it go away. */
-  if (!NILP (buf->dedicated_frame) &&
-      !FRAME_LIVE_P (XFRAME (buf->dedicated_frame)))
-    buf->dedicated_frame = Qnil;
-
-  return buf->dedicated_frame;
-}
-
-DEFUN ("set-buffer-dedicated-frame", Fset_buffer_dedicated_frame, 2, 2, 0, /*
-For this BUFFER, set the FRAME dedicated to it.
-FRAME must be a frame or nil.
-*/
-       (buffer, frame))
-{
-  struct buffer *buf = decode_buffer (buffer, 0);
-
-  if (!NILP (frame))
-    CHECK_LIVE_FRAME (frame); /* XEmacs change */
-
-  return buf->dedicated_frame = frame;
-}
-
-
 \f
 DEFUN ("buffer-modified-p", Fbuffer_modified_p, 0, 1, 0, /*
 Return t if BUFFER was modified since its file was last read or saved.
@@ -1227,7 +1199,7 @@ with `delete-process'.
          to access data internal to select.c that can't be seen from
          Lisp (so the Lisp code would just call into C anyway. */
       select_notify_buffer_kill (buf);
-      
+
       unbind_to (speccount, Qnil);
       UNGCPRO;
       b = XBUFFER (buf);        /* Hypothetical relocating GC. */
@@ -2186,8 +2158,6 @@ syms_of_buffer (void)
   DEFSUBR (Fbuffer_base_buffer);
   DEFSUBR (Fbuffer_indirect_children);
   DEFSUBR (Fbuffer_local_variables);
-  DEFSUBR (Fbuffer_dedicated_frame);
-  DEFSUBR (Fset_buffer_dedicated_frame);
   DEFSUBR (Fbuffer_modified_p);
   DEFSUBR (Fset_buffer_modified_p);
   DEFSUBR (Fbuffer_modified_tick);
@@ -2208,8 +2178,8 @@ syms_of_buffer (void)
   DEFSUBR (Fbuffer_memory_usage);
 #endif
 
-  deferror (&Qprotected_field, "protected-field",
-           "Attempt to modify a protected field", Qerror);
+  DEFERROR (Qprotected_field, "Attempt to modify a protected field",
+           Qinvalid_change);
 }
 
 void
@@ -3113,8 +3083,8 @@ directory_is_current_directory (Extbyte *pwd)
                      Qfile_name);
 
   return (IS_DIRECTORY_SEP (*pwd_internal)
-         && stat ((char *) pwd_internal, &pwdstat) == 0
-         && stat (".", &dotstat) == 0
+         && xemacs_stat ((char *) pwd_internal, &pwdstat) == 0
+         && xemacs_stat (".", &dotstat) == 0
          && dotstat.st_ino == pwdstat.st_ino
          && dotstat.st_dev == pwdstat.st_dev
          && pwd_internal_len < MAXPATHLEN);
index 8db8653..3d20fe2 100644 (file)
@@ -1190,7 +1190,7 @@ typedef enum dfc_conversion_type dfc_conversion_type;
 
 /* WARNING: These use a static buffer.  This can lead to disaster if
    these functions are not used *very* carefully.  Another reason to only use
-   TO_EXTERNAL_FORMATf() and TO_INTERNAL_FORMAT(). */
+   TO_EXTERNAL_FORMAT() and TO_INTERNAL_FORMAT(). */
 void
 dfc_convert_to_external_format (dfc_conversion_type source_type,
                                dfc_conversion_data *source,
@@ -1306,11 +1306,30 @@ typedef union { char c; void *p; } *dfc_aliasing_voidpp;
    argument to TO_EXTERNAL_FORMAT() and TO_INTERNAL_FORMAT(). */
 #define Qnative Qfile_name
 
-#ifdef HAVE_MS_WINDOWS
+#if defined (WIN32_NATIVE) || defined (CYGWIN)
 /* #### kludge!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    Remove this as soon as my Mule code is integrated. */
 #define Qmswindows_tstr Qnative
 #endif
+
+/* More stand-ins */
+#define Qcommand_argument_encoding Qnative
+#define Qenvironment_variable_encoding Qnative
+
+/* Convenience macros for extremely common invocations */
+#define C_STRING_TO_EXTERNAL(in, out, coding_system) \
+  TO_EXTERNAL_FORMAT (C_STRING, in, C_STRING_ALLOCA, out, coding_system)
+#define C_STRING_TO_EXTERNAL_MALLOC(in, out, coding_system) \
+  TO_EXTERNAL_FORMAT (C_STRING, in, C_STRING_MALLOC, out, coding_system)
+#define EXTERNAL_TO_C_STRING(in, out, coding_system) \
+  TO_INTERNAL_FORMAT (C_STRING, in, C_STRING_ALLOCA, out, coding_system)
+#define EXTERNAL_TO_C_STRING_MALLOC(in, out, coding_system) \
+  TO_INTERNAL_FORMAT (C_STRING, in, C_STRING_MALLOC, out, coding_system)
+#define LISP_STRING_TO_EXTERNAL(in, out, coding_system) \
+  TO_EXTERNAL_FORMAT (LISP_STRING, in, C_STRING_ALLOCA, out, coding_system)
+#define LISP_STRING_TO_EXTERNAL_MALLOC(in, out, coding_system) \
+  TO_EXTERNAL_FORMAT (LISP_STRING, in, C_STRING_MALLOC, out, coding_system)
+
 \f
 /************************************************************************/
 /*                                                                      */
index a5430e0..660127b 100644 (file)
@@ -189,9 +189,7 @@ Boston, MA 02111-1307, USA.  */
     /* FSFmacs has overlay stuff here.  We have extent info elsewhere in the
        struct buffer.  */
 
-    /* If dedicated_frame is non-nil, display_buffer tries to use it instead
-       of the current frame */
-    MARKED_SLOT (dedicated_frame);
+    /* dedicated_frame in lisp */
 
     /* Lisp of symbols naming the file format used for visited file. */
     MARKED_SLOT (file_format);
index b31bc4c..5bbb326 100644 (file)
@@ -471,7 +471,6 @@ Lisp_Object
 funcall_compiled_function (Lisp_Object fun, int nargs, Lisp_Object args[])
 {
   /* This function can GC */
-  Lisp_Object symbol, tail;
   int speccount = specpdl_depth();
   REGISTER int i = 0;
   Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (fun);
@@ -486,24 +485,26 @@ funcall_compiled_function (Lisp_Object fun, int nargs, Lisp_Object args[])
      and local variables of fun.   So just reserve it once. */
   SPECPDL_RESERVE (f->specpdl_depth);
 
-  /* Fmake_byte_code() guaranteed that f->arglist is a valid list
-     containing only non-constant symbols. */
-  LIST_LOOP_3 (symbol, f->arglist, tail)
-    {
-      if (EQ (symbol, Qand_rest))
-       {
-         tail = XCDR (tail);
-         symbol  = XCAR (tail);
-         SPECBIND_FAST_UNSAFE (symbol, Flist (nargs - i, &args[i]));
-         goto run_code;
-       }
-      else if (EQ (symbol, Qand_optional))
-       optional = 1;
-      else if (i == nargs && !optional)
-       goto wrong_number_of_arguments;
-      else
-       SPECBIND_FAST_UNSAFE (symbol, i < nargs ? args[i++] : Qnil);
-    }
+  {
+    /* Fmake_byte_code() guaranteed that f->arglist is a valid list
+       containing only non-constant symbols. */
+    LIST_LOOP_3 (symbol, f->arglist, tail)
+      {
+       if (EQ (symbol, Qand_rest))
+         {
+           tail = XCDR (tail);
+           symbol  = XCAR (tail);
+           SPECBIND_FAST_UNSAFE (symbol, Flist (nargs - i, &args[i]));
+           goto run_code;
+         }
+       else if (EQ (symbol, Qand_optional))
+         optional = 1;
+       else if (i == nargs && !optional)
+         goto wrong_number_of_arguments;
+       else
+         SPECBIND_FAST_UNSAFE (symbol, i < nargs ? args[i++] : Qnil);
+      }
+  }
 
   if (i < nargs)
     goto wrong_number_of_arguments;
@@ -2410,8 +2411,7 @@ syms_of_bytecode (void)
 {
   INIT_LRECORD_IMPLEMENTATION (compiled_function);
 
-  deferror (&Qinvalid_byte_code, "invalid-byte-code",
-           "Invalid byte code", Qerror);
+  DEFERROR_STANDARD (Qinvalid_byte_code, Qinvalid_state);
   defsymbol (&Qbyte_code, "byte-code");
   defsymbol (&Qcompiled_functionp, "compiled-function-p");
 
index 59baf47..b908a3a 100644 (file)
@@ -361,10 +361,12 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you
 
     if (fd_error < 0)
       {
+       int save_errno = errno;
        close (filefd);
        close (fd[0]);
        if (fd1 >= 0)
          close (fd1);
+       errno = save_errno;
        report_file_error ("Cannot open", Fcons(error_file, Qnil));
       }
 
@@ -427,8 +429,10 @@ If you quit, the process is killed with SIGINT, or SIGKILL if you
 #ifndef WIN32_NATIVE
   if (pid < 0)
     {
+      int save_errno = errno;
       if (fd[0] >= 0)
        close (fd[0]);
+      errno = save_errno;
       report_file_error ("Doing fork", Qnil);
     }
 #endif
@@ -865,6 +869,7 @@ When invoked interactively, prints the value in the echo area.
 char *
 egetenv (const char *var)
 {
+  /* This cannot GC -- 7-28-00 ben */
   Bufbyte *value;
   Bytecount valuelen;
 
index cc8edea..1d1a9bb 100644 (file)
@@ -73,13 +73,13 @@ char *alloca ();
 #undef INFODOCK_MINOR_VERSION
 #undef INFODOCK_BUILD_VERSION
 
-/* Make all functions from all IEEE Stds 1003.[123] available. */
+/* Make functions from IEEE Stds 1003.[123] available. */
 #undef _POSIX_C_SOURCE
 
-/* Make all functions from Unix98 available. */
+/* Make some functions from Unix98 available. */
 #undef _XOPEN_SOURCE
 
-/* Make extensions from Unix98 available. */
+/* Make "extensions" from Unix98 available. */
 #undef _XOPEN_SOURCE_EXTENDED
 
 /* Make all functions available on AIX.  See AC_AIX. */
@@ -181,6 +181,8 @@ char *alloca ();
 
 #undef HAVE_XCONVERTCASE
 
+#undef HAVE_BALLOON_HELP
+
 /* Where do we find bitmaps? */
 #undef BITMAPDIR
 
@@ -210,7 +212,6 @@ char *alloca ();
 #undef HAVE_MACH_MACH_H
 #undef HAVE_SYS_PARAM_H
 #undef HAVE_SYS_PSTAT_H
-#undef HAVE_SYS_STROPTS_H
 #undef HAVE_SYS_TIME_H
 #undef HAVE_SYS_TIMEB_H
 #undef HAVE_SYS_UN_H
@@ -225,7 +226,6 @@ char *alloca ();
 #undef TIME_WITH_SYS_TIME
 #undef WORDS_BIGENDIAN
 #undef HAVE_VFORK_H
-#undef HAVE_KSTAT_H
 #undef vfork
 
 #undef HAVE_LONG_FILE_NAMES
@@ -242,7 +242,6 @@ char *alloca ();
 #undef HAVE_SHLIB
 #undef HAVE_DLFCN_H
 
-#undef HAVE_LIBKSTAT
 #undef HAVE_LIBINTL
 #undef HAVE_LIBDNET
 #undef HAVE_LIBRESOLV
@@ -261,6 +260,13 @@ char *alloca ();
 #undef HAVE_TM_ZONE
 #undef HAVE_TZNAME
 
+/* For `getloadavg' provided by system */
+#undef HAVE_GETLOADAVG
+#undef HAVE_SYS_LOADAVG_H
+/* For implementing `getloadavg' ourselves */
+#undef HAVE_LIBKSTAT
+#undef HAVE_KSTAT_H
+
 /* Is `h_errno' declared by <netdb.h>? */
 #undef HAVE_H_ERRNO
 
@@ -292,7 +298,6 @@ char *alloca ();
 #undef HAVE_GETTIMEOFDAY
 #undef HAVE_GETWD
 #undef HAVE_GETCWD
-#undef HAVE_GETPT
 #undef HAVE_LOGB
 #undef HAVE_LRAND48
 #undef HAVE_MATHERR
@@ -316,7 +321,6 @@ char *alloca ();
 #undef HAVE_SIGSETJMP
 #undef HAVE_SNPRINTF
 #undef HAVE_STPCPY
-#undef HAVE_STRCASECMP
 #undef HAVE_STRERROR
 #undef HAVE_TZSET
 #undef HAVE_ULIMIT
@@ -324,6 +328,22 @@ char *alloca ();
 #undef HAVE_UTIMES
 #undef HAVE_WAITPID
 #undef HAVE_VSNPRINTF
+
+/* PTY support functions */
+#undef HAVE_GETPT      /* glibc's easy pty allocation function */
+#undef HAVE__GETPT     /*   SGI's easy pty allocation function */
+#undef HAVE_OPENPTY    /*   BSD's easy pty allocation function */
+#undef HAVE_GRANTPT    /* Unix98 */
+#undef HAVE_UNLOCKPT   /* Unix98 */
+#undef HAVE_PTSNAME    /* Unix98 */
+#undef HAVE_KILLPG     /* BSD */
+#undef HAVE_TCGETPGRP  /* Posix 1 */
+#undef HAVE_ISASTREAM  /* SysV streams */
+#undef HAVE_PTY_H      /* Linux, Tru64 openpty */
+#undef HAVE_LIBUTIL_H  /* BSD openpty */
+#undef HAVE_SYS_STROPTS_H /* SysV streams */
+#undef HAVE_SYS_STRTIO_H  /* SysV streams TIOCSIGNAL */
+
 #undef HAVE_SOCKETS
 #undef HAVE_SOCKADDR_SUN_LEN
 #undef HAVE_MULTICAST
@@ -571,31 +591,28 @@ char *alloca ();
    definitions isn't right with 64-bit systems.  */
 #undef USE_UNION_TYPE
 
-/* The configuration script defines opsysfile to be the name of the
-   s/...h file that describes the system type you are using.
-   The file is chosen based on the configuration name you give.
-
-   See the file ../etc/MACHINES for a list of systems and the
-   configuration names to use for them.
-
-   See s/template.h for documentation on writing s/...h files. */
+/* The configuration script may define `opsysfile' to be the name of
+   the s/...h file that describes your operating system.
+   The file name is chosen based on the configuration name. */
 
 #if defined (__cplusplus) && !defined (NOT_C_CODE)
 extern "C" {
 #endif
+
 #undef config_opsysfile
+#ifdef config_opsysfile
 #include config_opsysfile
+#endif
 
-/* The configuration script defines machfile to be the name of the
-   m/...h file that describes the machine you are using.  The file is
-   chosen based on the configuration name you give.
-
-   See the file ../etc/MACHINES for a list of machines and the
-   configuration names to use for them.
+/* The configuration script may define `machfile' to be the name of
+   the m/...h file that describes the machine you are using.
+   The file name is chosen based on the configuration name. */
 
-   See m/template.h for documentation on writing m/...h files. */
 #undef config_machfile
+#ifdef config_machfile
 #include config_machfile
+#endif
+
 #if defined (__cplusplus) && !defined (NOT_C_CODE)
 }
 #endif
index 3cd13ac..0207561 100644 (file)
@@ -182,17 +182,15 @@ mswindows_hide_console (void)
 void
 mswindows_show_console (void)
 {
+  /* What I really want is for the console window to appear on top of other
+     windows, but NOT get the focus.  This seems hard-to-impossible under
+     Windows.  The following sequence seems to do the best possible, along
+     with keeping the console window on top when xemacs --help is used. */
   HWND hwnd = mswindows_get_console_hwnd ();
-  ShowWindow (hwnd, SW_SHOWNA);
-
-  /* I tried to raise the window to the top without activating
-     it, but this fails.  Apparently Windows just doesn't like
-     having the active window not be on top.  So instead, we
-     at least put it just below our own window, where part of it
-     will likely be seen. */
-  SetWindowPos (hwnd, GetForegroundWindow (), 0, 0, 0, 0,
-               SWP_NOSIZE | SWP_NOMOVE | SWP_NOSENDCHANGING |
-               SWP_NOACTIVATE);
+  HWND hwndf = GetFocus ();
+  ShowWindow (hwnd, SW_SHOW);
+  BringWindowToTop (hwnd);
+  SetFocus (hwndf);
 }
 
 static int mswindows_console_buffered = 0;
@@ -237,6 +235,37 @@ mswindows_windows9x_p (void)
   return GetVersion () & 0x80000000;
 }
 
+DEFUN ("mswindows-debugging-output", Fmswindows_debugging_output, 1, 1, 0, /*
+Write CHAR-OR-STRING to the Windows debugger, using OutputDebugString().
+This function can be used as the STREAM argument of Fprint() or the like.
+*/
+       (char_or_string))
+{
+  Extbyte *extstr;
+
+  if (STRINGP (char_or_string))
+    {
+      TO_EXTERNAL_FORMAT (LISP_STRING, char_or_string,
+                         C_STRING_ALLOCA, extstr,
+                         Qmswindows_tstr);
+      OutputDebugString (extstr);
+    }
+  else
+    {
+      Bufbyte str[MAX_EMCHAR_LEN + 1];
+      Bytecount len;
+
+      CHECK_CHAR_COERCE_INT (char_or_string);
+      len = set_charptr_emchar (str, XCHAR (char_or_string));
+      str[len] = '\0';
+      TO_EXTERNAL_FORMAT (C_STRING, str,
+                         C_STRING_ALLOCA, extstr,
+                         Qmswindows_tstr);
+      OutputDebugString (extstr);
+    }
+
+  return char_or_string;
+}
 
 #ifdef DEBUG_XEMACS
 
@@ -446,10 +475,7 @@ no effect.  */
   Extbyte *titleout = 0;
   UINT sty = 0;
 
-  if (noninteractive)
-    return Qcancel;
-
-  if (!CONSP (flags))
+  if (!LISTP (flags))
     {
       CHECK_SYMBOL (flags);
       flags = list1 (flags);
@@ -547,6 +573,35 @@ mswindows_output_last_error (char *frob)
              frob, errval, (char*)lpMsgBuf);
 }
 
+static Lisp_Object
+msprinter_canonicalize_console_connection (Lisp_Object connection,
+                                          Error_behavior errb)
+{
+  /* If nil connection is specified, transform it into the name
+     of the default printer */
+  if (NILP (connection))
+    {
+      connection = msprinter_default_printer ();
+      if (NILP (connection))
+       {
+         if (ERRB_EQ (errb, ERROR_ME))
+           error ("There is no default printer in the system");
+         else
+           return Qunbound;
+       }
+    }
+
+  CHECK_STRING (connection);
+  return connection;
+}
+
+static Lisp_Object
+msprinter_canonicalize_device_connection (Lisp_Object connection,
+                                         Error_behavior errb)
+{
+  return msprinter_canonicalize_console_connection (connection, errb);
+}
+
 \f
 /************************************************************************/
 /*                            initialization                            */
@@ -555,6 +610,8 @@ mswindows_output_last_error (char *frob)
 void
 syms_of_console_mswindows (void)
 {
+  DEFSUBR (Fmswindows_debugging_output);
+
   defsymbol (&Qabortretryignore, "abortretryignore");
   defsymbol (&Qapplmodal, "applmodal");
   defsymbol (&Qdefault_desktop_only, "default-desktop-only");
@@ -609,6 +666,8 @@ console_type_create_mswindows (void)
 /*  CONSOLE_HAS_METHOD (mswindows, semi_canonicalize_device_connection); */
 
   INITIALIZE_CONSOLE_TYPE (msprinter, "msprinter", "console-msprinter-p");
+  CONSOLE_HAS_METHOD (msprinter, canonicalize_console_connection);
+  CONSOLE_HAS_METHOD (msprinter, canonicalize_device_connection);
 }
 
 void
index a2eaca5..ad6cca5 100644 (file)
@@ -65,12 +65,12 @@ DECLARE_CONSOLE_TYPE (msprinter);
 typedef struct Lisp_Devmode
 {
   struct lcrecord_header header;
-  
+
   /* Pointer to the DEVMODE structure */
   DEVMODE* devmode;
 
   /* Full printer name. It can be longer than devmode->dmDeviceName
-     can accomodate, so need to keep it separately */
+     can accommodate, so need to keep it separately */
   char* printer_name;
 
   /* Printer device this object is currently selected in, or Qnil
@@ -101,7 +101,7 @@ struct mswindows_device
   Lisp_Object fontlist;                /* List of strings, device fonts */
   HDC hcdc;                    /* Compatible DC */
   DWORD update_tick;           /* Used when device is modified through
-                                  Windows mwssages, see WM_DISPLAYCHANGE
+                                  Windows messages, see WM_DISPLAYCHANGE
                                   in event-msw.c */
 };
 
@@ -178,6 +178,9 @@ struct mswindows_frame
   /* Time of last click event, for button 2 emul */
   DWORD last_click_time;
 
+  /* Mods of last click event */
+  DWORD last_click_mods;
+
   /* Coordinates of last click event, screen-relative */
   POINTS last_click_point;
 #ifdef HAVE_TOOLBARS
@@ -210,9 +213,10 @@ struct mswindows_frame
   int ignore_next_rbutton_up : 1;
   int sizing : 1;
   int paint_pending : 1; /* Whether a WM_PAINT magic event has been queued */
+  int popup : 1; /* frame is a popup frame */
 
   /* Geometry, in characters, as specified by proplist during frame
-     creation. Memebers are set to -1 for unspecified */
+     creation. Members are set to -1 for unspecified */
   XEMACS_RECT_WH* target_rect;
 };
 
@@ -236,6 +240,7 @@ struct mswindows_frame
 #define FRAME_MSWINDOWS_CHARWIDTH(f)     (FRAME_MSWINDOWS_DATA (f)->charwidth)
 #define FRAME_MSWINDOWS_CHARHEIGHT(f)    (FRAME_MSWINDOWS_DATA (f)->charheight)
 #define FRAME_MSWINDOWS_TARGET_RECT(f)   (FRAME_MSWINDOWS_DATA (f)->target_rect)
+#define FRAME_MSWINDOWS_POPUP(f)         (FRAME_MSWINDOWS_DATA (f)->popup)
 
 /* Frame check and validation macros */
 #define FRAME_MSWINDOWS_P(frm) CONSOLE_TYPESYM_MSWINDOWS_P (FRAME_TYPE (frm))
@@ -255,7 +260,7 @@ struct msprinter_frame
 {
   int left_margin, top_margin,         /* All in twips */
     right_margin, bottom_margin;
-  int charheight, charwidth;           /* As per proplist or -1 if not gven */
+  int charheight, charwidth;           /* As per proplist or -1 if not given */
   int pix_left, pix_top;               /* Calculated in init_frame_*, VP offset */
   int job_started : 1;
   int page_started : 1;
@@ -296,11 +301,12 @@ LRESULT WINAPI mswindows_control_wnd_proc (HWND hwnd,
                                           UINT msg, WPARAM wParam,
                                           LPARAM lParam);
 
-void mswindows_redraw_exposed_area (struct frame *f, int x, int y, 
+void mswindows_redraw_exposed_area (struct frame *f, int x, int y,
                                    int width, int height);
 void mswindows_size_frame_internal (struct frame* f, XEMACS_RECT_WH* dest);
 HWND mswindows_get_selected_frame_hwnd (void);
 void mswindows_enqueue_magic_event (HWND hwnd, UINT msg);
+int mswindows_is_dialog_msg (MSG *msg);
 
 /* win32 DDE management library */
 #define MSWINDOWS_DDE_ITEM_OPEN "Open"
@@ -364,7 +370,36 @@ Lisp_Object mswindows_handle_gui_wm_command (struct frame* f,
 
 int mswindows_windows9x_p (void);
 
-
 void mswindows_output_last_error (char *frob);
 
+Lisp_Object mswindows_handle_print_dialog_box (struct frame *f,
+                                              Lisp_Object keys);
+Lisp_Object mswindows_handle_page_setup_dialog_box (struct frame *f,
+                                                   Lisp_Object keys);
+Lisp_Object mswindows_handle_print_setup_dialog_box (struct frame *f,
+                                                    Lisp_Object keys);
+
+void mswindows_register_popup_frame (Lisp_Object frame);
+void mswindows_unregister_popup_frame (Lisp_Object frame);
+
+void mswindows_destroy_selection (Lisp_Object selection);
+
+Lisp_Object msprinter_default_printer (void);
+
+struct mswindows_dialog_id
+{
+  struct lcrecord_header header;
+
+  Lisp_Object frame;
+  Lisp_Object callbacks;
+  HWND hwnd;
+};
+
+DECLARE_LRECORD (mswindows_dialog_id, struct mswindows_dialog_id);
+#define XMSWINDOWS_DIALOG_ID(x) XRECORD (x, mswindows_dialog_id, struct mswindows_dialog_id)
+#define XSETMSWINDOWS_DIALOG_ID(x, p) XSETRECORD (x, p, mswindows_dialog_id)
+#define MSWINDOWS_DIALOG_IDP(x) RECORDP (x, mswindows_dialog_id)
+#define CHECK_MSWINDOWS_DIALOG_ID(x) CHECK_RECORD (x, mswindows_dialog_id)
+#define CONCHECK_MSWINDOWS_DIALOG_ID(x) CONCHECK_RECORD (x, mswindows_dialog_id)
+
 #endif /* INCLUDED_console_msw_h_ */
index 34bd768..56cd325 100644 (file)
@@ -130,8 +130,8 @@ tty_init_console (struct console *con, Lisp_Object props)
   if (NILP (CONSOLE_NAME (con)))
     CONSOLE_NAME (con) = Ffile_name_nondirectory (tty);
   {
-    int tty_pg;
-    int controlling_tty_pg;
+    pid_t tty_pg;
+    pid_t controlling_tty_pg;
     int cfd;
 
     /* OK, the only sure-fire way I can think of to determine
index 7a45d9d..dcc7407 100644 (file)
@@ -20,6 +20,8 @@ Boston, MA 02111-1307, USA.  */
 
 /* Synched up with: Not in FSF. */
 
+/* This file Mule-ized by Ben Wing, 7-10-00. */
+
 /* Authorship:
 
    Ben Wing: January 1996, for 19.14.
@@ -29,6 +31,7 @@ Boston, MA 02111-1307, USA.  */
 #include "lisp.h"
 
 #include "console-x.h"
+#include "buffer.h"
 #include "process.h" /* canonicalize_host_name */
 #include "redisplay.h" /* for display_arg */
 
@@ -44,7 +47,7 @@ static void
 split_up_display_spec (Lisp_Object display, int *hostname_length,
                       int *display_length, int *screen_length)
 {
-  char *dotptr;
+  Bufbyte *dotptr;
 
   dotptr = strrchr ((char *) XSTRING_DATA (display), ':');
   if (!dotptr)
@@ -54,12 +57,11 @@ split_up_display_spec (Lisp_Object display, int *hostname_length,
     }
   else
     {
-      *hostname_length = dotptr - (char *) XSTRING_DATA (display);
+      *hostname_length = dotptr - XSTRING_DATA (display);
 
-      dotptr = strchr (dotptr, '.');
+      dotptr = strchr ((char *) dotptr, '.');
       if (dotptr)
-       *display_length = (dotptr - (char *) XSTRING_DATA (display)
-                          - *hostname_length);
+       *display_length = (dotptr - XSTRING_DATA (display) - *hostname_length);
       else
        *display_length = XSTRING_LENGTH (display) - *hostname_length;
     }
@@ -102,7 +104,7 @@ x_device_to_console_connection (Lisp_Object connection, Error_behavior errb)
 static Lisp_Object
 get_display_arg_connection (void)
 {
-  const char *disp_name;
+  const Extbyte *disp_name;
 
   /* If the user didn't explicitly specify a display to use when
      they called make-x-device, then we first check to see if a
@@ -114,7 +116,7 @@ get_display_arg_connection (void)
     {
       int elt;
       int argc;
-      char **argv;
+      Extbyte **argv;
       Lisp_Object conn;
 
       make_argc_argv (Vx_initial_argv_list, &argc, &argv);
@@ -127,7 +129,8 @@ get_display_arg_connection (void)
              if (elt + 1 == argc)
                {
                  suppress_early_error_handler_backtrace = 1;
-                 error ("-display specified with no arg");
+                 type_error (Qinvalid_argument,
+                             "-display specified with no arg");
                }
              else
                {
@@ -140,12 +143,12 @@ get_display_arg_connection (void)
       /* assert: display_arg is only set if we found the display
         arg earlier so we can't fail to find it now. */
       assert (disp_name != NULL);
-      conn = build_ext_string (disp_name, Qctext);
+      conn = build_ext_string (disp_name, Qcommand_argument_encoding);
       free_argc_argv (argv);
       return conn;
     }
   else
-    return build_ext_string (XDisplayName (0), Qctext);
+    return build_ext_string (XDisplayName (0), Qx_display_name_encoding);
 }
 
 /* "semi-canonicalize" means convert to a nicer form for printing, but
@@ -181,8 +184,7 @@ x_semi_canonicalize_console_connection (Lisp_Object connection,
   /* Check for a couple of standard special cases */
   if (string_byte (XSTRING (connection), 0) == ':')
     connection = concat2 (build_string ("localhost"), connection);
-  else if (!strncmp ((const char *) XSTRING_DATA (connection),
-                    "unix:", 5))
+  else if (!strncmp (XSTRING_DATA (connection), "unix:", 5))
     connection = concat2 (build_string ("localhost:"),
                          Fsubstring (connection, make_int (5), Qnil));
 
@@ -260,7 +262,7 @@ x_canonicalize_device_connection (Lisp_Object connection, Error_behavior errb)
   split_up_display_spec (connection, &hostname_length, &display_length,
                         &screen_length);
 
-  screen_str = build_string ((const char *) XSTRING_DATA (connection)
+  screen_str = build_string (XSTRING_DATA (connection)
                             + hostname_length + display_length);
   connection = x_canonicalize_console_connection (connection, errb);
 
index 6a60189..85bc5a3 100644 (file)
@@ -88,14 +88,14 @@ struct x_device
   Pixmap gray_pixmap;
 
   /* Atoms associated with this device. */
-  /* allocated in Xatoms_of_xfns in xfns.c */
+  /* allocated in Xatoms_of_device_x */
   Atom Xatom_WM_PROTOCOLS;
   Atom Xatom_WM_DELETE_WINDOW;
   Atom Xatom_WM_SAVE_YOURSELF;
   Atom Xatom_WM_TAKE_FOCUS;
   Atom Xatom_WM_STATE;
 
-  /* allocated in Xatoms_of_select_x in xselect.c */
+  /* allocated in Xatoms_of_select_x */
   Atom Xatom_CLIPBOARD;
   Atom Xatom_TIMESTAMP;
   Atom Xatom_TEXT;
@@ -108,7 +108,7 @@ struct x_device
   Atom Xatom_ATOM_PAIR;
   Atom Xatom_COMPOUND_TEXT;
 
-  /* allocated in Xatoms_of_objects_x in objects-x.c */
+  /* allocated in Xatoms_of_objects_x */
   Atom Xatom_FOUNDRY;
   Atom Xatom_FAMILY_NAME;
   Atom Xatom_WEIGHT_NAME;
@@ -206,14 +206,14 @@ struct x_device
 #define DEVICE_X_FONTSET(d)    (DEVICE_X_DATA (d)->fontset)
 #endif /* HAVE_XIM */
 
-/* allocated in Xatoms_of_xfns in xfns.c */
+/* allocated in Xatoms_of_device_x */
 #define DEVICE_XATOM_WM_PROTOCOLS(d)    (DEVICE_X_DATA (d)->Xatom_WM_PROTOCOLS)
 #define DEVICE_XATOM_WM_DELETE_WINDOW(d) (DEVICE_X_DATA (d)->Xatom_WM_DELETE_WINDOW)
 #define DEVICE_XATOM_WM_SAVE_YOURSELF(d) (DEVICE_X_DATA (d)->Xatom_WM_SAVE_YOURSELF)
 #define DEVICE_XATOM_WM_TAKE_FOCUS(d)   (DEVICE_X_DATA (d)->Xatom_WM_TAKE_FOCUS)
 #define DEVICE_XATOM_WM_STATE(d)        (DEVICE_X_DATA (d)->Xatom_WM_STATE)
 
-/* allocated in Xatoms_of_select_x in xselect.c */
+/* allocated in Xatoms_of_select_x */
 #define DEVICE_XATOM_CLIPBOARD(d)      (DEVICE_X_DATA (d)->Xatom_CLIPBOARD)
 #define DEVICE_XATOM_TIMESTAMP(d)      (DEVICE_X_DATA (d)->Xatom_TIMESTAMP)
 #define DEVICE_XATOM_TEXT(d)           (DEVICE_X_DATA (d)->Xatom_TEXT)
@@ -226,7 +226,7 @@ struct x_device
 #define DEVICE_XATOM_ATOM_PAIR(d)      (DEVICE_X_DATA (d)->Xatom_ATOM_PAIR)
 #define DEVICE_XATOM_COMPOUND_TEXT(d)  (DEVICE_X_DATA (d)->Xatom_COMPOUND_TEXT)
 
-/* allocated in Xatoms_of_objects_x in objects-x.c */
+/* allocated in Xatoms_of_objects_x */
 #define DEVICE_XATOM_FOUNDRY(d)                (DEVICE_X_DATA (d)->Xatom_FOUNDRY)
 #define DEVICE_XATOM_FAMILY_NAME(d)    (DEVICE_X_DATA (d)->Xatom_FAMILY_NAME)
 #define DEVICE_XATOM_WEIGHT_NAME(d)    (DEVICE_X_DATA (d)->Xatom_WEIGHT_NAME)
@@ -491,6 +491,23 @@ extern int in_specifier_change_function;
 
 extern Lisp_Object Vx_initial_argv_list; /* #### ugh! */
 
+/* Standins for various X encodings, until we know them better */
+
+/* !!#### Need to verify the encoding used in lwlib -- Qnative or Qctext?
+   Almost certainly the former.  Use a standin for now. */
+#define Qlwlib_encoding Qnative
+
+#define Qx_atom_name_encoding Qctext
+/* font names are often stored in atoms, so it gets sticky if we set this
+   to something different from atom-name encoding */
+#define Qx_font_name_encoding Qctext
+
+#define Qx_color_name_encoding Qctext
+
+/* the following probably must agree with Qcommand_argument_encoding and
+   Qenvironment_variable_encoding */
+#define Qx_display_name_encoding Qnative
+
 #endif /* HAVE_X_WINDOWS */
 
 #endif /* INCLUDED_console_x_h_ */
index 5c5fa9c..8bf8ab5 100644 (file)
@@ -120,6 +120,8 @@ struct console_methods
   void (*focus_on_frame_method) (struct frame *);
   void (*raise_frame_method) (struct frame *);
   void (*lower_frame_method) (struct frame *);
+  void (*enable_frame_method) (struct frame *);
+  void (*disable_frame_method) (struct frame *);
   int (*get_mouse_position_method) (struct device *d, Lisp_Object *frame,
                                    int *x, int *y);
   void (*set_mouse_position_method) (struct window *w, int x, int y);
@@ -234,8 +236,8 @@ struct console_methods
   void (*map_subwindow_method) (Lisp_Image_Instance *, int x, int y,
                                struct display_glyph_area* dga);
   void (*resize_subwindow_method) (Lisp_Image_Instance *, int w, int h);
-  void (*update_subwindow_method) (Lisp_Image_Instance *);
-  void (*update_widget_method) (Lisp_Image_Instance *);
+  void (*redisplay_subwindow_method) (Lisp_Image_Instance *);
+  void (*redisplay_widget_method) (Lisp_Image_Instance *);
   int (*image_instance_equal_method) (Lisp_Image_Instance *,
                                      Lisp_Image_Instance *,
                                      int depth);
@@ -294,7 +296,9 @@ struct console_methods
 
 #ifdef HAVE_DIALOGS
   /* dialog methods */
-  void (*popup_dialog_box_method) (struct frame *, Lisp_Object dbox_desc);
+  Lisp_Object (*make_dialog_box_internal_method) (struct frame *,
+                                                 Lisp_Object type,
+                                                 Lisp_Object keys);
 #endif
 };
 
index 79f5607..a0f2445 100644 (file)
@@ -1,6 +1,7 @@
 /* Primitive operations on Lisp data types for XEmacs Lisp interpreter.
    Copyright (C) 1985, 1986, 1988, 1992, 1993, 1994, 1995
    Free Software Foundation, Inc.
+   Copyright (C) 2000 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -39,17 +40,22 @@ Boston, MA 02111-1307, USA.  */
 
 Lisp_Object Qnil, Qt, Qquote, Qlambda, Qunbound;
 Lisp_Object Qerror_conditions, Qerror_message;
-Lisp_Object Qerror, Qquit, Qwrong_type_argument, Qargs_out_of_range;
-Lisp_Object Qvoid_variable, Qcyclic_variable_indirection;
-Lisp_Object Qvoid_function, Qcyclic_function_indirection;
-Lisp_Object Qsetting_constant, Qinvalid_read_syntax;
+Lisp_Object Qerror, Qquit, Qsyntax_error, Qinvalid_read_syntax;
+Lisp_Object Qlist_formation_error;
 Lisp_Object Qmalformed_list, Qmalformed_property_list;
 Lisp_Object Qcircular_list, Qcircular_property_list;
-Lisp_Object Qinvalid_function, Qwrong_number_of_arguments, Qno_catch;
+Lisp_Object Qinvalid_argument, Qwrong_type_argument, Qargs_out_of_range;
+Lisp_Object Qwrong_number_of_arguments, Qinvalid_function, Qno_catch;
+Lisp_Object Qinternal_error, Qinvalid_state;
+Lisp_Object Qvoid_variable, Qcyclic_variable_indirection;
+Lisp_Object Qvoid_function, Qcyclic_function_indirection;
+Lisp_Object Qinvalid_operation, Qinvalid_change;
+Lisp_Object Qsetting_constant;
+Lisp_Object Qediting_error;
+Lisp_Object Qbeginning_of_buffer, Qend_of_buffer, Qbuffer_read_only;
 Lisp_Object Qio_error, Qend_of_file;
 Lisp_Object Qarith_error, Qrange_error, Qdomain_error;
 Lisp_Object Qsingularity_error, Qoverflow_error, Qunderflow_error;
-Lisp_Object Qbeginning_of_buffer, Qend_of_buffer, Qbuffer_read_only;
 Lisp_Object Qintegerp, Qnatnump, Qsymbolp;
 Lisp_Object Qlistp, Qtrue_list_p, Qweak_listp;
 Lisp_Object Qconsp, Qsubrp;
@@ -638,10 +644,11 @@ Set the cdr of CONSCELL to be NEWCDR.  Return NEWCDR.
    return it.  If there is a cycle in the function chain, signal a
    cyclic-function-indirection error.
 
-   This is like Findirect_function, except that it doesn't signal an
-   error if the chain ends up unbound.  */
+   This is like Findirect_function when VOID_FUNCTION_ERRORP is true.
+   When VOID_FUNCTION_ERRORP is false, no error is signaled if the end
+   of the chain ends up being Qunbound. */
 Lisp_Object
-indirect_function (Lisp_Object object, int errorp)
+indirect_function (Lisp_Object object, int void_function_errorp)
 {
 #define FUNCTION_INDIRECTION_SUSPICION_LENGTH 16
   Lisp_Object tortoise, hare;
@@ -659,7 +666,7 @@ indirect_function (Lisp_Object object, int errorp)
        return Fsignal (Qcyclic_function_indirection, list1 (object));
     }
 
-  if (errorp && UNBOUNDP (hare))
+  if (void_function_errorp && UNBOUNDP (hare))
     return signal_void_function_error (object);
 
   return hare;
@@ -2027,8 +2034,8 @@ init_data_very_early (void)
 void
 init_errors_once_early (void)
 {
-  defsymbol (&Qerror_conditions, "error-conditions");
-  defsymbol (&Qerror_message, "error-message");
+  DEFSYMBOL (Qerror_conditions);
+  DEFSYMBOL (Qerror_message);
 
   /* We declare the errors here because some other deferrors depend
      on some of the errors below. */
@@ -2036,62 +2043,64 @@ init_errors_once_early (void)
   /* ERROR is used as a signaler for random errors for which nothing
      else is right */
 
-  deferror (&Qerror, "error", "error", Qnil);
-  deferror (&Qquit, "quit", "Quit", Qnil);
+  DEFERROR (Qerror, "error", Qnil);
+  DEFERROR_STANDARD (Qquit, Qnil);
 
-  deferror (&Qwrong_type_argument, "wrong-type-argument",
-           "Wrong type argument", Qerror);
-  deferror (&Qargs_out_of_range, "args-out-of-range", "Args out of range",
-           Qerror);
-  deferror (&Qvoid_function, "void-function",
-           "Symbol's function definition is void", Qerror);
-  deferror (&Qcyclic_function_indirection, "cyclic-function-indirection",
-           "Symbol's chain of function indirections contains a loop", Qerror);
-  deferror (&Qvoid_variable, "void-variable",
-           "Symbol's value as variable is void", Qerror);
-  deferror (&Qcyclic_variable_indirection, "cyclic-variable-indirection",
-           "Symbol's chain of variable indirections contains a loop", Qerror);
-  deferror (&Qsetting_constant, "setting-constant",
-           "Attempt to set a constant symbol", Qerror);
-  deferror (&Qinvalid_read_syntax, "invalid-read-syntax",
-           "Invalid read syntax", Qerror);
+  DEFERROR (Qunimplemented, "Feature not yet implemented", Qerror);
+  DEFERROR_STANDARD (Qsyntax_error, Qerror);
+  DEFERROR_STANDARD (Qinvalid_read_syntax, Qsyntax_error);
+  DEFERROR_STANDARD (Qlist_formation_error, Qsyntax_error);
 
   /* Generated by list traversal macros */
-  deferror (&Qmalformed_list, "malformed-list",
-           "Malformed list", Qerror);
-  deferror (&Qmalformed_property_list, "malformed-property-list",
-           "Malformed property list", Qmalformed_list);
-  deferror (&Qcircular_list, "circular-list",
-           "Circular list", Qerror);
-  deferror (&Qcircular_property_list, "circular-property-list",
-           "Circular property list", Qcircular_list);
-
-  deferror (&Qinvalid_function, "invalid-function", "Invalid function",
-           Qerror);
-  deferror (&Qwrong_number_of_arguments, "wrong-number-of-arguments",
-           "Wrong number of arguments", Qerror);
-  deferror (&Qno_catch, "no-catch", "No catch for tag",
-           Qerror);
-  deferror (&Qbeginning_of_buffer, "beginning-of-buffer",
-           "Beginning of buffer", Qerror);
-  deferror (&Qend_of_buffer, "end-of-buffer", "End of buffer", Qerror);
-  deferror (&Qbuffer_read_only, "buffer-read-only", "Buffer is read-only",
-           Qerror);
+  DEFERROR_STANDARD (Qmalformed_list, Qlist_formation_error);
+  DEFERROR_STANDARD (Qmalformed_property_list, Qmalformed_list);
+  DEFERROR_STANDARD (Qcircular_list, Qlist_formation_error);
+  DEFERROR_STANDARD (Qcircular_property_list, Qcircular_list);
+
+  DEFERROR_STANDARD (Qinvalid_argument, Qerror);
+  DEFERROR_STANDARD (Qwrong_type_argument, Qinvalid_argument);
+  DEFERROR_STANDARD (Qargs_out_of_range, Qinvalid_argument);
+  DEFERROR_STANDARD (Qwrong_number_of_arguments, Qinvalid_argument);
+  DEFERROR_STANDARD (Qinvalid_function, Qinvalid_argument);
+  DEFERROR (Qno_catch, "No catch for tag", Qinvalid_argument);
 
-  deferror (&Qio_error, "io-error", "IO Error", Qerror);
-  deferror (&Qend_of_file, "end-of-file", "End of stream", Qio_error);
+  DEFERROR_STANDARD (Qinternal_error, Qerror);
 
-  deferror (&Qarith_error, "arith-error", "Arithmetic error", Qerror);
-  deferror (&Qrange_error, "range-error", "Arithmetic range error",
-           Qarith_error);
-  deferror (&Qdomain_error, "domain-error", "Arithmetic domain error",
-           Qarith_error);
-  deferror (&Qsingularity_error, "singularity-error",
-           "Arithmetic singularity error", Qdomain_error);
-  deferror (&Qoverflow_error, "overflow-error",
-           "Arithmetic overflow error", Qdomain_error);
-  deferror (&Qunderflow_error, "underflow-error",
-           "Arithmetic underflow error", Qdomain_error);
+  DEFERROR (Qinvalid_state, "Properties or values have been set incorrectly",
+           Qerror);
+  DEFERROR (Qvoid_function, "Symbol's function definition is void",
+           Qinvalid_state);
+  DEFERROR (Qcyclic_function_indirection,
+           "Symbol's chain of function indirections contains a loop",
+           Qinvalid_state);
+  DEFERROR (Qvoid_variable, "Symbol's value as variable is void",
+           Qinvalid_state);
+  DEFERROR (Qcyclic_variable_indirection,
+           "Symbol's chain of variable indirections contains a loop",
+           Qinvalid_state);
+
+  DEFERROR (Qinvalid_operation,
+           "Operation not allowed or error during operation", Qerror);
+  DEFERROR (Qinvalid_change, "Attempt to set properties or values incorrectly",
+           Qinvalid_operation);
+  DEFERROR (Qsetting_constant, "Attempt to set a constant symbol",
+           Qinvalid_change);
+
+  DEFERROR (Qediting_error, "Invalid operation during editing",
+           Qinvalid_operation);
+  DEFERROR_STANDARD (Qbeginning_of_buffer, Qediting_error);
+  DEFERROR_STANDARD (Qend_of_buffer, Qediting_error);
+  DEFERROR (Qbuffer_read_only, "Buffer is read-only", Qediting_error);
+
+  DEFERROR (Qio_error, "IO Error", Qinvalid_operation);
+  DEFERROR (Qend_of_file, "End of file or stream", Qio_error);
+
+  DEFERROR (Qarith_error, "Arithmetic error", Qinvalid_operation);
+  DEFERROR (Qrange_error, "Arithmetic range error", Qarith_error);
+  DEFERROR (Qdomain_error, "Arithmetic domain error", Qarith_error);
+  DEFERROR (Qsingularity_error, "Arithmetic singularity error", Qdomain_error);
+  DEFERROR (Qoverflow_error, "Arithmetic overflow error", Qdomain_error);
+  DEFERROR (Qunderflow_error, "Arithmetic underflow error", Qdomain_error);
 }
 
 void
@@ -2099,35 +2108,35 @@ syms_of_data (void)
 {
   INIT_LRECORD_IMPLEMENTATION (weak_list);
 
-  defsymbol (&Qquote, "quote");
-  defsymbol (&Qlambda, "lambda");
-  defsymbol (&Qlistp, "listp");
-  defsymbol (&Qtrue_list_p, "true-list-p");
-  defsymbol (&Qconsp, "consp");
-  defsymbol (&Qsubrp, "subrp");
-  defsymbol (&Qsymbolp, "symbolp");
-  defsymbol (&Qintegerp, "integerp");
-  defsymbol (&Qcharacterp, "characterp");
-  defsymbol (&Qnatnump, "natnump");
-  defsymbol (&Qstringp, "stringp");
-  defsymbol (&Qarrayp, "arrayp");
-  defsymbol (&Qsequencep, "sequencep");
-  defsymbol (&Qbufferp, "bufferp");
-  defsymbol (&Qbitp, "bitp");
-  defsymbol (&Qbit_vectorp, "bit-vector-p");
-  defsymbol (&Qvectorp, "vectorp");
-  defsymbol (&Qchar_or_string_p, "char-or-string-p");
-  defsymbol (&Qmarkerp, "markerp");
-  defsymbol (&Qinteger_or_marker_p, "integer-or-marker-p");
-  defsymbol (&Qinteger_or_char_p, "integer-or-char-p");
-  defsymbol (&Qinteger_char_or_marker_p, "integer-char-or-marker-p");
-  defsymbol (&Qnumberp, "numberp");
-  defsymbol (&Qnumber_char_or_marker_p, "number-char-or-marker-p");
-  defsymbol (&Qcdr, "cdr");
-  defsymbol (&Qweak_listp, "weak-list-p");
+  DEFSYMBOL (Qquote);
+  DEFSYMBOL (Qlambda);
+  DEFSYMBOL (Qlistp);
+  DEFSYMBOL (Qtrue_list_p);
+  DEFSYMBOL (Qconsp);
+  DEFSYMBOL (Qsubrp);
+  DEFSYMBOL (Qsymbolp);
+  DEFSYMBOL (Qintegerp);
+  DEFSYMBOL (Qcharacterp);
+  DEFSYMBOL (Qnatnump);
+  DEFSYMBOL (Qstringp);
+  DEFSYMBOL (Qarrayp);
+  DEFSYMBOL (Qsequencep);
+  DEFSYMBOL (Qbufferp);
+  DEFSYMBOL (Qbitp);
+  DEFSYMBOL_MULTIWORD_PREDICATE (Qbit_vectorp);
+  DEFSYMBOL (Qvectorp);
+  DEFSYMBOL (Qchar_or_string_p);
+  DEFSYMBOL (Qmarkerp);
+  DEFSYMBOL (Qinteger_or_marker_p);
+  DEFSYMBOL (Qinteger_or_char_p);
+  DEFSYMBOL (Qinteger_char_or_marker_p);
+  DEFSYMBOL (Qnumberp);
+  DEFSYMBOL (Qnumber_char_or_marker_p);
+  DEFSYMBOL (Qcdr);
+  DEFSYMBOL_MULTIWORD_PREDICATE (Qweak_listp);
 
 #ifdef LISP_FLOAT_TYPE
-  defsymbol (&Qfloatp, "floatp");
+  DEFSYMBOL (Qfloatp);
 #endif /* LISP_FLOAT_TYPE */
 
   DEFSUBR (Fwrong_type_argument);
index 9accaa4..3f859dd 100644 (file)
-## This file automatically generated by make-src-depend.  Do not modify.
+## This file is automatically generated by `make-src-depend'.  Do not modify.
 
-#ifdef USE_UNION_TYPE
+#if defined(USE_UNION_TYPE)
 LISP_UNION_H=lisp-union.h
 #else
 LISP_UNION_H=lisp-disunion.h
 #endif
-LISP_H = lisp.h config.h $(LISP_UNION_H)
-#ifdef HAVE_MS_WINDOWS
-console-msw.o: $(LISP_H) conslots.h console-msw.h console.h events.h lisp-disunion.h lisp-union.h lrecord.h opaque.h symeval.h symsinit.h systime.h
-device-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console-stream.h console.h device.h events.h faces.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h systime.h toolbar.h
-dialog-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h
-dired-msw.o: $(LISP_H) buffer.h bufslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h ndir.h nt.h regex.h symeval.h symsinit.h sysdir.h sysfile.h sysproc.h systime.h
-event-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console-tty.h console.h device.h dragdrop.h events-mod.h events.h faces.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h lstream.h menubar-msw.h menubar.h mule-charset.h objects-msw.h objects.h process.h redisplay.h scrollbar-msw.h scrollbar.h select.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h toolbar.h
-frame-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h elhash.h events.h faces.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h
-glyphs-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h elhash.h faces.h file-coding.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h imgproc.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h objects-msw.h objects.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h toolbar.h window.h winslots.h
-gui-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h elhash.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h
-menubar-msw.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console-msw.h console.h device.h elhash.h events.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h menubar-msw.h menubar.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h
-objects-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h hash.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-msw.h objects.h specifier.h symeval.h symsinit.h
-redisplay-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h debug.h device.h events.h faces.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h gutter.h lisp-disunion.h lisp-union.h lrecord.h mule-ccl.h mule-charset.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h systime.h toolbar.h window.h winslots.h
-scrollbar-msw.o: $(LISP_H) conslots.h console-msw.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h redisplay.h scrollbar-msw.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h
-select-msw.o: $(LISP_H) conslots.h console-msw.h console.h device.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h redisplay.h scrollbar.h select.h specifier.h symeval.h symsinit.h toolbar.h
-toolbar-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h elhash.h faces.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
+LISP_H=lisp.h lrecord.h config.h general-slots.h symsinit.h symeval.h $(LISP_UNION_H)
+#if defined(HAVE_MS_WINDOWS)
+console-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h events.h mule-charset.h opaque.h syscommctrl.h systime.h syswindows.h
+device-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console-stream.h console.h device.h events.h faces.h frame.h frameslots.h glyphs.h gui.h mule-charset.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h syscommctrl.h sysdep.h systime.h syswindows.h toolbar.h window.h winslots.h
+dialog-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h frame.h frameslots.h glyphs.h gui.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h syscommctrl.h syswindows.h toolbar.h window.h winslots.h
+dired-msw.o: $(LISP_H) buffer.h bufslots.h mule-charset.h ndir.h nt.h regex.h sysdir.h sysfile.h sysproc.h systime.h syswindows.h
+event-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console-tty.h console.h device.h dragdrop.h events-mod.h events.h faces.h frame.h frameslots.h glyphs.h gui.h lstream.h menubar-msw.h menubar.h mule-charset.h objects-msw.h objects.h process.h redisplay.h scrollbar-msw.h scrollbar.h select.h specifier.h syscommctrl.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h syswindows.h toolbar.h window.h winslots.h
+frame-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h elhash.h events.h faces.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h mule-charset.h redisplay.h scrollbar.h specifier.h syscommctrl.h systime.h syswindows.h toolbar.h window.h winslots.h
+glyphs-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h elhash.h faces.h file-coding.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h imgproc.h insdel.h lstream.h mule-charset.h objects-msw.h objects.h opaque.h redisplay.h scrollbar.h specifier.h syscommctrl.h sysfile.h syswindows.h toolbar.h window.h winslots.h
+gui-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h elhash.h events.h frame.h frameslots.h glyphs.h gui.h mule-charset.h redisplay.h scrollbar.h specifier.h syscommctrl.h systime.h syswindows.h toolbar.h window.h winslots.h
+menubar-msw.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console-msw.h console.h device.h elhash.h events.h frame.h frameslots.h glyphs.h gui.h menubar-msw.h menubar.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h syscommctrl.h systime.h syswindows.h toolbar.h window.h winslots.h
+objects-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h hash.h insdel.h mule-charset.h objects-msw.h objects.h specifier.h syscommctrl.h syswindows.h
+redisplay-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h debug.h device.h events.h faces.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h gutter.h mule-ccl.h mule-charset.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h syscommctrl.h sysdep.h systime.h syswindows.h toolbar.h window.h winslots.h
+scrollbar-msw.o: $(LISP_H) conslots.h console-msw.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h redisplay.h scrollbar-msw.h scrollbar.h specifier.h syscommctrl.h systime.h syswindows.h toolbar.h window.h winslots.h
+select-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h file-coding.h frame.h frameslots.h glyphs.h gui.h mule-charset.h opaque.h redisplay.h scrollbar.h select.h specifier.h syscommctrl.h syswindows.h toolbar.h window.h winslots.h
+toolbar-msw.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h device.h elhash.h faces.h frame.h frameslots.h glyphs-msw.h glyphs.h gui.h mule-charset.h objects-msw.h objects.h redisplay.h scrollbar.h specifier.h syscommctrl.h syswindows.h toolbar.h window.h winslots.h
 #endif
-#ifdef HAVE_X_WINDOWS
-balloon-x.o: $(LISP_H) balloon_help.h conslots.h console-x.h console.h device.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h xintrinsic.h
-console-x.o: $(LISP_H) conslots.h console-x.h console.h lisp-disunion.h lisp-union.h lrecord.h process.h redisplay.h symeval.h symsinit.h xintrinsic.h
-device-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h conslots.h console-x.h console.h device.h elhash.h events.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-x.h objects.h offix-types.h offix.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysdll.h sysfile.h systime.h toolbar.h window.h winslots.h xgccache.h xintrinsic.h xintrinsicp.h xmu.h
-dialog-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h buffer.h bufslots.h commands.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h glyphs.h gui-x.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h xintrinsic.h
-frame-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h EmacsShell.h ExternalShell.h buffer.h bufslots.h conslots.h console-x.h console.h device.h dragdrop.h events-mod.h events.h extents.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h gutter.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-x.h objects.h offix-types.h offix.h redisplay.h scrollbar-x.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h xintrinsic.h xintrinsicp.h xmprimitivep.h xmu.h
-glyphs-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h bitmaps.h buffer.h bufslots.h conslots.h console-x.h console.h device.h faces.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h gui.h imgproc.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h objects-x.h objects.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h toolbar.h window.h winslots.h xintrinsic.h xmu.h
-gui-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h conslots.h console-x.h console.h device.h frame.h frameslots.h glyphs.h gui-x.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h xintrinsic.h
-input-method-xfs.o: $(LISP_H) EmacsFrame.h buffer.h bufslots.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h xintrinsic.h
-input-method-xlib.o: $(LISP_H) EmacsFrame.h buffer.h bufslots.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h xintrinsic.h
-menubar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h buffer.h bufslots.h commands.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h glyphs.h gui-x.h gui.h keymap.h lisp-disunion.h lisp-union.h lrecord.h menubar.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h xintrinsic.h
-objects-x.o: $(LISP_H) buffer.h bufslots.h conslots.h console-x.h console.h device.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-x.h objects.h specifier.h symeval.h symsinit.h xintrinsic.h
-redisplay-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h buffer.h bufslots.h conslots.h console-x.h console.h debug.h device.h faces.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h gutter.h lisp-disunion.h lisp-union.h lrecord.h mule-ccl.h mule-charset.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysproc.h systime.h toolbar.h window.h winslots.h xgccache.h xintrinsic.h xintrinsicp.h xmprimitivep.h
-scrollbar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h conslots.h console-x.h console.h device.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h gui.h lisp-disunion.h lisp-union.h lrecord.h redisplay.h scrollbar-x.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h xintrinsic.h
-select-x.o: $(LISP_H) buffer.h bufslots.h conslots.h console-x.h console.h device.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-x.h objects.h opaque.h redisplay.h scrollbar.h select.h specifier.h symeval.h symsinit.h systime.h toolbar.h xintrinsic.h
-toolbar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h buffer.h bufslots.h conslots.h console-x.h console.h device.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h xintrinsic.h xintrinsicp.h xmprimitivep.h
+#if defined(HAVE_X_WINDOWS)
+balloon-x.o: $(LISP_H) balloon_help.h conslots.h console-x.h console.h device.h xintrinsic.h
+console-x.o: $(LISP_H) buffer.h bufslots.h conslots.h console-x.h console.h mule-charset.h process.h redisplay.h xintrinsic.h
+device-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h conslots.h console-x.h console.h device.h elhash.h events.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h mule-charset.h objects-x.h objects.h offix-types.h offix.h redisplay.h scrollbar.h specifier.h sysdep.h sysdll.h sysfile.h systime.h toolbar.h window.h winslots.h xgccache.h xintrinsic.h xintrinsicp.h xmu.h
+dialog-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h buffer.h bufslots.h commands.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h glyphs.h gui-x.h gui.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h
+frame-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h EmacsShell.h ExternalShell.h buffer.h bufslots.h conslots.h console-x.h console.h device.h dragdrop.h events-mod.h events.h extents.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h gutter.h mule-charset.h objects-x.h objects.h offix-types.h offix.h redisplay.h scrollbar-x.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h xintrinsicp.h xmprimitivep.h xmu.h
+glyphs-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h bitmaps.h buffer.h bufslots.h conslots.h console-x.h console.h device.h faces.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h gui.h imgproc.h insdel.h lstream.h mule-charset.h objects-x.h objects.h opaque.h redisplay.h scrollbar.h specifier.h sysfile.h toolbar.h window.h winslots.h xintrinsic.h xmu.h
+gui-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h glyphs.h gui-x.h gui.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h
+menubar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h buffer.h bufslots.h commands.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h glyphs.h gui-x.h gui.h keymap.h menubar.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h
+objects-x.o: $(LISP_H) buffer.h bufslots.h conslots.h console-x.h console.h device.h insdel.h mule-charset.h objects-x.h objects.h specifier.h xintrinsic.h
+redisplay-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h buffer.h bufslots.h conslots.h console-x.h console.h debug.h device.h faces.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h gutter.h mule-ccl.h mule-charset.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h sysdep.h sysproc.h systime.h toolbar.h window.h winslots.h xgccache.h xintrinsic.h xintrinsicp.h xmprimitivep.h
+scrollbar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h conslots.h console-x.h console.h device.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h gui.h redisplay.h scrollbar-x.h scrollbar.h specifier.h toolbar.h window.h winslots.h xintrinsic.h
+select-x.o: $(LISP_H) buffer.h bufslots.h conslots.h console-x.h console.h device.h frame.h frameslots.h glyphs.h gui.h mule-charset.h objects-x.h objects.h opaque.h redisplay.h scrollbar.h select.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h
+toolbar-x.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h buffer.h bufslots.h conslots.h console-x.h console.h device.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h mule-charset.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h xintrinsic.h xintrinsicp.h xmprimitivep.h
 #endif
-#ifdef HAVE_DATABASE
-database.o: $(LISP_H) buffer.h bufslots.h database.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h sysfile.h
+#if defined(HAVE_TTY)
+console-tty.o: $(LISP_H) buffer.h bufslots.h conslots.h console-stream.h console-tty.h console.h device.h faces.h file-coding.h frame.h frameslots.h glyphs.h gui.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h syssignal.h systty.h toolbar.h window.h winslots.h
+device-tty.o: $(LISP_H) buffer.h bufslots.h conslots.h console-stream.h console-tty.h console.h device.h events.h faces.h frame.h frameslots.h glyphs.h gui.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h sysdep.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h
+event-tty.o: $(LISP_H) conslots.h console-tty.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h process.h redisplay.h scrollbar.h specifier.h sysproc.h syssignal.h systime.h systty.h syswait.h toolbar.h window.h winslots.h
+frame-tty.o: $(LISP_H) conslots.h console-tty.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h redisplay.h scrollbar.h specifier.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h
+objects-tty.o: $(LISP_H) conslots.h console-tty.h console.h device.h insdel.h mule-charset.h objects-tty.h objects.h specifier.h syssignal.h systty.h
+redisplay-tty.o: $(LISP_H) buffer.h bufslots.h conslots.h console-tty.h console.h device.h events.h faces.h frame.h frameslots.h glyphs.h gui.h lstream.h mule-charset.h objects-tty.h objects.h redisplay.h scrollbar.h specifier.h sysdep.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h
 #endif
-#ifdef MULE
-mule-canna.o: $(LISP_H) buffer.h bufslots.h file-coding.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h
-mule-ccl.o: $(LISP_H) buffer.h bufslots.h file-coding.h lisp-disunion.h lisp-union.h lrecord.h mule-ccl.h mule-charset.h symeval.h symsinit.h
-mule-charset.o: $(LISP_H) buffer.h bufslots.h chartab.h conslots.h console.h device.h elhash.h faces.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-ccl.h mule-charset.h symeval.h symsinit.h
-mule-mcpath.o: $(LISP_H) buffer.h bufslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h sysfile.h
-mule-wnnfns.o: $(LISP_H) buffer.h bufslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h symeval.h symsinit.h sysdep.h window.h winslots.h
-mule.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h regex.h symeval.h symsinit.h
+#if defined(HAVE_DATABASE)
+database.o: $(LISP_H) buffer.h bufslots.h database.h mule-charset.h sysfile.h
 #endif
-#ifdef EXTERNAL_WIDGET
+#if defined(MULE)
+mule-canna.o: $(LISP_H) buffer.h bufslots.h file-coding.h mule-charset.h
+mule-ccl.o: $(LISP_H) buffer.h bufslots.h file-coding.h mule-ccl.h mule-charset.h
+mule-charset.o: $(LISP_H) buffer.h bufslots.h chartab.h conslots.h console.h device.h elhash.h faces.h lstream.h mule-ccl.h mule-charset.h
+mule-wnnfns.o: $(LISP_H) buffer.h bufslots.h mule-charset.h redisplay.h scrollbar.h sysdep.h window.h winslots.h
+mule.o: $(LISP_H) regex.h
+#endif
+#if defined(EXTERNAL_WIDGET)
 ExternalClient-Xlib.o: extw-Xlib.h
 ExternalClient.o: ExternalClient.h ExternalClientP.h config.h extw-Xlib.h extw-Xt.h xintrinsicp.h
 ExternalShell.o: ExternalShell.h ExternalShellP.h config.h extw-Xlib.h extw-Xt.h xintrinsic.h xintrinsicp.h
 extw-Xlib.o: config.h extw-Xlib.h
 extw-Xt.o: config.h extw-Xlib.h extw-Xt.h
 #endif
-EmacsFrame.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h buffer.h bufslots.h conslots.h console-x.h console.h device.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h xintrinsic.h xintrinsicp.h xmprimitivep.h xmu.h
+EmacsFrame.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h EmacsFrame.h EmacsFrameP.h EmacsManager.h buffer.h bufslots.h conslots.h console-x.h console.h device.h faces.h frame.h frameslots.h glyphs-x.h glyphs.h gui.h mule-charset.h objects-x.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h xintrinsic.h xintrinsicp.h xmprimitivep.h xmu.h
 EmacsManager.o: EmacsManager.h EmacsManagerP.h config.h xintrinsicp.h xmmanagerp.h
 EmacsShell-sub.o: EmacsShell.h EmacsShellP.h config.h xintrinsic.h xintrinsicp.h
 EmacsShell.o: EmacsShell.h ExternalShell.h config.h xintrinsicp.h
-abbrev.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h symeval.h symsinit.h syntax.h window.h winslots.h
-alloc.o: $(LISP_H) alloc.h backtrace.h buffer.h bufslots.h bytecode.h chartab.h conslots.h console-stream.h console.h device.h dumper.h elhash.h events.h extents.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h systime.h toolbar.h window.h winslots.h
+abbrev.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h insdel.h mule-charset.h redisplay.h scrollbar.h syntax.h window.h winslots.h
+alloc.o: $(LISP_H) alloc.h backtrace.h buffer.h bufslots.h bytecode.h chartab.h conslots.h console-stream.h console.h device.h dumper.h elhash.h events.h extents.h frame.h frameslots.h glyphs.h gui.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h systime.h toolbar.h window.h winslots.h
 alloca.o: config.h
 balloon_help.o: balloon_help.h config.h xintrinsic.h
-blocktype.o: $(LISP_H) blocktype.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
-buffer.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h conslots.h console.h device.h elhash.h extents.h faces.h file-coding.h frame.h frameslots.h glyphs.h gui.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h syntax.h sysdep.h sysfile.h toolbar.h window.h winslots.h
-bytecode.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h chartab.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h symeval.h symsinit.h syntax.h
-callint.o: $(LISP_H) buffer.h bufslots.h bytecode.h commands.h events.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h symeval.h symsinit.h systime.h window.h winslots.h
-callproc.o: $(LISP_H) buffer.h bufslots.h commands.h file-coding.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h nt.h process.h redisplay.h scrollbar.h symeval.h symsinit.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h window.h winslots.h
-casefiddle.o: $(LISP_H) buffer.h bufslots.h chartab.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h syntax.h
-casetab.o: $(LISP_H) buffer.h bufslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h symeval.h symsinit.h
-chartab.o: $(LISP_H) buffer.h bufslots.h chartab.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h syntax.h
-cm.o: $(LISP_H) conslots.h console-tty.h console.h device.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h syssignal.h systty.h toolbar.h
-cmdloop.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h
-cmds.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h syntax.h
-console-stream.o: $(LISP_H) conslots.h console-stream.h console-tty.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h
-console-tty.o: $(LISP_H) buffer.h bufslots.h conslots.h console-stream.h console-tty.h console.h device.h faces.h file-coding.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h syssignal.h systty.h toolbar.h
-console.o: $(LISP_H) buffer.h bufslots.h conslots.h console-tty.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h
-data.o: $(LISP_H) buffer.h bufslots.h bytecode.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h sysfloat.h syssignal.h
-debug.o: $(LISP_H) bytecode.h debug.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
-device-tty.o: $(LISP_H) buffer.h bufslots.h conslots.h console-stream.h console-tty.h console.h device.h events.h faces.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h syssignal.h systime.h systty.h toolbar.h
-device.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h elhash.h events.h faces.h frame.h frameslots.h glyphs.h gui.h keymap.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h syssignal.h systime.h toolbar.h window.h winslots.h
-dgif_lib.o: gifrlib.h
-dialog.o: $(LISP_H) conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h
-dired.o: $(LISP_H) buffer.h bufslots.h commands.h elhash.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h ndir.h opaque.h regex.h symeval.h symsinit.h sysdep.h sysdir.h sysfile.h syspwd.h systime.h
-doc.o: $(LISP_H) buffer.h bufslots.h bytecode.h insdel.h keymap.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h sysfile.h
-doprnt.o: $(LISP_H) buffer.h bufslots.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h symeval.h symsinit.h
-dragdrop.o: $(LISP_H) dragdrop.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
-dumper.o: $(LISP_H) alloc.h conslots.h console-stream.h console.h dump-id.h dumper.h elhash.h lisp-disunion.h lisp-union.h lrecord.h specifier.h symeval.h symsinit.h sysfile.h
-dynarr.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
+blocktype.o: $(LISP_H) blocktype.h
+buffer.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h conslots.h console.h device.h elhash.h extents.h faces.h file-coding.h frame.h frameslots.h glyphs.h gui.h insdel.h lstream.h mule-charset.h process.h redisplay.h scrollbar.h select.h specifier.h syntax.h sysdep.h sysfile.h toolbar.h window.h winslots.h
+bytecode.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h chartab.h mule-charset.h opaque.h syntax.h
+callint.o: $(LISP_H) buffer.h bufslots.h bytecode.h commands.h events.h insdel.h mule-charset.h redisplay.h scrollbar.h systime.h window.h winslots.h
+callproc.o: $(LISP_H) buffer.h bufslots.h commands.h file-coding.h insdel.h lstream.h mule-charset.h nt.h process.h redisplay.h scrollbar.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswindows.h window.h winslots.h
+casefiddle.o: $(LISP_H) buffer.h bufslots.h chartab.h insdel.h mule-charset.h syntax.h
+casetab.o: $(LISP_H) buffer.h bufslots.h mule-charset.h opaque.h
+chartab.o: $(LISP_H) buffer.h bufslots.h chartab.h mule-charset.h syntax.h
+cm.o: $(LISP_H) conslots.h console-tty.h console.h device.h frame.h frameslots.h glyphs.h gui.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h syssignal.h systty.h toolbar.h window.h winslots.h
+cmdloop.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h
+cmds.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h insdel.h mule-charset.h syntax.h
+console-stream.o: $(LISP_H) conslots.h console-stream.h console-tty.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h
+console.o: $(LISP_H) buffer.h bufslots.h conslots.h console-tty.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h mule-charset.h redisplay.h scrollbar.h specifier.h sysdep.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h
+data.o: $(LISP_H) buffer.h bufslots.h bytecode.h mule-charset.h sysfloat.h syssignal.h
+debug.o: $(LISP_H) bytecode.h debug.h
+device.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h elhash.h events.h faces.h frame.h frameslots.h glyphs.h gui.h keymap.h mule-charset.h redisplay.h scrollbar.h specifier.h sysdep.h syssignal.h systime.h toolbar.h window.h winslots.h
+dgif_lib.o: $(LISP_H) gifrlib.h sysfile.h
+dialog.o: $(LISP_H) conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h
+dired.o: $(LISP_H) buffer.h bufslots.h commands.h elhash.h mule-charset.h ndir.h opaque.h regex.h sysdep.h sysdir.h sysfile.h syspwd.h systime.h
+doc.o: $(LISP_H) buffer.h bufslots.h bytecode.h insdel.h keymap.h mule-charset.h sysfile.h
+doprnt.o: $(LISP_H) buffer.h bufslots.h lstream.h mule-charset.h
+dragdrop.o: $(LISP_H) dragdrop.h
+dumper.o: $(LISP_H) alloc.h conslots.h console-stream.h console.h dump-id.h dumper.h elhash.h nt.h specifier.h sysfile.h syswindows.h
+dynarr.o: $(LISP_H)
 ecrt0.o: config.h
-editfns.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h conslots.h console.h device.h events.h extents.h frame.h frameslots.h glyphs.h gui.h insdel.h line-number.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h syspwd.h systime.h toolbar.h window.h winslots.h
-eldap.o: $(LISP_H) buffer.h bufslots.h eldap.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h symeval.h symsinit.h sysdep.h
-elhash.o: $(LISP_H) bytecode.h elhash.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
-emacs.o: $(LISP_H) backtrace.h buffer.h bufslots.h commands.h conslots.h console.h device.h dump-id.h dumper.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h paths.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysdll.h sysfile.h syssignal.h systime.h systty.h toolbar.h
-emodules.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h emodules.h file-coding.h frame.h frameslots.h glyphs.h gui.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysdll.h toolbar.h window.h winslots.h
-esd.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h miscplay.h symeval.h symsinit.h
-eval.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h commands.h conslots.h console.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h symeval.h symsinit.h
-event-Xt.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h Emacs.ad.h EmacsFrame.h blocktype.h buffer.h bufslots.h conslots.h console-tty.h console-x.h console.h device.h dragdrop.h elhash.h events-mod.h events.h file-coding.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h objects-x.h objects.h offix-types.h offix.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysproc.h syssignal.h systime.h systty.h toolbar.h xintrinsic.h xintrinsicp.h
-event-stream.o: $(LISP_H) blocktype.h buffer.h bufslots.h commands.h conslots.h console.h device.h elhash.h events-mod.h events.h file-coding.h frame.h frameslots.h glyphs.h gui.h insdel.h keymap.h lisp-disunion.h lisp-union.h lrecord.h lstream.h macros.h menubar.h mule-charset.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h syssignal.h systime.h toolbar.h window.h winslots.h
-event-tty.o: $(LISP_H) conslots.h console-tty.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysproc.h syssignal.h systime.h systty.h syswait.h toolbar.h
-event-unixoid.o: $(LISP_H) conslots.h console-stream.h console-tty.h console.h device.h events.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h process.h symeval.h symsinit.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h
-events.o: $(LISP_H) buffer.h bufslots.h conslots.h console-tty.h console-x.h console.h device.h events-mod.h events.h extents.h frame.h frameslots.h glyphs.h gui.h keymap.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h xintrinsic.h
-extents.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h debug.h device.h elhash.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h gutter.h insdel.h keymap.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h
-faces.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h elhash.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
-file-coding.o: $(LISP_H) buffer.h bufslots.h chartab.h elhash.h file-coding.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-ccl.h mule-charset.h opaque.h symeval.h symsinit.h
-fileio.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h events.h file-coding.h frame.h frameslots.h glyphs.h gui.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h ndir.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysdir.h sysfile.h sysproc.h syspwd.h systime.h toolbar.h window.h winslots.h
-filelock.o: $(LISP_H) buffer.h bufslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h ndir.h paths.h symeval.h symsinit.h sysdir.h sysfile.h syspwd.h syssignal.h
-filemode.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h sysfile.h
-floatfns.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h sysfloat.h syssignal.h
-fns.o: $(LISP_H) buffer.h bufslots.h bytecode.h conslots.h console.h device.h events.h extents.h frame.h frameslots.h glyphs.h gui.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h
-font-lock.o: $(LISP_H) buffer.h bufslots.h chartab.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h syntax.h
-frame-tty.o: $(LISP_H) conslots.h console-tty.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h syssignal.h systime.h systty.h toolbar.h
-frame.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h events.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h gutter.h lisp-disunion.h lisp-union.h lrecord.h menubar.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h
-free-hook.o: $(LISP_H) hash.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
-general.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
-getloadavg.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h sysfile.h
-gif_io.o: gifrlib.h sysfile.h
-glyphs-eimage.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h faces.h file-coding.h frame.h frameslots.h gifrlib.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h objects.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h toolbar.h
-glyphs-widget.o: $(LISP_H) buffer.h bufslots.h bytecode.h conslots.h console.h device.h faces.h frame.h frameslots.h glyphs.h gui.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h objects.h opaque.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
-glyphs.o: $(LISP_H) blocktype.h buffer.h bufslots.h chartab.h conslots.h console.h device.h elhash.h faces.h frame.h frameslots.h glyphs.h gui.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects.h opaque.h rangetab.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
+editfns.o: $(LISP_H) buffer.h bufslots.h chartab.h commands.h conslots.h console.h device.h events.h extents.h frame.h frameslots.h glyphs.h gui.h insdel.h line-number.h mule-charset.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h syspwd.h systime.h toolbar.h window.h winslots.h
+eldap.o: $(LISP_H) buffer.h bufslots.h eldap.h mule-charset.h opaque.h sysdep.h
+elhash.o: $(LISP_H) bytecode.h elhash.h
+emacs.o: $(LISP_H) backtrace.h buffer.h bufslots.h commands.h conslots.h console.h device.h dump-id.h dumper.h frame.h frameslots.h glyphs.h gui.h mule-charset.h nt.h paths.h process.h redisplay.h scrollbar.h specifier.h sysdep.h sysdll.h sysfile.h syssignal.h systime.h systty.h syswindows.h toolbar.h window.h winslots.h
+emodules.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h emodules.h file-coding.h frame.h frameslots.h glyphs.h gui.h insdel.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h sysdep.h sysdll.h toolbar.h window.h winslots.h
+esd.o: $(LISP_H) miscplay.h
+eval.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h commands.h conslots.h console.h mule-charset.h opaque.h
+event-Xt.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h Emacs.ad.h EmacsFrame.h blocktype.h buffer.h bufslots.h conslots.h console-tty.h console-x.h console.h device.h dragdrop.h elhash.h events-mod.h events.h file-coding.h frame.h frameslots.h glyphs.h gui.h lstream.h mule-charset.h objects-x.h objects.h offix-types.h offix.h process.h redisplay.h scrollbar.h specifier.h sysproc.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h xintrinsic.h xintrinsicp.h
+event-stream.o: $(LISP_H) blocktype.h buffer.h bufslots.h commands.h conslots.h console.h device.h elhash.h events-mod.h events.h file-coding.h frame.h frameslots.h glyphs.h gui.h insdel.h keymap.h lstream.h macros.h menubar.h mule-charset.h process.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h syssignal.h systime.h toolbar.h window.h winslots.h
+event-unixoid.o: $(LISP_H) conslots.h console-stream.h console-tty.h console.h device.h events.h lstream.h mule-charset.h process.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h
+events.o: $(LISP_H) buffer.h bufslots.h conslots.h console-tty.h console-x.h console.h device.h events-mod.h events.h extents.h frame.h frameslots.h glyphs.h gui.h keymap.h mule-charset.h redisplay.h scrollbar.h specifier.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h xintrinsic.h
+extents.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h debug.h device.h elhash.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h gutter.h insdel.h keymap.h mule-charset.h opaque.h process.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h
+faces.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h elhash.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h mule-charset.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h
+file-coding.o: $(LISP_H) buffer.h bufslots.h chartab.h elhash.h file-coding.h insdel.h lstream.h mule-ccl.h mule-charset.h opaque.h
+fileio.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h events.h file-coding.h frame.h frameslots.h glyphs.h gui.h insdel.h lstream.h mule-charset.h ndir.h redisplay.h scrollbar.h specifier.h sysdep.h sysdir.h sysfile.h sysproc.h syspwd.h systime.h toolbar.h window.h winslots.h
+filelock.o: $(LISP_H) buffer.h bufslots.h mule-charset.h ndir.h paths.h sysdir.h sysfile.h syspwd.h syssignal.h
+filemode.o: $(LISP_H) sysfile.h
+floatfns.o: $(LISP_H) sysfloat.h syssignal.h
+fns.o: $(LISP_H) buffer.h bufslots.h bytecode.h conslots.h console.h device.h events.h extents.h frame.h frameslots.h glyphs.h gui.h insdel.h lstream.h mule-charset.h opaque.h redisplay.h scrollbar.h specifier.h sysfile.h systime.h toolbar.h window.h winslots.h
+font-lock.o: $(LISP_H) buffer.h bufslots.h chartab.h insdel.h mule-charset.h syntax.h
+frame.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h events.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h gutter.h menubar.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h
+free-hook.o: $(LISP_H) hash.h
+general.o: $(LISP_H)
+getloadavg.o: $(LISP_H) sysfile.h
+gif_io.o: config.h gifrlib.h sysfile.h
+glyphs-eimage.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h faces.h file-coding.h frame.h frameslots.h gifrlib.h glyphs.h gui.h lstream.h mule-charset.h objects.h opaque.h redisplay.h scrollbar.h specifier.h sysfile.h toolbar.h window.h winslots.h
+glyphs-widget.o: $(LISP_H) buffer.h bufslots.h bytecode.h conslots.h console.h device.h faces.h frame.h frameslots.h glyphs.h gui.h insdel.h lstream.h mule-charset.h objects.h opaque.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h
+glyphs.o: $(LISP_H) blocktype.h buffer.h bufslots.h chartab.h conslots.h console.h device.h elhash.h faces.h frame.h frameslots.h glyphs.h gui.h insdel.h mule-charset.h objects.h opaque.h rangetab.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h
 gmalloc.o: config.h getpagesize.h
-gpmevent.o: $(LISP_H) commands.h conslots.h console-tty.h console.h device.h events-mod.h events.h gpmevent.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h process.h symeval.h symsinit.h sysdep.h sysproc.h syssignal.h systime.h systty.h
-gui.o: $(LISP_H) buffer.h bufslots.h bytecode.h elhash.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h
-gutter.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h faces.h frame.h frameslots.h glyphs.h gui.h gutter.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
-hash.o: $(LISP_H) hash.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
-hftctl.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
-hpplay.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h nativesound.h symeval.h symsinit.h
-imgproc.o: $(LISP_H) imgproc.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
-indent.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
-inline.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h bytecode.h chartab.h conslots.h console.h database.h device.h eldap.h elhash.h events.h extents.h faces.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h gui.h keymap.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h objects.h opaque.h postgresql.h process.h rangetab.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h syntax.h systime.h toolbar.h tooltalk.h window.h winslots.h xintrinsic.h
-input-method-motif.o: $(LISP_H) EmacsFrame.h conslots.h console-x.h console.h device.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h xintrinsic.h
-insdel.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h extents.h frame.h frameslots.h glyphs.h gui.h insdel.h line-number.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h
-intl.o: $(LISP_H) bytecode.h conslots.h console.h device.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
-keymap.o: $(LISP_H) buffer.h bufslots.h bytecode.h conslots.h console.h device.h elhash.h events-mod.h events.h frame.h frameslots.h glyphs.h gui.h insdel.h keymap.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h
-libsst.o: $(LISP_H) libsst.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
-line-number.o: $(LISP_H) buffer.h bufslots.h line-number.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h
-linuxplay.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h miscplay.h nativesound.h symeval.h symsinit.h sysfile.h syssignal.h
-lread.o: $(LISP_H) buffer.h bufslots.h bytecode.h elhash.h file-coding.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h opaque.h symeval.h symsinit.h sysfile.h sysfloat.h
-lstream.o: $(LISP_H) buffer.h bufslots.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h symeval.h symsinit.h sysfile.h
-macros.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h keymap.h lisp-disunion.h lisp-union.h lrecord.h macros.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h
+gpmevent.o: $(LISP_H) commands.h conslots.h console-tty.h console.h device.h events-mod.h events.h gpmevent.h lstream.h mule-charset.h process.h sysdep.h sysproc.h syssignal.h systime.h systty.h
+gui.o: $(LISP_H) buffer.h bufslots.h bytecode.h elhash.h gui.h mule-charset.h
+gutter.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h faces.h frame.h frameslots.h glyphs.h gui.h gutter.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h
+hash.o: $(LISP_H) hash.h
+hftctl.o: $(LISP_H)
+hpplay.o: $(LISP_H) nativesound.h
+imgproc.o: $(LISP_H) imgproc.h
+indent.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h extents.h faces.h frame.h frameslots.h glyphs.h gui.h insdel.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h
+inline.o: $(LISP_H) $(LWLIB_SRCDIR)/lwlib.h buffer.h bufslots.h bytecode.h chartab.h conslots.h console-msw.h console.h database.h device.h eldap.h elhash.h events.h extents.h faces.h file-coding.h frame.h frameslots.h glyphs-x.h glyphs.h gui-x.h gui.h keymap.h lstream.h mule-charset.h objects.h opaque.h postgresql.h process.h rangetab.h redisplay.h scrollbar.h specifier.h syntax.h syscommctrl.h systime.h syswindows.h toolbar.h tooltalk.h window.h winslots.h xintrinsic.h
+input-method-motif.o: $(LISP_H) EmacsFrame.h conslots.h console-x.h console.h device.h frame.h frameslots.h glyphs.h gui.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h xintrinsic.h
+input-method-xfs.o: $(LISP_H) EmacsFrame.h buffer.h bufslots.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h
+input-method-xlib.o: $(LISP_H) EmacsFrame.h buffer.h bufslots.h conslots.h console-x.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h xintrinsic.h
+insdel.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h extents.h frame.h frameslots.h glyphs.h gui.h insdel.h line-number.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h
+intl.o: $(LISP_H) bytecode.h conslots.h console.h device.h
+keymap.o: $(LISP_H) buffer.h bufslots.h bytecode.h conslots.h console.h device.h elhash.h events-mod.h events.h frame.h frameslots.h glyphs.h gui.h insdel.h keymap.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h
+libsst.o: $(LISP_H) libsst.h
+line-number.o: $(LISP_H) buffer.h bufslots.h line-number.h mule-charset.h
+linuxplay.o: $(LISP_H) miscplay.h nativesound.h sysfile.h syssignal.h
+lread.o: $(LISP_H) buffer.h bufslots.h bytecode.h elhash.h file-coding.h lstream.h mule-charset.h opaque.h sysfile.h sysfloat.h
+lstream.o: $(LISP_H) buffer.h bufslots.h insdel.h lstream.h mule-charset.h sysfile.h
+macros.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h keymap.h macros.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h
 malloc.o: config.h getpagesize.h
-marker.o: $(LISP_H) buffer.h bufslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h
-md5.o: $(LISP_H) buffer.h bufslots.h file-coding.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h symeval.h symsinit.h
-menubar.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h keymap.h lisp-disunion.h lisp-union.h lrecord.h menubar.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
-minibuf.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console-stream.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h systime.h toolbar.h window.h winslots.h
-miscplay.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h miscplay.h symeval.h symsinit.h sysfile.h syssignal.h
-nas.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h sysdep.h syssignal.h
-nt.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h nt.h ntheap.h symeval.h symsinit.h sysfile.h sysproc.h syssignal.h systime.h
-ntheap.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h ntheap.h symeval.h symsinit.h
-ntplay.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h nativesound.h symeval.h symsinit.h sysfile.h
-ntproc.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h nt.h ntheap.h process.h symeval.h symsinit.h sysfile.h sysproc.h syssignal.h systime.h syswait.h
-objects-tty.o: $(LISP_H) conslots.h console-tty.h console.h device.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects-tty.h objects.h specifier.h symeval.h symsinit.h syssignal.h systty.h
-objects.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h elhash.h faces.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
+marker.o: $(LISP_H) buffer.h bufslots.h mule-charset.h
+md5.o: $(LISP_H) buffer.h bufslots.h file-coding.h lstream.h mule-charset.h
+menubar.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h keymap.h menubar.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h
+minibuf.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console-stream.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h insdel.h mule-charset.h redisplay.h scrollbar.h specifier.h systime.h toolbar.h window.h winslots.h
+miscplay.o: $(LISP_H) miscplay.h sysfile.h syssignal.h
+nas.o: $(LISP_H) sysdep.h syssignal.h
+nt.o: $(LISP_H) ndir.h nt.h ntheap.h sysdir.h sysfile.h sysproc.h syspwd.h syssignal.h systime.h syswindows.h
+ntheap.o: $(LISP_H) ntheap.h syswindows.h
+ntplay.o: $(LISP_H) nativesound.h nt.h sysfile.h syswindows.h
+ntproc.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h mule-charset.h nt.h ntheap.h process.h syscommctrl.h sysfile.h sysproc.h syssignal.h systime.h syswait.h syswindows.h
+objects.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h elhash.h faces.h frame.h frameslots.h glyphs.h gui.h mule-charset.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h
 offix.o: offix-cursors.h offix-types.h offix.h xintrinsic.h
-opaque.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h opaque.h symeval.h symsinit.h
-postgresql.o: $(LISP_H) buffer.h bufslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h postgresql.h symeval.h symsinit.h sysdep.h
-print.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h conslots.h console-msw.h console-stream.h console-tty.h console.h device.h extents.h frame.h frameslots.h glyphs.h gui.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h syssignal.h systty.h toolbar.h
-process-nt.o: $(LISP_H) conslots.h console-msw.h console.h hash.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h process.h procimpl.h symeval.h symsinit.h sysdep.h
-process-unix.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h events.h file-coding.h frame.h frameslots.h glyphs.h gui.h hash.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h opaque.h process.h procimpl.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h toolbar.h window.h winslots.h
-process.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h events.h file-coding.h frame.h frameslots.h glyphs.h gui.h hash.h insdel.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h opaque.h process.h procimpl.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h toolbar.h window.h winslots.h
-profile.o: $(LISP_H) backtrace.h bytecode.h elhash.h hash.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h syssignal.h systime.h
-ralloc.o: $(LISP_H) getpagesize.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
-rangetab.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h rangetab.h symeval.h symsinit.h
+opaque.o: $(LISP_H) opaque.h
+postgresql.o: $(LISP_H) buffer.h bufslots.h mule-charset.h postgresql.h sysdep.h
+print.o: $(LISP_H) backtrace.h buffer.h bufslots.h bytecode.h conslots.h console-msw.h console-stream.h console-tty.h console.h device.h extents.h frame.h frameslots.h glyphs.h gui.h insdel.h lstream.h mule-charset.h redisplay.h scrollbar.h specifier.h syscommctrl.h sysfile.h syssignal.h systty.h syswindows.h toolbar.h window.h winslots.h
+process-nt.o: $(LISP_H) buffer.h bufslots.h conslots.h console-msw.h console.h hash.h lstream.h mule-charset.h nt.h process.h procimpl.h syscommctrl.h sysdep.h syswindows.h
+process-unix.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h events.h file-coding.h frame.h frameslots.h glyphs.h gui.h hash.h lstream.h mule-charset.h opaque.h process.h procimpl.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h toolbar.h window.h winslots.h
+process.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h events.h file-coding.h frame.h frameslots.h glyphs.h gui.h hash.h insdel.h lstream.h mule-charset.h opaque.h process.h procimpl.h redisplay.h scrollbar.h specifier.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h toolbar.h window.h winslots.h
+profile.o: $(LISP_H) backtrace.h bytecode.h elhash.h hash.h syssignal.h systime.h
+ralloc.o: $(LISP_H) getpagesize.h
+rangetab.o: $(LISP_H) rangetab.h
 realpath.o: config.h
-redisplay-output.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h faces.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
-redisplay-tty.o: $(LISP_H) buffer.h bufslots.h conslots.h console-tty.h console.h device.h events.h faces.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h objects-tty.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h syssignal.h systime.h systty.h toolbar.h window.h winslots.h
-redisplay.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console-tty.h console.h debug.h device.h elhash.h extents.h faces.h file-coding.h frame.h frameslots.h glyphs.h gui.h gutter.h insdel.h line-number.h lisp-disunion.h lisp-union.h lrecord.h menubar.h mule-charset.h objects.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h syssignal.h systty.h toolbar.h window.h winslots.h
-regex.o: $(LISP_H) buffer.h bufslots.h chartab.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h regex.h symeval.h symsinit.h syntax.h
-scrollbar.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h gutter.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
-search.o: $(LISP_H) buffer.h bufslots.h chartab.h insdel.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h regex.h symeval.h symsinit.h syntax.h
-select.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects.h opaque.h redisplay.h scrollbar.h select.h specifier.h symeval.h symsinit.h toolbar.h
-sgiplay.o: $(LISP_H) libst.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
-sheap.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h sheap-adjust.h symeval.h symsinit.h
-signal.o: $(LISP_H) conslots.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h syssignal.h systime.h toolbar.h
-sound.o: $(LISP_H) buffer.h bufslots.h conslots.h console-x.h console.h device.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h nativesound.h redisplay.h symeval.h symsinit.h sysdep.h xintrinsic.h
-specifier.o: $(LISP_H) buffer.h bufslots.h chartab.h conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h opaque.h rangetab.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
+redisplay-output.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h faces.h frame.h frameslots.h glyphs.h gui.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h
+redisplay.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console-tty.h console.h debug.h device.h elhash.h extents.h faces.h file-coding.h frame.h frameslots.h glyphs.h gui.h gutter.h insdel.h line-number.h menubar.h mule-charset.h objects.h process.h redisplay.h scrollbar.h specifier.h sysfile.h syssignal.h systty.h toolbar.h window.h winslots.h
+regex.o: $(LISP_H) buffer.h bufslots.h chartab.h mule-charset.h regex.h syntax.h
+scrollbar.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h gutter.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h
+search.o: $(LISP_H) buffer.h bufslots.h chartab.h insdel.h mule-charset.h opaque.h regex.h syntax.h
+select.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h extents.h frame.h frameslots.h glyphs.h gui.h mule-charset.h objects.h opaque.h redisplay.h scrollbar.h select.h specifier.h toolbar.h window.h winslots.h
+sgiplay.o: $(LISP_H) libst.h
+sheap.o: $(LISP_H) sheap-adjust.h
+signal.o: $(LISP_H) conslots.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h redisplay.h scrollbar.h specifier.h sysdep.h sysfile.h syssignal.h systime.h toolbar.h window.h winslots.h
+sound.o: $(LISP_H) buffer.h bufslots.h conslots.h console-x.h console.h device.h mule-charset.h nativesound.h redisplay.h sysdep.h sysfile.h sysproc.h systime.h xintrinsic.h
+specifier.o: $(LISP_H) buffer.h bufslots.h chartab.h conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h mule-charset.h opaque.h rangetab.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h
 strcat.o: config.h
 strcmp.o: config.h
 strcpy.o: config.h
-strftime.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
+strftime.o: $(LISP_H)
 sunOS-fix.o: config.h
-sunplay.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h nativesound.h symeval.h symsinit.h sysdep.h syssignal.h
-sunpro.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
-symbols.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h elhash.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h
-syntax.o: $(LISP_H) buffer.h bufslots.h chartab.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h syntax.h
-sysdep.o: $(LISP_H) buffer.h bufslots.h conslots.h console-stream.h console-tty.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h ndir.h ntheap.h process.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h sysdep.h sysdir.h sysfile.h syssignal.h systime.h systty.h syswait.h toolbar.h window.h winslots.h
+sunplay.o: $(LISP_H) nativesound.h sysdep.h syssignal.h
+sunpro.o: $(LISP_H)
+symbols.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h elhash.h mule-charset.h
+syntax.o: $(LISP_H) buffer.h bufslots.h chartab.h mule-charset.h syntax.h
+sysdep.o: $(LISP_H) buffer.h bufslots.h conslots.h console-stream.h console-tty.h console.h device.h events.h frame.h frameslots.h glyphs.h gui.h mule-charset.h ndir.h nt.h ntheap.h process.h redisplay.h scrollbar.h specifier.h sysdep.h sysdir.h sysfile.h sysproc.h syssignal.h systime.h systty.h syswait.h syswindows.h toolbar.h window.h winslots.h
 sysdll.o: config.h sysdll.h
-termcap.o: $(LISP_H) conslots.h console.h device.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
+termcap.o: $(LISP_H) conslots.h console.h device.h
 terminfo.o: config.h
-tests.o: $(LISP_H) buffer.h bufslots.h lisp-disunion.h lisp-union.h lrecord.h lstream.h mule-charset.h opaque.h symeval.h symsinit.h
-toolbar.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
-tooltalk.o: $(LISP_H) buffer.h bufslots.h elhash.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h process.h symeval.h symsinit.h tooltalk.h
+tests.o: $(LISP_H) buffer.h bufslots.h lstream.h mule-charset.h opaque.h
+toolbar.o: $(LISP_H) buffer.h bufslots.h conslots.h console.h device.h frame.h frameslots.h glyphs.h gui.h mule-charset.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h
+tooltalk.o: $(LISP_H) buffer.h bufslots.h elhash.h mule-charset.h process.h syssignal.h tooltalk.h
 tparam.o: config.h
-undo.o: $(LISP_H) buffer.h bufslots.h extents.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h
-unexaix.o: $(LISP_H) getpagesize.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
+undo.o: $(LISP_H) buffer.h bufslots.h extents.h mule-charset.h
+unexaix.o: $(LISP_H) getpagesize.h
 unexalpha.o: config.h
 unexapollo.o: config.h
 unexconvex.o: config.h getpagesize.h
 unexcw.o: config.h sysfile.h
-unexec.o: $(LISP_H) getpagesize.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
+unexec.o: $(LISP_H) getpagesize.h
 unexelf.o: config.h
-unexelfsgi.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h
+unexelfsgi.o: $(LISP_H)
 unexenix.o: config.h
 unexfreebsd.o: config.h
 unexhp9k3.o: config.h sysdep.h
-unexhp9k800.o: config.h
+unexhp9k800.o: $(LISP_H)
 unexmips.o: config.h getpagesize.h
-unexnt.o: config.h ntheap.h
+unexnt.o: $(LISP_H) nt.h ntheap.h syswindows.h
 unexsunos4.o: config.h
-vm-limit.o: $(LISP_H) lisp-disunion.h lisp-union.h lrecord.h mem-limits.h symeval.h symsinit.h
-widget.o: $(LISP_H) buffer.h bufslots.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h symeval.h symsinit.h
-window.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h elhash.h faces.h frame.h frameslots.h glyphs.h gui.h gutter.h lisp-disunion.h lisp-union.h lrecord.h mule-charset.h objects.h redisplay.h scrollbar.h specifier.h symeval.h symsinit.h toolbar.h window.h winslots.h
-xgccache.o: $(LISP_H) hash.h lisp-disunion.h lisp-union.h lrecord.h symeval.h symsinit.h xgccache.h
+vm-limit.o: $(LISP_H) mem-limits.h
+widget.o: $(LISP_H) buffer.h bufslots.h mule-charset.h
+win32.o: $(LISP_H) buffer.h bufslots.h mule-charset.h syswindows.h
+window.o: $(LISP_H) buffer.h bufslots.h commands.h conslots.h console.h device.h elhash.h faces.h frame.h frameslots.h glyphs.h gui.h gutter.h mule-charset.h objects.h redisplay.h scrollbar.h specifier.h toolbar.h window.h winslots.h
+xgccache.o: $(LISP_H) hash.h xgccache.h
 xmu.o: config.h
index 2d822a6..6e63f9a 100644 (file)
@@ -40,12 +40,10 @@ Boston, MA 02111-1307, USA.  */
 #include "frame.h"
 #include "sysdep.h"
 
-/* #### Andy, these includes might break cygwin compilation - kkm*/
 #include <commdlg.h>
-#include <winspool.h>
 
 #if !(defined (CYGWIN) || defined(MINGW))
-# include <objbase.h>  /* For CoInitialize */
+#include <objbase.h>   /* For CoInitialize */
 #endif
 
 /* win32 DDE management library globals */
@@ -60,7 +58,7 @@ HSZ mswindows_dde_item_open;
    nil means no, t means yes. */
 Lisp_Object Vmswindows_downcase_file_names;
 
-/* Control whether stat() attempts to determine file type and link count
+/* Control whether xemacs_stat() attempts to determine file type and link count
    exactly, at the expense of slower operation.  Since true hard links
    are supported on NTFS volumes, this is only relevant on NT.  */
 Lisp_Object Vmswindows_get_true_file_attributes;
@@ -137,7 +135,7 @@ mswindows_init_device (struct device *d, Lisp_Object props)
   wc.cbWndExtra = MSWINDOWS_WINDOW_EXTRA_BYTES;
   /* This must match whatever is passed to CreateWIndowEx, NULL is ok
      for this. */
-  wc.hInstance = NULL; 
+  wc.hInstance = NULL;
   wc.hIcon = LoadIcon (GetModuleHandle(NULL), XEMACS_CLASS);
   wc.hCursor = LoadCursor (NULL, IDC_ARROW);
   /* Background brush is only used during sizing, when XEmacs cannot
@@ -146,9 +144,16 @@ mswindows_init_device (struct device *d, Lisp_Object props)
   wc.lpszMenuName = NULL;
 
   wc.lpszClassName = XEMACS_CLASS;
-  wc.hIconSm = (HICON) LoadImage (GetModuleHandle (NULL), XEMACS_CLASS,
-                         IMAGE_ICON, 16, 16, 0);
-  RegisterClassEx (&wc);
+  if (xLoadImageA) /* not in NT 3.5 */
+    wc.hIconSm = (HICON) xLoadImageA (GetModuleHandle (NULL), XEMACS_CLASS,
+                                     IMAGE_ICON, 16, 16, 0);
+  else
+    wc.hIconSm = 0;
+
+  if (xRegisterClassExA)  /* not in NT 3.5 */
+    xRegisterClassExA (&wc);
+  else
+    RegisterClassA ((WNDCLASS *) &wc.style);
 
 #ifdef HAVE_WIDGETS
   xzero (wc);
@@ -157,7 +162,10 @@ mswindows_init_device (struct device *d, Lisp_Object props)
   wc.lpfnWndProc = (WNDPROC) mswindows_control_wnd_proc;
   wc.lpszClassName = XEMACS_CONTROL_CLASS;
   wc.hInstance = NULL;
-  RegisterClassEx (&wc);
+  if (xRegisterClassExA)  /* not in NT 3.5 */
+    xRegisterClassExA (&wc);
+  else
+    RegisterClassA ((WNDCLASS *) &wc.style);
 #endif
 
 #if defined (HAVE_TOOLBARS) || defined (HAVE_WIDGETS)
@@ -180,7 +188,7 @@ mswindows_finish_init_device (struct device *d, Lisp_Object props)
                 APPCMD_FILTERINITS|CBF_FAIL_SELFCONNECTIONS|CBF_FAIL_ADVISES|
                 CBF_FAIL_POKES|CBF_FAIL_REQUESTS|CBF_SKIP_ALLNOTIFICATIONS,
                 0);
-  
+
   mswindows_dde_service = DdeCreateStringHandle (mswindows_dde_mlid,
                                                 XEMACS_CLASS, 0);
   mswindows_dde_topic_system = DdeCreateStringHandle (mswindows_dde_mlid,
@@ -258,7 +266,7 @@ mswindows_device_system_metrics (struct device *d,
 #define FROB(met, fore, back)                          \
     case DM_##met:                                     \
       return build_syscolor_cons (fore, back);
-      
+
       FROB (color_default, COLOR_WINDOWTEXT, COLOR_WINDOW);
       FROB (color_select, COLOR_HIGHLIGHTTEXT, COLOR_HIGHLIGHT);
       FROB (color_balloon, COLOR_INFOTEXT, COLOR_INFOBK);
@@ -340,7 +348,7 @@ mswindows_device_implementation_flags (void)
 static void
 signal_open_printer_error (struct device *d)
 {
-  signal_simple_error ("Failed to open printer", DEVICE_CONNECTION (d));
+  invalid_operation ("Failed to open printer", DEVICE_CONNECTION (d));
 }
 
 
@@ -385,12 +393,31 @@ msprinter_delete_device_internal (struct device *d)
   DEVICE_MSPRINTER_FONTLIST (d) = Qnil;
 }
 
-static int msprinter_reinit_device (struct device *d, char* devname)
+static int
+msprinter_reinit_device (struct device *d, char* devname)
 {
   msprinter_delete_device_internal (d);
   return msprinter_init_device_internal (d, devname);
 }
 
+Lisp_Object
+msprinter_default_printer (void)
+{
+  Extbyte name[666];
+  Bufbyte *nameint;
+
+  if (GetProfileString (XETEXT ("windows"), XETEXT ("device"), NULL, name,
+                       sizeof (name) / XETCHAR_SIZE) <= 0)
+    return Qnil;
+  EXTERNAL_TO_C_STRING (name, nameint, Qmswindows_tstr);
+
+  if (name[0] == '\0')
+    return Qnil;
+  strtok (name, ",");
+
+  return build_string (name);
+}
+
 \f
 /************************************************************************/
 /*                          printer methods                             */
@@ -421,9 +448,9 @@ msprinter_init_device (struct device *d, Lisp_Object props)
 
   if (!msprinter_init_device_internal (d, printer_name))
     signal_open_printer_error (d);
-    
-  /* Determinie DEVMODE size and store the default DEVMODE */
-  dm_size = DocumentProperties (NULL, DEVICE_MSPRINTER_HPRINTER(d),
+
+  /* Determine DEVMODE size and store the default DEVMODE */
+  dm_size = DocumentProperties (NULL, DEVICE_MSPRINTER_HPRINTER (d),
                                printer_name, NULL, NULL, 0);
   if (dm_size <= 0)
     signal_open_printer_error (d);
@@ -435,7 +462,7 @@ msprinter_init_device (struct device *d, Lisp_Object props)
 
   assert (DEVMODE_SIZE (pdm) <= dm_size);
 
-  DEVICE_MSPRINTER_DEVMODE(d) = 
+  DEVICE_MSPRINTER_DEVMODE(d) =
     allocate_devmode (pdm, 0, printer_name, d);
 
 }
@@ -483,7 +510,7 @@ msprinter_device_system_metrics (struct device *d,
          therefore useless */
       return make_int (GetDeviceCaps (DEVICE_MSPRINTER_HDC(d), BITSPIXEL));
 
-    case DM_num_color_cells:   /* Prnters are non-palette devices */
+    case DM_num_color_cells:   /* Printers are non-palette devices */
     case DM_slow_device:       /* Animation would be a really bad idea */
     case DM_security:          /* Not provided by windows */
       return Qzero;
@@ -584,7 +611,7 @@ sync_printer_with_devmode (struct device* d, DEVMODE* devmode_in,
       DEVICE_MSPRINTER_HDC (d) =
        CreateDC ("WINSPOOL", DEVICE_MSPRINTER_NAME(d), NULL, devmode_out);
     }
+
   return 1;
 }
 
@@ -628,8 +655,8 @@ ensure_not_printing (struct device *d)
   {
     Lisp_Object device;
     XSETDEVICE (device, d);
-    signal_simple_error ("Cannot change settings while print job is active",
-                        device);
+    invalid_operation ("Cannot change settings while print job is active",
+                      device);
   }
 }
 
@@ -640,12 +667,8 @@ decode_devmode (Lisp_Object dev)
     return XDEVMODE (dev);
   else
     {
-      struct device* d = decode_device (dev);
-      Lisp_Object device;
-      XSETDEVICE (device, d);
-      CHECK_MSPRINTER_DEVICE (device);
-      ensure_not_printing (d);
-      return XDEVMODE (DEVICE_MSPRINTER_DEVMODE (d));
+      ensure_not_printing (XDEVICE (dev));
+      return XDEVMODE (DEVICE_MSPRINTER_DEVMODE (XDEVICE (dev)));
     }
 }
 
@@ -707,77 +730,74 @@ print_dialog_worker (Lisp_Object dev, int print_p)
   }
 }
 
-DEFUN ("msprinter-print-setup-dialog", Fmsprinter_print_setup_dialog, 1, 1, 0, /*
-Invoke Windows standard Printer Setup dialog.
-This dialog is usually invoked when the user selects the Printer Setup
-command.
-
-DEVICE must be either an 'msprinter device, or a printer settings
-object. The function brings up the Printer Setup dialog, where the user
-can select a different printer and/or change printer options.
-Connection name can change as a result of selecting a different printer
-device.  If a printer is specified, then changes are stored into the
-settings object currently selected into that printer.  If a settings
-object is supplied, then changes are recorded into it, and, it it is
-selected into a printer, then changes are propagated to that printer
-too.
-
-Return value is nil if the user has canceled the dialog.  Otherwise, it
-is a new plist, with the following properties:
-  name       Printer device name, even if unchanged by the user.
-
-The printer device is destroyed and an error is signaled if new printer
-is selected by the user, but cannot be initialized.
-
-See also `msprinter-print-dialog' and `msprinter-page-setup-dialog'.
-*/
-       (device))
+Lisp_Object
+mswindows_handle_print_setup_dialog_box (struct frame *f, Lisp_Object keys)
 {
-  return print_dialog_worker (device, 0);
+  Lisp_Object device = Qunbound, settings = Qunbound;
+
+  {
+    EXTERNAL_PROPERTY_LIST_LOOP_3 (key, value, keys)
+      {
+       if (EQ (key, Q_device))
+         {
+           device = wrap_device (decode_device (value));
+           CHECK_MSPRINTER_DEVICE (device);
+         }
+       else if (EQ (key, Q_printer_settings))
+         {
+           CHECK_DEVMODE (value);
+           settings = value;
+         }
+       else
+         syntax_error ("Unrecognized print-dialog keyword", key);
+      }
+  }
+
+  if ((UNBOUNDP (device) && UNBOUNDP (settings)) ||
+      (!UNBOUNDP (device) && !UNBOUNDP (settings)))
+    syntax_error ("Exactly one of :device and :printer-settings must be given",
+                 keys);
+
+  return print_dialog_worker (!UNBOUNDP (device) ? device : settings, 0);
 }
 
-DEFUN ("msprinter-print-dialog", Fmsprinter_print_dialog, 1, 1, 0, /*
-Invoke Windows standard Print dialog.
-This dialog is usually invoked when the user selects the Print command.
-After the user presses OK, the program should start actual printout.
-
-DEVICE must be either an 'msprinter device, or a printer settings
-object. The function brings up the Print dialog, where the user can
-select a different printer and/or change printer options. Connection
-name can change as a result of selecting a different printer device.  If
-a printer is specified, then changes are stored into the settings object
-currently selected into that printer.  If a settings object is supplied,
-then changes are recorded into it, and, it it is selected into a
-printer, then changes are propagated to that printer 
-too.
-
-Return value is nil if the user has canceled the dialog.  Otherwise, it
-is a new plist, with the following properties:
-  name       Printer device name, even if unchanged by the user.
-  from-page  First page to print, 1-based. If not specified by the user,
-             then this value is not included in the plist.
-  to-page    Last page to print, inclusive, 1-based. If not specified by
-             the user, then this value is not included in the plist.
-  copies     Number of copies to print.  Always returned.
-
-The DEVICE is destroyed and an error is signaled in case of
-initialization problem with the new printer.
-
-See also `msprinter-setup-print-dialog' and
-`msprinter-page-setup-dialog'.
-*/
-       (device))
+Lisp_Object
+mswindows_handle_print_dialog_box (struct frame *f, Lisp_Object keys)
 {
-  return print_dialog_worker (device, 1);
-}
+  Lisp_Object device = Qunbound, settings = Qunbound;
+
+  {
+    EXTERNAL_PROPERTY_LIST_LOOP_3 (key, value, keys)
+      {
+       if (EQ (key, Q_device))
+         {
+           device = wrap_device (decode_device (value));
+           CHECK_MSPRINTER_DEVICE (device);
+         }
+       else if (EQ (key, Q_printer_settings))
+         {
+           CHECK_DEVMODE (value);
+           settings = value;
+         }
+       else
+         syntax_error ("Unrecognized print-dialog keyword", key);
+      }
+  }
 
+  if ((UNBOUNDP (device) && UNBOUNDP (settings)) ||
+      (!UNBOUNDP (device) && !UNBOUNDP (settings)))
+    syntax_error ("Exactly one of :device and :printer-settings must be given",
+                 keys);
+
+  return print_dialog_worker (!UNBOUNDP (device) ? device : settings, 1);
+}
 
 static int
 plist_get_margin (Lisp_Object plist, Lisp_Object prop)
 {
   Lisp_Object val = Fplist_get (plist, prop, make_int (1440));
   if (!INTP (val))
-    signal_simple_error ("Margin value must be an integer", val);
+    invalid_argument ("Margin value must be an integer", val);
 
   return MulDiv (XINT (val), 100, 144);
 }
@@ -789,70 +809,78 @@ plist_set_margin (Lisp_Object plist, Lisp_Object prop, int margin, int mm_p)
   return Fcons (prop, Fcons (val, plist));
 }
 
-DEFUN ("msprinter-page-setup-dialog", Fmsprinter_page_setup_dialog, 1, 2, 0, /*
-Invoke Windows standard Page Setup dialog.
-This dialog is usually invoked in response to Page Setup command, and
-used to chose such parameters as page orientation, print margins etc.
-Note that this dialog contains the "Printer" button, which invokes
-Printer Setup dialog (see `msprinter-print-setup-dialog') so that the
-user can update the printer options or even select a different printer
-as well.
-
-DEVICE must be either an 'msprinter device, or a printer settings
-object. The function brings up the Page Setup dialog, where the user
-can select a different printer and/or change printer options.
-Connection name can change as a result of selecting a different printer
-device.  If a printer is specified, then changes are stored into the
-settings object currently selected into that printer.  If a settings
-object is supplied, then changes are recorded into it, and, it it is
-selected into a printer, then changes are propagated to that printer
-too.
-
-PLIST is a plist of job properties;
-see `default-msprinter-frame-plist' for the complete list.  The plist
-is used to initialize the dialog.
-
-Return value is nil if the user has canceled the dialog.  Otherwise,
-it is a new plist, containing the new list of properties.
-
-The DEVICE is destroyed and an error is signaled in case of
-initialization problem with the new printer.
-
-See also `msprinter-print-setup-dialog' and `msprinter-print-dialog'.
-*/
-       (device, plist))
+Lisp_Object
+mswindows_handle_page_setup_dialog_box (struct frame *f, Lisp_Object keys)
 {
-  Lisp_Devmode *ldm = decode_devmode (device);
-  PAGESETUPDLG pd;
+  Lisp_Object device = Qunbound, settings = Qunbound;
+  Lisp_Object plist = Qnil;
 
-  memset (&pd, 0, sizeof (pd));
-  pd.lStructSize = sizeof (pd);
-  pd.hwndOwner = mswindows_get_selected_frame_hwnd ();
-  pd.Flags = PSD_MARGINS;
-  pd.rtMargin.left   = plist_get_margin (plist, Qleft_margin);
-  pd.rtMargin.top    = plist_get_margin (plist, Qtop_margin);
-  pd.rtMargin.right  = plist_get_margin (plist, Qright_margin);
-  pd.rtMargin.bottom = plist_get_margin (plist, Qbottom_margin);
-  pd.hDevMode = devmode_to_hglobal (ldm);
+  {
+    EXTERNAL_PROPERTY_LIST_LOOP_3 (key, value, keys)
+      {
+       if (EQ (key, Q_device))
+         {
+           device = wrap_device (decode_device (value));
+           CHECK_MSPRINTER_DEVICE (device);
+         }
+       else if (EQ (key, Q_printer_settings))
+         {
+           CHECK_DEVMODE (value);
+           settings = value;
+         }
+       else if (EQ (key, Q_properties))
+         {
+           CHECK_LIST (value);
+           plist = value;
+         }
+       else
+         syntax_error ("Unrecognized page-setup dialog keyword", key);
+      }
+  }
 
-  if (!PageSetupDlg (&pd))
-    {
-      global_free_2_maybe (pd.hDevNames, pd.hDevMode);
-      return Qnil;
-    }
+  if ((UNBOUNDP (device) && UNBOUNDP (settings)) ||
+      (!UNBOUNDP (device) && !UNBOUNDP (settings)))
+    syntax_error ("Exactly one of :device and :printer-settings must be given",
+                 keys);
 
-  if (pd.hDevMode)
-    handle_devmode_changes (ldm, pd.hDevNames, pd.hDevMode);
+  if (UNBOUNDP (device))
+    device = settings;
 
-  /* Finally, build the resulting plist */
   {
-    Lisp_Object result = Qnil;
-    int mm_p = pd.Flags & PSD_INHUNDREDTHSOFMILLIMETERS;
-    result = plist_set_margin (result, Qbottom_margin, pd.rtMargin.bottom, mm_p);
-    result = plist_set_margin (result, Qright_margin, pd.rtMargin.right, mm_p);
-    result = plist_set_margin (result, Qtop_margin, pd.rtMargin.top, mm_p);
-    result = plist_set_margin (result, Qleft_margin, pd.rtMargin.left, mm_p);
-    return result;
+    Lisp_Devmode *ldm = decode_devmode (device);
+    PAGESETUPDLG pd;
+
+    memset (&pd, 0, sizeof (pd));
+    pd.lStructSize = sizeof (pd);
+    pd.hwndOwner = mswindows_get_selected_frame_hwnd ();
+    pd.Flags = PSD_MARGINS;
+    pd.rtMargin.left   = plist_get_margin (plist, Qleft_margin);
+    pd.rtMargin.top    = plist_get_margin (plist, Qtop_margin);
+    pd.rtMargin.right  = plist_get_margin (plist, Qright_margin);
+    pd.rtMargin.bottom = plist_get_margin (plist, Qbottom_margin);
+    pd.hDevMode = devmode_to_hglobal (ldm);
+
+    if (!PageSetupDlg (&pd))
+      {
+       global_free_2_maybe (pd.hDevNames, pd.hDevMode);
+       return Qnil;
+      }
+
+    if (pd.hDevMode)
+      handle_devmode_changes (ldm, pd.hDevNames, pd.hDevMode);
+
+    /* Finally, build the resulting plist */
+    {
+      Lisp_Object result = Qnil;
+      int mm_p = pd.Flags & PSD_INHUNDREDTHSOFMILLIMETERS;
+      result = plist_set_margin (result, Qbottom_margin, pd.rtMargin.bottom,
+                                mm_p);
+      result = plist_set_margin (result, Qright_margin, pd.rtMargin.right,
+                                mm_p);
+      result = plist_set_margin (result, Qtop_margin, pd.rtMargin.top, mm_p);
+      result = plist_set_margin (result, Qleft_margin, pd.rtMargin.left, mm_p);
+      return result;
+    }
   }
 }
 
@@ -882,7 +910,7 @@ A settings object can be selected to no more than one printer at a time.
 If the supplied settings object is not specialized, it is specialized
 for the printer immediately upon selection. The object can be
 despecialized after it is unselected by calling the function
-`msprinter-settings-despecialize'. 
+`msprinter-settings-despecialize'.
 
 Return value is the previously selected settings object.
 */
@@ -900,8 +928,8 @@ Return value is the previously selected settings object.
   ldm = XDEVMODE (settings);
 
   if (!NILP (ldm->device))
-    signal_simple_error ("The object is currently selected into a device",
-                        settings);
+    invalid_operation ("The object is currently selected into a device",
+                      settings);
 
   /* If the object being selected is de-specialized, then its
      size is perhaps not enough to receive the new devmode. We can ask
@@ -914,15 +942,15 @@ Return value is the previously selected settings object.
        DocumentProperties (NULL, DEVICE_MSPRINTER_HPRINTER(d),
                            DEVICE_MSPRINTER_NAME(d), NULL, NULL, 0);
       if (dm_size <= 0)
-       signal_simple_error ("Unable to specialize settings, printer error",
-                            device);
+       invalid_operation ("Unable to specialize settings, printer error",
+                          device);
 
       assert (XDEVMODE_SIZE (ldm) <= dm_size);
       ldm->devmode = xrealloc (ldm->devmode, dm_size);
     }
 
   /* If we bail out on signal here, no damage is done, except that
-     the stirage for the DEVMODE structure might be reallocated to
+     the storage for the DEVMODE structure might be reallocated to
      hold a larger one - not a big deal */
   if (!sync_printer_with_devmode (d, ldm->devmode, ldm->devmode,
                                  ldm->printer_name))
@@ -968,7 +996,7 @@ Return value is the currently selected settings object.
 
   /* If the supplied devmode is not specialized, then the current
      devmode size will always be sufficient, as the printer does
-     not change.  If it is specialized, we must reallocate the cuttent
+     not change.  If it is specialized, we must reallocate the current
      devmode storage to match with the supplied one, as it has the right
      size for the new printer, if it is going to change.  The correct
      way is to use the largest of the two though, to keep the old
@@ -984,7 +1012,7 @@ Return value is the currently selected settings object.
                                  ldm_current->devmode,
                                  ldm_new->printer_name))
     error ("Printer device initialization I/O error, device deleted.");
-  
+
   if (ldm_new->printer_name != NULL)
     {
       xfree (ldm_current->printer_name);
@@ -1033,9 +1061,9 @@ finalize_devmode (void *header, int for_disksave)
     {
       Lisp_Object devmode;
       XSETDEVMODE (devmode, dm);
-      signal_simple_error (
-        "Cannot dump XEmacs containing an msprinter-settings object",
-       devmode);
+      invalid_operation
+       ("Cannot dump XEmacs containing an msprinter-settings object",
+        devmode);
     }
 
   assert (NILP (dm->device));
@@ -1131,8 +1159,8 @@ Erase printer-specific settings from a printer settings object.
   ldm = XDEVMODE (settings);
 
   if (!NILP (ldm->device))
-    signal_simple_error ("The object is currently selected into a device",
-                        settings);
+    invalid_operation ("The object is currently selected into a device",
+                      settings);
 
   dm = ldm->devmode;
 
@@ -1148,6 +1176,90 @@ Erase printer-specific settings from a printer settings object.
   return Qnil;
 }
 
+DEFUN ("mswindows-get-default-printer", Fmswindows_get_default_printer, 0, 0, 0, /*
+Return name of the default printer, as string, on nil if there is no default.
+*/
+       ())
+{
+  return msprinter_default_printer ();
+}
+
+static void
+signal_enum_printer_error (void)
+{
+  invalid_operation ("Error enumerating printers", make_int (GetLastError ()));
+}
+
+DEFUN ("mswindows-printer-list", Fmswindows_printer_list, 0, 0, 0, /*
+Return a list of string names of installed printers.
+If there is a default printer, it is returned as the first element of
+the list.  If there is no default printer, the first element of the
+list will be nil.  The rest of elements are guaranteed to have string
+values.  Return value is nil if there are no printers installed.
+*/
+       ())
+{
+  int have_nt, ok;
+  BYTE *data_buf, dummy_byte;
+  size_t enum_entry_size;
+  DWORD enum_flags, enum_level, bytes_needed, num_printers;
+  struct gcpro gcpro1, gcpro2;
+  Lisp_Object result = Qnil, def_printer = Qnil;
+
+  /* Determine OS flavor, to use the fastest enumeration method available */
+  have_nt = !mswindows_windows9x_p ();
+  enum_flags = PRINTER_ENUM_LOCAL | (have_nt ? PRINTER_ENUM_CONNECTIONS : 0);
+  enum_level = have_nt ? 4 : 5;
+  enum_entry_size = have_nt ? sizeof (PRINTER_INFO_4) : sizeof (PRINTER_INFO_5);
+
+  /* Allocate memory for printer enum structure */
+  ok = EnumPrinters (enum_flags, NULL, enum_level, &dummy_byte, 1,
+                    &bytes_needed, &num_printers);
+  if (ok)
+    /* No printers, if just 1 byte is enough */
+    return Qnil;
+
+  if (GetLastError () != ERROR_INSUFFICIENT_BUFFER)
+    signal_enum_printer_error ();
+
+  data_buf = alloca (bytes_needed);
+  ok = EnumPrinters (enum_flags, NULL, enum_level, data_buf, bytes_needed,
+                    &bytes_needed, &num_printers);
+  if (!ok)
+    signal_enum_printer_error ();
+
+  if (num_printers == 0)
+    /* Strange but... */
+    return Qnil;
+
+  GCPRO2 (result, def_printer);
+
+  while (num_printers--)
+    {
+      LPCTSTR printer_name;
+      if (have_nt)
+       {
+         PRINTER_INFO_4 *info = (PRINTER_INFO_4*) data_buf;
+         printer_name = info->pPrinterName;
+       }
+      else
+       {
+         PRINTER_INFO_5 *info = (PRINTER_INFO_5*) data_buf;
+         printer_name = info->pPrinterName;
+       }
+      data_buf += enum_entry_size;
+
+      result = Fcons (build_ext_string (printer_name, Qmswindows_tstr),
+                     result);
+    }
+
+  def_printer = msprinter_default_printer ();
+  result = Fdelete (def_printer, result);
+  result = Fcons (def_printer, result);
+
+  RETURN_UNGCPRO (result);
+}
+
 \f
 /************************************************************************/
 /*                            initialization                            */
@@ -1158,14 +1270,13 @@ syms_of_device_mswindows (void)
 {
   INIT_LRECORD_IMPLEMENTATION (devmode);
 
-  DEFSUBR (Fmsprinter_print_setup_dialog);
-  DEFSUBR (Fmsprinter_print_dialog);
-  DEFSUBR (Fmsprinter_page_setup_dialog);
   DEFSUBR (Fmsprinter_get_settings);
   DEFSUBR (Fmsprinter_select_settings);
   DEFSUBR (Fmsprinter_apply_settings);
   DEFSUBR (Fmsprinter_settings_copy);
   DEFSUBR (Fmsprinter_settings_despecialize);
+  DEFSUBR (Fmswindows_get_default_printer);
+  DEFSUBR (Fmswindows_printer_list);
 
   defsymbol (&Qinit_pre_mswindows_win, "init-pre-mswindows-win");
   defsymbol (&Qinit_post_mswindows_win, "init-post-mswindows-win");
index cd6c425..a0586b6 100644 (file)
@@ -21,6 +21,8 @@ Boston, MA 02111-1307, USA.  */
 
 /* Synched up with: Not in FSF. */
 
+/* 7-8-00 !!#### This file needs definite Mule review. */
+
 /* Original authors: Jamie Zawinski and the FSF */
 /* Rewritten by Ben Wing and Chuck Thompson. */
 
@@ -246,11 +248,11 @@ x_init_device_class (struct device *d)
  * Finally, if all else fails, return `xemacs', as it is more
  * appropriate (X11R5 returns `main').
  */
-static char *
-compute_x_app_name (int argc, char **argv)
+static Extbyte *
+compute_x_app_name (int argc, Extbyte **argv)
 {
   int i;
-  char *ptr;
+  Extbyte *ptr;
 
   for (i = 1; i < argc - 1; i++)
     if (!strncmp(argv[i], "-name", max (2, strlen (argv[1]))))
@@ -459,7 +461,7 @@ x_init_device (struct device *d, Lisp_Object props)
   Display *dpy;
   Widget app_shell;
   int argc;
-  char **argv;
+  Extbyte **argv;
   const char *app_class;
   const char *app_name;
   const char *disp_name;
@@ -549,9 +551,7 @@ x_init_device (struct device *d, Lisp_Object props)
 
   make_argc_argv (Vx_initial_argv_list, &argc, &argv);
 
-  TO_EXTERNAL_FORMAT (LISP_STRING, display,
-                     C_STRING_ALLOCA, disp_name,
-                     Qctext);
+  LISP_STRING_TO_EXTERNAL (display, disp_name, Qctext);
 
   /*
    * Break apart the old XtOpenDisplay call into XOpenDisplay and
@@ -573,9 +573,7 @@ x_init_device (struct device *d, Lisp_Object props)
 
   if (STRINGP (Vx_emacs_application_class) &&
       XSTRING_LENGTH (Vx_emacs_application_class) > 0)
-    TO_EXTERNAL_FORMAT (LISP_STRING, Vx_emacs_application_class,
-                       C_STRING_ALLOCA, app_class,
-                       Qctext);
+    LISP_STRING_TO_EXTERNAL (Vx_emacs_application_class, app_class, Qctext);
   else
     {
       app_class = (NILP (Vx_emacs_application_class)  &&
@@ -595,7 +593,7 @@ x_init_device (struct device *d, Lisp_Object props)
      Yuck. */
   XtDisplayInitialize (Xt_app_con, dpy, compute_x_app_name (argc, argv),
                        app_class, emacs_options,
-                       XtNumber (emacs_options), &argc, argv);
+                       XtNumber (emacs_options), &argc, (char **) argv);
   speed_up_interrupts ();
 
   screen = DefaultScreen (dpy);
@@ -617,9 +615,7 @@ x_init_device (struct device *d, Lisp_Object props)
     if (STRINGP (Vx_app_defaults_directory) &&
        XSTRING_LENGTH (Vx_app_defaults_directory) > 0)
       {
-       TO_EXTERNAL_FORMAT (LISP_STRING, Vx_app_defaults_directory,
-                           C_STRING_ALLOCA, data_dir,
-                           Qfile_name);
+       LISP_STRING_TO_EXTERNAL (Vx_app_defaults_directory, data_dir, Qfile_name);
        path = (char *)alloca (strlen (data_dir) + strlen (locale) + 7);
        sprintf (path, "%s%s/Emacs", data_dir, locale);
        if (!access (path, R_OK))
@@ -627,9 +623,7 @@ x_init_device (struct device *d, Lisp_Object props)
       }
     else if (STRINGP (Vdata_directory) && XSTRING_LENGTH (Vdata_directory) > 0)
       {
-       TO_EXTERNAL_FORMAT (LISP_STRING, Vdata_directory,
-                           C_STRING_ALLOCA, data_dir,
-                           Qfile_name);
+       LISP_STRING_TO_EXTERNAL (Vdata_directory, data_dir, Qfile_name);
        path = (char *)alloca (strlen (data_dir) + 13 + strlen (locale) + 7);
        sprintf (path, "%sapp-defaults/%s/Emacs", data_dir, locale);
        if (!access (path, R_OK))
@@ -785,9 +779,10 @@ x_init_device (struct device *d, Lisp_Object props)
 #ifdef HAVE_WMCOMMAND
   {
     int new_argc;
-    char **new_argv;
+    Extbyte **new_argv;
     make_argc_argv (Vcommand_line_args, &new_argc, &new_argv);
-    XSetCommand (XtDisplay (app_shell), XtWindow (app_shell), new_argv, new_argc);
+    XSetCommand (XtDisplay (app_shell), XtWindow (app_shell),
+                (char **) new_argv, new_argc);
     free_argc_argv (new_argv);
   }
 #endif /* HAVE_WMCOMMAND */
@@ -1259,6 +1254,22 @@ construct_name_list (Display *display, Widget widget, char *fake_name,
 
 #endif /* 0 */
 
+/* strcasecmp() is not sufficiently portable or standard,
+   and it's easier just to write our own. */
+static int
+ascii_strcasecmp (const char *s1, const char *s2)
+{
+  while (1)
+    {
+      char c1 = *s1++;
+      char c2 = *s2++;
+      if (c1 >= 'A' && c1 <= 'Z') c1 += 'a' - 'A';
+      if (c2 >= 'A' && c2 <= 'Z') c2 += 'a' - 'A';
+      if (c1 != c2) return c1 - c2;
+      if (c1 == '\0') return 0;
+    }
+}
+
 static char_dynarr *name_char_dynarr;
 static char_dynarr *class_char_dynarr;
 
@@ -1485,13 +1496,13 @@ mean ``unspecified''.
     return build_string (raw_result);
   else if (EQ (type, Qboolean))
     {
-      if (!strcasecmp (raw_result, "off")   ||
-         !strcasecmp (raw_result, "false") ||
-         !strcasecmp (raw_result, "no"))
+      if (!ascii_strcasecmp (raw_result, "off")   ||
+         !ascii_strcasecmp (raw_result, "false") ||
+         !ascii_strcasecmp (raw_result, "no"))
        return Fcons (Qnil, Qnil);
-      if (!strcasecmp (raw_result, "on")   ||
-         !strcasecmp (raw_result, "true") ||
-         !strcasecmp (raw_result, "yes"))
+      if (!ascii_strcasecmp (raw_result, "on")   ||
+         !ascii_strcasecmp (raw_result, "true") ||
+         !ascii_strcasecmp (raw_result, "yes"))
        return Fcons (Qt, Qnil);
       return maybe_continuable_error
        (Qresource, errb,
@@ -1687,9 +1698,7 @@ Valid keysyms are listed in the files /usr/include/X11/keysymdef.h and in
   const char *keysym_ext;
 
   CHECK_STRING (keysym);
-  TO_EXTERNAL_FORMAT (LISP_STRING, keysym,
-                     C_STRING_ALLOCA, keysym_ext,
-                     Qctext);
+  LISP_STRING_TO_EXTERNAL (keysym, keysym_ext, Qctext);
 
   return XStringToKeysym (keysym_ext) ? Qt : Qnil;
 }
@@ -1935,9 +1944,7 @@ See also `x-get-font-path'.
 
   EXTERNAL_LIST_LOOP (path_entry, font_path)
     {
-      TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (path_entry),
-                         C_STRING_ALLOCA, directories[i++],
-                         Qfile_name);
+      LISP_STRING_TO_EXTERNAL (XCAR (path_entry), directories[i++], Qfile_name);
     }
 
   expect_x_error (dpy);
index b98df4c..b02ecc3 100644 (file)
@@ -986,7 +986,7 @@ size-icon             Icon dimensions.
 size-icon-small       Small icon dimensions.
 size-device           Device screen or paper size in pixels.
 size-workspace        Workspace size in pixels. This can be less than or
-                      equal to the above. For diplays, this is the area
+                      equal to the above. For displays, this is the area
                       available to applications less window manager
                       decorations. For printers, this is the size of
                       printable area.
index 2055be8..3395e05 100644 (file)
@@ -220,6 +220,7 @@ struct device
 DECLARE_LRECORD (device, struct device);
 #define XDEVICE(x) XRECORD (x, device, struct device)
 #define XSETDEVICE(x, p) XSETRECORD (x, p, device)
+#define wrap_device(p) wrap_object (p)
 #define DEVICEP(x) RECORDP (x, device)
 #define CHECK_DEVICE(x) CHECK_RECORD (x, device)
 #define CONCHECK_DEVICE(x) CONCHECK_RECORD (x, device)
index ff83db4..27fbad7 100644 (file)
@@ -1,5 +1,6 @@
 /* Implements elisp-programmable dialog boxes -- MS Windows interface.
    Copyright (C) 1998 Kirill M. Katsnelson <kkm@kis.ru>
+   Copyright (C) 2000 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -33,11 +34,31 @@ Boston, MA 02111-1307, USA.  */
 #include "gui.h"
 #include "opaque.h"
 
+#include <cderr.h>
+#include <commdlg.h>
+
+Lisp_Object Qdialog_box_error;
+
+static Lisp_Object Q_initial_directory;
+static Lisp_Object Q_initial_filename;
+static Lisp_Object Q_filter_list;
+static Lisp_Object Q_title;
+static Lisp_Object Q_allow_multi_select;
+static Lisp_Object Q_create_prompt_on_nonexistent;
+static Lisp_Object Q_overwrite_prompt;
+static Lisp_Object Q_file_must_exist;
+static Lisp_Object Q_no_network_button;
+static Lisp_Object Q_no_read_only_return;
+
 /* List containing all dialog data structures of currently popped up
-   dialogs. Each item is a cons of frame object and a vector of
-   callbacks for buttons in the dialog, in order */
+   dialogs. */
 static Lisp_Object Vdialog_data_list;
 
+/* List of popup frames wanting keyboard traversal handled */
+static Lisp_Object Vpopup_frame_list;
+
+Lisp_Object Vdefault_file_dialog_filter_alist;
+
 /* DLUs per character metrics */
 #define X_DLU_PER_CHAR      4
 #define Y_DLU_PER_CHAR      8
@@ -110,6 +131,51 @@ static Lisp_Object Vdialog_data_list;
 
 #define ID_ITEM_BIAS 32
 
+void
+mswindows_register_popup_frame (Lisp_Object frame)
+{
+  Vpopup_frame_list = Fcons (frame, Vpopup_frame_list);
+}
+
+void
+mswindows_unregister_popup_frame (Lisp_Object frame)
+{
+  Vpopup_frame_list = delq_no_quit (frame, Vpopup_frame_list);
+}
+
+/* Dispatch message to any dialog boxes.  Return non-zero if dispatched. */
+int
+mswindows_is_dialog_msg (MSG *msg)
+{
+  LIST_LOOP_2 (data, Vdialog_data_list)
+    {
+      if (IsDialogMessage (XMSWINDOWS_DIALOG_ID (data)->hwnd, msg))
+       return 1;
+    }
+
+  {
+    LIST_LOOP_2 (popup, Vpopup_frame_list)
+      {
+       HWND hwnd = FRAME_MSWINDOWS_HANDLE (XFRAME (popup));
+       if (IsDialogMessage (hwnd, msg))
+         return 1;
+      }
+  }
+  return 0;
+}
+
+static Lisp_Object
+mark_mswindows_dialog_id (Lisp_Object obj)
+{
+  struct mswindows_dialog_id *data = XMSWINDOWS_DIALOG_ID (obj);
+  mark_object (data->frame);
+  return data->callbacks;
+}
+
+DEFINE_LRECORD_IMPLEMENTATION ("mswindows-dialog-id", mswindows_dialog_id,
+                              mark_mswindows_dialog_id, 0, 0, 0, 0, 0,
+                              struct mswindows_dialog_id);
+
 /* Dialog procedure */
 static BOOL CALLBACK 
 dialog_proc (HWND hwnd, UINT msg, WPARAM w_param, LPARAM l_param)
@@ -131,14 +197,27 @@ dialog_proc (HWND hwnd, UINT msg, WPARAM w_param, LPARAM l_param)
     case WM_COMMAND:
       {
        Lisp_Object fn, arg, data;
+       struct mswindows_dialog_id *did;
+
        VOID_TO_LISP (data, GetWindowLong (hwnd, DWL_USER));
-       
-       assert (w_param >= ID_ITEM_BIAS 
-               && w_param < XVECTOR_LENGTH (XCDR (data)) + ID_ITEM_BIAS);
-       
-       get_gui_callback (XVECTOR_DATA (XCDR (data)) [w_param - ID_ITEM_BIAS],
-                         &fn, &arg);
-       mswindows_enqueue_misc_user_event (XCAR (data), fn, arg);
+       did = XMSWINDOWS_DIALOG_ID (data);
+       if (w_param != IDCANCEL) /* user pressed escape */
+         {
+           assert (w_param >= ID_ITEM_BIAS 
+                   && w_param
+                   < XVECTOR_LENGTH (did->callbacks) + ID_ITEM_BIAS);
+           
+           get_gui_callback (XVECTOR_DATA (did->callbacks)
+                             [w_param - ID_ITEM_BIAS],
+                             &fn, &arg);
+           mswindows_enqueue_misc_user_event (did->frame, fn, arg);
+         }
+       else
+         mswindows_enqueue_misc_user_event (did->frame, Qrun_hooks,
+                                            Qmenu_no_selection_hook);
+       /* #### need to error-protect!  will do so when i merge in
+          my working ws */
+       va_run_hook_with_args (Qdelete_dialog_box_hook, 1, data);
 
        DestroyWindow (hwnd);
       }
@@ -211,13 +290,130 @@ free_dynarr_opaque_ptr (Lisp_Object arg)
     Dynarr_add_many (template, &zeroes, slippage);     \
 }
 
-static void
-mswindows_popup_dialog_box (struct frame* f, Lisp_Object desc)
+static struct
+{
+  int errmess;
+  char *errname;
+} common_dialog_errors[] =
+{
+  { CDERR_DIALOGFAILURE, "CDERR_DIALOGFAILURE" },
+  { CDERR_FINDRESFAILURE, "CDERR_FINDRESFAILURE" },
+  { CDERR_INITIALIZATION, "CDERR_INITIALIZATION" },
+  { CDERR_LOADRESFAILURE, "CDERR_LOADRESFAILURE" },
+  { CDERR_LOADSTRFAILURE, "CDERR_LOADSTRFAILURE" },
+  { CDERR_LOCKRESFAILURE, "CDERR_LOCKRESFAILURE" },
+  { CDERR_MEMALLOCFAILURE, "CDERR_MEMALLOCFAILURE" },
+  { CDERR_MEMLOCKFAILURE, "CDERR_MEMLOCKFAILURE" },
+  { CDERR_NOHINSTANCE, "CDERR_NOHINSTANCE" },
+  { CDERR_NOHOOK, "CDERR_NOHOOK" },
+  { CDERR_NOTEMPLATE, "CDERR_NOTEMPLATE" },
+  { CDERR_REGISTERMSGFAIL, "CDERR_REGISTERMSGFAIL" },
+  { CDERR_STRUCTSIZE, "CDERR_STRUCTSIZE" },
+  { PDERR_CREATEICFAILURE, "PDERR_CREATEICFAILURE" },
+  { PDERR_DEFAULTDIFFERENT, "PDERR_DEFAULTDIFFERENT" },
+  { PDERR_DNDMMISMATCH, "PDERR_DNDMMISMATCH" },
+  { PDERR_GETDEVMODEFAIL, "PDERR_GETDEVMODEFAIL" },
+  { PDERR_INITFAILURE, "PDERR_INITFAILURE" },
+  { PDERR_LOADDRVFAILURE, "PDERR_LOADDRVFAILURE" },
+  { PDERR_NODEFAULTPRN, "PDERR_NODEFAULTPRN" },
+  { PDERR_NODEVICES, "PDERR_NODEVICES" },
+  { PDERR_PARSEFAILURE, "PDERR_PARSEFAILURE" },
+  { PDERR_PRINTERNOTFOUND, "PDERR_PRINTERNOTFOUND" },
+  { PDERR_RETDEFFAILURE, "PDERR_RETDEFFAILURE" },
+  { PDERR_SETUPFAILURE, "PDERR_SETUPFAILURE" },
+  { CFERR_MAXLESSTHANMIN, "CFERR_MAXLESSTHANMIN" },
+  { CFERR_NOFONTS, "CFERR_NOFONTS" },
+  { FNERR_BUFFERTOOSMALL, "FNERR_BUFFERTOOSMALL" },
+  { FNERR_INVALIDFILENAME, "FNERR_INVALIDFILENAME" },
+  { FNERR_SUBCLASSFAILURE, "FNERR_SUBCLASSFAILURE" },
+  { FRERR_BUFFERLENGTHZERO, "FRERR_BUFFERLENGTHZERO" },
+};
+
+static Lisp_Object
+handle_file_dialog_box (struct frame *f, Lisp_Object keys)
+{
+  OPENFILENAME ofn;
+  char fnbuf[8000];
+
+  xzero (ofn);
+  ofn.lStructSize = sizeof (ofn);
+  ofn.hwndOwner = FRAME_MSWINDOWS_HANDLE (f);
+  ofn.lpstrFile = fnbuf;
+  ofn.nMaxFile = sizeof (fnbuf) / XETCHAR_SIZE;
+  xetcscpy (fnbuf, XETEXT (""));
+
+  LOCAL_FILE_FORMAT_TO_TSTR (Fexpand_file_name (build_string (""), Qnil),
+                            ofn.lpstrInitialDir);
+
+  {
+    EXTERNAL_PROPERTY_LIST_LOOP_3 (key, value, keys)
+      {
+       if (EQ (key, Q_initial_filename))
+         {
+           Extbyte *fnout;
+
+           CHECK_STRING (value);
+           LOCAL_FILE_FORMAT_TO_TSTR (value, fnout);
+           xetcscpy (fnbuf, fnout);
+         }
+       else if (EQ (key, Q_title))
+         {
+           CHECK_STRING (value);
+           LISP_STRING_TO_EXTERNAL (value, ofn.lpstrTitle, Qmswindows_tstr);
+         }
+       else if (EQ (key, Q_initial_directory))
+         LOCAL_FILE_FORMAT_TO_TSTR (Fexpand_file_name (value, Qnil),
+                                    ofn.lpstrInitialDir);
+       else if (EQ (key, Q_file_must_exist))
+         {
+           if (!NILP (value))
+             ofn.Flags |= OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST;
+           else
+             ofn.Flags &= ~(OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST);
+         }
+       else
+         syntax_error ("Unrecognized file-dialog keyword", key);
+      }
+  }
+
+  if (!GetOpenFileName (&ofn))
+    {
+      DWORD err = CommDlgExtendedError ();
+      if (!err)
+       {
+         while (1)
+           signal_quit ();
+       }
+      else
+       {
+         int i;
+
+         for (i = 0; i < countof (common_dialog_errors); i++)
+           {
+             if (common_dialog_errors[i].errmess == err)
+               signal_type_error (Qdialog_box_error,
+                                  "Creating file-dialog-box",
+                                  build_string
+                                  (common_dialog_errors[i].errname));
+           }
+
+         signal_type_error (Qdialog_box_error,
+                            "Unknown common dialog box error???",
+                            make_int (err));
+       }
+    }
+
+  return tstr_to_local_file_format (ofn.lpstrFile);
+}
+
+static Lisp_Object
+handle_question_dialog_box (struct frame *f, Lisp_Object keys)
 {
   Lisp_Object_dynarr *dialog_items = Dynarr_new (Lisp_Object);
   unsigned_char_dynarr *template = Dynarr_new (unsigned_char);
   unsigned int button_row_width = 0;
   unsigned int text_width, text_height;
+  Lisp_Object question = Qnil, title = Qnil;
 
   int unbind_count = specpdl_depth ();
   record_unwind_protect (free_dynarr_opaque_ptr,
@@ -226,31 +422,56 @@ mswindows_popup_dialog_box (struct frame* f, Lisp_Object desc)
                         make_opaque_ptr (template));
 
   /* A big NO NEED to GCPRO gui_items stored in the array: they are just
-     pointers into DESC list, which is GC-protected by the caller */
+     pointers into KEYS list, which is GC-protected by the caller */
 
-  /* Parse each item in the dialog into gui_item structs, and stuff a dynarr
-     of these. Calculate button row width in this loop too */
   {
-    Lisp_Object item_cons;
-
-    EXTERNAL_LIST_LOOP (item_cons, XCDR (desc))
+    EXTERNAL_PROPERTY_LIST_LOOP_3 (key, value, keys)
       {
-       if (!NILP (XCAR (item_cons)))
+       if (EQ (key, Q_question))
          {
-           Lisp_Object gitem = gui_parse_item_keywords (XCAR (item_cons));
-           Dynarr_add (dialog_items, gitem);
-           button_row_width += button_width (XGUI_ITEM (gitem)->name) 
-             + X_BUTTON_MARGIN;
+           CHECK_STRING (value);
+           question = value;
          }
+       else if (EQ (key, Q_title))
+         {
+           CHECK_STRING (value);
+           title = value;
+         }
+       else if (EQ (key, Q_buttons))
+         {
+           Lisp_Object item_cons;
+
+           /* Parse each item in the dialog into gui_item structs,
+              and stuff a dynarr of these. Calculate button row width
+              in this loop too */
+           EXTERNAL_LIST_LOOP (item_cons, value)
+             {
+               if (!NILP (XCAR (item_cons)))
+                 {
+                   Lisp_Object gitem =
+                     gui_parse_item_keywords (XCAR (item_cons));
+                   Dynarr_add (dialog_items, gitem);
+                   button_row_width += button_width (XGUI_ITEM (gitem)->name) 
+                     + X_BUTTON_MARGIN;
+                 }
+             }
+
+           button_row_width -= X_BUTTON_MARGIN;
+         }
+       else
+         syntax_error ("Unrecognized question-dialog keyword", key);
       }
-    if (Dynarr_length (dialog_items) == 0)
-      signal_simple_error ("Dialog descriptor provides no active items", desc);
-    button_row_width -= X_BUTTON_MARGIN;
   }
 
+  if (Dynarr_length (dialog_items) == 0)
+    syntax_error ("Dialog descriptor provides no buttons", keys);
+
+  if (NILP (question))
+    syntax_error ("Dialog descriptor provides no question", keys);
+
   /* Determine the final width layout */
   {
-    Bufbyte *p = XSTRING_DATA (XCAR (desc));
+    Bufbyte *p = XSTRING_DATA (question);
     Charcount string_max = 0, this_length = 0;
     while (1)
       {
@@ -280,17 +501,17 @@ mswindows_popup_dialog_box (struct frame* f, Lisp_Object desc)
   
   /* Now calculate the height for the text control */
   {
-    Bufbyte *p = XSTRING_DATA (XCAR (desc));
+    Bufbyte *p = XSTRING_DATA (question);
     Charcount break_at = text_width / X_DLU_PER_CHAR;
     Charcount char_pos = 0;
     int num_lines = 1;
     Emchar ch;
     
-    while ((ch = charptr_emchar (p)) != (Emchar)'\0')
+    while ((ch = charptr_emchar (p)) != (Emchar) '\0')
       {
        INC_CHARPTR (p);
-       char_pos += ch != (Emchar)'\n';
-       if (ch == (Emchar)'\n' || char_pos == break_at)
+       char_pos += ch != (Emchar) '\n';
+       if (ch == (Emchar) '\n' || char_pos == break_at)
          {
            ++num_lines;
            char_pos = 0;
@@ -324,9 +545,12 @@ mswindows_popup_dialog_box (struct frame* f, Lisp_Object desc)
     /* We want no menu and standard class */
     Dynarr_add_many (template, &zeroes, 4);
 
-    /* And the third is the dialog title. "XEmacs" as long as we do not supply
-       one in descriptor. Note that the string must be in Unicode. */
-    Dynarr_add_many (template, L"XEmacs", 14);
+    /* And the third is the dialog title. "XEmacs" unless one is supplied.
+       Note that the string must be in Unicode. */
+    if (NILP (title))
+      Dynarr_add_many (template, L"XEmacs", 14);
+    else
+      push_lisp_string_as_unicode (template, title);
 
     /* We want standard dialog font */
     Dynarr_add_many (template, L"\x08MS Shell Dlg", 28);
@@ -348,7 +572,7 @@ mswindows_popup_dialog_box (struct frame* f, Lisp_Object desc)
     Dynarr_add_many (template, &static_class_id, sizeof (static_class_id));
 
     /* Next thing to add is control text, as Unicode string */
-    push_lisp_string_as_unicode (template, XCAR (desc));
+    push_lisp_string_as_unicode (template, question);
 
     /* Specify 0 length creation data */
     Dynarr_add_many (template, &zeroes, 2);
@@ -406,45 +630,103 @@ mswindows_popup_dialog_box (struct frame* f, Lisp_Object desc)
 
   /* Now the Windows dialog structure is ready. We need to prepare a
      data structure for the new dialog, which will contain callbacks
-     and the frame for these callbacks. This structure has to be
-     GC-protected. The data structure itself is a cons of frame object
-     and a vector of callbacks; for the protection reasons it is put
-     into a statically protected list. */
+     and the frame for these callbacks.  This structure has to be
+     GC-protected and thus it is put into a statically protected
+     list. */
   {
-    Lisp_Object frame, vector, dialog_data;
+    Lisp_Object dialog_data;
     int i;
-    
-    XSETFRAME (frame, f);
-    vector = make_vector (Dynarr_length (dialog_items), Qunbound);
-    dialog_data = Fcons (frame, vector);
+    struct mswindows_dialog_id *did =
+      alloc_lcrecord_type (struct mswindows_dialog_id,
+                          &lrecord_mswindows_dialog_id);
+
+    XSETMSWINDOWS_DIALOG_ID (dialog_data, did);
+
+    did->frame = wrap_frame (f);
+    did->callbacks = make_vector (Dynarr_length (dialog_items), Qunbound);
     for (i = 0; i < Dynarr_length (dialog_items); i++)
-      XVECTOR_DATA (vector) [i] =
+      XVECTOR_DATA (did->callbacks) [i] =
        XGUI_ITEM (*Dynarr_atp (dialog_items, i))->callback;
-
+    
     /* Woof! Everything is ready. Pop pop pop in now! */
-    if (!CreateDialogIndirectParam (NULL,
-                                   (LPDLGTEMPLATE) Dynarr_atp (template, 0),
-                                   FRAME_MSWINDOWS_HANDLE (f), dialog_proc,
-                                   (LPARAM) LISP_TO_VOID (dialog_data)))
+    did->hwnd =
+      CreateDialogIndirectParam (NULL,
+                                (LPDLGTEMPLATE) Dynarr_atp (template, 0),
+                                FRAME_MSWINDOWS_HANDLE (f), dialog_proc,
+                                (LPARAM) LISP_TO_VOID (dialog_data));
+    if (!did->hwnd)
       /* Something went wrong creating the dialog */
-      signal_simple_error ("System error creating dialog", desc);
+      signal_type_error (Qdialog_box_error, "Creating dialog", keys);
 
     Vdialog_data_list = Fcons (dialog_data, Vdialog_data_list);
+
+    /* Cease protection and free dynarrays */
+    unbind_to (unbind_count, Qnil);
+    return dialog_data;
   }
+}
 
-  /* Cease protection and free dynarrays */
-  unbind_to (unbind_count, Qnil);
+static Lisp_Object
+mswindows_make_dialog_box_internal (struct frame* f, Lisp_Object type,
+                                   Lisp_Object keys)
+{
+  if (EQ (type, Qfile))
+    return handle_file_dialog_box (f, keys);
+  else if (EQ (type, Qquestion))
+    return handle_question_dialog_box (f, keys);
+  else if (EQ (type, Qprint))
+    return mswindows_handle_print_dialog_box (f, keys);
+  else if (EQ (type, Qpage_setup))
+    return mswindows_handle_page_setup_dialog_box (f, keys);
+  else if (EQ (type, Qprint_setup))
+    return mswindows_handle_print_setup_dialog_box (f, keys);
+  else
+    signal_type_error (Qunimplemented, "Dialog box type", type);
+  return Qnil;
 }
 
 void
 console_type_create_dialog_mswindows (void)
 {
-  CONSOLE_HAS_METHOD (mswindows, popup_dialog_box);
+  CONSOLE_HAS_METHOD (mswindows, make_dialog_box_internal);
+}
+
+void
+syms_of_dialog_mswindows (void)
+{
+  INIT_LRECORD_IMPLEMENTATION (mswindows_dialog_id);
+
+  DEFKEYWORD (Q_initial_directory);
+  DEFKEYWORD (Q_initial_filename);
+  DEFKEYWORD (Q_filter_list);
+  DEFKEYWORD (Q_title);
+  DEFKEYWORD (Q_allow_multi_select);
+  DEFKEYWORD (Q_create_prompt_on_nonexistent);
+  DEFKEYWORD (Q_overwrite_prompt);
+  DEFKEYWORD (Q_file_must_exist);
+  DEFKEYWORD (Q_no_network_button);
+  DEFKEYWORD (Q_no_read_only_return);
+
+  /* Errors */
+  DEFERROR_STANDARD (Qdialog_box_error, Qinvalid_operation);
 }
 
 void
 vars_of_dialog_mswindows (void)
 {
+  Vpopup_frame_list = Qnil;
+  staticpro (&Vpopup_frame_list);
+
   Vdialog_data_list = Qnil;
   staticpro (&Vdialog_data_list);
+
+  DEFVAR_LISP ("default-file-dialog-filter-alist",
+              &Vdefault_file_dialog_filter_alist /*
+*/ );
+  Vdefault_file_dialog_filter_alist =
+    list5 (Fcons (build_string ("Text Files"), build_string ("*.txt")),
+          Fcons (build_string ("C Files"), build_string ("*.c;*.h")),
+          Fcons (build_string ("Elisp Files"), build_string ("*.el")),
+          Fcons (build_string ("HTML Files"), build_string ("*.html;*.html")),
+          Fcons (build_string ("All Files"), build_string ("*.*")));
 }
index 3d1acc3..3985761 100644 (file)
@@ -1,6 +1,7 @@
 /* Implements elisp-programmable dialog boxes -- X interface.
    Copyright (C) 1993, 1994 Free Software Foundation, Inc.
    Copyright (C) 1995 Tinker Systems and INS Engineering Corp.
+   Copyright (C) 2000 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -21,6 +22,8 @@ Boston, MA 02111-1307, USA.  */
 
 /* Synched up with: Not in FSF. */
 
+/* This file Mule-ized by Ben Wing, 7-8-00. */
+
 #include <config.h>
 #include "lisp.h"
 
@@ -40,7 +43,6 @@ Boston, MA 02111-1307, USA.  */
 static void
 maybe_run_dbox_text_callback (LWLIB_ID id)
 {
-  /* !!#### This function has not been Mule-ized */
   widget_value *wv;
   int got_some;
   wv = xmalloc_widget_value ();
@@ -49,7 +51,7 @@ maybe_run_dbox_text_callback (LWLIB_ID id)
   if (got_some)
     {
       Lisp_Object text_field_callback;
-      char *text_field_value = wv->value;
+      Extbyte *text_field_value = wv->value;
       VOID_TO_LISP (text_field_callback, wv->call_data);
       text_field_callback = XCAR (XCDR (text_field_callback));
       if (text_field_value)
@@ -57,13 +59,14 @@ maybe_run_dbox_text_callback (LWLIB_ID id)
          void *tmp =
            LISP_TO_VOID (cons3 (Qnil,
                                 list2 (text_field_callback,
-                                       build_string (text_field_value)),
+                                       build_ext_string (text_field_value,
+                                                         Qlwlib_encoding)),
                                 Qnil));
          popup_selection_callback (0, id, (XtPointer) tmp);
        }
     }
   /* This code tried to optimize, newing/freeing. This is generally
-     unsafe so we will alwats strdup and always use
+     unsafe so we will always strdup and always use
      free_widget_value_tree. */
   free_widget_value_tree (wv);
 }
@@ -92,6 +95,9 @@ dbox_selection_callback (Widget widget, LWLIB_ID id, XtPointer client_data)
   popup_up_p--;
   maybe_run_dbox_text_callback (id);
   popup_selection_callback (widget, id, client_data);
+  /* #### need to error-protect!  will do so when i merge in
+     my working ws */
+  va_run_hook_with_args (Qdelete_dialog_box_hook, 1, make_int (id));
   lw_destroy_all_widgets (id);
 
   /* The Motif dialog box sets the keyboard focus to itself.  When it
@@ -106,19 +112,14 @@ dbox_selection_callback (Widget widget, LWLIB_ID id, XtPointer client_data)
     lw_set_keyboard_focus (FRAME_X_SHELL_WIDGET (f), FRAME_X_TEXT_WIDGET (f));
 }
 
-static const char * const button_names [] = {
+static const Extbyte * const button_names [] = {
   "button1", "button2", "button3", "button4", "button5",
   "button6", "button7", "button8", "button9", "button10" };
 
-/* can't have static frame locals because of some broken compilers */
-static char tmp_dbox_name [255];
-
 static widget_value *
-dbox_descriptor_to_widget_value (Lisp_Object desc)
+dbox_descriptor_to_widget_value (Lisp_Object keys)
 {
-  /* !!#### This function has not been Mule-ized */
   /* This function can GC */
-  char *name;
   int lbuttons = 0, rbuttons = 0;
   int partition_seen = 0;
   int text_field_p = 0;
@@ -127,13 +128,33 @@ dbox_descriptor_to_widget_value (Lisp_Object desc)
   int n = 0;
   int count = specpdl_depth ();
   Lisp_Object wv_closure, gui_item;
+  Lisp_Object question = Qnil, title = Qnil, buttons = Qnil;
 
-  CHECK_CONS (desc);
-  CHECK_STRING (XCAR (desc));
-  name = (char *) XSTRING_DATA (LISP_GETTEXT (XCAR (desc)));
-  desc = XCDR (desc);
-  if (!CONSP (desc))
-    error ("dialog boxes must have some buttons");
+  {
+    EXTERNAL_PROPERTY_LIST_LOOP_3 (key, value, keys)
+      {
+       if (EQ (key, Q_question))
+         {
+           CHECK_STRING (value);
+           question = value;
+         }
+       else if (EQ (key, Q_title))
+         {
+           CHECK_STRING (value);
+           title = value;
+         }
+       else if (EQ (key, Q_buttons))
+         {
+           CHECK_LIST (value);
+           buttons = value;
+         }
+       else
+         syntax_error ("Unrecognized question-dialog keyword", key);
+      }
+  }
+
+  if (NILP (question))
+    syntax_error ("Dialog descriptor provides no question", keys);
 
   /* Inhibit GC during this conversion.  The reasons for this are
      the same as in menu_item_descriptor_to_widget_value(); see
@@ -151,62 +172,69 @@ dbox_descriptor_to_widget_value (Lisp_Object desc)
   wv_closure = make_opaque_ptr (kids);
   record_unwind_protect (widget_value_unwind, wv_closure);
   prev->name = xstrdup ("message");
-  prev->value = xstrdup (name);
+  LISP_STRING_TO_EXTERNAL_MALLOC (question, prev->value, Qlwlib_encoding);
   prev->enabled = 1;
 
-  for (; !NILP (desc); desc = Fcdr (desc))
-    {
-      Lisp_Object button = XCAR (desc);
-      widget_value *wv;
-
-      if (NILP (button))
-       {
-         if (partition_seen)
-           error ("more than one partition (nil) seen in dbox spec");
-         partition_seen = 1;
-         continue;
-       }
-      CHECK_VECTOR (button);
-      wv = xmalloc_widget_value ();
-
-      gui_item = gui_parse_item_keywords (button);
-      if (!button_item_to_widget_value (Qdialog,
-                                       gui_item, wv, allow_text_p, 1, 0))
-       {
-         free_widget_value_tree (wv);
-         continue;
-       }
-
-      if (wv->type == TEXT_TYPE)
-       {
-         text_field_p = 1;
-         allow_text_p = 0;      /* only allow one */
-       }
-      else                     /* it's a button */
-       {
-         allow_text_p = 0;      /* only allow text field at the front */
-         if (wv->value)        xfree (wv->value);
-         wv->value = wv->name; /* what a mess... */
-         wv->name = xstrdup (button_names [n]);
-
-         if (partition_seen)
-           rbuttons++;
-         else
-           lbuttons++;
-         n++;
-
-         if (lbuttons > 9 || rbuttons > 9)
-           error ("too many buttons (9)"); /* #### this leaks */
-       }
-
-      prev->next = wv;
-      prev = wv;
-    }
+  {
+    EXTERNAL_LIST_LOOP_2 (button, buttons)
+      {
+       widget_value *wv;
+
+       if (NILP (button))
+         {
+           if (partition_seen)
+             syntax_error ("More than one partition (nil) seen in dbox spec",
+                           keys);
+           partition_seen = 1;
+           continue;
+         }
+       CHECK_VECTOR (button);
+       wv = xmalloc_widget_value ();
+
+       gui_item = gui_parse_item_keywords (button);
+       if (!button_item_to_widget_value (Qdialog,
+                                         gui_item, wv, allow_text_p, 1, 0, 1))
+         {
+           free_widget_value_tree (wv);
+           continue;
+         }
+
+       if (wv->type == TEXT_TYPE)
+         {
+           text_field_p = 1;
+           allow_text_p = 0;    /* only allow one */
+         }
+       else                    /* it's a button */
+         {
+           allow_text_p = 0;    /* only allow text field at the front */
+           if (wv->value)
+             xfree (wv->value);
+           wv->value = wv->name;       /* what a mess... */
+           wv->name = xstrdup (button_names [n]);
+
+           if (partition_seen)
+             rbuttons++;
+           else
+             lbuttons++;
+           n++;
+
+           if (lbuttons > 9 || rbuttons > 9)
+             syntax_error ("Too many buttons (9)",
+                           keys); /* #### this leaks */
+         }
+
+       prev->next = wv;
+       prev = wv;
+      }
+  }
 
   if (n == 0)
-    error ("dialog boxes must have some buttons");
+    syntax_error ("Dialog boxes must have some buttons", keys);
+
   {
-    char type = (text_field_p ? 'P' : 'Q');
+    Extbyte type = (text_field_p ? 'P' : 'Q');
+    static Extbyte tmp_dbox_name [255];
+
     widget_value *dbox;
     sprintf (tmp_dbox_name, "%c%dBR%d", type, lbuttons + rbuttons, rbuttons);
     dbox = xmalloc_widget_value ();
@@ -220,14 +248,18 @@ dbox_descriptor_to_widget_value (Lisp_Object desc)
   }
 }
 
-static void
-x_popup_dialog_box (struct frame* f, Lisp_Object dbox_desc)
+static Lisp_Object
+x_make_dialog_box_internal (struct frame* f, Lisp_Object type,
+                           Lisp_Object keys)
 {
   int dbox_id;
   widget_value *data;
   Widget parent, dbox;
 
-  data = dbox_descriptor_to_widget_value (dbox_desc);
+  if (!EQ (type, Qquestion))
+    signal_type_error (Qunimplemented, "Dialog box type", type);
+
+  data = dbox_descriptor_to_widget_value (keys);
 
   parent = FRAME_X_SHELL_WIDGET (f);
 
@@ -257,6 +289,10 @@ x_popup_dialog_box (struct frame* f, Lisp_Object dbox_desc)
 
   popup_up_p++;
   lw_pop_up_all_widgets (dbox_id);
+
+  /* #### this could (theoretically) cause problems if we are up for
+     a REALLY REALLY long time -- too big to fit into lisp integer. */
+  return make_int (dbox_id);
 }
 
 void
@@ -267,7 +303,7 @@ syms_of_dialog_x (void)
 void
 console_type_create_dialog_x (void)
 {
-  CONSOLE_HAS_METHOD (x, popup_dialog_box);
+  CONSOLE_HAS_METHOD (x, make_dialog_box_internal);
 }
 
 void
index 4ce48a6..b067dcc 100644 (file)
@@ -1,6 +1,7 @@
 /* Implements elisp-programmable dialog boxes -- generic.
    Copyright (C) 1993, 1994 Free Software Foundation, Inc.
    Copyright (C) 1995 Tinker Systems and INS Engineering Corp.
+   Copyright (C) 2000 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -23,72 +24,49 @@ Boston, MA 02111-1307, USA.  */
 
 #include <config.h>
 #include "lisp.h"
+
 #include "frame.h"
 #include "device.h"
 
-DEFUN ("popup-dialog-box", Fpopup_dialog_box, 1, 1, 0, /*
-Pop up a dialog box.
-A dialog box description is a list.
-
-The first element of a dialog box must be a string, which is the title or
-question.
-
-The rest of the elements are descriptions of the dialog box's buttons.
-Each of these is a vector, the syntax of which is essentially the same as
-that of popup menu items.  They may have any of the following forms:
-
- [ "name" callback <active-p> ]
- [ "name" callback <active-p> "suffix" ]
- [ "name" callback :<keyword> <value>  :<keyword> <value> ... ]
-
-The name is the string to display on the button; it is filtered through the
-resource database, so it is possible for resources to override what string
-is actually displayed.
-
-Accelerators can be indicated in the string by putting the sequence
-"%_" before the character corresponding to the key that will invoke
-the button.  Uppercase and lowercase accelerators are equivalent.  The
-sequence "%%" is also special, and is translated into a single %.
+Lisp_Object Vdelete_dialog_box_hook;
+Lisp_Object Qdelete_dialog_box_hook;
 
-If the `callback' of a button is a symbol, then it must name a command.
-It will be invoked with `call-interactively'.  If it is a list, then it is
-evaluated with `eval'.
-
-One (and only one) of the buttons may be `nil'.  This marker means that all
-following buttons should be flushright instead of flushleft.
-
-Though the keyword/value syntax is supported for dialog boxes just as in
-popup menus, the only keyword which is both meaningful and fully implemented
-for dialog box buttons is `:active'.  */
-     (dbox_desc))
+DEFUN ("make-dialog-box-internal", Fmake_dialog_box_internal, 2, 2, 0, /*
+Internal helper function for `make-dialog-box'.
+This handles all dialog-box types except `general'.
+TYPE is the same as the first argument to `make-dialog-box', and KEYS
+a list of the remaining arguments.
+*/
+     (type, keys))
 {
   struct frame *f = selected_frame ();
   struct device *d = XDEVICE (f->device);
 
-  if (!HAS_DEVMETH_P (d, popup_dialog_box))
-    signal_simple_error ("Device does not support dialogs", f->device);
-
-  if (SYMBOLP (dbox_desc))
-    dbox_desc = Fsymbol_value (dbox_desc);
-  CHECK_CONS (dbox_desc);
-  CHECK_STRING (XCAR (dbox_desc));
-  if (!CONSP (XCDR (dbox_desc)))
-    signal_simple_error ("Dialog descriptor must supply at least one button",
-                        dbox_desc);
+  CHECK_SYMBOL (type);
 
-  DEVMETH (d, popup_dialog_box, (f, dbox_desc));
+  if (!HAS_DEVMETH_P (d, make_dialog_box_internal))
+    signal_type_error (Qunimplemented,
+                      "Device does not support dialogs", f->device);
 
-  return Qnil;
+  return DEVMETH (d, make_dialog_box_internal, (f, type, keys));
 }
 
 void
 syms_of_dialog (void)
 {
-  DEFSUBR (Fpopup_dialog_box);
+  DEFSUBR (Fmake_dialog_box_internal);
+
+  DEFSYMBOL (Qdelete_dialog_box_hook);
 }
 
 void
 vars_of_dialog (void)
 {
   Fprovide (intern ("dialog"));
+
+  DEFVAR_LISP ("delete-dialog-box-hook", &Vdelete_dialog_box_hook /*
+Function or functions to call when a dialog box is about to be deleted.
+One arg, the dialog box id.
+*/ );
+  Vdelete_dialog_box_hook = Qnil;
 }
index 1b20fc6..9e4b2b5 100644 (file)
@@ -208,9 +208,9 @@ mswindows_get_files (char *dirfile, int nowild, Lisp_Object pattern,
 
       /*
        * Here, we use FindFirstFile()/FindNextFile() instead of opendir(),
-       * stat(), & friends, because stat() is VERY expensive in terms of
-       * time.  Hence, we take the time to write complicated Win32-specific
-       * code, instead of simple Unix-style stuff.
+       * xemacs_stat(), & friends, because xemacs_stat() is VERY expensive in
+       * terms of time.  Hence, we take the time to write complicated
+       * Win32-specific code, instead of simple Unix-style stuff.
        */
       findex = 0;
       fh = INVALID_HANDLE_VALUE;
index 3b2d7ff..474c828 100644 (file)
@@ -146,7 +146,7 @@ If FILES-ONLY is the symbol t, then only the "files" in the directory
              memcpy (statbuf_tail, dp->d_name, len);
              statbuf_tail[len] = 0;
 
-             if (stat (statbuf, &st) == 0
+             if (xemacs_stat (statbuf, &st) == 0
                  && (st.st_mode & S_IFMT) == S_IFDIR)
                dir_p = 1;
 
@@ -260,9 +260,9 @@ file_name_completion_stat (Lisp_Object directory, DIRENTRY *dp,
      in case it is a directory.  */
   value = lstat (fullname, st_addr);
   if (S_ISLNK (st_addr->st_mode))
-    stat (fullname, st_addr);
+    xemacs_stat (fullname, st_addr);
 #else
-  value = stat (fullname, st_addr);
+  value = xemacs_stat (fullname, st_addr);
 #endif
   return value;
 }
@@ -507,7 +507,8 @@ file_name_completion (Lisp_Object file, Lisp_Object directory, int all_flag,
 
 \f
 
-/* The *pwent() functions do not exist on NT */
+/* The *pwent() functions do not exist on NT.  #### The NT equivalent
+   is NetUserEnum(), and rewriting to use it is not hard.*/
 #ifndef  WIN32_NATIVE
 
 static Lisp_Object user_name_completion (Lisp_Object user,
@@ -843,7 +844,7 @@ If file does not exist, returns nil.
   {
     struct stat sdir;
 
-    if (!NILP (directory) && stat ((char *) XSTRING_DATA (directory), &sdir) == 0)
+    if (!NILP (directory) && xemacs_stat ((char *) XSTRING_DATA (directory), &sdir) == 0)
       values[9] = (sdir.st_gid != s.st_gid) ? Qt : Qnil;
     else                        /* if we can't tell, assume worst */
       values[9] = Qt;
index c9a74a8..4aa59b5 100644 (file)
@@ -668,7 +668,7 @@ pdump_reloc_one (void *data, EMACS_INT delta, const struct lrecord_description *
 
            if (POINTER_TYPE_P (XTYPE (*pobj))
                && ! EQ (*pobj, Qnull_pointer))
-             XSETOBJ (*pobj, XTYPE (*pobj), (char *) XPNTR (*pobj) + delta);
+             XSETOBJ (*pobj, (char *) XPNTR (*pobj) + delta);
 
            break;
          }
@@ -686,7 +686,7 @@ pdump_reloc_one (void *data, EMACS_INT delta, const struct lrecord_description *
 
                if (POINTER_TYPE_P (XTYPE (*pobj))
                    && ! EQ (*pobj, Qnull_pointer))
-                 XSETOBJ (*pobj, XTYPE (*pobj), (char *) XPNTR (*pobj) + delta);
+                 XSETOBJ (*pobj, (char *) XPNTR (*pobj) + delta);
              }
            break;
          }
@@ -1023,7 +1023,7 @@ static int pdump_load_finish (void)
     {
       Lisp_Object obj = PDUMP_READ (p, Lisp_Object);
       if (POINTER_TYPE_P (XTYPE (obj)))
-       XSETOBJ (obj, XTYPE (obj), (char *) XPNTR (obj) + delta);
+       XSETOBJ (obj, (char *) XPNTR (obj) + delta);
       *staticvec[i] = obj;
     }
 
@@ -1081,7 +1081,7 @@ static int pdump_load_finish (void)
       Lisp_Object  obj = PDUMP_READ (p, Lisp_Object);
 
       if (POINTER_TYPE_P (XTYPE (obj)))
-       XSETOBJ (obj, XTYPE (obj), (char *) XPNTR (obj) + delta);
+       XSETOBJ (obj, (char *) XPNTR (obj) + delta);
 
       *var = obj;
     }
@@ -1103,9 +1103,6 @@ static int pdump_load_finish (void)
          p += sizeof (Lisp_Object) * rt.count;
     }
 
-  /* Put back noninteractive1 to its real value */
-  noninteractive1 = noninteractive;
-
   return 1;
 }
 
@@ -1121,11 +1118,11 @@ static void pdump_file_unmap(void)
 static int pdump_file_get(const char *path)
 {
 
-  pdump_hFile = CreateFile (path, 
+  pdump_hFile = CreateFile (path,
                            GENERIC_READ + GENERIC_WRITE,  /* Required for copy on write */
                            0,                      /* Not shared */
                            NULL,                   /* Not inheritable */
-                           OPEN_EXISTING, 
+                           OPEN_EXISTING,
                            FILE_ATTRIBUTE_NORMAL,
                            NULL);                  /* No template file */
   if (pdump_hFile == INVALID_HANDLE_VALUE)
@@ -1263,7 +1260,7 @@ static int pdump_file_try(char *exe_path)
            return 1;
          pdump_free();
        }
-      
+
       sprintf (w, "-%08x.dmp", dump_id);
       if (pdump_file_get (exe_path))
        {
@@ -1271,7 +1268,7 @@ static int pdump_file_try(char *exe_path)
            return 1;
          pdump_free();
        }
-      
+
       sprintf (w, ".dmp");
       if (pdump_file_get (exe_path))
        {
@@ -1279,10 +1276,10 @@ static int pdump_file_try(char *exe_path)
            return 1;
          pdump_free();
        }
-      
+
       do
        w--;
-      while (w>exe_path && !IS_DIRECTORY_SEP (*w) && (*w != '-') && (*w != '.'));      
+      while (w>exe_path && !IS_DIRECTORY_SEP (*w) && (*w != '-') && (*w != '.'));
     }
   while (w>exe_path && !IS_DIRECTORY_SEP (*w));
   return 0;
@@ -1292,7 +1289,7 @@ int pdump_load(const char *argv0)
 {
   char exe_path[PATH_MAX];
 #ifdef WIN32_NATIVE
-  GetModuleFileName (NULL, exe_path, PATH_MAX);  
+  GetModuleFileName (NULL, exe_path, PATH_MAX);
 #else /* !WIN32_NATIVE */
   char *w;
   const char *dir, *p;
@@ -1306,7 +1303,7 @@ int pdump_load(const char *argv0)
 
   p = dir + strlen(dir);
   while (p != dir && !IS_ANY_SEP (p[-1])) p--;
-  
+
   if (p != dir)
     {
       /* invocation-name includes a directory component -- presumably it
@@ -1337,12 +1334,12 @@ int pdump_load(const char *argv0)
              *w++ = '/';
            }
          strcpy(w, name);
-         
+
          /* ### #$%$#^$^@%$^#%@$ ! */
 #ifdef access
 #undef access
 #endif
-         
+
          if (!access (exe_path, X_OK))
            break;
          if (!*p)
@@ -1351,7 +1348,7 @@ int pdump_load(const char *argv0)
              sprintf (exe_path, "./%s", name);
              break;
            }
-         path = p+1;       
+         path = p+1;
        }
     }
 #endif /* WIN32_NATIVE */
index ca3d41e..1129eb1 100644 (file)
@@ -600,6 +600,12 @@ If BUFFER is nil, the current buffer is assumed.
   return make_char (BUF_FETCH_CHAR (b, n));
 }
 
+#if !defined(WINDOWSNT) && !defined(MSDOS)
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <limits.h>
+#endif
 \f
 DEFUN ("temp-directory", Ftemp_directory, 0, 0, 0, /*
 Return the pathname to the directory to use for temporary files.
@@ -619,7 +625,47 @@ On Unix it is obtained from TMPDIR, with /tmp as the default
 #else /* WIN32_NATIVE */
  tmpdir = getenv ("TMPDIR");
  if (!tmpdir)
+    {
+      struct stat st;
+      int myuid = getuid();
+      static char path[5 /* strlen ("/tmp/") */ + 1 + _POSIX_PATH_MAX];
+
+      strcpy (path, "/tmp/");
+      strncat (path, user_login_name (NULL), _POSIX_PATH_MAX);
+      if (lstat(path, &st) < 0 && errno == ENOENT)
+       {
+         mkdir(path, 0700);    /* ignore retval -- checked next anyway. */
+       }
+      if (lstat(path, &st) == 0 && st.st_uid == myuid && S_ISDIR(st.st_mode))
+       {
+         tmpdir = path;
+       }
+      else
+       {
+         strcpy(path, getenv("HOME")); strncat(path, "/tmp/", _POSIX_PATH_MAX);
+         if (stat(path, &st) < 0 && errno == ENOENT)
+           {
+             int fd;
+             char warnpath[1+_POSIX_PATH_MAX];
+             mkdir(path, 0700);        /* ignore retvals */
+             strcpy(warnpath, path);
+             strncat(warnpath, ".created_by_xemacs", _POSIX_PATH_MAX);
+             if ((fd = open(warnpath, O_WRONLY|O_CREAT, 0644)) > 0)
+               {
+                 write(fd, "XEmacs created this directory because /tmp/<yourname> was unavailable -- \nPlease check !\n", 89);
+                 close(fd);
+               }
+           }
+         if (stat(path, &st) == 0 && S_ISDIR(st.st_mode))
+           {
+             tmpdir = path;
+           }
+         else
+           {
    tmpdir = "/tmp";
+           }
+       }
+    }
 #endif
 
   return build_ext_string (tmpdir, Qfile_name);
@@ -1220,17 +1266,19 @@ and from `file-attributes'.
        (specified_time))
 {
   time_t value;
-  char buf[30];
-  char *tem;
+  char *the_ctime;
+  size_t len;
 
   if (! lisp_to_time (specified_time, &value))
     value = -1;
-  tem = (char *) ctime (&value);
+  the_ctime = ctime (&value);
 
-  strncpy (buf, tem, 24);
-  buf[24] = 0;
+  /* ctime is documented as always returning a "\n\0"-terminated
+     26-byte American time string, but let's be careful anyways. */
+  for (len = 0; the_ctime[len] != '\n' && the_ctime[len] != '\0'; len++)
+    ;
 
-  return build_ext_string (buf, Qbinary);
+  return make_ext_string ((Extbyte *) the_ctime, len, Qbinary);
 }
 
 #define TM_YEAR_ORIGIN 1900
@@ -2513,6 +2561,8 @@ zmacs-activate-region. Setting this to true lets a command be non-intrusive.
 See the variable `zmacs-regions'.
 
 The same effect can be achieved using the `_' interactive specification.
+
+`zmacs-region-stays' is reset to nil before each command is executed.
 */ );
   zmacs_region_stays = 0;
 
index 68b63e7..c26272d 100644 (file)
@@ -218,77 +218,73 @@ the LDAP library XEmacs was compiled with: `simple', `krbv41' and `krbv42'.
   int  ldap_sizelimit = 0;
   int  err;
 
-  Lisp_Object list, keyword, value;
-
   CHECK_STRING (host);
 
-  EXTERNAL_PROPERTY_LIST_LOOP (list, keyword, value, plist)
-    {
-      /* TCP Port */
-      if (EQ (keyword, Qport))
-        {
-          CHECK_INT (value);
-          ldap_port = XINT (value);
-        }
-      /* Authentication method */
-      if (EQ (keyword, Qauth))
-        {
-          if (EQ (value, Qsimple))
-            ldap_auth = LDAP_AUTH_SIMPLE;
+  {
+    EXTERNAL_PROPERTY_LIST_LOOP_3 (keyword, value, plist)
+      {
+       /* TCP Port */
+       if (EQ (keyword, Qport))
+         {
+           CHECK_INT (value);
+           ldap_port = XINT (value);
+         }
+       /* Authentication method */
+       if (EQ (keyword, Qauth))
+         {
+           if (EQ (value, Qsimple))
+             ldap_auth = LDAP_AUTH_SIMPLE;
 #ifdef LDAP_AUTH_KRBV41
-          else if (EQ (value, Qkrbv41))
-            ldap_auth = LDAP_AUTH_KRBV41;
+           else if (EQ (value, Qkrbv41))
+             ldap_auth = LDAP_AUTH_KRBV41;
 #endif
 #ifdef LDAP_AUTH_KRBV42
-          else if (EQ (value, Qkrbv42))
-            ldap_auth = LDAP_AUTH_KRBV42;
+           else if (EQ (value, Qkrbv42))
+             ldap_auth = LDAP_AUTH_KRBV42;
 #endif
-          else
-            signal_simple_error ("Invalid authentication method", value);
-        }
-      /* Bind DN */
-      else if (EQ (keyword, Qbinddn))
-        {
-          CHECK_STRING (value);
-         TO_EXTERNAL_FORMAT (LISP_STRING, value,
-                             C_STRING_ALLOCA, ldap_binddn,
-                             Qnative);
-        }
-      /* Password */
-      else if (EQ (keyword, Qpasswd))
-        {
-          CHECK_STRING (value);
-         TO_EXTERNAL_FORMAT (LISP_STRING, value,
-                             C_STRING_ALLOCA, ldap_passwd,
-                             Qnative);
-        }
-      /* Deref */
-      else if (EQ (keyword, Qderef))
-        {
-          if (EQ (value, Qnever))
-            ldap_deref = LDAP_DEREF_NEVER;
-          else if (EQ (value, Qsearch))
-            ldap_deref = LDAP_DEREF_SEARCHING;
-          else if (EQ (value, Qfind))
-            ldap_deref = LDAP_DEREF_FINDING;
-          else if (EQ (value, Qalways))
-            ldap_deref = LDAP_DEREF_ALWAYS;
-          else
-            signal_simple_error ("Invalid deref value", value);
-        }
-      /* Timelimit */
-      else if (EQ (keyword, Qtimelimit))
-        {
-          CHECK_INT (value);
-          ldap_timelimit = XINT (value);
-        }
-      /* Sizelimit */
-      else if (EQ (keyword, Qsizelimit))
-        {
-          CHECK_INT (value);
-          ldap_sizelimit = XINT (value);
-        }
-    }
+           else
+             signal_simple_error ("Invalid authentication method", value);
+         }
+       /* Bind DN */
+       else if (EQ (keyword, Qbinddn))
+         {
+           CHECK_STRING (value);
+           LISP_STRING_TO_EXTERNAL (value, ldap_binddn, Qnative);
+         }
+       /* Password */
+       else if (EQ (keyword, Qpasswd))
+         {
+           CHECK_STRING (value);
+           LISP_STRING_TO_EXTERNAL (value, ldap_passwd, Qnative);
+         }
+       /* Deref */
+       else if (EQ (keyword, Qderef))
+         {
+           if (EQ (value, Qnever))
+             ldap_deref = LDAP_DEREF_NEVER;
+           else if (EQ (value, Qsearch))
+             ldap_deref = LDAP_DEREF_SEARCHING;
+           else if (EQ (value, Qfind))
+             ldap_deref = LDAP_DEREF_FINDING;
+           else if (EQ (value, Qalways))
+             ldap_deref = LDAP_DEREF_ALWAYS;
+           else
+             signal_simple_error ("Invalid deref value", value);
+         }
+       /* Timelimit */
+       else if (EQ (keyword, Qtimelimit))
+         {
+           CHECK_INT (value);
+           ldap_timelimit = XINT (value);
+         }
+       /* Sizelimit */
+       else if (EQ (keyword, Qsizelimit))
+         {
+           CHECK_INT (value);
+           ldap_sizelimit = XINT (value);
+         }
+      }
+  }
 
   if (ldap_port == 0)
     {
@@ -297,7 +293,7 @@ the LDAP library XEmacs was compiled with: `simple', `krbv41' and `krbv42'.
 
   /* Connect to the server and bind */
   slow_down_interrupts ();
-  ld = ldap_open ((char *)XSTRING_DATA (host), ldap_port);
+  ld = ldap_open ((char *) XSTRING_DATA (host), ldap_port);
   speed_up_interrupts ();
 
   if (ld == NULL )
@@ -477,9 +473,7 @@ entry according to the value of WITHDN.
        {
          Lisp_Object current = XCAR (attrs);
          CHECK_STRING (current);
-         TO_EXTERNAL_FORMAT (LISP_STRING, current,
-                             C_STRING_ALLOCA, ldap_attributes[i],
-                             Qnative);
+         LISP_STRING_TO_EXTERNAL (current, ldap_attributes[i], Qnative);
          ++i;
        }
       ldap_attributes[i] = NULL;
@@ -638,9 +632,7 @@ containing attribute/value string pairs.
       CHECK_CONS (current);
       CHECK_STRING (XCAR (current));
       ldap_mods_ptrs[i] = &(ldap_mods[i]);
-      TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (current),
-                         C_STRING_ALLOCA, ldap_mods[i].mod_type,
-                         Qnative);
+      LISP_STRING_TO_EXTERNAL (XCAR (current), ldap_mods[i].mod_type, Qnative);
       ldap_mods[i].mod_op = LDAP_MOD_ADD | LDAP_MOD_BVALUES;
       values = XCDR (current);
       if (CONSP (values))
@@ -746,9 +738,7 @@ or `replace'. ATTR is the LDAP attribute type to modify.
         signal_simple_error ("Invalid LDAP modification type", mod_op);
       current = XCDR (current);
       CHECK_STRING (XCAR (current));
-      TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (current),
-                         C_STRING_ALLOCA, ldap_mods[i].mod_type,
-                         Qnative);
+      LISP_STRING_TO_EXTERNAL (XCAR (current), ldap_mods[i].mod_type, Qnative);
       values = XCDR (current);
       len = XINT (Flength (values));
       bervals = alloca_array (struct berval, len);
index 5e7bd46..36b51de 100644 (file)
@@ -29,13 +29,13 @@ Boston, MA 02111-1307, USA.  */
 
 Lisp_Object Qhash_tablep;
 static Lisp_Object Qhashtable, Qhash_table;
-static Lisp_Object Qweakness, Qvalue, Qkey_value;
+static Lisp_Object Qweakness, Qvalue, Qkey_or_value, Qkey_and_value;
 static Lisp_Object Vall_weak_hash_tables;
 static Lisp_Object Qrehash_size, Qrehash_threshold;
 static Lisp_Object Q_size, Q_test, Q_weakness, Q_rehash_size, Q_rehash_threshold;
 
 /* obsolete as of 19990901 in xemacs-21.2 */
-static Lisp_Object Qweak, Qkey_weak, Qvalue_weak, Qkey_value_weak;
+static Lisp_Object Qweak, Qkey_weak, Qvalue_weak, Qkey_or_value_weak;
 static Lisp_Object Qnon_weak, Q_type;
 
 typedef struct hentry
@@ -277,7 +277,7 @@ hash_table_hash (Lisp_Object hash_table, int depth)
    `size'             (a natnum or nil)
    `rehash-size'      (a float)
    `rehash-threshold' (a float)
-   `weakness'         (nil, t, key or value)
+   `weakness'         (nil, key, value, key-and-value, or key-or-value)
    `data'             (a list)
 
    If `print-readably' is nil, then a simpler syntax is used, for example
@@ -352,10 +352,10 @@ print_hash_table (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
   if (ht->weakness != HASH_TABLE_NON_WEAK)
     {
       sprintf (buf, " weakness %s",
-              (ht->weakness == HASH_TABLE_WEAK       ? "t"     :
-               ht->weakness == HASH_TABLE_KEY_WEAK   ? "key"   :
-               ht->weakness == HASH_TABLE_VALUE_WEAK ? "value" :
-               ht->weakness == HASH_TABLE_KEY_VALUE_WEAK ? "key-value" :
+              (ht->weakness == HASH_TABLE_WEAK           ? "key-and-value" :
+               ht->weakness == HASH_TABLE_KEY_WEAK       ? "key" :
+               ht->weakness == HASH_TABLE_VALUE_WEAK     ? "value" :
+               ht->weakness == HASH_TABLE_KEY_VALUE_WEAK ? "key-or-value" :
                "you-d-better-not-see-this"));
       write_c_string (buf, printcharfun);
     }
@@ -541,18 +541,19 @@ static int
 hash_table_weakness_validate (Lisp_Object keyword, Lisp_Object value,
                              Error_behavior errb)
 {
-  if (EQ (value, Qnil))                return 1;
-  if (EQ (value, Qt))          return 1;
-  if (EQ (value, Qkey))                return 1;
-  if (EQ (value, Qkey_value))          return 1;
-  if (EQ (value, Qvalue))      return 1;
+  if (EQ (value, Qnil))                        return 1;
+  if (EQ (value, Qt))                  return 1;
+  if (EQ (value, Qkey))                        return 1;
+  if (EQ (value, Qkey_and_value))      return 1;
+  if (EQ (value, Qkey_or_value))       return 1;
+  if (EQ (value, Qvalue))              return 1;
 
   /* Following values are obsolete as of 19990901 in xemacs-21.2 */
-  if (EQ (value, Qnon_weak))   return 1;
-  if (EQ (value, Qweak))       return 1;
-  if (EQ (value, Qkey_weak))   return 1;
-  if (EQ (value, Qkey_value_weak))     return 1;
-  if (EQ (value, Qvalue_weak)) return 1;
+  if (EQ (value, Qnon_weak))           return 1;
+  if (EQ (value, Qweak))               return 1;
+  if (EQ (value, Qkey_weak))           return 1;
+  if (EQ (value, Qkey_or_value_weak))  return 1;
+  if (EQ (value, Qvalue_weak))         return 1;
 
   maybe_signal_simple_error ("Invalid hash table weakness",
                             value, Qhash_table, errb);
@@ -562,18 +563,19 @@ hash_table_weakness_validate (Lisp_Object keyword, Lisp_Object value,
 static enum hash_table_weakness
 decode_hash_table_weakness (Lisp_Object obj)
 {
-  if (EQ (obj, Qnil))       return HASH_TABLE_NON_WEAK;
-  if (EQ (obj, Qt))         return HASH_TABLE_WEAK;
-  if (EQ (obj, Qkey))        return HASH_TABLE_KEY_WEAK;
-  if (EQ (obj, Qkey_value))        return HASH_TABLE_KEY_VALUE_WEAK;
-  if (EQ (obj, Qvalue))      return HASH_TABLE_VALUE_WEAK;
+  if (EQ (obj, Qnil))                  return HASH_TABLE_NON_WEAK;
+  if (EQ (obj, Qt))                    return HASH_TABLE_WEAK;
+  if (EQ (obj, Qkey_and_value))                return HASH_TABLE_WEAK;
+  if (EQ (obj, Qkey))                  return HASH_TABLE_KEY_WEAK;
+  if (EQ (obj, Qkey_or_value))         return HASH_TABLE_KEY_VALUE_WEAK;
+  if (EQ (obj, Qvalue))                        return HASH_TABLE_VALUE_WEAK;
 
   /* Following values are obsolete as of 19990901 in xemacs-21.2 */
-  if (EQ (obj, Qnon_weak))   return HASH_TABLE_NON_WEAK;
-  if (EQ (obj, Qweak))      return HASH_TABLE_WEAK;
-  if (EQ (obj, Qkey_weak))   return HASH_TABLE_KEY_WEAK;
-  if (EQ (obj, Qkey_value_weak))   return HASH_TABLE_KEY_VALUE_WEAK;
-  if (EQ (obj, Qvalue_weak)) return HASH_TABLE_VALUE_WEAK;
+  if (EQ (obj, Qnon_weak))             return HASH_TABLE_NON_WEAK;
+  if (EQ (obj, Qweak))                 return HASH_TABLE_WEAK;
+  if (EQ (obj, Qkey_weak))             return HASH_TABLE_KEY_WEAK;
+  if (EQ (obj, Qkey_or_value_weak))    return HASH_TABLE_KEY_VALUE_WEAK;
+  if (EQ (obj, Qvalue_weak))           return HASH_TABLE_VALUE_WEAK;
 
   signal_simple_error ("Invalid hash table weakness", obj);
   return HASH_TABLE_NON_WEAK; /* not reached */
@@ -806,15 +808,16 @@ the factor by which to increase the size of the hash table when enlarging.
 Keyword :rehash-threshold must be a float between 0.0 and 1.0,
 and specifies the load factor of the hash table which triggers enlarging.
 
-Non-standard keyword :weakness can be `nil' (default), `t', `key', `value'
-or `key-value'.
+Non-standard keyword :weakness can be `nil' (default), `t', `key-and-value',
+`key', `value' or `key-or-value'. `t' is an alias for `key-and-value'.
 
-A weak hash table is one whose pointers do not count as GC referents:
-for any key-value pair in the hash table, if the only remaining pointer
-to either the key or the value is in a weak hash table, then the pair
-will be removed from the hash table, and the key and value collected.
-A non-weak hash table (or any other pointer) would prevent the object
-from being collected.
+A key-and-value-weak hash table, also known as a fully-weak or simply
+as a weak hash table, is one whose pointers do not count as GC
+referents: for any key-value pair in the hash table, if the only
+remaining pointer to either the key or the value is in a weak hash
+table, then the pair will be removed from the hash table, and the key
+and value collected.  A non-weak hash table (or any other pointer)
+would prevent the object from being collected.
 
 A key-weak hash table is similar to a fully-weak hash table except that
 a key-value pair will be removed only if the key remains unmarked
@@ -828,7 +831,7 @@ unmarked outside of weak hash tables.  The pair will remain in the
 hash table if the value is pointed to by something other than a weak
 hash table, even if the key is not.
 
-A key-value-weak hash table is similar to a fully-weak hash table except
+A key-or-value-weak hash table is similar to a fully-weak hash table except
 that a key-value pair will be removed only if the value and the key remain
 unmarked outside of weak hash tables.  The pair will remain in the
 hash table if the value or key are pointed to by something other than a weak
@@ -1122,17 +1125,17 @@ beyond which the HASH-TABLE is enlarged by rehashing.
 
 DEFUN ("hash-table-weakness", Fhash_table_weakness, 1, 1, 0, /*
 Return the weakness of HASH-TABLE.
-This can be one of `nil', `t', `key' or `value'.
+This can be one of `nil', `key-and-value', `key-or-value', `key' or `value'.
 */
        (hash_table))
 {
   switch (xhash_table (hash_table)->weakness)
     {
-    case HASH_TABLE_WEAK:      return Qt;
-    case HASH_TABLE_KEY_WEAK:  return Qkey;
-    case HASH_TABLE_KEY_VALUE_WEAK:    return Qkey_value;
-    case HASH_TABLE_VALUE_WEAK:        return Qvalue;
-    default:                   return Qnil;
+    case HASH_TABLE_WEAK:              return Qkey_and_value;
+    case HASH_TABLE_KEY_WEAK:          return Qkey;
+    case HASH_TABLE_KEY_VALUE_WEAK:    return Qkey_or_value;
+    case HASH_TABLE_VALUE_WEAK:                return Qvalue;
+    default:                           return Qnil;
     }
 }
 
@@ -1145,11 +1148,11 @@ This can be one of `non-weak', `weak', `key-weak' or `value-weak'.
 {
   switch (xhash_table (hash_table)->weakness)
     {
-    case HASH_TABLE_WEAK:      return Qweak;
-    case HASH_TABLE_KEY_WEAK:  return Qkey_weak;
-    case HASH_TABLE_KEY_VALUE_WEAK:    return Qkey_value_weak;
-    case HASH_TABLE_VALUE_WEAK:        return Qvalue_weak;
-    default:                   return Qnon_weak;
+    case HASH_TABLE_WEAK:              return Qweak;
+    case HASH_TABLE_KEY_WEAK:          return Qkey_weak;
+    case HASH_TABLE_KEY_VALUE_WEAK:    return Qkey_or_value_weak;
+    case HASH_TABLE_VALUE_WEAK:                return Qvalue_weak;
+    default:                           return Qnon_weak;
     }
 }
 
@@ -1484,13 +1487,14 @@ syms_of_elhash (void)
   defsymbol (&Qhashtable, "hashtable");
   defsymbol (&Qweakness, "weakness");
   defsymbol (&Qvalue, "value");
-  defsymbol (&Qkey_value, "key-value");
+  defsymbol (&Qkey_or_value, "key-or-value");
+  defsymbol (&Qkey_and_value, "key-and-value");
   defsymbol (&Qrehash_size, "rehash-size");
   defsymbol (&Qrehash_threshold, "rehash-threshold");
 
   defsymbol (&Qweak, "weak");             /* obsolete */
   defsymbol (&Qkey_weak, "key-weak");     /* obsolete */
-  defsymbol (&Qkey_value_weak, "key-value-weak");     /* obsolete */
+  defsymbol (&Qkey_or_value_weak, "key-or-value-weak");    /* obsolete */
   defsymbol (&Qvalue_weak, "value-weak"); /* obsolete */
   defsymbol (&Qnon_weak, "non-weak");     /* obsolete */
 
index 446f3c9..abc8bfe 100644 (file)
@@ -338,13 +338,30 @@ uintptr_t bss_end = 0;
 /* Number of bytes of writable memory we can expect to be able to get */
 unsigned int lim_data;
 
+/* WARNING!
+
+   Some LISP-visible command-line options are set by XEmacs _before_ the
+   data is dumped in building a --pdump XEmacs, but used _after_ it is
+   restored in normal operation.  Thus the restored values overwrite the
+   values XEmacs is getting at run-time.  Such variables must be saved
+   before loading the dumpfile, and restored afterward.
+
+   This is done immediately before and after pdump_load() in main_1().
+   See that function for the current list of protected variables.
+
+   Note that if the variable is never DEFVAR'd, saving/restoring is not
+   needed.
+*/
+
 /* Nonzero means running XEmacs without interactive terminal.  */
 
 int noninteractive;
 
 /* Value of Lisp variable `noninteractive'.
    Normally same as C variable `noninteractive'
-   but nothing terrible happens if user sets this one.  */
+   but nothing terrible happens if user sets this one.
+
+   Shadowed from the pdumper by `noninteractive'. */
 
 int noninteractive1;
 
@@ -368,7 +385,7 @@ int nodumpfile;
 int debug_paths;
 
 /* Save argv and argc.  */
-static char **initial_argv;
+static Extbyte **initial_argv;
 static int initial_argc;
 
 static void sort_args (int argc, char **argv);
@@ -591,7 +608,7 @@ mswindows_handle_hardware_exceptions (DWORD code)
   */
 
   __except (EXCEPTION_EXECUTE_HANDLER) {}
-  
+
 
   /* pretend we didn't handle this, so that the debugger is invoked and/or
      the normal GPF box appears. */
@@ -623,7 +640,7 @@ memory_warning_signal (int sig)
 /* Code for dealing with Lisp access to the Unix command line */
 
 static Lisp_Object
-make_arg_list_1 (int argc, char **argv, int skip_args)
+make_arg_list_1 (int argc, Extbyte **argv, int skip_args)
 {
   Lisp_Object result = Qnil;
   REGISTER int i;
@@ -636,17 +653,26 @@ make_arg_list_1 (int argc, char **argv, int skip_args)
          if (i == 0)
            {
              /* Do not trust to what crt0 has stuffed into argv[0] */
-             char full_exe_path [MAX_PATH];
+             char full_exe_path[MAX_PATH];
+             Lisp_Object fullpath;
+
              GetModuleFileName (NULL, full_exe_path, MAX_PATH);
-             result = Fcons (build_ext_string (full_exe_path, Qfile_name),
-                             result);
+             fullpath = build_ext_string (full_exe_path, Qmswindows_tstr);
+             result = Fcons (fullpath, result);
 #if defined(HAVE_SHLIB)
-             (void)dll_init(full_exe_path);
+             {
+               Extbyte *fullpathext;
+
+               LISP_STRING_TO_EXTERNAL (fullpath, fullpathext,
+                                 Qdll_filename_encoding);
+               (void) dll_init (fullpathext);
+             }
 #endif
            }
          else
 #endif
-           result = Fcons (build_ext_string (argv [i], Qfile_name),
+           result = Fcons (build_ext_string (argv[i],
+                                             Qcommand_argument_encoding),
                            result);
        }
     }
@@ -654,7 +680,7 @@ make_arg_list_1 (int argc, char **argv, int skip_args)
 }
 
 Lisp_Object
-make_arg_list (int argc, char **argv)
+make_arg_list (int argc, Extbyte **argv)
 {
   return make_arg_list_1 (argc, argv, 0);
 }
@@ -662,21 +688,19 @@ make_arg_list (int argc, char **argv)
 /* Calling functions are also responsible for calling free_argc_argv
    when they are done with the generated list. */
 void
-make_argc_argv (Lisp_Object argv_list, int *argc, char ***argv)
+make_argc_argv (Lisp_Object argv_list, int *argc, Extbyte ***argv)
 {
   Lisp_Object next;
   int n = XINT (Flength (argv_list));
   REGISTER int i;
-  *argv = (char**) xmalloc ((n+1) * sizeof (char*));
+  *argv = (Extbyte**) xmalloc ((n+1) * sizeof (Extbyte*));
 
   for (i = 0, next = argv_list; i < n; i++, next = XCDR (next))
     {
-      const char *temp;
+      const Extbyte *temp;
       CHECK_STRING (XCAR (next));
 
-      TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (next),
-                         C_STRING_ALLOCA, temp,
-                         Qnative);
+      LISP_STRING_TO_EXTERNAL (XCAR (next), temp, Qcommand_argument_encoding);
       (*argv) [i] = xstrdup (temp);
     }
   (*argv) [n] = 0;
@@ -684,7 +708,7 @@ make_argc_argv (Lisp_Object argv_list, int *argc, char ***argv)
 }
 
 void
-free_argc_argv (char **argv)
+free_argc_argv (Extbyte **argv)
 {
   int elt = 0;
 
@@ -697,7 +721,7 @@ free_argc_argv (char **argv)
 }
 
 static void
-init_cmdargs (int argc, char **argv, int skip_args)
+init_cmdargs (int argc, Extbyte **argv, int skip_args)
 {
   initial_argv = argv;
   initial_argc = argc;
@@ -1113,7 +1137,44 @@ main_1 (int argc, char **argv, char **envp, int restart)
     initialized = 0;
     purify_flag = 1;
   } else {
+
+    /* Keep command options from getting stomped.
+
+       Some LISP-visible options are changed by XEmacs _after_ the data is
+       dumped in building a --pdump XEmacs, but _before_ it is restored in
+       normal operation.  Thus the restored values overwrite the values
+       XEmacs is getting at run-time.  Such variables must be saved here,
+       and restored after loading the dumped data.
+
+       Boy, this is ugly, but how else to do it?
+    */
+
+    /* noninteractive1 is protected by noninteractive, which is not
+       LISP-visible */
+    int inhibit_early_packages_save = inhibit_early_packages;
+    int inhibit_autoloads_save      = inhibit_autoloads;
+    int debug_paths_save            = debug_paths;
+#ifdef INHIBIT_SITE_LISP
+    int inhibit_site_lisp_save      = inhibit_site_lisp;
+#endif
+#ifdef INHIBIT_SITE_MODULES
+    int inhibit_site_modules_save   = inhibit_site_modules;
+#endif
+
     initialized = pdump_load (argv[0]);
+
+    /* Now unstomp everything */
+    noninteractive1        = noninteractive;
+    inhibit_early_packages = inhibit_early_packages_save;
+    inhibit_autoloads      = inhibit_autoloads_save;
+    debug_paths            = debug_paths_save;
+#ifdef INHIBIT_SITE_LISP
+    inhibit_site_lisp      = inhibit_site_lisp_save;
+#endif
+#ifdef INHIBIT_SITE_MODULES
+    inhibit_site_modules   = inhibit_site_modules_save;
+#endif
+
     if (initialized)
       run_temacs_argc = -1;
     else
@@ -1139,7 +1200,7 @@ main_1 (int argc, char **argv, char **envp, int restart)
       init_symbols_once_early ();
 
       /* Declare the basic symbols pertaining to errors,
-        So that deferror() can be called. */
+        So that DEFERROR*() can be called. */
       init_errors_once_early ();
 
       /* Make sure that opaque pointers can be created. */
@@ -1148,13 +1209,13 @@ main_1 (int argc, char **argv, char **envp, int restart)
       /* Now declare all the symbols and define all the Lisp primitives.
 
         The *only* thing that the syms_of_*() functions are allowed to do
-        is call one of the following three functions:
+        is call one of the following:
 
         INIT_LRECORD_IMPLEMENTATION()
-        defsymbol()
+        defsymbol(), DEFSYMBOL(), or DEFSYMBOL_MULTIWORD_PREDICATE()
         defsubr() (i.e. DEFSUBR)
-        deferror()
-        defkeyword()
+        deferror(), DEFERROR(), or DEFERROR_STANDARD()
+        defkeyword() or DEFKEYWORD()
 
         Order does not matter in these functions.
         */
@@ -1265,7 +1326,9 @@ main_1 (int argc, char **argv, char **envp, int restart)
 #endif
 
 #ifdef HAVE_X_WINDOWS
+#ifdef HAVE_BALLOON_HELP
       syms_of_balloon_x ();
+#endif
       syms_of_device_x ();
 #ifdef HAVE_DIALOGS
       syms_of_dialog_x ();
@@ -1290,6 +1353,7 @@ main_1 (int argc, char **argv, char **envp, int restart)
 #ifdef HAVE_MS_WINDOWS
       syms_of_console_mswindows ();
       syms_of_device_mswindows ();
+      syms_of_dialog_mswindows ();
       syms_of_frame_mswindows ();
       syms_of_objects_mswindows ();
       syms_of_select_mswindows ();
@@ -1301,13 +1365,16 @@ main_1 (int argc, char **argv, char **envp, int restart)
 #ifdef HAVE_SCROLLBARS
       syms_of_scrollbar_mswindows ();
 #endif
+#endif /* HAVE_MS_WINDOWS */
 #ifdef HAVE_MSW_C_DIRED
       syms_of_dired_mswindows ();
 #endif
 #ifdef WIN32_NATIVE
       syms_of_ntproc ();
 #endif
-#endif /* HAVE_MS_WINDOWS */
+#if defined (WIN32_NATIVE) || defined (CYGWIN)
+      syms_of_win32 ();
+#endif
 
 #ifdef MULE
       syms_of_mule ();
@@ -1687,7 +1754,9 @@ main_1 (int argc, char **argv, char **envp, int restart)
 #endif
 
 #ifdef HAVE_X_WINDOWS
+#ifdef HAVE_BALLOON_HELP
       vars_of_balloon_x ();
+#endif
       vars_of_device_x ();
 #ifdef HAVE_DIALOGS
       vars_of_dialog_x ();
@@ -2047,7 +2116,8 @@ main_1 (int argc, char **argv, char **envp, int restart)
                           first because many of the functions below
                           call egetenv() to get environment variables. */
   init_lread ();       /* Set up the Lisp reader. */
-  init_cmdargs (argc, argv, skip_args);        /* Create list Vcommand_line_args */
+  init_cmdargs (argc, (Extbyte **) argv,
+               skip_args);     /* Create list Vcommand_line_args */
   init_buffer ();      /* Set default directory of *scratch* buffer */
 
 #ifdef WIN32_NATIVE
@@ -2064,6 +2134,9 @@ main_1 (int argc, char **argv, char **envp, int restart)
 #ifdef SUNPRO
   init_sunpro (); /* Set up Sunpro usage tracking */
 #endif
+#if defined (WIN32_NATIVE) || defined (CYGWIN)
+  init_win32 ();
+#endif
 #if defined (HAVE_NATIVE_SOUND) && defined (hp9000s800)
   init_hpplay ();
 #endif
@@ -2663,10 +2736,12 @@ all of which are called before XEmacs is actually killed.
   UNGCPRO;
 
 #ifdef HAVE_MS_WINDOWS
-  /* If we displayed a message on the console and we're exiting due to
-     init error, then we must allow the user to see this message. */
-  if (mswindows_message_outputted && INTP (arg) && XINT (arg) != 0)
-    Fmswindows_message_box (build_string ("Initialization error"),
+  /* If we displayed a message on the console, then we must allow the
+     user to see this message.  This may be unnecessary, but can't hurt,
+     and we can't necessarily check arg; e.g. xemacs --help kills with
+     argument 0. */
+  if (mswindows_message_outputted)
+    Fmswindows_message_box (build_string ("Messages outputted.  XEmacs is exiting."),
                            Qnil, Qnil);
 #endif
 
@@ -2890,14 +2965,10 @@ and announce itself normally when it is run.
     char *intoname_ext;
     char *symname_ext;
 
-    TO_EXTERNAL_FORMAT (LISP_STRING, intoname,
-                       C_STRING_ALLOCA, intoname_ext,
-                       Qfile_name);
+    LISP_STRING_TO_EXTERNAL (intoname, intoname_ext, Qfile_name);
 
     if (STRINGP (symname))
-      TO_EXTERNAL_FORMAT (LISP_STRING, symname,
-                         C_STRING_ALLOCA, symname_ext,
-                         Qfile_name);
+      LISP_STRING_TO_EXTERNAL (symname, symname_ext, Qfile_name);
     else
       symname_ext = 0;
 
@@ -3103,7 +3174,7 @@ assert_failed (const char *file, int line, const char *expr)
       assert_failed_file = file;
       assert_failed_line = line;
       assert_failed_expr = expr;
+
       if (!initialized)
        fprintf (stderr,
                 "Fatal error: assertion failed, file %s, line %d, %s\n",
@@ -3303,6 +3374,11 @@ Codename of this version of Emacs (a string).
 #endif
   Vxemacs_codename = build_string (XEMACS_CODENAME);
 
+  /* Lisp variables which contain command line flags.
+
+     The portable dumper stomps on these; they must be saved and restored
+     if they are processed before the call to pdump_load() in main_1().
+  */
   DEFVAR_BOOL ("noninteractive", &noninteractive1 /*
 Non-nil means XEmacs is running without interactive terminal.
 */ );
@@ -3638,7 +3714,7 @@ The configured initial path for info documentation.
 #if defined(__sgi) && !defined(PDUMP)
 /* This is so tremendously ugly I'd puke. But then, it works.
  * The target is to override the static constructor from the
- * libiflPNG.so library which is maskerading as libz, and
+ * libiflPNG.so library which is masquerading as libz, and
  * cores on us when re-started from the dumped executable.
  * This will have to go for 21.1  -- OG.
  */
index bcd8f01..eb03bc8 100644 (file)
@@ -73,7 +73,7 @@ modules have been loaded as dynamic shared objects by examining the
 return value of the function `list-modules'.
 
 It is possible, although unwise, to unload modules using `unload-module'.
-The prefered mechanism for unloading or reloading modules is to quit
+The preferred mechanism for unloading or reloading modules is to quit
 XEmacs, and then reload those new or changed modules that are required.
 
 Messages informing you of the progress of the load are displayed unless
@@ -114,7 +114,7 @@ Unload a module previously loaded with load-module.
 As with load-module, this function requires at least the module FILE, and
 optionally the module NAME and VERSION to unload.  It may not be possible
 for the module to be unloaded from memory, as there may be Lisp objects
-refering to variables inside the module code.  However, once you have
+referring to variables inside the module code.  However, once you have
 requested a module to be unloaded, it will be unloaded from memory as
 soon as the last reference to symbols within the module is destroyed.
 */
@@ -209,7 +209,7 @@ find_make_module (const char *mod, const char *name, const char *ver, int mof)
     return fs; /* First free slot */
 
   /*
-   * We only get here if we havent found a free slot and the module was
+   * We only get here if we haven't found a free slot and the module was
    * not previously loaded.
    */
   if (modules == (emodules_list *)0)
@@ -278,7 +278,7 @@ module_load_unwind (Lisp_Object upto)
  * Do the actual grunt-work of loading in a module. We first try and
  * dlopen() the module. If that fails, we have an error and we bail
  * out immediately. If the dlopen() succeeds, we need to check for the
- * existance of certain special symbols.
+ * existence of certain special symbols.
  *
  * All modules will have complete access to the variables and functions
  * defined within XEmacs itself.  It is up to the module to declare any
@@ -288,17 +288,17 @@ module_load_unwind (Lisp_Object upto)
  *
  * We need to be very careful with how we load modules. If we encounter an
  * error along the way, we need to back out completely to the point at
- * which the user started. Since we can be called resursively, we need to
+ * which the user started. Since we can be called recursively, we need to
  * take care with marking modules as loaded. When we first start loading
  * modules, we set the counter to zero. As we enter the function each time,
- * we incremement the counter, and before we leave we decrement it. When
+ * we increment the counter, and before we leave we decrement it. When
  * we get back down to 0, we know we are at the end of the chain and we
  * can mark all the modules in the list as loaded.
  *
  * When we signal an error, we need to be sure to unwind all modules loaded
  * thus far (but only for this module chain). It is assumed that if any
  * modules in a chain fail, then they all do. This is logical, considering
- * that the only time we recurse is when we have dependant modules. So in
+ * that the only time we recurse is when we have dependent modules. So in
  * the error handler we take great care to close off the module chain before
  * we call "error" and let the Fmodule_load unwind_protect() function handle
  * the cleaning up.
@@ -386,7 +386,7 @@ emodules_load(const char *module, const char *modname, const char *modver)
   strcat (symname, mname);
   modload = (void (*)(void))dll_function (dlhandle, symname);
   /*
-   * modload is optional. If the module doesnt require other modules it can
+   * modload is optional. If the module doesn't require other modules it can
    * be left out.
    */
 
@@ -418,7 +418,7 @@ emodules_load(const char *module, const char *modname, const char *modver)
    * Attempt to make a new slot for this module. If this really is the
    * first time we are loading this module, the used member will be 0.
    * If that is non-zero, we know that we have a previously loaded module
-   * of the same name and version, and we dont need to go any further.
+   * of the same name and version, and we don't need to go any further.
    */
   mpx = find_make_module (soname, mname, mver, 0);
   mp = &modules[mpx];
@@ -543,7 +543,7 @@ Emacs dynamic loading mechanism version, as a string.
 
 This string is in the form XX.YY.ppp, where XX is the major version
 number, YY is the minor version number, and ppp is the patch level.
-This variable can be used to distinquish between different versions of
+This variable can be used to distinguish between different versions of
 the dynamic loading technology used in Emacs, if required.  It is not
 a given that this value will be the same as the Emacs version number.
 */ );
@@ -564,7 +564,7 @@ called by a Lisp function.
 Each element is a string (directory name) or nil (try default directory).
 
 Note that elements of this list *may not* begin with "~", so you must
-call `expland-file-name' on them before adding them to this list.
+call `expand-file-name' on them before adding them to this list.
 
 Initialized based on EMACSMODULEPATH environment variable, if any, otherwise
 to default specified the file `paths.h' when XEmacs was built.  If there
@@ -573,8 +573,8 @@ value for this variable by looking around in the file-system near the
 directory in which the XEmacs executable resides.
 
 Due to the nature of dynamic modules, the path names should almost always
-refer to architecture-dependant directories.  It is unwise to attempt to
-store dynamic modules in a hetrogenous environment.  Some environments
+refer to architecture-dependent directories.  It is unwise to attempt to
+store dynamic modules in a heterogenous environment.  Some environments
 are similar enough to each other that XEmacs will be unable to determine
 the correctness of a dynamic module, which can have unpredictable results
 when a dynamic module is loaded.
index 71d5726..15d06e8 100644 (file)
@@ -60,7 +60,7 @@ extern Lisp_Object Vemacs_minor_version;
  * second is the name of the module, and the third is the module version.
  * If the module name is NULL, we will always reload the .so. If it is not
  * NULL, we check to make sure we haven't loaded it before. If the version
- * is specified, we check to make sure we didnt load the module of the
+ * is specified, we check to make sure we didn't load the module of the
  * specified version before. We also use these as checks when we open the
  * module to make sure we have the right module.
  */
@@ -69,7 +69,7 @@ extern void emodules_load (const char *module, const char *name, const char *ver
 /*
  * Because subrs and symbols added by a dynamic module are not part of
  * the make-docfile process, we need a clean way to get the variables
- * and functions documented. Since people dont like the idea of making
+ * and functions documented. Since people don't like the idea of making
  * shared modules use different versions of DEFSUBR() and DEFVAR_LISP()
  * and friends, we need these two functions to insert the documentation
  * into the right place. These functions will be called by the module
index ec6a270..d34ba2e 100644 (file)
@@ -1,6 +1,7 @@
 /* Evaluator for XEmacs Lisp interpreter.
    Copyright (C) 1985-1987, 1992-1994 Free Software Foundation, Inc.
    Copyright (C) 1995 Sun Microsystems, Inc.
+   Copyright (C) 2000 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -561,10 +562,13 @@ signal_call_debugger (Lisp_Object conditions,
       specbind (Qdebug_on_signal,      Qnil);
       specbind (Qstack_trace_on_signal, Qnil);
 
-      internal_with_output_to_temp_buffer (build_string ("*Backtrace*"),
-                                          backtrace_259,
-                                          Qnil,
-                                          Qnil);
+      if (!noninteractive)
+       internal_with_output_to_temp_buffer (build_string ("*Backtrace*"),
+                                            backtrace_259,
+                                            Qnil,
+                                            Qnil);
+      else /* in batch mode, we want this going to stderr. */
+       backtrace_259 (Qnil);
       unbind_to (speccount, Qnil);
       *stack_trace_displayed = 1;
     }
@@ -593,10 +597,13 @@ signal_call_debugger (Lisp_Object conditions,
       specbind (Qdebug_on_signal,      Qnil);
       specbind (Qstack_trace_on_signal, Qnil);
 
-      internal_with_output_to_temp_buffer (build_string ("*Backtrace*"),
-                                          backtrace_259,
-                                          Qnil,
-                                          Qnil);
+      if (!noninteractive)
+       internal_with_output_to_temp_buffer (build_string ("*Backtrace*"),
+                                            backtrace_259,
+                                            Qnil,
+                                            Qnil);
+      else /* in batch mode, we want this going to stderr. */
+       backtrace_259 (Qnil);
       unbind_to (speccount, Qnil);
       *stack_trace_displayed = 1;
     }
@@ -637,7 +644,7 @@ If all args return nil, return nil.
        (args))
 {
   /* This function can GC */
-  REGISTER Lisp_Object arg, val;
+  REGISTER Lisp_Object val;
 
   LIST_LOOP_2 (arg, args)
     {
@@ -656,7 +663,7 @@ If no arg yields nil, return the last arg's value.
        (args))
 {
   /* This function can GC */
-  REGISTER Lisp_Object arg, val = Qt;
+  REGISTER Lisp_Object val = Qt;
 
   LIST_LOOP_2 (arg, args)
     {
@@ -732,7 +739,7 @@ CONDITION's value if non-nil is returned from the cond-form.
        (args))
 {
   /* This function can GC */
-  REGISTER Lisp_Object val, clause;
+  REGISTER Lisp_Object val;
 
   LIST_LOOP_2 (clause, args)
     {
@@ -758,7 +765,7 @@ DEFUN ("progn", Fprogn, 0, UNEVALLED, 0, /*
 {
   /* This function can GC */
   /* Caller must provide a true list in ARGS */
-  REGISTER Lisp_Object form, val = Qnil;
+  REGISTER Lisp_Object val = Qnil;
   struct gcpro gcpro1;
 
   GCPRO1 (args);
@@ -784,7 +791,7 @@ whose values are discarded.
        (args))
 {
   /* This function can GC */
-  REGISTER Lisp_Object val, form;
+  REGISTER Lisp_Object val;
   struct gcpro gcpro1;
 
   val = Feval (XCAR (args));
@@ -809,7 +816,7 @@ whose values are discarded.
        (args))
 {
   /* This function can GC */
-  REGISTER Lisp_Object val, form, tail;
+  REGISTER Lisp_Object val;
   struct gcpro gcpro1;
 
   Feval (XCAR (args));
@@ -819,8 +826,10 @@ whose values are discarded.
 
   GCPRO1 (val);
 
-  LIST_LOOP_3 (form, args, tail)
-    Feval (form);
+  {
+    LIST_LOOP_2 (form, args)
+      Feval (form);
+  }
 
   UNGCPRO;
   return val;
@@ -836,7 +845,6 @@ Each VALUEFORM can refer to the symbols already bound by this VARLIST.
        (args))
 {
   /* This function can GC */
-  Lisp_Object var, tail;
   Lisp_Object varlist = XCAR (args);
   Lisp_Object body    = XCDR (args);
   int speccount = specpdl_depth();
@@ -877,7 +885,6 @@ All the VALUEFORMs are evalled before any symbols are bound.
        (args))
 {
   /* This function can GC */
-  Lisp_Object var, tail;
   Lisp_Object varlist = XCAR (args);
   Lisp_Object body    = XCDR (args);
   int speccount = specpdl_depth();
@@ -897,36 +904,40 @@ All the VALUEFORMs are evalled before any symbols are bound.
   gcpro1.nvars = 0;
 
   idx = 0;
-  LIST_LOOP_3 (var, varlist, tail)
-    {
-      Lisp_Object *value = &temps[idx++];
-      if (SYMBOLP (var))
-       *value = Qnil;
-      else
-       {
-         Lisp_Object tem;
-         CHECK_CONS (var);
-         tem = XCDR (var);
-         if (NILP (tem))
-           *value = Qnil;
-         else
-           {
-             CHECK_CONS (tem);
-             *value = Feval (XCAR (tem));
-             gcpro1.nvars = idx;
+  {
+    LIST_LOOP_2 (var, varlist)
+      {
+       Lisp_Object *value = &temps[idx++];
+       if (SYMBOLP (var))
+         *value = Qnil;
+       else
+         {
+           Lisp_Object tem;
+           CHECK_CONS (var);
+           tem = XCDR (var);
+           if (NILP (tem))
+             *value = Qnil;
+           else
+             {
+               CHECK_CONS (tem);
+               *value = Feval (XCAR (tem));
+               gcpro1.nvars = idx;
 
-             if (!NILP (XCDR (tem)))
-               signal_simple_error
-                 ("`let' bindings can have only one value-form", var);
-           }
-       }
-    }
+               if (!NILP (XCDR (tem)))
+                 signal_simple_error
+                   ("`let' bindings can have only one value-form", var);
+             }
+         }
+      }
+  }
 
   idx = 0;
-  LIST_LOOP_3 (var, varlist, tail)
-    {
-      specbind (SYMBOLP (var) ? var : XCAR (var), temps[idx++]);
-    }
+  {
+    LIST_LOOP_2 (var, varlist)
+      {
+       specbind (SYMBOLP (var) ? var : XCAR (var), temps[idx++]);
+      }
+  }
 
   UNGCPRO;
 
@@ -1175,10 +1186,10 @@ If FORM is not a macro call, it is returned unchanged.
 Otherwise, the macro is expanded and the expansion is considered
 in place of FORM.  When a non-macro-call results, it is returned.
 
-The second optional arg ENVIRONMENT species an environment of macro
+The second optional arg ENVIRONMENT specifies an environment of macro
 definitions to shadow the loaded ones for use in file byte-compilation.
 */
-       (form, env))
+       (form, environment))
 {
   /* This function can GC */
   /* With cleanups from Hallvard Furuseth.  */
@@ -1199,7 +1210,7 @@ definitions to shadow the loaded ones for use in file byte-compilation.
        {
          QUIT;
          sym = def;
-         tem = Fassq (sym, env);
+         tem = Fassq (sym, environment);
          if (NILP (tem))
            {
              def = XSYMBOL (sym)->function;
@@ -1208,11 +1219,11 @@ definitions to shadow the loaded ones for use in file byte-compilation.
            }
          break;
        }
-      /* Right now TEM is the result from SYM in ENV,
+      /* Right now TEM is the result from SYM in ENVIRONMENT,
         and if TEM is nil then DEF is SYM's function definition.  */
       if (NILP (tem))
        {
-         /* SYM is not mentioned in ENV.
+         /* SYM is not mentioned in ENVIRONMENT.
             Look at its function definition.  */
          if (UNBOUNDP (def)
              || !CONSP (def))
@@ -1689,8 +1700,6 @@ Lisp_Object
 condition_case_3 (Lisp_Object bodyform, Lisp_Object var, Lisp_Object handlers)
 {
   /* This function can GC */
-  Lisp_Object handler;
-
   EXTERNAL_LIST_LOOP_2 (handler, handlers)
     {
       if (NILP (handler))
@@ -1703,7 +1712,6 @@ condition_case_3 (Lisp_Object bodyform, Lisp_Object var, Lisp_Object handlers)
            ;
          else
            {
-             Lisp_Object condition;
              EXTERNAL_LIST_LOOP_2 (condition, conditions)
                if (!SYMBOLP (condition))
                  goto invalid_condition_handler;
@@ -2247,6 +2255,267 @@ maybe_signal_continuable_error (Lisp_Object sig, Lisp_Object data,
 /****************** Error functions class 2 ******************/
 
 /* Class 2: Printf-like functions that signal an error.
+   These functions signal an error of a specified type, whose data
+   is a single string, created using the arguments. */
+
+/* dump an error message; called like printf */
+
+DOESNT_RETURN
+type_error (Lisp_Object type, const char *fmt, ...)
+{
+  Lisp_Object obj;
+  va_list args;
+
+  va_start (args, fmt);
+  obj = emacs_doprnt_string_va ((const Bufbyte *) GETTEXT (fmt), Qnil, -1,
+                               args);
+  va_end (args);
+
+  /* Fsignal GC-protects its args */
+  signal_error (type, list1 (obj));
+}
+
+void
+maybe_type_error (Lisp_Object type, Lisp_Object class, Error_behavior errb,
+                 const char *fmt, ...)
+{
+  Lisp_Object obj;
+  va_list args;
+
+  /* Optimization: */
+  if (ERRB_EQ (errb, ERROR_ME_NOT))
+    return;
+
+  va_start (args, fmt);
+  obj = emacs_doprnt_string_va ((const Bufbyte *) GETTEXT (fmt), Qnil, -1,
+                               args);
+  va_end (args);
+
+  /* Fsignal GC-protects its args */
+  maybe_signal_error (type, list1 (obj), class, errb);
+}
+
+Lisp_Object
+continuable_type_error (Lisp_Object type, const char *fmt, ...)
+{
+  Lisp_Object obj;
+  va_list args;
+
+  va_start (args, fmt);
+  obj = emacs_doprnt_string_va ((const Bufbyte *) GETTEXT (fmt), Qnil, -1,
+                               args);
+  va_end (args);
+
+  /* Fsignal GC-protects its args */
+  return Fsignal (type, list1 (obj));
+}
+
+Lisp_Object
+maybe_continuable_type_error (Lisp_Object type, Lisp_Object class,
+                             Error_behavior errb, const char *fmt, ...)
+{
+  Lisp_Object obj;
+  va_list args;
+
+  /* Optimization: */
+  if (ERRB_EQ (errb, ERROR_ME_NOT))
+    return Qnil;
+
+  va_start (args, fmt);
+  obj = emacs_doprnt_string_va ((const Bufbyte *) GETTEXT (fmt), Qnil, -1,
+                               args);
+  va_end (args);
+
+  /* Fsignal GC-protects its args */
+  return maybe_signal_continuable_error (type, list1 (obj), class, errb);
+}
+
+\f
+/****************** Error functions class 3 ******************/
+
+/* Class 3: Signal an error with a string and an associated object.
+   These functions signal an error of a specified type, whose data
+   is two objects, a string and a related Lisp object (usually the object
+   where the error is occurring). */
+
+DOESNT_RETURN
+signal_type_error (Lisp_Object type, const char *reason, Lisp_Object frob)
+{
+  if (UNBOUNDP (frob))
+    signal_error (type, list1 (build_translated_string (reason)));
+  else
+    signal_error (type, list2 (build_translated_string (reason), frob));
+}
+
+void
+maybe_signal_type_error (Lisp_Object type, const char *reason,
+                        Lisp_Object frob, Lisp_Object class,
+                        Error_behavior errb)
+{
+  /* Optimization: */
+  if (ERRB_EQ (errb, ERROR_ME_NOT))
+    return;
+  maybe_signal_error (type, list2 (build_translated_string (reason), frob),
+                                    class, errb);
+}
+
+Lisp_Object
+signal_type_continuable_error (Lisp_Object type, const char *reason,
+                              Lisp_Object frob)
+{
+  return Fsignal (type, list2 (build_translated_string (reason), frob));
+}
+
+Lisp_Object
+maybe_signal_type_continuable_error (Lisp_Object type, const char *reason,
+                                    Lisp_Object frob, Lisp_Object class,
+                                    Error_behavior errb)
+{
+  /* Optimization: */
+  if (ERRB_EQ (errb, ERROR_ME_NOT))
+    return Qnil;
+  return maybe_signal_continuable_error
+    (type, list2 (build_translated_string (reason),
+                   frob), class, errb);
+}
+
+\f
+/****************** Error functions class 4 ******************/
+
+/* Class 4: Printf-like functions that signal an error.
+   These functions signal an error of a specified type, whose data
+   is a two objects, a string (created using the arguments) and a
+   Lisp object.
+*/
+
+DOESNT_RETURN
+type_error_with_frob (Lisp_Object type, Lisp_Object frob, const char *fmt, ...)
+{
+  Lisp_Object obj;
+  va_list args;
+
+  va_start (args, fmt);
+  obj = emacs_doprnt_string_va ((const Bufbyte *) GETTEXT (fmt), Qnil, -1,
+                               args);
+  va_end (args);
+
+  /* Fsignal GC-protects its args */
+  signal_error (type, list2 (obj, frob));
+}
+
+void
+maybe_type_error_with_frob (Lisp_Object type, Lisp_Object frob,
+                           Lisp_Object class, Error_behavior errb,
+                           const char *fmt, ...)
+{
+  Lisp_Object obj;
+  va_list args;
+
+  /* Optimization: */
+  if (ERRB_EQ (errb, ERROR_ME_NOT))
+    return;
+
+  va_start (args, fmt);
+  obj = emacs_doprnt_string_va ((const Bufbyte *) GETTEXT (fmt), Qnil, -1,
+                               args);
+  va_end (args);
+
+  /* Fsignal GC-protects its args */
+  maybe_signal_error (type, list2 (obj, frob), class, errb);
+}
+
+Lisp_Object
+continuable_type_error_with_frob (Lisp_Object type, Lisp_Object frob,
+                                 const char *fmt, ...)
+{
+  Lisp_Object obj;
+  va_list args;
+
+  va_start (args, fmt);
+  obj = emacs_doprnt_string_va ((const Bufbyte *) GETTEXT (fmt), Qnil, -1,
+                               args);
+  va_end (args);
+
+  /* Fsignal GC-protects its args */
+  return Fsignal (type, list2 (obj, frob));
+}
+
+Lisp_Object
+maybe_continuable_type_error_with_frob (Lisp_Object type, Lisp_Object frob,
+                                       Lisp_Object class, Error_behavior errb,
+                                       const char *fmt, ...)
+{
+  Lisp_Object obj;
+  va_list args;
+
+  /* Optimization: */
+  if (ERRB_EQ (errb, ERROR_ME_NOT))
+    return Qnil;
+
+  va_start (args, fmt);
+  obj = emacs_doprnt_string_va ((const Bufbyte *) GETTEXT (fmt), Qnil, -1,
+                               args);
+  va_end (args);
+
+  /* Fsignal GC-protects its args */
+  return maybe_signal_continuable_error (type, list2 (obj, frob),
+                                        class, errb);
+}
+
+\f
+/****************** Error functions class 5 ******************/
+
+/* Class 5: Signal an error with a string and two associated objects.
+   These functions signal an error of a specified type, whose data
+   is three objects, a string and two related Lisp objects. */
+
+DOESNT_RETURN
+signal_type_error_2 (Lisp_Object type, const char *reason,
+                    Lisp_Object frob0, Lisp_Object frob1)
+{
+  signal_error (type, list3 (build_translated_string (reason), frob0,
+                              frob1));
+}
+
+void
+maybe_signal_type_error_2 (Lisp_Object type, const char *reason,
+                          Lisp_Object frob0, Lisp_Object frob1,
+                          Lisp_Object class, Error_behavior errb)
+{
+  /* Optimization: */
+  if (ERRB_EQ (errb, ERROR_ME_NOT))
+    return;
+  maybe_signal_error (type, list3 (build_translated_string (reason), frob0,
+                                    frob1), class, errb);
+}
+
+
+Lisp_Object
+signal_type_continuable_error_2 (Lisp_Object type, const char *reason,
+                                Lisp_Object frob0, Lisp_Object frob1)
+{
+  return Fsignal (type, list3 (build_translated_string (reason), frob0,
+                                frob1));
+}
+
+Lisp_Object
+maybe_signal_type_continuable_error_2 (Lisp_Object type, const char *reason,
+                                      Lisp_Object frob0, Lisp_Object frob1,
+                                      Lisp_Object class, Error_behavior errb)
+{
+  /* Optimization: */
+  if (ERRB_EQ (errb, ERROR_ME_NOT))
+    return Qnil;
+  return maybe_signal_continuable_error
+    (type, list3 (build_translated_string (reason), frob0,
+                   frob1),
+     class, errb);
+}
+
+\f
+/****************** Simple error functions class 2 ******************/
+
+/* Simple class 2: Printf-like functions that signal an error.
    These functions signal an error of type Qerror, whose data
    is a single string, created using the arguments. */
 
@@ -2322,9 +2591,9 @@ maybe_continuable_error (Lisp_Object class, Error_behavior errb,
 }
 
 \f
-/****************** Error functions class 3 ******************/
+/****************** Simple error functions class 3 ******************/
 
-/* Class 3: Signal an error with a string and an associated object.
+/* Simple class 3: Signal an error with a string and an associated object.
    These functions signal an error of type Qerror, whose data
    is two objects, a string and a related Lisp object (usually the object
    where the error is occurring). */
@@ -2365,9 +2634,9 @@ maybe_signal_simple_continuable_error (const char *reason, Lisp_Object frob,
 }
 
 \f
-/****************** Error functions class 4 ******************/
+/****************** Simple error functions class 4 ******************/
 
-/* Class 4: Printf-like functions that signal an error.
+/* Simple class 4: Printf-like functions that signal an error.
    These functions signal an error of type Qerror, whose data
    is a two objects, a string (created using the arguments) and a
    Lisp object.
@@ -2445,9 +2714,9 @@ maybe_continuable_error_with_frob (Lisp_Object frob, Lisp_Object class,
 }
 
 \f
-/****************** Error functions class 5 ******************/
+/****************** Simple error functions class 5 ******************/
 
-/* Class 5: Signal an error with a string and two associated objects.
+/* Simple class 5: Signal an error with a string and two associated objects.
    These functions signal an error of type Qerror, whose data
    is three objects, a string and two related Lisp objects. */
 
@@ -2552,6 +2821,55 @@ signal_circular_property_list_error (Lisp_Object list)
 {
   signal_error (Qcircular_property_list, list1 (list));
 }
+
+DOESNT_RETURN
+syntax_error (const char *reason, Lisp_Object frob)
+{
+  signal_type_error (Qsyntax_error, reason, frob);
+}
+
+DOESNT_RETURN
+syntax_error_2 (const char *reason, Lisp_Object frob1, Lisp_Object frob2)
+{
+  signal_type_error_2 (Qsyntax_error, reason, frob1, frob2);
+}
+
+DOESNT_RETURN
+invalid_argument (const char *reason, Lisp_Object frob)
+{
+  signal_type_error (Qinvalid_argument, reason, frob);
+}
+
+DOESNT_RETURN
+invalid_argument_2 (const char *reason, Lisp_Object frob1, Lisp_Object frob2)
+{
+  signal_type_error_2 (Qinvalid_argument, reason, frob1, frob2);
+}
+
+DOESNT_RETURN
+invalid_operation (const char *reason, Lisp_Object frob)
+{
+  signal_type_error (Qinvalid_operation, reason, frob);
+}
+
+DOESNT_RETURN
+invalid_operation_2 (const char *reason, Lisp_Object frob1, Lisp_Object frob2)
+{
+  signal_type_error_2 (Qinvalid_operation, reason, frob1, frob2);
+}
+
+DOESNT_RETURN
+invalid_change (const char *reason, Lisp_Object frob)
+{
+  signal_type_error (Qinvalid_change, reason, frob);
+}
+
+DOESNT_RETURN
+invalid_change_2 (const char *reason, Lisp_Object frob1, Lisp_Object frob2)
+{
+  signal_type_error_2 (Qinvalid_change, reason, frob1, frob2);
+}
+
 \f
 /************************************************************************/
 /*                           User commands                             */
@@ -2996,7 +3314,6 @@ Evaluate FORM and return its value.
          gcpro1.nvars = 0;
 
          {
-           REGISTER Lisp_Object arg;
            LIST_LOOP_2 (arg, original_args)
              {
                *p++ = Feval (arg);
@@ -3026,7 +3343,6 @@ Evaluate FORM and return its value.
          gcpro1.nvars = 0;
 
          {
-           REGISTER Lisp_Object arg;
            LIST_LOOP_2 (arg, original_args)
              {
                *p++ = Feval (arg);
@@ -3058,7 +3374,6 @@ Evaluate FORM and return its value.
       gcpro1.nvars = 0;
 
       {
-       REGISTER Lisp_Object arg;
        LIST_LOOP_2 (arg, original_args)
          {
            *p++ = Feval (arg);
@@ -3103,7 +3418,6 @@ Evaluate FORM and return its value.
          gcpro1.nvars = 0;
 
          {
-           REGISTER Lisp_Object arg;
            LIST_LOOP_2 (arg, original_args)
              {
                *p++ = Feval (arg);
@@ -3336,7 +3650,12 @@ function_argcount (Lisp_Object function, int function_min_args_p)
        }
       else if (EQ (funcar, Qautoload))
        {
+         struct gcpro gcpro1;
+
+         GCPRO1 (function);
          do_autoload (function, orig_function);
+         UNGCPRO;
+         function = orig_function;
          goto retry;
        }
       else if (EQ (funcar, Qlambda))
@@ -3351,12 +3670,11 @@ function_argcount (Lisp_Object function, int function_min_args_p)
   else
     {
     invalid_function:
-      return signal_invalid_function_error (function);
+      return signal_invalid_function_error (orig_function);
     }
 
   {
     int argcount = 0;
-    Lisp_Object arg;
 
     EXTERNAL_LIST_LOOP_2 (arg, arglist)
       {
@@ -3495,7 +3813,7 @@ static Lisp_Object
 funcall_lambda (Lisp_Object fun, int nargs, Lisp_Object args[])
 {
   /* This function can GC */
-  Lisp_Object symbol, arglist, body, tail;
+  Lisp_Object arglist, body, tail;
   int speccount = specpdl_depth();
   REGISTER int i = 0;
 
@@ -3510,7 +3828,7 @@ funcall_lambda (Lisp_Object fun, int nargs, Lisp_Object args[])
   {
     int optional = 0, rest = 0;
 
-    EXTERNAL_LIST_LOOP_3 (symbol, arglist, tail)
+    EXTERNAL_LIST_LOOP_2 (symbol, arglist)
       {
        if (!SYMBOLP (symbol))
          goto invalid_function;
@@ -5097,7 +5415,7 @@ reinit_vars_of_eval (void)
   specpdl = xnew_array (struct specbinding, specpdl_size);
   /* XEmacs change: increase these values. */
   max_specpdl_size = 3000;
-  max_lisp_eval_depth = 500;
+  max_lisp_eval_depth = 1000;
 #ifdef DEFEND_AGAINST_THROW_RECURSION
   throw_level = 0;
 #endif
index b9e83bd..d597719 100644 (file)
@@ -87,7 +87,7 @@ XtAppContext Xt_app_con;
 int x_allow_sendevents;
 
 #ifdef DEBUG_XEMACS
-int x_debug_events;
+int debug_x_events;
 #endif
 
 static int process_events_occurred;
@@ -944,7 +944,11 @@ x_to_emacs_keysym (XKeyPressedEvent *event, int simple_p)
 
 #ifdef HAVE_XIM
   int len;
-  char buffer[64];
+  /* Some implementations of XmbLookupString don't return
+     XBufferOverflow correctly, so increase the size of the xim input
+     buffer from 64 to the more reasonable size 513, as Emacs has done.
+     From Kenichi Handa. */
+  char buffer[513];
   char *bufptr = buffer;
   int   bufsiz = sizeof (buffer);
   Status status;
@@ -982,7 +986,7 @@ x_to_emacs_keysym (XKeyPressedEvent *event, int simple_p)
 #endif /* HAVE_XIM */
 
 #ifdef DEBUG_XEMACS
-  if (x_debug_events > 0)
+  if (debug_x_events > 0)
     {
       stderr_out ("   status=");
 #define print_status_when(S) if (status == S) stderr_out (#S)
@@ -1143,6 +1147,25 @@ x_event_to_emacs_event (XEvent *x_event, Lisp_Event *emacs_event)
        if (*state & xd->SuperMask)  modifiers |= XEMACS_MOD_SUPER;
        if (*state & xd->HyperMask)  modifiers |= XEMACS_MOD_HYPER;
        if (*state & xd->AltMask)    modifiers |= XEMACS_MOD_ALT;
+       {
+         int numero_de_botao = -1;
+
+         if (!key_event_p)
+           numero_de_botao = x_event->xbutton.button;
+
+         /* the button gets noted either in the button or the modifiers
+            field, but not both. */
+         if (numero_de_botao != 1 && (*state & Button1Mask))
+           modifiers |= XEMACS_MOD_BUTTON1;
+         if (numero_de_botao != 2 && (*state & Button2Mask))
+           modifiers |= XEMACS_MOD_BUTTON2;
+         if (numero_de_botao != 3 && (*state & Button3Mask))
+           modifiers |= XEMACS_MOD_BUTTON3;
+         if (numero_de_botao != 4 && (*state & Button4Mask))
+           modifiers |= XEMACS_MOD_BUTTON4;
+         if (numero_de_botao != 5 && (*state & Button5Mask))
+           modifiers |= XEMACS_MOD_BUTTON5;
+       }
 
        /* Ignore the Caps_Lock key if:
           - any other modifiers are down, so that Caps_Lock doesn't
@@ -1277,6 +1300,11 @@ x_event_to_emacs_event (XEvent *x_event, Lisp_Event *emacs_event)
         if (ev->state & xd->SuperMask) modifiers |= XEMACS_MOD_SUPER;
         if (ev->state & xd->HyperMask) modifiers |= XEMACS_MOD_HYPER;
         if (ev->state & xd->AltMask)   modifiers |= XEMACS_MOD_ALT;
+        if (ev->state & Button1Mask)   modifiers |= XEMACS_MOD_BUTTON1;
+        if (ev->state & Button2Mask)   modifiers |= XEMACS_MOD_BUTTON2;
+        if (ev->state & Button3Mask)   modifiers |= XEMACS_MOD_BUTTON3;
+        if (ev->state & Button4Mask)   modifiers |= XEMACS_MOD_BUTTON4;
+        if (ev->state & Button5Mask)   modifiers |= XEMACS_MOD_BUTTON5;
         /* Currently ignores Shift_Lock but probably shouldn't
            (but it definitely should ignore Caps_Lock). */
         emacs_event->event.motion.modifiers = modifiers;
@@ -1319,6 +1347,11 @@ x_event_to_emacs_event (XEvent *x_event, Lisp_Event *emacs_event)
            if (state & xd->SuperMask)  modifiers |= XEMACS_MOD_SUPER;
            if (state & xd->HyperMask)  modifiers |= XEMACS_MOD_HYPER;
            if (state & xd->AltMask)    modifiers |= XEMACS_MOD_ALT;
+           if (state & Button1Mask)    modifiers |= XEMACS_MOD_BUTTON1;
+           if (state & Button2Mask)    modifiers |= XEMACS_MOD_BUTTON2;
+           if (state & Button3Mask)    modifiers |= XEMACS_MOD_BUTTON3;
+           if (state & Button4Mask)    modifiers |= XEMACS_MOD_BUTTON4;
+           if (state & Button5Mask)    modifiers |= XEMACS_MOD_BUTTON5;
 
            if (state & Button5Mask)    button = Button5;
            if (state & Button4Mask)    button = Button4;
@@ -1507,7 +1540,7 @@ handle_focus_event_1 (struct frame *f, int in_p)
      do this in their selection callback, but we don't want that since
      a button having focus is legitimate. An edit field having focus
      is mandatory. Weirdly you get a FocusOut event when you click in
-     a widget-glyph but you don't get a correspondng FocusIn when you
+     a widget-glyph but you don't get a corresponding FocusIn when you
      click in the frame. Why is this?  */
   if (in_p
 #if XtSpecificationRelease > 5
@@ -2402,7 +2435,7 @@ describe_event (XEvent *event)
     break;
 
     case Expose:
-      if (x_debug_events > 1)
+      if (debug_x_events > 1)
        {
          XExposeEvent *ev = &event->xexpose;
          describe_event_window (ev->window, ev->display);
@@ -2415,7 +2448,7 @@ describe_event (XEvent *event)
       break;
 
     case GraphicsExpose:
-      if (x_debug_events > 1)
+      if (debug_x_events > 1)
        {
          XGraphicsExposeEvent *ev = &event->xgraphicsexpose;
          describe_event_window (ev->drawable, ev->display);
@@ -2432,7 +2465,7 @@ describe_event (XEvent *event)
 
     case EnterNotify:
     case LeaveNotify:
-      if (x_debug_events > 1)
+      if (debug_x_events > 1)
        {
          XCrossingEvent *ev = &event->xcrossing;
          describe_event_window (ev->window, ev->display);
@@ -2453,7 +2486,7 @@ describe_event (XEvent *event)
       break;
 
     case ConfigureNotify:
-      if (x_debug_events > 1)
+      if (debug_x_events > 1)
        {
          XConfigureEvent *ev = &event->xconfigure;
          describe_event_window (ev->window, ev->display);
@@ -2467,7 +2500,7 @@ describe_event (XEvent *event)
       break;
 
     case VisibilityNotify:
-      if (x_debug_events > 1)
+      if (debug_x_events > 1)
        {
          XVisibilityEvent *ev = &event->xvisibility;
          describe_event_window (ev->window, ev->display);
@@ -2630,7 +2663,7 @@ emacs_Xt_event_handler (Widget wid /* unused */,
   Lisp_Object emacs_event = Fmake_event (Qnil, Qnil);
 
 #ifdef DEBUG_XEMACS
-  if (x_debug_events > 0)
+  if (debug_x_events > 0)
     {
       describe_event (event);
     }
@@ -2914,6 +2947,21 @@ emacs_Xt_event_pending_p (int user_p)
   return 0;
 }
 
+static int
+emacs_Xt_current_event_timestamp (struct console *c)
+{
+  /* semi-yuck. */
+  Lisp_Object devs = CONSOLE_DEVICE_LIST (c);
+
+  if (NILP (devs))
+    return 0;
+  else
+    {
+      struct device *d = XDEVICE (XCAR (devs));
+      return DEVICE_X_LAST_SERVER_TIMESTAMP (d);
+    }
+}
+
 \f
 /************************************************************************/
 /*            replacement for standard string-to-pixel converter        */
@@ -3011,9 +3059,9 @@ Boolean EmacsXtCvtStringToPixel (
   if ((d = get_device_from_display_1(dpy))) {
     visual = DEVICE_X_VISUAL(d);
     if (colormap != DEVICE_X_COLORMAP(d)) {
-      XtAppWarningMsg(the_app_con, "wierdColormap", "cvtStringToPixel",
+      XtAppWarningMsg(the_app_con, "weirdColormap", "cvtStringToPixel",
                      "XtToolkitWarning",
-                     "The colormap passed to cvtStringToPixel doesn't match the one registerd to the device.\n",
+                     "The colormap passed to cvtStringToPixel doesn't match the one registered to the device.\n",
                      NULL, 0);
       status = XAllocNamedColor(dpy, colormap, (char*)str, &screenColor, &exactColor);
     } else {
@@ -3139,6 +3187,8 @@ reinit_vars_of_event_Xt (void)
   Xt_event_stream->quit_p_cb            = emacs_Xt_quit_p;
   Xt_event_stream->create_stream_pair_cb = emacs_Xt_create_stream_pair;
   Xt_event_stream->delete_stream_pair_cb = emacs_Xt_delete_stream_pair;
+  Xt_event_stream->current_event_timestamp_cb =
+    emacs_Xt_current_event_timestamp;
 
   the_Xt_timeout_blocktype = Blocktype_new (struct Xt_timeout_blocktype);
 
@@ -3165,14 +3215,14 @@ Beware: allowing emacs to process SendEvents opens a big security hole.
   x_allow_sendevents = 0;
 
 #ifdef DEBUG_XEMACS
-  DEFVAR_INT ("x-debug-events", &x_debug_events /*
+  DEFVAR_INT ("debug-x-events", &debug_x_events /*
 If non-zero, display debug information about X events that XEmacs sees.
 Information is displayed on stderr.  Currently defined values are:
 
 1 == non-verbose output
 2 == verbose output
 */ );
-  x_debug_events = 0;
+  debug_x_events = 0;
 #endif
 }
 
@@ -3215,7 +3265,7 @@ init_event_Xt_late (void) /* called when already initialized */
   Xt_app_con = XtCreateApplicationContext ();
   XtAppSetFallbackResources (Xt_app_con, (String *) x_fallback_resources);
 
-  /* In xselect.c */
+  /* In select-x.c */
   x_selection_timeout = (XtAppGetSelectionTimeout (Xt_app_con) / 1000);
   XSetErrorHandler (x_error_handler);
   XSetIOErrorHandler (x_IO_error_handler);
index 8f8ecf6..2dfb2fe 100644 (file)
@@ -96,7 +96,8 @@ static Lisp_Object mswindows_find_frame (HWND hwnd);
 static Lisp_Object mswindows_find_console (HWND hwnd);
 static Lisp_Object mswindows_key_to_emacs_keysym (int mswindows_key, int mods,
                                                  int extendedp);
-static int mswindows_modifier_state (BYTE* keymap, int has_AltGr);
+static int mswindows_modifier_state (BYTE* keymap, DWORD fwKeys,
+                                    int has_AltGr);
 static void mswindows_set_chord_timer (HWND hwnd);
 static int mswindows_button2_near_enough (POINTS p1, POINTS p2);
 static int mswindows_current_layout_has_AltGr (void);
@@ -151,7 +152,7 @@ int mswindows_mouse_button_max_skew_y;
 int mswindows_mouse_button_tolerance;
 
 #ifdef DEBUG_XEMACS
-int mswindows_debug_events;
+int debug_mswindows_events;
 #endif
 
 /* This is the event signaled by the event pump.
@@ -161,6 +162,8 @@ static int mswindows_in_modal_loop;
 
 /* Count of wound timers */
 static int mswindows_pending_timers_count;
+
+static DWORD mswindows_last_mouse_button_state;
 \f
 /************************************************************************/
 /*                Pipe instream - reads process output                  */
@@ -600,7 +603,8 @@ ntpipe_shove_writer (Lstream *stream, const unsigned char *data, size_t size)
   SetEvent (s->hev_thread);
   /* Give it a chance to run -- this dramatically improves performance
      of things like crypt. */
-  (void) SwitchToThread ();
+  if (xSwitchToThread) /* not in Win9x or NT 3.51 */
+    (void) xSwitchToThread ();
   return size;
 }
 
@@ -959,7 +963,7 @@ mswindows_enqueue_process_event (Lisp_Process* p)
 
 static void
 mswindows_enqueue_mouse_button_event (HWND hwnd, UINT msg, POINTS where,
-                                     DWORD when)
+                                     int mods, DWORD when)
 {
   int downp = (msg == WM_LBUTTONDOWN || msg == WM_MBUTTONDOWN ||
               msg == WM_RBUTTONDOWN);
@@ -979,7 +983,7 @@ mswindows_enqueue_mouse_button_event (HWND hwnd, UINT msg, POINTS where,
     ((msg==WM_RBUTTONDOWN || msg==WM_RBUTTONUP) ? 3 : 2);
   event->event.button.x = where.x;
   event->event.button.y = where.y;
-  event->event.button.modifiers = mswindows_modifier_state (NULL, 0);
+  event->event.button.modifiers = mswindows_modifier_state (NULL, mods, 0);
 
   if (downp)
     {
@@ -1270,6 +1274,14 @@ mswindows_drain_windows_queue (void)
 
   while (PeekMessage (&msg, NULL, 0, 0, PM_REMOVE))
     {
+      char class_name_buf [sizeof (XEMACS_CLASS) + 2] = "";
+
+      if (mswindows_is_dialog_msg (&msg))
+       {
+         mswindows_unmodalize_signal_maybe ();
+         continue;
+       }
+
       /* We have to translate messages that are not sent to an XEmacs
          frame. This is so that key presses work ok in things like
          edit fields. However, we *musn't* translate message for XEmacs
@@ -1279,7 +1291,7 @@ mswindows_drain_windows_queue (void)
       /* GetClassName will truncate a longer class name. By adding one
         extra character, we are forcing textual comparison to fail
         if the name is longer than XEMACS_CLASS */
-      char class_name_buf [sizeof (XEMACS_CLASS) + 2] = "";
+
       GetClassName (msg.hwnd, class_name_buf, sizeof (class_name_buf) - 1);
       if (stricmp (class_name_buf, XEMACS_CLASS) != 0)
        {
@@ -1289,7 +1301,7 @@ mswindows_drain_windows_queue (void)
       else if (msg.message == WM_PAINT)
        {
          struct mswindows_frame* msframe;
-         
+
          /* hdc will be NULL unless this is a subwindow - in which case we
             shouldn't have received a paint message for it here. */
          assert (msg.wParam == 0);
@@ -1400,7 +1412,7 @@ mswindows_need_event (int badly_p)
            {
              mswindows_drain_windows_queue ();
            }
-         else 
+         else
            {
 #ifdef HAVE_TTY
              /* Look for a TTY event */
@@ -1414,7 +1426,7 @@ mswindows_need_event (int badly_p)
                      struct console *c = tty_find_console_from_fd (i);
                      Lisp_Object emacs_event = Fmake_event (Qnil, Qnil);
                      Lisp_Event* event = XEVENT (emacs_event);
-                     
+
                      assert (c);
                      if (read_event_from_tty_or_stream_desc (event, c, i))
                        {
@@ -1433,7 +1445,7 @@ mswindows_need_event (int badly_p)
                        {
                          Lisp_Process *p =
                            get_process_from_usid (FD_TO_USID(i));
-                         
+
                          mswindows_enqueue_process_event (p);
                        }
                      else
@@ -1709,7 +1721,7 @@ mswindows_handle_paint (struct frame *frame)
 }
 
 /*
- * Returns 1 if a key is a real modifier or special key, which 
+ * Returns 1 if a key is a real modifier or special key, which
  * is better handled by DefWindowProc
  */
 static int
@@ -1993,7 +2005,7 @@ output_alt_keyboard_state (void)
 /*           asyncstate[2] & 0x1 ? 1 : 0); */
 }
 
-#endif /* DEBUG_XEMACS */  
+#endif /* DEBUG_XEMACS */
 
 
 /*
@@ -2011,6 +2023,11 @@ mswindows_wnd_proc (HWND hwnd, UINT message_, WPARAM wParam, LPARAM lParam)
   struct frame *frame;
   struct mswindows_frame* msframe;
 
+  /* Not perfect but avoids crashes. There is potential for wierd
+     behavior here. */
+  if (gc_in_progress)
+    goto defproc;
+
   assert (!GetWindowLong (hwnd, GWL_USERDATA));
   switch (message_)
     {
@@ -2045,14 +2062,14 @@ mswindows_wnd_proc (HWND hwnd, UINT message_, WPARAM wParam, LPARAM lParam)
        int should_set_keymap = 0;
 
 #ifdef DEBUG_XEMACS
-       if (mswindows_debug_events)
+       if (debug_mswindows_events)
          {
            stderr_out ("%s wparam=%d lparam=%d\n",
                        message_ == WM_KEYUP ? "WM_KEYUP" : "WM_SYSKEYUP",
                        wParam, (int)lParam);
            output_alt_keyboard_state ();
-         }         
-#endif /* DEBUG_XEMACS */  
+         }
+#endif /* DEBUG_XEMACS */
 
        mswindows_handle_sticky_modifiers (wParam, lParam, 0, 1);
        if (wParam == VK_CONTROL)
@@ -2074,7 +2091,7 @@ mswindows_wnd_proc (HWND hwnd, UINT message_, WPARAM wParam, LPARAM lParam)
          SetKeyboardState (keymap);
 
       }
-      
+
       if (key_needs_default_processing_p (wParam))
        goto defproc;
       else
@@ -2084,7 +2101,7 @@ mswindows_wnd_proc (HWND hwnd, UINT message_, WPARAM wParam, LPARAM lParam)
     case WM_SYSKEYDOWN:
 
       /* In some locales the right-hand Alt key is labelled AltGr. This key
-       * should produce alternative charcaters when combined with another key.
+       * should produce alternative characters when combined with another key.
        * eg on a German keyboard pressing AltGr+q should produce '@'.
        * AltGr generates exactly the same keystrokes as LCtrl+RAlt. But if
        * TranslateMessage() is called with *any* combination of Ctrl+Alt down,
@@ -2102,14 +2119,14 @@ mswindows_wnd_proc (HWND hwnd, UINT message_, WPARAM wParam, LPARAM lParam)
        int sticky_changed;
 
 #ifdef DEBUG_XEMACS
-       if (mswindows_debug_events)
+       if (debug_mswindows_events)
          {
            stderr_out ("%s wparam=%d lparam=%d\n",
                        message_ == WM_KEYDOWN ? "WM_KEYDOWN" : "WM_SYSKEYDOWN",
                        wParam, (int)lParam);
            output_alt_keyboard_state ();
-         }         
-#endif /* DEBUG_XEMACS */  
+         }
+#endif /* DEBUG_XEMACS */
 
        GetKeyboardState (keymap_orig);
        frame = XFRAME (mswindows_find_frame (hwnd));
@@ -2130,7 +2147,7 @@ mswindows_wnd_proc (HWND hwnd, UINT message_, WPARAM wParam, LPARAM lParam)
        else
          memcpy (keymap_sticky, keymap_orig, 256);
 
-       mods = mswindows_modifier_state (keymap_sticky, has_AltGr);
+       mods = mswindows_modifier_state (keymap_sticky, (DWORD) -1, has_AltGr);
 
        /* Handle non-printables */
        if (!NILP (keysym = mswindows_key_to_emacs_keysym (wParam, mods,
@@ -2148,7 +2165,7 @@ mswindows_wnd_proc (HWND hwnd, UINT message_, WPARAM wParam, LPARAM lParam)
            MSG msg, tranmsg;
            int potential_accelerator = 0;
            int got_accelerator = 0;
-         
+
            msg.hwnd = hwnd;
            msg.message = message_;
            msg.wParam = wParam;
@@ -2229,7 +2246,7 @@ mswindows_wnd_proc (HWND hwnd, UINT message_, WPARAM wParam, LPARAM lParam)
            /* This generates WM_SYSCHAR messages, which are interpreted
               by DefWindowProc as the menu selections. */
            if (got_accelerator)
-             { 
+             {
                SetKeyboardState (keymap_sticky);
                TranslateMessage (&msg);
                SetKeyboardState (keymap_orig);
@@ -2251,7 +2268,9 @@ mswindows_wnd_proc (HWND hwnd, UINT message_, WPARAM wParam, LPARAM lParam)
         if one wants to exercise fingers playing chords on the mouse,
         he is allowed to do that! */
       mswindows_enqueue_mouse_button_event (hwnd, message_,
-                                           MAKEPOINTS (lParam), GetMessageTime());
+                                           MAKEPOINTS (lParam),
+                                           wParam &~ MK_MBUTTON,
+                                           GetMessageTime());
       break;
 
     case WM_LBUTTONUP:
@@ -2269,7 +2288,11 @@ mswindows_wnd_proc (HWND hwnd, UINT message_, WPARAM wParam, LPARAM lParam)
          msframe->button2_is_down = 0;
          msframe->ignore_next_rbutton_up = 1;
          mswindows_enqueue_mouse_button_event (hwnd, WM_MBUTTONUP,
-                                               MAKEPOINTS (lParam), GetMessageTime());
+                                               MAKEPOINTS (lParam),
+                                               wParam
+                                               &~ (MK_LBUTTON | MK_MBUTTON
+                                                   | MK_RBUTTON),
+                                               GetMessageTime());
        }
       else
        {
@@ -2277,10 +2300,14 @@ mswindows_wnd_proc (HWND hwnd, UINT message_, WPARAM wParam, LPARAM lParam)
            {
              msframe->button2_need_rbutton = 0;
              mswindows_enqueue_mouse_button_event (hwnd, WM_LBUTTONDOWN,
-                                                   MAKEPOINTS (lParam), GetMessageTime());
+                                                   MAKEPOINTS (lParam),
+                                                   wParam &~ MK_LBUTTON,
+                                                   GetMessageTime());
            }
          mswindows_enqueue_mouse_button_event (hwnd, WM_LBUTTONUP,
-                                               MAKEPOINTS (lParam), GetMessageTime());
+                                               MAKEPOINTS (lParam),
+                                               wParam &~ MK_LBUTTON,
+                                               GetMessageTime());
        }
       break;
 
@@ -2299,7 +2326,11 @@ mswindows_wnd_proc (HWND hwnd, UINT message_, WPARAM wParam, LPARAM lParam)
          msframe->button2_is_down = 0;
          msframe->ignore_next_lbutton_up = 1;
          mswindows_enqueue_mouse_button_event (hwnd, WM_MBUTTONUP,
-                                               MAKEPOINTS (lParam), GetMessageTime());
+                                               MAKEPOINTS (lParam),
+                                               wParam
+                                               &~ (MK_LBUTTON | MK_MBUTTON
+                                                   | MK_RBUTTON),
+                                               GetMessageTime());
        }
       else
        {
@@ -2307,10 +2338,14 @@ mswindows_wnd_proc (HWND hwnd, UINT message_, WPARAM wParam, LPARAM lParam)
            {
              msframe->button2_need_lbutton = 0;
              mswindows_enqueue_mouse_button_event (hwnd, WM_RBUTTONDOWN,
-                                                   MAKEPOINTS (lParam), GetMessageTime());
+                                                   MAKEPOINTS (lParam),
+                                                   wParam &~ MK_RBUTTON,
+                                                   GetMessageTime());
            }
          mswindows_enqueue_mouse_button_event (hwnd, WM_RBUTTONUP,
-                                               MAKEPOINTS (lParam), GetMessageTime());
+                                               MAKEPOINTS (lParam),
+                                               wParam &~ MK_RBUTTON,
+                                               GetMessageTime());
        }
       break;
 
@@ -2322,18 +2357,28 @@ mswindows_wnd_proc (HWND hwnd, UINT message_, WPARAM wParam, LPARAM lParam)
          KillTimer (hwnd, BUTTON_2_TIMER_ID);
          msframe->button2_need_lbutton = 0;
          msframe->button2_need_rbutton = 0;
-         if (mswindows_button2_near_enough (msframe->last_click_point, MAKEPOINTS (lParam)))
+         if (mswindows_button2_near_enough (msframe->last_click_point,
+                                            MAKEPOINTS (lParam)))
            {
              mswindows_enqueue_mouse_button_event (hwnd, WM_MBUTTONDOWN,
-                                                   MAKEPOINTS (lParam), GetMessageTime());
+                                                   MAKEPOINTS (lParam),
+                                                   wParam
+                                                   &~ (MK_LBUTTON | MK_MBUTTON
+                                                       | MK_RBUTTON),
+                                                   GetMessageTime());
              msframe->button2_is_down = 1;
            }
          else
            {
              mswindows_enqueue_mouse_button_event (hwnd, WM_RBUTTONDOWN,
-                                                   msframe->last_click_point, msframe->last_click_time);
+                                                   msframe->last_click_point,
+                                                   msframe->last_click_mods
+                                                   &~ MK_RBUTTON,
+                                                   msframe->last_click_time);
              mswindows_enqueue_mouse_button_event (hwnd, WM_LBUTTONDOWN,
-                                                   MAKEPOINTS (lParam), GetMessageTime());
+                                                   MAKEPOINTS (lParam),
+                                                   wParam &~ MK_LBUTTON,
+                                                   GetMessageTime());
            }
        }
       else
@@ -2341,6 +2386,7 @@ mswindows_wnd_proc (HWND hwnd, UINT message_, WPARAM wParam, LPARAM lParam)
          mswindows_set_chord_timer (hwnd);
          msframe->button2_need_rbutton = 1;
          msframe->last_click_point = MAKEPOINTS (lParam);
+         msframe->last_click_mods = wParam;
        }
       msframe->last_click_time =  GetMessageTime();
       break;
@@ -2353,18 +2399,28 @@ mswindows_wnd_proc (HWND hwnd, UINT message_, WPARAM wParam, LPARAM lParam)
          KillTimer (hwnd, BUTTON_2_TIMER_ID);
          msframe->button2_need_lbutton = 0;
          msframe->button2_need_rbutton = 0;
-         if (mswindows_button2_near_enough (msframe->last_click_point, MAKEPOINTS (lParam)))
+         if (mswindows_button2_near_enough (msframe->last_click_point,
+                                            MAKEPOINTS (lParam)))
            {
              mswindows_enqueue_mouse_button_event (hwnd, WM_MBUTTONDOWN,
-                                                   MAKEPOINTS (lParam), GetMessageTime());
+                                                   MAKEPOINTS (lParam),
+                                                   wParam
+                                                   &~ (MK_LBUTTON | MK_MBUTTON
+                                                       | MK_RBUTTON),
+                                                   GetMessageTime());
              msframe->button2_is_down = 1;
            }
          else
            {
              mswindows_enqueue_mouse_button_event (hwnd, WM_LBUTTONDOWN,
-                                                   msframe->last_click_point, msframe->last_click_time);
+                                                   msframe->last_click_point,
+                                                   msframe->last_click_mods
+                                                   &~ MK_LBUTTON,
+                                                   msframe->last_click_time);
              mswindows_enqueue_mouse_button_event (hwnd, WM_RBUTTONDOWN,
-                                                   MAKEPOINTS (lParam), GetMessageTime());
+                                                   MAKEPOINTS (lParam),
+                                                   wParam &~ MK_RBUTTON,
+                                                   GetMessageTime());
            }
        }
       else
@@ -2372,6 +2428,7 @@ mswindows_wnd_proc (HWND hwnd, UINT message_, WPARAM wParam, LPARAM lParam)
          mswindows_set_chord_timer (hwnd);
          msframe->button2_need_lbutton = 1;
          msframe->last_click_point = MAKEPOINTS (lParam);
+         msframe->last_click_mods = wParam;
        }
       msframe->last_click_time =  GetMessageTime();
       break;
@@ -2386,13 +2443,19 @@ mswindows_wnd_proc (HWND hwnd, UINT message_, WPARAM wParam, LPARAM lParam)
            {
              msframe->button2_need_lbutton = 0;
              mswindows_enqueue_mouse_button_event (hwnd, WM_RBUTTONDOWN,
-                                                   msframe->last_click_point, msframe->last_click_time);
+                                                   msframe->last_click_point,
+                                                   msframe->last_click_mods
+                                                   &~ MK_RBUTTON,
+                                                   msframe->last_click_time);
            }
          else if (msframe->button2_need_rbutton)
            {
              msframe->button2_need_rbutton = 0;
              mswindows_enqueue_mouse_button_event (hwnd, WM_LBUTTONDOWN,
-                                                   msframe->last_click_point, msframe->last_click_time);
+                                                   msframe->last_click_point,
+                                                   msframe->last_click_mods
+                                                   &~ MK_LBUTTON,
+                                                   msframe->last_click_time);
            }
        }
       else
@@ -2423,7 +2486,8 @@ mswindows_wnd_proc (HWND hwnd, UINT message_, WPARAM wParam, LPARAM lParam)
          event->event_type = pointer_motion_event;
          event->event.motion.x = MAKEPOINTS(lParam).x;
          event->event.motion.y = MAKEPOINTS(lParam).y;
-         event->event.motion.modifiers = mswindows_modifier_state (NULL, 0);
+         event->event.motion.modifiers =
+           mswindows_modifier_state (NULL, wParam, 0);
 
          mswindows_enqueue_dispatch_event (emacs_event);
        }
@@ -2459,9 +2523,7 @@ mswindows_wnd_proc (HWND hwnd, UINT message_, WPARAM wParam, LPARAM lParam)
              {
                /* I think this is safe since the text will only go away
                   when the toolbar does...*/
-               TO_EXTERNAL_FORMAT (LISP_STRING, btext,
-                                   C_STRING_ALLOCA, tttext->lpszText,
-                                   Qnative);
+               LISP_STRING_TO_EXTERNAL (btext, tttext->lpszText, Qnative);
              }
 #endif
          }
@@ -2493,7 +2555,7 @@ mswindows_wnd_proc (HWND hwnd, UINT message_, WPARAM wParam, LPARAM lParam)
         shouldn't have received a paint message for it here. */
       assert (wParam == 0);
 
-      /* Can't queue a magic event because windows goes modal and sends paint 
+      /* Can't queue a magic event because windows goes modal and sends paint
         messages directly to the windows procedure when doing solid drags
         and the message queue doesn't get processed. */
       mswindows_handle_paint (XFRAME (mswindows_find_frame (hwnd)));
@@ -2821,7 +2883,8 @@ mswindows_wnd_proc (HWND hwnd, UINT message_, WPARAM wParam, LPARAM lParam)
        event->channel = mswindows_find_frame(hwnd);
        event->timestamp = GetMessageTime();
        event->event.misc.button = 1;           /* #### Should try harder */
-       event->event.misc.modifiers = mswindows_modifier_state (NULL, 0);
+       event->event.misc.modifiers = mswindows_modifier_state (NULL,
+                                                               (DWORD) -1, 0);
        event->event.misc.x = point.x;
        event->event.misc.y = point.y;
        event->event.misc.function = Qdragdrop_drop_dispatch;
@@ -2846,7 +2909,7 @@ mswindows_wnd_proc (HWND hwnd, UINT message_, WPARAM wParam, LPARAM lParam)
 
                if (CoCreateInstance (&CLSID_ShellLink, NULL,
                                      CLSCTX_INPROC_SERVER, &IID_IShellLink, &psl) == S_OK)
-                 { 
+                 {
                    IPersistFile* ppf;
 
                    if (psl->lpVtbl->QueryInterface (psl, &IID_IPersistFile,
@@ -2947,8 +3010,10 @@ mswindows_current_layout_has_AltGr (void)
      time when a key typed at autorepeat rate of 30 cps! */
   static HKL last_hkl = 0;
   static int last_hkl_has_AltGr;
+  HKL current_hkl = (HKL) -1;
 
-  HKL current_hkl = GetKeyboardLayout (0);
+  if (xGetKeyboardLayout) /* not in NT 3.5 */
+    current_hkl = xGetKeyboardLayout (0);
   if (current_hkl != last_hkl)
     {
       TCHAR c;
@@ -2968,11 +3033,20 @@ mswindows_current_layout_has_AltGr (void)
 /* Returns the state of the modifier keys in the format expected by the
  * Lisp_Event key_data, button_data and motion_data modifiers member */
 static int
-mswindows_modifier_state (BYTE* keymap, int has_AltGr)
+mswindows_modifier_state (BYTE* keymap, DWORD fwKeys, int has_AltGr)
 {
   int mods = 0;
+  int keys_is_real = 0;
   BYTE keymap2[256];
 
+  if (fwKeys == (DWORD) -1)
+    fwKeys = mswindows_last_mouse_button_state;
+  else
+    {
+      keys_is_real = 1;
+      mswindows_last_mouse_button_state = fwKeys;
+    }
+
   if (keymap == NULL)
     {
       keymap = keymap2;
@@ -2980,6 +3054,8 @@ mswindows_modifier_state (BYTE* keymap, int has_AltGr)
       has_AltGr = mswindows_current_layout_has_AltGr ();
     }
 
+  /* #### should look at fwKeys for MK_CONTROL.  I don't understand how
+     AltGr works. */
   if (has_AltGr && (keymap [VK_LCONTROL] & 0x80) && (keymap [VK_RMENU] & 0x80))
     {
       mods |= (keymap [VK_LMENU] & 0x80) ? XEMACS_MOD_META : 0;
@@ -2991,7 +3067,11 @@ mswindows_modifier_state (BYTE* keymap, int has_AltGr)
       mods |= (keymap [VK_CONTROL] & 0x80) ? XEMACS_MOD_CONTROL : 0;
     }
 
-  mods |= (keymap [VK_SHIFT] & 0x80) ? XEMACS_MOD_SHIFT : 0;
+  mods |= (keys_is_real ? fwKeys & MK_SHIFT : (keymap [VK_SHIFT] & 0x80))
+    ? XEMACS_MOD_SHIFT : 0;
+  mods |= fwKeys & MK_LBUTTON ? XEMACS_MOD_BUTTON1 : 0;
+  mods |= fwKeys & MK_MBUTTON ? XEMACS_MOD_BUTTON2 : 0;
+  mods |= fwKeys & MK_RBUTTON ? XEMACS_MOD_BUTTON3 : 0;
 
   return mods;
 }
@@ -3000,7 +3080,6 @@ mswindows_modifier_state (BYTE* keymap, int has_AltGr)
  * Translate a mswindows virtual key to a keysym.
  * Only returns non-Qnil for keys that don't generate WM_CHAR messages
  * or whose ASCII codes (like space) xemacs doesn't like.
- * Virtual key values are defined in winresrc.h
  */
 Lisp_Object mswindows_key_to_emacs_keysym (int mswindows_key, int mods,
                                           int extendedp)
@@ -3009,6 +3088,7 @@ Lisp_Object mswindows_key_to_emacs_keysym (int mswindows_key, int mods,
     {
       switch (mswindows_key)
         {
+       case VK_CANCEL:         return KEYSYM ("pause");
        case VK_RETURN:         return KEYSYM ("kp-enter");
        case VK_PRIOR:          return KEYSYM ("prior");
        case VK_NEXT:           return KEYSYM ("next");
@@ -3020,6 +3100,11 @@ Lisp_Object mswindows_key_to_emacs_keysym (int mswindows_key, int mods,
        case VK_DOWN:           return KEYSYM ("down");
        case VK_INSERT:         return KEYSYM ("insert");
        case VK_DELETE:         return QKdelete;
+#if 0  /* FSF Emacs allows these to return configurable syms/mods */
+       case VK_LWIN            return KEYSYM ("");
+       case VK_RWIN            return KEYSYM ("");
+#endif
+       case VK_APPS:           return KEYSYM ("menu");
        }
     }
   else
@@ -3031,6 +3116,7 @@ Lisp_Object mswindows_key_to_emacs_keysym (int mswindows_key, int mods,
        case '\n':              return QKlinefeed;
        case VK_CLEAR:          return KEYSYM ("clear");
        case VK_RETURN:         return QKreturn;
+       case VK_PAUSE:          return KEYSYM ("pause");
        case VK_ESCAPE:         return QKescape;
        case VK_SPACE:          return QKspace;
        case VK_PRIOR:          return KEYSYM ("kp-prior");
@@ -3048,11 +3134,6 @@ Lisp_Object mswindows_key_to_emacs_keysym (int mswindows_key, int mods,
        case VK_INSERT:         return KEYSYM ("kp-insert");
        case VK_DELETE:         return KEYSYM ("kp-delete");
        case VK_HELP:           return KEYSYM ("help");
-#if 0  /* FSF Emacs allows these to return configurable syms/mods */
-         case VK_LWIN          return KEYSYM ("");
-         case VK_RWIN          return KEYSYM ("");
-#endif
-       case VK_APPS:           return KEYSYM ("menu");
        case VK_NUMPAD0:        return KEYSYM ("kp-0");
        case VK_NUMPAD1:        return KEYSYM ("kp-1");
        case VK_NUMPAD2:        return KEYSYM ("kp-2");
@@ -3365,7 +3446,7 @@ emacs_mswindows_quit_p (void)
        {
          emacs_event = mswindows_cancel_dispatch_event (&match_against);
          assert (!NILP (emacs_event));
-         
+
          if (XEVENT(emacs_event)->event.key.modifiers & XEMACS_MOD_SHIFT)
            critical_p = 1;
 
@@ -3479,6 +3560,12 @@ emacs_mswindows_delete_stream_pair (Lisp_Object instream,
          : HANDLE_TO_USID (get_ntpipe_input_stream_waitable (XLSTREAM (instream))));
 }
 
+static int
+emacs_mswindows_current_event_timestamp (struct console *c)
+{
+  return GetTickCount ();
+}
+
 #ifndef HAVE_X_WINDOWS
 /* This is called from GC when a process object is about to be freed.
    If we've still got pointers to it in this file, we're gonna lose hard.
@@ -3533,6 +3620,8 @@ reinit_vars_of_event_mswindows (void)
   mswindows_event_stream->create_stream_pair_cb = emacs_mswindows_create_stream_pair;
   mswindows_event_stream->delete_stream_pair_cb = emacs_mswindows_delete_stream_pair;
 #endif
+  mswindows_event_stream->current_event_timestamp_cb =
+    emacs_mswindows_current_event_timestamp;
 }
 
 void
@@ -3555,7 +3644,7 @@ vars_of_event_mswindows (void)
 
 
 #ifdef DEBUG_XEMACS
-  DEFVAR_INT ("mswindows-debug-events", &mswindows_debug_events /*
+  DEFVAR_INT ("debug-mswindows-events", &debug_mswindows_events /*
 If non-zero, display debug information about Windows events that XEmacs sees.
 Information is displayed in a console window.  Currently defined values are:
 
@@ -3564,7 +3653,7 @@ Information is displayed in a console window.  Currently defined values are:
 
 #### Unfortunately, not yet implemented.
 */ );
-  mswindows_debug_events = 0;
+  debug_mswindows_events = 0;
 #endif
 
   DEFVAR_BOOL ("mswindows-alt-by-itself-activates-menu",
index a4d216c..0d09051 100644 (file)
@@ -610,6 +610,14 @@ event_stream_quit_p (void)
     event_stream->quit_p_cb ();
 }
 
+static int
+event_stream_current_event_timestamp (struct console *c)
+{
+  if (event_stream && event_stream->current_event_timestamp_cb)
+    return event_stream->current_event_timestamp_cb (c);
+  else
+    return 0;
+}
 
 \f
 /**********************************************************************/
@@ -767,6 +775,17 @@ maybe_kbd_translate (Lisp_Object event)
          XEVENT (event)->event.key.keysym = traduit;
          did_translate = 1;
        }
+      else if (CHARP (traduit))
+       {
+         Lisp_Event ev2;
+
+         zero_event (&ev2);
+         character_to_event (XCHAR (traduit), &ev2,
+                             XCONSOLE (EVENT_CHANNEL (XEVENT (event))), 1, 1);
+         XEVENT (event)->event.key.keysym = ev2.event.key.keysym;
+         XEVENT (event)->event.key.modifiers |= ev2.event.key.modifiers;
+         did_translate = 1;
+       }
     }
 
 #ifdef DEBUG_XEMACS
@@ -2037,7 +2056,12 @@ The next available event will be
 
 -- any events in `unread-command-events' or `unread-command-event'; else
 -- the next event in the currently executing keyboard macro, if any; else
--- an event queued by `enqueue-eval-event', if any; else
+-- an event queued by `enqueue-eval-event', if any, or any similar event
+   queued internally, such as a misc-user event. (For example, when an item
+   is selected from a menu or from a `question'-type dialog box, the item's
+   callback is not immediately executed, but instead a misc-user event
+   is generated and placed onto this queue; when it is dispatched, the
+   callback is executed.) Else
 -- the next available event from the window system or terminal driver.
 
 In the last case, this function will block until an event is available.
@@ -2352,7 +2376,7 @@ This function is useful for forcing the redisplay of native
 widgets. Normally these are redisplayed through a native window-system
 event encoded as magic event, rather than by the redisplay code.  This
 function does not call redisplay or do any of the other things that
-`next-event' does.  
+`next-event' does.
 */
        ())
 {
@@ -2875,10 +2899,8 @@ If sit-for is called from within a process filter function or timer
   return result;
 }
 
-/* This handy little function is used by xselect.c and energize.c to
-   wait for replies from processes that aren't really processes (that is,
-   the X server and the Energize server).
- */
+/* This handy little function is used by select-x.c to wait for replies
+   from processes that aren't really processes (e.g. the X server) */
 void
 wait_delaying_user_input (int (*predicate) (void *arg), void *predicate_arg)
 {
@@ -4416,6 +4438,23 @@ If FILE is nil, close any open dribble file.
 }
 
 \f
+
+DEFUN ("current-event-timestamp", Fcurrent_event_timestamp, 0, 1, 0, /*
+Return the current event timestamp of the window system associated with CONSOLE.
+CONSOLE defaults to the selected console if omitted.
+*/
+       (console))
+{
+  struct console *c = decode_console (console);
+  int tiempo = event_stream_current_event_timestamp (c);
+
+  /* This junk is so that timestamps don't get to be negative, but contain
+     as many bits as this particular emacs will allow.
+   */
+  return make_int (((1L << (VALBITS - 1)) - 1) & tiempo);
+}
+
+\f
 /************************************************************************/
 /*                            initialization                            */
 /************************************************************************/
@@ -4429,8 +4468,7 @@ syms_of_event_stream (void)
   defsymbol (&Qdisabled, "disabled");
   defsymbol (&Qcommand_event_p, "command-event-p");
 
-  deferror (&Qundefined_keystroke_sequence, "undefined-keystroke-sequence",
-            "Undefined keystroke sequence", Qerror);
+  DEFERROR_STANDARD (Qundefined_keystroke_sequence, Qinvalid_argument);
 
   DEFSUBR (Frecent_keys);
   DEFSUBR (Frecent_keys_ring_size);
@@ -4453,6 +4491,7 @@ syms_of_event_stream (void)
   DEFSUBR (Fthis_command_keys);
   DEFSUBR (Freset_this_command_lengths);
   DEFSUBR (Fopen_dribble_file);
+  DEFSUBR (Fcurrent_event_timestamp);
 
   defsymbol (&Qpre_command_hook, "pre-command-hook");
   defsymbol (&Qpost_command_hook, "post-command-hook");
@@ -4550,7 +4589,7 @@ Normal hook run when XEmacs it about to be idle.
 This occurs whenever it is going to block, waiting for an event.
 This generally happens as a result of a call to `next-event',
 `next-command-event', `sit-for', `sleep-for', `accept-process-output',
-`x-get-selection', or various Energize-specific commands.
+or `x-get-selection'.
 Errors running the hook are caught and ignored.
 */ );
   Vpre_idle_hook = Qnil;
@@ -4736,6 +4775,10 @@ Each key-press event is looked up in this table as follows:
    keysym changed and its modifiers left alone.  This is useful for
    dealing with non-standard X keyboards, such as the grievous damage
    that Sun has inflicted upon the world.
+-- If an entry maps a symbol to a character, then a key-press event
+   whose keysym is the former symbol (with any modifiers at all) gets
+   changed into a key-press event matching the latter character, and the
+   resulting modifiers are the union of the original and new modifiers.
 -- If an entry maps a character to a character, then a key-press event
    matching the former character gets converted to a key-press event
    matching the latter character.  This is useful on ASCII terminals
@@ -4744,6 +4787,16 @@ Each key-press event is looked up in this table as follows:
 -- If an entry maps a character to a symbol, then a key-press event
    matching the character gets converted to a key-press event whose
    keysym is the given symbol and which has no modifiers.
+
+Here's an example: This makes typing parens and braces easier by rerouting
+their positions to eliminate the need to use the Shift key.
+
+  (keyboard-translate ?[ ?()
+  (keyboard-translate ?] ?))
+  (keyboard-translate ?{ ?[)
+  (keyboard-translate ?} ?])
+  (keyboard-translate 'f11 ?{)
+  (keyboard-translate 'f12 ?})
 */ );
 
   DEFVAR_LISP ("retry-undefined-key-binding-unshifted",
index 76644e1..a7e2d6b 100644 (file)
@@ -6,3 +6,8 @@
 #define XEMACS_MOD_HYPER       (1<<3)
 #define XEMACS_MOD_ALT         (1<<4)
 #define XEMACS_MOD_SHIFT       (1<<5)  /* not used for dual-case characters */
+#define XEMACS_MOD_BUTTON1     (1<<6)
+#define XEMACS_MOD_BUTTON2     (1<<7)
+#define XEMACS_MOD_BUTTON3     (1<<8)
+#define XEMACS_MOD_BUTTON4     (1<<9)
+#define XEMACS_MOD_BUTTON5     (1<<10)
index e74f3ce..1e5f9db 100644 (file)
@@ -418,7 +418,6 @@ WARNING: the event object returned may be a reused one; see the function
 */
        (type, plist))
 {
-  Lisp_Object tail, keyword, value;
   Lisp_Object event = Qnil;
   Lisp_Event *e;
   EMACS_INT coord_x = 0, coord_y = 0;
@@ -449,7 +448,7 @@ WARNING: the event object returned may be a reused one; see the function
          (e.g. CHANNEL), which we don't want in empty events.  */
       e->event_type = empty_event;
       if (!NILP (plist))
-       error ("Cannot set properties of empty event");
+       syntax_error ("Cannot set properties of empty event", plist);
       UNGCPRO;
       return event;
     }
@@ -472,7 +471,7 @@ WARNING: the event object returned may be a reused one; see the function
   else
     {
       /* Not allowed: Qprocess, Qtimeout, Qmagic, Qeval, Qmagic_eval.  */
-      signal_simple_error ("Invalid event type", type);
+      invalid_argument ("Invalid event type", type);
     }
 
   EVENT_CHANNEL (e) = Qnil;
@@ -480,164 +479,169 @@ WARNING: the event object returned may be a reused one; see the function
   plist = Fcopy_sequence (plist);
   Fcanonicalize_plist (plist, Qnil);
 
-#define WRONG_EVENT_TYPE_FOR_PROPERTY(type, prop)                      \
-  error_with_frob (prop, "Invalid property for %s event",              \
-                  string_data (symbol_name (XSYMBOL (type))))
+#define WRONG_EVENT_TYPE_FOR_PROPERTY(event_type, prop) \
+  syntax_error_2 ("Invalid property for event type", prop, event_type)
 
-  EXTERNAL_PROPERTY_LIST_LOOP (tail, keyword, value, plist)
-    {
-      if (EQ (keyword, Qchannel))
-       {
-         if (e->event_type == key_press_event)
-           {
-             if (!CONSOLEP (value))
-               value = wrong_type_argument (Qconsolep, value);
-           }
-         else
-           {
-             if (!FRAMEP (value))
-               value = wrong_type_argument (Qframep, value);
-           }
-         EVENT_CHANNEL (e) = value;
-       }
-      else if (EQ (keyword, Qkey))
-       {
-         switch (e->event_type)
-           {
-           case key_press_event:
-             if (!SYMBOLP (value) && !CHARP (value))
-               signal_simple_error ("Invalid event key", value);
-             e->event.key.keysym = value;
-             break;
-           default:
-             WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword);
-             break;
-           }
-       }
-      else if (EQ (keyword, Qbutton))
-       {
-         CHECK_NATNUM (value);
-         check_int_range (XINT (value), 0, 7);
-
-         switch (e->event_type)
-           {
-           case button_press_event:
-           case button_release_event:
-             e->event.button.button = XINT (value);
-             break;
-           case misc_user_event:
-             e->event.misc.button = XINT (value);
-             break;
-           default:
-             WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword);
-             break;
-           }
-       }
-      else if (EQ (keyword, Qmodifiers))
-       {
-         int modifiers = 0;
-         Lisp_Object sym;
-
-         EXTERNAL_LIST_LOOP_2 (sym, value)
-           {
-             if      (EQ (sym, Qcontrol)) modifiers |= XEMACS_MOD_CONTROL;
-             else if (EQ (sym, Qmeta))    modifiers |= XEMACS_MOD_META;
-             else if (EQ (sym, Qsuper))   modifiers |= XEMACS_MOD_SUPER;
-             else if (EQ (sym, Qhyper))   modifiers |= XEMACS_MOD_HYPER;
-             else if (EQ (sym, Qalt))     modifiers |= XEMACS_MOD_ALT;
-             else if (EQ (sym, Qsymbol))  modifiers |= XEMACS_MOD_ALT;
-             else if (EQ (sym, Qshift))   modifiers |= XEMACS_MOD_SHIFT;
-             else
-               signal_simple_error ("Invalid key modifier", sym);
-           }
-
-         switch (e->event_type)
-           {
-           case key_press_event:
-             e->event.key.modifiers = modifiers;
-             break;
-           case button_press_event:
-           case button_release_event:
-             e->event.button.modifiers = modifiers;
-             break;
-           case pointer_motion_event:
-             e->event.motion.modifiers = modifiers;
-             break;
-           case misc_user_event:
-             e->event.misc.modifiers = modifiers;
-             break;
-           default:
-             WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword);
-             break;
-           }
-       }
-      else if (EQ (keyword, Qx))
-       {
-         switch (e->event_type)
-           {
-           case pointer_motion_event:
-           case button_press_event:
-           case button_release_event:
-           case misc_user_event:
-             /* Allow negative values, so we can specify toolbar
-                positions.  */
-             CHECK_INT (value);
-             coord_x = XINT (value);
-             break;
-           default:
-             WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword);
-             break;
-           }
-       }
-      else if (EQ (keyword, Qy))
-       {
-         switch (e->event_type)
-           {
-           case pointer_motion_event:
-           case button_press_event:
-           case button_release_event:
-           case misc_user_event:
-             /* Allow negative values; see above. */
-             CHECK_INT (value);
-             coord_y = XINT (value);
-             break;
-           default:
-             WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword);
-             break;
-           }
-       }
-      else if (EQ (keyword, Qtimestamp))
-       {
-         CHECK_NATNUM (value);
-         e->timestamp = XINT (value);
-       }
-      else if (EQ (keyword, Qfunction))
-       {
-         switch (e->event_type)
-           {
-           case misc_user_event:
-             e->event.eval.function = value;
-             break;
-           default:
-             WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword);
-             break;
-           }
-       }
-      else if (EQ (keyword, Qobject))
-       {
-         switch (e->event_type)
-           {
-           case misc_user_event:
-             e->event.eval.object = value;
-             break;
-           default:
-             WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword);
-             break;
-           }
-       }
-      else
-       signal_simple_error_2 ("Invalid property", keyword, value);
-    }
+  {
+    EXTERNAL_PROPERTY_LIST_LOOP_3 (keyword, value, plist)
+      {
+       if (EQ (keyword, Qchannel))
+         {
+           if (e->event_type == key_press_event)
+             {
+               if (!CONSOLEP (value))
+                 value = wrong_type_argument (Qconsolep, value);
+             }
+           else
+             {
+               if (!FRAMEP (value))
+                 value = wrong_type_argument (Qframep, value);
+             }
+           EVENT_CHANNEL (e) = value;
+         }
+       else if (EQ (keyword, Qkey))
+         {
+           switch (e->event_type)
+             {
+             case key_press_event:
+               if (!SYMBOLP (value) && !CHARP (value))
+                 syntax_error ("Invalid event key", value);
+               e->event.key.keysym = value;
+               break;
+             default:
+               WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword);
+               break;
+             }
+         }
+       else if (EQ (keyword, Qbutton))
+         {
+           CHECK_NATNUM (value);
+           check_int_range (XINT (value), 0, 7);
+
+           switch (e->event_type)
+             {
+             case button_press_event:
+             case button_release_event:
+               e->event.button.button = XINT (value);
+               break;
+             case misc_user_event:
+               e->event.misc.button = XINT (value);
+               break;
+             default:
+               WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword);
+               break;
+             }
+         }
+       else if (EQ (keyword, Qmodifiers))
+         {
+           int modifiers = 0;
+
+           EXTERNAL_LIST_LOOP_2 (sym, value)
+             {
+               if      (EQ (sym, Qcontrol)) modifiers |= XEMACS_MOD_CONTROL;
+               else if (EQ (sym, Qmeta))    modifiers |= XEMACS_MOD_META;
+               else if (EQ (sym, Qsuper))   modifiers |= XEMACS_MOD_SUPER;
+               else if (EQ (sym, Qhyper))   modifiers |= XEMACS_MOD_HYPER;
+               else if (EQ (sym, Qalt))     modifiers |= XEMACS_MOD_ALT;
+               else if (EQ (sym, Qsymbol))  modifiers |= XEMACS_MOD_ALT;
+               else if (EQ (sym, Qshift))   modifiers |= XEMACS_MOD_SHIFT;
+               else if (EQ (sym, Qbutton1))   modifiers |= XEMACS_MOD_BUTTON1;
+               else if (EQ (sym, Qbutton2))   modifiers |= XEMACS_MOD_BUTTON2;
+               else if (EQ (sym, Qbutton3))   modifiers |= XEMACS_MOD_BUTTON3;
+               else if (EQ (sym, Qbutton4))   modifiers |= XEMACS_MOD_BUTTON4;
+               else if (EQ (sym, Qbutton5))   modifiers |= XEMACS_MOD_BUTTON5;
+               else
+                 syntax_error ("Invalid key modifier", sym);
+             }
+
+           switch (e->event_type)
+             {
+             case key_press_event:
+               e->event.key.modifiers = modifiers;
+               break;
+             case button_press_event:
+             case button_release_event:
+               e->event.button.modifiers = modifiers;
+               break;
+             case pointer_motion_event:
+               e->event.motion.modifiers = modifiers;
+               break;
+             case misc_user_event:
+               e->event.misc.modifiers = modifiers;
+               break;
+             default:
+               WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword);
+               break;
+             }
+         }
+       else if (EQ (keyword, Qx))
+         {
+           switch (e->event_type)
+             {
+             case pointer_motion_event:
+             case button_press_event:
+             case button_release_event:
+             case misc_user_event:
+               /* Allow negative values, so we can specify toolbar
+                  positions.  */
+               CHECK_INT (value);
+               coord_x = XINT (value);
+               break;
+             default:
+               WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword);
+               break;
+             }
+         }
+       else if (EQ (keyword, Qy))
+         {
+           switch (e->event_type)
+             {
+             case pointer_motion_event:
+             case button_press_event:
+             case button_release_event:
+             case misc_user_event:
+               /* Allow negative values; see above. */
+               CHECK_INT (value);
+               coord_y = XINT (value);
+               break;
+             default:
+               WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword);
+               break;
+             }
+         }
+       else if (EQ (keyword, Qtimestamp))
+         {
+           CHECK_NATNUM (value);
+           e->timestamp = XINT (value);
+         }
+       else if (EQ (keyword, Qfunction))
+         {
+           switch (e->event_type)
+             {
+             case misc_user_event:
+               e->event.eval.function = value;
+               break;
+             default:
+               WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword);
+               break;
+             }
+         }
+       else if (EQ (keyword, Qobject))
+         {
+           switch (e->event_type)
+             {
+             case misc_user_event:
+               e->event.eval.object = value;
+               break;
+             default:
+               WRONG_EVENT_TYPE_FOR_PROPERTY (type, keyword);
+               break;
+             }
+         }
+       else
+         syntax_error_2 ("Invalid property", keyword, value);
+      }
+  }
 
   /* Insert the channel, if missing. */
   if (NILP (EVENT_CHANNEL (e)))
@@ -680,19 +684,25 @@ WARNING: the event object returned may be a reused one; see the function
     {
     case key_press_event:
       if (UNBOUNDP (e->event.key.keysym))
-       error ("A key must be specified to make a keypress event");
+       syntax_error ("A key must be specified to make a keypress event",
+                     plist);
       break;
     case button_press_event:
       if (!e->event.button.button)
-       error ("A button must be specified to make a button-press event");
+       syntax_error
+         ("A button must be specified to make a button-press event",
+          plist);
       break;
     case button_release_event:
       if (!e->event.button.button)
-       error ("A button must be specified to make a button-release event");
+       syntax_error
+         ("A button must be specified to make a button-release event",
+          plist);
       break;
     case misc_user_event:
       if (NILP (e->event.misc.function))
-       error ("A function must be specified to make a misc-user event");
+       syntax_error ("A function must be specified to make a misc-user event",
+                     plist);
       break;
     default:
       break;
@@ -1278,6 +1288,7 @@ format_event_object (char *buf, Lisp_Event *event, int brief)
     case dead_event:           strcpy (buf, "DEAD-EVENT"); return;
     default:
       abort ();
+      return;
     }
 #define modprint1(x)  do { strcpy (buf, (x)); buf += sizeof (x)-1; } while (0)
 #define modprint(x,y) do { if (brief) modprint1 (y); else modprint1 (x); } while (0)
@@ -1441,6 +1452,10 @@ empty            The event has been allocated but not assigned.
 
 DEFUN ("event-timestamp", Fevent_timestamp, 1, 1, 0, /*
 Return the timestamp of the event object EVENT.
+Timestamps are measured in milliseconds since the start of the window system.
+They are NOT related to any current time measurement.
+They should be compared with `event-timestamp<'.
+See also `current-event-timestamp'.
 */
        (event))
 {
@@ -1452,6 +1467,28 @@ Return the timestamp of the event object EVENT.
                      XEVENT (event)->timestamp);
 }
 
+#define TIMESTAMP_HALFSPACE (1L << (VALBITS - 2))
+
+DEFUN ("event-timestamp<", Fevent_timestamp_lessp, 2, 2, 0, /*
+Return true if timestamp TIME1 is earlier than timestamp TIME2.
+This correctly handles timestamp wrap.
+See also `event-timestamp' and `current-event-timestamp'.
+*/
+       (time1, time2))
+{
+  EMACS_INT t1, t2;
+
+  CHECK_NATNUM (time1);
+  CHECK_NATNUM (time2);
+  t1 = XINT (time1);
+  t2 = XINT (time2);
+
+  if (t1 < t2)
+    return t2 - t1 < TIMESTAMP_HALFSPACE ? Qt : Qnil;
+  else
+    return t1 - t2 < TIMESTAMP_HALFSPACE ? Qnil : Qt;
+}
+
 #define CHECK_EVENT_TYPE(e,t1,sym) do {                \
   CHECK_LIVE_EVENT (e);                                \
   if (XEVENT(e)->event_type != (t1))           \
@@ -1509,9 +1546,9 @@ Return the button-number of the given button-press or button-release event.
 }
 
 DEFUN ("event-modifier-bits", Fevent_modifier_bits, 1, 1, 0, /*
-Return a number representing the modifier keys which were down
+Return a number representing the modifier keys and buttons which were down
 when the given mouse or keyboard event was produced.
-See also the function event-modifiers.
+See also the function `event-modifiers'.
 */
        (event))
 {
@@ -1535,21 +1572,67 @@ See also the function event-modifiers.
 }
 
 DEFUN ("event-modifiers", Fevent_modifiers, 1, 1, 0, /*
-Return a list of symbols, the names of the modifier keys
+Return a list of symbols, the names of the modifier keys and buttons
 which were down when the given mouse or keyboard event was produced.
-See also the function event-modifier-bits.
+See also the function `event-modifier-bits'.
+
+The possible symbols in the list are
+
+`shift':     The Shift key.  Will not appear, in general, on key events
+             where the keysym is an ASCII character, because using Shift
+             on such a character converts it into another character rather
+             than actually just adding a Shift modifier.
+
+`control':   The Control key.
+
+`meta':      The Meta key.  On PC's and PC-style keyboards, this is generally
+             labelled \"Alt\"; Meta is a holdover from early Lisp Machines and
+             such, propagated through the X Window System.  On Sun keyboards,
+             this key is labelled with a diamond.
+
+`alt':       The \"Alt\" key.  Alt is in quotes because this does not refer
+             to what it obviously should refer to, namely the Alt key on PC
+             keyboards.  Instead, it refers to the key labelled Alt on Sun
+             keyboards, and to no key at all on PC keyboards.
+
+`super':     The Super key.  Most keyboards don't have any such key, but
+             under X Windows using `xmodmap' you can assign any key (such as
+             an underused right-shift, right-control, or right-alt key) to
+             this key modifier.  No support currently exists under MS Windows
+             for generating these modifiers.
+
+`hyper':     The Hyper key.  Works just like the Super key.
+
+`button1':   The mouse buttons.  This means that the specified button was held
+`button2':   down at the time the event occurred.  NOTE: For button-press
+`button3':   events, the button that was just pressed down does NOT appear in
+`button4':   the modifiers.
+`button5':
+
+Button modifiers are currently ignored when defining and looking up key and
+mouse strokes in keymaps.  This could be changed, which would allow a user to
+create button-chord actions, use a button as a key modifier and do other
+clever things.
 */
        (event))
 {
   int mod = XINT (Fevent_modifier_bits (event));
   Lisp_Object result = Qnil;
+  struct gcpro gcpro1;
+
+  GCPRO1 (result);
   if (mod & XEMACS_MOD_SHIFT)   result = Fcons (Qshift, result);
   if (mod & XEMACS_MOD_ALT)    result = Fcons (Qalt, result);
   if (mod & XEMACS_MOD_HYPER)   result = Fcons (Qhyper, result);
   if (mod & XEMACS_MOD_SUPER)   result = Fcons (Qsuper, result);
   if (mod & XEMACS_MOD_META)    result = Fcons (Qmeta, result);
   if (mod & XEMACS_MOD_CONTROL) result = Fcons (Qcontrol, result);
-  return result;
+  if (mod & XEMACS_MOD_BUTTON1) result = Fcons (Qbutton1, result);
+  if (mod & XEMACS_MOD_BUTTON2) result = Fcons (Qbutton2, result);
+  if (mod & XEMACS_MOD_BUTTON3) result = Fcons (Qbutton3, result);
+  if (mod & XEMACS_MOD_BUTTON4) result = Fcons (Qbutton4, result);
+  if (mod & XEMACS_MOD_BUTTON5) result = Fcons (Qbutton5, result);
+  RETURN_UNGCPRO (Fnreverse (result));
 }
 
 static int
@@ -1584,7 +1667,7 @@ event_x_y_pixel_internal (Lisp_Object event, int *x, int *y, int relative)
       w = find_window_by_pixel_pos (*x, *y, f->root_window);
 
       if (!w)
-       return 1;       /* #### What should really happen here. */
+       return 1;       /* #### What should really happen here? */
 
       *x -= w->pixel_left;
       *y -= w->pixel_top;
@@ -2191,6 +2274,7 @@ syms_of_events (void)
   DEFSUBR (Fevent_properties);
 
   DEFSUBR (Fevent_timestamp);
+  DEFSUBR (Fevent_timestamp_lessp);
   DEFSUBR (Fevent_key);
   DEFSUBR (Fevent_button);
   DEFSUBR (Fevent_modifier_bits);
index 7088301..e8fa7f8 100644 (file)
@@ -130,10 +130,9 @@ Boston, MA 02111-1307, USA.  */
  event_stream layer to translate to this format.
 
  NOTE: #### All timestamps should be measured as milliseconds since XEmacs
-       started.  Currently many or most events have a 0 as their
-       timestamp value, and for other timestamps, they are raw server
-       timestamps. (The X protocol doesn't provide any easy way of
-       translating between server time and real process time; yuck.)
+       started.  Currently they are raw server timestamps. (The X protocol
+       doesn't provide any easy way of translating between server time and
+       real process time; yuck.)
 
  Every event type has the following structures:
 
@@ -176,6 +175,7 @@ Boston, MA 02111-1307, USA.  */
                        If this is an integer, it will be in the printing
                        ASCII range: >32 and <127.
     modifiers          Bucky-bits on that key: control, meta, etc.
+                        Also includes buttons.
                        For many keys, Shift is not a bit; that is implicit
                        in the keyboard layout.
 
@@ -183,12 +183,12 @@ Boston, MA 02111-1307, USA.  */
  button_release_event
     button             What button went down or up.
     modifiers          Bucky-bits on that button: shift, control, meta, etc.
+                        Also includes other buttons (not the one pressed).
     x, y               Where it was at the button-state-change (in pixels).
 
  pointer_motion_event
     x, y               Where it was after it moved (in pixels).
     modifiers          Bucky-bits down when the motion was detected.
-                       (Possibly not all window systems will provide this?)
 
  process_event
     process            the XEmacs "process" object in question
@@ -336,6 +336,7 @@ struct event_stream
                                 int /* flags */);
   USID (*delete_stream_pair_cb) (Lisp_Object /* instream */,
                                 Lisp_Object /* outstream */);
+  int (*current_event_timestamp_cb) (struct console *);
 };
 
 /* Flags for create_stream_pair_cb() FLAGS parameter */
index 5fd8ad5..910c0aa 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (c) 1994, 1995 Free Software Foundation, Inc.
    Copyright (c) 1995 Sun Microsystems, Inc.
-   Copyright (c) 1995, 1996 Ben Wing.
+   Copyright (c) 1995, 1996, 2000 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -1599,8 +1599,8 @@ extent_changed_for_redisplay (EXTENT extent, int descendants_too,
   else if (STRINGP (object))
     {
     /* #### Changes to string extents can affect redisplay if they are
-       in the modeline or in the gutters. 
-       
+       in the modeline or in the gutters.
+
        If the extent is in some generated-modeline-string: when we
        change an extent in generated-modeline-string, this changes its
        parent, which is in `modeline-format', so we should force the
@@ -1609,7 +1609,7 @@ extent_changed_for_redisplay (EXTENT extent, int descendants_too,
        is not very efficient.  Should we add all
        `generated-modeline-string' strings to a hash table?  Maybe
        efficiency is not the greatest concern here and there's no big
-       loss in looping over the buffers. 
+       loss in looping over the buffers.
 
        If the extent is in a gutter we mark the gutter as
        changed. This means (a) we can update extents in the gutters
@@ -1860,7 +1860,7 @@ extent_in_region_p (EXTENT extent, Bytind from, Bytind to,
       case ME_ALL_EXTENTS_OPEN:        start_open = 1, end_open = 1; break;
       case ME_ALL_EXTENTS_CLOSED_OPEN: start_open = 0, end_open = 1; break;
       case ME_ALL_EXTENTS_OPEN_CLOSED: start_open = 1, end_open = 0; break;
-      default: abort(); break;
+      default: abort(); return 0;
       }
 
   start = buffer_or_string_bytind_to_startind (obj, from,
@@ -1895,7 +1895,7 @@ extent_in_region_p (EXTENT extent, Bytind from, Bytind to,
        retval = (start <= exs && exs <= end) || (start <= exe && exe <= end);
        break;
       default:
-       abort(); break;
+       abort(); return 0;
       }
   return flags & ME_NEGATE_IN_REGION ? !retval : retval;
 }
@@ -3245,8 +3245,8 @@ decode_extent (Lisp_Object extent_obj, unsigned int flags)
   if ((NILP (obj) && (flags & DE_MUST_HAVE_BUFFER))
       || (extent_detached_p (extent) && (flags & DE_MUST_BE_ATTACHED)))
     {
-      signal_simple_error ("extent doesn't belong to a buffer or string",
-                          extent_obj);
+      invalid_argument ("extent doesn't belong to a buffer or string",
+                        extent_obj);
     }
 
   return extent;
@@ -3536,7 +3536,9 @@ See `extent-parent'.
     return Qnil;
   for (rest = parent; !NILP (rest); rest = extent_parent (XEXTENT (rest)))
     if (EQ (rest, extent))
-      signal_simple_error ("Circular parent chain would result", extent);
+      signal_type_error (Qinvalid_change,
+                        "Circular parent chain would result",
+                        extent);
   if (NILP (parent))
     {
       remove_extent_from_children_list (XEXTENT (cur_parent), extent);
@@ -3899,7 +3901,7 @@ decode_map_extents_flags (Lisp_Object flags)
        EQ (sym, Qstart_and_end_in_region) ? ME_START_AND_END_IN_REGION :
        EQ (sym, Qstart_or_end_in_region)  ? ME_START_OR_END_IN_REGION :
        EQ (sym, Qnegate_in_region)        ? ME_NEGATE_IN_REGION :
-       (signal_simple_error ("Invalid `map-extents' flag", sym), 0);
+       (invalid_argument ("Invalid `map-extents' flag", sym), 0);
 
       flags = XCDR (flags);
     }
@@ -4237,11 +4239,12 @@ Thus, this function may be used to walk a tree of extents in a buffer:
 
 struct extent_at_arg
 {
-  EXTENT best_match;
+  Lisp_Object best_match; /* or list of extents */
   Memind best_start;
   Memind best_end;
   Lisp_Object prop;
   EXTENT before;
+  int all_extents;
 };
 
 enum extent_at_flag
@@ -4262,7 +4265,7 @@ decode_extent_at_flag (Lisp_Object at_flag)
   if (EQ (at_flag, Qbefore)) return EXTENT_AT_BEFORE;
   if (EQ (at_flag, Qat))     return EXTENT_AT_AT;
 
-  signal_simple_error ("Invalid AT-FLAG in `extent-at'", at_flag);
+  invalid_argument ("Invalid AT-FLAG in `extent-at'", at_flag);
   return EXTENT_AT_AFTER; /* unreached */
 }
 
@@ -4284,13 +4287,15 @@ extent_at_mapper (EXTENT e, void *arg)
        return 0;
     }
 
+  if (!closure->all_extents)
     {
-      EXTENT current = closure->best_match;
+      EXTENT current;
 
-      if (!current)
+      if (NILP (closure->best_match))
        goto accept;
+      current = XEXTENT (closure->best_match);
       /* redundant but quick test */
-      else if (extent_start (current) > extent_start (e))
+      if (extent_start (current) > extent_start (e))
        return 0;
 
       /* we return the "last" best fit, instead of the first --
@@ -4303,20 +4308,27 @@ extent_at_mapper (EXTENT e, void *arg)
       else
        return 0;
     accept:
-      closure->best_match = e;
+      XSETEXTENT (closure->best_match, e);
       closure->best_start = extent_start (e);
       closure->best_end = extent_end (e);
     }
+  else
+    {
+      Lisp_Object extent;
+
+      XSETEXTENT (extent, e);
+      closure->best_match = Fcons (extent, closure->best_match);
+    }
 
   return 0;
 }
 
 static Lisp_Object
 extent_at_bytind (Bytind position, Lisp_Object object, Lisp_Object property,
-                 EXTENT before, enum extent_at_flag at_flag)
+                 EXTENT before, enum extent_at_flag at_flag, int all_extents)
 {
   struct extent_at_arg closure;
-  Lisp_Object extent_obj;
+  struct gcpro gcpro1;
 
   /* it might be argued that invalid positions should cause
      errors, but the principle of least surprise dictates that
@@ -4334,20 +4346,21 @@ extent_at_bytind (Bytind position, Lisp_Object object, Lisp_Object property,
          : position > buffer_or_string_absolute_end_byte (object)))
     return Qnil;
 
-  closure.best_match = 0;
+  closure.best_match = Qnil;
   closure.prop = property;
   closure.before = before;
+  closure.all_extents = all_extents;
 
+  GCPRO1 (closure.best_match);
   map_extents_bytind (at_flag == EXTENT_AT_BEFORE ? position - 1 : position,
                      at_flag == EXTENT_AT_AFTER ? position + 1 : position,
                      extent_at_mapper, (void *) &closure, object, 0,
                      ME_START_OPEN | ME_ALL_EXTENTS_CLOSED);
+  if (all_extents)
+    closure.best_match = Fnreverse (closure.best_match);
+  UNGCPRO;
 
-  if (!closure.best_match)
-    return Qnil;
-
-  XSETEXTENT (extent_obj, closure.best_match);
-  return extent_obj;
+  return closure.best_match;
 }
 
 DEFUN ("extent-at", Fextent_at, 1, 5, 0, /*
@@ -4391,10 +4404,60 @@ you should use `map-extents', which gives you more control.
   else
     before_extent = decode_extent (before, DE_MUST_BE_ATTACHED);
   if (before_extent && !EQ (object, extent_object (before_extent)))
-    signal_simple_error ("extent not in specified buffer or string", object);
+    invalid_argument ("extent not in specified buffer or string", object);
+  fl = decode_extent_at_flag (at_flag);
+
+  return extent_at_bytind (position, object, property, before_extent, fl, 0);
+}
+
+DEFUN ("extents-at", Fextents_at, 1, 5, 0, /*
+Find all extents at POS in OBJECT having PROPERTY set.
+Normally, an extent is "at" POS if it overlaps the region (POS, POS+1);
+ i.e. if it covers the character after POS. (However, see the definition
+ of AT-FLAG.)
+This provides similar functionality to `extent-list', but does so in a way
+ that is compatible with `extent-at'. (For example, errors due to POS out of
+ range are ignored; this makes it safer to use this function in response to
+ a mouse event, because in many cases previous events have changed the buffer
+ contents.)
+OBJECT specifies a buffer or string and defaults to the current buffer.
+PROPERTY defaults to nil, meaning that any extent will do.
+Properties are attached to extents with `set-extent-property', which see.
+Returns nil if POS is invalid or there is no matching extent at POS.
+If the fourth argument BEFORE is not nil, it must be an extent; any returned
+ extent will precede that extent.  This feature allows `extents-at' to be
+ used by a loop over extents.
+AT-FLAG controls how end cases are handled, and should be one of:
+
+nil or `after'         An extent is at POS if it covers the character
+                       after POS.  This is consistent with the way
+                       that text properties work.
+`before'               An extent is at POS if it covers the character
+                       before POS.
+`at'                   An extent is at POS if it overlaps or abuts POS.
+                       This includes all zero-length extents at POS.
+
+Note that in all cases, the start-openness and end-openness of the extents
+considered is ignored.  If you want to pay attention to those properties,
+you should use `map-extents', which gives you more control.
+*/
+     (pos, object, property, before, at_flag))
+{
+  Bytind position;
+  EXTENT before_extent;
+  enum extent_at_flag fl;
+
+  object = decode_buffer_or_string (object);
+  position = get_buffer_or_string_pos_byte (object, pos, GB_NO_ERROR_IF_BAD);
+  if (NILP (before))
+    before_extent = 0;
+  else
+    before_extent = decode_extent (before, DE_MUST_BE_ATTACHED);
+  if (before_extent && !EQ (object, extent_object (before_extent)))
+    invalid_argument ("extent not in specified buffer or string", object);
   fl = decode_extent_at_flag (at_flag);
 
-  return extent_at_bytind (position, object, property, before_extent, fl);
+  return extent_at_bytind (position, object, property, before_extent, fl, 1);
 }
 
 /* ------------------------------- */
@@ -4999,7 +5062,7 @@ symbol_to_glyph_layout (Lisp_Object layout_obj)
   if (EQ (layout_obj, Qwhitespace))    return GL_WHITESPACE;
   if (EQ (layout_obj, Qtext))          return GL_TEXT;
 
-  signal_simple_error ("Unknown glyph layout type", layout_obj);
+  invalid_argument ("Unknown glyph layout type", layout_obj);
   return GL_TEXT; /* unreached */
 }
 
@@ -5965,14 +6028,14 @@ get_text_property_bytind (Bytind position, Lisp_Object prop,
   /* text_props_only specifies whether we only consider text-property
      extents (those with the 'text-prop property set) or all extents. */
   if (!text_props_only)
-    extent = extent_at_bytind (position, object, prop, 0, fl);
+    extent = extent_at_bytind (position, object, prop, 0, fl, 0);
   else
     {
       EXTENT prior = 0;
       while (1)
        {
          extent = extent_at_bytind (position, object, Qtext_prop, prior,
-                                    fl);
+                                    fl, 0);
          if (NILP (extent))
            return Qnil;
          if (EQ (prop, Fextent_property (extent, Qtext_prop, Qnil)))
@@ -6504,7 +6567,8 @@ Used as the `paste-function' property of `text-prop' extents.
 
   prop = Fextent_property (extent, Qtext_prop, Qnil);
   if (NILP (prop))
-    signal_simple_error ("Internal error: no text-prop", extent);
+    signal_type_error (Qinternal_error,
+                      "Internal error: no text-prop", extent);
   val = Fextent_property (extent, prop, Qnil);
 #if 0
   /* removed by bill perry, 2/9/97
@@ -6512,8 +6576,9 @@ Used as the `paste-function' property of `text-prop' extents.
   ** with a value of Qnil.  This is bad bad bad.
   */
   if (NILP (val))
-    signal_simple_error_2 ("Internal error: no text-prop",
-                          extent, prop);
+    signal_type_error_2 (Qinternal_error,
+                        "Internal error: no text-prop",
+                        extent, prop);
 #endif
   Fput_text_property (from, to, prop, val, Qnil);
   return Qnil; /* important! */
@@ -6757,6 +6822,7 @@ syms_of_extents (void)
   DEFSUBR (Fmap_extents);
   DEFSUBR (Fmap_extent_children);
   DEFSUBR (Fextent_at);
+  DEFSUBR (Fextents_at);
 
   DEFSUBR (Fset_extent_initial_redisplay_function);
   DEFSUBR (Fextent_face);
index 8c54aaf..9fce353 100644 (file)
@@ -66,7 +66,7 @@ struct file_coding_dump {
 static const struct lrecord_description fcd_description_1[] = {
   { XD_LISP_OBJECT_ARRAY, offsetof (struct file_coding_dump, coding_category_system), CODING_CATEGORY_LAST + 1 },
 #ifdef MULE
-  { XD_LISP_OBJECT_ARRAY, offsetof (struct file_coding_dump, ucs_to_mule_table), 65536 },
+  { XD_LISP_OBJECT_ARRAY, offsetof (struct file_coding_dump, ucs_to_mule_table), countof (fcd->ucs_to_mule_table) },
 #endif
   { XD_END }
 };
@@ -732,7 +732,7 @@ nil or 'undecided
      JIS (the Japanese encoding commonly used for e-mail), EUC (the
      standard Unix encoding for Japanese and other languages), and
      Compound Text (the encoding used in X11).  You can specify more
-     specific information about the conversion with the FLAGS argument.
+     specific information about the conversion with the PROPS argument.
 'big5
      Big5 (the encoding commonly used for Taiwanese).
 'ccl
@@ -882,7 +882,6 @@ if TYPE is 'ccl:
        (name, type, doc_string, props))
 {
   Lisp_Coding_System *codesys;
-  Lisp_Object rest, key, value;
   enum coding_system_type ty;
   int need_to_setup_eol_systems = 1;
 
@@ -914,92 +913,94 @@ if TYPE is 'ccl:
     CHECK_STRING (doc_string);
   CODING_SYSTEM_DOC_STRING (codesys) = doc_string;
 
-  EXTERNAL_PROPERTY_LIST_LOOP (rest, key, value, props)
-    {
-      if (EQ (key, Qmnemonic))
-       {
-          if (!NILP (value))
-           CHECK_STRING (value);
-         CODING_SYSTEM_MNEMONIC (codesys) = value;
-       }
+  {
+    EXTERNAL_PROPERTY_LIST_LOOP_3 (key, value, props)
+      {
+       if (EQ (key, Qmnemonic))
+         {
+           if (!NILP (value))
+             CHECK_STRING (value);
+           CODING_SYSTEM_MNEMONIC (codesys) = value;
+         }
 
-      else if (EQ (key, Qeol_type))
-       {
-         need_to_setup_eol_systems = NILP (value);
-         if (EQ (value, Qt))
-           value = Qnil;
-         CODING_SYSTEM_EOL_TYPE (codesys) = symbol_to_eol_type (value);
-       }
+       else if (EQ (key, Qeol_type))
+         {
+           need_to_setup_eol_systems = NILP (value);
+           if (EQ (value, Qt))
+             value = Qnil;
+           CODING_SYSTEM_EOL_TYPE (codesys) = symbol_to_eol_type (value);
+         }
 
-      else if (EQ (key, Qpost_read_conversion)) CODING_SYSTEM_POST_READ_CONVERSION (codesys) = value;
-      else if (EQ (key, Qpre_write_conversion)) CODING_SYSTEM_PRE_WRITE_CONVERSION (codesys) = value;
+       else if (EQ (key, Qpost_read_conversion)) CODING_SYSTEM_POST_READ_CONVERSION (codesys) = value;
+       else if (EQ (key, Qpre_write_conversion)) CODING_SYSTEM_PRE_WRITE_CONVERSION (codesys) = value;
 #ifdef MULE
-      else if (ty == CODESYS_ISO2022)
-       {
+       else if (ty == CODESYS_ISO2022)
+         {
 #define FROB_INITIAL_CHARSET(charset_num) \
   CODING_SYSTEM_ISO2022_INITIAL_CHARSET (codesys, charset_num) = \
     ((EQ (value, Qt) || EQ (value, Qnil)) ? value : Fget_charset (value))
 
-         if      (EQ (key, Qcharset_g0)) FROB_INITIAL_CHARSET (0);
-         else if (EQ (key, Qcharset_g1)) FROB_INITIAL_CHARSET (1);
-         else if (EQ (key, Qcharset_g2)) FROB_INITIAL_CHARSET (2);
-         else if (EQ (key, Qcharset_g3)) FROB_INITIAL_CHARSET (3);
+           if      (EQ (key, Qcharset_g0)) FROB_INITIAL_CHARSET (0);
+           else if (EQ (key, Qcharset_g1)) FROB_INITIAL_CHARSET (1);
+           else if (EQ (key, Qcharset_g2)) FROB_INITIAL_CHARSET (2);
+           else if (EQ (key, Qcharset_g3)) FROB_INITIAL_CHARSET (3);
 
 #define FROB_FORCE_CHARSET(charset_num) \
   CODING_SYSTEM_ISO2022_FORCE_CHARSET_ON_OUTPUT (codesys, charset_num) = !NILP (value)
 
-         else if (EQ (key, Qforce_g0_on_output)) FROB_FORCE_CHARSET (0);
-         else if (EQ (key, Qforce_g1_on_output)) FROB_FORCE_CHARSET (1);
-         else if (EQ (key, Qforce_g2_on_output)) FROB_FORCE_CHARSET (2);
-         else if (EQ (key, Qforce_g3_on_output)) FROB_FORCE_CHARSET (3);
+           else if (EQ (key, Qforce_g0_on_output)) FROB_FORCE_CHARSET (0);
+           else if (EQ (key, Qforce_g1_on_output)) FROB_FORCE_CHARSET (1);
+           else if (EQ (key, Qforce_g2_on_output)) FROB_FORCE_CHARSET (2);
+           else if (EQ (key, Qforce_g3_on_output)) FROB_FORCE_CHARSET (3);
 
 #define FROB_BOOLEAN_PROPERTY(prop) \
   CODING_SYSTEM_ISO2022_##prop (codesys) = !NILP (value)
 
-         else if (EQ (key, Qshort))         FROB_BOOLEAN_PROPERTY (SHORT);
-         else if (EQ (key, Qno_ascii_eol))  FROB_BOOLEAN_PROPERTY (NO_ASCII_EOL);
-         else if (EQ (key, Qno_ascii_cntl)) FROB_BOOLEAN_PROPERTY (NO_ASCII_CNTL);
-         else if (EQ (key, Qseven))         FROB_BOOLEAN_PROPERTY (SEVEN);
-         else if (EQ (key, Qlock_shift))    FROB_BOOLEAN_PROPERTY (LOCK_SHIFT);
-         else if (EQ (key, Qno_iso6429))    FROB_BOOLEAN_PROPERTY (NO_ISO6429);
-         else if (EQ (key, Qescape_quoted)) FROB_BOOLEAN_PROPERTY (ESCAPE_QUOTED);
-
-         else if (EQ (key, Qinput_charset_conversion))
-           {
-             codesys->iso2022.input_conv =
-               Dynarr_new (charset_conversion_spec);
-             parse_charset_conversion_specs (codesys->iso2022.input_conv,
-                                             value);
-           }
-         else if (EQ (key, Qoutput_charset_conversion))
-           {
-             codesys->iso2022.output_conv =
-               Dynarr_new (charset_conversion_spec);
-             parse_charset_conversion_specs (codesys->iso2022.output_conv,
-                                             value);
-           }
-         else
-           signal_simple_error ("Unrecognized property", key);
-       }
-      else if (EQ (type, Qccl))
-       {
-         if (EQ (key, Qdecode))
-           {
-             CHECK_VECTOR (value);
-             CODING_SYSTEM_CCL_DECODE (codesys) = value;
-           }
-         else if (EQ (key, Qencode))
-           {
-             CHECK_VECTOR (value);
-             CODING_SYSTEM_CCL_ENCODE (codesys) = value;
-           }
-         else
-           signal_simple_error ("Unrecognized property", key);
-       }
+           else if (EQ (key, Qshort))         FROB_BOOLEAN_PROPERTY (SHORT);
+           else if (EQ (key, Qno_ascii_eol))  FROB_BOOLEAN_PROPERTY (NO_ASCII_EOL);
+           else if (EQ (key, Qno_ascii_cntl)) FROB_BOOLEAN_PROPERTY (NO_ASCII_CNTL);
+           else if (EQ (key, Qseven))         FROB_BOOLEAN_PROPERTY (SEVEN);
+           else if (EQ (key, Qlock_shift))    FROB_BOOLEAN_PROPERTY (LOCK_SHIFT);
+           else if (EQ (key, Qno_iso6429))    FROB_BOOLEAN_PROPERTY (NO_ISO6429);
+           else if (EQ (key, Qescape_quoted)) FROB_BOOLEAN_PROPERTY (ESCAPE_QUOTED);
+
+           else if (EQ (key, Qinput_charset_conversion))
+             {
+               codesys->iso2022.input_conv =
+                 Dynarr_new (charset_conversion_spec);
+               parse_charset_conversion_specs (codesys->iso2022.input_conv,
+                                               value);
+             }
+           else if (EQ (key, Qoutput_charset_conversion))
+             {
+               codesys->iso2022.output_conv =
+                 Dynarr_new (charset_conversion_spec);
+               parse_charset_conversion_specs (codesys->iso2022.output_conv,
+                                               value);
+             }
+           else
+             signal_simple_error ("Unrecognized property", key);
+         }
+       else if (EQ (type, Qccl))
+         {
+           if (EQ (key, Qdecode))
+             {
+               CHECK_VECTOR (value);
+               CODING_SYSTEM_CCL_DECODE (codesys) = value;
+             }
+           else if (EQ (key, Qencode))
+             {
+               CHECK_VECTOR (value);
+               CODING_SYSTEM_CCL_ENCODE (codesys) = value;
+             }
+           else
+             signal_simple_error ("Unrecognized property", key);
+         }
 #endif /* MULE */
-      else
-       signal_simple_error ("Unrecognized property", key);
-    }
+       else
+         signal_simple_error ("Unrecognized property", key);
+      }
+  }
 
   if (need_to_setup_eol_systems)
     setup_eol_coding_systems (codesys);
@@ -1218,7 +1219,7 @@ subsidiary_coding_system (Lisp_Object coding_system, eol_type_t type)
     case EOL_LF:   new_coding_system = CODING_SYSTEM_EOL_LF   (cs); break;
     case EOL_CR:   new_coding_system = CODING_SYSTEM_EOL_CR   (cs); break;
     case EOL_CRLF: new_coding_system = CODING_SYSTEM_EOL_CRLF (cs); break;
-    default:       abort ();
+    default:       abort (); return Qnil;
     }
 
   return NILP (new_coding_system) ? coding_system : new_coding_system;
@@ -3443,13 +3444,13 @@ Return T on success, NIL on failure.
 */
        (code, character))
 {
-  unsigned int c;
+  size_t c;
 
   CHECK_CHAR (character);
-  CHECK_INT (code);
+  CHECK_NATNUM (code);
   c = XINT (code);
 
-  if (c < sizeof (fcd->ucs_to_mule_table))
+  if (c < countof (fcd->ucs_to_mule_table))
     {
       fcd->ucs_to_mule_table[c] = character;
       return Qt;
@@ -3461,7 +3462,7 @@ Return T on success, NIL on failure.
 static Lisp_Object
 ucs_to_char (unsigned long code)
 {
-  if (code < sizeof (fcd->ucs_to_mule_table))
+  if (code < countof (fcd->ucs_to_mule_table))
     {
       return fcd->ucs_to_mule_table[code];
     }
@@ -4557,6 +4558,7 @@ parse_iso2022_esc (Lisp_Object codesys, struct iso2022_decoder *iso,
          {
            /* Can this ever be reached? -slb */
            abort();
+           return 0;
          }
 
        cs = CHARSET_BY_ATTRIBUTES (type, c,
@@ -5567,8 +5569,7 @@ syms_of_file_coding (void)
 {
   INIT_LRECORD_IMPLEMENTATION (coding_system);
 
-  deferror (&Qcoding_system_error, "coding-system-error",
-           "Coding-system error", Qio_error);
+  DEFERROR_STANDARD (Qcoding_system_error, Qio_error);
 
   DEFSUBR (Fcoding_system_p);
   DEFSUBR (Ffind_coding_system);
@@ -5835,9 +5836,9 @@ complex_vars_of_file_coding (void)
 
 #ifdef MULE
   {
-    unsigned int i;
+    size_t i;
 
-    for (i = 0; i < 65536; i++)
+    for (i = 0; i < countof (fcd->ucs_to_mule_table); i++)
       fcd->ucs_to_mule_table[i] = Qnil;
   }
   staticpro (&mule_to_ucs_table);
index e8f7549..49f9262 100644 (file)
@@ -400,7 +400,7 @@ Given a Unix syntax file name, returns a string ending in slash.
 */
        (file))
 {
-  /* This function can GC.  GC checked 1997.04.06. */
+  /* This function can GC.  GC checked 2000-07-28 ben */
   Bufbyte *beg;
   Bufbyte *p;
   Lisp_Object handler;
@@ -459,7 +459,7 @@ or the entire name if it contains no slash.
 */
        (file))
 {
-  /* This function can GC.  GC checked 1997.04.06. */
+  /* This function can GC.  GC checked 2000-07-28 ben */
   Bufbyte *beg, *p, *end;
   Lisp_Object handler;
 
@@ -495,7 +495,7 @@ get a current directory to run processes in.
 */
   (filename))
 {
-  /* This function can GC.  GC checked 1997.04.06. */
+  /* This function can GC.  GC checked 2000-07-28 ben */
   Lisp_Object handler;
 
   /* If the file name has special constructs in it,
@@ -512,6 +512,7 @@ get a current directory to run processes in.
 static char *
 file_name_as_directory (char *out, char *in)
 {
+  /* This function cannot GC */
   int size = strlen (in);
 
   if (size == 0)
@@ -544,7 +545,7 @@ except for (file-name-as-directory \"\") => \"./\".
 */
        (file))
 {
-  /* This function can GC.  GC checked 1997.04.06. */
+  /* This function can GC.  GC checked 2000-07-28 ben */
   char *buf;
   Lisp_Object handler;
 
@@ -571,6 +572,7 @@ except for (file-name-as-directory \"\") => \"./\".
 static int
 directory_file_name (const char *src, char *dst)
 {
+  /* This function cannot GC */
   long slen = strlen (src);
   /* Process as Unix format: just remove any final slash.
      But leave "/" unchanged; do not change it to "".  */
@@ -594,7 +596,7 @@ In Unix-syntax, this function just removes the final slash.
 */
        (directory))
 {
-  /* This function can GC.  GC checked 1997.04.06. */
+  /* This function can GC.  GC checked 2000-07-28 ben */
   char *buf;
   Lisp_Object handler;
 
@@ -706,7 +708,7 @@ be an absolute file name.
 
       QUIT;
 
-      if (stat ((const char *) data, &ignored) < 0)
+      if (xemacs_stat ((const char *) data, &ignored) < 0)
        {
          /* We want to return only if errno is ENOENT.  */
          if (errno == ENOENT)
@@ -740,7 +742,7 @@ See also the function `substitute-in-file-name'.
 */
        (name, default_directory))
 {
-  /* This function can GC */
+  /* This function can GC.  GC-checked 2000-07-11 ben */
   Bufbyte *nm;
 
   Bufbyte *newdir, *p, *o;
@@ -757,6 +759,10 @@ See also the function `substitute-in-file-name'.
 #ifdef CYGWIN
   char *user;
 #endif
+  struct gcpro gcpro1, gcpro2;
+
+  /* both of these get set below */
+  GCPRO2 (name, default_directory);
 
   CHECK_STRING (name);
 
@@ -764,8 +770,11 @@ See also the function `substitute-in-file-name'.
      call the corresponding file handler.  */
   handler = Ffind_file_name_handler (name, Qexpand_file_name);
   if (!NILP (handler))
-    return call3_check_string (handler, Qexpand_file_name, name,
-                              default_directory);
+    {
+      UNGCPRO;
+      return call3_check_string (handler, Qexpand_file_name, name,
+                                default_directory);
+    }
 
   /* Use the buffer's default-directory if DEFAULT_DIRECTORY is omitted.  */
   if (NILP (default_directory))
@@ -777,7 +786,10 @@ See also the function `substitute-in-file-name'.
     {
       handler = Ffind_file_name_handler (default_directory, Qexpand_file_name);
       if (!NILP (handler))
-       return call3 (handler, Qexpand_file_name, name, default_directory);
+       {
+         UNGCPRO;
+         return call3 (handler, Qexpand_file_name, name, default_directory);
+       }
     }
 
   o = XSTRING_DATA (default_directory);
@@ -809,13 +821,8 @@ See also the function `substitute-in-file-name'.
       && ! (IS_DIRECTORY_SEP (o[0]))
 #endif /* not WIN32_NATIVE */
       )
-    {
-      struct gcpro gcpro1;
 
-      GCPRO1 (name);
-      default_directory = Fexpand_file_name (default_directory, Qnil);
-      UNGCPRO;
-    }
+    default_directory = Fexpand_file_name (default_directory, Qnil);
 
 #ifdef FILE_SYSTEM_CASE
   name = FILE_SYSTEM_CASE (name);
@@ -918,11 +925,11 @@ See also the function `substitute-in-file-name'.
              XSTRING_DATA (name)[0] = DRIVE_LETTER (drive);
              XSTRING_DATA (name)[1] = ':';
            }
-         return name;
+         RETURN_UNGCPRO (name);
 #else /* not WIN32_NATIVE */
          if (nm == XSTRING_DATA (name))
-           return name;
-         return build_string ((char *) nm);
+           RETURN_UNGCPRO (name);
+         RETURN_UNGCPRO (build_string ((char *) nm));
 #endif /* not WIN32_NATIVE */
        }
     }
@@ -1236,7 +1243,7 @@ See also the function `substitute-in-file-name'.
   CORRECT_DIR_SEPS (target);
 #endif /* WIN32_NATIVE */
 
-  return make_string (target, o - target);
+  RETURN_UNGCPRO (make_string (target, o - target));
 }
 
 DEFUN ("file-truename", Ffile_truename, 1, 2, 0, /*
@@ -1249,7 +1256,7 @@ No component of the resulting pathname will be a symbolic link, as
 */
        (filename, default_))
 {
-  /* This function can GC. */
+  /* This function can GC.  GC checked 2000-07-28 ben. */
   Lisp_Object expanded_name;
   struct gcpro gcpro1;
 
@@ -1257,11 +1264,11 @@ No component of the resulting pathname will be a symbolic link, as
 
   expanded_name = Fexpand_file_name (filename, default_);
 
-  GCPRO1 (expanded_name);
-
   if (!STRINGP (expanded_name))
     return Qnil;
 
+  GCPRO1 (expanded_name);
+
   {
     Lisp_Object handler =
       Ffind_file_name_handler (expanded_name, Qfile_truename);
@@ -1389,7 +1396,7 @@ If `/~' appears, all of FILENAME through that `/' is discarded.
 */
        (string))
 {
-  /* This function can GC.  GC checked 1997.04.06. */
+  /* This function can GC.  GC checked 2000-07-28 ben. */
   Bufbyte *nm;
 
   Bufbyte *s, *p, *o, *x, *endp;
@@ -1565,12 +1572,13 @@ If `/~' appears, all of FILENAME through that `/' is discarded.
   return make_string (xnm, x - xnm);
 
  badsubst:
-  error ("Bad format environment-variable substitution");
+  syntax_error ("Bad format environment-variable substitution", string);
  missingclose:
-  error ("Missing \"}\" in environment-variable substitution");
+  syntax_error ("Missing \"}\" in environment-variable substitution",
+               string);
  badvar:
-  error ("Substituting nonexistent environment variable \"%s\"",
-        target);
+  syntax_error_2 ("Substituting nonexistent environment variable",
+                 string, build_string (target));
 
   /* NOTREACHED */
   return Qnil; /* suppress compiler warning */
@@ -1582,7 +1590,7 @@ If `/~' appears, all of FILENAME through that `/' is discarded.
 Lisp_Object
 expand_and_dir_to_file (Lisp_Object filename, Lisp_Object defdir)
 {
-  /* This function can call lisp */
+  /* This function can call Lisp.  GC checked 2000-07-28 ben */
   Lisp_Object abspath;
   struct gcpro gcpro1;
 
@@ -1611,12 +1619,12 @@ static void
 barf_or_query_if_file_exists (Lisp_Object absname, const char *querystring,
                              int interactive, struct stat *statptr)
 {
-  /* This function can GC.  GC checked 1997.04.06. */
+  /* This function can call Lisp.  GC checked 2000-07-28 ben */
   struct stat statbuf;
 
   /* stat is a good way to tell whether the file exists,
      regardless of what access permissions it has.  */
-  if (stat ((char *) XSTRING_DATA (absname), &statbuf) >= 0)
+  if (xemacs_stat ((char *) XSTRING_DATA (absname), &statbuf) >= 0)
     {
       Lisp_Object tem;
 
@@ -1665,7 +1673,7 @@ A prefix arg makes KEEP-TIME non-nil.
 */
        (filename, newname, ok_if_already_exists, keep_time))
 {
-  /* This function can GC.  GC checked 1997.04.06. */
+  /* This function can call Lisp.  GC checked 2000-07-28 ben */
   int ifd, ofd, n;
   char buf[16 * 1024];
   struct stat st, out_st;
@@ -1707,8 +1715,10 @@ A prefix arg makes KEEP-TIME non-nil.
       args[1] = Qnil; args[2] = Qnil;
       NGCPRO1 (*args);
       ngcpro1.nvars = 3;
-      if (XSTRING_BYTE (newname, XSTRING_LENGTH (newname) - 1) != '/')
-       args[i++] = build_string ("/");
+      if (!IS_DIRECTORY_SEP (XSTRING_BYTE (newname,
+                                          XSTRING_LENGTH (newname) - 1)))
+
+       args[i++] = Fchar_to_string (Vdirectory_sep_char);
       args[i++] = Ffile_name_nondirectory (filename);
       newname = Fconcat (i, args);
       NUNGCPRO;
@@ -1718,7 +1728,7 @@ A prefix arg makes KEEP-TIME non-nil.
       || INTP (ok_if_already_exists))
     barf_or_query_if_file_exists (newname, "copy to it",
                                  INTP (ok_if_already_exists), &out_st);
-  else if (stat ((const char *) XSTRING_DATA (newname), &out_st) < 0)
+  else if (xemacs_stat ((const char *) XSTRING_DATA (newname), &out_st) < 0)
     out_st.st_mode = 0;
 
   ifd = interruptible_open ((char *) XSTRING_DATA (filename), O_RDONLY | OPEN_BINARY, 0);
@@ -1781,19 +1791,19 @@ A prefix arg makes KEEP-TIME non-nil.
       report_file_error ("I/O error", list1 (newname));
 
     if (input_file_statable_p)
-    {
-      if (!NILP (keep_time))
       {
-        EMACS_TIME atime, mtime;
-        EMACS_SET_SECS_USECS (atime, st.st_atime, 0);
-        EMACS_SET_SECS_USECS (mtime, st.st_mtime, 0);
-        if (set_file_times ((char *) XSTRING_DATA (newname), atime,
-                           mtime))
-         report_file_error ("I/O error", list1 (newname));
+       if (!NILP (keep_time))
+         {
+           EMACS_TIME atime, mtime;
+           EMACS_SET_SECS_USECS (atime, st.st_atime, 0);
+           EMACS_SET_SECS_USECS (mtime, st.st_mtime, 0);
+           if (set_file_times ((char *) XSTRING_DATA (newname), atime,
+                               mtime))
+             report_file_error ("I/O error", list1 (newname));
+         }
+       chmod ((const char *) XSTRING_DATA (newname),
+              st.st_mode & 07777);
       }
-      chmod ((const char *) XSTRING_DATA (newname),
-            st.st_mode & 07777);
-    }
 
     /* We'll close it by hand */
     XCAR (ofd_locative) = Qnil;
@@ -2130,8 +2140,8 @@ Open a network connection to PATH using LOGIN as the login string.
   /* netunam, being a strange-o system call only used once, is not
      encapsulated. */
 
-  TO_EXTERNAL_FORMAT (LISP_STRING, path,  C_STRING_ALLOCA, path_ext,  Qfile_name);
-  TO_EXTERNAL_FORMAT (LISP_STRING, login, C_STRING_ALLOCA, login_ext, Qnative);
+  LISP_STRING_TO_EXTERNAL (path, path_ext, Qfile_name);
+  LISP_STRING_TO_EXTERNAL (login, login_ext, Qnative);
 
   netresult = netunam (path_ext, login_ext);
 
@@ -2164,17 +2174,17 @@ check_executable (char *filename)
 {
 #ifdef WIN32_NATIVE
   struct stat st;
-  if (stat (filename, &st) < 0)
+  if (xemacs_stat (filename, &st) < 0)
     return 0;
   return ((st.st_mode & S_IEXEC) != 0);
 #else /* not WIN32_NATIVE */
 #ifdef HAVE_EACCESS
-  return eaccess (filename, 1) >= 0;
+  return eaccess (filename, X_OK) >= 0;
 #else
   /* Access isn't quite right because it uses the real uid
      and we really want to test with the effective uid.
      But Unix doesn't give us a right way to do it.  */
-  return access (filename, 1) >= 0;
+  return access (filename, X_OK) >= 0;
 #endif /* HAVE_EACCESS */
 #endif /* not WIN32_NATIVE */
 }
@@ -2185,14 +2195,14 @@ static int
 check_writable (const char *filename)
 {
 #ifdef HAVE_EACCESS
-  return (eaccess (filename, 2) >= 0);
+  return (eaccess (filename, W_OK) >= 0);
 #else
   /* Access isn't quite right because it uses the real uid
      and we really want to test with the effective uid.
      But Unix doesn't give us a right way to do it.
      Opening with O_WRONLY could work for an ordinary file,
      but would lose for directories.  */
-  return (access (filename, 2) >= 0);
+  return (access (filename, W_OK) >= 0);
 #endif
 }
 
@@ -2202,7 +2212,7 @@ See also `file-readable-p' and `file-attributes'.
 */
        (filename))
 {
-  /* This function can call lisp */
+  /* This function can call lisp; GC checked 2000-07-11 ben */
   Lisp_Object abspath;
   Lisp_Object handler;
   struct stat statbuf;
@@ -2219,7 +2229,7 @@ See also `file-readable-p' and `file-attributes'.
   if (!NILP (handler))
     return call2 (handler, Qfile_exists_p, abspath);
 
-  return stat ((char *) XSTRING_DATA (abspath), &statbuf) >= 0 ? Qt : Qnil;
+  return xemacs_stat ((char *) XSTRING_DATA (abspath), &statbuf) >= 0 ? Qt : Qnil;
 }
 
 DEFUN ("file-executable-p", Ffile_executable_p, 1, 1, 0, /*
@@ -2229,7 +2239,7 @@ For a directory, this means you can access files in that directory.
        (filename))
 
 {
-  /* This function can GC.  GC checked 1997.04.10. */
+  /* This function can GC.  GC checked 07-11-2000 ben. */
   Lisp_Object abspath;
   Lisp_Object handler;
   struct gcpro gcpro1;
@@ -2312,7 +2322,7 @@ Return t if file FILENAME can be written or created by you.
   if (!NILP (handler))
     return call2 (handler, Qfile_writable_p, abspath);
 
-  if (stat ((char *) XSTRING_DATA (abspath), &statbuf) >= 0)
+  if (xemacs_stat ((char *) XSTRING_DATA (abspath), &statbuf) >= 0)
     return (check_writable ((char *) XSTRING_DATA (abspath))
            ? Qt : Qnil);
 
@@ -2405,7 +2415,7 @@ if the directory so specified exists and really is a directory.
   if (!NILP (handler))
     return call2 (handler, Qfile_directory_p, abspath);
 
-  if (stat ((char *) XSTRING_DATA (abspath), &st) < 0)
+  if (xemacs_stat ((char *) XSTRING_DATA (abspath), &st) < 0)
     return Qnil;
   return (st.st_mode & S_IFMT) == S_IFDIR ? Qt : Qnil;
 }
@@ -2478,7 +2488,7 @@ This is the sort of file that holds an ordinary stream of data bytes.
   if (!NILP (handler))
     return call2 (handler, Qfile_regular_p, abspath);
 
-  if (stat ((char *) XSTRING_DATA (abspath), &st) < 0)
+  if (xemacs_stat ((char *) XSTRING_DATA (abspath), &st) < 0)
     return Qnil;
   return (st.st_mode & S_IFMT) == S_IFREG ? Qt : Qnil;
 }
@@ -2507,7 +2517,7 @@ Return mode bits of FILE, as an integer.
   if (!NILP (handler))
     return call2 (handler, Qfile_modes, abspath);
 
-  if (stat ((char *) XSTRING_DATA (abspath), &st) < 0)
+  if (xemacs_stat ((char *) XSTRING_DATA (abspath), &st) < 0)
     return Qnil;
   /* Syncing with FSF 19.34.6 note: not in FSF, #if 0'ed out here. */
 #if 0
@@ -2629,12 +2639,12 @@ otherwise, if FILE2 does not exist, the answer is t.
     return call3 (handler, Qfile_newer_than_file_p, abspath1,
                  abspath2);
 
-  if (stat ((char *) XSTRING_DATA (abspath1), &st) < 0)
+  if (xemacs_stat ((char *) XSTRING_DATA (abspath1), &st) < 0)
     return Qnil;
 
   mtime1 = st.st_mtime;
 
-  if (stat ((char *) XSTRING_DATA (abspath2), &st) < 0)
+  if (xemacs_stat ((char *) XSTRING_DATA (abspath2), &st) < 0)
     return Qt;
 
   return (mtime1 > st.st_mtime) ? Qt : Qnil;
@@ -2724,7 +2734,7 @@ positions), even in Mule. (Fixing this is very difficult.)
 
   fd = -1;
 
-  if (stat ((char *) XSTRING_DATA (filename), &st) < 0)
+  if (xemacs_stat ((char *) XSTRING_DATA (filename), &st) < 0)
     {
       if (fd >= 0) close (fd);
     badopen:
@@ -3111,12 +3121,12 @@ to the value of CODESYS.  If this is nil, no code conversion occurs.
 */
        (start, end, filename, append, visit, lockname, codesys))
 {
-  /* This function can call lisp */
+  /* This function can call lisp.  GC checked 2000-07-28 ben */
   int desc;
   int failure;
   int save_errno = 0;
   struct stat st;
-  Lisp_Object fn;
+  Lisp_Object fn = Qnil;
   int speccount = specpdl_depth ();
   int visiting_other = STRINGP (visit);
   int visiting = (EQ (visit, Qt) || visiting_other);
@@ -3125,28 +3135,37 @@ to the value of CODESYS.  If this is nil, no code conversion occurs.
   Lisp_Object annotations = Qnil;
   struct buffer *given_buffer;
   Bufpos start1, end1;
+  struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
+  struct gcpro ngcpro1, ngcpro2;
+  Lisp_Object curbuf;
 
-  /* #### dmoore - if Fexpand_file_name or handlers kill the buffer,
+  XSETBUFFER (curbuf, current_buffer);
+
+  /* start, end, visit, and append are never modified in this fun
+     so we don't protect them. */
+  GCPRO5 (visit_file, filename, codesys, lockname, annotations);
+  NGCPRO2 (curbuf, fn);
+
+  /* [[ dmoore - if Fexpand_file_name or handlers kill the buffer,
      we should signal an error rather than blissfully continuing
      along.  ARGH, this function is going to lose lose lose.  We need
      to protect the current_buffer from being destroyed, but the
-     multiple return points make this a pain in the butt. */
+     multiple return points make this a pain in the butt. ]] we do
+     protect curbuf now. --ben */
 
 #ifdef FILE_CODING
   codesys = Fget_coding_system (codesys);
 #endif /* FILE_CODING */
 
   if (current_buffer->base_buffer && ! NILP (visit))
-    error ("Cannot do file visiting in an indirect buffer");
+    invalid_operation ("Cannot do file visiting in an indirect buffer",
+                      curbuf);
 
   if (!NILP (start) && !STRINGP (start))
     get_buffer_range_char (current_buffer, start, end, &start1, &end1, 0);
 
   {
     Lisp_Object handler;
-    struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
-
-    GCPRO5 (start, filename, visit, visit_file, lockname);
 
     if (visiting_other)
       visit_file = Fexpand_file_name (visit, Qnil);
@@ -3154,11 +3173,11 @@ to the value of CODESYS.  If this is nil, no code conversion occurs.
       visit_file = filename;
     filename = Fexpand_file_name (filename, Qnil);
 
-    UNGCPRO;
-
     if (NILP (lockname))
       lockname = visit_file;
 
+    /* We used to UNGCPRO here.  BAD!  visit_file is used below after
+       more Lisp calling. */
     /* If the file name has special constructs in it,
        call the corresponding file handler.  */
     handler = Ffind_file_name_handler (filename, Qwrite_region);
@@ -3177,21 +3196,15 @@ to the value of CODESYS.  If this is nil, no code conversion occurs.
            current_buffer->filename = visit_file;
            MARK_MODELINE_CHANGED;
          }
+       NUNGCPRO;
+       UNGCPRO;
        return val;
       }
   }
 
 #ifdef CLASH_DETECTION
   if (!auto_saving)
-    {
-      Lisp_Object curbuf;
-      struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
-
-      XSETBUFFER (curbuf, current_buffer);
-      GCPRO5 (start, filename, visit_file, lockname, curbuf);
-      lock_file (lockname);
-      UNGCPRO;
-    }
+    lock_file (lockname);
 #endif /* CLASH_DETECTION */
 
   /* Special kludge to simplify auto-saving.  */
@@ -3237,9 +3250,9 @@ to the value of CODESYS.  If this is nil, no code conversion occurs.
   {
     Lisp_Object desc_locative = Fcons (make_int (desc), Qnil);
     Lisp_Object instream = Qnil, outstream = Qnil;
-    struct gcpro gcpro1, gcpro2;
+    struct gcpro nngcpro1, nngcpro2;
     /* need to gcpro; QUIT could happen out of call to write() */
-    GCPRO2 (instream, outstream);
+    NNGCPRO2 (instream, outstream);
 
     record_unwind_protect (close_file_unwind, desc_locative);
 
@@ -3297,7 +3310,6 @@ to the value of CODESYS.  If this is nil, no code conversion occurs.
        save_errno = errno;
       }
     Lstream_close (XLSTREAM (instream));
-    UNGCPRO;
 
 #ifdef HAVE_FSYNC
     /* Note fsync appears to change the modtime on BSD4.2 (both vax and sun).
@@ -3317,7 +3329,7 @@ to the value of CODESYS.  If this is nil, no code conversion occurs.
        systems where close() can change the modtime.  This is known to
        happen on various NFS file systems, on Windows, and on Linux.
        Rather than handling this on a per-system basis, we
-       unconditionally do the stat() after the close(). */
+       unconditionally do the xemacs_stat() after the close(). */
 
     /* NFS can report a write failure now.  */
     if (close (desc) < 0)
@@ -3331,9 +3343,11 @@ to the value of CODESYS.  If this is nil, no code conversion occurs.
        as necessary). */
     XCAR (desc_locative) = Qnil;
     unbind_to (speccount, Qnil);
+
+    NNUNGCPRO;
   }
 
-  stat ((char *) XSTRING_DATA (fn), &st);
+  xemacs_stat ((char *) XSTRING_DATA (fn), &st);
 
 #ifdef CLASH_DETECTION
   if (!auto_saving)
@@ -3347,9 +3361,10 @@ to the value of CODESYS.  If this is nil, no code conversion occurs.
     current_buffer->modtime = st.st_mtime;
 
   if (failure)
-    error ("IO error writing %s: %s",
-           XSTRING_DATA (fn),
-           strerror (save_errno));
+    {
+      errno = save_errno;
+      report_file_error ("Writing file", list1 (fn));
+    }
 
   if (visiting)
     {
@@ -3360,6 +3375,8 @@ to the value of CODESYS.  If this is nil, no code conversion occurs.
     }
   else if (quietly)
     {
+      NUNGCPRO;
+      UNGCPRO;
       return Qnil;
     }
 
@@ -3369,19 +3386,21 @@ to the value of CODESYS.  If this is nil, no code conversion occurs.
         message ("Wrote %s", XSTRING_DATA (visit_file));
       else
        {
-         struct gcpro gcpro1;
          Lisp_Object fsp;
-         GCPRO1 (fn);
+         struct gcpro nngcpro1;
 
+         NNGCPRO1 (fsp);
          fsp = Ffile_symlink_p (fn);
          if (NILP (fsp))
            message ("Wrote %s", XSTRING_DATA (fn));
          else
            message ("Wrote %s (symlink to %s)",
                     XSTRING_DATA (fn), XSTRING_DATA (fsp));
-         UNGCPRO;
+         NNUNGCPRO;
        }
     }
+  NUNGCPRO;
+  UNGCPRO;
   return Qnil;
 }
 
@@ -3633,7 +3652,7 @@ This means that the file has not been changed since it was visited or saved.
 */
        (buf))
 {
-  /* This function can call lisp */
+  /* This function can call lisp; GC checked 2000-07-11 ben */
   struct buffer *b;
   struct stat st;
   Lisp_Object handler;
@@ -3651,7 +3670,7 @@ This means that the file has not been changed since it was visited or saved.
   if (!NILP (handler))
     return call2 (handler, Qverify_visited_file_modtime, buf);
 
-  if (stat ((char *) XSTRING_DATA (b->filename), &st) < 0)
+  if (xemacs_stat ((char *) XSTRING_DATA (b->filename), &st) < 0)
     {
       /* If the file doesn't exist now and didn't exist before,
         we say that it isn't modified, provided the error is a tame one.  */
@@ -3723,7 +3742,7 @@ An argument specifies the modification time value to use
       if (!NILP (handler))
        /* The handler can find the file name the same way we did.  */
        return call2 (handler, Qset_visited_file_modtime, Qnil);
-      else if (stat ((char *) XSTRING_DATA (filename), &st) >= 0)
+      else if (xemacs_stat ((char *) XSTRING_DATA (filename), &st) >= 0)
        current_buffer->modtime = st.st_mtime;
     }
 
@@ -3764,7 +3783,7 @@ auto_save_1 (Lisp_Object ignored)
 
   /* Get visited file's mode to become the auto save file's mode.  */
   if (STRINGP (fn) &&
-      stat ((char *) XSTRING_DATA (fn), &st) >= 0)
+      xemacs_stat ((char *) XSTRING_DATA (fn), &st) >= 0)
     /* But make sure we can overwrite it later!  */
     auto_save_mode_bits = st.st_mode | 0600;
   else
@@ -4149,9 +4168,8 @@ syms_of_fileio (void)
   defsymbol (&Qformat_annotate_function, "format-annotate-function");
 
   defsymbol (&Qcompute_buffer_file_truename, "compute-buffer-file-truename");
-  deferror (&Qfile_error, "file-error", "File error", Qio_error);
-  deferror (&Qfile_already_exists, "file-already-exists",
-           "File already exists", Qfile_error);
+  DEFERROR_STANDARD (Qfile_error, Qio_error);
+  DEFERROR_STANDARD (Qfile_already_exists, Qfile_error);
 
   DEFSUBR (Ffind_file_name_handler);
 
index 44df999..7a645c2 100644 (file)
@@ -123,6 +123,7 @@ fill_in_lock_file_name (Bufbyte *lockfile, Lisp_Object fn)
 static int
 lock_file_1 (char *lfname, int force)
 {
+  /* Does not GC. */
   int err;
   char *lock_info_str;
   char *host_name;
@@ -160,6 +161,7 @@ lock_file_1 (char *lfname, int force)
 static int
 current_lock_owner (lock_info_type *owner, char *lfname)
 {
+  /* Does not GC. */
   int len, ret;
   int local_owner = 0;
   char *at, *dot;
@@ -257,6 +259,7 @@ current_lock_owner (lock_info_type *owner, char *lfname)
 static int
 lock_if_free (lock_info_type *clasher, char *lfname)
 {
+  /* Does not GC. */
   if (lock_file_1 (lfname, 0) == 0)
     {
       int locker;
@@ -298,7 +301,7 @@ lock_if_free (lock_info_type *clasher, char *lfname)
 void
 lock_file (Lisp_Object fn)
 {
-  /* This function can GC. */
+  /* This function can GC.  GC checked 7-11-00 ben */
   /* dmoore - and can destroy current_buffer and all sorts of other
      mean nasty things with pointy teeth.  If you call this make sure
      you protect things right. */
@@ -325,7 +328,7 @@ lock_file (Lisp_Object fn)
     if (!NILP (subject_buf)
        && NILP (Fverify_visited_file_modtime (subject_buf))
        && !NILP (Ffile_exists_p (fn)))
-      call1_in_buffer (XBUFFER(subject_buf),
+      call1_in_buffer (XBUFFER (subject_buf),
                       Qask_user_about_supersession_threat, fn);
   }
 
@@ -358,6 +361,7 @@ lock_file (Lisp_Object fn)
 void
 unlock_file (Lisp_Object fn)
 {
+  /* This can GC */
   register char *lfname;
   struct gcpro gcpro1;
 
index e7623f4..3162a1a 100644 (file)
--- a/src/fns.c
+++ b/src/fns.c
@@ -710,6 +710,7 @@ concat (int nargs, Lisp_Object *args,
        string_result_ptr = string_result;
         break;
       default:
+       val = Qnil;
         abort ();
       }
   }
@@ -1219,7 +1220,6 @@ The value is actually the tail of LIST whose car is ELT.
 */
        (elt, list))
 {
-  Lisp_Object list_elt, tail;
   EXTERNAL_LIST_LOOP_3 (list_elt, list, tail)
     {
       if (internal_equal (elt, list_elt, 0))
@@ -1236,7 +1236,6 @@ Do not use it.
 */
        (elt, list))
 {
-  Lisp_Object list_elt, tail;
   EXTERNAL_LIST_LOOP_3 (list_elt, list, tail)
     {
       if (internal_old_equal (elt, list_elt, 0))
@@ -1251,7 +1250,6 @@ The value is actually the tail of LIST whose car is ELT.
 */
        (elt, list))
 {
-  Lisp_Object list_elt, tail;
   EXTERNAL_LIST_LOOP_3 (list_elt, list, tail)
     {
       if (EQ_WITH_EBOLA_NOTICE (elt, list_elt))
@@ -1268,7 +1266,6 @@ Do not use it.
 */
        (elt, list))
 {
-  Lisp_Object list_elt, tail;
   EXTERNAL_LIST_LOOP_3 (list_elt, list, tail)
     {
       if (HACKEQ_UNSAFE (elt, list_elt))
@@ -1280,7 +1277,6 @@ Do not use it.
 Lisp_Object
 memq_no_quit (Lisp_Object elt, Lisp_Object list)
 {
-  Lisp_Object list_elt, tail;
   LIST_LOOP_3 (list_elt, list, tail)
     {
       if (EQ_WITH_EBOLA_NOTICE (elt, list_elt))
@@ -1296,7 +1292,6 @@ The value is actually the element of LIST whose car equals KEY.
        (key, list))
 {
   /* This function can GC. */
-  Lisp_Object elt, elt_car, elt_cdr;
   EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, list)
     {
       if (internal_equal (key, elt_car, 0))
@@ -1312,7 +1307,6 @@ The value is actually the element of LIST whose car equals KEY.
        (key, list))
 {
   /* This function can GC. */
-  Lisp_Object elt, elt_car, elt_cdr;
   EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, list)
     {
       if (internal_old_equal (key, elt_car, 0))
@@ -1336,7 +1330,6 @@ Elements of LIST that are not conses are ignored.
 */
        (key, list))
 {
-  Lisp_Object elt, elt_car, elt_cdr;
   EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, list)
     {
       if (EQ_WITH_EBOLA_NOTICE (key, elt_car))
@@ -1354,7 +1347,6 @@ Do not use it.
 */
        (key, list))
 {
-  Lisp_Object elt, elt_car, elt_cdr;
   EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, list)
     {
       if (HACKEQ_UNSAFE (key, elt_car))
@@ -1370,7 +1362,6 @@ Lisp_Object
 assq_no_quit (Lisp_Object key, Lisp_Object list)
 {
   /* This cannot GC. */
-  Lisp_Object elt;
   LIST_LOOP_2 (elt, list)
     {
       Lisp_Object elt_car = XCAR (elt);
@@ -1386,7 +1377,6 @@ The value is actually the element of LIST whose cdr equals KEY.
 */
        (key, list))
 {
-  Lisp_Object elt, elt_car, elt_cdr;
   EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, list)
     {
       if (internal_equal (key, elt_cdr, 0))
@@ -1401,7 +1391,6 @@ The value is actually the element of LIST whose cdr equals KEY.
 */
        (key, list))
 {
-  Lisp_Object elt, elt_car, elt_cdr;
   EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, list)
     {
       if (internal_old_equal (key, elt_cdr, 0))
@@ -1416,7 +1405,6 @@ The value is actually the element of LIST whose cdr is KEY.
 */
        (key, list))
 {
-  Lisp_Object elt, elt_car, elt_cdr;
   EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, list)
     {
       if (EQ_WITH_EBOLA_NOTICE (key, elt_cdr))
@@ -1431,7 +1419,6 @@ The value is actually the element of LIST whose cdr is KEY.
 */
        (key, list))
 {
-  Lisp_Object elt, elt_car, elt_cdr;
   EXTERNAL_ALIST_LOOP_4 (elt, elt_car, elt_cdr, list)
     {
       if (HACKEQ_UNSAFE (key, elt_cdr))
@@ -1445,7 +1432,6 @@ The value is actually the element of LIST whose cdr is KEY.
 Lisp_Object
 rassq_no_quit (Lisp_Object key, Lisp_Object list)
 {
-  Lisp_Object elt;
   LIST_LOOP_2 (elt, list)
     {
       Lisp_Object elt_cdr = XCDR (elt);
@@ -1466,7 +1452,6 @@ Also see: `remove'.
 */
        (elt, list))
 {
-  Lisp_Object list_elt;
   EXTERNAL_LIST_LOOP_DELETE_IF (list_elt, list,
                                (internal_equal (elt, list_elt, 0)));
   return list;
@@ -1481,7 +1466,6 @@ of changing the value of `foo'.
 */
        (elt, list))
 {
-  Lisp_Object list_elt;
   EXTERNAL_LIST_LOOP_DELETE_IF (list_elt, list,
                                (internal_old_equal (elt, list_elt, 0)));
   return list;
@@ -1496,7 +1480,6 @@ changing the value of `foo'.
 */
        (elt, list))
 {
-  Lisp_Object list_elt;
   EXTERNAL_LIST_LOOP_DELETE_IF (list_elt, list,
                                (EQ_WITH_EBOLA_NOTICE (elt, list_elt)));
   return list;
@@ -1511,7 +1494,6 @@ changing the value of `foo'.
 */
        (elt, list))
 {
-  Lisp_Object list_elt;
   EXTERNAL_LIST_LOOP_DELETE_IF (list_elt, list,
                                (HACKEQ_UNSAFE (elt, list_elt)));
   return list;
@@ -1523,7 +1505,6 @@ changing the value of `foo'.
 Lisp_Object
 delq_no_quit (Lisp_Object elt, Lisp_Object list)
 {
-  Lisp_Object list_elt;
   LIST_LOOP_DELETE_IF (list_elt, list,
                       (EQ_WITH_EBOLA_NOTICE (elt, list_elt)));
   return list;
@@ -1573,7 +1554,6 @@ the value of `foo'.
 */
        (key, list))
 {
-  Lisp_Object elt;
   EXTERNAL_LIST_LOOP_DELETE_IF (elt, list,
                                (CONSP (elt) &&
                                 internal_equal (key, XCAR (elt), 0)));
@@ -1597,7 +1577,6 @@ the value of `foo'.
 */
        (key, list))
 {
-  Lisp_Object elt;
   EXTERNAL_LIST_LOOP_DELETE_IF (elt, list,
                                (CONSP (elt) &&
                                 EQ_WITH_EBOLA_NOTICE (key, XCAR (elt))));
@@ -1609,7 +1588,6 @@ the value of `foo'.
 Lisp_Object
 remassq_no_quit (Lisp_Object key, Lisp_Object list)
 {
-  Lisp_Object elt;
   LIST_LOOP_DELETE_IF (elt, list,
                       (CONSP (elt) &&
                        EQ_WITH_EBOLA_NOTICE (key, XCAR (elt))));
@@ -1625,7 +1603,6 @@ the value of `foo'.
 */
        (value, list))
 {
-  Lisp_Object elt;
   EXTERNAL_LIST_LOOP_DELETE_IF (elt, list,
                                (CONSP (elt) &&
                                 internal_equal (value, XCDR (elt), 0)));
@@ -1641,7 +1618,6 @@ the value of `foo'.
 */
        (value, list))
 {
-  Lisp_Object elt;
   EXTERNAL_LIST_LOOP_DELETE_IF (elt, list,
                                (CONSP (elt) &&
                                 EQ_WITH_EBOLA_NOTICE (value, XCDR (elt))));
@@ -1652,7 +1628,6 @@ the value of `foo'.
 Lisp_Object
 remrassq_no_quit (Lisp_Object value, Lisp_Object list)
 {
-  Lisp_Object elt;
   LIST_LOOP_DELETE_IF (elt, list,
                       (CONSP (elt) &&
                        EQ_WITH_EBOLA_NOTICE (value, XCDR (elt))));
@@ -1692,7 +1667,6 @@ See also the function `nreverse', which is used more often.
        (list))
 {
   Lisp_Object reversed_list = Qnil;
-  Lisp_Object elt;
   EXTERNAL_LIST_LOOP_2 (elt, list)
     {
       reversed_list = Fcons (elt, reversed_list);
@@ -2094,8 +2068,6 @@ static Lisp_Object
 bad_bad_turtle (Lisp_Object *plist, Lisp_Object *badplace, Error_behavior errb)
 {
   if (ERRB_EQ (errb, ERROR_ME))
-    /* #### Eek, this will probably result in another error
-       when PLIST is printed out */
     return Fsignal (Qcircular_property_list, list1 (*plist));
   else
     {
@@ -2958,12 +2930,11 @@ mapcar1 (size_t leni, Lisp_Object *vals,
 
         if (vals == 0) we don't have any free space available and
         don't want to eat up any more stack with alloca().
-        So we use EXTERNAL_LIST_LOOP_3 and GCPRO the tail. */
+        So we use EXTERNAL_LIST_LOOP_3_NO_DECLARE and GCPRO the tail. */
 
       if (vals)
        {
          Lisp_Object *val = vals;
-         Lisp_Object elt;
 
          LIST_LOOP_2 (elt, sequence)
              *val++ = elt;
@@ -2979,12 +2950,13 @@ mapcar1 (size_t leni, Lisp_Object *vals,
       else
        {
          Lisp_Object elt, tail;
+         EMACS_INT len_unused;
          struct gcpro ngcpro1;
 
          NGCPRO1 (tail);
 
          {
-           EXTERNAL_LIST_LOOP_3 (elt, sequence, tail)
+           EXTERNAL_LIST_LOOP_4_NO_DECLARE (elt, sequence, tail, len_unused)
              {
                args[1] = elt;
                Ffuncall (2, args);
@@ -3161,6 +3133,14 @@ length, no consing will take place.
 \f
 /* #### this function doesn't belong in this file! */
 
+#ifdef HAVE_GETLOADAVG
+#ifdef HAVE_SYS_LOADAVG_H
+#include <sys/loadavg.h>
+#endif
+#else
+int getloadavg (double loadavg[], int nelem); /* Defined in getloadavg.c */
+#endif
+
 DEFUN ("load-average", Fload_average, 0, 1, 0, /*
 Return list of 1 minute, 5 minute and 15 minute load averages.
 Each of the three load averages is multiplied by 100,
index 53ea416..6cd74d7 100644 (file)
@@ -368,8 +368,8 @@ setup_context_cache (struct buffer *buf, Bufpos pt)
       /* OK, fine. */
       return;
 #if 0
-    /* This appears to cause huge slowdowns in files like
-       emacsfns.h, which have no top-level forms.
+    /* This appears to cause huge slowdowns in files which have no
+       top-level forms.
 
        In any case, it's not really necessary that we know for
        sure the top-level form we're in; if we're in a form
index 11809e0..9ea792d 100644 (file)
@@ -110,7 +110,7 @@ mswindows_init_frame_1 (struct frame *f, Lisp_Object props)
   /* Pick up relevant properties */
   initially_unmapped = Fplist_get (props, Qinitially_unmapped, Qnil);
   name = Fplist_get (props, Qname, Qnil);
-  
+
   popup = Fplist_get (props, Qpopup, Qnil);
   if (EQ (popup, Qt))
     popup = Fselected_frame (Qnil);
@@ -136,23 +136,23 @@ mswindows_init_frame_1 (struct frame *f, Lisp_Object props)
 
   FRAME_MSWINDOWS_TARGET_RECT (f)->left = NILP (left) ? -1 : abs (XINT (left));
   FRAME_MSWINDOWS_TARGET_RECT (f)->top = NILP (top) ? -1 : abs (XINT (top));
-  FRAME_MSWINDOWS_TARGET_RECT (f)->width = NILP (width) ? -1 : 
+  FRAME_MSWINDOWS_TARGET_RECT (f)->width = NILP (width) ? -1 :
     abs (XINT (width));
-  FRAME_MSWINDOWS_TARGET_RECT (f)->height = NILP (height) ? -1 : 
+  FRAME_MSWINDOWS_TARGET_RECT (f)->height = NILP (height) ? -1 :
     abs (XINT (height));
-      
+
   /* Misc frame stuff */
   FRAME_MSWINDOWS_MENU_HASH_TABLE(f) = Qnil;
 #ifdef HAVE_TOOLBARS
-  FRAME_MSWINDOWS_TOOLBAR_HASH_TABLE(f) = 
+  FRAME_MSWINDOWS_TOOLBAR_HASH_TABLE(f) =
     make_lisp_hash_table (50, HASH_TABLE_NON_WEAK, HASH_TABLE_EQUAL);
 #endif
   /* hashtable of instantiated glyphs on the frame. */
-  FRAME_MSWINDOWS_WIDGET_HASH_TABLE1 (f) = 
+  FRAME_MSWINDOWS_WIDGET_HASH_TABLE1 (f) =
     make_lisp_hash_table (50, HASH_TABLE_VALUE_WEAK, HASH_TABLE_EQUAL);
-  FRAME_MSWINDOWS_WIDGET_HASH_TABLE2 (f) = 
+  FRAME_MSWINDOWS_WIDGET_HASH_TABLE2 (f) =
     make_lisp_hash_table (50, HASH_TABLE_VALUE_WEAK, HASH_TABLE_EQUAL);
-  FRAME_MSWINDOWS_WIDGET_HASH_TABLE3 (f) = 
+  FRAME_MSWINDOWS_WIDGET_HASH_TABLE3 (f) =
     make_lisp_hash_table (50, HASH_TABLE_VALUE_WEAK, HASH_TABLE_EQUAL);
   /* Will initialize these in WM_SIZE handler. We cannot do it now,
      because we do not know what is CW_USEDEFAULT height and width */
@@ -188,6 +188,7 @@ mswindows_init_frame_1 (struct frame *f, Lisp_Object props)
       rect_default.top = rect.top + POPUP_OFFSET;
       char_to_real_pixel_size (f, POPUP_WIDTH, POPUP_HEIGHT,
                               &rect_default.width, &rect_default.height);
+      FRAME_MSWINDOWS_POPUP (f) = 1;
     }
 
   AdjustWindowRectEx(&rect, style, ADJR_MENUFLAG, exstyle);
@@ -199,8 +200,8 @@ mswindows_init_frame_1 (struct frame *f, Lisp_Object props)
   hwnd = CreateWindowEx (exstyle,
                         XEMACS_CLASS,
                         STRINGP(f->name) ? XSTRING_DATA(f->name) :
-                        (STRINGP(name) ? 
-                         (const Extbyte*)XSTRING_DATA(name) : 
+                        (STRINGP(name) ?
+                         (const Extbyte*)XSTRING_DATA(name) :
                          (const Extbyte*)XEMACS_CLASS),
                         style,
                         rect_default.left, rect_default.top,
@@ -210,13 +211,19 @@ mswindows_init_frame_1 (struct frame *f, Lisp_Object props)
   Vmswindows_frame_being_created = Qnil;
 
   if (hwnd == NULL)
-    error ("System call to create frame failed");
-                          
+    invalid_operation ("System call to create frame failed",
+                      STRINGP (f->name) ? f->name :
+                      STRINGP (name) ? name :
+                      Qunbound);
+
   FRAME_MSWINDOWS_HANDLE(f) = hwnd;
 
   SetWindowLong (hwnd, XWL_FRAMEOBJ, (LONG)LISP_TO_VOID(frame_obj));
   FRAME_MSWINDOWS_DC(f) = GetDC (hwnd);
   SetTextAlign (FRAME_MSWINDOWS_DC(f), TA_BASELINE | TA_LEFT | TA_NOUPDATECP);
+
+  if (FRAME_MSWINDOWS_POPUP (f))
+    mswindows_register_popup_frame (frame_obj);
 }
 
 static void
@@ -228,7 +235,7 @@ mswindows_init_frame_2 (struct frame *f, Lisp_Object props)
          since we don't have X resources. This may change if we look
          at the registry. Even so these values can get overridden
          later.*/
-      XEMACS_RECT_WH dest = { -1, -1, DEFAULT_FRAME_WIDTH, 
+      XEMACS_RECT_WH dest = { -1, -1, DEFAULT_FRAME_WIDTH,
                              DEFAULT_FRAME_HEIGHT };
       mswindows_size_frame_internal (f, &dest);
     }
@@ -240,7 +247,7 @@ mswindows_init_frame_3 (struct frame *f)
 {
   /* Don't do this earlier or we get a WM_PAINT before the frame is ready.
    * The SW_x parameter in the first call that an app makes to ShowWindow is
-   * ignored, and the parameter specified in the caller's STARTUPINFO is 
+   * ignored, and the parameter specified in the caller's STARTUPINFO is
    * substituted instead. That parameter is SW_HIDE if we were started by
    * runemacs, so call this twice. #### runemacs is evil */
   ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_SHOWNORMAL);
@@ -254,7 +261,7 @@ mswindows_after_init_frame (struct frame *f, int first_on_device,
                            int first_on_console)
 {
   /* Windows, unlike X, is very synchronous. After the initial
-     frame is created, it will never be displayed, except for 
+     frame is created, it will never be displayed, except for
      hollow border, unless we start pumping messages. Load progress
      messages show in the bottom of the hollow frame, which is ugly.
      We redisplay the initial frame here, so modeline and root window
@@ -287,6 +294,9 @@ mswindows_delete_frame (struct frame *f)
 {
   if (f->frame_data)
     {
+      Lisp_Object frame;
+      XSETFRAME (frame, f);
+      mswindows_unregister_popup_frame (frame);
       ReleaseDC(FRAME_MSWINDOWS_HANDLE(f), FRAME_MSWINDOWS_DC(f));
       DestroyWindow(FRAME_MSWINDOWS_HANDLE(f));
       xfree (f->frame_data);
@@ -310,7 +320,7 @@ mswindows_set_frame_size (struct frame *f, int width, int height)
   if (IsIconic (FRAME_MSWINDOWS_HANDLE(f)) || IsZoomed (FRAME_MSWINDOWS_HANDLE(f)))
     ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_RESTORE);
 
-  SetWindowPos (FRAME_MSWINDOWS_HANDLE(f), NULL, 
+  SetWindowPos (FRAME_MSWINDOWS_HANDLE(f), NULL,
                0, 0, rect.right-rect.left, rect.bottom-rect.top,
                SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSENDCHANGING | SWP_NOMOVE);
 }
@@ -318,13 +328,13 @@ mswindows_set_frame_size (struct frame *f, int width, int height)
 static void
 mswindows_set_frame_position (struct frame *f, int xoff, int yoff)
 {
-  SetWindowPos (FRAME_MSWINDOWS_HANDLE(f), NULL, 
+  SetWindowPos (FRAME_MSWINDOWS_HANDLE(f), NULL,
                xoff, yoff, 0, 0,
                SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSENDCHANGING | SWP_NOSIZE);
 }
 
 static void
-mswindows_make_frame_visible (struct frame *f) 
+mswindows_make_frame_visible (struct frame *f)
 {
   if (!FRAME_VISIBLE_P(f))
     ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_RESTORE);
@@ -335,7 +345,7 @@ mswindows_make_frame_visible (struct frame *f)
 }
 
 static void
-mswindows_make_frame_invisible (struct frame *f) 
+mswindows_make_frame_invisible (struct frame *f)
 {
   if (!FRAME_VISIBLE_P(f))
     return;
@@ -361,7 +371,7 @@ mswindows_frame_totally_visible_p (struct frame *f)
   UnionRect(&rc_temp, &rc_me, &rc_other);
   if (!EqualRect (&rc_temp, &rc_other))
     return 0;
-  
+
   /* Then see if any window above us obscures us */
   while ((hwnd = GetWindow (hwnd, GW_HWNDPREV)) != NULL)
     if (IsWindowVisible (hwnd))
@@ -404,11 +414,11 @@ mswindows_set_frame_icon (struct frame *f)
     {
       if (!XIMAGE_INSTANCE_MSWINDOWS_ICON (f->icon))
        {
-         mswindows_initialize_image_instance_icon (XIMAGE_INSTANCE (f->icon), 
+         mswindows_initialize_image_instance_icon (XIMAGE_INSTANCE (f->icon),
                                                    FALSE);
        }
-      
-      SetClassLong (FRAME_MSWINDOWS_HANDLE (f), GCL_HICON, 
+
+      SetClassLong (FRAME_MSWINDOWS_HANDLE (f), GCL_HICON,
                    (LONG) XIMAGE_INSTANCE_MSWINDOWS_ICON (f->icon));
     }
 }
@@ -494,7 +504,19 @@ mswindows_lower_frame (struct frame *f)
 }
 
 static void
-mswindows_set_title_from_bufbyte (struct frame *f, Bufbyte *title) 
+mswindows_enable_frame (struct frame *f)
+{
+  EnableWindow (FRAME_MSWINDOWS_HANDLE (f), TRUE);
+}
+
+static void
+mswindows_disable_frame (struct frame *f)
+{
+  EnableWindow (FRAME_MSWINDOWS_HANDLE (f), FALSE);
+}
+
+static void
+mswindows_set_title_from_bufbyte (struct frame *f, Bufbyte *title)
 {
   unsigned int new_checksum = hash_string (title, strlen (title));
   if (new_checksum != FRAME_MSWINDOWS_TITLE_CHECKSUM(f))
@@ -565,7 +587,7 @@ mswindows_set_frame_properties (struct frame *f, Lisp_Object plist)
              if (STRINGP (val))
                {
                  Lisp_Object frm, font_spec;
-                 
+
                  XSETFRAME (frm, f);
                  font_spec = Fget (Fget_face (Qdefault), Qfont, Qnil);
 
@@ -602,9 +624,9 @@ mswindows_set_frame_properties (struct frame *f, Lisp_Object plist)
 
   /* Now we've extracted the properties, apply them.
      Do not apply geometric properties during frame creation. This
-     is excessive anyways, and this loses becuase WM_SIZE has not
+     is excessive anyways, and this loses because WM_SIZE has not
      been sent yet, so frame width and height fields are not initialized.
-     
+
      unfortunately WM_SIZE loses as well since the resize is only
      applied once and the first time WM_SIZE is applied not everything
      is initialised in the frame (toolbars for instance). enabling
@@ -628,7 +650,7 @@ void mswindows_size_frame_internal (struct frame* f, XEMACS_RECT_WH* dest)
   int size_p = (dest->width >=0 || dest->height >=0);
   int move_p = (dest->top >=0 || dest->left >=0);
   char_to_real_pixel_size (f, dest->width, dest->height, &pixel_width, &pixel_height);
-  
+
   if (dest->width < 0)
     pixel_width = FRAME_PIXWIDTH (f);
   if (dest->height < 0)
@@ -639,7 +661,7 @@ void mswindows_size_frame_internal (struct frame* f, XEMACS_RECT_WH* dest)
     dest->left = rect.left;
   if (dest->top < 0)
     dest->top = rect.top;
-  
+
   rect.left = rect.top = 0;
   rect.right = pixel_width;
   rect.bottom = pixel_height;
@@ -690,11 +712,11 @@ void mswindows_size_frame_internal (struct frame* f, XEMACS_RECT_WH* dest)
       move_p=1;
     }
 
-  if (IsIconic (FRAME_MSWINDOWS_HANDLE(f)) 
+  if (IsIconic (FRAME_MSWINDOWS_HANDLE(f))
       || IsZoomed (FRAME_MSWINDOWS_HANDLE(f)))
     ShowWindow (FRAME_MSWINDOWS_HANDLE(f), SW_RESTORE);
 
-  SetWindowPos (FRAME_MSWINDOWS_HANDLE(f), NULL, 
+  SetWindowPos (FRAME_MSWINDOWS_HANDLE(f), NULL,
                dest->left, dest->top, pixel_width, pixel_height,
                SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOSENDCHANGING
                | (size_p ? 0 : SWP_NOSIZE)
@@ -734,7 +756,7 @@ mswindows_frame_size_fixed_p (struct frame *f)
 /*---------------------------------------------------------------------*/
 
 /*
- * With some drvier/os combination (I discovered this with HP drviers
+ * With some driver/os combination (I discovered this with HP drivers
  * under W2K), DC geometry is reset upon StartDoc and EndPage
  * calls. This is called every time one of these calls is made.
  */
@@ -763,8 +785,8 @@ error_frame_unsizable (struct frame *f)
 {
   Lisp_Object frame;
   XSETFRAME (frame, f);
-  signal_simple_error ("Cannot resize frame (margins)"
-                      " after print job has started.", frame);
+  invalid_change ("Cannot resize frame (margins) after print job has started.",
+                 frame);
 }
 
 static void
@@ -780,8 +802,8 @@ msprinter_init_frame_1 (struct frame *f, Lisp_Object props)
   /* Make sure this is the only frame on device. Windows printer can
      handle only one job at a time. */
   if (!NILP (DEVICE_FRAME_LIST (XDEVICE (FRAME_DEVICE (f)))))
-    error ("Only one frame (print job) at a time is allowed on "
-          "this printer device.");
+    invalid_operation ("Only one frame (print job) at a time is allowed on "
+                      "this printer device", FRAME_DEVICE (f));
 
   f->frame_data = xnew_and_zero (struct msprinter_frame);
 
@@ -812,16 +834,16 @@ msprinter_init_frame_3 (struct frame *f)
   frame_left = (MulDiv (GetDeviceCaps (hdc, LOGPIXELSX),
                        FRAME_MSPRINTER_LEFT_MARGIN(f), 1440)
                - GetDeviceCaps (hdc, PHYSICALOFFSETX));
-  
+
   if (FRAME_MSPRINTER_CHARWIDTH(f) > 0)
     {
       char_to_real_pixel_size (f, FRAME_MSPRINTER_CHARWIDTH(f), 0,
                               &frame_width, NULL);
-      FRAME_MSPRINTER_RIGHT_MARGIN(f) = 
+      FRAME_MSPRINTER_RIGHT_MARGIN(f) =
        MulDiv (GetDeviceCaps (hdc, PHYSICALWIDTH)
                - (frame_left + frame_width), 1440,
                GetDeviceCaps (hdc, LOGPIXELSX));
-    }          
+    }
   else
     frame_width = (GetDeviceCaps (hdc, PHYSICALWIDTH)
                   - frame_left
@@ -837,11 +859,11 @@ msprinter_init_frame_3 (struct frame *f)
       char_to_real_pixel_size (f, 0, FRAME_MSPRINTER_CHARHEIGHT(f),
                               NULL, &frame_height);
 
-      FRAME_MSPRINTER_BOTTOM_MARGIN(f) = 
+      FRAME_MSPRINTER_BOTTOM_MARGIN(f) =
        MulDiv (GetDeviceCaps (hdc, PHYSICALHEIGHT)
                - (frame_top + frame_height), 1440,
                GetDeviceCaps (hdc, LOGPIXELSY));
-    }          
+    }
   else
     frame_height = (GetDeviceCaps (hdc, PHYSICALHEIGHT)
                    - frame_top
@@ -850,13 +872,16 @@ msprinter_init_frame_3 (struct frame *f)
 
   /* Geometry sanity checks */
   if (!frame_pixsize_valid_p (f, frame_width, frame_height))
-    error ("Area inside print margins has shrunk to naught.");
+    invalid_operation ("Area inside print margins has shrunk to naught",
+                      STRINGP (f->name) ? f->name : Qunbound);
 
   if (frame_left < 0
       || frame_top < 0
       || frame_left + frame_width > GetDeviceCaps (hdc, HORZRES)
       || frame_top + frame_height > GetDeviceCaps (hdc, VERTRES))
-    error ("Print area is ouside of the printer's hardware printable area.");
+    invalid_operation ("Print area is ouside of the printer's "
+                      "hardware printable area",
+                      STRINGP (f->name) ? f->name : Qunbound);
 
   /* Apply XEmacs frame geometry and layout windows */
   {
@@ -880,7 +905,8 @@ msprinter_init_frame_3 (struct frame *f)
   di.fwType = 0;
 
   if (StartDoc (hdc, &di) <= 0)
-    error ("Cannot start print job");
+    invalid_operation ("Cannot start print job",
+                      STRINGP (f->name) ? f->name : Qunbound);
 
   apply_dc_geometry (f);
 
@@ -1031,7 +1057,7 @@ console_type_create_frame_mswindows (void)
 {
   /* Display frames */
   CONSOLE_HAS_METHOD (mswindows, init_frame_1);
-  CONSOLE_HAS_METHOD (mswindows, init_frame_2); 
+  CONSOLE_HAS_METHOD (mswindows, init_frame_2);
   CONSOLE_HAS_METHOD (mswindows, init_frame_3);
   CONSOLE_HAS_METHOD (mswindows, after_init_frame);
   CONSOLE_HAS_METHOD (mswindows, mark_frame);
@@ -1041,6 +1067,8 @@ console_type_create_frame_mswindows (void)
   CONSOLE_HAS_METHOD (mswindows, set_mouse_position);
   CONSOLE_HAS_METHOD (mswindows, raise_frame);
   CONSOLE_HAS_METHOD (mswindows, lower_frame);
+  CONSOLE_HAS_METHOD (mswindows, enable_frame);
+  CONSOLE_HAS_METHOD (mswindows, disable_frame);
   CONSOLE_HAS_METHOD (mswindows, make_frame_visible);
   CONSOLE_HAS_METHOD (mswindows, make_frame_invisible);
   CONSOLE_HAS_METHOD (mswindows, iconify_frame);
@@ -1055,8 +1083,8 @@ console_type_create_frame_mswindows (void)
   CONSOLE_HAS_METHOD (mswindows, frame_visible_p);
   CONSOLE_HAS_METHOD (mswindows, frame_totally_visible_p);
   CONSOLE_HAS_METHOD (mswindows, frame_iconified_p);
-  CONSOLE_HAS_METHOD (mswindows, set_frame_pointer); 
-  CONSOLE_HAS_METHOD (mswindows, set_frame_icon); 
+  CONSOLE_HAS_METHOD (mswindows, set_frame_pointer);
+  CONSOLE_HAS_METHOD (mswindows, set_frame_icon);
   CONSOLE_HAS_METHOD (mswindows, get_frame_parent);
   CONSOLE_HAS_METHOD (mswindows, update_frame_external_traits);
   CONSOLE_HAS_METHOD (mswindows, frame_size_fixed_p);
@@ -1093,11 +1121,11 @@ vars_of_frame_mswindows (void)
 
   DEFVAR_LISP ("mswindows-use-system-frame-size-defaults", &Vmswindows_use_system_frame_size_defaults /*
 Controls whether to use system or XEmacs defaults for frame size.
-If nil then reasonable defaults are used for intial frame sizes. If t
+If nil then reasonable defaults are used for initial frame sizes. If t
 then the system will choose default sizes for the frame.
 */ );
   Vmswindows_use_system_frame_size_defaults = Qnil;
-  
+
   DEFVAR_LISP ("default-mswindows-frame-plist", &Vdefault_mswindows_frame_plist /*
 Plist of default frame-creation properties for mswindows frames.
 These override what is specified in `default-frame-plist', but are
@@ -1155,7 +1183,7 @@ set at any time, except as otherwise noted):
   top-margin                   typographical unit of measurement,
   right-margin                  equal to 1/1440 of an inch, or 1/20 of a
   bottom-margin                        point, and roughly equal to 7/400 of a
-                               millimeter. If not specifified, each margin
+                               millimeter. If not specified, each margin
                                defaults to one inch (25.4 mm).
 
      MARGINS NOTE. right-margin and bottom-margin are overridden by
index 6815605..d96d844 100644 (file)
@@ -124,7 +124,6 @@ tty_frame_visible_p (struct frame *f)
 static void
 tty_raise_frame_no_select (struct frame *f)
 {
-  Lisp_Object frame;
   LIST_LOOP_2 (frame, DEVICE_FRAME_LIST (XDEVICE (FRAME_DEVICE (f))))
     {
       struct frame *o = XFRAME (frame);
index 9396eee..dbd70cb 100644 (file)
@@ -23,6 +23,8 @@ Boston, MA 02111-1307, USA.  */
 
 /* Substantially rewritten for XEmacs.  */
 
+/* 7-8-00 !!#### This file needs definite Mule review. */
+
 #include <config.h>
 #include "lisp.h"
 
@@ -114,7 +116,7 @@ x_any_window_to_frame (struct device *d, Window wdesc)
 
   /* We used to map over all frames here and then map over all widgets
      belonging to that frame. However it turns out that this was very fragile
-     as it requires our display stuctures to be in sync _and_ that the
+     as it requires our display structures to be in sync _and_ that the
      loop is told about every new widget somebody adds. Therefore we
      now let Xt find it for us (which does a bottom-up search which
      could even be faster) */
@@ -662,9 +664,7 @@ x_set_frame_text_value (struct frame *f, Bufbyte *value,
       {
         const char * tmp;
         encoding = DEVICE_XATOM_COMPOUND_TEXT (XDEVICE (FRAME_DEVICE (f)));
-       TO_EXTERNAL_FORMAT (C_STRING, value,
-                           C_STRING_ALLOCA, tmp,
-                           Qctext);
+       C_STRING_TO_EXTERNAL (value, tmp, Qctext);
         new_XtValue = (String) tmp;
         break;
       }
@@ -766,9 +766,7 @@ x_set_frame_properties (struct frame *f, Lisp_Object plist)
          if (XSTRING_LENGTH (prop) == 0)
            continue;
 
-         TO_EXTERNAL_FORMAT (LISP_STRING, prop,
-                             C_STRING_ALLOCA, extprop,
-                             Qctext);
+         LISP_STRING_TO_EXTERNAL (prop, extprop, Qctext);
          if (STRINGP (val))
            {
              const Extbyte *extval;
@@ -1876,9 +1874,7 @@ x_create_widgets (struct frame *f, Lisp_Object lisp_window_id,
 #endif
 
   if (STRINGP (f->name))
-    TO_EXTERNAL_FORMAT (LISP_STRING, f->name,
-                       C_STRING_ALLOCA, name,
-                       Qctext);
+    LISP_STRING_TO_EXTERNAL (f->name, name, Qctext);
   else
     name = "emacs";
 
@@ -2490,6 +2486,18 @@ x_lower_frame (struct frame *f)
     }
 }
 
+static void
+x_enable_frame (struct frame *f)
+{
+  XtSetSensitive (FRAME_X_SHELL_WIDGET (f), True);
+}
+
+static void
+x_disable_frame (struct frame *f)
+{
+  XtSetSensitive (FRAME_X_SHELL_WIDGET (f), False);
+}
+
 /* Change from withdrawn state to mapped state. */
 static void
 x_make_frame_visible (struct frame *f)
@@ -2793,6 +2801,8 @@ console_type_create_frame_x (void)
   CONSOLE_HAS_METHOD (x, set_mouse_position);
   CONSOLE_HAS_METHOD (x, raise_frame);
   CONSOLE_HAS_METHOD (x, lower_frame);
+  CONSOLE_HAS_METHOD (x, enable_frame);
+  CONSOLE_HAS_METHOD (x, disable_frame);
   CONSOLE_HAS_METHOD (x, make_frame_visible);
   CONSOLE_HAS_METHOD (x, make_frame_invisible);
   CONSOLE_HAS_METHOD (x, iconify_frame);
index 1689076..dbbaf63 100644 (file)
@@ -102,7 +102,7 @@ Lisp_Object Qvisible, Qiconic, Qinvisible, Qvisible_iconic, Qinvisible_iconic;
 Lisp_Object Qnomini, Qvisible_nomini, Qiconic_nomini, Qinvisible_nomini;
 Lisp_Object Qvisible_iconic_nomini, Qinvisible_iconic_nomini;
 
-Lisp_Object Qset_specifier, Qset_glyph_image, Qset_face_property;
+Lisp_Object Qset_specifier, Qset_face_property;
 Lisp_Object Qface_property_instance;
 
 Lisp_Object Qframe_property_alias;
@@ -198,9 +198,6 @@ allocate_frame_core (Lisp_Object device)
   XWINDOW (root_window)->pixel_width = 10;
   XWINDOW (root_window)->pixel_height = 9;
 
-  /* The size of the minibuffer window is now set in x_create_frame
-     in xfns.c. */
-
   f->root_window = root_window;
   f->selected_window = root_window;
   f->last_nonminibuf_window = root_window;
@@ -1036,13 +1033,10 @@ frame_matches_frametype (Lisp_Object frame, Lisp_Object type)
 }
 
 int
-device_matches_console_spec (Lisp_Object frame, Lisp_Object device,
-                            Lisp_Object console)
+device_matches_console_spec (Lisp_Object device, Lisp_Object console)
 {
   if (EQ (console, Qwindow_system))
     return DEVICE_WIN_P (XDEVICE (device));
-  if (NILP (console))
-    console = (DEVICE_CONSOLE (XDEVICE (FRAME_DEVICE (XFRAME (frame)))));
   if (DEVICEP (console))
     return EQ (device, console);
   if (CONSOLEP (console))
@@ -1056,78 +1050,60 @@ device_matches_console_spec (Lisp_Object frame, Lisp_Object device,
    FRAMETYPE and CONSOLE control which frames and devices
    are considered; see `next-frame'. */
 
-static Lisp_Object
-next_frame_internal (Lisp_Object frame, Lisp_Object frametype,
-                    Lisp_Object console, int called_from_delete_device)
+Lisp_Object
+next_frame (Lisp_Object frame, Lisp_Object frametype, Lisp_Object console)
 {
+  Lisp_Object first = Qnil;
+  Lisp_Object devcons, concons;
   int passed = 0;
-  int started_over = 0;
 
-  /* If this frame is dead, it won't be in frame_list, and we'll loop
-     forever.  Forestall that.  */
   CHECK_LIVE_FRAME (frame);
 
-  while (1)
+  DEVICE_LOOP_NO_BREAK (devcons, concons)
     {
-      Lisp_Object devcons, concons;
+      Lisp_Object device = XCAR (devcons);
+      Lisp_Object frmcons;
 
-      DEVICE_LOOP_NO_BREAK (devcons, concons)
+      if (!device_matches_console_spec (device, console))
        {
-         Lisp_Object device = XCAR (devcons);
-         Lisp_Object frmcons;
+         if (EQ (device, FRAME_DEVICE (XFRAME (frame))))
+           passed = 1;
+         continue;
+       }
 
-         if (!device_matches_console_spec (frame, device, console))
-           continue;
+      DEVICE_FRAME_LOOP (frmcons, XDEVICE (device))
+       {
+         Lisp_Object f = XCAR (frmcons);
 
-         DEVICE_FRAME_LOOP (frmcons, XDEVICE (device))
+         if (passed)
            {
-             Lisp_Object f = XCAR (frmcons);
-             if (passed)
+             if (frame_matches_frametype (f, frametype))
+               return f;
+           }
+         else
+           {
+             if (EQ (frame, f))
                {
-                 /* #### Doing this here is bad and is now
-                     unnecessary.  The real bug was that f->iconified
-                     was never, ever updated unless a user explicitly
-                     called frame-iconified-p.  That has now been
-                     fixed.  With this change removed all of the other
-                     changes made to support this routine having the
-                     called_from_delete_device arg could be removed.
-                     But it is too close to release to do that now. */
-#if 0
-                 /* Make sure the visibility and iconified flags are
-                     up-to-date unless we're being deleted. */
-                 if (!called_from_delete_device)
-                   {
-                     Fframe_iconified_p (f);
-                     Fframe_visible_p (f);
-                   }
-#endif
-
-                 /* Decide whether this frame is eligible to be returned.  */
-
-                 /* If we've looped all the way around without finding any
-                    eligible frames, return the original frame.  */
-                 if (EQ (f, frame))
-                   return f;
-
-                 if (frame_matches_frametype (f, frametype))
-                   return f;
+                 passed = 1;
+               }
+             else
+               {
+                 if (NILP (first) && frame_matches_frametype (f, frametype))
+                   first = f;
                }
-
-             if (EQ (frame, f))
-               passed++;
            }
        }
-      /* We hit the end of the list, and need to start over again. */
-      if (started_over)
-       return Qnil;
-      started_over++;
     }
-}
 
-Lisp_Object
-next_frame (Lisp_Object frame, Lisp_Object frametype, Lisp_Object console)
-{
-  return next_frame_internal (frame, frametype, console, 0);
+  if (NILP (first))
+    /* We went through the whole frame list without finding a single
+       acceptable frame.  Return the original frame.  */
+    return frame;
+  else
+    /* There were no acceptable frames in the list after FRAME; otherwise,
+       we would have returned directly from the loop.  Since FIRST is the last
+       acceptable frame in the list, return it.  */
+    return first;
 }
 
 /* Return the previous frame in the frame list before FRAME.
@@ -1135,50 +1111,52 @@ next_frame (Lisp_Object frame, Lisp_Object frametype, Lisp_Object console)
    are considered; see `next-frame'. */
 
 Lisp_Object
-prev_frame (Lisp_Object frame, Lisp_Object frametype, Lisp_Object console)
+previous_frame (Lisp_Object frame, Lisp_Object frametype, Lisp_Object console)
 {
   Lisp_Object devcons, concons;
-  Lisp_Object prev;
+  Lisp_Object last = Qnil;
 
-  /* If this frame is dead, it won't be in frame_list, and we'll loop
-     forever.  Forestall that.  */
   CHECK_LIVE_FRAME (frame);
 
-  prev = Qnil;
   DEVICE_LOOP_NO_BREAK (devcons, concons)
     {
       Lisp_Object device = XCAR (devcons);
       Lisp_Object frmcons;
 
-      if (!device_matches_console_spec (frame, device, console))
-       continue;
+      if (!device_matches_console_spec (device, console))
+       {
+         if (EQ (device, FRAME_DEVICE (XFRAME (frame)))
+             && !NILP (last))
+           return last;
+         continue;
+       }
 
       DEVICE_FRAME_LOOP (frmcons, XDEVICE (device))
        {
          Lisp_Object f = XCAR (frmcons);
 
-         if (EQ (frame, f) && !NILP (prev))
-           return prev;
-
-         /* Decide whether this frame is eligible to be returned,
-            according to frametype.  */
-
-         if (frame_matches_frametype (f, frametype))
-           prev = f;
-
+         if (EQ (frame, f))
+           {
+             if (!NILP (last))
+               return last;
+           }
+         else
+           {
+             if (frame_matches_frametype (f, frametype))
+               last = f;
+           }
        }
     }
 
-  /* We've scanned the entire list.  */
-  if (NILP (prev))
+  if (NILP (last))
     /* We went through the whole frame list without finding a single
        acceptable frame.  Return the original frame.  */
     return frame;
   else
     /* There were no acceptable frames in the list before FRAME; otherwise,
-       we would have returned directly from the loop.  Since PREV is the last
+       we would have returned directly from the loop.  Since LAST is the last
        acceptable frame in the list, return it.  */
-    return prev;
+    return last;
 }
 
 DEFUN ("next-frame", Fnext_frame, 0, 3, 0, /*
@@ -1243,7 +1221,7 @@ arguments.
 {
   XSETFRAME (frame, decode_frame (frame));
 
-  return prev_frame (frame, frametype, console);
+  return previous_frame (frame, frametype, console);
 }
 
 /* Return any frame for which PREDICATE is non-zero, or return Qnil
@@ -1275,23 +1253,15 @@ find_some_frame (int (*predicate) (Lisp_Object, void *),
    (Exception: if F is a stream frame, it's OK to delete if
    any other frames exist.) */
 
-static int
-other_visible_frames_internal (struct frame *f, int called_from_delete_device)
+int
+other_visible_frames (struct frame *f)
 {
   Lisp_Object frame;
 
   XSETFRAME (frame, f);
   if (FRAME_STREAM_P (f))
-    return !EQ (frame, next_frame_internal (frame, Qt, Qt,
-                                           called_from_delete_device));
-  return !EQ (frame, next_frame_internal (frame, Qvisible_iconic_nomini, Qt,
-                                         called_from_delete_device));
-}
-
-int
-other_visible_frames (struct frame *f)
-{
-  return other_visible_frames_internal (f, 0);
+    return !EQ (frame, next_frame (frame, Qt, Qt));
+  return !EQ (frame, next_frame (frame, Qvisible_iconic_nomini, Qt));
 }
 
 /* Delete frame F.
@@ -1354,7 +1324,7 @@ delete_frame_internal (struct frame *f, int force,
      losing any way of communicating with the still running XEmacs process.
      So we put it back.  */
   if (!force && !allow_deletion_of_last_visible_frame &&
-      !other_visible_frames_internal (f, called_from_delete_device))
+      !other_visible_frames (f))
     error ("Attempt to delete the sole visible or iconified frame");
 
   /* Does this frame have a minibuffer, and is it the surrogate
@@ -1480,22 +1450,17 @@ delete_frame_internal (struct frame *f, int force,
 
       next = DEVMETH_OR_GIVEN (d, get_frame_parent, (f), Qnil);
       if (NILP (next) || EQ (next, frame) || ! FRAME_LIVE_P (XFRAME (next)))
-       next = next_frame_internal (frame, Qvisible, device,
-                                   called_from_delete_device);
+       next = next_frame (frame, Qvisible, device);
       if (NILP (next) || EQ (next, frame))
-       next = next_frame_internal (frame, Qvisible, console,
-                                   called_from_delete_device);
+       next = next_frame (frame, Qvisible, console);
       if (NILP (next) || EQ (next, frame))
-       next = next_frame_internal (frame, Qvisible, Qt,
-                                   called_from_delete_device);
+       next = next_frame (frame, Qvisible, Qt);
       if (NILP (next) || EQ (next, frame))
-       next = next_frame_internal (frame, Qt, device,
-                                   called_from_delete_device);
+       next = next_frame (frame, Qt, device);
       if (NILP (next) || EQ (next, frame))
-       next = next_frame_internal (frame, Qt, console,
-                                   called_from_delete_device);
+       next = next_frame (frame, Qt, console);
       if (NILP (next) || EQ (next, frame))
-       next = next_frame_internal (frame, Qt, Qt, called_from_delete_device);
+       next = next_frame (frame, Qt, Qt);
 
       /* if we haven't found another frame at this point
         then there aren't any. */
@@ -1517,9 +1482,7 @@ delete_frame_internal (struct frame *f, int force,
           */
          if (!EQ (device, FRAME_DEVICE(XFRAME(next))))
            {
-               Lisp_Object next_f =
-                   next_frame_internal (frame, Qt, device,
-                                        called_from_delete_device);
+               Lisp_Object next_f = next_frame (frame, Qt, device);
                if (NILP (next_f) || EQ (next_f, frame))
                  set_device_selected_frame (d, Qnil);
                else
@@ -1560,9 +1523,9 @@ delete_frame_internal (struct frame *f, int force,
   /* Unfortunately deleting the frame will also delete the parent of
      all of the subwindow instances current on the frame. I think this
      can lead to bad things when trying to finalize the
-     instances. Thus we loop over the instance cache calling the
+     instances. Thus we loop over all instance caches calling the
      finalize method for each instance. */
-  free_frame_subwindow_instance_cache (f);
+  free_frame_subwindow_instances (f);
 
   /* This must be done before the window and window_mirror structures
      are freed.  The scrollbar information is attached to them. */
@@ -1748,13 +1711,14 @@ mouse_pixel_position_1 (struct device *d, Lisp_Object *frame,
 
 DEFUN ("mouse-pixel-position", Fmouse_pixel_position, 0, 1, 0, /*
 Return a list (WINDOW X . Y) giving the current mouse window and position.
-The position is given in pixel units, where (0, 0) is the upper-left corner.
+The position is given in pixel units, where (0, 0) is the upper-left corner
+of the window.
 
 When the cursor is not over a window, the return value is a list (nil nil).
 
 DEVICE specifies the device on which to read the mouse position, and
 defaults to the selected device.  If the device is a mouseless terminal
-or Emacs hasn't been programmed to read its mouse position, it returns
+or XEmacs hasn't been programmed to read its mouse position, it returns
 the device's selected window for WINDOW and nil for X and Y.
 */
        (device))
@@ -2100,6 +2064,34 @@ doesn't support multiple overlapping frames, this function does nothing.
   return Qnil;
 }
 
+\f
+DEFUN ("disable-frame", Fdisable_frame, 1, 1, 0, /*
+Disable frame FRAME, so that it cannot have the focus or receive user input.
+This is normally used during modal dialog boxes.
+WARNING: Be very careful not to wedge XEmacs!
+Use an `unwind-protect' that re-enables the frame to avoid this.
+*/
+       (frame))
+{
+  struct frame *f = decode_frame (frame);
+
+  f->disabled = 1;
+  MAYBE_FRAMEMETH (f, disable_frame, (f));
+  return Qnil;
+}
+
+DEFUN ("enable-frame", Fenable_frame, 1, 1, 0, /*
+Enable frame FRAME, so that it can have the focus and receive user input.
+Frames are normally enabled, unless explicitly disabled using `disable-frame'.
+*/
+       (frame))
+{
+  struct frame *f = decode_frame (frame);
+  f->disabled = 0;
+  MAYBE_FRAMEMETH (f, enable_frame, (f));
+  return Qnil;
+}
+
 /* Ben thinks there is no need for `redirect-frame-focus' or `frame-focus',
    crockish FSFmacs functions.  See summary on focus in event-stream.c. */
 \f
@@ -2919,11 +2911,11 @@ change_frame_size_1 (struct frame *f, int newheight, int newwidth)
     {
       /* Adjust for gutters here so that we always get set
          properly. */
-      new_pixheight -= 
+      new_pixheight -=
        (FRAME_TOP_GUTTER_BOUNDS (f)
         + FRAME_BOTTOM_GUTTER_BOUNDS (f));
 
-      XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_top 
+      XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_top
        = FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f);
 
       if (FRAME_HAS_MINIBUF_P (f)
@@ -2951,7 +2943,7 @@ change_frame_size_1 (struct frame *f, int newheight, int newwidth)
 
          XWINDOW (FRAME_MINIBUF_WINDOW (f))->pixel_top =
            FRAME_TOP_BORDER_END (f) +
-           FRAME_TOP_GUTTER_BOUNDS (f) + 
+           FRAME_TOP_GUTTER_BOUNDS (f) +
            FRAME_BOTTOM_GUTTER_BOUNDS (f) +
            new_pixheight - minibuf_height;
 
@@ -2970,11 +2962,11 @@ change_frame_size_1 (struct frame *f, int newheight, int newwidth)
     {
       /* Adjust for gutters here so that we always get set
          properly. */
-      new_pixwidth -= 
+      new_pixwidth -=
        (FRAME_LEFT_GUTTER_BOUNDS (f)
         + FRAME_RIGHT_GUTTER_BOUNDS (f));
-      
-      XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_left = 
+
+      XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_left =
        FRAME_LEFT_BORDER_END (f) + FRAME_LEFT_GUTTER_BOUNDS (f);
       set_window_pixwidth (FRAME_ROOT_WINDOW (f), new_pixwidth, 0);
 
@@ -3245,7 +3237,6 @@ syms_of_frame (void)
   defsymbol (&Qborder_width, "border-width");
   /* Qwidth, Qheight, Qleft, Qtop in general.c */
   defsymbol (&Qset_specifier, "set-specifier");
-  defsymbol (&Qset_glyph_image, "set-glyph-image");
   defsymbol (&Qset_face_property, "set-face-property");
   defsymbol (&Qface_property_instance, "face-property-instance");
   defsymbol (&Qframe_property_alias, "frame-property-alias");
@@ -3283,6 +3274,8 @@ syms_of_frame (void)
   DEFSUBR (Fvisible_frame_list);
   DEFSUBR (Fraise_frame);
   DEFSUBR (Flower_frame);
+  DEFSUBR (Fdisable_frame);
+  DEFSUBR (Fenable_frame);
   DEFSUBR (Fframe_property);
   DEFSUBR (Fframe_properties);
   DEFSUBR (Fset_frame_properties);
index ceae5b0..4ce3d15 100644 (file)
@@ -142,6 +142,9 @@ Value : Emacs meaning                           :f-v-p : X meaning
 
   /* one-bit flags: */
 
+  /* Is focusing onto this frame disabled? (Modal dialog boxes) */
+  unsigned int disabled :1;
+
   /* Are we finished initializing? */
   unsigned int init_finished :1;
 
@@ -242,6 +245,7 @@ extern Lisp_Object Vmouse_motion_handler;
 DECLARE_LRECORD (frame, struct frame);
 #define XFRAME(x) XRECORD (x, frame, struct frame)
 #define XSETFRAME(x, p) XSETRECORD (x, p, frame)
+#define wrap_frame(p) wrap_object (p)
 #define FRAMEP(x) RECORDP (x, frame)
 #define CHECK_FRAME(x) CHECK_RECORD (x, frame)
 #define CONCHECK_FRAME(x) CONCHECK_RECORD (x, frame)
@@ -770,8 +774,8 @@ extern int frame_changed;
 void update_frame_title (struct frame *f);
 Lisp_Object next_frame (Lisp_Object f, Lisp_Object frametype,
                        Lisp_Object console);
-Lisp_Object prev_frame (Lisp_Object f, Lisp_Object frametype,
-                       Lisp_Object console);
+Lisp_Object previous_frame (Lisp_Object f, Lisp_Object frametype,
+                           Lisp_Object console);
 void pixel_to_char_size (struct frame *f, int pixel_width, int pixel_height,
                         int *char_width, int *char_height);
 void char_to_pixel_size (struct frame *f, int char_width, int char_height,
@@ -807,8 +811,7 @@ void delete_frame_internal (struct frame *f, int force,
 void io_error_delete_frame (Lisp_Object frame);
 Lisp_Object find_some_frame (int (*predicate) (Lisp_Object, void *),
                             void *closure);
-int device_matches_console_spec (Lisp_Object frame, Lisp_Object device,
-                                Lisp_Object console);
+int device_matches_console_spec (Lisp_Object device, Lisp_Object console);
 Lisp_Object frame_first_window (struct frame *f);
 int show_gc_cursor (struct frame *f, Lisp_Object cursor);
 void set_frame_selected_window (struct frame *f, Lisp_Object window);
index a695b7f..3af3fcc 100644 (file)
@@ -1,6 +1,6 @@
 /* Commonly-used symbols
    Copyright (C) 1995 Sun Microsystems.
-   Copyright (C) 1995, 1996 Ben Wing.
+   Copyright (C) 1995, 1996, 2000 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -21,353 +21,32 @@ Boston, MA 02111-1307, USA.  */
 
 /* Synched up with: Not in FSF. */
 
-/* The purpose of this file is as a central place to stick symbols
-   that don't have any obvious connection to any particular module
-   and might be used in many different contexts.
-
-   #### More should be put here.
-   */
+/* See general-slots.h.
+*/
 
 #include <config.h>
 #include "lisp.h"
 
-Lisp_Object Qabort;
-Lisp_Object Qactually_requested;
-Lisp_Object Qafter;
-Lisp_Object Qall;
-Lisp_Object Qand;
-Lisp_Object Qappend;
-Lisp_Object Qassoc;
-Lisp_Object Qat;
-Lisp_Object Qautodetect;
-Lisp_Object Qbad_variable;
-Lisp_Object Qbefore;
-Lisp_Object Qbinary;
-Lisp_Object Qbitmap;
-Lisp_Object Qboolean;
-Lisp_Object Qbottom;
-Lisp_Object Qbottom_margin;
-Lisp_Object Qbuffer;
-Lisp_Object Qbutton;
-Lisp_Object Qcancel;
-Lisp_Object Qcategory;
-Lisp_Object Qcenter;
-Lisp_Object Qchannel;
-Lisp_Object Qchar;
-Lisp_Object Qcharacter;
-Lisp_Object Qchars;
-Lisp_Object Qcolor;
-Lisp_Object Qcolumns;
-Lisp_Object Qcommand;
-Lisp_Object Qconsole;
-Lisp_Object Qcopies;
-Lisp_Object Qcritical;
-Lisp_Object Qctext;
-Lisp_Object Qcursor;
-Lisp_Object Qdata;
-Lisp_Object Qdead;
-Lisp_Object Qdefault;
-Lisp_Object Qdelete;
-Lisp_Object Qdelq;
-Lisp_Object Qdevice;
-Lisp_Object Qdialog;
-Lisp_Object Qdimension;
-Lisp_Object Qdisplay;
-Lisp_Object Qdoc_string;
-Lisp_Object Qduplex;
-Lisp_Object Qdynarr_overhead;
-Lisp_Object Qempty;
-Lisp_Object Qeq;
-Lisp_Object Qeql;
-Lisp_Object Qequal;
-Lisp_Object Qeval;
-Lisp_Object Qextents;
-Lisp_Object Qface;
-Lisp_Object Qfile_name;
-Lisp_Object Qfont;
-Lisp_Object Qframe;
-Lisp_Object Qfrom_page;
-Lisp_Object Qfull_assoc;
-Lisp_Object Qfuncall;
-Lisp_Object Qfunction;
-Lisp_Object Qgap_overhead;
-Lisp_Object Qgeneric;
-Lisp_Object Qgeometry;
-Lisp_Object Qglobal;
-Lisp_Object Qgutter;
-Lisp_Object Qheight;
-Lisp_Object Qhelp;
-Lisp_Object Qhighlight;
-Lisp_Object Qhorizontal;
-Lisp_Object Qicon;
-Lisp_Object Qid;
-Lisp_Object Qignore;
-Lisp_Object Qimage;
-Lisp_Object Qinfo;
-Lisp_Object Qinherit;
-Lisp_Object Qinteger;
-Lisp_Object Qinternal;
-Lisp_Object Qkey;
-Lisp_Object Qkey_assoc;
-Lisp_Object Qkeyboard;
-Lisp_Object Qkeymap;
-Lisp_Object Qlandscape;
-Lisp_Object Qlast_command;
-Lisp_Object Qleft;
-Lisp_Object Qleft_margin;
-Lisp_Object Qlet;
-Lisp_Object Qlist;
-Lisp_Object Qmagic;
-Lisp_Object Qmalloc_overhead;
-Lisp_Object Qmarkers;
-Lisp_Object Qmax;
-Lisp_Object Qmemory;
-Lisp_Object Qmenubar;
-Lisp_Object Qmessage;
-Lisp_Object Qminus;
-Lisp_Object Qmodifiers;
-Lisp_Object Qmotion;
-Lisp_Object Qmsprinter;
-Lisp_Object Qmswindows;
-Lisp_Object Qname;
-Lisp_Object Qno;
-Lisp_Object Qnone;
-Lisp_Object Qnot;
-Lisp_Object Qnothing;
-Lisp_Object Qnotice;
-Lisp_Object Qobject;
-Lisp_Object Qok;
-Lisp_Object Qold_assoc;
-Lisp_Object Qold_delete;
-Lisp_Object Qold_delq;
-Lisp_Object Qold_rassoc;
-Lisp_Object Qold_rassq;
-Lisp_Object Qonly;
-Lisp_Object Qor;
-Lisp_Object Qorientation;
-Lisp_Object Qother;
-Lisp_Object Qpointer;
-Lisp_Object Qpopup;
-Lisp_Object Qportrait;
-Lisp_Object Qprint;
-Lisp_Object Qprinter;
-Lisp_Object Qprocess;
-Lisp_Object Qprovide;
-Lisp_Object Qrassoc;
-Lisp_Object Qrassq;
-Lisp_Object Qrequire;
-Lisp_Object Qresource;
-Lisp_Object Qretry;
-Lisp_Object Qreturn;
-Lisp_Object Qreverse;
-Lisp_Object Qright;
-Lisp_Object Qright_margin;
-Lisp_Object Qsearch;
-Lisp_Object Qselected;
-Lisp_Object Qsignal;
-Lisp_Object Qsimple;
-Lisp_Object Qsize;
-Lisp_Object Qspace;
-Lisp_Object Qspecifier;
-Lisp_Object Qstream;
-Lisp_Object Qstring;
-Lisp_Object Qsymbol;
-Lisp_Object Qsyntax;
-Lisp_Object Qterminal;
-Lisp_Object Qtest;
-Lisp_Object Qtext;
-Lisp_Object Qthis_command;
-Lisp_Object Qtimeout;
-Lisp_Object Qtimestamp;
-Lisp_Object Qtoolbar;
-Lisp_Object Qtop;
-Lisp_Object Qtop_margin;
-Lisp_Object Qto_page;
-Lisp_Object Qtty;
-Lisp_Object Qtype;
-Lisp_Object Qundecided;
-Lisp_Object Qundefined;
-Lisp_Object Qunimplemented;
-Lisp_Object Qvalue_assoc;
-Lisp_Object Qvertical;
-Lisp_Object Qwarning;
-Lisp_Object Qwidget;
-Lisp_Object Qwidth;
-Lisp_Object Qwindow;
-Lisp_Object Qwindow_system;
-Lisp_Object Qx;
-Lisp_Object Qy;
-Lisp_Object Qyes;
+#define SYMBOL(fou) Lisp_Object fou
+#define SYMBOL_KEYWORD(la_cle_est_fou) Lisp_Object la_cle_est_fou
+#define SYMBOL_GENERAL(tout_le_monde, est_fou) Lisp_Object tout_le_monde
+
+#include "general-slots.h"
+
+#undef SYMBOL
+#undef SYMBOL_KEYWORD
+#undef SYMBOL_GENERAL
 
 void
 syms_of_general (void)
 {
-  defsymbol (&Qabort, "abort");
-  defsymbol (&Qactually_requested, "actually-requested");
-  defsymbol (&Qafter, "after");
-  defsymbol (&Qall, "all");
-  defsymbol (&Qand, "and");
-  defsymbol (&Qappend, "append");
-  defsymbol (&Qassoc, "assoc");
-  defsymbol (&Qat, "at");
-  defsymbol (&Qautodetect, "autodetect");
-  defsymbol (&Qbad_variable, "bad-variable");
-  defsymbol (&Qbefore, "before");
-  defsymbol (&Qbinary, "binary");
-  defsymbol (&Qbitmap, "bitmap");
-  defsymbol (&Qboolean, "boolean");
-  defsymbol (&Qbottom, "bottom");
-  defsymbol (&Qbottom_margin, "bottom-margin");
-  defsymbol (&Qbuffer, "buffer");
-  defsymbol (&Qbutton, "button");
-  defsymbol (&Qcancel, "cancel");
-  defsymbol (&Qcategory, "category");
-  defsymbol (&Qcenter, "center");
-  defsymbol (&Qchannel, "channel");
-  defsymbol (&Qchar, "char");
-  defsymbol (&Qcharacter, "character");
-  defsymbol (&Qchars, "chars");
-  defsymbol (&Qcolor, "color");
-  defsymbol (&Qcolumns, "columns");
-  defsymbol (&Qcommand, "command");
-  defsymbol (&Qconsole, "console");
-  defsymbol (&Qcopies, "copies");
-  defsymbol (&Qcritical, "critical");
-  defsymbol (&Qctext, "ctext");
-  defsymbol (&Qcursor, "cursor");
-  defsymbol (&Qdata, "data");
-  defsymbol (&Qdead, "dead");
-  defsymbol (&Qdefault, "default");
-  defsymbol (&Qdelete, "delete");
-  defsymbol (&Qdelq, "delq");
-  defsymbol (&Qdevice, "device");
-  defsymbol (&Qdialog, "dialog");
-  defsymbol (&Qdimension, "dimension");
-  defsymbol (&Qdisplay, "display");
-  defsymbol (&Qdoc_string, "doc-string");
-  defsymbol (&Qduplex, "duplex");
-  defsymbol (&Qdynarr_overhead, "dynarr-overhead");
-  defsymbol (&Qempty, "empty");
-  defsymbol (&Qeq, "eq");
-  defsymbol (&Qeql, "eql");
-  defsymbol (&Qequal, "equal");
-  defsymbol (&Qeval, "eval");
-  defsymbol (&Qextents, "extents");
-  defsymbol (&Qface, "face");
-  defsymbol (&Qfile_name, "file-name");
-  defsymbol (&Qfont, "font");
-  defsymbol (&Qframe, "frame");
-  defsymbol (&Qfrom_page, "from-page");
-  defsymbol (&Qfunction, "function");
-  defsymbol (&Qfull_assoc, "full-assoc");
-  defsymbol (&Qfuncall, "funcall");
-  defsymbol (&Qfunction, "function");
-  defsymbol (&Qgap_overhead, "gap-overhead");
-  defsymbol (&Qgeneric, "generic");
-  defsymbol (&Qgeometry, "geometry");
-  defsymbol (&Qglobal, "global");
-  defsymbol (&Qgutter, "gutter");
-  defsymbol (&Qheight, "height");
-  defsymbol (&Qhelp, "help");
-  defsymbol (&Qhighlight, "highlight");
-  defsymbol (&Qhorizontal, "horizontal");
-  defsymbol (&Qicon, "icon");
-  defsymbol (&Qid, "id");
-  defsymbol (&Qignore, "ignore");
-  defsymbol (&Qimage, "image");
-  defsymbol (&Qinfo, "info");
-  defsymbol (&Qinherit, "inherit");
-  defsymbol (&Qinteger, "integer");
-  defsymbol (&Qinternal, "internal");
-  defsymbol (&Qkey, "key");
-  defsymbol (&Qkey_assoc, "key-assoc");
-  defsymbol (&Qkeyboard, "keyboard");
-  defsymbol (&Qkeymap, "keymap");
-  defsymbol (&Qlandscape, "landscape");
-  defsymbol (&Qlast_command, "last-command");
-  defsymbol (&Qleft, "left");
-  defsymbol (&Qleft_margin, "left-margin");
-  defsymbol (&Qlet, "let");
-  defsymbol (&Qlist, "list");
-  defsymbol (&Qmagic, "magic");
-  defsymbol (&Qmalloc_overhead, "malloc-overhead");
-  defsymbol (&Qmarkers, "markers");
-  defsymbol (&Qmax, "max");
-  defsymbol (&Qmemory, "memory");
-  defsymbol (&Qmenubar, "menubar");
-  defsymbol (&Qmessage, "message");
-  defsymbol (&Qminus, "-");
-  defsymbol (&Qmodifiers, "modifiers");
-  defsymbol (&Qmotion, "motion");
-  defsymbol (&Qmsprinter, "msprinter");
-  defsymbol (&Qmswindows, "mswindows");
-  defsymbol (&Qname, "name");
-  defsymbol (&Qno, "no");
-  defsymbol (&Qnone, "none");
-  defsymbol (&Qnot, "not");
-  defsymbol (&Qnothing, "nothing");
-  defsymbol (&Qnotice, "notice");
-  defsymbol (&Qobject, "object");
-  defsymbol (&Qok, "ok");
-  defsymbol (&Qold_assoc, "old-assoc");
-  defsymbol (&Qold_delete, "old-delete");
-  defsymbol (&Qold_delq, "old-delq");
-  defsymbol (&Qold_rassoc, "old-rassoc");
-  defsymbol (&Qold_rassq, "old-rassq");
-  defsymbol (&Qonly, "only");
-  defsymbol (&Qor, "or");
-  defsymbol (&Qorientation, "orientation");
-  defsymbol (&Qother, "other");
-  defsymbol (&Qpointer, "pointer");
-  defsymbol (&Qpopup, "popup");
-  defsymbol (&Qportrait, "portrait");
-  defsymbol (&Qprint, "print");
-  defsymbol (&Qprinter, "printer");
-  defsymbol (&Qprocess, "process");
-  defsymbol (&Qprovide, "provide");
-  defsymbol (&Qrassoc, "rassoc");
-  defsymbol (&Qrassq, "rassq");
-  defsymbol (&Qrequire, "require");
-  defsymbol (&Qresource, "resource");
-  defsymbol (&Qretry, "retry");
-  defsymbol (&Qreturn, "return");
-  defsymbol (&Qreverse, "reverse");
-  defsymbol (&Qright, "right");
-  defsymbol (&Qright_margin, "right-margin");
-  defsymbol (&Qsearch, "search");
-  defsymbol (&Qselected, "selected");
-  defsymbol (&Qsignal, "signal");
-  defsymbol (&Qsimple, "simple");
-  defsymbol (&Qsize, "size");
-  defsymbol (&Qspace, "space");
-  defsymbol (&Qspecifier, "specifier");
-  defsymbol (&Qstream, "stream");
-  defsymbol (&Qstring, "string");
-  defsymbol (&Qsymbol, "symbol");
-  defsymbol (&Qsyntax, "syntax");
-  defsymbol (&Qterminal, "terminal");
-  defsymbol (&Qtest, "test");
-  defsymbol (&Qtext, "text");
-  defsymbol (&Qthis_command, "this-command");
-  defsymbol (&Qtimeout, "timeout");
-  defsymbol (&Qtimestamp, "timestamp");
-  defsymbol (&Qtoolbar, "toolbar");
-  defsymbol (&Qtop, "top");
-  defsymbol (&Qtop_margin, "top-margin");
-  defsymbol (&Qto_page, "to-page");
-  defsymbol (&Qtty, "tty");
-  defsymbol (&Qtype, "type");
-  defsymbol (&Qundecided, "undecided");
-  defsymbol (&Qundefined, "undefined");
-  defsymbol (&Qunimplemented, "unimplemented");
-  defsymbol (&Qvalue_assoc, "value-assoc");
-  defsymbol (&Qvertical, "vertical");
-  defsymbol (&Qwarning, "warning");
-  defsymbol (&Qwidget, "widget");
-  defsymbol (&Qwidth, "width");
-  defsymbol (&Qwindow, "window");
-  defsymbol (&Qwindow_system, "window-system");
-  defsymbol (&Qx, "x");
-  defsymbol (&Qy, "y");
-  defsymbol (&Qyes, "yes");
+#define SYMBOL(loco) DEFSYMBOL (loco)
+#define SYMBOL_KEYWORD(meshugeneh) DEFKEYWORD (meshugeneh)
+#define SYMBOL_GENERAL(vachement, fou) defsymbol (&vachement, fou)
+
+#include "general-slots.h"
+
+#undef SYMBOL
+#undef SYMBOL_KEYWORD
+#undef SYMBOL_GENERAL
 }
index 721f32b..4a41be8 100644 (file)
@@ -51,7 +51,8 @@ Boston, MA 02111-1307, USA.  */
    sony_news                    NEWS-OS (works at least for 4.1C)
    UMAX
    UMAX4_3
-   WIN32_NATIVE                        No-op for Windows95/NT.
+   WIN32_NATIVE                        No-op for Windows9x/NT.
+   CYGWIN                      No-op for Cygwin.
    __linux__                   Linux: assumes /proc filesystem mounted.
                                Support from Michael K. Johnson.
    __NetBSD__                  NetBSD: assumes /kern filesystem mounted.
@@ -71,27 +72,6 @@ Boston, MA 02111-1307, USA.  */
 #include "lisp.h"
 #include "sysfile.h" /* for encapsulated open, close, read, write */
 
-#ifndef WIN32_NATIVE
-#ifndef CYGWIN
-
-#include <sys/types.h>
-
-/* Both the Emacs and non-Emacs sections want this.  Some
-   configuration files' definitions for the LOAD_AVE_CVT macro (like
-   sparc.h's) use macros like FSCALE, defined here.  */
-#ifdef unix
-#include <sys/param.h>
-#endif
-
-
-/* Exclude all the code except the test program at the end
-   if the system has its own `getloadavg' function.
-
-   The declaration of `errno' is needed by the test program
-   as well as the function itself, so it comes first.  */
-
-#include <errno.h>
-
 #ifndef HAVE_GETLOADAVG
 
 /* The existing Emacs configuration files define a macro called
@@ -457,11 +437,6 @@ Boston, MA 02111-1307, USA.  */
 #include <sys/pstat.h>
 #endif /* HAVE_SYS_PSTAT_H (on HPUX) */
 
-#if defined(HAVE_FCNTL_H) || defined(_POSIX_VERSION)
-#include <fcntl.h>
-#else
-#include <sys/file.h>
-#endif
 \f
 /* Avoid static vars inside a function since in HPUX they dump as pure.  */
 
@@ -506,6 +481,8 @@ static kvm_t *kd;
    Return the number written (never more than 3, but may be less than NELEM),
    or -1 if an error occurred.  */
 
+int getloadavg (double loadavg[], int nelem);
+
 int
 getloadavg (double loadavg[], int nelem)
 {
@@ -773,7 +750,7 @@ getloadavg (double loadavg[], int nelem)
        : (load_ave.tl_avenrun.l[0] / (double) load_ave.tl_lscale));
 #endif /* OSF_MIPS */
 
-#if !defined (LDAV_DONE) && defined (WIN32_NATIVE)
+#if !defined (LDAV_DONE) && (defined (WIN32_NATIVE) || defined (CYGWIN))
 #define LDAV_DONE
 
   /* A faithful emulation is going to have to be saved for a rainy day.  */
@@ -781,7 +758,7 @@ getloadavg (double loadavg[], int nelem)
     {
       loadavg[elem] = 0.0;
     }
-#endif  /* WIN32_NATIVE */
+#endif  /* WIN32_NATIVE or CYGWIN */
 
 #if !defined (LDAV_DONE) && defined (OSF_ALPHA)
 #define LDAV_DONE
@@ -954,22 +931,3 @@ main (int argc, char **argv)
   exit (0);
 }
 #endif /* TEST */
-
-#else
-
-/* Emulate getloadavg.  */
-int
-getloadavg (double loadavg[], int nelem)
-{
-  int i;
-
-  /* A faithful emulation is going to have to be saved for a rainy day.  */
-  for (i = 0; i < nelem; i++) 
-    {
-      loadavg[i] = 0.0;
-    }
-  return i;
-}
-
-#endif /*__GNUWIN32__*/
-#endif /* WIN32_NATIVE */
index cb61afa..f8502d1 100644 (file)
@@ -119,7 +119,8 @@ jpeg_validate (Lisp_Object instantiator)
 }
 
 static Lisp_Object
-jpeg_normalize (Lisp_Object inst, Lisp_Object console_type)
+jpeg_normalize (Lisp_Object inst, Lisp_Object console_type,
+               Lisp_Object dest_mask)
 {
   return simple_image_type_normalize (inst, console_type, Qjpeg);
 }
@@ -515,7 +516,8 @@ gif_validate (Lisp_Object instantiator)
 }
 
 static Lisp_Object
-gif_normalize (Lisp_Object inst, Lisp_Object console_type)
+gif_normalize (Lisp_Object inst, Lisp_Object console_type,
+              Lisp_Object dest_mask)
 {
   return simple_image_type_normalize (inst, console_type, Qgif);
 }
@@ -757,7 +759,8 @@ png_validate (Lisp_Object instantiator)
 }
 
 static Lisp_Object
-png_normalize (Lisp_Object inst, Lisp_Object console_type)
+png_normalize (Lisp_Object inst, Lisp_Object console_type,
+              Lisp_Object dest_mask)
 {
   return simple_image_type_normalize (inst, console_type, Qpng);
 }
@@ -1043,7 +1046,8 @@ tiff_validate (Lisp_Object instantiator)
 }
 
 static Lisp_Object
-tiff_normalize (Lisp_Object inst, Lisp_Object console_type)
+tiff_normalize (Lisp_Object inst, Lisp_Object console_type,
+               Lisp_Object dest_mask)
 {
   return simple_image_type_normalize (inst, console_type, Qtiff);
 }
@@ -1255,7 +1259,7 @@ tiff_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
     mem_struct.len = len;
     mem_struct.index = 0;
 
-    unwind.tiff = TIFFClientOpen ("memfile", "r", &mem_struct,
+    unwind.tiff = TIFFClientOpen ("memfile", "r", (thandle_t) &mem_struct,
                                  (TIFFReadWriteProc)tiff_memory_read,
                                  (TIFFReadWriteProc)tiff_memory_write,
                                  tiff_memory_seek, tiff_memory_close, tiff_memory_size,
index 56c6b65..4d4a5f1 100644 (file)
@@ -134,7 +134,7 @@ get_device_compdc (struct device *d)
 static void init_image_instance_geometry (Lisp_Image_Instance *ii)
 {
   struct device *d = DOMAIN_XDEVICE (ii->domain);
-  
+
   if (/* #### Scaleable && */ DEVICE_MSPRINTER_P (d))
     {
       HDC printer_dc = DEVICE_MSPRINTER_HCDC (d);
@@ -154,7 +154,7 @@ static void init_image_instance_geometry (Lisp_Image_Instance *ii)
        IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_WIDTH (ii);
       IMAGE_INSTANCE_PIXMAP_HEIGHT (ii) =
        IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_HEIGHT (ii);
-    }      
+    }
 }
 
 #define BPLINE(width) ((int)(~3UL & (unsigned long)((width) +3)))
@@ -686,7 +686,7 @@ mswindows_create_resized_mask (Lisp_Image_Instance* ii,
 }
 
 #if 0 /* Currently unused */
-/* #### Warining: This function is not correct anymore with
+/* #### Warning: This function is not correct anymore with
    resizable printer bitmaps.  If you uncomment it, clean it. --kkm */
 int
 mswindows_resize_dibitmap_instance (Lisp_Image_Instance* ii,
@@ -1019,7 +1019,8 @@ bmp_validate (Lisp_Object instantiator)
 }
 
 static Lisp_Object
-bmp_normalize (Lisp_Object inst, Lisp_Object console_type)
+bmp_normalize (Lisp_Object inst, Lisp_Object console_type,
+              Lisp_Object dest_mask)
 {
   return simple_image_type_normalize (inst, console_type, Qbmp);
 }
@@ -1086,7 +1087,8 @@ mswindows_resource_validate (Lisp_Object instantiator)
 }
 
 static Lisp_Object
-mswindows_resource_normalize (Lisp_Object inst, Lisp_Object console_type)
+mswindows_resource_normalize (Lisp_Object inst, Lisp_Object console_type,
+                             Lisp_Object dest_mask)
 {
   /* This function can call lisp */
   Lisp_Object file = Qnil;
@@ -1315,12 +1317,32 @@ mswindows_resource_instantiate (Lisp_Object image_instance, Lisp_Object instanti
     signal_simple_error ("Invalid resource identifier", resource_id);
 
   /* load the image */
-  if (!(himage = LoadImage (hinst, resid, type, 0, 0,
-                           LR_CREATEDIBSECTION | LR_DEFAULTSIZE |
-                           LR_SHARED |
-                           (!NILP (file) ? LR_LOADFROMFILE : 0))))
+  if (xLoadImageA) /* not in NT 3.5 */
+    {
+      if (!(himage = xLoadImageA (hinst, resid, type, 0, 0,
+                                 LR_CREATEDIBSECTION | LR_DEFAULTSIZE |
+                                 LR_SHARED |
+                                 (!NILP (file) ? LR_LOADFROMFILE : 0))))
+       signal_simple_error ("Cannot load image", instantiator);
+    }
+  else
     {
-      signal_simple_error ("Cannot load image", instantiator);
+      /* Is this correct?  I don't really care. */
+      switch (type)
+       {
+       case IMAGE_BITMAP:
+         himage = LoadBitmap (hinst, resid);
+         break;
+       case IMAGE_CURSOR:
+         himage = LoadCursor (hinst, resid);
+         break;
+       case IMAGE_ICON:
+         himage = LoadIcon (hinst, resid);
+         break;
+       }
+
+      if (!himage)
+       signal_simple_error ("Cannot load image", instantiator);
     }
 
   if (hinst)
@@ -2143,11 +2165,13 @@ mswindows_widget_hfont (Lisp_Image_Instance *p,
 static HDWP
 begin_defer_window_pos (struct frame *f)
 {
+#ifdef DEFER_WINDOW_POS
   if (FRAME_MSWINDOWS_DATA (f)->hdwp == 0)
     FRAME_MSWINDOWS_DATA (f)->hdwp = BeginDeferWindowPos (10);
+#endif
   return FRAME_MSWINDOWS_DATA (f)->hdwp;
 }
-  
+
 /* unmap the image if it is a widget. This is used by redisplay via
    redisplay_unmap_subwindows */
 static void
@@ -2155,6 +2179,7 @@ mswindows_unmap_subwindow (Lisp_Image_Instance *p)
 {
   if (IMAGE_INSTANCE_SUBWINDOW_ID (p))
     {
+#ifdef DEFER_WINDOW_POS
       struct frame *f = XFRAME (IMAGE_INSTANCE_FRAME (p));
       HDWP hdwp = begin_defer_window_pos (f);
       HDWP new_hdwp;
@@ -2175,6 +2200,13 @@ mswindows_unmap_subwindow (Lisp_Image_Instance *p)
       else
        hdwp = new_hdwp;
       FRAME_MSWINDOWS_DATA (f)->hdwp = hdwp;
+#else
+      SetWindowPos (IMAGE_INSTANCE_MSWINDOWS_CLIPWINDOW (p),
+                   NULL,
+                   0, 0, 0, 0,
+                   SWP_HIDEWINDOW | SWP_NOACTIVATE |
+                   SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER );
+#endif
       if (GetFocus() == WIDGET_INSTANCE_MSWINDOWS_HANDLE (p))
        SetFocus (GetParent (IMAGE_INSTANCE_MSWINDOWS_CLIPWINDOW (p)));
     }
@@ -2186,9 +2218,11 @@ static void
 mswindows_map_subwindow (Lisp_Image_Instance *p, int x, int y,
                         struct display_glyph_area* dga)
 {
+#ifdef DEFER_WINDOW_POS
   struct frame *f = XFRAME (IMAGE_INSTANCE_FRAME (p));
   HDWP hdwp = begin_defer_window_pos (f);
   HDWP new_hdwp;
+#endif
   /* move the window before mapping it ... */
   SetWindowPos (IMAGE_INSTANCE_MSWINDOWS_CLIPWINDOW (p),
                NULL,
@@ -2202,24 +2236,36 @@ mswindows_map_subwindow (Lisp_Image_Instance *p, int x, int y,
                SWP_NOZORDER | SWP_NOSIZE
                | SWP_NOCOPYBITS | SWP_NOSENDCHANGING);
   /* ... now map it - we are not allowed to move it at the same time. */
-  new_hdwp = DeferWindowPos (hdwp, IMAGE_INSTANCE_MSWINDOWS_CLIPWINDOW (p),
-                            NULL,
-                            0, 0, 0, 0,
-                            SWP_NOZORDER | SWP_NOSIZE | SWP_NOMOVE
-                            | SWP_SHOWWINDOW
-                            /* | SWP_NOCOPYBITS */
-                            /* Setting this flag causes the call to
-                               DeferWindowPos to fail with
-                               "Invalid parameter".  I don't understand
-                               why we bother to try and set this
-                               anyway. -- ben */
-                            /* | SWP_NOSENDCHANGING */
-                            | SWP_NOACTIVATE);
-  if (!new_hdwp)
-    mswindows_output_last_error ("mapping");
-  else
-    hdwp = new_hdwp;
-  FRAME_MSWINDOWS_DATA (f)->hdwp = hdwp;
+  if (!IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (p))
+    {
+#ifdef DEFER_WINDOW_POS
+      new_hdwp = DeferWindowPos
+       (hdwp,
+        IMAGE_INSTANCE_MSWINDOWS_CLIPWINDOW (p),
+        NULL, 0, 0, 0, 0,
+        SWP_NOZORDER | SWP_NOSIZE | SWP_NOMOVE
+        | SWP_SHOWWINDOW
+        /* | SWP_NOCOPYBITS */
+        /* Setting this flag causes the call to
+           DeferWindowPos to fail with
+           "Invalid parameter".  I don't understand
+           why we bother to try and set this
+           anyway. -- ben */
+        /* | SWP_NOSENDCHANGING */
+        | SWP_NOACTIVATE);
+      if (!new_hdwp)
+       mswindows_output_last_error ("mapping");
+      else
+       hdwp = new_hdwp;
+      FRAME_MSWINDOWS_DATA (f)->hdwp = hdwp;
+#else
+      SetWindowPos (IMAGE_INSTANCE_MSWINDOWS_CLIPWINDOW (p),
+                   NULL,
+                   0, 0, 0, 0,
+                   SWP_NOZORDER | SWP_NOSIZE | SWP_NOMOVE
+                   | SWP_SHOWWINDOW | SWP_NOCOPYBITS | SWP_NOACTIVATE);
+#endif
+    }
 }
 
 /* resize the subwindow instance */
@@ -2237,7 +2283,7 @@ mswindows_resize_subwindow (Lisp_Image_Instance* ii, int w, int h)
 
 /* Simply resize the window here. */
 static void
-mswindows_update_subwindow (Lisp_Image_Instance *p)
+mswindows_redisplay_subwindow (Lisp_Image_Instance *p)
 {
   mswindows_resize_subwindow (p,
                              IMAGE_INSTANCE_WIDTH (p),
@@ -2247,7 +2293,7 @@ mswindows_update_subwindow (Lisp_Image_Instance *p)
 /* when you click on a widget you may activate another widget this
    needs to be checked and all appropriate widgets updated */
 static void
-mswindows_update_widget (Lisp_Image_Instance *p)
+mswindows_redisplay_widget (Lisp_Image_Instance *p)
 {
   /* Possibly update the face font and colors. */
   if (!NILP (IMAGE_INSTANCE_WIDGET_TEXT (p))
@@ -2265,7 +2311,7 @@ mswindows_update_widget (Lisp_Image_Instance *p)
   /* Possibly update the dimensions. */
   if (IMAGE_INSTANCE_SIZE_CHANGED (p))
     {
-      mswindows_resize_subwindow (p, 
+      mswindows_resize_subwindow (p,
                                  IMAGE_INSTANCE_WIDTH (p),
                                  IMAGE_INSTANCE_HEIGHT (p));
     }
@@ -2282,7 +2328,7 @@ mswindows_update_widget (Lisp_Image_Instance *p)
     }
 }
 
-/* register widgets into our hastable so that we can cope with the
+/* register widgets into our hashtable so that we can cope with the
    callbacks. The hashtable is weak so deregistration is handled
    automatically */
 static int
@@ -2512,6 +2558,11 @@ mswindows_widget_instantiate (Lisp_Object image_instance, Lisp_Object instantiat
     SendMessage (wnd, WM_SETFONT,
                 (WPARAM) mswindows_widget_hfont (ii, domain),
                 MAKELPARAM (TRUE, 0));
+#if 0
+  /* #### doesn't work.  need to investigate more closely. */
+  if (IMAGE_INSTANCE_WANTS_INITIAL_FOCUS (ii))
+    SetFocus (wnd);
+#endif
 }
 
 /* Instantiate a native layout widget. */
@@ -2524,15 +2575,15 @@ mswindows_native_layout_instantiate (Lisp_Object image_instance,
   Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
 
   mswindows_widget_instantiate (image_instance, instantiator, pointer_fg,
-                               pointer_bg, dest_mask, domain, "STATIC", 
+                               pointer_bg, dest_mask, domain, "STATIC",
                                /* Approximation to styles available with
                                   an XEmacs layout. */
-                               EQ (IMAGE_INSTANCE_LAYOUT_BORDER (ii),
-                                   Qetched_in) ||
-                               EQ (IMAGE_INSTANCE_LAYOUT_BORDER (ii),
-                                   Qetched_out) ||
-                               GLYPHP (IMAGE_INSTANCE_LAYOUT_BORDER (ii))
-                               ? SS_ETCHEDFRAME : SS_SUNKEN,
+                               (EQ (IMAGE_INSTANCE_LAYOUT_BORDER (ii),
+                                    Qetched_in) ||
+                                EQ (IMAGE_INSTANCE_LAYOUT_BORDER (ii),
+                                    Qetched_out) ||
+                                GLYPHP (IMAGE_INSTANCE_LAYOUT_BORDER (ii))
+                                ? SS_ETCHEDFRAME : SS_SUNKEN) | DS_CONTROL,
                                0);
 }
 
@@ -2611,7 +2662,7 @@ mswindows_button_instantiate (Lisp_Object image_instance, Lisp_Object instantiat
 
 /* Update the state of a button. */
 static void
-mswindows_button_update (Lisp_Object image_instance)
+mswindows_button_redisplay (Lisp_Object image_instance)
 {
   /* This function can GC if IN_REDISPLAY is false. */
   Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
@@ -2645,6 +2696,7 @@ mswindows_progress_gauge_instantiate (Lisp_Object image_instance, Lisp_Object in
 {
   HWND wnd;
   Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+  Lisp_Object val;
   mswindows_widget_instantiate (image_instance, instantiator, pointer_fg,
                                pointer_bg, dest_mask, domain, PROGRESS_CLASS,
                                WS_BORDER | PBS_SMOOTH, WS_EX_CLIENTEDGE);
@@ -2666,6 +2718,10 @@ mswindows_progress_gauge_instantiate (Lisp_Object image_instance, Lisp_Object in
                            (XIMAGE_INSTANCE_WIDGET_FACE (ii),
                             XIMAGE_INSTANCE_FRAME (ii))))));
 #endif
+  val = XGUI_ITEM (IMAGE_INSTANCE_WIDGET_ITEMS (ii))->value;
+  CHECK_INT (val);
+  SendMessage (WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii),
+              PBM_SETPOS, (WPARAM)XINT (val), 0);
 }
 
 /* instantiate a tree view widget */
@@ -2755,12 +2811,47 @@ mswindows_tree_view_instantiate (Lisp_Object image_instance, Lisp_Object instant
     }
 }
 
+/* Set the properties of a tree view. */
+static void
+mswindows_tree_view_redisplay (Lisp_Object image_instance)
+{
+  /* This function can GC if IN_REDISPLAY is false. */
+  Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+
+  if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii))
+    {
+      HWND wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii);
+      Lisp_Object rest;
+      HTREEITEM parent;
+      /* Delete previous items. */
+      SendMessage (wnd, TVM_DELETEITEM, 0, (LPARAM)TVI_ROOT);
+      /* define a root */
+      parent = add_tree_item (image_instance, wnd, NULL,
+                             XCAR (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii)),
+                             TRUE, IMAGE_INSTANCE_DOMAIN (ii));
+
+      /* recursively add items to the tree view */
+      /* add items to the tab */
+      LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii)))
+       {
+         if (LISTP (XCAR (rest)))
+           add_tree_item_list (image_instance, wnd, parent, XCAR (rest),
+                               IMAGE_INSTANCE_DOMAIN (ii));
+         else
+           add_tree_item (image_instance, wnd, parent, XCAR (rest), FALSE,
+                          IMAGE_INSTANCE_DOMAIN (ii));
+       }
+    }
+}
+
 /* instantiate a tab control */
-static TC_ITEM* add_tab_item (Lisp_Object image_instance,
-                            HWND wnd, Lisp_Object item,
-                            Lisp_Object domain, int i)
+static int
+add_tab_item (Lisp_Object image_instance,
+             HWND wnd, Lisp_Object item,
+             Lisp_Object domain, int i)
 {
-  TC_ITEM tvitem, *ret;
+  TC_ITEM tvitem;
+  int ret = 0;
 
   tvitem.mask = TCIF_TEXT;
 
@@ -2783,8 +2874,8 @@ static TC_ITEM* add_tab_item (Lisp_Object image_instance,
 
   tvitem.cchTextMax = strlen (tvitem.pszText);
 
-  if ((ret = (TC_ITEM*)SendMessage (wnd, TCM_INSERTITEM,
-                                   i, (LPARAM)&tvitem)) < 0)
+  if ((ret = SendMessage (wnd, TCM_INSERTITEM,
+                         i, (LPARAM)&tvitem)) < 0)
     signal_simple_error ("error adding tab entry", item);
 
   return ret;
@@ -2820,7 +2911,8 @@ mswindows_tab_control_instantiate (Lisp_Object image_instance, Lisp_Object insta
   /* add items to the tab */
   LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)))
     {
-      add_tab_item (image_instance, wnd, XCAR (rest), domain, i);
+      int idx = add_tab_item (image_instance, wnd, XCAR (rest), domain, i);
+      assert (idx == i);
       if (gui_item_selected_p (XCAR (rest)))
        selected = i;
       i++;
@@ -2828,32 +2920,78 @@ mswindows_tab_control_instantiate (Lisp_Object image_instance, Lisp_Object insta
   SendMessage (wnd, TCM_SETCURSEL, selected, 0);
 }
 
-/* set the properties of a tab control */
+/* Set the properties of a tab control. */
 static void
-mswindows_tab_control_update (Lisp_Object image_instance)
+mswindows_tab_control_redisplay (Lisp_Object image_instance)
 {
   /* This function can GC if IN_REDISPLAY is false. */
   Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
-
-  if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii))
+#ifdef DEBUG_WIDGET_OUTPUT
+  stderr_out ("tab control %p redisplayed\n", IMAGE_INSTANCE_SUBWINDOW_ID (ii));
+#endif
+  if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii)
+      ||
+      IMAGE_INSTANCE_WIDGET_ACTION_OCCURRED (ii))
     {
       HWND wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii);
       int i = 0, selected = 0;
       Lisp_Object rest;
 
-      /* delete the pre-existing items */
-      SendMessage (wnd, TCM_DELETEALLITEMS, 0, 0);
+      assert (!NILP (IMAGE_INSTANCE_WIDGET_ITEMS (ii)));
 
-      /* add items to the tab */
-      LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii)))
+      /* If only the order has changed then simply select the first
+        one. This stops horrendous rebuilding of the tabs each time
+        you click on one. */
+      if (tab_control_order_only_changed (image_instance))
        {
-         add_tab_item (image_instance, wnd, XCAR (rest),
-                       IMAGE_INSTANCE_FRAME (ii), i);
-         if (gui_item_selected_p (XCAR (rest)))
-           selected = i;
-         i++;
+         Lisp_Object selected =
+           gui_item_list_find_selected
+           (NILP (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii)) ?
+            XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)) :
+            XCDR (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii)));
+
+         LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)))
+           {
+             if (gui_item_equal_sans_selected (XCAR (rest), selected, 0))
+               {
+                 Lisp_Object old_selected = gui_item_list_find_selected
+                   (XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)));
+
+                 /* Pick up the new selected item. */
+                 XGUI_ITEM (old_selected)->selected =
+                   XGUI_ITEM (XCAR (rest))->selected;
+                 XGUI_ITEM (XCAR (rest))->selected =
+                   XGUI_ITEM (selected)->selected;
+                 /* We're not actually changing the items. */
+                 IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii) = 0;
+                 IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii) = Qnil;
+
+                 SendMessage (wnd, TCM_SETCURSEL, i, 0);
+#ifdef DEBUG_WIDGET_OUTPUT
+                 stderr_out ("tab control %p selected item %d\n",
+                         IMAGE_INSTANCE_SUBWINDOW_ID (ii), i);
+#endif
+                 break;
+               }
+             i++;
+           }
+       }
+      else
+       {
+         /* delete the pre-existing items */
+         SendMessage (wnd, TCM_DELETEALLITEMS, 0, 0);
+
+         /* add items to the tab */
+         LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii)))
+           {
+             add_tab_item (image_instance, wnd, XCAR (rest),
+                           IMAGE_INSTANCE_FRAME (ii), i);
+             if (gui_item_selected_p (XCAR (rest)))
+               selected = i;
+             i++;
+           }
+         SendMessage (wnd, TCM_SETCURSEL, selected, 0);
        }
-      SendMessage (wnd, TCM_SETCURSEL, selected, 0);
     }
 }
 
@@ -2888,8 +3026,7 @@ mswindows_combo_box_instantiate (Lisp_Object image_instance, Lisp_Object instant
   Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
   HWND wnd;
   Lisp_Object rest;
-  Lisp_Object data = Fplist_get (find_keyword_in_vector (instantiator, Q_properties),
-                                Q_items, Qnil);
+  Lisp_Object items = find_keyword_in_vector (instantiator, Q_items);
   int len, height;
 
   /* Maybe ought to generalise this more but it may be very windows
@@ -2903,7 +3040,7 @@ mswindows_combo_box_instantiate (Lisp_Object image_instance, Lisp_Object instant
 
   /* We now have everything right apart from the height. */
   default_face_font_info (domain, 0, 0, &height, 0, 0);
-  GET_LIST_LENGTH (data, len);
+  GET_LIST_LENGTH (items, len);
 
   height = (height + WIDGET_BORDER_HEIGHT * 2 ) * len;
   IMAGE_INSTANCE_HEIGHT (ii) = height;
@@ -2919,12 +3056,14 @@ mswindows_combo_box_instantiate (Lisp_Object image_instance, Lisp_Object instant
   image_instance_layout (image_instance,
                         IMAGE_UNSPECIFIED_GEOMETRY,
                         IMAGE_UNSPECIFIED_GEOMETRY,
+                        IMAGE_UNCHANGED_GEOMETRY,
+                        IMAGE_UNCHANGED_GEOMETRY,
                         domain);
 
   wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii);
   /* add items to the combo box */
   SendMessage (wnd, CB_RESETCONTENT, 0, 0);
-  LIST_LOOP (rest, Fplist_get (IMAGE_INSTANCE_WIDGET_PROPS (ii), Q_items, Qnil))
+  LIST_LOOP (rest, items)
     {
       Extbyte* lparam;
       TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (rest),
@@ -2988,12 +3127,12 @@ mswindows_combo_box_property (Lisp_Object image_instance, Lisp_Object prop)
   return Qunbound;
 }
 
-/* set the properties of a progres guage */
+/* set the properties of a progress gauge */
 static void
-mswindows_progress_gauge_update (Lisp_Object image_instance)
+mswindows_progress_gauge_redisplay (Lisp_Object image_instance)
 {
   Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
-  
+
   if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii))
     {
       Lisp_Object val;
@@ -3001,10 +3140,10 @@ mswindows_progress_gauge_update (Lisp_Object image_instance)
       assert (GUI_ITEMP (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii)));
 #endif
       val = XGUI_ITEM (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii))->value;
-#ifdef DEBUG_WIDGET_OUTPUT     
-      printf ("progress gauge displayed value on %p updated to %ld\n",
-             WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii),
-             XINT(val));
+#ifdef DEBUG_WIDGET_OUTPUT
+      stderr_out ("progress gauge displayed value on %p updated to %ld\n",
+                 WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii),
+                 XINT(val));
 #endif
       CHECK_INT (val);
       SendMessage (WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii),
@@ -3054,9 +3193,9 @@ console_type_create_glyphs_mswindows (void)
   CONSOLE_HAS_METHOD (mswindows, finalize_image_instance);
   CONSOLE_HAS_METHOD (mswindows, unmap_subwindow);
   CONSOLE_HAS_METHOD (mswindows, map_subwindow);
-  CONSOLE_HAS_METHOD (mswindows, update_subwindow);
+  CONSOLE_HAS_METHOD (mswindows, redisplay_subwindow);
   CONSOLE_HAS_METHOD (mswindows, resize_subwindow);
-  CONSOLE_HAS_METHOD (mswindows, update_widget);
+  CONSOLE_HAS_METHOD (mswindows, redisplay_widget);
   CONSOLE_HAS_METHOD (mswindows, image_instance_equal);
   CONSOLE_HAS_METHOD (mswindows, image_instance_hash);
   CONSOLE_HAS_METHOD (mswindows, init_image_instance_from_eimage);
@@ -3118,7 +3257,7 @@ image_instantiator_format_create_glyphs_mswindows (void)
   INITIALIZE_DEVICE_IIFORMAT (mswindows, button);
   IIFORMAT_HAS_DEVMETHOD (mswindows, button, property);
   IIFORMAT_HAS_DEVMETHOD (mswindows, button, instantiate);
-  IIFORMAT_HAS_DEVMETHOD (mswindows, button, update);
+  IIFORMAT_HAS_DEVMETHOD (mswindows, button, redisplay);
   /* edit-field widget */
   INITIALIZE_DEVICE_IIFORMAT (mswindows, edit_field);
   IIFORMAT_HAS_DEVMETHOD (mswindows, edit_field, instantiate);
@@ -3137,16 +3276,16 @@ image_instantiator_format_create_glyphs_mswindows (void)
   IIFORMAT_HAS_DEVMETHOD (mswindows, scrollbar, instantiate);
   /* progress gauge */
   INITIALIZE_DEVICE_IIFORMAT (mswindows, progress_gauge);
-  IIFORMAT_HAS_DEVMETHOD (mswindows, progress_gauge, update);
+  IIFORMAT_HAS_DEVMETHOD (mswindows, progress_gauge, redisplay);
   IIFORMAT_HAS_DEVMETHOD (mswindows, progress_gauge, instantiate);
   /* tree view widget */
   INITIALIZE_DEVICE_IIFORMAT (mswindows, tree_view);
-  /*  IIFORMAT_HAS_DEVMETHOD (mswindows, progress, set_property);*/
   IIFORMAT_HAS_DEVMETHOD (mswindows, tree_view, instantiate);
+  IIFORMAT_HAS_DEVMETHOD (mswindows, tree_view, redisplay);
   /* tab control widget */
   INITIALIZE_DEVICE_IIFORMAT (mswindows, tab_control);
   IIFORMAT_HAS_DEVMETHOD (mswindows, tab_control, instantiate);
-  IIFORMAT_HAS_DEVMETHOD (mswindows, tab_control, update);
+  IIFORMAT_HAS_DEVMETHOD (mswindows, tab_control, redisplay);
 #endif
   /* windows bitmap format */
   INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (bmp, "bmp");
index bc3e829..fbba67f 100644 (file)
@@ -58,10 +58,8 @@ Lisp_Object Qlayout;
 DEFINE_IMAGE_INSTANTIATOR_FORMAT (native_layout);
 Lisp_Object Qnative_layout;
 
-Lisp_Object Q_descriptor, Q_height, Q_width, Q_properties, Q_items;
-Lisp_Object Q_image, Q_text, Q_orientation, Q_justify, Q_border;
-Lisp_Object Q_margin_width;
 Lisp_Object Qetched_in, Qetched_out, Qbevel_in, Qbevel_out;
+Lisp_Object Qmake_glyph;
 
 #ifdef DEBUG_WIDGETS
 int debug_widget_instances;
@@ -85,16 +83,14 @@ widget_possible_dest_types (void)
 }
 
 static void
-check_valid_glyph_or_instantiator (Lisp_Object data)
+check_valid_instantiator (Lisp_Object data)
 {
   Lisp_Object glyph = data;
   if (SYMBOLP (data))
     glyph = XSYMBOL (data)->value;
 
-  if (IMAGE_INSTANCEP (glyph))
-    CHECK_IMAGE_INSTANCE (glyph);
-  else if (!CONSP (glyph) && !VECTORP (glyph))
-    CHECK_BUFFER_GLYPH (glyph);
+  if (!CONSP (glyph) && !VECTORP (glyph))
+    invalid_argument ("instantiator item must be a vector", data);
 }
 
 static void
@@ -103,7 +99,7 @@ check_valid_orientation (Lisp_Object data)
   if (!EQ (data, Qhorizontal)
       &&
       !EQ (data, Qvertical))
-    signal_simple_error ("unknown orientation for layout", data);
+    invalid_argument ("unknown orientation for layout", data);
 }
 
 static void
@@ -116,14 +112,14 @@ check_valid_tab_orientation (Lisp_Object data)
       !EQ (data, Qleft)
       &&
       !EQ (data, Qright))
-    signal_simple_error ("unknown orientation for tab control", data);
+    invalid_argument ("unknown orientation for tab control", data);
 }
 
 static void
 check_valid_justification (Lisp_Object data)
 {
   if (!EQ (data, Qleft) && !EQ (data, Qright) && !EQ (data, Qcenter))
-    signal_simple_error ("unknown justification for layout", data);
+    invalid_argument ("unknown justification for layout", data);
 }
 
 static void
@@ -132,7 +128,7 @@ check_valid_border (Lisp_Object data)
   if (!EQ (data, Qt) && !EQ (data, Qetched_in) && !EQ (data, Qetched_out)
       && !EQ (data, Qbevel_in) && !EQ (data, Qbevel_out)
       && !GLYPHP (data) && !VECTORP (data))
-    signal_simple_error ("unknown border style for layout", data);
+    invalid_argument ("unknown border style for layout", data);
 }
 
 static void
@@ -147,7 +143,7 @@ check_valid_callback (Lisp_Object data)
        && !COMPILED_FUNCTIONP (data)
        && !CONSP (data))
     {
-       signal_simple_error (":callback must be a function or expression", data);
+       invalid_argument (":callback must be a function or expression", data);
     }
 }
 
@@ -155,7 +151,7 @@ static void
 check_valid_int_or_function (Lisp_Object data)
 {
   if (!INTP (data) && !CONSP (data))
-    signal_simple_error ("must be an integer or expresssion", data);
+    invalid_argument ("must be an integer or expresssion", data);
 }
 
 static void
@@ -168,11 +164,11 @@ static void
 check_valid_string_or_vector (Lisp_Object data)
 {
     if (!STRINGP (data) && !VECTORP (data))
-       signal_simple_error (":descriptor must be a string or a vector", data);
+       invalid_argument (":descriptor must be a string or a vector", data);
 }
 
 void
-check_valid_item_list_1 (Lisp_Object items)
+check_valid_item_list (Lisp_Object items)
 {
   Lisp_Object rest;
 
@@ -184,32 +180,21 @@ check_valid_item_list_1 (Lisp_Object items)
       else if (VECTORP (XCAR (rest)))
        gui_parse_item_keywords (XCAR (rest));
       else if (LISTP (XCAR (rest)))
-       check_valid_item_list_1 (XCAR (rest));
+       check_valid_item_list (XCAR (rest));
       else
-       signal_simple_error ("Items must be vectors, lists or strings", items);
+       invalid_argument ("Items must be vectors, lists or strings", items);
     }
 }
 
 static void
-check_valid_item_list (Lisp_Object data)
-{
-  Lisp_Object items;
-
-  Fcheck_valid_plist (data);
-  items = Fplist_get (data, Q_items, Qnil);
-
-  check_valid_item_list_1 (items);
-}
-
-static void
-check_valid_glyph_or_instantiator_list (Lisp_Object data)
+check_valid_instantiator_list (Lisp_Object data)
 {
   Lisp_Object rest;
 
   CHECK_LIST (data);
   EXTERNAL_LIST_LOOP (rest, data)
     {
-      check_valid_glyph_or_instantiator (XCAR (rest));
+      check_valid_instantiator (XCAR (rest));
     }
 }
 
@@ -219,26 +204,26 @@ glyph_instantiator_to_glyph (Lisp_Object sym)
   /* This function calls lisp. */
   Lisp_Object glyph = sym;
   struct gcpro gcpro1;
-         
+
   GCPRO1 (glyph);
   /* if we have a symbol get at the actual data */
   if (SYMBOLP (glyph))
     glyph = XSYMBOL (glyph)->value;
-         
+
   if (CONSP (glyph))
     glyph = Feval (glyph);
 
   /* Be really helpful to the user. */
   if (VECTORP (glyph))
     {
-      glyph = call1 (intern ("make-glyph"), glyph);
+      glyph = call1 (Qmake_glyph, glyph);
     }
 
   /* substitute the new glyph */
   RETURN_UNGCPRO (glyph);
 }
 
-static void 
+static void
 substitute_keyword_value (Lisp_Object inst, Lisp_Object key, Lisp_Object val)
 {
   int i;
@@ -264,24 +249,24 @@ substitute_keyword_value (Lisp_Object inst, Lisp_Object key, Lisp_Object val)
    type (Qedit_field for example). It is debatable whether we should
    wire things in this generalised way rather than treating widgets
    specially in image_instance_property. */
-static Lisp_Object 
+static Lisp_Object
 widget_property (Lisp_Object image_instance, Lisp_Object prop)
 {
   Lisp_Image_Instance* ii = XIMAGE_INSTANCE (image_instance);
   struct image_instantiator_methods* meths;
-
+#if 0                          /* The usefulness of this is dubious. */
   /* first see if its a general property ... */
   if (!NILP (Fplist_member (IMAGE_INSTANCE_WIDGET_PROPS (ii), prop)))
     return Fplist_get (IMAGE_INSTANCE_WIDGET_PROPS (ii), prop, Qnil);
-
+#endif
   /* .. then try device specific methods ... */
   meths = decode_device_ii_format (image_instance_device (image_instance),
-                                  IMAGE_INSTANCE_WIDGET_TYPE (ii), 
+                                  IMAGE_INSTANCE_WIDGET_TYPE (ii),
                                   ERROR_ME_NOT);
   if (meths && HAS_IIFORMAT_METH_P (meths, property))
     return IIFORMAT_METH (meths, property, (image_instance, prop));
   /* ... then format specific methods ... */
-  meths = decode_device_ii_format (Qnil, IMAGE_INSTANCE_WIDGET_TYPE (ii), 
+  meths = decode_device_ii_format (Qnil, IMAGE_INSTANCE_WIDGET_TYPE (ii),
                                   ERROR_ME_NOT);
   if (meths && HAS_IIFORMAT_METH_P (meths, property))
     return IIFORMAT_METH (meths, property, (image_instance, prop));
@@ -289,58 +274,62 @@ widget_property (Lisp_Object image_instance, Lisp_Object prop)
   return Qunbound;
 }
 
-static Lisp_Object 
-widget_set_property (Lisp_Object image_instance, Lisp_Object prop, Lisp_Object val)
+/* Update the displayed properties of a widget.
+
+   #### This has been adapted from the original set_property functions
+   and thus reuses the state management of that. A better solution is
+   to simply re-parse the instantiator when items need updating. This
+   make comparing differences much simpler and obviates the need for a
+   lot of the state variables.
+
+   #### property is still a valid function since we have to be able to
+   extract information from the actual widget.
+
+   #### update_widget should probably be re-written to use the
+   instantiator. We probably want to keep a record of the differences
+   also to make this easy. We would also need a pending_instantiator
+   so that changes could be delayed. */
+static void
+widget_update (Lisp_Object image_instance, Lisp_Object instantiator)
 {
   Lisp_Image_Instance* ii = XIMAGE_INSTANCE (image_instance);
   struct image_instantiator_methods* meths;
-  Lisp_Object ret;
 
-  /* PIck up any generic properties that we might need to keep hold
+  Lisp_Object text = find_keyword_in_vector (instantiator, Q_text);
+  /* Pick up any generic properties that we might need to keep hold
      of. */
-  if (EQ (prop, Q_text))
+  if (!NILP (text))
     {
-      IMAGE_INSTANCE_WIDGET_TEXT (ii) = val;
+      IMAGE_INSTANCE_WIDGET_TEXT (ii) = text;
       IMAGE_INSTANCE_TEXT_CHANGED (ii) = 1;
     }
 
   /* Now try device specific methods first ... */
-  meths = decode_device_ii_format (image_instance_device (image_instance), 
-                                  IMAGE_INSTANCE_WIDGET_TYPE (ii), 
+  meths = decode_device_ii_format (image_instance_device (image_instance),
+                                  IMAGE_INSTANCE_WIDGET_TYPE (ii),
                                   ERROR_ME_NOT);
-  if (meths && HAS_IIFORMAT_METH_P (meths, set_property)
-      &&
-      !UNBOUNDP (ret = 
-                IIFORMAT_METH (meths, set_property, (image_instance, prop, val))))
-    {
-      return ret;
-    }
+  MAYBE_IIFORMAT_METH (meths, update, (image_instance, instantiator));
   /* ... then format specific methods ... */
-  meths = decode_device_ii_format (Qnil, IMAGE_INSTANCE_WIDGET_TYPE (ii), 
+  meths = decode_device_ii_format (Qnil, IMAGE_INSTANCE_WIDGET_TYPE (ii),
                                   ERROR_ME_NOT);
-  if (meths && HAS_IIFORMAT_METH_P (meths, set_property)
-      &&
-      !UNBOUNDP (ret = 
-                IIFORMAT_METH (meths, set_property, (image_instance, prop, val))))
-    {
-      return ret;
-    }
-  /* we didn't do any device specific properties, so shove the property in our plist */
+  MAYBE_IIFORMAT_METH (meths, update, (image_instance, instantiator));
+#if 0 /* The usefulness of this is dubious. */
+  /* we didn't do any device specific properties, so shove the property in our plist. */
   IMAGE_INSTANCE_WIDGET_PROPS (ii)
     = Fplist_put (IMAGE_INSTANCE_WIDGET_PROPS (ii), prop, val);
-  return val;
+#endif
 }
 
 /* Like the rest of redisplay, we want widget updates to occur
    asynchronously. Thus toolkit specific methods for setting
-   properties must be called by redisplay instead of by
-   *_set_property. Thus *_set_property records the change and this
-   function actually implements it. We want to be slightly clever
-   about this however by supplying format specific functions for the
-   updates instead of lumping them all into this function. Note that
-   there is no need for format generic functions. */
+   properties must be called by redisplay instead of by *_update. Thus
+   *_update records the change and this function actually implements
+   it. We want to be slightly clever about this however by supplying
+   format specific functions for the updates instead of lumping them
+   all into this function. Note that there is no need for format
+   generic functions. This is not the same as widget_update! */
 void
-update_widget (Lisp_Object widget)
+redisplay_widget (Lisp_Object widget)
 {
   Lisp_Image_Instance* ii = XIMAGE_INSTANCE (widget);
   struct image_instantiator_methods* meths;
@@ -350,17 +339,19 @@ update_widget (Lisp_Object widget)
       || EQ (IMAGE_INSTANCE_WIDGET_TYPE (ii), Qnative_layout))
     return;
 
-  /* Device generic methods. We must update the widget's size as it
-     may have been changed by the the layout routines. We also do this
-     here so that explicit resizing from lisp does not result in
-     synchronous updates. */
-  MAYBE_DEVMETH (DOMAIN_XDEVICE (ii->domain), update_widget, (ii));
-
-  /* Device-format specific methods */
+  /* Device-format specific methods - e.g. x_tab_control_redisplay () */
   meths = decode_device_ii_format (image_instance_device (widget), 
                                   IMAGE_INSTANCE_WIDGET_TYPE (ii), 
                                   ERROR_ME_NOT);
-  MAYBE_IIFORMAT_METH (meths, update, (widget));
+  MAYBE_IIFORMAT_METH (meths, redisplay, (widget));
+
+  /* Device generic methods - e.g. x_redisplay_widget (). We must
+     update the widget's size as it may have been changed by the the
+     layout routines. We also do this here so that explicit resizing
+     from lisp does not result in synchronous updates. Do this last so
+     that format-specific methods have an opportunity to prevent
+     wholesale changes - e.g. rebuilding tabs. */
+  MAYBE_DEVMETH (DOMAIN_XDEVICE (ii->domain), redisplay_widget, (ii));
 
   /* Pick up the items we recorded earlier. */
   if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii))
@@ -373,8 +364,8 @@ update_widget (Lisp_Object widget)
 
 /* Query for a widgets desired geometry. If no type specific method is
    provided then use the widget text to calculate sizes. */
-static void 
-widget_query_geometry (Lisp_Object image_instance, 
+static void
+widget_query_geometry (Lisp_Object image_instance,
                       int* width, int* height,
                       enum image_instance_geometry disp, Lisp_Object domain)
 {
@@ -386,32 +377,32 @@ widget_query_geometry (Lisp_Object image_instance,
   /* First just set up what we already have. */
   if (width)   *width = IMAGE_INSTANCE_WIDTH (ii);
   if (height)  *height = IMAGE_INSTANCE_HEIGHT (ii);
-  
+
   if (IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii)
       ||
       IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii))
     {
       /* .. then try device specific methods ... */
       meths = decode_device_ii_format (image_instance_device (image_instance),
-                                      IMAGE_INSTANCE_WIDGET_TYPE (ii), 
+                                      IMAGE_INSTANCE_WIDGET_TYPE (ii),
                                       ERROR_ME_NOT);
       if (meths && HAS_IIFORMAT_METH_P (meths, query_geometry))
-       IIFORMAT_METH (meths, query_geometry, (image_instance, 
+       IIFORMAT_METH (meths, query_geometry, (image_instance,
                                               width, height, disp,
                                               domain));
       else
        {
          /* ... then format specific methods ... */
-         meths = decode_device_ii_format (Qnil, IMAGE_INSTANCE_WIDGET_TYPE (ii), 
+         meths = decode_device_ii_format (Qnil, IMAGE_INSTANCE_WIDGET_TYPE (ii),
                                           ERROR_ME_NOT);
          if (meths && HAS_IIFORMAT_METH_P (meths, query_geometry))
-           IIFORMAT_METH (meths, query_geometry, (image_instance, 
+           IIFORMAT_METH (meths, query_geometry, (image_instance,
                                                   width, height, disp,
                                                   domain));
-         else 
+         else
            {
              int w, h;
-             
+
              /* Then if we are allowed to resize the widget, make the
                 size the same as the text dimensions. */
              query_string_geometry (IMAGE_INSTANCE_WIDGET_TEXT (ii),
@@ -440,28 +431,31 @@ widget_query_geometry (Lisp_Object image_instance,
     }
 }
 
-static int 
-widget_layout (Lisp_Object image_instance, 
-              int width, int height, Lisp_Object domain)
+static int
+widget_layout (Lisp_Object image_instance,
+              int width, int height, int xoffset, int yoffset,
+              Lisp_Object domain)
 {
   Lisp_Image_Instance* ii = XIMAGE_INSTANCE (image_instance);
   struct image_instantiator_methods* meths;
 
   /* .. then try device specific methods ... */
   meths = decode_device_ii_format (image_instance_device (image_instance),
-                                  IMAGE_INSTANCE_WIDGET_TYPE (ii), 
+                                  IMAGE_INSTANCE_WIDGET_TYPE (ii),
                                   ERROR_ME_NOT);
   if (meths && HAS_IIFORMAT_METH_P (meths, layout))
-    return IIFORMAT_METH (meths, layout, (image_instance, 
-                                         width, height, domain));
+    return IIFORMAT_METH (meths, layout, (image_instance,
+                                         width, height, xoffset, yoffset,
+                                         domain));
   else
     {
       /* ... then format specific methods ... */
-      meths = decode_device_ii_format (Qnil, IMAGE_INSTANCE_WIDGET_TYPE (ii), 
+      meths = decode_device_ii_format (Qnil, IMAGE_INSTANCE_WIDGET_TYPE (ii),
                                       ERROR_ME_NOT);
       if (meths && HAS_IIFORMAT_METH_P (meths, layout))
-       return IIFORMAT_METH (meths, layout, (image_instance, 
-                                             width, height, domain));
+       return IIFORMAT_METH (meths, layout, (image_instance,
+                                             width, height, xoffset, yoffset,
+                                             domain));
     }
   return 1;
 }
@@ -472,38 +466,41 @@ widget_validate (Lisp_Object instantiator)
   Lisp_Object desc = find_keyword_in_vector (instantiator, Q_descriptor);
 
   if (NILP (desc))
-    signal_simple_error ("Must supply :descriptor", instantiator);
+    syntax_error ("Must supply :descriptor", instantiator);
 
   if (VECTORP (desc))
     gui_parse_item_keywords (desc);
 
   if (!NILP (find_keyword_in_vector (instantiator, Q_width))
       && !NILP (find_keyword_in_vector (instantiator, Q_pixel_width)))
-    signal_simple_error ("Must supply only one of :width and :pixel-width", instantiator);
+    syntax_error ("Must supply only one of :width and :pixel-width", instantiator);
 
   if (!NILP (find_keyword_in_vector (instantiator, Q_height))
             && !NILP (find_keyword_in_vector (instantiator, Q_pixel_height)))
-    signal_simple_error ("Must supply only one of :height and :pixel-height", instantiator);
+    syntax_error ("Must supply only one of :height and :pixel-height", instantiator);
 }
 
 static void
 combo_box_validate (Lisp_Object instantiator)
 {
   widget_validate (instantiator);
-  if (NILP (find_keyword_in_vector (instantiator, Q_properties)))
-    signal_simple_error ("Must supply item list", instantiator);
+  if (NILP (find_keyword_in_vector (instantiator, Q_items)))
+    syntax_error ("Must supply item list", instantiator);
 }
 
 /* we need to convert things like glyphs to images, eval expressions
    etc.*/
 static Lisp_Object
-widget_normalize (Lisp_Object inst, Lisp_Object console_type)
+widget_normalize (Lisp_Object inst, Lisp_Object console_type,
+                 Lisp_Object dest_mask)
 {
   /* This function can call lisp */
   Lisp_Object glyph = find_keyword_in_vector (inst, Q_image);
 
   /* we need to eval glyph if its an expression, we do this for the
-     same reasons we normalize file to data. */
+     same reasons we normalize file to data.
+
+     #### should just normalize the data. */
   if (!NILP (glyph))
     {
       substitute_keyword_value (inst, Q_image, glyph_instantiator_to_glyph (glyph));
@@ -541,6 +538,9 @@ widget_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
                    Lisp_Object pointer_fg, Lisp_Object pointer_bg,
                    int dest_mask, Lisp_Object domain)
 {
+  /* #### practically all of this should be moved to widget_update()
+     so that users can dynamically change all possible widget
+     properties. */
   Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
   Lisp_Object face = find_keyword_in_vector (instantiator, Q_face);
   Lisp_Object height = find_keyword_in_vector (instantiator, Q_height);
@@ -549,62 +549,52 @@ widget_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
   Lisp_Object pixheight = find_keyword_in_vector (instantiator, Q_pixel_height);
   Lisp_Object desc = find_keyword_in_vector (instantiator, Q_descriptor);
   Lisp_Object glyph = find_keyword_in_vector (instantiator, Q_image);
-  Lisp_Object props = find_keyword_in_vector (instantiator, Q_properties);
   Lisp_Object items = find_keyword_in_vector (instantiator, Q_items);
   Lisp_Object orient = find_keyword_in_vector (instantiator, Q_orientation);
   Lisp_Object mwidth = find_keyword_in_vector (instantiator, Q_margin_width);
+  Lisp_Object ifocus = find_keyword_in_vector (instantiator, Q_initial_focus);
   int pw=0, ph=0, tw=0, th=0;
-  
+
   /* this just does pixel type sizing */
   subwindow_instantiate (image_instance, instantiator, pointer_fg, pointer_bg,
                         dest_mask, domain);
-  
+
   if (!(dest_mask & IMAGE_WIDGET_MASK))
     incompatible_image_types (instantiator, dest_mask, IMAGE_WIDGET_MASK);
 
   initialize_widget_image_instance (ii, XVECTOR_DATA (instantiator)[0]);
 
   IMAGE_INSTANCE_TYPE (ii) = IMAGE_WIDGET;
-  IMAGE_INSTANCE_WIDGET_PROPS (ii) = props;
 
   /* retrieve the fg and bg colors */
   if (!NILP (face))
     SET_IMAGE_INSTANCE_WIDGET_FACE (ii, Fget_face (face));
-  
+
   /* retrieve the gui item information. This is easy if we have been
      provided with a vector, more difficult if we have just been given
      keywords */
   if (STRINGP (desc) || NILP (desc))
     {
       /* big cheat - we rely on the fact that a gui item looks like an instantiator */
-      IMAGE_INSTANCE_WIDGET_ITEMS (ii) = 
+      IMAGE_INSTANCE_WIDGET_ITEMS (ii) =
        gui_parse_item_keywords_no_errors (instantiator);
       IMAGE_INSTANCE_WIDGET_TEXT (ii) = desc;
     }
   else
     IMAGE_INSTANCE_WIDGET_ITEMS (ii) =
       gui_parse_item_keywords_no_errors (desc);
-      
+
   /* Pick up the orientation before we do our first layout. */
   if (EQ (orient, Qleft) || EQ (orient, Qright) || EQ (orient, Qvertical))
     IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) = LAYOUT_VERTICAL;
 
   /* parse more gui items out of the properties */
-  if (!NILP (props)
-      && 
-      !EQ (IMAGE_INSTANCE_WIDGET_TYPE (ii), Qlayout)
+  if (!NILP (items) && !EQ (IMAGE_INSTANCE_WIDGET_TYPE (ii), Qlayout)
       && !EQ (IMAGE_INSTANCE_WIDGET_TYPE (ii), Qnative_layout))
     {
-      if (NILP (items))
-       {
-         items = Fplist_get (props, Q_items, Qnil);
-       }
-      if (!NILP (items))
-       {
-         IMAGE_INSTANCE_WIDGET_ITEMS (ii) = 
-           Fcons (IMAGE_INSTANCE_WIDGET_ITEMS (ii), 
-                  parse_gui_item_tree_children (items));
-       }
+      IMAGE_INSTANCE_WIDGET_ITEMS (ii) =
+       Fcons (IMAGE_INSTANCE_WIDGET_ITEMS (ii),
+              parse_gui_item_tree_children (items));
     }
 
   /* Normalize size information. We now only assign sizes if the user
@@ -662,9 +652,9 @@ widget_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
   if (!NILP (glyph))
     {
       if (!pw)
-       pw = glyph_width (glyph, domain) + 2 * WIDGET_BORDER_WIDTH;
+       pw = glyph_width (glyph, image_instance) + 2 * WIDGET_BORDER_WIDTH;
       if (!ph)
-       ph = glyph_height (glyph, domain) + 2 * WIDGET_BORDER_HEIGHT;
+       ph = glyph_height (glyph, image_instance) + 2 * WIDGET_BORDER_HEIGHT;
       IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii) = 0;
       IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii) = 0;
     }
@@ -673,6 +663,8 @@ widget_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
   if (!NILP (mwidth))
     IMAGE_INSTANCE_MARGIN_WIDTH (ii) = XINT (mwidth);
 
+  IMAGE_INSTANCE_WANTS_INITIAL_FOCUS (ii) = !NILP (ifocus);
+
   /* Layout for the layout widget is premature at this point since the
      children will not have been instantiated. We can't instantiate
      them until the device instantiation method for the layout has
@@ -697,7 +689,7 @@ widget_post_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
 /* Get the geometry of a button control. We need to adjust the size
    depending on the type of button. */
 static void
-button_query_geometry (Lisp_Object image_instance, 
+button_query_geometry (Lisp_Object image_instance,
                       int* width, int* height,
                       enum image_instance_geometry disp, Lisp_Object domain)
 {
@@ -723,14 +715,14 @@ button_query_geometry (Lisp_Object image_instance,
 
 /* tree-view geometry - get the height right */
 static void
-tree_view_query_geometry (Lisp_Object image_instance, 
+tree_view_query_geometry (Lisp_Object image_instance,
                          int* width, int* height,
                          enum image_instance_geometry disp, Lisp_Object domain)
 {
   Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
   Lisp_Object items = IMAGE_INSTANCE_WIDGET_ITEMS (ii);
 
-  
+
   if (*width)
     {
       /* #### what should this be. reconsider when X has tree views. */
@@ -750,14 +742,14 @@ tree_view_query_geometry (Lisp_Object image_instance,
 /* Get the geometry of a tab control. This is based on the number of
    items and text therin in the tab control. */
 static void
-tab_control_query_geometry (Lisp_Object image_instance, 
+tab_control_query_geometry (Lisp_Object image_instance,
                            int* width, int* height,
                            enum image_instance_geometry disp, Lisp_Object domain)
 {
   Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
   Lisp_Object items = XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii));
   Lisp_Object rest;
-  unsigned int tw = 0, th = 0;
+  int tw = 0, th = 0;
 
   LIST_LOOP (rest, items)
     {
@@ -784,48 +776,83 @@ tab_control_query_geometry (Lisp_Object image_instance,
     }
 }
 
-/* Get the geometry of a tab control. This is based on the number of
-   items and text therin in the tab control. */
-static Lisp_Object
-tab_control_set_property (Lisp_Object image_instance, 
-                         Lisp_Object prop,
-                         Lisp_Object val)
+/* Update the contents of a tab control. */
+static void
+tab_control_update (Lisp_Object image_instance,
+                   Lisp_Object instantiator)
 {
-  /* Record new items for update. *_tab_control_update will do the
+  Lisp_Object items = find_keyword_in_vector (instantiator, Q_items);
+  /* Record new items for update. *_tab_control_redisplay will do the
      rest. */
-  if (EQ (prop, Q_items))
+  if (!NILP (items))
     {
       Lisp_Image_Instance* ii = XIMAGE_INSTANCE (image_instance);
-
-      check_valid_item_list_1 (val);
-      
+      check_valid_item_list (items);
+#ifdef DEBUG_WIDGET_OUTPUT
+      stderr_out ("tab control %p updated\n", IMAGE_INSTANCE_SUBWINDOW_ID (ii));
+#endif
       /* Don't set the actual items since we might decide not to use
          the new ones (because nothing has really changed). If we did
          set them and didn't use them then we would get into whole
          heaps of trouble when the old items get GC'd. */
       IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii) =
-       Fcons (XCAR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)), 
-              parse_gui_item_tree_children (val));
+       Fcons (XCAR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)),
+              parse_gui_item_tree_children (items));
       IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii) = 1;
+    }
+}
+
+/* Determine whether only the order has changed for a tab. */
+int tab_control_order_only_changed (Lisp_Object image_instance)
+{
+  Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+  int found = 0, len, pending_len;
+  Lisp_Object rest;
+
+  /* Degenerate case. */
+  if (NILP (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii)))
+    return 1;
 
-      return Qt;
+  /* See whether we just need a change in order. */
+  GET_LIST_LENGTH (IMAGE_INSTANCE_WIDGET_ITEMS (ii), len);
+  GET_LIST_LENGTH (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii),
+                  pending_len);
+  if (len == pending_len)
+    {
+      LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)))
+       {
+         Lisp_Object pending_rest;
+         found = 0;
+         LIST_LOOP (pending_rest,
+                    XCDR (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii)))
+           {
+             if (gui_item_equal_sans_selected (XCAR (rest),
+                                               XCAR (pending_rest), 0))
+               {
+                 found = 1;
+                 break;
+               }
+           }
+         if (!found)
+           break;
+       }
     }
-  return Qunbound;
+  return found;
 }
 
-/* set the properties of a progres guage */
-static Lisp_Object
-progress_gauge_set_property (Lisp_Object image_instance,
-                            Lisp_Object prop,
-                            Lisp_Object val)
+/* Set the properties of a progress gauge */
+static void
+progress_gauge_update (Lisp_Object image_instance,
+                      Lisp_Object instantiator)
 {
   Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+  Lisp_Object value = find_keyword_in_vector (instantiator, Q_value);
 
-  if (EQ (prop, Q_value))
+  if (!NILP (value))
     {
-      CHECK_INT (val);
+      CHECK_INT (value);
 #ifdef DEBUG_WIDGET_OUTPUT
-      printf ("progress gauge value set to %ld\n", XINT (val));
+      stderr_out ("progress gauge value set to %ld\n", XINT (value));
 #endif
       IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii) =
        copy_gui_item_tree (IMAGE_INSTANCE_WIDGET_ITEMS (ii));
@@ -833,44 +860,147 @@ progress_gauge_set_property (Lisp_Object image_instance,
       assert (GUI_ITEMP (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii)));
 #endif
       if (GUI_ITEMP (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii)))
-       XGUI_ITEM (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii))->value = val;
+       XGUI_ITEM (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii))->value = value;
 
       IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii) = 1;
-
-      return Qt;
     }
-  return Qunbound;
 }
 
 \f
 /*****************************************************************************
  *                              widget layout                               *
  *****************************************************************************/
-/* we need to convert things like glyphs to images, eval expressions
-   etc.*/
+/* We need to cascade normalization.*/
 static Lisp_Object
-layout_normalize (Lisp_Object inst, Lisp_Object console_type)
+layout_normalize (Lisp_Object inst, Lisp_Object console_type,
+                 Lisp_Object dest_mask)
 {
   /* This function can call lisp */
-  Lisp_Object items = find_keyword_in_vector (inst, Q_items);
-  Lisp_Object border = find_keyword_in_vector (inst, Q_border);
-  /* we need to eval glyph if its an expression, we do this for the
-     same reasons we normalize file to data. */
+  struct gcpro gcpro1, gcpro2;
+  Lisp_Object alist = Qnil, new_items = Qnil, border;
+  /* This function can call lisp */
+  Lisp_Object items;
+
+  GCPRO2 (alist, new_items);
+  alist = tagged_vector_to_alist (inst);
+  items = assq_no_quit (Q_items, alist);
+
+  /* We need to normalize sub-objects. */
   if (!NILP (items))
     {
       Lisp_Object rest;
-      LIST_LOOP (rest, items)
+      LIST_LOOP (rest, XCDR (items))
        {
-         /* substitute the new glyph */
-         Fsetcar (rest, glyph_instantiator_to_glyph (XCAR (rest)));
+         /* Substitute the new instantiator */
+         new_items = Fcons (normalize_image_instantiator (XCAR (rest),
+                                                          console_type, dest_mask),
+                            new_items);
        }
+      new_items = Fnreverse (new_items);
+      Fsetcdr (items, new_items);
     }
-  /* normalize the border spec. */
-  if (VECTORP (border) || CONSP (border))
+  /* Normalize the border spec. */
+  border = assq_no_quit (Q_border, alist);
+  if (!NILP (border) && VECTORP (XCDR (border)))
     {
-      substitute_keyword_value (inst, Q_border, glyph_instantiator_to_glyph (border));
+      Fsetcdr (border, normalize_image_instantiator (XCDR (border),
+                                                    console_type, dest_mask));
     }
-  return inst;
+
+  {
+    Lisp_Object result = alist_to_tagged_vector (XVECTOR_DATA (inst)[0],
+                                                alist);
+    free_alist (alist);
+    RETURN_UNGCPRO (result);
+  }
+}
+
+/* Update the instances in the layout. */
+static void
+layout_update (Lisp_Object image_instance, Lisp_Object instantiator)
+{
+  Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+  Lisp_Object items = find_keyword_in_vector (instantiator, Q_items);
+  Lisp_Object border_inst = find_keyword_in_vector (instantiator, Q_border);
+  Lisp_Object border = Qnil;
+  Lisp_Object children = IMAGE_INSTANCE_LAYOUT_CHILDREN (ii);
+  int structure_changed = 0;
+  struct gcpro gcpro1;
+
+  /* We want to avoid consing if we can. This is quite awkward because
+     we have to deal with the border as well as the items. */
+
+  GCPRO1 (border);
+
+  if (INTP (IMAGE_INSTANCE_LAYOUT_BORDER (ii)))
+    {
+      border = XCAR (children);
+      children = XCDR (children);
+    }
+
+#ifdef DEBUG_WIDGET_OUTPUT
+  stderr_out ("layout updated\n");
+#endif
+  /* Update the border. */
+  if (!NILP (border_inst))
+    {
+      if (VECTORP (border_inst))
+       {
+         /* We are going to be sneaky here and add the border text as
+            just another child, the layout and output routines don't know
+            this and will just display at the offsets we prescribe. */
+         if (!NILP (border))
+           call3 (Qset_glyph_image, border, border_inst,
+                  IMAGE_INSTANCE_DOMAIN (ii));
+         else
+           {
+             border = Fcons (call1 (Qmake_glyph, border_inst), Qnil);
+             structure_changed = 1;
+           }
+         IMAGE_INSTANCE_LAYOUT_BORDER (ii) = make_int (0);
+       }
+      else
+       {
+         if (!NILP (border))
+           {
+             border = Qnil;
+             structure_changed = 1;
+           }
+         if (EQ (border_inst, Qt))
+             IMAGE_INSTANCE_LAYOUT_BORDER (ii) = Qetched_in;
+         else
+           IMAGE_INSTANCE_LAYOUT_BORDER (ii) = border_inst;
+       }
+    }
+
+  /* Pick up the sub-widgets. */
+  if (!NILP (items))
+    {
+      int len1, len2;
+      GET_LIST_LENGTH (items, len1);
+      GET_LIST_LENGTH (children, len2);
+      /* The structure hasn't changed so just update the images. */
+      if (!structure_changed && len1 == len2)
+       {
+         /* Pick up the sub-widgets. */
+         for (; !NILP (children); children = XCDR (children), items = XCDR (items))
+           {
+             call3 (Qset_glyph_image, XCAR (children), XCAR (items),
+                    IMAGE_INSTANCE_DOMAIN (ii));
+           }
+       }
+      /* The structure has changed so start over. */
+      else
+       {
+         /* Instantiate any new glyphs. */
+         for (; !NILP (items); items = XCDR (items))
+           {
+             border = Fcons (call1 (Qmake_glyph, XCAR (items)), border);
+           }
+         IMAGE_INSTANCE_LAYOUT_CHILDREN (ii) = Fnreverse (border);
+       }
+    }
+  UNGCPRO;
 }
 
 static void
@@ -880,8 +1010,10 @@ layout_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
 {
   Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
   Lisp_Object orient = find_keyword_in_vector (instantiator, Q_orientation);
-  Lisp_Object border = find_keyword_in_vector (instantiator, Q_border);
 
+#ifdef DEBUG_WIDGET_OUTPUT
+  stderr_out ("layout instantiated\n");
+#endif
   /* Do widget type instantiation first. */
   widget_instantiate (image_instance, instantiator, pointer_fg, pointer_bg,
                      dest_mask, domain);
@@ -890,60 +1022,17 @@ layout_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
     {
       IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) = LAYOUT_VERTICAL;
     }
-      
-  if (EQ (border, Qt))
-    {
-      IMAGE_INSTANCE_LAYOUT_BORDER (ii) = Qetched_in;
-    }
-  else
-    {
-      IMAGE_INSTANCE_LAYOUT_BORDER (ii) = border;
-    }
-  /* We don't do the children yet as we might not have a containing
+
+  /* Get child glyphs and finish instantiation. We can't do image
+     instance children yet as we might not have a containing
      window. */
+  layout_update (image_instance, instantiator);
 }
 
 static void
 layout_post_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
                         Lisp_Object domain)
 {
-  Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
-  Lisp_Object items = find_keyword_in_vector (instantiator, Q_items);
-  Lisp_Object rest, children = Qnil;
-
-  if (GLYPHP (IMAGE_INSTANCE_LAYOUT_BORDER (ii)))
-    {
-      /* We are going to be sneaky here and add the border text as
-        just another child, the layout and output routines don't know
-        this and will just display at the offsets we prescribe. */
-      Lisp_Object gii = glyph_image_instance 
-       (IMAGE_INSTANCE_LAYOUT_BORDER (ii),
-        image_instance, ERROR_ME, 1);
-
-      if (!IMAGE_INSTANCEP (gii))
-       return;
-      /* make sure we are designated as the parent. */
-      XIMAGE_INSTANCE_PARENT (gii) = image_instance;
-      children = Fcons (gii, children);
-      IMAGE_INSTANCE_LAYOUT_BORDER (ii) = make_int (0);
-    }
-
-  /* Pick up the sub-widgets. */
-  LIST_LOOP (rest, items)
-    {
-      /* make sure the image is instantiated */
-      Lisp_Object gii = glyph_image_instance (XCAR (rest), 
-                                             image_instance, ERROR_ME, 1);
-      if (!IMAGE_INSTANCEP (gii))
-       return;
-      /* make sure we are designated as the parent. */
-      XIMAGE_INSTANCE_PARENT (gii) = image_instance;
-      children = Fcons (gii, children);
-    }
-  /* Make sure elements in the layout are in the order the
-     user expected. */
-  children = Fnreverse (children);
-  IMAGE_INSTANCE_LAYOUT_CHILDREN (ii) = children;
 }
 
 /* Layout widget. Sizing commentary: we have a number of problems that
@@ -956,30 +1045,30 @@ layout_post_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
    course these attributes can change dynamically and so the size
    should changed dynamically also. Only in a few limited cases should
    the size be fixed and remain fixed. Of course this actually means
-   that we don't really want to specifiy the size *at all* for most
+   that we don't really want to specify the size *at all* for most
    widgets - we want it to be discovered dynamically. Thus we can
    envisage the following scenarios:
-   
+
    1. A button is sized to accommodate its text, the text changes and the
-   button should change size also.  
+   button should change size also.
 
    2. A button is given an explicit size. Its size should never change.
 
    3. Layout is put inside an area. The size of the area changes, the
-   layout should change with it. 
+   layout should change with it.
 
    4. A button grows to accommodate additional text. The whitespace
    around it should be modified to cope with the new layout
-   requirements. 
+   requirements.
 
    5. A button grows. The area surrounding it should grow also if
-   possible. 
+   possible.
 
    What metrics are important?
    1. Actual width and height.
-   
+
    2. Whether the width and height are what the widget actually wants, or
-   whether it can grow or shrink. 
+   whether it can grow or shrink.
 
    Text glyphs are particularly troublesome since their metrics depend
    on the context in which they are being viewed. For instance they
@@ -1011,7 +1100,7 @@ layout_query_geometry (Lisp_Object image_instance, int* width,
   /* First just set up what we already have. */
   if (width)   *width = IMAGE_INSTANCE_WIDTH (ii);
   if (height)  *height = IMAGE_INSTANCE_HEIGHT (ii);
-  
+
   /* If we are not allowed to dynamically size then return. */
   if (!IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii)
       &&
@@ -1021,19 +1110,20 @@ layout_query_geometry (Lisp_Object image_instance, int* width,
   /* Pick up the border text if we have one. */
   if (INTP (IMAGE_INSTANCE_LAYOUT_BORDER (ii)))
     {
-      image_instance_query_geometry (XCAR (items), &gwidth, &gheight, disp, domain);
+      glyph_query_geometry (XCAR (items), &gwidth, &gheight, disp,
+                           image_instance);
       ph_adjust = gheight / 2;
       items = XCDR (items);
     }
-  
+
   /* Flip through the items to work out how much stuff we have to display */
   LIST_LOOP (rest, items)
     {
       Lisp_Object glyph = XCAR (rest);
-      image_instance_query_geometry (glyph, &gwidth, &gheight, disp, domain);
+      glyph_query_geometry (glyph, &gwidth, &gheight, disp, image_instance);
 
       nitems ++;
-      if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) 
+      if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii)
          == LAYOUT_HORIZONTAL)
        {
          maxph = max (maxph, gheight);
@@ -1050,7 +1140,7 @@ layout_query_geometry (Lisp_Object image_instance, int* width,
      have been fixed by the user. */
   if (!NILP (IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (ii)))
     {
-      Lisp_Object dynamic_width = 
+      Lisp_Object dynamic_width =
        Feval (IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (ii));
       if (INTP (dynamic_width))
        *width = XINT (dynamic_width);
@@ -1059,14 +1149,14 @@ layout_query_geometry (Lisp_Object image_instance, int* width,
           == LAYOUT_HORIZONTAL)
     *width = maxpw + ((nitems + 1) * WIDGET_BORDER_WIDTH +
                      IMAGE_INSTANCE_MARGIN_WIDTH (ii)) * 2;
-  else 
-    *width = maxpw + 2 * (WIDGET_BORDER_WIDTH * 2 + 
+  else
+    *width = maxpw + 2 * (WIDGET_BORDER_WIDTH * 2 +
                          IMAGE_INSTANCE_MARGIN_WIDTH (ii));
 
   /* Work out vertical spacings. */
   if (!NILP (IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (ii)))
     {
-      Lisp_Object dynamic_height = 
+      Lisp_Object dynamic_height =
        Feval (IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (ii));
       if (INTP (dynamic_height))
        *height = XINT (dynamic_height);
@@ -1081,8 +1171,9 @@ layout_query_geometry (Lisp_Object image_instance, int* width,
 }
 
 int
-layout_layout (Lisp_Object image_instance, 
-              int width, int height, Lisp_Object domain)
+layout_layout (Lisp_Object image_instance,
+              int width, int height, int xoffset, int yoffset,
+              Lisp_Object domain)
 {
   Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
   Lisp_Object rest;
@@ -1100,26 +1191,25 @@ layout_layout (Lisp_Object image_instance,
     {
       Lisp_Object border = XCAR (items);
       items = XCDR (items);
-      image_instance_query_geometry (border, &gwidth, &gheight,
-                                    IMAGE_DESIRED_GEOMETRY, domain);
-      /* #### Really, what should this be? */
-      XIMAGE_INSTANCE_XOFFSET (border) = 10;
-      XIMAGE_INSTANCE_YOFFSET (border) = 0;
+      glyph_query_geometry (border, &gwidth, &gheight,
+                           IMAGE_DESIRED_GEOMETRY, image_instance);
       ph_adjust = gheight / 2;
       IMAGE_INSTANCE_LAYOUT_BORDER (ii) = make_int (ph_adjust);
 
-      image_instance_layout (border, gwidth, gheight, domain);
+      /* #### Really, what should this be? */
+      glyph_do_layout (border, gwidth, gheight, 10, 0,
+                      image_instance);
     }
 
   /* Flip through the items to work out how much stuff we have to display. */
   LIST_LOOP (rest, items)
     {
       Lisp_Object glyph = XCAR (rest);
-      
-      image_instance_query_geometry (glyph, &gwidth, &gheight, 
-                                    IMAGE_DESIRED_GEOMETRY, domain);
+
+      glyph_query_geometry (glyph, &gwidth, &gheight,
+                           IMAGE_DESIRED_GEOMETRY, image_instance);
       nitems ++;
-      if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) 
+      if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii)
          == LAYOUT_HORIZONTAL)
        {
          maxph = max (maxph, gheight);
@@ -1138,12 +1228,12 @@ layout_layout (Lisp_Object image_instance,
        just provide default spacing and will let the output routines
        clip.. */
     horiz_spacing = WIDGET_BORDER_WIDTH * 2;
-  else if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) 
+  else if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii)
           == LAYOUT_HORIZONTAL)
     /* We have a larger area to display in so distribute the space
        evenly. */
-    horiz_spacing = (width - (maxpw + 
-                             IMAGE_INSTANCE_MARGIN_WIDTH (ii) * 2)) 
+    horiz_spacing = (width - (maxpw +
+                             IMAGE_INSTANCE_MARGIN_WIDTH (ii) * 2))
       / (nitems + 1);
   else
     horiz_spacing = (width - maxpw) / 2
@@ -1151,13 +1241,13 @@ layout_layout (Lisp_Object image_instance,
 
   if (height < maxph)
     vert_spacing = WIDGET_BORDER_HEIGHT * 2;
-  else if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) 
+  else if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii)
           == LAYOUT_VERTICAL)
-    vert_spacing = (height - (maxph + ph_adjust + 
-                             IMAGE_INSTANCE_MARGIN_WIDTH (ii) * 2)) 
+    vert_spacing = (height - (maxph + ph_adjust +
+                             IMAGE_INSTANCE_MARGIN_WIDTH (ii) * 2))
       / (nitems + 1);
   else
-    vert_spacing = (height - (maxph + ph_adjust)) / 2 
+    vert_spacing = (height - (maxph + ph_adjust)) / 2
       - IMAGE_INSTANCE_MARGIN_WIDTH (ii);
 
   y = vert_spacing + ph_adjust + IMAGE_INSTANCE_MARGIN_WIDTH (ii);
@@ -1170,33 +1260,33 @@ layout_layout (Lisp_Object image_instance,
     {
       Lisp_Object glyph = XCAR (rest);
 
-      image_instance_query_geometry (glyph, &gwidth, &gheight, 
-                                    IMAGE_DESIRED_GEOMETRY, domain);
+      glyph_query_geometry (glyph, &gwidth, &gheight,
+                           IMAGE_DESIRED_GEOMETRY, image_instance);
 
-      if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) 
+      if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii)
          == LAYOUT_HORIZONTAL)
        {
-         if (IMAGE_INSTANCE_SUBWINDOW_JUSTIFY (ii) 
+         if (IMAGE_INSTANCE_SUBWINDOW_JUSTIFY (ii)
              == LAYOUT_JUSTIFY_RIGHT)
            y = height - (gheight + vert_spacing);
-         if (IMAGE_INSTANCE_SUBWINDOW_JUSTIFY (ii) 
+         if (IMAGE_INSTANCE_SUBWINDOW_JUSTIFY (ii)
              == LAYOUT_JUSTIFY_CENTER)
            y = (height - gheight) / 2;
        }
-      else 
+      else
        {
-         if (IMAGE_INSTANCE_SUBWINDOW_JUSTIFY (ii) 
+         if (IMAGE_INSTANCE_SUBWINDOW_JUSTIFY (ii)
              == LAYOUT_JUSTIFY_RIGHT)
            x = width - (gwidth + horiz_spacing);
-         if (IMAGE_INSTANCE_SUBWINDOW_JUSTIFY (ii) 
+         if (IMAGE_INSTANCE_SUBWINDOW_JUSTIFY (ii)
              == LAYOUT_JUSTIFY_CENTER)
            x = (width - gwidth) / 2;
        }
-       
-      XIMAGE_INSTANCE_XOFFSET (glyph) = x;
-      XIMAGE_INSTANCE_YOFFSET (glyph) = y;
-       
-      if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) 
+
+      /* Now layout subwidgets if they require it. */
+      glyph_do_layout (glyph, gwidth, gheight, x, y, image_instance);
+
+      if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii)
          == LAYOUT_HORIZONTAL)
        {
          x += (gwidth + horiz_spacing);
@@ -1205,31 +1295,53 @@ layout_layout (Lisp_Object image_instance,
        {
          y += (gheight + vert_spacing);
        }
-      
-      /* Now layout subwidgets if they require it. */
-      image_instance_layout (glyph, gwidth, gheight, domain);
+
     }
   return 1;
 }
 
+/* Get the glyphs that comprise a layout. These are created internally
+   and so are otherwise inaccessible to lisp. We need some way of getting
+   properties from the widgets that comprise a layout and this is the
+   simplest way of doing it.
+
+   #### Eventually we should allow some more intelligent access to
+   sub-widgets. */
+static Lisp_Object
+layout_property (Lisp_Object image_instance, Lisp_Object prop)
+{
+  /* This function can GC. */
+  Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+  if (EQ (prop, Q_items))
+    {
+      if (INTP (IMAGE_INSTANCE_LAYOUT_BORDER (ii)) &&
+         CONSP (IMAGE_INSTANCE_LAYOUT_CHILDREN (ii)))
+       return Fcopy_sequence (XCDR
+                              (IMAGE_INSTANCE_LAYOUT_CHILDREN (ii)));
+      else
+       return Fcopy_sequence (IMAGE_INSTANCE_LAYOUT_CHILDREN (ii));
+    }
+  return Qunbound;
+}
+
 /* Layout subwindows if they are real subwindows. */
 static int
 native_layout_layout (Lisp_Object image_instance,
-                     int width, int height,
+                     int width, int height, int xoffset, int yoffset,
                      Lisp_Object domain)
 {
   Lisp_Image_Instance* ii = XIMAGE_INSTANCE (image_instance);
   Lisp_Object rest;
-  
+
   /* The first time this gets called, the layout will be only
      partially instantiated. The children get done in
      post_instantiate. */
   if (!IMAGE_INSTANCE_INITIALIZED (ii))
     return 0;
 
-  /* Defining this overrides the default layout_layout so we first have to call that to get 
+  /* Defining this overrides the default layout_layout so we first have to call that to get
      suitable instances and values set up. */
-  layout_layout (image_instance, width, height, domain);
+  layout_layout (image_instance, width, height, xoffset, yoffset, domain);
 
   LIST_LOOP (rest, IMAGE_INSTANCE_LAYOUT_CHILDREN (ii))
     {
@@ -1239,7 +1351,7 @@ native_layout_layout (Lisp_Object image_instance,
       dga.width = IMAGE_INSTANCE_WIDTH (ii);
       dga.height = IMAGE_INSTANCE_HEIGHT (ii);
 
-      map_subwindow (XCAR (rest), 
+      map_subwindow (XCAR (rest),
                     IMAGE_INSTANCE_XOFFSET (ii),
                     IMAGE_INSTANCE_YOFFSET (ii), &dga);
     }
@@ -1254,47 +1366,38 @@ native_layout_layout (Lisp_Object image_instance,
 void
 syms_of_glyphs_widget (void)
 {
-  defkeyword (&Q_descriptor, ":descriptor");
-  defkeyword (&Q_height, ":height");
-  defkeyword (&Q_width, ":width");
-  defkeyword (&Q_properties, ":properties");
-  defkeyword (&Q_items, ":items");
-  defkeyword (&Q_image, ":image");
-  defkeyword (&Q_text, ":text");
-  defkeyword (&Q_orientation, ":orientation");
-  defkeyword (&Q_justify, ":justify");
-  defkeyword (&Q_border, ":border");
-  defkeyword (&Q_margin_width, ":margin-width");
-
-  defsymbol (&Qetched_in, "etched-in");
-  defsymbol (&Qetched_out, "etched-out");
-  defsymbol (&Qbevel_in, "bevel-in");
-  defsymbol (&Qbevel_out, "bevel-out");
+  DEFSYMBOL (Qetched_in);
+  DEFSYMBOL (Qetched_out);
+  DEFSYMBOL (Qbevel_in);
+  DEFSYMBOL (Qbevel_out);
+  DEFSYMBOL (Qmake_glyph);
 }
 
-#define VALID_GUI_KEYWORDS(type) do {                                                  \
-  IIFORMAT_VALID_NONCOPY_KEYWORD (type, Q_active, check_valid_anything);               \
-  IIFORMAT_VALID_KEYWORD (type, Q_suffix, check_valid_anything);                       \
-  IIFORMAT_VALID_KEYWORD (type, Q_keys, check_valid_string);                           \
-  IIFORMAT_VALID_KEYWORD (type, Q_style, check_valid_symbol);                          \
-  IIFORMAT_VALID_NONCOPY_KEYWORD (type, Q_selected, check_valid_anything);             \
-  IIFORMAT_VALID_KEYWORD (type, Q_filter, check_valid_anything);                       \
-  IIFORMAT_VALID_KEYWORD (type, Q_config, check_valid_symbol);                         \
-  IIFORMAT_VALID_KEYWORD (type, Q_included, check_valid_anything);                     \
-  IIFORMAT_VALID_KEYWORD (type, Q_key_sequence, check_valid_string);                   \
-  IIFORMAT_VALID_KEYWORD (type, Q_accelerator, check_valid_string);                    \
-  IIFORMAT_VALID_KEYWORD (type, Q_label, check_valid_anything);                                \
-  IIFORMAT_VALID_NONCOPY_KEYWORD (type, Q_callback, check_valid_callback);             \
-  IIFORMAT_VALID_NONCOPY_KEYWORD (type, Q_callback_ex, check_valid_callback);          \
-  IIFORMAT_VALID_NONCOPY_KEYWORD (type, Q_descriptor, check_valid_string_or_vector);   \
+#define VALID_GUI_KEYWORDS(type) do {                                        \
+  IIFORMAT_VALID_NONCOPY_KEYWORD (type, Q_active, check_valid_anything);      \
+  IIFORMAT_VALID_KEYWORD (type, Q_suffix, check_valid_anything);             \
+  IIFORMAT_VALID_KEYWORD (type, Q_keys, check_valid_string);                 \
+  IIFORMAT_VALID_KEYWORD (type, Q_style, check_valid_symbol);                \
+  IIFORMAT_VALID_NONCOPY_KEYWORD (type, Q_selected, check_valid_anything);    \
+  IIFORMAT_VALID_KEYWORD (type, Q_filter, check_valid_anything);             \
+  IIFORMAT_VALID_KEYWORD (type, Q_config, check_valid_symbol);               \
+  IIFORMAT_VALID_KEYWORD (type, Q_included, check_valid_anything);           \
+  IIFORMAT_VALID_KEYWORD (type, Q_initial_focus, check_valid_anything);              \
+  IIFORMAT_VALID_KEYWORD (type, Q_key_sequence, check_valid_string);         \
+  IIFORMAT_VALID_KEYWORD (type, Q_accelerator, check_valid_string);          \
+  IIFORMAT_VALID_KEYWORD (type, Q_label, check_valid_anything);                      \
+  IIFORMAT_VALID_NONCOPY_KEYWORD (type, Q_callback, check_valid_callback);    \
+  IIFORMAT_VALID_NONCOPY_KEYWORD (type, Q_callback_ex, check_valid_callback); \
+  IIFORMAT_VALID_NONCOPY_KEYWORD (type, Q_descriptor,                        \
+                                 check_valid_string_or_vector);              \
 } while (0)
 
-#define VALID_WIDGET_KEYWORDS(type) do {                               \
-  IIFORMAT_VALID_KEYWORD (type, Q_width, check_valid_int);             \
-  IIFORMAT_VALID_KEYWORD (type, Q_height, check_valid_int);            \
-  IIFORMAT_VALID_KEYWORD (type, Q_pixel_width, check_valid_int_or_function);\
-  IIFORMAT_VALID_KEYWORD (type, Q_pixel_height, check_valid_int_or_function);\
-  IIFORMAT_VALID_KEYWORD (type, Q_face, check_valid_face);             \
+#define VALID_WIDGET_KEYWORDS(type) do {                                     \
+  IIFORMAT_VALID_KEYWORD (type, Q_width, check_valid_int);                   \
+  IIFORMAT_VALID_KEYWORD (type, Q_height, check_valid_int);                  \
+  IIFORMAT_VALID_KEYWORD (type, Q_pixel_width, check_valid_int_or_function);  \
+  IIFORMAT_VALID_KEYWORD (type, Q_pixel_height, check_valid_int_or_function); \
+  IIFORMAT_VALID_KEYWORD (type, Q_face, check_valid_face);                   \
 } while (0)
 
 
@@ -1302,7 +1405,7 @@ static void image_instantiator_widget (void)
 { /* we only do this for properties */
   INITIALIZE_IMAGE_INSTANTIATOR_FORMAT_NO_SYM (widget, "widget");
   IIFORMAT_HAS_METHOD (widget, property);
-  IIFORMAT_HAS_METHOD (widget, set_property);
+  IIFORMAT_HAS_METHOD (widget, update);
   IIFORMAT_HAS_METHOD (widget, query_geometry);
   IIFORMAT_HAS_METHOD (widget, layout);
 }
@@ -1318,7 +1421,7 @@ static void image_instantiator_buttons (void)
   IIFORMAT_HAS_SHARED_METHOD (button, governing_domain, subwindow);
   IIFORMAT_HAS_METHOD (button, query_geometry);
   IIFORMAT_VALID_KEYWORD (button,
-                         Q_image, check_valid_glyph_or_instantiator);
+                         Q_image, check_valid_instantiator);
   VALID_WIDGET_KEYWORDS (button);
   VALID_GUI_KEYWORDS (button);
 }
@@ -1346,9 +1449,10 @@ static void image_instantiator_combo_box (void)
 
   IIFORMAT_VALID_KEYWORD (combo_box, Q_width, check_valid_int);
   IIFORMAT_VALID_KEYWORD (combo_box, Q_height, check_valid_int);
-  IIFORMAT_VALID_KEYWORD (combo_box, Q_pixel_width, check_valid_int_or_function);
+  IIFORMAT_VALID_KEYWORD (combo_box, Q_pixel_width,
+                         check_valid_int_or_function);
   IIFORMAT_VALID_KEYWORD (combo_box, Q_face, check_valid_face);
-  IIFORMAT_VALID_KEYWORD (combo_box, Q_properties, check_valid_item_list);
+  IIFORMAT_VALID_KEYWORD (combo_box, Q_items, check_valid_item_list);
 }
 
 static void image_instantiator_scrollbar (void)
@@ -1361,8 +1465,10 @@ static void image_instantiator_scrollbar (void)
   IIFORMAT_HAS_SHARED_METHOD (scrollbar, governing_domain, subwindow);
   VALID_GUI_KEYWORDS (scrollbar);
 
-  IIFORMAT_VALID_KEYWORD (scrollbar, Q_pixel_width, check_valid_int_or_function);
-  IIFORMAT_VALID_KEYWORD (scrollbar, Q_pixel_height, check_valid_int_or_function);
+  IIFORMAT_VALID_KEYWORD (scrollbar, Q_pixel_width,
+                         check_valid_int_or_function);
+  IIFORMAT_VALID_KEYWORD (scrollbar, Q_pixel_height,
+                         check_valid_int_or_function);
   IIFORMAT_VALID_KEYWORD (scrollbar, Q_face, check_valid_face);
 }
 
@@ -1374,9 +1480,11 @@ static void image_instantiator_progress_guage (void)
   IIFORMAT_HAS_SHARED_METHOD (progress_gauge, instantiate, widget);
   IIFORMAT_HAS_SHARED_METHOD (progress_gauge, post_instantiate, widget);
   IIFORMAT_HAS_SHARED_METHOD (progress_gauge, governing_domain, subwindow);
-  IIFORMAT_HAS_METHOD (progress_gauge, set_property);
+  IIFORMAT_HAS_METHOD (progress_gauge, update);
   VALID_WIDGET_KEYWORDS (progress_gauge);
   VALID_GUI_KEYWORDS (progress_gauge);
+
+  IIFORMAT_VALID_KEYWORD (progress_gauge, Q_value, check_valid_int);
 }
 
 static void image_instantiator_tree_view (void)
@@ -1387,10 +1495,11 @@ static void image_instantiator_tree_view (void)
   IIFORMAT_HAS_SHARED_METHOD (tree_view, instantiate, widget);
   IIFORMAT_HAS_SHARED_METHOD (tree_view, post_instantiate, widget);
   IIFORMAT_HAS_SHARED_METHOD (tree_view, governing_domain, subwindow);
+  IIFORMAT_HAS_SHARED_METHOD (tree_view, update, tab_control);
   IIFORMAT_HAS_METHOD (tree_view, query_geometry);
   VALID_WIDGET_KEYWORDS (tree_view);
   VALID_GUI_KEYWORDS (tree_view);
-  IIFORMAT_VALID_KEYWORD (tree_view, Q_properties, check_valid_item_list);
+  IIFORMAT_VALID_KEYWORD (tree_view, Q_items, check_valid_item_list);
 }
 
 static void image_instantiator_tab_control (void)
@@ -1402,11 +1511,12 @@ static void image_instantiator_tab_control (void)
   IIFORMAT_HAS_SHARED_METHOD (tab_control, post_instantiate, widget);
   IIFORMAT_HAS_SHARED_METHOD (tab_control, governing_domain, subwindow);
   IIFORMAT_HAS_METHOD (tab_control, query_geometry);
-  IIFORMAT_HAS_METHOD (tab_control, set_property);
+  IIFORMAT_HAS_METHOD (tab_control, update);
   VALID_WIDGET_KEYWORDS (tab_control);
   VALID_GUI_KEYWORDS (tab_control);
-  IIFORMAT_VALID_KEYWORD (tab_control, Q_orientation, check_valid_tab_orientation);
-  IIFORMAT_VALID_KEYWORD (tab_control, Q_properties, check_valid_item_list);
+  IIFORMAT_VALID_KEYWORD (tab_control, Q_orientation,
+                         check_valid_tab_orientation);
+  IIFORMAT_VALID_KEYWORD (tab_control, Q_items, check_valid_item_list);
 }
 
 static void image_instantiator_labels (void)
@@ -1420,14 +1530,14 @@ static void image_instantiator_labels (void)
   IIFORMAT_VALID_KEYWORD (label, Q_descriptor, check_valid_string);
 }
 
-#define VALID_LAYOUT_KEYWORDS(layout) \
-  VALID_WIDGET_KEYWORDS (layout);                                              \
-  IIFORMAT_VALID_KEYWORD (layout, Q_orientation, check_valid_orientation);     \
-  IIFORMAT_VALID_KEYWORD (layout, Q_justify, check_valid_justification);       \
-  IIFORMAT_VALID_KEYWORD (layout, Q_border, check_valid_border);               \
-  IIFORMAT_VALID_KEYWORD (layout, Q_margin_width, check_valid_int);    \
-  IIFORMAT_VALID_KEYWORD (layout, Q_items,                             \
-                         check_valid_glyph_or_instantiator_list)
+#define VALID_LAYOUT_KEYWORDS(layout)                                     \
+  VALID_WIDGET_KEYWORDS (layout);                                         \
+  IIFORMAT_VALID_KEYWORD (layout, Q_orientation, check_valid_orientation); \
+  IIFORMAT_VALID_KEYWORD (layout, Q_justify, check_valid_justification);   \
+  IIFORMAT_VALID_KEYWORD (layout, Q_border, check_valid_border);          \
+  IIFORMAT_VALID_KEYWORD (layout, Q_margin_width, check_valid_int);       \
+  IIFORMAT_VALID_KEYWORD (layout, Q_items,                                \
+                         check_valid_instantiator_list)
 
 static void image_instantiator_layout (void)
 {
@@ -1439,6 +1549,8 @@ static void image_instantiator_layout (void)
   IIFORMAT_HAS_METHOD (layout, normalize);
   IIFORMAT_HAS_METHOD (layout, query_geometry);
   IIFORMAT_HAS_METHOD (layout, layout);
+  IIFORMAT_HAS_METHOD (layout, update);
+  IIFORMAT_HAS_METHOD (layout, property);
 
   VALID_GUI_KEYWORDS (layout);
   VALID_LAYOUT_KEYWORDS (layout);
@@ -1455,6 +1567,7 @@ static void image_instantiator_native_layout (void)
   IIFORMAT_HAS_SHARED_METHOD (native_layout, normalize, layout);
   IIFORMAT_HAS_SHARED_METHOD (native_layout, query_geometry, layout);
   IIFORMAT_HAS_SHARED_METHOD (native_layout, layout, layout);
+  IIFORMAT_HAS_SHARED_METHOD (native_layout, property, layout);
 
   VALID_GUI_KEYWORDS (native_layout);
   VALID_LAYOUT_KEYWORDS (native_layout);
index af515d8..9ce627b 100644 (file)
@@ -17,7 +17,6 @@ XEmacs 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 XEmacs; see the file COPYING.  If not, write to
 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
@@ -25,6 +24,8 @@ Boston, MA 02111-1307, USA.  */
 
 /* Synched up with: Not in FSF. */
 
+/* 7-8-00 This file is more or less Mule-ized in my Mule workspace. */
+
 /* Original author: Jamie Zawinski for 19.8
    font-truename stuff added by Jamie Zawinski for 19.10
    subwindow support added by Chuck Thompson
@@ -397,7 +398,7 @@ x_finalize_image_instance (Lisp_Image_Instance *p)
 
   if (DEVICE_LIVE_P (XDEVICE (IMAGE_INSTANCE_DEVICE (p))))
     {
-      Display *dpy = DEVICE_X_DISPLAY 
+      Display *dpy = DEVICE_X_DISPLAY
        (XDEVICE (IMAGE_INSTANCE_DEVICE (p)));
       if (0)
        ;
@@ -1163,9 +1164,7 @@ xbm_instantiate_1 (Lisp_Object image_instance, Lisp_Object instantiator,
     {
       const char *ext_data;
 
-      TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (XCDR (XCDR (mask_data))),
-                         C_STRING_ALLOCA, ext_data,
-                         Qbinary);
+      LISP_STRING_TO_EXTERNAL (XCAR (XCDR (XCDR (mask_data))), ext_data, Qbinary);
       mask = pixmap_from_xbm_inline (IMAGE_INSTANCE_DEVICE (ii),
                                     XINT (XCAR (mask_data)),
                                     XINT (XCAR (XCDR (mask_data))),
@@ -1189,9 +1188,7 @@ x_xbm_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
 
   assert (!NILP (data));
 
-  TO_EXTERNAL_FORMAT (LISP_STRING, XCAR (XCDR (XCDR (data))),
-                     C_STRING_ALLOCA, ext_data,
-                     Qbinary);
+  LISP_STRING_TO_EXTERNAL (XCAR (XCDR (XCDR (data))), ext_data, Qbinary);
 
   xbm_instantiate_1 (image_instance, instantiator, pointer_fg,
                     pointer_bg, dest_mask, XINT (XCAR (data)),
@@ -1677,9 +1674,7 @@ x_xface_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
 
   assert (!NILP (data));
 
-  TO_EXTERNAL_FORMAT (LISP_STRING, data,
-                     C_STRING_ALLOCA, dstring,
-                     Qbinary);
+  LISP_STRING_TO_EXTERNAL (data, dstring, Qbinary);
 
   if ((p = strchr (dstring, ':')))
     {
@@ -1743,7 +1738,8 @@ autodetect_validate (Lisp_Object instantiator)
 
 static Lisp_Object
 autodetect_normalize (Lisp_Object instantiator,
-                     Lisp_Object console_type)
+                     Lisp_Object console_type,
+                     Lisp_Object dest_mask)
 {
   Lisp_Object file = find_keyword_in_vector (instantiator, Q_data);
   Lisp_Object filename = Qnil;
@@ -1851,9 +1847,7 @@ autodetect_instantiate (Lisp_Object image_instance,
   if (dest_mask & IMAGE_POINTER_MASK)
     {
       const char *name_ext;
-      TO_EXTERNAL_FORMAT (LISP_STRING, data,
-                         C_STRING_ALLOCA, name_ext,
-                         Qfile_name);
+      LISP_STRING_TO_EXTERNAL (data, name_ext, Qfile_name);
       if (XmuCursorNameToIndex (name_ext) != -1)
         {
           result = alist_to_tagged_vector (Qcursor_font, alist);
@@ -2053,9 +2047,7 @@ cursor_font_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
   if (!(dest_mask & IMAGE_POINTER_MASK))
     incompatible_image_types (instantiator, dest_mask, IMAGE_POINTER_MASK);
 
-  TO_EXTERNAL_FORMAT (LISP_STRING, data,
-                     C_STRING_ALLOCA, name_ext,
-                     Qfile_name);
+  LISP_STRING_TO_EXTERNAL (data, name_ext, Qfile_name);
   if ((i = XmuCursorNameToIndex (name_ext)) == -1)
     signal_simple_error ("Unrecognized cursor-font name", data);
 
@@ -2155,8 +2147,9 @@ x_map_subwindow (Lisp_Image_Instance *p, int x, int y,
                         x, y, dga->width, dga->height);
       XMoveWindow (IMAGE_INSTANCE_X_SUBWINDOW_DISPLAY (p),
                   subwindow, -dga->xoffset, -dga->yoffset);
-      XMapWindow (IMAGE_INSTANCE_X_SUBWINDOW_DISPLAY (p),
-                 IMAGE_INSTANCE_X_CLIPWINDOW (p));
+      if (!IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (p))
+       XMapWindow (IMAGE_INSTANCE_X_SUBWINDOW_DISPLAY (p),
+                   IMAGE_INSTANCE_X_CLIPWINDOW (p));
     }
   else                         /* must be a widget */
     {
@@ -2166,14 +2159,15 @@ x_map_subwindow (Lisp_Image_Instance *p, int x, int y,
                         dga->width, dga->height, 0);
       XtMoveWidget (IMAGE_INSTANCE_X_WIDGET_ID (p),
                    -dga->xoffset, -dga->yoffset);
-      XtMapWidget (IMAGE_INSTANCE_X_CLIPWIDGET (p));
+      if (!IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (p))
+       XtMapWidget (IMAGE_INSTANCE_X_CLIPWIDGET (p));
     }
 }
 
 /* when you click on a widget you may activate another widget this
    needs to be checked and all appropriate widgets updated */
 static void
-x_update_subwindow (Lisp_Image_Instance *p)
+x_redisplay_subwindow (Lisp_Image_Instance *p)
 {
   /* Update the subwindow size if necessary. */
   if (IMAGE_INSTANCE_SIZE_CHANGED (p))
@@ -2188,7 +2182,7 @@ x_update_subwindow (Lisp_Image_Instance *p)
 /* Update all attributes that have changed. Lwlib actually does most
    of this for us. */
 static void
-x_update_widget (Lisp_Image_Instance *p)
+x_redisplay_widget (Lisp_Image_Instance *p)
 {
   /* This function can GC if IN_REDISPLAY is false. */
 #ifdef HAVE_WIDGETS
@@ -2203,19 +2197,23 @@ x_update_widget (Lisp_Image_Instance *p)
 
       XSETIMAGE_INSTANCE (image_instance, p);
       wv = gui_items_to_widget_values
-       (image_instance, IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (p));
+       (image_instance, IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (p),
+        /* #### this is not right; we need to keep track of which widgets
+           want accelerators and which don't */ 0);
       wv->change = STRUCTURAL_CHANGE;
-      /* now modify the widget */
-      lw_modify_all_widgets (IMAGE_INSTANCE_X_WIDGET_LWID (p),
-                            wv, True);
-      free_widget_value_tree (wv);
     }
-
-  /* Now do non structural updates. */
-  wv = lw_get_all_values (IMAGE_INSTANCE_X_WIDGET_LWID (p));
-
-  if (!wv)
-    return;
+  else
+    {
+      /* Assume the lotus position, breath deeply and chant to
+        yourself lwlibsux, lwlibsux ... lw_get_all_values returns a
+        reference to the real values rather than a copy thus any
+        changes we make to the values we get back will look like they
+        have already been applied. If we rebuild the widget tree then
+        we may lose propertie. */
+      wv = copy_widget_value_tree (lw_get_all_values
+                                  (IMAGE_INSTANCE_X_WIDGET_LWID (p)),
+                                  NO_CHANGE);
+    }
 
   /* Possibly update the colors and font */
   if (IMAGE_INSTANCE_WIDGET_FACE_CHANGED (p)
@@ -2232,9 +2230,7 @@ x_update_widget (Lisp_Image_Instance *p)
     {
       char* str;
       Lisp_Object val = IMAGE_INSTANCE_WIDGET_TEXT (p);
-      TO_EXTERNAL_FORMAT (LISP_STRING, val,
-                         C_STRING_ALLOCA, str,
-                         Qnative);
+      LISP_STRING_TO_EXTERNAL (val, str, Qnative);
       wv->value = str;
     }
 
@@ -2264,7 +2260,8 @@ x_update_widget (Lisp_Image_Instance *p)
 
   /* now modify the widget */
   lw_modify_all_widgets (IMAGE_INSTANCE_X_WIDGET_LWID (p),
-                        wv, False);
+                        wv, True);
+  free_widget_value_tree (wv);
 #endif
 }
 
@@ -2394,6 +2391,11 @@ update_widget_face (widget_value* wv, Lisp_Image_Instance *ii,
                      (IMAGE_INSTANCE_WIDGET_TEXT (ii),
                       IMAGE_INSTANCE_WIDGET_FACE (ii),
                       domain))));
+  wv->change = VISIBLE_CHANGE;
+  /* #### Megahack - but its just getting too complicated to do this
+     in the right place. */
+  if (EQ (IMAGE_INSTANCE_WIDGET_TYPE (ii), Qtab_control))
+    update_tab_widget_face (wv, ii, domain);
 }
 
 static void
@@ -2410,9 +2412,12 @@ update_tab_widget_face (widget_value* wv, Lisp_Image_Instance *ii,
         domain);
       XColor fcolor = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (pixel));
       lw_add_widget_value_arg (val, XtNtabForeground, fcolor.pixel);
+      wv->change = VISIBLE_CHANGE;
+      val->change = VISIBLE_CHANGE;
 
       for (cur = val->next; cur; cur = cur->next)
        {
+         cur->change = VISIBLE_CHANGE;
          if (cur->value)
            {
              lw_copy_widget_value_args (val, cur);
@@ -2449,9 +2454,7 @@ x_widget_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
   IMAGE_INSTANCE_TYPE (ii) = IMAGE_WIDGET;
 
   if (!NILP (IMAGE_INSTANCE_WIDGET_TEXT (ii)))
-    TO_EXTERNAL_FORMAT (LISP_STRING, IMAGE_INSTANCE_WIDGET_TEXT (ii),
-                       C_STRING_ALLOCA, nm,
-                       Qnative);
+    LISP_STRING_TO_EXTERNAL (IMAGE_INSTANCE_WIDGET_TEXT (ii), nm, Qnative);
 
   ii->data = xnew_and_zero (struct x_subwindow_data);
 
@@ -2566,7 +2569,7 @@ x_button_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
   Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
   Lisp_Object gui = IMAGE_INSTANCE_WIDGET_ITEM (ii);
   Lisp_Object glyph = find_keyword_in_vector (instantiator, Q_image);
-  widget_value* wv = gui_items_to_widget_values (image_instance, gui);
+  widget_value* wv = gui_items_to_widget_values (image_instance, gui, 1);
 
   if (!NILP (glyph))
     {
@@ -2603,13 +2606,13 @@ x_button_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
    i.e. although the arg contents may be the same the args look
    different and so are re-applied to the widget. */
 static void
-x_button_update (Lisp_Object image_instance)
+x_button_redisplay (Lisp_Object image_instance)
 {
   /* This function can GC if IN_REDISPLAY is false. */
   Lisp_Image_Instance *p = XIMAGE_INSTANCE (image_instance);
   widget_value* wv =
     gui_items_to_widget_values (image_instance,
-                               IMAGE_INSTANCE_WIDGET_ITEMS (p));
+                               IMAGE_INSTANCE_WIDGET_ITEMS (p), 1);
 
   /* now modify the widget */
   lw_modify_all_widgets (IMAGE_INSTANCE_X_WIDGET_LWID (p),
@@ -2643,15 +2646,15 @@ x_progress_gauge_instantiate (Lisp_Object image_instance, Lisp_Object instantiat
 {
   Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
   Lisp_Object gui = IMAGE_INSTANCE_WIDGET_ITEM (ii);
-  widget_value* wv = gui_items_to_widget_values (image_instance, gui);
+  widget_value* wv = gui_items_to_widget_values (image_instance, gui, 0);
 
   x_widget_instantiate (image_instance, instantiator, pointer_fg,
                        pointer_bg, dest_mask, domain, "progress", wv);
 }
 
-/* set the properties of a progres guage */
+/* set the properties of a progress gauge */
 static void
-x_progress_gauge_update (Lisp_Object image_instance)
+x_progress_gauge_redisplay (Lisp_Object image_instance)
 {
   Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
 
@@ -2676,7 +2679,7 @@ x_edit_field_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
 {
   Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
   Lisp_Object gui = IMAGE_INSTANCE_WIDGET_ITEM (ii);
-  widget_value* wv = gui_items_to_widget_values (image_instance, gui);
+  widget_value* wv = gui_items_to_widget_values (image_instance, gui, 0);
 
   x_widget_instantiate (image_instance, instantiator, pointer_fg,
                        pointer_bg, dest_mask, domain, "text-field", wv);
@@ -2697,7 +2700,7 @@ x_combo_box_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
                      pointer_bg, dest_mask, domain);
 
   wv = gui_items_to_widget_values (image_instance,
-                                  IMAGE_INSTANCE_WIDGET_ITEMS (ii));
+                                  IMAGE_INSTANCE_WIDGET_ITEMS (ii), 0);
 
   x_widget_instantiate (image_instance, instantiator, pointer_fg,
                        pointer_bg, dest_mask, domain, "combo-box", wv);
@@ -2712,21 +2715,76 @@ x_tab_control_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
   Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
   widget_value * wv =
     gui_items_to_widget_values (image_instance,
-                               IMAGE_INSTANCE_WIDGET_ITEMS (ii));
-
+                               IMAGE_INSTANCE_WIDGET_ITEMS (ii), 0);
   update_tab_widget_face (wv, ii,
                          IMAGE_INSTANCE_FRAME (ii));
-
   x_widget_instantiate (image_instance, instantiator, pointer_fg,
                        pointer_bg, dest_mask, domain, "tab-control", wv);
 }
 
-/* set the properties of a tab control */
+/* Set the properties of a tab control */
 static void
-x_tab_control_update (Lisp_Object image_instance)
+x_tab_control_redisplay (Lisp_Object image_instance)
 {
   Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
 
+  if (IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii)
+      ||
+      IMAGE_INSTANCE_WIDGET_ACTION_OCCURRED (ii))
+    {
+      /* If only the order has changed then simply select the first
+        one of the pending set. This stops horrendous rebuilding -
+        and hence flicker - of the tabs each time you click on
+        one. */
+      if (tab_control_order_only_changed (image_instance))
+       {
+         Lisp_Object rest, selected =
+           gui_item_list_find_selected
+           (NILP (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii)) ?
+            XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)) :
+            XCDR (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii)));
+
+         LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)))
+           {
+             if (gui_item_equal_sans_selected (XCAR (rest), selected, 0))
+               {
+                 /* There may be an encapsulated way of doing this,
+                    but I couldn't find it. */
+                 Lisp_Object old_selected =gui_item_list_find_selected
+                   (XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)));
+                 Arg al [1];
+                 char* name;
+                 unsigned int num_children, i;
+                 Widget* children;
+
+                 LISP_STRING_TO_EXTERNAL (XGUI_ITEM (XCAR (rest))->name,
+                                          name, Qnative);
+                 /* The name may contain a `.' which confuses
+                    XtNameToWidget, so we do it ourselves. */
+                 children = XtCompositeChildren (IMAGE_INSTANCE_X_WIDGET_ID (ii),
+                                                 &num_children);
+                 for (i = 0; i < num_children; i++)
+                   {
+                     if (!strcmp (XtName (children [i]), name))
+                       {
+                         XtSetArg (al [0], XtNtopWidget, children [i]);
+                         XtSetValues (IMAGE_INSTANCE_X_WIDGET_ID (ii), al, 1);
+                         break;
+                       }
+                   }
+                 /* Pick up the new selected item. */
+                 XGUI_ITEM (old_selected)->selected =
+                   XGUI_ITEM (XCAR (rest))->selected;
+                 XGUI_ITEM (XCAR (rest))->selected =
+                   XGUI_ITEM (selected)->selected;
+                 /* We're not actually changing the items anymore. */
+                 IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii) = 0;
+                 IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii) = Qnil;
+                 break;
+               }
+           }
+       }
+    }
   /* Possibly update the face. */
   if (IMAGE_INSTANCE_WIDGET_FACE_CHANGED (ii)
       ||
@@ -2734,16 +2792,21 @@ x_tab_control_update (Lisp_Object image_instance)
       ||
       IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii))
     {
-      widget_value* wv = lw_get_all_values (IMAGE_INSTANCE_X_WIDGET_LWID (ii));
+      /* See previous comments on the brokeness of lwlib.
 
-      /* #### I don't know why this can occur. */
-      if (!wv)
-       return;
+        #### There's actually not much point in doing this here
+        since, colors will have been set appropriately by
+        x_redisplay_widget. */
+      widget_value* wv =copy_widget_value_tree
+       (lw_get_all_values
+        (IMAGE_INSTANCE_X_WIDGET_LWID (ii)),
+        NO_CHANGE);
 
       update_tab_widget_face (wv, ii,
                              IMAGE_INSTANCE_FRAME (ii));
 
       lw_modify_all_widgets (IMAGE_INSTANCE_X_WIDGET_LWID (ii), wv, True);
+      free_widget_value_tree (wv);
     }
 }
 
@@ -2755,7 +2818,7 @@ x_label_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
 {
   Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
   Lisp_Object gui = IMAGE_INSTANCE_WIDGET_ITEM (ii);
-  widget_value* wv = gui_items_to_widget_values (image_instance, gui);
+  widget_value* wv = gui_items_to_widget_values (image_instance, gui, 0);
 
   x_widget_instantiate (image_instance, instantiator, pointer_fg,
                        pointer_bg, dest_mask, domain, "button", wv);
@@ -2789,8 +2852,8 @@ console_type_create_glyphs_x (void)
   CONSOLE_HAS_METHOD (x, locate_pixmap_file);
   CONSOLE_HAS_METHOD (x, unmap_subwindow);
   CONSOLE_HAS_METHOD (x, map_subwindow);
-  CONSOLE_HAS_METHOD (x, update_widget);
-  CONSOLE_HAS_METHOD (x, update_subwindow);
+  CONSOLE_HAS_METHOD (x, redisplay_widget);
+  CONSOLE_HAS_METHOD (x, redisplay_subwindow);
 }
 
 void
@@ -2832,13 +2895,13 @@ image_instantiator_format_create_glyphs_x (void)
   INITIALIZE_DEVICE_IIFORMAT (x, button);
   IIFORMAT_HAS_DEVMETHOD (x, button, property);
   IIFORMAT_HAS_DEVMETHOD (x, button, instantiate);
-  IIFORMAT_HAS_DEVMETHOD (x, button, update);
+  IIFORMAT_HAS_DEVMETHOD (x, button, redisplay);
   /* general widget methods. */
   INITIALIZE_DEVICE_IIFORMAT (x, widget);
   IIFORMAT_HAS_DEVMETHOD (x, widget, property);
   /* progress gauge */
   INITIALIZE_DEVICE_IIFORMAT (x, progress_gauge);
-  IIFORMAT_HAS_DEVMETHOD (x, progress_gauge, update);
+  IIFORMAT_HAS_DEVMETHOD (x, progress_gauge, redisplay);
   IIFORMAT_HAS_DEVMETHOD (x, progress_gauge, instantiate);
   /* text field */
   INITIALIZE_DEVICE_IIFORMAT (x, edit_field);
@@ -2847,12 +2910,12 @@ image_instantiator_format_create_glyphs_x (void)
   /* combo box */
   INITIALIZE_DEVICE_IIFORMAT (x, combo_box);
   IIFORMAT_HAS_DEVMETHOD (x, combo_box, instantiate);
-  IIFORMAT_HAS_SHARED_DEVMETHOD (x, combo_box, update, tab_control);
+  IIFORMAT_HAS_SHARED_DEVMETHOD (x, combo_box, redisplay, tab_control);
 #endif
   /* tab control widget */
   INITIALIZE_DEVICE_IIFORMAT (x, tab_control);
   IIFORMAT_HAS_DEVMETHOD (x, tab_control, instantiate);
-  IIFORMAT_HAS_DEVMETHOD (x, tab_control, update);
+  IIFORMAT_HAS_DEVMETHOD (x, tab_control, redisplay);
   /* label */
   INITIALIZE_DEVICE_IIFORMAT (x, label);
   IIFORMAT_HAS_DEVMETHOD (x, label, instantiate);
index 791926b..f904a4d 100644 (file)
@@ -32,6 +32,7 @@ Boston, MA 02111-1307, USA.  */
 
 #include "xintrinsic.h"
 #include "../lwlib/lwlib.h"
+#include "../lwlib/lwlib-utils.h"
 
 /****************************************************************************
  *                         Image-Instance Object                            *
index b8ef6a8..2953dce 100644 (file)
@@ -125,8 +125,9 @@ typedef struct
 image_instantiator_format_entry_dynarr *
   the_image_instantiator_format_entry_dynarr;
 
-static Lisp_Object allocate_image_instance (Lisp_Object governing_domain, 
-                                           Lisp_Object glyph);
+static Lisp_Object allocate_image_instance (Lisp_Object governing_domain,
+                                           Lisp_Object parent,
+                                           Lisp_Object instantiator);
 static void image_validate (Lisp_Object instantiator);
 static void glyph_property_was_changed (Lisp_Object glyph,
                                        Lisp_Object property,
@@ -134,6 +135,8 @@ static void glyph_property_was_changed (Lisp_Object glyph,
 static void set_image_instance_dirty_p (Lisp_Object instance, int dirty);
 static void register_ignored_expose (struct frame* f, int x, int y, int width, int height);
 static void cache_subwindow_instance_in_frame_maybe (Lisp_Object instance);
+static void update_image_instance (Lisp_Object image_instance,
+                                  Lisp_Object instantiator);
 /* Unfortunately windows and X are different. In windows BeginPaint()
    will prevent WM_PAINT messages being generated so it is unnecessary
    to register exposures as they will not occur. Under X they will
@@ -433,6 +436,85 @@ find_keyword_in_vector (Lisp_Object vector, Lisp_Object keyword)
   return find_keyword_in_vector_or_given (vector, keyword, Qnil);
 }
 
+static Lisp_Object
+find_instantiator_differences (Lisp_Object new, Lisp_Object old)
+{
+  Lisp_Object alist = Qnil;
+  Lisp_Object *elt = XVECTOR_DATA (new);
+  Lisp_Object *old_elt = XVECTOR_DATA (old);
+  int len = XVECTOR_LENGTH (new);
+  struct gcpro gcpro1;
+
+  /* If the vector length has changed then consider everything
+     changed. We could try and figure out what properties have
+     disappeared or been added, but this code is only used as an
+     optimization anyway so lets not bother. */
+  if (len != XVECTOR_LENGTH (old))
+    return new;
+
+  GCPRO1 (alist);
+
+  for (len -= 2; len >= 1; len -= 2)
+    {
+      /* Keyword comparisons can be done with eq, the value must be
+         done with equal.
+         #### Note that this does not optimize re-ordering. */
+      if (!EQ (elt[len], old_elt[len])
+         || !internal_equal (elt[len+1], old_elt[len+1], 0))
+       alist = Fcons (Fcons (elt[len], elt[len+1]), alist);
+     }
+
+  {
+    Lisp_Object result = alist_to_tagged_vector (elt[0], alist);
+    free_alist (alist);
+    RETURN_UNGCPRO (result);
+  }
+}
+
+DEFUN ("set-instantiator-property", Fset_instantiator_property,
+       3, 3, 0, /*
+Destructively set the property KEYWORD of INSTANTIATOR to VAL.
+If the property is not set then it is added to a copy of the
+instantiator and the new instantiator returned.
+Use `set-glyph-image' on glyphs to register instantiator changes.  */
+       (instantiator, keyword, val))
+{
+  Lisp_Object *elt;
+  int len;
+
+  CHECK_VECTOR (instantiator);
+  if (!KEYWORDP (keyword))
+    signal_simple_error ("instantiator property must be a keyword", keyword);
+
+  elt = XVECTOR_DATA (instantiator);
+  len = XVECTOR_LENGTH (instantiator);
+
+  for (len -= 2; len >= 1; len -= 2)
+    {
+      if (EQ (elt[len], keyword))
+       {
+         elt[len+1] = val;
+         break;
+       }
+    }
+
+  /* Didn't find it so add it. */
+  if (len < 1)
+  {
+    Lisp_Object alist = Qnil, result;
+    struct gcpro gcpro1;
+
+    GCPRO1 (alist);
+    alist = tagged_vector_to_alist (instantiator);
+    alist = Fcons (Fcons (keyword, val), alist);
+    result = alist_to_tagged_vector (elt[0], alist);
+    free_alist (alist);
+    RETURN_UNGCPRO (result);
+  }
+
+  return instantiator;
+}
+
 void
 check_valid_string (Lisp_Object data)
 {
@@ -572,7 +654,7 @@ void
 check_window_subwindow_cache (struct window* w)
 {
   Lisp_Object window;
-  
+
   XSETWINDOW (window, w);
 
   assert (!NILP (w->subwindow_instance_cache));
@@ -587,9 +669,12 @@ check_image_instance_structure (Lisp_Object instance)
   /* Weird nothing images exist at startup when the console is
      deleted. */
   if (!NOTHING_IMAGE_INSTANCEP (instance))
-    assert (DOMAIN_LIVE_P (instance));
+    {
+      assert (DOMAIN_LIVE_P (instance));
+      assert (VECTORP (XIMAGE_INSTANCE_INSTANTIATOR (instance)));
+    }
   if (WINDOWP (XIMAGE_INSTANCE_DOMAIN (instance)))
-    check_window_subwindow_cache 
+    check_window_subwindow_cache
       (XWINDOW (XIMAGE_INSTANCE_DOMAIN (instance)));
 }
 #endif
@@ -603,7 +688,7 @@ get_image_instantiator_governing_domain (Lisp_Object instantiator,
 {
   int governing_domain;
 
-  struct image_instantiator_methods *meths = 
+  struct image_instantiator_methods *meths =
     decode_image_instantiator_format (XVECTOR_DATA (instantiator)[0],
                                      ERROR_ME);
   governing_domain = IIFORMAT_METH_OR_GIVEN (meths, governing_domain, (),
@@ -631,7 +716,7 @@ get_image_instantiator_governing_domain (Lisp_Object instantiator,
   return domain;
 }
 
-static Lisp_Object
+Lisp_Object
 normalize_image_instantiator (Lisp_Object instantiator,
                              Lisp_Object contype,
                              Lisp_Object dest_mask)
@@ -642,8 +727,9 @@ normalize_image_instantiator (Lisp_Object instantiator,
   if (STRINGP (instantiator))
     instantiator = process_image_string_instantiator (instantiator, contype,
                                                      XINT (dest_mask));
-
-  assert (VECTORP (instantiator));
+  /* Subsequent validation will pick this up. */
+  if (!VECTORP (instantiator))
+    return instantiator;
   /* We have to always store the actual pixmap data and not the
      filename even though this is a potential memory pig.  We have to
      do this because it is quite possible that we will need to
@@ -659,7 +745,7 @@ normalize_image_instantiator (Lisp_Object instantiator,
     meths = decode_image_instantiator_format (XVECTOR_DATA (instantiator)[0],
                                              ERROR_ME);
     RETURN_UNGCPRO (IIFORMAT_METH_OR_GIVEN (meths, normalize,
-                                           (instantiator, contype),
+                                           (instantiator, contype, dest_mask),
                                            instantiator));
   }
 }
@@ -671,13 +757,15 @@ instantiate_image_instantiator (Lisp_Object governing_domain,
                                Lisp_Object pointer_fg, Lisp_Object pointer_bg,
                                int dest_mask, Lisp_Object glyph)
 {
-  Lisp_Object ii = allocate_image_instance (governing_domain, glyph);
+  Lisp_Object ii = allocate_image_instance (governing_domain,
+                                           IMAGE_INSTANCEP (domain) ?
+                                           domain : glyph, instantiator);
   Lisp_Image_Instance* p = XIMAGE_INSTANCE (ii);
   struct image_instantiator_methods *meths, *device_meths;
   struct gcpro gcpro1;
 
   GCPRO1 (ii);
-  if (!valid_image_instantiator_format_p (XVECTOR_DATA (instantiator)[0], 
+  if (!valid_image_instantiator_format_p (XVECTOR_DATA (instantiator)[0],
                                          DOMAIN_DEVICE (governing_domain)))
     signal_simple_error
       ("Image instantiator format is invalid in this locale.",
@@ -689,7 +777,7 @@ instantiate_image_instantiator (Lisp_Object governing_domain,
                                            pointer_bg, dest_mask, domain));
 
   /* Now do device specific instantiation. */
-  device_meths = decode_device_ii_format (DOMAIN_DEVICE (governing_domain), 
+  device_meths = decode_device_ii_format (DOMAIN_DEVICE (governing_domain),
                                          XVECTOR_DATA (instantiator)[0],
                                          ERROR_ME_NOT);
 
@@ -703,7 +791,9 @@ instantiate_image_instantiator (Lisp_Object governing_domain,
      geometry values, thus the instance needs to have been laid-out
      before they get called. */
   image_instance_layout (ii, XIMAGE_INSTANCE_WIDTH (ii),
-                        XIMAGE_INSTANCE_HEIGHT (ii), domain);
+                        XIMAGE_INSTANCE_HEIGHT (ii),
+                        IMAGE_UNCHANGED_GEOMETRY,
+                        IMAGE_UNCHANGED_GEOMETRY, domain);
 
   MAYBE_IIFORMAT_METH (device_meths, instantiate, (ii, instantiator, pointer_fg,
                                                   pointer_bg, dest_mask, domain));
@@ -715,16 +805,18 @@ instantiate_image_instantiator (Lisp_Object governing_domain,
   IMAGE_INSTANCE_INITIALIZED (p) = 1;
   /* Now that we're done verify that we really are laid out. */
   if (IMAGE_INSTANCE_LAYOUT_CHANGED (p))
-      image_instance_layout (ii, XIMAGE_INSTANCE_WIDTH (ii),
-                            XIMAGE_INSTANCE_HEIGHT (ii), domain);
-  
+    image_instance_layout (ii, XIMAGE_INSTANCE_WIDTH (ii),
+                          XIMAGE_INSTANCE_HEIGHT (ii),
+                          IMAGE_UNCHANGED_GEOMETRY,
+                          IMAGE_UNCHANGED_GEOMETRY, domain);
+
   /* We *must* have a clean image at this point. */
   IMAGE_INSTANCE_TEXT_CHANGED (p) = 0;
   IMAGE_INSTANCE_SIZE_CHANGED (p) = 0;
   IMAGE_INSTANCE_LAYOUT_CHANGED (p) = 0;
   IMAGE_INSTANCE_DIRTYP (p) = 0;
 
-  assert ( XIMAGE_INSTANCE_HEIGHT (ii) >= 0 
+  assert ( XIMAGE_INSTANCE_HEIGHT (ii) >= 0
           && XIMAGE_INSTANCE_WIDTH (ii) >= 0 );
 
   ERROR_CHECK_IMAGE_INSTANCE (ii);
@@ -753,6 +845,7 @@ mark_image_instance (Lisp_Object obj)
 #endif
 
   mark_object (i->name);
+  mark_object (i->instantiator);
   /* Is this legal in marking? We may get in the situation where the
      domain has been deleted - making the instance unusable. It seems
      better to remove the domain so that it can be finalized. */
@@ -762,7 +855,7 @@ mark_image_instance (Lisp_Object obj)
     mark_object (i->domain);
 
   /* We don't mark the glyph reference since that would create a
-     circularity preventing GC. */
+     circularity preventing GC. Ditto the instantiator. */
   switch (IMAGE_INSTANCE_TYPE (i))
     {
     case IMAGE_TEXT:
@@ -781,7 +874,7 @@ mark_image_instance (Lisp_Object obj)
     case IMAGE_WIDGET:
       mark_object (IMAGE_INSTANCE_WIDGET_TYPE (i));
       mark_object (IMAGE_INSTANCE_WIDGET_PROPS (i));
-      mark_object (IMAGE_INSTANCE_WIDGET_FACE (i));
+      mark_object (IMAGE_INSTANCE_SUBWINDOW_FACE (i));
       mark_object (IMAGE_INSTANCE_WIDGET_ITEMS (i));
       mark_object (IMAGE_INSTANCE_LAYOUT_CHILDREN (i));
       mark_object (IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (i));
@@ -794,11 +887,11 @@ mark_image_instance (Lisp_Object obj)
       break;
     }
 
-  /* The image may have been previously finalized (yes that's wierd,
+  /* The image may have been previously finalized (yes that's weird,
      see Fdelete_frame() and mark_window_as_deleted()), in which case
      the domain will be nil, so cope with this. */
   if (!NILP (IMAGE_INSTANCE_DEVICE (i)))
-    MAYBE_DEVMETH (XDEVICE (IMAGE_INSTANCE_DEVICE (i)), 
+    MAYBE_DEVMETH (XDEVICE (IMAGE_INSTANCE_DEVICE (i)),
                   mark_image_instance, (i));
 
   return i->device;
@@ -955,7 +1048,7 @@ finalize_image_instance (void *header, int for_disksave)
 
   /* objects like this exist at dump time, so don't bomb out. */
   if (IMAGE_INSTANCE_TYPE (i) == IMAGE_NOTHING
-      || 
+      ||
       NILP (IMAGE_INSTANCE_DEVICE (i)))
     return;
   if (for_disksave) finalose (i);
@@ -991,6 +1084,10 @@ image_instance_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
   if (!internal_equal (IMAGE_INSTANCE_NAME (i1), IMAGE_INSTANCE_NAME (i2),
                       depth + 1))
     return 0;
+  if (!internal_equal (IMAGE_INSTANCE_INSTANTIATOR (i1),
+                      IMAGE_INSTANCE_INSTANTIATOR (i2),
+                      depth + 1))
+    return 0;
 
   switch (IMAGE_INSTANCE_TYPE (i1))
     {
@@ -1061,7 +1158,7 @@ image_instance_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
       abort ();
     }
 
-  return DEVMETH_OR_GIVEN (DOMAIN_XDEVICE (i1->domain), 
+  return DEVMETH_OR_GIVEN (DOMAIN_XDEVICE (i1->domain),
                           image_instance_equal, (i1, i2, depth), 1);
 }
 
@@ -1095,10 +1192,12 @@ static unsigned long
 image_instance_hash (Lisp_Object obj, int depth)
 {
   Lisp_Image_Instance *i = XIMAGE_INSTANCE (obj);
-  unsigned long hash = HASH4 (LISP_HASH (IMAGE_INSTANCE_DOMAIN (i)),
+  unsigned long hash = HASH5 (LISP_HASH (IMAGE_INSTANCE_DOMAIN (i)),
                              IMAGE_INSTANCE_WIDTH (i),
                              IMAGE_INSTANCE_MARGIN_WIDTH (i),
-                             IMAGE_INSTANCE_HEIGHT (i));
+                             IMAGE_INSTANCE_HEIGHT (i),
+                             internal_hash (IMAGE_INSTANCE_INSTANTIATOR (i),
+                                            depth + 1));
 
   ERROR_CHECK_IMAGE_INSTANCE (obj);
 
@@ -1128,17 +1227,17 @@ image_instance_hash (Lisp_Object obj, int depth)
                    LISP_HASH (IMAGE_INSTANCE_WIDGET_TYPE (i)),
                    internal_hash (IMAGE_INSTANCE_WIDGET_PROPS (i), depth + 1),
                    internal_hash (IMAGE_INSTANCE_WIDGET_ITEMS (i), depth + 1),
-                   internal_hash (IMAGE_INSTANCE_LAYOUT_CHILDREN (i), 
+                   internal_hash (IMAGE_INSTANCE_LAYOUT_CHILDREN (i),
                                   depth + 1));
     case IMAGE_SUBWINDOW:
-      hash = HASH2 (hash, (int) IMAGE_INSTANCE_SUBWINDOW_ID (i));
+      hash = HASH2 (hash, (EMACS_INT) IMAGE_INSTANCE_SUBWINDOW_ID (i));
       break;
 
     default:
       abort ();
     }
 
-  return HASH2 (hash, DEVMETH_OR_GIVEN 
+  return HASH2 (hash, DEVMETH_OR_GIVEN
                (XDEVICE (image_instance_device (obj)),
                 image_instance_hash, (i, depth),
                 0));
@@ -1151,7 +1250,8 @@ DEFINE_LRECORD_IMPLEMENTATION ("image-instance", image_instance,
                               Lisp_Image_Instance);
 
 static Lisp_Object
-allocate_image_instance (Lisp_Object governing_domain, Lisp_Object glyph)
+allocate_image_instance (Lisp_Object governing_domain, Lisp_Object parent,
+                        Lisp_Object instantiator)
 {
   Lisp_Image_Instance *lp =
     alloc_lcrecord_type (Lisp_Image_Instance, &lrecord_image_instance);
@@ -1177,7 +1277,8 @@ allocate_image_instance (Lisp_Object governing_domain, Lisp_Object glyph)
   lp->width = IMAGE_UNSPECIFIED_GEOMETRY;
   lp->margin_width = 0;
   lp->height = IMAGE_UNSPECIFIED_GEOMETRY;
-  lp->parent = glyph;
+  lp->parent = parent;
+  lp->instantiator = instantiator;
   /* So that layouts get done. */
   lp->layout_changed = 1;
   lp->initialized = 0;
@@ -1576,67 +1677,6 @@ the image instance in the domain.
   return Qnil;
 }
 
-DEFUN ("set-image-instance-property", Fset_image_instance_property, 3, 3, 0, /*
-Set the given property of the given image instance.
-Does nothing if the property or the property method do not exist for
-the image instance in the domain.
-
-WARNING: If you are thinking about using this function, think again.
-You probably want to be using `set-glyph-image' to change the glyph's
-specifier.  Be especially wary if you are thinking of calling this
-function after having called `glyph-image-instance'.  Unless you are
-absolutely sure what you're doing, pretty much the only legitimate
-uses for this function are setting user-specified info in a widget,
-such as text in a text field.  */
-       (image_instance, prop, val))
-{
-  Lisp_Image_Instance* ii;
-  Lisp_Object type, ret;
-  struct image_instantiator_methods* meths;
-
-  CHECK_IMAGE_INSTANCE (image_instance);
-  ERROR_CHECK_IMAGE_INSTANCE (image_instance);
-  CHECK_SYMBOL (prop);
-  ii = XIMAGE_INSTANCE (image_instance);
-  type = encode_image_instance_type (IMAGE_INSTANCE_TYPE (ii));
-  /* try device specific methods first ... */
-  meths = decode_device_ii_format (image_instance_device (image_instance),
-                                  type, ERROR_ME_NOT);
-  if (meths && HAS_IIFORMAT_METH_P (meths, set_property)
-      &&
-      !UNBOUNDP (ret =
-                IIFORMAT_METH (meths, set_property, (image_instance, prop, val))))
-    {
-      val = ret;
-    }
-  else
-    {
-      /* ... then format specific methods ... */
-      meths = decode_device_ii_format (Qnil, type, ERROR_ME_NOT);
-      if (meths && HAS_IIFORMAT_METH_P (meths, set_property)
-         &&
-         !UNBOUNDP (ret =
-                    IIFORMAT_METH (meths, set_property, (image_instance, prop, val))))
-       {
-         val = ret;
-       }
-      else
-       {
-         val = Qnil;
-       }
-    }
-
-  /* Make sure the image instance gets redisplayed. */
-  set_image_instance_dirty_p (image_instance, 1);
-  /* Force the glyph to be laid out again. */
-  IMAGE_INSTANCE_LAYOUT_CHANGED (ii) = 1;
-
-  MARK_SUBWINDOWS_STATE_CHANGED;
-  MARK_GLYPHS_CHANGED;
-
-  return val;
-}
-
 DEFUN ("image-instance-file-name", Fimage_instance_file_name, 1, 1, 0, /*
 Return the file name from which IMAGE-INSTANCE was read, if known.
 */
@@ -1872,8 +1912,8 @@ instance is a mono pixmap; otherwise, the same image instance is returned.
 
   /* #### There should be a copy_image_instance(), which calls a
      device-specific method to copy the window-system subobject. */
-  new = allocate_image_instance (XIMAGE_INSTANCE_DOMAIN (image_instance), 
-                                Qnil);
+  new = allocate_image_instance (XIMAGE_INSTANCE_DOMAIN (image_instance),
+                                Qnil, Qnil);
   copy_lcrecord (XIMAGE_INSTANCE (new), XIMAGE_INSTANCE (image_instance));
   /* note that if this method returns non-zero, this method MUST
      copy any window-system resources, so that when one image instance is
@@ -1925,10 +1965,12 @@ image_instance_query_geometry (Lisp_Object image_instance,
    function relatively simple to take account of that. An alternative
    approach is to consider separately the two cases, one where you
    don't mind what size you have (normal widgets) and one where you
-   want to specifiy something (layout widgets). */
+   want to specify something (layout widgets). */
 void
 image_instance_layout (Lisp_Object image_instance,
-                      int width, int height, Lisp_Object domain)
+                      int width, int height,
+                      int xoffset, int yoffset,
+                      Lisp_Object domain)
 {
   Lisp_Image_Instance* ii = XIMAGE_INSTANCE (image_instance);
   Lisp_Object type;
@@ -1940,6 +1982,16 @@ image_instance_layout (Lisp_Object image_instance,
   if (NOTHING_IMAGE_INSTANCEP (image_instance))
     return;
 
+  /* We don't want carefully calculated offsets to be mucked up by
+     random layouts. */
+  if (xoffset != IMAGE_UNCHANGED_GEOMETRY)
+    XIMAGE_INSTANCE_XOFFSET (image_instance) = xoffset;
+  if (yoffset != IMAGE_UNCHANGED_GEOMETRY)
+    XIMAGE_INSTANCE_YOFFSET (image_instance) = yoffset;
+
+  assert (XIMAGE_INSTANCE_YOFFSET (image_instance) >= 0
+         && XIMAGE_INSTANCE_XOFFSET (image_instance) >= 0);
+
   type = encode_image_instance_type (IMAGE_INSTANCE_TYPE (ii));
   meths = decode_device_ii_format (Qnil, type, ERROR_ME_NOT);
 
@@ -1990,13 +2042,73 @@ image_instance_layout (Lisp_Object image_instance,
   IMAGE_INSTANCE_WIDTH (ii) = width;
   IMAGE_INSTANCE_HEIGHT (ii) = height;
 
-  if (IIFORMAT_METH_OR_GIVEN (meths, layout, 
-                             (image_instance, width, height, domain), 1))
+  if (IIFORMAT_METH_OR_GIVEN (meths, layout,
+                             (image_instance, width, height, xoffset, yoffset,
+                              domain), 1))
     /* Do not clear the dirty flag here - redisplay will do this for
        us at the end. */
     IMAGE_INSTANCE_LAYOUT_CHANGED (ii) = 0;
 }
 
+/* Update an image instance from its changed instantiator. */
+static void
+update_image_instance (Lisp_Object image_instance,
+                      Lisp_Object instantiator)
+{
+  struct image_instantiator_methods* meths;
+  Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+
+  ERROR_CHECK_IMAGE_INSTANCE (image_instance);
+
+  if (NOTHING_IMAGE_INSTANCEP (image_instance))
+    return;
+
+  assert (!internal_equal (IMAGE_INSTANCE_INSTANTIATOR (ii), instantiator, 0)
+         || (internal_equal (IMAGE_INSTANCE_INSTANTIATOR (ii), instantiator, 0)
+          && internal_equal (IMAGE_INSTANCE_INSTANTIATOR (ii), instantiator, -10)));
+
+  /* If the instantiator is identical then do nothing. We must use
+     equal here because the specifier code copies the instantiator. */
+  if (!internal_equal (IMAGE_INSTANCE_INSTANTIATOR (ii), instantiator, 0))
+    {
+      /* Extract the changed properties so that device / format
+        methods only have to cope with these. We assume that
+        normalization has already been done. */
+      Lisp_Object diffs = find_instantiator_differences
+       (instantiator,
+        IMAGE_INSTANCE_INSTANTIATOR (ii));
+      Lisp_Object type = encode_image_instance_type
+       (IMAGE_INSTANCE_TYPE (ii));
+      struct gcpro gcpro1;
+      GCPRO1 (diffs);
+
+      /* try device specific methods first ... */
+      meths = decode_device_ii_format (image_instance_device (image_instance),
+                                      type, ERROR_ME_NOT);
+      MAYBE_IIFORMAT_METH (meths, update, (image_instance, diffs));
+      /* ... then format specific methods ... */
+      meths = decode_device_ii_format (Qnil, type, ERROR_ME_NOT);
+      MAYBE_IIFORMAT_METH (meths, update, (image_instance, diffs));
+
+      /* Instance and therefore glyph has changed so mark as dirty.
+        If we don't do this output optimizations will assume the
+        glyph is unchanged. */
+      set_image_instance_dirty_p (image_instance, 1);
+      /* Structure has changed. */
+      IMAGE_INSTANCE_LAYOUT_CHANGED (ii) = 1;
+
+      UNGCPRO;
+    }
+  /* We should now have a consistent instantiator so keep a record of
+     it. It is important that we don't actually update the window
+     system widgets here - we must do that when redisplay tells us
+     to.
+
+     #### should we delay doing this until the display is up-to-date
+     also? */
+  IMAGE_INSTANCE_INSTANTIATOR (ii) = instantiator;
+}
+
 /*
  * Mark image instance in W as dirty if (a) W's faces have changed and
  * (b) GLYPH_OR_II instance in W is a string.
@@ -2088,7 +2200,8 @@ inherit_validate (Lisp_Object instantiator)
 }
 
 static Lisp_Object
-inherit_normalize (Lisp_Object inst, Lisp_Object console_type)
+inherit_normalize (Lisp_Object inst, Lisp_Object console_type,
+                  Lisp_Object dest_mask)
 {
   Lisp_Object face;
 
@@ -2262,20 +2375,16 @@ text_query_geometry (Lisp_Object image_instance,
 }
 
 /* set the properties of a string */
-static Lisp_Object
-text_set_property (Lisp_Object image_instance, Lisp_Object prop,
-                  Lisp_Object val)
+static void
+text_update (Lisp_Object image_instance, Lisp_Object instantiator)
 {
-  Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+  Lisp_Object val = find_keyword_in_vector (instantiator, Q_data);
 
-  if (EQ (prop, Q_data))
+  if (!NILP (val))
     {
       CHECK_STRING (val);
-      IMAGE_INSTANCE_TEXT_STRING (ii) = val;
-
-      return Qt;
+      XIMAGE_INSTANCE_TEXT_STRING (image_instance) = val;
     }
-  return Qunbound;
 }
 
 \f
@@ -2472,9 +2581,7 @@ bitmap_to_lisp_data (Lisp_Object name, int *xhot, int *yhot,
   int result;
   const char *filename_ext;
 
-  TO_EXTERNAL_FORMAT (LISP_STRING, name,
-                     C_STRING_ALLOCA, filename_ext,
-                     Qfile_name);
+  LISP_STRING_TO_EXTERNAL (name, filename_ext, Qfile_name);
   result = read_bitmap_data_from_file (filename_ext, &w, &h,
                                       &data, xhot, yhot);
 
@@ -2560,7 +2667,8 @@ xbm_mask_file_munging (Lisp_Object alist, Lisp_Object file,
 /* Normalize method for XBM's. */
 
 static Lisp_Object
-xbm_normalize (Lisp_Object inst, Lisp_Object console_type)
+xbm_normalize (Lisp_Object inst, Lisp_Object console_type,
+              Lisp_Object dest_mask)
 {
   Lisp_Object file = Qnil, mask_file = Qnil;
   struct gcpro gcpro1, gcpro2, gcpro3;
@@ -2643,7 +2751,8 @@ xface_validate (Lisp_Object instantiator)
 }
 
 static Lisp_Object
-xface_normalize (Lisp_Object inst, Lisp_Object console_type)
+xface_normalize (Lisp_Object inst, Lisp_Object console_type,
+                Lisp_Object dest_mask)
 {
   /* This function can call lisp */
   Lisp_Object file = Qnil, mask_file = Qnil;
@@ -2718,9 +2827,7 @@ pixmap_to_lisp_data (Lisp_Object name, int ok_if_data_invalid)
   int result;
   char *fname = 0;
 
-  TO_EXTERNAL_FORMAT (LISP_STRING, name,
-                     C_STRING_ALLOCA, fname,
-                     Qfile_name);
+  LISP_STRING_TO_EXTERNAL (name, fname, Qfile_name);
   result = XpmReadFileToData (fname, &data);
 
   if (result == XpmSuccess)
@@ -2852,7 +2959,8 @@ evaluate_xpm_color_symbols (void)
 }
 
 static Lisp_Object
-xpm_normalize (Lisp_Object inst, Lisp_Object console_type)
+xpm_normalize (Lisp_Object inst, Lisp_Object console_type,
+              Lisp_Object dest_mask)
 {
   Lisp_Object file = Qnil;
   Lisp_Object color_symbols;
@@ -3019,7 +3127,7 @@ image_instantiate (Lisp_Object specifier, Lisp_Object matchspec,
       Lisp_Object governing_domain =
        get_image_instantiator_governing_domain (instantiator, domain);
       struct gcpro gcpro1;
-      
+
       GCPRO1 (instance);
 
       /* We have to put subwindow, widget and text image instances in
@@ -3031,13 +3139,13 @@ image_instantiate (Lisp_Object specifier, Lisp_Object matchspec,
        {
          pointer_fg = FACE_FOREGROUND (Vpointer_face, domain);
          pointer_bg = FACE_BACKGROUND (Vpointer_face, domain);
-         ls3 = list3 (instantiator, pointer_fg, pointer_bg);
+         ls3 = list3 (glyph, pointer_fg, pointer_bg);
        }
 
       /* First look in the device cache. */
       if (DEVICEP (governing_domain))
        {
-         subtable = Fgethash (make_int (dest_mask), 
+         subtable = Fgethash (make_int (dest_mask),
                               XDEVICE (governing_domain)->
                               image_instance_cache,
                               Qunbound);
@@ -3046,7 +3154,7 @@ image_instantiate (Lisp_Object specifier, Lisp_Object matchspec,
              /* For the image instance cache, we do comparisons with
                 EQ rather than with EQUAL, as we do for color and
                 font names.  The reasons are:
-                
+
                 1) pixmap data can be very long, and thus the hashing
                 and comparing will take awhile.
 
@@ -3054,13 +3162,13 @@ image_instantiate (Lisp_Object specifier, Lisp_Object matchspec,
                 are EQUAL but not EQ (that can happen a lot with
                 faces, because their specifiers are copied around);
                 but pixmaps tend not to be in faces.
-                
+
                 However, if the image-instance could be a pointer, we
                 have to use EQUAL because we massaged the
                 instantiator into a cons3 also containing the
                 foreground and background of the pointer face.  */
 
-             subtable = make_lisp_hash_table 
+             subtable = make_lisp_hash_table
                (20, pointerp ? HASH_TABLE_KEY_CAR_WEAK
                 : HASH_TABLE_KEY_WEAK,
                 pointerp ? HASH_TABLE_EQUAL
@@ -3071,7 +3179,7 @@ image_instantiate (Lisp_Object specifier, Lisp_Object matchspec,
            }
          else
            {
-             instance = Fgethash (pointerp ? ls3 : instantiator,
+             instance = Fgethash (pointerp ? ls3 : glyph,
                                   subtable, Qunbound);
            }
        }
@@ -3080,7 +3188,7 @@ image_instantiate (Lisp_Object specifier, Lisp_Object matchspec,
          /* Subwindows have a per-window cache and have to be treated
             differently. */
          instance =
-           Fgethash (instantiator,
+           Fgethash (pointerp ? ls3 : glyph,
                      XWINDOW (governing_domain)->subwindow_instance_cache,
                      Qunbound);
        }
@@ -3093,8 +3201,8 @@ image_instantiate (Lisp_Object specifier, Lisp_Object matchspec,
        {
          Lisp_Object locative =
            noseeum_cons (Qnil,
-                         noseeum_cons (pointerp ? ls3 : instantiator,
-                                       DEVICEP (governing_domain) ? subtable 
+                         noseeum_cons (pointerp ? ls3 : glyph,
+                                       DEVICEP (governing_domain) ? subtable
                                        : XWINDOW (governing_domain)
                                        ->subwindow_instance_cache));
          int speccount = specpdl_depth ();
@@ -3106,7 +3214,7 @@ image_instantiate (Lisp_Object specifier, Lisp_Object matchspec,
             resulting instance, which gets recorded instead. */
          record_unwind_protect (image_instantiate_cache_result,
                                 locative);
-         instance = 
+         instance =
            instantiate_image_instantiator (governing_domain,
                                            domain, instantiator,
                                            pointer_fg, pointer_bg,
@@ -3126,18 +3234,33 @@ image_instantiate (Lisp_Object specifier, Lisp_Object matchspec,
 #ifdef ERROR_CHECK_GLYPHS
          if (image_instance_type_to_mask (XIMAGE_INSTANCE_TYPE (instance))
              & (IMAGE_SUBWINDOW_MASK | IMAGE_WIDGET_MASK))
-           assert (EQ (Fgethash ((pointerp ? ls3 : instantiator),
+           assert (EQ (Fgethash ((pointerp ? ls3 : glyph),
                                  XWINDOW (governing_domain)
                                  ->subwindow_instance_cache,
                                  Qunbound), instance));
 #endif
        }
-      else
-       free_list (ls3);
-
-      if (NILP (instance))
+      else if (NILP (instance))
        signal_simple_error ("Can't instantiate image (probably cached)",
                             instantiator);
+      /* We found an instance. However, because we are using the glyph
+         as the hash key instead of the instantiator, the current
+         instantiator may not be the same as the original. Thus we
+         must update the instance based on the new
+         instantiator. Preserving instance identity like this is
+         important to stop excessive window system widget creation and
+         deletion - and hence flashing. */
+      else
+       {
+         /* #### This function should be able to cope with *all*
+            changes to the instantiator, but currently only copes
+            with the most used properties. This means that it is
+            possible to make changes that don't get reflected in the
+            display. */
+         update_image_instance (instance, instantiator);
+         free_list (ls3);
+       }
+
 #ifdef ERROR_CHECK_GLYPHS
       if (image_instance_type_to_mask (XIMAGE_INSTANCE_TYPE (instance))
          & (IMAGE_SUBWINDOW_MASK | IMAGE_WIDGET_MASK))
@@ -3615,7 +3738,7 @@ Return a list of valid glyph types.
 }
 
 DEFUN ("make-glyph-internal", Fmake_glyph_internal, 0, 1, 0, /*
-Create and return a new uninitialized glyph or type TYPE.
+Create and return a new uninitialized glyph of type TYPE.
 
 TYPE specifies the type of the glyph; this should be one of `buffer',
 `pointer', or `icon', and defaults to `buffer'.  The type of the glyph
@@ -3718,7 +3841,9 @@ glyph_width (Lisp_Object glyph_or_image, Lisp_Object domain)
 
   if (XIMAGE_INSTANCE_NEEDS_LAYOUT (instance))
     image_instance_layout (instance, IMAGE_UNSPECIFIED_GEOMETRY,
-                          IMAGE_UNSPECIFIED_GEOMETRY, domain);
+                          IMAGE_UNSPECIFIED_GEOMETRY,
+                          IMAGE_UNCHANGED_GEOMETRY,
+                          IMAGE_UNCHANGED_GEOMETRY, domain);
 
   return XIMAGE_INSTANCE_WIDTH (instance);
 }
@@ -3746,7 +3871,9 @@ glyph_ascent (Lisp_Object glyph_or_image, Lisp_Object domain)
 
   if (XIMAGE_INSTANCE_NEEDS_LAYOUT (instance))
     image_instance_layout (instance, IMAGE_UNSPECIFIED_GEOMETRY,
-                          IMAGE_UNSPECIFIED_GEOMETRY, domain);
+                          IMAGE_UNSPECIFIED_GEOMETRY,
+                          IMAGE_UNCHANGED_GEOMETRY,
+                          IMAGE_UNCHANGED_GEOMETRY, domain);
 
   if (XIMAGE_INSTANCE_TYPE (instance) == IMAGE_TEXT)
     return XIMAGE_INSTANCE_TEXT_ASCENT (instance);
@@ -3764,7 +3891,9 @@ glyph_descent (Lisp_Object glyph_or_image, Lisp_Object domain)
 
   if (XIMAGE_INSTANCE_NEEDS_LAYOUT (instance))
     image_instance_layout (instance, IMAGE_UNSPECIFIED_GEOMETRY,
-                          IMAGE_UNSPECIFIED_GEOMETRY, domain);
+                          IMAGE_UNSPECIFIED_GEOMETRY,
+                          IMAGE_UNCHANGED_GEOMETRY,
+                          IMAGE_UNCHANGED_GEOMETRY, domain);
 
   if (XIMAGE_INSTANCE_TYPE (instance) ==  IMAGE_TEXT)
     return XIMAGE_INSTANCE_TEXT_DESCENT (instance);
@@ -3784,7 +3913,9 @@ glyph_height (Lisp_Object glyph_or_image, Lisp_Object domain)
 
   if (XIMAGE_INSTANCE_NEEDS_LAYOUT (instance))
     image_instance_layout (instance, IMAGE_UNSPECIFIED_GEOMETRY,
-                          IMAGE_UNSPECIFIED_GEOMETRY, domain);
+                          IMAGE_UNSPECIFIED_GEOMETRY,
+                          IMAGE_UNCHANGED_GEOMETRY,
+                          IMAGE_UNCHANGED_GEOMETRY, domain);
 
   return XIMAGE_INSTANCE_HEIGHT (instance);
 }
@@ -3920,32 +4051,29 @@ glyph_property_was_changed (Lisp_Object glyph, Lisp_Object property,
     (XGLYPH (glyph)->after_change) (glyph, property, locale);
 }
 
-#if 0                          /* Not used for now */
-static void
-glyph_query_geometry (Lisp_Object glyph_or_image, Lisp_Object window,
-                     unsigned int* width, unsigned int* height,
+void
+glyph_query_geometry (Lisp_Object glyph_or_image, int* width, int* height,
                      enum image_instance_geometry disp, Lisp_Object domain)
 {
   Lisp_Object instance = glyph_or_image;
 
   if (GLYPHP (glyph_or_image))
-    instance = glyph_image_instance (glyph_or_image, window, ERROR_ME_NOT, 1);
+    instance = glyph_image_instance (glyph_or_image, domain, ERROR_ME_NOT, 1);
 
   image_instance_query_geometry (instance, width, height, disp, domain);
 }
 
-static void
-glyph_layout (Lisp_Object glyph_or_image, Lisp_Object window,
-             unsigned int width, unsigned int height, Lisp_Object domain)
+void
+glyph_do_layout (Lisp_Object glyph_or_image, int width, int height,
+             int xoffset, int yoffset, Lisp_Object domain)
 {
   Lisp_Object instance = glyph_or_image;
 
   if (GLYPHP (glyph_or_image))
-    instance = glyph_image_instance (glyph_or_image, window, ERROR_ME_NOT, 1);
+    instance = glyph_image_instance (glyph_or_image, domain, ERROR_ME_NOT, 1);
 
-  image_instance_layout (instance, width, height, domain);
+  image_instance_layout (instance, width, height, xoffset, yoffset, domain);
 }
-#endif
 
 \f
 /*****************************************************************************
@@ -4162,22 +4290,50 @@ cache_subwindow_instance_in_frame_maybe (Lisp_Object instance)
    deleted in and moreover, frame finalization deletes the window
    system windows before deleting XEmacs windows, and hence
    subwindows.  */
-void
-free_frame_subwindow_instance_cache (struct frame* f)
+int
+unmap_subwindow_instance_cache_mapper (Lisp_Object key, Lisp_Object value,
+                                      void* finalize)
 {
-  Lisp_Object rest;
-
-  LIST_LOOP (rest, XWEAK_LIST_LIST (FRAME_SUBWINDOW_CACHE (f)))
+  /* value can be nil; we cache failures as well as successes */
+  if (!NILP (value))
     {
-      Lisp_Image_Instance *ii = XIMAGE_INSTANCE (XCAR (rest));
-      /* Make sure that the subwindow is unmapped so that window
-        deletion will not try and do it again. */
-      unmap_subwindow (XCAR (rest));
-      finalize_image_instance (ii, 0);
+      struct frame* f = XFRAME (XIMAGE_INSTANCE_FRAME (value));
+      unmap_subwindow (value);
+      if (finalize)
+       {
+         /* In case GC doesn't catch up fast enough, remove from the frame
+            cache also. Otherwise code that checks the sanity of the instance
+            will fail. */
+         XWEAK_LIST_LIST (FRAME_SUBWINDOW_CACHE (f))
+           = delq_no_quit (value,
+                           XWEAK_LIST_LIST (FRAME_SUBWINDOW_CACHE (f)));
+         finalize_image_instance (XIMAGE_INSTANCE (value), 0);
+       }
     }
+  return 0;
+}
+
+static void
+finalize_all_subwindow_instances (struct window *w)
+{
+  if (!NILP (w->next))   finalize_all_subwindow_instances (XWINDOW (w->next));
+  if (!NILP (w->vchild)) finalize_all_subwindow_instances (XWINDOW (w->vchild));
+  if (!NILP (w->hchild)) finalize_all_subwindow_instances (XWINDOW (w->hchild));
+
+  elisp_maphash (unmap_subwindow_instance_cache_mapper,
+                w->subwindow_instance_cache, (void*)1);
+}
+
+void
+free_frame_subwindow_instances (struct frame* f)
+{
+  /* Make sure all instances are finalized. We have to do this via the
+     instance cache since some instances may be extant but not
+     displayed (and hence not in the frame cache). */
+  finalize_all_subwindow_instances (XWINDOW (f->root_window));
 }
 
-/* Unmap and remove all instances from the frame cache. */
+/* Unmap all instances in the frame cache. */
 void
 reset_frame_subwindow_instance_cache (struct frame* f)
 {
@@ -4186,11 +4342,7 @@ reset_frame_subwindow_instance_cache (struct frame* f)
   LIST_LOOP (rest, XWEAK_LIST_LIST (FRAME_SUBWINDOW_CACHE (f)))
     {
       Lisp_Object value = XCAR (rest);
-      /* Make sure that the subwindow is unmapped so that window
-        deletion will not try and do it again. */
       unmap_subwindow (value);
-      XWEAK_LIST_LIST (FRAME_SUBWINDOW_CACHE (f))
-       = delq_no_quit (value, XWEAK_LIST_LIST (FRAME_SUBWINDOW_CACHE (f)));
     }
 }
 
@@ -4218,9 +4370,9 @@ check_for_ignored_expose (struct frame* f, int x, int y, int width, int height)
   for (ei = f->subwindow_exposures, prev = 0; ei; ei = ei->next)
     {
       /* Checking for exact matches just isn't good enough as we
-        mighte get exposures for partially obscure subwindows, thus
-        we have to check for overlaps. Being conservative we will
-        check for exposures wholly contained by the subwindow, this
+        might get exposures for partially obscured subwindows, thus
+        we have to check for overlaps. Being conservative, we will
+        check for exposures wholly contained by the subwindow - this
         might give us what we want.*/
       if (ei->x <= x && ei->y <= y
          && ei->x + ei->width >= x + width
@@ -4292,9 +4444,9 @@ int find_matching_subwindow (struct frame* f, int x, int y, int width, int heigh
 
       if (IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (ii)
          &&
-         IMAGE_INSTANCE_DISPLAY_X (ii) <= x 
-         && 
-         IMAGE_INSTANCE_DISPLAY_Y (ii) <= y 
+         IMAGE_INSTANCE_DISPLAY_X (ii) <= x
+         &&
+         IMAGE_INSTANCE_DISPLAY_Y (ii) <= y
          &&
          IMAGE_INSTANCE_DISPLAY_X (ii)
          + IMAGE_INSTANCE_DISPLAY_WIDTH (ii) >= x + width
@@ -4317,7 +4469,7 @@ int find_matching_subwindow (struct frame* f, int x, int y, int width, int heigh
    should generally only get called if the subwindow is actually
    dirty. */
 void
-update_subwindow (Lisp_Object subwindow)
+redisplay_subwindow (Lisp_Object subwindow)
 {
   Lisp_Image_Instance* ii = XIMAGE_INSTANCE (subwindow);
   int count = specpdl_depth ();
@@ -4333,10 +4485,11 @@ update_subwindow (Lisp_Object subwindow)
   if (WIDGET_IMAGE_INSTANCEP (subwindow))
     {
       if (image_instance_changed (subwindow))
-       update_widget (subwindow);
+       redisplay_widget (subwindow);
       /* Reset the changed flags. */
       IMAGE_INSTANCE_WIDGET_FACE_CHANGED (ii) = 0;
       IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED (ii) = 0;
+      IMAGE_INSTANCE_WIDGET_ACTION_OCCURRED (ii) = 0;
       IMAGE_INSTANCE_TEXT_CHANGED (ii) = 0;
     }
   else if (IMAGE_INSTANCE_TYPE (ii) == IMAGE_SUBWINDOW
@@ -4344,7 +4497,7 @@ update_subwindow (Lisp_Object subwindow)
           !NILP (IMAGE_INSTANCE_FRAME (ii)))
     {
       MAYBE_DEVMETH (DOMAIN_XDEVICE (ii->domain),
-                    update_subwindow, (ii));
+                    redisplay_subwindow, (ii));
     }
 
   IMAGE_INSTANCE_SIZE_CHANGED (ii) = 0;
@@ -4357,18 +4510,27 @@ update_subwindow (Lisp_Object subwindow)
      way round - it simply means that we will get more displays than
      we might need. We can get better hashing by making the depth
      negative - currently it will recurse down 7 levels.*/
-  IMAGE_INSTANCE_DISPLAY_HASH (ii) = internal_hash (subwindow, 
+  IMAGE_INSTANCE_DISPLAY_HASH (ii) = internal_hash (subwindow,
                                                    IMAGE_INSTANCE_HASH_DEPTH);
 
   unbind_to (count, Qnil);
 }
 
+/* Determine whether an image_instance has changed structurally and
+   hence needs redisplaying in some way.
+
+   #### This should just look at the instantiator differences when we
+   get rid of the stored items altogether. In fact we should probably
+   store the new instantiator as well as the old - as we do with
+   gui_items currently - and then pick-up the new on the next
+   redisplay. This would obviate the need for any of this trickery
+   with hashcodes. */
 int
 image_instance_changed (Lisp_Object subwindow)
 {
   Lisp_Image_Instance* ii = XIMAGE_INSTANCE (subwindow);
 
-  if (internal_hash (subwindow, IMAGE_INSTANCE_HASH_DEPTH) != 
+  if (internal_hash (subwindow, IMAGE_INSTANCE_HASH_DEPTH) !=
       IMAGE_INSTANCE_DISPLAY_HASH (ii))
     return 1;
   /* #### I think there is probably a bug here. This gets called for
@@ -4378,7 +4540,8 @@ image_instance_changed (Lisp_Object subwindow)
   else if (WIDGET_IMAGE_INSTANCEP (subwindow)
           && (!internal_equal (IMAGE_INSTANCE_WIDGET_ITEMS (ii),
                                IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (ii), 0)
-              || !NILP (IMAGE_INSTANCE_LAYOUT_CHILDREN (ii))))
+              || !NILP (IMAGE_INSTANCE_LAYOUT_CHILDREN (ii))
+              || IMAGE_INSTANCE_WIDGET_ACTION_OCCURRED (ii)))
     return 1;
   else
     return 0;
@@ -4391,19 +4554,19 @@ update_widget_instances (Lisp_Object frame)
   struct frame* f;
   Lisp_Object rest;
 
-  /* Its possible for the preceeding callback to have deleted the
+  /* Its possible for the preceding callback to have deleted the
      frame, so cope with this. */
   if (!FRAMEP (frame) || !FRAME_LIVE_P (XFRAME (frame)))
     return;
 
   CHECK_FRAME (frame);
   f = XFRAME (frame);
-  
+
   /* If we get called we know something has changed. */
   LIST_LOOP (rest, XWEAK_LIST_LIST (FRAME_SUBWINDOW_CACHE (f)))
     {
       Lisp_Object widget = XCAR (rest);
-      
+
       if (XIMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (widget)
          &&
          image_instance_changed (widget))
@@ -4429,7 +4592,7 @@ void unmap_subwindow (Lisp_Object subwindow)
     return;
 
 #ifdef DEBUG_WIDGETS
-  stderr_out ("unmapping subwindow %d\n", IMAGE_INSTANCE_SUBWINDOW_ID (ii));
+  stderr_out ("unmapping subwindow %p\n", IMAGE_INSTANCE_SUBWINDOW_ID (ii));
 #endif
   f = XFRAME (IMAGE_INSTANCE_FRAME (ii));
 
@@ -4440,7 +4603,7 @@ void unmap_subwindow (Lisp_Object subwindow)
                           IMAGE_INSTANCE_DISPLAY_HEIGHT (ii));
   IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (ii) = 0;
 
-  MAYBE_DEVMETH (XDEVICE (IMAGE_INSTANCE_DEVICE (ii)), 
+  MAYBE_DEVMETH (XDEVICE (IMAGE_INSTANCE_DEVICE (ii)),
                 unmap_subwindow, (ii));
 }
 
@@ -4458,12 +4621,11 @@ void map_subwindow (Lisp_Object subwindow, int x, int y,
     return;
 
 #ifdef DEBUG_WIDGETS
-  stderr_out ("mapping subwindow %d, %dx%d@%d+%d\n",
+  stderr_out ("mapping subwindow %p, %dx%d@%d+%d\n",
              IMAGE_INSTANCE_SUBWINDOW_ID (ii),
              dga->width, dga->height, x, y);
 #endif
   f = XFRAME (IMAGE_INSTANCE_FRAME (ii));
-  IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (ii) = 1;
   IMAGE_INSTANCE_DISPLAY_X (ii) = x;
   IMAGE_INSTANCE_DISPLAY_Y (ii) = y;
   IMAGE_INSTANCE_DISPLAY_WIDTH (ii) = dga->width;
@@ -4471,6 +4633,7 @@ void map_subwindow (Lisp_Object subwindow, int x, int y,
 
   MAYBE_DEVMETH (DOMAIN_XDEVICE (ii->domain),
                 map_subwindow, (ii, x, y, dga));
+  IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (ii) = 1;
 }
 
 static int
@@ -4526,7 +4689,7 @@ subwindow_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
     }
 }
 
-/* This is just a backup in case no-one has assigned a suitable geometry. 
+/* This is just a backup in case no-one has assigned a suitable geometry.
    #### It should really query the enclose window for geometry. */
 static void
 subwindow_query_geometry (Lisp_Object image_instance, int* width,
@@ -4552,7 +4715,7 @@ Return the window id of SUBWINDOW as a number.
        (subwindow))
 {
   CHECK_SUBWINDOW_IMAGE_INSTANCE (subwindow);
-  return make_int ((int) XIMAGE_INSTANCE_SUBWINDOW_ID (subwindow));
+  return make_int ((EMACS_INT) XIMAGE_INSTANCE_SUBWINDOW_ID (subwindow));
 }
 
 DEFUN ("resize-subwindow", Fresize_subwindow, 1, 3, 0, /*
@@ -4577,7 +4740,7 @@ If a value is nil that parameter is not changed.
   else
     newh = XINT (height);
 
-  /* The actual resizing gets done asychronously by
+  /* The actual resizing gets done asynchronously by
      update_subwindow. */
   IMAGE_INSTANCE_HEIGHT (ii) = newh;
   IMAGE_INSTANCE_WIDTH (ii) = neww;
@@ -4774,22 +4937,22 @@ syms_of_glyphs (void)
   DEFSUBR (Fset_console_type_image_conversion_list);
   DEFSUBR (Fconsole_type_image_conversion_list);
 
-  defkeyword (&Q_file, ":file");
-  defkeyword (&Q_data, ":data");
-  defkeyword (&Q_face, ":face");
-  defkeyword (&Q_pixel_height, ":pixel-height");
-  defkeyword (&Q_pixel_width, ":pixel-width");
+  DEFKEYWORD (Q_file);
+  DEFKEYWORD (Q_data);
+  DEFKEYWORD (Q_face);
+  DEFKEYWORD (Q_pixel_height);
+  DEFKEYWORD (Q_pixel_width);
 
 #ifdef HAVE_XPM
-  defkeyword (&Q_color_symbols, ":color-symbols");
+  DEFKEYWORD (Q_color_symbols);
 #endif
 #ifdef HAVE_WINDOW_SYSTEM
-  defkeyword (&Q_mask_file, ":mask-file");
-  defkeyword (&Q_mask_data, ":mask-data");
-  defkeyword (&Q_hotspot_x, ":hotspot-x");
-  defkeyword (&Q_hotspot_y, ":hotspot-y");
-  defkeyword (&Q_foreground, ":foreground");
-  defkeyword (&Q_background, ":background");
+  DEFKEYWORD (Q_mask_file);
+  DEFKEYWORD (Q_mask_data);
+  DEFKEYWORD (Q_hotspot_x);
+  DEFKEYWORD (Q_hotspot_y);
+  DEFKEYWORD (Q_foreground);
+  DEFKEYWORD (Q_background);
 #endif
   /* image specifiers */
 
@@ -4800,13 +4963,13 @@ syms_of_glyphs (void)
 
   defsymbol (&Qimage_instancep, "image-instance-p");
 
-  defsymbol (&Qnothing_image_instance_p, "nothing-image-instance-p");
-  defsymbol (&Qtext_image_instance_p, "text-image-instance-p");
-  defsymbol (&Qmono_pixmap_image_instance_p, "mono-pixmap-image-instance-p");
-  defsymbol (&Qcolor_pixmap_image_instance_p, "color-pixmap-image-instance-p");
-  defsymbol (&Qpointer_image_instance_p, "pointer-image-instance-p");
-  defsymbol (&Qwidget_image_instance_p, "widget-image-instance-p");
-  defsymbol (&Qsubwindow_image_instance_p, "subwindow-image-instance-p");
+  DEFSYMBOL (Qnothing_image_instance_p);
+  DEFSYMBOL (Qtext_image_instance_p);
+  DEFSYMBOL (Qmono_pixmap_image_instance_p);
+  DEFSYMBOL (Qcolor_pixmap_image_instance_p);
+  DEFSYMBOL (Qpointer_image_instance_p);
+  DEFSYMBOL (Qwidget_image_instance_p);
+  DEFSYMBOL (Qsubwindow_image_instance_p);
 
   DEFSUBR (Fmake_image_instance);
   DEFSUBR (Fimage_instance_p);
@@ -4826,7 +4989,6 @@ syms_of_glyphs (void)
   DEFSUBR (Fimage_instance_foreground);
   DEFSUBR (Fimage_instance_background);
   DEFSUBR (Fimage_instance_property);
-  DEFSUBR (Fset_image_instance_property);
   DEFSUBR (Fcolorize_image_instance);
   /* subwindows */
   DEFSUBR (Fsubwindowp);
@@ -4837,21 +4999,21 @@ syms_of_glyphs (void)
   /* Qnothing defined as part of the "nothing" image-instantiator
      type. */
   /* Qtext defined in general.c */
-  defsymbol (&Qmono_pixmap, "mono-pixmap");
-  defsymbol (&Qcolor_pixmap, "color-pixmap");
+  DEFSYMBOL (Qmono_pixmap);
+  DEFSYMBOL (Qcolor_pixmap);
   /* Qpointer defined in general.c */
 
   /* glyphs */
 
-  defsymbol (&Qglyphp, "glyphp");
-  defsymbol (&Qcontrib_p, "contrib-p");
-  defsymbol (&Qbaseline, "baseline");
+  DEFSYMBOL (Qglyphp);
+  DEFSYMBOL (Qcontrib_p);
+  DEFSYMBOL (Qbaseline);
 
-  defsymbol (&Qbuffer_glyph_p, "buffer-glyph-p");
-  defsymbol (&Qpointer_glyph_p, "pointer-glyph-p");
-  defsymbol (&Qicon_glyph_p, "icon-glyph-p");
+  DEFSYMBOL (Qbuffer_glyph_p);
+  DEFSYMBOL (Qpointer_glyph_p);
+  DEFSYMBOL (Qicon_glyph_p);
 
-  defsymbol (&Qconst_glyph_variable, "const-glyph-variable");
+  DEFSYMBOL (Qconst_glyph_variable);
 
   DEFSUBR (Fglyph_type);
   DEFSUBR (Fvalid_glyph_type_p);
@@ -4862,21 +5024,18 @@ syms_of_glyphs (void)
   DEFSUBR (Fglyph_ascent);
   DEFSUBR (Fglyph_descent);
   DEFSUBR (Fglyph_height);
+  DEFSUBR (Fset_instantiator_property);
 
   /* Qbuffer defined in general.c. */
   /* Qpointer defined above */
 
   /* Unfortunately, timeout handlers must be lisp functions. This is
      for animated glyphs. */
-  defsymbol (&Qglyph_animated_timeout_handler,
-             "glyph-animated-timeout-handler");
+  DEFSYMBOL (Qglyph_animated_timeout_handler);
   DEFSUBR (Fglyph_animated_timeout_handler);
 
   /* Errors */
-  deferror (&Qimage_conversion_error,
-           "image-conversion-error",
-           "image-conversion error", Qio_error);
-
+  DEFERROR_STANDARD (Qimage_conversion_error, Qio_error);
 }
 
 static const struct lrecord_description image_specifier_description[] = {
@@ -4959,7 +5118,7 @@ static const struct lrecord_description iim_description_1[] = {
 };
 
 const struct struct_description iim_description = {
-  sizeof(struct image_instantiator_methods),
+  sizeof (struct image_instantiator_methods),
   iim_description_1
 };
 
@@ -5002,7 +5161,7 @@ image_instantiator_format_create (void)
   /* #### Andy, what is this?  This is a bogus format and should not be
      visible to the user. */
   INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (text, "text");
-  IIFORMAT_HAS_METHOD (text, set_property);
+  IIFORMAT_HAS_METHOD (text, update);
   IIFORMAT_HAS_METHOD (text, query_geometry);
 
   INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (formatted_string, "formatted-string");
index a3a9405..e1867af 100644 (file)
@@ -95,6 +95,7 @@ enum image_instance_geometry
 };
 
 #define IMAGE_UNSPECIFIED_GEOMETRY -1
+#define IMAGE_UNCHANGED_GEOMETRY -2
 
 #define WIDGET_BORDER_HEIGHT 4
 #define WIDGET_BORDER_WIDTH 4
@@ -128,7 +129,8 @@ struct image_instantiator_methods
      that should be used in a glyph, for devices of type CONSOLE_TYPE.
      Signal an error if conversion fails. */
   Lisp_Object (*normalize_method) (Lisp_Object instantiator,
-                                  Lisp_Object console_type);
+                                  Lisp_Object console_type,
+                                  Lisp_Object dest_mask);
 
   /* Governing domain method: Return an int indicating what type of
      domain an instance in this format is governed by. */
@@ -163,7 +165,9 @@ struct image_instantiator_methods
                                      Lisp_Object property,
                                      Lisp_Object val);
   /* Asynchronously update properties. */
-  void (*update_method) (Lisp_Object image_instance);
+  void (*update_method) (Lisp_Object image_instance,
+                        Lisp_Object instantiator);
+  void (*redisplay_method) (Lisp_Object image_instance);
 
   /* Find out the desired geometry, as given by disp, of this image
    instance. Actual geometry is stored in the appropriate slots in the
@@ -176,7 +180,8 @@ struct image_instantiator_methods
   /* Layout the instance and its children bounded by the provided
      dimensions. Returns success or failure. */
   int (*layout_method) (Lisp_Object image_instance,
-                       int width, int height, Lisp_Object domain);
+                       int width, int height, int xoffset, int yoffset,
+                       Lisp_Object domain);
 };
 
 /***** Calling an image-instantiator method *****/
@@ -269,7 +274,7 @@ IIFORMAT_VALID_GENERIC_KEYWORD(format, keyw, validate_fun, 1, 0)
 #define IIFORMAT_VALID_MULTI_KEYWORD(format, keyw, validate_fun)       \
 IIFORMAT_VALID_GENERIC_KEYWORD(format, keyw, validate_fun, 1, 1)
 
-/* Same as IIFORMAT_VALID_KEYWORD execpt that the argument is not
+/* Same as IIFORMAT_VALID_KEYWORD except that the argument is not
    copied by the specifier functions. This is necessary for things
    like callbacks etc. */
 #define IIFORMAT_VALID_NONCOPY_KEYWORD(format, keyw, validate_fun)     \
@@ -348,7 +353,7 @@ void check_valid_string (Lisp_Object data);
 void check_valid_int (Lisp_Object data);
 void check_valid_face (Lisp_Object data);
 void check_valid_vector (Lisp_Object data);
-void check_valid_item_list_1 (Lisp_Object items);
+void check_valid_item_list (Lisp_Object items);
 
 void initialize_subwindow_image_instance (Lisp_Image_Instance*);
 void subwindow_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
@@ -363,10 +368,10 @@ void image_instance_query_geometry (Lisp_Object image_instance,
                                    enum image_instance_geometry disp,
                                    Lisp_Object domain);
 void image_instance_layout (Lisp_Object image_instance,
-                           int width, int height,
+                           int width, int height, int xoffset, int yoffset,
                            Lisp_Object domain);
 int layout_layout (Lisp_Object image_instance,
-                  int width, int height,
+                  int width, int height, int xoffset, int yoffset,
                   Lisp_Object domain);
 int invalidate_glyph_geometry_maybe (Lisp_Object glyph_or_ii, struct window* w);
 
@@ -528,6 +533,8 @@ struct Lisp_Image_Instance
   /* The glyph from which we were instantiated. This is a weak
      reference. */
   Lisp_Object parent;
+  /* The instantiator from which we were instantiated. */
+  Lisp_Object instantiator;
   enum image_instance_type type;
   unsigned int x_offset, y_offset;     /* for layout purposes */
   int width, height, margin_width;
@@ -537,9 +544,10 @@ struct Lisp_Image_Instance
   unsigned int dirty : 1;
   unsigned int size_changed : 1;
   unsigned int text_changed : 1;
-  unsigned int layout_changed : 1; 
+  unsigned int layout_changed : 1;
   unsigned int optimize_output : 1; /* For outputting layouts. */
   unsigned int initialized : 1; /* When we're fully done. */
+  unsigned int wants_initial_focus : 1;
 
   union
   {
@@ -565,10 +573,10 @@ struct Lisp_Image_Instance
     struct
     {
       void* subwindow;         /* specific devices can use this as necessary */
-      struct 
+      struct
       {                                /* We need these so we can do without
                                   subwindow_cachel */
-       unsigned int x, y;      
+       unsigned int x, y;
        unsigned int width, height;
       } display_data;
       unsigned int being_displayed : 1; /* used to detect when needs
@@ -579,7 +587,7 @@ struct Lisp_Image_Instance
       unsigned int justification : 2; /* Left, right or center. */
       /* Face for colors and font. We specify this here because we
         want people to be able to put :face in the instantiator
-        spec. Using gyph-face is more inconvenient, although more
+        spec. Using glyph-face is more inconvenient, although more
         general. */
       Lisp_Object face;
       Lisp_Object type;
@@ -592,6 +600,7 @@ struct Lisp_Image_Instance
       /* Change flags to augment dirty. */
       unsigned int face_changed : 1;
       unsigned int items_changed : 1;
+      unsigned int action_occurred : 1;
     } subwindow;
   } u;
 
@@ -616,6 +625,7 @@ struct Lisp_Image_Instance
 #define IMAGE_INSTANCE_FRAME(i) (DOMAIN_FRAME ((i)->domain))
 #define IMAGE_INSTANCE_NAME(i) ((i)->name)
 #define IMAGE_INSTANCE_PARENT(i) ((i)->parent)
+#define IMAGE_INSTANCE_INSTANTIATOR(i) ((i)->instantiator)
 #define IMAGE_INSTANCE_GLYPH(i) (image_instance_parent_glyph(i))
 #define IMAGE_INSTANCE_TYPE(i) ((i)->type)
 #define IMAGE_INSTANCE_XOFFSET(i) ((i)->x_offset)
@@ -636,6 +646,7 @@ struct Lisp_Image_Instance
 #define IMAGE_INSTANCE_FACE(i) \
   (GLYPHP (IMAGE_INSTANCE_GLYPH (i)) ? \
    XGLYPH_FACE (IMAGE_INSTANCE_GLYPH (i)) : Qnil)
+#define IMAGE_INSTANCE_WANTS_INITIAL_FOCUS(i) ((i)->wants_initial_focus)
 
 /* Changed flags */
 #define IMAGE_INSTANCE_TEXT_CHANGED(i) ((i)->text_changed)
@@ -644,6 +655,8 @@ struct Lisp_Image_Instance
   ((i)->u.subwindow.face_changed)
 #define IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED(i) \
   ((i)->u.subwindow.items_changed)
+#define IMAGE_INSTANCE_WIDGET_ACTION_OCCURRED(i) \
+  ((i)->u.subwindow.action_occurred)
 #define IMAGE_INSTANCE_LAYOUT_CHANGED(i) ((i)->layout_changed)
 #define IMAGE_INSTANCE_OPTIMIZE_OUTPUT(i) ((i)->optimize_output)
 
@@ -694,6 +707,8 @@ struct Lisp_Image_Instance
 ((i)->u.subwindow.orientation)
 #define IMAGE_INSTANCE_SUBWINDOW_JUSTIFY(i) \
 ((i)->u.subwindow.justification)
+#define IMAGE_INSTANCE_SUBWINDOW_FACE(i) \
+((i)->u.subwindow.face)
 
 /* Widget properties */
 #define IMAGE_INSTANCE_WIDGET_WIDTH(i) \
@@ -737,6 +752,8 @@ XCAR (IMAGE_INSTANCE_WIDGET_ITEMS (i)) :    \
   IMAGE_INSTANCE_GLYPH (XIMAGE_INSTANCE (i))
 #define XIMAGE_INSTANCE_PARENT(i) \
   IMAGE_INSTANCE_PARENT (XIMAGE_INSTANCE (i))
+#define XIMAGE_INSTANCE_INSTANTIATOR(i) \
+  IMAGE_INSTANCE_INSTANTIATOR (XIMAGE_INSTANCE (i))
 #define XIMAGE_INSTANCE_TYPE(i) \
   IMAGE_INSTANCE_TYPE (XIMAGE_INSTANCE (i))
 #define XIMAGE_INSTANCE_DISPLAY_HASH(i) \
@@ -822,6 +839,8 @@ XCAR (IMAGE_INSTANCE_WIDGET_ITEMS (i)) :    \
   IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (XIMAGE_INSTANCE (i))
 #define XIMAGE_INSTANCE_WIDGET_TEXT(i) \
   IMAGE_INSTANCE_WIDGET_TEXT (XIMAGE_INSTANCE (i))
+#define XIMAGE_INSTANCE_WIDGET_ACTION_OCCURRED(i) \
+  IMAGE_INSTANCE_WIDGET_ACTION_OCCURRED (XIMAGE_INSTANCE (i))
 
 #define XIMAGE_INSTANCE_LAYOUT_CHILDREN(i) \
   IMAGE_INSTANCE_LAYOUT_CHILDREN (XIMAGE_INSTANCE (i))
@@ -844,6 +863,8 @@ XCAR (IMAGE_INSTANCE_WIDGET_ITEMS (i)) :    \
   IMAGE_INSTANCE_SUBWINDOW_ORIENT (XIMAGE_INSTANCE (i))
 #define XIMAGE_INSTANCE_SUBWINDOW_JUSTIFY(i) \
   IMAGE_INSTANCE_SUBWINDOW_JUSTIFY (XIMAGE_INSTANCE (i))
+#define XIMAGE_INSTANCE_SUBWINDOW_FACE(i) \
+  IMAGE_INSTANCE_SUBWINDOW_FACE (XIMAGE_INSTANCE (i))
 
 #define MARK_IMAGE_INSTANCE_CHANGED(i) \
   (IMAGE_INSTANCE_DIRTYP (i) = 1);
@@ -975,12 +996,22 @@ Lisp_Object alist_to_tagged_vector (Lisp_Object tag, Lisp_Object alist);
 void string_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
                         Lisp_Object pointer_fg, Lisp_Object pointer_bg,
                         int dest_mask, Lisp_Object domain);
+int tab_control_order_only_changed (Lisp_Object image_instance);
 Lisp_Object allocate_glyph (enum glyph_type type,
                            void (*after_change) (Lisp_Object glyph,
                                                  Lisp_Object property,
                                                  Lisp_Object locale));
+Lisp_Object normalize_image_instantiator (Lisp_Object instantiator,
+                                         Lisp_Object contype,
+                                         Lisp_Object dest_mask);
+void glyph_query_geometry (Lisp_Object glyph_or_image, int* width, int* height,
+                          enum image_instance_geometry disp,
+                          Lisp_Object domain);
+void glyph_do_layout (Lisp_Object glyph_or_image, int width, int height,
+                     int xoffset, int yoffset,
+                     Lisp_Object domain);
 void query_string_geometry ( Lisp_Object string, Lisp_Object face,
-                            int* width, int* height, int* descent, 
+                            int* width, int* height, int* descent,
                             Lisp_Object domain);
 Lisp_Object query_string_font (Lisp_Object string,
                               Lisp_Object face, Lisp_Object domain);
@@ -1093,13 +1124,15 @@ void unmap_subwindow (Lisp_Object subwindow);
 void map_subwindow (Lisp_Object subwindow, int x, int y,
                    struct display_glyph_area *dga);
 int find_matching_subwindow (struct frame* f, int x, int y, int width, int height);
-void update_widget (Lisp_Object widget);
+void redisplay_widget (Lisp_Object widget);
 void update_widget_instances (Lisp_Object frame);
-void update_subwindow (Lisp_Object subwindow);
+void redisplay_subwindow (Lisp_Object subwindow);
 Lisp_Object image_instance_parent_glyph (struct Lisp_Image_Instance*);
 int image_instance_changed (Lisp_Object image);
-void free_frame_subwindow_instance_cache (struct frame* f);
+void free_frame_subwindow_instances (struct frame* f);
 void reset_frame_subwindow_instance_cache (struct frame* f);
+int unmap_subwindow_instance_cache_mapper (Lisp_Object key,
+                                          Lisp_Object value, void* finalize);
 
 struct expose_ignore
 {
index 4c8b809..a3c3d46 100644 (file)
@@ -570,7 +570,7 @@ Toggle accepting of GPM mouse events.
        conn.maxMod = ((1<<KG_SHIFT)|(1<<KG_ALT)|(1<<KG_CTRL));
 
        /* Reset some silly static variables so that multiple Gpm_Open()
-       ** calls have even a sligh chance of working
+       ** calls have even a slight chance of working
        */
        gpm_tried = 0;
        gpm_flag = 0;
index db63c2a..dd858d0 100644 (file)
@@ -50,6 +50,11 @@ mswindows_handle_gui_wm_command (struct frame* f, HWND ctrl, LPARAM id)
 
   image_instance = Fgethash (make_int (id), 
                             FRAME_MSWINDOWS_WIDGET_HASH_TABLE1 (f), Qnil);
+  /* It is possible for a widget action to cause it to get out of sync
+     with its instantiator. Thus it is necessary to signal this
+     possibility. */
+  if (IMAGE_INSTANCEP (image_instance))
+    XIMAGE_INSTANCE_WIDGET_ACTION_OCCURRED (image_instance) = 1;
   callback = Fgethash (make_int (id), 
                       FRAME_MSWINDOWS_WIDGET_HASH_TABLE2 (f), Qnil);
   callback_ex = Fgethash (make_int (id), 
@@ -89,98 +94,7 @@ mswindows_handle_gui_wm_command (struct frame* f, HWND ctrl, LPARAM id)
   return Qt;
 }
 
-DEFUN ("mswindows-shell-execute", Fmswindows_shell_execute, 2, 4, 0, /*
-Get Windows to perform OPERATION on DOCUMENT.
-This is a wrapper around the ShellExecute system function, which
-invokes the application registered to handle OPERATION for DOCUMENT.
-OPERATION is typically \"open\", \"print\" or \"explore\" (but can be
-nil for the default action), and DOCUMENT is typically the name of a
-document file or URL, but can also be a program executable to run or
-a directory to open in the Windows Explorer.
-
-If DOCUMENT is a program executable, PARAMETERS can be a string
-containing command line parameters, but otherwise should be nil.
-
-SHOW-FLAG can be used to control whether the invoked application is hidden
-or minimized.  If SHOW-FLAG is nil, the application is displayed normally,
-otherwise it is an integer representing a ShowWindow flag:
-
-  0 - start hidden
-  1 - start normally
-  3 - start maximized
-  6 - start minimized
-*/
-       (operation, document, parameters, show_flag))
-{
-  /* Encode filename and current directory.  */
-  Lisp_Object current_dir = Ffile_name_directory (document);
-  char* path = NULL;
-  char* doc = NULL;
-  Extbyte* f=0;
-  int ret;
-  struct gcpro gcpro1, gcpro2;
-
-  CHECK_STRING (document);
-
-  if (NILP (current_dir))
-    current_dir = current_buffer->directory;
-
-  GCPRO2 (current_dir, document);
-
-  /* Use mule and cygwin-safe APIs top get at file data. */
-  if (STRINGP (current_dir))
-    {
-      TO_EXTERNAL_FORMAT (LISP_STRING, current_dir,
-                         C_STRING_ALLOCA, f,
-                         Qfile_name);
-#ifdef CYGWIN
-      CYGWIN_WIN32_PATH (f, path);
-#else
-      path = f;
-#endif
-    }
-
-  if (STRINGP (document))
-    {
-      TO_EXTERNAL_FORMAT (LISP_STRING, document,
-                         C_STRING_ALLOCA, f,
-                         Qfile_name);
-#ifdef CYGWIN
-      CYGWIN_WIN32_PATH (f, doc);
-#else
-      doc = f;
-#endif
-    }
-
-  UNGCPRO;
-
-  ret = (int) ShellExecute (NULL,
-                           (STRINGP (operation) ?
-                            XSTRING_DATA (operation) : NULL),
-                           doc, 
-                           (STRINGP (parameters) ?
-                            XSTRING_DATA (parameters) : NULL),
-                           path,
-                           (INTP (show_flag) ?
-                            XINT (show_flag) : SW_SHOWDEFAULT));
-
-  if (ret > 32)
-    return Qt;
-  
-  if (ret == ERROR_FILE_NOT_FOUND)
-    signal_simple_error ("file not found", document);
-  else if (ret == ERROR_PATH_NOT_FOUND)
-    signal_simple_error ("path not found", current_dir);
-  else if (ret == ERROR_BAD_FORMAT)
-    signal_simple_error ("bad executable format", document);
-  else
-    error ("internal error");
-
-  return Qnil;
-}
-
 void
 syms_of_gui_mswindows (void)
 {
-  DEFSUBR (Fmswindows_shell_execute);
 }
index 8aebe30..7a0e382 100644 (file)
@@ -1,6 +1,6 @@
 /* General GUI code -- X-specific. (menubars, scrollbars, toolbars, dialogs)
    Copyright (C) 1995 Board of Trustees, University of Illinois.
-   Copyright (C) 1995, 1996 Ben Wing.
+   Copyright (C) 1995, 1996, 2000 Ben Wing.
    Copyright (C) 1995 Sun Microsystems, Inc.
    Copyright (C) 1998 Free Software Foundation, Inc.
 
@@ -23,6 +23,8 @@ Boston, MA 02111-1307, USA.  */
 
 /* Synched up with: Not in FSF. */
 
+/* This file Mule-ized by Ben Wing, 7-8-00. */
+
 #include <config.h>
 #include "lisp.h"
 
@@ -40,8 +42,6 @@ Boston, MA 02111-1307, USA.  */
 #include "redisplay.h"
 #include "opaque.h"
 
-Lisp_Object Qmenu_no_selection_hook;
-
 /* we need a unique id for each popup menu, dialog box, and scrollbar */
 static unsigned int lwlib_id_tick;
 
@@ -153,8 +153,9 @@ widget_value_unwind (Lisp_Object closure)
 static void
 print_widget_value (widget_value *wv, int depth)
 {
-  /* !!#### This function has not been Mule-ized */
-  char d [200];
+  /* strings in wv are in external format; use printf not stdout_out
+     because the latter takes internal-format strings */
+  Extbyte d [200];
   int i;
   for (i = 0; i < depth; i++) d[i] = ' ';
   d[depth]=0;
@@ -255,11 +256,16 @@ popup_selection_callback (Widget widget, LWLIB_ID ignored_id,
       callback = XCAR (XCDR (data));
       callback_ex = XCDR (XCDR (data));
       update_subwindows_p = 1;
+      /* It is possible for a widget action to cause it to get out of
+        sync with its instantiator. Thus it is necessary to signal
+        this possibility. */
+      if (IMAGE_INSTANCEP (image_instance))
+       XIMAGE_INSTANCE_WIDGET_ACTION_OCCURRED (image_instance) = 1;
 
       if (!NILP (callback_ex) && !UNBOUNDP (callback_ex))
        {
          event = Fmake_event (Qnil, Qnil);
-         
+
          XEVENT (event)->event_type = misc_user_event;
          XEVENT (event)->channel = frame;
          XEVENT (event)->event.eval.function = Qeval;
@@ -292,7 +298,7 @@ popup_selection_callback (Widget widget, LWLIB_ID ignored_id,
 #endif
   if (!NILP (event))
     enqueue_Xt_dispatch_event (event);
-  /* The result of this evaluation could cause other instances to change so 
+  /* The result of this evaluation could cause other instances to change so
      enqueue an update callback to check this. */
   if (update_subwindows_p && !NILP (event))
     enqueue_magic_eval_event (update_widget_instances, frame);
@@ -312,11 +318,11 @@ popup_selection_callback (Widget widget, LWLIB_ID ignored_id,
       ((void) (slot = (!NILP (form))))
 #endif
 
-char *
-menu_separator_style (const char *s)
+Extbyte *
+menu_separator_style_and_to_external (const Bufbyte *s)
 {
-  const char *p;
-  char first;
+  const Bufbyte *p;
+  Bufbyte first;
 
   if (!s || s[0] == '\0')
     return NULL;
@@ -336,18 +342,25 @@ menu_separator_style (const char *s)
            ? NULL                      /* single etched is the default */
            : xstrdup ("shadowDoubleEtchedIn"));
   else if (*p == ':')
-    return xstrdup (p+1);
+    {
+      Extbyte *retval;
+
+      C_STRING_TO_EXTERNAL_MALLOC (p + 1, retval, Qlwlib_encoding);
+      return retval;
+    }
 
   return NULL;
 }
 
-char *
-strdup_and_add_accel (char *name)
+Extbyte *
+add_accel_and_to_external (Lisp_Object string)
 {
   int i;
   int found_accel = 0;
+  Extbyte *retval;
+  Bufbyte *name = XSTRING_DATA (string);
 
-  for (i=0; name[i]; ++i)
+  for (i = 0; name[i]; ++i)
     if (name[i] == '%' && name[i+1] == '_')
       {
        found_accel = 1;
@@ -355,15 +368,18 @@ strdup_and_add_accel (char *name)
       }
 
   if (found_accel)
-    return xstrdup (name);
+    LISP_STRING_TO_EXTERNAL_MALLOC (string, retval, Qlwlib_encoding);
   else
     {
-      char *chars = (char *) alloca (strlen (name) + 3);
+      size_t namelen = XSTRING_LENGTH (string);
+      Bufbyte *chars = (Bufbyte *) alloca (namelen + 3);
       chars[0] = '%';
       chars[1] = '_';
-      memcpy (chars+2, name, strlen (name) + 1);
-      return xstrdup (chars);
+      memcpy (chars + 2, name, namelen + 1);
+      C_STRING_TO_EXTERNAL_MALLOC (chars, retval, Qlwlib_encoding);
     }
+
+  return retval;
 }
 
 /* This does the dirty work.  gc_currently_forbidden is 1 when this is called.
@@ -371,10 +387,9 @@ strdup_and_add_accel (char *name)
 int
 button_item_to_widget_value (Lisp_Object gui_object_instance,
                             Lisp_Object gui_item, widget_value *wv,
-                            int allow_text_field_p, int no_keys_p, 
-                            int menu_entry_p)
+                            int allow_text_field_p, int no_keys_p,
+                            int menu_entry_p, int accel_p)
 {
-  /* !!#### This function has not been Mule-ized */
   /* This function cannot GC because gc_currently_forbidden is set when
      it's called */
   Lisp_Gui_Item* pgui = 0;
@@ -383,17 +398,19 @@ button_item_to_widget_value (Lisp_Object gui_object_instance,
   if (STRINGP (gui_item))
     {
       wv->type = TEXT_TYPE;
-      wv->name = (char *) XSTRING_DATA (gui_item);
-      wv->name = strdup_and_add_accel (wv->name);
+      if (accel_p)
+       wv->name = add_accel_and_to_external (gui_item);
+      else
+       LISP_STRING_TO_EXTERNAL_MALLOC (gui_item, wv->name, Qlwlib_encoding);
       return 1;
     }
   else if (!GUI_ITEMP (gui_item))
-    signal_simple_error("need a string or a gui_item here", gui_item);
+    syntax_error ("need a string or a gui_item here", gui_item);
 
   pgui = XGUI_ITEM (gui_item);
 
   if (!NILP (pgui->filter))
-    signal_simple_error(":filter keyword not permitted on leaf nodes", gui_item);
+    syntax_error (":filter keyword not permitted on leaf nodes", gui_item);
 
 #ifdef HAVE_MENUBARS
   if (menu_entry_p && !gui_item_included_p (gui_item, Vmenubar_configuration))
@@ -407,13 +424,19 @@ button_item_to_widget_value (Lisp_Object gui_object_instance,
     pgui->name = Feval (pgui->name);
 
   CHECK_STRING (pgui->name);
-  wv->name = (char *) XSTRING_DATA (pgui->name);
-  wv->name = xstrdup (wv->name);
-  wv->accel = LISP_TO_VOID (gui_item_accelerator (gui_item));
+  if (accel_p)
+    {
+      wv->name = add_accel_and_to_external (pgui->name);
+      wv->accel = LISP_TO_VOID (gui_item_accelerator (gui_item));
+    }
+  else
+    {
+      LISP_STRING_TO_EXTERNAL_MALLOC (pgui->name, wv->name, Qlwlib_encoding);
+      wv->accel = LISP_TO_VOID (Qnil);
+    }
 
   if (!NILP (pgui->suffix))
     {
-      const char *const_bogosity;
       Lisp_Object suffix2;
 
       /* Shortcut to avoid evaluating suffix each time */
@@ -425,11 +448,7 @@ button_item_to_widget_value (Lisp_Object gui_object_instance,
          CHECK_STRING (suffix2);
        }
 
-      TO_EXTERNAL_FORMAT (LISP_STRING, suffix2,
-                         C_STRING_ALLOCA, const_bogosity,
-                         Qfile_name);
-      wv->value = (char *) const_bogosity;
-      wv->value = xstrdup (wv->value);
+      LISP_STRING_TO_EXTERNAL_MALLOC (suffix2, wv->value, Qlwlib_encoding);
     }
 
   wv_set_evalable_slot (wv->enabled, pgui->active);
@@ -451,7 +470,7 @@ button_item_to_widget_value (Lisp_Object gui_object_instance,
       CHECK_STRING (pgui->keys);
       pgui->keys = Fsubstitute_command_keys (pgui->keys);
       if (XSTRING_LENGTH (pgui->keys) > 0)
-       wv->key = xstrdup ((char *) XSTRING_DATA (pgui->keys));
+       LISP_STRING_TO_EXTERNAL_MALLOC (pgui->keys, wv->key, Qlwlib_encoding);
       else
        wv->key = 0;
     }
@@ -461,7 +480,7 @@ button_item_to_widget_value (Lisp_Object gui_object_instance,
       /* #### Warning, dependency here on current_buffer and point */
       where_is_to_char (pgui->callback, buf);
       if (buf [0])
-       wv->key = xstrdup (buf);
+       C_STRING_TO_EXTERNAL_MALLOC (buf, wv->key, Qlwlib_encoding);
       else
        wv->key = 0;
     }
@@ -469,14 +488,16 @@ button_item_to_widget_value (Lisp_Object gui_object_instance,
   CHECK_SYMBOL (pgui->style);
   if (NILP (pgui->style))
     {
+      Bufbyte *intname;
       /* If the callback is nil, treat this item like unselectable text.
         This way, dashes will show up as a separator. */
       if (!wv->enabled)
        wv->type = BUTTON_TYPE;
-      if (separator_string_p (wv->name))
+      EXTERNAL_TO_C_STRING (wv->name, intname, Qlwlib_encoding);
+      if (separator_string_p (intname))
        {
          wv->type = SEPARATOR_TYPE;
-         wv->value = menu_separator_style (wv->name);
+         wv->value = menu_separator_style_and_to_external (intname);
        }
       else
        {
@@ -509,27 +530,29 @@ button_item_to_widget_value (Lisp_Object gui_object_instance,
 #endif
     }
   else
-    signal_simple_error_2 ("Unknown style", pgui->style, gui_item);
+    syntax_error_2 ("Unknown style", pgui->style, gui_item);
 
   if (!allow_text_field_p && (wv->type == TEXT_TYPE))
-    signal_simple_error ("Text field not allowed in this context", gui_item);
+    syntax_error ("Text field not allowed in this context", gui_item);
 
   if (!NILP (pgui->selected) && EQ (pgui->style, Qtext))
-    signal_simple_error (
-                        ":selected only makes sense with :style toggle, radio or button",
-                        gui_item);
+    syntax_error
+      (":selected only makes sense with :style toggle, radio or button",
+       gui_item);
   return 1;
 }
 
 /* parse tree's of gui items into widget_value hierarchies */
-static void gui_item_children_to_widget_values (Lisp_Object gui_object_instance,
+static void gui_item_children_to_widget_values (Lisp_Object
+                                               gui_object_instance,
                                                Lisp_Object items,
-                                               widget_value* parent);
+                                               widget_value* parent,
+                                               int accel_p);
 
 static widget_value *
 gui_items_to_widget_values_1 (Lisp_Object gui_object_instance,
                              Lisp_Object items, widget_value* parent,
-                             widget_value* prev)
+                             widget_value* prev, int accel_p)
 {
   widget_value* wv = 0;
 
@@ -537,13 +560,13 @@ gui_items_to_widget_values_1 (Lisp_Object gui_object_instance,
   /* now walk the tree creating widget_values as appropriate */
   if (!CONSP (items))
     {
-      wv = xmalloc_widget_value();
+      wv = xmalloc_widget_value ();
       if (parent)
        parent->contents = wv;
       else
        prev->next = wv;
       if (!button_item_to_widget_value (gui_object_instance,
-                                       items, wv, 0, 1, 0))
+                                       items, wv, 0, 1, 0, accel_p))
        {
          free_widget_value_tree (wv);
          if (parent)
@@ -552,32 +575,31 @@ gui_items_to_widget_values_1 (Lisp_Object gui_object_instance,
            prev->next = 0;
        }
       else
-       {
-         wv->value = xstrdup (wv->name);       /* what a mess... */
-       }
+       wv->value = xstrdup (wv->name); /* what a mess... */
     }
   else
     {
       /* first one is the parent */
       if (CONSP (XCAR (items)))
-       signal_simple_error ("parent item must not be a list", XCAR (items));
+       syntax_error ("parent item must not be a list", XCAR (items));
 
       if (parent)
        wv = gui_items_to_widget_values_1 (gui_object_instance,
-                                          XCAR (items), parent, 0);
+                                          XCAR (items), parent, 0, accel_p);
       else
        wv = gui_items_to_widget_values_1 (gui_object_instance,
-                                          XCAR (items), 0, prev);
+                                          XCAR (items), 0, prev, accel_p);
       /* the rest are the children */
       gui_item_children_to_widget_values (gui_object_instance,
-                                         XCDR (items), wv);
+                                         XCDR (items), wv, accel_p);
     }
   return wv;
 }
 
 static void
 gui_item_children_to_widget_values (Lisp_Object gui_object_instance,
-                                   Lisp_Object items, widget_value* parent)
+                                   Lisp_Object items, widget_value* parent,
+                                   int accel_p)
 {
   widget_value* wv = 0, *prev = 0;
   Lisp_Object rest;
@@ -585,27 +607,28 @@ gui_item_children_to_widget_values (Lisp_Object gui_object_instance,
 
   /* first one is master */
   prev = gui_items_to_widget_values_1 (gui_object_instance, XCAR (items),
-                                      parent, 0);
+                                      parent, 0, accel_p);
   /* the rest are the children */
   LIST_LOOP (rest, XCDR (items))
     {
       Lisp_Object tab = XCAR (rest);
-      wv = gui_items_to_widget_values_1 (gui_object_instance, tab, 0, prev);
+      wv = gui_items_to_widget_values_1 (gui_object_instance, tab, 0, prev,
+                                        accel_p);
       prev = wv;
     }
 }
 
 widget_value *
-gui_items_to_widget_values (Lisp_Object gui_object_instance, Lisp_Object items)
+gui_items_to_widget_values (Lisp_Object gui_object_instance, Lisp_Object items,
+                           int accel_p)
 {
-  /* !!#### This function has not been Mule-ized */
   /* This function can GC */
   widget_value *control = 0, *tmp = 0;
   int count = specpdl_depth ();
   Lisp_Object wv_closure;
 
   if (NILP (items))
-    signal_simple_error ("must have some items", items);
+    syntax_error ("must have some items", items);
 
   /* Inhibit GC during this conversion.  The reasons for this are
      the same as in menu_item_descriptor_to_widget_value(); see
@@ -616,11 +639,12 @@ gui_items_to_widget_values (Lisp_Object gui_object_instance, Lisp_Object items)
 
   /* Also make sure that we free the partially-created widget_value
      tree on Lisp error. */
-  control = xmalloc_widget_value();
+  control = xmalloc_widget_value ();
   wv_closure = make_opaque_ptr (control);
   record_unwind_protect (widget_value_unwind, wv_closure);
 
-  gui_items_to_widget_values_1 (gui_object_instance, items, control, 0);
+  gui_items_to_widget_values_1 (gui_object_instance, items, control, 0,
+                               accel_p);
 
   /* mess about getting the data we really want */
   tmp = control;
@@ -698,8 +722,6 @@ void
 syms_of_gui_x (void)
 {
   INIT_LRECORD_IMPLEMENTATION (popup_data);
-
-  defsymbol (&Qmenu_no_selection_hook, "menu-no-selection-hook");
 }
 
 void
@@ -721,14 +743,4 @@ vars_of_gui_x (void)
 
   Vpopup_callbacks = Qnil;
   staticpro (&Vpopup_callbacks);
-
-#if 0
-  /* This DEFVAR_LISP is just for the benefit of make-docfile. */
-  /* #### misnamed */
-  DEFVAR_LISP ("menu-no-selection-hook", &Vmenu_no_selection_hook /*
-Function or functions to call when a menu or dialog box is dismissed
-without a selection having been made.
-*/ );
-#endif
-  Fset (Qmenu_no_selection_hook, Qnil);
 }
index d507f69..032aa46 100644 (file)
@@ -1,6 +1,6 @@
 /* General GUI code -- X-specific header file.
    Copyright (C) 1993, 1994 Free Software Foundation, Inc.
-   Copyright (C) 1996 Ben Wing.
+   Copyright (C) 1996, 2000 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -21,6 +21,8 @@ Boston, MA 02111-1307, USA.  */
 
 /* Synched up with: Not in FSF. */
 
+/* This file Mule-ized by Ben Wing, 7-8-00. */
+
 #ifndef INCLUDED_gui_x_h_
 #define INCLUDED_gui_x_h_
 
@@ -68,15 +70,14 @@ int popup_handled_p (LWLIB_ID id);
 void free_popup_widget_value_tree (widget_value *wv);
 void popup_selection_callback (Widget widget, LWLIB_ID ignored_id,
                               XtPointer client_data);
-char *strdup_and_add_accel (char *name);
+Extbyte *add_accel_and_to_external (Lisp_Object string);
 int button_item_to_widget_value (Lisp_Object gui_object_instance,
                                 Lisp_Object gui_item, widget_value *wv,
-                                int allow_text_field_p, int no_keys_p, 
-                                int menu_entry_p);
+                                int allow_text_field_p, int no_keys_p,
+                                int menu_entry_p, int accel_p);
 widget_value * gui_items_to_widget_values (Lisp_Object gui_object_instance,
-                                          Lisp_Object items);
-Lisp_Object menu_name_to_accelerator (char *name);
-char *menu_separator_style (const char *s);
+                                          Lisp_Object items, int accel_p);
+Extbyte *menu_separator_style_and_to_external (const Bufbyte *s);
 Lisp_Object widget_value_unwind (Lisp_Object closure);
 
 #endif /* INCLUDED_gui_x_h_ */
index 47e21a5..5ec1628 100644 (file)
--- a/src/gui.c
+++ b/src/gui.c
@@ -23,6 +23,9 @@ Boston, MA 02111-1307, USA.  */
 
 /* Synched up with: Not in FSF. */
 
+/* This file not quite Mule-ized yet but will be when merged with my
+   Mule workspace. --ben */
+
 #include <config.h>
 #include "lisp.h"
 #include "gui.h"
@@ -30,10 +33,8 @@ Boston, MA 02111-1307, USA.  */
 #include "buffer.h"
 #include "bytecode.h"
 
-Lisp_Object Q_active, Q_suffix, Q_keys, Q_style, Q_selected;
-Lisp_Object Q_filter, Q_config, Q_included, Q_key_sequence;
-Lisp_Object Q_accelerator, Q_label, Q_callback, Q_callback_ex, Q_value;
-Lisp_Object Qtoggle, Qradio;
+Lisp_Object Qmenu_no_selection_hook;
+Lisp_Object Vmenu_no_selection_hook;
 
 static Lisp_Object parse_gui_item_tree_list (Lisp_Object list);
 
@@ -53,10 +54,10 @@ See `popup-menu' and `popup-dialog-box'.
 #endif /* HAVE_POPUPS */
 
 int
-separator_string_p (const char *s)
+separator_string_p (const Bufbyte *s)
 {
-  const char *p;
-  char first;
+  const Bufbyte *p;
+  Bufbyte first;
 
   if (!s || s[0] == '\0')
     return 0;
@@ -118,7 +119,7 @@ gui_item_add_keyval_pair (Lisp_Object gui_item,
   Lisp_Gui_Item *pgui_item = XGUI_ITEM (gui_item);
 
   if (!KEYWORDP (key))
-    signal_simple_error_2 ("Non-keyword in gui item", key, pgui_item->name);
+    syntax_error_2 ("Non-keyword in gui item", key, pgui_item->name);
 
   if     (EQ (key, Q_suffix))   pgui_item->suffix   = val;
   else if (EQ (key, Q_active))  pgui_item->active   = val;
@@ -138,10 +139,10 @@ gui_item_add_keyval_pair (Lisp_Object gui_item,
       if (SYMBOLP (val) || CHARP (val))
        pgui_item->accelerator = val;
       else if (ERRB_EQ (errb, ERROR_ME))
-       signal_simple_error ("Bad keyboard accelerator", val);
+       syntax_error ("Bad keyboard accelerator", val);
     }
   else if (ERRB_EQ (errb, ERROR_ME))
-    signal_simple_error_2 ("Unknown keyword in gui item", key,
+    syntax_error_2 ("Unknown keyword in gui item", key,
                           pgui_item->name);
 }
 
@@ -198,7 +199,7 @@ make_gui_item_from_keywords_internal (Lisp_Object item,
   contents = XVECTOR_DATA (item);
 
   if (length < 1)
-    signal_simple_error ("GUI item descriptors must be at least 1 elts long", item);
+    syntax_error ("GUI item descriptors must be at least 1 elts long", item);
 
   /* length 1:                 [ "name" ]
      length 2:         [ "name" callback ]
@@ -233,7 +234,7 @@ make_gui_item_from_keywords_internal (Lisp_Object item,
     {
       int i;
       if ((length - start) & 1)
-       signal_simple_error (
+       syntax_error (
                "GUI item descriptor has an odd number of keywords and values",
                             item);
 
@@ -357,6 +358,19 @@ gui_item_selected_p (Lisp_Object gui_item)
          || !NILP (Feval (XGUI_ITEM (gui_item)->selected)));
 }
 
+Lisp_Object
+gui_item_list_find_selected (Lisp_Object gui_item_list)
+{
+  /* This function can GC. */
+  Lisp_Object rest;
+  LIST_LOOP (rest, gui_item_list)
+    {
+      if (gui_item_selected_p (XCAR (rest)))
+       return XCAR (rest);
+    }
+  return XCAR (gui_item_list);
+}
+
 /*
  * Decide whether a GUI item is included by evaluating its :included
  * form if given, and testing its :config form against supplied CONFLIST
@@ -384,7 +398,7 @@ gui_item_included_p (Lisp_Object gui_item, Lisp_Object conflist)
 static DOESNT_RETURN
 signal_too_long_error (Lisp_Object name)
 {
-  signal_simple_error ("GUI item produces too long displayable string", name);
+  syntax_error ("GUI item produces too long displayable string", name);
 }
 
 #ifdef HAVE_WINDOW_SYSTEM
@@ -544,8 +558,8 @@ gui_item_id_hash (Lisp_Object hashtable, Lisp_Object gitem, int slot)
   return id;
 }
 
-static int
-gui_item_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+int
+gui_item_equal_sans_selected (Lisp_Object obj1, Lisp_Object obj2, int depth)
 {
   Lisp_Gui_Item *p1 = XGUI_ITEM (obj1);
   Lisp_Gui_Item *p2 = XGUI_ITEM (obj2);
@@ -568,8 +582,6 @@ gui_item_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
        &&
        EQ (p1->style, p2->style)
        &&
-       EQ (p1->selected, p2->selected)
-       &&
        EQ (p1->accelerator, p2->accelerator)
        &&
        EQ (p1->keys, p2->keys)
@@ -579,6 +591,19 @@ gui_item_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
   return 1;
 }
 
+static int
+gui_item_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+{
+  Lisp_Gui_Item *p1 = XGUI_ITEM (obj1);
+  Lisp_Gui_Item *p2 = XGUI_ITEM (obj2);
+
+  if (!(gui_item_equal_sans_selected (obj1, obj2, depth)
+       &&
+       EQ (p1->selected, p2->selected)))
+    return 0;
+  return 1;
+}
+
 static void
 print_gui_item (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
 {
@@ -632,7 +657,7 @@ copy_gui_item_tree (Lisp_Object arg)
     }
   else if (GUI_ITEMP (arg))
     return copy_gui_item (arg);
-  else 
+  else
     return arg;
 }
 
@@ -658,7 +683,7 @@ parse_gui_item_tree_item (Lisp_Object entry)
       CHECK_STRING (entry);
     }
   else
-    signal_simple_error ("item must be a vector or a string", entry);
+    syntax_error ("item must be a vector or a string", entry);
 
   RETURN_UNGCPRO (ret);
 }
@@ -715,23 +740,7 @@ syms_of_gui (void)
 {
   INIT_LRECORD_IMPLEMENTATION (gui_item);
 
-  defkeyword (&Q_active,   ":active");
-  defkeyword (&Q_suffix,   ":suffix");
-  defkeyword (&Q_keys,     ":keys");
-  defkeyword (&Q_key_sequence,":key-sequence");
-  defkeyword (&Q_style,    ":style");
-  defkeyword (&Q_selected, ":selected");
-  defkeyword (&Q_filter,   ":filter");
-  defkeyword (&Q_config,   ":config");
-  defkeyword (&Q_included, ":included");
-  defkeyword (&Q_accelerator, ":accelerator");
-  defkeyword (&Q_label, ":label");
-  defkeyword (&Q_callback, ":callback");
-  defkeyword (&Q_callback_ex, ":callback-ex");
-  defkeyword (&Q_value, ":value");
-
-  defsymbol (&Qtoggle, "toggle");
-  defsymbol (&Qradio, "radio");
+  DEFSYMBOL (Qmenu_no_selection_hook);
 
 #ifdef HAVE_POPUPS
   DEFSUBR (Fpopup_up_p);
@@ -741,4 +750,9 @@ syms_of_gui (void)
 void
 vars_of_gui (void)
 {
+  DEFVAR_LISP ("menu-no-selection-hook", &Vmenu_no_selection_hook /*
+Function or functions to call when a menu or dialog box is dismissed
+without a selection having been made.
+*/ );
+  Vmenu_no_selection_hook = Qnil;
 }
index 9974c9b..91f9c61 100644 (file)
--- a/src/gui.h
+++ b/src/gui.h
@@ -27,8 +27,9 @@ Boston, MA 02111-1307, USA.  */
 #ifndef INCLUDED_gui_h_
 #define INCLUDED_gui_h_
 
-int separator_string_p (const char *s);
+int separator_string_p (const Bufbyte *s);
 void get_gui_callback (Lisp_Object, Lisp_Object *, Lisp_Object *);
+int gui_item_equal_sans_selected (Lisp_Object obj1, Lisp_Object obj2, int depth);
 
 extern int popup_up_p;
 
@@ -63,10 +64,6 @@ DECLARE_LRECORD (gui_item, Lisp_Gui_Item);
 #define CHECK_GUI_ITEM(x) CHECK_RECORD (x, gui_item)
 #define CONCHECK_GUI_ITEM(x) CONCHECK_RECORD (x, gui_item)
 
-extern Lisp_Object Q_accelerator, Q_active, Q_config, Q_filter, Q_included;
-extern Lisp_Object Q_keys, Q_selected, Q_suffix, Qradio, Qtoggle;
-extern Lisp_Object Q_key_sequence, Q_label, Q_callback, Q_callback_ex, Q_value;
-
 void gui_item_add_keyval_pair (Lisp_Object,
                               Lisp_Object key, Lisp_Object val,
                               Error_behavior errb);
@@ -75,6 +72,7 @@ Lisp_Object gui_parse_item_keywords_no_errors (Lisp_Object item);
 void gui_add_item_keywords_to_plist (Lisp_Object plist, Lisp_Object gui_item);
 int  gui_item_active_p (Lisp_Object);
 int  gui_item_selected_p (Lisp_Object);
+Lisp_Object gui_item_list_find_selected (Lisp_Object gui_item_list);
 int  gui_item_included_p (Lisp_Object, Lisp_Object into);
 Lisp_Object gui_item_accelerator (Lisp_Object gui_item);
 Lisp_Object gui_name_accelerator (Lisp_Object name);
@@ -89,6 +87,8 @@ void gui_item_init (Lisp_Object gui_item);
 Lisp_Object parse_gui_item_tree_children (Lisp_Object list);
 Lisp_Object copy_gui_item_tree (Lisp_Object arg);
 
+extern Lisp_Object Qmenu_no_selection_hook, Qdelete_dialog_box_hook;
+
 /* this is mswindows biased but reasonably safe I think */
 #define GUI_ITEM_ID_SLOTS 8
 #define GUI_ITEM_ID_MIN(s) (s * 0x2000)
index 8821c10..3bde818 100644 (file)
@@ -183,7 +183,7 @@ get_gutter_coords (struct frame *f, enum gutter_pos pos, int *x, int *y,
     case TOP_GUTTER:
       *x = FRAME_LEFT_BORDER_END (f);
       *y = FRAME_TOP_BORDER_END (f);
-      *width = FRAME_RIGHT_BORDER_START (f) 
+      *width = FRAME_RIGHT_BORDER_START (f)
        - FRAME_LEFT_BORDER_END (f);
       *height = FRAME_TOP_GUTTER_BOUNDS (f);
       break;
@@ -191,7 +191,7 @@ get_gutter_coords (struct frame *f, enum gutter_pos pos, int *x, int *y,
     case BOTTOM_GUTTER:
       *x = FRAME_LEFT_BORDER_END (f);
       *y = WINDOW_BOTTOM (bot);
-      *width = FRAME_RIGHT_BORDER_START (f) 
+      *width = FRAME_RIGHT_BORDER_START (f)
        - FRAME_LEFT_BORDER_END (f);
       *height = FRAME_BOTTOM_GUTTER_BOUNDS (f);
       break;
@@ -203,7 +203,7 @@ get_gutter_coords (struct frame *f, enum gutter_pos pos, int *x, int *y,
       *height = WINDOW_BOTTOM (bot)
        - (FRAME_TOP_BORDER_END (f) + FRAME_TOP_GUTTER_BOUNDS (f));
       break;
-      
+
     case RIGHT_GUTTER:
       *x = FRAME_RIGHT_BORDER_START (f)
        - FRAME_RIGHT_GUTTER_BOUNDS (f);
@@ -220,20 +220,20 @@ get_gutter_coords (struct frame *f, enum gutter_pos pos, int *x, int *y,
 
 /* Convert the gutter specifier into something we can actually
    display. */
-static Lisp_Object construct_window_gutter_spec (struct window* w, 
+static Lisp_Object construct_window_gutter_spec (struct window* w,
                                                 enum gutter_pos pos)
 {
   Lisp_Object rest, *args;
   int nargs = 0;
   Lisp_Object gutter = RAW_WINDOW_GUTTER (w, pos);
-  
+
   if (STRINGP (gutter) || NILP (gutter))
     return gutter;
 
   GET_LIST_LENGTH (gutter, nargs);
   args = alloca_array (Lisp_Object, nargs >> 1);
   nargs = 0;
-  
+
   for (rest = gutter; !NILP (rest); rest = XCDR (XCDR (rest)))
     {
       /* We only put things in the real gutter that are declared to be
@@ -245,7 +245,7 @@ static Lisp_Object construct_window_gutter_spec (struct window* w,
          args [nargs++] = XCAR (XCDR (rest));
        }
     }
-  
+
   return Fconcat (nargs, args);
 }
 
@@ -284,7 +284,7 @@ output_gutter (struct frame *f, enum gutter_pos pos, int force)
   /* generate some display lines */
   generate_displayable_area (w, WINDOW_GUTTER (w, pos),
                             x + border_width, y + border_width,
-                            width - 2 * border_width, 
+                            width - 2 * border_width,
                             height - 2 * border_width, ddla, 0, findex);
 
   /* We only output the gutter if we think something of significance
@@ -299,7 +299,7 @@ output_gutter (struct frame *f, enum gutter_pos pos, int force)
       (f->extents_changed && w->gutter_extent_modiff[pos]))
     {
 #ifdef DEBUG_GUTTERS
-      printf ("gutter redisplay triggered by %s\n", force ? "force" : 
+      printf ("gutter redisplay triggered by %s\n", force ? "force" :
              f->faces_changed ? "f->faces_changed" :
              f->frame_changed ? "f->frame_changed" :
              f->gutter_changed ? "f->gutter_changed" :
@@ -317,13 +317,13 @@ output_gutter (struct frame *f, enum gutter_pos pos, int force)
        {
          output_display_line (w, cdla, ddla, line, -1, -1);
        }
-      
+
       /* If the number of display lines has shrunk, adjust. */
       if (cdla_len > Dynarr_length (ddla))
        {
          Dynarr_length (cdla) = Dynarr_length (ddla);
        }
-      
+
       /* grab coordinates of last line and blank after it. */
       if (Dynarr_length (ddla) > 0)
        {
@@ -360,7 +360,7 @@ output_gutter (struct frame *f, enum gutter_pos pos, int force)
       /* bevel the gutter area if so desired */
       if (border_width != 0)
        {
-         MAYBE_DEVMETH (d, bevel_area, 
+         MAYBE_DEVMETH (d, bevel_area,
                         (w, findex, x, y, width, height, border_width,
                          EDGE_ALL, EDGE_BEVEL_OUT));
        }
@@ -378,7 +378,7 @@ output_gutter (struct frame *f, enum gutter_pos pos, int force)
   w->gutter_extent_modiff [pos] = 0;
 }
 
-/* Sizing gutters is a pain so we try and help the user by detemining
+/* Sizing gutters is a pain so we try and help the user by determining
    what height will accommodate all lines. This is useless on left and
    right gutters as we always have a maximal number of lines. */
 static Lisp_Object
@@ -472,7 +472,7 @@ mark_gutters (struct frame* f)
 
 /* This is called by extent_changed_for_redisplay, so that redisplay
    knows exactly what extents have changed. */
-void 
+void
 gutter_extent_signal_changed_region_maybe (Lisp_Object obj,
                                           Bufpos start, Bufpos end)
 {
@@ -487,7 +487,7 @@ gutter_extent_signal_changed_region_maybe (Lisp_Object obj,
       enum gutter_pos pos;
       Lisp_Object window = FRAME_LAST_NONMINIBUF_WINDOW (f);
       struct window* w = XWINDOW (window);
-      
+
       GUTTER_POS_LOOP (pos)
        {
          if (EQ (WINDOW_GUTTER (w, pos), obj))
@@ -547,7 +547,7 @@ update_frame_gutters (struct frame *f)
       f->extents_changed)
     {
       enum gutter_pos pos;
-      
+
       /* We don't actually care about these when outputting the gutter
          so locally disable them. */
       int local_clip_changed = f->clip_changed;
@@ -686,7 +686,7 @@ See `default-gutter-position'.
                              list1 (Fcons (Qnil, Qzero)));
       set_specifier_fallback (Vgutter_border_width[new],
                              Vdefault_gutter_border_width);
-      /* We don't realy want the left and right gutters to default to
+      /* We don't really want the left and right gutters to default to
          visible. */
       set_specifier_fallback (Vgutter_visible_p[cur],
                              cur == TOP_GUTTER || cur == BOTTOM_GUTTER ?
@@ -700,7 +700,7 @@ See `default-gutter-position'.
     }
 
   run_hook (Qdefault_gutter_position_changed_hook);
-  
+
   return position;
 }
 
@@ -769,7 +769,7 @@ gutter_validate (Lisp_Object instantiator)
 {
   if (NILP (instantiator))
     return;
-  
+
   /* Must be a string or a plist. */
   if (!STRINGP (instantiator) && NILP (Fvalid_plist_p (instantiator)))
       signal_simple_error ("Gutter spec must be string, plist or nil", instantiator);
@@ -777,7 +777,7 @@ gutter_validate (Lisp_Object instantiator)
   if (!STRINGP (instantiator))
     {
       Lisp_Object rest;
-      
+
       for (rest = instantiator; !NILP (rest); rest = XCDR (XCDR (rest)))
        {
          if (!SYMBOLP (XCAR (rest))
@@ -816,7 +816,7 @@ gutter_specs_changed (Lisp_Object specifier, struct window *w,
 {
   w->real_gutter[pos] = construct_window_gutter_spec (w, pos);
   w->real_gutter_size[pos] = w->gutter_size[pos];
-  
+
   if (EQ (w->real_gutter_size[pos], Qautodetect)
       && !NILP (w->gutter_visible_p[pos]))
     {
@@ -877,7 +877,7 @@ gutter_geometry_changed_in_window (Lisp_Object specifier, struct window *w,
          w->real_gutter_size [pos] = calculate_gutter_size (w, pos);
        }
     }
-  
+
   MARK_GUTTER_CHANGED;
   MARK_MODELINE_CHANGED;
   MARK_WINDOWS_CHANGED (w);
@@ -946,7 +946,7 @@ gutter_visible_validate (Lisp_Object instantiator)
     return;
 
   if (!NILP (instantiator) && !EQ (instantiator, Qt) && !CONSP (instantiator))
-    signal_simple_error ("Gutter visibility must be a boolean or list of symbols", 
+    signal_simple_error ("Gutter visibility must be a boolean or list of symbols",
                         instantiator);
 
   if (CONSP (instantiator))
@@ -956,7 +956,7 @@ gutter_visible_validate (Lisp_Object instantiator)
       EXTERNAL_LIST_LOOP (rest, instantiator)
        {
          if (!SYMBOLP (XCAR (rest)))
-             signal_simple_error ("Gutter visibility must be a boolean or list of symbols", 
+             signal_simple_error ("Gutter visibility must be a boolean or list of symbols",
                                   instantiator);
        }
     }
@@ -994,7 +994,7 @@ Ensure that all gutters are correctly showing their gutter specifier.
          /* Sequence is quite important here. We not only want to
           redisplay the gutter area but we also want to flush any
           frame size changes out so that the gutter redisplay happens
-          in a kosha environment. 
+          in a kosha environment.
 
           This is not only so that things look right but so that
           glyph redisplay optimization kicks in, by default display
@@ -1019,7 +1019,7 @@ Ensure that all gutters are correctly showing their gutter specifier.
 
          MAYBE_DEVMETH (d, frame_output_end, (f));
       }
-      
+
       d->gutter_changed = 0;
     }
 
@@ -1346,7 +1346,7 @@ See `default-gutter-height' for more information.
 #endif
 #ifdef HAVE_MS_WINDOWS
   fb = Fcons (Fcons (list1 (Qmsprinter), Qzero), fb);
-  fb = Fcons (Fcons (list1 (Qmswindows), 
+  fb = Fcons (Fcons (list1 (Qmswindows),
                     make_int (DEFAULT_GUTTER_WIDTH)), fb);
 #endif
   if (!NILP (fb))
index 916b94f..d3824d2 100644 (file)
@@ -85,6 +85,10 @@ Boston, MA 02111-1307, USA.  */
 #include "gui-x.h"
 #endif
 
+#ifdef HAVE_MS_WINDOWS
+#include "console-msw.h"
+#endif
+
 #ifdef FILE_CODING
 #include "file-coding.h"
 #endif
index c522ff2..b0068fd 100644 (file)
@@ -126,6 +126,10 @@ static Boolean xim_initted = False;
 
 static XIMStyle best_style (XIMStyles *user, XIMStyles *xim);
 
+/* #### it appears this prototype is missing from the X11R6.4 includes,
+   at least the XFree86 version ... */
+char * XSetIMValues(XIM, ...);
+
 void
 Initialize_Locale (void)
 {
@@ -246,7 +250,11 @@ XIM_init_device (struct device *d)
 #ifdef THIS_IS_X11R6
   DEVICE_X_XIM (d) = NULL;
   XRegisterIMInstantiateCallback (DEVICE_X_DISPLAY (d), NULL, NULL, NULL,
-                                 IMInstantiateCallback, (XPointer) d);
+                                 IMInstantiateCallback,
+                                 /* The sixth parameter is of type
+                                    XPointer in XFree86 but (XPointer *)
+                                    on most other X11's. */
+                                 (void *) d);
   return;
 #else
   Display *dpy = DEVICE_X_DISPLAY (d);
index 8600bf8..520507a 100644 (file)
@@ -1194,6 +1194,7 @@ bytind_to_bufpos (struct buffer *buf, Bytind x)
 Bufpos
 get_buffer_pos_char (struct buffer *b, Lisp_Object pos, unsigned int flags)
 {
+  /* Does not GC */
   Bufpos ind;
   Bufpos min_allowed, max_allowed;
 
@@ -1243,6 +1244,7 @@ void
 get_buffer_range_char (struct buffer *b, Lisp_Object from, Lisp_Object to,
                       Bufpos *from_out, Bufpos *to_out, unsigned int flags)
 {
+  /* Does not GC */
   Bufpos min_allowed, max_allowed;
 
   min_allowed = (flags & GB_ALLOW_PAST_ACCESSIBLE) ?
index afa9c08..9cae3ab 100644 (file)
@@ -463,8 +463,11 @@ keymap_lookup_directly (Lisp_Object keymap,
 {
   Lisp_Keymap *k;
 
-  if ((modifiers & ~(XEMACS_MOD_CONTROL | XEMACS_MOD_META | XEMACS_MOD_SUPER | XEMACS_MOD_HYPER
-                     | XEMACS_MOD_ALT | XEMACS_MOD_SHIFT)) != 0)
+  modifiers &= ~(XEMACS_MOD_BUTTON1 | XEMACS_MOD_BUTTON2 | XEMACS_MOD_BUTTON3
+                | XEMACS_MOD_BUTTON4 | XEMACS_MOD_BUTTON5);
+  if ((modifiers & ~(XEMACS_MOD_CONTROL | XEMACS_MOD_META | XEMACS_MOD_SUPER
+                    | XEMACS_MOD_HYPER | XEMACS_MOD_ALT | XEMACS_MOD_SHIFT))
+      != 0)
     abort ();
 
   k = XKEYMAP (keymap);
@@ -641,6 +644,8 @@ keymap_store (Lisp_Object keymap, const struct key_data *key,
   int modifiers = key->modifiers;
   Lisp_Keymap *k = XKEYMAP (keymap);
 
+  modifiers &= ~(XEMACS_MOD_BUTTON1 | XEMACS_MOD_BUTTON2 | XEMACS_MOD_BUTTON3
+                | XEMACS_MOD_BUTTON4 | XEMACS_MOD_BUTTON5);
   assert ((modifiers & ~(XEMACS_MOD_CONTROL | XEMACS_MOD_META
                         | XEMACS_MOD_SUPER | XEMACS_MOD_HYPER
                         | XEMACS_MOD_ALT | XEMACS_MOD_SHIFT)) == 0);
@@ -1702,7 +1707,10 @@ ensure_meta_prefix_char_keymapp (Lisp_Object keys, int indx,
        XVECTOR_DATA (new_keys) [i] = XVECTOR_DATA (keys) [i];
     }
   else
-    abort ();
+    {
+      new_keys = Qnil;
+      abort ();
+    }
 
   if (EQ (keys, new_keys))
     error_with_frob (mpc_binding,
@@ -4123,12 +4131,18 @@ describe_map (Lisp_Object keymap, Lisp_Object elt_prefix,
          if (!NILP (elt_prefix))
            buffer_insert_lisp_string (buf, elt_prefix);
 
-         if (modifiers & XEMACS_MOD_META)    buffer_insert_c_string (buf, "M-");
-         if (modifiers & XEMACS_MOD_CONTROL) buffer_insert_c_string (buf, "C-");
-         if (modifiers & XEMACS_MOD_SUPER)   buffer_insert_c_string (buf, "S-");
-         if (modifiers & XEMACS_MOD_HYPER)   buffer_insert_c_string (buf, "H-");
-         if (modifiers & XEMACS_MOD_ALT)     buffer_insert_c_string (buf, "Alt-");
-         if (modifiers & XEMACS_MOD_SHIFT)   buffer_insert_c_string (buf, "Sh-");
+         if (modifiers & XEMACS_MOD_META)
+           buffer_insert_c_string (buf, "M-");
+         if (modifiers & XEMACS_MOD_CONTROL)
+           buffer_insert_c_string (buf, "C-");
+         if (modifiers & XEMACS_MOD_SUPER)
+           buffer_insert_c_string (buf, "S-");
+         if (modifiers & XEMACS_MOD_HYPER)
+           buffer_insert_c_string (buf, "H-");
+         if (modifiers & XEMACS_MOD_ALT)
+           buffer_insert_c_string (buf, "Alt-");
+         if (modifiers & XEMACS_MOD_SHIFT)
+           buffer_insert_c_string (buf, "Sh-");
          if (SYMBOLP (keysym))
            {
              Lisp_Object code = Fget (keysym, Vcharacter_set_property, Qnil);
index 31ff44d..fc3b54e 100644 (file)
@@ -39,6 +39,7 @@ EXFUN (Fmake_keymap, 1);
 EXFUN (Fwhere_is_internal, 5);
 
 extern Lisp_Object Qalt, Qcontrol, Qhyper, Qmeta, Qshift, Qsuper;
+extern Lisp_Object Qbutton1, Qbutton2, Qbutton3, Qbutton4, Qbutton5;
 extern Lisp_Object Vmeta_prefix_char;
 
 Lisp_Object get_keymap (Lisp_Object object, int errorp, int autoload);
index b0ce90f..e9a18dc 100644 (file)
@@ -98,7 +98,7 @@ allocate_line_number_cache (struct buffer *b)
 }
 
 /* Flag LINE_NUMBER_BEGV (b) as dirty.  Do it only if the line number
-   cache is already initialized.  */ 
+   cache is already initialized.  */
 void
 narrow_line_number_cache (struct buffer *b)
 {
index 39a96d8..4c8c69e 100644 (file)
@@ -76,7 +76,7 @@ Boston, MA 02111-1307, USA.  */
 typedef EMACS_INT Lisp_Object;
 
 #define Lisp_Type_Int_Bit (Lisp_Type_Int_Even & Lisp_Type_Int_Odd)
-#define make_obj(vartype, x) ((Lisp_Object) (x))
+#define wrap_object(ptr) ((Lisp_Object) (ptr))
 #define make_int(x) ((Lisp_Object) (((x) << INT_GCBITS) | Lisp_Type_Int_Bit))
 #define make_char(x) ((Lisp_Object) (((x) << GCBITS) | Lisp_Type_Char))
 #define VALMASK (((1UL << VALBITS) - 1UL) << GCTYPEBITS)
@@ -94,9 +94,9 @@ typedef EMACS_INT Lisp_Object;
 #define Qzero make_int (0)
 #define Qnull_pointer ((Lisp_Object) 0)
 #define EQ(x,y) ((x) == (y))
-#define XSETINT(var,  value) ((void) ((var) = make_int (value)))
+#define XSETINT(var, value) ((void) ((var) = make_int (value)))
 #define XSETCHAR(var, value) ((void) ((var) = make_char (value)))
-#define XSETOBJ(var, vartype, value) ((void) ((var) = make_obj (vartype, value)))
+#define XSETOBJ(var, value) ((void) ((var) = wrap_object (value)))
 
 /* Convert between a (void *) and a Lisp_Object, as when the
    Lisp_Object is passed to a toolkit callback function */
index 70ef72c..e853668 100644 (file)
@@ -94,7 +94,7 @@ Lisp_Object;
   xset_var->gu.type = Lisp_Type_Char;  \
   xset_var->gu.val = xset_value;       \
 } while (0)
-# define XSETOBJ(var, vartype, value) do {     \
+# define XSETOBJ(var, value) do {              \
   EMACS_UINT xset_value = (EMACS_UINT) (value);        \
   (var).ui = xset_value;                       \
 } while (0)
@@ -105,7 +105,7 @@ INLINE_HEADER Lisp_Object
 make_int (EMACS_INT val)
 {
   Lisp_Object obj;
-  XSETINT(obj, val);
+  XSETINT (obj, val);
   return obj;
 }
 
@@ -114,7 +114,16 @@ INLINE_HEADER Lisp_Object
 make_char (Emchar val)
 {
   Lisp_Object obj;
-  XSETCHAR(obj, val);
+  XSETCHAR (obj, val);
+  return obj;
+}
+
+INLINE_HEADER Lisp_Object wrap_object (void *ptr);
+INLINE_HEADER Lisp_Object
+wrap_object (void *ptr)
+{
+  Lisp_Object obj;
+  XSETOBJ (obj, ptr);
   return obj;
 }
 
index 75dd14d..7d4b7fc 100644 (file)
@@ -1,7 +1,7 @@
 /* Fundamental definitions for XEmacs Lisp interpreter.
    Copyright (C) 1985-1987, 1992-1995 Free Software Foundation, Inc.
    Copyright (C) 1993-1996 Richard Mlynarik.
-   Copyright (C) 1995, 1996 Ben Wing.
+   Copyright (C) 1995, 1996, 2000 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -29,6 +29,8 @@ Boston, MA 02111-1307, USA.  */
 /*                       general definitions                           */
 /************************************************************************/
 
+/* ------------------------ include files ------------------- */
+
 /* We include the following generally useful header files so that you
    don't have to worry about prototypes when using the standard C
    library functions and macros.  These files shouldn't be excessively
@@ -43,7 +45,7 @@ Boston, MA 02111-1307, USA.  */
 #include <sys/types.h>
 #include <limits.h>
 
-/* ---- Dynamic arrays ---- */
+/* ------------------------ dynamic arrays ------------------- */
 
 #define Dynarr_declare(type)   \
   type *base;                  \
@@ -96,8 +98,6 @@ struct overhead_stats;
 size_t Dynarr_memory_usage (void *d, struct overhead_stats *stats);
 #endif
 
-#include "symsinit.h"          /* compiler warning suppression */
-
 /* Also define min() and max(). (Some compilers put them in strange
    places that won't be referenced by the above include files, such
    as 'macros.h' under Solaris.) */
@@ -276,15 +276,56 @@ void assert_failed (const char *, int, const char *);
    maybe for simple structures like Dynarrs); that keeps them private
    to the routines that actually use them. */
 
+/* ------------------------------- */
+/*     basic char/int typedefs     */
+/* ------------------------------- */
+
+/* The definitions we put here use typedefs to convey additional meaning to
+   types that by themselves are pretty general.  Stuff pointed to by a
+   char * or unsigned char * will nearly always be one of four types:
+   a) pointer to internally-formatted text; b) pointer to text in some
+   external format, which can be defined as all formats other than the
+   internal one; c) pure ASCII text; d) binary data that is not meant to
+   be interpreted as text. [A fifth possible type "e) a general pointer
+   to memory" should be replaced with void *.] By using these more specific
+   types in lieu of the general ones, you clear up greatly the confusions
+   that inevitably will occur when it's not clearly known the semantics of
+   a char * argument being studied. */
+
+typedef unsigned char UChar;
+
 /* The data representing the text in a buffer is logically a set
    of Bufbytes, declared as follows. */
 
-typedef unsigned char Bufbyte;
+typedef UChar Bufbyte;
+
+/* Explicitly signed or unsigned versions: */
+typedef UChar UBufbyte;
+typedef char  SBufbyte;
+
+/* The data representing a string in "external" format (binary or any
+   external encoding) is logically a set of Extbytes, declared as follows. */
+
+typedef UChar Extbyte; /* #### I REALLY think this should be a char.  This
+                         is more logical and will fix enough char-UChar
+                         inconsistencies that maybe we'll be able to stop
+                         turning off those warnings. --ben */
+
+/* Explicitly signed or unsigned versions: */
+typedef UChar UExtbyte;
+typedef char  SExtbyte;
+
+/* A byte in a string in binary format: */
+
+typedef char Char_Binary;
+typedef UChar UChar_Binary;
 
-/* The data representing a string in "external" format (simple
-   binary format) is logically a set of Extbytes, declared as follows. */
+/* A byte in a string in entirely US-ASCII format: (Nothing outside
+ the range 00 - 7F) */
+
+typedef char Char_ASCII;
+typedef UChar UChar_ASCII;
 
-typedef unsigned char Extbyte;
 
 /* To the user, a buffer is made up of characters, declared as follows.
    In the non-Mule world, characters and Bufbytes are equivalent.
@@ -312,6 +353,10 @@ typedef EMACS_INT Charcount;
 /* Length in bytes of a string in external format */
 typedef EMACS_INT Extcount;
 
+/* ------------------------------- */
+/*     structure/other typedefs    */
+/* ------------------------------- */
+
 typedef struct lstream Lstream;
 
 typedef unsigned int face_index;
@@ -552,12 +597,12 @@ int eq_with_ebola_notice (Lisp_Object, Lisp_Object);
 
 \f
 /************************************************************************/
-/*                  Definitions of basic Lisp objects                  */
+/**                 Definitions of basic Lisp objects                 **/
 /************************************************************************/
 
 #include "lrecord.h"
 
-/*********** unbound ***********/
+/*------------------------------ unbound -------------------------------*/
 
 /* Qunbound is a special Lisp_Object (actually of type
    symbol-value-forward), that can never be visible to
@@ -566,7 +611,7 @@ int eq_with_ebola_notice (Lisp_Object, Lisp_Object);
 
 #define UNBOUNDP(val) EQ (val, Qunbound)
 
-/*********** cons ***********/
+/*------------------------------- cons ---------------------------------*/
 
 /* In a cons, the markbit of the car is the gc mark bit */
 
@@ -616,95 +661,112 @@ extern Lisp_Object Qnil;
     x = wrong_type_argument (Qlistp, x);       \
 } while (0)
 
-/* For a list that's known to be in valid list format --
-   will abort() if the list is not in valid format */
-#define LIST_LOOP(tail, list)          \
-  for (tail = list;                    \
-       !NILP (tail);                   \
-       tail = XCDR (tail))
+/*---------------------- list traversal macros -------------------------*/
 
-#define LIST_LOOP_2(elt, list)         \
-  Lisp_Object tail##elt;               \
-  LIST_LOOP_3(elt, list, tail##elt)
+/* Note: These macros are for traversing through a list in some format,
+   and executing code that you specify on each member of the list.
 
-#define LIST_LOOP_3(elt, list, tail)   \
-  for (tail = list;                    \
-       NILP (tail) ?                   \
-        0 : (elt = XCAR (tail), 1);    \
-       tail = XCDR (tail))
+   There are two kinds of macros, those requiring surrounding braces, and
+   those not requiring this.  Which type of macro will be indicated.
+   The general format for using a brace-requiring macro is
 
-#define GET_LIST_LENGTH(list, len) do {                \
-  Lisp_Object GLL_tail;                                \
-  for (GLL_tail = list, len = 0;               \
-       !NILP (GLL_tail);                       \
-       GLL_tail = XCDR (GLL_tail), ++len)      \
-    DO_NOTHING;                                        \
-} while (0)
+   {
+     LIST_LOOP_3 (elt, list, tail)
+       execute_code_here;
+   }
 
-#define GET_EXTERNAL_LIST_LENGTH(list, len)            \
-do {                                                   \
-  Lisp_Object GELL_elt, GELL_tail;                     \
-  EXTERNAL_LIST_LOOP_4 (GELL_elt, list, GELL_tail, len)        \
-    ;                                                  \
-} while (0)
+   or
 
-/* For a list that's known to be in valid list format, where we may
-   be deleting the current element out of the list --
-   will abort() if the list is not in valid format */
-#define LIST_LOOP_DELETING(consvar, nextconsvar, list)         \
-  for (consvar = list;                                         \
-       !NILP (consvar) ? (nextconsvar = XCDR (consvar), 1) :0; \
-       consvar = nextconsvar)
+   {
+     LIST_LOOP_3 (elt, list, tail)
+       {
+         execute_code_here;
+       }
+   }
 
-/* Delete all elements of external list LIST
-   satisfying CONDITION, an expression referring to variable ELT */
-#define EXTERNAL_LIST_LOOP_DELETE_IF(elt, list, condition) do {        \
-  Lisp_Object prev_tail_##list = Qnil;                         \
-  Lisp_Object tail_##list;                                     \
-  EMACS_INT len_##list;                                                \
-  EXTERNAL_LIST_LOOP_4 (elt, list, tail_##list, len_##list)    \
-    {                                                          \
-      if (condition)                                           \
-       {                                                       \
-         if (NILP (prev_tail_##list))                          \
-           list = XCDR (tail_##list);                          \
-         else                                                  \
-           XCDR (prev_tail_##list) = XCDR (tail_##list);       \
-          /* Keep tortoise from ever passing hare. */          \
-         len_##list = 0;                                       \
-       }                                                       \
-      else                                                     \
-       prev_tail_##list = tail_##list;                         \
-    }                                                          \
-} while (0)
+   You can put variable declarations between the brace and beginning of
+   macro, but NOTHING ELSE.
 
-/* Delete all elements of true non-circular list LIST
-   satisfying CONDITION, an expression referring to variable ELT */
-#define LIST_LOOP_DELETE_IF(elt, list, condition) do {         \
-  Lisp_Object prev_tail_##list = Qnil;                         \
-  Lisp_Object tail_##list;                                     \
-  LIST_LOOP_3 (elt, list, tail_##list)                         \
-    {                                                          \
-      if (condition)                                           \
-       {                                                       \
-         if (NILP (prev_tail_##list))                          \
-           list = XCDR (tail_##list);                          \
-         else                                                  \
-           XCDR (prev_tail_##list) = XCDR (tail_##list);       \
-       }                                                       \
-      else                                                     \
-       prev_tail_##list = tail_##list;                         \
-    }                                                          \
-} while (0)
+   The brace-requiring macros typically declare themselves any arguments
+   that are initialized and iterated by the macros.  If for some reason
+   you need to declare these arguments yourself (e.g. to do something on
+   them before the iteration starts, use the _NO_DECLARE versions of the
+   macros.)
+*/
+
+/* There are two basic kinds of macros: those that handle "internal" lists
+   that are known to be correctly structured (i.e. first element is a cons
+   or nil, and the car of each cons is also a cons or nil, and there are
+   no circularities), and those that handle "external" lists, where the
+   list may have any sort of invalid formation.  This is reflected in
+   the names: those with "EXTERNAL_" work with external lists, and those
+   without this prefix work with internal lists.  The internal-list
+   macros will hit an assertion failure if the structure is ill-formed;
+   the external-list macros will signal an error in this case, either a
+   malformed-list error or a circular-list error.
+
+   Note also that the simplest external list iterator, EXTERNAL_LIST_LOOP,
+   does *NOT* check for circularities.  Therefore, make sure you call
+   QUIT each iteration or so.  However, it's probably easier just to use
+   EXTERNAL_LIST_LOOP_2, which is easier to use in any case.
+*/
+
+/* LIST_LOOP and EXTERNAL_LIST_LOOP are the simplest macros.  They don't
+   require brace surrounding, and iterate through a list, which may or may
+   not known to be syntactically correct.  EXTERNAL_LIST_LOOP is for those
+   not known to be correct, and it detects and signals a malformed list
+   error when encountering a problem.  Circularities, however, are not
+   handled, and cause looping forever, so make sure to include a QUIT.
+   These functions also accept two args, TAIL (set progressively to each
+   cons starting with the first), and LIST, the list to iterate over.
+   TAIL needs to be defined by the program.
+
+   In each iteration, you can retrieve the current list item using XCAR
+   (tail), or destructively modify the list using XSETCAR (tail,
+   ...). */
+
+#define LIST_LOOP(tail, list)          \
+  for (tail = list;                    \
+       !NILP (tail);                   \
+       tail = XCDR (tail))
 
-/* For a list that may not be in valid list format --
-   will signal an error if the list is not in valid format */
 #define EXTERNAL_LIST_LOOP(tail, list)                 \
   for (tail = list; !NILP (tail); tail = XCDR (tail))  \
      if (!CONSP (tail))                                        \
        signal_malformed_list_error (list);             \
      else
 
+/* The following macros are the "core" macros for list traversal.
+
+   *** ALL OF THESE MACROS MUST BE DECLARED INSIDE BRACES -- SEE ABOVE. ***
+
+   LIST_LOOP_2 and EXTERNAL_LIST_LOOP_2 are the standard, most-often used
+   macros.  They take two arguments, an element variable ELT and the list
+   LIST.  ELT is automatically declared, and set to each element in turn
+   from LIST.
+
+   LIST_LOOP_3 and EXTERNAL_LIST_LOOP_3 are the same, but they have a third
+   argument TAIL, another automatically-declared variable.  At each iteration,
+   this one points to the cons cell for which ELT is the car.
+
+   EXTERNAL_LIST_LOOP_4 is like EXTERNAL_LIST_LOOP_3 but takes an additional
+   LEN argument, again automatically declared, which counts the number of
+   iterations gone by.  It is 0 during the first iteration.
+
+   EXTERNAL_LIST_LOOP_4_NO_DECLARE is like EXTERNAL_LIST_LOOP_4 but none
+   of the variables are automatically declared, and so you need to declare
+   them yourself. (ELT and TAIL are Lisp_Objects, and LEN is an EMACS_INT.)
+*/
+
+#define LIST_LOOP_2(elt, list)         \
+  LIST_LOOP_3(elt, list, unused_tail_##elt)
+
+#define LIST_LOOP_3(elt, list, tail)   \
+  Lisp_Object elt, tail;               \
+  for (tail = list;                    \
+       NILP (tail) ?                   \
+        0 : (elt = XCAR (tail), 1);    \
+       tail = XCDR (tail))
 
 /* The following macros are for traversing lisp lists.
    Signal an error if LIST is not properly acyclic and nil-terminated.
@@ -719,28 +781,34 @@ do {                                                      \
 #define EXTERNAL_LIST_LOOP_1(list)                                     \
 Lisp_Object ELL1_elt, ELL1_hare, ELL1_tortoise;                                \
 EMACS_INT ELL1_len;                                                    \
-EXTERNAL_LIST_LOOP_6 (ELL1_elt, list, ELL1_len, ELL1_hare,             \
+PRIVATE_EXTERNAL_LIST_LOOP_6 (ELL1_elt, list, ELL1_len, ELL1_hare,     \
                      ELL1_tortoise, CIRCULAR_LIST_SUSPICION_LENGTH)
 
 #define EXTERNAL_LIST_LOOP_2(elt, list)                                        \
-Lisp_Object hare_##elt, tortoise_##elt;                                        \
+Lisp_Object elt, hare_##elt, tortoise_##elt;                           \
 EMACS_INT len_##elt;                                                   \
-EXTERNAL_LIST_LOOP_6 (elt, list, len_##elt, hare_##elt,                        \
+PRIVATE_EXTERNAL_LIST_LOOP_6 (elt, list, len_##elt, hare_##elt,                \
                      tortoise_##elt, CIRCULAR_LIST_SUSPICION_LENGTH)
 
 #define EXTERNAL_LIST_LOOP_3(elt, list, tail)                          \
-Lisp_Object tortoise_##elt;                                            \
+Lisp_Object elt, tail, tortoise_##elt;                                 \
 EMACS_INT len_##elt;                                                   \
-EXTERNAL_LIST_LOOP_6 (elt, list, len_##elt, tail,                      \
+PRIVATE_EXTERNAL_LIST_LOOP_6 (elt, list, len_##elt, tail,              \
                      tortoise_##elt, CIRCULAR_LIST_SUSPICION_LENGTH)
 
-#define EXTERNAL_LIST_LOOP_4(elt, list, tail, len)                     \
+#define EXTERNAL_LIST_LOOP_4_NO_DECLARE(elt, list, tail, len)          \
 Lisp_Object tortoise_##elt;                                            \
-EXTERNAL_LIST_LOOP_6 (elt, list, len, tail,                            \
+PRIVATE_EXTERNAL_LIST_LOOP_6 (elt, list, len, tail,                    \
+                     tortoise_##elt, CIRCULAR_LIST_SUSPICION_LENGTH)
+
+#define EXTERNAL_LIST_LOOP_4(elt, list, tail, len)                     \
+Lisp_Object elt, tail, tortoise_##elt;                                 \
+EMACS_INT len;                                                         \
+PRIVATE_EXTERNAL_LIST_LOOP_6 (elt, list, len, tail,                    \
                      tortoise_##elt, CIRCULAR_LIST_SUSPICION_LENGTH)
 
 
-#define EXTERNAL_LIST_LOOP_6(elt, list, len, hare,             \
+#define PRIVATE_EXTERNAL_LIST_LOOP_6(elt, list, len, hare,     \
                              tortoise, suspicion_length)       \
   for (tortoise = hare = list, len = 0;                                \
                                                                \
@@ -759,37 +827,171 @@ EXTERNAL_LIST_LOOP_6 (elt, list, len, tail,                              \
            ((void) signal_circular_list_error (list)) :        \
            ((void) 0)))))
 
+/* GET_LIST_LENGTH and GET_EXTERNAL_LIST_LENGTH:
+
+   These two macros return the length of LIST (either an internal or external
+   list, according to which macro is used), stored into LEN (which must
+   be declared by the caller).  Circularities are trapped in external lists
+   (and cause errors).  Neither macro need be declared inside brackets. */
+
+#define GET_LIST_LENGTH(list, len) do {                \
+  Lisp_Object GLL_tail;                                \
+  for (GLL_tail = list, len = 0;               \
+       !NILP (GLL_tail);                       \
+       GLL_tail = XCDR (GLL_tail), ++len)      \
+    DO_NOTHING;                                        \
+} while (0)
+
+#define GET_EXTERNAL_LIST_LENGTH(list, len)                            \
+do {                                                                   \
+  Lisp_Object GELL_elt, GELL_tail;                                     \
+  EXTERNAL_LIST_LOOP_4_NO_DECLARE (GELL_elt, list, GELL_tail, len)     \
+    ;                                                                  \
+} while (0)
+
+/* For a list that's known to be in valid list format, where we may
+   be deleting the current element out of the list --
+   will abort() if the list is not in valid format */
+#define LIST_LOOP_DELETING(consvar, nextconsvar, list)         \
+  for (consvar = list;                                         \
+       !NILP (consvar) ? (nextconsvar = XCDR (consvar), 1) :0; \
+       consvar = nextconsvar)
+
+/* LIST_LOOP_DELETE_IF and EXTERNAL_LIST_LOOP_DELETE_IF:
 
+   These two macros delete all elements of LIST (either an internal or
+   external list, according to which macro is used) satisfying
+   CONDITION, a C expression referring to variable ELT.  ELT is
+   automatically declared.  Circularities are trapped in external
+   lists (and cause errors).  Neither macro need be declared inside
+   brackets. */
+
+#define LIST_LOOP_DELETE_IF(elt, list, condition) do {         \
+  /* Do not use ##list when creating new variables because     \
+     that may not be just a variable name. */                  \
+  Lisp_Object prev_tail_##elt = Qnil;                          \
+  LIST_LOOP_3 (elt, list, tail_##elt)                          \
+    {                                                          \
+      if (condition)                                           \
+       {                                                       \
+         if (NILP (prev_tail_##elt))                           \
+           list = XCDR (tail_##elt);                           \
+         else                                                  \
+           XCDR (prev_tail_##elt) = XCDR (tail_##elt); \
+       }                                                       \
+      else                                                     \
+       prev_tail_##elt = tail_##elt;                           \
+    }                                                          \
+} while (0)
+
+#define EXTERNAL_LIST_LOOP_DELETE_IF(elt, list, condition) do {        \
+  Lisp_Object prev_tail_##elt = Qnil;                          \
+  EXTERNAL_LIST_LOOP_4 (elt, list, tail_##elt, len_##elt)      \
+    {                                                          \
+      if (condition)                                           \
+       {                                                       \
+         if (NILP (prev_tail_##elt))                           \
+           list = XCDR (tail_##elt);                           \
+         else                                                  \
+           XCDR (prev_tail_##elt) = XCDR (tail_##elt);         \
+          /* Keep tortoise from ever passing hare. */          \
+         len_##elt = 0;                                        \
+       }                                                       \
+      else                                                     \
+       prev_tail_##elt = tail_##elt;                           \
+    }                                                          \
+} while (0)
+
+
+/* Macros for looping over external alists.
+
+   *** ALL OF THESE MACROS MUST BE DECLARED INSIDE BRACES -- SEE ABOVE. ***
+
+   EXTERNAL_ALIST_LOOP_4 is similar to EXTERNAL_LIST_LOOP_2, but it
+   assumes the elements are aconses (the elements in an alist) and
+   sets two additional argument variables ELT_CAR and ELT_CDR to the
+   car and cdr of the acons.  All of the variables ELT, ELT_CAR and
+   ELT_CDR are automatically declared.
+
+   EXTERNAL_ALIST_LOOP_5 adds a TAIL argument to EXTERNAL_ALIST_LOOP_4,
+   just like EXTERNAL_LIST_LOOP_3 does, and again TAIL is automatically
+   declared.
+
+   EXTERNAL_ALIST_LOOP_6 adds a LEN argument to EXTERNAL_ALIST_LOOP_5,
+   just like EXTERNAL_LIST_LOOP_4 does, and again LEN is automatically
+   declared.
+
+   EXTERNAL_ALIST_LOOP_6_NO_DECLARE does not declare any of its arguments,
+   just like EXTERNAL_LIST_LOOP_4_NO_DECLARE, and so these must be declared
+   manually.
+ */
 
 /* Optimized and safe macros for looping over external alists. */
 #define EXTERNAL_ALIST_LOOP_4(elt, elt_car, elt_cdr, list)     \
+Lisp_Object elt, elt_car, elt_cdr;                             \
 Lisp_Object hare_##elt, tortoise_##elt;                                \
 EMACS_INT len_##elt;                                           \
-EXTERNAL_ALIST_LOOP_8 (elt, elt_car, elt_cdr, list,            \
+PRIVATE_EXTERNAL_ALIST_LOOP_8 (elt, elt_car, elt_cdr, list,    \
                       len_##elt, hare_##elt, tortoise_##elt,   \
                       CIRCULAR_LIST_SUSPICION_LENGTH)
 
 #define EXTERNAL_ALIST_LOOP_5(elt, elt_car, elt_cdr, list, tail)       \
+Lisp_Object elt, elt_car, elt_cdr, tail;                               \
 Lisp_Object tortoise_##elt;                                            \
 EMACS_INT len_##elt;                                                   \
-EXTERNAL_ALIST_LOOP_8 (elt, elt_car, elt_cdr, list,                    \
+PRIVATE_EXTERNAL_ALIST_LOOP_8 (elt, elt_car, elt_cdr, list,            \
                       len_##elt, tail, tortoise_##elt,                 \
                       CIRCULAR_LIST_SUSPICION_LENGTH)                  \
 
 #define EXTERNAL_ALIST_LOOP_6(elt, elt_car, elt_cdr, list, tail, len)  \
+Lisp_Object elt, elt_car, elt_cdr, tail;                               \
+EMACS_INT len;                                                         \
 Lisp_Object tortoise_##elt;                                            \
-EXTERNAL_ALIST_LOOP_8 (elt, elt_car, elt_cdr, list,                    \
+PRIVATE_EXTERNAL_ALIST_LOOP_8 (elt, elt_car, elt_cdr, list,            \
                       len, tail, tortoise_##elt,                       \
                       CIRCULAR_LIST_SUSPICION_LENGTH)
 
+#define EXTERNAL_ALIST_LOOP_6_NO_DECLARE(elt, elt_car, elt_cdr, list,  \
+                                        tail, len)                     \
+Lisp_Object tortoise_##elt;                                            \
+PRIVATE_EXTERNAL_ALIST_LOOP_8 (elt, elt_car, elt_cdr, list,            \
+                      len, tail, tortoise_##elt,                       \
+                      CIRCULAR_LIST_SUSPICION_LENGTH)
 
-#define EXTERNAL_ALIST_LOOP_8(elt, elt_car, elt_cdr, list, len, hare,  \
-                             tortoise, suspicion_length)               \
-EXTERNAL_LIST_LOOP_6 (elt, list, len, hare, tortoise, suspicion_length)        \
+
+#define PRIVATE_EXTERNAL_ALIST_LOOP_8(elt, elt_car, elt_cdr, list, len, \
+                                     hare, tortoise, suspicion_length) \
+PRIVATE_EXTERNAL_LIST_LOOP_6 (elt, list, len, hare, tortoise,          \
+                             suspicion_length)                         \
   if (CONSP (elt) ? (elt_car = XCAR (elt), elt_cdr = XCDR (elt), 0) :1)        \
     continue;                                                          \
   else
 
+/* Macros for looping over external property lists.
+
+   *** ALL OF THESE MACROS MUST BE DECLARED INSIDE BRACES -- SEE ABOVE. ***
+
+   EXTERNAL_PROPERTY_LIST_LOOP_3 maps over an external list assumed to
+   be a property list, consisting of alternating pairs of keys
+   (typically symbols or keywords) and values.  Each iteration
+   processes one such pair out of LIST, assigning the two elements to
+   KEY and VALUE respectively.  Malformed lists and circularities are
+   trapped as usual, and in addition, property lists with an odd number
+   of elements also signal an error.
+
+   EXTERNAL_PROPERTY_LIST_LOOP_4 adds a TAIL argument to
+   EXTERNAL_PROPERTY_LIST_LOOP_3, just like EXTERNAL_LIST_LOOP_3 does,
+   and again TAIL is automatically declared.
+
+   EXTERNAL_PROPERTY_LIST_LOOP_5 adds a LEN argument to
+   EXTERNAL_PROPERTY_LIST_LOOP_4, just like EXTERNAL_LIST_LOOP_4 does,
+   and again LEN is automatically declared.  Note that in this case,
+   LEN counts the iterations, NOT the total number of list elements
+   processed, which is 2 * LEN.
+
+   EXTERNAL_PROPERTY_LIST_LOOP_5_NO_DECLARE does not declare any of its
+   arguments, just like EXTERNAL_LIST_LOOP_4_NO_DECLARE, and so these
+   must be declared manually.  */
 
 /* Optimized and safe macros for looping over external property lists. */
 #define EXTERNAL_PROPERTY_LIST_LOOP_3(key, value, list)                        \
@@ -810,6 +1012,12 @@ EMACS_INT len;                                                            \
 EXTERNAL_PROPERTY_LIST_LOOP_7 (key, value, list, len, tail,            \
                     tortoise_##key, CIRCULAR_LIST_SUSPICION_LENGTH)
 
+#define EXTERNAL_PROPERTY_LIST_LOOP_5_NO_DECLARE(key, value, list,     \
+                                                tail, len)             \
+Lisp_Object tortoise_##key;                                            \
+EXTERNAL_PROPERTY_LIST_LOOP_7 (key, value, list, len, tail,            \
+                    tortoise_##key, CIRCULAR_LIST_SUSPICION_LENGTH)
+
 
 #define EXTERNAL_PROPERTY_LIST_LOOP_7(key, value, list, len, hare,     \
                              tortoise, suspicion_length)               \
@@ -818,7 +1026,8 @@ EXTERNAL_PROPERTY_LIST_LOOP_7 (key, value, list, len, tail,                \
        ((CONSP (hare) &&                                               \
         (key = XCAR (hare),                                            \
          hare = XCDR (hare),                                           \
-         CONSP (hare))) ?                                              \
+         (CONSP (hare) ? 1 :                                           \
+          (signal_malformed_property_list_error (list), 0)))) ?        \
        (value = XCAR (hare), 1) :                                      \
        (NILP (hare) ? 0 :                                              \
         (signal_malformed_property_list_error (list), 0)));            \
@@ -905,7 +1114,7 @@ TRUE_LIST_P (Lisp_Object object)
     signal_malformed_list_error (CTL_list);            \
 } while (0)
 
-/*********** string ***********/
+/*------------------------------ string --------------------------------*/
 
 struct Lisp_String
 {
@@ -980,7 +1189,7 @@ void set_string_char (Lisp_String *s, Charcount i, Emchar c);
     offsetof (flexible_array_structtype, flexible_array_field[0])) *   \
    (flexible_array_length))
 
-/*********** vector ***********/
+/*------------------------------ vector --------------------------------*/
 
 struct Lisp_Vector
 {
@@ -1005,7 +1214,7 @@ DECLARE_LRECORD (vector, Lisp_Vector);
 #define vector_data(v) ((v)->contents)
 #define XVECTOR_DATA(s) vector_data (XVECTOR (s))
 
-/*********** bit vector ***********/
+/*---------------------------- bit vectors -----------------------------*/
 
 #if (LONGBITS < 16)
 #error What the hell?!
@@ -1075,8 +1284,7 @@ set_bit_vector_bit (Lisp_Bit_Vector *v, size_t n, int value)
 #define BIT_VECTOR_LONG_STORAGE(len) \
   (((len) + LONGBITS_POWER_OF_2 - 1) >> LONGBITS_LOG2)
 
-
-/*********** symbol ***********/
+/*------------------------------ symbol --------------------------------*/
 
 typedef struct Lisp_Symbol Lisp_Symbol;
 struct Lisp_Symbol
@@ -1110,7 +1318,7 @@ DECLARE_LRECORD (symbol, Lisp_Symbol);
 #define symbol_function(s) ((s)->function)
 #define symbol_plist(s) ((s)->plist)
 
-/*********** subr ***********/
+/*------------------------------- subr ---------------------------------*/
 
 typedef Lisp_Object (*lisp_fn_t) (void);
 
@@ -1138,7 +1346,8 @@ DECLARE_LRECORD (subr, Lisp_Subr);
   ((Lisp_Object (*) (EXFUN_##max_args)) (subr)->subr_fn)
 #define subr_name(subr) ((subr)->name)
 
-/*********** marker ***********/
+/*------------------------------ marker --------------------------------*/
+
 
 typedef struct Lisp_Marker Lisp_Marker;
 struct Lisp_Marker
@@ -1164,7 +1373,7 @@ DECLARE_LRECORD (marker, Lisp_Marker);
 #define marker_next(m) ((m)->next)
 #define marker_prev(m) ((m)->prev)
 
-/*********** char ***********/
+/*------------------------------- char ---------------------------------*/
 
 #define CHARP(x) (XTYPE (x) == Lisp_Type_Char)
 
@@ -1188,7 +1397,7 @@ XCHAR (Lisp_Object obj)
 #define CONCHECK_CHAR(x) CONCHECK_NONRECORD (x, Lisp_Type_Char, Qcharacterp)
 
 
-/*********** float ***********/
+/*------------------------------ float ---------------------------------*/
 
 #ifdef LISP_FLOAT_TYPE
 
@@ -1243,7 +1452,7 @@ DECLARE_LRECORD (float, Lisp_Float);
 
 #endif /* not LISP_FLOAT_TYPE */
 
-/*********** int ***********/
+/*-------------------------------- int ---------------------------------*/
 
 #define ZEROP(x) EQ (x, Qzero)
 
@@ -1325,7 +1534,7 @@ XCHAR_OR_INT (Lisp_Object obj)
 } while (0)
 
 
-/*********** readonly objects ***********/
+/*--------------------------- readonly objects -------------------------*/
 
 #define CHECK_C_WRITEABLE(obj)                                 \
   do { if (c_readonly (obj)) c_write_error (obj); } while (0)
@@ -1336,7 +1545,7 @@ XCHAR_OR_INT (Lisp_Object obj)
 #define C_READONLY(obj) (C_READONLY_RECORD_HEADER_P(XRECORD_LHEADER (obj)))
 #define LISP_READONLY(obj) (LISP_READONLY_RECORD_HEADER_P(XRECORD_LHEADER (obj)))
 
-/*********** structures ***********/
+/*----------------------------- structrures ----------------------------*/
 
 typedef struct structure_keyword_entry structure_keyword_entry;
 struct structure_keyword_entry
@@ -1377,7 +1586,7 @@ void define_structure_type_keyword (struct structure_type *st,
                                                     Lisp_Object value,
                                                     Error_behavior errb));
 
-/*********** weak lists ***********/
+/*---------------------------- weak lists ------------------------------*/
 
 enum weak_list_type
 {
@@ -1418,7 +1627,7 @@ Lisp_Object make_weak_list (enum weak_list_type type);
 int finish_marking_weak_lists (void);
 void prune_weak_lists (void);
 
-/*********** lcrecord lists ***********/
+/*-------------------------- lcrecord-list -----------------------------*/
 
 struct lcrecord_list
 {
@@ -1854,7 +2063,7 @@ void debug_ungcpro(char *, int, struct gcpro *);
 /* Another try to fix SunPro C compiler warnings */
 /* "end-of-loop code not reached" */
 /* "statement not reached */
-#ifdef __SUNPRO_C
+#if defined __SUNPRO_C || defined __USLC__
 #define RETURN_SANS_WARNINGS if (1) return
 #define RETURN_NOT_REACHED(value)
 #else
@@ -1988,6 +2197,26 @@ typedef long intptr_t;
 typedef unsigned long uintptr_t;
 #endif
 
+\f
+/************************************************************************/
+/*                              prototypes                              */
+/************************************************************************/
+
+/* NOTE: Prototypes should go HERE, not in various header files, unless
+   they specifically reference a type that's not defined in lisp.h.
+   (And even then, you might consider adding the type to lisp.h.)
+
+   The idea is that header files typically contain the innards of objects,
+   and we want to minimize the number of "dependencies" of one file on
+   the specifics of such objects.  Putting prototypes here minimizes the
+   number of header files that need to be included -- good for a number
+   of reasons. --ben */
+
+/*--------------- prototypes for various public c functions ------------*/
+
+/* Prototypes for all init/syms_of/vars_of initialization functions. */
+#include "symsinit.h"
+
 /* Defined in alloc.c */
 void release_breathing_space (void);
 Lisp_Object noseeum_cons (Lisp_Object, Lisp_Object);
@@ -2136,9 +2365,9 @@ DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS (fatal (const char *,
 int stderr_out (const char *, ...) PRINTF_ARGS (1, 2);
 int stdout_out (const char *, ...) PRINTF_ARGS (1, 2);
 SIGTYPE fatal_error_signal (int);
-Lisp_Object make_arg_list (int, char **);
-void make_argc_argv (Lisp_Object, int *, char ***);
-void free_argc_argv (char **);
+Lisp_Object make_arg_list (int, Extbyte **);
+void make_argc_argv (Lisp_Object, int *, Extbyte ***);
+void free_argc_argv (Extbyte **);
 Lisp_Object decode_env_path (const char *, const char *);
 Lisp_Object decode_path (const char *);
 /* Nonzero means don't do interactive redisplay and don't change tty modes */
@@ -2151,9 +2380,53 @@ extern int suppress_early_error_handler_backtrace;
 
 /* Defined in eval.c */
 DECLARE_DOESNT_RETURN (signal_error (Lisp_Object, Lisp_Object));
-void maybe_signal_error (Lisp_Object, Lisp_Object, Lisp_Object, Error_behavior);
+void maybe_signal_error (Lisp_Object, Lisp_Object, Lisp_Object,
+                        Error_behavior);
 Lisp_Object maybe_signal_continuable_error (Lisp_Object, Lisp_Object,
                                            Lisp_Object, Error_behavior);
+DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS (type_error (Lisp_Object,
+                                                             const char *,
+                                                             ...), 2, 3);
+void maybe_type_error (Lisp_Object, Lisp_Object, Error_behavior, const char *,
+                      ...) PRINTF_ARGS (4, 5);
+Lisp_Object continuable_type_error (Lisp_Object, const char *, ...)
+     PRINTF_ARGS (2, 3);
+Lisp_Object maybe_continuable_type_error (Lisp_Object, Lisp_Object,
+                                         Error_behavior,
+                                         const char *, ...)
+     PRINTF_ARGS (4, 5);
+DECLARE_DOESNT_RETURN (signal_type_error (Lisp_Object, const char *,
+                                         Lisp_Object));
+void maybe_signal_type_error (Lisp_Object, const char *, Lisp_Object,
+                             Lisp_Object, Error_behavior);
+Lisp_Object signal_type_continuable_error (Lisp_Object, const char *,
+                                          Lisp_Object);
+Lisp_Object maybe_signal_type_continuable_error (Lisp_Object, const char *,
+                                                Lisp_Object,
+                                                Lisp_Object, Error_behavior);
+DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS (type_error_with_frob
+                                                 (Lisp_Object, Lisp_Object,
+                                                  const char *,
+                                                  ...), 3, 4);
+void maybe_type_error_with_frob (Lisp_Object, Lisp_Object, Lisp_Object,
+                                Error_behavior,
+                                const char *, ...) PRINTF_ARGS (5, 6);
+Lisp_Object continuable_type_error_with_frob (Lisp_Object, Lisp_Object,
+                                             const char *,
+                                             ...) PRINTF_ARGS (3, 4);
+Lisp_Object maybe_continuable_type_error_with_frob
+(Lisp_Object, Lisp_Object, Lisp_Object, Error_behavior, const char *, ...)
+     PRINTF_ARGS (5, 6);
+DECLARE_DOESNT_RETURN (signal_type_error_2 (Lisp_Object, const char *,
+                                           Lisp_Object, Lisp_Object));
+void maybe_signal_type_error_2 (Lisp_Object, const char *, Lisp_Object,
+                               Lisp_Object, Lisp_Object, Error_behavior);
+Lisp_Object signal_type_continuable_error_2 (Lisp_Object, const char *,
+                                            Lisp_Object, Lisp_Object);
+Lisp_Object maybe_signal_type_continuable_error_2 (Lisp_Object, const char *,
+                                                  Lisp_Object, Lisp_Object,
+                                                  Lisp_Object,
+                                                  Error_behavior);
 DECLARE_DOESNT_RETURN_GCC_ATTRIBUTE_SYNTAX_SUCKS (error (const char *,
                                                           ...), 1, 2);
 void maybe_error (Lisp_Object, Error_behavior, const char *,
@@ -2190,6 +2463,25 @@ DECLARE_DOESNT_RETURN (signal_malformed_property_list_error (Lisp_Object));
 DECLARE_DOESNT_RETURN (signal_circular_list_error (Lisp_Object));
 DECLARE_DOESNT_RETURN (signal_circular_property_list_error (Lisp_Object));
 
+DECLARE_DOESNT_RETURN (syntax_error (const char *reason, Lisp_Object frob));
+DECLARE_DOESNT_RETURN (syntax_error_2 (const char *reason, Lisp_Object frob1,
+                                      Lisp_Object frob2));
+DECLARE_DOESNT_RETURN (invalid_argument (const char *reason,
+                                        Lisp_Object frob));
+DECLARE_DOESNT_RETURN (invalid_argument_2 (const char *reason,
+                                          Lisp_Object frob1,
+                                          Lisp_Object frob2));
+DECLARE_DOESNT_RETURN (invalid_operation (const char *reason,
+                                         Lisp_Object frob));
+DECLARE_DOESNT_RETURN (invalid_operation_2 (const char *reason,
+                                           Lisp_Object frob1,
+                                           Lisp_Object frob2));
+DECLARE_DOESNT_RETURN (invalid_change (const char *reason,
+                                      Lisp_Object frob));
+DECLARE_DOESNT_RETURN (invalid_change_2 (const char *reason,
+                                        Lisp_Object frob1,
+                                        Lisp_Object frob2));
+
 Lisp_Object signal_void_function_error (Lisp_Object);
 Lisp_Object signal_invalid_function_error (Lisp_Object);
 Lisp_Object signal_wrong_number_of_arguments_error (Lisp_Object, int);
@@ -2350,9 +2642,6 @@ Lisp_Object nconc2 (Lisp_Object, Lisp_Object);
 Lisp_Object bytecode_nconc2 (Lisp_Object *);
 void check_losing_bytecode (const char *, Lisp_Object);
 
-/* Defined in getloadavg.c */
-int getloadavg (double[], int);
-
 /* Defined in glyphs.c */
 Error_behavior decode_error_behavior_flag (Lisp_Object);
 Lisp_Object encode_error_behavior_flag (Error_behavior);
@@ -2549,8 +2838,9 @@ void memory_warnings (void *, void (*) (const char *));
 Lisp_Object save_window_excursion_unwind (Lisp_Object);
 Lisp_Object display_buffer (Lisp_Object, Lisp_Object, Lisp_Object);
 
-/* The following were machine generated 19980312 */
+/*--------------- prototypes for Lisp primitives in C ------------*/
 
+/* The following were machine generated 19980312 */
 
 EXFUN (Faccept_process_output, 3);
 EXFUN (Fadd1, 1);
@@ -2609,6 +2899,7 @@ EXFUN (Fdecode_shift_jis_char, 1);
 EXFUN (Fdefault_boundp, 1);
 EXFUN (Fdefault_value, 1);
 EXFUN (Fdefine_key, 3);
+EXFUN (Fdelete, 2);
 EXFUN (Fdelete_region, 3);
 EXFUN (Fdelete_process, 1);
 EXFUN (Fdelq, 2);
@@ -2682,6 +2973,7 @@ EXFUN (Fintern_soft, 2);
 EXFUN (Fkey_description, 1);
 EXFUN (Fkill_emacs, 1);
 EXFUN (Fkill_local_variable, 1);
+EXFUN (Flast, 2);
 EXFUN (Flax_plist_get, 3);
 EXFUN (Flax_plist_remprop, 2);
 EXFUN (Flength, 1);
@@ -2798,98 +3090,107 @@ EXFUN (Fverify_visited_file_modtime, 1);
 EXFUN (Fvertical_motion, 3);
 EXFUN (Fwiden, 1);
 
+/*--------------- prototypes for constant symbols  ------------*/
 
-extern Lisp_Object Q_style, Qabort, Qactually_requested;
+extern Lisp_Object Q_style;
 extern Lisp_Object Qactivate_menubar_hook;
-extern Lisp_Object Qafter, Qall, Qand, Qappend;
-extern Lisp_Object Qarith_error, Qarrayp, Qassoc, Qat, Qautodetect, Qautoload;
-extern Lisp_Object Qbackground, Qbackground_pixmap, Qbad_variable, Qbefore;
-extern Lisp_Object Qbeginning_of_buffer, Qbig5, Qbinary;
-extern Lisp_Object Qbitmap, Qbitp, Qblinking;
-extern Lisp_Object Qboolean, Qbottom, Qbottom_margin, Qbuffer;
-extern Lisp_Object Qbuffer_glyph_p, Qbuffer_live_p, Qbuffer_read_only, Qbutton;
-extern Lisp_Object Qbyte_code, Qcall_interactively, Qcancel, Qcategory;
+extern Lisp_Object Qarith_error;
+extern Lisp_Object Qarrayp, Qautoload;
+extern Lisp_Object Qbackground, Qbackground_pixmap;
+extern Lisp_Object Qbeginning_of_buffer, Qbig5;
+extern Lisp_Object Qbitp, Qblinking;
+extern Lisp_Object Qbuffer_glyph_p, Qbuffer_live_p, Qbuffer_read_only;
+extern Lisp_Object Qbyte_code, Qcall_interactively;
 extern Lisp_Object Qcategory_designator_p, Qcategory_table_value_p, Qccl, Qcdr;
-extern Lisp_Object Qchannel, Qchar, Qchar_or_string_p, Qcharacter, Qcharacterp;
-extern Lisp_Object Qchars, Qcharset_g0, Qcharset_g1, Qcharset_g2, Qcharset_g3;
-extern Lisp_Object Qcenter, Qcircular_list, Qcircular_property_list;
+extern Lisp_Object Qchar_or_string_p, Qcharacterp;
+extern Lisp_Object Qcharset_g0, Qcharset_g1, Qcharset_g2, Qcharset_g3;
+extern Lisp_Object Qcircular_list, Qcircular_property_list;
 extern Lisp_Object Qcoding_system_error;
-extern Lisp_Object Qcolor, Qcolor_pixmap_image_instance_p;
-extern Lisp_Object Qcolumns, Qcommand, Qcommandp, Qcompletion_ignore_case;
-extern Lisp_Object Qconsole, Qconsole_live_p, Qconst_specifier, Qcopies, Qcr;
-extern Lisp_Object Qcritical, Qcrlf, Qctext, Qcurrent_menubar, Qctext, Qcursor;
-extern Lisp_Object Qcyclic_variable_indirection, Qdata, Qdead, Qdecode;
-extern Lisp_Object Qdefault, Qdefun, Qdelete, Qdelq, Qdevice, Qdevice_live_p;
-extern Lisp_Object Qdialog;
-extern Lisp_Object Qdim, Qdimension, Qdisabled, Qdisplay, Qdisplay_table;
-extern Lisp_Object Qdoc_string, Qdomain_error, Qduplex, Qdynarr_overhead;
-extern Lisp_Object Qempty, Qencode, Qend_of_buffer, Qend_of_file, Qend_open;
-extern Lisp_Object Qeol_cr, Qeol_crlf, Qeol_lf, Qeol_type, Qeq, Qeql, Qequal;
+extern Lisp_Object Qcolor_pixmap_image_instance_p;
+extern Lisp_Object Qcommandp, Qcompletion_ignore_case;
+extern Lisp_Object Qconsole_live_p, Qconst_specifier, Qcr;
+extern Lisp_Object Qcrlf, Qcurrent_menubar, Qctext;
+extern Lisp_Object Qcyclic_variable_indirection, Qdecode;
+extern Lisp_Object Qdefun, Qdevice_live_p;
+extern Lisp_Object Qdim, Qdisabled, Qdisplay_table;
+extern Lisp_Object Qdomain_error;
+extern Lisp_Object Qediting_error;
+extern Lisp_Object Qencode, Qend_of_buffer, Qend_of_file, Qend_open;
+extern Lisp_Object Qeol_cr, Qeol_crlf, Qeol_lf, Qeol_type;
 extern Lisp_Object Qerror, Qerror_conditions, Qerror_message, Qescape_quoted;
-extern Lisp_Object Qeval, Qevent_live_p, Qexit, Qextent_live_p, Qextents;
-extern Lisp_Object Qexternal_debugging_output, Qface, Qfeaturep;
-extern Lisp_Object Qfile_name, Qfile_error;
-extern Lisp_Object Qfont, Qforce_g0_on_output, Qforce_g1_on_output;
+extern Lisp_Object Qevent_live_p, Qexit, Qextent_live_p;
+extern Lisp_Object Qexternal_debugging_output, Qfeaturep;
+extern Lisp_Object Qfile_error;
+extern Lisp_Object Qforce_g0_on_output, Qforce_g1_on_output;
 extern Lisp_Object Qforce_g2_on_output, Qforce_g3_on_output, Qforeground;
-extern Lisp_Object Qformat, Qframe, Qframe_live_p, Qfrom_page, Qfull_assoc;
-extern Lisp_Object Qfuncall, Qfunction;
-extern Lisp_Object Qgap_overhead, Qgeneric, Qgeometry, Qglobal, Qheight;
-extern Lisp_Object Qhelp, Qhighlight, Qhorizontal, Qicon;
-extern Lisp_Object Qicon_glyph_p, Qid, Qidentity, Qignore, Qimage, Qinfo;
-extern Lisp_Object Qinherit;
+extern Lisp_Object Qformat, Qframe_live_p;
+extern Lisp_Object Qicon_glyph_p, Qidentity;
 extern Lisp_Object Qinhibit_quit, Qinhibit_read_only;
-extern Lisp_Object Qinput_charset_conversion, Qinteger;
+extern Lisp_Object Qinput_charset_conversion;
 extern Lisp_Object Qinteger_char_or_marker_p, Qinteger_or_char_p;
-extern Lisp_Object Qinteger_or_marker_p, Qintegerp, Qinteractive, Qinternal;
-extern Lisp_Object Qinvalid_function, Qinvalid_read_syntax, Qio_error;
-extern Lisp_Object Qiso2022, Qkey, Qkey_assoc, Qkeyboard, Qkeymap;
-extern Lisp_Object Qlambda, Qlast_command, Qlayout, Qlandscape;
-extern Lisp_Object Qleft, Qleft_margin, Qlet, Qlf;
-extern Lisp_Object Qlist, Qlistp, Qload, Qlock_shift, Qmacro, Qmagic;
+extern Lisp_Object Qinteger_or_marker_p, Qintegerp, Qinteractive;
+extern Lisp_Object Qinternal_error, Qinvalid_argument;
+extern Lisp_Object Qinvalid_change, Qinvalid_function, Qinvalid_operation;
+extern Lisp_Object Qinvalid_read_syntax, Qinvalid_state;
+extern Lisp_Object Qio_error;
+extern Lisp_Object Qiso2022;
+extern Lisp_Object Qlambda, Qlayout;
+extern Lisp_Object Qlf;
+extern Lisp_Object Qlist_formation_error;
+extern Lisp_Object Qlistp, Qload, Qlock_shift, Qmacro;
 extern Lisp_Object Qmakunbound, Qmalformed_list, Qmalformed_property_list;
-extern Lisp_Object Qmalloc_overhead, Qmark, Qmarkers;
-extern Lisp_Object Qmenubar;
-extern Lisp_Object Qmax, Qmemory, Qmessage, Qminus, Qmnemonic, Qmodifiers;
-extern Lisp_Object Qmono_pixmap_image_instance_p, Qmotion;
-extern Lisp_Object Qmouse_leave_buffer_hook, Qmsprinter, Qmswindows;
-extern Lisp_Object Qname, Qnas, Qnatnump, Qnative_layout;
-extern Lisp_Object Qno, Qno_ascii_cntl, Qno_ascii_eol, Qno_catch;
-extern Lisp_Object Qno_conversion, Qno_iso6429, Qnone, Qnot, Qnothing;
-extern Lisp_Object Qnothing_image_instance_p, Qnotice;
+extern Lisp_Object Qmark;
+extern Lisp_Object Qmnemonic;
+extern Lisp_Object Qmono_pixmap_image_instance_p;
+extern Lisp_Object Qmouse_leave_buffer_hook;
+extern Lisp_Object Qnas, Qnatnump, Qnative_layout;
+extern Lisp_Object Qno_ascii_cntl, Qno_ascii_eol, Qno_catch;
+extern Lisp_Object Qno_conversion, Qno_iso6429;
+extern Lisp_Object Qnothing_image_instance_p;
 extern Lisp_Object Qnumber_char_or_marker_p, Qnumberp;
-extern Lisp_Object Qobject, Qok, Qold_assoc, Qold_delete, Qold_delq;
-extern Lisp_Object Qold_rassoc;
-extern Lisp_Object Qold_rassq, Qonly, Qor, Qother;
-extern Lisp_Object Qorientation, Qoutput_charset_conversion;
-extern Lisp_Object Qoverflow_error, Qpoint, Qpointer, Qpointer_glyph_p;
-extern Lisp_Object Qpointer_image_instance_p, Qportrait, Qpost_read_conversion;
-extern Lisp_Object Qpre_write_conversion, Qprint, Qprinter, Qprint_length;
-extern Lisp_Object Qprint_string_length, Qprocess, Qprogn, Qprovide, Qquit;
-extern Lisp_Object Qquote, Qrange_error, Qrassoc, Qrassq, Qread_char;
+extern Lisp_Object Qoutput_charset_conversion;
+extern Lisp_Object Qoverflow_error, Qpoint, Qpointer_glyph_p;
+extern Lisp_Object Qpointer_image_instance_p, Qpost_read_conversion;
+extern Lisp_Object Qpre_write_conversion, Qprint_length;
+extern Lisp_Object Qprint_string_length, Qprogn, Qquit;
+extern Lisp_Object Qquote, Qrange_error, Qread_char;
 extern Lisp_Object Qread_from_minibuffer, Qreally_early_error_handler;
-extern Lisp_Object Qregion_beginning, Qregion_end, Qrequire, Qresource;
-extern Lisp_Object Qretry, Qreturn, Qreverse, Qright, Qright_margin;
+extern Lisp_Object Qregion_beginning, Qregion_end;
 extern Lisp_Object Qrun_hooks, Qsans_modifiers;
-extern Lisp_Object Qsave_buffers_kill_emacs, Qsearch, Qselected;
+extern Lisp_Object Qsave_buffers_kill_emacs;
 extern Lisp_Object Qself_insert_command, Qself_insert_defer_undo;
 extern Lisp_Object Qsequencep, Qset, Qsetting_constant;
 extern Lisp_Object Qseven, Qshift_jis, Qshort;
-extern Lisp_Object Qsignal, Qsimple, Qsingularity_error, Qsize, Qspace;
-extern Lisp_Object Qspecifier, Qstandard_input, Qstandard_output, Qstart_open;
-extern Lisp_Object Qstream, Qstring, Qstring_lessp, Qsubwindow;
+extern Lisp_Object Qsingularity_error;
+extern Lisp_Object Qstandard_input, Qstandard_output;
+extern Lisp_Object Qstart_open;
+extern Lisp_Object Qstring_lessp, Qsubwindow;
 extern Lisp_Object Qsubwindow_image_instance_p;
-extern Lisp_Object Qsymbol, Qsyntax, Qt, Qterminal, Qtest;
-extern Lisp_Object Qtext, Qtext_image_instance_p, Qthis_command, Qtimeout;
-extern Lisp_Object Qtimestamp, Qtoolbar, Qtop, Qtop_margin, Qtop_level;
-extern Lisp_Object Qto_page, Qtrue_list_p, Qtty, Qtype;
-extern Lisp_Object Qunbound, Qundecided, Qundefined, Qunderflow_error;
-extern Lisp_Object Qunderline, Qunimplemented, Quser_files_and_directories;
-extern Lisp_Object Qvalue_assoc, Qvalues;
-extern Lisp_Object Qvariable_documentation, Qvariable_domain, Qvertical;
-extern Lisp_Object Qvoid_function, Qvoid_variable, Qwarning;
-extern Lisp_Object Qwidth, Qwidget, Qwindow;
-extern Lisp_Object Qwindow_live_p, Qwindow_system, Qwrong_number_of_arguments;
-extern Lisp_Object Qwrong_type_argument, Qx, Qy, Qyes, Qyes_or_no_p;
+extern Lisp_Object Qsyntax_error, Qt;
+extern Lisp_Object Qtext_image_instance_p;
+extern Lisp_Object Qtop_level;
+extern Lisp_Object Qtrue_list_p;
+extern Lisp_Object Qunbound, Qunderflow_error;
+extern Lisp_Object Qunderline, Quser_files_and_directories;
+extern Lisp_Object Qvalues;
+extern Lisp_Object Qvariable_documentation, Qvariable_domain;
+extern Lisp_Object Qvoid_function, Qvoid_variable;
+extern Lisp_Object Qwindow_live_p, Qwrong_number_of_arguments;
+extern Lisp_Object Qwrong_type_argument, Qyes_or_no_p;
+
+#define SYMBOL(fou) extern Lisp_Object fou
+#define SYMBOL_KEYWORD(la_cle_est_fou) extern Lisp_Object la_cle_est_fou
+#define SYMBOL_GENERAL(tout_le_monde, est_fou) \
+  extern Lisp_Object tout_le_monde
+
+#include "general-slots.h"
+
+#undef SYMBOL
+#undef SYMBOL_KEYWORD
+#undef SYMBOL_GENERAL
+
+/*--------------- prototypes for variables of type Lisp_Object  ------------*/
+
 extern Lisp_Object Vactivate_menubar_hook, Vascii_canon_table;
 extern Lisp_Object Vascii_downcase_table, Vascii_eqv_table;
 extern Lisp_Object Vascii_upcase_table, Vautoload_queue, Vblank_menubar;
index 638dde6..03a4f54 100644 (file)
@@ -218,14 +218,14 @@ EXFUN (Fread_from_string, 3);
 \f
 
 static DOESNT_RETURN
-syntax_error (const char *string)
+read_syntax_error (const char *string)
 {
   signal_error (Qinvalid_read_syntax,
                list1 (build_translated_string (string)));
 }
 
 static Lisp_Object
-continuable_syntax_error (const char *string)
+continuable_read_syntax_error (const char *string)
 {
   return Fsignal (Qinvalid_read_syntax,
                  list1 (build_translated_string (string)));
@@ -623,7 +623,7 @@ encoding detection or end-of-line detection.
              int result;
              /* temporarily hack the 'c' off the end of the filename */
              foundstr[foundlen - 1] = '\0';
-             result = stat (foundstr, &s2);
+             result = xemacs_stat (foundstr, &s2);
              if (result >= 0 &&
                  (unsigned) s1.st_mtime < (unsigned) s2.st_mtime)
               {
@@ -1014,7 +1014,7 @@ locate_file_in_directory_mapper (char *fn, void *arg)
   struct stat st;
 
   /* Ignore file if it's a directory.  */
-  if (stat (fn, &st) >= 0
+  if (xemacs_stat (fn, &st) >= 0
       && (st.st_mode & S_IFMT) != S_IFDIR)
     {
       /* Check that we can access or open it.  */
@@ -1230,7 +1230,7 @@ locate_file (Lisp_Object path, Lisp_Object str, Lisp_Object suffixes,
       int found = 0;
 
       /* If this path element is relative, we have to look by hand. */
-      if (NILP (Ffile_name_absolute_p (pathel)))
+      if (NILP (pathel) || NILP (Ffile_name_absolute_p (pathel)))
        {
          val = locate_file_in_directory (pathel, str, suffixes, storeptr,
                                          mode);
@@ -2120,17 +2120,17 @@ read_structure (Lisp_Object readcharfun)
 
   GCPRO2 (orig_list, already_seen);
   if (c != '(')
-    RETURN_UNGCPRO (continuable_syntax_error ("#s not followed by paren"));
+    RETURN_UNGCPRO (continuable_read_syntax_error ("#s not followed by paren"));
   list = read_list (readcharfun, ')', 0, 0);
   orig_list = list;
   {
     int len = XINT (Flength (list));
     if (len == 0)
-      RETURN_UNGCPRO (continuable_syntax_error
+      RETURN_UNGCPRO (continuable_read_syntax_error
                      ("structure type not specified"));
     if (!(len & 1))
       RETURN_UNGCPRO
-       (continuable_syntax_error
+       (continuable_read_syntax_error
         ("structures must have alternating keyword/value pairs"));
   }
 
@@ -2767,9 +2767,9 @@ sequence_reader (Lisp_Object readcharfun,
        unreadchar (readcharfun, ch);
 #ifdef FEATUREP_SYNTAX
       if (ch == ']')
-       syntax_error ("\"]\" in a list");
+       read_syntax_error ("\"]\" in a list");
       else if (ch == ')')
-       syntax_error ("\")\" in a vector");
+       read_syntax_error ("\")\" in a vector");
 #endif
       state = ((conser) (readcharfun, state, len));
     }
@@ -2809,15 +2809,15 @@ read_list_conser (Lisp_Object readcharfun, void *state, Charcount len)
          goto done;
        }
       else if (ch == ']')
-       syntax_error ("']' in a list");
+       read_syntax_error ("']' in a list");
       else if (ch == ')')
-       syntax_error ("')' in a vector");
+       read_syntax_error ("')' in a vector");
       else
 #endif
       if (ch != '.')
        signal_simple_error ("BUG! Internal reader error", elt);
       else if (!s->allow_dotted_lists)
-       syntax_error ("\".\" in a vector");
+       read_syntax_error ("\".\" in a vector");
       else
        {
          if (!NILP (s->tail))
@@ -2835,7 +2835,7 @@ read_list_conser (Lisp_Object readcharfun, void *state, Charcount len)
                  goto done;
                }
            }
-         syntax_error (". in wrong context");
+         read_syntax_error (". in wrong context");
        }
     }
 
@@ -3030,7 +3030,7 @@ read_compiled_function (Lisp_Object readcharfun, Emchar terminator)
   len = XINT (Flength (stuff));
   if (len < COMPILED_STACK_DEPTH + 1 || len > COMPILED_DOMAIN + 1)
     return
-      continuable_syntax_error ("#[...] used with wrong number of elements");
+      continuable_read_syntax_error ("#[...] used with wrong number of elements");
 
   for (iii = 0; CONSP (stuff); iii++)
     {
index 9d50b0c..1a39ab5 100644 (file)
@@ -136,7 +136,7 @@ enum lrecord_type
   lrecord_type_symbol_value_lisp_magic,
   lrecord_type_symbol_value_buffer_local,
   lrecord_type_max_symbol_value_magic = lrecord_type_symbol_value_buffer_local,
-  
+
   lrecord_type_symbol,
   lrecord_type_subr,
   lrecord_type_cons,
@@ -187,9 +187,12 @@ enum lrecord_type
   lrecord_type_pgconn,
   lrecord_type_pgresult,
   lrecord_type_devmode,
-  lrecord_type_count /* must be last */
+  lrecord_type_mswindows_dialog_id,
+  lrecord_type_last_built_in_type /* must be last */
 };
 
+extern unsigned int lrecord_type_count;
+
 struct lrecord_implementation
 {
   const char *name;
@@ -259,7 +262,12 @@ struct lrecord_implementation
   unsigned int basic_p :1;
 };
 
-extern const struct lrecord_implementation *lrecord_implementations_table[];
+/* All the built-in lisp object types are enumerated in `enum record_type'.
+   Additional ones may be defined by a module (none yet).  We leave some
+   room in `lrecord_implementations_table' for such new lisp object types. */
+#define MODULE_DEFINABLE_TYPE_COUNT 32
+
+extern const struct lrecord_implementation *lrecord_implementations_table[(unsigned int)lrecord_type_last_built_in_type + MODULE_DEFINABLE_TYPE_COUNT];
 
 #define XRECORD_LHEADER_IMPLEMENTATION(obj) \
    LHEADER_IMPLEMENTATION (XRECORD_LHEADER (obj))
@@ -289,7 +297,7 @@ extern int gc_in_progress;
    A lrecord external description  is an array  of values.  The  first
    value of each line is a type, the second  the offset in the lrecord
    structure.  Following values  are parameters, their  presence, type
-   and number is type-dependant.
+   and number is type-dependent.
 
    The description ends with a "XD_END" or "XD_SPECIFIER_END" record.
 
@@ -455,6 +463,27 @@ const struct lrecord_implementation lrecord_##c_name =                     \
     getprop, putprop, remprop, plist, size, sizer,                     \
     lrecord_type_##c_name, basic_p }
 
+#define DEFINE_EXTERNAL_LRECORD_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,desc,structtype) \
+DEFINE_EXTERNAL_LRECORD_IMPLEMENTATION_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,desc,0,0,0,0,structtype)
+
+#define DEFINE_EXTERNAL_LRECORD_IMPLEMENTATION_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,structtype) \
+MAKE_EXTERNAL_LRECORD_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,sizeof (structtype),0,0,structtype)
+
+#define DEFINE_EXTERNAL_LRECORD_SEQUENCE_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,desc,sizer,structtype) \
+DEFINE_EXTERNAL_LRECORD_SEQUENCE_IMPLEMENTATION_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,desc,0,0,0,0,sizer,structtype)
+
+#define DEFINE_EXTERNAL_LRECORD_SEQUENCE_IMPLEMENTATION_WITH_PROPS(name,c_name,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,sizer,structtype) \
+MAKE_EXTERNAL_LRECORD_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,0,sizer,0,structtype)
+
+#define MAKE_EXTERNAL_LRECORD_IMPLEMENTATION(name,c_name,marker,printer,nuker,equal,hash,desc,getprop,putprop,remprop,plist,size,sizer,basic_p,structtype) \
+DECLARE_ERROR_CHECK_TYPECHECK(c_name, structtype)                      \
+unsigned int lrecord_type_##c_name = lrecord_type_count++;              \
+const struct lrecord_implementation lrecord_##c_name =                 \
+  { name, marker, printer, nuker, equal, hash, desc,                   \
+    getprop, putprop, remprop, plist, size, sizer,                     \
+    (enum lrecord_type)lrecord_type_##c_name, basic_p }
+
+
 extern Lisp_Object (*lrecord_markers[]) (Lisp_Object);
 
 #define INIT_LRECORD_IMPLEMENTATION(type) do {                         \
@@ -467,16 +496,139 @@ extern Lisp_Object (*lrecord_markers[]) (Lisp_Object);
 #define XRECORD_LHEADER(a) ((struct lrecord_header *) XPNTR (a))
 
 #define RECORD_TYPEP(x, ty) \
-  (LRECORDP (x) && XRECORD_LHEADER (x)->type == (ty))
+  (LRECORDP (x) && (((unsigned int)(XRECORD_LHEADER (x)->type)) == ((unsigned int)(ty))))
+
+/* Steps to create a new object:
+
+   1. Declare the struct for your object in a header file somewhere.
+   Remember that it must begin with
+
+   struct lcrecord_header header;
+
+   2. Put a DECLARE_LRECORD() for the object below the struct definition,
+   along with the standard XFOO/XSETFOO junk.
+
+   3. Add this header file to inline.c.
+
+   4. Create the methods for your object.  Note that technically you don't
+   need any, but you will almost always want at least a mark method.
+
+   5. Define your object with DEFINE_LRECORD_IMPLEMENTATION() or some
+   variant.
+
+   6. Include the header file in the .c file where you defined the object.
+
+   7. Put a call to INIT_LRECORD_IMPLEMENTATION() for the object in the
+   .c file's syms_of_foo() function.
+
+   8. Add a type enum for the object to enum lrecord_type, earlier in this
+   file.
+
+An example:
+
+------------------------------ in toolbar.h -----------------------------
+
+struct toolbar_button
+{
+  struct lcrecord_header header;
+
+  Lisp_Object next;
+  Lisp_Object frame;
+
+  Lisp_Object up_glyph;
+  Lisp_Object down_glyph;
+  Lisp_Object disabled_glyph;
+
+  Lisp_Object cap_up_glyph;
+  Lisp_Object cap_down_glyph;
+  Lisp_Object cap_disabled_glyph;
 
-/* NOTE: the DECLARE_LRECORD() must come before the associated
-   DEFINE_LRECORD_*() or you will get compile errors.
+  Lisp_Object callback;
+  Lisp_Object enabled_p;
+  Lisp_Object help_string;
+
+  char enabled;
+  char down;
+  char pushright;
+  char blank;
+
+  int x, y;
+  int width, height;
+  int dirty;
+  int vertical;
+  int border_width;
+};
+
+DECLARE_LRECORD (toolbar_button, struct toolbar_button);
+#define XTOOLBAR_BUTTON(x) XRECORD (x, toolbar_button, struct toolbar_button)
+#define XSETTOOLBAR_BUTTON(x, p) XSETRECORD (x, p, toolbar_button)
+#define TOOLBAR_BUTTONP(x) RECORDP (x, toolbar_button)
+#define CHECK_TOOLBAR_BUTTON(x) CHECK_RECORD (x, toolbar_button)
+#define CONCHECK_TOOLBAR_BUTTON(x) CONCHECK_RECORD (x, toolbar_button)
+
+------------------------------ in toolbar.c -----------------------------
+
+#include "toolbar.h"
+
+...
+
+static Lisp_Object
+mark_toolbar_button (Lisp_Object obj)
+{
+  struct toolbar_button *data = XTOOLBAR_BUTTON (obj);
+  mark_object (data->next);
+  mark_object (data->frame);
+  mark_object (data->up_glyph);
+  mark_object (data->down_glyph);
+  mark_object (data->disabled_glyph);
+  mark_object (data->cap_up_glyph);
+  mark_object (data->cap_down_glyph);
+  mark_object (data->cap_disabled_glyph);
+  mark_object (data->callback);
+  mark_object (data->enabled_p);
+  return data->help_string;
+}
+
+DEFINE_LRECORD_IMPLEMENTATION ("toolbar-button", toolbar_button,
+                              mark_toolbar_button, 0, 0, 0, 0, 0,
+                              struct toolbar_button);
+
+...
+
+void
+syms_of_toolbar (void)
+{
+  INIT_LRECORD_IMPLEMENTATION (toolbar_button);
+
+  ...;
+}
+
+------------------------------ in inline.c -----------------------------
+
+#ifdef HAVE_TOOLBARS
+#include "toolbar.h"
+#endif
+
+------------------------------ in lrecord.h -----------------------------
+
+enum lrecord_type
+{
+  ...
+  lrecord_type_toolbar_button,
+  ...
+};
+
+*/
+
+/*
+
+Note: Object types defined in external dynamically-loaded modules (not
+part of the XEmacs main source code) should use DECLARE_EXTERNAL_LRECORD
+and DEFINE_EXTERNAL_LRECORD_IMPLEMENTATION rather than DECLARE_LRECORD
+and DEFINE_LRECORD_IMPLEMENTATION.
+
+*/
 
-   Furthermore, you always need to put the DECLARE_LRECORD() in a header
-   file, and make sure the header file is included in inline.c, even
-   if the type is private to a particular file.  Otherwise, you will
-   get undefined references for the error_check_foo() inline function
-   under GCC. */
 
 #ifdef ERROR_CHECK_TYPECHECK
 
@@ -492,6 +644,10 @@ error_check_##c_name (Lisp_Object obj)                             \
 }                                                              \
 extern Lisp_Object Q##c_name##p
 
+# define DECLARE_EXTERNAL_LRECORD(c_name, structtype)          \
+extern unsigned int lrecord_type_##c_name;                      \
+DECLARE_LRECORD(c_name, structtype)
+
 # define DECLARE_NONRECORD(c_name, type_enum, structtype)      \
 INLINE_HEADER structtype *                                     \
 error_check_##c_name (Lisp_Object obj);                                \
@@ -508,7 +664,7 @@ extern Lisp_Object Q##c_name##p
 
 # define XSETRECORD(var, p, c_name) do                         \
 {                                                              \
-  XSETOBJ (var, Lisp_Type_Record, p);                          \
+  XSETOBJ (var, p);                                            \
   assert (RECORD_TYPEP (var, lrecord_type_##c_name));          \
 } while (0)
 
@@ -517,12 +673,16 @@ extern Lisp_Object Q##c_name##p
 # define DECLARE_LRECORD(c_name, structtype)                   \
 extern Lisp_Object Q##c_name##p;                               \
 extern const struct lrecord_implementation lrecord_##c_name
+# define DECLARE_EXTERNAL_LRECORD(c_name, structtype)          \
+extern Lisp_Object Q##c_name##p;                               \
+extern unsigned int lrecord_type_##c_name;                     \
+extern const struct lrecord_implementation lrecord_##c_name
 # define DECLARE_NONRECORD(c_name, type_enum, structtype)      \
 extern Lisp_Object Q##c_name##p
 # define XRECORD(x, c_name, structtype) ((structtype *) XPNTR (x))
 # define XNONRECORD(x, c_name, type_enum, structtype)          \
   ((structtype *) XPNTR (x))
-# define XSETRECORD(var, p, c_name) XSETOBJ (var, Lisp_Type_Record, p)
+# define XSETRECORD(var, p, c_name) XSETOBJ (var, p)
 
 #endif /* not ERROR_CHECK_TYPECHECK */
 
index 6eba8b1..6800934 100644 (file)
@@ -92,7 +92,7 @@ typedef struct lstream_implementation
      the caller calls Lstream_read() with a very small size.
 
      This function can be NULL if the stream is output-only. */
-  /* The omniscient mly, blinded by the irresistable thrall of Common
+  /* The omniscient mly, blinded by the irresistible thrall of Common
      Lisp, thinks that it is bogus that the types and implementations
      of input and output streams are the same. */
   ssize_t (*reader) (Lstream *stream, unsigned char *data, size_t size);
index 52dd45d..f80b586 100644 (file)
@@ -64,15 +64,6 @@ Boston, MA 02111-1307, USA.  */
 
 #undef CANNOT_DUMP
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-#undef VIRT_ADDR_VARIES
-
 /* This prevents Emacs dumping an unsqueezed binary with the
    SQUEEZE bit set in the magic number. */
 
index f19db5d..5ce252b 100644 (file)
@@ -58,15 +58,6 @@ Boston, MA 02111-1307, USA.  */
 #define UNEXEC "unexfx2800.o"
 #define LIBS_MACHINE "-lalliant"
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-#undef VIRT_ADDR_VARIES
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index 06921ef..1832dc1 100644 (file)
@@ -45,15 +45,6 @@ Boston, MA 02111-1307, USA.  */
 
 #undef CANNOT_DUMP
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-#undef VIRT_ADDR_VARIES
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index 4810c1e..894dd0e 100644 (file)
@@ -55,15 +55,6 @@ compiler is so brain damaged that it is not even worth trying to use it.
 
 /* #define CANNOT_DUMP
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-/* #define VIRT_ADDR_VARIES*/
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index 2575739..a40b6d5 100644 (file)
@@ -39,11 +39,6 @@ Boston, MA 02111-1307, USA.  */
 /* Do not define LOAD_AVE_TYPE or LOAD_AVE_CVT
    since there is no /dev/kmem */
 
-/* Undefine VIRT_ADDR_VARIES because the virtual addresses of
-   pure and impure space as loaded do not vary.  */
-
-#undef VIRT_ADDR_VARIES
-
 /* Define HAVE_ALLOCA because we use the system's version of alloca.  */
 
 #define HAVE_ALLOCA
index 897845a..571c31a 100644 (file)
@@ -71,16 +71,6 @@ Boston, MA 02111-1307, USA.  */
 
 #undef CANNOT_DUMP
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-#undef VIRT_ADDR_VARIES
-
-
 /* this brings in alloca() if we're using cc */
 #ifdef USG
 #define NO_REMAP 
@@ -88,7 +78,6 @@ Boston, MA 02111-1307, USA.  */
 #endif /* USG */
 
 #ifdef WIN32_NATIVE
-#define VIRT_ADDR_VARIES
 #define DATA_END       get_data_end ()
 #define DATA_START     get_data_start ()
 #define HAVE_ALLOCA
index 896a6cc..c209aae 100644 (file)
@@ -42,15 +42,6 @@ Boston, MA 02111-1307, USA.  */
    and temacs will do (load "loadup") automatically unless told otherwise.  */
 /* #define CANNOT_DUMP */
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-/* #define VIRT_ADDR_VARIES */  /* Karl Kleinpaste says this isn't needed.  */
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index b3cc63a..3f2e4aa 100644 (file)
@@ -43,15 +43,6 @@ Boston, MA 02111-1307, USA.  */
 
 /* #define CANNOT_DUMP */
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-/* #define VIRT_ADDR_VARIES */
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index f18bc99..e454761 100644 (file)
@@ -45,15 +45,6 @@ Boston, MA 02111-1307, USA.  */
    and temacs will do (load "loadup") automatically unless told otherwise.  */
 /* #define CANNOT_DUMP */
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-/* #define VIRT_ADDR_VARIES */  /* Karl Kleinpaste says this isn't needed.  */
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index 2427a4f..1f6ffef 100644 (file)
@@ -40,15 +40,6 @@ Boston, MA 02111-1307, USA.  */
 
 /* #define CANNOT_DUMP */
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-#undef VIRT_ADDR_VARIES
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index a618993..bcb243b 100644 (file)
@@ -56,15 +56,6 @@ Boston, MA 02111-1307, USA.  */
 
 /* #define CANNOT_DUMP */
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-/*#define VIRT_ADDR_VARIES*/
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index 887770b..2c6a618 100644 (file)
@@ -43,15 +43,6 @@ Boston, MA 02111-1307, USA.  */
 
 /*#define CANNOT_DUMP*/
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that data space precedes text space,
-   numerically.  */
-
-#undef VIRT_ADDR_VARIES
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index a05b005..21e954f 100644 (file)
@@ -48,15 +48,6 @@ Boston, MA 02111-1307, USA.  */
 
 /* #define CANNOT_DUMP */
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that data space precedes text space,
-   numerically.  */
-
-/* #define VIRT_ADDR_VARIES */
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index 7177af1..d20b306 100644 (file)
@@ -50,15 +50,6 @@ Boston, MA 02111-1307, USA.  */
 
 /* #define CANNOT_DUMP  */
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-/* #define VIRT_ADDR_VARIES */ 
-
 /* Define NO_REMAP if memory segmentation makes it not work well
    to change the boundary between the text section and data section
    when Emacs is dumped.  If you define this, the preloaded Lisp
index c19f6ee..343de01 100644 (file)
@@ -55,15 +55,6 @@ Boston, MA 02111-1307, USA.  */
 
 /*#define CANNOT_DUMP /**/
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-/* #define VIRT_ADDR_VARIES /**/
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index e62c338..5284017 100644 (file)
@@ -60,15 +60,6 @@ Boston, MA 02111-1307, USA.  */
 
 /* #define CANNOT_DUMP */
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-/* #define VIRT_ADDR_VARIES */
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index a649ec4..946cec8 100644 (file)
@@ -42,15 +42,6 @@ Boston, MA 02111-1307, USA.  */
 
 #undef CANNOT_DUMP
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-/* #define VIRT_ADDR_VARIES */
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index a8174f2..2729e33 100644 (file)
@@ -71,15 +71,6 @@ NOTE-END */
 
 /* #define CANNOT_DUMP */
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-#define VIRT_ADDR_VARIES
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index 607b52a..71e652f 100644 (file)
@@ -57,15 +57,6 @@ Boston, MA 02111-1307, USA.  */
 
 #undef CANNOT_DUMP
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-#define VIRT_ADDR_VARIES
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index 14383ef..100dbed 100644 (file)
@@ -52,15 +52,6 @@ NOTE-END */
 
 /* #define CANNOT_DUMP */
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-/* #define VIRT_ADDR_VARIES */
-
 /* XEmacs: Richard Cognot <cognot@ensg.u-nancy.fr> says we need this for
    HPUX; but eeide@asylum.cs.utah.edu (Eric Eide) says it loses on BSD. */
 #ifndef BSD
index 79d3f53..2e0c840 100644 (file)
@@ -45,15 +45,6 @@ Boston, MA 02111-1307, USA.  */
 
 /* #define CANNOT_DUMP */
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-/* #define VIRT_ADDR_VARIES */
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index 73d14e3..d8bdf39 100644 (file)
@@ -59,15 +59,6 @@ so disable it for them.  */
 
 /* #define CANNOT_DUMP */
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-/* #define VIRT_ADDR_VARIES */
-
 /* Define addresses, macros, change some setup for dump */
 
 #define NO_REMAP
index 61f5246..d4c7deb 100644 (file)
@@ -49,15 +49,6 @@ Boston, MA 02111-1307, USA.  */
 
 /* #define CANNOT_DUMP */
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-#undef VIRT_ADDR_VARIES
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index da59f6d..cc65be2 100644 (file)
@@ -112,15 +112,6 @@ NOTE-END */
 
 /* #define CANNOT_DUMP */
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-/* #define VIRT_ADDR_VARIES */
-
 #ifdef XENIX
 
 /* Define NO_REMAP if memory segmentation makes it not work well
index 5e207d2..c8f1217 100644 (file)
@@ -55,15 +55,6 @@ Boston, MA 02111-1307, USA.  */
 
 #undef CANNOT_DUMP
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-/* #define VIRT_ADDR_VARIES */
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index 37106d7..eda9953 100644 (file)
@@ -56,15 +56,6 @@ Boston, MA 02111-1307, USA.  */
 
 #undef CANNOT_DUMP
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-/* #define VIRT_ADDR_VARIES */
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index 45a0138..913868b 100644 (file)
@@ -55,15 +55,6 @@ Boston, MA 02111-1307, USA.  */
 
 #undef CANNOT_DUMP
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-/* #define VIRT_ADDR_VARIES */
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index fcb7600..71d5936 100644 (file)
@@ -82,15 +82,6 @@ NOTE-END */
 
 /* #define CANNOT_DUMP */
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-/* #define VIRT_ADDR_VARIES */
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index e4cdd5e..70827e3 100644 (file)
@@ -33,15 +33,6 @@ Boston, MA 02111-1307, USA.  */
 
 /* #define CANNOT_DUMP */
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-/* #define VIRT_ADDR_VARIES */
-
 #ifdef linux
 
 #define NO_REMAP
index 3db18b8..fdde3f2 100644 (file)
@@ -45,15 +45,6 @@ Boston, MA 02111-1307, USA.  */
 
 #undef CANNOT_DUMP
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-#undef VIRT_ADDR_VARIES
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index 6163ad6..88942e4 100644 (file)
@@ -56,15 +56,6 @@ NOTE-END  */
 /* ns16000's have an unexec, so should the mg-1 */
 #undef CANNOT_DUMP
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-/* hmmmm... not sure.  copied sequent.h */
-#undef VIRT_ADDR_VARIES
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index a86c443..c5ce0a6 100644 (file)
@@ -63,15 +63,6 @@ NOTE-END  */
 
 #undef CANNOT_DUMP
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-/* #define VIRT_ADDR_VARIES */
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index e17397c..dd01ff3 100644 (file)
@@ -63,15 +63,6 @@ NOTE-END  */
 
 #undef CANNOT_DUMP
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-/* #define VIRT_ADDR_VARIES */
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index dc12e02..2cda767 100644 (file)
@@ -58,15 +58,6 @@ NOTE-END  */
 
 #undef CANNOT_DUMP
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-/* #define VIRT_ADDR_VARIES */
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index 05c8e80..8c48731 100644 (file)
@@ -53,15 +53,6 @@ Boston, MA 02111-1307, USA.  */
 
 /* #define CANNOT_DUMP */
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-/* #define VIRT_ADDR_VARIES */
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index 63b3bbe..68e63cc 100644 (file)
@@ -52,15 +52,6 @@ Boston, MA 02111-1307, USA.  */
 
 /* #define CANNOT_DUMP */
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-/* #define VIRT_ADDR_VARIES */
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index c047f12..ba4ebfd 100644 (file)
@@ -43,15 +43,6 @@ Boston, MA 02111-1307, USA.  */
 
 /* #define CANNOT_DUMP */
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-/* #define VIRT_ADDR_VARIES */
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index ec8d956..574e267 100644 (file)
@@ -45,15 +45,6 @@ Boston, MA 02111-1307, USA.  */
 
 #undef CANNOT_DUMP
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-#undef VIRT_ADDR_VARIES
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index 7284f6d..27a8aa2 100644 (file)
@@ -53,19 +53,10 @@ Boston, MA 02111-1307, USA.  */
 #define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
 #else /* mklinux */
 
-/* Define NO_ARG_ARRAY if you cannot take the address of the first of a
- * group of arguments and treat it as an array of the arguments.  */
-
-#define NO_ARG_ARRAY
-
 /* Define addresses, macros, change some setup for dump */
 
 #define NO_REMAP
 
-/* Use type int rather than a union, to represent Lisp_Object */
-
-/* #define NO_UNION_TYPE */
-
 #ifdef CANNOT_DUMP
 
 #endif /* CANNOT_DUMP */
index b64851d..0919f7a 100644 (file)
@@ -55,15 +55,6 @@ Boston, MA 02111-1307, USA.  */
 
 /* #define CANNOT_DUMP */
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-/* #define VIRT_ADDR_VARIES */
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index 95d7f6a..aa3d416 100644 (file)
@@ -64,15 +64,6 @@ NOTE-END */
 
 /* #define CANNOT_DUMP */
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-/* #define VIRT_ADDR_VARIES */
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index a6900e5..54f9229 100644 (file)
@@ -68,15 +68,6 @@ Boston, MA 02111-1307, USA.  */
 
 #undef CANNOT_DUMP
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-/* #define VIRT_ADDR_VARIES */
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index def9730..ea09f03 100644 (file)
@@ -48,15 +48,6 @@ Boston, MA 02111-1307, USA.  */
 
 #undef CANNOT_DUMP
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-#undef VIRT_ADDR_VARIES
-
 /* The STRIDE system is more powerful than standard USG5.  */
 
 #define HAVE_PTYS
index dfc7206..b7279fb 100644 (file)
@@ -36,15 +36,6 @@ Boston, MA 02111-1307, USA.  */
    and temacs will do (load "loadup") automatically unless told otherwise.  */
 /* #define CANNOT_DUMP */
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-/* #define VIRT_ADDR_VARIES */  /* Karl Kleinpaste says this isn't needed.  */
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index 12c7b82..a9b9921 100644 (file)
@@ -46,15 +46,6 @@ Boston, MA 02111-1307, USA.  */
 
 /* #define CANNOT_DUMP */
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-/* #define VIRT_ADDR_VARIES */
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index 11b8146..29003aa 100644 (file)
@@ -40,14 +40,6 @@ Boston, MA 02111-1307, USA.  */
    and temacs will do (load "loadup") automatically unless told otherwise.  */
 /*#define CANNOT_DUMP*/
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-/* #define VIRT_ADDR_VARIES */ 
-
 /* Define NO_REMAP if memory segmentation makes it not work well
    to change the boundary between the text section and data section
    when Emacs is dumped.  If you define this, the preloaded Lisp
index e6cf3c3..bb3e8c0 100644 (file)
@@ -43,15 +43,6 @@ Boston, MA 02111-1307, USA.  */
 
 #define CANNOT_DUMP
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-#define VIRT_ADDR_VARIES
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index 37413e5..3ebb3bb 100644 (file)
@@ -44,15 +44,6 @@ Boston, MA 02111-1307, USA.  */
 
 /* #define CANNOT_DUMP */
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-/* #define VIRT_ADDR_VARIES */
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index 502e814..fce182a 100644 (file)
@@ -44,15 +44,6 @@ Boston, MA 02111-1307, USA.  */
 
 /* #define CANNOT_DUMP */
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-/* #define VIRT_ADDR_VARIES */
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index 5e4d2af..c695c4d 100644 (file)
@@ -46,15 +46,6 @@ Boston, MA 02111-1307, USA.  */
 
 #undef CANNOT_DUMP
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that data space precedes text space,
-   numerically.  */
-
-#undef VIRT_ADDR_VARIES
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index 87d5803..53920e2 100644 (file)
@@ -49,15 +49,6 @@ Boston, MA 02111-1307, USA.  */
 
 #undef CANNOT_DUMP
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-#undef VIRT_ADDR_VARIES
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index 6277d07..d75d4b4 100644 (file)
@@ -25,29 +25,11 @@ Boston, MA 02111-1307, USA.  */
    operating system this machine is likely to run.
    USUAL-OPSYS="<name of system .h file here, without the s- or .h>"  */
 
-/* Define NO_ARG_ARRAY if you cannot take the address of the first of a
- * group of arguments and treat it as an array of the arguments.  */
-
-#define NO_ARG_ARRAY
-
 /* Now define a symbol for the cpu type, if your compiler
    does not define it automatically:
    Ones defined so far include vax, m68000, ns16000, pyramid,
    orion, tahoe, APOLLO and many others */
 
-/* Use type int rather than a union, to represent Lisp_Object */
-/* This is desirable for most machines.  */
-
-#define NO_UNION_TYPE
-
-/* Data type of load average, as read out of kmem.  */
-
-#define LOAD_AVE_TYPE long
-
-/* Convert that into an integer that is 100 for a load average of 1.0  */
-
-#define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
-
 /* Define CANNOT_DUMP on machines where unexec does not work.
    Then the function dump-emacs will not be defined
    and temacs will do (load "loadup") automatically unless told otherwise.  */
@@ -57,20 +39,13 @@ Boston, MA 02111-1307, USA.  */
 #define        CANNOT_UNEXEC   1
  */
 
+/* Do not define LOAD_AVE_TYPE or LOAD_AVE_CVT
+   since there is no load average available. */
+
 /* Start and end of text and data.  */
 #define DATA_END       get_data_end ()
 #define DATA_START     get_data_start ()
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-/* Text does precede data space, but this is never a safe assumption.  */
-#define VIRT_ADDR_VARIES
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index 6dfb22d..fc18990 100644 (file)
@@ -45,15 +45,6 @@ Boston, MA 02111-1307, USA.  */
 
 /* #define CANNOT_DUMP */
 
-/* Define VIRT_ADDR_VARIES if the virtual addresses of
-   pure and impure space as loaded can vary, and even their
-   relative order cannot be relied on.
-
-   Otherwise Emacs assumes that text space precedes data space,
-   numerically.  */
-
-/* #define VIRT_ADDR_VARIES */
-
 /* Define C_ALLOCA if this machine does not support a true alloca
    and the one written in C should be used instead.
    Define HAVE_ALLOCA to say that the system provides a properly
index f28a23b..ace1007 100644 (file)
@@ -45,6 +45,10 @@ for (qw (config.h sheap-adjust.h paths.h Emacs.ad.h)) {
   $generated_header{$_} = 1;
 }
 
+# Although this is not technically true, it ought to be true,
+# and makes the generated Makefile smaller.
+$uses{'lisp.h'}{'config.h'} = 1;
+
 for my $file (keys %exists) {
   open (FILE, $file) or die "$file: $!";
   undef $/; $_ = <FILE>;
@@ -80,18 +84,17 @@ while (1) {
 
 # Print file header
 print
-"## This file automatically generated by $myName.  Do not modify.
+"## This file is automatically generated by \`$myName'.  Do not modify.
 
-#ifdef USE_UNION_TYPE
+#if defined(USE_UNION_TYPE)
 LISP_UNION_H=lisp-union.h
 #else
 LISP_UNION_H=lisp-disunion.h
 #endif
 ";
 
-my @LISP_H = ('lisp.h', 'config.h');
-#@LISP_H = grep (! /lisp-(dis)?union\.h/, @LISP_H);
-print "LISP_H = @{[grep (!/lisp-(dis)?union\.h/, @LISP_H)]} \$(LISP_UNION_H)\n";
+my @LISP_H = ('lisp.h', keys %{$uses{'lisp.h'}});
+print "LISP_H=@{[grep (!/lisp-(dis)?union\.h/, @LISP_H)]} \$(LISP_UNION_H)\n";
 
 sub PrintDeps {
   my $file = shift;
@@ -105,7 +108,7 @@ sub PrintDeps {
 
 sub PrintPatternDeps {
   my ($pattern, $CPP_SYMBOL) = @_;
-  print "#ifdef $CPP_SYMBOL\n";
+  print "#if defined($CPP_SYMBOL)\n";
   for my $file (sort grep (/$pattern/ && /\.c$/, keys %uses)) {
     PrintDeps($file);
     delete $uses{$file};
@@ -113,14 +116,16 @@ sub PrintPatternDeps {
   print "#endif\n";
 }
 
-PrintPatternDeps ('-msw',     "HAVE_MS_WINDOWS");
-PrintPatternDeps ('-x',       "HAVE_X_WINDOWS");
-PrintPatternDeps ('database', "HAVE_DATABASE");
-PrintPatternDeps ('^mule',    "MULE");
+PrintPatternDeps ('-msw\\.',   "HAVE_MS_WINDOWS");
+PrintPatternDeps ('-x\\.',     "HAVE_X_WINDOWS");
+PrintPatternDeps ('-tty\\.',   "HAVE_TTY");
+PrintPatternDeps ('^database', "HAVE_DATABASE");
+PrintPatternDeps ('^mule',     "MULE");
 PrintPatternDeps ('^(?:External|extw-)', "EXTERNAL_WIDGET");
 
 for my $file (sort grep (/\.c$/, keys %uses)) { PrintDeps($file); }
 
+# Surprisingly robust regexp to remove comments from arbitrary C code
 sub RemoveComments {
   $_[0] =~
     s{ (
index 33f456a..5e0625a 100644 (file)
@@ -116,31 +116,42 @@ static Lisp_Object current_hash_table;
 #define MENU_ITEM_ID_BITS(x) (((x) & 0x7FFF) | 0x8000)
 static HMENU top_level_menu;
 
-/* Translate (in place) %_ to &, %% to %.
-   Return new length, and (through accel) the accelerator character.
-   (If there is no accelerator, it will be added on the first character.)
-   len = number of bytes (not including zero terminator).
-   maxlen = size of buffer.
-   We assume and maintain zero-termination.  To be absolutely sure
-   of not hitting an error, maxlen should be >= 2*len + 3. */
-
+/*
+ * Translate (in place) X accelerator syntax to win32 accelerator syntax.
+ * Return new length.
+ * len = number of bytes (not including zero terminator).
+ * maxlen = size of buffer.
+ * accel = (Emchar*) to receive the accelerator character
+ *         or NULL to suppress accelerators in the menu or dialog item.
+ *
+ * %% is replaced with %
+ * if accel is NULL:
+ *   %_ is removed.
+ * if accel is non-NULL:
+ *   %_ is replaced with &.
+ *   The accelerator character is passed back in *accel.
+ *   (If there is no accelerator, it will be added on the first character.)
+ *
+ * We assume and maintain zero-termination.  To be absolutely sure
+ * of not hitting an error, maxlen should be >= 2*len + 3.
+ */
 Bytecount
 mswindows_translate_menu_or_dialog_item (Bufbyte *item, Bytecount len,
-                                  Bytecount maxlen, Emchar *accel,
-                                  Lisp_Object error_name)
+                                        Bytecount maxlen, Emchar *accel,
+                                        Lisp_Object error_name)
 {
   Bufbyte *ptr;
 
-  *accel = '\0';
+  if (accel)
+    *accel = '\0';
 
   /* Escape '&' as '&&' */
-  
   ptr = item;
   while ((ptr = (Bufbyte *) memchr (ptr, '&', len - (ptr - item))) != NULL)
     {
       if (len + 2 > maxlen)
-       signal_simple_error ("Menu item produces too long displayable string",
-                            error_name);
+       syntax_error ("Menu item produces too long displayable string",
+                     error_name);
       memmove (ptr + 1, ptr, (len - (ptr - item)) + 1);
       len++;
       ptr += 2;
@@ -153,27 +164,38 @@ mswindows_translate_menu_or_dialog_item (Bufbyte *item, Bytecount len,
     {
       if (*(ptr + 1) == '_')
        {
-         *ptr = '&';
-         if (!*accel)
-           /* #### urk !  We need a reference translation table for
-              case changes that aren't buffer-specific. */
-           *accel = DOWNCASE (current_buffer, charptr_emchar (ptr + 2));
-         memmove (ptr + 1, ptr + 2, len - (ptr - item + 2) + 1);
-         len--;
+         if (accel)
+           {
+             *ptr = '&';
+             if (!*accel)
+               /* #### urk !  We need a reference translation table for
+                  case changes that aren't buffer-specific. */
+               *accel = DOWNCASE (current_buffer, charptr_emchar (ptr + 2));
+             memmove (ptr + 1, ptr + 2, len - (ptr - item + 2) + 1);
+             len--;
+           }
+         else  /* Skip accelerator */
+           {
+             memmove (ptr, ptr + 2, len - (ptr - item + 2) + 1);
+             len-=2;
+           }
        }
       else if (*(ptr + 1) == '%')
        {
          memmove (ptr + 1, ptr + 2, len - (ptr - item + 2) + 1);
          len--;
+         ptr++;
        }
-      ptr++;
+      else     /* % on its own - shouldn't happen */
+       ptr++;
     }
 
-  if (!*accel)
+  if (accel && !*accel)
     {
+      /* Force a default accelerator */
       if (len + 2 > maxlen)
-       signal_simple_error ("Menu item produces too long displayable string",
-                            error_name);
+       syntax_error ("Menu item produces too long displayable string",
+                     error_name);
       ptr = item;
       memmove (ptr + 1, ptr, len + 1);
       /* #### urk !  We need a reference translation table for
@@ -202,7 +224,7 @@ displayable_menu_item (Lisp_Object gui_item, int bar_p, Emchar *accel)
   /* We construct the name in a static buffer. That's fine, because
      menu items longer than 128 chars are probably programming errors,
      and better be caught than displayed! */
-  
+
   static char buf[MAX_MENUITEM_LENGTH+2];
 
   /* Left flush part of the string */
@@ -298,7 +320,7 @@ checksum_menu_item (Lisp_Object item)
       return HASH2 (internal_hash (XVECTOR_DATA(item)[0], 0),
                    internal_hash (XVECTOR_DATA(item)[1], 0));
     }
+
   /* An error - will be caught later */
   return 0;
 }
@@ -310,6 +332,9 @@ populate_menu_add_item (HMENU menu, Lisp_Object path,
                        int flush_right, int bar_p)
 {
   MENUITEMINFO item_info;
+  UINT oldflags = MF_BYPOSITION;
+  UINT olduidnewitem = 0;
+  LPCTSTR oldlpnewitem = 0;
 
   item_info.cbSize = sizeof (item_info);
   item_info.fMask = MIIM_TYPE | MIIM_STATE | MIIM_ID;
@@ -321,12 +346,17 @@ populate_menu_add_item (HMENU menu, Lisp_Object path,
     {
       /* Separator or unselectable text */
       if (separator_string_p (XSTRING_DATA (item)))
-       item_info.fType = MFT_SEPARATOR;
+       {
+         item_info.fType = MFT_SEPARATOR;
+         oldflags |= MF_SEPARATOR;
+       }
       else
        {
          item_info.fType = MFT_STRING;
          item_info.fState = MFS_DISABLED;
          item_info.dwTypeData = XSTRING_DATA (item);
+         oldflags |= MF_STRING | MF_DISABLED;
+         oldlpnewitem = item_info.dwTypeData;
        }
     }
   else if (CONSP (item))
@@ -343,17 +373,20 @@ populate_menu_add_item (HMENU menu, Lisp_Object path,
       menu_parse_submenu_keywords (item, gui_item);
 
       if (!STRINGP (pgui_item->name))
-       signal_simple_error ("Menu name (first element) must be a string",
+       syntax_error ("Menu name (first element) must be a string",
                             item);
 
       if (!gui_item_included_p (gui_item, Vmenubar_configuration))
-      {
-       UNGCPRO;
-       goto done;
-      }
+       {
+         UNGCPRO;
+         goto done;
+       }
 
       if (!gui_item_active_p (gui_item))
-       item_info.fState = MFS_GRAYED;
+       {
+         item_info.fState = MFS_GRAYED;
+         oldflags |= MF_GRAYED;
+       }
       /* Temptation is to put 'else' right here. Although, the
         displayed item won't have an arrow indicating that it is a
         popup.  So we go ahead a little bit more and create a popup */
@@ -362,6 +395,9 @@ populate_menu_add_item (HMENU menu, Lisp_Object path,
       item_info.fMask |= MIIM_SUBMENU;
       item_info.dwTypeData = displayable_menu_item (gui_item, bar_p, &accel);
       item_info.hSubMenu = submenu;
+      olduidnewitem = (UINT) submenu;
+      oldlpnewitem = item_info.dwTypeData;
+      oldflags |= MF_POPUP;
 
       if (accel && bar_p)
        *accel_list = Fcons (make_char (accel), *accel_list);
@@ -383,7 +419,7 @@ populate_menu_add_item (HMENU menu, Lisp_Object path,
          Fputhash (hmenu_to_lisp_object (submenu), path, hash_tab);
        }
       UNGCPRO;
-    } 
+    }
   else if (VECTORP (item))
     {
       /* An ordinary item */
@@ -396,16 +432,19 @@ populate_menu_add_item (HMENU menu, Lisp_Object path,
       GCPRO2 (gui_item, *accel_list);
 
       if (!gui_item_included_p (gui_item, Vmenubar_configuration))
-      {
-       UNGCPRO;
-       goto done;
-      }
+       {
+         UNGCPRO;
+         goto done;
+       }
 
       if (!STRINGP (pgui_item->name))
        pgui_item->name = Feval (pgui_item->name);
 
       if (!gui_item_active_p (gui_item))
-       item_info.fState = MFS_GRAYED;
+       {
+         item_info.fState = MFS_GRAYED;
+         oldflags = MF_GRAYED;
+       }
 
       style = (NILP (pgui_item->selected) || NILP (Feval (pgui_item->selected))
               ? Qnil : pgui_item->style);
@@ -414,10 +453,13 @@ populate_menu_add_item (HMENU menu, Lisp_Object path,
        {
          item_info.fType |= MFT_RADIOCHECK;
          item_info.fState |= MFS_CHECKED;
+         oldflags |= MF_CHECKED; /* Can't support radio-button checkmarks
+                                    under 3.51 */
        }
       else if (EQ (style, Qtoggle))
        {
          item_info.fState |= MFS_CHECKED;
+         oldflags |= MF_CHECKED;
        }
 
       id = allocate_menu_item_id (path, pgui_item->name,
@@ -427,6 +469,9 @@ populate_menu_add_item (HMENU menu, Lisp_Object path,
       item_info.wID = (UINT) XINT (id);
       item_info.fType |= MFT_STRING;
       item_info.dwTypeData = displayable_menu_item (gui_item, bar_p, &accel);
+      olduidnewitem = item_info.wID;
+      oldflags |= MF_STRING;
+      oldlpnewitem = item_info.dwTypeData;
 
       if (accel && bar_p)
        *accel_list = Fcons (make_char (accel), *accel_list);
@@ -434,17 +479,18 @@ populate_menu_add_item (HMENU menu, Lisp_Object path,
       UNGCPRO;
     }
   else
-    {
-      signal_simple_error ("Malformed menu item descriptor", item);
-    }
+    syntax_error ("Malformed menu item descriptor", item);
 
   if (flush_right)
-    item_info.fType |= MFT_RIGHTJUSTIFY;
+    item_info.fType |= MFT_RIGHTJUSTIFY; /* can't support in 3.51 */
 
-  InsertMenuItem (menu, UINT_MAX, TRUE, &item_info);
+  if (xInsertMenuItemA)
+    xInsertMenuItemA (menu, UINT_MAX, TRUE, &item_info);
+  else
+    InsertMenu (menu, UINT_MAX, oldflags, olduidnewitem, oldlpnewitem);
 
 done:;
-}  
+}
 
 /*
  * This function is called from populate_menu and checksum_menu.
@@ -488,7 +534,7 @@ populate_or_checksum_helper (HMENU menu, Lisp_Object path, Lisp_Object desc,
 
   /* Check that menu name is specified when expected */
   if (NILP (pgui_item->name) && deep_p)
-    signal_simple_error ("Menu must have a name", desc);
+    syntax_error ("Menu must have a name", desc);
 
   /* Apply filter if specified */
   if (!NILP (pgui_item->filter))
@@ -514,7 +560,7 @@ populate_or_checksum_helper (HMENU menu, Lisp_Object path, Lisp_Object desc,
        checksum = HASH2 (checksum,
                          checksum_menu_item (XCAR (item_desc)));
     }
-  
+
   if (populate_p)
     {
       /* Remove the "(empty)" item, if there are other ones */
@@ -528,9 +574,10 @@ populate_or_checksum_helper (HMENU menu, Lisp_Object path, Lisp_Object desc,
        {
          CHECK_STRING (pgui_item->name);
          InsertMenu (menu, 0, MF_BYPOSITION | MF_STRING | MF_DISABLED,
-                     0, XSTRING_DATA(pgui_item->name));
+                     0, displayable_menu_item (gui_item, bar_p, NULL));
          InsertMenu (menu, 1, MF_BYPOSITION | MF_SEPARATOR, 0, NULL);
-         SetMenuDefaultItem (menu, 0, MF_BYPOSITION);
+         if (xSetMenuDefaultItem) /* not in NT 3.5x */
+           xSetMenuDefaultItem (menu, 0, MF_BYPOSITION);
        }
     }
 
@@ -648,7 +695,7 @@ prune_menubar (struct frame *f)
 
   Fputhash (hmenu_to_lisp_object (menubar), Qnil,
            FRAME_MSWINDOWS_MENU_HASH_TABLE (f));
-  populate_menu (menubar, Qnil, desc, 
+  populate_menu (menubar, Qnil, desc,
                 FRAME_MSWINDOWS_MENU_HASH_TABLE (f), 1);
   UNGCPRO;
 }
@@ -671,12 +718,13 @@ mswindows_char_is_accelerator (struct frame *f, Emchar ch)
 {
   Lisp_Object hash = FRAME_MSWINDOWS_MENU_HASH_TABLE (f);
 
-  assert (HASH_TABLEP (hash));
+  if (NILP (hash))
+    return 0;
   /* !!#### not Mule-ized */
   return !NILP (memq_no_quit (make_char (tolower (ch)),
                              Fgethash (Qt, hash, Qnil)));
 }
-  
+
 \f
 /*------------------------------------------------------------------------*/
 /* Message handlers                                                       */
@@ -771,7 +819,7 @@ mswindows_handle_wm_command (struct frame *f, WORD id)
   XSETFRAME (frame, f);
   /* this used to call mswindows_enqueue_misc_user_event but that
      breaks customize because the misc_event gets eval'ed in some
-     cicumstances. Don't change it back unless you can fix the
+     circumstances. Don't change it back unless you can fix the
      customize problem also.*/
   enqueue_misc_user_event (frame, fn, arg);
   mswindows_enqueue_magic_event (NULL, XM_BUMPQUEUE);
@@ -889,11 +937,11 @@ mswindows_popup_menu (Lisp_Object menu_desc, Lisp_Object event)
   menu = create_empty_popup_menu ();
   Fputhash (hmenu_to_lisp_object (menu), Qnil, current_hash_table);
   top_level_menu = menu;
-  
+
   /* see comments in menubar-x.c */
   if (zmacs_regions)
     zmacs_region_stays = 1;
-  
+
   ok = TrackPopupMenu (menu,
                       TPM_LEFTALIGN | TPM_LEFTBUTTON | TPM_RIGHTBUTTON,
                       pt.x, pt.y, 0,
index 3adf9b8..84d147e 100644 (file)
@@ -1,6 +1,7 @@
 /* Implements an elisp-programmable menubar -- X interface.
    Copyright (C) 1993, 1994 Free Software Foundation, Inc.
    Copyright (C) 1995 Tinker Systems and INS Engineering Corp.
+   Copyright (C) 2000 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -21,6 +22,8 @@ Boston, MA 02111-1307, USA.  */
 
 /* Synched up with: Not in FSF. */
 
+/* This file Mule-ized by Ben Wing, 7-8-00. */
+
 /* Authorship:
 
    Created 16-dec-91 by Jamie Zawinski.
@@ -102,7 +105,6 @@ menu_item_descriptor_to_widget_value_1 (Lisp_Object desc,
   /* This function cannot GC.
      It is only called from menu_item_descriptor_to_widget_value, which
      prohibits GC. */
-  /* !!#### This function has not been Mule-ized */
   int menubar_root_p = (menu_type == MENUBAR_TYPE && depth == 0);
   int count = specpdl_depth ();
   int partition_seen = 0;
@@ -113,21 +115,16 @@ menu_item_descriptor_to_widget_value_1 (Lisp_Object desc,
 
   if (STRINGP (desc))
     {
-      char *string_chars = (char *) XSTRING_DATA (desc);
+      Bufbyte *string_chars = XSTRING_DATA (desc);
       wv->type = (separator_string_p (string_chars) ? SEPARATOR_TYPE :
                  TEXT_TYPE);
-#if 1
-      /* #### - should internationalize with X resources instead.
-         Not so! --ben */
-      string_chars = GETTEXT (string_chars);
-#endif
       if (wv->type == SEPARATOR_TYPE)
        {
-         wv->value = menu_separator_style (string_chars);
+         wv->value = menu_separator_style_and_to_external (string_chars);
        }
       else
        {
-         wv->name = xstrdup (string_chars);
+         LISP_STRING_TO_EXTERNAL_MALLOC (desc, wv->name, Qlwlib_encoding);
          wv->enabled = 1;
          /* dverna Dec. 98: command_builder_operate_menu_accelerator will
             manipulate the accel as a Lisp_Object if the widget has a name.
@@ -142,7 +139,7 @@ menu_item_descriptor_to_widget_value_1 (Lisp_Object desc,
       if (!button_item_to_widget_value (Qmenubar,
                                        gui_item, wv, 1,
                                        (menu_type == MENUBAR_TYPE
-                                        && depth <= 1), 1))
+                                        && depth <= 1), 1, 1))
        {
          /* :included form was nil */
          wv = NULL;
@@ -164,10 +161,9 @@ menu_item_descriptor_to_widget_value_1 (Lisp_Object desc,
          int active_spec = 0;
          wv->type = CASCADE_TYPE;
          wv->enabled = 1;
-         wv->name = (char *) XSTRING_DATA (LISP_GETTEXT (XCAR (desc)));
-         wv->name = strdup_and_add_accel (wv->name);
+         wv->name = add_accel_and_to_external (XCAR (desc));
 
-         accel = gui_name_accelerator (LISP_GETTEXT (XCAR (desc)));
+         accel = gui_name_accelerator (XCAR (desc));
          wv->accel = LISP_TO_VOID (accel);
 
          desc = Fcdr (desc);
@@ -177,8 +173,7 @@ menu_item_descriptor_to_widget_value_1 (Lisp_Object desc,
              Lisp_Object cascade = desc;
              desc = Fcdr (desc);
              if (NILP (desc))
-               signal_simple_error ("Keyword in menu lacks a value",
-                                    cascade);
+               syntax_error ("Keyword in menu lacks a value", cascade);
              val = Fcar (desc);
              desc = Fcdr (desc);
              if (EQ (key, Q_included))
@@ -195,14 +190,14 @@ menu_item_descriptor_to_widget_value_1 (Lisp_Object desc,
                       || CHARP (val))
                    wv->accel = LISP_TO_VOID (val);
                  else
-                   signal_simple_error ("bad keyboard accelerator", val);
+                   syntax_error ("bad keyboard accelerator", val);
                }
              else if (EQ (key, Q_label))
                {
                  /* implement in 21.2 */
                }
              else
-               signal_simple_error ("Unknown menu cascade keyword", cascade);
+               syntax_error ("Unknown menu cascade keyword", cascade);
            }
 
          if ((!NILP (config_tag)
@@ -256,7 +251,7 @@ menu_item_descriptor_to_widget_value_1 (Lisp_Object desc,
              title_wv->enabled = 1;
              title_wv->next = sep_wv;
              sep_wv->type = SEPARATOR_TYPE;
-             sep_wv->value = menu_separator_style ("==");
+             sep_wv->value = menu_separator_style_and_to_external ("==");
              sep_wv->next = 0;
 
              wv->contents = title_wv;
@@ -289,8 +284,7 @@ menu_item_descriptor_to_widget_value_1 (Lisp_Object desc,
        }
       else
        {
-         signal_simple_error ("Menu name (first element) must be a string",
-                               desc);
+         syntax_error ("Menu name (first element) must be a string", desc);
        }
 
       if (deep_p || menubar_root_p)
@@ -302,8 +296,9 @@ menu_item_descriptor_to_widget_value_1 (Lisp_Object desc,
              if (menubar_root_p && NILP (child))       /* the partition */
                {
                  if (partition_seen)
-                   error (
-                          "More than one partition (nil) in menubar description");
+                   syntax_error
+                     ("More than one partition (nil) in menubar description",
+                      desc);
                  partition_seen = 1;
                  next = xmalloc_widget_value ();
                  next->type = PUSHRIGHT_TYPE;
@@ -326,9 +321,9 @@ menu_item_descriptor_to_widget_value_1 (Lisp_Object desc,
        wv = NULL;
     }
   else if (NILP (desc))
-    error ("nil may not appear in menu descriptions");
+    syntax_error ("nil may not appear in menu descriptions", desc);
   else
-    signal_simple_error ("Unrecognized menu descriptor", desc);
+    syntax_error ("Unrecognized menu descriptor", desc);
 
  menu_item_done:
 
index f397934..7641aae 100644 (file)
@@ -371,6 +371,10 @@ This removes %_'s (accelerator indications) and converts %% to %.
       INC_CHARPTR (name_data);
     }
 
+  if (string_result_ptr - string_result == XSTRING_LENGTH (name)
+      && !memcmp (string_result, XSTRING_DATA (name), XSTRING_LENGTH (name)))
+    return name;
+
   return make_string (string_result, string_result_ptr - string_result);
 }
 
@@ -559,13 +563,15 @@ The possible keywords are:
                         :included (memq symbol menubar-configuration)
                     See the variable `menubar-configuration'.
 
- :filter <function>  A menu filter can only be used in a menu item list.
-                    (i.e. not in a menu item itself).  It is used to
+ :filter <function>  A menu filter can only be used at the beginning of a
+                     submenu description (i.e. not in a menu item itself).
+                    (Remember that most of the keywords can take evaluated
+                    expressions as well as constants.)  The filter is used to
                     incrementally create a submenu only when it is selected
                      by the user and not every time the menubar is activated.
                      The filter function is passed the list of menu items in
-                     the submenu and must return a list of menu items to be
-                     used for the menu.  It must not destructively modify
+                     the submenu and must return the modified list to be
+                    actually used.  The filter MUST NOT destructively modify
                      the list of menu items passed to it.  It is called only
                     when the menu is about to be displayed, so other menus
                     may already be displayed.  Vile and terrible things will
@@ -576,6 +582,7 @@ The possible keywords are:
 
  :key-sequence keys  Used in FSF Emacs as an hint to an equivalent keybinding.
                      Ignored by XEmacs for easymenu.el compatibility.
+                    (XEmacs computes this information automatically.)
 
 For example:
 
index 9b2cce8..fef111f 100644 (file)
@@ -65,7 +65,7 @@ Lisp_Object command_builder_operate_menu_accelerator (struct command_builder
 
 extern int in_menu_callback;
 #endif
+
 #endif /* HAVE_MENUBARS */
 
 #endif /* INCLUDED_menubar_h_ */
index 4d6aff2..fc15f56 100644 (file)
@@ -430,7 +430,7 @@ Lisp_Object Vccl_program_table;
                                        extended_command (rrr,RRR,Rrr,ARGS)
                                      */
 
-/* 
+/*
    Here after, Extended CCL Instructions.
    Bit length of extended command is 14.
    Therefore, the instruction code range is 0..16384(0x3fff).
@@ -489,7 +489,7 @@ Lisp_Object Vccl_program_table;
                                        3:MAP-ID1
                                        4:MAP-ID2
                                        ...
-                                    */ 
+                                    */
 
 /* Map the code in reg[rrr] by MAPs starting from the Nth (N =
    reg[RRR]) map.
@@ -560,7 +560,7 @@ Lisp_Object Vccl_program_table;
    where
        STARTPOINT is an offset to be used for indexing a map,
        ENDPOINT is a maximum index number of a map,
-       VAL and VALn is a number, nil, t, or lambda.  
+       VAL and VALn is a number, nil, t, or lambda.
 
    Valid index range of a map of type (a) is:
        STARTPOINT <= index < STARTPOINT + map_size - 1
@@ -752,7 +752,7 @@ struct ccl_prog_stack
     int ic;                    /* Instruction Counter.  */
   };
 
-/* For the moment, we only support depth 256 of stack.  */ 
+/* For the moment, we only support depth 256 of stack.  */
 static struct ccl_prog_stack ccl_prog_stack_struct[256];
 
 int
@@ -1137,7 +1137,7 @@ ccl_driver (struct ccl_program *ccl, const unsigned char *source,
                    src++;
                    goto ccl_read_multibyte_character_suspend;
                  }
-             
+
                i = *src++;
 #if 0
                if (i == LEADING_CODE_COMPOSITION)
@@ -1283,7 +1283,7 @@ ccl_driver (struct ccl_program *ccl, const unsigned char *source,
              SPLIT_CHAR (op, reg[RRR], i, j);
              if (j != -1)
                i = (i << 7) | j;
-             
+
              reg[rrr] = i;
              break;
 
@@ -1309,7 +1309,7 @@ ccl_driver (struct ccl_program *ccl, const unsigned char *source,
              SPLIT_CHAR (op, reg[RRR], i, j);
              if (j != -1)
                i = (i << 7) | j;
-             
+
              reg[rrr] = i;
              break;
 
@@ -1370,7 +1370,7 @@ ccl_driver (struct ccl_program *ccl, const unsigned char *source,
                        else
                          continue;
                      }
-                   else 
+                   else
                      continue;
 
                    if (NILP (content))
@@ -1402,7 +1402,7 @@ ccl_driver (struct ccl_program *ccl, const unsigned char *source,
                ic = fin_ic;
              }
              break;
-             
+
            case CCL_MapMultiple:
              {
                Lisp_Object map, content, attrib, value;
@@ -1479,7 +1479,7 @@ ccl_driver (struct ccl_program *ccl, const unsigned char *source,
                        else
                          continue;
                      }
-                   else 
+                   else
                      continue;
 
                    if (NILP (content))
@@ -1575,7 +1575,7 @@ ccl_driver (struct ccl_program *ccl, const unsigned char *source,
              }
              break;
 #endif
-             
+
            default:
              CCL_INVALID_CMD;
            }
@@ -1919,7 +1919,7 @@ Return index number of the registered CCL program.
    The rest elements are mapped numbers.
    Symbol t means to map to an original number before mapping.
    Symbol nil means that the corresponding element is empty.
-   Symbol lambda menas to terminate mapping here.
+   Symbol lambda means to terminate mapping here.
 */
 
 DEFUN ("register-code-conversion-map", Fregister_code_conversion_map,
@@ -1936,7 +1936,7 @@ Return index number of the registered map.")
 
   CHECK_SYMBOL (symbol, 0);
   CHECK_VECTOR (map, 1);
-  
+
   for (i = 0; i < len; i++)
     {
       Lisp_Object slot = XVECTOR (Vcode_conversion_map_vector)->contents[i];
index d79acab..ea04c9d 100644 (file)
@@ -690,7 +690,6 @@ character set.  Recognized properties are:
   int type;
   Lisp_Object registry = Qnil;
   Lisp_Object charset;
-  Lisp_Object rest, keyword, value;
   Lisp_Object ccl_program = Qnil;
   Lisp_Object short_name = Qnil, long_name = Qnil;
 
@@ -702,85 +701,87 @@ character set.  Recognized properties are:
   if (!NILP (charset))
     signal_simple_error ("Cannot redefine existing charset", name);
 
-  EXTERNAL_PROPERTY_LIST_LOOP (rest, keyword, value, props)
-    {
-      if (EQ (keyword, Qshort_name))
-       {
-         CHECK_STRING (value);
-         short_name = value;
-       }
-
-      if (EQ (keyword, Qlong_name))
-       {
-         CHECK_STRING (value);
-         long_name = value;
-       }
-
-      else if (EQ (keyword, Qdimension))
-       {
-         CHECK_INT (value);
-         dimension = XINT (value);
-         if (dimension < 1 || dimension > 2)
-           signal_simple_error ("Invalid value for 'dimension", value);
-       }
-
-      else if (EQ (keyword, Qchars))
-       {
-         CHECK_INT (value);
-         chars = XINT (value);
-         if (chars != 94 && chars != 96)
-           signal_simple_error ("Invalid value for 'chars", value);
-       }
-
-      else if (EQ (keyword, Qcolumns))
-       {
-         CHECK_INT (value);
-         columns = XINT (value);
-         if (columns != 1 && columns != 2)
-           signal_simple_error ("Invalid value for 'columns", value);
-       }
-
-      else if (EQ (keyword, Qgraphic))
-       {
-         CHECK_INT (value);
-         graphic = XINT (value);
-         if (graphic < 0 || graphic > 1)
-           signal_simple_error ("Invalid value for 'graphic", value);
-       }
-
-      else if (EQ (keyword, Qregistry))
-       {
-         CHECK_STRING (value);
-         registry = value;
-       }
-
-      else if (EQ (keyword, Qdirection))
-       {
-         if (EQ (value, Ql2r))
-           direction = CHARSET_LEFT_TO_RIGHT;
-         else if (EQ (value, Qr2l))
-           direction = CHARSET_RIGHT_TO_LEFT;
-         else
-           signal_simple_error ("Invalid value for 'direction", value);
-       }
-
-      else if (EQ (keyword, Qfinal))
-       {
-         CHECK_CHAR_COERCE_INT (value);
-         final = XCHAR (value);
-         if (final < '0' || final > '~')
-           signal_simple_error ("Invalid value for 'final", value);
-       }
-
-      else if (EQ (keyword, Qccl_program))
-       {
-         CHECK_VECTOR (value);
-         ccl_program = value;
-       }
-
-      else
-       signal_simple_error ("Unrecognized property", keyword);
-    }
+  {
+    EXTERNAL_PROPERTY_LIST_LOOP_3 (keyword, value, props)
+      {
+       if (EQ (keyword, Qshort_name))
+         {
+           CHECK_STRING (value);
+           short_name = value;
+         }
+
+       if (EQ (keyword, Qlong_name))
+         {
+           CHECK_STRING (value);
+           long_name = value;
+         }
+
+       else if (EQ (keyword, Qdimension))
+         {
+           CHECK_INT (value);
+           dimension = XINT (value);
+           if (dimension < 1 || dimension > 2)
+             signal_simple_error ("Invalid value for 'dimension", value);
+         }
+
+       else if (EQ (keyword, Qchars))
+         {
+           CHECK_INT (value);
+           chars = XINT (value);
+           if (chars != 94 && chars != 96)
+             signal_simple_error ("Invalid value for 'chars", value);
+         }
+
+       else if (EQ (keyword, Qcolumns))
+         {
+           CHECK_INT (value);
+           columns = XINT (value);
+           if (columns != 1 && columns != 2)
+             signal_simple_error ("Invalid value for 'columns", value);
+         }
+
+       else if (EQ (keyword, Qgraphic))
+         {
+           CHECK_INT (value);
+           graphic = XINT (value);
+           if (graphic < 0 || graphic > 1)
+             signal_simple_error ("Invalid value for 'graphic", value);
+         }
+
+       else if (EQ (keyword, Qregistry))
+         {
+           CHECK_STRING (value);
+           registry = value;
+         }
+
+       else if (EQ (keyword, Qdirection))
+         {
+           if (EQ (value, Ql2r))
+             direction = CHARSET_LEFT_TO_RIGHT;
+           else if (EQ (value, Qr2l))
+             direction = CHARSET_RIGHT_TO_LEFT;
+           else
+             signal_simple_error ("Invalid value for 'direction", value);
+         }
+
+       else if (EQ (keyword, Qfinal))
+         {
+           CHECK_CHAR_COERCE_INT (value);
+           final = XCHAR (value);
+           if (final < '0' || final > '~')
+             signal_simple_error ("Invalid value for 'final", value);
+         }
+
+       else if (EQ (keyword, Qccl_program))
+         {
+           CHECK_VECTOR (value);
+           ccl_program = value;
+         }
+
+       else
+         signal_simple_error ("Unrecognized property", keyword);
+      }
+  }
 
   if (!final)
     error ("'final must be specified");
@@ -1090,7 +1091,7 @@ character s with caron.
 
   CHECK_INT (arg1);
   /* It is useful (and safe, according to Olivier Galibert) to strip
-     the 8th bit off ARG1 and ARG2 becaue it allows programmers to
+     the 8th bit off ARG1 and ARG2 because it allows programmers to
      write (make-char 'latin-iso8859-2 CODE) where code is the actual
      Latin 2 code of the character.  */
   a1 = XINT (arg1) & 0x7f;
index 4733004..f098fff 100644 (file)
@@ -565,7 +565,7 @@ extern struct charset_lookup *chlook;
 
 #ifdef ERROR_CHECK_TYPECHECK
 /* int not Bufbyte even though that is the actual type of a leading byte.
-   This way, out-ot-range values will get caught rather than automatically
+   This way, out-of-range values will get caught rather than automatically
    truncated. */
 INLINE_HEADER Lisp_Object CHARSET_BY_LEADING_BYTE (int lb);
 INLINE_HEADER Lisp_Object
index e258857..e6d2a34 100644 (file)
@@ -1066,7 +1066,6 @@ or wnn_kaikakko and the CDR contains the value.
 {
   int             rc;
   struct wnn_param     param;
-  Lisp_Object tail, key, val;
   int  snum;
 
   if ((snum = check_wnn_server_type ()) == -1) return Qnil;
@@ -1074,34 +1073,36 @@ or wnn_kaikakko and the CDR contains the value.
   rc = jl_param_get (wnnfns_buf[snum], &param);
   if (rc < 0) return Qnil;
 
-  EXTERNAL_PROPERTY_LIST_LOOP (tail, key, val, Vsetvalues_alist)
-    {
-      int setval;
-      CHECK_INT (val);
-      setval = XINT (val);
-      if (EQ (key, Qwnn_n)) param.n = setval;
-      else if (EQ (key, Qwnn_nsho)) param.nsho = setval;
-      else if (EQ (key, Qwnn_hindo)) param.p1 = setval;
-      else if (EQ (key, Qwnn_len)) param.p2 = setval;
-      else if (EQ (key, Qwnn_jiri)) param.p3 = setval;
-      else if (EQ (key, Qwnn_flag)) param.p4 = setval;
-      else if (EQ (key, Qwnn_jisho)) param.p5 = setval;
-      else if (EQ (key, Qwnn_sbn)) param.p6 = setval;
-      else if (EQ (key, Qwnn_dbn_len)) param.p7 = setval;
-      else if (EQ (key, Qwnn_sbn_cnt)) param.p8 = setval;
-      else if (EQ (key, Qwnn_suuji)) param.p9 = setval;
-      else if (EQ (key, Qwnn_kana)) param.p10 = setval;
-      else if (EQ (key, Qwnn_eisuu)) param.p11 = setval;
-      else if (EQ (key, Qwnn_kigou)) param.p12 = setval;
-      else if (EQ (key, Qwnn_toji_kakko)) param.p13 = setval;
-      else if (EQ (key, Qwnn_fuzokogo)) param.p14 = setval;
-      else if (EQ (key, Qwnn_kaikakko)) param.p15 = setval;
-      else
-        {
-         signal_simple_error ("Invalid wnn keyword", key);
-         return Qnil;
-       }
-    }
+  {
+    EXTERNAL_PROPERTY_LIST_LOOP_3 (key, val, Vsetvalues_alist)
+      {
+       int setval;
+       CHECK_INT (val);
+       setval = XINT (val);
+       if (EQ (key, Qwnn_n)) param.n = setval;
+       else if (EQ (key, Qwnn_nsho)) param.nsho = setval;
+       else if (EQ (key, Qwnn_hindo)) param.p1 = setval;
+       else if (EQ (key, Qwnn_len)) param.p2 = setval;
+       else if (EQ (key, Qwnn_jiri)) param.p3 = setval;
+       else if (EQ (key, Qwnn_flag)) param.p4 = setval;
+       else if (EQ (key, Qwnn_jisho)) param.p5 = setval;
+       else if (EQ (key, Qwnn_sbn)) param.p6 = setval;
+       else if (EQ (key, Qwnn_dbn_len)) param.p7 = setval;
+       else if (EQ (key, Qwnn_sbn_cnt)) param.p8 = setval;
+       else if (EQ (key, Qwnn_suuji)) param.p9 = setval;
+       else if (EQ (key, Qwnn_kana)) param.p10 = setval;
+       else if (EQ (key, Qwnn_eisuu)) param.p11 = setval;
+       else if (EQ (key, Qwnn_kigou)) param.p12 = setval;
+       else if (EQ (key, Qwnn_toji_kakko)) param.p13 = setval;
+       else if (EQ (key, Qwnn_fuzokogo)) param.p14 = setval;
+       else if (EQ (key, Qwnn_kaikakko)) param.p15 = setval;
+       else
+         {
+           signal_simple_error ("Invalid wnn keyword", key);
+           return Qnil;
+         }
+      }
+  }
 
 #if 0
   printf("wnn_n = %d\n",param.n);
index ceba9a2..bc473aa 100644 (file)
--- a/src/nas.c
+++ b/src/nas.c
 #include <unistd.h>
 #endif
 
+/* NAS <= 1.2p5 defines {BIG,LITTLE}_ENDIAN in <audio/fileutil.h>,
+   conflicting with GNU libc (at least); newer versions avoid this
+   name space pollution.
 
+   DO NOT USE THOSE MACROS in this file.  Use NAS_{BIG,LITTLE}_ENDIAN.
+
+   It would be slightly more reliable to do this via configure, but that
+   seems unnecessarily complex.
+*/
 #undef LITTLE_ENDIAN
 #undef BIG_ENDIAN
+
 #include <audio/audiolib.h>
 #include <audio/soundlib.h>
 #include <audio/snd.h>
 #include <audio/wave.h>
 #include <audio/fileutil.h>
 
+/* NAS <= 1.2p5 <audio/fileutil.h> doesn't define the NAS_ versions */
+#ifndef NAS_LITTLE_ENDIAN
+#define NAS_LITTLE_ENDIAN LITTLE_ENDIAN
+#define NAS_BIG_ENDIAN BIG_ENDIAN
+#endif
+
 #ifdef emacs
 
 #    define XTOOLKIT
@@ -682,7 +697,7 @@ SndOpenDataForReading (const char *data,
 
   memcpy (&si->h, data, sizeof (SndHeader));
 
-  if (LITTLE_ENDIAN)
+  if (NAS_LITTLE_ENDIAN)
     {
       char            n;
     
@@ -834,7 +849,7 @@ readChunk (RiffChunk *c)
     char            n;
 
     if ((status = dread(c, sizeof(RiffChunk), 1)))
-       if (BIG_ENDIAN)
+       if (NAS_BIG_ENDIAN)
            swapl(&c->ckSize, n);
 
     return status;
@@ -920,18 +935,18 @@ WaveOpenDataForReading (const char *data,
        {
            AuInt32            dummy;
 
-           wi->format = DataReadS(BIG_ENDIAN);
-           wi->channels = DataReadS(BIG_ENDIAN);
-           wi->sampleRate = DataReadL(BIG_ENDIAN);
+           wi->format = DataReadS(NAS_BIG_ENDIAN);
+           wi->channels = DataReadS(NAS_BIG_ENDIAN);
+           wi->sampleRate = DataReadL(NAS_BIG_ENDIAN);
 
            /* we don't care about the next two fields */
-           dummy = DataReadL(BIG_ENDIAN);
-           dummy = DataReadS(BIG_ENDIAN);
+           dummy = DataReadL(NAS_BIG_ENDIAN);
+           dummy = DataReadS(NAS_BIG_ENDIAN);
 
            if (wi->format != RIFF_WAVE_FORMAT_PCM)
                Err();
 
-           wi->bitsPerSample = DataReadS(BIG_ENDIAN);
+           wi->bitsPerSample = DataReadS(NAS_BIG_ENDIAN);
 
            /* skip any other format specific fields */
            dseek(PAD2(ck.ckSize - 16), 1);
index 04dd422..63f682e 100644 (file)
--- a/src/nt.c
+++ b/src/nt.c
@@ -69,20 +69,6 @@ getwd (char *dir)
 #endif
 }
 
-/* Emulate getloadavg.  */
-int
-getloadavg (double loadavg[], int nelem)
-{
-  int i;
-
-  /* A faithful emulation is going to have to be saved for a rainy day.  */
-  for (i = 0; i < nelem; i++) 
-    {
-      loadavg[i] = 0.0;
-    }
-  return i;
-}
-
 /* Emulate getpwuid, getpwnam and others.  */
 
 #define PASSWD_FIELD_SIZE 256
@@ -1108,7 +1094,7 @@ readdir (DIR *dirp)
     }
   
   /* Emacs never uses this value, so don't bother making it match
-     value returned by stat().  */
+     value returned by xemacs_stat().  */
   dir_static.d_ino = 1;
   
   dir_static.d_reclen = sizeof (struct direct) - MAXNAMLEN + 3 +
index 939baf8..6a39332 100644 (file)
@@ -75,7 +75,7 @@ Lisp_Object Vwin32_start_process_share_console;
    but is useful for Win32 processes on both Win95 and NT as well.  */
 Lisp_Object Vwin32_pipe_read_delay;
 
-/* Control whether stat() attempts to generate fake but hopefully
+/* Control whether xemacs_stat() attempts to generate fake but hopefully
    "accurate" inode values, by hashing the absolute truenames of files.
    This should detect aliasing between long and short names, but still
    allows the possibility of hash collisions.  */
@@ -410,8 +410,10 @@ create_child (const char *exe, char *cmdline, char *env,
   start.hStdError = GetStdHandle (STD_ERROR_HANDLE);
 
   /* Explicitly specify no security */
+  /* #### not supported under win98, but will go away */
   if (!InitializeSecurityDescriptor (&sec_desc, SECURITY_DESCRIPTOR_REVISION))
     goto EH_Fail;
+  /* #### not supported under win98, but will go away */
   if (!SetSecurityDescriptorDacl (&sec_desc, TRUE, NULL, FALSE))
     goto EH_Fail;
   sec_attrs.nLength = sizeof (sec_attrs);
@@ -498,7 +500,7 @@ sys_spawnve (int mode, const char *cmdname,
     }
 
   /* Handle executable names without an executable suffix.  */
-  program = make_string (cmdname, strlen (cmdname));
+  program = build_string (cmdname);
   GCPRO1 (program);
   if (NILP (Ffile_executable_p (program)))
     {
@@ -1252,6 +1254,7 @@ If successful, the new locale id is returned, otherwise nil.
   if (!IsValidLocale (XINT (lcid), LCID_SUPPORTED))
     return Qnil;
 
+  /* #### not supported under win98, but will go away */
   if (!SetThreadLocale (XINT (lcid)))
     return Qnil;
 
index cb3a864..3621a12 100644 (file)
@@ -49,7 +49,7 @@ Boston, MA 02111-1307, USA.  */
 #include "device.h"
 #include "insdel.h"
 
-typedef struct colormap_t 
+typedef struct colormap_t
 {
   const char *name;
   COLORREF colorref;
@@ -58,10 +58,10 @@ typedef struct colormap_t
 /* Colors from X11R6 "XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp" */
 /* MSWindows tends to round up the numbers in it's palette, ie where X uses
  * 127, MSWindows uses 128. Colors commented as "Adjusted" are tweaked to
- * match the Windows standard palette to increase the likelyhood of
+ * match the Windows standard palette to increase the likelihood of
  * mswindows_color_to_string() finding a named match.
  */
-static const colormap_t mswindows_X_color_map[] = 
+static const colormap_t mswindows_X_color_map[] =
 {
   {"white"             , PALETTERGB (255, 255, 255) },
   {"black"             , PALETTERGB (0, 0, 0) },
@@ -727,14 +727,14 @@ static const colormap_t mswindows_X_color_map[] =
 };
 
 
-typedef struct fontmap_t 
+typedef struct fontmap_t
 {
   const char *name;
   int value;
 } fontmap_t;
 
 /* Default weight first, preferred names listed before synonyms */
-static const fontmap_t fontweight_map[] = 
+static const fontmap_t fontweight_map[] =
 {
   {"Regular"           , FW_REGULAR},  /* The standard font weight */
   {"Thin"              , FW_THIN},
@@ -752,9 +752,9 @@ static const fontmap_t fontweight_map[] =
   {"Black"             , FW_BLACK}
 };
 
-/* Default charset first, no synonyms allowed because these names are 
+/* Default charset first, no synonyms allowed because these names are
  * matched against the names reported by win32 by match_font() */
-static const fontmap_t charset_map[] = 
+static const fontmap_t charset_map[] =
 {
   {"Western"           , ANSI_CHARSET},
   {"Symbol"            , SYMBOL_CHARSET},
@@ -784,7 +784,7 @@ static const fontmap_t charset_map[] =
 /************************************************************************/
 
 static int
-hexval (char c) 
+hexval (char c)
 {
   /* assumes ASCII and isxdigit(c) */
   if (c >= 'a')
@@ -805,7 +805,7 @@ mswindows_string_to_color(const char *name)
       /* numeric names look like "#RRGGBB", "#RRRGGGBBB" or "#RRRRGGGGBBBB"
         or "rgb:rrrr/gggg/bbbb" */
       unsigned int r, g, b;
-  
+
       for (i=1; i<strlen(name); i++)
        {
          if (!isxdigit ((int)name[i]))
@@ -854,7 +854,7 @@ mswindows_string_to_color(const char *name)
            }
          return (PALETTERGB (r, g, b));
        }
-      else 
+      else
        return (COLORREF) -1;
     }
   else if (*name)      /* Can't be an empty string */
@@ -961,7 +961,70 @@ struct font_enum_t
 };
 
 static int CALLBACK
-font_enum_callback_2 (ENUMLOGFONTEX *lpelfe, NEWTEXTMETRICEX *lpntme, 
+old_font_enum_callback_2 (ENUMLOGFONT FAR *lpelfe, NEWTEXTMETRIC FAR *lpntme,
+                         int FontType, struct font_enum_t *font_enum)
+{
+  char fontname[MSW_FONTSIZE];
+  Lisp_Object fontname_lispstr;
+  int i;
+
+  /*
+   * The enumerated font weights are not to be trusted because:
+   *  a) lpelfe->elfStyle is only filled in for TrueType fonts.
+   *  b) Not all Bold and Italic styles of all fonts (including some Vector,
+   *     Truetype and Raster fonts) are enumerated.
+   * I guess that fonts for which Bold and Italic styles are generated
+   * 'on-the-fly' are not enumerated. It would be overly restrictive to
+   * disallow Bold And Italic weights for these fonts, so we just leave
+   * weights unspecified. This means that we have to weed out duplicates of
+   * those fonts that do get enumerated with different weights.
+   */
+  if (FontType == 0 /*vector*/ || FontType == TRUETYPE_FONTTYPE)
+    /* Scalable, so leave pointsize blank */
+    sprintf (fontname, "%s::::", lpelfe->elfLogFont.lfFaceName);
+  else
+    /* Formula for pointsize->height from LOGFONT docs in Platform SDK */
+    sprintf (fontname, "%s::%d::", lpelfe->elfLogFont.lfFaceName,
+            MulDiv (lpntme->tmHeight - lpntme->tmInternalLeading,
+                    72, GetDeviceCaps (font_enum->hdc, LOGPIXELSY)));
+
+  /*
+   * The enumerated font character set strings are not to be trusted because
+   * lpelfe->elfScript is returned in the host language and not in English.
+   * We can't know a priori the translations of "Western", "Central European"
+   * etc into the host language, so we must use English. The same argument
+   * applies to the font weight string when matching fonts.
+   */
+  for (i=0; i<countof (charset_map); i++)
+    if (lpelfe->elfLogFont.lfCharSet == charset_map[i].value)
+      {
+       strcat (fontname, charset_map[i].name);
+       break;
+      }
+  if (i==countof (charset_map))
+    strcpy (fontname, charset_map[0].name);
+
+  /* Add the font name to the list if not already there */
+  fontname_lispstr = build_string (fontname);
+  if (NILP (memq_no_quit (fontname_lispstr, font_enum->list)))
+    font_enum->list = Fcons (fontname_lispstr, font_enum->list);
+
+  return 1;
+}
+
+static int CALLBACK
+old_font_enum_callback_1 (ENUMLOGFONT FAR *lpelfe, NEWTEXTMETRIC FAR *lpntme,
+                         int FontType, struct font_enum_t *font_enum)
+{
+  /* This function gets called once per facename per character set.
+   * We call a second callback to enumerate the fonts in each facename */
+  return EnumFontFamilies (font_enum->hdc, lpelfe->elfLogFont.lfFaceName,
+                          (FONTENUMPROC) old_font_enum_callback_2,
+                          (LPARAM) font_enum);
+}
+
+static int CALLBACK
+font_enum_callback_2 (ENUMLOGFONTEX *lpelfe, NEWTEXTMETRICEX *lpntme,
                      int FontType, struct font_enum_t *font_enum)
 {
   char fontname[MSW_FONTSIZE];
@@ -971,7 +1034,7 @@ font_enum_callback_2 (ENUMLOGFONTEX *lpelfe, NEWTEXTMETRICEX *lpntme,
   /*
    * The enumerated font weights are not to be trusted because:
    *  a) lpelfe->elfStyle is only filled in for TrueType fonts.
-   *  b) Not all Bold and Italic styles of all fonts (inluding some Vector,
+   *  b) Not all Bold and Italic styles of all fonts (including some Vector,
    *     Truetype and Raster fonts) are enumerated.
    * I guess that fonts for which Bold and Italic styles are generated
    * 'on-the-fly' are not enumerated. It would be overly restrictive to
@@ -1013,14 +1076,14 @@ font_enum_callback_2 (ENUMLOGFONTEX *lpelfe, NEWTEXTMETRICEX *lpntme,
 }
 
 static int CALLBACK
-font_enum_callback_1 (ENUMLOGFONTEX *lpelfe, NEWTEXTMETRICEX *lpntme, 
+font_enum_callback_1 (ENUMLOGFONTEX *lpelfe, NEWTEXTMETRICEX *lpntme,
                      int FontType, struct font_enum_t *font_enum)
 {
   /* This function gets called once per facename per character set.
    * We call a second callback to enumerate the fonts in each facename */
-  return EnumFontFamiliesEx (font_enum->hdc, &lpelfe->elfLogFont,
-                            (FONTENUMPROC) font_enum_callback_2,
-                            (LPARAM) font_enum, 0);
+  return xEnumFontFamiliesExA (font_enum->hdc, &lpelfe->elfLogFont,
+                              (FONTENUMPROC) font_enum_callback_2,
+                              (LPARAM) font_enum, 0);
 }
 
 /*
@@ -1040,8 +1103,13 @@ mswindows_enumerate_fonts (HDC hdc)
   logfont.lfPitchAndFamily = DEFAULT_PITCH;
   font_enum.hdc = hdc;
   font_enum.list = Qnil;
-  EnumFontFamiliesEx (hdc, &logfont, (FONTENUMPROC) font_enum_callback_1,
-                     (LPARAM) (&font_enum), 0);
+  if (xEnumFontFamiliesExA)
+    xEnumFontFamiliesExA (hdc, &logfont, (FONTENUMPROC) font_enum_callback_1,
+                         (LPARAM) (&font_enum), 0);
+  else /* NT 3.5x */
+    EnumFontFamilies (hdc, 0, (FONTENUMPROC) old_font_enum_callback_1,
+                     (LPARAM) (&font_enum));
+
   return font_enum.list;
 }
 
@@ -1189,7 +1257,7 @@ static void
 mswindows_finalize_font_instance (Lisp_Font_Instance *f);
 
 /*
- * This is a work horse for both mswindows_initialize_font_instanc and
+ * This is a work horse for both mswindows_initialize_font_instance and
  * msprinter_initialize_font_instance.
  */
 static int
@@ -1263,7 +1331,7 @@ initialize_font_instance (Lisp_Font_Instance *f, Lisp_Object name,
 
   for (i=0; i<countof (fontweight_map); i++)
     if (!stricmp (weight, fontweight_map[i].name))
-      {        
+      {
        logfont.lfWeight = fontweight_map[i].value;
        break;
       }
@@ -1366,7 +1434,7 @@ initialize_font_instance (Lisp_Font_Instance *f, Lisp_Object name,
     effects[0] = '\0';
 
   /* Charset */
-  /* charset can be specified even if earlier fields havn't been */
+  /* charset can be specified even if earlier fields haven't been */
   if (fields < 5)
     {
       if ((c=strchr (extname, ':')) && (c=strchr (c+1, ':')) &&
@@ -1438,7 +1506,7 @@ initialize_font_instance (Lisp_Font_Instance *f, Lisp_Object name,
 
   f->data = xnew_and_zero (struct mswindows_font_instance_data);
   FONT_INSTANCE_MSWINDOWS_HFONT_VARIANT (f,0,0) = hfont;
-  
+
   /* Some underlined fonts have the descent of one pixel more than their
      non-underlined counterparts. Font variants though are assumed to have
      identical metrics. So get the font metrics from the underlined variant
@@ -1518,7 +1586,7 @@ mswindows_print_font_instance (Lisp_Font_Instance *f,
                               int escapeflag)
 {
   char buf[10];
-  sprintf (buf, " 0x%lx", 
+  sprintf (buf, " 0x%lx",
           (unsigned long)FONT_INSTANCE_MSWINDOWS_HFONT_VARIANT (f,0,0));
   write_c_string (buf, printcharfun);
 }
@@ -1583,7 +1651,7 @@ mswindows_font_instance_truename (Lisp_Font_Instance *f, Error_behavior errb)
       break;
     default:;
     }
-  
+
   return build_ext_string (extname, Qnative);
 }
 
@@ -1597,7 +1665,7 @@ mswindows_font_spec_matches_charset (struct device *d, Lisp_Object charset,
   /* #### Implement me */
   if (UNBOUNDP (charset))
     return 1;
-  
+
   return 1;
 }
 
@@ -1661,7 +1729,7 @@ console_type_create_objects_mswindows (void)
 /*  CONSOLE_HAS_METHOD (mswindows, mark_font_instance); */
   CONSOLE_HAS_METHOD (mswindows, print_font_instance);
   CONSOLE_HAS_METHOD (mswindows, finalize_font_instance);
-  CONSOLE_HAS_METHOD (mswindows, font_instance_truename); 
+  CONSOLE_HAS_METHOD (mswindows, font_instance_truename);
   CONSOLE_HAS_METHOD (mswindows, list_fonts);
 #ifdef MULE
   CONSOLE_HAS_METHOD (mswindows, font_spec_matches_charset);
@@ -1684,7 +1752,7 @@ console_type_create_objects_mswindows (void)
 /*  CONSOLE_INHERITS_METHOD (msprinter, mswindows, mark_font_instance); */
   CONSOLE_INHERITS_METHOD (msprinter, mswindows, print_font_instance);
   CONSOLE_INHERITS_METHOD (msprinter, mswindows, finalize_font_instance);
-  CONSOLE_INHERITS_METHOD (msprinter, mswindows, font_instance_truename); 
+  CONSOLE_INHERITS_METHOD (msprinter, mswindows, font_instance_truename);
   CONSOLE_INHERITS_METHOD (msprinter, mswindows, list_fonts);
 #ifdef MULE
   CONSOLE_INHERITS_METHOD (msprinter, mswindows, font_spec_matches_charset);
index f01de94..4db87ae 100644 (file)
@@ -50,7 +50,7 @@ struct mswindows_color_instance_data
    combinations.  Only the one at index 0, neither underlined nor
    struk through is created with the font instance. Other fonts are
    created as necessary during redisplay, using the one at index 0
-   as protptype */
+   as prototype */
 #define MSWINDOWS_NUM_FONT_VARIANTS 4
 struct mswindows_font_instance_data
 {
index 5c670d5..c0d87cd 100644 (file)
@@ -2,7 +2,7 @@
    Copyright (C) 1993, 1994 Free Software Foundation, Inc.
    Copyright (C) 1995 Board of Trustees, University of Illinois.
    Copyright (C) 1995 Tinker Systems.
-   Copyright (C) 1995, 1996 Ben Wing.
+   Copyright (C) 1995, 1996, 2000 Ben Wing.
    Copyright (C) 1995 Sun Microsystems, Inc.
 
 This file is part of XEmacs.
@@ -26,6 +26,8 @@ Boston, MA 02111-1307, USA.  */
 
 /* Authors: Jamie Zawinski, Chuck Thompson, Ben Wing */
 
+/* This file Mule-ized by Ben Wing, 7-10-00. */
+
 #include <config.h>
 #include "lisp.h"
 
@@ -51,7 +53,7 @@ int x_handle_non_fully_specified_fonts;
    match - tries the next nearest...
 
    Return value is 1 for normal success, 2 for nearest color success,
-   3 for Non-deallocable sucess. */
+   3 for Non-deallocable success. */
 int
 allocate_nearest_color (Display *display, Colormap colormap, Visual *visual,
                        XColor *color_def)
@@ -135,7 +137,8 @@ allocate_nearest_color (Display *display, Colormap colormap, Visual *visual,
                bl = color_def->blue << (bbits - 8);
              else
                bl = color_def->blue >> (8 - bbits);
-             color_def->pixel = (rd << rshift) | (gr << gshift) | (bl << bshift);
+             color_def->pixel = (rd << rshift) | (gr << gshift) | (bl <<
+                                                                   bshift);
              status = 3;
            }
        }
@@ -162,14 +165,14 @@ allocate_nearest_color (Display *display, Colormap colormap, Visual *visual,
          int x;
 
          if( cells == NULL )
-             {
-                 cells = alloca_array (XColor, no_cells);
-                 for (x = 0; x < no_cells; x++)
-                     cells[x].pixel = x;
+           {
+             cells = alloca_array (XColor, no_cells);
+             for (x = 0; x < no_cells; x++)
+               cells[x].pixel = x;
 
-                 /* read the current colormap */
-                 XQueryColors (display, colormap, cells, no_cells);
-             }
+             /* read the current colormap */
+             XQueryColors (display, colormap, cells, no_cells);
+           }
 
          nearest = 0;
          /* I'm assuming CSE so I'm not going to condense this. */
@@ -177,20 +180,24 @@ allocate_nearest_color (Display *display, Colormap colormap, Visual *visual,
                            * ((color_def->red >> 8) - (cells[0].red >> 8)))
                           +
                           (((color_def->green >> 8) - (cells[0].green >> 8))
-                           * ((color_def->green >> 8) - (cells[0].green >> 8)))
+                           * ((color_def->green >> 8) - (cells[0].green >>
+                                                         8)))
                           +
                           (((color_def->blue >> 8) - (cells[0].blue >> 8))
-                           * ((color_def->blue >> 8) - (cells[0].blue >> 8))));
+                           * ((color_def->blue >> 8) - (cells[0].blue >>
+                                                        8))));
          for (x = 1; x < no_cells; x++)
            {
              trial_delta = ((((color_def->red >> 8) - (cells[x].red >> 8))
                              * ((color_def->red >> 8) - (cells[x].red >> 8)))
                             +
                             (((color_def->green >> 8) - (cells[x].green >> 8))
-                             * ((color_def->green >> 8) - (cells[x].green >> 8)))
+                             * ((color_def->green >> 8) - (cells[x].green >>
+                                                           8)))
                             +
                             (((color_def->blue >> 8) - (cells[x].blue >> 8))
-                             * ((color_def->blue >> 8) - (cells[x].blue >> 8))));
+                             * ((color_def->blue >> 8) - (cells[x].blue >>
+                                                          8))));
 
              /* less? Ignore cells marked as previously failing */
              if( (trial_delta < nearest_delta) &&
@@ -204,22 +211,22 @@ allocate_nearest_color (Display *display, Colormap colormap, Visual *visual,
          color_def->green = cells[nearest].green;
          color_def->blue = cells[nearest].blue;
          if (XAllocColor (display, colormap, color_def) != 0)
-             status = 2;
+           status = 2;
          else
-             /* LSK: Either the colour map has changed since
-              * we read it, or the colour is allocated
-              * read/write... Mark this cmap entry so it's
-              * ignored in the next iteration.
-              */
-             cells[nearest].pixel = ULONG_MAX;
+           /* LSK: Either the colour map has changed since
+            * we read it, or the colour is allocated
+            * read/write... Mark this cmap entry so it's
+            * ignored in the next iteration.
+            */
+           cells[nearest].pixel = ULONG_MAX;
        }
     }
   return status;
 }
 
-int
-x_parse_nearest_color (struct device *d, XColor *color, Bufbyte *name,
-                      Bytecount len, Error_behavior errb)
+static int
+x_parse_nearest_color (struct device *d, XColor *color, Lisp_Object name,
+                      Error_behavior errb)
 {
   Display *dpy   = DEVICE_X_DISPLAY  (d);
   Colormap cmap  = DEVICE_X_COLORMAP (d);
@@ -229,24 +236,20 @@ x_parse_nearest_color (struct device *d, XColor *color, Bufbyte *name,
   xzero (*color);
   {
     const Extbyte *extname;
-    Extcount extnamelen;
 
-    TO_EXTERNAL_FORMAT (DATA, (name, len),
-                       ALLOCA, (extname, extnamelen),
-                       Qbinary);
-    result = XParseColor (dpy, cmap, (char *) extname, color);
+    LISP_STRING_TO_EXTERNAL (name, extname, Qx_color_name_encoding);
+    result = XParseColor (dpy, cmap, extname, color);
   }
   if (!result)
     {
-      maybe_signal_simple_error ("Unrecognized color", make_string (name, len),
-                                Qcolor, errb);
+      maybe_signal_simple_error ("Unrecognized color", name, Qcolor, errb);
       return 0;
     }
   result = allocate_nearest_color (dpy, cmap, visual, color);
   if (!result)
     {
-      maybe_signal_simple_error ("Couldn't allocate color",
-                                make_string (name, len), Qcolor, errb);
+      maybe_signal_simple_error ("Couldn't allocate color", name, Qcolor,
+                                errb);
       return 0;
     }
 
@@ -260,10 +263,7 @@ x_initialize_color_instance (Lisp_Color_Instance *c, Lisp_Object name,
   XColor color;
   int result;
 
-  result = x_parse_nearest_color (XDEVICE (device), &color,
-                                 XSTRING_DATA   (name),
-                                 XSTRING_LENGTH (name),
-                                 errb);
+  result = x_parse_nearest_color (XDEVICE (device), &color, name, errb);
 
   if (!result)
     return 0;
@@ -284,7 +284,7 @@ x_print_color_instance (Lisp_Color_Instance *c,
                        Lisp_Object printcharfun,
                        int escapeflag)
 {
-  char buf[100];
+  Bufbyte buf[100];
   XColor color = COLOR_INSTANCE_X_COLOR (c);
   sprintf (buf, " %ld=(%X,%X,%X)",
           color.pixel, color.red, color.green, color.blue);
@@ -300,7 +300,8 @@ x_finalize_color_instance (Lisp_Color_Instance *c)
        {
          if (COLOR_INSTANCE_X_DEALLOC (c))
            {
-             XFreeColors (DEVICE_X_DISPLAY (XDEVICE (c->device)), DEVICE_X_COLORMAP (XDEVICE (c->device)),
+             XFreeColors (DEVICE_X_DISPLAY (XDEVICE (c->device)),
+                          DEVICE_X_COLORMAP (XDEVICE (c->device)),
                           &COLOR_INSTANCE_X_COLOR (c).pixel, 1, 0);
            }
        }
@@ -348,10 +349,9 @@ x_valid_color_name_p (struct device *d, Lisp_Object color)
   XColor c;
   Display *dpy = DEVICE_X_DISPLAY (d);
   Colormap cmap = DEVICE_X_COLORMAP (d);
+  const Extbyte *extname;
 
-  const char *extname;
-
-  TO_EXTERNAL_FORMAT (LISP_STRING, color, C_STRING_ALLOCA, extname, Qctext);
+  LISP_STRING_TO_EXTERNAL (color, extname, Qx_color_name_encoding);
 
   return XParseColor (dpy, cmap, extname, &c);
 }
@@ -367,9 +367,9 @@ x_initialize_font_instance (Lisp_Font_Instance *f, Lisp_Object name,
 {
   Display *dpy = DEVICE_X_DISPLAY (XDEVICE (device));
   XFontStruct *xf;
-  const char *extname;
+  const Extbyte *extname;
 
-  TO_EXTERNAL_FORMAT (LISP_STRING, f->name, C_STRING_ALLOCA, extname, Qctext);
+  LISP_STRING_TO_EXTERNAL (f->name, extname, Qx_font_name_encoding);
   xf = XLoadQueryFont (dpy, extname);
 
   if (!xf)
@@ -466,7 +466,7 @@ x_print_font_instance (Lisp_Font_Instance *f,
                       Lisp_Object printcharfun,
                       int escapeflag)
 {
-  char buf[200];
+  Bufbyte buf[200];
   sprintf (buf, " 0x%lx", (unsigned long) FONT_INSTANCE_X_FONT (f)->fid);
   write_c_string (buf, printcharfun);
 }
@@ -503,12 +503,12 @@ x_finalize_font_instance (Lisp_Font_Instance *f)
    "bitstream" fonts even if the bitstream fonts are earlier in the path, and
    also picking 100dpi adobe fonts over 75dpi adobe fonts even though the
    75dpi are in the path earlier) but sometimes appears to be doing something
-   else entirely (for example, removing the bitsream fonts from the path will
+   else entirely (for example, removing the bitstream fonts from the path will
    cause the 75dpi adobe fonts to be used instead of the 100dpi, even though
    their relative positions in the path (and their names!) have not changed).
 
    The documentation for XSetFontPath() seems to indicate that the order of
-   entries in the font path means something, but it's pretty noncommital about
+   entries in the font path means something, but it's pretty noncommittal about
    it, and the spirit of the law is apparently not being obeyed...
 
    All the fonts I've seen have a property named `FONT' which contains the
@@ -570,14 +570,14 @@ x_finalize_font_instance (Lisp_Font_Instance *f)
    that the various servers are actually doing, please let me know!  -- jwz. */
 
 static int
-valid_x_font_name_p (Display *dpy, char *name)
+valid_x_font_name_p (Display *dpy, Extbyte *name)
 {
   /* Maybe this should be implemented by calling XLoadFont and trapping
      the error.  That would be a lot of work, and wasteful as hell, but
      might be more correct.
    */
   int nnames = 0;
-  char **names = 0;
+  SExtbyte **names = 0;
   if (! name)
     return 0;
   names = XListFonts (dpy, name, 1, &nnames);
@@ -586,11 +586,11 @@ valid_x_font_name_p (Display *dpy, char *name)
   return (nnames != 0);
 }
 
-static char *
+static Extbyte *
 truename_via_FONT_prop (Display *dpy, XFontStruct *font)
 {
   unsigned long value = 0;
-  char *result = 0;
+  Extbyte *result = 0;
   if (XGetFontProperty (font, XA_FONT, &value))
     result = XGetAtomName (dpy, value);
   /* result is now 0, or the string value of the FONT property. */
@@ -606,19 +606,19 @@ truename_via_FONT_prop (Display *dpy, XFontStruct *font)
   return result;       /* this must be freed by caller if non-0 */
 }
 
-static char *
+static Extbyte *
 truename_via_random_props (Display *dpy, XFontStruct *font)
 {
   struct device *d = get_device_from_display (dpy);
   unsigned long value = 0;
-  char *foundry, *family, *weight, *slant, *setwidth, *add_style;
+  Extbyte *foundry, *family, *weight, *slant, *setwidth, *add_style;
   unsigned long pixel, point, res_x, res_y;
-  char *spacing;
+  Extbyte *spacing;
   unsigned long avg_width;
-  char *registry, *encoding;
-  char composed_name [2048];
+  Extbyte *registry, *encoding;
+  Extbyte composed_name [2048];
   int ok = 0;
-  char *result;
+  Extbyte *result;
 
 #define get_string(atom,var)                           \
   if (XGetFontProperty (font, (atom), &value))         \
@@ -661,7 +661,7 @@ truename_via_random_props (Display *dpy, XFontStruct *font)
   if (ok)
     {
       int L = strlen (composed_name) + 1;
-      result = (char *) xmalloc (L);
+      result = (Extbyte *) xmalloc (L);
       strncpy (result, composed_name, L);
     }
   else
@@ -683,11 +683,11 @@ truename_via_random_props (Display *dpy, XFontStruct *font)
 /* Unbounded, for sufficiently small values of infinity... */
 #define MAX_FONT_COUNT 5000
 
-static char *
-truename_via_XListFonts (Display *dpy, char *font_name)
+static Extbyte *
+truename_via_XListFonts (Display *dpy, Extbyte *font_name)
 {
-  char *result = 0;
-  char **names;
+  Extbyte *result = 0;
+  SExtbyte **names;
   int count = 0;
 
 #ifndef XOPENFONT_SORTS
@@ -699,6 +699,7 @@ truename_via_XListFonts (Display *dpy, char *font_name)
   /* But the world I live in is much more perverse. */
   names = XListFonts (dpy, font_name, MAX_FONT_COUNT, &count);
   while (count--)
+    /* !!#### Not Mule-friendly */
     /* If names[count] is lexicographically less than result, use it.
        (#### Should we be comparing case-insensitively?) */
     if (result == 0 || (strcmp (result, names [count]) < 0))
@@ -714,11 +715,11 @@ truename_via_XListFonts (Display *dpy, char *font_name)
 }
 
 static Lisp_Object
-x_font_truename (Display *dpy, char *name, XFontStruct *font)
+x_font_truename (Display *dpy, Extbyte *name, XFontStruct *font)
 {
-  char *truename_FONT = 0;
-  char *truename_random = 0;
-  char *truename = 0;
+  Extbyte *truename_FONT = 0;
+  Extbyte *truename_random = 0;
+  Extbyte *truename = 0;
 
   /* The search order is:
      - if FONT property exists, and is a valid name, return it.
@@ -763,7 +764,7 @@ x_font_truename (Display *dpy, char *name, XFontStruct *font)
 
   if (truename)
     {
-      Lisp_Object result = build_string (truename);
+      Lisp_Object result = build_ext_string (truename, Qx_font_name_encoding);
       XFree (truename);
       return result;
     }
@@ -779,10 +780,12 @@ x_font_instance_truename (Lisp_Font_Instance *f, Error_behavior errb)
   if (NILP (FONT_INSTANCE_X_TRUENAME (f)))
     {
       Display *dpy = DEVICE_X_DISPLAY (d);
-      char *name = (char *) XSTRING_DATA (f->name);
       {
+       Extbyte *nameext;
+
+       LISP_STRING_TO_EXTERNAL (f->name, nameext, Qx_font_name_encoding);
        FONT_INSTANCE_X_TRUENAME (f) =
-         x_font_truename (dpy, name, FONT_INSTANCE_X_FONT (f));
+         x_font_truename (dpy, nameext, FONT_INSTANCE_X_FONT (f));
       }
       if (NILP (FONT_INSTANCE_X_TRUENAME (f)))
        {
@@ -790,7 +793,7 @@ x_font_instance_truename (Lisp_Font_Instance *f, Error_behavior errb)
          XSETFONT_INSTANCE (font_instance, f);
 
          maybe_signal_simple_error ("Couldn't determine font truename",
-                                  font_instance, Qfont, errb);
+                                    font_instance, Qfont, errb);
          /* Ok, just this once, return the font name as the truename.
             (This is only used by Fequal() right now.) */
          return f->name;
@@ -812,11 +815,14 @@ x_font_instance_properties (Lisp_Font_Instance *f)
   props = FONT_INSTANCE_X_FONT (f)->properties;
   for (i = FONT_INSTANCE_X_FONT (f)->n_properties - 1; i >= 0; i--)
     {
-      char *name_str = 0;
-      char *val_str = 0;
       Lisp_Object name, value;
       Atom atom = props [i].name;
-      name_str = XGetAtomName (dpy, atom);
+      Bufbyte *name_str = 0;
+      Extbyte *namestrext = XGetAtomName (dpy, atom);
+
+      if (namestrext)
+       EXTERNAL_TO_C_STRING (namestrext, name_str, Qx_atom_name_encoding);
+
       name = (name_str ? intern (name_str) : Qnil);
       if (name_str &&
          (atom == XA_FONT ||
@@ -841,12 +847,14 @@ x_font_instance_properties (Lisp_Font_Instance *f)
           !strcmp (name_str, "RELATIVE_WEIGHT") ||
           !strcmp (name_str, "STYLE")))
        {
-         val_str = XGetAtomName (dpy, props [i].card32);
-         value = (val_str ? build_string (val_str) : Qnil);
+         Extbyte *val_str = XGetAtomName (dpy, props [i].card32);
+
+         value = (val_str ? build_ext_string (val_str, Qx_atom_name_encoding)
+                  : Qnil);
        }
       else
        value = make_int (props [i].card32);
-      if (name_str) XFree (name_str);
+      if (namestrext) XFree (namestrext);
       result = Fcons (Fcons (name, value), result);
     }
   return result;
@@ -855,19 +863,18 @@ x_font_instance_properties (Lisp_Font_Instance *f)
 static Lisp_Object
 x_list_fonts (Lisp_Object pattern, Lisp_Object device)
 {
-  char **names;
+  SExtbyte **names;
   int count = 0;
   Lisp_Object result = Qnil;
-  const char *patternext;
+  const Extbyte *patternext;
 
-  TO_EXTERNAL_FORMAT (LISP_STRING, pattern,
-                     C_STRING_ALLOCA, patternext,
-                     Qbinary);
+  LISP_STRING_TO_EXTERNAL (pattern, patternext, Qx_font_name_encoding);
 
   names = XListFonts (DEVICE_X_DISPLAY (XDEVICE (device)),
                      patternext, MAX_FONT_COUNT, &count);
   while (count--)
-    result = Fcons (build_ext_string (names [count], Qbinary), result);
+    result = Fcons (build_ext_string (names[count], Qx_font_name_encoding),
+                   result);
   if (names)
     XFreeFontNames (names);
   return result;
@@ -929,28 +936,24 @@ x_font_spec_matches_charset (struct device *d, Lisp_Object charset,
 static Lisp_Object
 x_find_charset_font (Lisp_Object device, Lisp_Object font, Lisp_Object charset)
 {
-  char **names;
+  SExtbyte **names;
   int count = 0;
   Lisp_Object result = Qnil;
-  const char *patternext;
+  const Extbyte *patternext;
   int i;
 
-  TO_EXTERNAL_FORMAT (LISP_STRING, font,
-                     C_STRING_ALLOCA, patternext,
-                     Qbinary);
+  LISP_STRING_TO_EXTERNAL (font, patternext, Qx_font_name_encoding);
 
   names = XListFonts (DEVICE_X_DISPLAY (XDEVICE (device)),
                      patternext, MAX_FONT_COUNT, &count);
   /* #### This code seems awfully bogus -- mrb */
   for (i = 0; i < count; i ++)
     {
-      const char *intname;
+      const Bufbyte *intname;
 
-      TO_INTERNAL_FORMAT (C_STRING, names[i],
-                         C_STRING_ALLOCA, intname,
-                         Qbinary);
+      EXTERNAL_TO_C_STRING (names[i], intname, Qx_font_name_encoding);
       if (x_font_spec_matches_charset (XDEVICE (device), charset,
-                                      (Bufbyte *) intname, Qnil, 0, -1))
+                                      intname, Qnil, 0, -1))
        {
          result = build_string (intname);
          break;
index 8bfdfd1..9241c50 100644 (file)
@@ -22,6 +22,8 @@ Boston, MA 02111-1307, USA.  */
 
 /* Synched up with:  Not in FSF. */
 
+/* This file Mule-ized (more like Mule-verified) by Ben Wing, 7-10-00. */
+
 #ifndef INCLUDED_objects_x_h_
 #define INCLUDED_objects_x_h_
 
@@ -43,10 +45,8 @@ struct x_color_instance_data
 #define COLOR_INSTANCE_X_COLOR(c) (X_COLOR_INSTANCE_DATA (c)->color)
 #define COLOR_INSTANCE_X_DEALLOC(c) (X_COLOR_INSTANCE_DATA (c)->dealloc_on_gc)
 
-int allocate_nearest_color (Display *display, Colormap screen_colormap, Visual *visual,
-                           XColor *color_def);
-int x_parse_nearest_color (struct device *d, XColor *color, Bufbyte *name,
-                          Bytecount len, Error_behavior errb);
+int allocate_nearest_color (Display *display, Colormap screen_colormap,
+                           Visual *visual, XColor *color_def);
 
 /*****************************************************************************
  Font-Instance
index 2c27ff2..baccaad 100644 (file)
@@ -43,7 +43,7 @@ void
 finalose (void *ptr)
 {
   Lisp_Object obj;
-  XSETOBJ (obj, Lisp_Type_Record, ptr);
+  XSETOBJ (obj, ptr);
 
   signal_simple_error
     ("Can't dump an emacs containing window system objects", obj);
index 8276439..67d550a 100644 (file)
@@ -19,8 +19,8 @@ License along with this library; if not, write to the Free Software
 Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#ifndef INCLUDED_offix_h_
-#define INCLUDED_offix_h_
+#ifndef __DragAndDropH__
+#define __DragAndDropH__ 1L
 
 /* The standard DND types are defined here */
 #include "offix-types.h"
@@ -63,7 +63,6 @@ DndChangeCursor(int Type,
                int width,int height,
                char *image,char *mask,
                int hot_x,int hot_y);
-
-#endif /* INCLUDED_offix_h_ */
+#endif
 
 
index f98c244..afbbf0d 100644 (file)
@@ -52,7 +52,11 @@ Lisp_Object Vstandard_output, Qstandard_output;
 
 /* The subroutine object for external-debugging-output is kept here
    for the convenience of the debugger.  */
-Lisp_Object Qexternal_debugging_output;
+Lisp_Object Qexternal_debugging_output, Qalternate_debugging_output;
+
+#ifdef HAVE_MS_WINDOWS
+Lisp_Object Qmswindows_debugging_output;
+#endif
 
 /* Avoid actual stack overflow in print.  */
 static int print_depth;
@@ -105,10 +109,6 @@ FILE *termscript;  /* Stdio stream being used for copy of all output.  */
 
 int stdout_needs_newline;
 
-#ifdef WIN32_NATIVE
-static int no_useful_stderr;
-#endif
-
 static void
 std_handle_out_external (FILE *stream, Lisp_Object lstream,
                         const Extbyte *extptr, Extcount extlen,
@@ -120,12 +120,14 @@ std_handle_out_external (FILE *stream, Lisp_Object lstream,
   if (stream)
     {
 #ifdef WIN32_NATIVE
-      if (!no_useful_stderr)
-       no_useful_stderr = GetStdHandle (STD_ERROR_HANDLE) == 0 ? 1 : -1;
+      HANDLE errhand = GetStdHandle (STD_INPUT_HANDLE);
+      int no_useful_stderr = errhand == 0 || errhand == INVALID_HANDLE_VALUE;
 
+      if (!no_useful_stderr)
+       no_useful_stderr = !PeekNamedPipe (errhand, 0, 0, 0, 0, 0);
       /* we typically have no useful stdout/stderr under windows if we're
         being invoked graphically. */
-      if (!noninteractive || no_useful_stderr > 0)
+      if (no_useful_stderr)
        mswindows_output_console_string (extptr, extlen);
       else
 #endif
@@ -189,7 +191,7 @@ std_handle_out_va (FILE *stream, const char *fmt, va_list args)
       extptr = (Extbyte *) kludge;
       extlen = (Extcount) strlen ((char *) kludge);
     }
-  
+
   std_handle_out_external (stream, Qnil, extptr, extlen, 1, 1);
   return retval;
 }
@@ -1404,7 +1406,7 @@ print_symbol (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
      the flag print-gensym is non-nil, prefix it with #n= to read the
      object back with the #n# reader syntax later if needed.  */
   if (!NILP (Vprint_gensym)
-      /* #### Test whether this produces a noticable slow-down for
+      /* #### Test whether this produces a noticeable slow-down for
          printing when print-gensym is non-nil.  */
       && !EQ (obj, oblookup (Vobarray,
                             string_data (symbol_name (XSYMBOL (obj))),
@@ -1512,13 +1514,9 @@ print_symbol (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
   UNGCPRO;
 }
 \f
-/* #ifdef DEBUG_XEMACS */
 
-/* I don't like seeing `Note: Strange doc (not fboundp) for function
-   alternate-debugging-output @ 429542' -slb */
-/* #### Eek!  Any clue how to get rid of it?  In fact, how about
-   getting rid of this function altogether?  Does anything actually
-   *use* it?  --hniksic */
+/* Useful on systems or in places where writing to stdout is unavailable or
+   not working. */
 
 static int alternate_do_pointer;
 static char alternate_do_string[5000];
@@ -1546,7 +1544,6 @@ to 0.
   alternate_do_string[alternate_do_pointer] = 0;
   return character;
 }
-/* #endif / * DEBUG_XEMACS */
 
 DEFUN ("external-debugging-output", Fexternal_debugging_output, 1, 3, 0, /*
 Write CHAR-OR-STRING to stderr or stdout.
@@ -1658,6 +1655,12 @@ debug_print_no_newline (Lisp_Object debug_print_obj)
     Vprint_level = make_int (debug_print_level);
 
   print_internal (debug_print_obj, Qexternal_debugging_output, 1);
+  alternate_do_pointer = 0;
+  print_internal (debug_print_obj, Qalternate_debugging_output, 1);
+#ifdef WIN32_NATIVE
+  /* Write out to the debugger, as well */
+  print_internal (debug_print_obj, Qmswindows_debugging_output, 1);
+#endif
 
   Vinhibit_quit  = save_Vinhibit_quit;
   Vprint_level   = save_Vprint_level;
@@ -1783,6 +1786,10 @@ syms_of_print (void)
   DEFSUBR (Fexternal_debugging_output);
   DEFSUBR (Fopen_termscript);
   defsymbol (&Qexternal_debugging_output, "external-debugging-output");
+  defsymbol (&Qalternate_debugging_output, "alternate-debugging-output");
+#ifdef HAVE_MS_WINDOWS
+  defsymbol (&Qmswindows_debugging_output, "mswindows-debugging-output");
+#endif
   DEFSUBR (Fwith_output_to_temp_buffer);
 }
 
index cad1d18..9f2ad46 100644 (file)
@@ -42,6 +42,9 @@ Boston, MA 02111-1307, USA.  */
 #include <winsock.h>
 #endif
 
+/* Bound by win32-native.el */
+Lisp_Object Qmswindows_construct_process_command_line;
+
 /* Arbitrary size limit for code fragments passed to run_in_other_process */
 #define FRAGMENT_CODE_SIZE 32
 
@@ -407,10 +410,11 @@ enable_child_signals (HANDLE h_process)
 /* ---------------------------- the 95 way ------------------------------- */
 
 static BOOL CALLBACK
-find_child_console (HWND hwnd, struct nt_process_data *cp)
+find_child_console (HWND hwnd, long putada)
 {
   DWORD thread_id;
   DWORD process_id;
+  struct nt_process_data *cp = (struct nt_process_data *) putada;
 
   thread_id = GetWindowThreadProcessId (hwnd, &process_id);
   if (process_id == cp->dwProcessId)
@@ -608,7 +612,7 @@ send_signal_the_95_way (struct nt_process_data *cp, int pid, int signo)
 static int
 send_signal (struct nt_process_data *cp, int pid, int signo)
 {
-  return send_signal_the_nt_way (cp, pid, signo)
+  return (!mswindows_windows9x_p () && send_signal_the_nt_way (cp, pid, signo))
     || send_signal_the_95_way (cp, pid, signo);
 }
 
@@ -621,7 +625,7 @@ validate_signal_number (int signo)
   if (signo != SIGKILL && signo != SIGTERM
       && signo != SIGQUIT && signo != SIGINT
       && signo != SIGHUP)
-    signal_simple_error ("Signal number not supported", make_int (signo));
+    invalid_argument ("Signal number not supported", make_int (signo));
 }
 \f  
 /*-----------------------------------------------------------------------*/
@@ -672,7 +676,7 @@ static void
 signal_cannot_launch (Lisp_Object image_file, DWORD err)
 {
   mswindows_set_errno (err);
-  signal_simple_error_2 ("Error starting", image_file, lisp_strerror (errno));
+  report_file_error ("Error starting", image_file);
 }
 
 static void
@@ -720,31 +724,34 @@ nt_create_process (Lisp_Process *p,
      already does this. */
 
   /* Find out whether the application is windowed or not */
-  {
-    /* SHGetFileInfo tends to return ERROR_FILE_NOT_FOUND on most
-       errors. This leads to bogus error message. */
-    DWORD image_type;
-    char *p = strrchr ((char *)XSTRING_DATA (program), '.');
-    if (p != NULL &&
-       (stricmp (p, ".exe") == 0 ||
-        stricmp (p, ".com") == 0 ||
-        stricmp (p, ".bat") == 0 ||
-        stricmp (p, ".cmd") == 0))
-      {
-       image_type = SHGetFileInfo ((char *)XSTRING_DATA (program), 0,NULL,
-                                   0, SHGFI_EXETYPE);
-      }
-    else
-      {
-       char progname[MAX_PATH];
-       sprintf (progname, "%s.exe", (char *)XSTRING_DATA (program));
-       image_type = SHGetFileInfo (progname, 0, NULL, 0, SHGFI_EXETYPE);
-      }
-    if (image_type == 0)
-      signal_cannot_launch (program, (GetLastError () == ERROR_FILE_NOT_FOUND
-                                     ? ERROR_BAD_FORMAT : GetLastError ()));
-    windowed = HIWORD (image_type) != 0;
-  }
+  if (xSHGetFileInfoA)
+    {
+      /* SHGetFileInfo tends to return ERROR_FILE_NOT_FOUND on most
+        errors. This leads to bogus error message. */
+      DWORD image_type;
+      char *p = strrchr ((char *)XSTRING_DATA (program), '.');
+      if (p != NULL &&
+         (stricmp (p, ".exe") == 0 ||
+          stricmp (p, ".com") == 0 ||
+          stricmp (p, ".bat") == 0 ||
+          stricmp (p, ".cmd") == 0))
+       {
+         image_type = xSHGetFileInfoA ((char *)XSTRING_DATA (program), 0,NULL,
+                                       0, SHGFI_EXETYPE);
+       }
+      else
+       {
+         char progname[MAX_PATH];
+         sprintf (progname, "%s.exe", (char *)XSTRING_DATA (program));
+         image_type = xSHGetFileInfoA (progname, 0, NULL, 0, SHGFI_EXETYPE);
+       }
+      if (image_type == 0)
+       signal_cannot_launch (program, (GetLastError () == ERROR_FILE_NOT_FOUND
+                                       ? ERROR_BAD_FORMAT : GetLastError ()));
+      windowed = HIWORD (image_type) != 0;
+    }
+  else /* NT 3.5; we have no idea so just guess. */
+    windowed = 0;
 
   /* Decide whether to do I/O on process handles, or just mark the
      process exited immediately upon successful launching. We do I/O if the
@@ -782,264 +789,35 @@ nt_create_process (Lisp_Process *p,
       hmyslurp = htmp;
     }
 
-  /* Convert an argv vector into Win32 style command line. */
+  /* Convert an argv vector into Win32 style command line by a call to
+     lisp function `mswindows-construct-process-command-line'
+     (in win32-native.el) */
   {
     int i;
-    Bufbyte **quoted_args;
-    int is_dos_app, is_cygnus_app;
-    int is_command_shell;
-    int do_quoting = 0;
-    char escape_char = 0;
-
-    nargv++; /* include program; we access argv offset by 1 below */
-    quoted_args = alloca_array (Bufbyte *, nargv);
-
-    /* Determine whether program is a 16-bit DOS executable, or a Win32
-       executable that is implicitly linked to the Cygnus dll (implying it
-       was compiled with the Cygnus GNU toolchain and hence relies on
-       cygwin.dll to parse the command line - we use this to decide how to
-       escape quote chars in command line args that must be quoted). */
-    mswindows_executable_type (XSTRING_DATA (program),
-                              &is_dos_app, &is_cygnus_app);
+    Lisp_Object args_or_ret = Qnil;
+    struct gcpro gcpro1;
 
-    {
-      /* #### Bleeeeeeeeeeeeeeeeech!!!!  The command shells appear to
-        use '^' as a quote character, at least under NT.  #### I haven't
-        tested 95.  If it allows no quoting conventions at all, set
-        escape_char to 0 and the code below will work. (e.g. NT tolerates
-         no quoting -- this command
-
-         cmd /c "ls "/Program Files""
-
-         actually works.) */
-        
-      struct gcpro gcpro1, gcpro2;
-      Lisp_Object progname = Qnil;
-
-      GCPRO2 (program, progname);
-      progname = Ffile_name_nondirectory (program);
-      progname = Fdowncase (progname, Qnil);
-
-      is_command_shell =
-       internal_equal (progname, build_string ("command.com"), 0)
-       || internal_equal (progname, build_string ("cmd.exe"), 0);
-      UNGCPRO;
-    }
-       
-#if 0
-    /* #### we need to port this. */
-    /* On Windows 95, if cmdname is a DOS app, we invoke a helper
-       application to start it by specifying the helper app as cmdname,
-       while leaving the real app name as argv[0].  */
-    if (is_dos_app)
-      {
-       cmdname = (char*) alloca (MAXPATHLEN);
-       if (egetenv ("CMDPROXY"))
-         strcpy ((char*)cmdname, egetenv ("CMDPROXY"));
-       else
-         {
-           strcpy ((char*)cmdname, XSTRING_DATA (Vinvocation_directory));
-           strcat ((char*)cmdname, "cmdproxy.exe");
-         }
-      }
-#endif
-  
-    /* we have to do some conjuring here to put argv and envp into the
-       form CreateProcess wants...  argv needs to be a space separated/null
-       terminated list of parameters, and envp is a null
-       separated/double-null terminated list of parameters.
-
-       Additionally, zero-length args and args containing whitespace or
-       quote chars need to be wrapped in double quotes - for this to work,
-       embedded quotes need to be escaped as well.  The aim is to ensure
-       the child process reconstructs the argv array we start with
-       exactly, so we treat quotes at the beginning and end of arguments
-       as embedded quotes.
-
-       The Win32 GNU-based library from Cygnus doubles quotes to escape
-       them, while MSVC uses backslash for escaping.  (Actually the MSVC
-       startup code does attempt to recognize doubled quotes and accept
-       them, but gets it wrong and ends up requiring three quotes to get a
-       single embedded quote!)  So by default we decide whether to use
-       quote or backslash as the escape character based on whether the
-       binary is apparently a Cygnus compiled app.
-
-       Note that using backslash to escape embedded quotes requires
-       additional special handling if an embedded quote is already
-       preceded by backslash, or if an arg requiring quoting ends with
-       backslash.  In such cases, the run of escape characters needs to be
-       doubled.  For consistency, we apply this special handling as long
-       as the escape character is not quote.
-   
-       Since we have no idea how large argv and envp are likely to be we
-       figure out list lengths on the fly and allocate them.  */
-  
-    if (!NILP (Vmswindows_quote_process_args))
-      {
-       do_quoting = 1;
-       /* Override escape char by binding mswindows-quote-process-args to
-          desired character, or use t for auto-selection.  */
-       if (INTP (Vmswindows_quote_process_args))
-         escape_char = (char) XINT (Vmswindows_quote_process_args);
-       else
-         escape_char = is_command_shell ? '^' : is_cygnus_app ? '"' : '\\';
-      }
-  
-    /* do argv...  */
-    for (i = 0; i < nargv; ++i)
-      {
-       Bufbyte *targ = XSTRING_DATA (i == 0 ? program : argv[i - 1]);
-       Bufbyte *p = targ;
-       int need_quotes = 0;
-       int escape_char_run = 0;
-       int arglen = 0;
-
-       if (*p == 0)
-         need_quotes = 1;
-       for ( ; *p; p++)
-         {
-           if (*p == '"')
-             {
-               /* allow for embedded quotes to be escaped */
-               if (escape_char)
-                 arglen++;
-               need_quotes = 1;
-               /* handle the case where the embedded quote is already escaped */
-               if (escape_char_run > 0)
-                 {
-                   /* To preserve the arg exactly, we need to double the
-                      preceding escape characters (plus adding one to
-                      escape the quote character itself).  */
-                   arglen += escape_char_run;
-                 }
-             }
-           else if (*p == ' ' || *p == '\t')
-             {
-               need_quotes = 1;
-             }
-
-           if (escape_char && *p == escape_char && escape_char != '"')
-             escape_char_run++;
-           else
-             escape_char_run = 0;
-         }
-       if (need_quotes)
-         {
-           arglen += 2;
-           /* handle the case where the arg ends with an escape char - we
-              must not let the enclosing quote be escaped.  */
-           if (escape_char_run > 0)
-             arglen += escape_char_run;
-         }
-       arglen += strlen (targ) + 1;
-
-       quoted_args[i] = alloca_array (Bufbyte, arglen); 
-      }
+    GCPRO1 (args_or_ret);
 
     for (i = 0; i < nargv; ++i)
-      {
-       Bufbyte *targ = XSTRING_DATA (i == 0 ? program : argv[i - 1]);
-       Bufbyte *p = targ;
-       int need_quotes = 0;
-       Bufbyte *parg = quoted_args[i];
-
-       if (*p == 0)
-         need_quotes = 1;
+      args_or_ret = Fcons (*argv++, args_or_ret);
+    args_or_ret = Fnreverse (args_or_ret);
+    args_or_ret = Fcons (program, args_or_ret);
 
-       if (do_quoting)
-         {
-           for ( ; *p; p++)
-             if (*p == ' ' || *p == '\t' || *p == '"')
-               need_quotes = 1;
-         }
-       if (need_quotes)
-         {
-           int escape_char_run = 0;
-           Bufbyte * first;
-           Bufbyte * last;
-
-           p = targ;
-           first = p;
-           last = p + strlen (p) - 1;
-           *parg++ = '"';
-#if 0
-           /* This version does not escape quotes if they occur at the
-              beginning or end of the arg - this could lead to incorrect
-              behavior when the arg itself represents a command line
-              containing quoted args.  I believe this was originally done
-              as a hack to make some things work, before
-              `mswindows-quote-process-args' was added.  */
-           while (*p)
-             {
-               if (*p == '"' && p > first && p < last)
-                 *parg++ = escape_char;        /* escape embedded quotes */
-               *parg++ = *p++;
-             }
-#else
-           for ( ; *p; p++)
-             {
-               if (escape_char && *p == '"')
-                 {
-                   /* double preceding escape chars if any */
-                   while (escape_char_run > 0)
-                     {
-                       *parg++ = escape_char;
-                       escape_char_run--;
-                     }
-                   /* escape all quote chars, even at beginning or end */
-                   *parg++ = escape_char;
-                 }
-               *parg++ = *p;
-
-               if (escape_char && *p == escape_char && escape_char != '"')
-                 escape_char_run++;
-               else
-                 escape_char_run = 0;
-             }
-           /* double escape chars before enclosing quote */
-           while (escape_char_run > 0)
-             {
-               *parg++ = escape_char;
-               escape_char_run--;
-             }
-#endif
-           *parg++ = '"';
-         }
-       else
-         {
-           strcpy (parg, targ);
-           parg += strlen (targ);
-         }
-       *parg = '\0';
-      }
+    args_or_ret = call1 (Qmswindows_construct_process_command_line,
+                        args_or_ret);
 
-    {
-      int total_cmdline_len = 0;
-      Extcount *extargcount = (Extcount *) alloca_array (Extcount, nargv);
-      Extbyte **extarg = (Extbyte **) alloca_array (Extbyte *, nargv);
-      Extbyte *command_ptr;
+    if (!STRINGP (args_or_ret))
+      /* Luser wrote his/her own clever version */
+      invalid_argument
+       ("Bogus return value from `mswindows-construct-process-command-line'",
+        args_or_ret);
 
-      for (i = 0; i < nargv; ++i)
-       {
-         TO_EXTERNAL_FORMAT (C_STRING, quoted_args[i], ALLOCA,
-                             (extarg[i], extargcount[i]), Qmswindows_tstr);
-         /* account for space and terminating null */
-         total_cmdline_len += extargcount[i] + EITCHAR_SIZE;
-       }
+    LISP_STRING_TO_EXTERNAL (args_or_ret, command_line, Qmswindows_tstr);
 
-      command_line = alloca_array (char, total_cmdline_len);
-      command_ptr = command_line;
-      for (i = 0; i < nargv; ++i)
-       {
-         memcpy (command_ptr, extarg[i], extargcount[i]);
-         command_ptr += extargcount[i];
-         EICOPY_TCHAR (command_ptr, ' ');
-         command_ptr += EITCHAR_SIZE;
-       }
-      EICOPY_TCHAR (command_ptr, '\0');
-      command_ptr += EITCHAR_SIZE;
-    }
+    UNGCPRO; /* args_or_ret */
   }
+
   /* Set `proc_env' to a nul-separated array of the strings in
      Vprocess_environment terminated by 2 nuls.  */
  
@@ -1123,6 +901,24 @@ nt_create_process (Lisp_Process *p,
       }
     *penv = 0;
   }
+
+#if 0
+    /* #### we need to port this. */
+    /* On Windows 95, if cmdname is a DOS app, we invoke a helper
+       application to start it by specifying the helper app as cmdname,
+       while leaving the real app name as argv[0].  */
+    if (is_dos_app)
+      {
+       cmdname = (char*) alloca (MAXPATHLEN);
+       if (egetenv ("CMDPROXY"))
+         strcpy ((char*)cmdname, egetenv ("CMDPROXY"));
+       else
+         {
+           strcpy ((char*)cmdname, XSTRING_DATA (Vinvocation_directory));
+           strcat ((char*)cmdname, "cmdproxy.exe");
+         }
+      }
+#endif
   
   /* Create process */
   {
@@ -1276,8 +1072,8 @@ nt_send_process (Lisp_Object proc, struct lstream* lstream)
          p->tick++;
          process_tick++;
          deactivate_process (*((Lisp_Object *) (&vol_proc)));
-         error ("Broken pipe error sending to process %s; closed it",
-                XSTRING_DATA (p->name));
+         invalid_operation ("Broken pipe error sending to process; closed it",
+                            p->name);
        }
 
       {
@@ -1320,7 +1116,7 @@ nt_kill_child_process (Lisp_Object proc, int signo,
 
   /* Send signal */
   if (!send_signal (NT_DATA (p), 0, signo))
-    signal_simple_error ("Cannot send signal to process", proc);
+    invalid_operation ("Cannot send signal to process", proc);
 }
 
 /*
@@ -1462,7 +1258,7 @@ nt_open_network_stream (Lisp_Object name, Lisp_Object host,
   CHECK_STRING (host);
 
   if (!EQ (protocol, Qtcp))
-    signal_simple_error ("Unsupported protocol", protocol);
+    invalid_argument ("Unsupported protocol", protocol);
 
   if (INTP (service))
     port = htons ((unsigned short) XINT (service));
@@ -1472,7 +1268,7 @@ nt_open_network_stream (Lisp_Object name, Lisp_Object host,
       CHECK_STRING (service);
       svc_info = getservbyname ((char *) XSTRING_DATA (service), "tcp");
       if (svc_info == 0)
-       signal_simple_error ("Unknown service", service);
+       invalid_argument ("Unknown service", service);
       port = svc_info->s_port;
     }
 
@@ -1581,6 +1377,7 @@ process_type_create_nt (void)
 void
 syms_of_process_nt (void)
 {
+  DEFSYMBOL (Qmswindows_construct_process_command_line);
 }
 
 void
index ebe75c6..3523f6c 100644 (file)
@@ -61,6 +61,9 @@ Boston, MA 02111-1307, USA.  */
 #include "systty.h"
 #include "syswait.h"
 
+#ifdef HPUX
+#include <grp.h>               /* See grantpt fixups for HPUX below. */
+#endif
 
 /*
  * Implementation-specific data. Pointed to by Lisp_Process->process_data
@@ -83,12 +86,6 @@ struct unix_process_data
 
 #define UNIX_DATA(p) ((struct unix_process_data*)((p)->process_data))
 
-#ifdef HAVE_PTYS
-/* The file name of the pty opened by allocate_pty.  */
-
-static char pty_name[24];
-#endif
-
 
 \f
 /**********************************************************************/
@@ -152,17 +149,17 @@ close_process_descs (void)
 /* This function used to be visible on the Lisp level, but there is no
    real point in doing that.  Here is the doc string:
 
-  "Connect to an existing file descriptor.\n\
-Returns a subprocess-object to represent the connection.\n\
-Input and output work as for subprocesses; `delete-process' closes it.\n\
-Args are NAME BUFFER INFD OUTFD.\n\
-NAME is name for process.  It is modified if necessary to make it unique.\n\
-BUFFER is the buffer (or buffer-name) to associate with the process.\n\
- Process output goes at end of that buffer, unless you specify\n\
- an output stream or filter function to handle the output.\n\
- BUFFER may be also nil, meaning that this process is not associated\n\
- with any buffer\n\
-INFD and OUTFD specify the file descriptors to use for input and\n\
+  "Connect to an existing file descriptor.
+Return a subprocess-object to represent the connection.
+Input and output work as for subprocesses; `delete-process' closes it.
+Args are NAME BUFFER INFD OUTFD.
+NAME is name for process.  It is modified if necessary to make it unique.
+BUFFER is the buffer (or buffer-name) to associate with the process.
+ Process output goes at end of that buffer, unless you specify
+ an output stream or filter function to handle the output.
+ BUFFER may also be nil, meaning that this process is not associated
+ with any buffer.
+INFD and OUTFD specify the file descriptors to use for input and
  output, respectively."
 */
 
@@ -179,15 +176,16 @@ connect_to_file_descriptor (Lisp_Object name, Lisp_Object buffer,
   CHECK_INT (outfd);
 
   inch = XINT (infd);
-  if (get_process_from_usid (FD_TO_USID(inch)))
-    error ("There is already a process connected to fd %d", inch);
+  if (get_process_from_usid (FD_TO_USID (inch)))
+    invalid_operation ("There is already a process connected to fd", infd);
   if (!NILP (buffer))
     buffer = Fget_buffer_create (buffer);
   proc = make_process_internal (name);
 
   XPROCESS (proc)->pid = Fcons (infd, name);
   XPROCESS (proc)->buffer = buffer;
-  init_process_io_handles (XPROCESS (proc), (void*)inch, (void*)XINT (outfd), 0);
+  init_process_io_handles (XPROCESS (proc), (void*)inch, (void*)XINT (outfd),
+                          0);
   UNIX_DATA (XPROCESS (proc))->connected_via_filedesc_p = 1;
 
   event_stream_select_process (XPROCESS (proc));
@@ -196,16 +194,162 @@ connect_to_file_descriptor (Lisp_Object name, Lisp_Object buffer,
 }
 
 #ifdef HAVE_PTYS
+static int allocate_pty_the_old_fashioned_way (void);
+
+/* The file name of the (slave) pty opened by allocate_pty().  */
+#ifndef MAX_PTYNAME_LEN
+#define MAX_PTYNAME_LEN 64
+#endif
+static char pty_name[MAX_PTYNAME_LEN];
 
 /* Open an available pty, returning a file descriptor.
    Return -1 on failure.
    The file name of the terminal corresponding to the pty
-   is left in the variable pty_name.  */
+   is left in the variable `pty_name'.  */
 
 static int
 allocate_pty (void)
 {
-#ifndef PTY_OPEN
+  /* Unix98 standardized grantpt, unlockpt, and ptsname, but not the
+     functions required to open a master pty in the first place :-(
+
+     Modern Unix systems all seems to have convenience methods to open
+     a master pty fd in one function call, but there is little
+     agreement on how to do it.
+
+     allocate_pty() tries all the different known easy ways of opening
+     a pty.  In case of failure, we resort to the old BSD-style pty
+     grovelling code in allocate_pty_the_old_fashioned_way(). */
+  int master_fd = -1;
+  const char *slave_name = NULL;
+  const char *clone = NULL;
+  static const char * const clones[] = /* Different pty master clone devices */
+    {
+      "/dev/ptmx",      /* Various systems */
+      "/dev/ptm/clone", /* HPUX */
+      "/dev/ptc",       /* AIX */
+      "/dev/ptmx_bsd"   /* Tru64 */
+    };
+
+#ifdef HAVE_GETPT /* glibc */
+  master_fd = getpt ();
+  if (master_fd >= 0)
+    goto have_master;
+#endif /* HAVE_GETPT */
+
+
+#if defined(HAVE_OPENPTY) /* BSD, Tru64, glibc */
+  {
+    int slave_fd = -1;
+    int rc;
+    EMACS_BLOCK_SIGNAL (SIGCHLD);
+    rc = openpty (&master_fd, &slave_fd, NULL, NULL, NULL);
+    EMACS_UNBLOCK_SIGNAL (SIGCHLD);
+    if (rc == 0)
+      {
+       slave_name = ttyname (slave_fd);
+       close (slave_fd);
+       goto have_slave_name;
+      }
+    else
+      {
+       if (master_fd >= 0)
+         close (master_fd);
+       if (slave_fd >= 0)
+         close (slave_fd);
+      }
+  }
+#endif /* HAVE_OPENPTY */
+
+#if defined(HAVE__GETPTY) && defined (O_NDELAY) /* SGI */
+  master_fd = -1;
+  EMACS_BLOCK_SIGNAL (SIGCHLD);
+  slave_name = _getpty (&master_fd, O_RDWR | O_NDELAY, 0600, 0);
+  EMACS_UNBLOCK_SIGNAL (SIGCHLD);
+  if (master_fd >= 0 && slave_name != NULL)
+    goto have_slave_name;
+#endif /* HAVE__GETPTY */
+
+  /* Master clone devices are available on most systems */
+  {
+    int i;
+    for (i = 0; i < countof (clones); i++)
+      {
+       clone = clones[i];
+       master_fd = open (clone, O_RDWR | O_NONBLOCK | OPEN_BINARY, 0);
+       if (master_fd >= 0)
+         goto have_master;
+      }
+    clone = NULL;
+  }
+
+  goto lose;
+
+ have_master:
+
+#if defined (HAVE_PTSNAME)
+  slave_name = ptsname (master_fd);
+  if (slave_name)
+    goto have_slave_name;
+#endif
+
+  /* AIX docs say to use ttyname, not ptsname, to get slave_name */
+  if (clone
+      && !strcmp (clone, "/dev/ptc")
+      && (slave_name = ttyname (master_fd)) != NULL)
+    goto have_slave_name;
+
+  goto lose;
+
+ have_slave_name:
+  strncpy (pty_name, slave_name, sizeof (pty_name));
+  pty_name[sizeof (pty_name) - 1] = '\0';
+  setup_pty (master_fd);
+
+  /* We jump through some hoops to frob the pty.
+     It's not obvious that checking the return code here is useful. */
+
+  /* "The grantpt() function will fail if it is unable to successfully
+      invoke the setuid root program.  It may also fail if the
+      application has installed a signal handler to catch SIGCHLD
+      signals." */
+#if defined (HAVE_GRANTPT) || defined (HAVE_UNLOCKPT)
+  EMACS_BLOCK_SIGNAL (SIGCHLD);
+
+#if defined (HAVE_GRANTPT)
+  grantpt (master_fd);
+#ifdef HPUX
+  /* grantpt() behavior on some versions of HP-UX differs from what's
+     specified in the man page: the group of the slave PTY is set to
+     the user's primary group, and we fix that. */
+  {
+    struct group *tty_group = getgrnam ("tty");
+    if (tty_group != NULL)
+      chown (pty_name, (uid_t) -1, tty_group->gr_gid);
+  }
+#endif /* HPUX has broken grantpt() */
+#endif /* HAVE_GRANTPT */
+
+#if defined (HAVE_UNLOCKPT)
+  unlockpt (master_fd);
+#endif
+
+  EMACS_UNBLOCK_SIGNAL (SIGCHLD);
+#endif /* HAVE_GRANTPT || HAVE_UNLOCKPT */
+
+  return master_fd;
+
+ lose:
+  if (master_fd >= 0)
+    close (master_fd);
+  return allocate_pty_the_old_fashioned_way ();
+}
+
+/* This function tries to allocate a pty by iterating through file
+   pairs with names like /dev/ptyp1 and /dev/ttyp1. */
+static int
+allocate_pty_the_old_fashioned_way (void)
+{
   struct stat stb;
 
   /* Some systems name their pseudoterminals so that there are gaps in
@@ -214,19 +358,20 @@ allocate_pty (void)
      three failures in a row before deciding that we've reached the
      end of the ptys.  */
   int failed_count = 0;
-#endif
   int fd;
-#ifndef HAVE_GETPT
   int i;
   int c;
-#endif
 
 #ifdef PTY_ITERATION
   PTY_ITERATION
 #else
+# ifndef FIRST_PTY_LETTER
+# define FIRST_PTY_LETTER 'p'
+# endif
   for (c = FIRST_PTY_LETTER; c <= 'z'; c++)
     for (i = 0; i < 16; i++)
-#endif
+#endif /* PTY_ITERATION */
+
       {
 #ifdef PTY_NAME_SPRINTF
        PTY_NAME_SPRINTF
@@ -234,53 +379,30 @@ allocate_pty (void)
        sprintf (pty_name, "/dev/pty%c%x", c, i);
 #endif /* no PTY_NAME_SPRINTF */
 
-#ifdef PTY_OPEN
-       PTY_OPEN;
-#else /* no PTY_OPEN */
-#ifdef IRIS
-       /* Unusual IRIS code */
-       *ptyv = open ("/dev/ptc", O_RDWR | O_NONBLOCK | OPEN_BINARY, 0);
-       if (fd < 0)
-         return -1;
-       if (fstat (fd, &stb) < 0)
-         return -1;
-#else /* not IRIS */
-       if (stat (pty_name, &stb) < 0)
+       if (xemacs_stat (pty_name, &stb) < 0)
          {
-           failed_count++;
-           if (failed_count >= 3)
+           if (++failed_count >= 3)
              return -1;
          }
        else
          failed_count = 0;
        fd = open (pty_name, O_RDWR | O_NONBLOCK | OPEN_BINARY, 0);
-#endif /* not IRIS */
-#endif /* no PTY_OPEN */
 
        if (fd >= 0)
          {
-           /* check to make certain that both sides are available
-              this avoids a nasty yet stupid bug in rlogins */
 #ifdef PTY_TTY_NAME_SPRINTF
            PTY_TTY_NAME_SPRINTF
 #else
             sprintf (pty_name, "/dev/tty%c%x", c, i);
 #endif /* no PTY_TTY_NAME_SPRINTF */
-#if !defined(UNIPLUS) && !defined(HAVE_GETPT)
-           if (access (pty_name, 6) != 0)
+           if (access (pty_name, R_OK | W_OK) == 0)
              {
-               close (fd);
-#if !defined(IRIS) && !defined(__sgi)
-               continue;
-#else
-               return -1;
-#endif /* IRIS */
+               setup_pty (fd);
+               return fd;
              }
-#endif /* not UNIPLUS */
-           setup_pty (fd);
-           return fd;
+           close (fd);
          }
-      }
+      } /* iteration */
   return -1;
 }
 #endif /* HAVE_PTYS */
@@ -575,14 +697,14 @@ static int
 process_signal_char (int tty_fd, int signo)
 {
   /* If it's not a tty, pray that these default values work */
-  if (!isatty(tty_fd)) {
+  if (! isatty (tty_fd)) {
 #define CNTL(ch) (037 & (ch))
     switch (signo)
       {
-      case SIGINT:  return CNTL('C');
-      case SIGQUIT: return CNTL('\\');
+      case SIGINT:  return CNTL ('C');
+      case SIGQUIT: return CNTL ('\\');
 #ifdef SIGTSTP
-      case SIGTSTP: return CNTL('Z');
+      case SIGTSTP: return CNTL ('Z');
 #endif
       }
   }
@@ -694,7 +816,7 @@ unix_init_process (void)
  * Initialize any process local data. This is called when newly
  * created process is connected to real OS file handles. The
  * handles are generally represented by void* type, but are
- * of type int (file descriptors) for UNIX
+ * of type int (file descriptors) for UNIX.
  */
 
 static void
@@ -718,8 +840,6 @@ unix_create_process (Lisp_Process *p,
                     Lisp_Object *argv, int nargv,
                     Lisp_Object program, Lisp_Object cur_dir)
 {
-  /* This function rewritten by ben@xemacs.org. */
-
   int pid;
   int inchannel  = -1;
   int outchannel = -1;
@@ -792,17 +912,15 @@ unix_create_process (Lisp_Process *p,
        int xforkin = forkin;
        int xforkout = forkout;
 
-       if (!pty_flag)
-         EMACS_SEPARATE_PROCESS_GROUP ();
-#ifdef HAVE_PTYS
-       else
-         {
-           /* Disconnect the current controlling terminal, pursuant to
-              making the pty be the controlling terminal of the process.
-              Also put us in our own process group. */
+       /* Disconnect the current controlling terminal, pursuant to
+          making the pty be the controlling terminal of the process.
+          Also put us in our own process group. */
 
-           disconnect_controlling_terminal ();
+       disconnect_controlling_terminal ();
 
+#ifdef HAVE_PTYS
+       if (pty_flag)
+         {
            /* Open the pty connection and make the pty's terminal
               our controlling terminal.
 
@@ -855,9 +973,22 @@ unix_create_process (Lisp_Process *p,
                Must be done before using tc* functions on xforkin.
                This guarantees that isatty(xforkin) is true. */
 
-# ifdef SETUP_SLAVE_PTY
-           SETUP_SLAVE_PTY;
-# endif /* SETUP_SLAVE_PTY */
+#  if defined (HAVE_ISASTREAM) && defined (I_PUSH)
+           if (isastream (xforkin))
+             {
+#    if defined (I_FIND)
+#      define stream_module_pushed(fd, module) (ioctl (fd, I_FIND, module) == 1)
+#    else
+#      define stream_module_pushed(fd, module) 0
+#    endif
+               if (! stream_module_pushed (xforkin, "ptem"))
+                 ioctl (xforkin, I_PUSH, "ptem");
+               if (! stream_module_pushed (xforkin, "ldterm"))
+                 ioctl (xforkin, I_PUSH, "ldterm");
+               if (! stream_module_pushed (xforkin, "ttcompat"))
+                 ioctl (xforkin, I_PUSH, "ttcompat");
+             }
+#  endif /* HAVE_ISASTREAM */
 
 #  ifdef TIOCSCTTY
            /* We ignore the return value
@@ -891,7 +1022,7 @@ unix_create_process (Lisp_Process *p,
               of our new controlling terminal. */
 
            {
-             int piddly = EMACS_GET_PROCESS_GROUP ();
+             pid_t piddly = EMACS_GET_PROCESS_GROUP ();
              EMACS_SET_TTY_PROCESS_GROUP (xforkin, &piddly);
            }
 
@@ -928,9 +1059,7 @@ unix_create_process (Lisp_Process *p,
            }
          new_argv[i + 1] = 0;
 
-         TO_EXTERNAL_FORMAT (LISP_STRING, cur_dir,
-                             C_STRING_ALLOCA, current_dir,
-                             Qfile_name);
+         LISP_STRING_TO_EXTERNAL (cur_dir, current_dir, Qfile_name);
 
          child_setup (xforkin, xforkout, xforkout, new_argv, current_dir);
        }
@@ -945,7 +1074,9 @@ unix_create_process (Lisp_Process *p,
 
   if (pid < 0)
     {
+      int save_errno = errno;
       close_descriptor_pair (forkin, forkout);
+      errno = save_errno;
       report_file_error ("Doing fork", Qnil);
     }
 
@@ -1141,12 +1272,12 @@ unix_send_process (Lisp_Object proc, struct lstream* lstream)
 
   /* #### JV: layering violation?
 
-     This function knows too much about the relation between the encodingstream
-     (DATA_OUTSTREAM) and te actual output stream p->output_stream.
+     This function knows too much about the relation between the encoding
+     stream (DATA_OUTSTREAM) and the actual output stream p->output_stream.
 
      If encoding streams properly forwarded all calls, we could simply
      use DATA_OUTSTREAM everywhere. */
-  
+
   if (!SETJMP (send_process_frame))
     {
       /* use a reasonable-sized buffer (somewhere around the size of the
@@ -1204,8 +1335,7 @@ unix_send_process (Lisp_Object proc, struct lstream* lstream)
       p->tick++;
       process_tick++;
       deactivate_process (*((Lisp_Object *) (&vol_proc)));
-      error ("SIGPIPE raised on process %s; closed it",
-            XSTRING_DATA (p->name));
+      invalid_operation ("SIGPIPE raised on process; closed it", p->name);
     }
 
   old_sigpipe = (SIGTYPE (*) (int)) signal (SIGPIPE, send_process_trap);
@@ -1272,7 +1402,17 @@ unix_deactivate_process (Lisp_Process *p)
   return usid;
 }
 
-/* send a signal number SIGNO to PROCESS.
+/* If the subtty field of the process data is not filled in, do so now. */
+static void
+try_to_initialize_subtty (struct unix_process_data *upd)
+{
+  if (upd->pty_flag
+      && (upd->subtty = -1 || ! isatty (upd->subtty))
+      && STRINGP (upd->tty_name))
+    upd->subtty = open (XSTRING_DATA (upd->tty_name), O_RDWR, 0);
+}
+
+/* Send signal number SIGNO to PROCESS.
    CURRENT_GROUP means send to the process group that currently owns
    the terminal being used to communicate with PROCESS.
    This is used for various commands in shell mode.
@@ -1281,70 +1421,18 @@ unix_deactivate_process (Lisp_Process *p)
 
    If we can, we try to signal PROCESS by sending control characters
    down the pty.  This allows us to signal inferiors who have changed
-   their uid, for which killpg would return an EPERM error.
+   their uid, for which killpg would return an EPERM error,
+   or processes running on other machines via remote login.
 
-   The method signals an error if the given SIGNO is not valid
-*/
+   The method signals an error if the given SIGNO is not valid. */
 
 static void
 unix_kill_child_process (Lisp_Object proc, int signo,
                         int current_group, int nomsg)
 {
-  int gid;
-  int no_pgrp = 0;
-  int kill_retval;
+  pid_t pgid = -1;
   Lisp_Process *p = XPROCESS (proc);
-
-  if (!UNIX_DATA(p)->pty_flag)
-    current_group = 0;
-
-  /* If we are using pgrps, get a pgrp number and make it negative.  */
-  if (current_group)
-    {
-#ifdef SIGNALS_VIA_CHARACTERS
-      /* If possible, send signals to the entire pgrp
-        by sending an input character to it.  */
-      {
-        char sigchar = process_signal_char(UNIX_DATA(p)->subtty, signo);
-        if (sigchar) {
-          send_process (proc, Qnil, (Bufbyte *) &sigchar, 0, 1);
-          return;
-        }
-      }
-#endif /* ! defined (SIGNALS_VIA_CHARACTERS) */
-
-#ifdef TIOCGPGRP
-      /* Get the pgrp using the tty itself, if we have that.
-        Otherwise, use the pty to get the pgrp.
-        On pfa systems, saka@pfu.fujitsu.co.JP writes:
-        "TIOCGPGRP symbol defined in sys/ioctl.h at E50.
-        But, TIOCGPGRP does not work on E50 ;-P works fine on E60"
-        His patch indicates that if TIOCGPGRP returns an error, then
-        we should just assume that p->pid is also the process group id.  */
-      {
-       int err;
-
-        err = ioctl ( (UNIX_DATA(p)->subtty != -1
-                      ? UNIX_DATA(p)->subtty
-                      : UNIX_DATA(p)->infd), TIOCGPGRP, &gid);
-
-#ifdef pfa
-       if (err == -1)
-         gid = - XINT (p->pid);
-#endif /* ! defined (pfa) */
-      }
-      if (gid == -1)
-       no_pgrp = 1;
-      else
-       gid = - gid;
-#else /* ! defined (TIOCGPGRP ) */
-      /* Can't select pgrps on this system, so we know that
-        the child itself heads the pgrp.  */
-      gid = - XINT (p->pid);
-#endif /* ! defined (TIOCGPGRP ) */
-    }
-  else
-    gid = - XINT (p->pid);
+  struct unix_process_data *d = UNIX_DATA (p);
 
   switch (signo)
     {
@@ -1361,46 +1449,92 @@ unix_kill_child_process (Lisp_Object proc, int signo,
     case SIGINT:
     case SIGQUIT:
     case SIGKILL:
-      flush_pending_output (UNIX_DATA(p)->infd);
+      flush_pending_output (d->infd);
       break;
     }
 
-  /* If we don't have process groups, send the signal to the immediate
-     subprocess.  That isn't really right, but it's better than any
-     obvious alternative.  */
-  if (no_pgrp)
-    {
-      kill_retval = kill (XINT (p->pid), signo) ? errno : 0;
-    }
-  else
+  if (! d->pty_flag)
+    current_group = 0;
+
+  /* If current_group is true, we want to send a signal to the
+     foreground process group of the terminal our child process is
+     running on.  You would think that would be easy.
+
+     The BSD people invented the TIOCPGRP ioctl to get the foreground
+     process group of a tty.  That, combined with killpg, gives us
+     what we want.
+
+     However, the POSIX standards people, in their infinite wisdom,
+     have seen fit to only allow this for processes which have the
+     terminal as controlling terminal, which doesn't apply to us.
+
+     Sooo..., we have to do something non-standard.  The ioctls
+     TIOCSIGNAL, TIOCSIG, and TIOCSIGSEND send the signal directly on
+     many systems.  POSIX tcgetpgrp(), since it is *documented* as not
+     doing what we want, is actually less likely to work than the BSD
+     ioctl TIOCGPGRP it is supposed to obsolete.  Sometimes we have to
+     use TIOCGPGRP on the master end, sometimes the slave end
+     (probably an AIX bug).  So we better get a fd for the slave if we
+     haven't got it yet.  On some systems none of these work, so then
+     we just fall back to the non-current_group behavior and kill the
+     process group of the child. */
+  if (current_group)
     {
-      /* gid may be a pid, or minus a pgrp's number */
-#if defined (TIOCSIGNAL) || defined (TIOCSIGSEND)
-      if (current_group)
+      try_to_initialize_subtty (d);
+
+#ifdef SIGNALS_VIA_CHARACTERS
+      /* If possible, send signals to the entire pgrp
+        by sending an input character to it.  */
+      {
+        char sigchar = process_signal_char (d->subtty, signo);
+        if (sigchar)
+         {
+           send_process (proc, Qnil, (Bufbyte *) &sigchar, 0, 1);
+           return;
+         }
+      }
+#endif /* SIGNALS_VIA_CHARACTERS */
+
+#ifdef TIOCGPGRP
+      if (pgid == -1)
+       ioctl (d->infd, TIOCGPGRP, &pgid); /* BSD */
+      if (pgid == -1 && d->subtty != -1)
+       ioctl (d->subtty, TIOCGPGRP, &pgid); /* Only this works on AIX! */
+#endif /* TIOCGPGRP */
+
+      if (pgid == -1)
        {
-#ifdef TIOCSIGNAL
-         kill_retval = ioctl (UNIX_DATA(p)->infd, TIOCSIGNAL, signo);
-#else /* ! defined (TIOCSIGNAL) */
-         kill_retval = ioctl (UNIX_DATA(p)->infd, TIOCSIGSEND, signo);
-#endif /* ! defined (TIOCSIGNAL) */
+         /* Many systems provide an ioctl to send a signal directly */
+#ifdef TIOCSIGNAL /* Solaris, HP-UX */
+         if (ioctl (d->infd, TIOCSIGNAL, signo) != -1)
+           return;
+#endif /* TIOCSIGNAL */
+
+#ifdef TIOCSIG /* BSD */
+         if (ioctl (d->infd, TIOCSIG, signo) != -1)
+           return;
+#endif /* TIOCSIG */
        }
-      else
-       kill_retval = kill (- XINT (p->pid), signo) ? errno : 0;
-#else /* ! (defined (TIOCSIGNAL) || defined (TIOCSIGSEND)) */
-      kill_retval = EMACS_KILLPG (-gid, signo) ? errno : 0;
-#endif /* ! (defined (TIOCSIGNAL) || defined (TIOCSIGSEND)) */
-    }
-
-  if (kill_retval < 0 && errno == EINVAL)
-    error ("Signal number %d is invalid for this system", signo);
+    } /* current_group */
+
+  if (pgid == -1)
+    /* Either current_group is 0, or we failed to get the foreground
+       process group using the trickery above.  So we fall back to
+       sending the signal to the process group of our child process.
+       Since this is often a shell that ignores signals like SIGINT,
+       the shell's subprocess is killed, which is the desired effect.
+       The process group of p->pid is always p->pid, since it was
+       created as a process group leader. */
+    pgid = XINT (p->pid);
+
+  /* Finally send the signal. */
+  if (EMACS_KILLPG (pgid, signo) == -1)
+    error ("kill (%ld, %ld) failed: %s",
+          (long) pgid, (long) signo, strerror (errno));
 }
 
-/*
- * Kill any process in the system given its PID.
- *
- * Returns zero if a signal successfully sent, or
- * negative number upon failure
- */
+/* Send signal SIGCODE to any process in the system given its PID.
+   Return zero if successful, a negative number upon failure. */
 
 static int
 unix_kill_process_by_pid (int pid, int sigcode)
@@ -1408,9 +1542,7 @@ unix_kill_process_by_pid (int pid, int sigcode)
   return kill (pid, sigcode);
 }
 
-/*
- * Return TTY name used to communicate with subprocess
- */
+/* Return TTY name used to communicate with subprocess. */
 
 static Lisp_Object
 unix_get_tty_name (Lisp_Process *p)
@@ -1418,11 +1550,8 @@ unix_get_tty_name (Lisp_Process *p)
   return UNIX_DATA (p)->tty_name;
 }
 
-/*
- * Canonicalize host name HOST, and return its canonical form
- *
- * The default implementation just takes HOST for a canonical name.
- */
+/* Canonicalize host name HOST, and return its canonical form.
+   The default implementation just takes HOST for a canonical name. */
 
 #ifdef HAVE_SOCKETS
 static Lisp_Object
@@ -1440,15 +1569,13 @@ unix_canonicalize_host_name (Lisp_Object host)
   hints.ai_family = AF_UNSPEC;
   hints.ai_socktype = SOCK_STREAM;
   hints.ai_protocol = 0;
-  TO_EXTERNAL_FORMAT (LISP_STRING, host, C_STRING_ALLOCA, ext_host, Qnative);
+  LISP_STRING_TO_EXTERNAL (host, ext_host, Qnative);
   retval = getaddrinfo (ext_host, NULL, &hints, &res);
   if (retval != 0)
     {
       char *gai_error;
 
-      TO_INTERNAL_FORMAT (C_STRING, gai_strerror (retval),
-                         C_STRING_ALLOCA, gai_error,
-                         Qnative);
+      EXTERNAL_TO_C_STRING (gai_strerror (retval), gai_error, Qnative);
       maybe_error (Qprocess, ERROR_ME_NOT,
                   "%s \"%s\"", gai_error, XSTRING_DATA (host));
       canonname = host;
@@ -1478,11 +1605,11 @@ unix_canonicalize_host_name (Lisp_Object host)
 #endif /* ! HAVE_GETADDRINFO */
 }
 
-/* open a TCP network connection to a given HOST/SERVICE.  Treated
-   exactly like a normal process when reading and writing.  Only
-   differences are in status display and process deletion.  A network
-   connection has no PID; you cannot signal it.  All you can do is
-   deactivate and close it via delete-process */
+/* Open a TCP network connection to a given HOST/SERVICE.
+   Treated exactly like a normal process when reading and writing.
+   Only differences are in status display and process deletion.
+   A network connection has no PID; you cannot signal it.  All you can
+   do is deactivate and close it via delete-process. */
 
 static void
 unix_open_network_stream (Lisp_Object name, Lisp_Object host, Lisp_Object service,
@@ -1498,8 +1625,7 @@ unix_open_network_stream (Lisp_Object name, Lisp_Object host, Lisp_Object servic
   CHECK_STRING (host);
 
   if (!EQ (protocol, Qtcp) && !EQ (protocol, Qudp))
-    error ("Unsupported protocol \"%s\"",
-          string_data (symbol_name (XSYMBOL (protocol))));
+    invalid_argument ("Unsupported protocol", protocol);
 
   {
 #if defined(HAVE_GETADDRINFO) && defined(HAVE_GETNAMEINFO)
@@ -1523,9 +1649,7 @@ unix_open_network_stream (Lisp_Object name, Lisp_Object host, Lisp_Object servic
     else
       {
        CHECK_STRING (service);
-       TO_EXTERNAL_FORMAT (LISP_STRING, service,
-                           C_STRING_ALLOCA, portstring,
-                           Qnative);
+       LISP_STRING_TO_EXTERNAL (service, portstring, Qnative);
        port = 0;
       }
 
@@ -1537,15 +1661,13 @@ unix_open_network_stream (Lisp_Object name, Lisp_Object host, Lisp_Object servic
     else /* EQ (protocol, Qudp) */
       hints.ai_socktype = SOCK_DGRAM;
     hints.ai_protocol = 0;
-    TO_EXTERNAL_FORMAT (LISP_STRING, host, C_STRING_ALLOCA, ext_host, Qnative);
+    LISP_STRING_TO_EXTERNAL (host, ext_host, Qnative);
     retval = getaddrinfo (ext_host, portstring, &hints, &res);
     if (retval != 0)
       {
        char *gai_error;
 
-       TO_INTERNAL_FORMAT (C_STRING, gai_strerror (retval),
-                           C_STRING_ALLOCA, gai_error,
-                           Qnative);
+       EXTERNAL_TO_C_STRING (gai_strerror (retval), gai_error, Qnative);
        error ("%s/%s %s", XSTRING_DATA (host), portstring, gai_error);
       }
 
@@ -1676,7 +1798,7 @@ unix_open_network_stream (Lisp_Object name, Lisp_Object host, Lisp_Object servic
          svc_info = getservbyname ((char *) XSTRING_DATA (service), "udp");
 
        if (svc_info == 0)
-         error ("Unknown service \"%s\"", XSTRING_DATA (service));
+         invalid_argument ("Unknown service", service);
        port = svc_info->s_port;
       }
 
@@ -1795,8 +1917,9 @@ unix_open_network_stream (Lisp_Object name, Lisp_Object host, Lisp_Object servic
 */
 
 static void
-unix_open_multicast_group (Lisp_Object name, Lisp_Object dest, Lisp_Object port,
-                          Lisp_Object ttl, void** vinfd, void** voutfd)
+unix_open_multicast_group (Lisp_Object name, Lisp_Object dest,
+                          Lisp_Object port, Lisp_Object ttl, void** vinfd,
+                          void** voutfd)
 {
   struct ip_mreq imr;
   struct sockaddr_in sa;
@@ -1817,7 +1940,7 @@ unix_open_multicast_group (Lisp_Object name, Lisp_Object dest, Lisp_Object port,
   thettl = (unsigned char) XINT (ttl);
 
   if ((udp = getprotobyname ("udp")) == NULL)
-    error ("No info available for UDP protocol");
+    type_error (Qinvalid_operation, "No info available for UDP protocol");
 
   /* Init the sockets. Yes, I need 2 sockets. I couldn't duplicate one. */
   if ((rs = socket (PF_INET, SOCK_DGRAM, udp->p_proto)) < 0)
index 028cfb4..5812151 100644 (file)
@@ -608,10 +608,24 @@ INCODE and OUTCODE specify the coding-system objects used in input/output
     }
   else
     {
-      if (!NILP (Ffile_directory_p (program)))
-       error ("Specified program for new process is a directory");
+      /* we still need to canonicalize it and ensure it has the proper
+        ending, e.g. .exe */
+      struct gcpro ngcpro1;
+
+      tem = Qnil;
+      NGCPRO1 (tem);
+      locate_file (list1 (build_string ("")), program, Vlisp_EXEC_SUFFIXES,
+                  &tem, X_OK);
+      if (NILP (tem))
+       report_file_error ("Searching for program", list1 (program));
+      program = tem;
+      NUNGCPRO;
     }
 
+  if (!NILP (Ffile_directory_p (program)))
+    invalid_operation ("Specified program for new process is a directory",
+                      program);
+
   proc = make_process_internal (name);
 
   XPROCESS (proc)->buffer = buffer;
@@ -664,7 +678,8 @@ INCODE and OUTCODE specify the coding-system objects used in input/output
    connection has no PID; you cannot signal it.  All you can do is
    deactivate and close it via delete-process */
 
-DEFUN ("open-network-stream-internal", Fopen_network_stream_internal, 4, 5, 0, /*
+DEFUN ("open-network-stream-internal", Fopen_network_stream_internal, 4, 5,
+       0, /*
 Open a TCP connection for a service to a host.
 Return a subprocess-object to represent the connection.
 Input and output work as for subprocesses; `delete-process' closes it.
@@ -682,7 +697,7 @@ Fifth argument PROTOCOL is a network protocol.  Currently 'tcp
  (Transmission Control Protocol) and 'udp (User Datagram Protocol) are
  supported.  When omitted, 'tcp is assumed.
 
-Ouput via `process-send-string' and input via buffer or filter (see
+Output via `process-send-string' and input via buffer or filter (see
 `set-process-filter') are stream-oriented.  That means UDP datagrams are
 not guaranteed to be sent and received in discrete packets. (But small
 datagrams around 500 bytes that are not truncated by `process-send-string'
@@ -1523,133 +1538,23 @@ If PROCESS has not yet exited or died, return 0.
 
 \f
 
-/* send a signal number SIGNO to PROCESS.
-   CURRENT_GROUP means send to the process group that currently owns
-   the terminal being used to communicate with PROCESS.
-   This is used for various commands in shell mode.
-   If NOMSG is zero, insert signal-announcements into process's buffers
-   right away.
-
-   If we can, we try to signal PROCESS by sending control characters
-   down the pty.  This allows us to signal inferiors who have changed
-   their uid, for which killpg would return an EPERM error.  */
-
-static void
-process_send_signal (Lisp_Object process, int signo,
-                     int current_group, int nomsg)
-{
-  /* This function can GC */
-  Lisp_Object proc = get_process (process);
-
-  if (network_connection_p (proc))
-    error ("Network connection %s is not a subprocess",
-          XSTRING_DATA (XPROCESS(proc)->name));
-  CHECK_LIVE_PROCESS (proc);
-
-  MAYBE_PROCMETH (kill_child_process, (proc, signo, current_group, nomsg));
-}
-
-DEFUN ("interrupt-process", Finterrupt_process, 0, 2, 0, /*
-Interrupt process PROCESS.  May be process or name of one.
-Nil or no arg means current buffer's process.
-Second arg CURRENT-GROUP non-nil means send signal to
-the current process-group of the process's controlling terminal
-rather than to the process's own process group.
-If the process is a shell, this means interrupt current subjob
-rather than the shell.
-*/
-       (process, current_group))
-{
-  /* This function can GC */
-  process_send_signal (process, SIGINT, !NILP (current_group), 0);
-  return process;
-}
-
-DEFUN ("kill-process", Fkill_process, 0, 2, 0, /*
-Kill process PROCESS.  May be process or name of one.
-See function `interrupt-process' for more details on usage.
-*/
-       (process, current_group))
-{
-  /* This function can GC */
-#ifdef SIGKILL
-  process_send_signal (process, SIGKILL, !NILP (current_group), 0);
-#else
-  error ("kill-process: Not supported on this system");
-#endif
-  return process;
-}
-
-DEFUN ("quit-process", Fquit_process, 0, 2, 0, /*
-Send QUIT signal to process PROCESS.  May be process or name of one.
-See function `interrupt-process' for more details on usage.
-*/
-       (process, current_group))
-{
-  /* This function can GC */
-#ifdef SIGQUIT
-  process_send_signal (process, SIGQUIT, !NILP (current_group), 0);
-#else
-  error ("quit-process: Not supported on this system");
-#endif
-  return process;
-}
-
-DEFUN ("stop-process", Fstop_process, 0, 2, 0, /*
-Stop process PROCESS.  May be process or name of one.
-See function `interrupt-process' for more details on usage.
-*/
-       (process, current_group))
-{
-  /* This function can GC */
-#ifdef SIGTSTP
-  process_send_signal (process, SIGTSTP, !NILP (current_group), 0);
-#else
-  error ("stop-process: Not supported on this system");
-#endif
-  return process;
-}
-
-DEFUN ("continue-process", Fcontinue_process, 0, 2, 0, /*
-Continue process PROCESS.  May be process or name of one.
-See function `interrupt-process' for more details on usage.
-*/
-       (process, current_group))
+static int
+decode_signal (Lisp_Object signal_)
 {
-  /* This function can GC */
-#ifdef SIGCONT
-  process_send_signal (process, SIGCONT, !NILP (current_group), 0);
-#else
-  error ("continue-process: Not supported on this system");
-#endif
-  return process;
-}
-
-DEFUN ("signal-process", Fsignal_process, 2, 2,
-       "nProcess number: \nnSignal code: ", /*
-Send the process with process id PID the signal with code SIGCODE.
-PID must be an integer.  The process need not be a child of this Emacs.
-SIGCODE may be an integer, or a symbol whose name is a signal name.
-*/
-       (pid, sigcode))
-{
-  CHECK_INT (pid);
-
-  if (INTP (sigcode))
-    ;
+  if (INTP (signal_))
+    return XINT (signal_);
   else
     {
       Bufbyte *name;
 
-      CHECK_SYMBOL (sigcode);
-      name = string_data (XSYMBOL (sigcode)->name);
+      CHECK_SYMBOL (signal_);
+      name = string_data (XSYMBOL (signal_)->name);
 
-#define handle_signal(signal)                          \
-  else if (!strcmp ((const char *) name, #signal))     \
-    XSETINT (sigcode, signal)
+#define handle_signal(sym) do {                                \
+       if (!strcmp ((const char *) name, #sym))        \
+         return sym;                                   \
+      } while (0)
 
-      if (0)
-       ;
       handle_signal (SIGINT);  /* ANSI */
       handle_signal (SIGILL);  /* ANSI */
       handle_signal (SIGABRT); /* ANSI */
@@ -1783,14 +1688,145 @@ SIGCODE may be an integer, or a symbol whose name is a signal name.
 #ifdef SIGPWR
       handle_signal (SIGPWR);
 #endif
-      else
-       error ("Undefined signal name %s", name);
-    }
 
 #undef handle_signal
 
+      error ("Undefined signal name %s", name);
+      return 0; /* Unreached */
+    }
+}
+
+/* Send signal number SIGNO to PROCESS.
+   CURRENT-GROUP non-nil means send signal to the current
+   foreground process group of the process's controlling terminal rather
+   than to the process's own process group.
+   This is used for various commands in shell mode.
+   If NOMSG is zero, insert signal-announcements into process's buffers
+   right away.
+
+   If we can, we try to signal PROCESS by sending control characters
+   down the pty.  This allows us to signal inferiors who have changed
+   their uid, for which kill() would return an EPERM error, or to
+   processes running on another computer through a remote login.  */
+
+static void
+process_send_signal (Lisp_Object process, int signo,
+                     int current_group, int nomsg)
+{
+  /* This function can GC */
+  Lisp_Object proc = get_process (process);
+
+  if (network_connection_p (proc))
+    error ("Network connection %s is not a subprocess",
+          XSTRING_DATA (XPROCESS(proc)->name));
+  CHECK_LIVE_PROCESS (proc);
+
+  MAYBE_PROCMETH (kill_child_process, (proc, signo, current_group, nomsg));
+}
+
+DEFUN ("process-send-signal", Fprocess_send_signal, 1, 3, 0, /*
+Send signal SIGNAL to process PROCESS.
+SIGNAL may be an integer, or a symbol naming a signal, like `SIGSEGV'.
+PROCESS may be a process, a buffer, the name of a process or buffer, or
+nil, indicating the current buffer's process.
+Third arg CURRENT-GROUP non-nil means send signal to the current
+foreground process group of the process's controlling terminal rather
+than to the process's own process group.
+If the process is a shell that supports job control, this means
+send the signal to the current subjob rather than the shell.
+*/
+       (signal_, process, current_group))
+{
+  /* This function can GC */
+  process_send_signal (process, decode_signal (signal_),
+                      !NILP (current_group), 0);
+  return process;
+}
+
+DEFUN ("interrupt-process", Finterrupt_process, 0, 2, 0, /*
+Interrupt process PROCESS.
+See function `process-send-signal' for more details on usage.
+*/
+       (process, current_group))
+{
+  /* This function can GC */
+  process_send_signal (process, SIGINT, !NILP (current_group), 0);
+  return process;
+}
+
+DEFUN ("kill-process", Fkill_process, 0, 2, 0, /*
+Kill process PROCESS.
+See function `process-send-signal' for more details on usage.
+*/
+       (process, current_group))
+{
+  /* This function can GC */
+#ifdef SIGKILL
+  process_send_signal (process, SIGKILL, !NILP (current_group), 0);
+#else
+  error ("kill-process: Not supported on this system");
+#endif
+  return process;
+}
+
+DEFUN ("quit-process", Fquit_process, 0, 2, 0, /*
+Send QUIT signal to process PROCESS.
+See function `process-send-signal' for more details on usage.
+*/
+       (process, current_group))
+{
+  /* This function can GC */
+#ifdef SIGQUIT
+  process_send_signal (process, SIGQUIT, !NILP (current_group), 0);
+#else
+  error ("quit-process: Not supported on this system");
+#endif
+  return process;
+}
+
+DEFUN ("stop-process", Fstop_process, 0, 2, 0, /*
+Stop process PROCESS.
+See function `process-send-signal' for more details on usage.
+*/
+       (process, current_group))
+{
+  /* This function can GC */
+#ifdef SIGTSTP
+  process_send_signal (process, SIGTSTP, !NILP (current_group), 0);
+#else
+  error ("stop-process: Not supported on this system");
+#endif
+  return process;
+}
+
+DEFUN ("continue-process", Fcontinue_process, 0, 2, 0, /*
+Continue process PROCESS.
+See function `process-send-signal' for more details on usage.
+*/
+       (process, current_group))
+{
+  /* This function can GC */
+#ifdef SIGCONT
+  process_send_signal (process, SIGCONT, !NILP (current_group), 0);
+#else
+  error ("continue-process: Not supported on this system");
+#endif
+  return process;
+}
+
+DEFUN ("signal-process", Fsignal_process, 2, 2,
+       "nProcess number: \nnSignal code: ", /*
+Send the process with process id PID the signal with code SIGNAL.
+PID must be an integer.  The process need not be a child of this Emacs.
+SIGNAL may be an integer, or a symbol naming a signal, like `SIGSEGV'.
+*/
+       (pid, signal_))
+{
+  CHECK_INT (pid);
+
   return make_int (PROCMETH_OR_GIVEN (kill_process_by_pid,
-                                     (XINT (pid), XINT (sigcode)), -1));
+                                     (XINT (pid), decode_signal (signal_)),
+                                     -1));
 }
 
 DEFUN ("process-send-eof", Fprocess_send_eof, 0, 1, 0, /*
@@ -2039,6 +2075,7 @@ syms_of_process (void)
 #endif /* HAVE_SOCKETS */
   DEFSUBR (Fprocess_send_region);
   DEFSUBR (Fprocess_send_string);
+  DEFSUBR (Fprocess_send_signal);
   DEFSUBR (Finterrupt_process);
   DEFSUBR (Fkill_process);
   DEFSUBR (Fquit_process);
index ed88beb..f940db5 100644 (file)
@@ -139,13 +139,4 @@ Lisp_Object canonicalize_host_name (Lisp_Object host);
 
 #endif /* emacs */
 
-#ifdef HAVE_GETPT
-#define PTY_ITERATION
-#define PTY_OPEN \
-    if ((fd = getpt()) < 0 || grantpt (fd) < 0 || unlockpt (fd) < 0) \
-      return -1;
-#define PTY_NAME_SPRINTF
-#define PTY_TTY_NAME_SPRINTF strcpy (pty_name, ptsname (fd));
-#endif
-
 #endif /* INCLUDED_process_h_ */
index a8556d2..afc1cc1 100644 (file)
@@ -467,7 +467,7 @@ exactly once) if FUNCTION modifies or deletes the current entry
       EMACS_INT first, last;
       Lisp_Object args[4];
       int oldlen;
-      
+
     again:
       first = entry->first;
       last = entry->last;
index 9caf8f7..ea34721 100644 (file)
@@ -576,7 +576,6 @@ mswindows_output_dibitmap (struct frame *f, Lisp_Image_Instance *p,
   HDC hdc = get_frame_dc (f, 1);
   HDC hcompdc = get_frame_compdc (f);
   HGDIOBJ old=NULL;
-  COLORREF bgcolor = GetBkColor (hdc);
   const int real_x = IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_WIDTH (p);
   const int real_y = IMAGE_INSTANCE_MSWINDOWS_BITMAP_REAL_HEIGHT (p);
   const int surface_x = IMAGE_INSTANCE_PIXMAP_WIDTH (p);
@@ -585,15 +584,30 @@ mswindows_output_dibitmap (struct frame *f, Lisp_Image_Instance *p,
   /* first blit the mask */
   if (IMAGE_INSTANCE_MSWINDOWS_MASK (p))
     {
-      RGBQUAD col;
-      col.rgbBlue = GetBValue (bgcolor);
-      col.rgbRed = GetRValue (bgcolor);
-      col.rgbGreen = GetGValue (bgcolor);
-      col.rgbReserved = 0;
+      RGBQUAD bg;
+      COLORREF bgcolor;
 
       old = SelectObject (hcompdc, IMAGE_INSTANCE_MSWINDOWS_MASK (p));
       
-      SetDIBColorTable (hcompdc, 1, 1, &col);
+      if (IMAGE_INSTANCE_TYPE (p) == IMAGE_MONO_PIXMAP)
+       {
+         COLORREF fgcolor;
+         RGBQUAD fg;
+
+         fgcolor = GetTextColor (hdc);
+         fg.rgbBlue = GetBValue (fgcolor);
+         fg.rgbRed = GetRValue (fgcolor);
+         fg.rgbGreen = GetGValue (fgcolor);
+         fg.rgbReserved = 0;
+         SetDIBColorTable (hcompdc, 0, 1, &fg);
+       }
+
+      bgcolor = GetBkColor (hdc);
+      bg.rgbBlue = GetBValue (bgcolor);
+      bg.rgbRed = GetRValue (bgcolor);
+      bg.rgbGreen = GetGValue (bgcolor);
+      bg.rgbReserved = 0;
+      SetDIBColorTable (hcompdc, 1, 1, &bg);
 
       StretchBlt (hdc, 
                  db->xpos, db->ypos,
@@ -974,6 +988,7 @@ mswindows_frame_output_begin (struct frame *f)
 static void
 mswindows_frame_output_end (struct frame *f)
 {
+#ifdef DEFER_WINDOW_POS
   HDWP hdwp = FRAME_MSWINDOWS_DATA (f)->hdwp;
 
   if (hdwp != 0)
@@ -981,7 +996,7 @@ mswindows_frame_output_end (struct frame *f)
       EndDeferWindowPos (hdwp);
       FRAME_MSWINDOWS_DATA (f)->hdwp = 0;
     }
-
+#endif
   GdiFlush();
 }
 
@@ -1176,7 +1191,7 @@ mswindows_output_display_block (struct window *w, struct display_line *dl, int b
                      if (EQ (XIMAGE_INSTANCE_WIDGET_TYPE (instance),
                              Qlayout))
                        {
-                         redisplay_output_layout (w, instance, &dbox, &dga, findex,
+                         redisplay_output_layout (window, instance, &dbox, &dga, findex,
                                                   cursor_start, cursor_width,
                                                   cursor_height);
                          if (rb->cursor_type == CURSOR_ON)
index 0994fb8..61f22de 100644 (file)
@@ -233,7 +233,7 @@ compare_runes (struct window *w, struct rune *crb, struct rune *drb)
     return 0;
   /* Only check dirtiness if we know something has changed. */
   else if (crb->type == RUNE_DGLYPH &&
-          (XGLYPH_DIRTYP (crb->object.dglyph.glyph) || 
+          (XGLYPH_DIRTYP (crb->object.dglyph.glyph) ||
            crb->findex != drb->findex))
     {
       /* We need some way of telling redisplay_output_layout () that the
@@ -255,19 +255,19 @@ compare_runes (struct window *w, struct rune *crb, struct rune *drb)
        return 0;
       ii = XIMAGE_INSTANCE (image);
 
-      if (TEXT_IMAGE_INSTANCEP (image) && 
-         (crb->findex != drb->findex || 
+      if (TEXT_IMAGE_INSTANCEP (image) &&
+         (crb->findex != drb->findex ||
           WINDOW_FACE_CACHEL_DIRTY (w, drb->findex)))
        return 0;
 
-      /* It is quite common of the two glyphs to be EQ since in many
+      /* It is quite common for the two glyphs to be EQ since in many
         cases they will actually be the same object. This does not
         mean, however, that nothing has changed. We therefore need to
         check the current hash of the glyph against the last recorded
         display hash and the pending display items. See
         update_subwindow (). */
       if (image_instance_changed (image) ||
-         crb->findex != drb->findex || 
+         crb->findex != drb->findex ||
          WINDOW_FACE_CACHEL_DIRTY (w, drb->findex))
        {
          /* We now now we are going to re-output the glyph, but since
@@ -275,7 +275,7 @@ compare_runes (struct window *w, struct rune *crb, struct rune *drb)
             changes, send a hint to the output routines that they can
             take some short cuts. This is most useful for
             layouts. This flag should get reset by the output
-            routines. 
+            routines.
 
             #### It is possible for us to get here when the
             face_cachel is dirty. I do not know what the implications
@@ -1169,17 +1169,16 @@ static void redisplay_unmap_subwindows (struct frame* f, int x, int y, int width
   LIST_LOOP (rest, XWEAK_LIST_LIST (FRAME_SUBWINDOW_CACHE (f)))
     {
       Lisp_Image_Instance *ii = XIMAGE_INSTANCE (XCAR (rest));
-
       if (IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (ii)
          &&
          IMAGE_INSTANCE_DISPLAY_X (ii)
-         + IMAGE_INSTANCE_DISPLAY_WIDTH (ii) > x 
-         && 
+         + IMAGE_INSTANCE_DISPLAY_WIDTH (ii) > x
+         &&
          IMAGE_INSTANCE_DISPLAY_X (ii) < x + width
          &&
          IMAGE_INSTANCE_DISPLAY_Y (ii)
-         + IMAGE_INSTANCE_DISPLAY_HEIGHT (ii) > y 
-         && 
+         + IMAGE_INSTANCE_DISPLAY_HEIGHT (ii) > y
+         &&
          IMAGE_INSTANCE_DISPLAY_Y (ii) < y + height
          &&
          !EQ (XCAR (rest), ignored_window))
@@ -1236,7 +1235,7 @@ redisplay_output_subwindow (struct window *w,
   /* The first thing we are going to do is update the display
      characteristics of the subwindow. This also clears the dirty
      flags as a side effect. */
-  update_subwindow (image_instance);
+  redisplay_subwindow (image_instance);
 
   /* This makes the glyph area fit into the display area. */
   if (!redisplay_normalize_glyph_area (db, dga))
@@ -1296,27 +1295,25 @@ redisplay_output_subwindow (struct window *w,
  issues lwlib has to grapple with. We really need to know what has
  actually changed and make a layout decision based on that. We also
  really need to know what has changed so that we can only make the
- neccessary changes in update_subwindow.  This has all now been
+ necessary changes in update_subwindow.  This has all now been
  implemented, Viva la revolution!
  ****************************************************************************/
 void
-redisplay_output_layout (struct window *w,
+redisplay_output_layout (Lisp_Object domain,
                         Lisp_Object image_instance,
                         struct display_box* db, struct display_glyph_area* dga,
                         face_index findex, int cursor_start, int cursor_width,
                         int cursor_height)
 {
   Lisp_Image_Instance *p = XIMAGE_INSTANCE (image_instance);
-  Lisp_Object window, rest;
+  Lisp_Object rest, window = DOMAIN_WINDOW (domain);
   Emchar_dynarr *buf = Dynarr_new (Emchar);
-  struct frame *f = XFRAME (w->frame);
-  struct device *d = XDEVICE (f->device);
+  struct window *w = XWINDOW (window);
+  struct device *d = DOMAIN_XDEVICE (domain);
   int layout_height, layout_width;
 
-  XSETWINDOW (window, w);
-
-  layout_height = glyph_height (image_instance, window);
-  layout_width = glyph_width (image_instance, window);
+  layout_height = glyph_height (image_instance, domain);
+  layout_width = glyph_width (image_instance, domain);
 
   dga->height = layout_height;
   dga->width = layout_width;
@@ -1389,7 +1386,8 @@ redisplay_output_layout (struct window *w,
   /* Flip through the widgets in the layout displaying as necessary */
   LIST_LOOP (rest, IMAGE_INSTANCE_LAYOUT_CHILDREN (p))
     {
-      Lisp_Object child = XCAR (rest);
+      Lisp_Object child = glyph_image_instance (XCAR (rest), image_instance,
+                                               ERROR_ME_NOT, 1);
 
       struct display_box cdb;
       /* For losing HP-UX */
@@ -1407,10 +1405,10 @@ redisplay_output_layout (struct window *w,
          struct display_glyph_area cdga;
          cdga.xoffset  = IMAGE_INSTANCE_XOFFSET (childii) - dga->xoffset;
          cdga.yoffset = IMAGE_INSTANCE_YOFFSET (childii) - dga->yoffset;
-         cdga.width = glyph_width (child, window);
-         cdga.height = glyph_height (child, window);
+         cdga.width = glyph_width (child, image_instance);
+         cdga.height = glyph_height (child, image_instance);
 
-         IMAGE_INSTANCE_OPTIMIZE_OUTPUT (childii) = 
+         IMAGE_INSTANCE_OPTIMIZE_OUTPUT (childii) =
            IMAGE_INSTANCE_OPTIMIZE_OUTPUT (p);
 
          /* Although normalization is done by the output routines
@@ -1462,9 +1460,9 @@ redisplay_output_layout (struct window *w,
                        xzero (dl);
                        /* Munge boxes into display lines. */
                        dl.ypos = (cdb.ypos - cdga.yoffset)
-                         + glyph_ascent (child, window);
-                       dl.ascent = glyph_ascent (child, window);
-                       dl.descent = glyph_descent (child, window);
+                         + glyph_ascent (child, image_instance);
+                       dl.ascent = glyph_ascent (child, image_instance);
+                       dl.descent = glyph_descent (child, image_instance);
                        dl.top_clip = cdga.yoffset;
                        dl.clip = (dl.ypos + dl.descent) - (cdb.ypos + cdb.height);
                        /* output_string doesn't understand offsets in
@@ -1491,7 +1489,7 @@ redisplay_output_layout (struct window *w,
                case IMAGE_WIDGET:
                  if (EQ (IMAGE_INSTANCE_WIDGET_TYPE (childii), Qlayout))
                    {
-                     redisplay_output_layout (w, child, &cdb, &cdga, findex,
+                     redisplay_output_layout (image_instance, child, &cdb, &cdga, findex,
                                               0, 0, 0);
                      break;
                    }
@@ -1514,10 +1512,10 @@ redisplay_output_layout (struct window *w,
          IMAGE_INSTANCE_OPTIMIZE_OUTPUT (childii) = 0;
        }
     }
-  
+
   /* Update any display properties. I'm not sure whether this actually
      does anything for layouts except clear the changed flags. */
-  update_subwindow (image_instance);
+  redisplay_subwindow (image_instance);
 
   Dynarr_free (buf);
 }
@@ -1559,7 +1557,7 @@ redisplay_output_pixmap (struct window *w,
     {
       redisplay_clear_clipped_region (window, findex,
                                      db, dga,
-                                     (int)IMAGE_INSTANCE_PIXMAP_MASK (p),
+                                     (IMAGE_INSTANCE_PIXMAP_MASK (p) != 0),
                                      Qnil);
 
       /* This shrinks the display box to exactly enclose the glyph
@@ -1681,7 +1679,7 @@ redisplay_clear_region (Lisp_Object locale, face_index findex, int x, int y,
  redisplay_clear_clipped_region
 
  Clear the area in the dest display_box not covered by the src
- display_glyph_area using the given face. This is a common occurance
+ display_glyph_area using the given face. This is a common occurrence
  for images shorter than the display line. Clipping can be played
  around with by altering these. glyphsrc should be normalized.
  ****************************************************************************/
index e1a6063..359f5e2 100644 (file)
@@ -166,8 +166,7 @@ static void
 #endif
 tty_frame_output_end (struct frame *f)
 {
-  struct device *d = XDEVICE (FRAME_DEVICE (f));
-  struct console *c = XCONSOLE (DEVICE_CONSOLE (d));
+  struct console *c = XCONSOLE (FRAME_CONSOLE (f));
 
   CONSOLE_TTY_CURSOR_X (c) = CONSOLE_TTY_FINAL_CURSOR_X (c);
   CONSOLE_TTY_CURSOR_Y (c) = CONSOLE_TTY_FINAL_CURSOR_Y (c);
@@ -882,7 +881,13 @@ reset_tty_modes (struct console *c)
   OUTPUT1_IF (c, TTY_SD (c).keypad_off);
   OUTPUT1_IF (c, TTY_SD (c).cursor_normal);
   OUTPUT1_IF (c, TTY_SD (c).end_motion);
-  tty_frame_output_end (XFRAME (CONSOLE_SELECTED_FRAME (c)));
+
+  {
+    Lisp_Object frm = CONSOLE_SELECTED_FRAME (c);
+
+    if (!NILP (frm))
+      tty_frame_output_end (XFRAME (frm));
+  }
 }
 
 /*****************************************************************************
index afccf66..98f1334 100644 (file)
@@ -458,12 +458,12 @@ x_output_display_block (struct window *w, struct display_line *dl, int block,
                                               cursor_start, cursor_width,
                                               cursor_height, 0);
                      break;
-                     
+
                    case IMAGE_WIDGET:
                      if (EQ (XIMAGE_INSTANCE_WIDGET_TYPE (instance),
                              Qlayout))
                        {
-                         redisplay_output_layout (w, instance, &dbox, &dga, findex,
+                         redisplay_output_layout (window, instance, &dbox, &dga, findex,
                                                   cursor_start, cursor_width,
                                                   cursor_height);
                          break;
@@ -473,17 +473,17 @@ x_output_display_block (struct window *w, struct display_line *dl, int block,
                                                  cursor_start, cursor_width,
                                                  cursor_height);
                      break;
-                     
+
                    case IMAGE_NOTHING:
                      /* nothing is as nothing does */
                      break;
-                     
+
                    case IMAGE_TEXT:
                    case IMAGE_POINTER:
                    default:
                      abort ();
                    }
-                 IMAGE_INSTANCE_OPTIMIZE_OUTPUT 
+                 IMAGE_INSTANCE_OPTIMIZE_OUTPUT
                    (XIMAGE_INSTANCE (instance)) = 0;
                }
 
@@ -2000,7 +2000,7 @@ x_flash (struct device *d)
                      w->pixel_width, flash_height);
     }
   else
-    /* If it is short, flash it all.  */ 
+    /* If it is short, flash it all.  */
     XFillRectangle (dpy, win, gc, w->pixel_left, w->pixel_top,
                    w->pixel_width, w->pixel_height);
 
@@ -2033,7 +2033,7 @@ x_flash (struct device *d)
                      w->pixel_width, flash_height);
     }
   else
-    /* If it is short, flash it all.  */ 
+    /* If it is short, flash it all.  */
     XFillRectangle (dpy, win, gc, w->pixel_left, w->pixel_top,
                    w->pixel_width, w->pixel_height);
 
index a8a26c7..6604dd2 100644 (file)
@@ -1659,7 +1659,7 @@ add_glyph_rune (pos_data *data, struct glyph_block *gb, int pos_type,
       else
        findex = get_builtin_face_cache_index (w, face);
 
-      instance = glyph_image_instance (gb->glyph, data->window, 
+      instance = glyph_image_instance (gb->glyph, data->window,
                                       ERROR_ME_NOT, 1);
       if (TEXT_IMAGE_INSTANCEP (instance))
        {
@@ -3500,7 +3500,7 @@ generate_formatted_string_db (Lisp_Object format_str, Lisp_Object result_str,
 
   /* result_str is nil when we're building a frame or icon title. Otherwise,
      we're building a modeline, so the offset starts at the modeline
-     horizontal scrolling ammount */
+     horizontal scrolling amount */
   if (! NILP (result_str))
     offset = w->modeline_hscroll;
   generate_fstring_runes (w, &data, 0, 0, -1, format_str, 0,
@@ -4284,9 +4284,9 @@ create_string_text_block (struct window *w, Lisp_Object disp_string,
   int truncate_win = b ? window_truncation_on (w) : 0;
   int end_glyph_width = 0;
 
-  /* we're going to ditch selective display for static text, its an
-     FSF thing and invisble extents are the way to go
-     here. Implementing it also relies on a number of buffer-specific
+  /* We're going to ditch selective display for static text, it's an
+     FSF thing and invisible extents are the way to go here.
+     Implementing it also relies on a number of buffer-specific
      functions that we don't have the luxury of being able to use
      here. */
 
@@ -5989,7 +5989,7 @@ redisplay_window (Lisp_Object window, int skip_selected)
       && !(MINI_WINDOW_P (w) && f->buffers_changed)
       && !f->frame_changed
       && !truncation_changed
-      /* check whether start is really at the begining of a line  GE */
+      /* check whether start is really at the beginning of a line  GE */
       && (!w->start_at_line_beg || beginning_of_line_p (b, startp))
       )
     {
@@ -6331,12 +6331,15 @@ redisplay_frame (struct frame *f, int preemption_check)
   if (f->clear)
     f->frame_changed = 1;
 
-  /* Invalidate the subwindow cache. We use subwindows_changed here to
-     cause subwindows to get instantiated. This is because
+  /* Invalidate the subwindow caches. We use subwindows_changed here
+     to cause subwindows to get instantiated. This is because
      subwindows_state_changed is less strict - dealing with things
      like the clicked state of button. We have to do this before
      redisplaying the gutters as subwindows get unmapped in the
      process.*/
+  if (f->frame_changed)
+    reset_frame_subwindow_instance_cache (f);
+
   if (f->frame_changed || f->subwindows_changed)
     {
       /* we have to do this so the gutter gets regenerated. */
@@ -7530,7 +7533,7 @@ point_would_be_visible (struct window *w, Bufpos startp, Bufpos point)
    displayed.  The end of the last line is also know as the window end
    position.
 
-   WARNING: It is possible that rediplay failed to layout any lines for the
+   WARNING: It is possible that redisplay failed to layout any lines for the
    windows. Under normal circumstances this is rare. However it seems that it
    does occur in the following situation: A mouse event has come in and we
    need to compute its location in a window. That code (in
@@ -8890,7 +8893,7 @@ input and is guaranteed to proceed to completion.
 
   redisplay_frame (f, 1);
 
-  /* If we don't reset the global redisplay flafs here, subsequent
+  /* If we don't reset the global redisplay flags here, subsequent
      changes to the display will not get registered by redisplay
      because it thinks it already has registered changes. If you
      really knew what you were doing you could confuse redisplay by
index 4f5e6b1..08ac68c 100644 (file)
@@ -272,7 +272,7 @@ typedef struct
   to the things that are being displayed, and the context,
   e.g. buffers and windows. According to Chuck this is so that we can
   get speed, which seems fine to me, however this usage is extended
-  too far down the redispay routines IMO. At some level there should
+  too far down the redisplay routines IMO. At some level there should
   be functions that know how to display strings with extents and
   faces, regardless of buffer etc. After all the window system does
   not care. <andy@xemacs.org> */
@@ -751,7 +751,7 @@ int compute_line_start_cache_dynarr_usage (line_start_cache_dynarr *dyn,
 int get_next_display_block (layout_bounds bounds,
                            display_block_dynarr *dba, int start_pos,
                            int *next_start);
-void redisplay_output_layout (struct window *w,
+void redisplay_output_layout (Lisp_Object domain,
                              Lisp_Object image_instance,
                              struct display_box* db, struct display_glyph_area* dga,
                              face_index findex, int cursor_start, int cursor_width,
index 683a4be..ef33687 100644 (file)
@@ -5500,22 +5500,25 @@ re_match_2_internal (struct re_pattern_buffer *bufp, const char *string1,
 #ifdef emacs
        case before_dot:
           DEBUG_PRINT1 ("EXECUTING before_dot.\n");
-         if (BUF_PTR_BYTE_POS (regex_emacs_buffer, (unsigned char *) d) >=
-             BUF_PT (regex_emacs_buffer))
+         if (!regex_emacs_buffer_p
+             || (BUF_PTR_BYTE_POS (regex_emacs_buffer, (unsigned char *) d)
+                 >= BUF_PT (regex_emacs_buffer)))
            goto fail;
          break;
 
        case at_dot:
           DEBUG_PRINT1 ("EXECUTING at_dot.\n");
-         if (BUF_PTR_BYTE_POS (regex_emacs_buffer, (unsigned char *) d)
-             != BUF_PT (regex_emacs_buffer))
+         if (!regex_emacs_buffer_p
+             || (BUF_PTR_BYTE_POS (regex_emacs_buffer, (unsigned char *) d)
+                 != BUF_PT (regex_emacs_buffer)))
            goto fail;
          break;
 
        case after_dot:
           DEBUG_PRINT1 ("EXECUTING after_dot.\n");
-          if (BUF_PTR_BYTE_POS (regex_emacs_buffer, (unsigned char *) d)
-             <= BUF_PT (regex_emacs_buffer))
+          if (!regex_emacs_buffer_p
+             || (BUF_PTR_BYTE_POS (regex_emacs_buffer, (unsigned char *) d)
+                 <= BUF_PT (regex_emacs_buffer)))
            goto fail;
          break;
 #if 0 /* not emacs19 */
index 103206c..d0cce94 100644 (file)
@@ -60,15 +60,6 @@ Boston, MA 02111-1307, USA.  */
 /* In AIX, you allocate a pty by opening /dev/ptc to get the master side.
    To get the name of the slave side, you just ttyname() the master side.  */
 
-#define PTY_ITERATION for (c = 0; !c ; c++)
-#define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptc");
-#define PTY_TTY_NAME_SPRINTF strcpy (pty_name, ttyname (fd));
-
-/* XEmacs change: #### is this crap necessary? */
-#ifndef NOT_C_CODE
-#include <termios.h>
-#endif
-
 /*
  *     Define HAVE_PTYS if the system supports pty devices.
  */
index 61e18b7..eacae2e 100644 (file)
@@ -17,8 +17,6 @@
 #define LIBS_DEBUG
 #define LIBS_SYSTEM "-lutil -lcompat"
 
-#define HAVE_GETLOADAVG
-
 /* System uses OXTABS instead of the expected TAB3.
    (Copied from netbsd.h.)  */
 #define TABDLY OXTABS
index c8673c3..8a2c246 100644 (file)
@@ -61,11 +61,20 @@ Boston, MA 02111-1307, USA.  */
 #  endif
 # endif
 
+# if CYGWIN_VERSION_DLL_MAJOR < 20
+
 void cygwin32_win32_to_posix_path_list (const char*, char*);
 int cygwin32_win32_to_posix_path_list_buf_size (const char*);
 void cygwin32_posix_to_win32_path_list (const char*, char*);
 int cygwin32_posix_to_win32_path_list_buf_size (const char*);
-# if CYGWIN_VERSION_DLL_MAJOR < 20
+
+#define cygwin_win32_to_posix_path_list cygwin32_win32_to_posix_path_list
+#define cygwin_win32_to_posix_path_list_buf_size \
+  cygwin32_win32_to_posix_path_list_buf_size
+#define cygwin_posix_to_win32_path_list cygwin32_posix_to_win32_path_list
+#define cygwin_posix_to_win32_path_list_buf_size \
+  cygwin32_posix_to_win32_path_list_buf_size
+
 struct timeval;
 struct timezone;
 struct itimerval;
@@ -89,6 +98,13 @@ int utimes (char *file, struct timeval *tvp);
 int srandom (unsigned seed);
 long random (void);
 
+# else /* not CYGWIN_VERSION_DLL_MAJOR < 20 */
+
+void cygwin_win32_to_posix_path_list (const char*, char*);
+int cygwin_win32_to_posix_path_list_buf_size (const char*);
+void cygwin_posix_to_win32_path_list (const char*, char*);
+int cygwin_posix_to_win32_path_list_buf_size (const char*);
+
 # endif /* CYGWIN_VERSION_DLL_MAJOR < 20 */
 
 # if CYGWIN_VERSION_DLL_MAJOR <= 20
@@ -96,6 +112,9 @@ char *getpass (const char *prompt);
 double logb (double);
 # endif /* CYGWIN_VERSION_DLL_MAJOR <= 20 */
 
+/* Still left out of 1.1! */
+double logb (double);
+
 #endif
 
 #ifndef ORDINARY_LINK
@@ -131,18 +150,8 @@ double logb (double);
 
 #undef MAIL_USE_SYSTEM_LOCK
 
-/* Define NO_ARG_ARRAY if you cannot take the address of the first of a
- * group of arguments and treat it as an array of the arguments.  */
-
-#define NO_ARG_ARRAY
-
-/* Data type of load average, as read out of kmem.  */
-
-#define LOAD_AVE_TYPE long
-
-/* Convert that into an integer that is 100 for a load average of 1.0  */
-
-#define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
+/* Do not define LOAD_AVE_TYPE or LOAD_AVE_CVT
+   since there is no load average available. */
 
 /* Define VIRT_ADDR_VARIES if the virtual addresses of
    pure and impure space as loaded can vary, and even their
@@ -203,44 +212,8 @@ double logb (double);
 #define SYSTEM_PURESIZE_EXTRA 15000
 
 #define CYGWIN_CONV_PATH(src, dst) \
-dst = alloca (cygwin32_win32_to_posix_path_list_buf_size(src)); \
-cygwin32_win32_to_posix_path_list(src, dst)
+dst = alloca (cygwin_win32_to_posix_path_list_buf_size(src)); \
+cygwin_win32_to_posix_path_list(src, dst)
 #define CYGWIN_WIN32_PATH(src, dst) \
-dst = alloca (cygwin32_posix_to_win32_path_list_buf_size(src)); \
-cygwin32_posix_to_win32_path_list(src, dst)
-
-/*
- * stolen from usg.
- */
-#define HAVE_PTYS
-#define FIRST_PTY_LETTER 'z'
-
-/* Pseudo-terminal support under SVR4 only loops to deal with errors. */
-
-#define PTY_ITERATION for (i = 0, c = 0; i < 1; i++)
-
-/* This sets the name of the master side of the PTY. */
-
-#define PTY_NAME_SPRINTF strcpy (pty_name, "/dev/ptmx");
-
-/* This sets the name of the slave side of the PTY.  On SysVr4,
-   grantpt(3) forks a subprocess, so keep sigchld_handler() from
-   intercepting that death.  If any child but grantpt's should die
-   within, it should be caught after EMACS_UNBLOCK_SIGNAL. */
-
-#define PTY_OPEN \
-   fd = open (pty_name, O_RDWR | O_NONBLOCK | OPEN_BINARY, 0)
-
-#define PTY_TTY_NAME_SPRINTF                           \
-  {                                                    \
-    extern char* ptsname(int);                         \
-    char *ptyname;                                     \
-                                                       \
-    if (!(ptyname = ptsname (fd)))                     \
-      { close (fd); return -1; }                       \
-    strncpy (pty_name, ptyname, sizeof (pty_name));    \
-    pty_name[sizeof (pty_name) - 1] = 0;               \
-  }
-
-/* ============================================================ */
-
+dst = alloca (cygwin_posix_to_win32_path_list_buf_size(src)); \
+cygwin_posix_to_win32_path_list(src, dst)
index 01ddc2f..bac8625 100644 (file)
@@ -97,7 +97,6 @@
 
 #endif /* not __ELF__ */
 
-#define HAVE_GETLOADAVG
 /* #define NO_TERMIO */ /* detected in configure */
 #define DECLARE_GETPWUID_WITH_UID_T
 
index 5e70049..7d3daa9 100644 (file)
@@ -29,9 +29,6 @@ Boston, MA 02111-1307, USA.  */
 #undef SYSTEM_TYPE
 #define SYSTEM_TYPE "gnu"
 
-/* XXX should getloadavg be in libc?  Should we have a libutil?
-#define HAVE_GETLOADAVG */
-
 #define LIBS_DEBUG
 
 /* XXX emacs should not expect TAB3 to be defined.  */
index a99e9ca..b150e22 100644 (file)
 
 #define WNOHANG                0x1
 
-/* No need to use sprintf to get the tty name--we get that from _getpty.  */
-#undef PTY_TTY_NAME_SPRINTF
-#define PTY_TTY_NAME_SPRINTF
-/* No need to get the pty name at all.  */
-#define PTY_NAME_SPRINTF
-/* We need only try once to open a pty.  */
-#define PTY_ITERATION
-/* Here is how to do it.  */
-/* It is necessary to prevent SIGCHLD signals within _getpty.
-   So we block them. */
-#define PTY_OPEN                                               \
-{                                                              \
-  char *name;                                                  \
-  struct stat stb;                                             \
-  EMACS_BLOCK_SIGCHLD;                                         \
-  name = _getpty (&fd, O_RDWR | O_NDELAY, 0600, 0);            \
-  EMACS_UNBLOCK_SIGCHLD;                                       \
-  if (name == 0)                                               \
-    return -1;                                                 \
-  if (fd < 0)                                                  \
-    return -1;                                                 \
-  if (fstat (fd, &stb) < 0)                                    \
-    return -1;                                                 \
-  strcpy (pty_name, name);                                     \
-}
-
 /* jpff@maths.bath.ac.uk reports `struct exception' is not defined
    on this system, so inhibit use of matherr.  */
 #define NO_MATHERR
index d1ac5dc..f0dabaf 100644 (file)
 #undef SETUP_SLAVE_PTY
 #endif
 
-/* No need to use sprintf to get the tty name--we get that from _getpty.  */
-#ifdef PTY_TTY_NAME_SPRINTF
-#undef PTY_TTY_NAME_SPRINTF
-#endif
-#define PTY_TTY_NAME_SPRINTF
-/* No need to get the pty name at all.  */
-#ifdef PTY_NAME_SPRINTF
-#undef PTY_NAME_SPRINTF
-#endif
-#define PTY_NAME_SPRINTF
-#ifdef emacs
-char *_getpty ();
-#endif
-/* We need only try once to open a pty.  */
-#define PTY_ITERATION
-/* Here is how to do it.  */
-/* It is necessary to prevent SIGCHLD signals within _getpty.
-   So we block them. */
-#define PTY_OPEN                                               \
-{                                                              \
-  char *name;                                                  \
-  struct stat stb;                                             \
-  EMACS_BLOCK_SIGCHLD;                                         \
-  name = _getpty (&fd, O_RDWR | O_NDELAY, 0600, 0);            \
-  EMACS_UNBLOCK_SIGCHLD;                                       \
-  if (name == 0)                                               \
-    return -1;                                                 \
-  if (fd < 0)                                                  \
-    return -1;                                                 \
-  if (fstat (fd, &stb) < 0)                                    \
-    return -1;                                                 \
-  strcpy (pty_name, name);                                     \
-}
-
 /* jpff@maths.bath.ac.uk reports `struct exception' is not defined
    on this system, so inhibit use of matherr.  */
 #define NO_MATHERR
index 8d8d138..4e85f20 100644 (file)
@@ -207,3 +207,4 @@ Boston, MA 02111-1307, USA.  */
 
 /* XEmacs: removed setpgrp() definition because we use setpgid() when
    it's available, and autodetect it. */
+
index 1c50be9..c0e8b0c 100644 (file)
@@ -60,11 +60,6 @@ Boston, MA 02111-1307, USA.  */
 #undef MAIL_USE_SYSTEM_LOCK
 #define HAVE_MSW_C_DIRED
 
-/* Define NO_ARG_ARRAY if you cannot take the address of the first of a
- * group of arguments and treat it as an array of the arguments.  */
-
-#define NO_ARG_ARRAY
-
 /* System calls that are encapsulated */
 #define ENCAPSULATE_RENAME
 #define ENCAPSULATE_OPEN
@@ -73,13 +68,8 @@ Boston, MA 02111-1307, USA.  */
 #define ENCAPSULATE_STAT
 #define ENCAPSULATE_FSTAT
 
-/* Data type of load average, as read out of kmem.  */
-
-#define LOAD_AVE_TYPE long
-
-/* Convert that into an integer that is 100 for a load average of 1.0  */
-
-#define LOAD_AVE_CVT(x) (int) (((double) (x)) * 100.0 / FSCALE)
+/* Do not define LOAD_AVE_TYPE or LOAD_AVE_CVT
+   since there is no load average available. */
 
 /* Define VIRT_ADDR_VARIES if the virtual addresses of
    pure and impure space as loaded can vary, and even their
index 30b7525..6b84bd0 100644 (file)
@@ -17,7 +17,6 @@
 
 #undef KERNEL_FILE
 #undef LDAV_SYMBOL
-#define HAVE_GETLOADAVG
 
 #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)
 
index b306088..d780f91 100644 (file)
 #define USG5_4
 #endif
 
-#if OS_RELEASE >= 57
-#define HAVE_GETLOADAVG
-#endif
-
 /* Fix understandable GCC lossage on Solaris 2.6 */
 #if defined(__GNUC__) && OS_RELEASE >= 56 && !defined(NOT_C_CODE)
 
index 6175a2c..985dbe3 100644 (file)
@@ -228,8 +228,6 @@ typedef int pid_t;
 #define HAVE_H_ERRNO
 #define HAVE_STRUCT_UTIMBUF
 
-#define HAVE_STRCASECMP
-
 /* Compatibility macros. Some used to be routines in nt.c */
 #define strcasecmp(x,y) _stricmp(x,y)
 #define random() (rand() << 15 | rand())
@@ -357,6 +355,16 @@ gid_t getegid (void);
  #endif
 #endif
 
+/* Force the various NT 4 structures and constants to be included; we're
+   careful not to call (or even link with) functions not in NT 3.51 when
+   running on 3.51, but when running on NT 4 or Win9x, we use the later
+   functions, and need their headers. */
+/* The VC++ (5.0, at least) headers treat WINVER non-existent as 0x0400 */
+#if defined (WINVER) && WINVER < 0x0400
+# undef WINVER
+# define WINVER 0x0400
+#endif
+
 /* MSVC 6.0 has a mechanism to declare functions which never return */
 #if (_MSC_VER >= 1200)
 #define DOESNT_RETURN __declspec(noreturn) void
index dd1caa3..832fcbd 100644 (file)
@@ -47,14 +47,14 @@ mswindows_create_scrollbar_instance (struct frame *f, int vertical,
                                     struct scrollbar_instance *sb)
 {
   int orientation;
-  
+
   sb->scrollbar_data = xnew_and_zero (struct mswindows_scrollbar_data);
-  
+
   if (vertical)
     orientation = SBS_VERT;
   else
     orientation = SBS_HORZ;
-  
+
   SCROLLBAR_MSW_HANDLE (sb) =
     CreateWindowEx(0, "SCROLLBAR", 0, orientation|WS_CHILD,
                 CW_USEDEFAULT, CW_USEDEFAULT,
@@ -83,7 +83,7 @@ static void
 mswindows_free_scrollbar_instance (struct scrollbar_instance *sb)
 {
   DestroyWindow (SCROLLBAR_MSW_HANDLE (sb));
-  if (sb->scrollbar_data) 
+  if (sb->scrollbar_data)
     xfree (sb->scrollbar_data);
 }
 
@@ -146,7 +146,7 @@ mswindows_update_scrollbar_instance_values (struct window *w,
   UPDATE_POS_FIELD (scrollbar_width);
   UPDATE_POS_FIELD (scrollbar_height);
 
-  if (pos_changed) 
+  if (pos_changed)
     {
       MoveWindow(SCROLLBAR_MSW_HANDLE (sb),
                 new_scrollbar_x, new_scrollbar_y,
@@ -186,7 +186,7 @@ mswindows_handle_scrollbar_event (HWND hwnd, int code, int pos)
   f = XFRAME (frame);
 
   /* SB_LINEDOWN == SB_CHARLEFT etc. This is the way they will
-     always be - any Windows is binary compatible backward with 
+     always be - any Windows is binary compatible backward with
      old programs */
 
   switch (code)
@@ -195,12 +195,12 @@ mswindows_handle_scrollbar_event (HWND hwnd, int code, int pos)
       mswindows_enqueue_misc_user_event
        (frame, vert ? Qscrollbar_line_down : Qscrollbar_char_right, win);
       break;
-         
+
     case SB_LINEUP:
       mswindows_enqueue_misc_user_event
        (frame, vert ? Qscrollbar_line_up : Qscrollbar_char_left, win);
       break;
-         
+
     case SB_PAGEDOWN:
       mswindows_enqueue_misc_user_event
        (win, vert ? Qscrollbar_page_down : Qscrollbar_page_right,
@@ -213,7 +213,7 @@ mswindows_handle_scrollbar_event (HWND hwnd, int code, int pos)
         vert ? Qscrollbar_page_up : Qscrollbar_page_left,
         vert ? Fcons (win, Qnil) : win);
       break;
-         
+
     case SB_BOTTOM:
       mswindows_enqueue_misc_user_event
        (frame, vert ? Qscrollbar_to_bottom : Qscrollbar_to_right, win);
@@ -276,7 +276,7 @@ can_scroll(struct scrollbar_instance* scrollbar)
 int
 mswindows_handle_mousewheel_event (Lisp_Object frame, int keys, int delta)
 {
-  int hasVertBar, hasHorzBar;  /* Indicates prescence of scroll bars */
+  int hasVertBar, hasHorzBar;  /* Indicates presence of scroll bars */
   unsigned wheelScrollLines = 0; /* Number of lines per wheel notch */
 
   /* Find the currently selected window */
index 554be5d..39967fd 100644 (file)
@@ -23,6 +23,8 @@ Boston, MA 02111-1307, USA.  */
 
 /* Synched up with: Not in FSF. */
 
+/* This file Mule-ized (more like Mule-verified) by Ben Wing, 7-8-00. */
+
 #include <config.h>
 #include "lisp.h"
 
@@ -408,7 +410,7 @@ x_update_vertical_scrollbar_callback (Widget widget, LWLIB_ID id,
   mirror = find_scrollbar_window_mirror (f, id);
   if (!mirror)
     return;
-  
+
   win = real_window (mirror, 1);
 
   if (NILP (win))
@@ -614,7 +616,7 @@ x_update_horizontal_scrollbar_callback (Widget widget, LWLIB_ID id,
   mirror = find_scrollbar_window_mirror (f, id);
   if (!mirror)
     return;
-  
+
   win = real_window (mirror, 1);
 
   if (NILP (win))
index ffa3c12..37092a5 100644 (file)
@@ -461,7 +461,7 @@ update_scrollbar_instance (struct window *w, int vertical,
          {
            x_offset = WINDOW_LEFT (w);
          }
-       else 
+       else
          {
            x_offset = WINDOW_RIGHT (w) - scrollbar_width;
            if (window_needs_vertical_divider (w))
@@ -1004,7 +1004,7 @@ This is a specifier; use `set-specifier' to change it.
 This is a specifier; use `set-specifier' to change it.
 */ );
   Vscrollbar_on_left_p = Fmake_specifier (Qboolean);
-  
+
   {
     /* Kludge. Under X, we want athena scrollbars on the left,
        while all other scrollbars go on the right by default. */
index 46feb9c..7f92765 100644 (file)
@@ -301,6 +301,7 @@ looking_at_1 (Lisp_Object string, struct buffer *buf, int posix)
   s2 = BI_BUF_ZV (buf) - p2;
 
   regex_emacs_buffer = buf;
+  regex_emacs_buffer_p = 1;
   i = re_match_2 (bufp, (char *) BI_BUF_BYTE_ADDRESS (buf, p1),
                  s1, (char *) BI_BUF_BYTE_ADDRESS (buf, p2), s2,
                  BI_BUF_PT (buf) - BI_BUF_BEGV (buf), &search_regs,
@@ -391,6 +392,7 @@ string_match_1 (Lisp_Object regexp, Lisp_Object string, Lisp_Object start,
   {
     Bytecount bis = charcount_to_bytecount (XSTRING_DATA (string), s);
     regex_emacs_buffer = buf;
+    regex_emacs_buffer_p = 0;
     val = re_search (bufp, (char *) XSTRING_DATA (string),
                     XSTRING_LENGTH (string), bis,
                     XSTRING_LENGTH (string) - bis,
@@ -484,6 +486,7 @@ fast_string_match (Lisp_Object regexp,  const Bufbyte *nonreloc,
 
   /* #### evil current-buffer dependency */
   regex_emacs_buffer = current_buffer;
+  regex_emacs_buffer_p = 0;
   val = re_search (bufp, (char *) newnonreloc + offset, length, 0,
                   length, 0);
 
@@ -1164,6 +1167,7 @@ search_buffer (struct buffer *buf, Lisp_Object string, Bufpos bufpos,
          Bytecount val;
          QUIT;
           regex_emacs_buffer = buf;
+         regex_emacs_buffer_p = 1;
          val = re_search_2 (bufp,
                             (char *) BI_BUF_BYTE_ADDRESS (buf, p1), s1,
                             (char *) BI_BUF_BYTE_ADDRESS (buf, p2), s2,
@@ -1202,6 +1206,7 @@ search_buffer (struct buffer *buf, Lisp_Object string, Bufpos bufpos,
          Bytecount val;
          QUIT;
           regex_emacs_buffer = buf;
+         regex_emacs_buffer_p = 1;
           val = re_search_2 (bufp,
                             (char *) BI_BUF_BYTE_ADDRESS (buf, p1), s1,
                             (char *) BI_BUF_BYTE_ADDRESS (buf, p2), s2,
@@ -1242,7 +1247,7 @@ search_buffer (struct buffer *buf, Lisp_Object string, Bufpos bufpos,
 
        BTW "BM" stands for Boyer-Moore, which is one of the standard
        string-searching algorithms.  It's the best string-searching
-       algorithm out there provided
+       algorithm out there, provided that:
 
        a) You're not fazed by algorithm complexity. (Rabin-Karp, which
           uses hashing, is much much easier to code but not as fast.)
@@ -1574,8 +1579,8 @@ set_search_regs (struct buffer *buf, Bufpos beg, Charcount len)
 
 \f
 /* Given a string of words separated by word delimiters,
-  compute a regexp that matches those exact words
-  separated by arbitrary punctuation.  */
+   compute a regexp that matches those exact words
+   separated by arbitrary punctuation.  */
 
 static Lisp_Object
 wordify (Lisp_Object buffer, Lisp_Object string)
@@ -2543,8 +2548,8 @@ void
 syms_of_search (void)
 {
 
-  deferror (&Qsearch_failed, "search-failed", "Search failed", Qerror);
-  deferror (&Qinvalid_regexp, "invalid-regexp", "Invalid regexp", Qerror);
+  DEFERROR_STANDARD (Qsearch_failed, Qinvalid_operation);
+  DEFERROR_STANDARD (Qinvalid_regexp, Qsyntax_error);
 
   DEFSUBR (Flooking_at);
   DEFSUBR (Fposix_looking_at);
index 4aa0aaf..1e8fd43 100644 (file)
@@ -65,14 +65,14 @@ symbol_to_ms_cf (Lisp_Object value)
 {
   /* If it's NIL, we're in trouble. */
   if (NILP (value))                    return 0;
-  
+
   /* If it's an integer, assume it's a format ID */
   if (INTP (value))                    return (UINT) (XINT (value));
 
   /* If it's a string, register the format(!) */
   if (STRINGP (value))
     return RegisterClipboardFormat (XSTRING_DATA (value));
-  
+
   /* Check for Windows clipboard format symbols */
   if (EQ (value, QCF_TEXT))            return CF_TEXT;
   if (EQ (value, QCF_BITMAP))          return CF_BITMAP;
@@ -82,6 +82,9 @@ symbol_to_ms_cf (Lisp_Object value)
   if (EQ (value, QCF_TIFF))            return CF_TIFF;
   if (EQ (value, QCF_OEMTEXT))         return CF_OEMTEXT;
   if (EQ (value, QCF_DIB))             return CF_DIB;
+#ifdef CF_DIBV5
+  if (EQ (value, QCF_DIBV5))           return CF_DIBV5;
+#endif
   if (EQ (value, QCF_PALETTE))         return CF_PALETTE;
   if (EQ (value, QCF_PENDATA))         return CF_PENDATA;
   if (EQ (value, QCF_RIFF))            return CF_RIFF;
@@ -114,6 +117,9 @@ ms_cf_to_symbol (UINT format)
     case CF_TIFF:              return QCF_TIFF;
     case CF_OEMTEXT:           return QCF_OEMTEXT;
     case CF_DIB:               return QCF_DIB;
+#ifdef CF_DIBV5
+    case CF_DIBV5:             return QCF_DIBV5;
+#endif
     case CF_PALETTE:           return QCF_PALETTE;
     case CF_PENDATA:           return QCF_PENDATA;
     case CF_RIFF:              return QCF_RIFF;
@@ -139,14 +145,18 @@ cf_is_autofreed (UINT format)
 {
   switch (format)
     {
-    /* This list comes from the SDK documentation */
+      /* This list comes from the SDK documentation */
     case CF_DSPENHMETAFILE:
     case CF_DSPMETAFILEPICT:
     case CF_ENHMETAFILE:
+    case CF_METAFILEPICT:
     case CF_BITMAP:
     case CF_DSPBITMAP:
     case CF_PALETTE:
     case CF_DIB:
+#ifdef CF_DIBV5
+    case CF_DIBV5:
+#endif
     case CF_DSPTEXT:
     case CF_OEMTEXT:
     case CF_TEXT:
@@ -159,7 +169,7 @@ cf_is_autofreed (UINT format)
 }
 
 /* Do protocol to assert ourself as a selection owner.
-   
+
    Under mswindows, we:
 
    * Only set the clipboard if (eq selection-name 'CLIPBOARD)
@@ -208,7 +218,7 @@ mswindows_own_selection (Lisp_Object selection_name,
       /* Only continue if we can figure out a clipboard type */
       if (!cfType)
        return Qnil;
-      
+
       cfObject = selection_type;
     }
 
@@ -230,52 +240,52 @@ mswindows_own_selection (Lisp_Object selection_name,
 
       data = XCDR (data);
     }
-  
+
   /* We support opaque or string values, but we only mention string
      values for now... */
   if (!OPAQUEP (data)
       && !STRINGP (data))
     return Qnil;
-      
+
   /* Compute the data length */
   if (OPAQUEP (data))
     size = XOPAQUE_SIZE (data);
   else
     size = XSTRING_LENGTH (data) + 1;
-      
+
   /* Find the frame */
   f = selected_frame ();
 
   /* Open the clipboard */
   if (!OpenClipboard (FRAME_MSWINDOWS_HANDLE (f)))
     return Qnil;
-  
+
   /* Allocate memory */
   hValue = GlobalAlloc (GMEM_DDESHARE | GMEM_MOVEABLE, size);
-      
+
   if (!hValue)
     {
       CloseClipboard ();
 
       return Qnil;
     }
-      
+
   /* Copy the data */
   if (OPAQUEP (data))
     src = XOPAQUE_DATA (data);
   else
     src = XSTRING_DATA (data);
-      
+
   dst = GlobalLock (hValue);
-  
+
   if (!dst)
     {
       GlobalFree (hValue);
       CloseClipboard ();
-      
+
       return Qnil;
     }
-  
+
   memcpy (dst, src, size);
 
   GlobalUnlock (hValue);
@@ -301,7 +311,7 @@ mswindows_own_selection (Lisp_Object selection_name,
     {
       Lisp_Object alist_elt = Qnil, rest;
       Lisp_Object cfType_int = make_int (cfType);
-      
+
       /* First check if there's an element in the alist for this type
         already. */
       alist_elt = assq_no_quit (cfType_int, Vhandle_alist);
@@ -314,7 +324,7 @@ mswindows_own_selection (Lisp_Object selection_name,
        {
          /* Free the original handle */
          GlobalFree ((HGLOBAL) get_opaque_ptr (XCDR (alist_elt)));
-       
+
          /* Remove the original one (adding first makes life easier, because
             we don't have to special case this being the first element)      */
          for (rest = Vhandle_alist; !NILP (rest); rest = Fcdr (rest))
@@ -325,7 +335,7 @@ mswindows_own_selection (Lisp_Object selection_name,
              }
        }
     }
-  
+
   CloseClipboard ();
 
   /* #### Should really return a time, though this is because of the
@@ -342,7 +352,7 @@ mswindows_available_selection_types (Lisp_Object selection_name)
 
   if (!EQ (selection_name, QCLIPBOARD))
     return Qnil;
-  
+
   /* Find the frame */
   f = selected_frame ();
 
@@ -353,7 +363,7 @@ mswindows_available_selection_types (Lisp_Object selection_name)
   /* #### ajh - Should there be an unwind-protect handler around this?
                 It could (well it probably won't, but it's always better to
                be safe) run out of memory and leave the clipboard open... */
-  
+
   while ((format = EnumClipboardFormats (format)))
     types = Fcons (ms_cf_to_symbol (format), types);
 
@@ -388,7 +398,7 @@ mswindows_selection_data_type_name (Lisp_Object type_id)
   /* If it's an integer, convert to a symbol if appropriate */
   if (INTP (type_id))
     type_id = ms_cf_to_symbol (XINT (type_id));
-  
+
   /* If this is a symbol, return it */
   if (SYMBOLP (type_id))
     return type_id;
@@ -410,10 +420,10 @@ mswindows_selection_data_type_name (Lisp_Object type_id)
          MULE could hack it. */
       name = make_ext_string (name_buf, numchars,
                              Fget_coding_system (Qraw_text));
-      
+
       return name;
     }
-  
+
   return Qnil;
 }
 
@@ -429,13 +439,13 @@ mswindows_get_foreign_selection (Lisp_Object selection_symbol,
   void         *data;
   struct frame  *f = NULL;
   struct gcpro gcpro1;
-  
+
   /* Only continue if we're trying to read the clipboard - mswindows doesn't
      use the same selection model as X */
   if (!EQ (selection_symbol, QCLIPBOARD))
     return Qnil;
 
-  /* If this is one fo the X-style atom name symbols, or NIL, convert it
+  /* If this is one of the X-style atom name symbols, or NIL, convert it
      as appropriate */
   if (NILP (target_type) || x_sym_p (target_type))
     {
@@ -492,7 +502,7 @@ mswindows_get_foreign_selection (Lisp_Object selection_symbol,
   CloseClipboard ();
 
   GCPRO1 (ret);
-  
+
   /* Convert this to the appropriate type. If we can't find anything,
      then we return a cons of the form (DATA-TYPE . STRING), where the
      string contains the raw binary data. */
@@ -501,7 +511,7 @@ mswindows_get_foreign_selection (Lisp_Object selection_symbol,
                             ret);
 
   UNGCPRO;
-  
+
   if (NILP (value))
     return Fcons (cfObject, ret);
   else
@@ -529,17 +539,15 @@ mswindows_disown_selection (Lisp_Object selection, Lisp_Object timeval)
 void
 mswindows_destroy_selection (Lisp_Object selection)
 {
-  Lisp_Object alist_elt;
-  
   /* Do nothing if this isn't for the clipboard. */
   if (!EQ (selection, QCLIPBOARD))
     return;
 
   /* Right. We need to delete everything in Vhandle_alist. */
-  alist_elt = Vhandle_alist;
-
-  for (alist_elt; !NILP (alist_elt); alist_elt = Fcdr (alist_elt))
-    GlobalFree ((HGLOBAL) get_opaque_ptr (XCDR (alist_elt)));
+  {
+    LIST_LOOP_2 (elt, Vhandle_alist)
+      GlobalFree ((HGLOBAL) get_opaque_ptr (XCDR (elt)));
+  }
 
   Vhandle_alist = Qnil;
 }
index d37ff2b..82470e5 100644 (file)
@@ -139,9 +139,7 @@ symbol_to_x_atom (struct device *d, Lisp_Object sym, int only_if_exists)
 
   {
     const char *nameext;
-    TO_EXTERNAL_FORMAT (LISP_STRING, Fsymbol_name (sym),
-                       C_STRING_ALLOCA, nameext,
-                       Qctext);
+    LISP_STRING_TO_EXTERNAL (Fsymbol_name (sym), nameext, Qctext);
     return XInternAtom (display, nameext, only_if_exists ? True : False);
   }
 }
@@ -228,7 +226,7 @@ x_own_selection (Lisp_Object selection_name, Lisp_Object selection_value,
      That assumed equivalence of time_t and Time, which is not
      necessarily the case (e.g. under OSF on the Alphas, where
      Time is a 64-bit quantity and time_t is a 32-bit quantity).
-     
+
      Opaque pointers are the clean way to go here.
   */
   selection_time = make_opaque (&thyme, sizeof (thyme));
@@ -378,7 +376,7 @@ motif_clipboard_cb (Widget widget, int *data_id, int *private_id, int *reason)
 
        /* Whichever lazy git wrote this originally just called abort()
           when anything didn't go their way... */
-       
+
        /* Try some other text types */
        if (NILP (selection))
          selection = select_convert_out (QCLIPBOARD, QSTRING, Qnil);
@@ -386,7 +384,7 @@ motif_clipboard_cb (Widget widget, int *data_id, int *private_id, int *reason)
          selection = select_convert_out (QCLIPBOARD, QTEXT, Qnil);
        if (NILP (selection))
          selection = select_convert_out (QCLIPBOARD, QCOMPOUND_TEXT, Qnil);
-       
+
        if (CONSP (selection) && SYMBOLP (XCAR (selection))
            && (EQ (XCAR (selection), QSTRING)
                || EQ (XCAR (selection), QTEXT)
@@ -400,8 +398,8 @@ motif_clipboard_cb (Widget widget, int *data_id, int *private_id, int *reason)
        if (!STRINGP (selection))
          signal_error (Qselection_conversion_error,
                        build_string ("couldn't convert selection to string"));
-                              
-       
+
+
        XmClipboardCopyByName (dpy, window, *data_id,
                               (char *) XSTRING_DATA (selection),
                               XSTRING_LENGTH (selection) + 1,
@@ -600,7 +598,7 @@ x_handle_selection_request (XSelectionRequestEvent *event)
     }
 
   local_selection_time = * (Time *) XOPAQUE_DATA (temp_obj);
-  
+
   if (event->time != CurrentTime &&
       local_selection_time > event->time)
     {
@@ -632,14 +630,14 @@ x_handle_selection_request (XSelectionRequestEvent *event)
     Atom type;
     lisp_data_to_selection_data (d, converted_selection,
                                 &data, &type, &size, &format);
-    
+
     x_reply_selection_request (event, format, data, size, type);
     successful_p = Qt;
     /* Tell x_selection_request_lisp_error() it's cool. */
     event->type = 0;
     xfree (data);
   }
-  
+
   unbind_to (count, Qnil);
 
  DONE_LABEL:
@@ -682,7 +680,7 @@ x_handle_selection_clear (XSelectionClearEvent *event)
   /* We don't own the selection, so that's fine. */
   if (NILP (local_selection_time_lisp))
     return;
-  
+
   local_selection_time = * (Time *) XOPAQUE_DATA (local_selection_time_lisp);
 
   /* This SelectionClear is for a selection that we no longer own, so we can
@@ -692,7 +690,7 @@ x_handle_selection_clear (XSelectionClearEvent *event)
   if (changed_owner_time != CurrentTime &&
       local_selection_time > changed_owner_time)
     return;
-  
+
   handle_selection_clear (selection_symbol);
 }
 
index e87a7a1..6c1076d 100644 (file)
@@ -41,8 +41,8 @@ Lisp_Object QPRIMARY, QSECONDARY, QSTRING, QINTEGER, QCLIPBOARD, QTIMESTAMP,
 
 /* Windows clipboard formats */
 Lisp_Object QCF_TEXT, QCF_BITMAP, QCF_METAFILEPICT, QCF_SYLK, QCF_DIF,
-  QCF_TIFF, QCF_OEMTEXT, QCF_DIB, QCF_PALETTE, QCF_PENDATA, QCF_RIFF,
-  QCF_WAVE, QCF_UNICODETEXT, QCF_ENHMETAFILE, QCF_HDROP, QCF_LOCALE,
+  QCF_TIFF, QCF_OEMTEXT, QCF_DIB, QCF_DIBV5, QCF_PALETTE, QCF_PENDATA,
+  QCF_RIFF, QCF_WAVE, QCF_UNICODETEXT, QCF_ENHMETAFILE, QCF_HDROP, QCF_LOCALE,
   QCF_OWNERDISPLAY, QCF_DSPTEXT, QCF_DSPBITMAP, QCF_DSPMETAFILEPICT,
   QCF_DSPENHMETAFILE;
 
@@ -53,7 +53,7 @@ Lisp_Object Qreplace_all, Qreplace_existing;
 Lisp_Object Qselection_conversion_error;
 
 /* A couple of Lisp functions */
-Lisp_Object Qselect_convert_in, Qselect_convert_out;
+Lisp_Object Qselect_convert_in, Qselect_convert_out, Qselect_coerce;
 
 /* These are alists whose CARs are selection-types (whose names are the same
    as the names of X Atoms or Windows clipboard formats) and whose CDRs are
@@ -63,6 +63,7 @@ Lisp_Object Qselect_convert_in, Qselect_convert_out;
  */
 Lisp_Object Vselection_converter_out_alist;
 Lisp_Object Vselection_converter_in_alist;
+Lisp_Object Vselection_coercion_alist;
 Lisp_Object Vselection_appender_alist;
 Lisp_Object Vselection_buffer_killed_alist;
 Lisp_Object Vselection_coercible_types;
@@ -167,7 +168,7 @@ anything that the functions on selection-converter-out-alist know about.
   if (NILP (data_type))
     data_type = QSTRING;
 #endif
-  
+
   /* Examine the how-to-add argument */
   if (EQ (how_to_add, Qreplace_all) || NILP (how_to_add))
     {
@@ -202,7 +203,7 @@ anything that the functions on selection-converter-out-alist know about.
       if (!NILP (value_list))
        prev_real_value = assq_no_quit (data_type, value_list);
     }
-  
+
   /* Append values if necessary */
   if (!NILP (value_list) && (EQ (how_to_add, Qappend) || EQ (how_to_add, Qt)))
     {
@@ -220,7 +221,7 @@ anything that the functions on selection-converter-out-alist know about.
                error ("cannot append selections of supplied types.");
 
              function = XCDR (function);
-             
+
              selection_value = call4 (function,
                                       selection_name,
                                       data_type,
@@ -237,25 +238,25 @@ anything that the functions on selection-converter-out-alist know about.
       selection_data = Fcons (data_type, selection_value);
       value_list = Fcons (selection_data, value_list);
     }
-    
+
   if (!NILP (prev_real_value))
     {
       Lisp_Object rest; /* We know it isn't the CAR, so it's easy. */
-      
+
       /* Delete the old type entry from the list */
       for (rest = value_list; !NILP (rest); rest = Fcdr (rest))
        if (EQ (prev_real_value, Fcar (XCDR (rest))))
          {
            XCDR (rest) = Fcdr (XCDR (rest));
            break;
-         }     
+         }
     }
   else
     {
       value_list = Fcons (Fcons (data_type, selection_value),
                          value_list);
     }
-  
+
   /* Complete the local cache update; note that we destructively
      modify the current list entry if there is one */
   if (NILP (prev_value))
@@ -268,10 +269,10 @@ anything that the functions on selection-converter-out-alist know about.
       selection_data = prev_value;
       Fsetcar (XCDR (selection_data), value_list);
     }
-  
+
   GCPRO1 (selection_data);
 
-  /* have to do device specific stuff last so that methods can access the 
+  /* have to do device specific stuff last so that methods can access the
      selection_alist */
   if (HAS_DEVMETH_P (XDEVICE (device), own_selection))
     selection_time = DEVMETH (XDEVICE (device), own_selection,
@@ -371,12 +372,12 @@ so it should be taken as a minimal estimate of what is available.
       else if (SYMBOLP (value) && NILP (type))
        types = Fcons (QATOM, types);
     }
-  
+
   UNGCPRO;
 
   return types;
 }
-       
+
 /* remove a selection from our local copy
  */
 void
@@ -433,7 +434,7 @@ If we own the named selection, then disown it (make there be no selection).
 
   MAYBE_DEVMETH (XDEVICE (device), disown_selection,
                 (selection_name, selection_time));
-  
+
   handle_selection_clear (selection_name);
 
   return Qt;
@@ -506,9 +507,9 @@ TEXT or COMPOUND_TEXT, it will be decoded as Compound Text.
        (selection_symbol, target_type, device))
 {
   /* This function can GC */
-  Lisp_Object val = Qnil, element = Qnil;
-  struct gcpro gcpro1, gcpro2, gcpro3;
-  GCPRO3 (target_type, val, element);
+  Lisp_Object val = Qnil;
+  struct gcpro gcpro1, gcpro2;
+  GCPRO2 (target_type, val);
   CHECK_SYMBOL (selection_symbol);
 
   if (NILP (device))
@@ -521,7 +522,7 @@ TEXT or COMPOUND_TEXT, it will be decoded as Compound Text.
   if (NILP (target_type))
     target_type = QSTRING;
 #endif
-  
+
 #if 0 /* #### MULTIPLE doesn't work yet and probably never will */
   if (CONSP (target_type) &&
       XCAR (target_type) == QMULTIPLE)
@@ -539,8 +540,15 @@ TEXT or COMPOUND_TEXT, it will be decoded as Compound Text.
 
   val = get_local_selection (selection_symbol, target_type);
 
-  if (NILP (val) && (HAS_DEVMETH_P (XDEVICE (device), get_foreign_selection)))
+  if (!NILP (val))
+    {
+      /* If we get something from the local cache, we may need to convert
+         it slightly - to do this, we call select-coerce */
+      val = call3 (Qselect_coerce, selection_symbol, target_type, val);
+    }
+  else if (HAS_DEVMETH_P (XDEVICE (device), get_foreign_selection))
     {
+      /* Nothing in the local cache; try the window system */
       val = DEVMETH (XDEVICE (device), get_foreign_selection,
                     (selection_symbol, target_type));
     }
@@ -548,7 +556,7 @@ TEXT or COMPOUND_TEXT, it will be decoded as Compound Text.
   if (NILP (val))
     {
       /* Still nothing. Try coercion. */
-      
+
       /* Try looking in selection-coercible-types to see if any of
         them are present for this selection. We try them *in order*;
         the first for which a conversion succeeds gets returned. */
@@ -559,32 +567,22 @@ TEXT or COMPOUND_TEXT, it will be decoded as Compound Text.
          if (NILP (val))
            continue;
 
-         /* #### Probably should have a Qselection_coercion_alist and a
-                 select-coerce function. */
-         val = call3 (Qselect_convert_out,
-                      selection_symbol, target_type, val);
+         val = call3 (Qselect_coerce, selection_symbol, target_type, val);
 
          if (!NILP (val))
            break;
        }
     }
 
-  if (NILP (val))
-    {
-      UNGCPRO;
-      
-      return Qnil;
-    }
-  
   /* Used to call clean_local_selection here... but that really belonged
      in Lisp (so the equivalent is now built-in to the INTEGER conversion
      function select-convert-from-integer) - ajh */
-  
+
   UNGCPRO;
   return val;
 }
 
-/* These two are convenient interfaces to the lisp code in select.el;
+/* These are convenient interfaces to the lisp code in select.el;
    this way we can rename them easily rather than having to hunt everywhere.
    Also, this gives us access to get_local_selection so that convert_out
    can retrieve the internal selection value automatically if passed a
@@ -598,6 +596,14 @@ select_convert_in (Lisp_Object selection,
 }
 
 Lisp_Object
+select_coerce (Lisp_Object selection,
+              Lisp_Object type,
+              Lisp_Object value)
+{
+  return call3 (Qselect_coerce, selection, type, value);
+}
+
+Lisp_Object
 select_convert_out (Lisp_Object selection,
                    Lisp_Object type,
                    Lisp_Object value)
@@ -607,40 +613,30 @@ select_convert_out (Lisp_Object selection,
 
   if (NILP (value))
     {
-      Lisp_Object element = Qnil, ret;
-      struct gcpro gcpro1;
-      GCPRO1 (element);
-
-      {
-       /* Try looking in selection-coercible-types to see if any of
+      /* Try looking in selection-coercible-types to see if any of
         them are present for this selection. We try them *in order*;
         the first for which a conversion succeeds gets returned. */
-       EXTERNAL_LIST_LOOP_2 (element, Vselection_coercible_types)
-         {
-           value = get_local_selection (selection, element);
-
-           if (NILP (value))
-             continue;
-         
-           ret = call3 (Qselect_convert_out, selection, type, value);
-
-           if (!NILP (ret))
-             {
-               UNGCPRO;
-             
-               return ret;
-             }
-         }
-      }
-      
-      UNGCPRO;
-      
+      EXTERNAL_LIST_LOOP_2 (element, Vselection_coercible_types)
+       {
+         Lisp_Object ret;
+
+         value = get_local_selection (selection, element);
+
+         if (NILP (value))
+           continue;
+
+         ret = call3 (Qselect_convert_out, selection, type, value);
+
+         if (!NILP (ret))
+           return ret;
+       }
+
       return Qnil;
     }
 
   return call3 (Qselect_convert_out, selection, type, value);
 }
-                    
+
 \f
 /* Gets called from kill-buffer; this lets us dispose of buffer-dependent
    selections (or alternatively make them independent of the buffer) when
@@ -650,7 +646,7 @@ select_notify_buffer_kill (Lisp_Object buffer)
 {
   Lisp_Object rest;
   struct gcpro gcpro1, gcpro2, gcpro3;
-  
+
   /* For each element of Vselection_alist */
   for (rest = Vselection_alist;
        !NILP (rest);)
@@ -658,7 +654,7 @@ select_notify_buffer_kill (Lisp_Object buffer)
       Lisp_Object selection, values, prev = Qnil;
 
       selection = XCAR (rest);
-      
+
       for (values = XCAR (XCDR (selection));
           !NILP (values);
           values = XCDR (values))
@@ -680,18 +676,18 @@ select_notify_buffer_kill (Lisp_Object buffer)
                 own-selection from with the buffer-killed handler, then
                 causes a GC. Just as a note, *don't do this*. */
              GCPRO3 (rest, values, value);
-             
+
              newval = call4 (handler_fn, XCAR (selection), XCAR (value),
                              XCDR (value), buffer);
 
              UNGCPRO;
-             
+
              /* Set or delete the value (by destructively modifying
                 the list). */
              if (!NILP (newval))
                {
                  Fsetcdr (value, newval);
-                 
+
                  prev = values;
                }
              else
@@ -730,17 +726,18 @@ syms_of_select (void)
 {
   DEFSUBR (Fown_selection_internal);
   DEFSUBR (Fget_selection_internal);
-  DEFSUBR (Fselection_exists_p);
   DEFSUBR (Fget_selection_timestamp);
+  DEFSUBR (Fselection_exists_p);
   DEFSUBR (Fdisown_selection_internal);
   DEFSUBR (Fselection_owner_p);
   DEFSUBR (Favailable_selection_types);
   DEFSUBR (Fregister_selection_data_type);
   DEFSUBR (Fselection_data_type_name);
-  
+
   /* Lisp Functions */
   defsymbol (&Qselect_convert_in, "select-convert-in");
   defsymbol (&Qselect_convert_out, "select-convert-out");
+  defsymbol (&Qselect_coerce, "select-coerce");
 
   /* X Atoms */
   defsymbol (&QPRIMARY, "PRIMARY");
@@ -769,6 +766,7 @@ syms_of_select (void)
   defsymbol (&QCF_TIFF, "CF_TIFF");
   defsymbol (&QCF_OEMTEXT, "CF_OEMTEXT");
   defsymbol (&QCF_DIB, "CF_DIB");
+  defsymbol (&QCF_DIBV5, "CF_DIBV5");
   defsymbol (&QCF_PALETTE, "CF_PALETTE");
   defsymbol (&QCF_PENDATA, "CF_PENDATA");
   defsymbol (&QCF_RIFF, "CF_RIFF");
@@ -786,10 +784,8 @@ syms_of_select (void)
   /* Selection strategies */
   defsymbol (&Qreplace_all, "replace-all");
   defsymbol (&Qreplace_existing, "replace-existing");
-  
-  deferror (&Qselection_conversion_error,
-           "selection-conversion-error",
-           "selection-conversion error", Qio_error);
+
+  DEFERROR_STANDARD (Qselection_conversion_error, Qio_error);
 }
 
 void
@@ -802,7 +798,7 @@ vars_of_select (void)
 An alist associating selection-types (such as STRING and TIMESTAMP) with
 functions.  This is an alias for `selection-converter-out-alist', and should
 be considered obsolete.  Use the new name instead. */ );
-                                                                             
+
   DEFVAR_LISP ("selection-converter-out-alist",
               &Vselection_converter_out_alist /*
 An alist associating selection-types (such as STRING and TIMESTAMP) with
@@ -867,6 +863,21 @@ value, or nil to indicate that the conversion was not possible.
 See also `selection-converter-out-alist'. */ );
   Vselection_converter_in_alist = Qnil;
 
+  DEFVAR_LISP ("selection-coercion-alist",
+              &Vselection_coercion_alist /*
+An alist associating selection-types (such as STRING and TIMESTAMP) with
+functions.  These functions will be called with three args; the name
+of the selection (typically PRIMARY, SECONDARY or CLIPBOARD); the type
+from which the selection should be converted, and the selection value.
+The value passed will be *exactly the same value* that was given to
+`own-selection'; it should be converted into something suitable for
+return to a program calling `get-selection' with the appropriate
+parameters.
+
+See also `selection-converter-in-alist' and
+`selection-converter-out-alist'. */);
+  Vselection_coercion_alist = Qnil;
+
   DEFVAR_LISP ("selection-appender-alist",
               &Vselection_appender_alist /*
 An alist associating selection-types (such as STRING and TIMESTAMP) with
@@ -876,7 +887,7 @@ of the selection; and two selection values.  The functions are expected to
 return a value representing the catenation of the two values, or nil to
 indicate that this was not possible. */ );
   Vselection_appender_alist = Qnil;
-  
+
   DEFVAR_LISP ("selection-buffer-killed-alist",
               &Vselection_buffer_killed_alist /*
 An alist associating selection-types (such as STRING and TIMESTAMP) with
@@ -894,7 +905,7 @@ A list of selection types that are coercible---that is, types that may be
 automatically converted to another type. Selection values with types in this
 list may be subject to conversion attempts to other types. */ );
   Vselection_coercible_types = Qnil;
-  
+
   DEFVAR_LISP ("lost-selection-hooks", &Vlost_selection_hooks /*
 A function or functions to be called after we have been notified
 that we have lost the selection.  The function(s) will be called with one
index 854d47d..4e6d00d 100644 (file)
@@ -30,8 +30,8 @@ extern Lisp_Object QPRIMARY, QSECONDARY, QSTRING, QINTEGER, QCLIPBOARD,
 
 /* Windows clipboard formats */
 extern Lisp_Object QCF_TEXT, QCF_BITMAP, QCF_METAFILEPICT, QCF_SYLK, QCF_DIF,
-  QCF_TIFF, QCF_OEMTEXT, QCF_DIB, QCF_PALETTE, QCF_PENDATA, QCF_RIFF,
-  QCF_WAVE, QCF_UNICODETEXT, QCF_ENHMETAFILE, QCF_HDROP, QCF_LOCALE,
+  QCF_TIFF, QCF_OEMTEXT, QCF_DIB, QCF_DIBV5, QCF_PALETTE, QCF_PENDATA,
+  QCF_RIFF, QCF_WAVE, QCF_UNICODETEXT, QCF_ENHMETAFILE, QCF_HDROP, QCF_LOCALE,
   QCF_OWNERDISPLAY, QCF_DSPTEXT, QCF_DSPBITMAP, QCF_DSPMETAFILEPICT,
   QCF_DSPENHMETAFILE;
 
@@ -48,6 +48,9 @@ Lisp_Object select_convert_in (Lisp_Object selection,
 Lisp_Object select_convert_out (Lisp_Object selection,
                                Lisp_Object type,
                                Lisp_Object value);
+Lisp_Object select_coerce (Lisp_Object selection,
+                          Lisp_Object type,
+                          Lisp_Object value);
 
 /* Notifications */
 void handle_selection_clear (Lisp_Object selection_symbol);
index 550254e..1f1acc9 100644 (file)
@@ -120,9 +120,7 @@ Windows the sound file must be in WAV format.
     {
       char *fileext;
 
-      TO_EXTERNAL_FORMAT (LISP_STRING, file,
-                         C_STRING_ALLOCA, fileext,
-                         Qfile_name);
+      LISP_STRING_TO_EXTERNAL (file, fileext, Qfile_name);
       /* #### NAS code should allow specification of a device. */
       if (nas_play_sound_file (fileext, vol))
        return Qnil;
@@ -135,9 +133,7 @@ Windows the sound file must be in WAV format.
       char *fileext;
       int result;
 
-      TO_EXTERNAL_FORMAT (LISP_STRING, file,
-                         C_STRING_ALLOCA, fileext,
-                         Qfile_name);
+      LISP_STRING_TO_EXTERNAL (file, fileext, Qfile_name);
 
       /* #### ESD uses alarm(). But why should we also stop SIGIO? */
       stop_interrupts ();
@@ -153,9 +149,7 @@ Windows the sound file must be in WAV format.
     {
       const char *fileext;
 
-      TO_EXTERNAL_FORMAT (LISP_STRING, file,
-                         C_STRING_ALLOCA, fileext,
-                         Qfile_name);
+      LISP_STRING_TO_EXTERNAL (file, fileext, Qfile_name);
       /* The sound code doesn't like getting SIGIO interrupts.
         Unix sucks! */
       stop_interrupts ();
@@ -652,7 +646,7 @@ of sounds.  Otherwise, sounds are always played synchronously.
   DEFVAR_LISP ("native-sound-only-on-console", &Vnative_sound_only_on_console /*
 Non-nil value means play sounds only if XEmacs is running
 on the system console.
-Nil means always always play sounds, even if running on a non-console tty
+Nil means always play sounds, even if running on a non-console tty
 or a secondary X display.
 
 This variable only applies to native sound support.
index bc0efc1..7fa2e3a 100644 (file)
@@ -41,15 +41,15 @@ Boston, MA 02111-1307, USA.  */
 #include "rangetab.h"
 
 Lisp_Object Qspecifierp;
-Lisp_Object Qprepend, Qremove_tag_set_prepend, Qremove_tag_set_append;
-Lisp_Object Qremove_locale, Qremove_locale_type, Qremove_all;
-Lisp_Object Qfallback;
-
-/* Qinteger, Qboolean, Qgeneric defined in general.c. */
-Lisp_Object Qnatnum;
+Lisp_Object Qremove_tag_set_prepend, Qremove_tag_set_append;
+Lisp_Object Qremove_locale, Qremove_locale_type;
 
 Lisp_Object Qconsole_type, Qdevice_class;
 
+Lisp_Object Qspecifier_syntax_error;
+Lisp_Object Qspecifier_argument_error;
+Lisp_Object Qspecifier_change_error;
+
 static Lisp_Object Vuser_defined_tags;
 
 typedef struct specifier_type_entry specifier_type_entry;
@@ -68,7 +68,8 @@ static specifier_type_entry_dynarr *the_specifier_type_entry_dynarr;
 
 static const struct lrecord_description ste_description_1[] = {
   { XD_LISP_OBJECT, offsetof (specifier_type_entry, symbol) },
-  { XD_STRUCT_PTR,  offsetof (specifier_type_entry, meths), 1, &specifier_methods_description },
+  { XD_STRUCT_PTR,  offsetof (specifier_type_entry, meths), 1,
+    &specifier_methods_description },
   { XD_END }
 };
 
@@ -385,14 +386,16 @@ static const struct struct_description specifier_caching_description = {
 };
 
 static const struct lrecord_description specifier_description[] = {
-  { XD_STRUCT_PTR,  offsetof (Lisp_Specifier, methods), 1, &specifier_methods_description },
+  { XD_STRUCT_PTR,  offsetof (Lisp_Specifier, methods), 1,
+    &specifier_methods_description },
   { XD_LO_LINK,     offsetof (Lisp_Specifier, next_specifier) },
   { XD_LISP_OBJECT, offsetof (Lisp_Specifier, global_specs) },
   { XD_LISP_OBJECT, offsetof (Lisp_Specifier, device_specs) },
   { XD_LISP_OBJECT, offsetof (Lisp_Specifier, frame_specs) },
   { XD_LISP_OBJECT, offsetof (Lisp_Specifier, window_specs) },
   { XD_LISP_OBJECT, offsetof (Lisp_Specifier, buffer_specs) },
-  { XD_STRUCT_PTR,  offsetof (Lisp_Specifier, caching), 1, &specifier_caching_description },
+  { XD_STRUCT_PTR,  offsetof (Lisp_Specifier, caching), 1,
+    &specifier_caching_description },
   { XD_LISP_OBJECT, offsetof (Lisp_Specifier, magic_parent) },
   { XD_LISP_OBJECT, offsetof (Lisp_Specifier, fallback) },
   { XD_SPECIFIER_END }
@@ -425,8 +428,8 @@ decode_specifier_type (Lisp_Object type, Error_behavior errb)
        return Dynarr_at (the_specifier_type_entry_dynarr, i).meths;
     }
 
-  maybe_signal_simple_error ("Invalid specifier type", type,
-                            Qspecifier, errb);
+  maybe_signal_type_error (Qspecifier_argument_error, "Invalid specifier type",
+                          type, Qspecifier, errb);
 
   return 0;
 }
@@ -646,7 +649,8 @@ instantiated in.
     ? Qt : Qnil;
 }
 
-DEFUN ("valid-specifier-locale-type-p", Fvalid_specifier_locale_type_p, 1, 1, 0, /*
+DEFUN ("valid-specifier-locale-type-p", Fvalid_specifier_locale_type_p, 1, 1, 0,
+       /*
 Given a specifier LOCALE-TYPE, return non-nil if it is valid.
 Valid locale types are 'global, 'device, 'frame, 'window, and 'buffer.
 \(Note, however, that in functions that accept either a locale or a locale
@@ -670,7 +674,8 @@ check_valid_locale_or_locale_type (Lisp_Object locale)
       !NILP (Fvalid_specifier_locale_p (locale)) ||
       !NILP (Fvalid_specifier_locale_type_p (locale)))
     return;
-  signal_simple_error ("Invalid specifier locale or locale type", locale);
+  signal_type_error (Qspecifier_argument_error,
+                    "Invalid specifier locale or locale type", locale);
 }
 
 DEFUN ("specifier-locale-type-from-locale", Fspecifier_locale_type_from_locale,
@@ -681,7 +686,8 @@ Given a specifier LOCALE, return its type.
 {
   /* This cannot GC. */
   if (NILP (Fvalid_specifier_locale_p (locale)))
-    signal_simple_error ("Invalid specifier locale", locale);
+    signal_type_error (Qspecifier_argument_error, "Invalid specifier locale",
+                      locale);
   if (DEVICEP (locale)) return Qdevice;
   if (FRAMEP  (locale)) return Qframe;
   if (WINDOWP (locale)) return Qwindow;
@@ -699,7 +705,8 @@ decode_locale (Lisp_Object locale)
   else if (!NILP (Fvalid_specifier_locale_p (locale)))
     return locale;
   else
-    signal_simple_error ("Invalid specifier locale", locale);
+    signal_type_error (Qspecifier_argument_error, "Invalid specifier locale",
+                      locale);
 
   return Qnil;
 }
@@ -714,7 +721,8 @@ decode_locale_type (Lisp_Object locale_type)
   if (EQ (locale_type, Qwindow)) return LOCALE_WINDOW;
   if (EQ (locale_type, Qbuffer)) return LOCALE_BUFFER;
 
-  signal_simple_error ("Invalid specifier locale type", locale_type);
+  signal_type_error (Qspecifier_argument_error, "Invalid specifier locale type",
+                    locale_type);
   return LOCALE_GLOBAL; /* not reached */
 }
 
@@ -729,7 +737,6 @@ decode_locale_list (Lisp_Object locale)
     }
   else if (CONSP (locale))
     {
-      Lisp_Object elt;
       EXTERNAL_LIST_LOOP_2 (elt, locale)
        check_valid_locale_or_locale_type (elt);
       return locale;
@@ -751,7 +758,8 @@ static void
 check_valid_domain (Lisp_Object domain)
 {
   if (NILP (Fvalid_specifier_domain_p (domain)))
-    signal_simple_error ("Invalid specifier domain", domain);
+    signal_type_error (Qspecifier_argument_error, "Invalid specifier domain",
+                      domain);
 }
 
 Lisp_Object
@@ -827,7 +835,8 @@ decode_specifier_tag_set (Lisp_Object tag_set)
   if (!NILP (Fvalid_specifier_tag_p (tag_set)))
     return list1 (tag_set);
   if (NILP (Fvalid_specifier_tag_set_p (tag_set)))
-    signal_simple_error ("Invalid specifier tag-set", tag_set);
+    signal_type_error (Qspecifier_argument_error, "Invalid specifier tag-set",
+                      tag_set);
   return tag_set;
 }
 
@@ -890,7 +899,7 @@ sorting by symbol name and removing duplicates.)
        (tag_set))
 {
   if (NILP (Fvalid_specifier_tag_set_p (tag_set)))
-    signal_simple_error ("Invalid tag set", tag_set);
+    signal_type_error (Qspecifier_argument_error, "Invalid tag set", tag_set);
   return canonicalize_tag_set (tag_set);
 }
 
@@ -920,7 +929,8 @@ device_matches_specifier_tag_set_p (Lisp_Object device, Lisp_Object tag_set)
   return 1;
 }
 
-DEFUN ("device-matches-specifier-tag-set-p", Fdevice_matches_specifier_tag_set_p, 2, 2, 0, /*
+DEFUN ("device-matches-specifier-tag-set-p",
+       Fdevice_matches_specifier_tag_set_p, 2, 2, 0, /*
 Return non-nil if DEVICE matches specifier tag set TAG-SET.
 This means that DEVICE matches each tag in the tag set. (Every
 tag recognized by XEmacs has a predicate associated with it that
@@ -931,7 +941,7 @@ specifies which devices match it.)
   CHECK_LIVE_DEVICE (device);
 
   if (NILP (Fvalid_specifier_tag_set_p (tag_set)))
-    signal_simple_error ("Invalid tag set", tag_set);
+    signal_type_error (Qspecifier_argument_error, "Invalid tag set", tag_set);
 
   return device_matches_specifier_tag_set_p (device, tag_set) ? Qt : Qnil;
 }
@@ -954,12 +964,13 @@ and classes) or the symbols nil, t, 'all, or 'global.
   CHECK_SYMBOL (tag);
   if (valid_device_class_p (tag) ||
       valid_console_type_p (tag))
-    signal_simple_error ("Cannot redefine built-in specifier tags", tag);
+    signal_type_error (Qspecifier_change_error,
+                      "Cannot redefine built-in specifier tags", tag);
   /* Try to prevent common instantiators and locales from being
      redefined, to reduce ambiguity */
   if (NILP (tag) || EQ (tag, Qt) || EQ (tag, Qall) || EQ (tag, Qglobal))
-    signal_simple_error ("Cannot define nil, t, 'all, or 'global",
-                        tag);
+    signal_type_error (Qspecifier_change_error, "Cannot define nil, t, 'all, or 'global",
+                      tag);
   assoc = assq_no_quit (tag, Vuser_defined_tags);
   if (NILP (assoc))
     {
@@ -1032,7 +1043,8 @@ setup_device_initial_specifier_tags (struct device *d)
     }
 }
 
-DEFUN ("device-matching-specifier-tag-list", Fdevice_matching_specifier_tag_list,
+DEFUN ("device-matching-specifier-tag-list",
+       Fdevice_matching_specifier_tag_list,
        0, 1, 0, /*
 Return a list of all specifier tags matching DEVICE.
 DEVICE defaults to the selected device if omitted.
@@ -1088,7 +1100,8 @@ Return the predicate for the given specifier tag.
   CHECK_SYMBOL (tag);
 
   if (NILP (Fvalid_specifier_tag_p (tag)))
-    signal_simple_error ("Invalid specifier tag", tag);
+    signal_type_error (Qspecifier_argument_error, "Invalid specifier tag",
+                      tag);
 
   /* Make up some predicates for the built-in types */
 
@@ -1215,19 +1228,22 @@ check_valid_inst_list (Lisp_Object inst_list, struct specifier_methods *meths,
 
       if (!CONSP (rest))
        {
-         maybe_signal_simple_error ("Invalid instantiator list", inst_list,
+         maybe_signal_type_error (Qspecifier_syntax_error,
+                                  "Invalid instantiator list", inst_list,
                                     Qspecifier, errb);
          return Qnil;
        }
       if (!CONSP (inst_pair = XCAR (rest)))
        {
-         maybe_signal_simple_error ("Invalid instantiator pair", inst_pair,
+         maybe_signal_type_error (Qspecifier_syntax_error,
+                                  "Invalid instantiator pair", inst_pair,
                                     Qspecifier, errb);
          return Qnil;
        }
       if (NILP (Fvalid_specifier_tag_set_p (tag_set = XCAR (inst_pair))))
        {
-         maybe_signal_simple_error ("Invalid specifier tag", tag_set,
+         maybe_signal_type_error (Qspecifier_syntax_error,
+                                  "Invalid specifier tag", tag_set,
                                     Qspecifier, errb);
          return Qnil;
        }
@@ -1270,13 +1286,15 @@ check_valid_spec_list (Lisp_Object spec_list, struct specifier_methods *meths,
       Lisp_Object spec, locale;
       if (!CONSP (rest) || !CONSP (spec = XCAR (rest)))
        {
-         maybe_signal_simple_error ("Invalid specification list", spec_list,
+         maybe_signal_type_error (Qspecifier_syntax_error,
+                                  "Invalid specification list", spec_list,
                                     Qspecifier, errb);
          return Qnil;
        }
       if (NILP (Fvalid_specifier_locale_p (locale = XCAR (spec))))
        {
-         maybe_signal_simple_error ("Invalid specifier locale", locale,
+         maybe_signal_type_error (Qspecifier_syntax_error,
+                                  "Invalid specifier locale", locale,
                                     Qspecifier, errb);
          return Qnil;
        }
@@ -1326,7 +1344,8 @@ decode_how_to_add_specification (Lisp_Object how_to_add)
   if (EQ (Qremove_all, how_to_add))
     return SPEC_REMOVE_ALL;
 
-  signal_simple_error ("Invalid `how-to-add' flag", how_to_add);
+  signal_type_error (Qspecifier_argument_error, "Invalid `how-to-add' flag",
+                    how_to_add);
 
   return SPEC_PREPEND;         /* not reached */
 }
@@ -1350,7 +1369,8 @@ check_modifiable_specifier (Lisp_Object spec)
 {
   if (NILP (Vunlock_ghost_specifiers)
       && GHOST_SPECIFIER_P (XSPECIFIER (spec)))
-    signal_simple_error ("Attempt to modify read-only specifier",
+    signal_type_error (Qspecifier_change_error,
+                      "Attempt to modify read-only specifier",
                         list1 (spec));
 }
 
@@ -1762,7 +1782,10 @@ specifier_add_spec (Lisp_Object specifier, Lisp_Object locale,
   else if (add_meth == SPEC_APPEND)
     tem = nconc2 (*orig_inst_list, list_to_build_up);
   else
-    abort ();
+    {
+      abort ();
+      tem = Qnil;
+    }
 
   *orig_inst_list = tem;
 
@@ -2370,7 +2393,8 @@ check_valid_specifier_matchspec (Lisp_Object matchspec,
     }
 }
 
-DEFUN ("check-valid-specifier-matchspec", Fcheck_valid_specifier_matchspec, 2, 2, 0, /*
+DEFUN ("check-valid-specifier-matchspec", Fcheck_valid_specifier_matchspec, 2,
+       2, 0, /*
 Signal an error if MATCHSPEC is invalid for SPECIFIER-TYPE.
 See `specifier-matching-instance' for a description of matchspecs.
 */
@@ -2758,7 +2782,8 @@ you should not use this function; use `specifier-instance' instead.
   return UNBOUNDP (val) ? default_ : val;
 }
 
-DEFUN ("specifier-matching-instance-from-inst-list", Fspecifier_matching_instance_from_inst_list,
+DEFUN ("specifier-matching-instance-from-inst-list",
+       Fspecifier_matching_instance_from_inst_list,
        4, 5, 0, /*
 Attempt to convert a particular inst-list into an instance.
 This attempts to instantiate INST-LIST in the given DOMAIN
@@ -3092,7 +3117,8 @@ static void
 boolean_validate (Lisp_Object instantiator)
 {
   if (!EQ (instantiator, Qt) && !EQ (instantiator, Qnil))
-    signal_simple_error ("Must be t or nil", instantiator);
+    signal_type_error (Qspecifier_argument_error, "Must be t or nil",
+                      instantiator);
 }
 
 DEFUN ("boolean-specifier-p", Fboolean_specifier_p, 1, 1, 0, /*
@@ -3140,7 +3166,8 @@ display_table_validate (Lisp_Object instantiator)
       if (!VALID_SINGLE_DISPTABLE_INSTANTIATOR_P (instantiator))
        {
        lose:
-         dead_wrong_type_argument (display_table_specifier_methods->predicate_symbol,
+         dead_wrong_type_argument
+           (display_table_specifier_methods->predicate_symbol,
                                    instantiator);
        }
     }
@@ -3167,13 +3194,12 @@ syms_of_specifier (void)
 {
   INIT_LRECORD_IMPLEMENTATION (specifier);
 
-  defsymbol (&Qspecifierp, "specifierp");
+  DEFSYMBOL (Qspecifierp);
 
-  defsymbol (&Qconsole_type, "console-type");
-  defsymbol (&Qdevice_class, "device-class");
+  DEFSYMBOL (Qconsole_type);
+  DEFSYMBOL (Qdevice_class);
 
-  /* Qinteger, Qboolean, Qgeneric defined in general.c */
-  defsymbol (&Qnatnum, "natnum");
+  /* specifier types defined in general.c. */
 
   DEFSUBR (Fvalid_specifier_type_p);
   DEFSUBR (Fspecifier_type_list);
@@ -3228,14 +3254,15 @@ syms_of_specifier (void)
 
   /* locales are defined in general.c. */
 
-  defsymbol (&Qprepend, "prepend");
-  defsymbol (&Qremove_tag_set_prepend, "remove-tag-set-prepend");
-  defsymbol (&Qremove_tag_set_append, "remove-tag-set-append");
-  defsymbol (&Qremove_locale, "remove-locale");
-  defsymbol (&Qremove_locale_type, "remove-locale-type");
-  defsymbol (&Qremove_all, "remove-all");
+  /* some how-to-add flags in general.c. */
+  DEFSYMBOL (Qremove_tag_set_prepend);
+  DEFSYMBOL (Qremove_tag_set_append);
+  DEFSYMBOL (Qremove_locale);
+  DEFSYMBOL (Qremove_locale_type);
 
-  defsymbol (&Qfallback, "fallback");
+  DEFERROR_STANDARD (Qspecifier_syntax_error, Qsyntax_error);
+  DEFERROR_STANDARD (Qspecifier_argument_error, Qinvalid_argument);
+  DEFERROR_STANDARD (Qspecifier_change_error, Qinvalid_change);
 }
 
 void
@@ -3261,7 +3288,8 @@ specifier_type_create (void)
 
   SPECIFIER_HAS_METHOD (boolean, validate);
 
-  INITIALIZE_SPECIFIER_TYPE (display_table, "display-table", "display-table-p");
+  INITIALIZE_SPECIFIER_TYPE (display_table, "display-table",
+                            "display-table-p");
 
   SPECIFIER_HAS_METHOD (display_table, validate);
 }
index 5758637..c925a57 100644 (file)
@@ -152,7 +152,7 @@ struct specifier_methods
      name specifier_instance) to avoid creating "external"
      specification loops.
 
-     This method must presume that both INSTANTIATOR and MATCSPEC are
+     This method must presume that both INSTANTIATOR and MATCHSPEC are
      already validated by the corresponding validate_* methods, and
      may abort if they are invalid.
 
index 2667fce..32e56dd 100644 (file)
@@ -1,6 +1,6 @@
 /* "intern" and friends -- moved here from lread.c and data.c
    Copyright (C) 1985-1989, 1992-1994 Free Software Foundation, Inc.
-   Copyright (C) 1995 Ben Wing.
+   Copyright (C) 1995, 2000 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -449,11 +449,15 @@ OBARRAY defaults to the value of `obarray'.
 */
        (function, obarray))
 {
+  struct gcpro gcpro1;
+
   if (NILP (obarray))
     obarray = Vobarray;
   obarray = check_obarray (obarray);
 
+  GCPRO1 (obarray);
   map_obarray (obarray, mapatoms_1, &function);
+  UNGCPRO;
   return Qnil;
 }
 
@@ -495,14 +499,17 @@ Return list of symbols found.
        (regexp, predicate))
 {
   struct appropos_mapper_closure closure;
+  struct gcpro gcpro1;
 
   CHECK_STRING (regexp);
 
   closure.regexp = regexp;
   closure.predicate = predicate;
   closure.accumulation = Qnil;
+  GCPRO1 (closure.accumulation);
   map_obarray (Vobarray, apropos_mapper, &closure);
   closure.accumulation = Fsort (closure.accumulation, Qstring_lessp);
+  UNGCPRO;
   return closure.accumulation;
 }
 
@@ -1137,8 +1144,6 @@ set_default_buffer_slot_variable (Lisp_Object sym,
 
   if (mask > 0)                /* Not always per-buffer */
     {
-      Lisp_Object elt;
-
       /* Set value in each buffer which hasn't shadowed the default */
       LIST_LOOP_2 (elt, Vbuffer_alist)
        {
@@ -1179,8 +1184,6 @@ set_default_console_slot_variable (Lisp_Object sym,
 
   if (mask > 0)                /* Not always per-console */
     {
-      Lisp_Object console;
-
       /* Set value in each console which hasn't shadowed the default */
       LIST_LOOP_2 (console, Vconsole_list)
        {
@@ -3206,10 +3209,63 @@ reinit_symbols_once_early (void)
 #ifndef Qnull_pointer
   /* C guarantees that Qnull_pointer will be initialized to all 0 bits,
      so the following is actually a no-op.  */
-  XSETOBJ (Qnull_pointer, (enum Lisp_Type) 0, 0);
+  XSETOBJ (Qnull_pointer, 0);
 #endif
 }
 
+static void
+defsymbol_massage_name_1 (Lisp_Object *location, const char *name, int dump_p,
+                         int multiword_predicate_p)
+{
+  char temp[500];
+  int len = strlen (name) - 1;
+  int i;
+
+  if (multiword_predicate_p)
+    assert (len + 1 < sizeof (temp));
+  else
+    assert (len < sizeof (temp));
+  strcpy (temp, name + 1); /* Remove initial Q */
+  if (multiword_predicate_p)
+    {
+      strcpy (temp + len - 1, "_p");
+      len++;
+    }
+  for (i = 0; i < len; i++)
+    if (temp[i] == '_')
+      temp[i] = '-';
+  *location = Fintern (make_string ((const Bufbyte *) temp, len), Qnil);
+  if (dump_p)
+    staticpro (location);
+  else
+    staticpro_nodump (location);
+}
+
+void
+defsymbol_massage_name_nodump (Lisp_Object *location, const char *name)
+{
+  defsymbol_massage_name_1 (location, name, 0, 0);
+}
+
+void
+defsymbol_massage_name (Lisp_Object *location, const char *name)
+{
+  defsymbol_massage_name_1 (location, name, 1, 0);
+}
+
+void
+defsymbol_massage_multiword_predicate_nodump (Lisp_Object *location,
+                                             const char *name)
+{
+  defsymbol_massage_name_1 (location, name, 0, 1);
+}
+
+void
+defsymbol_massage_multiword_predicate (Lisp_Object *location, const char *name)
+{
+  defsymbol_massage_name_1 (location, name, 1, 1);
+}
+
 void
 defsymbol_nodump (Lisp_Object *location, const char *name)
 {
@@ -3235,6 +3291,20 @@ defkeyword (Lisp_Object *location, const char *name)
   Fset (*location, *location);
 }
 
+void
+defkeyword_massage_name (Lisp_Object *location, const char *name)
+{
+  char temp[500];
+  int len = strlen (name);
+
+  assert (len < sizeof (temp));
+  strcpy (temp, name);
+  temp[1] = ':'; /* it's an underscore in the C variable */
+
+  defsymbol_massage_name (location, temp);
+  Fset (*location, *location);
+}
+
 #ifdef DEBUG_XEMACS
 /* Check that nobody spazzed writing a DEFUN. */
 static void
@@ -3270,16 +3340,16 @@ check_sane_subr (Lisp_Subr *subr, Lisp_Object sym)
  * Once we have copied everything across, we re-use the original static
  * structure to store a pointer to the newly allocated one. This will be
  * used in emodules.c by emodules_doc_subr() to find a pointer to the
- * allocated object so that we can set its doc string propperly.
+ * allocated object so that we can set its doc string properly.
  *
- * NOTE: We dont actually use the DOC pointer here any more, but we did
+ * NOTE: We don't actually use the DOC pointer here any more, but we did
  * in an earlier implementation of module support. There is no harm in
  * setting it here in case we ever need it in future implementations.
  * subr->doc will point to the new subr structure that was allocated.
- * Code can then get this value from the statis subr structure and use
+ * Code can then get this value from the static subr structure and use
  * it if required.
  *
- * FIXME: Should newsubr be staticpro()'ed? I dont think so but I need
+ * FIXME: Should newsubr be staticpro()'ed? I don't think so but I need
  * a guru to check.
  */
 #define check_module_subr()                                            \
@@ -3322,12 +3392,15 @@ defsubr_macro (Lisp_Subr *subr)
   XSYMBOL (sym)->function = Fcons (Qmacro, fun);
 }
 
-void
-deferror (Lisp_Object *symbol, const char *name, const char *messuhhj,
-         Lisp_Object inherits_from)
+static void
+deferror_1 (Lisp_Object *symbol, const char *name, const char *messuhhj,
+           Lisp_Object inherits_from, int massage_p)
 {
   Lisp_Object conds;
-  defsymbol (symbol, name);
+  if (massage_p)
+    defsymbol_massage_name (symbol, name);
+  else
+    defsymbol (symbol, name);
 
   assert (SYMBOLP (inherits_from));
   conds = Fget (inherits_from, Qerror_conditions, Qnil);
@@ -3339,47 +3412,79 @@ deferror (Lisp_Object *symbol, const char *name, const char *messuhhj,
 }
 
 void
+deferror (Lisp_Object *symbol, const char *name, const char *messuhhj,
+         Lisp_Object inherits_from)
+{
+  deferror_1 (symbol, name, messuhhj, inherits_from, 0);
+}
+
+void
+deferror_massage_name (Lisp_Object *symbol, const char *name,
+                      const char *messuhhj, Lisp_Object inherits_from)
+{
+  deferror_1 (symbol, name, messuhhj, inherits_from, 1);
+}
+
+void
+deferror_massage_name_and_message (Lisp_Object *symbol, const char *name,
+                                  Lisp_Object inherits_from)
+{
+  char temp[500];
+  int i;
+  int len = strlen (name) - 1;
+
+  assert (len < sizeof (temp));
+  strcpy (temp, name + 1); /* Remove initial Q */
+  temp[0] = toupper (temp[0]);
+  for (i = 0; i < len; i++)
+    if (temp[i] == '_')
+      temp[i] = ' ';
+
+  deferror_1 (symbol, name, temp, inherits_from, 1);
+}
+
+void
 syms_of_symbols (void)
 {
-  defsymbol (&Qvariable_documentation, "variable-documentation");
-  defsymbol (&Qvariable_domain, "variable-domain");    /* I18N3 */
-  defsymbol (&Qad_advice_info, "ad-advice-info");
-  defsymbol (&Qad_activate, "ad-activate");
-
-  defsymbol (&Qget_value, "get-value");
-  defsymbol (&Qset_value, "set-value");
-  defsymbol (&Qbound_predicate, "bound-predicate");
-  defsymbol (&Qmake_unbound, "make-unbound");
-  defsymbol (&Qlocal_predicate, "local-predicate");
-  defsymbol (&Qmake_local, "make-local");
-
-  defsymbol (&Qboundp, "boundp");
-  defsymbol (&Qglobally_boundp, "globally-boundp");
-  defsymbol (&Qmakunbound, "makunbound");
-  defsymbol (&Qsymbol_value, "symbol-value");
-  defsymbol (&Qset, "set");
-  defsymbol (&Qsetq_default, "setq-default");
-  defsymbol (&Qdefault_boundp, "default-boundp");
-  defsymbol (&Qdefault_value, "default-value");
-  defsymbol (&Qset_default, "set-default");
-  defsymbol (&Qmake_variable_buffer_local, "make-variable-buffer-local");
-  defsymbol (&Qmake_local_variable, "make-local-variable");
-  defsymbol (&Qkill_local_variable, "kill-local-variable");
-  defsymbol (&Qkill_console_local_variable, "kill-console-local-variable");
-  defsymbol (&Qsymbol_value_in_buffer, "symbol-value-in-buffer");
-  defsymbol (&Qsymbol_value_in_console, "symbol-value-in-console");
-  defsymbol (&Qlocal_variable_p, "local-variable-p");
-
-  defsymbol (&Qconst_integer, "const-integer");
-  defsymbol (&Qconst_boolean, "const-boolean");
-  defsymbol (&Qconst_object, "const-object");
-  defsymbol (&Qconst_specifier, "const-specifier");
-  defsymbol (&Qdefault_buffer, "default-buffer");
-  defsymbol (&Qcurrent_buffer, "current-buffer");
-  defsymbol (&Qconst_current_buffer, "const-current-buffer");
-  defsymbol (&Qdefault_console, "default-console");
-  defsymbol (&Qselected_console, "selected-console");
-  defsymbol (&Qconst_selected_console, "const-selected-console");
+  DEFSYMBOL (Qvariable_documentation);
+  DEFSYMBOL (Qvariable_domain);        /* I18N3 */
+  DEFSYMBOL (Qad_advice_info);
+  DEFSYMBOL (Qad_activate);
+
+  DEFSYMBOL (Qget_value);
+  DEFSYMBOL (Qset_value);
+  DEFSYMBOL (Qbound_predicate);
+  DEFSYMBOL (Qmake_unbound);
+  DEFSYMBOL (Qlocal_predicate);
+  DEFSYMBOL (Qmake_local);
+
+  DEFSYMBOL (Qboundp);
+  DEFSYMBOL (Qglobally_boundp);
+  DEFSYMBOL (Qmakunbound);
+  DEFSYMBOL (Qsymbol_value);
+  DEFSYMBOL (Qset);
+  DEFSYMBOL (Qsetq_default);
+  DEFSYMBOL (Qdefault_boundp);
+  DEFSYMBOL (Qdefault_value);
+  DEFSYMBOL (Qset_default);
+  DEFSYMBOL (Qmake_variable_buffer_local);
+  DEFSYMBOL (Qmake_local_variable);
+  DEFSYMBOL (Qkill_local_variable);
+  DEFSYMBOL (Qkill_console_local_variable);
+  DEFSYMBOL (Qsymbol_value_in_buffer);
+  DEFSYMBOL (Qsymbol_value_in_console);
+  DEFSYMBOL (Qlocal_variable_p);
+
+  DEFSYMBOL (Qconst_integer);
+  DEFSYMBOL (Qconst_boolean);
+  DEFSYMBOL (Qconst_object);
+  DEFSYMBOL (Qconst_specifier);
+  DEFSYMBOL (Qdefault_buffer);
+  DEFSYMBOL (Qcurrent_buffer);
+  DEFSYMBOL (Qconst_current_buffer);
+  DEFSYMBOL (Qdefault_console);
+  DEFSYMBOL (Qselected_console);
+  DEFSYMBOL (Qconst_selected_console);
 
   DEFSUBR (Fintern);
   DEFSUBR (Fintern_soft);
@@ -3438,7 +3543,7 @@ defvar_magic (const char *symbol_name, const struct symbol_value_forward *magic)
     sym = Fintern (make_string_nocopy ((const Bufbyte *) symbol_name,
                                       strlen (symbol_name)), Qnil);
 
-  XSETOBJ (XSYMBOL (sym)->value, Lisp_Type_Record, magic);
+  XSETOBJ (XSYMBOL (sym)->value, magic);
 }
 
 void
index ac3bec1..739999b 100644 (file)
@@ -1,5 +1,6 @@
 /* Definitions of symbol-value forwarding for XEmacs Lisp interpreter.
    Copyright (C) 1985, 1986, 1987, 1992, 1993 Free Software Foundation, Inc.
+   Copyright (C) 2000 Ben Wing.
 
 This file is part of XEmacs.
 
@@ -80,7 +81,7 @@ struct symbol_value_magic
  XRECORD_LHEADER (x)->type <= lrecord_type_max_symbol_value_magic)
 #define XSYMBOL_VALUE_MAGIC_TYPE(v) \
        (((struct symbol_value_magic *) XPNTR (v))->type)
-#define XSETSYMBOL_VALUE_MAGIC(s, p) XSETOBJ (s, Lisp_Type_Record, p)
+#define XSETSYMBOL_VALUE_MAGIC(s, p) XSETOBJ (s, p)
 void print_symbol_value_magic (Lisp_Object, Lisp_Object, int);
 
 /********** The various different symbol-value-magic types ***********/
@@ -281,13 +282,38 @@ void defsubr (Lisp_Subr *);
 void defsubr_macro (Lisp_Subr *);
 #define DEFSUBR_MACRO(Fname) defsubr_macro (&S##Fname)
 
+void defsymbol_massage_name (Lisp_Object *location, const char *name);
+void defsymbol_massage_name_nodump (Lisp_Object *location, const char *name);
+void defsymbol_massage_multiword_predicate (Lisp_Object *location,
+                                           const char *name);
+void defsymbol_massage_multiword_predicate_nodump (Lisp_Object *location,
+                                                  const char *name);
 void defsymbol (Lisp_Object *location, const char *name);
 void defsymbol_nodump (Lisp_Object *location, const char *name);
 
+#define DEFSYMBOL(name) defsymbol_massage_name (&name, #name)
+#define DEFSYMBOL_NO_DUMP(name) defsymbol_massage_name_nodump (&name, #name)
+#define DEFSYMBOL_MULTIWORD_PREDICATE(name) \
+  defsymbol_massage_multiword_predicate (&name, #name)
+#define DEFSYMBOL_MULTIWORD_PREDICATE_NO_DUMP(name) \
+  defsymbol_massage_multiword_predicate_nodump (&name, #name)
+
 void defkeyword (Lisp_Object *location, const char *name);
+void defkeyword_massage_name (Lisp_Object *location, const char *name);
+#define DEFKEYWORD(name) defkeyword_massage_name (&name, #name)
 
 void deferror (Lisp_Object *symbol, const char *name,
               const char *message, Lisp_Object inherits_from);
+void deferror_massage_name (Lisp_Object *symbol, const char *name,
+                           const char *message, Lisp_Object inherits_from);
+void deferror_massage_name_and_message (Lisp_Object *symbol, const char *name,
+                                       Lisp_Object inherits_from);
+#define DEFERROR(name, message, inherits_from) \
+  deferror_massage_name (&name, #name, message, inherits_from)
+/* In this case, the error message is the same as the name, modulo some
+   prettifying */
+#define DEFERROR_STANDARD(name, inherits_from) \
+  deferror_massage_name_and_message (&name, #name, inherits_from)
 
 /* Macros we use to define forwarded Lisp variables.
    These are used in the syms_of_FILENAME functions.  */
index e8a5d62..0df8a68 100644 (file)
@@ -67,6 +67,7 @@ void syms_of_device_tty (void);
 void syms_of_device_mswindows (void);
 void syms_of_device_x (void);
 void syms_of_device (void);
+void syms_of_dialog_mswindows (void);
 void syms_of_dialog_x (void);
 void syms_of_dialog (void);
 void syms_of_dired (void);
@@ -154,6 +155,7 @@ void syms_of_select_x (void);
 void syms_of_eldap (void);
 void syms_of_postgresql (void);
 void syms_of_gpmevent (void);
+void syms_of_win32 (void);
 
 /* Initialize the console types (dump-time but for reinit_). */
 
@@ -449,5 +451,6 @@ void init_ntproc (void); /* #### delete me, please! */
 void init_xemacs_process (void);
 void init_redisplay (void);
 void init_sunpro (void);
+void init_win32 (void);
 
 #endif /* INCLUDED_symsinit_h_ */
index c84502a..8daf22c 100644 (file)
@@ -74,6 +74,9 @@ int no_quit_in_re_search;
    and the like. */
 struct buffer *regex_emacs_buffer;
 
+/* Tell the regex routines whether buffer is used or not. */
+int regex_emacs_buffer_p;
+
 Lisp_Object Vstandard_syntax_table;
 
 Lisp_Object Vsyntax_designator_chars_string;
index d94fc04..4b2709b 100644 (file)
@@ -254,6 +254,7 @@ Lisp_Object syntax_match (Lisp_Object table, Emchar ch);
 
 extern int no_quit_in_re_search;
 extern struct buffer *regex_emacs_buffer;
+extern int regex_emacs_buffer_p;
 
 void update_syntax_table (Lisp_Char_Table *ct);
 
index e027ad2..afd72cf 100644 (file)
@@ -111,10 +111,6 @@ Boston, MA 02111-1307, USA.  */
 #endif /* TIOCGWINSZ or ISC4_0 */
 #endif /* USG */
 
-#ifdef HAVE_SYS_STROPTS_H
-#include <sys/stropts.h>
-#endif /* HAVE_SYS_STROPTS_H */
-
 /* LPASS8 is new in 4.3, and makes cbreak mode provide all 8 bits.  */
 #ifndef LPASS8
 #define LPASS8 0
@@ -777,6 +773,11 @@ get_pty_max_bytes (int fd)
 #if defined (HAVE_FPATHCONF) && defined (_PC_MAX_CANON)
   {
     int max_canon = fpathconf (fd, _PC_MAX_CANON);
+#ifdef __hpux__
+    /* HP-UX 10.20 fpathconf returns 768, but this results in
+       truncated input lines, while 255 works. */
+    if (max_canon > 255) max_canon = 255;
+#endif
     return (max_canon < 0 ? SAFE_MAX_CANON :
            max_canon > SAFE_MAX_CANON ? max_canon - MAX_CANON_SLACK :
            max_canon);
@@ -883,7 +884,7 @@ set_window_size (int fd, int height, int width)
 void
 setup_pty (int fd)
 {
-  /* I'm told that TOICREMOTE does not mean control chars
+  /* I'm told that TIOCREMOTE does not mean control chars
      "can't be sent" but rather that they don't have
      input-editing or signaling effects.
      That should be good, because we have other ways
@@ -1227,8 +1228,8 @@ unrequest_sigio (void)
 
 #ifdef SIGIO_REQUIRES_SEPARATE_PROCESS_GROUP
 
-static int inherited_pgroup;
-static int inherited_tty_pgroup;
+static pid_t inherited_pgroup;
+static pid_t inherited_tty_pgroup;
 
 #endif
 
@@ -1246,7 +1247,7 @@ munge_tty_process_group (void)
       CONSOLE_LIVE_P (XCONSOLE (Vcontrolling_terminal)))
     {
       int fd = open ("/dev/tty", O_RDWR, 0);
-      int me = getpid ();
+      pid_t me = getpid ();
       EMACS_BLOCK_SIGNAL (SIGTTOU);
       EMACS_SET_TTY_PROCESS_GROUP (fd, &me);
       EMACS_UNBLOCK_SIGNAL (SIGTTOU);
@@ -2170,7 +2171,7 @@ start_of_text (void)
 /*
  *     Return the address of the start of the data segment prior to
  *     doing an unexec.  After unexec the return value is undefined.
- *     See crt0.c for further information and definition of data_start.
+ *     See ecrt0.c for further information and definition of data_start.
  *
  *     Apparently, on BSD systems this is etext at startup.  On
  *     USG systems (swapping) this is highly mmu dependent and
@@ -3119,9 +3120,8 @@ sys_fstat (int fd, struct stat *buf)
 }
 #endif /* ENCAPSULATE_FSTAT */
 
-#ifdef ENCAPSULATE_STAT
 int
-sys_stat (const char *path, struct stat *buf)
+xemacs_stat (const char *path, struct stat *buf)
 {
   PATHNAME_CONVERT_OUT (path);
 #ifdef WIN32_NATIVE
@@ -3130,7 +3130,6 @@ sys_stat (const char *path, struct stat *buf)
   return stat (path, buf);
 #endif
 }
-#endif /* ENCAPSULATE_STAT */
 
 /****************** file-manipulation calls *****************/
 
@@ -3871,7 +3870,7 @@ mkdir (const char *dpath, int dmode)
   int cpid, status, fd;
   struct stat statbuf;
 
-  if (stat (dpath, &statbuf) == 0)
+  if (stat (dpath, &statbuf) == 0) /* we do want stat() here */
     {
       errno = EEXIST;          /* Stat worked, so it already exists */
       return -1;
@@ -3930,7 +3929,7 @@ rmdir (const char *dpath)
   int cpid, status, fd;
   struct stat statbuf;
 
-  if (stat (dpath, &statbuf) != 0)
+  if (stat (dpath, &statbuf) != 0) /* we do want stat() here */
     {
       /* Stat just set errno.  We don't have to */
       return -1;
@@ -3999,59 +3998,3 @@ dlclose (void)
 }
 
 #endif /* USE_DL_STUBS */
-
-\f
-
-#ifndef HAVE_STRCASECMP
-/*
- * From BSD
- */
-static unsigned char charmap[] = {
-        '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007',
-        '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017',
-        '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027',
-        '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037',
-        '\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047',
-        '\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057',
-        '\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067',
-        '\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077',
-        '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147',
-        '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157',
-        '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167',
-        '\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137',
-        '\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147',
-        '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157',
-        '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167',
-        '\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177',
-        '\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207',
-        '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217',
-        '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227',
-        '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237',
-        '\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247',
-        '\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257',
-        '\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267',
-        '\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277',
-        '\300', '\301', '\302', '\303', '\304', '\305', '\306', '\307',
-        '\310', '\311', '\312', '\313', '\314', '\315', '\316', '\317',
-        '\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327',
-        '\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337',
-        '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347',
-        '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357',
-        '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367',
-        '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377',
-};
-
-int
-strcasecmp (char *s1, char *s2)
-{
-  unsigned char *cm = charmap;
-  unsigned char *us1 = (unsigned char *) s1;
-  unsigned char *us2 = (unsigned char *)s2;
-
-  while (cm[*us1] == cm[*us2++])
-    if (*us1++ == '\0')
-      return (0);
-
-  return (cm[*us1] - cm[*--us2]);
-}
-#endif /* !HAVE_STRCASECMP */
index 35e9117..1504961 100644 (file)
@@ -57,13 +57,13 @@ dll_init (const char *arg)
 dll_handle
 dll_open (const char *fname)
 {
-  return (dll_handle)dlopen (fname, RTLD_LAZY | RTLD_GLOBAL);
+  return (dll_handle) dlopen (fname, RTLD_LAZY | RTLD_GLOBAL);
 }
 
 int
 dll_close (dll_handle h)
 {
-  return dlclose((void *)h);
+  return dlclose ((void *) h);
 }
 
 dll_func
@@ -72,10 +72,10 @@ dll_function (dll_handle h, const char *n)
 #ifdef DLSYM_NEEDS_UNDERSCORE
   char *buf = alloca_array (char, strlen (n) + 2);
   *buf = '_';
-  (void)strcpy(buf + 1, n);
+  strcpy (buf + 1, n);
   n = buf;
 #endif
-  return (dll_func)dlsym ((void *)h, n);
+  return (dll_func) dlsym ((void *) h, n);
 }
 
 dll_var
@@ -84,7 +84,7 @@ dll_variable (dll_handle h, const char *n)
 #ifdef DLSYM_NEEDS_UNDERSCORE
   char *buf = alloca_array (char, strlen (n) + 2);
   *buf = '_';
-  (void)strcpy(buf + 1, n);
+  strcpy (buf + 1, n);
   n = buf;
 #endif
   return (dll_var)dlsym ((void *)h, n);
@@ -94,9 +94,9 @@ const char *
 dll_error (dll_handle h)
 {
 #if defined(HAVE_DLERROR) || defined(dlerror)
-  return (const char *)dlerror ();
+  return (const char *) dlerror ();
 #elif defined(HAVE__DLERROR)
-  return (const char *)_dlerror();
+  return (const char *) _dlerror();
 #else
   return "Shared library error";
 #endif
@@ -114,26 +114,16 @@ dll_init (const char *arg)
 dll_handle
 dll_open (const char *fname)
 {
-  shl_t h = shl_load (fname, BIND_DEFERRED,0L);
-  shl_t *hp = NULL;
+  /* shl_load will hang hard if passed a NULL fname. */
+  if (fname == NULL) return NULL;
 
-  if (h)
-    {
-      hp = (shl_t *)malloc (sizeof (shl_t));
-      if (!hp)
-       shl_unload(h);
-      else
-       *hp = h;
-    }
-  return (dll_handle)hp;
+  return (dll_handle) shl_load (fname, BIND_DEFERRED,0L);
 }
 
 int
 dll_close (dll_handle h)
 {
-  shl_t hp = *((shl_t *)h);
-  free (hp);
-  return shl_unload(h);
+  return shl_unload ((shl_t) h);
 }
 
 dll_func
@@ -141,10 +131,10 @@ dll_function (dll_handle h, const char *n)
 {
   long handle = 0L;
 
-  if (shl_findsym ((shl_t *)h, n, TYPE_PROCEDURE, &handle))
+  if (shl_findsym ((shl_t *) &h, n, TYPE_PROCEDURE, &handle))
     return NULL;
 
-  return (dll_func)handle;
+  return (dll_func) handle;
 }
 
 dll_var
@@ -152,10 +142,10 @@ dll_variable (dll_handle h, const char *n)
 {
   long handle = 0L;
 
-  if (shl_findsym ((shl_t *)h, n, TYPE_DATA, &handle))
+  if (shl_findsym ((shl_t *) &h, n, TYPE_DATA, &handle))
     return NULL;
 
-  return (dll_var)handle;
+  return (dll_var) handle;
 }
 
 const char *
@@ -190,7 +180,7 @@ dll_open (const char *fname)
   if (rc)
     return NULL;
 
-  return (dll_handle)1;
+  return (dll_handle) 1;
 }
 
 int
@@ -208,13 +198,13 @@ dll_close (dll_handle h)
 DLL_FUNC
 dll_function (dll_handle h, const char *n)
 {
-  return dld_get_func(n);
+  return dld_get_func (n);
 }
 
 DLL_FUNC
 dll_variable (dll_handle h, const char *n)
 {
-  return dld_get_symbol(n);
+  return dld_get_symbol (n);
 }
 #elif defined (WIN32_NATIVE)
 
@@ -231,7 +221,7 @@ dll_init (const char *arg)
 dll_handle
 dll_open (const char *fname)
 {
-  return (dll_handle)LoadLibrary (fname);
+  return (dll_handle) LoadLibrary (fname);
 }
 
 int
@@ -243,13 +233,13 @@ dll_close (dll_handle h)
 dll_func
 dll_function (dll_handle h, const char *n)
 {
-  return (dll_func)GetProcAddress (h,n);
+  return (dll_func) GetProcAddress (h, n);
 }
 
 dll_func
 dll_variable (dll_handle h, const char *n)
 {
-  return (dll_func)GetProcAddress (h,n);
+  return (dll_func) GetProcAddress (h, n);
 }
 
 const char *
index bda610e..1870289 100644 (file)
@@ -50,4 +50,9 @@ const char *dll_error(dll_handle);
 }
 #endif
 
+/* More stand-ins ... */
+
+#define Qdll_filename_encoding Qfile_name
+#define Qdll_function_name_encoding Qnative
+
 #endif /* INCLUDED_sysdll_h_ */
index f5f7490..2f6c90d 100644 (file)
@@ -51,6 +51,8 @@ Boston, MA 02111-1307, USA.  */
 #include <sys/stat.h>
 
 #ifndef WIN32_NATIVE
+/* Some configuration files' definitions for the LOAD_AVE_CVT macro
+   (like sparc.h's) use macros like FSCALE, defined here. */
 #include <sys/param.h>
 #endif
 
@@ -439,24 +441,13 @@ int sys_fstat (int fd, struct stat *buf);
 #endif
 #if defined (ENCAPSULATE_FSTAT) && !defined (DONT_ENCAPSULATE)
 # undef fstat
-/* Need to use arguments to avoid messing with struct stat */
-# define fstat(fd, buf) sys_fstat (fd, buf)
+# define fstat sys_fstat
 #endif
 #if !defined (ENCAPSULATE_FSTAT) && defined (DONT_ENCAPSULATE)
 # define sys_fstat fstat
 #endif
 
-#ifdef ENCAPSULATE_STAT
-int sys_stat (const char *path, struct stat *buf);
-#endif
-#if defined (ENCAPSULATE_STAT) && !defined (DONT_ENCAPSULATE)
-# undef stat
-/* Need to use arguments to avoid messing with struct stat */
-# define stat(path, buf) sys_stat (path, buf)
-#endif
-#if !defined (ENCAPSULATE_STAT) && defined (DONT_ENCAPSULATE)
-# define sys_stat stat
-#endif
+int xemacs_stat (const char *path, struct stat *buf);
 
 /* encapsulations: file-manipulation calls */
 
index f8302e2..ebb4e78 100644 (file)
@@ -118,6 +118,22 @@ Boston, MA 02111-1307, USA.  */
 #include <sys/select.h>
 #endif
 
+#ifdef HAVE_SYS_STROPTS_H
+#include <sys/stropts.h>       /* isastream(), I_PUSH */
+#endif
+
+#ifdef HAVE_SYS_STRTIO_H
+#include <sys/strtio.h>                /* TIOCSIGNAL */
+#endif
+
+#ifdef HAVE_PTY_H
+#include <pty.h>               /* openpty() on Tru64, Linux */
+#endif
+
+#ifdef HAVE_LIBUTIL_H
+#include <libutil.h>           /* openpty() on BSD */
+#endif
+
 #ifdef FD_SET
 
 /* We could get this from param.h, but better not to depend on finding that.
index f0be8d1..8b2747c 100644 (file)
@@ -209,13 +209,13 @@ signal_handler_t sys_do_signal (int signal_number, signal_handler_t action);
 
 /* On bsd, [man says] kill does not accept a negative number to kill a pgrp.
    Must do that using the killpg call.  */
-#ifdef BSD
-#define EMACS_KILLPG(gid, signo) killpg (gid, signo)
+#ifdef HAVE_KILLPG
+#define EMACS_KILLPG(pid, signo) killpg (pid, signo)
 #else
 #ifdef WIN32_NATIVE
-#define EMACS_KILLPG(gid, signo) kill (gid, signo)
+#define EMACS_KILLPG(pid, signo) kill (pid, signo)
 #else
-#define EMACS_KILLPG(gid, signo) kill (-(gid), signo)
+#define EMACS_KILLPG(pid, signo) kill (-(pid), signo)
 #endif
 #endif
 
index c15906e..6494003 100644 (file)
@@ -246,55 +246,34 @@ Boston, MA 02111-1307, USA.  */
 /*       Manipulate a terminal's current (foreground) process group     */
 /* -------------------------------------------------------------------- */
 
-/* EMACS_HAVE_TTY_PGRP is true if we can get and set the tty's current
-   controlling process group.
+/* EMACS_GET_TTY_PGRP(int FD, pid_t *PGID) sets *PGID to the terminal
+   FD's current foreground process group.  Return -1 if there is an error.
 
-   EMACS_GET_TTY_PGRP(int FD, int *PGID) sets *PGID the terminal FD's
-   current process group.  Return -1 if there is an error.
+   EMACS_SET_TTY_PGRP(int FD, pid_t *PGID) sets the terminal FD's current
+   foreground process group to *PGID.  Return -1 if there is an error.
 
-   EMACS_SET_TTY_PGRP(int FD, int *PGID) sets the terminal FD's
-   current process group to *PGID.  Return -1 if there is an error.  */
+   We prefer using the ioctl (BSD) interface instead of its Posix
+   replacement tgetpgrp/tcsetpgrp since that is documented as being
+   restricted to processes sharing the same controlling tty. */
 
-/* HPUX tty process group stuff doesn't work, says the anonymous voice
-   from the past.  */
-/* But HPUX people say it does, so I've removed it.  --ben */
-# ifdef TIOCGPGRP
-#  define EMACS_HAVE_TTY_PGRP
-# else
-#  ifdef HAVE_TERMIOS
-#   define EMACS_HAVE_TTY_PGRP
-#  endif
-# endif
-
-#ifdef EMACS_HAVE_TTY_PGRP
-
-#if defined (HAVE_TERMIOS) && ! defined (BSD_TERMIOS)
+#if defined (TIOCGPGRP)
 
-/* Resist the urge to insert needless extra parentheses. */
-#define EMACS_GET_TTY_PGRP(fd, pgid) (*(pgid) = tcgetpgrp (fd))
-#define EMACS_SET_TTY_PGRP(fd, pgid) tcsetpgrp (fd, *(pgid))
+#define EMACS_GET_TTY_PROCESS_GROUP(fd, pgid) ioctl (fd, TIOCGPGRP, pgid)
+#define EMACS_SET_TTY_PROCESS_GROUP(fd, pgid) ioctl (fd, TIOCSPGRP, pgid)
 
-#elif defined (TIOCSPGRP)
+#elif defined (HAVE_TCGETPGRP)
 
-#define EMACS_GET_TTY_PGRP(fd, pgid) (ioctl ((fd), TIOCGPGRP, (pgid)))
-#define EMACS_SET_TTY_PGRP(fd, pgid) (ioctl ((fd), TIOCSPGRP, (pgid)))
+#define EMACS_GET_TTY_PROCESS_GROUP(fd, pgid) (*(pgid) = tcgetpgrp (fd))
+#define EMACS_SET_TTY_PROCESS_GROUP(fd, pgid) tcsetpgrp (fd, *(pgid))
 
-#endif
-
-#endif /* EMACS_HAVE_TTY_PGRP */
-
-#ifndef EMACS_GET_TTY_PGRP
+#else
 
 /* Just ignore this for now and hope for the best */
-#define EMACS_GET_TTY_PGRP(fd, pgid) 0
-#define EMACS_SET_TTY_PGRP(fd, pgif) 0
+#define EMACS_GET_TTY_PROCESS_GROUP(fd, pgid) 0
+#define EMACS_SET_TTY_PROCESS_GROUP(fd, pgif) 0
 
 #endif
 
-/* XEmacs interim backward-compatibility */
-#define EMACS_GET_TTY_PROCESS_GROUP EMACS_GET_TTY_PGRP
-#define EMACS_SET_TTY_PROCESS_GROUP EMACS_SET_TTY_PGRP
-
 /* EMACS_GETPGRP (arg) returns the process group of the terminal.  */
 
 #ifdef GETPGRP_VOID
index e4389c7..0b505cb 100644 (file)
@@ -65,7 +65,15 @@ extern BOOL WINAPI PlaySound(LPCSTR,HMODULE,DWORD);
 #define FONTENUMPROC FONTENUMEXPROC
 #define ntmTm ntmentm
 #elif defined (WIN32_LEAN_AND_MEAN)
+#ifdef HAVE_X_WINDOWS
+/* Christ almighty.  The problems you get when combining two large code bases,
+   neither with any respect for namespace purity. */
+#undef Status
+#endif
 #include <winspool.h>
+#ifdef HAVE_X_WINDOWS
+#define Status int
+#endif
 #include <mmsystem.h>
 #include <shellapi.h>
 #include <ddeml.h>
@@ -166,13 +174,119 @@ typedef NMHDR *LPNMHDR;
 
 /* Definitions for Mule under MS Windows */
 
-/* extern int mswindows_windows9x_p; */
-/* #define EIUNICODE_P (!mswindows_windows9x_p) */
-#define EIUNICODE_P 0
+#include <wchar.h>
+
+#ifdef CYGWIN
+
+/* All but wcscmp and wcslen left out of Cygwin headers -- but present
+   in /usr/include/mingw32/string.h! */
+wchar_t* wcscat (wchar_t*, const wchar_t*);
+wchar_t* wcschr (const wchar_t*, wchar_t);
+int    wcscoll (const wchar_t*, const wchar_t*);
+wchar_t* wcscpy (wchar_t*, const wchar_t*);
+size_t wcscspn (const wchar_t*, const wchar_t*);
+/* Note: No wcserror in CRTDLL. */
+wchar_t* wcsncat (wchar_t*, const wchar_t*, size_t);
+int    wcsncmp(const wchar_t*, const wchar_t*, size_t);
+wchar_t* wcsncpy(wchar_t*, const wchar_t*, size_t);
+wchar_t* wcspbrk(const wchar_t*, const wchar_t*);
+wchar_t* wcsrchr(const wchar_t*, wchar_t);
+size_t wcsspn(const wchar_t*, const wchar_t*);
+wchar_t* wcsstr(const wchar_t*, const wchar_t*);
+wchar_t* wcstok(wchar_t*, const wchar_t*);
+size_t wcsxfrm(wchar_t*, const wchar_t*, size_t);
+
+#endif /* CYGWIN */
+
+// extern int mswindows_windows9x_p;
+/* #define XEUNICODE_P (!mswindows_windows9x_p) */
+#define XEUNICODE_P 0
+
+#define XETCHAR_SIZE (XEUNICODE_P ? sizeof (WCHAR) : sizeof (CHAR))
+#define MAX_XETCHAR_SIZE sizeof (WCHAR)
+#define XETEXT1(arg) (XEUNICODE_P ? ((char *) (L##arg)) : (arg))
+/* We need to do this indirection in case ARG is also a manifest constant.
+   I don't really understand why. --ben */
+#define XETEXT(arg) XETEXT1(arg)
+#define XECOPY_TCHAR(ptr, ch) \
+  (XEUNICODE_P ? (* (LPWSTR) (ptr) = L##ch) : (* (LPSTR) (ptr) = (ch)))
+#define xetcslen(arg) (XEUNICODE_P ? wcslen ((wchar_t *) arg) : strlen (arg))
+#define xetcscmp(s1, s2) \
+  (XEUNICODE_P ? wcscmp ((wchar_t *) s1, (wchar_t *) s2) \
+   : strcmp (s1, s2))
+#define xetcscpy(s1, s2) \
+  (XEUNICODE_P ? (char *) wcscpy ((wchar_t *) s1, (wchar_t *) s2) \
+   : strcpy (s1, s2))
+#define xetcschr(s, ch) \
+  (XEUNICODE_P ? (char *) wcschr ((wchar_t *) s, (WCHAR) ch) \
+   : strchr (s, ch))
+#define xetcsrchr(s, ch) \
+  (XEUNICODE_P ? (char *) wcsrchr ((wchar_t *) s, (WCHAR) ch) \
+   : strrchr (s, ch))
+
+
+#define LOCAL_FILE_FORMAT_TO_TSTR(path, out)           \
+do {                                                   \
+  Bufbyte *lttff;                                      \
+                                                       \
+  LOCAL_TO_WIN32_FILE_FORMAT (path, lttff);            \
+  C_STRING_TO_EXTERNAL (lttff, out, Qmswindows_tstr);  \
+} while (0)
+
+Lisp_Object tstr_to_local_file_format (Extbyte *pathout);
+
+#ifdef CYGWIN
+#define LOCAL_TO_WIN32_FILE_FORMAT(path, pathout)                      \
+do {                                                                   \
+  Lisp_Object ltwff1 = (path);                                         \
+  int ltwff2 =                                                         \
+    cygwin_posix_to_win32_path_list_buf_size (XSTRING_DATA (ltwff1));  \
+  pathout = (Bufbyte *) alloca (ltwff2);                               \
+  cygwin_posix_to_win32_path_list (XSTRING_DATA (ltwff1), pathout);    \
+} while (0)
+#else
+#define LOCAL_TO_WIN32_FILE_FORMAT(path, pathout)      \
+do {                                                   \
+  (pathout) = XSTRING_DATA (path);                     \
+} while (0)
+#endif
+
+#ifdef CYGWIN
+#define WIN32_TO_LOCAL_FILE_FORMAT(path, pathout)      \
+do {                                                   \
+  Bufbyte *wtlff1 = (path);                            \
+  int wtlff2 =                                         \
+    cygwin_win32_to_posix_path_list_buf_size (wtlff1); \
+  Bufbyte *wtlff3 = (Bufbyte *) alloca (wtlff2);       \
+  cygwin_win32_to_posix_path_list (wtlff1, wtlff3);    \
+  (pathout) = build_string (wtlff3);                   \
+} while (0)
+#else
+#define WIN32_TO_LOCAL_FILE_FORMAT(path, pathout)      \
+do {                                                   \
+  (pathout) = build_string (path);                     \
+} while (0)
+#endif
+
+extern BOOL (WINAPI *xSwitchToThread) (VOID);
+
+extern HKL (WINAPI *xGetKeyboardLayout) (DWORD);
+extern BOOL (WINAPI *xSetMenuDefaultItem) (HMENU, UINT, UINT);
+extern BOOL (WINAPI *xInsertMenuItemA) (HMENU, UINT, BOOL, LPCMENUITEMINFOA);
+extern BOOL (WINAPI *xInsertMenuItemW) (HMENU, UINT, BOOL, LPCMENUITEMINFOW);
+extern HANDLE (WINAPI *xLoadImageA) (HINSTANCE, LPCSTR, UINT, int, int, UINT);
+extern HANDLE (WINAPI *xLoadImageW) (HINSTANCE, LPCWSTR, UINT, int, int, UINT);
+extern ATOM (WINAPI *xRegisterClassExA) (CONST WNDCLASSEXA *);
+extern ATOM (WINAPI *xRegisterClassExW) (CONST WNDCLASSEXW *);
+
+extern int (WINAPI *xEnumFontFamiliesExA) (HDC, LPLOGFONTA, FONTENUMPROCA,
+                                          LPARAM, DWORD);
+extern int (WINAPI *xEnumFontFamiliesExW) (HDC, LPLOGFONTW, FONTENUMPROCW,
+                                          LPARAM, DWORD);
 
-#define EITCHAR_SIZE (EIUNICODE_P ? sizeof (WCHAR) : sizeof (CHAR))
-#define EITEXT(arg) (EIUNICODE_P ? L##arg : (arg))
-#define EICOPY_TCHAR(ptr, ch) \
-  (EIUNICODE_P ? (* (LPWSTR) (ptr) = L##ch) : (* (LPSTR) (ptr) = (ch)))
+extern DWORD (WINAPI *xSHGetFileInfoA) (LPCSTR, DWORD, SHFILEINFOA FAR *, UINT,
+                                       UINT);
+extern DWORD (WINAPI *xSHGetFileInfoW) (LPCWSTR, DWORD, SHFILEINFOW FAR *,
+                                       UINT, UINT);
 
 #endif /* INCLUDED_syswindows_h_ */
index 1b9fcb0..4720506 100644 (file)
@@ -341,7 +341,7 @@ tgetent (bp, name)
   const char *term;
   int malloc_size = 0;
   int c;
-  char *tcenv;                 /* TERMCAP value, if it contais :tc=.  */
+  char *tcenv;                 /* TERMCAP value, if it contains :tc=.  */
   const char *indirect = 0;    /* Terminal type in :tc= in TERMCAP value.  */
 
   tem = getenv ("TERMCAP");
index a8a8f0e..64f2b6c 100644 (file)
@@ -23,6 +23,8 @@ Boston, MA 02111-1307, USA.  */
 
 /* Synched up with: Not in FSF. */
 
+/* This file Mule-ized (more like Mule-verified) by Ben Wing, 7-8-00. */
+
 #include <config.h>
 #include "lisp.h"
 
index b93fcd6..573241a 100644 (file)
@@ -73,24 +73,8 @@ mark_toolbar_button (Lisp_Object obj)
   return data->help_string;
 }
 
-static void
-print_toolbar_button (Lisp_Object obj, Lisp_Object printcharfun,
-                     int escapeflag)
-{
-  struct toolbar_button *tb = XTOOLBAR_BUTTON (obj);
-  char buf[100];
-
-  if (print_readably)
-    error ("printing unreadable object #<toolbar-button 0x%x>",
-          tb->header.uid);
-
-  sprintf (buf, "#<toolbar-button 0x%x>", tb->header.uid);
-  write_c_string (buf, printcharfun);
-}
-
 DEFINE_LRECORD_IMPLEMENTATION ("toolbar-button", toolbar_button,
-                              mark_toolbar_button, print_toolbar_button,
-                              0, 0, 0, 0,
+                              mark_toolbar_button, 0, 0, 0, 0, 0,
                               struct toolbar_button);
 
 DEFUN ("toolbar-button-p", Ftoolbar_button_p, 1, 1, 0, /*
@@ -1040,7 +1024,7 @@ whole, use `check-valid-instantiator' with a specifier type of 'toolbar.
         which buffer to check in.  #### I think this is a bad thing.
         See if we can't get enough information to this function so
         that it can check.
-        
+
         #### Wrong.  We shouldn't be checking the value at all here.
         The user might set or change the value at any time. */
       value = Fsymbol_value (elt[0]);
index 4a87c3e..308f438 100644 (file)
@@ -33,6 +33,7 @@ Boston, MA 02111-1307, USA.  */
 #include "elhash.h"
 #include "process.h"
 #include "tooltalk.h"
+#include "syssignal.h"
 
 Lisp_Object Vtooltalk_fd;
 
@@ -773,7 +774,7 @@ New arguments can be added to a message with add-tooltalk-message-arg.
     {
       const char *value_ext;
       CHECK_STRING (value);
-      TO_EXTERNAL_FORMAT (LISP_STRING, value, C_STRING_ALLOCA, value_ext, Qnative);
+      LISP_STRING_TO_EXTERNAL (value, value_ext, Qnative);
       tt_message_arg_val_set (m, n, value_ext);
     }
   else if (EQ (attribute, Qtt_status))
@@ -798,7 +799,7 @@ New arguments can be added to a message with add-tooltalk-message-arg.
     {
       const char *value_ext;
       CHECK_STRING (value);
-      TO_EXTERNAL_FORMAT (LISP_STRING, value, C_STRING_ALLOCA, value_ext, Qnative);
+      LISP_STRING_TO_EXTERNAL (value, value_ext, Qnative);
       (*fun_str) (m, value_ext);
     }
 
@@ -914,13 +915,13 @@ embedded nulls (use 'arg_bval).
   {
     const char *vtype_ext;
 
-    TO_EXTERNAL_FORMAT (LISP_STRING, vtype, C_STRING_ALLOCA, vtype_ext, Qnative);
+    LISP_STRING_TO_EXTERNAL (vtype, vtype_ext, Qnative);
     if (NILP (value))
       tt_message_arg_add (m, n, vtype_ext, NULL);
     else if (STRINGP (value))
       {
        const char *value_ext;
-       TO_EXTERNAL_FORMAT (LISP_STRING, value, C_STRING_ALLOCA, value_ext, Qnative);
+       LISP_STRING_TO_EXTERNAL (value, value_ext, Qnative);
        tt_message_arg_add (m, n, vtype_ext, value_ext);
       }
     else if (INTP (value))
@@ -1025,28 +1026,28 @@ less the "tooltalk_pattern_" prefix and the "_add" ...
     {
       const char *value_ext;
       CHECK_STRING (value);
-      TO_EXTERNAL_FORMAT (LISP_STRING, value, C_STRING_ALLOCA, value_ext, Qnative);
+      LISP_STRING_TO_EXTERNAL (value, value_ext, Qnative);
       tt_pattern_file_add (p, value_ext);
     }
   else if (EQ (attribute, Qtt_object))
     {
       const char *value_ext;
       CHECK_STRING (value);
-      TO_EXTERNAL_FORMAT (LISP_STRING, value, C_STRING_ALLOCA, value_ext, Qnative);
+      LISP_STRING_TO_EXTERNAL (value, value_ext, Qnative);
       tt_pattern_object_add (p, value_ext);
     }
   else if (EQ (attribute, Qtt_op))
     {
       const char *value_ext;
       CHECK_STRING (value);
-      TO_EXTERNAL_FORMAT (LISP_STRING, value, C_STRING_ALLOCA, value_ext, Qnative);
+      LISP_STRING_TO_EXTERNAL (value, value_ext, Qnative);
       tt_pattern_op_add (p, value_ext);
     }
   else if (EQ (attribute, Qtt_otype))
     {
       const char *value_ext;
       CHECK_STRING (value);
-      TO_EXTERNAL_FORMAT (LISP_STRING, value, C_STRING_ALLOCA, value_ext, Qnative);
+      LISP_STRING_TO_EXTERNAL (value, value_ext, Qnative);
       tt_pattern_otype_add (p, value_ext);
     }
   else if (EQ (attribute, Qtt_scope))
@@ -1058,21 +1059,21 @@ less the "tooltalk_pattern_" prefix and the "_add" ...
     {
       const char *value_ext;
       CHECK_STRING (value);
-      TO_EXTERNAL_FORMAT (LISP_STRING, value, C_STRING_ALLOCA, value_ext, Qnative);
+      LISP_STRING_TO_EXTERNAL (value, value_ext, Qnative);
       tt_pattern_sender_add (p, value_ext);
     }
   else if (EQ (attribute, Qtt_sender_ptype))
     {
       const char *value_ext;
       CHECK_STRING (value);
-      TO_EXTERNAL_FORMAT (LISP_STRING, value, C_STRING_ALLOCA, value_ext, Qnative);
+      LISP_STRING_TO_EXTERNAL (value, value_ext, Qnative);
       tt_pattern_sender_ptype_add (p, value_ext);
     }
   else if (EQ (attribute, Qtt_session))
     {
       const char *value_ext;
       CHECK_STRING (value);
-      TO_EXTERNAL_FORMAT (LISP_STRING, value, C_STRING_ALLOCA, value_ext, Qnative);
+      LISP_STRING_TO_EXTERNAL (value, value_ext, Qnative);
       tt_pattern_session_add (p, value_ext);
     }
   else if (EQ (attribute, Qtt_state))
@@ -1113,13 +1114,13 @@ is added.  At present there's no way to add a binary data argument.
   {
     const char *vtype_ext;
 
-    TO_EXTERNAL_FORMAT (LISP_STRING, vtype, C_STRING_ALLOCA, vtype_ext, Qnative);
+    LISP_STRING_TO_EXTERNAL (vtype, vtype_ext, Qnative);
     if (NILP (value))
       tt_pattern_arg_add (p, n, vtype_ext, NULL);
     else if (STRINGP (value))
       {
        const char *value_ext;
-       TO_EXTERNAL_FORMAT (LISP_STRING, value, C_STRING_ALLOCA, value_ext, Qnative);
+       LISP_STRING_TO_EXTERNAL (value, value_ext, Qnative);
        tt_pattern_arg_add (p, n, vtype_ext, value_ext);
       }
     else if (INTP (value))
@@ -1368,7 +1369,7 @@ syms_of_tooltalk (void)
   defsymbol (&Qtt_reply, "reply");
   defsymbol (&Qtt_fail, "fail");
 
-  deferror (&Qtooltalk_error, "tooltalk-error", "ToolTalk error", Qio_error);
+  DEFERROR (Qtooltalk_error, "ToolTalk error", Qio_error);
 }
 
 void
index 8312e20..7f9b551 100644 (file)
@@ -29,7 +29,10 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 #include <fcntl.h>
 #include <config.h>
 #include <string.h>
+
+#define DONT_ENCAPSULATE /* filenames are external in unex*.c */
 #include "sysfile.h"
+
 #define PERROR(arg) perror(arg);exit(-1) 
 
 #ifndef HAVE_A_OUT_H
index 9c2bad9..5a5a7d3 100644 (file)
@@ -58,6 +58,7 @@ Boston, MA 02111-1307, USA.  */
 #include <errno.h>
 
 #include <a.out.h>
+#include "lisp.h"
 
 /*
  * Minor modification to enable dumping with shared libraries added by
@@ -81,12 +82,10 @@ Boston, MA 02111-1307, USA.  */
 
 #ifdef HPUX_USE_SHLIBS
 #include <dl.h>                        /* User-space dynamic loader entry points */
-void Save_Shared_Data(void);
-int run_time_remap();
+static void Save_Shared_Data (void);
+static void Restore_Shared_Data (void);
 #endif
 
-#define min(x,y)  ( ((x)<(y))?(x):(y) )
-
 void write_header(int file, struct header *hdr, struct som_exec_auxhdr *auxhdr);
 void read_header (int file, struct header *hdr, struct som_exec_auxhdr *auxhdr);
 void save_data_space (int file, struct header *hdr,
@@ -100,10 +99,10 @@ int calculate_checksum(struct header *hdr);
 
 /* Create a new a.out file, same as old but with current data space */
 int
-unexec(char new_name[],                /* name of the new a.out file to be created */
-       char old_name[],                /* name of the old a.out file */
-       char *new_end_of_text,  /* ptr to new edata/etext; NOT USED YET */
-       int dummy1, int dummy2) /* not used by emacs */
+unexec (char *new_name,                /* name of the new a.out file to be created */
+        char *old_name,                /* name of the old a.out file */
+        uintptr_t new_end_of_text, /* ptr to new edata/etext; NOT USED YET */
+        uintptr_t dummy1, uintptr_t dummy2) /* not used by emacs */
 {
   int old, new;
   int old_size, new_size;
@@ -291,11 +290,17 @@ copy_file (int old, int new, int size)
 
   for (; size > 0; size -= len)
     {
-      len = min(size, sizeof(buffer));
-      if (read(old, buffer, len) != len)
-       { perror("Read failure on a.out file"); exit(1); }
-      if (write(new, buffer, len) != len)
-       { perror("Write failure in a.out file"); exit(1); }
+      len = size < sizeof (buffer) ? size : sizeof (buffer);
+      if (read (old, buffer, len) != len)
+       {
+         perror ("Read failure on a.out file");
+         exit (1);
+       }
+      if (write (new, buffer, len) != len)
+       {
+         perror ("Write failure in a.out file");
+         exit (1);
+       }
     }
 }
 
@@ -338,19 +343,24 @@ display_header(struct header *hdr, struct som_exec_auxhdr *auxhdr)
 
 void *Brk_On_Dump = 0;         /* Brk value to restore... stored as a global */
 
-void Save_Shared_Data () {
-  Brk_On_Dump = sbrk( 0 );
-}
-
-void Restore_Shared_Data () {
-  brk ( Brk_On_Dump );
+static void
+Save_Shared_Data (void)
+{
+  Brk_On_Dump = sbrk (0);
 }
 
-int run_time_remap (int d) {
-  Restore_Shared_Data();
+static void
+Restore_Shared_Data (void)
+{
+  brk (Brk_On_Dump);
 }
 
 /* run_time_remap is the magic called by startup code in the dumped executable
- * if RUN_TIME_REMAP is set.
- */
+   if RUN_TIME_REMAP is set. */
+int
+run_time_remap (char *dummy)
+{
+  Restore_Shared_Data ();
+  return 0;
+}
 #endif /* HPUX_USE_SHLIBS */
index 77cf487..3a6b0b1 100644 (file)
@@ -56,10 +56,9 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  * version of my_ebss in lastfile.c and a new firstfile.c file.  jhar */
 
 #include <config.h>
-#include <stdlib.h>    /* _fmode */
-#include <stdio.h>
-#include <fcntl.h>
-#include <windows.h>
+#include "lisp.h"
+
+#include "syswindows.h"
 
 #include "nt.h"
 #include "ntheap.h"
@@ -170,9 +169,9 @@ _start (void)
 }
 
 /* Dump out .data and .bss sections into a new executable.  */
-void
-unexec (char *new_name, char *old_name, void *start_data, void *start_bss,
-       void *entry_address)
+int
+unexec (char *new_name, char *old_name, unsigned int start_data,
+       unsigned int start_bss, unsigned int entry_address)
 {
   file_data in_file, out_file;
   char out_filename[MAX_PATH], in_filename[MAX_PATH];
@@ -267,6 +266,8 @@ unexec (char *new_name, char *old_name, void *start_data, void *start_bss,
 
   close_file_data (&in_file);
   close_file_data (&out_file);
+
+  return 0;
 }
 
 /* Routines to manipulate NT executable file sections.  */
index 357e5c0..80d8c63 100644 (file)
@@ -79,7 +79,7 @@ check_memory_limits (void)
          if (data_size > five_percent * 15)
            {
              warnlevel++;
-             (*warn_function) ("Warning: past 75% of memory limit");
+             (*save_warn_fun) ("Warning: past 75% of memory limit");
            }
          break;
 
@@ -87,7 +87,7 @@ check_memory_limits (void)
          if (data_size > five_percent * 17)
            {
              warnlevel++;
-             (*warn_function) ("Warning: past 85% of memory limit");
+             (*save_warn_fun) ("Warning: past 85% of memory limit");
            }
          break;
 
@@ -95,12 +95,12 @@ check_memory_limits (void)
          if (data_size > five_percent * 19)
            {
              warnlevel++;
-             (*warn_function) ("Warning: past 95% of memory limit");
+             (*save_warn_fun) ("Warning: past 95% of memory limit");
            }
          break;
 
        default:
-         (*warn_function) ("Warning: past acceptable memory limits");
+         (*save_warn_fun) ("Warning: past acceptable memory limits");
          break;
        }
       warn_function = save_warn_fun;
@@ -120,7 +120,18 @@ check_memory_limits (void)
     warnlevel = 2;
 
   if (EXCEEDS_LISP_PTR (cp))
-    (*warn_function) ("Warning: memory in use exceeds lisp pointer size");
+    {
+      if (warn_function)
+       {
+         /* temporarily reset the warn_function to 0 or we will get infinite
+            looping. */
+         save_warn_fun = warn_function;
+         warn_function = 0;
+         (*save_warn_fun)
+           ("Warning: memory in use exceeds lisp pointer size");
+         warn_function = save_warn_fun;
+       }
+    }
 }
 
 /* Cause reinitialization based on job parameters;
index b981c91..cfa89b4 100644 (file)
@@ -82,7 +82,7 @@ Lisp_Object Vvertical_divider_shadow_thickness;
 /* Divider surface width (not counting 3-d borders) */
 Lisp_Object Vvertical_divider_line_width;
 
-/* Spacing between outer egde of divider border and window edge */
+/* Spacing between outer edge of divider border and window edge */
 Lisp_Object Vvertical_divider_spacing;
 
 /* How much to scroll by per-line. */
@@ -283,7 +283,7 @@ allocate_window (void)
   p->line_start_cache = Dynarr_new (line_start_cache);
   p->subwindow_instance_cache = make_lisp_hash_table (30,
                                                      HASH_TABLE_KEY_VALUE_WEAK,
-                                                     HASH_TABLE_EQUAL);
+                                                     HASH_TABLE_EQ);
   p->line_cache_last_updated = Qzero;
   INIT_DISP_VARIABLE (last_point_x, 0);
   INIT_DISP_VARIABLE (last_point_y, 0);
@@ -1020,7 +1020,7 @@ window_top_window_gutter_height (struct window *w)
 {
   if (!NILP (w->hchild) || !NILP (w->vchild))
     return 0;
-  
+
 #ifdef HAVE_SCROLLBARS
   if (!NILP (w->scrollbar_on_top_p))
     return window_scrollbar_height (w);
@@ -1328,7 +1328,7 @@ currently displayed in a window.
 
 The names are somewhat confusing; here's a table to help out:
 
-                    width                         height               
+                    width                         height
 -------------------------------------------------------------------------
 w/o gutters
   (rows/columns)    window-width                  window-text-area-height
@@ -1510,7 +1510,7 @@ Return the number of columns by which WINDOW is scrolled from left margin.
 }
 
 DEFUN ("modeline-hscroll", Fmodeline_hscroll, 0, 1, 0, /*
-Return the horizontal scrolling ammount of WINDOW's modeline.
+Return the horizontal scrolling amount of WINDOW's modeline.
 If the window has no modeline, return nil.
 */
        (window))
@@ -1522,7 +1522,7 @@ If the window has no modeline, return nil.
 }
 
 DEFUN ("set-modeline-hscroll", Fset_modeline_hscroll, 2, 2, 0, /*
-Set the horizontal scrolling ammount of WINDOW's modeline to NCOL.
+Set the horizontal scrolling amount of WINDOW's modeline to NCOL.
 If NCOL is negative, it will silently be forced to 0.
 If the window has no modeline, return nil. Otherwise, return the actual
 value that was set.
@@ -1603,9 +1603,12 @@ The frame toolbars, menubars and gutters are considered to be outside of this ar
        (window))
 {
   struct window *w = decode_window (window);
+  struct frame *f = XFRAME (w->frame);
 
-  int left = w->pixel_left;
-  int top  = w->pixel_top;
+  int left =
+    w->pixel_left - FRAME_LEFT_BORDER_END (f) - FRAME_LEFT_GUTTER_BOUNDS (f);
+  int top =
+    w->pixel_top - FRAME_TOP_BORDER_END (f) - FRAME_TOP_GUTTER_BOUNDS (f);
 
   return list4 (make_int (left),
                make_int (top),
@@ -1636,7 +1639,7 @@ top left corner of the window.
 
 DEFUN ("window-point", Fwindow_point, 0, 1, 0, /*
 Return current value of point in WINDOW.
-For a nonselected window, this is the value point would have
+For a non-selected window, this is the value point would have
 if that window were selected.
 
 Note that, when WINDOW is the selected window and its buffer
@@ -1871,30 +1874,12 @@ replace_window (Lisp_Object old, Lisp_Object replacement)
   ERROR_CHECK_SUBWINDOW_CACHE (p);
 }
 
-static int
-window_unmap_subwindows_cache_mapper (Lisp_Object key, Lisp_Object value,
-                                     void *flag_closure)
-{
-  /* value can be nil; we cache failures as well as successes */
-  if (!NILP (value))
-    {
-      struct frame* f = XFRAME (XIMAGE_INSTANCE_FRAME (value));
-      unmap_subwindow (value);
-      /* In case GC doesn't catch up fast enough, remove from the frame
-        cache also. Otherwise code that checks the sanity of the instance
-        will fail. */
-      XWEAK_LIST_LIST (FRAME_SUBWINDOW_CACHE (f))
-       = delq_no_quit (value, XWEAK_LIST_LIST (FRAME_SUBWINDOW_CACHE (f)));
-    }
-  return 0;
-}
-
 static void
 window_unmap_subwindows (struct window* w)
 {
   assert (!NILP (w->subwindow_instance_cache));
-  elisp_maphash (window_unmap_subwindows_cache_mapper,
-                w->subwindow_instance_cache, 0);
+  elisp_maphash (unmap_subwindow_instance_cache_mapper,
+                w->subwindow_instance_cache, (void*)1);
 }
 
 /* we're deleting W; set the structure of W to indicate this. */
@@ -2125,7 +2110,7 @@ will automatically call `save-buffers-kill-emacs'.)
 
 \f
 DEFUN ("next-window", Fnext_window, 0, 4, 0, /*
-Return next window after WINDOW in canonical ordering of windows.
+Return the next window after WINDOW in the canonical ordering of windows.
 If omitted, WINDOW defaults to the selected window.
 
 Optional second arg MINIBUF t means count the minibuffer window even
@@ -2146,7 +2131,7 @@ ALL-FRAMES = 0 means include windows on all visible and iconified frames.
 If ALL-FRAMES is a frame, restrict search to windows on that frame.
 Anything else means restrict to WINDOW's frame.
 
-Optional fourth argument CONSOLE controls which consoles or devices the
+Optional fourth arg CONSOLE controls which consoles or devices the
 returned window may be on.  If CONSOLE is a console, return windows only
 on that console.  If CONSOLE is a device, return windows only on that
 device.  If CONSOLE is a console type, return windows only on consoles
@@ -2177,8 +2162,9 @@ windows, eventually ending up back at the window you started with.
     minibuf = (minibuf_level ? minibuf_window : Qlambda);
   else if (! EQ (minibuf, Qt))
     minibuf = Qlambda;
-  /* Now minibuf can be t => count all minibuffer windows,
-     lambda => count none of them,
+  /* Now `minibuf' is one of:
+     t      => count all minibuffer windows
+     lambda => count none of them
      or a specific minibuffer window (the active one) to count.  */
 
   /* all_frames == nil doesn't specify which frames to include.  */
@@ -2199,11 +2185,12 @@ windows, eventually ending up back at the window you started with.
     return frame_first_window (XFRAME (all_frames));
   else if (! EQ (all_frames, Qt))
     all_frames = Qnil;
-  /* Now all_frames is t meaning search all frames,
-     nil meaning search just current frame,
-     visible meaning search just visible frames,
-     0 meaning search visible and iconified frames,
-     or a window, meaning search the frame that window belongs to.  */
+  /* Now `all_frames' is one of:
+     t        => search all frames
+     nil      => search just the current frame
+     visible  => search just visible frames
+     0        => search visible and iconified frames
+     a window => search the frame that window belongs to.  */
 
   /* Do this loop at least once, to get the next window, and perhaps
      again, if we hit the minibuffer and that is not acceptable.  */
@@ -2222,10 +2209,9 @@ windows, eventually ending up back at the window you started with.
 
            if (! NILP (all_frames))
              {
-               Lisp_Object tem1;
-
-               tem1 = tem;
+               Lisp_Object tem1 = tem;
                tem = next_frame (tem, all_frames, console);
+
                /* In the case where the minibuffer is active,
                   and we include its frame as well as the selected one,
                   next_frame may get stuck in that frame.
@@ -2252,7 +2238,6 @@ windows, eventually ending up back at the window you started with.
          else break;
        }
     }
-  /* "acceptable" is the correct spelling. */
   /* Which windows are acceptable?
      Exit the loop and accept this window if
      this isn't a minibuffer window,
@@ -2268,7 +2253,7 @@ windows, eventually ending up back at the window you started with.
 }
 
 DEFUN ("previous-window", Fprevious_window, 0, 4, 0, /*
-Return the window preceding WINDOW in canonical ordering of windows.
+Return the window preceding WINDOW in the canonical ordering of windows.
 If omitted, WINDOW defaults to the selected window.
 
 Optional second arg MINIBUF t means count the minibuffer window even
@@ -2280,16 +2265,16 @@ Several frames may share a single minibuffer; if the minibuffer
 counts, all windows on all frames that share that minibuffer count
 too.  Therefore, `previous-window' can be used to iterate through
 the set of windows even when the minibuffer is on another frame.  If
-the minibuffer does not count, only windows from WINDOW's frame count
+the minibuffer does not count, only windows from WINDOW's frame count.
 
-If optional third arg ALL-FRAMES t means include windows on all frames.
+Optional third arg ALL-FRAMES t means include windows on all frames.
 ALL-FRAMES nil or omitted means cycle within the frames as specified
 above.  ALL-FRAMES = `visible' means include windows on all visible frames.
 ALL-FRAMES = 0 means include windows on all visible and iconified frames.
 If ALL-FRAMES is a frame, restrict search to windows on that frame.
 Anything else means restrict to WINDOW's frame.
 
-Optional fourth argument CONSOLE controls which consoles or devices the
+Optional fourth arg CONSOLE controls which consoles or devices the
 returned window may be on.  If CONSOLE is a console, return windows only
 on that console.  If CONSOLE is a device, return windows only on that
 device.  If CONSOLE is a console type, return windows only on consoles
@@ -2320,8 +2305,9 @@ windows, eventually ending up back at the window you started with.
     minibuf = (minibuf_level ? minibuf_window : Qlambda);
   else if (! EQ (minibuf, Qt))
     minibuf = Qlambda;
-  /* Now minibuf can be t => count all minibuffer windows,
-     lambda => count none of them,
+  /* Now `minibuf' is one of:
+     t      => count all minibuffer windows
+     lambda => count none of them
      or a specific minibuffer window (the active one) to count.  */
 
   /* all_frames == nil doesn't specify which frames to include.
@@ -2343,11 +2329,12 @@ windows, eventually ending up back at the window you started with.
     return frame_first_window (XFRAME (all_frames));
   else if (! EQ (all_frames, Qt))
     all_frames = Qnil;
-  /* Now all_frames is t meaning search all frames,
-     nil meaning search just current frame,
-     visible meaning search just visible frames,
-     0 meaning search visible and iconified frames,
-     or a window, meaning search the frame that window belongs to.  */
+  /* Now `all_frames' is one of:
+     t        => search all frames
+     nil      => search just the current frame
+     visible  => search just visible frames
+     0        => search visible and iconified frames
+     a window => search the frame that window belongs to.  */
 
   /* Do this loop at least once, to get the next window, and perhaps
      again, if we hit the minibuffer and that is not acceptable.  */
@@ -2365,7 +2352,7 @@ windows, eventually ending up back at the window you started with.
            tem = WINDOW_FRAME (XWINDOW (window));
 
            if (! NILP (all_frames))
-             /* It's actually important that we use prev_frame here,
+             /* It's actually important that we use previous_frame here,
                 rather than next_frame.  All the windows acceptable
                 according to the given parameters should form a ring;
                 Fnext_window and Fprevious_window should go back and
@@ -2375,10 +2362,8 @@ windows, eventually ending up back at the window you started with.
                 window_loop assumes that these `ring' requirement are
                 met.  */
              {
-               Lisp_Object tem1;
-
-               tem1 = tem;
-               tem = prev_frame (tem, all_frames, console);
+               Lisp_Object tem1 = tem;
+               tem = previous_frame (tem, all_frames, console);
                /* In the case where the minibuffer is active,
                   and we include its frame as well as the selected one,
                   next_frame may get stuck in that frame.
@@ -2564,20 +2549,19 @@ window_loop (enum window_loop type,
   int lose_lose = 0;
   Lisp_Object devcons, concons;
 
-  /* FRAME_ARG is Qlambda to stick to one frame,
-     Qvisible to consider all visible frames,
-     or Qt otherwise.  */
-
   /* If we're only looping through windows on a particular frame,
      FRAME points to that frame.  If we're looping through windows
      on all frames, FRAME is 0.  */
-
   if (FRAMEP (frames))
     frame = XFRAME (frames);
   else if (NILP (frames))
     frame = selected_frame ();
   else
     frame = 0;
+
+  /* FRAME_ARG is Qlambda to stick to one frame,
+     Qvisible to consider all visible frames,
+     or Qt otherwise.  */
   if (frame)
     frame_arg = Qlambda;
   else if (ZEROP (frames))
@@ -2598,7 +2582,10 @@ window_loop (enum window_loop type,
       if (NILP (the_frame))
        continue;
 
-      if (!device_matches_console_spec (the_frame, device, console))
+      if (!device_matches_console_spec (device,
+                                       NILP (console) ?
+                                       FRAME_CONSOLE (XFRAME (the_frame)) :
+                                       console))
        continue;
 
       /* Pick a window to start with.  */
@@ -2624,7 +2611,7 @@ window_loop (enum window_loop type,
 
          /* Pick the next window now, since some operations will delete
             the current window.  */
-         next_window = Fnext_window (w, mini ? Qt : Qnil, frame_arg, Qt);
+         next_window = Fnext_window (w, mini ? Qt : Qnil, frame_arg, device);
 
          /* #### Still needed ?? */
          /* Given the outstanding quality of the rest of this code,
@@ -3302,7 +3289,7 @@ DEFUN ("set-window-buffer", Fset_window_buffer, 2, 3, 0, /*
 Make WINDOW display BUFFER as its contents.
 BUFFER can be a buffer or buffer name.
 
-With non-nil optional argument `norecord', do not modify the
+With non-nil optional argument NORECORD, do not modify the
 global or per-frame buffer ordering.
 */
        (window, buffer, norecord))
@@ -3377,7 +3364,7 @@ Select WINDOW.  Most editing will apply to WINDOW's buffer.
 The main editor command loop selects the buffer of the selected window
 before each command.
 
-With non-nil optional argument `norecord', do not modify the
+With non-nil optional argument NORECORD, do not modify the
 global or per-frame buffer ordering.
 */
        (window, norecord))
@@ -3391,7 +3378,7 @@ global or per-frame buffer ordering.
   /* we have already caught dead-window errors */
   if (!NILP (w->hchild) || !NILP (w->vchild))
     error ("Trying to select non-leaf window");
-  
+
   w->use_time = make_int (++window_select_count);
 
   if (EQ (window, old_selected_window))
@@ -3517,10 +3504,10 @@ make_dummy_parent (Lisp_Object window)
   p->line_start_cache = Dynarr_new (line_start_cache);
   p->face_cachels     = Dynarr_new (face_cachel);
   p->glyph_cachels    = Dynarr_new (glyph_cachel);
-  p->subwindow_instance_cache = 
+  p->subwindow_instance_cache =
     make_lisp_hash_table (30,
                          HASH_TABLE_KEY_VALUE_WEAK,
-                         HASH_TABLE_EQUAL);
+                         HASH_TABLE_EQ);
 
   /* Put new into window structure in place of window */
   replace_window (window, new);
@@ -3544,7 +3531,7 @@ make_dummy_parent (Lisp_Object window)
 DEFUN ("split-window", Fsplit_window, 0, 3, "", /*
 Split WINDOW, putting SIZE lines in the first of the pair.
 WINDOW defaults to selected one and SIZE to half its size.
-If optional third arg HOR-FLAG is non-nil, split side by side
+If optional third arg HORFLAG is non-nil, split side by side
 and put SIZE columns in the first of the pair.
 */
        (window, chsize, horflag))
@@ -5215,23 +5202,32 @@ by `current-window-configuration' (which see).
       record_unwind_protect (free_window_configuration, old_window_config);
 
       mark_windows_in_use (f, 1);
-
-      /* Force subwindows to be reinstantiated. They are all going
-         anyway and if we don't do this GC may not happen between now
-         and the next time we check their integrity. */
+#ifdef BROKEN_SUBWINDOW_REDISPLAY
+      /* Force subwindows to be remapped. This is overkill but saves
+       us having to rely on the redisplay code to unmap any extant
+       subwindows.
+
+       #### It does cause some extra flashing though which we could
+       possibly avoid. So consider trying to get redisplay to work
+       correctly.
+
+       Removing the instances from the frame cache is wrong because
+       an instance is only put in the frame cache when it is
+       instantiated. So if we do this there is a chance that stuff
+       will never get put back in the frame cache. */
       reset_frame_subwindow_instance_cache (f);
-
+#endif
 #if 0
       /* JV: This is bogus,
         First of all, the units are inconsistent. The frame sizes are measured
         in characters but the window sizes are stored in pixels. So if a
         font size change happened between saving and restoring, the
         frame "sizes" maybe equal but the windows still should be
-        resized. This is tickled alot by the new "character size
-        stays constant" policy in 21.0. It leads to very wierd
+        resized. This is tickled a lot by the new "character size
+        stays constant" policy in 21.0. It leads to very weird
         glitches (and possibly crashes when asserts are tickled).
 
-        Just changing the units doens't help because changing the
+        Just changing the units doesn't help because changing the
         toolbar configuration can also change the pixel positions.
         Luckily there is a much simpler way of doing this, see below.
        */
@@ -5363,18 +5359,28 @@ by `current-window-configuration' (which see).
          w->hscroll = p->hscroll;
          w->modeline_hscroll = p->modeline_hscroll;
          w->line_cache_last_updated = Qzero;
-         /* The subwindow instance cache isn't preserved across
-            window configurations, and in fact doing so would be
-            wrong. We just reset to zero and then redisplay will fill
-            it up as needed. */
-         w->subwindow_instance_cache =
-           make_lisp_hash_table (30,
-                                 HASH_TABLE_KEY_VALUE_WEAK,
-                                 HASH_TABLE_EQUAL);
+         /* When we restore a window's configuration, the identity of
+            the window hasn't actually changed - so there is no
+            reason why we shouldn't preserve the instance cache for
+            it - unless it was originally deleted. This will often
+            buy us something as we will not have to re-instantiate
+            all the instances. This is because this is an instance
+            cache - not a display cache. Preserving the display cache
+            would definitely be wrong.
+
+            We specifically want to do this for tabs, since for some
+            reason finding a file will cause the configuration to be
+            set. */
+         if (NILP (w->subwindow_instance_cache))
+           w->subwindow_instance_cache =
+             make_lisp_hash_table (30,
+                                   HASH_TABLE_KEY_VALUE_WEAK,
+                                   HASH_TABLE_EQ);
          SET_LAST_MODIFIED (w, 1);
          SET_LAST_FACECHANGE (w);
          w->config_mark = 0;
 
+         /* #### Consider making the instance cache a winslot. */
 #define WINDOW_SLOT(slot, compare) w->slot = p->slot
 #include "winslots.h"
 
@@ -5751,7 +5757,7 @@ its value is -not- saved.
   config->frame_height = FRAME_HEIGHT (f); */
   /* When using `push-window-configuration', often the minibuffer ends
      up as the selected window because functions run as the result of
-     user interaction e.g. hyper-apropros. It seems to me the sensible
+     user interaction e.g. hyper-apropos. It seems to me the sensible
      thing to do is not record the minibuffer here. */
   if (FRAME_MINIBUF_ONLY_P (f) || minibuf_level)
     config->current_window = FRAME_SELECTED_WINDOW (f);
@@ -5868,7 +5874,7 @@ a non-nil result to be returned.
     }
   else
     {
-      /* optimised case */
+      /* optimized case */
       dl = Dynarr_atp (dla, y);
       db = get_display_block_from_line (dl, TEXT);
 
@@ -6073,6 +6079,7 @@ The function is called with one argument, the buffer to be displayed.
 Used by `with-output-to-temp-buffer'.
 If this function is used, then it must do the entire job of showing
 the buffer; `temp-buffer-show-hook' is not run unless this function runs it.
+\(`temp-buffer-show-hook' is obsolete.  Do not use in new code.)
 */ );
   Vtemp_buffer_show_function = Qnil;
 
index c97390f..53f7aee 100644 (file)
@@ -57,7 +57,7 @@ Boston, MA 02111-1307, USA.  */
   WINDOW_SLOT (vertical_divider_shadow_thickness, EQ);
   /* Divider surface width (not counting 3-d borders) */
   WINDOW_SLOT (vertical_divider_line_width, EQ);
-  /* Spacing between outer egde of divider border and window edge */
+  /* Spacing between outer edge of divider border and window edge */
   WINDOW_SLOT (vertical_divider_spacing, EQ);
   /* Whether vertical dividers are always displayed */
   WINDOW_SLOT (vertical_divider_always_visible_p, EQ);
index b86d41a..e435bb2 100644 (file)
@@ -1,3 +1,32 @@
+2000-10-04  Martin Buchholz <martin@xemacs.org>
+
+       * XEmacs 21.2.36 is released.
+
+2000-09-27  Martin Buchholz  <martin@xemacs.org>
+
+       * automated/lisp-tests.el: Add `current-time' test.
+
+2000-09-16  Martin Buchholz  <martin@xemacs.org>
+
+       * automated/mule-tests.el: Add ucs tests.
+
+       * DLL/dltest.c: Remove reference to obsolete emacsfns.h
+
+2000-08-03  Yoshiki Hayashi  <yoshiki@xemacs.org>
+
+       * automated/lisp-test.el: Check matching \\= against string
+       doesn't crash XEmacs.
+       From: Markus Linnala <maage@cs.tut.fi>
+
+2000-07-26  Andy Piper  <andy@xemacs.org>
+
+       * glyph-test.el: fix for new glyph instantiation mechanism.
+
+2000-07-31  Martin Buchholz  <martin@xemacs.org>
+
+       * automated/hash-table-tests.el:
+       Fix up test suite to comply with new hash table weakness API.
+
 2000-07-19  Martin Buchholz <martin@xemacs.org>
 
        * XEmacs 21.2.35 is released.
index d449a71..8f2c71d 100644 (file)
@@ -7,7 +7,6 @@ gcc -shared -fPIC -Demacs -DHAVE_CONFIG_H -I. \
 
 # include <config.h>
 # include "lisp.h"
-# include "emacsfns.h"
 
 Lisp_Object Qdltest_counter;
 
index 0c7247e..8aba946 100644 (file)
@@ -41,7 +41,7 @@
   (dolist (size '(0 1 100))
     (dolist (rehash-size '(1.1 9.9))
       (dolist (rehash-threshold '(0.2 .9))
-       (dolist (weakness '(nil t key value))
+       (dolist (weakness '(nil key value key-or-value key-and-value))
          (dolist (data '(() (1 2) (1 2 3 4)))
            (let ((ht (make-hash-table
                       :test test
              (Assert (eq weakness (hash-table-weakness ht))))))))))
 
 (loop for (fun weakness) in '((make-hashtable nil)
-                             (make-weak-hashtable t)
+                             (make-weak-hashtable key-and-value)
                              (make-key-weak-hashtable key)
                              (make-value-weak-hashtable value))
   do (Assert (eq weakness (hash-table-weakness (funcall fun 10)))))
 
 (loop for (type weakness) in '((non-weak nil)
-                              (weak t)
+                              (weak key-and-value)
                               (key-weak key)
                               (value-weak value))
   do (Assert (equal (make-hash-table :type type)
index 9bf5ebb..66c9272 100644 (file)
 (Assert (equal (split-string "foo,,bar" ",+") '("foo" "bar")))
 (Assert (equal (split-string ",foo,,bar," ",+") '("" "foo" "bar" "")))
 
+(Assert (not (string-match "\\(\\.\\=\\)" ".")))
+
 ;;-----------------------------------------------------
 ;; Test near-text buffer functions.
 ;;-----------------------------------------------------
 (Check-Error 'wrong-type-argument (subseq 3 2))
 (Check-Error 'args-out-of-range (subseq [1 2 3] -42))
 (Check-Error 'args-out-of-range (subseq [1 2 3] 0 42))
+
+;;-----------------------------------------------------
+;; Time-related tests
+;;-----------------------------------------------------
+(Assert (= (length (current-time-string)) 24))
index eb2317c..6348a51 100644 (file)
@@ -313,4 +313,16 @@ the Assert macro checks for correctness."
 
   ;; Add many more file operation tests here...
 
+  ;;---------------------------------------------------------------
+  ;; Test Unicode-related functions
+  ;;---------------------------------------------------------------
+  (let* ((scaron (make-char 'latin-iso8859-2 57)))
+    (loop for code in '(#x0000 #x2222 #x4444 #xffff) do
+      (progn
+       (set-ucs-char code scaron)
+       (Assert (eq scaron (ucs-char code)))))
+  
+    (Assert (eq nil (set-ucs-char #x1ffff scaron)))
+    (Check-Error wrong-type-argument (set-ucs-char -10000 scaron)))
+  
   )
index b5d1727..aec1b7c 100644 (file)
@@ -1,6 +1,6 @@
 (set-extent-begin-glyph 
  (make-extent (point) (point))
- (setq im (make-glyph [xpm :file "xemacs-icon.xpm"])))
+ (setq im (make-glyph [xbm :file "xemacsicon.xbm"])))
 
 (set-extent-begin-glyph 
  (make-extent (point) (point))
 (setq ok-select nil)
 (set-extent-begin-glyph 
  (make-extent (point) (point))
- (setq radio-button1 
-       (make-glyph 
+ (make-glyph 
+  (setq radio-button1 
        [button :face widget
                :descriptor ["ok1" (setq ok-select t)
                             :style radio :selected ok-select]])))
 ;; button in a group
 (set-extent-begin-glyph 
  (make-extent (point) (point))
- (setq radio-button2
-       (make-glyph
-`      [button :descriptor ["ok2" (setq ok-select nil) :style radio 
+ (make-glyph 
+  (setq radio-button2
+       [button :descriptor ["ok2" (setq ok-select nil) :style radio 
                             :selected (not ok-select)]])))
 ;; toggle button
 (set-extent-begin-glyph 
                                        :selected (not ok-select)]])))
 (set-extent-begin-glyph 
  (make-extent (point) (point))
- (setq toggle-button
-       (make-glyph [button :descriptor ["ok4" :style toggle 
-                                       :callback 
-                                       (setq ok-select (not ok-select))
-                                       :selected ok-select]])))
+ (make-glyph 
+  (setq toggle-button
+       [button :descriptor ["ok4" :style toggle 
+                            :callback 
+                            (setq ok-select (not ok-select))
+                            :selected ok-select]])))
 
 ;; normal pushbutton
 (set-extent-begin-glyph 
  (setq tree (make-glyph 
             [tree-view :width 10
                        :descriptor "My Tree"
-                       :properties (:items (["One" foo]
-                                            (["Two" foo]
-                                             ["Four" foo]
-                                             "Six")
-                                            "Three"))])))
+                       :items (["One" foo]
+                               (["Two" foo]
+                                ["Four" foo]
+                                "Six")
+                               "Three")])))
 
 ;; tab control
 (set-extent-begin-glyph 
            [tab-control :descriptor "My Tab"
                         :face highlight
                         :orientation right
-                        :properties (:items (["One" foo :selected t]
-                                             ["Two" fee :selected nil]
-                                             ["Three" foo :selected nil]))])))
+                        :items (["One" foo :selected t]
+                                ["Two" fee :selected nil]
+                                ["Three" foo :selected nil])])))
 
 ;; progress gauge
 (set-extent-begin-glyph 
  (make-extent (point) (point))
  (setq pgauge (make-glyph 
-              [progress-gauge :width 10 :height 2 
+              [progress-gauge :width 10 :height 2 :value 0
                               :descriptor "ok"])))
 ;; progress the progress ...
 (let ((x 0))
   (while (<= x 100)
-    (set-image-instance-property (glyph-image-instance pgauge) :value x)
+    (set-glyph-image pgauge `[progress-gauge :width 10 :height 2
+                                            :descriptor "ok" :value ,x])
     (setq x (+ x 5))
     (sit-for 0.1)))
 
@@ -96,7 +98,9 @@
 ;; progress the progress ...
 (let ((x 0))
   (while (<= x 100)
-    (set-image-instance-property (glyph-image-instance pg) :value x)
+    (set-glyph-image pg
+                    `[progress-gauge :width 5 :pixel-height 16
+                                     :descriptor "ok" :value ,x])
     (setq x (+ x 5))
     (sit-for 0.1)))
 
 ;; edit box
 (set-extent-begin-glyph 
  (make-extent (point) (point)) 
- (setq edit-field (make-glyph [edit-field :pixel-width 50 :pixel-height 30
+ (make-glyph (setq edit-field [edit-field :pixel-width 50 :pixel-height 30
                                          :face bold-italic
                                          :descriptor ["Hello"]])))
 ;; combo box
 (set-extent-begin-glyph 
  (make-extent (point) (point))
- (setq combo-box (make-glyph
-                 [combo-box :width 10 :descriptor ["Hello"] 
-                            :properties (:items ("One" "Two" "Three"))])))
+ (make-glyph (setq combo-box
+                  [combo-box :width 10 :descriptor ["Hello"] 
+                             :items ("One" "Two" "Three")])))
 
 ;; label
 (set-extent-begin-glyph 
  (make-extent (point) (point))
- (setq label (make-glyph [label :pixel-width 150 :descriptor "Hello"])))
+ (make-glyph (setq label [label :pixel-width 150 :descriptor "Hello"])))
 
 ;; string
 (set-extent-begin-glyph 
  (make-extent (point) (point))
- (setq str (make-glyph [string :data "Hello There"])))
+ (make-glyph 
+  (setq str
+       [string :data "Hello There"])))
 
 ;; scrollbar
 ;(set-extent-begin-glyph 
 ;; layout
 (setq layout 
       (make-glyph
-       [layout :descriptor "The Layout"
-              :orientation vertical
-              :justify left
-              :border [string :data "Hello There Mrs"]
-              :items ([native-layout :orientation horizontal
-                                     :items (radio-button1 radio-button2)]
-                      edit-field toggle-button label str)]))
-(set-glyph-face layout 'gui-element)
+       `[layout :descriptor "The Layout"
+               :orientation vertical
+               :justify left
+               :border [string :data "Hello There Mrs"]
+               :items ([layout :orientation horizontal
+                               :items (,radio-button1 ,radio-button2)]
+                       ,edit-field ,toggle-button ,label ,str)]))
+;(set-glyph-face layout 'gui-element)
 (set-extent-begin-glyph
  (make-extent (point) (point)) layout)
 
+;; another test layout
+(set-extent-begin-glyph
+ (make-extent (point) (point)) 
+ (setq layout-2
+       (make-glyph `[layout :descriptor "The Layout"
+                           :orientation vertical
+                           :items ([progress-gauge :value 0 :width 10 :height 2
+                                                   :descriptor "ok"])])))
+
+(set-glyph-image layout-2 `[layout :descriptor "The Layout"
+                                  :orientation vertical
+                                  :items ([progress-gauge :value 4 :width 10 :height 2
+                                                          :descriptor "ok"])])
 (setq test-toggle-widget nil)
        
 (defun test-toggle (widget)
index 27b6d07..c73b09f 100644 (file)
 
 (set-specifier bottom-gutter-height 'autodetect)
 (set-specifier bottom-gutter-border-width 2)
-(set-gutter-element bottom-gutter 'str str)
+
+(set-gutter-element 
+ bottom-gutter 'str
+ (make-glyph 
+  [layout :orientation vertical 
+         :justify left :margin-width 4 
+         :items ([string :data "Fontifying glyphs.c..."]
+                 [layout :orientation horizontal 
+                         :items 
+                         ([progress-gauge :value 0 :pixel-height 24
+                                          :pixel-width 250 :descriptor 
+                                          "Progress"]
+                          [button :pixel-height 24
+                                  :descriptor " Stop " 
+                                  :callback (quote quit)])])]))
+
 (set-gutter-element bottom-gutter 'str2 str2)
 (set-gutter-element-visible-p bottom-gutter-visible-p 'str t)
 (set-gutter-element-visible-p bottom-gutter-visible-p 'str2 t)
+
index e616054..05e3746 100644 (file)
@@ -2,8 +2,8 @@
 emacs_is_beta=t
 emacs_major_version=21
 emacs_minor_version=2
-emacs_beta_version=35
-xemacs_codename="Nike"
+emacs_beta_version=36
+xemacs_codename="Notus"
 infodock_major_version=4
 infodock_minor_version=0
 infodock_build_version=8