This commit was generated by cvs2svn to compensate for changes in r1130,
authortomo <tomo>
Wed, 19 Jan 2000 08:37:29 +0000 (08:37 +0000)
committertomo <tomo>
Wed, 19 Jan 2000 08:37:29 +0000 (08:37 +0000)
which included commits to RCS files with non-trunk default branches.

103 files changed:
README.packages
config.guess
config.sub
configure.usage
etc/NEWS
etc/TUTORIAL.de
lib-src/ChangeLog
lib-src/Makefile.in.in
lib-src/b2m.c
lib-src/cvtmail.c
lib-src/digest-doc.c
lib-src/ellcc.c
lib-src/etags.c
lib-src/fakemail.c
lib-src/getopt.c
lib-src/getopt1.c
lib-src/gnuserv.h
lib-src/hexl.c
lib-src/make-docfile.c
lib-src/make-path.c
lib-src/movemail.c
lib-src/ootags.c
lib-src/pop.c
lib-src/profile.c
lib-src/sorted-doc.c
lib-src/wakeup.c
lib-src/yow.c
lisp/about.el
lisp/autoload.el
lisp/cus-edit.el
lisp/hyper-apropos.el
lisp/info.el
lisp/menubar-items.el
lisp/minibuf.el
lisp/modeline.el
lisp/mule/mule-misc.el
lisp/process.el
lwlib/ChangeLog
lwlib/config.h.in
lwlib/lwlib-Xaw.c
lwlib/lwlib-Xlw.c
lwlib/lwlib-Xm.c
lwlib/lwlib.c
man/ChangeLog
man/info.texi
man/internals/internals.texi
man/lispref/control.texi
man/lispref/debugging.texi
man/new-users-guide/new-users-guide.texi
man/xemacs-faq.texi
man/xemacs/custom.texi
man/xemacs/mini.texi
man/xemacs/regs.texi
man/xemacs/xemacs.texi
nt/ChangeLog
nt/config.h
nt/minitar.c
nt/xemacs.mak
src/Makefile.in.in
src/bytecode.c
src/console-tty.c
src/elhash.c
src/eval.c
src/event-Xt.c
src/event-msw.c
src/events.c
src/extents.c
src/extents.h
src/frame.h
src/glyphs-msw.c
src/glyphs-widget.c
src/glyphs-x.c
src/glyphs.h
src/gpmevent.c
src/gui.c
src/input-method-motif.c
src/keymap.c
src/libsst.c
src/md5.c
src/menubar-x.c
src/menubar.c
src/ntheap.c
src/print.c
src/s/aix3-2.h
src/s/cygwin32.h
src/s/windowsnt.h
src/scrollbar.c
src/specifier.h
src/sysdep.c
src/sysfile.h
src/termcap.c
src/toolbar.c
src/unexaix.c
src/unexalpha.c
src/unexec.c
src/unexfreebsd.c
src/unexhp9k3.c
src/unexmips.c
src/window.c
src/window.h
tests/ChangeLog
tests/glyph-test.el
version.sh

index dbbc6c5..d618862 100644 (file)
@@ -9,8 +9,10 @@ Real Real Quickstart FAQ
 ------------------------
 
 Q. Do I need to have the packages to compile XEmacs?
-A. If you want to compile with MULE, you need the mule-base package installed.
-   Otherwise, no package is required before compilation.
+A. No, XEmacs will build and install just fine without any packages
+   installed.  However, only the most basic editing functions will be
+   available with no packages installed, so installing packages is an
+   essential part of making your installed XEmacs _useful_.
 
 Q. I really liked the old way that packages were bundled and do not
    want to mess with packages at all.
@@ -20,11 +22,11 @@ A. You can grab all the packages at once like you used to with old
 A note of caution
 -----------------
 
-The XEmacs package system is still in its infancy. Please expect a few 
-minor hurdles on the way. Also neither the interface nor the structure is 
+The XEmacs package system is still in its infancy. Please expect a few
+minor hurdles on the way. Also neither the interface nor the structure is
 set in stone. The XEmacs maintainers reserve the right to sacrifice
 backwards compatibility as quirks are worked out over the coming
-releases. 
+releases.
 
 Some Package Theory
 -------------------
@@ -35,7 +37,7 @@ have been unbundled. They have been replaced by the package system.
 Each elisp add-on (or groups of them when they are small) now comes
 in its own tarball that contains a small search hierarchy.
 
-You select just the ones you need. Install them by untarring them into 
+You select just the ones you need. Install them by untarring them into
 the right place. On startup XEmacs will find them, set up the load
 path correctly, install autoloads, etc, etc.
 
@@ -60,7 +62,7 @@ Where to get the packages
 -------------------------
 
 Packages are available from ftp://ftp.xemacs.org/pub/xemacs/packages
-and its mirror.
+and its mirrors.
 
 How to install the packages
 ---------------------------
@@ -73,14 +75,14 @@ The Sumo Tarball
 ----------------
 
 Those with little time, cheap connections and plenty of disk space can
-install all packages at once using the sumo tarballs.
+install all the packages at once using the sumo tarballs.
 Download the file
 
-xemacs-sumo-<date>.tar.gz 
+xemacs-sumo.tar.gz
 
 For an XEmacs compiled with Mule you also need
 
-xemacs-mule-sumo-<date>.tar.gz
+xemacs-mule-sumo.tar.gz
 
 N.B. They are called 'Sumo Tarballs' for good reason. They are
 currently about 15MB and 2.3MB (gzipped) respectively.
@@ -120,8 +122,8 @@ XEmacs comes with some tools to make the periodic updating and
 installing easier. It will notice if new packages or versions are
 available and will fetch them from the ftp site.
 
-Unfortunately this requires that a few packages are already in place. 
-You will have to install them by hand as above or use a SUMO tarball. 
+Unfortunately this requires that a few packages are already in place.
+You will have to install them by hand as above or use a SUMO tarball.
 This requirement will hopefully go away in the future. The packages
 you need are:
 
@@ -132,7 +134,7 @@ and optionally:
 
    mailcrypt    - If you have PGP installed and want to verify the
                   signature of the index file.
-   mule-base    - Needed if you want to compile XEmacs with MULE.
+   mule-base    - Needed if you want to use XEmacs with MULE.
 
 After installing these by hand, you can start XEmacs. (It is a good
 idea to use 'xemacs -vanilla' here as your startup files might need
@@ -164,7 +166,7 @@ things now moved to packages.)
 -  When you are finished choosing packages, invoke
    'Packages->Install/Remove Select' from the menu or type 'x' to
    begin installing packages.
-    
+
 After Installation
 ------------------
 
@@ -173,7 +175,7 @@ New packages can only be used by XEmacs after a restart.
 Note to MULE users
 ------------------
 
-Unlike all other packages the mule-base package is used at build/dump 
+Unlike all other packages the mule-base package is used at build/dump
 time. This means that you need this available before compiling XEmacs
 with MULE. Also it is a good idea to keep packages that are
 MULE-only separate by putting them in the mule-packages hierarchy.
@@ -200,7 +202,7 @@ Upgrading/Removing Packages
 ---------------------------
 
 As the exact files and their locations contained in a package may
-change it is recommend to remove a package first before installing a
+change it is recommended to remove a package first before installing a
 new version. In order to facilitate removal each package contains an
 pgkinfo/MANIFEST.pkgname file which list all the files belong to the
 package. M-x package-admin-delete-binary-package RET can be used to
@@ -230,7 +232,7 @@ Finding the right packages
 
 If you want to find out which package contains the functionality you
 are looking for, use M-x package-get-package-provider, and give it a
-symbol that is likely to be in that package.  eg, if some code you
-want to use has a (require 'thingatpt) in it, try doing
+symbol that is likely to be in that package.  For example, if some
+code you want to use has a (require 'thingatpt) in it, try doing
 M-x package-get-package-provider RET thingatpt , which will return
 something like: (fsf-compat "1.06").
index 7f2ead9..e1b5871 100755 (executable)
@@ -1,6 +1,7 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999
+#   Free Software Foundation, Inc.
 #
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -23,6 +24,7 @@
 
 # Written by Per Bothner <bothner@cygnus.com>.
 # The master version of this file is at the FSF in /home/gd/gnu/lib.
+# Please send patches to <autoconf-patches@gnu.org>.
 #
 # This script attempts to guess a canonical system name similar to
 # config.sub.  If it succeeds, it prints the system name on stdout, and
 # (but try to keep the structure clean).
 #
 
+# Use $HOST_CC if defined. $CC may point to a cross-compiler
+if test x"$CC_FOR_BUILD" = x; then
+  if test x"$HOST_CC" != x; then
+    CC_FOR_BUILD="$HOST_CC"
+  else
+    if test x"$CC" != x; then
+      CC_FOR_BUILD="$CC"
+    else
+      CC_FOR_BUILD=cc
+    fi
+  fi
+fi
+
+
 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
 # (ghazi@noc.rutgers.edu 8/24/94.)
 if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
@@ -46,7 +62,8 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
 UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
-trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
+dummy=dummy-$$
+trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15
 
 # Note: order is significant - the case branches are not exclusive.
 
@@ -59,7 +76,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        # A Tn.n version is a released field test version.
        # A Xn.n version is an unreleased experimental baselevel.
        # 1.2 uses "1.2" for uname -r.
-       cat <<EOF >dummy.s
+       cat <<EOF >$dummy.s
        .globl main
        .ent main
 main:
@@ -76,9 +93,9 @@ main:
        ret \$31,(\$26),1
        .end main
 EOF
-       ${CC-cc} dummy.s -o dummy 2>/dev/null
+       $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
        if test "$?" = 0 ; then
-               ./dummy
+               ./$dummy
                case "$?" in
                        7)
                                UNAME_MACHINE="alpha"
@@ -97,8 +114,14 @@ EOF
                                ;;
                esac
        fi
-       rm -f dummy.s dummy
-       echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]`
+       rm -f $dummy.s $dummy
+       echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+       exit 0 ;;
+    Alpha\ *:Windows_NT*:*)
+       # How do we know it's Interix rather than the generic POSIX subsystem?
+       # Should we change UNAME_MACHINE based on the output of uname instead
+       # of the specific Alpha model?
+       echo alpha-pc-interix
        exit 0 ;;
     21064:Windows_NT:50:3)
        echo alpha-dec-winnt3.5
@@ -133,6 +156,9 @@ EOF
     wgrisc:OpenBSD:*:*)
        echo mipsel-unknown-openbsd${UNAME_RELEASE}
        exit 0 ;;
+    *:OS/390:*:*)
+       echo i370-ibm-openedition
+       exit 0 ;;
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
        echo arm-acorn-riscix${UNAME_RELEASE}
        exit 0;;
@@ -142,7 +168,7 @@ EOF
     SR2?01:HI-UX/MPP:*:*)
        echo hppa1.1-hitachi-hiuxmpp
        exit 0;;
-    Pyramid*:OSx*:*:*|MIS*:OSx*:*:*|MIS*:SMP_DC-OSx*:*:*)
+    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
        # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
        if test "`(/bin/universe) 2>/dev/null`" = att ; then
                echo pyramid-pyramid-sysv3
@@ -150,7 +176,7 @@ EOF
                echo pyramid-pyramid-bsd
        fi
        exit 0 ;;
-    NILE:*:*:dcosx)
+    NILE*:*:*:dcosx)
        echo pyramid-pyramid-svr4
        exit 0 ;;
     sun4H:SunOS:5.*:*)
@@ -201,6 +227,32 @@ EOF
     atari*:OpenBSD:*:*)
        echo m68k-unknown-openbsd${UNAME_RELEASE}
        exit 0 ;;
+    # The situation for MiNT is a little confusing.  The machine name
+    # can be virtually everything (everything which is not
+    # "atarist" or "atariste" at least should have a processor 
+    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
+    # to the lowercase version "mint" (or "freemint").  Finally
+    # the system name "TOS" denotes a system which is actually not
+    # MiNT.  But MiNT is downward compatible to TOS, so this should
+    # be no problem.
+    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+        echo m68k-atari-mint${UNAME_RELEASE}
+       exit 0 ;;
+    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+       echo m68k-atari-mint${UNAME_RELEASE}
+        exit 0 ;;
+    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+        echo m68k-atari-mint${UNAME_RELEASE}
+       exit 0 ;;
+    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+        echo m68k-milan-mint${UNAME_RELEASE}
+        exit 0 ;;
+    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+        echo m68k-hades-mint${UNAME_RELEASE}
+        exit 0 ;;
+    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+        echo m68k-unknown-mint${UNAME_RELEASE}
+        exit 0 ;;
     sun3*:NetBSD:*:*)
        echo m68k-sun-netbsd${UNAME_RELEASE}
        exit 0 ;;
@@ -234,12 +286,16 @@ EOF
     VAX*:ULTRIX*:*:*)
        echo vax-dec-ultrix${UNAME_RELEASE}
        exit 0 ;;
-    2020:CLIX:*:*)
+    2020:CLIX:*:* | 2430:CLIX:*:*)
        echo clipper-intergraph-clix${UNAME_RELEASE}
        exit 0 ;;
     mips:*:*:UMIPS | mips:*:*:RISCos)
-       sed 's/^        //' << EOF >dummy.c
-       int main (argc, argv) int argc; char **argv; {
+       sed 's/^        //' << EOF >$dummy.c
+#ifdef __cplusplus
+       int main (int argc, char *argv[]) {
+#else
+       int main (argc, argv) int argc; char *argv[]; {
+#endif
        #if defined (host_mips) && defined (MIPSEB)
        #if defined (SYSTYPE_SYSV)
          printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
@@ -254,10 +310,10 @@ EOF
          exit (-1);
        }
 EOF
-       ${CC-cc} dummy.c -o dummy \
-         && ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
-         && rm dummy.c dummy && exit 0
-       rm -f dummy.c dummy
+       $CC_FOR_BUILD $dummy.c -o $dummy \
+         && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+         && rm $dummy.c $dummy && exit 0
+       rm -f $dummy.c $dummy
        echo mips-mips-riscos${UNAME_RELEASE}
        exit 0 ;;
     Night_Hawk:Power_UNIX:*:*)
@@ -275,15 +331,18 @@ EOF
     AViiON:dgux:*:*)
         # DG/UX returns AViiON for all architectures
         UNAME_PROCESSOR=`/usr/bin/uname -p`
-        if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
-       if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
-            -o ${TARGET_BINARY_INTERFACE}x = x ] ; then
+       if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110]
+       then
+           if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+              [ ${TARGET_BINARY_INTERFACE}x = x ]
+           then
                echo m88k-dg-dgux${UNAME_RELEASE}
-       else
+           else
                echo m88k-dg-dguxbcs${UNAME_RELEASE}
+           fi
+       else
+           echo i586-dg-dgux${UNAME_RELEASE}
        fi
-        else echo i586-dg-dgux${UNAME_RELEASE}
-        fi
        exit 0 ;;
     M88*:DolphinOS:*:*)        # DolphinOS (SVR3)
        echo m88k-dolphin-sysv3
@@ -309,7 +368,7 @@ EOF
        exit 0 ;;
     *:AIX:2:3)
        if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
-               sed 's/^                //' << EOF >dummy.c
+               sed 's/^                //' << EOF >$dummy.c
                #include <sys/systemcfg.h>
 
                main()
@@ -320,8 +379,8 @@ EOF
                        exit(0);
                        }
 EOF
-               ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
-               rm -f dummy.c dummy
+               $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
+               rm -f $dummy.c $dummy
                echo rs6000-ibm-aix3.2.5
        elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
                echo rs6000-ibm-aix3.2.4
@@ -369,24 +428,24 @@ EOF
            9000/31? )            HP_ARCH=m68000 ;;
            9000/[34]?? )         HP_ARCH=m68k ;;
            9000/[678][0-9][0-9])
-              sed 's/^              //' << EOF >dummy.c
+              sed 's/^              //' << EOF >$dummy.c
               #include <stdlib.h>
               #include <unistd.h>
-              
+
               int main ()
               {
               #if defined(_SC_KERNEL_BITS)
                   long bits = sysconf(_SC_KERNEL_BITS);
-              #endif 
+              #endif
                   long cpu  = sysconf (_SC_CPU_VERSION);
-              
-                  switch (cpu) 
+
+                  switch (cpu)
                {
                case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
                case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
-               case CPU_PA_RISC2_0: 
+               case CPU_PA_RISC2_0:
               #if defined(_SC_KERNEL_BITS)
-                   switch (bits) 
+                   switch (bits)
                        {
                        case 64: puts ("hppa2.0w"); break;
                        case 32: puts ("hppa2.0n"); break;
@@ -394,20 +453,20 @@ EOF
                        } break;
               #else  /* !defined(_SC_KERNEL_BITS) */
                    puts ("hppa2.0"); break;
-              #endif 
+              #endif
                default: puts ("hppa1.0"); break;
                }
                   exit (0);
               }
 EOF
-       ${CC-cc} dummy.c -o dummy && HP_ARCH=`./dummy`
-       rm -f dummy.c dummy
+       (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
+       rm -f $dummy.c $dummy
        esac
        HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
        echo ${HP_ARCH}-hp-hpux${HPUX_REV}
        exit 0 ;;
     3050*:HI-UX:*:*)
-       sed 's/^        //' << EOF >dummy.c
+       sed 's/^        //' << EOF >$dummy.c
        #include <unistd.h>
        int
        main ()
@@ -432,8 +491,8 @@ EOF
          exit (0);
        }
 EOF
-       ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
-       rm -f dummy.c dummy
+       $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
+       rm -f $dummy.c $dummy
        echo unknown-hitachi-hiuxwe2
        exit 0 ;;
     9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
@@ -442,6 +501,9 @@ EOF
     9000/8??:4.3bsd:*:*)
        echo hppa1.0-hp-bsd
        exit 0 ;;
+    *9??*:MPE/iX:*:*)
+       echo hppa1.0-hp-mpeix
+       exit 0 ;;
     hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
        echo hppa1.1-hp-osf
        exit 0 ;;
@@ -458,6 +520,9 @@ EOF
     parisc*:Lites*:*:*)
        echo hppa1.1-hp-lites
        exit 0 ;;
+    hppa*:OpenBSD:*:*)
+       echo hppa-unknown-openbsd
+       exit 0 ;;
     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
        echo c1-convex-bsd
         exit 0 ;;
@@ -490,11 +555,14 @@ EOF
     CRAY*TS:*:*:*)
        echo t90-cray-unicos${UNAME_RELEASE}
        exit 0 ;;
+    CRAY*T3E:*:*:*)
+       echo alpha-cray-unicosmk${UNAME_RELEASE}
+       exit 0 ;;
     CRAY-2:*:*:*)
        echo cray2-cray-unicos
         exit 0 ;;
     F300:UNIX_System_V:*:*)
-        FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'`
+        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
         FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
         echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
         exit 0 ;;
@@ -507,29 +575,47 @@ EOF
     hp300:OpenBSD:*:*)
        echo m68k-unknown-openbsd${UNAME_RELEASE}
        exit 0 ;;
+    i?86:BSD/386:*:* | i?86:BSD/OS:*:*)
+       echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+       exit 0 ;;
     sparc*:BSD/OS:*:*)
        echo sparc-unknown-bsdi${UNAME_RELEASE}
        exit 0 ;;
-    i?86:BSD/386:*:* | *:BSD/OS:*:*)
-       echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+    *:BSD/OS:*:*)
+       echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
        exit 0 ;;
     *:FreeBSD:*:*)
+       if test -x /usr/bin/objformat; then
+           if test "elf" = "`/usr/bin/objformat`"; then
+               echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'`
+               exit 0
+           fi
+       fi
        echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
        exit 0 ;;
     *:NetBSD:*:*)
-       echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+       echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'`
        exit 0 ;;
     *:OpenBSD:*:*)
        echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
        exit 0 ;;
     i*:CYGWIN*:*)
-       echo ${UNAME_MACHINE}-pc-cygwin32
+       echo ${UNAME_MACHINE}-pc-cygwin
        exit 0 ;;
     i*:MINGW*:*)
        echo ${UNAME_MACHINE}-pc-mingw32
        exit 0 ;;
+    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+       # How do we know it's Interix rather than the generic POSIX subsystem?
+       # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+       # UNAME_MACHINE based on the output of uname instead of i386?
+       echo i386-pc-interix
+       exit 0 ;;
+    i*:UWIN*:*)
+       echo ${UNAME_MACHINE}-pc-uwin
+       exit 0 ;;
     p*:CYGWIN*:*)
-       echo powerpcle-unknown-cygwin32
+       echo powerpcle-unknown-cygwin
        exit 0 ;;
     prep*:SunOS:5.*:*)
        echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
@@ -538,15 +624,11 @@ EOF
        echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
        exit 0 ;;
     *:Linux:*:*)
-       # uname on the ARM produces all sorts of strangeness, and we need to
-       # filter it out.
-       case "$UNAME_MACHINE" in
-         arm* | sa110*)              UNAME_MACHINE="arm" ;;
-       esac
 
        # The BFD linker knows what the default object file format is, so
-       # first see if it will tell us.
-       ld_help_string=`ld --help 2>&1`
+       # first see if it will tell us. cd to the root directory to prevent
+       # problems with other programs or directories called `ld' in the path.
+       ld_help_string=`cd /; ld --help 2>&1`
        ld_supported_emulations=`echo $ld_help_string \
                         | sed -ne '/supported emulations:/!d
                                    s/[         ][      ]*/ /g
@@ -554,16 +636,74 @@ EOF
                                    s/ .*//
                                    p'`
         case "$ld_supported_emulations" in
-         i?86linux)  echo "${UNAME_MACHINE}-pc-linux-gnuaout"      ; exit 0 ;;
-         i?86coff)   echo "${UNAME_MACHINE}-pc-linux-gnucoff"      ; exit 0 ;;
-         sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
-         armlinux)   echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
-         m68klinux)  echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
-         elf32ppc)   echo "powerpc-unknown-linux-gnu"              ; exit 0 ;;
+         *ia64)
+               echo "${UNAME_MACHINE}-unknown-linux"
+               exit 0
+               ;;
+         i?86linux)
+               echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+               exit 0
+               ;;
+         i?86coff)
+               echo "${UNAME_MACHINE}-pc-linux-gnucoff"
+               exit 0
+               ;;
+         sparclinux)
+               echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
+               exit 0
+               ;;
+         armlinux)
+               echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
+               exit 0
+               ;;
+         elf32arm*)
+               echo "${UNAME_MACHINE}-unknown-linux-gnu"
+               exit 0
+               ;;
+         armelf_linux*)
+               echo "${UNAME_MACHINE}-unknown-linux-gnu"
+               exit 0
+               ;;
+         m68klinux)
+               echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
+               exit 0
+               ;;
+         elf32ppc)
+               # Determine Lib Version
+               cat >$dummy.c <<EOF
+#include <features.h>
+#if defined(__GLIBC__)
+extern char __libc_version[];
+extern char __libc_release[];
+#endif
+main(argc, argv)
+     int argc;
+     char *argv[];
+{
+#if defined(__GLIBC__)
+  printf("%s %s\n", __libc_version, __libc_release);
+#else
+  printf("unkown\n");
+#endif
+  return 0;
+}
+EOF
+               LIBC=""
+               $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
+               if test "$?" = 0 ; then
+                       ./$dummy | grep 1\.99 > /dev/null
+                       if test "$?" = 0 ; then
+                               LIBC="libc1"
+                       fi
+               fi      
+               rm -f $dummy.c $dummy
+               echo powerpc-unknown-linux-gnu${LIBC}
+               exit 0
+               ;;
        esac
 
        if test "${UNAME_MACHINE}" = "alpha" ; then
-               sed 's/^        //'  <<EOF >dummy.s
+               sed 's/^        //'  <<EOF >$dummy.s
                .globl main
                .ent main
        main:
@@ -581,9 +721,9 @@ EOF
                .end main
 EOF
                LIBC=""
-               ${CC-cc} dummy.s -o dummy 2>/dev/null
+               $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
                if test "$?" = 0 ; then
-                       ./dummy
+                       ./$dummy
                        case "$?" in
                        7)
                                UNAME_MACHINE="alpha"
@@ -600,22 +740,23 @@ EOF
                        16)
                                UNAME_MACHINE="alphaev6"
                                ;;
-                       esac    
+                       esac
 
-                       objdump --private-headers dummy | \
+                       objdump --private-headers $dummy | \
                          grep ld.so.1 > /dev/null
                        if test "$?" = 0 ; then
                                LIBC="libc1"
                        fi
-               fi      
-               rm -f dummy.s dummy
+               fi
+               rm -f $dummy.s $dummy
                echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
        elif test "${UNAME_MACHINE}" = "mips" ; then
-         cat >dummy.c <<EOF
-main(argc, argv)
-     int argc;
-     char *argv[];
-{
+         cat >$dummy.c <<EOF
+#ifdef __cplusplus
+       int main (int argc, char *argv[]) {
+#else
+       int main (argc, argv) int argc; char *argv[]; {
+#endif
 #ifdef __MIPSEB__
   printf ("%s-unknown-linux-gnu\n", argv[1]);
 #endif
@@ -625,8 +766,8 @@ main(argc, argv)
   return 0;
 }
 EOF
-         ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
-         rm -f dummy.c dummy
+         $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
+         rm -f $dummy.c $dummy
        else
          # Either a pre-BFD a.out linker (linux-gnuoldld)
          # or one that does not give us useful --help.
@@ -645,12 +786,13 @@ EOF
            ;;
          esac
          # Determine whether the default compiler is a.out or elf
-         cat >dummy.c <<EOF
+         cat >$dummy.c <<EOF
 #include <features.h>
-main(argc, argv)
-     int argc;
-     char *argv[];
-{
+#ifdef __cplusplus
+       int main (int argc, char *argv[]) {
+#else
+       int main (argc, argv) int argc; char *argv[]; {
+#endif
 #ifdef __ELF__
 # ifdef __GLIBC__
 #  if __GLIBC__ >= 2
@@ -667,8 +809,8 @@ main(argc, argv)
   return 0;
 }
 EOF
-         ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
-         rm -f dummy.c dummy
+         $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
+         rm -f $dummy.c $dummy
        fi ;;
 # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.  earlier versions
 # are messed up and put the nodename in both sysname and nodename.
@@ -684,10 +826,20 @@ EOF
        echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
        exit 0 ;;
     i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
+       UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
        if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
-               echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
+               echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+       else
+               echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+       fi
+       exit 0 ;;
+    i?86:*:5:7*)
+        # Fixed at (any) Pentium or better
+        UNAME_MACHINE=i586
+        if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then
+           echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION}
        else
-               echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
+           echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
        fi
        exit 0 ;;
     i?86:*:3.2:*)
@@ -699,18 +851,15 @@ EOF
                (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
                (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
                        && UNAME_MACHINE=i586
+               (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
+                       && UNAME_MACHINE=i686
+               (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
+                       && UNAME_MACHINE=i686
                echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
        else
                echo ${UNAME_MACHINE}-pc-sysv32
        fi
        exit 0 ;;
-    i?86:UnixWare:*:*)
-       if /bin/uname -X 2>/dev/null >/dev/null ; then
-         (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
-           && UNAME_MACHINE=i586
-       fi
-       echo ${UNAME_MACHINE}-unixware-${UNAME_RELEASE}-${UNAME_VERSION}
-       exit 0 ;;
     pc:*:*:*)
         # uname -m prints for DJGPP always 'pc', but it prints nothing about
         # the processor, so we play safe by assuming i386.
@@ -752,7 +901,7 @@ EOF
     mc68030:UNIX_System_V:4.*:*)
        echo m68k-atari-sysv4
        exit 0 ;;
-    i?86:LynxOS:2.*:*)
+    i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*)
        echo i386-unknown-lynxos${UNAME_RELEASE}
        exit 0 ;;
     TSUNAMI:LynxOS:2.*:*)
@@ -764,6 +913,9 @@ EOF
     SM[BE]S:UNIX_SV:*:*)
        echo mips-dde-sysv${UNAME_RELEASE}
        exit 0 ;;
+    RM*:ReliantUNIX-*:*:*)
+       echo mips-sni-sysv4
+       exit 0 ;;
     RM*:SINIX-*:*:*)
        echo mips-sni-sysv4
        exit 0 ;;
@@ -794,7 +946,7 @@ EOF
     news*:NEWS-OS:*:6*)
        echo mips-sony-newsos6
        exit 0 ;;
-    R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R4000:UNIX_SV:*:*)
+    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
        if [ -d /usr/nec ]; then
                echo mips-nec-sysv${UNAME_RELEASE}
        else
@@ -810,12 +962,27 @@ EOF
     BePC:BeOS:*:*)     # BeOS running on Intel PC compatible.
        echo i586-pc-beos
        exit 0 ;;
+    SX-4:SUPER-UX:*:*)
+       echo sx4-nec-superux${UNAME_RELEASE}
+       exit 0 ;;
+    SX-5:SUPER-UX:*:*)
+       echo sx5-nec-superux${UNAME_RELEASE}
+       exit 0 ;;
+    Power*:Rhapsody:*:*)
+       echo powerpc-apple-rhapsody${UNAME_RELEASE}
+       exit 0 ;;
+    *:Rhapsody:*:*)
+       echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+       exit 0 ;;
+    *:QNX:*:4*)
+       echo i386-qnx-qnx${UNAME_VERSION}
+       exit 0 ;;
 esac
 
 #echo '(No uname command or uname output not recognized.)' 1>&2
 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
 
-cat >dummy.c <<EOF
+cat >$dummy.c <<EOF
 #ifdef _SEQUENT_
 # include <sys/types.h>
 # include <sys/utsname.h>
@@ -853,7 +1020,10 @@ main ()
 #endif
   int version;
   version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
-  printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+  if (version < 4)
+    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+  else
+    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
   exit (0);
 #endif
 
@@ -913,8 +1083,8 @@ main ()
 }
 EOF
 
-${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
-rm -f dummy.c dummy
+$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0
+rm -f $dummy.c $dummy
 
 # Apollos put the system type in the environment.
 
index f791166..28426bb 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Configuration validation subroutine script, version 1.1.
-#   Copyright (C) 1991, 92-97, 1998 Free Software Foundation, Inc.
+#   Copyright (C) 1991, 92-97, 1998, 1999 Free Software Foundation, Inc.
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
 # can handle that machine.  It does not imply ALL GNU software can.
@@ -98,11 +98,21 @@ case $os in
                os=
                basic_machine=$1
                ;;
+       -sim | -cisco | -oki | -wec | -winbond)
+               os=
+               basic_machine=$1
+               ;;
+       -scout)
+               ;;
+       -wrs)
+               os=-vxworks
+               basic_machine=$1
+               ;;
        -hiux*)
                os=-hiuxwe2
                ;;
        -sco5)
-               os=sco3.2v5
+               os=-sco3.2v5
                basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
                ;;
        -sco4)
@@ -121,6 +131,9 @@ case $os in
                os=-sco3.2v2
                basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
                ;;
+       -udk*)
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
        -isc)
                os=-isc2.2
                basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
@@ -143,22 +156,33 @@ case $os in
        -psos*)
                os=-psos
                ;;
+       -mint | -mint[0-9]*)
+               basic_machine=m68k-atari
+               os=-mint
+               ;;
 esac
 
 # Decode aliases for certain CPU-COMPANY combinations.
 case $basic_machine in
        # Recognize the basic CPU types without company name.
        # Some are omitted here because they have special meanings below.
-       tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
+       tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
                | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
-               | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 | hppa2.0 \
-               | alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \
-               | i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \
-               | mips64 | mipsel | mips64el | mips64orion | mips64orionel \
-               | mipstx39 | mipstx39el \
-               | sparc | sparclet | sparclite | sparc64 | v850)
+               | 580 | i960 | h8300 \
+               | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
+               | alpha | alphaev[4-7] | alphaev56 | alphapca5[67] \
+               | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \
+               | 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \
+               | mips64orion | mips64orionel | mipstx39 | mipstx39el \
+               | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
+               | mips64vr5000 | miprs64vr5000el | mcore \
+               | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \
+               | thumb | d10v | fr30)
                basic_machine=$basic_machine-unknown
                ;;
+       m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65 | pj | pjl)
+               ;;
+
        # We use `pc' rather than `unknown'
        # because (1) that's what they normally are, and
        # (2) the word "unknown" tends to confuse beginning users.
@@ -171,27 +195,45 @@ case $basic_machine in
                exit 1
                ;;
        # Recognize the basic CPU types with company name.
-       vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \
+       # FIXME: clean up the formatting here.
+       vax-* | tahoe-* | i[34567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
              | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
              | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
-             | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
-             | xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* \
-             | alpha-* | alphaev5-* | alphaev56-* | we32k-* | cydra-* \
-             | ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \
+             | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
+             | xmp-* | ymp-* \
+             | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \
+             | alpha-* | alphaev[4-7]-* | alphaev56-* | alphapca5[67]-* \
+             | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
+             | clipper-* | orion-* \
              | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
-             | sparc64-* | mips64-* | mipsel-* \
-             | mips64el-* | mips64orion-* | mips64orionel-*  \
-             | mipstx39-* | mipstx39el-* \
-             | f301-*)
+             | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \
+             | mips64el-* | mips64orion-* | mips64orionel-* \
+             | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
+             | mipstx39-* | mipstx39el-* | mcore-* \
+             | f301-* | armv*-* | t3e-* \
+             | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
+             | thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* )
                ;;
        # Recognize the various machine names and aliases which stand
        # for a CPU type and a company and sometimes even an OS.
+       386bsd)
+               basic_machine=i386-unknown
+               os=-bsd
+               ;;
        3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
                basic_machine=m68000-att
                ;;
        3b*)
                basic_machine=we32k-att
                ;;
+       a29khif)
+               basic_machine=a29k-amd
+               os=-udi
+               ;;
+       adobe68k)
+               basic_machine=m68010-adobe
+               os=-scout
+               ;;
        alliant | fx80)
                basic_machine=fx80-alliant
                ;;
@@ -221,6 +263,10 @@ case $basic_machine in
                basic_machine=m68k-apollo
                os=-sysv
                ;;
+       apollo68bsd)
+               basic_machine=m68k-apollo
+               os=-bsd
+               ;;
        aux)
                basic_machine=m68k-apple
                os=-aux
@@ -297,6 +343,10 @@ case $basic_machine in
        encore | umax | mmax)
                basic_machine=ns32k-encore
                ;;
+       es1800 | OSE68k | ose68k | ose | OSE)
+               basic_machine=m68k-ericsson
+               os=-ose
+               ;;
        fx2800)
                basic_machine=i860-alliant
                ;;
@@ -315,6 +365,14 @@ case $basic_machine in
                basic_machine=h8300-hitachi
                os=-hms
                ;;
+       h8300xray)
+               basic_machine=h8300-hitachi
+               os=-xray
+               ;;
+       h8500hms)
+               basic_machine=h8500-hitachi
+               os=-hms
+               ;;
        harris)
                basic_machine=m88k-harris
                os=-sysv3
@@ -330,13 +388,30 @@ case $basic_machine in
                basic_machine=m68k-hp
                os=-hpux
                ;;
+       hp3k9[0-9][0-9] | hp9[0-9][0-9])
+               basic_machine=hppa1.0-hp
+               ;;
        hp9k2[0-9][0-9] | hp9k31[0-9])
                basic_machine=m68000-hp
                ;;
        hp9k3[2-9][0-9])
                basic_machine=m68k-hp
                ;;
-       hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
+       hp9k6[0-9][0-9] | hp6[0-9][0-9])
+               basic_machine=hppa1.0-hp
+               ;;
+       hp9k7[0-79][0-9] | hp7[0-79][0-9])
+               basic_machine=hppa1.1-hp
+               ;;
+       hp9k78[0-9] | hp78[0-9])
+               # FIXME: really hppa2.0-hp
+               basic_machine=hppa1.1-hp
+               ;;
+       hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+               # FIXME: really hppa2.0-hp
+               basic_machine=hppa1.1-hp
+               ;;
+       hp9k8[0-9][13679] | hp8[0-9][13679])
                basic_machine=hppa1.1-hp
                ;;
        hp9k8[0-9][0-9] | hp8[0-9][0-9])
@@ -345,9 +420,16 @@ case $basic_machine in
        hppa-next)
                os=-nextstep3
                ;;
+       hppaosf)
+               basic_machine=hppa1.1-hp
+               os=-osf
+               ;;
+       hppro)
+               basic_machine=hppa1.1-hp
+               os=-proelf
+               ;;
        i370-ibm* | ibm*)
                basic_machine=i370-ibm
-               os=-mvs
                ;;
 # I'm not sure what "Sysv32" means.  Should this be sysv3.2?
        i[34567]86v32)
@@ -366,6 +448,25 @@ case $basic_machine in
                basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
                os=-solaris2
                ;;
+       i386mach)
+               basic_machine=i386-mach
+               os=-mach
+               ;;
+       i386-vsta | vsta)
+               basic_machine=i386-unknown
+               os=-vsta
+               ;;
+       i386-go32 | go32)
+               basic_machine=i386-unknown
+               os=-go32
+               ;;
+       i386-mingw32 | mingw32)
+               basic_machine=i386-unknown
+               os=-mingw32
+               ;;
+       i386-qnx | qnx)
+               basic_machine=i386-qnx
+               ;;
        iris | iris4d)
                basic_machine=mips-sgi
                case $os in
@@ -394,6 +495,10 @@ case $basic_machine in
        miniframe)
                basic_machine=m68000-convergent
                ;;
+       *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+               basic_machine=m68k-atari
+               os=-mint
+               ;;
        mipsel*-linux*)
                basic_machine=mipsel-unknown
                os=-linux-gnu
@@ -408,10 +513,30 @@ case $basic_machine in
        mips3*)
                basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
                ;;
+       monitor)
+               basic_machine=m68k-rom68k
+               os=-coff
+               ;;
+       msdos)
+               basic_machine=i386-unknown
+               os=-msdos
+               ;;
+       mvs)
+               basic_machine=i370-ibm
+               os=-mvs
+               ;;
        ncr3000)
                basic_machine=i486-ncr
                os=-sysv4
                ;;
+       netbsd386)
+               basic_machine=i386-unknown
+               os=-netbsd
+               ;;
+       netwinder)
+               basic_machine=armv4l-rebel
+               os=-linux
+               ;;
        news | news700 | news800 | news900)
                basic_machine=m68k-sony
                os=-newsos
@@ -424,6 +549,10 @@ case $basic_machine in
                basic_machine=mips-sony
                os=-newsos
                ;;
+       necv70)
+               basic_machine=v70-nec
+               os=-sysv
+               ;;
        next | m*-next )
                basic_machine=m68k-next
                case $os in
@@ -449,9 +578,25 @@ case $basic_machine in
                basic_machine=i960-intel
                os=-nindy
                ;;
+       mon960)
+               basic_machine=i960-intel
+               os=-mon960
+               ;;
        np1)
                basic_machine=np1-gould
                ;;
+       op50n-* | op60c-*)
+               basic_machine=hppa1.1-oki
+               os=-proelf
+               ;;
+       OSE68000 | ose68000)
+               basic_machine=m68000-ericsson
+               os=-ose
+               ;;
+       os68k)
+               basic_machine=m68k-none
+               os=-os68k
+               ;;
        pa-hitachi)
                basic_machine=hppa1.1-hitachi
                os=-hiuxwe2
@@ -469,19 +614,19 @@ case $basic_machine in
         pc532 | pc532-*)
                basic_machine=ns32k-pc532
                ;;
-       pentium | p5 | k5 | nexen)
+       pentium | p5 | k5 | k6 | nexen)
                basic_machine=i586-pc
                ;;
-       pentiumpro | p6 | k6 | 6x86)
+       pentiumpro | p6 | 6x86)
                basic_machine=i686-pc
                ;;
        pentiumii | pentium2)
                basic_machine=i786-pc
                ;;
-       pentium-* | p5-* | k5-* | nexen-*)
+       pentium-* | p5-* | k5-* | k6-* | nexen-*)
                basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
                ;;
-       pentiumpro-* | p6-* | k6-* | 6x86-*)
+       pentiumpro-* | p6-* | 6x86-*)
                basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
                ;;
        pentiumii-* | pentium2-*)
@@ -505,12 +650,20 @@ case $basic_machine in
        ps2)
                basic_machine=i386-ibm
                ;;
+       rom68k)
+               basic_machine=m68k-rom68k
+               os=-coff
+               ;;
        rm[46]00)
                basic_machine=mips-siemens
                ;;
        rtpc | rtpc-*)
                basic_machine=romp-ibm
                ;;
+       sa29200)
+               basic_machine=a29k-amd
+               os=-udi
+               ;;
        sequent)
                basic_machine=i386-sequent
                ;;
@@ -518,6 +671,10 @@ case $basic_machine in
                basic_machine=sh-hitachi
                os=-hms
                ;;
+       sparclite-wrs)
+               basic_machine=sparclite-wrs
+               os=-vxworks
+               ;;
        sps7)
                basic_machine=m68k-bull
                os=-sysv2
@@ -525,6 +682,13 @@ case $basic_machine in
        spur)
                basic_machine=spur-unknown
                ;;
+       st2000)
+               basic_machine=m68k-tandem
+               ;;
+       stratus)
+               basic_machine=i860-stratus
+               os=-sysv4
+               ;;
        sun2)
                basic_machine=m68000-sun
                ;;
@@ -569,6 +733,10 @@ case $basic_machine in
                basic_machine=i386-sequent
                os=-dynix
                ;;
+       t3e)
+               basic_machine=t3e-cray
+               os=-unicos
+               ;;
        tx39)
                basic_machine=mipstx39-unknown
                ;;
@@ -586,6 +754,10 @@ case $basic_machine in
                basic_machine=a29k-nyu
                os=-sym1
                ;;
+       v810 | necv810)
+               basic_machine=v810-nec
+               os=-none
+               ;;
        vaxv)
                basic_machine=vax-dec
                os=-sysv
@@ -609,6 +781,14 @@ case $basic_machine in
                basic_machine=a29k-wrs
                os=-vxworks
                ;;
+       w65*)
+               basic_machine=w65-wdc
+               os=-none
+               ;;
+       w89k-*)
+               basic_machine=hppa1.1-winbond
+               os=-proelf
+               ;;
        xmp)
                basic_machine=xmp-cray
                os=-unicos
@@ -616,6 +796,10 @@ case $basic_machine in
         xps | xps100)
                basic_machine=xps100-honeywell
                ;;
+       z8k-*-coff)
+               basic_machine=z8k-unknown
+               os=-sim
+               ;;
        none)
                basic_machine=none-none
                os=-none
@@ -623,6 +807,15 @@ case $basic_machine in
 
 # Here we handle the default manufacturer of certain CPU types.  It is in
 # some cases the only manufacturer, in others, it is the most popular.
+       w89k)
+               basic_machine=hppa1.1-winbond
+               ;;
+       op50n)
+               basic_machine=hppa1.1-oki
+               ;;
+       op60c)
+               basic_machine=hppa1.1-oki
+               ;;
        mips)
                if [ x$os = x-linux-gnu ]; then
                        basic_machine=mips-unknown
@@ -645,7 +838,7 @@ case $basic_machine in
        we32k)
                basic_machine=we32k-att
                ;;
-       sparc)
+       sparc | sparcv9)
                basic_machine=sparc-sun
                ;;
         cydra)
@@ -657,6 +850,16 @@ case $basic_machine in
        orion105)
                basic_machine=clipper-highlevel
                ;;
+       mac | mpw | mac-mpw)
+               basic_machine=m68k-apple
+               ;;
+       pmac | pmac-mpw)
+               basic_machine=powerpc-apple
+               ;;
+       c4x*)
+               basic_machine=c4x-none
+               os=-coff
+               ;;
        *)
                echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
                exit 1
@@ -710,13 +913,21 @@ case $os in
              | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
              | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
              | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
-             | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
+             | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
              | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
              | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
-             | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-             | -mingw32* | -linux-gnu* | -uxpv* | -beos*)
+             | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+             | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
+             | -interix* | -uwin* | -rhapsody* | -opened* | -openstep* | -oskit*)
        # Remember, each alternative MUST END IN *, to match a version number.
                ;;
+       -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+             | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
+             | -macos* | -mpw* | -magic* | -mon960* | -lnews*)
+               ;;
+       -mac*)
+               os=`echo $os | sed -e 's|mac|macos|'`
+               ;;
        -linux*)
                os=`echo $os | sed -e 's|linux|linux-gnu|'`
                ;;
@@ -726,6 +937,9 @@ case $os in
        -sunos6*)
                os=`echo $os | sed -e 's|sunos6|solaris3|'`
                ;;
+       -opened*)
+               os=-openedition
+               ;;
        -osfrose*)
                os=-osfrose
                ;;
@@ -741,6 +955,9 @@ case $os in
        -acis*)
                os=-aos
                ;;
+       -386bsd)
+               os=-bsd
+               ;;
        -ctix* | -uts*)
                os=-sysv
                ;;
@@ -760,6 +977,9 @@ case $os in
        -oss*)
                os=-sysv3
                ;;
+        -qnx)
+               os=-qnx4
+               ;;
        -svr4)
                os=-sysv4
                ;;
@@ -772,9 +992,18 @@ case $os in
        # This must come after -sysvr4.
        -sysv*)
                ;;
+       -ose*)
+               os=-ose
+               ;;
+       -es1800*)
+               os=-ose
+               ;;
        -xenix)
                os=-xenix
                ;;
+        -*mint | -*MiNT)
+               os=-mint
+               ;;
        -none)
                ;;
        *)
@@ -800,6 +1029,9 @@ case $basic_machine in
        *-acorn)
                os=-riscix1.2
                ;;
+       arm*-rebel)
+               os=-linux
+               ;;
        arm*-semi)
                os=-aout
                ;;
@@ -821,6 +1053,15 @@ case $basic_machine in
                # default.
                # os=-sunos4
                ;;
+       m68*-cisco)
+               os=-aout
+               ;;
+       mips*-cisco)
+               os=-elf
+               ;;
+       mips*-*)
+               os=-elf
+               ;;
        *-tti)  # must be before sparc entry or we get the wrong os.
                os=-sysv3
                ;;
@@ -833,6 +1074,15 @@ case $basic_machine in
        *-ibm)
                os=-aix
                ;;
+       *-wec)
+               os=-proelf
+               ;;
+       *-winbond)
+               os=-proelf
+               ;;
+       *-oki)
+               os=-proelf
+               ;;
        *-hp)
                os=-hpux
                ;;
@@ -896,6 +1146,18 @@ case $basic_machine in
        f301-fujitsu)
                os=-uxpv
                ;;
+       *-rom68k)
+               os=-coff
+               ;;
+       *-*bug)
+               os=-coff
+               ;;
+       *-apple)
+               os=-macos
+               ;;
+       *-atari*)
+               os=-mint
+               ;;
        *)
                os=-none
                ;;
@@ -917,9 +1179,15 @@ case $basic_machine in
                        -aix*)
                                vendor=ibm
                                ;;
+                       -beos*)
+                               vendor=be
+                               ;;
                        -hpux*)
                                vendor=hp
                                ;;
+                       -mpeix*)
+                               vendor=hp
+                               ;;
                        -hiux*)
                                vendor=hitachi
                                ;;
@@ -935,7 +1203,7 @@ case $basic_machine in
                        -genix*)
                                vendor=ns
                                ;;
-                       -mvs*)
+                       -mvs* | -opened*)
                                vendor=ibm
                                ;;
                        -ptx*)
@@ -947,6 +1215,15 @@ case $basic_machine in
                        -aux*)
                                vendor=apple
                                ;;
+                       -hms*)
+                               vendor=hitachi
+                               ;;
+                       -mpw* | -macos*)
+                               vendor=apple
+                               ;;
+                       -*mint | -*MiNT)
+                               vendor=atari
+                               ;;
                esac
                basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
                ;;
index 71d3f8f..a6e9c6b 100644 (file)
@@ -141,7 +141,7 @@ Additional features:
                         installed LDAP libraries on the system).
 --mail-locking=TYPE (*) Specify the locking to be used by movemail to prevent
                         concurrent updates of mail spool files. Valid types
-                        are `lockf', `flock', and `file'.
+                        are `lockf', `flock', and `dot'.
 --with-modules         Compile in experimental support for dynamically
                        loaded libraries (Dynamic Shared Objects).
 --with-site-lisp=yes    Allow for a site-lisp directory in the XEmacs hierarchy
index 3dcba1e..1c58518 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -136,6 +136,21 @@ 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
 
+** Mail spool locking now works correctly.
+XEmacs has always come with a little auxiliary program, movemail,
+which moves mail out of the system's spool area into user storage.  To
+coordinate between XEmacs, the mail delivery agent, and other mail
+user agents, movemail needs to properly lock the spool file before
+moving it.  Movemail now correctly respects the --mail-locking option
+to configure.  Moreover, movemail's locking behavior can be specified
+at run-time, via a new command-line option -m to movemail, or through
+the environment variable EMACSLOCKMETHOD.
+
+When installing XEmacs, make sure you configure it according to your
+environment's mail spool locking conventions.  When you're using a
+binary kit, set the `mail-lock-method' variable at startup, or the
+EMACSLOCKMETHOD environment variable.
+
 ** New command-line switches -user-init-file and -user-init-directory.
 These can be used to specify alternate locations for what is normally
 ~/.emacs and ~/.xemacs.
@@ -144,6 +159,10 @@ Moreover, -user <user> (which used to only work in unpredictable ways)
 is now equivalent to
 -user-init-file ~<user>/.emacs -user-init-directory ~<user>/.xemacs.
 
+** New variable `mswindows-meta-activates-menu'.
+If you set this variable to nil then pressing the Alt key under
+MS-Windows will no longer activate the menubar. The default is t.
+
 ** Etags changes.
 
 *** In DOS, etags looks for file.cgz if it cannot find file.c.
index f15c75d..def5aa3 100644 (file)
@@ -1,4 +1,4 @@
-Copyright (c) 1997, Adrian Aichner <adrian@xemacs.org>.
+Copyright (c) 1997-2000, Adrian Aichner <adrian@xemacs.org>.
 
 Copyright (c) 1985, 1996 Free Software Foundation, Inc. See end for conditions.
 
@@ -39,7 +39,7 @@ weiterbewegt.  Um eine Seite zur
 META-Taste gedrückt und tippe v oder tippe <ESC>v wenn Deine Tastatur
 keine META-, EDIT- oder ALT-Taste besitzt).
 
->>  Versuche ein paar Mal M-v und C-v zu tippen.
+>>  Versuche ein paarmal M-v und C-v zu tippen.
 
 
 * ZUSAMMENFASSUNG
@@ -1137,7 +1137,7 @@ Diese Version des Tutorials ist, wie GNU Emacs selbst,
 urheberrechtlich geschützt und erlaubt die Verteilung von Kopien unter
 bestimmten Voraussetzungen:
 
-Copyright (c) 1997, Adrian Aichner <adrian@xemacs.org>.
+Copyright (c) 1997-2000, Adrian Aichner <adrian@xemacs.org>.
 
 Copyright (c) 1985, 1996 Free Software Foundation
 
index db885d4..6b90ddb 100644 (file)
@@ -1,3 +1,47 @@
+2000-01-18  Martin Buchholz <martin@xemacs.org>
+
+       * XEmacs 21.2.27 is released.
+
+2000-01-18  Martin Buchholz  <martin@xemacs.org>
+
+       * ootags.c: Ansify.
+       * etags.c:
+       * getopt.c:
+       * cvtmail.c:
+       Remove declarations of ANSI errno, getenv(), malloc().
+
+2000-01-13  Martin Buchholz  <martin@xemacs.org>
+
+       * movemail.c (main): 
+       * make-docfile.c (write_c_args): 
+       Simple compiler warning fixes.
+
+2000-01-09  Martin Buchholz  <martin@xemacs.org>
+
+       * *.[ch]: Change <../src/config.h> to <config.h>
+       * ellcc.c: Always use <...> to #include files not in `.'
+       * Makefile.in.in: Use safer -I paths.
+       Use $(top_srcdir) instead of $(srcdir)/../src
+       Add warning comment.
+
+2000-01-08  Martin Buchholz  <martin@xemacs.org>
+
+       * movemail.c: Warning removal.
+
+2000-01-06  Norbert Koch  <norbert@s.netic.de>
+
+       * movemail.c: Typo fix.
+
+2000-01-03  Michael Sperber [Mr. Preprocessor]  <sperber@informatik.uni-tuebingen.de>
+
+       * movemail.c: Overhaul of the locking code.
+
+2000-01-03  Martin Buchholz  <martin@xemacs.org>
+
+       * etags.c (etags_strrchr): Ansify.
+       (etags_strchr): Ansify.
+       (get_compressor_from_suffix): Remove warning, make code cleaner.
+
 1999-12-31  Martin Buchholz <martin@xemacs.org>
 
        * XEmacs 21.2.26 is released.
index 7730260..d926072 100644 (file)
@@ -91,7 +91,7 @@ INSTALLABLES = $(INSTALLABLES_BASE) ellcc
 #ifdef HAVE_MS_WINDOWS
 INSTALLABLES = $(INSTALLABLES_BASE) runxemacs rungnuclient
 #else
-INSTALLABLES = $(INSTALLABLES_BASE) 
+INSTALLABLES = $(INSTALLABLES_BASE)
 #endif
 #endif
 
@@ -162,7 +162,13 @@ ld_libs_general=@ld_libs_general@
 
 ## We need to #define emacs to get the right versions of some files.
 
-cppflags = -Demacs -I$(top_srcdir)/src -I../src $(CPPFLAGS)
+## To understand the order of -I flags, consider what happens if you run
+## ./configure in the source tree, and then run
+## $(srcdir).2.26/configure in some other build tree.
+## Where will the generated files like config.h be included from?
+## This is also why you _must_ use <...> instead of "..." 
+## when #include'ing generated files.
+cppflags = -Demacs -I. -I../src -I$(srcdir) -I$(top_srcdir)/src $(CPPFLAGS)
 cflags   = $(CFLAGS) $(cppflags) $(c_switch_general)
 ldflags  = $(LDFLAGS) $(ld_switch_general) $(ld_libs_general)
 
@@ -279,32 +285,29 @@ getopt.o: ${srcdir}/getopt.c ${srcdir}/getopt.h
        ${CC} -c $(cflags) ${srcdir}/getopt.c
 getopt1.o: ${srcdir}/getopt1.c ${srcdir}/getopt.h
        ${CC} -c $(cflags) ${srcdir}/getopt1.c
-alloca.o: ${srcdir}/../src/alloca.c
+alloca.o: ${top_srcdir}/src/alloca.c
        ${CC} -c $(cflags) ${srcdir}/../src/alloca.c
 
-regex.o: ${srcdir}/../src/regex.c ${srcdir}/../src/regex.h
+regex.o: ${srcdir}/../src/regex.c ${top_srcdir}/src/regex.h
        $(CC) -c `echo $(cflags) | sed 's/-Demacs/ /'` \
-               -DINHIBIT_STRING_HEADER ${srcdir}/../src/regex.c
+               -DINHIBIT_STRING_HEADER ${top_srcdir}/src/regex.c
 
-etags_args = -I. $(cflags) -I${srcdir} -I${srcdir}/../src \
-       -DVERSION='"${version}"' ${srcdir}/etags.c \
+etags_args = $(cflags) -DVERSION='"${version}"' ${srcdir}/etags.c \
        $(GETOPTOBJS) regex.o $(ldflags)
-etags_deps   = ${srcdir}/etags.c $(GETOPTDEPS) regex.o ../src/config.h
+etags_deps = ${srcdir}/etags.c $(GETOPTDEPS) regex.o ../src/config.h
 
 etags: ${etags_deps}
        $(CC) ${etags_args} -o $@
 
-ellcc_args = -I. $(cflags) -I${srcdir} -I${srcdir}/../src \
-    ${srcdir}/ellcc.c $(ldflags)
+ellcc_args = $(cflags) ${srcdir}/ellcc.c $(ldflags)
 ellcc_deps = ${srcdir}/ellcc.c ellcc.h ../src/config.h
 
 ellcc: ${ellcc_deps}
        $(CC) ${ellcc_args} -o $@
 
-run_args = -I. $(cflags) -I${srcdir} -I${srcdir}/../src \
-       -DVERSION='"${version}"' ${srcdir}/run.c \
+run_args = $(cflags) -DVERSION='"${version}"' ${srcdir}/run.c \
        $(ldflags) -Wl,--subsystem,windows -e _mainCRTStartup
-run_deps   = ${srcdir}/run.c ${srcdir}/run.h ${srcdir}/run.rc \
+run_deps = ${srcdir}/run.c ${srcdir}/run.h ${srcdir}/run.rc \
        ${srcdir}/../nt/xemacs.ico ${srcdir}/../nt/file.ico \
        ${srcdir}/../nt/lisp.ico
 
@@ -319,10 +322,9 @@ runxemacs: run
 rungnuclient: run
        cp run.exe $@.exe
 
-ootags_args = -I. $(cflags) -I${srcdir} -I${srcdir}/../src \
-       -DVERSION='"${version}"' ${srcdir}/ootags.c \
+ootags_args = $(cflags) -DVERSION='"${version}"' ${srcdir}/ootags.c \
        $(GETOPTOBJS) regex.o $(ldflags)
-ootags_deps   = ${srcdir}/ootags.c $(GETOPTDEPS) regex.o ../src/config.h
+ootags_deps = ${srcdir}/ootags.c $(GETOPTDEPS) regex.o ../src/config.h
 
 ootags: ${ootags_deps}
        $(CC) ${ootags_args} -o $@
index dda077d..d92ea5a 100644 (file)
@@ -19,7 +19,7 @@
    by Francesco Potorti` <pot@cnuce.cnr.it>. */
 
 #ifdef HAVE_CONFIG_H
-#include <../src/config.h>
+#include <config.h>
 /* On some systems, Emacs defines static as nothing for the sake
    of unexec.  We don't want that here since we don't use unexec. */
 #undef static
index 768bcee..6bdcaf1 100644 (file)
@@ -35,17 +35,12 @@ Boston, MA 02111-1307, USA.  */
  */
 
 
-#include <../src/config.h>
+#include <config.h>
 
 #include <stdio.h>
 #include <string.h>
+#include <stdlib.h>
 
-#if __STDC__ || defined(STDC_HEADERS)
-# include <stdlib.h>
-#else
-char *malloc ();
-char *getenv ();
-#endif
 static void *xmalloc (unsigned int);
 static void *xrealloc (char *ptr, unsigned int);
 static void skip_to_lf (FILE *stream);
@@ -68,7 +63,7 @@ main (int argc, char *argv[])
   char name[14];
   int c;
 
-  hd = (char *) getenv ("HOME");
+  hd = getenv ("HOME");
 
   md = (char *) xmalloc (strlen (hd) + 10);
   strcpy (md, hd);
index a39ddc6..1fc540c 100644 (file)
@@ -6,7 +6,7 @@
    but in texinfo format and sorted by function/variable name.  */
 
 #ifdef emacs
-#include <../src/config.h>
+#include <config.h>
 #endif
 #include <stdio.h>
 
index a116c9d..5168a11 100644 (file)
@@ -58,7 +58,7 @@ the lines of:
 See the samples for more details.
 */
 
-#include <../src/config.h>
+#include <config.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -71,8 +71,9 @@ See the samples for more details.
 #endif /* HAVE_UNISTD_H */
 
 #define EMODULES_GATHER_VERSION
-#include "emodules.h"
-#include "ellcc.h"
+
+#include <emodules.h>
+#include <ellcc.h> /* Generated files must be included using <...> */
 
 #define DEBUG
 
index 35a161e..12bdc61 100644 (file)
@@ -96,9 +96,6 @@ char pot_etags_version[] = "@(#) pot revision number is 13.33";
 #include <stdio.h>
 #include <ctype.h>
 #include <errno.h>
-#ifndef errno
-  extern int errno;
-#endif
 #include <sys/types.h>
 #include <sys/stat.h>
 
@@ -194,8 +191,6 @@ typedef struct
   char **interpreters;
 } language;
 
-extern char *getenv ();
-
 typedef struct node_st
 {                              /* sorting structure            */
   char *name;                  /* function or type name        */
@@ -282,8 +277,8 @@ char *skip_spaces (char *cp);
 char *skip_non_spaces (char *cp);
 char *savenstr (char *cp, int len);
 char *savestr (char *cp);
-char *etags_strchr (char *sp, char c);
-char *etags_strrchr (char *sp, char c);
+char *etags_strchr (const char *sp, int c);
+char *etags_strrchr (const char *sp, int c);
 char *etags_getcwd (void);
 char *relative_filename (char *file, char *dir);
 char *absolute_filename (char *file, char *dir);
@@ -1208,17 +1203,21 @@ get_compressor_from_suffix (file, extptr)
   /* Let those poor souls who live with DOS 8+3 file name limits get
      some solace by treating foo.cgz as if it were foo.c.gz, etc.
      Only the first do loop is run if not MSDOS */
+#ifdef MSDOS
   do
     {
       for (compr = compressors; compr->suffix != NULL; compr++)
        if (streq (compr->suffix, suffix))
          return compr;
-#ifndef MSDOS
-      break;
-#endif
       if (extptr != NULL)
        *extptr = ++suffix;
     } while (*suffix != '\0');
+#else
+  for (compr = compressors; compr->suffix != NULL; compr++)
+    if (streq (compr->suffix, suffix))
+      return compr;
+#endif
+
   return NULL;
 }
 
@@ -5112,14 +5111,13 @@ savenstr (cp, len)
 /*
  * Return the ptr in sp at which the character c last
  * appears; NULL if not found
- *
- * Identical to System V strrchr, included for portability.
  */
 char *
 etags_strrchr (sp, c)
-     register char *sp, c;
+     const char *sp;
+     int c;
 {
-  register char *r;
+  register const char *r;
 
   r = NULL;
   do
@@ -5127,24 +5125,23 @@ etags_strrchr (sp, c)
       if (*sp == c)
        r = sp;
   } while (*sp++);
-  return r;
+  return (char *) r;
 }
 
 
 /*
  * Return the ptr in sp at which the character c first
  * appears; NULL if not found
- *
- * Identical to System V strchr, included for portability.
  */
 char *
 etags_strchr (sp, c)
-     register char *sp, c;
+     const char *sp;
+     int c;
 {
   do
     {
       if (*sp == c)
-       return sp;
+       return (char *) sp;
     } while (*sp++);
   return NULL;
 }
index d3e4786..63ac5d5 100644 (file)
@@ -21,7 +21,7 @@ Boston, MA 02111-1307, USA.  */
 /* Synched up with: FSF 19.28. */
 
 #define NO_SHORTNAMES
-#include <../src/config.h>
+#include <config.h>
 
 #if defined (BSD) && !defined (BSD4_1) && !defined (USE_FAKEMAIL)
 /* This program is not used in BSD, so just avoid loader complaints.  */
@@ -638,10 +638,6 @@ main (int argc, char *argv[])
   register int size;
   FILE *the_pipe;
 
-#if !(__STDC__ || defined(STDC_HEADERS))
-  extern char *getenv ();
-#endif
-
   mail_program_name = getenv ("FAKEMAILER");
   if (!(mail_program_name && *mail_program_name))
     mail_program_name = (char *) MAIL_PROGRAM_NAME;
index dd5cc71..21231de 100644 (file)
@@ -31,7 +31,7 @@ USA.  */
 #endif
 
 #ifdef HAVE_CONFIG_H
-#include <../src/config.h>
+#include <config.h>
 #endif
 
 #include <stdio.h>
@@ -202,11 +202,6 @@ static char *posixly_correct;
 #define        my_index        strchr
 #else
 
-/* Avoid depending on library functions or files
-   whose names are inconsistent.  */
-
-char *getenv ();
-
 static char *
 my_index (const char *str, int chr)
 {
index 1492066..de15d66 100644 (file)
@@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 USA.  */
 \f
 #ifdef HAVE_CONFIG_H
-#include <../src/config.h>
+#include <config.h>
 #endif
 
 #include "getopt.h"
index 9fb3edd..4e2ac5a 100644 (file)
@@ -43,7 +43,7 @@ static char header_rcsid [] = "!Header: gnuserv.h,v 2.4 95/02/16 11:58:11 arup a
 #define NO_SHORTNAMES
 /* gnuserv should not be compiled using SOCKS */
 #define DO_NOT_SOCKSIFY
-#include <../src/config.h>
+#include <config.h>
 #undef read
 #undef write
 #undef open
index 0a88b00..8d7f308 100644 (file)
@@ -1,6 +1,6 @@
 /* Synched up with: FSF 19.28. */
 
-#include <../src/config.h>
+#include <config.h>
 
 #include <stdio.h>
 #include <ctype.h>
index e28e38e..930990e 100644 (file)
@@ -40,7 +40,7 @@ Boston, MA 02111-1307, USA.  */
  */
 
 #define NO_SHORTNAMES   /* Tell config not to load remap.h */
-#include <../src/config.h>
+#include <config.h>
 
 #include <stdio.h>
 #include <errno.h>
@@ -429,10 +429,10 @@ write_c_args (FILE *out, CONST char *func, char *buff, int minargs,
       static char lo[] = "Lisp_Object";
       if ((C_IDENTIFIER_CHAR_P (c) != in_ident) && !in_ident &&
          (strncmp (p, lo, sizeof (lo) - 1) == 0) &&
-         isspace(*(p + sizeof (lo) - 1)))
+         isspace((unsigned char) (* (p + sizeof (lo) - 1))))
        {
          p += (sizeof (lo) - 1);
-         while (isspace (*p))
+         while (isspace ((unsigned char) (*p)))
            p++;
          c = *p;
        }
index a8093e8..d27ba27 100644 (file)
@@ -27,7 +27,7 @@ Boston, MA 02111-1307, USA.  */
    that option. */
 
 #ifdef emacs
-#include <../src/config.h>
+#include <config.h>
 #endif
 
 #include <sys/types.h>
index 9a1a3c6..12f180a 100644 (file)
@@ -1,35 +1,41 @@
 /* movemail foo bar -- move file foo to file bar,
-   locking file foo the way /bin/mail respects.
+   locking file foo.
    Copyright (C) 1986, 1992, 1993, 1994, 1996 Free Software Foundation, Inc.
 
-This file is part of GNU Emacs.
+This file is part of XEmacs.
 
-GNU Emacs is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
+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.
 
-GNU Emacs is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
+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 GNU Emacs; see the file COPYING.  If not, write to
+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.  */
+Boston, MA 02111-1307, USA.
 
-/* Important notice: defining MAIL_USE_FLOCK or MAIL_USE_LOCKF *will
-   cause loss of mail* if you do it on a system that does not normally
-   use flock as its way of interlocking access to inbox files.  The
-   setting of MAIL_USE_FLOCK and MAIL_USE_LOCKF *must agree* with the
-   system's own conventions.  It is not a choice that is up to you.
+ Please mail bugs and suggestions to the XEmacs maintainer.
+*/
 
-   So, if your system uses lock files rather than flock, then the only way
-   you can get proper operation is to enable movemail to write lockfiles there.
-   This means you must either give that directory access modes
-   that permit everyone to write lockfiles in it, or you must make movemail
-   a setuid or setgid program.  */
+/* Important notice:
+ *
+ *  You *must* coordinate the locking method used by movemail with that
+ *  used by your mail delivery agent, as well as that of the other mail
+ *  user agents on your system.  movemail allows you to do this at run
+ *  time via the -m flag.  Moreover, it uses a default determined by
+ *  the MAIL_LOCK_DOT, MAIL_LOCK_LOCKF, MAIL_LOCK_FLOCK,
+ *  MAIL_LOCK_LOCKING, and MAIL_LOCK_MMDF preprocessor settings.
+ */
+
+/*
+ * Mike Sperber <sperber@informatik.uni-tuebingen.de> reorganized
+ * everything that has to with locking in December 1999.
+ */
 
 /*
  * Modified January, 1986 by Michael R. Gretzinger (Project Athena)
@@ -56,7 +62,7 @@ Boston, MA 02111-1307, USA.  */
 
 #define NO_SHORTNAMES   /* Tell config not to load remap.h */
 #define DONT_ENCAPSULATE
-#include <../src/config.h>
+#include <config.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <stdio.h>
@@ -106,7 +112,7 @@ char * strerror (int errnum);
 #include <io.h>
 #endif /* WINDOWSNT */
 
-#if defined (HAVE_UNISTD_H) || defined (USG)
+#if defined (HAVE_UNISTD_H)
 #include <unistd.h>
 #endif /* unistd.h */
 #ifndef F_OK
@@ -116,23 +122,15 @@ char * strerror (int errnum);
 #define R_OK 4
 #endif /* No F_OK */
 
-#if defined (HAVE_FCNTL_H) || defined (USG)
+#if defined (HAVE_FCNTL_H)
 #include <fcntl.h>
 #endif /* fcntl.h */
 
-#if defined (XENIX) || defined (WINDOWSNT)
+#ifdef HAVE_LOCKING
 #include <sys/locking.h>
 #endif
 
-#ifdef MAIL_USE_LOCKF
-#define MAIL_USE_SYSTEM_LOCK
-#endif
-
-#ifdef MAIL_USE_FLOCK
-#define MAIL_USE_SYSTEM_LOCK
-#endif
-
-#ifdef MAIL_USE_MMDF
+#ifdef HAVE_MMDF
 extern int lk_open (), lk_close ();
 #endif
 
@@ -144,6 +142,7 @@ extern int lk_open (), lk_close ();
 
 static void fatal (char *, char*);
 static void error (char *, char *, char *);
+static void usage(int);
 static void pfatal_with_name (char *);
 static void pfatal_and_delete (char *);
 static char *concat (char *, char *, char *);
@@ -160,9 +159,6 @@ static int pop_search_top (popserver server, int msgno, int lines,
                           struct re_pattern_buffer* regexp);
 #endif
 
-/* Nonzero means this is name of a lock file to delete on fatal error.  */
-char *delete_lockname;
-
 int verbose=0;
 #ifdef MAIL_USE_POP
 int reverse=0;
@@ -184,10 +180,35 @@ struct option longopts[] =
   { "regex",                   required_argument,         NULL,        'r'     },
   { "match-lines",             required_argument,         NULL,        'l'     },
 #endif
+  { "lock-method",             required_argument,         NULL,        'm'     },
+  { "help",                    no_argument,               NULL,        'h'     },
   { "verbose",                         no_argument,               NULL,        'v'     },
   { 0 }
 };
 
+#define DOTLOCKING     0
+#define FLOCKING       1
+#define LOCKFING       2
+#define MMDF                   3
+#define LOCKING         4
+
+#if defined(MAIL_LOCK_FLOCK) && defined(HAVE_FLOCK)
+#define DEFAULT_LOCKING FLOCKING
+#elif defined(MAIL_LOCK_LOCKF) && defined(HAVE_LOCKF)
+#define DEFAULT_LOCKING LOCKFING
+#elif defined(MAIL_LOCK_MMDF) && defined(HAVE_MMDF)
+#define DEFAULT_LOCKING MMDF
+#elif defined(MAIL_LOCK_LOCKING) && defined(HAVE_LOCKING)
+#define DEFAULT_LOCKING LOCKING
+#else
+#define DEFAULT_LOCKING DOTLOCKING
+#endif
+
+static void lock_dot(char *);
+static void unlock_dot(char *);
+static int parse_lock_method(char *);
+static char *unparse_lock_method(int);
+
 int
 main (int argc, char *argv[])
 {
@@ -198,23 +219,23 @@ main (int argc, char *argv[])
   int status;
 #endif
 
-#ifndef MAIL_USE_SYSTEM_LOCK
-  struct stat st;
-  long now;
-  int tem;
-  char *lockname, *p;
-  char *tempname;
-  int desc;
-#endif /* not MAIL_USE_SYSTEM_LOCK */
+  int lock_method = DEFAULT_LOCKING;
+
+  char *maybe_lock_env;
 
-  delete_lockname = 0;
+  maybe_lock_env = getenv("EMACSLOCKMETHOD");
+  if (maybe_lock_env)
+    {
+      printf("maybe-lock_env: %s\n", maybe_lock_env);
+      lock_method = parse_lock_method(maybe_lock_env);
+    }
 
-  while (1)
+  for (;;)
     {
 #ifdef MAIL_USE_POP
-      char* optstring = "i:o:p:l:r:xvk";
+      char* optstring = "i:o:m:p:l:r:xvhk";
 #else
-      char* optstring = "i:o:v";
+      char* optstring = "i:o:m:vh";
 #endif
       int opt = getopt_long (argc, argv, optstring, longopts, 0);
   
@@ -255,7 +276,16 @@ main (int argc, char *argv[])
          regexp_pattern = compile_regex (optarg);
          break;
 #endif
-       case 'v':               verbose = 1;    break;
+
+       case 'm':
+         lock_method = parse_lock_method(optarg);
+         break;
+       case 'h':
+         usage(lock_method);
+         exit(0);
+       case 'v':
+         verbose = 1;
+         break;
        }
     }
 
@@ -272,17 +302,19 @@ main (int argc, char *argv[])
     
   if (!inname || !outname)
     {
-      fprintf (stderr, "Usage: movemail [-rvxk] [-l lines ] [-i] inbox [-o] destfile [[-p] POP-password]\n");
+      usage(lock_method);
       exit(1);
     }
 
-#ifdef MAIL_USE_MMDF
-  mmdf_init (argv[0]);
+#ifdef HAVE_MMDF
+  if (lock_method == MMDF)
+    mmdf_init (argv[0]);
 #endif
 
   if (*outname == 0)
     fatal ("Destination file name is empty", 0);
 
+  VERBOSE(("checking access to output file\n"));
   /* Check access to output file.  */
   if (access (outname, F_OK) == 0 && access (outname, W_OK) != 0)
     pfatal_with_name (outname);
@@ -320,121 +352,83 @@ main (int argc, char *argv[])
   if (access (inname, R_OK | W_OK) != 0)
     pfatal_with_name (inname);
 
-#ifndef MAIL_USE_MMDF
-#ifndef MAIL_USE_SYSTEM_LOCK
-  /* Use a lock file named after our first argument with .lock appended:
-     If it exists, the mail file is locked.  */
-  /* Note: this locking mechanism is *required* by the mailer
-     (on systems which use it) to prevent loss of mail.
-
-     On systems that use a lock file, extracting the mail without locking
-     WILL occasionally cause loss of mail due to timing errors!
-
-     So, if creation of the lock file fails
-     due to access permission on the mail spool directory,
-     you simply MUST change the permission
-     and/or make movemail a setgid program
-     so it can create lock files properly.
-
-     You might also wish to verify that your system is one
-     which uses lock files for this purpose.  Some systems use other methods.
-
-     If your system uses the `flock' system call for mail locking,
-     define MAIL_USE_SYSTEM_LOCK in config.h or the s-*.h file
-     and recompile movemail.  If the s- file for your system
-     should define MAIL_USE_SYSTEM_LOCK but does not, send a bug report
-     to bug-gnu-emacs@prep.ai.mit.edu so we can fix it.  */
-
-  lockname = concat (inname, ".lock", "");
-  tempname = (char *) xmalloc (strlen (inname) + strlen ("EXXXXXX") + 1);
-  strcpy (tempname, inname);
-  p = tempname + strlen (tempname);
-  while (p != tempname && !IS_DIRECTORY_SEP (p[-1]))
-    p--;
-  *p = 0;
-  strcpy (p, "EXXXXXX");
-  mktemp (tempname);
-  unlink (tempname);
 
-  while (1)
+  if (fork () == 0)
     {
-      /* Create the lock file, but not under the lock file name.  */
-      /* Give up if cannot do that.  */
-      desc = open (tempname, O_WRONLY | O_CREAT | O_EXCL, 0666);
-      if (desc < 0)
-       {
-         char *message = (char *) xmalloc (strlen (tempname) + 50);
-         sprintf (message, "%s--see source file lib-src/movemail.c",
-                  tempname);
-         pfatal_with_name (message);
-       }
-      close (desc);
+      setuid (getuid ());
 
-      tem = link (tempname, lockname);
-      unlink (tempname);
-      if (tem >= 0)
-       break;
-      sleep (1);
+      VERBOSE(("opening input file\n"));
 
-      /* If lock file is five minutes old, unlock it.
-        Five minutes should be good enough to cope with crashes
-        and wedgitude, and long enough to avoid being fooled
-        by time differences between machines.  */
-      if (stat (lockname, &st) >= 0)
+      switch (lock_method)
        {
-         now = time (0);
-         if (st.st_ctime < now - 300)
-           unlink (lockname);
+       case DOTLOCKING:
+         indesc = open (inname, O_RDONLY);
+         break;
+#ifdef HAVE_LOCKF
+       case LOCKFING:
+         indesc = open (inname, O_RDWR);
+         break;
+#endif
+#ifdef HAVE_FLOCK
+       case FLOCKING:
+         indesc = open (inname, O_RDWR);
+         break;
+#endif
+#ifdef HAVE_LOCKING
+       case LOCKING:
+         indesc = open (inname, O_RDWR);
+         break;
+#endif
+#ifdef HAVE_MMDF
+       case MMDF:
+         indesc = lk_open (inname, O_RDONLY, 0, 0, 10);
+         break;
+#endif
+       default: abort();
        }
-    }
-
-  delete_lockname = lockname;
-#endif /* not MAIL_USE_SYSTEM_LOCK */
-#endif /* not MAIL_USE_MMDF */
-
-  if (fork () == 0)
-    {
-      setuid (getuid ());
-
-#ifndef MAIL_USE_MMDF
-#ifdef MAIL_USE_SYSTEM_LOCK
-      indesc = open (inname, O_RDWR);
-#else  /* if not MAIL_USE_SYSTEM_LOCK */
-      indesc = open (inname, O_RDONLY);
-#endif /* not MAIL_USE_SYSTEM_LOCK */
-#else  /* MAIL_USE_MMDF */
-      indesc = lk_open (inname, O_RDONLY, 0, 0, 10);
-#endif /* MAIL_USE_MMDF */
 
       if (indesc < 0)
        pfatal_with_name (inname);
 
-#if defined (BSD) || defined (XENIX)
+#ifdef HAVE_UMASK      
       /* In case movemail is setuid to root, make sure the user can
         read the output file.  */
-      /* This is desirable for all systems
-        but I don't want to assume all have the umask system call */
       umask (umask (0) & 0333);
-#endif /* BSD or Xenix */
+#endif
+
       outdesc = open (outname, O_WRONLY | O_CREAT | O_EXCL, 0666);
       if (outdesc < 0)
        pfatal_with_name (outname);
-#ifdef MAIL_USE_SYSTEM_LOCK
-#ifdef MAIL_USE_LOCKF
-      if (lockf (indesc, F_LOCK, 0) < 0) pfatal_with_name (inname);
-#else /* not MAIL_USE_LOCKF */
-#ifdef XENIX
-      if (locking (indesc, LK_RLCK, 0L) < 0) pfatal_with_name (inname);
-#else
-#ifdef WINDOWSNT
-      if (locking (indesc, LK_RLCK, -1L) < 0) pfatal_with_name (inname);
-#else
-      if (flock (indesc, LOCK_EX) < 0) pfatal_with_name (inname);
+
+      VERBOSE(("locking input file\n"));
+
+      switch (lock_method)
+       {
+#ifdef HAVE_LOCKF
+       case LOCKFING:
+         if (lockf (indesc, F_LOCK, 0) < 0)
+           pfatal_with_name (inname);
+         break;
+#endif
+#ifdef HAVE_FLOCK
+       case FLOCKING:
+         if (flock (indesc, LOCK_EX) < 0)
+           pfatal_with_name (inname);
+         break;
 #endif
+#ifdef HAVE_LOCKING
+       case LOCKING:
+         if (locking (indesc, LK_RLCK, -1L) < 0)
+           pfatal_with_name (inname);
+         break;
 #endif
-#endif /* not MAIL_USE_LOCKF */
-#endif /* MAIL_USE_SYSTEM_LOCK */
+       case DOTLOCKING:
+         lock_dot(inname);
+         break;
+       }
 
+      VERBOSE(("copying input file to output file\n"));
+           
       {
        char buf[1024];
 
@@ -453,7 +447,7 @@ main (int argc, char *argv[])
          }
       }
 
-#ifdef BSD
+#ifdef HAVE_FSYNC
       if (fsync (outdesc) < 0)
        pfatal_and_delete (outname);
 #endif
@@ -462,31 +456,29 @@ main (int argc, char *argv[])
       if (close (outdesc) != 0)
        pfatal_and_delete (outname);
 
-#ifdef MAIL_USE_SYSTEM_LOCK
-#if defined (STRIDE) || defined (XENIX) || defined (WINDOWSNT)
-      /* Stride, xenix have file locking, but no ftruncate.  This mess will do. */
-      close (open (inname, O_CREAT | O_TRUNC | O_RDWR, 0666));
-#else
-      ftruncate (indesc, 0L);
-#endif /* STRIDE or XENIX */
-#endif /* MAIL_USE_SYSTEM_LOCK */
+      VERBOSE(("deleting or truncating input file\n"));
 
-#ifdef MAIL_USE_MMDF
-      lk_close (indesc, 0, 0, 0);
+      switch (lock_method)
+       {
+       case LOCKFING:
+       case FLOCKING:
+       case LOCKING:
+#ifdef HAVE_FTRUNCATE
+         ftruncate (indesc, 0L);
 #else
-      close (indesc);
+         close (open (inname, O_CREAT | O_TRUNC | O_RDWR, 0666));
 #endif
-
-#ifndef MAIL_USE_SYSTEM_LOCK
-      /* Delete the input file; if we can't, at least get rid of its
-        contents.  */
-#ifdef MAIL_UNLINK_SPOOL
-      /* This is generally bad to do, because it destroys the permissions
-        that were set on the file.  Better to just empty the file.  */
-      if (unlink (inname) < 0 && errno != ENOENT)
-#endif /* MAIL_UNLINK_SPOOL */
-       creat (inname, 0600);
-#endif /* not MAIL_USE_SYSTEM_LOCK */
+         close (indesc);
+         break;
+#ifdef HAVE_MMDF
+       case MMDF:
+         lk_close (indesc, 0, 0, 0);
+         break;
+#endif
+       case DOTLOCKING:
+         creat (inname, 0600);
+         break;
+       }
 
       exit (0);
     }
@@ -497,22 +489,162 @@ main (int argc, char *argv[])
   else if (WEXITSTATUS (status) != 0)
     exit (WEXITSTATUS (status));
 
-#if !defined (MAIL_USE_MMDF) && !defined (MAIL_USE_SYSTEM_LOCK)
-  unlink (lockname);
-#endif /* not MAIL_USE_MMDF and not MAIL_USE_SYSTEM_LOCK */
+  if (lock_method == DOTLOCKING)
+    unlock_dot(inname);
 
-#endif /* ! DISABLE_DIRECT_ACCESS */
+#endif /* not DISABLE_DIRECT_ACCESS */
 
   return 0;
 }
-\f
+
+static void
+usage(int lock_method)
+{
+  printf ("Usage: movemail [-rvxkh] [-l lines ] [-m method ] [-i] inbox [-o] destfile [[-p] POP-password]\n");
+  printf("where method is one of: dot");
+#ifdef HAVE_LOCKF
+  printf(", lockf");
+#endif
+#ifdef HAVE_FLOCK
+  printf(", flock");
+#endif
+#ifdef HAVE_MMDF
+  printf(", mmdf");
+#endif
+#ifdef HAVE_LOCKING
+  printf(", locking");
+#endif
+  printf("\nDefault is: %s\n", unparse_lock_method(lock_method));
+  
+}
+
+static char *
+unparse_lock_method(int lock_method)
+{
+  switch (lock_method)
+    {
+    case DOTLOCKING: return "dot";
+    case FLOCKING:   return "flock";
+    case LOCKFING:   return "lockf";
+    case LOCKING:    return "locking";
+    case MMDF:       return "mmdf";
+    default: abort();return 0;
+    }
+}
+
+static int
+parse_lock_method(char *method_name)
+{
+  if (!strcmp("dot", method_name) || !strcmp("file", method_name))
+    return DOTLOCKING;
+#ifdef HAVE_LOCKF
+  else if (!strcmp("lockf", method_name))
+    return LOCKFING;
+#endif
+#ifdef HAVE_FLOCK
+  else if (!strcmp("flock", method_name))
+    return FLOCKING;
+#endif
+#ifdef HAVE_MMDF
+  else if (!strcmp("mmdf", method_name))
+    return MMDF;
+#endif
+#ifdef HAVE_LOCKING
+  else if (!strcmp("locking", method_name))
+    return LOCKING;
+#endif
+  else
+    fatal("invalid lock method: %s", method_name);
+  return 0; /* unreached */
+}
+
+static char *
+dot_filename(char *filename)
+{
+  return concat (filename, ".lock", "");
+}
+
+static char *dotlock_filename = NULL;
+
+static void
+lock_dot(char *filename)
+{
+  struct stat st;
+  long now;
+  int tem;
+  char *lockname, *p;
+  char *tempname;
+  int desc;
+
+  dotlock_filename = (char *) xmalloc(strlen(filename) + 1);
+
+  /* Use a lock file named after our first argument with .lock appended:
+     If it exists, the mail file is locked. */
+
+  lockname = dot_filename(filename);
+  tempname = (char *) xmalloc (strlen (filename) + strlen ("EXXXXXX") + 1);
+  strcpy (tempname, filename);
+  p = tempname + strlen (tempname);
+  while (p != tempname && !IS_DIRECTORY_SEP (p[-1]))
+    p--;
+  *p = 0;
+  strcpy (p, "EXXXXXX");
+  mktemp (tempname);
+  unlink (tempname);
+
+  for (;;)
+    {
+      /* Create the lock file, but not under the lock file name.  */
+      /* Give up if cannot do that.  */
+      desc = open (tempname, O_WRONLY | O_CREAT | O_EXCL, 0666);
+      if (desc < 0)
+       {
+         char *message = (char *) xmalloc (strlen (tempname) + 50);
+         sprintf (message, "%s--see source file lib-src/movemail.c",
+                  tempname);
+         pfatal_with_name (message);
+       }
+      close (desc);
+
+      tem = link (tempname, lockname);
+      unlink (tempname);
+      if (tem >= 0)
+       break;
+      sleep (1);
+
+      /* If lock file is five minutes old, unlock it.
+        Five minutes should be good enough to cope with crashes
+        and wedgitude, and long enough to avoid being fooled
+        by time differences between machines.  */
+      if (stat (lockname, &st) >= 0)
+       {
+         now = time (0);
+         if (st.st_ctime < now - 300)
+           unlink (lockname);
+       }
+    }
+  strcpy(dotlock_filename, filename);
+}
+
+static void
+unlock_dot(char *filename)
+{
+  unlink(dot_filename(filename));
+}
+
+static void
+maybe_unlock_dot(void)
+{
+  if (dotlock_filename)
+    unlock_dot(dotlock_filename);
+}
+
 /* Print error message and exit.  */
 
 static void
 fatal (char *s1, char *s2)
 {
-  if (delete_lockname)
-    unlink (delete_lockname);
+  maybe_unlock_dot();
   error (s1, s2, NULL);
   exit (1);
 }
@@ -568,7 +700,7 @@ xmalloc (unsigned int size)
     fatal ("virtual memory exhausted", 0);
   return result;
 }
-\f
+
 /* This is the guts of the interface to the Post Office Protocol.  */
 
 #ifdef MAIL_USE_POP
@@ -605,7 +737,7 @@ popmail (char *user, char *outfile, char *password)
   FILE *mbf;
   popserver server;
 
-  VERBOSE(("opening server\r"));
+  VERBOSE(("opening server\n"));
   server = pop_open (0, user, password, POP_NO_GETPASS);
   if (! server)
     {
@@ -613,7 +745,7 @@ popmail (char *user, char *outfile, char *password)
       return (1);
     }
 
-  VERBOSE(("stat'ing messages\r"));
+  VERBOSE(("stat'ing messages\n"));
   if (pop_stat (server, &nmsgs, &nbytes))
     {
       error (pop_error, NULL, NULL);
@@ -654,13 +786,13 @@ popmail (char *user, char *outfile, char *password)
   for (idx = 0; idx < nmsgs; idx++)
     {
       i = reverse ? nmsgs - idx : idx + 1;
-      VERBOSE(("checking message %d     \r", i));
+      VERBOSE(("checking message %d     \n", i));
       
       if (!regexp_pattern 
          || 
          pop_search_top (server, i, match_lines, regexp_pattern) == POP_RETRIEVED)
        {
-         VERBOSE(("retrieving message %d     \r", i));
+         VERBOSE(("retrieving message %d     \n", i));
           mbx_delimit_begin (mbf);
          if (pop_retr (server, i, mbx_write, mbf) != POP_RETRIEVED)
            {
@@ -689,7 +821,7 @@ popmail (char *user, char *outfile, char *password)
    *      directories have lost mail when over quota because these checks were
    *      not made in previous versions of movemail. */
 
-#ifdef BSD
+#ifdef HAVE_FSYNC
   if (fsync (mbfi) < 0)
     {
       error ("Error in fsync: %s", strerror (errno), NULL);
@@ -709,7 +841,7 @@ popmail (char *user, char *outfile, char *password)
        {
          if (retrieved_list[i] == 1)
            {
-             VERBOSE(("deleting message %d     \r", i));
+             VERBOSE(("deleting message %d     \n", i));
              if (pop_delete (server, i))
                {
                  error (pop_error, NULL, NULL);
@@ -877,7 +1009,7 @@ compile_regex (char* pattern)
 
 
 #endif /* MAIL_USE_POP */
-\f
+
 #ifndef HAVE_STRERROR
 char *
 strerror (int errnum)
index 8a9d0c3..80b4cd0 100644 (file)
@@ -104,9 +104,6 @@ char pot_etags_version[] = "@(#) pot revision number is 12.28";
 #include <stdio.h>
 #include <ctype.h>
 #include <errno.h>
-#ifndef errno
-  extern int errno;
-#endif
 #include <sys/types.h>
 #include <sys/stat.h>
 
@@ -176,9 +173,9 @@ char pot_etags_version[] = "@(#) pot revision number is 12.28";
 #ifdef OO_BROWSER
 #define set_construct(construct) \
   if (!oo_browser_construct) oo_browser_construct = construct
-void oo_browser_clear_all_globals();
-void oo_browser_clear_some_globals();
-void oo_browser_check_and_clear_structtype();
+void oo_browser_clear_all_globals(void);
+void oo_browser_clear_some_globals(void);
+void oo_browser_check_and_clear_structtype(void);
 #endif
 
 /*
@@ -200,7 +197,7 @@ void oo_browser_check_and_clear_structtype();
 
 typedef int bool;
 
-typedef void Lang_function ();
+typedef void Lang_function (FILE *);
 
 typedef struct
 {
@@ -860,9 +857,7 @@ char *massage_name (s)
 
 \f
 int
-main (argc, argv)
-     int argc;
-     char *argv[];
+main (int argc, char *argv[])
 {
   int i;
   unsigned int nincluded_files;
@@ -1654,8 +1649,7 @@ static char oo_browser_prefix;
 #endif
 
 void
-put_entries (np)
-     register node *np;
+put_entries (node *np)
 {
   register char *sp;
 
@@ -1889,9 +1883,7 @@ struct C_stab_entry { char *name; int c_ext; enum sym_type type; };
 /* maximum key range = 117, duplicates = 0 */
 
 static unsigned int
-hash (str, len)
-     register char *str;
-     register int unsigned len;
+hash (char *str, unsigned int len)
 {
   static unsigned char asso_values[] =
     {
@@ -1909,13 +1901,13 @@ hash (str, len)
       10,  62,  59, 130,  28,  27,  50,  19,   3, 130,
      130, 130, 130, 130, 130, 130, 130, 130,
     };
-  return len + asso_values[str[2]] + asso_values[str[0]];
+  return len +
+    asso_values[(unsigned char) str[2]] +
+    asso_values[(unsigned char) str[0]];
 }
 
-struct C_stab_entry *
-in_word_set (str, len)
-     register char *str;
-     register unsigned int len;
+static struct C_stab_entry *
+in_word_set (char *str, unsigned int len)
 {
   static struct C_stab_entry wordlist[] =
     {
@@ -2077,7 +2069,7 @@ enum sym_type structtype;
 
 #ifdef OO_BROWSER
 void
-oo_browser_check_and_clear_structtype()
+oo_browser_check_and_clear_structtype(void)
 {
   /* Allow for multiple enum_label tags. */
   if (structtype != st_C_enum)
@@ -2156,7 +2148,7 @@ int methodlen;
 
 #ifdef OO_BROWSER
 void
-oo_browser_clear_all_globals()
+oo_browser_clear_all_globals(void)
 {
   /* Initialize globals so there is no carry over between files. */
   oo_browser_construct = C_NULL;
@@ -2167,7 +2159,7 @@ oo_browser_clear_all_globals()
 }
 
 void
-oo_browser_clear_some_globals()
+oo_browser_clear_some_globals(void)
 {
   oo_browser_construct = C_NULL;
   structtype = st_none;
@@ -3638,8 +3630,7 @@ Fortran_functions (inf)
  * look for '^[a-zA-Z_.$][a-zA_Z0-9_.$]*[: ^I^J]'
  */
 void
-Asm_labels (inf)
-     FILE *inf;
+Asm_labels (FILE *inf)
 {
   register char *cp;
 
index c50fc14..0c12cbe 100644 (file)
@@ -21,7 +21,7 @@ Boston, MA 02111-1307, USA.  */
 
 #ifdef HAVE_CONFIG_H
 #define NO_SHORTNAMES  /* Tell config not to load remap.h */
-#include <../src/config.h>
+#include <config.h>
 #else
 #define MAIL_USE_POP
 #endif
index ec62ebb..b0ab560 100644 (file)
@@ -32,7 +32,7 @@ Boston, MA 02111-1307, USA.  */
  **  abstraction : a stopwatch
  **  operations: reset_watch, get_time
  */
-#include <../src/config.h>
+#include <config.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include "../src/systime.h"
index b7c3baa..4b82143 100644 (file)
@@ -7,7 +7,7 @@
 
 /* Synched up with: FSF 19.28. */
 
-#include <../src/config.h>
+#include <config.h>
 
 #include <stdio.h>
 #include <ctype.h>
index 979bd82..618938e 100644 (file)
@@ -1,6 +1,6 @@
 /* Program to produce output at regular intervals.  */
 
-#include <../src/config.h>
+#include <config.h>
 
 #if __STDC__ || defined(STDC_HEADERS)
 #include <stdlib.h>
index 6a76772..79d4635 100644 (file)
@@ -10,7 +10,7 @@
 /* Synched up with: FSF 19.28. */
 
 #define DONT_ENCAPSULATE
-#include <../src/config.h>
+#include <config.h>
 
 #include <stdio.h>
 #include <ctype.h>
index 4448a0d..fa41b5e 100644 (file)
@@ -56,6 +56,7 @@
 ;; `about-maintainer-info' (and maybe `about-hackers'.
 (defvar xemacs-hackers
   '((ajc      "Andrew Cosgriff"   "ajc@bing.wattle.id.au")
+    (aj       "Andreas Jaeger"    "aj@suse.de")
     (baw      "Barry Warsaw"      "bwarsaw@python.org")
     (bw       "Bob Weiner"        "weiner@beopen.com")
     (chr      "Christian Nybø"    "chr@mediascience.no")
@@ -987,6 +988,14 @@ internet startup called New Media Science, doing scripting and
 violation of HTML DTD's.  After graduation, spring 1999, he'll be
 looking for a job involving lisp programming, French and Russian.")
      (widget-insert ".\n"))
+    (aj
+     (widget-insert "\
+In the XEmacs team I'm responsible for the packages which means mainly
+applying patches and packaging the packages.
+
+I'm a software developer working for the SuSE Labs of the Linux
+distributor SuSE.  My main task is to improve the GNU C library.")
+     (widget-insert ".\n"))
 ))
 
 ;; Setup the buffer for a maintainer.
@@ -1197,6 +1206,9 @@ Originator and maintainer of the gnus.org domain.\n")
 Beta tester and last hacker of calendar.\n")
     (about-show-linked-info 'chr "\
 Maintainer of the XEmacs FAQ and proud author of `zap-up-to-char'.\n")
+    (about-show-linked-info 'aj "\
+`Package Patch Tender', beta tester and GNU libc developer.\n")
+
     (flet ((print-short (name addr &optional shortinfo)
             (concat (about-with-face name 'italic)
                     (about-tabs name)
@@ -1263,7 +1275,7 @@ above.  We couldn't have done it without them.\n\n"
        (print-short "Per Abrahamsen" "abraham@dina.kvl.dk")
        (print-short "Gary Adams" "gra@zeppo.East.Sun.COM")
        (print-short "Gennady Agranov" "agranov@csa.CS.Technion.Ac.IL")
-       (print-short "Adrian Aichner" "aichner@ecf.teradyne.com")
+       (print-short "Adrian Aichner" "adrian@xemacs.org")
        (print-short "Mark Allender" "allender@vnet.IBM.COM")
        (print-short "Stephen R. Anderson" "sra@bloch.ling.yale.edu")
        (print-short "Butch Anton" "butch@zaphod.uchicago.edu")
@@ -1360,7 +1372,6 @@ above.  We couldn't have done it without them.\n\n"
        (print-short "Tudor Hulubei" "tudor@cs.unh.edu")
        (print-short "Tatsuya Ichikawa" "ichikawa@hv.epson.co.jp")
        (print-short "Andrew Innes" "andrewi@harlequin.co.uk")
-       (print-short "Andreas Jaeger" "aj@arthur.rhein-neckar.de")
        (print-short "Markku Jarvinen" "Markku.Jarvinen@simpukka.funet.fi")
        (print-short "Robin Jeffries" "robin.jeffries@sun.com")
        (print-short "Philip Johnson" "johnson@uhics.ics.Hawaii.Edu")
index ec70873..2862234 100644 (file)
@@ -359,7 +359,7 @@ Unless you are an XEmacs maintainr, it is probably unwise to change this.")
 (defun update-file-autoloads (file)
   "Update the autoloads for FILE in `generated-autoload-file'
 \(which FILE might bind in its local variables).
-This functions refuses to update autoloads files."
+This function refuses to update autoloads files."
   (interactive "fUpdate autoloads for file: ")
   (setq file (expand-file-name file))
   (when (and (file-newer-than-file-p file generated-autoload-file)
index 983bace..734725f 100644 (file)
@@ -1,6 +1,6 @@
 ;;; cus-edit.el --- Tools for customizating Emacs and Lisp packages.
 ;;
-;; Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc.
 ;;
 ;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
 ;; Maintainer: Hrvoje Niksic <hniksic@xemacs.org>
@@ -2272,7 +2272,7 @@ Optional EVENT is the location for the menu."
   :format "%t: %v"
   :tag "Attributes"
   :extra-offset 12
-  :button-args '(:help-echo "Control whether this attribute have any effect")
+  :button-args '(:help-echo "Control whether this attribute has any effect")
   :args (mapcar (lambda (att)
                  (list 'group
                        :inline t
@@ -2756,7 +2756,7 @@ Optional EVENT is the location for the menu."
   :tag "Hook")
 
 (defun custom-hook-convert-widget (widget)
-  ;; Handle `:custom-options'.
+  ;; Handle `:options'.
   (let* ((options (widget-get widget :options))
         (other `(editable-list :inline t
                                :entry-format "%i %d%v"
index dd3397a..a9c4d34 100644 (file)
@@ -438,7 +438,9 @@ General Commands:
        (if (and (or (symbolp defn) (symbolp (setq defn (car-safe defn))))
                 defn
                 show)
-           (hyper-apropos-get-doc defn t))))))
+           (hyper-apropos-get-doc defn t))
+       (or (memq major-mode '(hyper-apropos-mode hyper-apropos-help-mode))
+         (setq hyper-apropos-prev-wconfig (current-window-configuration)))))))
 
 ;;;###autoload
 (defun hyper-describe-face (symbol &optional this-ref-buffer)
@@ -460,10 +462,9 @@ See also `hyper-apropos' and `hyper-describe-function'."
                            ": "))
                  (mapcar #'(lambda (x) (list (symbol-name x)))
                          (face-list))
-                 nil t nil 'hyper-apropos-face-history)))
-     (list (if (string= val "")
-              (progn (push (symbol-name v) hyper-apropos-face-history) v)
-            (intern-soft val))
+                 nil t nil 'hyper-apropos-face-history
+                 (and v (symbol-name v)))))
+     (list (intern-soft val)
           current-prefix-arg)))
   (if (null symbol)
       (message "Sorry, nothing to describe.")
@@ -530,10 +531,10 @@ See also `hyper-apropos' and `hyper-describe-function'."
                         (if v
                             (format " (default %s): " v)
                           ": "))
-                obarray predicate t nil 'variable-history)))
-    (if (string= val "")
-       (progn (push (symbol-name v) variable-history) v)
-      (intern-soft val))))
+                obarray predicate t nil 'variable-history
+                (and v (symbol-name v)))))
+    (intern-soft val)))
+
 ;;;###autoload
 (define-obsolete-function-alias
   'hypropos-read-variable-symbol 'hyper-apropos-read-variable-symbol)
@@ -549,10 +550,9 @@ See also `hyper-apropos' and `hyper-describe-function'."
                                     (format "%s (default %s): " prompt fn)
                                   (format "%s: " prompt))
                                 obarray 'fboundp t nil
-                                'function-history)))
-    (if (equal val "")
-       (progn (push (symbol-name fn) function-history) fn)
-      (intern-soft val))))
+                                'function-history
+                                (and fn (symbol-name fn)))))
+    (intern-soft val)))
 
 (defun hyper-apropos-last-help (arg)
   "Go back to the last symbol documented in the *Hyper Help* buffer."
index d96c5ba..d90df95 100644 (file)
@@ -437,9 +437,15 @@ nil or `never', the default, auto-generated info directory
   "List of directories to search for Info documentation files.
 
 The first directory in this list, the \"dir\" file there will become
-the (dir)Top node of the Info documentation tree.  If you wish to
-modify the info search path, use `M-x customize-variable,
-Info-directory-list' to do so.")
+the (dir)Top node of the Info documentation tree.
+
+Note: DO NOT use the `customize' interface to change the value of this
+variable.  Its value is created dynamically on each startup, depending
+on XEmacs packages installed on the system.  If you want to change the
+search path, make the needed modifications on the variable's value
+from .emacs.  For instance:
+
+    (setq Info-directory-list (cons \"~/info\" Info-directory-list))")
 
 (defcustom Info-localdir-heading-regexp
     "^Locally installed XEmacs Packages:?"
@@ -1489,12 +1495,10 @@ annotation for any node of any file.  (See `a' and `x' commands.)"
     (or (equal tag "") (Info-find-node nil (format "<<%s>>" tag)))))
 
 ;;;###autoload
-(defun Info-visit-file ()
+(defun Info-visit-file (file)
   "Directly visit an info file."
-  (interactive)
-  (let* ((insert-default-directory nil)
-        (file (read-file-name "Goto Info file: " "" "")))
-    (or (equal file "") (Info-find-node (expand-file-name file) "Top"))))
+  (interactive "fVisit Info file: ")
+  (Info-find-node (expand-file-name file) "Top"))
 
 (defun Info-restore-point (&optional always)
   "Restore point to same location it had last time we were in this node."
@@ -1513,13 +1517,33 @@ annotation for any node of any file.  (See `a' and `x' commands.)"
        (set-window-start (get-buffer-window (current-buffer))
                         (+ (nth 2 entry) (point-min)))))
 
+(defvar Info-read-node-completion-table)
+
+;; This function is used as the "completion table" while reading a node name.
+;; It does completion using the alist in Info-read-node-completion-table
+;; unless STRING starts with an open-paren.
+(defun Info-read-node-name-1 (string predicate code)
+  (let ((no-completion (and (> (length string) 0) (eq (aref string 0) ?\())))
+    (cond ((eq code nil)
+          (if no-completion
+              string
+            (try-completion string Info-read-node-completion-table predicate)))
+         ((eq code t)
+          (if no-completion
+              nil
+            (all-completions string Info-read-node-completion-table predicate)))
+         ((eq code 'lambda)
+          (if no-completion
+              t
+            (assoc string Info-read-node-completion-table))))))
+
 (defun Info-read-node-name (prompt &optional default)
   (Info-setup-initial)
   (let* ((completion-ignore-case t)
-        (nodename (completing-read prompt
-                                   (Info-build-node-completions)
-                                   nil nil nil
-                                   'Info-minibuffer-history)))
+        (Info-read-node-completion-table (Info-build-node-completions))
+        (nodename (completing-read prompt 'Info-read-node-name-1
+                                   nil t nil 'Info-minibuffer-history
+                                   default)))
     (if (equal nodename "")
        (or default
            (Info-read-node-name prompt))
@@ -1576,10 +1600,14 @@ annotation for any node of any file.  (See `a' and `x' commands.)"
 ;;;###autoload
 (defun Info-search (regexp)
   "Search for REGEXP, starting from point, and select node it's found in."
-  (interactive "sSearch (regexp): ")
-  (if (equal regexp "")
-      (setq regexp Info-last-search)
-    (setq Info-last-search regexp))
+  (interactive (list
+               (read-from-minibuffer
+                (if Info-last-search
+                    (format "Search (regexp, default %s): "
+                            Info-last-search)
+                  "Search (regexp): ")
+                nil nil nil nil nil Info-last-search)))
+  (setq Info-last-search regexp)
   (with-search-caps-disable-folding regexp t
     (let ((found ())
           (onode Info-current-node)
@@ -1666,7 +1694,7 @@ annotation for any node of any file.  (See `a' and `x' commands.)"
        (skip-chars-forward (concat (or allowedchars "^,\t\n") "("))
        (if (looking-at "(")
           (skip-chars-forward "^)")))
-     (skip-chars-backward " ")
+     (skip-chars-backward " .")
      (point))))
 
 (defun Info-next (&optional n)
@@ -1761,7 +1789,8 @@ NAME may be an abbreviation of the reference name."
                                                  default ") ")
                                        "Follow reference named: ")
                                      completions nil t nil
-                                     'Info-minibuffer-history)))
+                                     'Info-minibuffer-history
+                                     default)))
           (if (and (string= item "") default)
               (list default)
             (list item)))
@@ -1845,7 +1874,19 @@ NAME may be an abbreviation of the reference name."
          (if (looking-at ":")
              (buffer-substring beg (1- (point)))
            (skip-chars-forward " \t\n")
-           (Info-following-node-name (if multi-line "^.,\t" "^.,\t\n"))))
+           ;; Kludge.
+           ;; Allow dots in node name not followed by whitespace.
+           (re-search-forward
+            (concat "\\(([^)]+)[^."
+                    (if multi-line "" "\n")
+                    "]*\\|\\([^.,\t"
+                    (if multi-line "" "\n")
+                    ;; We consider dots followed by newline as
+                    ;; end of nodename even if multil-line.
+                    ;; Also stops at .).  It is generated by @pxref.
+                    ;; Skips sequential dots.
+                    "]\\|\\.+[^ \t\n)]\\)+\\)"))
+           (match-string 1)))
     (while (setq i (string-match "\n" str i))
       (aset str i ?\ ))
     str))
@@ -1888,7 +1929,8 @@ Completion is allowed, and the menu item point is on is the default."
                                                   default)
                                           "Menu item: ")
                                       completions nil t nil
-                                      'Info-minibuffer-history)))
+                                      'Info-minibuffer-history
+                                      default)))
         ;; we rely on the fact that completing-read accepts an input
         ;; of "" even when the require-match argument is true and ""
         ;; is not a valid possibility
@@ -2095,7 +2137,7 @@ Give a blank topic name to go to the Index node itself."
   (interactive "sIndex topic: ")
   (let ((pattern (format "\n\\* \\([^\n:]*%s[^\n:]*\\):[ \t]*%s"
                         (regexp-quote topic)
-                        "\\([^.\n]*\\)\\.[ t]*\\([0-9]*\\)"))
+                        "\\(.*\\)\\.[ t]*\\([0-9]*\\)$"))
        node)
     (message "Searching index for `%s'..." topic)
     (Info-goto-node "Top")
index 0750bc8..4439044 100644 (file)
                    (or buffer-undo-list pending-undo-list))
        :suffix (if (or (eq last-command 'undo)
                       (eq last-command 'advertised-undo))
-                      "More" "")]
+                  "More" "")]
       ["Redo" redo
        :included (fboundp 'redo)
        :active (not (or (eq buffer-undo-list t)
-                        (eq last-buffer-undo-list nil)
-                        (not (or (eq last-buffer-undo-list buffer-undo-list)
-                                 (and (null (car-safe buffer-undo-list))
-                                      (eq last-buffer-undo-list
-                                          (cdr-safe buffer-undo-list)))))
-                        (or (eq buffer-undo-list pending-undo-list)
-                            (eq (cdr buffer-undo-list) pending-undo-list))))
+                       (eq last-buffer-undo-list nil)
+                       (not (or (eq last-buffer-undo-list buffer-undo-list)
+                                (and (null (car-safe buffer-undo-list))
+                                     (eq last-buffer-undo-list
+                                         (cdr-safe buffer-undo-list)))))
+                       (or (eq buffer-undo-list pending-undo-list)
+                           (eq (cdr buffer-undo-list) pending-undo-list))))
        :suffix (if (eq last-command 'redo) "More" "")]
       ["Cut" kill-primary-selection
        :active (selection-owner-p)]
          (force-cursor-redisplay))
        :style radio
        :selected (eq bar-cursor t)]
-       ["Bar cursor (2 pixels)"
-        (progn
-          (customize-set-variable 'bar-cursor 2)
-          (force-cursor-redisplay))
-        :style radio
-        :selected (and bar-cursor (not (eq bar-cursor t)))]
-       "------"
-       ["Line Numbers"
-        (progn
-          (customize-set-variable 'line-number-mode (not line-number-mode))
-          (redraw-modeline))
-        :style toggle :selected line-number-mode]
-       ["Column Numbers"
-        (progn
-          (customize-set-variable 'column-number-mode
-                                  (not column-number-mode))
-          (redraw-modeline))
-        :style toggle :selected column-number-mode]
+       ["Bar cursor (2 pixels)"
+       (progn
+         (customize-set-variable 'bar-cursor 2)
+         (force-cursor-redisplay))
+       :style radio
+       :selected (and bar-cursor (not (eq bar-cursor t)))]
+       "------"
+       ["Line Numbers"
+       (progn
+         (customize-set-variable 'line-number-mode (not line-number-mode))
+         (redraw-modeline))
+       :style toggle :selected line-number-mode]
+       ["Column Numbers"
+       (progn
+         (customize-set-variable 'column-number-mode
+                                 (not column-number-mode))
+         (redraw-modeline))
+       :style toggle :selected column-number-mode]
        )
       ("Menubar Appearance"
        ["Buffers Menu Length..."
@@ -1142,11 +1142,16 @@ Sorts the buffers in alphabetical order by name, but puts buffers beginning
 with a star at the end of the list."
   (let* ((nam1 (buffer-name buf1))
         (nam2 (buffer-name buf2))
+        (inv1p (not (null (string-match "\\` " nam1))))
+        (inv2p (not (null (string-match "\\` " nam2))))
         (star1p (not (null (string-match "\\`*" nam1))))
         (star2p (not (null (string-match "\\`*" nam2)))))
-    (if (not (eq star1p star2p))
-       (not star1p)
-      (string-lessp nam1 nam2))))
+    (cond ((not (eq inv1p inv2p))
+          (not inv1p))
+         ((not (eq star1p star2p))
+          (not star1p))
+         (t
+          (string-lessp nam1 nam2)))))
 
 (defun sort-buffers-menu-by-mode-then-alphabetically (buf1 buf2)
   "For use as a value of `buffers-menu-sort-function'.
@@ -1154,15 +1159,23 @@ Sorts first by major mode and then alphabetically by name, but puts buffers
 beginning with a star at the end of the list."
   (let* ((nam1 (buffer-name buf1))
         (nam2 (buffer-name buf2))
+        (inv1p (not (null (string-match "\\` " nam1))))
+        (inv2p (not (null (string-match "\\` " nam2))))
         (star1p (not (null (string-match "\\`*" nam1))))
         (star2p (not (null (string-match "\\`*" nam2))))
         (mode1 (symbol-value-in-buffer 'major-mode buf1))
         (mode2 (symbol-value-in-buffer 'major-mode buf2)))
-    (cond ((not (eq star1p star2p)) (not star1p))
+    (cond ((not (eq inv1p inv2p))
+          (not inv1p))
+         ((not (eq star1p star2p))
+          (not star1p))
          ((and star1p star2p (string-lessp nam1 nam2)))
-         ((string-lessp mode1 mode2) t)
-         ((string-lessp mode2 mode1) nil)
-         (t (string-lessp nam1 nam2)))))
+         ((string-lessp mode1 mode2)
+          t)
+         ((string-lessp mode2 mode1)
+          nil)
+         (t
+          (string-lessp nam1 nam2)))))
 
 ;; this version is too slow on some machines.
 (defun slow-format-buffers-menu-line (buffer)
@@ -1544,4 +1557,4 @@ The menu is computed by combining `global-popup-menu' and `mode-popup-menu'."
 (provide 'x-menubar)
 (provide 'menubar-items)
 
-;;; x-menubar.el ends here.
+;;; menubar-items.el ends here.
index 9f26bc5..af83e9c 100644 (file)
@@ -77,10 +77,12 @@ t means to return a list of all possible completions of STRING.
 (defvar minibuffer-completion-confirm nil
   "Non-nil => demand confirmation of completion before exiting minibuffer.")
 
-(defvar minibuffer-confirm-incomplete nil
+(defcustom minibuffer-confirm-incomplete nil
   "If true, then in contexts where completing-read allows answers which
 are not valid completions, an extra RET must be typed to confirm the
-response.  This is helpful for catching typos, etc.")
+response.  This is helpful for catching typos, etc."
+  :type 'boolean
+  :group 'minibuffer)
 
 (defcustom completion-auto-help t
   "*Non-nil means automatically provide help for invalid completion input."
@@ -1248,7 +1250,9 @@ With prefix argument N, search for Nth previous match.
 If N is negative, find the next or Nth next match."
   (interactive
    (let ((enable-recursive-minibuffers t)
-        (minibuffer-history-sexp-flag nil))
+        (minibuffer-history-sexp-flag nil)
+        (minibuffer-max-depth (and minibuffer-max-depth
+                                   (1+ minibuffer-max-depth))))
      (if (eq 't (symbol-value minibuffer-history-variable))
         (error "History is not being recorded in this context"))
      (list (read-from-minibuffer "Previous element matching (regexp): "
@@ -1296,7 +1300,9 @@ With prefix argument N, search for Nth next match.
 If N is negative, find the previous or Nth previous match."
   (interactive
    (let ((enable-recursive-minibuffers t)
-        (minibuffer-history-sexp-flag nil))
+        (minibuffer-history-sexp-flag nil)
+        (minibuffer-max-depth (and minibuffer-max-depth
+                                   (1+ minibuffer-max-depth))))
      (if (eq t (symbol-value minibuffer-history-variable))
         (error "History is not being recorded in this context"))
      (list (read-from-minibuffer "Next element matching (regexp): "
@@ -1646,7 +1652,7 @@ only existing buffer names are allowed."
 This will prompt with a dialog box if appropriate, according to
  `should-use-dialog-box-p'.
 Value is not expanded---you must call `expand-file-name' yourself.
-Value is subject to interpreted by substitute-in-file-name however.
+Value is subject to interpretation by `substitute-in-file-name' however.
 Default name to DEFAULT if user enters a null string.
  (If DEFAULT is omitted, the visited file name is used,
   except that if INITIAL-CONTENTS is specified, that combined with DIR is
index ea16c56..778d2c9 100644 (file)
@@ -19,7 +19,7 @@
 ;; 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 
+;; along with XEmacs; see the file COPYING.  If not, write to the
 ;; Free Software Foundation, 59 Temple Place - Suite 330,
 ;; Boston, MA 02111-1307, USA.
 
@@ -59,11 +59,36 @@ buffer list and clicking on the right half cycles backward."
   :type 'boolean
   :group 'modeline)
 
+(defcustom modeline-scrolling-method nil
+  "*If non-nil, dragging the modeline with the mouse may also scroll its
+text horizontally (vertical motion controls window resizing and horizontal
+motion controls modeline scrolling).
+
+With a value of t, the modeline text is scrolled in the same direction as
+the mouse motion. With a value of 'scrollbar, the modeline is considered as
+a scrollbar for its own text, which then moves in the opposite direction."
+  :type '(choice (const :tag "none" nil)
+                (const :tag "text" t)
+                (const :tag "scrollbar" scrollbar))
+  :set (lambda (sym val)
+        (set-default sym val)
+        (when (featurep 'x)
+          (cond ((eq val t)
+                 (set-glyph-image modeline-pointer-glyph "hand2" 'global 'x))
+                ((eq val 'scrollbar)
+                 (set-glyph-image modeline-pointer-glyph "fleur" 'global 'x))
+                (t
+                 (set-glyph-image modeline-pointer-glyph "sb_v_double_arrow"
+                                  'global 'x)))))
+  :group 'modeline)
+
 (defun mouse-drag-modeline (event)
   "Resize a window by dragging its modeline.
 This command should be bound to a button-press event in modeline-map.
 Holding down a mouse button and moving the mouse up and down will
-make the clicked-on window taller or shorter."
+make the clicked-on window taller or shorter.
+
+See also the variable `modeline-scrolling-method'."
   (interactive "e")
   (or (button-press-event-p event)
       (error "%s must be invoked by a mouse-press" this-command))
@@ -79,9 +104,9 @@ make the clicked-on window taller or shorter."
          (start-event-frame (event-frame event))
          (start-event-window (event-window event))
          (start-nwindows (count-windows t))
-;;       (hscroll-delta (face-width 'modeline))
-;;       (start-hscroll (modeline-hscroll (event-window event)))
-;        (start-x-pixel (event-x-pixel event))
+         (hscroll-delta (face-width 'modeline))
+         (start-hscroll (modeline-hscroll (event-window event)))
+         (start-x-pixel (event-x-pixel event))
          (last-timestamp 0)
          default-line-height
          modeline-height
@@ -141,7 +166,9 @@ make the clicked-on window taller or shorter."
               ;; scroll) nore Y pos (modeline drag) have changed.
               (and modeline-click-swaps-buffers
                    (= depress-line (event-y event))
-;;                 (= start-hscroll (modeline-hscroll start-event-window))
+                   (or (not modeline-scrolling-method)
+                       (= start-hscroll
+                          (modeline-hscroll start-event-window)))
                    (modeline-swap-buffers event)))
              ((button-event-p event)
               (setq done t))
@@ -153,11 +180,14 @@ make the clicked-on window taller or shorter."
                  drag-divider-event-lag)
               nil)
              (t
-;;              (set-modeline-hscroll start-event-window
-;;                                    (+ (/ (- (event-x-pixel event) 
-;;                                             start-x-pixel)
-;;                                          hscroll-delta)
-;;                                       start-hscroll))
+              (when modeline-scrolling-method
+                (let ((delta (/ (- (event-x-pixel event) start-x-pixel)
+                                hscroll-delta)))
+                  (set-modeline-hscroll start-event-window
+                                        (if (eq modeline-scrolling-method t)
+                                            (- start-hscroll delta)
+                                          (+ start-hscroll delta)))
+                  ))
               (setq last-timestamp (event-timestamp event)
                     y (event-y-pixel event)
                     edges (window-pixel-edges start-event-window)
@@ -263,7 +293,7 @@ the buffer of the window whose modeline was clicked upon.")
 (make-face 'modeline-mousable "Face for mousable portions of the modeline.")
 (set-face-parent 'modeline-mousable 'modeline nil '(default))
 (when (featurep 'window-system)
-  (set-face-foreground 'modeline-mousable 
+  (set-face-foreground 'modeline-mousable
                       '(((default color x) . "firebrick")
                         ((default color mswindows) . "firebrick"))
                         'global))
@@ -307,7 +337,7 @@ in the list takes precedence.")
                       '(((default color x) . "green4")
                         ((default color x) . "forestgreen")
                         ((default color mswindows) . "green4")
-                        ((default color mswindows) . "forestgreen")) 
+                        ((default color mswindows) . "forestgreen"))
                       'global))
 
 (defvar modeline-mousable-minor-mode-extent (make-extent nil nil)
@@ -391,7 +421,7 @@ Example: (add-minor-mode 'view-minor-mode \" View\" view-mode-map)"
               name)))
        (if (setq el (assq toggle minor-mode-alist))
            (setcdr el (list hacked-name))
-         (funcall add-elt 
+         (funcall add-elt
                   (list toggle hacked-name)
                   'minor-mode-alist))))
     (when keymap
@@ -508,7 +538,7 @@ parentheses on the modeline."
           "Face for the buffer ID string in the modeline.")
 (set-face-parent 'modeline-buffer-id 'modeline nil '(default))
 (when (featurep 'window-system)
-  (set-face-foreground 'modeline-buffer-id 
+  (set-face-foreground 'modeline-buffer-id
                       '(((default color x) . "blue4")
                         ((default color mswindows) . "blue4"))
                       'global))
@@ -521,7 +551,7 @@ parentheses on the modeline."
 (defvar modeline-buffer-id-extent (make-extent nil nil)
   "Extent covering the whole of the buffer-id string.")
 (set-extent-face modeline-buffer-id-extent 'modeline-buffer-id)
-  
+
 (defvar modeline-buffer-id-left-extent (make-extent nil nil)
 "Extent covering the left half of the buffer-id string.")
 (set-extent-keymap modeline-buffer-id-left-extent
index 9b4906e..2a411dd 100644 (file)
@@ -163,8 +163,8 @@ If each element of LIST is not a string, it is converted to string
 (defalias 'sref 'aref)
 (defalias 'map-char-concat 'mapcar)
 (defun char-bytes (character)
-  "Return number of length a CHARACTER occupies in a string or buffer.
-It returns only 1 in XEmacs.  It is for compatibility with MULE 2.3."
+  "Return number of bytes a CHARACTER occupies in a string or buffer.
+It always returns 1 in XEmacs.  It is for compatibility with MULE 2.3."
   1)
 (defalias 'char-length 'char-bytes)
 
@@ -208,19 +208,6 @@ because its `find-charset-string' ignores ASCII charset."
 ;      (cons charset dest)
 ;      ))))
 
-(defun char-octet (ch &optional n)
-  "Return the octet numbered N (should be 0 or 1) of char CH.
-N defaults to 0 if omitted."
-  (let ((split (split-char ch)))
-    (setq n (or n 0))
-    (cond ((eq n 0)
-          (nth 1 split))
-         ((eq n 1)
-          (nth 2 split))
-         (t (error "n must be 0 or 1")))))
-;; Made obsolete June 15, 1999.  Delete ASAP.
-(make-obsolete 'char-octet "Use split-char")
-
 ;(defun split-char-or-char-int (char)
 ;  "Return list of charset and one or two position-codes of CHAR.
 ;CHAR must be character or integer."
index 0e3d478..db05e32 100644 (file)
@@ -321,7 +321,7 @@ Ouput 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'
-are usually fine.)  Note further that UDP protocol does not guard against 
+are usually fine.)  Note further that UDP protocol does not guard against
 lost packets."
   (open-network-stream-internal name buffer host service protocol))
 
@@ -342,13 +342,11 @@ lost packets."
                start (1+ end)))
        (concat result (substring argument start))))))
 
-(defun exec-to-string (command)
-  "Execute COMMAND as an external process and return the output of that
-process as a string"
-  ;; by "William G. Dubuque" <wgd@zurich.ai.mit.edu>
+(defun shell-command-to-string (command)
+  "Execute shell command COMMAND and return its output as a string."
   (with-output-to-string
     (call-process shell-file-name nil t nil shell-command-switch command)))
 
-(defalias 'shell-command-to-string 'exec-to-string)
+(defalias 'exec-to-string 'shell-command-to-string)
 
 ;;; process.el ends here
index 655f241..8e6ab44 100644 (file)
@@ -1,3 +1,27 @@
+2000-01-18  Martin Buchholz <martin@xemacs.org>
+
+       * XEmacs 21.2.27 is released.
+
+2000-01-15  Andy Piper  <andy@xemacs.org>
+
+       * lwlib-Xlw.c (lw_update_one_widget): make sure global
+       properties gets set.
+
+2000-01-07  Martin Buchholz  <martin@xemacs.org>
+
+       * config.h.in (ATHENA_INCLUDE): CPP trickery to make old cpps happy.
+       This extends support for gcc 2.6 (e.g. on BSD/OS 2.0)
+
+       * lwlib.c: Fix up memset calls.
+
+       * lwlib-Xm.c (xm_update_text): Warning suppression.
+       (xm_update_text_field): Warning suppression.
+
+2000-01-03  Martin Buchholz  <martin@xemacs.org>
+
+       * lwlib-Xaw.c (xaw_update_one_widget): Emergency fix for this crash:
+       (yes-or-no-p-dialog-box "Yes or No")
+
 1999-12-31  Martin Buchholz <martin@xemacs.org>
 
        * XEmacs 21.2.26 is released.
index d94cb09..de51ba5 100644 (file)
@@ -32,9 +32,12 @@ Boston, MA 02111-1307, USA.  */
 /* The path to the Athena widgets - the usual value is `X11/Xaw' */
 #undef ATHENA_H_PATH
 
-/* For use in #include statements.  This extra level of macro indirection
-   is necessary because you can't use macros directly within <> or "" */
-#define ATHENA_INCLUDE(header_file) <ATHENA_H_PATH/header_file>
+/* For use in #include statements.
+   You can't use macros directly within the <> of a #include statement.
+   The multiply nested macros are necessary to make old gcc's happy. */
+#define INCLUDE_GLUE_2(dirname,basename) <##dirname##/##basename##>
+#define INCLUDE_GLUE_1(dirname,basename) INCLUDE_GLUE_2(dirname,basename)
+#define ATHENA_INCLUDE(header_file) INCLUDE_GLUE_1(ATHENA_H_PATH,header_file)
 
 
 #endif /* _LWLIB_CONFIG_H_ */
index 77aeb48..5329976 100644 (file)
@@ -146,7 +146,7 @@ xaw_update_one_widget (widget_instance *instance, Widget widget,
       }
 #endif /* LWLIB_DIALOGS_ATHENA */
 #ifdef LWLIB_WIDGETS_ATHENA
-  else if (XtIsSubclass (widget, labelWidgetClass))
+  else if (XtClass (widget) == labelWidgetClass)
       {
        Arg al [1];
        XtSetArg (al [0], XtNlabel, val->value);
index 8063c7c..e4e91d6 100644 (file)
@@ -536,6 +536,9 @@ xlw_update_one_widget (widget_instance* instance, Widget widget,
                       widget_value* val, Boolean deep_p)
 {
   WidgetClass class = XtClass (widget);
+  /* Update up global arg values. */
+  if (val->args && val->args->nargs)
+    XtSetValues (widget, val->args->args, val->args->nargs);
 
   if (0)
     ;
index 85db133..99db011 100644 (file)
@@ -680,7 +680,7 @@ xm_update_menu (widget_instance* instance, Widget widget, widget_value* val,
 static void
 xm_update_text (widget_instance* instance, Widget widget, widget_value* val)
 {
-  XmTextSetString (widget, val->value ? val->value : "");
+  XmTextSetString (widget, val->value ? val->value : (char *) "");
   XtRemoveAllCallbacks (widget, XmNactivateCallback);
   XtAddCallback (widget, XmNactivateCallback, xm_generic_callback, instance);
   XtRemoveAllCallbacks (widget, XmNvalueChangedCallback);
@@ -692,7 +692,7 @@ static void
 xm_update_text_field (widget_instance* instance, Widget widget,
                      widget_value* val)
 {
-  XmTextFieldSetString (widget, val->value ? val->value : "");
+  XmTextFieldSetString (widget, val->value ? val->value : (char *) "");
   XtRemoveAllCallbacks (widget, XmNactivateCallback);
   XtAddCallback (widget, XmNactivateCallback, xm_generic_callback, instance);
   XtRemoveAllCallbacks (widget, XmNvalueChangedCallback);
index f55f092..1ecef08 100644 (file)
@@ -111,7 +111,7 @@ malloc_widget_value (void)
     }
   if (wv)
     {
-      memset (wv, 0, sizeof (widget_value));
+      memset (wv, '\0', sizeof (widget_value));
     }
   return wv;
 }
@@ -188,7 +188,7 @@ copy_scrollbar_values (widget_value *val, widget_value *copy)
   if (val->scrollbar_data)
     *copy->scrollbar_data = *val->scrollbar_data;
   else
-    memset (copy->scrollbar_data, 0, sizeof (scrollbar_values));
+    memset (copy->scrollbar_data, '\0', sizeof (scrollbar_values));
 }
 
 /*
@@ -358,7 +358,7 @@ free_widget_info (widget_info *info)
   safe_free_str (info->type);
   safe_free_str (info->name);
   free_widget_value_tree (info->val);
-  memset ((void*)info, 0xDEADBEEF, sizeof (widget_info));
+  memset (info, '\0', sizeof (widget_info));
   free (info);
 }
 
@@ -393,7 +393,7 @@ allocate_widget_instance (widget_info *info, Widget parent, Boolean pop_up_p)
 static void
 free_widget_instance (widget_instance *instance)
 {
-  memset ((void *) instance, 0xDEADBEEF, sizeof (widget_instance));
+  memset (instance, '\0', sizeof (widget_instance));
   free (instance);
 }
 
@@ -1368,11 +1368,11 @@ void lw_add_widget_value_arg (widget_value* wv, String name, XtArgVal value)
   if (!wv->args)
     {
       wv->args = (widget_args *) malloc (sizeof (widget_args));
-      memset (wv->args, 0, sizeof (widget_args));
+      memset (wv->args, '\0', sizeof (widget_args));
       wv->args->ref_count = 1;
       wv->args->nargs = 0;
       wv->args->args = (ArgList) malloc (sizeof (Arg) * 10);
-      memset (wv->args->args, 0, sizeof (Arg) * 10);
+      memset (wv->args->args, '\0', sizeof (Arg) * 10);
     }
   
   if (wv->args->nargs > 10)
index a163690..cefb9e8 100644 (file)
@@ -1,3 +1,78 @@
+2000-01-18  Martin Buchholz <martin@xemacs.org>
+
+       * XEmacs 21.2.27 is released.
+
+2000-01-17  Yoshiki Hayashi  <t90553@mail.ecc.u-tokyo.ac.jp>
+
+       * xemacs/regs.texi: Synch with FSF 20.5.
+
+2000-01-14  Yoshiki Hayashi  <t90553@mail.ecc.u-tokyo.ac.jp>
+
+       * info.texi: Change cross reference from emacs to xemacs.
+
+2000-01-14  Yoshiki Hayashi  <t90553@mail.ecc.u-tokyo.ac.jp>
+
+       * xemacs/mini.texi: Synch with FSF 20.5.  Update.
+
+2000-01-16  Martin Buchholz  <martin@xemacs.org>
+
+       * xemacs-faq.texi (Q2.1.15): Fix up @table formatting.
+
+2000-01-14  Martin Buchholz  <martin@xemacs.org>
+
+       * xemacs-faq.texi (Q2.1.15): Update dbx/gdb debugging info.
+
+2000-01-14  Sandra Wambold  <wambold@xemacs.org>
+
+       * xemacs-faq.texi: removed out-of-date XEmacs 19 questions.
+
+2000-01-14  Sandra Wambold  <wambold@xemacs.org>
+
+       * xemacs-faq.texi: Updated Macintosh information,
+       updated OS/2 info, changed turn-on-pending-delete answer.
+
+2000-01-08  Martin Buchholz  <martin@xemacs.org>
+
+       * xemacs-faq.texi (Q2.1.15): Make debugging info current.
+
+2000-01-08  Hrvoje Niksic  <hniksic@iskon.hr>
+
+       * lispref/control.texi (Signaling Errors): Document that `signal'
+       is continuable.
+       (Signaling Errors): Document `cerror', `signal-error', and
+       `check-argument-type'.
+       (Handling Errors): Mention `debug-on-signal'.
+       (Error Symbols): Document `define-error'.
+       (Processing of Errors): Document `display-error' and
+       `error-message-string'.
+
+2000-01-05  Yoshiki Hayashi  <t90553@mail.ecc.u-tokyo.ac.jp>
+
+       * internals/internals.texi: Remove latin-1 char.
+
+2000-01-05  Didier Verna  <didier@xemacs.org>
+
+       * xemacs/custom.texi (Key bindings using strings): add missing
+       whitespace.
+
+       * xemacs/xemacs.texi (Top):
+       * new-users-guide/new-users-guide.texi (Top): add missing `@top'
+       node.
+
+1999-12-24  Yoshiki Hayashi  <t90553@mail.ecc.u-tokyo.ac.jp>
+
+       * lispref/minibuf.texi (Reading a Password): New section.
+
+1999-12-21  Yoshiki Hayashi  <t90553@mail.ecc.u-tokyo.ac.jp>
+
+       * lispref/minibuf.texi: Remove documentation about
+       minibuffer-local-ns-map, read-no-blanks-input.
+
+1999-12-21  Yoshiki Hayashi  <t90553@mail.ecc.u-tokyo.ac.jp>
+
+       * lispref/minibuf.texi: Partial Synch with FSF manual.
+       Add description about DEFAULT argument of reading functions.
+
 1999-12-31  Martin Buchholz <martin@xemacs.org>
 
        * XEmacs 21.2.26 is released.
index e9eab51..bd827ee 100644 (file)
@@ -3,7 +3,7 @@
 @setfilename ../info/info.info
 @settitle Info
 @comment %**end of header
-@comment $Id: info.texi,v 1.4.2.3 1999/12/05 19:02:24 martinb Exp $
+@comment $Id: info.texi,v 1.4.2.4 2000/01/18 07:27:42 yoshiki Exp $
 
 @dircategory Texinfo documentation system
 @direntry
@@ -855,9 +855,10 @@ node of the file with Emacs Info mode.
 
 The following variables may modify the behaviour 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, emacs, The GNU Emacs
-Manual}.
+in your @file{~/.emacs} init file.  @xref{Examining, Examining and
+Setting Variables, Examining and Setting Variables, xemacs, XEmacs
+User's Manual}.
+
 
 @vtable @code
 @item Info-enable-edit
index f738f74..81b32d4 100644 (file)
@@ -2650,8 +2650,8 @@ Unfortunately, Emacs Lisp is slow, and is going to stay slow.  Function
 calls in elisp are especially expensive.  Iterating over a long list is
 going to be 30 times faster implemented in C than in Elisp.
 
-To get started debugging XEmacs, take a look at the @file{gdbinit} and
-@file{dbxrc} files in the @file{src} directory.
+To get started debugging XEmacs, take a look at the @file{.gdbinit} and
+@file{.dbxrc} files in the @file{src} directory.
 @xref{Q2.1.15 - How to Debug an XEmacs problem with a debugger,,,
 xemacs-faq, XEmacs FAQ}.
 
@@ -4993,7 +4993,7 @@ The first thing that is checked while marking an object is whether the
 object is a real Lisp object @code{Lisp_Type_Record} or just an integer
 or a character. Integers and characters are the only two types that are
 stored directly - without another level of indirection, and therefore they
-don´t have to be marked and collected. 
+don't have to be marked and collected. 
 @xref{How Lisp Objects Are Represented in C}.
 
 The second case is the one we have to handle. It is the one when we are
@@ -5033,7 +5033,7 @@ bulkier objects are allocated and handled using that scheme of
 @code{lcrecords}. Each object is @code{malloc}ed separately
 instead of placing it in one of the contiguous frob blocks. All types
 that are currently stored 
-using @code{lcrecords}´s  @code{alloc_lcrecord} and
+using @code{lcrecords}'s  @code{alloc_lcrecord} and
 @code{make_lcrecord_list} are the types: vectors, buffers,
 char-table, char-table-entry, console, weak-list, database, device,
 ldap, hash-table, command-builder, extent-auxiliary, extent-info, face,
index 5ea470f..4588d48 100644 (file)
@@ -662,7 +662,7 @@ instead.  @xref{Catch and Throw}.
 which you call for other purposes, such as if you try to take the
 @sc{car} of an integer or move forward a character at the end of the
 buffer; you can also signal errors explicitly with the functions
-@code{error} and @code{signal}.
+@code{error}, @code{signal}, and others.
 
   Quitting, which happens when the user types @kbd{C-g}, is not 
 considered an error, but it is handled almost like an error.
@@ -673,6 +673,11 @@ This function signals an error with an error message constructed by
 applying @code{format} (@pxref{String Conversion}) to
 @var{format-string} and @var{args}.
 
+This error is not continuable: you cannot continue execution after the
+error using the debugger @kbd{r} or @kbd{c} commands.  If you wish the
+user to be able to continue execution, use @code{cerror} or
+@code{signal} instead.
+
 These examples show typical uses of @code{error}:
 
 @example
@@ -691,7 +696,8 @@ These examples show typical uses of @code{error}:
 
 @code{error} works by calling @code{signal} with two arguments: the
 error symbol @code{error}, and a list containing the string returned by
-@code{format}.
+@code{format}.  This is repeated in an endless loop, to ensure that
+@code{error} never returns.
 
 If you want to use your own string as an error message verbatim, don't
 just write @code{(error @var{string})}.  If @var{string} contains
@@ -699,10 +705,16 @@ just write @code{(error @var{string})}.  If @var{string} contains
 results.  Instead, use @code{(error "%s" @var{string})}.
 @end defun
 
+@defun cerror format-string &rest args
+This function behaves like @code{error}, except that the error it
+signals is continuable.  That means that debugger commands @kbd{c} and
+@kbd{r} can resume execution.
+@end defun
+
 @defun signal error-symbol data
-This function signals an error named by @var{error-symbol}.  The
-argument @var{data} is a list of additional Lisp objects relevant to the
-circumstances of the error.
+This function signals a continuable error named by @var{error-symbol}.
+The argument @var{data} is a list of additional Lisp objects relevant to
+the circumstances of the error.
 
 The argument @var{error-symbol} must be an @dfn{error symbol}---a symbol
 bearing a property @code{error-conditions} whose value is a list of
@@ -710,9 +722,9 @@ condition names.  This is how XEmacs Lisp classifies different sorts of
 errors.
 
 The number and significance of the objects in @var{data} depends on
-@var{error-symbol}.  For example, with a @code{wrong-type-arg} error,
-there are two objects in the list: a predicate that describes the type
-that was expected, and the object that failed to fit that type.
+@var{error-symbol}.  For example, with a @code{wrong-type-argument}
+error, there are two objects in the list: a predicate that describes the
+type that was expected, and the object that failed to fit that type.
 @xref{Error Symbols}, for a description of error symbols.
 
 Both @var{error-symbol} and @var{data} are available to any error
@@ -721,8 +733,10 @@ variable to a list of the form @code{(@var{error-symbol} .@:
 @var{data})} (@pxref{Handling Errors}).  If the error is not handled,
 these two values are used in printing the error message.
 
-The function @code{signal} never returns (though in older Emacs versions
-it could sometimes return).
+The function @code{signal} can return, if the debugger is invoked and
+the user invokes the ``return from signal'' option.  If you want the
+error not to be continuable, use @code{signal-error} instead.  Note that
+in FSF Emacs @code{signal} never returns.
 
 @smallexample
 @group
@@ -731,17 +745,42 @@ it could sometimes return).
 @end group
 
 @group
-(signal 'no-such-error '("My unknown error condition."))
-     @error{} peculiar error: "My unknown error condition."
+(signal 'no-such-error '("My unknown error condition"))
+     @error{} Peculiar error (no-such-error "My unknown error condition")
 @end group
 @end smallexample
 @end defun
 
-@cindex CL note---no continuable errors
-@quotation
-@b{Common Lisp note:} XEmacs Lisp has nothing like the Common Lisp
-concept of continuable errors.
-@end quotation
+@defun signal-error error-symbol data
+This function behaves like @code{signal}, except that the error it
+signals is not continuable.
+@end defun
+
+@defmac check-argument-type predicate argument
+This macro checks that @var{argument} satisfies @var{predicate}.  If
+that is not the case, it signals a continuable
+@code{wrong-type-argument} error until the returned value satisfies
+@var{predicate}, and assigns the returned value to @var{argument}.  In
+other words, execution of the program will not continue until
+@var{predicate} is met.
+
+@var{argument} is not evaluated, and should be a symbol.
+@var{predicate} is evaluated, and should name a function.
+
+As shown in the following example, @code{check-argument-type} is useful
+in low-level code that attempts to ensure the sanity of its data before
+proceeding.
+
+@example
+@group
+(defun cache-object-internal (object wlist)
+  ;; @r{Before doing anything, make sure that @var{wlist} is indeed}
+  ;; @r{a weak list, which is what we expect.}
+  (check-argument-type 'weak-list-p wlist)
+  @dots{})
+@end group
+@end example
+@end defmac
 
 @node Processing of Errors
 @subsubsection How XEmacs Processes Errors
@@ -761,6 +800,27 @@ command loop has an implicit handler for all kinds of errors.  The
 command loop's handler uses the error symbol and associated data to
 print an error message.
 
+Errors in command loop are processed using the @code{command-error}
+function, which takes care of some necessary cleanup, and prints a
+formatted error message to the echo area.  The functions that do the
+formatting are explained below.
+
+@defun display-error error-object stream
+This function displays @var{error-object} on @var{stream}.
+@var{error-object} is a cons of error type, a symbol, and error
+arguments, a list.  If the error type symbol of one of its error
+condition superclasses has an @code{display-error} property, that
+function is invoked for printing the actual error message.  Otherwise,
+the error is printed as @samp{Error: arg1, arg2, ...}.
+@end defun
+
+@defun error-message-string error-object
+This function converts @var{error-object} to an error message string,
+and returns it.  The message is equivalent to the one that would be
+printed by @code{display-error}, except that it is conveniently returned
+in string form.
+@end defun
+
 @cindex @code{debug-on-error} use
 An error that has no explicit handler may call the Lisp debugger.  The
 debugger is enabled if the variable @code{debug-on-error} (@pxref{Error
@@ -834,6 +894,13 @@ predictable, such as failure to open a file in a call to
 totally unpredictable, such as when the program evaluates an expression
 read from the user.
 
+@cindex @code{debug-on-signal} use
+  Even when an error is handled, the debugger may still be called if the
+variable @code{debug-on-signal} (@pxref{Error Debugging}) is
+non-@code{nil}.  Note that this may yield unpredictable results with
+code that traps expected errors as normal part of its operation.  Do not
+set @code{debug-on-signal} unless you know what you are doing.
+
   Error signaling and handling have some resemblance to @code{throw} and
 @code{catch}, but they are entirely separate facilities.  An error
 cannot be caught by a @code{catch}, and a @code{throw} cannot be handled
@@ -917,7 +984,9 @@ message and returns a very large number.
 @end smallexample
 
 @noindent
-The handler specifies condition name @code{arith-error} so that it will handle only division-by-zero errors.  Other kinds of errors will not be handled, at least not by this @code{condition-case}.  Thus,
+The handler specifies condition name @code{arith-error} so that it will
+handle only division-by-zero errors.  Other kinds of errors will not be
+handled, at least not by this @code{condition-case}.  Thus,
 
 @smallexample
 @group
@@ -972,43 +1041,49 @@ one or more condition names: @code{error}, the error symbol if that
 is distinct from @code{error}, and perhaps some intermediate
 classifications.
 
-  In order for a symbol to be an error symbol, it must have an
-@code{error-conditions} property which gives a list of condition names.
-This list defines the conditions that this kind of error belongs to.
-(The error symbol itself, and the symbol @code{error}, should always be
-members of this list.)  Thus, the hierarchy of condition names is
-defined by the @code{error-conditions} properties of the error symbols.
-
-  In addition to the @code{error-conditions} list, the error symbol
-should have an @code{error-message} property whose value is a string to
-be printed when that error is signaled but not handled.  If the
-@code{error-message} property exists, but is not a string, the error
-message @samp{peculiar error} is used.
-@cindex peculiar error
+  In other words, each error condition @dfn{inherits} from another error
+condition, with @code{error} sitting at the top of the inheritance
+hierarchy.
+
+@defun define-error error-symbol error-message &optional inherits-from
+  This function defines a new error, denoted by @var{error-symbol}.
+@var{error-message} is an informative message explaining the error, and
+will be printed out when an unhandled error occurs.  @var{error-symbol}
+is a sub-error of @var{inherits-from} (which defaults to @code{error}).
+
+  @code{define-error} internally works by putting on @var{error-symbol}
+an @code{error-message} property whose value is @var{error-message}, and
+an @code{error-conditions} property that is a list of @var{error-symbol}
+followed by each of its super-errors, up to and including @code{error}.
+You will sometimes see code that sets this up directly rather than
+calling @code{define-error}, but you should @emph{not} do this yourself,
+unless you wish to maintain compatibility with FSF Emacs, which does not
+provide @code{define-error}.
+@end defun
 
-  Here is how we define a new error symbol, @code{new-error}:
+  Here is how we define a new error symbol, @code{new-error}, that
+belongs to a range of errors called @code{my-own-errors}:
 
 @example
 @group
-(put 'new-error
-     'error-conditions
-     '(error my-own-errors new-error))       
-@result{} (error my-own-errors new-error)
-@end group
-@group
-(put 'new-error 'error-message "A new error")
-@result{} "A new error"
+(define-error 'my-own-errors "A whole range of errors" 'error)
+(define-error 'new-error "A new error" 'my-own-errors)
 @end group
 @end example
 
 @noindent
-This error has three condition names: @code{new-error}, the narrowest
-classification; @code{my-own-errors}, which we imagine is a wider
-classification; and @code{error}, which is the widest of all.
+@code{new-error} has three condition names: @code{new-error}, the
+narrowest classification; @code{my-own-errors}, which we imagine is a
+wider classification; and @code{error}, which is the widest of all.
+
+  Note that it is not legal to try to define an error unless its
+super-error is also defined.  For instance, attempting to define
+@code{new-error} before @code{my-own-errors} are defined will signal an
+error.
 
   The error string should start with a capital letter but it should
 not end with a period.  This is for consistency with the rest of Emacs.
+
   Naturally, XEmacs will never signal @code{new-error} on its own; only
 an explicit call to @code{signal} (@pxref{Signaling Errors}) in your
 code can do this:
@@ -1044,6 +1119,8 @@ make it possible to categorize errors at various levels of generality
 when you write an error handler.  Using error symbols alone would
 eliminate all but the narrowest level of classification.
 
+  
+
   @xref{Standard Errors}, for a list of all the standard error symbols
 and their conditions.
 
index 72dd9eb..698d0ed 100644 (file)
@@ -95,6 +95,12 @@ happen in process filter functions and sentinels.  Therefore, these
 errors also can invoke the debugger.  @xref{Processes}.
 @end defopt
 
+@defopt debug-on-signal
+This variable is similar to @code{debug-on-error} but breaks
+whenever an error is signalled, regardless of whether it would be
+handled.
+@end defopt
+
 @defopt debug-ignored-errors
 This variable specifies certain kinds of errors that should not enter
 the debugger.  Its value is a list of error condition symbols and/or
@@ -124,12 +130,6 @@ this:
           '(lambda () (setq debug-on-error t)))
 @end example
 
-@defopt debug-on-signal
-This variable is similar to @code{debug-on-error} but breaks
-whenever an error is signalled, regardless of whether it would be
-handled.
-@end defopt
-
 @node Infinite Loops
 @subsection Debugging Infinite Loops
 @cindex infinite loops
index 3bed4da..2826aef 100644 (file)
@@ -60,9 +60,8 @@ are preserved on all copies.
 @page
 @ifinfo
 @node Top, Intro, (dir), (dir)
+@top The Emacs Editor
 
-The Emacs Editor
-****************
 
 Emacs is the extensible, customizable, self-documenting real-time
 display editor.  This Info file will help you get started on using 
index 65ef9d5..96e935b 100644 (file)
@@ -7,7 +7,7 @@
 @finalout
 @titlepage
 @title XEmacs FAQ
-@subtitle Frequently asked questions about XEmacs @* Last Modified: $Date: 1999/12/23 01:50:47 $
+@subtitle Frequently asked questions about XEmacs @* Last Modified: $Date: 2000/01/16 13:41:45 $
 @sp 1
 @author Tony Rossini <rossini@@biostat.washington.edu>
 @author Ben Wing <ben@@xemacs.org>
@@ -139,7 +139,6 @@ Getting Started:
 * Q1.4.4::      May I see an example of a useful XEmacs Lisp function?
 * Q1.4.5::      And how do I bind it to a key?
 * Q1.4.6::      What's the difference between a macro and a function?
-* Q1.4.7::      Why options saved with 19.13 don't work with 19.14 or later?
 
 Installation and Trouble Shooting
 
@@ -155,8 +154,6 @@ Installation and Trouble Shooting
 * Q2.0.10::     After I run configure I find a coredump, is something wrong?
 * Q2.0.11::     XEmacs can't resolve host names.
 * Q2.0.12::     Why can't I strip XEmacs?
-* Q2.0.13::     Can't link XEmacs on Solaris with Gcc.
-* Q2.0.14::     Make on HP/UX 9 fails after linking temacs
 
 Trouble Shooting:
 * Q2.1.1::      XEmacs just crashed on me!
@@ -176,10 +173,10 @@ Trouble Shooting:
 * Q2.1.15::     How to debug an XEmacs problem with a debugger.
 * Q2.1.16::     XEmacs crashes in @code{strcat} on HP/UX 10.
 * Q2.1.17::     @samp{Marker does not point anywhere}.
-* Q2.1.18::     19.14 hangs on HP/UX 10.10.
+* Q2.1.18::     [This question intentionally left blank]
 * Q2.1.19::     XEmacs does not follow the local timezone.
 * Q2.1.20::     @samp{Symbol's function definition is void: hkey-help-show.}
-* Q2.1.21::     Every so often the XEmacs frame freezes.
+* Q2.1.21::     [This question intentionally left blank]
 * Q2.1.22::     XEmacs seems to take a really long time to do some things.
 * Q2.1.23::     Movemail on Linux does not work for XEmacs 19.15 and later.
 * Q2.1.24::     XEmacs won't start without network. (NEW)
@@ -199,8 +196,8 @@ Customization and Options
 X Window System & Resources:
 * Q3.1.1::      Where is a list of X resources?
 * Q3.1.2::      How can I detect a color display?
-* Q3.1.3::      @code{(set-screen-width)} worked in 19.6, but not in 19.13?
-* Q3.1.4::      Specifying @code{Emacs*EmacsScreen.geometry} in @file{.emacs} does not work in 19.15?
+* Q3.1.3::      [This question intentionally left blank]
+* Q3.1.4::      [This question intentionally left blank]
 * Q3.1.5::      How can I get the icon to just say @samp{XEmacs}?
 * Q3.1.6::      How can I have the window title area display the full path?
 * Q3.1.7::      @samp{xemacs -name junk} doesn't work?
@@ -319,7 +316,7 @@ Infodock:
 Other Unbundled Packages:
 * Q4.7.1::      What is AUC TeX?  Where do you get it?
 * Q4.7.2::      Are there any Emacs Lisp Spreadsheets?
-* Q4.7.3::      Byte compiling AUC TeX on XEmacs 19.14
+* Q4.7.3::      [This question intentionally left blank]
 * Q4.7.4::      Problems installing AUC TeX
 * Q4.7.5::      Is there a reason for an Emacs package not to be included in XEmacs?
 * Q4.7.6::      Is there a MatLab mode?
@@ -336,14 +333,14 @@ The Miscellaneous Stuff
 * Q5.0.8::      Why does edt emulation not work?
 * Q5.0.9::      How can I emulate VI and use it as my default mode?
 * Q5.0.10::     [This question intentionally left blank]
-* Q5.0.11::     Filladapt doesn't work in 19.15?
+* Q5.0.11::     How do I turn on filladapt for all buffers?
 * Q5.0.12::     How do I disable gnuserv from opening a new frame?
 * Q5.0.13::     How do I start gnuserv so that each subsequent XEmacs is a client?
 * Q5.0.14::     Strange things are happening in Shell Mode.
 * Q5.0.15::     Where do I get the latest CC Mode?
 * Q5.0.16::     I find auto-show-mode disconcerting.  How do I turn it off?
 * Q5.0.17::     How can I get two instances of info?
-* Q5.0.18::     I upgraded to XEmacs 19.14 and gnuserv stopped working
+* Q5.0.18::     [This question intentionally left blank]
 * Q5.0.19::     Is there something better than LaTeX mode?
 * Q5.0.20::     Is there a way to start a new XEmacs if there's no gnuserv running, and otherwise use gnuclient?
 
@@ -487,7 +484,6 @@ Getting Started:
 * Q1.4.4::      May I see an example of a useful XEmacs Lisp function?
 * Q1.4.5::      And how do I bind it to a key?
 * Q1.4.6::      What's the difference between a macro and a function?
-* Q1.4.7::      Why options saved with 19.13 don't work with 19.14 or later?
 @end menu
 
 @node Q1.0.1, Q1.0.2, Introduction, Introduction
@@ -660,30 +656,30 @@ Yes, @xref{MS Windows}.
 @comment (NT and 95).  The current betas require having an X server to run
 @comment XEmacs; however, a native NT/95 port is in alpha, thanks to
 @comment @email{jhar@@tardis.ed.ac.uk, Jonathan Harris}.
-@comment 
+@comment
 @comment Although some features are still unimplemented, XEmacs 21.0 will support
 @comment MS-Windows.
-@comment 
+@comment
 @comment The NT development is now coordinated by a mailing list at
 @comment @email{xemacs-nt@@xemacs.org}.
-@comment 
+@comment
 @comment If you are willing to contribute or want to follow the progress, mail to
 @comment @iftex
 @comment @*
 @comment @end iftex
 @comment @email{xemacs-nt-request@@xemacs.org} to subscribe.
-@comment 
+@comment
 @comment Furthermore, Altrasoft is seeking corporate and government sponsors to
 @comment help fund a fully native port of XEmacs to Windows 95 and NT using
 @comment full-time, senior-level staff working under a professionally managed
 @comment project structure.  See @uref{http://www.altrasoft.com/, the Altrasoft
 @comment web site} for more details
 @comment or contact Altrasoft directly at 1-888-ALTSOFT.
-@comment 
-@comment 
+@comment
+@comment
 @comment The closest existing port is @dfn{Win-Emacs}, which is based on Lucid
 @comment Emacs 19.6.  Available from @uref{http://www.pearlsoft.com/}.
-@comment 
+@comment
 @comment There's a port of GNU Emacs (not XEmacs) at
 @comment @example
 @comment @uref{http://www.cs.washington.edu/homes/voelker/ntemacs.html}.
@@ -693,12 +689,17 @@ Yes, @xref{MS Windows}.
 @unnumberedsubsec Q1.0.11: Is there a port of XEmacs to the Macintosh?
 @c changed
 
-There has been a port to the MachTen environment of XEmacs 19.13, but no
-patches have been submitted to the maintainers to get this in the
-mainstream distribution.
+@c There has been a port to the MachTen environment of XEmacs 19.13, but no
+@c patches have been submitted to the maintainers to get this in the
+@c mainstream distribution.
+@c
+@c For the MacOS, there is a port of
+@c @uref{ftp://ftp.cs.cornell.edu/pub/parmet/, Emacs 18.59}.
 
-For the MacOS, there is a port of
-@uref{ftp://ftp.cs.cornell.edu/pub/parmet/, Emacs 18.59}.
+Yes, there is a port of XEmacs 19.14, tested on MacOS 7.6.1 and MacOS
+8.5.1 by @uref{pjarvis@@ispchannel.com,Pitts Jarvis}.  It's available
+at @uref{http://my.ispchannel.com/~pjarvis/xemacs.html,
+http://my.ispchannel.com/~pjarvis/xemacs.html}.
 
 @node Q1.0.12, Q1.0.13, Q1.0.11, Introduction
 @unnumberedsubsec Q1.0.12: Is there a port of XEmacs to NextStep?
@@ -710,12 +711,12 @@ XEmacs port, but never went any farther.
 @node Q1.0.13, Q1.0.14, Q1.0.12, Introduction
 @unnumberedsubsec Q1.0.13: Is there a port of XEmacs to OS/2?
 
-No, and there is no news of anyone working on it.
+No, but Alexander Nikolaev <avn_1251@@mail.ru> is working on it.
 
 @node Q1.0.14, Q1.1.1, Q1.0.13, Introduction
 @unnumberedsubsec Q1.0.14: Where can I obtain a printed copy of the XEmacs users manual?
 
-Pre-printed manuals are not available.  If you are familiar with 
+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
@@ -871,14 +872,20 @@ crash some time ago.
 @itemize @bullet
 @item @email{binge@@aloft.att.com, Curtis.N.Bingham}
 
+@item @email{bruncott@@dormeur.inria.fr, Georges Brun-Cottan}
+
 @item @email{rjc@@cogsci.ed.ac.uk, Richard Caley}
 
 @item @email{cognot@@ensg.u-nancy.fr, Richard Cognot}
 
+@item @email{daku@@nortel.ca, Mark Daku}
+
 @item @email{wgd@@martigny.ai.mit.edu, William G. Dubuque}
 
 @item @email{eeide@@cs.utah.edu, Eric Eide}
 
+@item @email{af@@biomath.jussieu.fr, Alain Fauconnet}
+
 @item @email{cflatter@@nrao.edu, Chris Flatters}
 
 @item @email{ginsparg@@adra.com, Evelyn Ginsparg}
@@ -977,7 +984,7 @@ characters.
 @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.  
+MULE support is now available for UNIX versions of XEmacs.
 
 If you would like to help, you may want to join the
 @email{xemacs-mule@@xemacs.org} mailing list.  Especially needed are
@@ -1177,11 +1184,11 @@ it's available in a non-english language, type @kbd{C-u C-h t TAB}, type
 the first letters of your preferred language, then type @key{RET}.
 
 @comment There's an Emacs Lisp tutorial at
-@comment 
+@comment
 @comment @example
 @comment @uref{ftp://prep.ai.mit.edu/pub/gnu/emacs-lisp-intro-1.04.tar.gz}.
 @comment @end example
-@comment 
+@comment
 @comment @email{erik@@petaxp.rug.ac.be, Erik Sundermann} has made a tutorial web
 @comment page at
 @comment @iftex
@@ -1235,7 +1242,7 @@ To bind to a key do:
 
 Or interactively, @kbd{M-x global-set-key} and follow the prompts.
 
-@node Q1.4.6, Q1.4.7, Q1.4.5, Introduction
+@node Q1.4.6, , Q1.4.5, Introduction
 @unnumberedsubsec Q1.4.6: What's the difference between a macro and a function?
 
 Quoting from the Lisp Reference (a.k.a @dfn{Lispref}) Manual:
@@ -1255,36 +1262,6 @@ Do not confuse the two terms with @dfn{keyboard macros}, which are
 another matter, entirely.  A keyboard macro is a key bound to several
 other keys.  Refer to manual for details.
 
-@node Q1.4.7, , Q1.4.6, Introduction
-@unnumberedsubsec Q1.4.7: How come options saved with 19.13 don't work with 19.14 or later?
-
-There's a problem with options of the form:
-
-@lisp
-(add-spec-list-to-specifier (face-property 'searchm-field 'font)
-                            '((global (nil))))
-@end lisp
-
-saved by a 19.13 XEmacs that causes a 19.14 XEmacs grief.  You must
-delete these options.  XEmacs 19.14 and later no longer write the
-options directly to @file{.emacs} which should allow us to deal with
-version incompatibilities better in the future.
-
-Options saved under XEmacs 19.13 are protected by code that specifically
-requires a version 19 XEmacs.  This won't be a problem unless you're
-using XEmacs v20.  You should consider changing the code to read:
-
-@lisp
-(cond
- ((and (string-match "XEmacs" emacs-version)
-       (boundp 'emacs-major-version)
-       (or (and (= emacs-major-version 19)
-                (>= emacs-minor-version 12))
-           (>= emacs-major-version 20)))
-  ...
-  ))
-@end lisp
-
 @node Installation, Customization, Introduction, Top
 @unnumbered 2 Installation and Trouble Shooting
 
@@ -1305,8 +1282,6 @@ Installation:
 * Q2.0.10::     After I run configure I find a coredump, is something wrong?
 * Q2.0.11::     XEmacs can't resolve host names.
 * Q2.0.12::     Why can't I strip XEmacs?
-* Q2.0.13::     Can't link XEmacs on Solaris with Gcc.
-* Q2.0.14::     Make on HP/UX 9 fails after linking temacs
 
 Trouble Shooting:
 * Q2.1.1::      XEmacs just crashed on me!
@@ -1326,10 +1301,10 @@ Trouble Shooting:
 * Q2.1.15::     How to debug an XEmacs problem with a debugger.
 * Q2.1.16::     XEmacs crashes in @code{strcat} on HP/UX 10.
 * Q2.1.17::     @samp{Marker does not point anywhere}.
-* Q2.1.18::     19.14 hangs on HP/UX 10.10.
+* Q2.1.18::     [This question intentionally left blank]
 * Q2.1.19::     XEmacs does not follow the local timezone.
 * Q2.1.20::     @samp{Symbol's function definition is void: hkey-help-show.}
-* Q2.1.21::     Every so often the XEmacs frame freezes.
+* Q2.1.21::     [This question intentionally left blank]
 * Q2.1.22::     XEmacs seems to take a really long time to do some things.
 * Q2.1.23::     Movemail on Linux does not work for XEmacs 19.15 and later.
 * Q2.1.24::     XEmacs won't start without network. (NEW)
@@ -1758,7 +1733,7 @@ check to see if you've put DNS in the shared libc and will then proceed
 to link against the DNS resolver library code.
 @end quotation
 
-@node Q2.0.12, Q2.0.13, Q2.0.11, Installation
+@node Q2.0.12, Q2.1.1, Q2.0.11, Installation
 @unnumberedsubsec Q2.0.12: Why can't I strip XEmacs?
 
 @email{cognot@@fronsac.ensg.u-nancy.fr, Richard Cognot} writes:
@@ -1813,46 +1788,7 @@ cp lib-src/DOC-19.16-XEmacs
 @end enumerate
 @end quotation
 
-@node Q2.0.13, Q2.0.14, Q2.0.12, Installation
-@unnumberedsubsec Q2.0.13: Problems linking with Gcc on Solaris
-
-There are known difficulties linking with Gnu ld on Solaris.  A typical
-error message might look like:
-
-@example
-unexec(): dlopen(../dynodump/dynodump.so): ld.so.1: ./temacs:
-fatal: relocation error:
-symbol not found: main: referenced in ../dynodump/dynodump.so
-@end example
-
-@email{martin@@xemacs.org, Martin Buchholz} writes:
-
-@quotation
-You need to specify @samp{-fno-gnu-linker} as part of your flags to pass
-to ld.  Future releases of XEmacs will try to do this automatically.
-@end quotation
-
-@node Q2.0.14, Q2.1.1, Q2.0.13, Installation
-@unnumberedsubsec Q2.0.14: Make on HP/UX 9 fails after linking temacs
-
-Problem when building xemacs-19.16 on hpux 9:
-
-@email{cognot@@ensg.u-nancy.fr, Richard Cognot} writes:
-
-@quotation
-make on hpux fails after linking temacs with a message:
-
-@example
-"make: don't know how to make .y."
-@end example
-
-Solution: This is a problem with HP make revision 70.X.  Either use GNU
-make, or install PHCO_6552, which will bring make to revision
-72.24.1.17.
-@end quotation
-
-
-@node Q2.1.1, Q2.1.2, Q2.0.14, Installation
+@node Q2.1.1, Q2.1.2, Q2.0.12, Installation
 @unnumberedsec 2.1: Trouble Shooting
 @unnumberedsubsec Q2.1.1: Help!  XEmacs just crashed on me!
 
@@ -2316,17 +2252,55 @@ it cannot display the internal C structure of a Lisp Object.  Even if
 all you've got is a core dump, all is not lost.
 
 If you're using GDB, there are some macros in the file
-@file{src/gdbinit} in the XEmacs source distribution that should make it
-easier for you to decode Lisp objects.  Copy this file to
-@file{~/.gdbinit}, or @code{source} it from @file{~/.gdbinit}, and use
-the macros defined therein.  In particular, use the @code{pobj} macro to
-print the internal C representation of a lisp object.  This will work
-with a core file or not-yet-run executable.  The aliases @code{ldp} and
-@code{lbt} are provided for conveniently calling @code{debug_print} and
-@code{debug_backtrace}.
+@file{src/.gdbinit} in the XEmacs source distribution that should make
+it easier for you to decode Lisp objects.  This file is automatically
+read by gdb if gdb is run in the directory where xemacs was built, and
+contains these useful macros to inspect the state of xemacs:
+
+@table @code
+@item pobj
+Usage: pobj lisp_object @*
+Print the internal C representation of a lisp object.
+
+@item xtype
+Usage: xtype lisp_object @*
+Print the Lisp type of a lisp object.
+
+@item lbt
+Usage: lbt @*
+Print the current Lisp stack trace.
+Requires a running xemacs process.
+
+@item ldp
+Usage: ldp lisp_object @*
+Print a Lisp Object value using the Lisp printer.
+Requires a running xemacs process.
+
+@item run-temacs
+Usage: run-temacs @*
+Run temacs interactively, like xemacs.
+Use this with debugging tools (like purify) that cannot deal with dumping,
+or when temacs builds successfully, but xemacs does not.
+
+@item dump-temacs
+Usage: dump-temacs @*
+Run the dumping part of the build procedure.
+Use when debugging temacs, not xemacs!
+Use this when temacs builds successfully, but xemacs does not.
+
+@item check-xemacs
+Usage: check-xemacs @*
+Run the test suite.  Equivalent to 'make check'.
+
+@item check-temacs
+Usage: check-temacs @*
+Run the test suite on temacs.  Equivalent to 'make check-temacs'.
+Use this with debugging tools (like purify) that cannot deal with dumping,
+or when temacs builds successfully, but xemacs does not.
+@end table
 
 If you are using Sun's @file{dbx} debugger, there is an equivalent file
-@file{src/dbxrc} to copy to or source from @file{~/.dbxrc}.
+@file{src/.dbxrc}, which defines the same commands for dbx.
 
 @item
 If you're using a debugger to get a C stack backtrace and you're seeing
@@ -2377,14 +2351,13 @@ you'll have something useful.
 
 @item
 If you compile with the newer gcc variants gcc-2.8 or egcs, you will
-also need gdb 4.17.  Earlier releases of gdb can't handle the debug
-information generated by the newer compilers.
+also need gdb 4.17 or above.  Earlier releases of gdb can't handle the
+debug information generated by the newer compilers.
 
 @item
-The above information on using @file{src/gdbinit} works for XEmacs-21.0
-and above.  For older versions of XEmacs, there are different
-@file{gdbinit} files provided in the @file{src} directory.  Use the one
-corresponding to the configure options used when building XEmacs.
+In versions of XEmacs before 21.2.27, @file{src/.gdbinit} was named
+@file{src/gdbinit}.  This had the disadvantage of not being sourced
+automatically by gdb, so you had to set that up yourself.
 
 @end itemize
 
@@ -2430,58 +2403,7 @@ Upgrade your Gnus.
 @end enumerate
 
 @node Q2.1.18, Q2.1.19, Q2.1.17, Installation
-@unnumberedsubsec Q2.1.18: 19.14 hangs on HP/UX 10.10.
-
-@email{cognot@@ensg.u-nancy.fr, Richard Cognot} writes:
-
-@quotation
-For the record, compiling on hpux 10.10 leads to a hang in Gnus when
-compiled with optimization on.
-
-I've just discovered that my hpux 10.01 binary was working less well
-than expected. In fact, on a 10.10 system, @code{(while t)} was not
-interrupted by @kbd{C-g}. I defined @code{BROKEN_SIGIO} and recompiled on
-10.10, and... the hang is now gone.
-
-As far as configure goes, this will be a bit tricky: @code{BROKEN_SIGIO}
-is needed on 10.10, but @strong{not} on 10.01: if I run my 10.01 binary
-on a 10.01 machine, without @code{BROKEN_SIGIO} being defined, @kbd{C-g}
-works as expected.
-@end quotation
-
-@email{cognot@@ensg.u-nancy.fr, Richard Cognot} adds:
-
-@quotation
-Apparently somebody has found the reason why there is this
-@iftex
-@*
-@end iftex
-@samp{poll:
-interrupted...} message for each event.  For some reason, libcurses
-reimplements a @code{select()} system call, in a highly broken fashion.
-The fix is to add a -lc to the link line @emph{before} the
--lxcurses. XEmacs will then use the right version of @code{select()}.
-@end quotation
-
-
-@email{af@@biomath.jussieu.fr, Alain Fauconnet} writes:
-
-@quotation
-The @emph{real} solution is to @emph{not} link -lcurses in!  I just
-changed -lcurses to -ltermcap in the Makefile and it fixed:
-
-@enumerate
-@item
-The @samp{poll: interrupted system call} message.
-
-@item
-A more serious problem I had discovered in the meantime, that is the
-fact that subprocess handling was seriously broken: subprocesses
-e.g. started by AUC TeX for TeX compilation of a buffer would
-@emph{hang}.  Actually they would wait forever for emacs to read the
-socket which connects stdout...
-@end enumerate
-@end quotation
+@unnumberedsubsec Q2.1.18: removed
 
 @node Q2.1.19, Q2.1.20, Q2.1.18, Installation
 @unnumberedsubsec Q2.1.19: XEmacs does not follow the local timezone.
@@ -2509,10 +2431,7 @@ This is a problem with a partially loaded hyperbole.  Try adding:
 where you load hyperbole and the problem should go away.
 
 @node Q2.1.21, Q2.1.22, Q2.1.20, Installation
-@unnumberedsubsec Q2.1.21: Every so often the XEmacs frame freezes
-
-This problem has been fixed in 19.15, and was due to a not easily
-reproducible race condition.
+@unnumberedsubsec Q2.1.21: [This question intentionally left blank]
 
 @node Q2.1.22, Q2.1.23, Q2.1.21, Installation
 @unnumberedsubsec Q2.1.22: XEmacs seems to take a really long time to do some things
@@ -2603,8 +2522,8 @@ Customization---Emacs Lisp and @file{.emacs}:
 X Window System & Resources:
 * Q3.1.1::      Where is a list of X resources?
 * Q3.1.2::      How can I detect a color display?
-* Q3.1.3::      @code{(set-screen-width)} worked in 19.6, but not in 19.13?
-* Q3.1.4::      Specifying @code{Emacs*EmacsScreen.geometry} in @file{.emacs} does not work in 19.15?
+* Q3.1.3::      [This question intentionally left blank]
+* Q3.1.4::      [This question intentionally left blank]
 * Q3.1.5::      How can I get the icon to just say @samp{XEmacs}?
 * Q3.1.6::      How can I have the window title area display the full path?
 * Q3.1.7::      @samp{xemacs -name junk} doesn't work?
@@ -2876,38 +2795,10 @@ in:
 @end lisp
 
 @node Q3.1.3, Q3.1.4, Q3.1.2, Customization
-@unnumberedsubsec Q3.1.3: @code{(set-screen-width)} worked in 19.6, but not in 19.13?
-
-In Lucid Emacs 19.6 I did @code{(set-screen-width @var{characters})} and
-@code{(set-screen-height @var{lines})} in my @file{.emacs} instead of
-specifying @code{Emacs*EmacsScreen.geometry} in my
-@iftex
-@*
-@end iftex
-@file{.Xdefaults} but
-this does not work in XEmacs 19.13.
-
-These two functions now take frame arguments:
-
-@lisp
-(set-frame-width (selected-frame) @var{characters})
-(set-frame-height (selected-frame) @var{lines})
-@end lisp
+@unnumberedsubsec Q3.1.3: [This question intentionally left blank]
 
 @node Q3.1.4, Q3.1.5, Q3.1.3, Customization
-@unnumberedsubsec Q3.1.4: Specifying @code{Emacs*EmacsScreen.geometry} in @file{.emacs} does not work in 19.15?
-
-In XEmacs 19.11 I specified @code{Emacs*EmacsScreen.geometry} in
-my @file{.emacs} but this does not work in XEmacs 19.15.
-
-We have switched from using the term @dfn{screen} to using the term
-@dfn{frame}.
-
-The correct entry for your @file{.Xdefaults} is now:
-
-@example
-Emacs*EmacsFrame.geometry
-@end example
+@unnumberedsubsec Q3.1.4: [This question intentionally left blank]
 
 @node Q3.1.5, Q3.1.6, Q3.1.4, Customization
 @unnumberedsubsec Q3.1.5: How can I get the icon to just say @samp{XEmacs}?
@@ -3999,13 +3890,19 @@ is what happens when you select a region (with the mouse or keyboard)
 and you press a key to replace the selected region by the key you typed.
 Usually backspace kills the selected region.
 
-To get this behavior, add the following line to your @file{.emacs}:
+To get this behavior, add the following lines to your @file{.emacs}:
 
 @lisp
-(turn-on-pending-delete)
+(cond
+ ((fboundp 'turn-on-pending-delete)
+  (turn-on-pending-delete))
+ ((fboundp 'pending-delete-on)
+  (pending-delete-on t)))
 @end lisp
 
-Note that this will work with both Backspace and Delete.
+Note that this will work with both Backspace and Delete.  This code is a 
+tad more complicated than it has to be for XEmacs in order to make it
+more portable.
 
 @node Q3.10.3, Q3.10.4, Q3.10.2, Customization
 @unnumberedsubsec Q3.10.3: Can I turn off the highlight during isearch?
@@ -4122,7 +4019,7 @@ Infodock:
 Other Unbundled Packages:
 * Q4.7.1::      What is AUC TeX?  Where do you get it?
 * Q4.7.2::      Are there any Emacs Lisp Spreadsheets?
-* Q4.7.3::      Byte compiling AUC TeX on XEmacs 19.14
+* Q4.7.3::      [This question intentionally left blank]
 * Q4.7.4::      Problems installing AUC TeX
 * Q4.7.5::      Is there a reason for an Emacs package not to be included in XEmacs?
 * Q4.7.6::      Is there a MatLab mode?
@@ -4637,12 +4534,12 @@ following patch:
 @@@@ -42,7 +42,7 @@@@
  (defvar running-xemacs nil "t if we're running XEmacs")
  (defvar running-emacs  nil "t if we're running GNU Emacs 19")
+
 -(if (string-match "^\\(19\\|20\\)\..*\\(XEmacs\\|Lucid\\)" emacs-version)
 +(if (string-match "\\(XEmacs\\|Lucid\\)" emacs-version)
      (setq running-xemacs t)
      (setq running-emacs  t))
-@end format 
+@end format
 
 
 
@@ -4859,17 +4756,7 @@ Yes.  Check out @dfn{dismal} (which stands for Dis' Mode Ain't Lotus) at
 @uref{ftp://cs.nyu.edu/pub/local/fox/dismal/}.
 
 @node Q4.7.3, Q4.7.4, Q4.7.2, Subsystems
-@unnumberedsubsec Q4.7.3: Byte compiling AUC TeX on XEmacs 19.14.
-
-@email{bruncott@@dormeur.inria.fr, Georges Brun-Cottan} writes:
-
-@quotation
-When byte compiling auctex-9.4g, you must use the command:
-
-@example
-xemacs -batch -l lpath.el
-@end example
-@end quotation
+@unnumberedsubsec Q4.7.3: [This question intentionally left blank]
 
 @node Q4.7.4, Q4.7.5, Q4.7.3, Subsystems
 @unnumberedsubsec Q4.7.4: Problems installing AUC TeX.
@@ -4965,14 +4852,14 @@ Major & Minor Modes:
 * Q5.0.8::      Why does edt emulation not work?
 * Q5.0.9::      How can I emulate VI and use it as my default mode?
 * Q5.0.10::     [This question intentionally left blank]
-* Q5.0.11::     Filladapt doesn't work in 19.15?
+* Q5.0.11::     How do I turn on filladapt for all buffers?
 * Q5.0.12::     How do I disable gnuserv from opening a new frame?
 * Q5.0.13::     How do I start gnuserv so that each subsequent XEmacs is a client?
 * Q5.0.14::     Strange things are happening in Shell Mode.
 * Q5.0.15::     Where do I get the latest CC Mode?
 * Q5.0.16::     I find auto-show-mode disconcerting.  How do I turn it off?
 * Q5.0.17::     How can I get two instances of info?
-* Q5.0.18::     I upgraded to XEmacs 19.14 and gnuserv stopped working
+* Q5.0.18::     [This question intentionally left blank]
 * Q5.0.19::     Is there something better than LaTeX mode?
 * Q5.0.20::     Is there a way to start a new XEmacs if there's no gnuserv running, and otherwise use gnuclient?
 
@@ -5165,7 +5052,7 @@ rename-uniquely} to rename the @code{*shell*} buffer instead of @kbd{M-x
 rename-buffer}.
 
 Alternately, you can set the variable @code{shell-multiple-shells}.
-If the value of this variable is non-nil, each time shell mode is invoked, 
+If the value of this variable is non-nil, each time shell mode is invoked,
 a new shell is made
 
 @node Q5.0.7, Q5.0.8, Q5.0.6, Miscellaneous
@@ -5221,11 +5108,11 @@ it, otherwise some minor modes may not get viper-ized.
 Obsolete question, left blank to avoid renumbering
 
 @node Q5.0.11, Q5.0.12, Q5.0.10, Miscellaneous
-@unnumberedsubsec Q5.0.11: Filladapt doesn't work in 19.15
+@unnumberedsubsec Q5.0.11: How do I turn on filladapt for all buffers?
 
-Filladapt 2.x is included in 19.15.  In it filladapt is now a minor
-mode and minor modes are traditionally off by default.  The following
-added to your @file{.emacs} will turn it on for all buffers:
+Filladapt is a minor mode and minor modes are traditionally off by
+default.  The following added to your @file{.emacs} will turn it on for
+all buffers:
 
 @lisp
 (setq-default filladapt-mode t)
@@ -5333,19 +5220,7 @@ enabled by default.  To turn it off, put the following in your
 You can't.  The @code{info} package does not provide for multiple info buffers.
 
 @node Q5.0.18, Q5.0.19, Q5.0.17, Miscellaneous
-@unnumberedsubsec Q5.0.18: I upgraded to XEmacs 19.14 and gnuserv stopped working.
-
-@email{daku@@nortel.ca, Mark Daku} writes:
-
-@quotation
-It turns out I was using an older version of gnuserv.  The installation
-didn't put the binary into the public bin directory.  It put it in
-@iftex
-@*
-@end iftex
-@file{lib/xemacs-19.14/hppa1.1-hp-hpux9.05/gnuserv}.  Shouldn't it have
-been put in @file{bin/hppa1.1-hp-hpux9.0}?
-@end quotation
+@unnumberedsubsec Q5.0.18: [This question intentionally left blank]
 
 @node Q5.0.19, Q5.0.20, Q5.0.18, Miscellaneous
 @unnumberedsubsec Q5.0.19: Is there something better than LaTeX mode?
@@ -6206,7 +6081,7 @@ port of XEmacs.
 
 General Info
 * Q6.0.1::     What is the status of the XEmacs port to Windows?
-* Q6.0.2::     What flavors of MS Windows are supported?  
+* Q6.0.2::     What flavors of MS Windows are supported?
 * Q6.0.3::      Where are the XEmacs on MS Windows binaries?
 * Q6.0.4::     Does XEmacs on MS Windows require an X server to run?
 
@@ -6317,7 +6192,7 @@ Pointers to X servers can be found at
 @iftex
 @*
 @end iftex
-@uref{http://dao.gsfc.nasa.gov/software/grads/win32/X11R6.3/}; 
+@uref{http://dao.gsfc.nasa.gov/software/grads/win32/X11R6.3/};
 
 look for "Where to get an X server".  Also note that, although the above
 page talks about Cygnus gnu-win32 (Cygwin), the information on X servers
@@ -6403,7 +6278,7 @@ well as pre-built ncurses and graphic libraries, from:
 @unnumberedsec 6.2: Customization and User Interface
 @unnumberedsubsec Q6.2.1: How will the port cope with differences in the Windows user interface?
 
-XEmacs (and Emacs in general) UI is pretty 
+XEmacs (and Emacs in general) UI is pretty
 different from what is expected of a typical MS Windows program.  How will
 the MS Windows port cope with it?
 
@@ -6468,7 +6343,7 @@ Here is a recount of various Emacs versions running on MS Windows:
 
 @itemize @bullet
 
-@item 
+@item
 Win-Emacs
 
 @itemize @minus
@@ -6484,7 +6359,7 @@ Pearlsoft, but not anymore, since Pearlsoft went out of business.
 @item
 GNU Emacs for DOS
 
-@itemize @minus  
+@itemize @minus
 
 @item
 GNU Emacs features support for MS-DOS and DJGPP (D.J. Delorie's DOS
@@ -6496,7 +6371,7 @@ is far too big compared to typical DOS editors.
 @item
 GNU Emacs compiled with Win32
 
-@itemize @minus  
+@itemize @minus
 
 @item
 Starting with version 19.30, it has been possible to compile GNU Emacs
@@ -6509,7 +6384,7 @@ flavor of XEmacs on MS Windows.
 @item
 NT Emacs
 
-@itemize @minus  
+@itemize @minus
 
 @item
 NT Emacs is a version of GNU Emacs modified to compile and run under
@@ -6518,7 +6393,7 @@ in spirit to the XEmacs "native" port.
 
 @item
 NT Emacs has been written by Geoff Voelker, and more information can be
-found at 
+found at
 @iftex
 @*
 @end iftex
@@ -6529,7 +6404,7 @@ found at
 @item
 XEmacs
 
-@itemize @minus  
+@itemize @minus
 
 @item
 Beginning with XEmacs 19.12, XEmacs' architecture has been redesigned
index d37a926..bcb9764 100644 (file)
@@ -1093,9 +1093,9 @@ definitions for the same key.  Or you can change the current buffer's
 local map, which affects all buffers using the same major mode.
 
 @menu
-* Interactive Rebinding::     Changing Key Bindings Interactively   
-* Programmatic Rebinding::    Changing Key Bindings Programmatically
-* Key Bindings Using Strings::Using Strings for Changing Key Bindings 
+* Interactive Rebinding::      Changing Key Bindings Interactively   
+* Programmatic Rebinding::     Changing Key Bindings Programmatically
+* Key Bindings Using Strings:: Using Strings for Changing Key Bindings 
 @end menu
 
 @node Interactive Rebinding
index c46ce59..3d75b35 100644 (file)
@@ -3,20 +3,19 @@
 @chapter The Minibuffer
 @cindex minibuffer
 
-  Emacs commands use the @dfn{minibuffer} to read arguments more
-complicated than a single number.  Minibuffer arguments can be file
-names, buffer names, Lisp function names, Emacs command names, Lisp
-expressions, and many other things, depending on the command reading the
-argument.  To edit the argument in the minibuffer, you can use Emacs
-editing commands.
-
+  The @dfn{minibuffer} is the facility used by XEmacs commands to read
+arguments more complicated than a single number.  Minibuffer arguments
+can be file names, buffer names, Lisp function names, XEmacs command
+names, Lisp expressions, and many other things, depending on the command
+reading the argument.  You can use the usual XEmacs editing commands in
+the minibuffer to edit the argument text.
 
 @cindex prompt
   When the minibuffer is in use, it appears in the echo area, and the
 cursor moves there.  The beginning of the minibuffer line displays a
-@dfn{prompt} indicating what kind of input you should supply and how it
-will be used.  The prompt is often derived from the name of the command
-the argument is for.  The prompt normally ends with a colon.
+@dfn{prompt} which says what kind of input you should supply and how it
+will be used.  Often this prompt is derived from the name of the command
+that the argument is for.  The prompt normally ends with a colon.
 
 @cindex default argument
   Sometimes a @dfn{default argument} appears in parentheses after the
@@ -26,14 +25,14 @@ For example, commands that read buffer names always show a default, which
 is the name of the buffer that will be used if you type just @key{RET}.
 
 @kindex C-g
-  The simplest way to give a minibuffer argument is to type the text you
-want, terminated by @key{RET} to exit the minibuffer.  To get out
-of the minibuffer and cancel the command that it was for, type
-@kbd{C-g}.
+  The simplest way to enter a minibuffer argument is to type the text
+you want, terminated by @key{RET} which exits the minibuffer.  You can
+cancel the command that wants the argument, and get out of the
+minibuffer, by typing @kbd{C-g}.
 
   Since the minibuffer uses the screen space of the echo area, it can
-conflict with other ways Emacs customarily uses the echo area.  Here is how
-Emacs handles such conflicts:
+conflict with other ways XEmacs customarily uses the echo area.  Here is
+how XEmacs handles such conflicts:
 
 @itemize @bullet
 @item
@@ -44,9 +43,9 @@ while.  It comes back after a few seconds, or as soon as you type
 anything.
 
 @item
-If you use a command in the minibuffer whose purpose is to print a
-message in the echo area (for example @kbd{C-x =}) the message is
-displayed normally, and the minibuffer is hidden for a while.  It comes back
+If in the minibuffer you use a command whose purpose is to print a
+message in the echo area, such as @kbd{C-x =}, the message is printed
+normally, and the minibuffer is hidden for a while.  It comes back
 after a few seconds, or as soon as you type anything.
 
 @item
@@ -58,6 +57,7 @@ use.
 * File: Minibuffer File.  Entering file names with the minibuffer.
 * Edit: Minibuffer Edit.  How to edit in the minibuffer.
 * Completion::           An abbreviation facility for minibuffer input.
+* Minibuffer History::    Reusing recent minibuffer arguments.
 * Repetition::           Re-executing commands that used the minibuffer.
 @end menu
 
@@ -66,37 +66,43 @@ use.
 
   Sometimes the minibuffer starts out with text in it.  For example, when
 you are supposed to give a file name, the minibuffer starts out containing
-the @dfn{default directory}, which ends with a slash.  This informs
-you in which directory the file will be looked for if you do not specify
-a different one. For example, the minibuffer might start out with:
+the @dfn{default directory}, which ends with a slash.  This is to inform
+you which directory the file will be found in if you do not specify a
+directory.
+
+  For example, the minibuffer might start out with these contents:
 
 @example
 Find File: /u2/emacs/src/
 @end example
 
 @noindent
-where @samp{Find File:@: } is the prompt.  Typing @kbd{buffer.c} specifies
-the file 
-@*@file{/u2/emacs/src/buffer.c}.  To find files in nearby
-directories, use @samp{..}; thus, if you type @kbd{../lisp/simple.el}, the
-file that you visit will be the one named 
-@*@file{/u2/emacs/lisp/simple.el}.
-Alternatively, you can use  @kbd{M-@key{DEL}} to kill directory names you
-don't want (@pxref{Words}).@refill
-
-  You can also type an absolute file name, one starting with a slash or a
-tilde, ignoring the default directory.  For example, to find the file
-@file{/etc/termcap}, just type the name, giving:
+where @samp{Find File:@: } is the prompt.  Typing @kbd{buffer.c}
+specifies the file @file{/u2/emacs/src/buffer.c}.  To find files in
+nearby directories, use @kbd{..}; thus, if you type
+@kbd{../lisp/simple.el}, you will get the file named
+@file{/u2/emacs/lisp/simple.el}.  Alternatively, you can kill with
+@kbd{M-@key{DEL}} the directory names you don't want (@pxref{Words}).
+
+  If you don't want any of the default, you can kill it with @kbd{C-a
+C-k}.  But you don't need to kill the default; you can simply ignore it.
+Insert an absolute file name, one starting with a slash or a tilde,
+after the default directory.  For example, to specify the file
+@file{/etc/termcap}, just insert that name, giving these minibuffer
+contents:
 
 @example
 Find File: /u2/emacs/src//etc/termcap
 @end example
 
 @noindent
-Two slashes in a row are not normally meaningful in Unix file names, but
-they are allowed in XEmacs.  They mean, ``ignore everything before the
-second slash in the pair.''  Thus, @samp{/u2/emacs/src/} is ignored, and
-you get the file @file{/etc/termcap}.
+@cindex // in file name
+@cindex double slash in file name
+@cindex slashes repeated in file name
+XEmacs gives a special meaning to a double slash (which is not normally
+a useful thing to write): it means, ``ignore everything before the
+second slash in the pair.''  Thus, @samp{/u2/emacs/src/} is ignored in
+the example above, and you get the file @file{/etc/termcap}.
 
 @vindex insert-default-directory
 If you set @code{insert-default-directory} to @code{nil}, the default
@@ -107,126 +113,141 @@ interpreted with respect to the same default directory.
 @node Minibuffer Edit, Completion, Minibuffer File, Minibuffer
 @section Editing in the Minibuffer
 
-  The minibuffer is an Emacs buffer (albeit a peculiar one), and the usual
-Emacs commands are available for editing the text of an argument you are
-entering.
+  The minibuffer is an XEmacs buffer (albeit a peculiar one), and the
+usual XEmacs commands are available for editing the text of an argument
+you are entering.
 
   Since @key{RET} in the minibuffer is defined to exit the minibuffer,
-you must use @kbd{C-o} or @kbd{C-q @key{LFD}} to insert a newline into
-the minibuffer. (Recall that a newline is really the @key{LFD}
-character.)
-
-  The minibuffer has its own window, which always has space on the screen
-but acts as if it were not there when the minibuffer is not in use.  The
-minibuffer window is just like the others; you can switch to another 
-window with @kbd{C-x o}, edit text in other windows, and perhaps even
-visit more files before returning to the minibuffer to submit the
-argument.  You can kill text in another window, return to the minibuffer
-window, and then yank the text to use it in the argument.  @xref{Windows}.
-
-  There are, however, some restrictions on the use of the minibuffer window.
-You cannot switch buffers in it---the minibuffer and its window are
-permanently attached.  You also cannot split or kill the minibuffer
-window, but you can make it taller with @kbd{C-x ^}.
+you can't use it to insert a newline in the minibuffer.  To do that,
+type @kbd{C-o} or @kbd{C-q C-j}.  (Recall that a newline is really the
+character control-J.)
+
+  The minibuffer has its own window which always has space on the screen
+but acts as if it were not there when the minibuffer is not in use.
+When the minibuffer is in use, its window is just like the others; you
+can switch to another window with @kbd{C-x o}, edit text in other
+windows and perhaps even visit more files, before returning to the
+minibuffer to submit the argument.  You can kill text in another window,
+return to the minibuffer window, and then yank the text to use it in the
+argument.  @xref{Windows}.
+
+  There are some restrictions on the use of the minibuffer window,
+however.  You cannot switch buffers in it---the minibuffer and its
+window are permanently attached.  Also, you cannot split or kill the
+minibuffer window. But you can make it taller in the normal fashion with
+@kbd{C-x ^}.
 
 @kindex C-M-v
-  If you are in the minibuffer and issue a command that displays help
-text in another window, that window will be scrolled if you type
-@kbd{M-C-v} while in the minibuffer until you exit the minibuffer.  This
-feature is helpful if a completing minibuffer gives you a long list of
-possible completions.
+  If while in the minibuffer you issue a command that displays help text
+of any sort in another window, you can use the @kbd{C-M-v} command while
+in the minibuffer to scroll the help text.  This lasts until you exit
+the minibuffer.  This feature is especially useful if a completing
+minibuffer gives you a list of possible completions.  @xref{Other Window}.
 
+@vindex minibuffer-confirm-incomplete
 If the variable @code{minibuffer-confirm-incomplete} is @code{t}, you
 are asked for confirmation if there is no known completion for the text
 you typed. For example, if you attempted to visit a non-existent file,
 the minibuffer might read:
 @example
-        Find File:chocolate_bar.c [no completions, confirm]
+        Find File: chocolate_bar.c [no completions, confirm]
 @end example
 If you press @kbd{Return} again, that confirms the filename. Otherwise,
 you can continue editing it. 
 
- Emacs supports recursive use of the minibuffer.  However, it is
-easy to do this by accident (because of autorepeating keyboards, for
-example) and get confused.  Therefore, most Emacs commands that use the
-minibuffer refuse to operate if the minibuffer window is selected.  If the
-minibuffer is active but you have switched to a different window, recursive
-use of the minibuffer is allowed---if you know enough to try to do this,
-you probably will not get confused.
+ XEmacs supports recursive use of the minibuffer.  However, it is easy
+to do this by accident (because of autorepeating keyboards, for example)
+and get confused.  Therefore, most XEmacs commands that use the
+minibuffer refuse to operate if the minibuffer window is selected.  If
+the minibuffer is active but you have switched to a different window,
+recursive use of the minibuffer is allowed---if you know enough to try
+to do this, you probably will not get confused.
 
 @vindex enable-recursive-minibuffers
-  If you set the variable @code{enable-recursive-minibuffers} to be
+  If you set the variable @code{enable-recursive-minibuffers} to a
 non-@code{nil}, recursive use of the minibuffer is always allowed.
 
-@node Completion, Repetition, Minibuffer Edit, Minibuffer
+@node Completion, Minibuffer History, Minibuffer Edit, Minibuffer
 @section Completion
 @cindex completion
 
-  When appropriate, the minibuffer provides a @dfn{completion} facility.
-You type the beginning of an argument and one of the completion keys,
-and Emacs visibly fills in the rest, depending on what you have already
-typed.
+  For certain kinds of arguments, you can use @dfn{completion} to enter
+the argument value.  Completion means that you type part of the
+argument, then XEmacs visibly fills in the rest, or as much as
+can be determined from the part you have typed.
 
   When completion is available, certain keys---@key{TAB}, @key{RET}, and
-@key{SPC}---are redefined to complete an abbreviation present in the
+@key{SPC}---are rebound to complete the text present in the
 minibuffer into a longer string that it stands for, by matching it
 against a set of @dfn{completion alternatives} provided by the command
 reading the argument.  @kbd{?} is defined to display a list of possible
 completions of what you have inserted.
 
-  For example, when the minibuffer is being used by @kbd{Meta-x} to read
-the name of a command, it is given a list of all available Emacs command
-names to complete against.  The completion keys match the text in the
-minibuffer against all the command names, find any additional characters of
-the name that are implied by the ones already present in the minibuffer,
-and add those characters to the ones you have given.
-
-  Case is normally significant in completion because it is significant in
-most of the names that you can complete (buffer names, file names, and
-command names).  Thus, @samp{fo} will not complete to @samp{Foo}.  When you
-are completing a name in which case does not matter, case may be ignored
-for completion's sake if specified by program.
+  For example, when @kbd{M-x} uses the minibuffer to read the name of a
+command, it provides a list of all available XEmacs command names to
+complete against.  The completion keys match the text in the minibuffer
+against all the command names, find any additional name characters
+implied by the ones already present in the minibuffer, and add those
+characters to the ones you have given.  This is what makes it possible
+to type @kbd{M-x inse @key{SPC} b @key{RET}} instead of @kbd{M-x
+insert-buffer @key{RET}} (for example).
+
+  Case is normally significant in completion because it is significant
+in most of the names that you can complete (buffer names, file names and
+command names).  Thus, @samp{fo} does not complete to @samp{Foo}.  When
+you are completing a name in which case does not matter, case may be
+ignored for completion's sake if specified by program.
 
 When a completion list is displayed, the completions will highlight as
 you move the mouse over them.  Clicking the middle mouse button on any 
 highlighted completion will ``select'' it just as if you had typed it in
 and hit @key{RET}.
 
-@subsection A Completion Example
+@menu
+* Example: Completion Example.
+* Commands: Completion Commands.
+* Strict Completion::
+* Options: Completion Options.
+@end menu
+
+@node Completion Example, Completion Commands, Completion, Completion
+@subsection Completion Example
 
 @kindex TAB
 @findex minibuffer-complete
-  Consider the following example.  If you type @kbd{Meta-x au @key{TAB}},
-@key{TAB} looks for alternatives (in this case, command names) that
-start with @samp{au}.  There are only two commands: @code{auto-fill-mode} and
-@code{auto-save-mode}.  They are the same as far as @code{auto-}, so the
-@samp{au} in the minibuffer changes to @samp{auto-}.@refill
-
-  If you type @key{TAB} again immediately, there are multiple possibilities
-for the very next character---it could be @samp{s} or @samp{f}---so no more
-characters are added; but a list of all possible completions is displayed
-in another window.
+  A concrete example may help here.  If you type @kbd{M-x au @key{TAB}},
+the @key{TAB} looks for alternatives (in this case, command names) that
+start with @samp{au}.  There are several, including
+@code{auto-fill-mode} and @code{auto-save-mode}---but they are all the
+same as far as @code{auto}, so the @samp{au} in the minibuffer changes
+to @samp{auto}.
+
+  If you type @key{TAB} again immediately, there are multiple
+possibilities for the very next character---it could be any of
+@samp{c-}---so no more characters are added; instead, @key{TAB}
+displays a list of all possible completions in another window.
 
   If you go on to type @kbd{f @key{TAB}}, this @key{TAB} sees
 @samp{auto-f}.  The only command name starting this way is
-@code{auto-fill-mode}, so completion inserts the rest of that command.  You
-now have @samp{auto-fill-mode} in the minibuffer after typing just @kbd{au
-@key{TAB} f @key{TAB}}.  Note that @key{TAB} has this effect because in the
-minibuffer it is bound to the function @code{minibuffer-complete} when
-completion is supposed to be done.@refill
+@code{auto-fill-mode}, so completion fills in the rest of that.  You now
+have @samp{auto-fill-mode} in the minibuffer after typing just @kbd{au
+@key{TAB} f @key{TAB}}.  Note that @key{TAB} has this effect because in
+the minibuffer it is bound to the command @code{minibuffer-complete}
+when completion is available.
 
+@node Completion Commands, Strict Completion, Completion Example, Completion
 @subsection Completion Commands
 
-  Here is a list of all the completion commands defined in the minibuffer
+  Here is a list of the completion commands defined in the minibuffer
 when completion is available.
 
 @table @kbd
 @item @key{TAB}
-Complete the text in the minibuffer as much as possible @*
+Complete the text in the minibuffer as much as possible
 (@code{minibuffer-complete}).
 @item @key{SPC}
-Complete the text in the minibuffer but don't add or fill out more
-than one word (@code{minibuffer-complete-word}).
+Complete the minibuffer text, but don't go beyond one word
+(@code{minibuffer-complete-word}).
 @item @key{RET}
 Submit the text in the minibuffer as the argument, possibly completing
 first as described below (@code{minibuffer-complete-and-exit}).
@@ -244,14 +265,51 @@ highlighted completion and exit the minibuffer.
 
 @kindex SPC
 @findex minibuffer-complete-word
-@key{SPC} completes in a way that is similar to @key{TAB}, but it never
-goes beyond the next hyphen or space.  If you have @samp{auto-f} in the 
-minibuffer and type @key{SPC}, it finds that the completion is
- @samp{auto-fill-mode}, but it stops completing after @samp{fill-}. 
-The result is @samp{auto-fill-}. Another @key{SPC} at this point
-completes all the way to @samp{auto-fill-mode}.  @key{SPC} in the
-minibuffer runs the function @code{minibuffer-complete-word} when 
-completion is available.@refill
+  @key{SPC} completes much like @key{TAB}, but never goes beyond the
+next hyphen or space.  If you have @samp{auto-f} in the minibuffer and
+type @key{SPC}, it finds that the completion is @samp{auto-fill-mode},
+but it stops completing after @samp{fill-}.  This gives
+@samp{auto-fill-}.  Another @key{SPC} at this point completes all the
+way to @samp{auto-fill-mode}.  @key{SPC} in the minibuffer when
+completion is available runs the command
+@code{minibuffer-complete-word}.
+
+  Here are some commands you can use to choose a completion from a
+window that displays a list of completions:
+
+@table @kbd
+@findex mouse-choose-completion
+@item button2up
+Clicking mouse button 2 on a completion in the list of possible
+completions chooses that completion (@code{mouse-choose-completion}).
+You normally use this command while point is in the minibuffer; but you
+must click in the list of completions, not in the minibuffer itself.
+
+@findex choose-completion
+@item @key{RET}
+Typing @key{RET} @emph{in the completion list buffer} chooses the
+completion that point is in or next to (@code{choose-completion}).  To
+use this command, you must first switch windows to the window that shows
+the list of completions.
+
+@findex next-list-mode-item
+@item @key{RIGHT}
+@itemx @key{TAB}
+@itemx C-f
+Typing the right-arrow key @key{RIGHT}, @key{TAB} or @kbd{C-f} @emph{in
+the completion list buffer} moves point to the following completion
+(@code{next-list-mode-item}).
+
+@findex previous-list-mode-item
+@item @key{LEFT}
+@itemx C-b
+Typing the left-arrow key @key{LEFT} or @kbd{C-b} @emph{in the
+completion list buffer} moves point toward the beginning of the buffer,
+to the previous completion (@code{previous-list-mode-item}).
+@end table
+
+@node Strict Completion, Completion Options, Completion Commands, Completion
+@subsection Strict Completion
 
   There are three different ways that @key{RET} can work in completing
 minibuffers, depending on how the argument will be used.
@@ -276,7 +334,7 @@ Cautious completion is used for reading file names for files that must
 already exist.
 
 @item
-@dfn{Permissive} completion is used when any string is
+@dfn{Permissive} completion is used when any string whatever is
 meaningful, and the list of completion alternatives is just a guide.
 For example, when @kbd{C-x C-f} reads the name of a file to visit, any
 file name is allowed, in case you want to create a file.  In
@@ -284,21 +342,26 @@ permissive completion, @key{RET} takes the text in the minibuffer
 exactly as given, without completing it.
 @end itemize
 
-  The completion commands display a list of all possible completions in a
-window whenever there is more than one possibility for the very next
-character.  Typing @kbd{?} explicitly requests such a list.  The
-list of completions counts as help text, so @kbd{C-M-v} typed in the
-minibuffer scrolls the list.
+  The completion commands display a list of all possible completions in
+a window whenever there is more than one possibility for the very next
+character.  Also, typing @kbd{?} explicitly requests such a list.  If
+the list of completions is long, you can scroll it with @kbd{C-M-v}
+(@pxref{Other Window}).
+
+@node Completion Options,  , Strict Completion, Completion
+@subsection Completion Options
 
 @vindex completion-ignored-extensions
   When completion is done on file names, certain file names are usually
-ignored.  The variable @code{completion-ignored-extensions} contains a list
-of strings; a file whose name ends in any of those strings is ignored as a
-possible completion.  The standard value of this variable has several
-elements including @code{".o"}, @code{".elc"}, @code{".dvi"} and @code{"~"}.
-The effect is that, for example, @samp{foo} completes to @samp{foo.c}
-even though @samp{foo.o} exists as well.  If the only possible completions
-are files that end in ``ignored'' strings, they are not ignored.@refill
+ignored.  The variable @code{completion-ignored-extensions} contains a
+list of strings; a file whose name ends in any of those strings is
+ignored as a possible completion.  The standard value of this variable
+has several elements including @code{".o"}, @code{".elc"}, @code{".dvi"}
+and @code{"~"}.  The effect is that, for example, @samp{foo} can
+complete to @samp{foo.c} even though @samp{foo.o} exists as well.
+However, if @emph{all} the possible completions end in ``ignored''
+strings, then they are not ignored.  Ignored extensions do not apply to
+lists of completions---those always mention all possible completions.
 
 @vindex completion-auto-help
   If a completion command finds the next character is undetermined, it
@@ -312,47 +375,135 @@ then in contexts where @code{completing-read} allows answers that are
 not valid completions, an extra @key{RET} must be typed to confirm the
 response.  This is helpful for catching typos.
 
-@node Repetition,, Completion, Minibuffer
+@node Minibuffer History, Repetition, Completion, Minibuffer
+@section Minibuffer History
+@cindex minibuffer history
+@cindex history of minibuffer input
+
+  Every argument that you enter with the minibuffer is saved on a
+@dfn{minibuffer history list} so that you can use it again later in
+another argument.  Special commands load the text of an earlier argument
+in the minibuffer.  They discard the old minibuffer contents, so you can
+think of them as moving through the history of previous arguments.
+
+@table @kbd
+@item @key{UP}
+@itemx M-p
+Move to the next earlier argument string saved in the minibuffer history
+(@code{previous-history-element}).
+@item @key{DOWN}
+@itemx M-n
+Move to the next later argument string saved in the minibuffer history
+(@code{next-history-element}).
+@item M-r @var{regexp} @key{RET}
+Move to an earlier saved argument in the minibuffer history that has a
+match for @var{regexp} (@code{previous-matching-history-element}).
+@item M-s @var{regexp} @key{RET}
+Move to a later saved argument in the minibuffer history that has a
+match for @var{regexp} (@code{next-matching-history-element}).
+@end table
+
+@kindex M-p @r{(minibuffer history)}
+@kindex M-n @r{(minibuffer history)}
+@findex next-history-element
+@findex previous-history-element
+  The simplest way to reuse the saved arguments in the history list is
+to move through the history list one element at a time.  While in the
+minibuffer, use @kbd{M-p} or up-arrow (@code{previous-history-element})
+to ``move to'' the next earlier minibuffer input, and use @kbd{M-n} or
+down-arrow (@code{next-history-element}) to ``move to'' the next later
+input.
+
+  The previous input that you fetch from the history entirely replaces
+the contents of the minibuffer.  To use it as the argument, exit the
+minibuffer as usual with @key{RET}.  You can also edit the text before
+you reuse it; this does not change the history element that you
+``moved'' to, but your new argument does go at the end of the history
+list in its own right.
+
+  For many minibuffer arguments there is a ``default'' value.  In some
+cases, the minibuffer history commands know the default value.  Then you
+can insert the default value into the minibuffer as text by using
+@kbd{M-n} to move ``into the future'' in the history.
+
+@findex previous-matching-history-element
+@findex next-matching-history-element
+@kindex M-r @r{(minibuffer history)}
+@kindex M-s @r{(minibuffer history)}
+  There are also commands to search forward or backward through the
+history; they search for history elements that match a regular
+expression that you specify with the minibuffer.  @kbd{M-r}
+(@code{previous-matching-history-element}) searches older elements in
+the history, while @kbd{M-s} (@code{next-matching-history-element})
+searches newer elements.  By special dispensation, these commands can
+use the minibuffer to read their arguments even though you are already
+in the minibuffer when you issue them.  As with incremental searching,
+an uppercase letter in the regular expression makes the search
+case-sensitive (@pxref{Search Case}).
+
+  All uses of the minibuffer record your input on a history list, but
+there are separate history lists for different kinds of arguments.  For
+example, there is a list for file names, used by all the commands that
+read file names.
+
+  There are several other very specific history lists, including one for
+command names read by @kbd{M-x}, one for buffer names, one for arguments
+of commands like @code{query-replace}, and one for compilation commands
+read by @code{compile}.  Finally, there is one ``miscellaneous'' history
+list that most minibuffer arguments use.
+
+@c Do wee need this?
+@ignore
+@vindex history-length
+  The variable @code{history-length} specifies the maximum length of a
+minibuffer history list; once a list gets that long, the oldest element
+is deleted each time an element is added.  If the value of
+@code{history-length} is @code{t}, though, there is no maximum length
+and elements are never deleted.
+@end ignore
+
+@node Repetition,  , Minibuffer History, Minibuffer
 @section Repeating Minibuffer Commands
 @cindex command history
 @cindex history of commands
 
   Every command that uses the minibuffer at least once is recorded on a
-special history list, together with the values of the minibuffer arguments,
-so that you can repeat the command easily.  In particular, every
-use of @kbd{Meta-x} is recorded, since @kbd{M-x} uses the minibuffer to
-read the command name.
+special history list, together with the values of its arguments, so that
+you can repeat the entire command.  In particular, every use of
+@kbd{M-x} is recorded there, since @kbd{M-x} uses the minibuffer to read
+the command name.
 
 @findex list-command-history
 @c widecommands
 @table @kbd
-@item C-x @key{ESC}
-Re-execute a recent minibuffer command @*(@code{repeat-complex-command}).
+@item C-x @key{ESC} @key{ESC}
+Re-execute a recent minibuffer command (@code{repeat-complex-command}).
 @item M-p
 Within @kbd{C-x @key{ESC}}, move to previous recorded command
 (@code{previous-history-element}).
 @item M-n
 Within @kbd{C-x @key{ESC}}, move to the next (more recent) recorded
-command (@code{next-history-element}).@refill
+command (@code{next-history-element}).
 @item M-x list-command-history
 Display the entire command history, showing all the commands
-@kbd{C-x @key{ESC}} can repeat, most recent first.@refill
+@kbd{C-x @key{ESC} @key{ESC}} can repeat, most recent first.
 @end table
 
-@kindex C-x ESC
+@kindex C-x ESC ESC
 @findex repeat-complex-command
-  @kbd{C-x @key{ESC}} is used to re-execute a recent command that used
-the minibuffer. With no argument, it repeats the last command.  A numeric
-argument specifies which command to repeat; 1 means the last one, and
-larger numbers specify earlier commands.
-
-  @kbd{C-x @key{ESC}} works by turning the previous command into a Lisp
-expression and then entering a minibuffer initialized with the text for
-that expression.  If you type just @key{RET}, the command is repeated as
-before.  You can also change the command by editing the Lisp expression.
-The expression you finally submit will be executed.  The repeated
-command is added to the front of the command history unless it is
-identical to the most recently executed command already there.
+  @kbd{C-x @key{ESC} @key{ESC}} is used to re-execute a recent
+minibuffer-using command.  With no argument, it repeats the last such
+command.  A numeric argument specifies which command to repeat; one
+means the last one, and larger numbers specify earlier ones.
+
+  @kbd{C-x @key{ESC} @key{ESC}} works by turning the previous command
+into a Lisp expression and then entering a minibuffer initialized with
+the text for that expression.  If you type just @key{RET}, the command
+is repeated as before.  You can also change the command by editing the
+Lisp expression.  Whatever expression you finally submit is what will be
+executed.  The repeated command is added to the front of the command
+history unless it is identical to the most recently executed command
+already there.
 
   Even if you don't understand Lisp syntax, it will probably be obvious
 which command is displayed for repetition.  If you do not change the text,
@@ -362,17 +513,17 @@ you can be sure the command will repeat exactly as before.
 @kindex M-p
 @findex next-complex-command
 @findex previous-complex-command
-  If you are in the minibuffer for @kbd{C-x @key{ESC}} and the command shown
-to you is not the one you want to repeat, you can move around the list of
-previous commands using @kbd{M-n} and @kbd{M-p}.  @kbd{M-p} replaces the
-contents of the minibuffer with the next earlier recorded command, and
-@kbd{M-n} replaces it with the next later command.  After finding the
-desired previous command, you can edit its expression and then
-resubmit it by typing @key{RET}.  Any editing you have done on the
-command to be repeated is lost if you use @kbd{M-n} or @kbd{M-p}.
-
-@kbd{M-n} and @kbd{M-p} are specially defined within @kbd{C-x @key{ESC}}
-to run the commands @code{previous-history-element} and
+  If you are in the minibuffer for @kbd{C-x @key{ESC} @key{ESC}} and the
+command shown to you is not the one you want to repeat, you can move
+around the list of previous commands using @kbd{M-n} and @kbd{M-p}.
+@kbd{M-p} replaces the contents of the minibuffer with the next earlier
+recorded command, and @kbd{M-n} replaces it with the next later command.
+After finding the desired previous command, you can edit its expression
+and then resubmit it by typing @key{RET}.  Any editing you have done on
+the command to be repeated is lost if you use @kbd{M-n} or @kbd{M-p}.
+
+@kbd{M-n} and @kbd{M-p} are specially defined within @kbd{C-x @key{ESC}
+@key{ESC}} to run the commands @code{previous-history-element} and
 @code{next-history-element}.
 
 @vindex command-history
index 9435e1e..fe7810f 100644 (file)
@@ -3,22 +3,20 @@
 @chapter Registers
 @cindex registers
 
-  Emacs @dfn{registers} are places in which you can save text or
-positions for later use.  Text saved in a register can be copied into
-the buffer once or many times; a position saved in a register is used by
-moving point to that position.  Rectangles can also be copied into and
-out of registers (@pxref{Rectangles}).
+  XEmacs @dfn{registers} are places in which you can save text or
+positions for later use.  Once you save text or a rectangle in a
+register, you can copy it into the buffer once or many times; a position
+saved in a register is used by moving point to that position.
+Rectangles can also be copied into and out of registers
+(@pxref{Rectangles}).
 
-  Each register has a name, which is a single character.  A register can
-store either a piece of text, a position, or a rectangle, but only one
-thing at any given time.  Whatever you store in a register remains
-there until you store something else in that register.
-
-@menu
-* RegPos::    Saving positions in registers.
-* RegText::   Saving text in registers.
-* RegRect::   Saving rectangles in registers.
-@end menu
+@findex view-register
+  Each register has a name which is a single character.  A register can
+store a piece of text, a rectangle, a position, a window configuration,
+or a file name, but only one thing at any given time.  Whatever you
+store in a register remains there until you store something else in that
+register.  To see what a register @var{r} contains, use @kbd{M-x
+view-register}.
 
 @table @kbd
 @item M-x view-register @key{RET} @var{r}
@@ -29,34 +27,49 @@ Display a description of what register @var{r} contains.
   @kbd{M-x view-register} reads a register name as an argument and then
 displays the contents of the specified register.
 
+@menu
+* Position: RegPos.           Saving positions in registers.
+* Text: RegText.              Saving text in registers.
+* Rectangle: RegRect.         Saving rectangles in registers.
+* Configurations: RegConfig.  Saving window configurations in registers.
+* Files: RegFiles.            File names in registers.
+* Numbers: RegNumbers.        Numbers in registers.
+* Bookmarks::                 Bookmarks are like registers, but persistent.
+@end menu
+
 @node RegPos, RegText, Registers, Registers
 @section Saving Positions in Registers
 
-  Saving a position records a spot in a buffer so you can move
-back there later.  Moving to a saved position re-selects the buffer
-and moves point to the spot.
+  Saving a position records a place in a buffer so that you can move
+back there later.  Moving to a saved position switches to that buffer
+and moves point to that place in it.
 
 @table @kbd
-@item C-x r SPC @var{r}
-Save the location of point in register @var{r} (@code{point-to-register}).
+@item C-x r @key{SPC} @var{r}
+Save position of point in register @var{r} (@code{point-to-register}).
 @item C-x r j @var{r}
-Jump to the location saved in register @var{r} (@code{register-to-point}).
+Jump to the position saved in register @var{r} (@code{jump-to-register}).
 @end table
 
 @kindex C-x r SPC
 @findex point-to-register
-  To save the current location of point in a register, choose a name
-@var{r} and type @kbd{C-x r SPC @var{r}}.  The register @var{r} retains
-the location thus saved until you store something else in that
-register.@refill
+  To save the current position of point in a register, choose a name
+@var{r} and type @kbd{C-x r @key{SPC} @var{r}}.  The register @var{r}
+retains the position thus saved until you store something else in that
+register.
 
 @kindex C-x r j
-@findex register-to-point
-  The command @kbd{C-x r j @var{r}} moves point to the location recorded
+@findex jump-to-register
+  The command @kbd{C-x r j @var{r}} moves point to the position recorded
 in register @var{r}.  The register is not affected; it continues to
 record the same location.  You can jump to the same position using the
 same register as often as you want.
 
+  If you use @kbd{C-x r j} to go to a saved position, but the buffer it
+was saved from has been killed, @kbd{C-x r j} tries to create the buffer
+again by visiting the same file.  Of course, this works only for buffers
+that were visiting files.
+
 @node RegText, RegRect, RegPos, Registers
 @section Saving Text in Registers
 
@@ -65,46 +78,234 @@ can be impractical to use the kill ring, since each subsequent kill moves
 the piece of text further down on the ring.  It becomes hard to keep
 track of the argument needed to retrieve the same text with @kbd{C-y}.  An
 alternative is to store the text in a register with @kbd{C-x r s}
-(@code{copy-to-register}) and then retrieve it with @kbd{C-x r g}
+(@code{copy-to-register}) and then retrieve it with @kbd{C-x r i}
 (@code{insert-register}).
 
 @table @kbd
 @item C-x r s @var{r}
 Copy region into register @var{r} (@code{copy-to-register}).
 @item C-x r g @var{r}
+@itemx C-x r i @var{r}
 Insert text contents of register @var{r} (@code{insert-register}).
 @end table
 
 @kindex C-x r s
 @kindex C-x r g
+@kindex C-x r i
 @findex copy-to-register
 @findex insert-register
   @kbd{C-x r s @var{r}} stores a copy of the text of the region into the
-register named @var{r}.  Given a numeric argument, @kbd{C-x r s} deletes the
-text from the buffer as well.
+register named @var{r}.  Given a numeric argument, @kbd{C-x r s @var{r}}
+deletes the text from the buffer as well.
 
-  @kbd{C-x r g @var{r}} inserts the text from register @var{r} in the buffer.
-By default it leaves point before the text and places the mark after it. 
-With a numeric argument, it puts point after the text and the mark
-before it.
+  @kbd{C-x r i @var{r}} inserts the text from register @var{r} in the buffer.
+By default it leaves point before the text and places the mark after
+it. With a numeric argument (@kbd{C-u}), it puts point after the text
+and the mark before it.
 
-@node RegRect,, RegText, Registers
+@node RegRect, RegConfig, RegText, Registers
 @section Saving Rectangles in Registers
 @cindex rectangle
-@findex copy-region-to-rectangle
 
   A register can contain a rectangle instead of lines of text.  The rectangle
 is represented as a list of strings.  @xref{Rectangles}, for basic
 information on rectangles and how to specify rectangles in a buffer.
 
 @table @kbd
+@findex copy-rectangle-to-register
+@kindex C-x r r
 @item C-x r r @var{r}
-Copy the region-rectangle into register @var{r}(@code{copy-rectangle-to-register}).
-With a numeric argument, delete it as well.
+Copy the region-rectangle into register @var{r}
+(@code{copy-rectangle-to-register}).  With a numeric argument, delete it
+as well.
 @item C-x r g @var{r}
+@itemx C-x r i @var{r}
 Insert the rectangle stored in register @var{r} (if it contains a
 rectangle) (@code{insert-register}).
 @end table
 
-  The @kbd{C-x r g} command inserts linear text if the register contains
+  The @kbd{C-x r i @var{r}} command inserts linear text if the register
+  contains
 that, or inserts a rectangle if the register contains one.
+
+  See also the command @code{sort-columns}, which you can think of
+as sorting a rectangle.  @xref{Sorting}.
+
+@node RegConfig, RegNumbers, RegRect, Registers
+@section Saving Window Configurations in Registers
+
+@findex window-configuration-to-register
+@findex frame-configuration-to-register
+@kindex C-x r w
+@c @kindex C-x r f
+  You can save the window configuration of the selected frame in a
+register, or even the configuration of all windows in all frames, and
+restore the configuration later.
+
+@table @kbd
+@item C-x r w @var{r}
+Save the state of the selected frame's windows in register @var{r}
+(@code{window-configuration-to-register}).
+@c @item C-x r f @var{r}
+@item M-x frame-configuration-to-register @key{RET} @var{r}
+Save the state of all frames, including all their windows, in register
+@var{r} (@code{frame-configuration-to-register}).
+@end table
+
+  Use @kbd{C-x r j @var{r}} to restore a window or frame configuration.
+This is the same command used to restore a cursor position.  When you
+restore a frame configuration, any existing frames not included in the
+configuration become invisible.  If you wish to delete these frames
+instead, use @kbd{C-u C-x r j @var{r}}.
+
+@node RegNumbers, RegFiles, RegConfig, Registers
+@section Keeping Numbers in Registers
+
+  There are commands to store a number in a register, to insert
+the number in the buffer in decimal, and to increment it.  These commands
+can be useful in keyboard macros (@pxref{Keyboard Macros}).
+
+@table @kbd
+@item C-u @var{number} C-x r n @var{reg}
+@kindex C-x r n
+@findex number-to-register
+Store @var{number} into register @var{reg} (@code{number-to-register}).
+@item C-u @var{number} C-x r + @var{reg}
+@kindex C-x r +
+@findex increment-register
+Increment the number in register @var{reg} by @var{number}
+(@code{increment-register}).
+@item C-x r g @var{reg}
+Insert the number from register @var{reg} into the buffer.
+@end table
+
+  @kbd{C-x r g} is the same command used to insert any other
+sort of register contents into the buffer.
+
+@node RegFiles, Bookmarks, RegNumbers, Registers
+@section Keeping File Names in Registers
+
+  If you visit certain file names frequently, you can visit them more
+conveniently if you put their names in registers.  Here's the Lisp code
+used to put a file name in a register:
+
+@smallexample
+(set-register ?@var{r} '(file . @var{name}))
+@end smallexample
+
+@need 3000
+@noindent
+For example,
+
+@smallexample
+(set-register ?z '(file . "/usr/src/xemacs/src/ChangeLog"))
+@end smallexample
+
+@noindent
+puts the file name shown in register @samp{z}.
+
+  To visit the file whose name is in register @var{r}, type @kbd{C-x r j
+@var{r}}.  (This is the same command used to jump to a position or
+restore a frame configuration.)
+
+@node Bookmarks,  , RegFiles, Registers
+@section Bookmarks
+@cindex bookmarks
+
+  @dfn{Bookmarks} are somewhat like registers in that they record
+positions you can jump to.  Unlike registers, they have long names, and
+they persist automatically from one Emacs session to the next.  The
+prototypical use of bookmarks is to record ``where you were reading'' in
+various files.
+
+  Note: bookmark.el is distributed in edit-utils package.  You need to
+install that to use bookmark facility (@pxref{Packages}).
+
+@table @kbd
+@item C-x r m @key{RET}
+Set the bookmark for the visited file, at point.
+
+@item C-x r m @var{bookmark} @key{RET}
+@findex bookmark-set
+Set the bookmark named @var{bookmark} at point (@code{bookmark-set}).
+
+@item C-x r b @var{bookmark} @key{RET}
+@findex bookmark-jump
+Jump to the bookmark named @var{bookmark} (@code{bookmark-jump}).
+
+@item C-x r l
+@findex list-bookmarks
+List all bookmarks (@code{list-bookmarks}).
+
+@item M-x bookmark-save
+@findex bookmark-save
+Save all the current bookmark values in the default bookmark file.
+@end table
+
+@kindex C-x r m
+@findex bookmark-set
+@kindex C-x r b
+@findex bookmark-jump
+  The prototypical use for bookmarks is to record one current position
+in each of several files.  So the command @kbd{C-x r m}, which sets a
+bookmark, uses the visited file name as the default for the bookmark
+name.  If you name each bookmark after the file it points to, then you
+can conveniently revisit any of those files with @kbd{C-x r b}, and move
+to the position of the bookmark at the same time.
+
+@kindex C-x r l
+  To display a list of all your bookmarks in a separate buffer, type
+@kbd{C-x r l} (@code{list-bookmarks}).  If you switch to that buffer,
+you can use it to edit your bookmark definitions or annotate the
+bookmarks.  Type @kbd{C-h m} in that buffer for more information about
+its special editing commands.
+
+  When you kill XEmacs, XEmacs offers to save your bookmark values in
+your default bookmark file, @file{~/.emacs.bmk}, if you have changed any
+bookmark values.  You can also save the bookmarks at any time with the
+@kbd{M-x bookmark-save} command.  The bookmark commands load your
+default bookmark file automatically.  This saving and loading is how
+bookmarks persist from one XEmacs session to the next.
+
+@vindex bookmark-save-flag
+  If you set the variable @code{bookmark-save-flag} to 1, then each
+command that sets a bookmark will also save your bookmarks; this way,
+you don't lose any bookmark values even if XEmacs crashes.  (The value,
+if a number, says how many bookmark modifications should go by between
+saving.)
+
+@vindex bookmark-search-size
+  Bookmark position values are saved with surrounding context, so that
+@code{bookmark-jump} can find the proper position even if the file is
+modified slightly.  The variable @code{bookmark-search-size} says how
+many characters of context to record, on each side of the bookmark's
+position.
+
+  Here are some additional commands for working with bookmarks:
+
+@table @kbd
+@item M-x bookmark-load @key{RET} @var{filename} @key{RET}
+@findex bookmark-load
+Load a file named @var{filename} that contains a list of bookmark
+values.  You can use this command, as well as @code{bookmark-write}, to
+work with other files of bookmark values in addition to your default
+bookmark file.
+
+@item M-x bookmark-write @key{RET} @var{filename} @key{RET}
+@findex bookmark-write
+Save all the current bookmark values in the file @var{filename}.
+
+@item M-x bookmark-delete @key{RET} @var{bookmark} @key{RET}
+@findex bookmark-delete
+Delete the bookmark named @var{bookmark}.
+
+@item M-x bookmark-insert-location @key{RET} @var{bookmark} @key{RET}
+@findex bookmark-insert-location
+Insert in the buffer the name of the file that bookmark @var{bookmark}
+points to.
+
+@item M-x bookmark-insert @key{RET} @var{bookmark} @key{RET}
+@findex bookmark-insert
+Insert in the buffer the @emph{contents} of the file that bookmark
+@var{bookmark} points to.
+@end table
index 0ad18f7..cbbf13c 100644 (file)
@@ -90,9 +90,8 @@ translation approved by the author instead of in the original English.
 @page
 @ifinfo
 @node Top, License,, (dir)
+@top The XEmacs Editor
 
-The XEmacs Editor
-*****************
 
 XEmacs is the extensible, customizable, self-documenting real-time
 display editor.  This Info file describes how to edit with Emacs
index 993621f..dcf8740 100644 (file)
@@ -1,3 +1,23 @@
+2000-01-18  Martin Buchholz <martin@xemacs.org>
+
+       * XEmacs 21.2.27 is released.
+
+2000-01-18  Martin Buchholz  <martin@xemacs.org>
+
+       * minitar.c: Errno.h --> errno.h.  Remove errno declaration.
+
+2000-01-13  Kirill 'Big K' Katsnelson  <kkm@dtmx.com>
+
+       * xemacs.mak: Added USE_PORTABLE_DUMPER make command line macro.
+       (temacs:) Added dependency for lastfile.lib so that 'make temacs'
+       builds it first.
+
+1999-12-28  Scott Blachowicz  <Scott.Blachowicz@seaslug.org>
+
+       * minitar.mak: Add vars to allow building from main xemacs.mak.
+
+       * xemacs.mak: Add rules to build & install minitar.
+
 1999-12-31  Martin Buchholz <martin@xemacs.org>
 
        * XEmacs 21.2.26 is released.
index e012c18..7571782 100644 (file)
@@ -611,16 +611,8 @@ on various systems. */
 /* Should movemail use hesiod for getting POP server host? */
 #undef HESIOD
 /* Determine type of mail locking. */
-/* Play preprocessor games so that configure options override s&m files */
-#undef REAL_MAIL_USE_LOCKF
-#undef REAL_MAIL_USE_FLOCK
-#undef MAIL_USE_LOCKF
-#undef MAIL_USE_FLOCK
-#ifdef REAL_MAIL_USE_FLOCK
-#define MAIL_USE_FLOCK
-#endif
-#ifdef REAL_MAIL_USE_LOCKF
-#define MAIL_USE_LOCKF
-#endif
+#undef MAIL_LOCK_LOCKF
+#undef REAL_LOCK_FLOCK
+#undef MAIL_LOCK_DOT
 
 #endif /* _SRC_CONFIG_H_ */
index 75127f6..2fa8b52 100644 (file)
@@ -13,7 +13,7 @@
 
 
 #include <stdio.h>
-#include <Errno.h>
+#include <errno.h>
 
 #include <zlib.h>
 
@@ -43,7 +43,6 @@ int makepath(char *path)
 {
   char tmp[MAXNAMELEN];
   char *cp;
-  extern int errno;
 
   for (cp=path; cp; cp = (char*)strchr(cp+1,'/')){
     if (!*cp)
index 9090b73..e04f1c3 100644 (file)
@@ -129,12 +129,18 @@ DEBUG_XEMACS=0
 !if !defined(USE_UNION_TYPE)
 USE_UNION_TYPE=0
 !endif
+!if !defined(USE_MINITAR)
+USE_MINITAR=1
+!endif
 !if !defined(USE_MINIMAL_TAGBITS)
 USE_MINIMAL_TAGBITS=0
 !endif
 !if !defined(USE_INDEXED_LRECORD_IMPLEMENTATION)
 USE_INDEXED_LRECORD_IMPLEMENTATION=0
 !endif
+!if !defined(USE_PORTABLE_DUMPER)
+USE_PORTABLE_DUMPER=0
+!endif
 !if !defined(GUNG_HO)
 GUNG_HO=0
 !endif
@@ -341,6 +347,10 @@ TAGBITS_DEFINES=-DUSE_MINIMAL_TAGBITS
 LRECORD_DEFINES=-DUSE_INDEXED_LRECORD_IMPLEMENTATION
 !endif
 !if $(USE_UNION_TYPE)
+!if $(USE_PORTABLE_DUMPER)
+DUMPER_DEFINES=-DPDUMP
+!endif
+
 UNION_DEFINES=-DUSE_UNION_TYPE
 !endif
 
@@ -359,7 +369,7 @@ PATH_DEFINES=-DPATH_PREFIX=\"$(PATH_PREFIX)\"
 INCLUDES=$(X_INCLUDES) $(MSW_INCLUDES) -I$(XEMACS)\nt\inc -I$(XEMACS)\src -I$(XEMACS)\lwlib
 
 DEFINES=$(X_DEFINES) $(MSW_DEFINES) $(MULE_DEFINES) \
-       $(TAGBITS_DEFINES) $(LRECORD_DEFINES) $(UNION_DEFINES) \
+       $(TAGBITS_DEFINES) $(LRECORD_DEFINES) $(UNION_DEFINES) $(DUMPER_DEFINES)\
        -DWIN32 -D_WIN32 -DWIN32_LEAN_AND_MEAN -DWINDOWSNT -Demacs \
        -DHAVE_CONFIG_H $(PROGRAM_DEFINES) $(PATH_DEFINES)
 
@@ -428,6 +438,8 @@ $(LIB_SRC)/movemail.exe: $(LIB_SRC)/movemail.c $(LIB_SRC)/pop.c $(ETAGS_DEPS)
        cd $(LIB_SRC)
        $(CCV) -I. -I$(XEMACS)/src -I$(XEMACS)/nt/inc $(LIB_SRC_DEFINES) $(CFLAGS) -Fe$@ $** wsock32.lib -link -incremental:no
        cd $(NT)
+$(LIB_SRC)/minitar.exe : $(NT)/minitar.mak $(NT)/minitar.c
+       nmake -nologo -f minitar.mak ZLIB="$(ZLIB_DIR)" NT="$(NT)" LIB_SRC="$(LIB_SRC)"
 
 LIB_SRC_TOOLS = \
        $(LIB_SRC)/make-docfile.exe     \
@@ -437,6 +449,14 @@ LIB_SRC_TOOLS = \
        $(LIB_SRC)/sorted-doc.exe       \
        $(LIB_SRC)/wakeup.exe           \
        $(LIB_SRC)/etags.exe            
+!if $(USE_MINITAR)
+LIB_SRC_TOOLS = \
+       $(LIB_SRC_TOOLS) \
+       $(LIB_SRC)/minitar.exe
+!endif
+
+# Shorthand target
+minitar: $(LIB_SRC)/minitar.exe
 
 #------------------------------------------------------------------------------
 
@@ -1142,6 +1162,7 @@ $(DOC): $(LIB_SRC)\make-docfile.exe
        $(LIB_SRC)\make-docfile.exe -a $(DOC) -d $(TEMACS_SRC) $(DOC_SRC9)
 
 update-elc:
+       set EMACSBOOTSTRAPMODULEPATH=$(MODULES)
        set EMACSBOOTSTRAPLOADPATH=$(LISP);$(PACKAGE_PATH)
        set EMACSBOOTSTRAPMODULEPATH=$(MODULES)
        $(TEMACS) -batch -l $(TEMACS_DIR)\..\lisp\update-elc.el
@@ -1163,7 +1184,7 @@ all:      $(XEMACS)\Installation $(OUTDIR)\nul $(LASTFILE) $(LWLIB) \
        $(LIB_SRC_TOOLS) $(RUNEMACS) $(TEMACS) update-elc $(DOC) dump-xemacs \
        $(LISP)/auto-autoloads.el $(LISP)/custom-load.el info
 
-temacs: $(TEMACS)
+temacs: $(LASTFILE) $(TEMACS)
 
 # use this rule to install the system
 install:       all
@@ -1321,6 +1342,9 @@ XEmacs $(XEMACS_VERSION_STRING) $(xemacs_codename:"=\") configured for `$(EMACS_
 !if $(USE_UNION_TYPE)
   Using union type for Lisp object storage.
 !endif
+!if $(USE_PORTABLE_DUMPER)
+  Using portable dumper.
+!endif
 !if $(DEBUG_XEMACS)
   Compiling in extra debug checks. XEmacs will be slow!
 !endif
index 36aede3..21d04e1 100644 (file)
@@ -502,7 +502,7 @@ debug-temacs: temacs
 ## Purify
 PURIFY_PROG  = purify
 PURIFY_FLAGS = -chain-length=32 -ignore-signals=SIGPOLL -threads=yes \
- -cache-dir=./purecache -always-use-cache-dir=yes -pointer-mask=0x0fffffff
+ -cache-dir=./purecache -always-use-cache-dir=yes
 PURIFY_LIBS  = -lpthread
 puremacs: $(temacs_deps)
        $(PURIFY_PROG) $(PURIFY_FLAGS) $(LD) $(temacs_link_args) $(PURIFY_LIBS)
index e39fe3f..9058be8 100644 (file)
@@ -527,6 +527,10 @@ funcall_compiled_function (Lisp_Object fun, int nargs, Lisp_Object args[])
   }
 
  wrong_number_of_arguments:
+  /* The actual printed compiled_function object is incomprehensible.
+     Check the backtrace to see if we can get a more meaningful symbol. */
+  if (EQ (fun, indirect_function (*backtrace_list->function, 0)))
+    fun = *backtrace_list->function;
   return Fsignal (Qwrong_number_of_arguments, list2 (fun, make_int (nargs)));
 }
 
index c836d8c..12fc504 100644 (file)
@@ -278,6 +278,8 @@ CODESYS defaults to the value of `terminal-coding-system'.
   set_encoding_stream_coding_system
     (XLSTREAM (CONSOLE_TTY_DATA (decode_tty_console (console))->outstream),
      Fget_coding_system (NILP (codesys) ? Vterminal_coding_system : codesys));
+  /* Redraw tty */
+  face_property_was_changed (Vdefault_face, Qfont, Qtty);
   return Qnil;
 }
 
index 29fe779..397f65d 100644 (file)
@@ -413,19 +413,11 @@ xhash_table (Lisp_Object hash_table)
 /************************************************************************/
 
 /* Creation of hash tables, without error-checking. */
-static double
-hash_table_rehash_threshold (Lisp_Hash_Table *ht)
-{
-  return
-    ht->rehash_threshold > 0.0 ? ht->rehash_threshold :
-    ht->size > 4096 && !ht->test_function ? 0.7 : 0.6;
-}
-
 static void
 compute_hash_table_derived_values (Lisp_Hash_Table *ht)
 {
   ht->rehash_count = (size_t)
-    ((double) ht->size * hash_table_rehash_threshold (ht));
+    ((double) ht->size * ht->rehash_threshold);
   ht->golden_ratio = (size_t)
     ((double) ht->size * (.6180339887 / (double) sizeof (Lisp_Object)));
 }
@@ -440,10 +432,6 @@ make_general_lisp_hash_table (enum hash_table_test test,
   Lisp_Object hash_table;
   Lisp_Hash_Table *ht = alloc_lcrecord_type (Lisp_Hash_Table, &lrecord_hash_table);
 
-  ht->rehash_size      = rehash_size;
-  ht->rehash_threshold = rehash_threshold;
-  ht->weakness         = weakness;
-
   switch (test)
     {
     case HASH_TABLE_EQ:
@@ -465,15 +453,21 @@ make_general_lisp_hash_table (enum hash_table_test test,
       abort ();
     }
 
-  if (ht->rehash_size <= 0.0)
-    ht->rehash_size = HASH_TABLE_DEFAULT_REHASH_SIZE;
+  ht->weakness = weakness;
+
+  ht->rehash_size =
+    rehash_size > 1.0 ? rehash_size : HASH_TABLE_DEFAULT_REHASH_SIZE;
+
+  ht->rehash_threshold =
+    rehash_threshold > 0.0 ? rehash_threshold :
+    size > 4096 && !ht->test_function ? 0.7 : 0.6;
+
   if (size < HASH_TABLE_MIN_SIZE)
     size = HASH_TABLE_MIN_SIZE;
-  if (rehash_threshold < 0.0)
-    rehash_threshold = 0.75;
-  ht->size =
-    hash_table_size ((size_t) ((double) size / hash_table_rehash_threshold (ht)) + 1);
+  ht->size = hash_table_size ((size_t) (((double) size / ht->rehash_threshold)
+                                       + 1.0));
   ht->count = 0;
+
   compute_hash_table_derived_values (ht);
 
   /* We leave room for one never-occupied sentinel hentry at the end.  */
@@ -500,8 +494,7 @@ make_lisp_hash_table (size_t size,
                      enum hash_table_weakness weakness,
                      enum hash_table_test test)
 {
-  return make_general_lisp_hash_table
-    (test, size, HASH_TABLE_DEFAULT_REHASH_SIZE, -1.0, weakness);
+  return make_general_lisp_hash_table (test, size, -1.0, -1.0, weakness);
 }
 
 /* Pretty reading of hash tables.
@@ -1090,7 +1083,7 @@ beyond which the HASH-TABLE is enlarged by rehashing.
 */
        (hash_table))
 {
-  return make_float (hash_table_rehash_threshold (xhash_table (hash_table)));
+  return make_float (xhash_table (hash_table)->rehash_threshold);
 }
 
 DEFUN ("hash-table-weakness", Fhash_table_weakness, 1, 1, 0, /*
index 1992302..e2768e7 100644 (file)
@@ -4743,7 +4743,7 @@ backtrace_specials (int speccount, int speclimit, Lisp_Object stream)
 
 DEFUN ("backtrace", Fbacktrace, 0, 2, "", /*
 Print a trace of Lisp function calls currently active.
-Option arg STREAM specifies the output stream to send the backtrace to,
+Optional arg STREAM specifies the output stream to send the backtrace to,
 and defaults to the value of `standard-output'.  Optional second arg
 DETAILED means show places where currently active variable bindings,
 catches, condition-cases, and unwind-protects were made as well as
@@ -4786,8 +4786,8 @@ function calls.
       if (!NILP (detailed) && catches && catches->backlist == backlist)
        {
           int catchpdl = catches->pdlcount;
-          if (specpdl[catchpdl].func == condition_case_unwind
-              && speccount > catchpdl)
+          if (speccount > catchpdl
+             && specpdl[catchpdl].func == condition_case_unwind)
             /* This is a condition-case catchpoint */
             catchpdl = catchpdl + 1;
 
index 4bea4e7..46161af 100644 (file)
@@ -1339,8 +1339,8 @@ handle_focus_event_1 (struct frame *f, int in_p)
      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
      click in the frame. Why is this?  */
-  if (in_p 
-#if XtSpecificationRelease > 5      
+  if (in_p
+#if XtSpecificationRelease > 5
       && FRAME_X_TEXT_WIDGET (f) != focus_widget
 #endif
       )
@@ -2011,22 +2011,24 @@ static void
 Xt_process_to_emacs_event (struct Lisp_Event *emacs_event)
 {
   int i;
-  Lisp_Object process;
 
   assert (process_events_occurred > 0);
+
   for (i = 0; i < MAXDESC; i++)
     {
-      process = filedesc_with_input[i];
+      Lisp_Object process = filedesc_with_input[i];
       if (PROCESSP (process))
-       break;
+       {
+         filedesc_with_input[i] = Qnil;
+         process_events_occurred--;
+         /* process events have nil as channel */
+         emacs_event->event_type = process_event;
+         emacs_event->timestamp  = 0; /* #### */
+         emacs_event->event.process.process = process;
+         return;
+       }
     }
-  assert (i < MAXDESC);
-  filedesc_with_input[i] = Qnil;
-  process_events_occurred--;
-  /* process events have nil as channel */
-  emacs_event->event_type = process_event;
-  emacs_event->timestamp  = 0; /* #### */
-  emacs_event->event.process.process = process;
+  abort ();
 }
 
 static void
index 3911ef6..d8c07f1 100644 (file)
@@ -2264,9 +2264,7 @@ mswindows_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
          VOID_TO_LISP (image_instance, ii);
          if (IMAGE_INSTANCEP (image_instance)
              &&
-             IMAGE_INSTANCE_TYPE_P (image_instance, IMAGE_WIDGET)
-             &&
-             !NILP (XIMAGE_INSTANCE_WIDGET_FACE (image_instance)))
+             IMAGE_INSTANCE_TYPE_P (image_instance, IMAGE_WIDGET))
            {
              /* set colors for the buttons */
              HDC hdc = (HDC)wParam;
@@ -3004,7 +3002,7 @@ vars_of_event_mswindows (void)
   mswindows_s_dispatch_event_queue = Qnil;
   staticpro (&mswindows_s_dispatch_event_queue);
   mswindows_s_dispatch_event_queue_tail = Qnil;
-  pdump_wire (&mswindows_u_dispatch_event_queue_tail);
+  pdump_wire (&mswindows_s_dispatch_event_queue_tail);
 
   mswindows_error_caught_in_modal_loop = Qnil;
   staticpro (&mswindows_error_caught_in_modal_loop);
index 7bb19c4..e08ded9 100644 (file)
@@ -1059,7 +1059,7 @@ event_to_character (struct Lisp_Event *event,
 
   if (event->event_type != key_press_event)
     {
-      if (event->event_type == dead_event) abort ();
+      assert (event->event_type != dead_event);
       return -1;
     }
   if (!allow_extra_modifiers &&
index d0ef995..bb5fa40 100644 (file)
@@ -4618,14 +4618,9 @@ struct report_extent_modification_closure {
   int speccount;
 };
 
-/* This juggling with the pointer to another file's global variable is
-   kind of yucky.  Perhaps I should just export the variable.  */
-static int *inside_change_hook_pointer;
-
 static Lisp_Object
 report_extent_modification_restore (Lisp_Object buffer)
 {
-  *inside_change_hook_pointer = 0;
   if (current_buffer != XBUFFER (buffer))
     Fset_buffer (buffer);
   return Qnil;
@@ -4650,7 +4645,13 @@ report_extent_modification_mapper (EXTENT extent, void *arg)
   /* Now that we are sure to call elisp, set up an unwind-protect so
      inside_change_hook gets restored in case we throw.  Also record
      the current buffer, in case we change it.  Do the recording only
-     once.  */
+     once.
+
+     One confusing thing here is that our caller never actually calls
+     unbind_to (closure.speccount, Qnil).  This is because
+     map_extents_bytind() unbinds before, and with a smaller
+     speccount.  The additional unbind_to() in
+     report_extent_modification() would cause XEmacs to abort.  */
   if (closure->speccount == -1)
     {
       closure->speccount = specpdl_depth ();
@@ -4666,7 +4667,10 @@ report_extent_modification_mapper (EXTENT extent, void *arg)
   /* #### It's a shame that we can't use any of the existing run_hook*
      functions here.  This is so because all of them work with
      symbols, to be able to retrieve default values of local hooks.
-     <sigh> */
+     <sigh>
+
+     #### Idea: we could set up a dummy symbol, and call the hook
+     functions on *that*.  */
 
   if (!CONSP (hook) || EQ (XCAR (hook), Qlambda))
     call3 (hook, exobj, startobj, endobj);
@@ -4674,6 +4678,8 @@ report_extent_modification_mapper (EXTENT extent, void *arg)
     {
       Lisp_Object tail;
       EXTERNAL_LIST_LOOP (tail, hook)
+       /* #### Shouldn't this perform the same Fset_buffer() check as
+           above?  */
        call3 (XCAR (tail), exobj, startobj, endobj);
     }
   return 0;
@@ -4681,7 +4687,7 @@ report_extent_modification_mapper (EXTENT extent, void *arg)
 
 void
 report_extent_modification (Lisp_Object buffer, Bufpos start, Bufpos end,
-                           int *inside, int afterp)
+                           int afterp)
 {
   struct report_extent_modification_closure closure;
 
@@ -4691,20 +4697,8 @@ report_extent_modification (Lisp_Object buffer, Bufpos start, Bufpos end,
   closure.afterp = afterp;
   closure.speccount = -1;
 
-  inside_change_hook_pointer = inside;
-  *inside = 1;
-
   map_extents (start, end, report_extent_modification_mapper, (void *)&closure,
               buffer, NULL, ME_MIGHT_CALL_ELISP);
-
-  if (closure.speccount == -1)
-    *inside = 0;
-  else
-    {
-      /* We mustn't unbind when closure.speccount != -1 because
-        map_extents_bytind has already done that.  */
-      assert (*inside == 0);
-    }
 }
 
 \f
index 390c3e0..2a2ab9d 100644 (file)
@@ -367,7 +367,7 @@ void process_extents_for_insertion (Lisp_Object object,
                                    Bytind opoint, Bytecount length);
 void process_extents_for_deletion (Lisp_Object object, Bytind from,
                                   Bytind to, int destroy_them);
-void report_extent_modification (Lisp_Object, Bufpos, Bufpos, int *, int);
+void report_extent_modification (Lisp_Object, Bufpos, Bufpos, int);
 
 void set_extent_glyph (EXTENT extent, Lisp_Object glyph, int endp,
                       glyph_layout layout);
index bba3195..c8ec325 100644 (file)
@@ -777,4 +777,6 @@ int is_surrogate_for_selected_frame (struct frame *f);
 void update_frame_icon (struct frame *f);
 void invalidate_vertical_divider_cache_in_frame (struct frame *f);
 
+void init_frame (void);
+
 #endif /* _XEMACS_FRAME_H_ */
index 00506b5..cbe62a1 100644 (file)
@@ -1,5 +1,5 @@
 /* mswindows-specific glyph objects.
-   Copyright (C) 1998, 1999 Andy Piper.
+   Copyright (C) 1998, 1999, 2000 Andy Piper.
 
 This file is part of XEmacs.
 
@@ -439,18 +439,18 @@ static void set_mono_pixel ( unsigned char* bits,
                             int bpline, int height,
                             int x, int y, int white )
 {
-  int index;
+  int i;
   unsigned char    bitnum;
   /* Find the byte on which this scanline begins */
-  index = (height - y - 1) * bpline;
+  i = (height - y - 1) * bpline;
   /* Find the byte containing this pixel */
-  index += (x >> 3);
+  i += (x >> 3);
   /* Which bit is it? */
   bitnum = (unsigned char)( 7 - (x % 8) );
   if( white )         /* Turn it on */
-    bits[index] |= (1<<bitnum);
+    bits[i] |= (1<<bitnum);
   else         /* Turn it off */
-    bits[index] &= ~(1<<bitnum);
+    bits[i] &= ~(1<<bitnum);
 }
 
 static void
@@ -1330,15 +1330,6 @@ check_valid_resource_id (Lisp_Object data)
     signal_simple_error ("invalid resource identifier", data);
 }
 
-void
-check_valid_string_or_int (Lisp_Object data)
-{
-  if (!INTP (data))
-    CHECK_STRING (data);
-  else
-    CHECK_INT (data);
-}
-
 /**********************************************************************
  *                             XBM                                    *
  **********************************************************************/
@@ -1628,7 +1619,7 @@ static int flip_table[] =
    padded to a multiple of 16.  Scan lines are stored in increasing
    byte order from left to right, big-endian within a byte.  0 =
    black, 1 = white.  */
-HBITMAP
+static HBITMAP
 xbm_create_bitmap_from_data (HDC hdc, char *data,
                             unsigned int width, unsigned int height,
                             int mask, COLORREF fg, COLORREF bg)
@@ -2106,6 +2097,7 @@ static void
 mswindows_map_subwindow (struct Lisp_Image_Instance *p, int x, int y,
                         struct display_glyph_area* dga)
 {
+      SetFocus (GetParent (IMAGE_INSTANCE_MSWINDOWS_CLIPWINDOW (p)));
   /* move the window before mapping it ... */
   SetWindowPos (IMAGE_INSTANCE_MSWINDOWS_CLIPWINDOW (p),
                NULL,
@@ -2144,6 +2136,7 @@ mswindows_resize_subwindow (struct Lisp_Image_Instance* ii, int w, int h)
 static void
 mswindows_update_subwindow (struct Lisp_Image_Instance *p)
 {
+  /* Now do widget specific updates. */
   if (IMAGE_INSTANCE_TYPE (p) == IMAGE_WIDGET)
     {
       /* buttons checked or otherwise */
@@ -2161,10 +2154,10 @@ mswindows_update_subwindow (struct Lisp_Image_Instance *p)
       SendMessage (WIDGET_INSTANCE_MSWINDOWS_HANDLE (p),
                   WM_SETFONT,
                   (WPARAM)FONT_INSTANCE_MSWINDOWS_HFONT
-                  (XFONT_INSTANCE (widget_face_font_info
-                                   (IMAGE_INSTANCE_SUBWINDOW_FRAME (p),
+                  (XFONT_INSTANCE (query_string_font 
+                                   (IMAGE_INSTANCE_WIDGET_TEXT (p),
                                     IMAGE_INSTANCE_WIDGET_FACE (p),
-                                    0, 0))),
+                                    IMAGE_INSTANCE_SUBWINDOW_FRAME (p)))),
                   MAKELPARAM (TRUE, 0));
     }
 }
@@ -2344,9 +2337,7 @@ mswindows_widget_instantiate (Lisp_Object image_instance, Lisp_Object instantiat
     {
       id = mswindows_register_widget_instance (image_instance, domain);
     }
-  /* have to set the type this late in case there is no device
-     instantiation for a widget */
-  IMAGE_INSTANCE_TYPE (ii) = IMAGE_WIDGET;
+
   if (!NILP (IMAGE_INSTANCE_WIDGET_TEXT (ii)))
     GET_C_STRING_OS_DATA_ALLOCA (IMAGE_INSTANCE_WIDGET_TEXT (ii), nm);
 
@@ -2355,7 +2346,7 @@ mswindows_widget_instantiate (Lisp_Object image_instance, Lisp_Object instantiat
 
   if ((IMAGE_INSTANCE_MSWINDOWS_CLIPWINDOW (ii)
        = CreateWindowEx(
-                       0,              /* EX flags */
+                       WS_EX_CONTROLPARENT,    /* EX flags */
                        XEMACS_CONTROL_CLASS,
                        0,              /* text */
                        WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_CHILD,
@@ -2396,17 +2387,17 @@ mswindows_widget_instantiate (Lisp_Object image_instance, Lisp_Object instantiat
   /* set the widget font from the widget face */
   SendMessage (wnd, WM_SETFONT,
               (WPARAM)FONT_INSTANCE_MSWINDOWS_HFONT
-              (XFONT_INSTANCE (widget_face_font_info
-                               (domain,
+              (XFONT_INSTANCE (query_string_font
+                               (IMAGE_INSTANCE_WIDGET_TEXT (ii),
                                 IMAGE_INSTANCE_WIDGET_FACE (ii),
-                                0, 0))),
+                                domain))),
               MAKELPARAM (TRUE, 0));
 }
 
 /* Instantiate a button widget. Unfortunately instantiated widgets are
    particular to a frame since they need to have a parent. It's not
    like images where you just select the image into the context you
-   want to display it in and BitBlt it. So images instances can have a
+   want to display it in and BitBlt it. So image instances can have a
    many-to-one relationship with things you see, whereas widgets can
    only be one-to-one (i.e. per frame) */
 static void
@@ -2417,15 +2408,14 @@ mswindows_button_instantiate (Lisp_Object image_instance, Lisp_Object instantiat
   /* this function can call lisp */
   struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
   HWND wnd;
-  int flags = BS_NOTIFY;
+  int flags = WS_TABSTOP;/* BS_NOTIFY #### is needed to get exotic feedback
+                           only. Since we seem to want nothing beyond BN_CLICK,
+                           the style is perhaps not necessary -- kkm */
   Lisp_Object style;
   Lisp_Object gui = IMAGE_INSTANCE_WIDGET_ITEM (ii);
   struct Lisp_Gui_Item* pgui = XGUI_ITEM (gui);
   Lisp_Object glyph = find_keyword_in_vector (instantiator, Q_image);
 
-  if (!gui_item_active_p (gui))
-    flags |= WS_DISABLED;
-
   if (!NILP (glyph))
     {
       if (!IMAGE_INSTANCEP (glyph))
@@ -2438,6 +2428,8 @@ mswindows_button_instantiate (Lisp_Object image_instance, Lisp_Object instantiat
 
   style = pgui->style;
 
+  /* #### consider using the default face for radio and toggle
+     buttons. */
   if (EQ (style, Qradio))
     {
       flags |= BS_RADIOBUTTON;
@@ -2447,11 +2439,13 @@ mswindows_button_instantiate (Lisp_Object image_instance, Lisp_Object instantiat
       flags |= BS_AUTOCHECKBOX;
     }
   else
-    flags |= BS_DEFPUSHBUTTON;
+    {
+      flags |= BS_DEFPUSHBUTTON;
+    }
 
   mswindows_widget_instantiate (image_instance, instantiator, pointer_fg,
-                               pointer_bg, dest_mask, domain, "BUTTON", flags,
-                               WS_EX_CONTROLPARENT);
+                               pointer_bg, dest_mask, domain, "BUTTON", 
+                               flags, 0);
 
   wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii);
   /* set the checked state */
@@ -2465,9 +2459,9 @@ mswindows_button_instantiate (Lisp_Object image_instance, Lisp_Object instantiat
       SendMessage (wnd, BM_SETIMAGE,
                   (WPARAM) (XIMAGE_INSTANCE_MSWINDOWS_BITMAP (glyph) ?
                             IMAGE_BITMAP : IMAGE_ICON),
-                  (LPARAM) (XIMAGE_INSTANCE_MSWINDOWS_BITMAP (glyph) ?
-                            XIMAGE_INSTANCE_MSWINDOWS_BITMAP (glyph) :
-                            XIMAGE_INSTANCE_MSWINDOWS_ICON (glyph)));
+                  (XIMAGE_INSTANCE_MSWINDOWS_BITMAP (glyph) ?
+                   (LPARAM) XIMAGE_INSTANCE_MSWINDOWS_BITMAP (glyph) :
+                   (LPARAM) XIMAGE_INSTANCE_MSWINDOWS_ICON (glyph)));
     }
 }
 
@@ -2480,8 +2474,7 @@ mswindows_edit_field_instantiate (Lisp_Object image_instance, Lisp_Object instan
   mswindows_widget_instantiate (image_instance, instantiator, pointer_fg,
                                pointer_bg, dest_mask, domain, "EDIT",
                                ES_LEFT | ES_AUTOHSCROLL | WS_TABSTOP
-                               | WS_BORDER,
-                               WS_EX_CLIENTEDGE | WS_EX_CONTROLPARENT);
+                               | WS_BORDER, WS_EX_CLIENTEDGE);
 }
 
 /* instantiate a progress gauge */
@@ -2494,8 +2487,7 @@ mswindows_progress_gauge_instantiate (Lisp_Object image_instance, Lisp_Object in
   struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
   mswindows_widget_instantiate (image_instance, instantiator, pointer_fg,
                                pointer_bg, dest_mask, domain, PROGRESS_CLASS,
-                               WS_TABSTOP | WS_BORDER | PBS_SMOOTH,
-                               WS_EX_CLIENTEDGE | WS_EX_CONTROLPARENT);
+                               WS_BORDER | PBS_SMOOTH, WS_EX_CLIENTEDGE);
   wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii);
   /* set the colors */
 #ifdef PBS_SETBKCOLOR
@@ -2579,7 +2571,7 @@ mswindows_tree_view_instantiate (Lisp_Object image_instance, Lisp_Object instant
                                pointer_bg, dest_mask, domain, WC_TREEVIEW,
                                WS_TABSTOP | WS_BORDER | PBS_SMOOTH
                                | TVS_HASLINES | TVS_HASBUTTONS,
-                               WS_EX_CLIENTEDGE | WS_EX_CONTROLPARENT);
+                               WS_EX_CLIENTEDGE);
 
   wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii);
 
@@ -2602,7 +2594,7 @@ mswindows_tree_view_instantiate (Lisp_Object image_instance, Lisp_Object instant
 /* instantiate a tab control */
 static TC_ITEM* add_tab_item (Lisp_Object image_instance,
                             HWND wnd, Lisp_Object item,
-                            Lisp_Object domain, int index)
+                            Lisp_Object domain, int i)
 {
   TC_ITEM tvitem, *ret;
 
@@ -2624,7 +2616,7 @@ static TC_ITEM* add_tab_item (Lisp_Object image_instance,
   tvitem.cchTextMax = strlen (tvitem.pszText);
 
   if ((ret = (TC_ITEM*)SendMessage (wnd, TCM_INSERTITEM,
-                                   index, (LPARAM)&tvitem)) < 0)
+                                   i, (LPARAM)&tvitem)) < 0)
     signal_simple_error ("error adding tab entry", item);
 
   return ret;
@@ -2637,20 +2629,31 @@ mswindows_tab_control_instantiate (Lisp_Object image_instance, Lisp_Object insta
 {
   Lisp_Object rest;
   HWND wnd;
-  int index = 0;
+  int i = 0;
   struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+  Lisp_Object orient = find_keyword_in_vector (instantiator, Q_orientation);
+  unsigned int flags = WS_TABSTOP;
+
+  if (EQ (orient, Qleft) || EQ (orient, Qright))
+    {
+      flags |= TCS_VERTICAL | TCS_MULTILINE;
+    }
+  if (EQ (orient, Qright) || EQ (orient, Qbottom))
+    {
+      flags |= TCS_BOTTOM;
+    }
+
   mswindows_widget_instantiate (image_instance, instantiator, pointer_fg,
                                pointer_bg, dest_mask, domain, WC_TABCONTROL,
                                /* borders don't suit tabs so well */
-                               WS_TABSTOP,
-                               WS_EX_CONTROLPARENT);
+                               flags, 0);
 
   wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii);
   /* add items to the tab */
   LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)))
     {
-      add_tab_item (image_instance, wnd, XCAR (rest), domain, index);
-      index++;
+      add_tab_item (image_instance, wnd, XCAR (rest), domain, i);
+      i++;
     }
 }
 
@@ -2664,7 +2667,7 @@ mswindows_tab_control_set_property (Lisp_Object image_instance, Lisp_Object prop
   if (EQ (prop, Q_items))
     {
       HWND wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii);
-      int index = 0;
+      int i = 0;
       Lisp_Object rest;
       check_valid_item_list_1 (val);
 
@@ -2679,8 +2682,8 @@ mswindows_tab_control_set_property (Lisp_Object image_instance, Lisp_Object prop
       LIST_LOOP (rest, XCDR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)))
        {
          add_tab_item (image_instance, wnd, XCAR (rest),
-                       IMAGE_INSTANCE_SUBWINDOW_FRAME (ii), index);
-         index++;
+                       IMAGE_INSTANCE_SUBWINDOW_FRAME (ii), i);
+         i++;
        }
 
       return Qt;
@@ -2707,8 +2710,7 @@ mswindows_scrollbar_instantiate (Lisp_Object image_instance, Lisp_Object instant
 {
   mswindows_widget_instantiate (image_instance, instantiator, pointer_fg,
                                pointer_bg, dest_mask, domain, "SCROLLBAR",
-                               0,
-                               WS_EX_CLIENTEDGE );
+                               WS_TABSTOP, WS_EX_CLIENTEDGE);
 }
 
 /* instantiate a combo control */
@@ -2722,8 +2724,7 @@ mswindows_combo_box_instantiate (Lisp_Object image_instance, Lisp_Object instant
   Lisp_Object rest;
   Lisp_Object data = Fplist_get (find_keyword_in_vector (instantiator, Q_properties),
                                 Q_items, Qnil);
-  int len;
-  GET_LIST_LENGTH (data, len);
+  int len, height;
 
   /* Maybe ought to generalise this more but it may be very windows
      specific. In windows the window height of a combo box is the
@@ -2731,19 +2732,29 @@ mswindows_combo_box_instantiate (Lisp_Object image_instance, Lisp_Object instant
      before creating the window and then reset it to a single line
      after the window is created so that redisplay does the right
      thing. */
-  widget_instantiate_1 (image_instance, instantiator, pointer_fg,
-                       pointer_bg, dest_mask, domain, len + 1, 0, 0);
+  widget_instantiate (image_instance, instantiator, pointer_fg,
+                     pointer_bg, dest_mask, domain);
+
+  /* We now have everything right apart from the height. */
+  default_face_font_info (domain, 0, 0, &height, 0, 0);
+  GET_LIST_LENGTH (data, len);
 
+  height = (height + WIDGET_BORDER_HEIGHT * 2 ) * len;
+  IMAGE_INSTANCE_HEIGHT (ii) = height;
+  
+  /* Now create the widget. */
   mswindows_widget_instantiate (image_instance, instantiator, pointer_fg,
                                pointer_bg, dest_mask, domain, "COMBOBOX",
                                WS_BORDER | WS_TABSTOP | CBS_DROPDOWN
                                | CBS_AUTOHSCROLL
                                | CBS_HASSTRINGS | WS_VSCROLL,
-                               WS_EX_CLIENTEDGE | WS_EX_CONTROLPARENT);
-  /* reset the height */
-  widget_text_to_pixel_conversion (domain,
-                                  IMAGE_INSTANCE_WIDGET_FACE (ii), 1, 0,
-                                  &IMAGE_INSTANCE_SUBWINDOW_HEIGHT (ii), 0);
+                               WS_EX_CLIENTEDGE);
+  /* Reset the height. layout will probably do this safely, but better make sure. */
+  image_instance_layout (image_instance, 
+                        IMAGE_UNSPECIFIED_GEOMETRY,
+                        IMAGE_UNSPECIFIED_GEOMETRY,
+                        domain);
+
   wnd = WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii);
   /* add items to the combo box */
   SendMessage (wnd, CB_RESETCONTENT, 0, 0);
@@ -2823,7 +2834,8 @@ mswindows_widget_set_property (Lisp_Object image_instance, Lisp_Object prop,
       GET_C_STRING_OS_DATA_ALLOCA (val, lparam);
       SendMessage (WIDGET_INSTANCE_MSWINDOWS_HANDLE (ii),
                   WM_SETTEXT, 0, (LPARAM)lparam);
-      return Qt;
+      /* We don't return Qt here so that other widget methods can be
+         called afterwards. */
     }
   return Qunbound;
 }
@@ -2846,10 +2858,10 @@ mswindows_progress_gauge_set_property (Lisp_Object image_instance, Lisp_Object p
 }
 
 LRESULT WINAPI
-mswindows_control_wnd_proc (HWND hwnd, UINT message,
+mswindows_control_wnd_proc (HWND hwnd, UINT msg,
                            WPARAM wParam, LPARAM lParam)
 {
-  switch (message)
+  switch (msg)
     {
     case WM_NOTIFY:
     case WM_COMMAND:
@@ -2859,9 +2871,9 @@ mswindows_control_wnd_proc (HWND hwnd, UINT message,
     case WM_CTLCOLORSTATIC:
     case WM_CTLCOLORSCROLLBAR:
 
-      return mswindows_wnd_proc (GetParent (hwnd), message, wParam, lParam);
+      return mswindows_wnd_proc (GetParent (hwnd), msg, wParam, lParam);
     default:
-      return DefWindowProc (hwnd, message, wParam, lParam);
+      return DefWindowProc (hwnd, msg, wParam, lParam);
     }
 }
 
index eb399c1..2d6ed8c 100644 (file)
@@ -1,5 +1,5 @@
 /* Widget-specific glyph objects.
-   Copyright (C) 1998, 1999 Andy Piper.
+   Copyright (C) 1998, 1999, 2000 Andy Piper.
 
 This file is part of XEmacs.
 
@@ -60,50 +60,20 @@ Lisp_Object Q_descriptor, Q_height, Q_width, Q_properties, Q_items;
 Lisp_Object Q_image, Q_text, Q_percent, Q_orientation, Q_justify, Q_border;
 Lisp_Object Qetched_in, Qetched_out, Qbevel_in, Qbevel_out;
 
-#define WIDGET_BORDER_HEIGHT 4
-#define WIDGET_BORDER_WIDTH 4
-
 #ifdef DEBUG_WIDGETS
 int debug_widget_instances;
 #endif
 
 /* TODO:
    - more complex controls.
-   - tooltips for controls.
+   - tooltips for controls, especially buttons.
  */
 
-/* In windows normal windows work in pixels, dialog boxes work in
+/* In MS-Windows normal windows work in pixels, dialog boxes work in
    dialog box units. Why? sigh. We could reuse the metrics for dialogs
    if this were not the case. As it is we have to position things
    pixel wise. I'm not even sure that X has this problem at least for
    buttons in groups. */
-Lisp_Object
-widget_face_font_info (Lisp_Object domain, Lisp_Object face,
-                      int *height, int *width)
-{
-  Lisp_Object font_instance = FACE_FONT (face, domain, Vcharset_ascii);
-
-  if (height)
-    *height = XFONT_INSTANCE (font_instance)->height;
-  if (width)
-    *width = XFONT_INSTANCE (font_instance)->width;
-  
-  return font_instance;
-}
-
-void
-widget_text_to_pixel_conversion (Lisp_Object domain, Lisp_Object face,
-                                int th, int tw,
-                                int* height, int* width)
-{
-  int ch=0, cw=0;
-  widget_face_font_info (domain, face, &ch, &cw);
-  if (height)
-    *height = th * ch + 2 * WIDGET_BORDER_HEIGHT;
-  if (width)
-    *width = tw * cw + 2 * WIDGET_BORDER_WIDTH;
-}
-
 static int
 widget_possible_dest_types (void)
 {
@@ -133,6 +103,19 @@ check_valid_orientation (Lisp_Object data)
 }
 
 static void
+check_valid_tab_orientation (Lisp_Object data)
+{
+  if (!EQ (data, Qtop)
+      &&
+      !EQ (data, Qbottom)
+      &&
+      !EQ (data, Qleft)
+      &&
+      !EQ (data, Qright))
+    signal_simple_error ("unknown orientation for tab control", data);
+}
+
+static void
 check_valid_justification (Lisp_Object data)
 {
   if (!EQ (data, Qleft) && !EQ (data, Qright) && !EQ (data, Qcenter))
@@ -259,17 +242,17 @@ substitute_keyword_value (Lisp_Object inst, Lisp_Object key, Lisp_Object val)
     }
 }
 
-/* wire widget property invocations to specific widgets ...  The
- problem we are solving here is that when instantiators get converted
- to instances they lose some type information (they just become
- subwindows or widgets for example). For widgets we need to preserve
- this type information so that we can do widget specific operations on
- the instances. This is encoded in the widget type
- field. widget_property gets invoked by decoding the primary type
- (Qwidget), widget property then invokes based on the secondary type
- (Qedit_field for example). It is debatable that we should wire things in this
- generalised way rather than treating widgets specially in
- image_instance_property. */
+/* Wire widget property invocations to specific widgets. The problem
+   we are solving here is that when instantiators get converted to
+   instances they lose some type information (they just become
+   subwindows or widgets for example). For widgets we need to preserve
+   this type information so that we can do widget specific operations
+   on the instances. This is encoded in the widget type
+   field. widget_property gets invoked by decoding the primary type
+   (Qwidget), <widget>_property then invokes based on the secondary
+   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 
 widget_property (Lisp_Object image_instance, Lisp_Object prop)
 {
@@ -302,7 +285,14 @@ widget_set_property (Lisp_Object image_instance, Lisp_Object prop, Lisp_Object v
   struct image_instantiator_methods* meths;
   Lisp_Object ret;
 
-  /* try device specific methods first ... */
+  /* PIck up any generic properties that we might need to keep hold
+     of. */
+  if (EQ (prop, Q_text))
+    {
+      IMAGE_INSTANCE_WIDGET_TEXT (ii) = val;
+    }
+
+  /* Now try device specific methods first ... */
   meths = decode_device_ii_format (IMAGE_INSTANCE_DEVICE (ii), 
                                   IMAGE_INSTANCE_WIDGET_TYPE (ii), 
                                   ERROR_ME_NOT);
@@ -329,6 +319,85 @@ widget_set_property (Lisp_Object image_instance, Lisp_Object prop, Lisp_Object v
   return val;
 }
 
+/* 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, 
+                      unsigned int* width, unsigned int* height,
+                      enum image_instance_geometry disp, Lisp_Object domain)
+{
+  struct Lisp_Image_Instance* ii = XIMAGE_INSTANCE (image_instance);
+  struct image_instantiator_methods* meths;
+
+  /* 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 (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, 
+                                              width, height, disp,
+                                              domain));
+      else
+       {
+         /* ... then format specific methods ... */
+         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, 
+                                                  width, height, disp,
+                                                  domain));
+         else 
+           {
+             unsigned 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),
+                                    IMAGE_INSTANCE_WIDGET_FACE (ii),
+                                    &w, &h, 0, domain);
+             /* Adjust the size for borders. */
+             if (IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii))
+               *width = w + 2 * WIDGET_BORDER_WIDTH;
+             if (IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii))
+               *height = h +  2 * WIDGET_BORDER_HEIGHT;
+           }
+       }
+    }
+}
+
+static void 
+widget_layout (Lisp_Object image_instance, 
+              unsigned int width, unsigned int height, Lisp_Object domain)
+{
+  struct 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 (ii), 
+                                  IMAGE_INSTANCE_WIDGET_TYPE (ii), 
+                                  ERROR_ME_NOT);
+  if (meths && HAS_IIFORMAT_METH_P (meths, layout))
+    IIFORMAT_METH (meths, layout, (image_instance, 
+                                  width, height, domain));
+  else
+    {
+      /* ... then format specific methods ... */
+      meths = decode_device_ii_format (Qnil, IMAGE_INSTANCE_WIDGET_TYPE (ii), 
+                                      ERROR_ME_NOT);
+      if (meths && HAS_IIFORMAT_METH_P (meths, layout))
+       IIFORMAT_METH (meths, layout, (image_instance, 
+                                      width, height, domain));
+    }
+}
+
 static void
 widget_validate (Lisp_Object instantiator)
 {
@@ -381,8 +450,12 @@ initialize_widget_image_instance (struct Lisp_Image_Instance *ii, Lisp_Object ty
   /*  initialize_subwindow_image_instance (ii);*/
   IMAGE_INSTANCE_WIDGET_TYPE (ii) = type;
   IMAGE_INSTANCE_WIDGET_PROPS (ii) = Qnil;
-  IMAGE_INSTANCE_WIDGET_FACE (ii) = Vwidget_face;
+  SET_IMAGE_INSTANCE_WIDGET_FACE (ii, Qnil);
   IMAGE_INSTANCE_WIDGET_ITEMS (ii) = allocate_gui_item ();
+  IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii) = 1;
+  IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii) = 1;
+  IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii) = 0;
+  IMAGE_INSTANCE_SUBWINDOW_JUSTIFY (ii) = 0;
 }
 
 /* Instantiate a button widget. Unfortunately instantiated widgets are
@@ -392,10 +465,9 @@ initialize_widget_image_instance (struct Lisp_Image_Instance *ii, Lisp_Object ty
    many-to-one relationship with things you see, whereas widgets can
    only be one-to-one (i.e. per frame) */
 void
-widget_instantiate_1 (Lisp_Object image_instance, Lisp_Object instantiator,
-                     Lisp_Object pointer_fg, Lisp_Object pointer_bg,
-                     int dest_mask, Lisp_Object domain, int default_textheight,
-                     int default_pixheight, int default_textwidth)
+widget_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
+                   Lisp_Object pointer_fg, Lisp_Object pointer_bg,
+                   int dest_mask, Lisp_Object domain)
 {
   struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
   Lisp_Object face = find_keyword_in_vector (instantiator, Q_face);
@@ -406,6 +478,7 @@ widget_instantiate_1 (Lisp_Object image_instance, Lisp_Object instantiator,
   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 orient = find_keyword_in_vector (instantiator, Q_orientation);
   int pw=0, ph=0, tw=0, th=0;
   
   /* this just does pixel type sizing */
@@ -419,11 +492,15 @@ widget_instantiate_1 (Lisp_Object image_instance, Lisp_Object instantiator,
 
   /* retrieve the fg and bg colors */
   if (!NILP (face))
-    IMAGE_INSTANCE_WIDGET_FACE (ii) = Fget_face (face);
+    SET_IMAGE_INSTANCE_WIDGET_FACE (ii, Fget_face (face));
   
   /* data items for some widgets */
   IMAGE_INSTANCE_WIDGET_PROPS (ii) = props;
 
+  /* 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) = 1;
+
   /* 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 */
@@ -448,53 +525,73 @@ widget_instantiate_1 (Lisp_Object image_instance, Lisp_Object instantiator,
                 parse_gui_item_tree_children (items));
     }
 
-  /* normalize size information */
-  if (!NILP (width))
-    tw = XINT (width);
-  if (!NILP (height))
-    th = XINT (height);
-  if (!NILP (pixwidth))
-    pw = XINT (pixwidth);
-  if (!NILP (pixheight))
-    ph = XINT (pixheight);
+  /* Normalize size information. We now only assign sizes if the user
+     gives us some explicitly, or there are some constraints that we
+     can't change later on. Otherwise we postpone sizing until query
+     geometry gets called. */
+  if (!NILP (pixwidth))                /* pixwidth takes precendent */
+    {
+      pw = XINT (pixwidth);
+      IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii) = 0;
+    }
+  else if (!NILP (width))
+    {
+      tw = XINT (width);
+      IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii) = 0;
+    }
 
-  /* for a widget with an image pick up the dimensions from that */
-  if (!NILP (glyph))
+  if (!NILP (pixheight))
+    {
+      ph = XINT (pixheight);
+      IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii) = 0;
+    }
+  else if (!NILP (height) && XINT (height) > 1)
     {
-      if (!pw && !tw)
-       pw = glyph_width (glyph, Qnil, DEFAULT_INDEX, domain) 
-         + 2 * WIDGET_BORDER_WIDTH;
-      if (!ph && !th)
-       ph = glyph_height (glyph, Qnil, DEFAULT_INDEX, domain) 
-         + 2 * WIDGET_BORDER_HEIGHT;
+      th = XINT (height);
+      IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii) = 0;
     }
 
-  /* if we still don' t have sizes, guess from text size */
-  if (!tw && !pw)
+  /* Taking the default face information when the user has specified
+     size in characters is probably as good as any since the widget
+     face is more likely to be proportional and thus give inadequate
+     results. Using character sizes can only ever be approximate
+     anyway. */
+  if (tw || th)
     {
-      if (default_textwidth)
-       tw = default_textwidth;
-      else if (!NILP (IMAGE_INSTANCE_WIDGET_TEXT (ii)))
-       tw = XSTRING_LENGTH (IMAGE_INSTANCE_WIDGET_TEXT (ii));
+      int charwidth, charheight;
+      default_face_font_info (domain, 0, 0, &charheight, &charwidth, 0);
+      if (tw)
+       pw = charwidth * tw;
+      if (th)
+       ph = charheight * th;
     }
 
-  if (!th && !ph)
+  /* for a widget with an image pick up the dimensions from that */
+  if (!NILP (glyph))
     {
-      if (default_textheight)
-       th = default_textheight;
-      else if (!NILP (IMAGE_INSTANCE_WIDGET_TEXT (ii)))
-       th = 1;
-      else
-       ph = default_pixheight;
+      if (!pw)
+       pw = glyph_width (glyph, domain) + 2 * WIDGET_BORDER_WIDTH;
+      if (!ph)
+       ph = glyph_height (glyph, domain) + 2 * WIDGET_BORDER_HEIGHT;
+      IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii) = 0;
+      IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii) = 0;
     }
-  
-  if (tw !=0 || th !=0)
-    widget_text_to_pixel_conversion (domain,
-                                    IMAGE_INSTANCE_WIDGET_FACE (ii),
-                                    th, tw, th ? &ph : 0, tw ? &pw : 0);
 
-  IMAGE_INSTANCE_SUBWINDOW_WIDTH (ii) = pw;
-  IMAGE_INSTANCE_SUBWINDOW_HEIGHT (ii) = ph;
+  /* have to set the type this late in case there is no device
+     instantiation for a widget */
+  IMAGE_INSTANCE_TYPE (ii) = IMAGE_WIDGET;
+
+  /* When we create the widgets the window system expects a valid
+     size, so If we still don' t have sizes, call layout to pick them
+     up. If query_geometry or layout relies on the widget being in
+     existence then we are in catch 22. */
+  image_instance_layout (image_instance, 
+                        pw ? pw : IMAGE_UNSPECIFIED_GEOMETRY,
+                        ph ? ph : IMAGE_UNSPECIFIED_GEOMETRY,
+                        domain);
+  /* Layout has already been done so we don't need to re-layout. */
+  IMAGE_INSTANCE_DIRTYP (ii) = 0;
+
 #ifdef DEBUG_WIDGETS
   debug_widget_instances++;
   stderr_out ("instantiated ");
@@ -503,63 +600,67 @@ widget_instantiate_1 (Lisp_Object image_instance, Lisp_Object instantiator,
 #endif
 }
 
+/* tree-view geometry - get the height right */
 static void
-widget_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
-                   Lisp_Object pointer_fg, Lisp_Object pointer_bg,
-                   int dest_mask, Lisp_Object domain)
+tree_view_query_geometry (Lisp_Object image_instance, 
+                         unsigned int* width, unsigned int* height,
+                         enum image_instance_geometry disp, Lisp_Object domain)
 {
-  widget_instantiate_1 (image_instance, instantiator, pointer_fg,
-                              pointer_bg, dest_mask, domain, 1, 0, 0);
-}
+  struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+  Lisp_Object items = IMAGE_INSTANCE_WIDGET_ITEMS (ii);
 
-/* tree-view generic instantiation - get the height right */
-static void
-tree_view_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
-                      Lisp_Object pointer_fg, Lisp_Object pointer_bg,
-                      int dest_mask, Lisp_Object domain)
-{
-  Lisp_Object data = Fplist_get (find_keyword_in_vector (instantiator, Q_properties),
-                                Q_items, Qnil);
-  int len;
-  GET_LIST_LENGTH (data, len);
-  widget_instantiate_1 (image_instance, instantiator, pointer_fg,
-                       pointer_bg, dest_mask, domain, len + 1, 0, 0);
+  
+  if (*width)
+    {
+      /* #### what should this be. reconsider when X has tree views. */
+      query_string_geometry (IMAGE_INSTANCE_WIDGET_TEXT (ii),
+                            IMAGE_INSTANCE_WIDGET_FACE (ii),
+                            width, 0, 0, domain);
+    }
+  if (*height)
+    {
+      int len, h;
+      default_face_font_info (domain, 0, 0, &h, 0, 0);
+      GET_LIST_LENGTH (items, len);
+      *height = len * h;
+    }
 }
 
+/* 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_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
-                Lisp_Object pointer_fg, Lisp_Object pointer_bg,
-                int dest_mask, Lisp_Object domain)
+tab_control_query_geometry (Lisp_Object image_instance, 
+                           unsigned int* width, unsigned int* height,
+                           enum image_instance_geometry disp, Lisp_Object domain)
 {
-  Lisp_Object data = Fplist_get (find_keyword_in_vector (instantiator, Q_properties),
-                                Q_items, Qnil);
+  struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+  Lisp_Object items = IMAGE_INSTANCE_WIDGET_ITEMS (ii);
   Lisp_Object rest;
-  int len = 0;
+  unsigned int tw = 0, th = 0;
 
-  LIST_LOOP (rest, data)
+  LIST_LOOP (rest, items)
     {
-      len += 3;                        /* some bias */
-      if (STRINGP (XCAR (rest)))
-       len += XSTRING_LENGTH (XCAR (rest));
-      else if (VECTORP (XCAR (rest)))
-       {
-         Lisp_Object gui = gui_parse_item_keywords (XCAR (rest));
-         len += XSTRING_LENGTH (XGUI_ITEM (gui)->name);
-       }
+      unsigned int h, w;
+
+      query_string_geometry (XGUI_ITEM (XCAR (rest))->name,
+                            IMAGE_INSTANCE_WIDGET_FACE (ii),
+                            &w, &h, 0, domain);
+      tw += 2 * WIDGET_BORDER_WIDTH; /* some bias */
+      tw += w;
+      th = max (th, h + 2 * WIDGET_BORDER_HEIGHT);
     }
 
-  widget_instantiate_1 (image_instance, instantiator, pointer_fg,
-                       pointer_bg, dest_mask, domain, 0, 0, len);
-}
-
-/* Instantiate a static control */
-static void
-static_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
-                   Lisp_Object pointer_fg, Lisp_Object pointer_bg,
-                   int dest_mask, Lisp_Object domain)
-{
-  widget_instantiate_1 (image_instance, instantiator, pointer_fg,
-                       pointer_bg, dest_mask, domain, 0, 4, 0);
+  /* Fixup returned values depending on orientation. */
+  if (IMAGE_INSTANCE_SUBWINDOW_ORIENT (ii))
+    {
+      if (height)      *height = tw;
+      if (width)       *width = th;
+    }
+  else
+    {
+      if (height)      *height = th;
+      if (width)       *width = tw;
+    }
 }
 
 \f
@@ -689,8 +790,8 @@ layout_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
   LIST_LOOP (rest, items)
     {
       Lisp_Object glyph = XCAR (rest);
-      int gheight = glyph_height (glyph, Qnil, DEFAULT_INDEX, domain);
-      int gwidth = glyph_width (glyph, Qnil, DEFAULT_INDEX, domain);
+      int gheight = glyph_height (glyph, domain);
+      int gwidth = glyph_width (glyph, domain);
       nitems ++;
       if (EQ (orient, Qhorizontal))
        {
@@ -738,7 +839,7 @@ layout_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
       XIMAGE_INSTANCE_XOFFSET (bglyph) = 10; /* Really, what should this be? */
       XIMAGE_INSTANCE_YOFFSET (bglyph) = 0;
 
-      ph_adjust = (glyph_height (border, Qnil, DEFAULT_INDEX, domain) / 2);
+      ph_adjust = (glyph_height (border, domain) / 2);
       IMAGE_INSTANCE_LAYOUT_BORDER (ii) = make_int (ph_adjust);
     }
 
@@ -768,8 +869,8 @@ layout_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
       /* make sure the image is instantiated */
       Lisp_Object glyph = XCAR (rest);
       Lisp_Object gii = glyph_image_instance (glyph, domain, ERROR_ME, 1);
-      int gwidth = glyph_width (glyph, Qnil, DEFAULT_INDEX, domain);
-      int gheight = glyph_height (glyph, Qnil, DEFAULT_INDEX, domain);
+      int gwidth = glyph_width (glyph, domain);
+      int gheight = glyph_height (glyph, domain);
 
       children = Fcons (gii, children);
 
@@ -862,6 +963,8 @@ image_instantiator_format_create_glyphs_widget (void)
   INITIALIZE_IMAGE_INSTANTIATOR_FORMAT_NO_SYM (widget, "widget");
   IIFORMAT_HAS_METHOD (widget, property);
   IIFORMAT_HAS_METHOD (widget, set_property);
+  IIFORMAT_HAS_METHOD (widget, query_geometry);
+  IIFORMAT_HAS_METHOD (widget, layout);
 
   /* widget image-instantiator types - buttons */
   INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (button, "button");
@@ -917,7 +1020,8 @@ image_instantiator_format_create_glyphs_widget (void)
   INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (tree_view, "tree-view");
   IIFORMAT_HAS_SHARED_METHOD (tree_view, validate, combo_box);
   IIFORMAT_HAS_SHARED_METHOD (tree_view, possible_dest_types, widget);
-  IIFORMAT_HAS_METHOD (tree_view, instantiate);
+  IIFORMAT_HAS_SHARED_METHOD (tree_view, instantiate, widget);
+  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);
@@ -926,15 +1030,17 @@ image_instantiator_format_create_glyphs_widget (void)
   INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (tab_control, "tab-control");
   IIFORMAT_HAS_SHARED_METHOD (tab_control, validate, combo_box);
   IIFORMAT_HAS_SHARED_METHOD (tab_control, possible_dest_types, widget);
-  IIFORMAT_HAS_METHOD (tab_control, instantiate);
+  IIFORMAT_HAS_SHARED_METHOD (tab_control, instantiate, widget);
+  IIFORMAT_HAS_METHOD (tab_control, query_geometry);
   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);
 
   /* labels */
   INITIALIZE_IMAGE_INSTANTIATOR_FORMAT (label, "label");
   IIFORMAT_HAS_SHARED_METHOD (label, possible_dest_types, widget);
-  IIFORMAT_HAS_SHARED_METHOD (label, instantiate, static);
+  IIFORMAT_HAS_SHARED_METHOD (label, instantiate, widget);
   VALID_WIDGET_KEYWORDS (label);
   IIFORMAT_VALID_KEYWORD (label, Q_descriptor, check_valid_string);
 
index b162822..d2dc9df 100644 (file)
@@ -4,7 +4,7 @@
    Copyright (C) 1995 Tinker Systems
    Copyright (C) 1995, 1996 Ben Wing
    Copyright (C) 1995 Sun Microsystems
-   Copyright (C) 1999 Andy Piper
+   Copyright (C) 1999, 2000 Andy Piper
 
 This file is part of XEmacs.
 
@@ -104,13 +104,13 @@ DECLARE_IMAGE_INSTANTIATOR_FORMAT (jpeg);
 #endif
 #ifdef HAVE_TIFF
 DECLARE_IMAGE_INSTANTIATOR_FORMAT (tiff);
-#endif  
+#endif
 #ifdef HAVE_PNG
 DECLARE_IMAGE_INSTANTIATOR_FORMAT (png);
-#endif  
+#endif
 #ifdef HAVE_GIF
 DECLARE_IMAGE_INSTANTIATOR_FORMAT (gif);
-#endif  
+#endif
 #ifdef HAVE_XPM
 DEFINE_DEVICE_IIFORMAT (x, xpm);
 #endif
@@ -427,7 +427,7 @@ x_finalize_image_instance (struct Lisp_Image_Instance *p)
              IMAGE_INSTANCE_X_MASK (p) != IMAGE_INSTANCE_X_PIXMAP (p))
            XFreePixmap (dpy, IMAGE_INSTANCE_X_MASK (p));
          IMAGE_INSTANCE_PIXMAP_MASK (p) = 0;
-         
+
          if (IMAGE_INSTANCE_X_PIXMAP_SLICES (p))
            {
              for (i = 0; i < IMAGE_INSTANCE_PIXMAP_MAXSLICE (p); i++)
@@ -445,7 +445,7 @@ x_finalize_image_instance (struct Lisp_Image_Instance *p)
              XFreeCursor (dpy, IMAGE_INSTANCE_X_CURSOR (p));
              IMAGE_INSTANCE_X_CURSOR (p) = 0;
            }
-         
+
          if (IMAGE_INSTANCE_X_NPIXELS (p) != 0)
            {
              XFreeColors (dpy,
@@ -519,7 +519,7 @@ x_initialize_pixmap_image_instance (struct Lisp_Image_Instance *ii,
 {
   ii->data = xnew_and_zero (struct x_image_instance_data);
   IMAGE_INSTANCE_PIXMAP_MAXSLICE (ii) = slices;
-  IMAGE_INSTANCE_X_PIXMAP_SLICES (ii) = 
+  IMAGE_INSTANCE_X_PIXMAP_SLICES (ii) =
     xnew_array_and_zero (Pixmap, slices);
   IMAGE_INSTANCE_TYPE (ii) = type;
   IMAGE_INSTANCE_PIXMAP_FILENAME (ii) = Qnil;
@@ -945,7 +945,7 @@ x_init_image_instance_from_eimage (struct Lisp_Image_Instance *ii,
 
   for (slice = 0; slice < slices; slice++)
     {
-      ximage = convert_EImage_to_XImage (device, width, height, 
+      ximage = convert_EImage_to_XImage (device, width, height,
                                         eimage + (width * height * 3 * slice),
                                         &pixtbl, &npixels);
       if (!ximage)
@@ -1288,8 +1288,8 @@ xpm_free (XpmAttributes *xpmattrs)
 
 static void
 x_xpm_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
-                                  Lisp_Object pointer_fg, Lisp_Object pointer_bg,
-                                  int dest_mask, Lisp_Object domain)
+                  Lisp_Object pointer_fg, Lisp_Object pointer_bg,
+                  int dest_mask, Lisp_Object domain)
 {
   /* This function can GC */
   struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
@@ -1729,7 +1729,7 @@ autodetect_validate (Lisp_Object instantiator)
 
 static Lisp_Object
 autodetect_normalize (Lisp_Object instantiator,
-                               Lisp_Object console_type)
+                     Lisp_Object console_type)
 {
   Lisp_Object file = find_keyword_in_vector (instantiator, Q_data);
   Lisp_Object filename = Qnil;
@@ -1820,10 +1820,10 @@ autodetect_possible_dest_types (void)
 
 static void
 autodetect_instantiate (Lisp_Object image_instance,
-                                 Lisp_Object instantiator,
-                                 Lisp_Object pointer_fg,
-                                 Lisp_Object pointer_bg,
-                                 int dest_mask, Lisp_Object domain)
+                       Lisp_Object instantiator,
+                       Lisp_Object pointer_fg,
+                       Lisp_Object pointer_bg,
+                       int dest_mask, Lisp_Object domain)
 {
   Lisp_Object data = find_keyword_in_vector (instantiator, Q_data);
   struct gcpro gcpro1, gcpro2, gcpro3;
@@ -2113,8 +2113,8 @@ x_unmap_subwindow (struct Lisp_Image_Instance *p)
 {
   if (IMAGE_INSTANCE_TYPE (p) == IMAGE_SUBWINDOW)
     {
-      XUnmapWindow 
-       (IMAGE_INSTANCE_X_SUBWINDOW_DISPLAY (p), 
+      XUnmapWindow
+       (IMAGE_INSTANCE_X_SUBWINDOW_DISPLAY (p),
         IMAGE_INSTANCE_X_CLIPWINDOW (p));
     }
   else                         /* must be a widget */
@@ -2133,7 +2133,7 @@ x_map_subwindow (struct Lisp_Image_Instance *p, int x, int y,
     {
       Window subwindow = IMAGE_INSTANCE_X_SUBWINDOW_ID (p);
       XMoveResizeWindow (IMAGE_INSTANCE_X_SUBWINDOW_DISPLAY (p),
-                        IMAGE_INSTANCE_X_CLIPWINDOW (p), 
+                        IMAGE_INSTANCE_X_CLIPWINDOW (p),
                         x, y, dga->width, dga->height);
       XMoveWindow (IMAGE_INSTANCE_X_SUBWINDOW_DISPLAY (p),
                   subwindow, -dga->xoffset, -dga->yoffset);
@@ -2142,7 +2142,7 @@ x_map_subwindow (struct Lisp_Image_Instance *p, int x, int y,
     }
   else                         /* must be a widget */
     {
-      XtConfigureWidget (IMAGE_INSTANCE_X_CLIPWIDGET (p), 
+      XtConfigureWidget (IMAGE_INSTANCE_X_CLIPWIDGET (p),
                         x + IMAGE_INSTANCE_X_WIDGET_XOFFSET (p),
                         y + IMAGE_INSTANCE_X_WIDGET_YOFFSET (p),
                         dga->width, dga->height, 0);
@@ -2160,28 +2160,23 @@ x_update_subwindow (struct Lisp_Image_Instance *p)
 #ifdef HAVE_WIDGETS
   if (IMAGE_INSTANCE_TYPE (p) == IMAGE_WIDGET)
     {
-      Arg al[5];
-      widget_value* wv = gui_items_to_widget_values 
+      widget_value* wv = gui_items_to_widget_values
        (IMAGE_INSTANCE_WIDGET_ITEMS (p));
 
       /* This seems ugly, but I'm not sure what else to do. */
       if (EQ (IMAGE_INSTANCE_WIDGET_TYPE (p), Qtab_control))
        {
-         update_tab_widget_face (wv, p, 
+         update_tab_widget_face (wv, p,
                                  IMAGE_INSTANCE_SUBWINDOW_FRAME (p));
        }
       /* update the colors and font */
       update_widget_face (wv, p, IMAGE_INSTANCE_SUBWINDOW_FRAME (p));
-      
+
       /* now modify the widget */
-      lw_modify_all_widgets (IMAGE_INSTANCE_X_WIDGET_LWID (p), 
+      lw_modify_all_widgets (IMAGE_INSTANCE_X_WIDGET_LWID (p),
                             wv, True);
       free_widget_value_tree (wv);
-      /* We have to do this otherwise Motif will unceremoniously
-         resize us when the label gets set. */
-      XtSetArg (al [0], XtNwidth, IMAGE_INSTANCE_WIDGET_WIDTH (p));
-      XtSetArg (al [1], XtNheight, IMAGE_INSTANCE_WIDGET_HEIGHT (p));
-      XtSetValues (IMAGE_INSTANCE_X_WIDGET_ID (p), al, 2);
+      /* subwindow resizing now gets done by the parent function. */
     }
 #endif
 }
@@ -2202,7 +2197,7 @@ x_subwindow_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
   Window pw, win;
   XSetWindowAttributes xswa;
   Mask valueMask = 0;
-  unsigned int w = IMAGE_INSTANCE_SUBWINDOW_WIDTH (ii), 
+  unsigned int w = IMAGE_INSTANCE_SUBWINDOW_WIDTH (ii),
     h = IMAGE_INSTANCE_SUBWINDOW_HEIGHT (ii);
 
   if (!DEVICE_X_P (XDEVICE (device)))
@@ -2224,9 +2219,9 @@ x_subwindow_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
   valueMask |= CWBackingStore;
   xswa.colormap = DefaultColormapOfScreen (xs);
   valueMask |= CWColormap;
-  
+
   /* Create a window for clipping */
-  IMAGE_INSTANCE_X_CLIPWINDOW (ii) = 
+  IMAGE_INSTANCE_X_CLIPWINDOW (ii) =
     XCreateWindow (dpy, pw, 0, 0, w, h, 0, CopyFromParent,
                   InputOutput, CopyFromParent, valueMask,
                   &xswa);
@@ -2236,7 +2231,7 @@ x_subwindow_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
                       0, 0, w, h, 0, CopyFromParent,
                       InputOutput, CopyFromParent, valueMask,
                       &xswa);
-  
+
   IMAGE_INSTANCE_SUBWINDOW_ID (ii) = (void*)win;
 }
 
@@ -2270,7 +2265,7 @@ Subwindows are not currently implemented.
 }
 #endif
 
-static void 
+static void
 x_resize_subwindow (struct Lisp_Image_Instance* ii, int w, int h)
 {
   if (IMAGE_INSTANCE_TYPE (ii) == IMAGE_SUBWINDOW)
@@ -2310,28 +2305,34 @@ update_widget_face (widget_value* wv, struct Lisp_Image_Instance *ii,
 #ifdef LWLIB_WIDGETS_MOTIF
   XmFontList fontList;
 #endif
-
-  Lisp_Object pixel = FACE_FOREGROUND 
+  /* Update the foreground. */
+  Lisp_Object pixel = FACE_FOREGROUND
     (IMAGE_INSTANCE_WIDGET_FACE (ii),
      domain);
-  XColor fcolor = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (pixel));
-
+  XColor fcolor = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (pixel)), bcolor;
   lw_add_widget_value_arg (wv, XtNforeground, fcolor.pixel);
+
+  /* Update the background. */
+  pixel = FACE_BACKGROUND (IMAGE_INSTANCE_WIDGET_FACE (ii),
+                          domain);
+  bcolor = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (pixel));
+  lw_add_widget_value_arg (wv, XtNbackground, bcolor.pixel);
+
 #ifdef LWLIB_WIDGETS_MOTIF
   fontList = XmFontListCreate
-    (FONT_INSTANCE_X_FONT 
-     (XFONT_INSTANCE (widget_face_font_info 
-                     (domain,
+    (FONT_INSTANCE_X_FONT
+     (XFONT_INSTANCE (query_string_font
+                     (IMAGE_INSTANCE_WIDGET_TEXT (ii),
                       IMAGE_INSTANCE_WIDGET_FACE (ii),
-                      0, 0))), XmSTRING_DEFAULT_CHARSET);
+                      domain))),  XmSTRING_DEFAULT_CHARSET);
   lw_add_widget_value_arg (wv, XmNfontList, (XtArgVal)fontList);
 #endif
-  lw_add_widget_value_arg 
-    (wv, XtNfont, (XtArgVal)FONT_INSTANCE_X_FONT 
-     (XFONT_INSTANCE (widget_face_font_info 
-                     (domain,
+  lw_add_widget_value_arg
+    (wv, XtNfont, (XtArgVal)FONT_INSTANCE_X_FONT
+     (XFONT_INSTANCE (query_string_font
+                     (IMAGE_INSTANCE_WIDGET_TEXT (ii),
                       IMAGE_INSTANCE_WIDGET_FACE (ii),
-                      0, 0))));
+                      domain))));
 }
 
 static void
@@ -2341,9 +2342,9 @@ update_tab_widget_face (widget_value* wv, struct Lisp_Image_Instance *ii,
   if (wv->contents)
     {
       widget_value* val = wv->contents, *cur;
-      
+
       /* Give each child label the correct foreground color. */
-      Lisp_Object pixel = FACE_FOREGROUND 
+      Lisp_Object pixel = FACE_FOREGROUND
        (IMAGE_INSTANCE_WIDGET_FACE (ii),
         domain);
       XColor fcolor = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (pixel));
@@ -2398,9 +2399,9 @@ x_widget_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
   clip_wv = xmalloc_widget_value ();
 
   lw_add_widget_value_arg (clip_wv, XtNresize, False);
-  lw_add_widget_value_arg (clip_wv, XtNwidth, 
+  lw_add_widget_value_arg (clip_wv, XtNwidth,
                           (Dimension)IMAGE_INSTANCE_SUBWINDOW_WIDTH (ii));
-  lw_add_widget_value_arg (clip_wv, XtNheight, 
+  lw_add_widget_value_arg (clip_wv, XtNheight,
                           (Dimension)IMAGE_INSTANCE_SUBWINDOW_HEIGHT (ii));
   clip_wv->enabled = True;
 
@@ -2422,7 +2423,7 @@ x_widget_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
      created so that Motif will fix up the shadow colors
      correctly. Once the widget is created Motif won't do this
      anymore...*/
-  pixel = FACE_FOREGROUND 
+  pixel = FACE_FOREGROUND
     (IMAGE_INSTANCE_WIDGET_FACE (ii),
      IMAGE_INSTANCE_SUBWINDOW_FRAME (ii));
   fcolor = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (pixel));
@@ -2436,9 +2437,9 @@ x_widget_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
   lw_add_widget_value_arg (wv, XtNforeground, fcolor.pixel);
   /* we cannot allow widgets to resize themselves */
   lw_add_widget_value_arg (wv, XtNresize, False);
-  lw_add_widget_value_arg (wv, XtNwidth, 
+  lw_add_widget_value_arg (wv, XtNwidth,
                           (Dimension)IMAGE_INSTANCE_SUBWINDOW_WIDTH (ii));
-  lw_add_widget_value_arg (wv, XtNheight, 
+  lw_add_widget_value_arg (wv, XtNheight,
                           (Dimension)IMAGE_INSTANCE_SUBWINDOW_HEIGHT (ii));
   /* update the font. */
   update_widget_face (wv, ii, domain);
@@ -2452,9 +2453,9 @@ x_widget_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
   /* Resize the widget here so that the values do not get copied by
      lwlib. */
   ac = 0;
-  XtSetArg (al [ac], XtNwidth, 
+  XtSetArg (al [ac], XtNwidth,
            (Dimension)IMAGE_INSTANCE_SUBWINDOW_WIDTH (ii)); ac++;
-  XtSetArg (al [ac], XtNheight, 
+  XtSetArg (al [ac], XtNheight,
            (Dimension)IMAGE_INSTANCE_SUBWINDOW_HEIGHT (ii)); ac++;
   XtSetValues (IMAGE_INSTANCE_X_WIDGET_ID (ii), al, ac);
   /* because the EmacsManager is the widgets parent we have to
@@ -2485,7 +2486,6 @@ x_widget_set_property (Lisp_Object image_instance, Lisp_Object prop,
       GET_C_STRING_OS_DATA_ALLOCA (val, str);
       wv->value = str;
       lw_modify_all_widgets (IMAGE_INSTANCE_X_WIDGET_LWID (ii), wv, False);
-      return Qt;
     }
 
   /* Modify the text properties of the widget */
@@ -2494,7 +2494,6 @@ x_widget_set_property (Lisp_Object image_instance, Lisp_Object prop,
       widget_value* wv = lw_get_all_values (IMAGE_INSTANCE_X_WIDGET_LWID (ii));
       update_widget_face (wv, ii, IMAGE_INSTANCE_SUBWINDOW_FRAME (ii));
       lw_modify_all_widgets (IMAGE_INSTANCE_X_WIDGET_LWID (ii), wv, False);
-      return Qt;
     }
   return Qunbound;
 }
@@ -2616,9 +2615,9 @@ x_edit_field_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
   struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
   Lisp_Object gui = IMAGE_INSTANCE_WIDGET_ITEM (ii);
   widget_value* wv = xmalloc_widget_value ();
-  
+
   button_item_to_widget_value (gui, wv, 1, 1);
-  
+
   x_widget_instantiate (image_instance, instantiator, pointer_fg,
                        pointer_bg, dest_mask, domain, "text-field", wv);
 }
@@ -2634,11 +2633,11 @@ x_combo_box_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
   widget_value * wv = 0;
   /* This is not done generically because of sizing problems under
      mswindows. */
-  widget_instantiate_1 (image_instance, instantiator, pointer_fg,
-                       pointer_bg, dest_mask, domain, 1, 0, 0);
+  widget_instantiate (image_instance, instantiator, pointer_fg,
+                     pointer_bg, dest_mask, domain);
 
   wv = gui_items_to_widget_values (IMAGE_INSTANCE_WIDGET_ITEMS (ii));
-  
+
   x_widget_instantiate (image_instance, instantiator, pointer_fg,
                        pointer_bg, dest_mask, domain, "combo-box", wv);
 }
@@ -2650,10 +2649,10 @@ x_tab_control_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
                           int dest_mask, Lisp_Object domain)
 {
   struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
-  widget_value * wv = 
+  widget_value * wv =
     gui_items_to_widget_values (IMAGE_INSTANCE_WIDGET_ITEMS (ii));
 
-  update_tab_widget_face (wv, ii, 
+  update_tab_widget_face (wv, ii,
                          IMAGE_INSTANCE_SUBWINDOW_FRAME (ii));
 
   x_widget_instantiate (image_instance, instantiator, pointer_fg,
@@ -2666,19 +2665,19 @@ x_tab_control_set_property (Lisp_Object image_instance, Lisp_Object prop,
                            Lisp_Object val)
 {
   struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
-  
+
   if (EQ (prop, Q_items))
     {
       widget_value * wv = 0;
       check_valid_item_list_1 (val);
 
-      IMAGE_INSTANCE_WIDGET_ITEMS (ii) = 
-       Fcons (XCAR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)), 
+      IMAGE_INSTANCE_WIDGET_ITEMS (ii) =
+       Fcons (XCAR (IMAGE_INSTANCE_WIDGET_ITEMS (ii)),
               parse_gui_item_tree_children (val));
 
       wv = gui_items_to_widget_values (IMAGE_INSTANCE_WIDGET_ITEMS (ii));
-      
-      update_tab_widget_face (wv, ii, 
+
+      update_tab_widget_face (wv, ii,
                              IMAGE_INSTANCE_SUBWINDOW_FRAME (ii));
 
       lw_modify_all_widgets (IMAGE_INSTANCE_X_WIDGET_LWID (ii), wv, True);
@@ -2699,9 +2698,9 @@ x_label_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
   struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
   Lisp_Object gui = IMAGE_INSTANCE_WIDGET_ITEM (ii);
   widget_value* wv = xmalloc_widget_value ();
-  
+
   button_item_to_widget_value (gui, wv, 1, 1);
-  
+
   x_widget_instantiate (image_instance, instantiator, pointer_fg,
                        pointer_bg, dest_mask, domain, "button", wv);
 }
@@ -2755,13 +2754,13 @@ image_instantiator_format_create_glyphs_x (void)
 #endif
 #ifdef HAVE_TIFF
   IIFORMAT_VALID_CONSOLE (x, tiff);
-#endif  
+#endif
 #ifdef HAVE_PNG
   IIFORMAT_VALID_CONSOLE (x, png);
-#endif  
+#endif
 #ifdef HAVE_GIF
   IIFORMAT_VALID_CONSOLE (x, gif);
-#endif  
+#endif
   INITIALIZE_DEVICE_IIFORMAT (x, xbm);
   IIFORMAT_HAS_DEVMETHOD (x, xbm, instantiate);
 
index c8bb105..decfe0c 100644 (file)
@@ -84,6 +84,18 @@ typedef struct
 
 extern const struct struct_description iim_description;
 
+enum image_instance_geometry
+{
+  IMAGE_GEOMETRY,
+  IMAGE_DESIRED_GEOMETRY,
+  IMAGE_MIN_GEOMETRY,
+  IMAGE_MAX_GEOMETRY, 
+  IMAGE_UNSPECIFIED_GEOMETRY = ~0
+};
+
+#define WIDGET_BORDER_HEIGHT 4
+#define WIDGET_BORDER_WIDTH 4
+
 struct image_instantiator_methods
 {
   Lisp_Object symbol;
@@ -132,12 +144,19 @@ struct image_instantiator_methods
                                      Lisp_Object property,
                                      Lisp_Object val);
 
-  /* Find out the geometry of this 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
+   image instance. */
   void (*query_geometry_method) (Lisp_Object image_instance,
-                                int* width, int* height, int disp);
-
-  /* Layout the instances children. */
-  void (*layout_children_method) (Lisp_Object image_instance);
+                                unsigned int* width, unsigned int* height,
+                                enum image_instance_geometry disp, 
+                                Lisp_Object domain);
+  
+  /* Layout the instance and its children bounded by the provided
+     dimensions. */
+  void (*layout_method) (Lisp_Object image_instance,
+                                 unsigned int width, unsigned int height,
+                                 Lisp_Object domain);
 };
 
 /***** Calling an image-instantiator method *****/
@@ -306,10 +325,16 @@ void initialize_subwindow_image_instance (struct Lisp_Image_Instance*);
 void subwindow_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
                            Lisp_Object pointer_fg, Lisp_Object pointer_bg,
                            int dest_mask, Lisp_Object domain);
-void widget_instantiate_1 (Lisp_Object image_instance, Lisp_Object instantiator,
-                          Lisp_Object pointer_fg, Lisp_Object pointer_bg,
-                          int dest_mask, Lisp_Object domain, int default_textheight,
-                          int default_pixheight, int default_textwidth);
+void widget_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
+                        Lisp_Object pointer_fg, Lisp_Object pointer_bg,
+                        int dest_mask, Lisp_Object domain);
+void image_instance_query_geometry (Lisp_Object image_instance, 
+                                   unsigned int* width, unsigned int* height, 
+                                   enum image_instance_geometry disp,
+                                   Lisp_Object domain);
+void image_instance_layout (Lisp_Object image_instance, 
+                           unsigned int width, unsigned int height, 
+                           Lisp_Object domain);
 
 DECLARE_DOESNT_RETURN (incompatible_image_types (Lisp_Object instantiator,
                                                  int given_dest_mask,
@@ -372,14 +397,6 @@ enum image_instance_type
   IMAGE_LAYOUT
 };
 
-enum image_instance_geometry
-{
-  IMAGE_GEOMETRY,
-  IMAGE_DESIRED_GEOMETRY,
-  IMAGE_MIN_GEOMETRY,
-  IMAGE_MAX_GEOMETRY
-};
-
 #define IMAGE_NOTHING_MASK (1 << 0)
 #define IMAGE_TEXT_MASK (1 << 1)
 #define IMAGE_MONO_PIXMAP_MASK (1 << 2)
@@ -463,6 +480,9 @@ struct Lisp_Image_Instance
   struct lcrecord_header header;
   Lisp_Object device;
   Lisp_Object name;
+  /* The glyph from which we were instantiated. This is a weak
+     reference. */
+  Lisp_Object glyph;
   enum image_instance_type type;
   unsigned int x_offset, y_offset;     /* for layout purposes */
   unsigned int width, height;
@@ -493,11 +513,19 @@ struct Lisp_Image_Instance
       Lisp_Object frame;
       void* subwindow;         /* specific devices can use this as necessary */
       unsigned int being_displayed : 1;        /* used to detect when needs to be unmapped */
+      unsigned int v_resize : 1;       /* Whether the vsize is allowed to change. */
+      unsigned int h_resize : 1;       /* Whether the hsize is allowed to change. */
+      unsigned int orientation : 1; /* Vertical or horizontal. */
+      unsigned int justification : 2; /* Left, right or center. */
       union
       {
        struct
        {
-         Lisp_Object face; /* foreground and background colors */
+         /* Face for colors and font. We specify this here becuase we
+            want people to be able to put :face in the instantiator
+            spec. Using gyph-face is more inconvenient, although more
+            general. */
+         Lisp_Object face;     
          Lisp_Object type;
          Lisp_Object props;    /* properties */
          Lisp_Object gui_item; /* a list of gui_items */
@@ -515,8 +543,18 @@ struct Lisp_Image_Instance
   void *data;
 };
 
+/* Layout bit-fields. */
+#define LAYOUT_HORIZONTAL      0
+#define LAYOUT_VERTICAL        1
+
+#define LAYOUT_JUSTIFY_LEFT 0
+#define LAYOUT_JUSTIFY_RIGHT 1
+#define LAYOUT_JUSTIFY_CENTER 2
+
+/* Accessor macros. */
 #define IMAGE_INSTANCE_DEVICE(i) ((i)->device)
 #define IMAGE_INSTANCE_NAME(i) ((i)->name)
+#define IMAGE_INSTANCE_GLYPH(i) ((i)->glyph)
 #define IMAGE_INSTANCE_TYPE(i) ((i)->type)
 #define IMAGE_INSTANCE_XOFFSET(i) ((i)->x_offset)
 #define IMAGE_INSTANCE_YOFFSET(i) ((i)->y_offset)
@@ -526,6 +564,8 @@ struct Lisp_Image_Instance
  ((IMAGE_INSTANCE_TYPE (i) == IMAGE_MONO_PIXMAP)                       \
   || (IMAGE_INSTANCE_TYPE (i) == IMAGE_COLOR_PIXMAP))
 #define IMAGE_INSTANCE_DIRTYP(i) ((i)->dirty)
+#define IMAGE_INSTANCE_FACE(i) \
+  XGLYPH_FACE (IMAGE_INSTANCE_GLYPH (i))
 
 #define IMAGE_INSTANCE_TEXT_STRING(i) ((i)->u.text.string)
 #define IMAGE_INSTANCE_TEXT_WIDTH(i) \
@@ -533,6 +573,8 @@ struct Lisp_Image_Instance
 #define IMAGE_INSTANCE_TEXT_HEIGHT(i) \
   IMAGE_INSTANCE_HEIGHT(i)
 #define IMAGE_INSTANCE_TEXT_DESCENT(i) ((i)->u.text.descent)
+#define IMAGE_INSTANCE_TEXT_ASCENT(i) \
+  (IMAGE_INSTANCE_TEXT_HEIGHT(i) - IMAGE_INSTANCE_TEXT_DESCENT(i))
 
 #define IMAGE_INSTANCE_PIXMAP_WIDTH(i) \
   IMAGE_INSTANCE_WIDTH(i)
@@ -559,6 +601,14 @@ struct Lisp_Image_Instance
 #define IMAGE_INSTANCE_SUBWINDOW_FRAME(i) ((i)->u.subwindow.frame)
 #define IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP(i) \
 ((i)->u.subwindow.being_displayed)
+#define IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP(i) \
+((i)->u.subwindow.v_resize)
+#define IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP(i) \
+((i)->u.subwindow.h_resize)
+#define IMAGE_INSTANCE_SUBWINDOW_ORIENT(i) \
+((i)->u.subwindow.orientation)
+#define IMAGE_INSTANCE_SUBWINDOW_JUSTIFY(i) \
+((i)->u.subwindow.justification)
 
 #define IMAGE_INSTANCE_WIDGET_WIDTH(i) \
   IMAGE_INSTANCE_WIDTH(i)
@@ -566,7 +616,12 @@ struct Lisp_Image_Instance
   IMAGE_INSTANCE_HEIGHT(i)
 #define IMAGE_INSTANCE_WIDGET_TYPE(i) ((i)->u.subwindow.s.widget.type)
 #define IMAGE_INSTANCE_WIDGET_PROPS(i) ((i)->u.subwindow.s.widget.props)
-#define IMAGE_INSTANCE_WIDGET_FACE(i) ((i)->u.subwindow.s.widget.face)
+#define SET_IMAGE_INSTANCE_WIDGET_FACE(i,f) \
+ ((i)->u.subwindow.s.widget.face = f)
+#define IMAGE_INSTANCE_WIDGET_FACE(i) \
+  (!NILP ((i)->u.subwindow.s.widget.face) ? (i)->u.subwindow.s.widget.face : \
+  !NILP (IMAGE_INSTANCE_FACE (i)) ? IMAGE_INSTANCE_FACE (i) : \
+  Vwidget_face)
 #define IMAGE_INSTANCE_WIDGET_ITEMS(i) ((i)->u.subwindow.s.widget.gui_item)
 #define IMAGE_INSTANCE_WIDGET_ITEM(i) \
 (CONSP (IMAGE_INSTANCE_WIDGET_ITEMS (i)) ? \
@@ -581,6 +636,8 @@ XCAR (IMAGE_INSTANCE_WIDGET_ITEMS (i)) : \
   IMAGE_INSTANCE_DEVICE (XIMAGE_INSTANCE (i))
 #define XIMAGE_INSTANCE_NAME(i) \
   IMAGE_INSTANCE_NAME (XIMAGE_INSTANCE (i))
+#define XIMAGE_INSTANCE_GLYPH(i) \
+  IMAGE_INSTANCE_GLYPH (XIMAGE_INSTANCE (i))
 #define XIMAGE_INSTANCE_TYPE(i) \
   IMAGE_INSTANCE_TYPE (XIMAGE_INSTANCE (i))
 #define XIMAGE_INSTANCE_XOFFSET(i) \
@@ -589,9 +646,23 @@ XCAR (IMAGE_INSTANCE_WIDGET_ITEMS (i)) : \
   IMAGE_INSTANCE_YOFFSET (XIMAGE_INSTANCE (i))
 #define XIMAGE_INSTANCE_DIRTYP(i) \
   IMAGE_INSTANCE_DIRTYP (XIMAGE_INSTANCE (i))
+#define XIMAGE_INSTANCE_WIDTH(i) \
+  IMAGE_INSTANCE_WIDTH (XIMAGE_INSTANCE (i))
+#define XIMAGE_INSTANCE_HEIGHT(i) \
+  IMAGE_INSTANCE_HEIGHT (XIMAGE_INSTANCE (i))
+#define XIMAGE_INSTANCE_FACE(i) \
+  IMAGE_INSTANCE_FACE (XIMAGE_INSTANCE (i))
 
 #define XIMAGE_INSTANCE_TEXT_STRING(i) \
   IMAGE_INSTANCE_TEXT_STRING (XIMAGE_INSTANCE (i))
+#define XIMAGE_INSTANCE_TEXT_WIDTH(i) \
+  IMAGE_INSTANCE_TEXT_WIDTH (XIMAGE_INSTANCE (i))
+#define XIMAGE_INSTANCE_TEXT_HEIGHT(i) \
+  IMAGE_INSTANCE_TEXT_HEIGHT (XIMAGE_INSTANCE (i))
+#define XIMAGE_INSTANCE_TEXT_ASCENT(i) \
+  IMAGE_INSTANCE_TEXT_ASCENT (XIMAGE_INSTANCE (i))
+#define XIMAGE_INSTANCE_TEXT_DESCENT(i) \
+  IMAGE_INSTANCE_TEXT_DESCENT (XIMAGE_INSTANCE (i))
 
 #define XIMAGE_INSTANCE_PIXMAP_WIDTH(i) \
   IMAGE_INSTANCE_PIXMAP_WIDTH (XIMAGE_INSTANCE (i))
@@ -630,6 +701,8 @@ XCAR (IMAGE_INSTANCE_WIDGET_ITEMS (i)) : \
   IMAGE_INSTANCE_WIDGET_PROPS (XIMAGE_INSTANCE (i))
 #define XIMAGE_INSTANCE_WIDGET_FACE(i) \
   IMAGE_INSTANCE_WIDGET_FACE (XIMAGE_INSTANCE (i))
+#define XSET_IMAGE_INSTANCE_WIDGET_FACE(i) \
+  SET_IMAGE_INSTANCE_WIDGET_FACE (XIMAGE_INSTANCE (i))
 #define XIMAGE_INSTANCE_WIDGET_ITEM(i) \
   IMAGE_INSTANCE_WIDGET_ITEM (XIMAGE_INSTANCE (i))
 #define XIMAGE_INSTANCE_WIDGET_ITEMS(i) \
@@ -652,6 +725,10 @@ XCAR (IMAGE_INSTANCE_WIDGET_ITEMS (i)) : \
   IMAGE_INSTANCE_SUBWINDOW_FRAME (XIMAGE_INSTANCE (i))
 #define XIMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP(i) \
   IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (XIMAGE_INSTANCE (i))
+#define XIMAGE_INSTANCE_SUBWINDOW_ORIENT(i) \
+  IMAGE_INSTANCE_SUBWINDOW_ORIENT (XIMAGE_INSTANCE (i))
+#define XIMAGE_INSTANCE_SUBWINDOW_JUSTIFY(i) \
+  IMAGE_INSTANCE_SUBWINDOW_JUSTIFY (XIMAGE_INSTANCE (i))
 
 #define MARK_IMAGE_INSTANCE_CHANGED(i) \
   (IMAGE_INSTANCE_DIRTYP (i) = 1);
@@ -758,19 +835,10 @@ extern Lisp_Object Vcontinuation_glyph, Vcontrol_arrow_glyph, Vhscroll_glyph;
 extern Lisp_Object Vinvisible_text_glyph, Voctal_escape_glyph, Vtruncation_glyph;
 extern Lisp_Object Vxemacs_logo;
 
-unsigned short glyph_width (Lisp_Object glyph, Lisp_Object frame_face,
-                           face_index window_findex,
-                           Lisp_Object window);
-unsigned short glyph_ascent (Lisp_Object glyph,  Lisp_Object frame_face,
-                            face_index window_findex,
-                            Lisp_Object window);
-unsigned short glyph_descent (Lisp_Object glyph,
-                             Lisp_Object frame_face,
-                             face_index window_findex,
-                             Lisp_Object window);
-unsigned short glyph_height (Lisp_Object glyph,  Lisp_Object frame_face,
-                            face_index window_findex,
-                            Lisp_Object window);
+unsigned short glyph_width (Lisp_Object glyph, Lisp_Object domain);
+unsigned short glyph_ascent (Lisp_Object glyph, Lisp_Object domain);
+unsigned short glyph_descent (Lisp_Object glyph, Lisp_Object domain);
+unsigned short glyph_height (Lisp_Object glyph, Lisp_Object domain);
 Lisp_Object glyph_baseline (Lisp_Object glyph, Lisp_Object domain);
 Lisp_Object glyph_face (Lisp_Object glyph, Lisp_Object domain);
 int glyph_contrib_p (Lisp_Object glyph, Lisp_Object domain);
@@ -789,11 +857,11 @@ Lisp_Object allocate_glyph (enum glyph_type type,
                            void (*after_change) (Lisp_Object glyph,
                                                  Lisp_Object property,
                                                  Lisp_Object locale));
-Lisp_Object widget_face_font_info (Lisp_Object domain, Lisp_Object face,
-                                  int *height, int *width);
-void widget_text_to_pixel_conversion (Lisp_Object domain, Lisp_Object face,
-                                     int th, int tw,
-                                     int* height, int* width);
+void query_string_geometry ( Lisp_Object string, Lisp_Object face,
+                            unsigned int* width, unsigned int* height, 
+                            unsigned int* descent, Lisp_Object domain);
+Lisp_Object query_string_font (Lisp_Object string, 
+                              Lisp_Object face, Lisp_Object domain);
 Lisp_Object add_glyph_animated_timeout (EMACS_INT tickms, Lisp_Object device);
 void disable_glyph_animated_timeout (int i);
 
@@ -868,8 +936,8 @@ typedef struct subwindow_cachel subwindow_cachel;
 struct subwindow_cachel
 {
   Lisp_Object subwindow;
-  int x, y;
-  int width, height;
+  unsigned int x, y;
+  unsigned int width, height;
   unsigned int being_displayed : 1;
   unsigned int updated : 1;
 };
@@ -890,10 +958,8 @@ int find_matching_subwindow (struct frame* f, int x, int y, int width, int heigh
 
 struct expose_ignore
 {
-  int  x;
-  int  y;
-  int  width;
-  int  height;
+  unsigned int x, y;
+  unsigned int width, height;
   struct expose_ignore *next;
 };
 
index 2d37ea1..0a219b9 100644 (file)
@@ -452,7 +452,7 @@ static void gpm_next_event_cb (struct Lisp_Event *event)
                return;
        }
 
-       return (orig_next_event_cb (event));
+       orig_next_event_cb (event);
 }
 
 static void hook_event_callbacks_once (void)
index e43a204..a83688c 100644 (file)
--- a/src/gui.c
+++ b/src/gui.c
@@ -76,7 +76,7 @@ get_gui_callback (Lisp_Object data, Lisp_Object *fn, Lisp_Object *arg)
   if (SYMBOLP (data)
       || (COMPILED_FUNCTIONP (data)
          && XCOMPILED_FUNCTION (data)->flags.interactivep)
-      || (EQ (XCAR (data), Qlambda)
+      || (CONSP (data) && (EQ (XCAR (data), Qlambda))
          && !NILP (Fassq (Qinteractive, Fcdr (Fcdr (data))))))
     {
       *fn = Qcall_interactively;
index a1cb446..d209e88 100644 (file)
@@ -115,9 +115,10 @@ XIM_init_frame (struct frame *f)
      default face, rather than foreground and background resources, or
      that the user can use set-frame-parameters to set xic attributes */
 
-#define res(name, class, representation, field, default_value) \
-  { name, class, representation, sizeof(xim_resources.field), \
-     XtOffsetOf(xim_resources_t, field), XtRString, default_value }
+#define res(name, class, representation, field, default_value) \
+  { name, class, representation, sizeof(xim_resources.field),  \
+    XtOffsetOf(xim_resources_t, field),                                \
+    XtRString, (XtPointer) (default_value) }
 
   static XtResource resources[] =
   {
index 04b6b46..2fd38ef 100644 (file)
@@ -2116,7 +2116,7 @@ lookup_keys (Lisp_Object keymap, int nkeys, Lisp_Object *keys,
   if (nkeys == 0)
     return Qnil;
 
-  if (nkeys < (countof (kkk)))
+  if (nkeys < countof (kkk))
     raw_keys = kkk;
   else
     raw_keys = alloca_array (struct key_data, nkeys);
@@ -2146,7 +2146,7 @@ lookup_events (Lisp_Object event_head, int nmaps, Lisp_Object keymaps[],
 
   nkeys = event_chain_count (event_head);
 
-  if (nkeys < (countof (kkk)))
+  if (nkeys < countof (kkk))
     raw_keys = kkk;
   else
     raw_keys = alloca_array (struct key_data, nkeys);
@@ -2372,8 +2372,7 @@ get_relevant_keymaps (Lisp_Object keys,
                  get_relevant_extent_keymaps
                    (Fevent_modeline_position (terminal),
                     XBUFFER (buffer)->generated_modeline_string,
-                    /* #### third arg should maybe be a glyph. */
-                    Qnil, &closure);
+                    Fevent_glyph_extent (terminal), &closure);
 
                  if (!UNBOUNDP (map) && !NILP (map))
                    relevant_map_push (get_keymap (map, 1, 1), &closure);
index 677852d..4180167 100644 (file)
 #include "lisp.h"
 #endif
 
-#ifdef STDC_HEADERS
 #include <stdlib.h>
-#endif
+#include <stdio.h>
+#include <fcntl.h>
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
 
-#include <stdio.h>
-#include <fcntl.h>
 #include "libsst.h"
 
 #define AUDBUF 1024
 
-extern void usleep();
-
 int
 sst_open(play_level, record_level)
     int play_level, record_level;
     {
     int fd, i, gr, ger, gx;
     struct audio_ioctl ai;
-    char *getenv(), *ep;
+    char *ep;
 
     fd = open( "/dev/audio", O_RDWR );
     if ( fd < 0 )
index 775942a..8e524f6 100644 (file)
--- a/src/md5.c
+++ b/src/md5.c
@@ -482,7 +482,7 @@ md5_coding_system (Lisp_Object object, Lisp_Object coding, Lisp_Object istream,
        {
          /* Attempt to autodetect the coding of the string.  This is
              VERY hit-and-miss.  */
-         enum eol_type eol = EOL_AUTODETECT;
+         eol_type_t eol = EOL_AUTODETECT;
          coding_system = Fget_coding_system (Qundecided);
          determine_real_coding_system (XLSTREAM (istream),
                                        &coding_system, &eol);
index c15e271..62f4afc 100644 (file)
@@ -94,14 +94,11 @@ menu_item_descriptor_to_widget_value_1 (Lisp_Object desc,
      prohibits GC. */
   /* !!#### This function has not been Mule-ized */
   int menubar_root_p = (menu_type == MENUBAR_TYPE && depth == 0);
-  widget_value *wv;
-  Lisp_Object wv_closure;
   int count = specpdl_depth ();
   int partition_seen = 0;
+  widget_value *wv = xmalloc_widget_value ();
+  Lisp_Object wv_closure = make_opaque_ptr (wv);
 
-  wv = xmalloc_widget_value ();
-
-  wv_closure = make_opaque_ptr (wv);
   record_unwind_protect (widget_value_unwind, wv_closure);
 
   if (STRINGP (desc))
@@ -363,7 +360,7 @@ int in_menu_callback;
 static Lisp_Object
 restore_in_menu_callback (Lisp_Object val)
 {
-    in_menu_callback = XINT(val);
+    in_menu_callback = XINT (val);
     return Qnil;
 }
 #endif /* LWLIB_MENUBARS_LUCID || LWLIB_MENUBARS_MOTIF */
@@ -514,24 +511,21 @@ pre_activate_callback (Widget widget, LWLIB_ID id, XtPointer client_data)
 static widget_value *
 compute_menubar_data (struct frame *f, Lisp_Object menubar, int deep_p)
 {
-  widget_value *data;
-
   if (NILP (menubar))
-    data = 0;
+    return 0;
   else
     {
-      Lisp_Object old_buffer;
+      widget_value *data;
       int count = specpdl_depth ();
 
-      old_buffer = Fcurrent_buffer ();
-      record_unwind_protect (Fset_buffer, old_buffer);
-      Fset_buffer ( XWINDOW (FRAME_SELECTED_WINDOW (f))->buffer);
+      record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
+      Fset_buffer (XWINDOW (FRAME_SELECTED_WINDOW (f))->buffer);
       data = menu_item_descriptor_to_widget_value (menubar, MENUBAR_TYPE,
                                                   deep_p, 0);
-      Fset_buffer (old_buffer);
       unbind_to (count, Qnil);
+
+      return data;
     }
-  return data;
 }
 
 static int
@@ -541,7 +535,7 @@ set_frame_menubar (struct frame *f, int deep_p, int first_time_p)
   Lisp_Object menubar;
   int menubar_visible;
   long id;
-  /* As for the toolbar, the minibuffer does not have its own menubar. */
+  /* As with the toolbar, the minibuffer does not have its own menubar. */
   struct window *w = XWINDOW (FRAME_LAST_NONMINIBUF_WINDOW (f));
 
   if (! FRAME_X_P (f))
@@ -693,7 +687,7 @@ make_dummy_xbutton_event (XEvent *dummy,
        XtSetArg (al [1], XtNy, &shelly);
        XtGetValues (shell, al, 2);
       }
-#endif      
+#endif
       XtSetArg (al [0], XtNx, &framex);
       XtSetArg (al [1], XtNy, &framey);
       XtGetValues (daddy, al, 2);
index 7a6e2dc..c92232f 100644 (file)
@@ -588,11 +588,9 @@ This is a specifier; use `set-specifier' to change it.
 
   set_specifier_fallback (Vmenubar_visible_p, list1 (Fcons (Qnil, Qt)));
   set_specifier_caching (Vmenubar_visible_p,
-                        slot_offset (struct window,
-                                     menubar_visible_p),
+                        offsetof (struct window, menubar_visible_p),
                         menubar_visible_p_changed,
-                        slot_offset (struct frame,
-                                     menubar_visible_p),
+                        offsetof (struct frame, menubar_visible_p),
                         menubar_visible_p_changed_in_frame);
 }
 
index ff5ef3a..8f9984e 100644 (file)
@@ -148,7 +148,8 @@ allocate_heap (void)
      still a pretty decent arena to play in!  */
 
   unsigned long base = 0x01B00000;   /*  27MB */
-  unsigned long end  = 1 << VALBITS; /* 256MB */
+  /* Temporary hack for the non-starting problem - use 28 (256Mb) rather than VALBITS (1Gb) */
+  unsigned long end  = 1 << 28;      /* 256MB */
   void *ptr = NULL;
 
 #define NTHEAP_PROBE_BASE 1
index 5b828ca..41591be 100644 (file)
@@ -627,8 +627,13 @@ print_error_message (Lisp_Object error_object, Lisp_Object stream)
   {
     int first = 1;
     int speccount = specpdl_depth ();
+    Lisp_Object frame = Qnil;
+    struct gcpro gcpro1;
+    GCPRO1 (stream);
 
     specbind (Qprint_message_label, Qerror);
+    stream = print_prepare (stream, &frame);
+
     tail = Fcdr (error_object);
     if (EQ (type, Qerror))
       {
@@ -650,6 +655,8 @@ print_error_message (Lisp_Object error_object, Lisp_Object stream)
        tail = Fcdr (tail);
        first = 0;
       }
+    print_finish (stream, frame);
+    UNGCPRO;
     unbind_to (speccount, Qnil);
     return;
     /* not reached */
index a006cef..70330be 100644 (file)
@@ -32,8 +32,6 @@
 #endif
 #endif
 
-#define HAVE_FSYNC
-
 /* With this defined, a gcc-compiled Emacs crashed in realloc under AIX
    3.2, and a cc-compiled Emacs works with this undefined.
    --karl@cs.umb.edu.  */
index def1faa..1eaa8b5 100644 (file)
@@ -121,6 +121,12 @@ extern long random();
 #ifndef WM_MOUSEWHEEL
 #define WM_MOUSEWHEEL 0x20A
 #endif
+#ifndef TCS_BOTTOM
+#define TCS_BOTTOM 0x0002
+#endif
+#ifndef TCS_VERTICAL
+#define TCS_VERTICAL 0x0080
+#endif
 
 #define PBS_SMOOTH              0x01
 
index ebbcf69..6dee7ee 100644 (file)
@@ -105,9 +105,9 @@ typedef int pid_t;
    The alternative is that a lock file named
    /usr/spool/mail/$USER.lock.  */
 
-/* #define MAIL_USE_FLOCK */
 #define MAIL_USE_POP
-#define MAIL_USE_SYSTEM_LOCK
+#define HAVE_LOCKING
+#define MAIL_USE_LOCKING
 
 /* If the character used to separate elements of the executable path
    is not ':', #define this to be the appropriate character constant.  */
index 39855c8..6f2f0e9 100644 (file)
@@ -956,11 +956,9 @@ This is a specifier; use `set-specifier' to change it.
     (Vscrollbar_width,
      list1 (Fcons (Qnil, make_int (DEFAULT_SCROLLBAR_WIDTH))));
   set_specifier_caching (Vscrollbar_width,
-                        slot_offset (struct window,
-                                     scrollbar_width),
+                        offsetof (struct window, scrollbar_width),
                         vertical_scrollbar_changed_in_window,
-                        slot_offset (struct frame,
-                                     scrollbar_width),
+                        offsetof (struct frame, scrollbar_width),
                         frame_size_slipped);
 
   DEFVAR_SPECIFIER ("scrollbar-height", &Vscrollbar_height /*
@@ -972,11 +970,9 @@ This is a specifier; use `set-specifier' to change it.
     (Vscrollbar_height,
      list1 (Fcons (Qnil, make_int (DEFAULT_SCROLLBAR_HEIGHT))));
   set_specifier_caching (Vscrollbar_height,
-                        slot_offset (struct window,
-                                     scrollbar_height),
+                        offsetof (struct window, scrollbar_height),
                         some_window_value_changed,
-                        slot_offset (struct frame,
-                                     scrollbar_height),
+                        offsetof (struct frame, scrollbar_height),
                         frame_size_slipped);
 
   DEFVAR_SPECIFIER ("horizontal-scrollbar-visible-p", &Vhorizontal_scrollbar_visible_p /*
@@ -987,11 +983,11 @@ This is a specifier; use `set-specifier' to change it.
   set_specifier_fallback (Vhorizontal_scrollbar_visible_p,
                          list1 (Fcons (Qnil, Qt)));
   set_specifier_caching (Vhorizontal_scrollbar_visible_p,
-                        slot_offset (struct window,
-                                     horizontal_scrollbar_visible_p),
+                        offsetof (struct window,
+                                  horizontal_scrollbar_visible_p),
                         some_window_value_changed,
-                        slot_offset (struct frame,
-                                     horizontal_scrollbar_visible_p),
+                        offsetof (struct frame,
+                                  horizontal_scrollbar_visible_p),
                         frame_size_slipped);
 
   DEFVAR_SPECIFIER ("vertical-scrollbar-visible-p", &Vvertical_scrollbar_visible_p /*
@@ -1002,11 +998,11 @@ This is a specifier; use `set-specifier' to change it.
   set_specifier_fallback (Vvertical_scrollbar_visible_p,
                          list1 (Fcons (Qnil, Qt)));
   set_specifier_caching (Vvertical_scrollbar_visible_p,
-                        slot_offset (struct window,
-                                     vertical_scrollbar_visible_p),
+                        offsetof (struct window,
+                                  vertical_scrollbar_visible_p),
                         vertical_scrollbar_changed_in_window,
-                        slot_offset (struct frame,
-                                     vertical_scrollbar_visible_p),
+                        offsetof (struct frame,
+                                  vertical_scrollbar_visible_p),
                         frame_size_slipped);
 
   DEFVAR_SPECIFIER ("scrollbar-on-left-p", &Vscrollbar_on_left_p /*
@@ -1030,11 +1026,9 @@ This is a specifier; use `set-specifier' to change it.
   }
 
   set_specifier_caching (Vscrollbar_on_left_p,
-                        slot_offset (struct window,
-                                     scrollbar_on_left_p),
+                        offsetof (struct window, scrollbar_on_left_p),
                         vertical_scrollbar_changed_in_window,
-                        slot_offset (struct frame,
-                                     scrollbar_on_left_p),
+                        offsetof (struct frame, scrollbar_on_left_p),
                         frame_size_slipped);
 
   DEFVAR_SPECIFIER ("scrollbar-on-top-p", &Vscrollbar_on_top_p /*
@@ -1045,11 +1039,9 @@ This is a specifier; use `set-specifier' to change it.
   set_specifier_fallback (Vscrollbar_on_top_p,
                          list1 (Fcons (Qnil, Qnil)));
   set_specifier_caching (Vscrollbar_on_top_p,
-                        slot_offset (struct window,
-                                     scrollbar_on_top_p),
+                        offsetof (struct window, scrollbar_on_top_p),
                         some_window_value_changed,
-                        slot_offset (struct frame,
-                                     scrollbar_on_top_p),
+                        offsetof (struct frame, scrollbar_on_top_p),
                         frame_size_slipped);
 }
 
@@ -1059,8 +1051,7 @@ complex_vars_of_scrollbar (void)
   Vscrollbar_pointer_glyph = Fmake_glyph_internal (Qpointer);
 
   set_specifier_caching (XGLYPH (Vscrollbar_pointer_glyph)->image,
-                        slot_offset (struct window,
-                                     scrollbar_pointer),
+                        offsetof (struct window, scrollbar_pointer),
                         scrollbar_pointer_changed_in_window,
                         0, 0);
 }
index e447d5c..e8c51f8 100644 (file)
@@ -281,6 +281,15 @@ error_check_##type##_specifier_data (struct Lisp_Specifier *sp)            \
   assert (SPECIFIER_TYPE_P (sp, type));                                        \
   return (struct type##_specifier *) sp->data;                         \
 }                                                                      \
+INLINE struct Lisp_Specifier *                                         \
+error_check_##type##_specifier_type (Lisp_Object obj);                 \
+INLINE struct Lisp_Specifier *                                         \
+error_check_##type##_specifier_type (Lisp_Object obj)                  \
+{                                                                      \
+  struct Lisp_Specifier *sp = XSPECIFIER (obj);                                \
+  assert (SPECIFIER_TYPE_P (sp, type));                                        \
+  return sp;                                                           \
+}                                                                      \
 DECLARE_NOTHING
 #else
 #define DECLARE_SPECIFIER_TYPE(type)                           \
@@ -343,10 +352,19 @@ do {                                                                      \
      : (sp)->data))
 #endif
 
-/* #### Need to create ERROR_CHECKING versions of these. */
+#ifdef ERROR_CHECK_TYPECHECK
+# define XSPECIFIER_TYPE(x, type)      \
+   error_check_##type##_specifier_type (x)
+# define XSETSPECIFIER_TYPE(x, p, type)        do              \
+{                                                      \
+  XSETSPECIFIER (x, p);                                        \
+  assert (SPECIFIER_TYPEP (XSPECIFIER(x), type));      \
+} while (0)
+#else
+# define XSPECIFIER_TYPE(x, type) XSPECIFIER (x)
+# define XSETSPECIFIER_TYPE(x, p, type) XSETSPECIFIER (x, p)
+#endif /* ERROR_CHECK_TYPE_CHECK */
 
-#define XSPECIFIER_TYPE(x, type) XSPECIFIER (x)
-#define XSETSPECIFIER_TYPE(x, p, type) XSETSPECIFIER (x, p)
 #define SPECIFIER_TYPEP(x, type)                               \
   (SPECIFIERP (x) && SPECIFIER_TYPE_P (XSPECIFIER (x), type))
 #define CHECK_SPECIFIER_TYPE(x, type) do {             \
index 7f5486b..99b4313 100644 (file)
@@ -2145,9 +2145,9 @@ hft_reset (struct console *con)
  */
 
 #ifdef __cplusplus
-  extern "C" int _start ();
+  extern "C" int _start (void);
 #else
-  extern int _start ();
+  extern int _start (void);
 #endif
 
 #ifndef HAVE_TEXT_START
index cc8f2de..c7e29cb 100644 (file)
@@ -203,10 +203,6 @@ Boston, MA 02111-1307, USA.  */
 #define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
 #endif
 
-#if !defined (USG)  && !defined (WINDOWSNT)
-# define HAVE_FSYNC
-#endif
-
 #ifndef MAXPATHLEN
 /* in 4.1, param.h fails to define this. */
 #define MAXPATHLEN 1024
index 6beecc5..1c5529e 100644 (file)
@@ -26,18 +26,9 @@ Boston, MA 02111-1307, USA.  */
 #include "lisp.h" /* For encapsulated open, close, read */
 #include "device.h" /* For DEVICE_BAUD_RATE */
 #else /* not emacs */
-#if defined(USG) || defined(STDC_HEADERS)
-#define memcpy(d, s, n) memcpy ((d), (s), (n))
-#endif
 
-#ifdef STDC_HEADERS
 #include <stdlib.h>
 #include <string.h>
-#else
-char *getenv ();
-char *malloc ();
-char *realloc ();
-#endif
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
@@ -337,8 +328,6 @@ static int name_match ();
 
    If BP is zero, space is dynamically allocated.  */
 
-extern char *getenv ();
-
 int
 tgetent (bp, name)
      char *bp;
@@ -365,7 +354,7 @@ tgetent (bp, name)
      it is the entry itself, but only if
      the name the caller requested matches the TERM variable.  */
 
-  if (tem && !IS_DIRECTORY_SEP (*tem) && !strcmp (name, (char *) getenv ("TERM")))
+  if (tem && !IS_DIRECTORY_SEP (*tem) && !strcmp (name, getenv ("TERM")))
     {
       indirect = tgetst1 (find_capability (tem, "tc"), 0);
       if (!indirect)
index 31732af..cff25ac 100644 (file)
@@ -1434,8 +1434,7 @@ For the other vector formats (specifying blank areas of the toolbar):
      automatically knew about specifier fallbacks, so we didn't
      have to do it ourselves. */
   set_specifier_caching (Vdefault_toolbar,
-                        slot_offset (struct window,
-                                     default_toolbar),
+                        offsetof (struct window, default_toolbar),
                         default_toolbar_specs_changed,
                         0, 0);
 
@@ -1447,8 +1446,7 @@ See `default-toolbar' for a description of a valid toolbar instantiator.
 */ );
   Vtoolbar[TOP_TOOLBAR] = Fmake_specifier (Qtoolbar);
   set_specifier_caching (Vtoolbar[TOP_TOOLBAR],
-                        slot_offset (struct window,
-                                     toolbar[TOP_TOOLBAR]),
+                        offsetof (struct window, toolbar[TOP_TOOLBAR]),
                         toolbar_specs_changed,
                         0, 0);
 
@@ -1465,8 +1463,7 @@ displayed even if you provide a value for `bottom-toolbar'.
 */ );
   Vtoolbar[BOTTOM_TOOLBAR] = Fmake_specifier (Qtoolbar);
   set_specifier_caching (Vtoolbar[BOTTOM_TOOLBAR],
-                        slot_offset (struct window,
-                                     toolbar[BOTTOM_TOOLBAR]),
+                        offsetof (struct window, toolbar[BOTTOM_TOOLBAR]),
                         toolbar_specs_changed,
                         0, 0);
 
@@ -1483,8 +1480,7 @@ displayed even if you provide a value for `left-toolbar'.
 */ );
   Vtoolbar[LEFT_TOOLBAR] = Fmake_specifier (Qtoolbar);
   set_specifier_caching (Vtoolbar[LEFT_TOOLBAR],
-                        slot_offset (struct window,
-                                     toolbar[LEFT_TOOLBAR]),
+                        offsetof (struct window, toolbar[LEFT_TOOLBAR]),
                         toolbar_specs_changed,
                         0, 0);
 
@@ -1501,8 +1497,7 @@ displayed even if you provide a value for `right-toolbar'.
 */ );
   Vtoolbar[RIGHT_TOOLBAR] = Fmake_specifier (Qtoolbar);
   set_specifier_caching (Vtoolbar[RIGHT_TOOLBAR],
-                        slot_offset (struct window,
-                                     toolbar[RIGHT_TOOLBAR]),
+                        offsetof (struct window, toolbar[RIGHT_TOOLBAR]),
                         toolbar_specs_changed,
                         0, 0);
 
@@ -1556,11 +1551,9 @@ is not visible, so it is expanded to take up the slack.
 */ );
   Vdefault_toolbar_height = Fmake_specifier (Qnatnum);
   set_specifier_caching (Vdefault_toolbar_height,
-                        slot_offset (struct window,
-                                     default_toolbar_height),
+                        offsetof (struct window, default_toolbar_height),
                         default_toolbar_size_changed_in_window,
-                        slot_offset (struct frame,
-                                     default_toolbar_height),
+                        offsetof (struct frame, default_toolbar_height),
                         default_toolbar_size_changed_in_frame);
 
   DEFVAR_SPECIFIER ("default-toolbar-width", &Vdefault_toolbar_width /*
@@ -1571,11 +1564,9 @@ See `default-toolbar-height' for more information.
 */ );
   Vdefault_toolbar_width = Fmake_specifier (Qnatnum);
   set_specifier_caching (Vdefault_toolbar_width,
-                        slot_offset (struct window,
-                                     default_toolbar_width),
+                        offsetof (struct window, default_toolbar_width),
                         default_toolbar_size_changed_in_window,
-                        slot_offset (struct frame,
-                                     default_toolbar_width),
+                        offsetof (struct frame, default_toolbar_width),
                         default_toolbar_size_changed_in_frame);
 
   DEFVAR_SPECIFIER ("top-toolbar-height",
@@ -1587,11 +1578,9 @@ See `default-toolbar-height' for more information.
 */ );
   Vtoolbar_size[TOP_TOOLBAR] = Fmake_specifier (Qnatnum);
   set_specifier_caching (Vtoolbar_size[TOP_TOOLBAR],
-                        slot_offset (struct window,
-                                     toolbar_size[TOP_TOOLBAR]),
+                        offsetof (struct window, toolbar_size[TOP_TOOLBAR]),
                         toolbar_geometry_changed_in_window,
-                        slot_offset (struct frame,
-                                     toolbar_size[TOP_TOOLBAR]),
+                        offsetof (struct frame, toolbar_size[TOP_TOOLBAR]),
                         frame_size_slipped);
 
   DEFVAR_SPECIFIER ("bottom-toolbar-height",
@@ -1603,11 +1592,9 @@ See `default-toolbar-height' for more information.
 */ );
   Vtoolbar_size[BOTTOM_TOOLBAR] = Fmake_specifier (Qnatnum);
   set_specifier_caching (Vtoolbar_size[BOTTOM_TOOLBAR],
-                        slot_offset (struct window,
-                                     toolbar_size[BOTTOM_TOOLBAR]),
+                        offsetof (struct window, toolbar_size[BOTTOM_TOOLBAR]),
                         toolbar_geometry_changed_in_window,
-                        slot_offset (struct frame,
-                                     toolbar_size[BOTTOM_TOOLBAR]),
+                        offsetof (struct frame, toolbar_size[BOTTOM_TOOLBAR]),
                         frame_size_slipped);
 
   DEFVAR_SPECIFIER ("left-toolbar-width",
@@ -1619,11 +1606,9 @@ See `default-toolbar-height' for more information.
 */ );
   Vtoolbar_size[LEFT_TOOLBAR] = Fmake_specifier (Qnatnum);
   set_specifier_caching (Vtoolbar_size[LEFT_TOOLBAR],
-                        slot_offset (struct window,
-                                     toolbar_size[LEFT_TOOLBAR]),
+                        offsetof (struct window, toolbar_size[LEFT_TOOLBAR]),
                         toolbar_geometry_changed_in_window,
-                        slot_offset (struct frame,
-                                     toolbar_size[LEFT_TOOLBAR]),
+                        offsetof (struct frame, toolbar_size[LEFT_TOOLBAR]),
                         frame_size_slipped);
 
   DEFVAR_SPECIFIER ("right-toolbar-width",
@@ -1635,11 +1620,9 @@ See `default-toolbar-height' for more information.
 */ );
   Vtoolbar_size[RIGHT_TOOLBAR] = Fmake_specifier (Qnatnum);
   set_specifier_caching (Vtoolbar_size[RIGHT_TOOLBAR],
-                        slot_offset (struct window,
-                                     toolbar_size[RIGHT_TOOLBAR]),
+                        offsetof (struct window, toolbar_size[RIGHT_TOOLBAR]),
                         toolbar_geometry_changed_in_window,
-                        slot_offset (struct frame,
-                                     toolbar_size[RIGHT_TOOLBAR]),
+                        offsetof (struct frame, toolbar_size[RIGHT_TOOLBAR]),
                         frame_size_slipped);
 
   fb = Qnil;
@@ -1700,11 +1683,9 @@ the value in a window domain will not.
 */ );
   Vdefault_toolbar_border_width = Fmake_specifier (Qnatnum);
   set_specifier_caching (Vdefault_toolbar_border_width,
-                        slot_offset (struct window,
-                                     default_toolbar_border_width),
+                        offsetof (struct window, default_toolbar_border_width),
                         default_toolbar_border_width_changed_in_window,
-                        slot_offset (struct frame,
-                                     default_toolbar_border_width),
+                        offsetof (struct frame, default_toolbar_border_width),
                         default_toolbar_border_width_changed_in_frame);
 
   DEFVAR_SPECIFIER ("top-toolbar-border-width",
@@ -1716,11 +1697,11 @@ See `default-toolbar-height' for more information.
 */ );
   Vtoolbar_border_width[TOP_TOOLBAR] = Fmake_specifier (Qnatnum);
   set_specifier_caching (Vtoolbar_border_width[TOP_TOOLBAR],
-                        slot_offset (struct window,
-                                     toolbar_border_width[TOP_TOOLBAR]),
+                        offsetof (struct window,
+                                  toolbar_border_width[TOP_TOOLBAR]),
                         toolbar_geometry_changed_in_window,
-                        slot_offset (struct frame,
-                                     toolbar_border_width[TOP_TOOLBAR]),
+                        offsetof (struct frame,
+                                  toolbar_border_width[TOP_TOOLBAR]),
                         frame_size_slipped);
 
   DEFVAR_SPECIFIER ("bottom-toolbar-border-width",
@@ -1732,11 +1713,11 @@ See `default-toolbar-height' for more information.
 */ );
   Vtoolbar_border_width[BOTTOM_TOOLBAR] = Fmake_specifier (Qnatnum);
   set_specifier_caching (Vtoolbar_border_width[BOTTOM_TOOLBAR],
-                        slot_offset (struct window,
-                                     toolbar_border_width[BOTTOM_TOOLBAR]),
+                        offsetof (struct window,
+                                  toolbar_border_width[BOTTOM_TOOLBAR]),
                         toolbar_geometry_changed_in_window,
-                        slot_offset (struct frame,
-                                     toolbar_border_width[BOTTOM_TOOLBAR]),
+                        offsetof (struct frame,
+                                  toolbar_border_width[BOTTOM_TOOLBAR]),
                         frame_size_slipped);
 
   DEFVAR_SPECIFIER ("left-toolbar-border-width",
@@ -1748,11 +1729,11 @@ See `default-toolbar-height' for more information.
 */ );
   Vtoolbar_border_width[LEFT_TOOLBAR] = Fmake_specifier (Qnatnum);
   set_specifier_caching (Vtoolbar_border_width[LEFT_TOOLBAR],
-                        slot_offset (struct window,
-                                     toolbar_border_width[LEFT_TOOLBAR]),
+                        offsetof (struct window,
+                                  toolbar_border_width[LEFT_TOOLBAR]),
                         toolbar_geometry_changed_in_window,
-                        slot_offset (struct frame,
-                                     toolbar_border_width[LEFT_TOOLBAR]),
+                        offsetof (struct frame,
+                                  toolbar_border_width[LEFT_TOOLBAR]),
                         frame_size_slipped);
 
   DEFVAR_SPECIFIER ("right-toolbar-border-width",
@@ -1764,11 +1745,11 @@ See `default-toolbar-height' for more information.
 */ );
   Vtoolbar_border_width[RIGHT_TOOLBAR] = Fmake_specifier (Qnatnum);
   set_specifier_caching (Vtoolbar_border_width[RIGHT_TOOLBAR],
-                        slot_offset (struct window,
-                                     toolbar_border_width[RIGHT_TOOLBAR]),
+                        offsetof (struct window,
+                                  toolbar_border_width[RIGHT_TOOLBAR]),
                         toolbar_geometry_changed_in_window,
-                        slot_offset (struct frame,
-                                     toolbar_border_width[RIGHT_TOOLBAR]),
+                        offsetof (struct frame,
+                                  toolbar_border_width[RIGHT_TOOLBAR]),
                         frame_size_slipped);
 
   fb = Qnil;
@@ -1812,11 +1793,9 @@ visibility specifiers have a fallback value of true.
 */ );
   Vdefault_toolbar_visible_p = Fmake_specifier (Qboolean);
   set_specifier_caching (Vdefault_toolbar_visible_p,
-                        slot_offset (struct window,
-                                     default_toolbar_visible_p),
+                        offsetof (struct window, default_toolbar_visible_p),
                         default_toolbar_visible_p_changed_in_window,
-                        slot_offset (struct frame,
-                                     default_toolbar_visible_p),
+                        offsetof (struct frame, default_toolbar_visible_p),
                         default_toolbar_visible_p_changed_in_frame);
 
   DEFVAR_SPECIFIER ("top-toolbar-visible-p",
@@ -1828,11 +1807,11 @@ See `default-toolbar-visible-p' for more information.
 */ );
   Vtoolbar_visible_p[TOP_TOOLBAR] = Fmake_specifier (Qboolean);
   set_specifier_caching (Vtoolbar_visible_p[TOP_TOOLBAR],
-                        slot_offset (struct window,
-                                     toolbar_visible_p[TOP_TOOLBAR]),
+                        offsetof (struct window,
+                                  toolbar_visible_p[TOP_TOOLBAR]),
                         toolbar_geometry_changed_in_window,
-                        slot_offset (struct frame,
-                                     toolbar_visible_p[TOP_TOOLBAR]),
+                        offsetof (struct frame,
+                                  toolbar_visible_p[TOP_TOOLBAR]),
                         frame_size_slipped);
 
   DEFVAR_SPECIFIER ("bottom-toolbar-visible-p",
@@ -1844,11 +1823,11 @@ See `default-toolbar-visible-p' for more information.
 */ );
   Vtoolbar_visible_p[BOTTOM_TOOLBAR] = Fmake_specifier (Qboolean);
   set_specifier_caching (Vtoolbar_visible_p[BOTTOM_TOOLBAR],
-                        slot_offset (struct window,
-                                     toolbar_visible_p[BOTTOM_TOOLBAR]),
+                        offsetof (struct window,
+                                  toolbar_visible_p[BOTTOM_TOOLBAR]),
                         toolbar_geometry_changed_in_window,
-                        slot_offset (struct frame,
-                                     toolbar_visible_p[BOTTOM_TOOLBAR]),
+                        offsetof (struct frame,
+                                  toolbar_visible_p[BOTTOM_TOOLBAR]),
                         frame_size_slipped);
 
   DEFVAR_SPECIFIER ("left-toolbar-visible-p",
@@ -1860,11 +1839,11 @@ See `default-toolbar-visible-p' for more information.
 */ );
   Vtoolbar_visible_p[LEFT_TOOLBAR] = Fmake_specifier (Qboolean);
   set_specifier_caching (Vtoolbar_visible_p[LEFT_TOOLBAR],
-                        slot_offset (struct window,
-                                     toolbar_visible_p[LEFT_TOOLBAR]),
+                        offsetof (struct window,
+                                  toolbar_visible_p[LEFT_TOOLBAR]),
                         toolbar_geometry_changed_in_window,
-                        slot_offset (struct frame,
-                                     toolbar_visible_p[LEFT_TOOLBAR]),
+                        offsetof (struct frame,
+                                  toolbar_visible_p[LEFT_TOOLBAR]),
                         frame_size_slipped);
 
   DEFVAR_SPECIFIER ("right-toolbar-visible-p",
@@ -1876,11 +1855,11 @@ See `default-toolbar-visible-p' for more information.
 */ );
   Vtoolbar_visible_p[RIGHT_TOOLBAR] = Fmake_specifier (Qboolean);
   set_specifier_caching (Vtoolbar_visible_p[RIGHT_TOOLBAR],
-                        slot_offset (struct window,
-                                     toolbar_visible_p[RIGHT_TOOLBAR]),
+                        offsetof (struct window,
+                                  toolbar_visible_p[RIGHT_TOOLBAR]),
                         toolbar_geometry_changed_in_window,
-                        slot_offset (struct frame,
-                                     toolbar_visible_p[RIGHT_TOOLBAR]),
+                        offsetof (struct frame,
+                                  toolbar_visible_p[RIGHT_TOOLBAR]),
                         frame_size_slipped);
 
   /* initially, top inherits from default; this can be
@@ -1902,8 +1881,7 @@ This is a specifier; use `set-specifier' to change it.
 */ );
   Vtoolbar_buttons_captioned_p = Fmake_specifier (Qboolean);
   set_specifier_caching (Vtoolbar_buttons_captioned_p,
-                        slot_offset (struct window,
-                                     toolbar_buttons_captioned_p),
+                        offsetof (struct window, toolbar_buttons_captioned_p),
                         toolbar_buttons_captioned_p_changed,
                         0, 0);
   set_specifier_fallback (Vtoolbar_buttons_captioned_p,
index 50f5b21..933097e 100644 (file)
@@ -439,7 +439,6 @@ write_segment (int new, char *ptr, char *end)
 {
   int i, nwrite, ret;
   char buf[80];
-  extern int errno;
   char zeros[UnexBlockSz];
 
   for (i = 0; ptr < end;)
index a8045f0..9602c10 100644 (file)
@@ -31,6 +31,7 @@ Boston, MA 02111-1307, USA.  */
 #include <sys/stat.h>
 #include <sys/mman.h>
 #include <stdio.h>
+#include <errno.h>
 #include <varargs.h>
 #include <filehdr.h>
 #include <aouthdr.h>
@@ -54,9 +55,6 @@ static void mark_x (char *);
        if (lseek (_fd, _position, L_SET) != _position) \
          fatal_unexec (_error_message, _error_arg);
 
-extern int errno;
-extern char *strerror ();
-
 void *sbrk();
 
 #define EEOF -1
index 06bb930..7c885d5 100644 (file)
@@ -136,7 +136,7 @@ before writing it (above and beyond the number of bytes of actual
 program text).  HDR's standard fields are already correct, except that
 this adjustment to the `a_text' field has not yet been made;
 thus, the amount of offset can depend on the data in the file.
-  
+
 * A_TEXT_SEEK(HDR)
 
 If defined, this macro specifies the number of bytes to seek into the
@@ -186,19 +186,12 @@ pointer looks like an int) but not on all machines.
 #  undef _POSIX_SOURCE
 # endif
 
-# if defined(__lucid) && !defined(__STDC_EXTENDED__)
-#  define __STDC_EXTENDED__ 1
-# endif
-
 # include <stddef.h>
 # include <stdlib.h>
 # include <unistd.h>
 # include <string.h>
 # include <stddef.h>
-
-# ifdef __lucid
-#  include <sysent.h>
-# endif
+# include <errno.h>
 
 #endif
 
@@ -443,7 +436,7 @@ unexec (new_name, a_name, data_start, bss_start, entry_address)
     {
       close (new);
       /* unlink (new_name);            / * Failed, unlink new a.out */
-      return -1;       
+      return -1;
     }
 
   close (new);
@@ -998,7 +991,7 @@ copy_text_and_data (int new, int a_out)
     char c;
     int mcount_address, mcount_offset, count;
     extern char *_execname;
-   
+
 
     /* The use of _execname is incompatible with RISCiX 1.1 */
     sprintf (command, "nm %s | fgrep mcount", _execname);
@@ -1018,7 +1011,7 @@ copy_text_and_data (int new, int a_out)
     {
       sprintf (errbuf, "Failed to execute the command '%s'\n", command);
       PERROR (errbuf);
-    }  
+    }
 
     sscanf(address_text, "%x", &mcount_address);
     ptr = (char *) unexec_text_start;
@@ -1076,7 +1069,6 @@ write_segment (new, ptr, end)
 #if 0
   char buf[80];
 #endif
-  extern int errno;
   /* This is the normal amount to write at once.
      It is the size of block that NFS uses.  */
   int writesize = 1 << 13;
index 5cb73b3..0a97488 100644 (file)
@@ -40,6 +40,7 @@ Tweaked 26-Feb-94 by Shawn Carey for use with FreeBSD-1.1 shared libraries.
 #include <sys/types.h>
 #include <string.h>
 #include <stdio.h>
+#include <errno.h>
 #include <a.out.h>
 #include <unistd.h>
 #include <ctype.h>
@@ -95,7 +96,6 @@ int run_time_remap (char *dummy);
 /********************** Variables **********************************/
 
 /* for reporting error messages from system calls */
-extern int errno;
 extern int _DYNAMIC;
 extern char **environ;             
 
index 607cd73..9bca2a9 100644 (file)
@@ -40,6 +40,7 @@ Modified Jan 93 by Hamish Macdonald for HPUX
 #include <sys/types.h>
 #include <string.h>
 #include <stdio.h>
+#include <errno.h>
 #include <signal.h>
 #ifdef __hp9000s300
 # include </usr/include/debug.h>
@@ -87,7 +88,6 @@ int run_time_remap (char *dummy);
 
 /* for reporting error messages from system calls */
 extern int sys_nerr;
-extern int errno;
 extern int _DYNAMIC;
 extern char **environ;             
 
index 486646b..ca497ae 100644 (file)
@@ -26,6 +26,7 @@ Boston, MA 02111-1307, USA.  */
 #include <sys/file.h>
 #include <sys/stat.h>
 #include <stdio.h>
+#include <errno.h>
 #include <varargs.h>
 
 #ifdef MACH
@@ -95,7 +96,6 @@ static void mark_x ();
        if (lseek (_fd, _position, L_SET) != _position) \
          fatal_unexec (_error_message, _error_arg);
 
-extern int errno;
 extern char *strerror ();
 #define EEOF -1
 
index 80934b9..9281bd8 100644 (file)
@@ -1148,7 +1148,7 @@ be used.  Otherwise, the selected frame is used.
   return FRAME_MINIBUF_WINDOW (decode_frame_or_selected (con_dev_or_frame));
 }
 
-DEFUN ("window-minibuffer-p", Fwindow_minibuffer_p, 1, 1, 0, /*
+DEFUN ("window-minibuffer-p", Fwindow_minibuffer_p, 0, 1, 0, /*
 Return non-nil if WINDOW is a minibuffer window.
 */
        (window))
@@ -1437,22 +1437,23 @@ Return the number of columns by which WINDOW is scrolled from left margin.
   return make_int (decode_window (window)->hscroll);
 }
 
-#ifdef MODELINE_IS_SCROLLABLE
 DEFUN ("modeline-hscroll", Fmodeline_hscroll, 0, 1, 0, /*
-Return the number of columns by which WINDOW's modeline is scrolled from
-left margin. If the window has no modeline, return nil.
+Return the horizontal scrolling ammount of WINDOW's modeline.
+If the window has no modeline, return nil.
 */
        (window))
 {
   struct window *w = decode_window (window);
 
-  return (WINDOW_HAS_MODELINE_P (w)) ? make_int (w->modeline_hscroll) : Qnil;
+  return (WINDOW_HAS_MODELINE_P (w)) ? make_int ((int) w->modeline_hscroll) :
+    Qnil;
 }
 
 DEFUN ("set-modeline-hscroll", Fset_modeline_hscroll, 2, 2, 0, /*
-Set number of columns WINDOW's modeline is scrolled from left margin to NCOL.
-NCOL should be zero or positive. If NCOL is negative, it will be forced to 0.
-If the window has no modeline, do nothing and return nil.
+Set the horizontal scrolling ammount 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.
 */
        (window, ncol))
 {
@@ -1460,18 +1461,20 @@ If the window has no modeline, do nothing and return nil.
 
   if (WINDOW_HAS_MODELINE_P (w))
     {
-      int ncols;
+      Charcount ncols;
+
       CHECK_INT (ncol);
-      ncols = XINT (ncol);
-      if (ncols < 0) ncols = 0;
-      if (w->modeline_hscroll != ncols)
-       MARK_MODELINE_CHANGED;
-      w->modeline_hscroll = ncols;
-      return ncol;
+      ncols = (XINT (ncol) <= 0) ? 0 : (Charcount) XINT (ncol);
+      if (ncols != w->modeline_hscroll)
+       {
+         MARK_MODELINE_CHANGED;
+         w->modeline_hscroll = ncols;
+       }
+      return make_int ((int) ncols);
     }
+
   return Qnil;
 }
-#endif /* MODELINE_IS_SCROLLABLE */
 
 DEFUN ("set-window-hscroll", Fset_window_hscroll, 2, 2, 0, /*
 Set number of columns WINDOW is scrolled from left margin to NCOL.
@@ -4050,12 +4053,12 @@ window_scroll (Lisp_Object window, Lisp_Object n, int direction,
     fheight = XINT (Vwindow_pixel_scroll_increment);
   else if (!NILP (Vwindow_pixel_scroll_increment));
     default_face_height_and_width (window, &fheight, &fwidth);
-  
+
   if (Dynarr_length (dla) >= 1)
     modeline = Dynarr_atp (dla, 0)->modeline;
 
   dl = Dynarr_atp (dla, modeline);
-    
+
   if (value > 0)
     {
       /* Go for partial display line scrolling. This just means bumping
@@ -4074,7 +4077,7 @@ window_scroll (Lisp_Object window, Lisp_Object n, int direction,
        {
          int vtarget;
          Bufpos startp, old_start;
-         
+
          if (WINDOW_TEXT_TOP_CLIP (w))
            {
              WINDOW_TEXT_TOP_CLIP (w) = 0;
@@ -4083,7 +4086,7 @@ window_scroll (Lisp_Object window, Lisp_Object n, int direction,
 
          old_start = marker_position (w->start[CURRENT_DISP]);
          startp = vmotion (w, old_start, value, &vtarget);
-         
+
          if (vtarget < value &&
              (w->window_end_pos[CURRENT_DISP] == -1
               || (BUF_Z (b) - w->window_end_pos[CURRENT_DISP] > BUF_ZV (b))))
@@ -4098,7 +4101,7 @@ window_scroll (Lisp_Object window, Lisp_Object n, int direction,
              w->force_start = 1;
              w->start_at_line_beg = beginning_of_line_p (b, startp);
              MARK_WINDOWS_CHANGED (w);
-             
+
              if (!point_would_be_visible (w, startp, XINT (point)))
                {
                  if (selected)
@@ -4132,16 +4135,16 @@ window_scroll (Lisp_Object window, Lisp_Object n, int direction,
        {
          int vtarget;
          Bufpos startp, old_start;
-         
+
          if (WINDOW_TEXT_TOP_CLIP (w))
            {
              WINDOW_TEXT_TOP_CLIP (w) = 0;
              MARK_WINDOWS_CHANGED (w);
            }
-             
+
          old_start = marker_position (w->start[CURRENT_DISP]);
          startp = vmotion (w, old_start, value, &vtarget);
-         
+
          if (vtarget > value
              && marker_position (w->start[CURRENT_DISP]) == BUF_BEGV (b))
            {
@@ -4155,16 +4158,16 @@ window_scroll (Lisp_Object window, Lisp_Object n, int direction,
              w->force_start = 1;
              w->start_at_line_beg = beginning_of_line_p (b, startp);
              MARK_WINDOWS_CHANGED (w);
-             
+
              if (!point_would_be_visible (w, startp, XINT (point)))
                {
                  Bufpos new_point;
-                 
+
                  if (MINI_WINDOW_P (w))
                    new_point = startp;
                  else
                    new_point = start_of_last_line (w, startp);
-                 
+
                  if (selected)
                    BUF_SET_PT (b, new_point);
                  else
@@ -4694,7 +4697,7 @@ struct saved_window
   int pixel_width;
   int pixel_height;
   int hscroll;
-  int modeline_hscroll;
+  Charcount modeline_hscroll;
   int parent_index;           /* index into saved_windows */
   int prev_index;             /* index into saved_windows */
   char start_at_line_beg; /* boolean */
@@ -4956,7 +4959,7 @@ by `current-window-configuration' (which see).
   int previous_pixel_width;
   int previous_minibuf_height, previous_minibuf_top,previous_minibuf_width;
   int real_font_height;
-  int converted_minibuf_height,target_minibuf_height; 
+  int converted_minibuf_height,target_minibuf_height;
   int specpdl_count = specpdl_depth ();
 
   GCPRO1 (configuration);
@@ -5024,7 +5027,7 @@ by `current-window-configuration' (which see).
 #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 
+        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
@@ -5045,7 +5048,7 @@ by `current-window-configuration' (which see).
          || config->frame_width != FRAME_WIDTH (f))
        change_frame_size (f, config->frame_height, config->frame_width, 0);
 #endif
-      
+
       previous_pixel_top = XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_top;
       previous_pixel_height = XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_height;
       previous_pixel_left = XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_left;
@@ -5055,7 +5058,7 @@ by `current-window-configuration' (which see).
 
       default_face_height_and_width (frame, &real_font_height, 0);
       assert(real_font_height > 0);
-  
+
       if (FRAME_HAS_MINIBUF_P (f) && ! FRAME_MINIBUF_ONLY_P (f))
        {
          previous_minibuf_height
@@ -5068,13 +5071,14 @@ by `current-window-configuration' (which see).
       else
        {
          previous_minibuf_height = 0;
+         previous_minibuf_top = 0;
          previous_minibuf_width = 0;
        }
       converted_minibuf_height =
        (previous_minibuf_height % real_font_height) == 0 ?
        - (previous_minibuf_height / real_font_height ) :    /* lines */
            previous_minibuf_height;   /* pixels */
-           
+
       /* Temporarily avoid any problems with windows that are smaller
         than they are supposed to be.  */
       window_min_height = 1;
@@ -5256,7 +5260,7 @@ by `current-window-configuration' (which see).
 
          #### Now we get more cases correct then ever before, but
         are we treating all? For instance what if the frames minibuf window
-        is no longer the same one? 
+        is no longer the same one?
       */
       target_minibuf_height = previous_minibuf_height;
       if (converted_minibuf_height &&
@@ -5279,7 +5283,7 @@ by `current-window-configuration' (which see).
          set_window_pixwidth  (FRAME_MINIBUF_WINDOW (f),
                            previous_minibuf_width, 0);
        }
-       
+
       /* This is a better way to deal with frame resizing, etc.
         What we _actually_ want is for the old (just restored)
         root window to fit
@@ -5294,7 +5298,7 @@ by `current-window-configuration' (which see).
       /* Note that this function also updates the subwindow
         "pixel_left"s */
       set_window_pixwidth (FRAME_ROOT_WINDOW (f), previous_pixel_width, 0);
-      
+
       /* If restoring in the current frame make the window current,
         otherwise just update the frame selected_window slot to be
         the restored current_window. */
@@ -5536,11 +5540,11 @@ its value is -not- saved.
 
   /* save the minibuffer height using the heuristics from
      change_frame_size_1 */
-  
+
   XSETFRAME (frame, f); /* frame could have been nil ! */
   default_face_height_and_width (frame, &real_font_height, 0);
   assert(real_font_height > 0);
-  
+
   if (FRAME_HAS_MINIBUF_P (f) && ! FRAME_MINIBUF_ONLY_P (f))
     minibuf_height = XWINDOW(FRAME_MINIBUF_WINDOW(f))->pixel_height;
   else
@@ -5606,7 +5610,7 @@ a non-nil result to be returned.
 
       if (NILP (pos))
        pos = Fwindow_point (window);
-      
+
       CHECK_INT (pos);
       point = XINT (pos);
 
@@ -5744,15 +5748,13 @@ syms_of_window (void)
   DEFSUBR (Fwindow_displayed_text_pixel_height);
   DEFSUBR (Fwindow_text_area_pixel_width);
   DEFSUBR (Fwindow_hscroll);
-#ifdef MODELINE_IS_SCROLLABLE
+  DEFSUBR (Fset_window_hscroll);
   DEFSUBR (Fmodeline_hscroll);
   DEFSUBR (Fset_modeline_hscroll);
-#endif /* MODELINE_IS_SCROLLABLE */
 #if 0 /* bogus FSF crock */
   DEFSUBR (Fwindow_redisplay_end_trigger);
   DEFSUBR (Fset_window_redisplay_end_trigger);
 #endif
-  DEFSUBR (Fset_window_hscroll);
   DEFSUBR (Fwindow_pixel_edges);
   DEFSUBR (Fwindow_text_area_pixel_edges);
   DEFSUBR (Fwindow_point);
@@ -5892,8 +5894,7 @@ This is a specifier; use `set-specifier' to change it.
   Fadd_spec_to_specifier (Vmodeline_shadow_thickness, make_int (2),
                          Qnil, Qnil, Qnil);
   set_specifier_caching (Vmodeline_shadow_thickness,
-                        slot_offset (struct window,
-                                     modeline_shadow_thickness),
+                        offsetof (struct window, modeline_shadow_thickness),
                         modeline_shadow_thickness_changed,
                         0, 0);
 
@@ -5905,8 +5906,7 @@ This is a specifier; use `set-specifier' to change it.
   set_specifier_fallback (Vhas_modeline_p,
                          list1 (Fcons (Qnil, Qt)));
   set_specifier_caching (Vhas_modeline_p,
-                        slot_offset (struct window,
-                                     has_modeline_p),
+                        offsetof (struct window, has_modeline_p),
                         /* #### It's strange that we need a special
                            flag to indicate that the shadow-thickness
                            has changed, but not one to indicate that
@@ -5928,8 +5928,8 @@ This is a specifier; use `set-specifier' to change it.
   set_specifier_fallback (Vvertical_divider_always_visible_p,
                          list1 (Fcons (Qnil, Qt)));
   set_specifier_caching (Vvertical_divider_always_visible_p,
-                        slot_offset (struct window,
-                                     vertical_divider_always_visible_p),
+                        offsetof (struct window,
+                                  vertical_divider_always_visible_p),
                         vertical_divider_changed_in_window,
                         0, 0);
 
@@ -5943,8 +5943,8 @@ This is a specifier; use `set-specifier' to change it.
   Fadd_spec_to_specifier (Vvertical_divider_shadow_thickness, make_int (2),
                          Qnil, Qnil, Qnil);
   set_specifier_caching (Vvertical_divider_shadow_thickness,
-                        slot_offset (struct window,
-                                     vertical_divider_shadow_thickness),
+                        offsetof (struct window,
+                                  vertical_divider_shadow_thickness),
                         vertical_divider_changed_in_window,
                         0, 0);
   DEFVAR_SPECIFIER ("vertical-divider-line-width", &Vvertical_divider_line_width /*
@@ -5974,8 +5974,8 @@ This is a specifier; use `set-specifier' to change it.
     set_specifier_fallback (Vvertical_divider_line_width, fb);
   }
   set_specifier_caching (Vvertical_divider_line_width,
-                         slot_offset (struct window,
-                                     vertical_divider_line_width),
+                         offsetof (struct window,
+                                  vertical_divider_line_width),
                         vertical_divider_changed_in_window,
                          0, 0);
 
@@ -6004,8 +6004,7 @@ This is a specifier; use `set-specifier' to change it.
     set_specifier_fallback (Vvertical_divider_spacing, fb);
   }
   set_specifier_caching (Vvertical_divider_spacing,
-                        slot_offset (struct window,
-                                     vertical_divider_spacing),
+                        offsetof (struct window, vertical_divider_spacing),
                         vertical_divider_changed_in_window,
                         0, 0);
 }
index 043a9fc..588187a 100644 (file)
@@ -129,7 +129,7 @@ struct window
   /* Number of columns display within the window is scrolled to the left. */
   int hscroll;
   /* Idem for the window's modeline */
-  int modeline_hscroll;
+  Charcount modeline_hscroll;
   /* Amount to clip off the top line for pixel-based scrolling. Point
      will remain constant but this will be incremented to
      incrementally shift lines up. */
index b4234ab..d1b19a2 100644 (file)
@@ -1,3 +1,17 @@
+2000-01-18  Martin Buchholz <martin@xemacs.org>
+
+       * XEmacs 21.2.27 is released.
+
+1999-12-24  Yoshiki Hayashi  <t90553@mail.ecc.u-tokyo.ac.jp>
+
+       * automated/syntax-tests.el: New file.
+       Add test for scan_words using forward-word and backword-word.
+
+2000-01-08  Martin Buchholz  <martin@xemacs.org>
+
+       * automated/mule-tests.el: 
+       Test resizing of small and big (> 8k bytes) strings.
+
 1999-12-31  Martin Buchholz <martin@xemacs.org>
 
        * XEmacs 21.2.26 is released.
index 67533cc..b9c04a1 100644 (file)
@@ -2,6 +2,10 @@
  (make-extent (point) (point))
  (setq im (make-glyph [xpm :file "xemacs-icon.xpm"])))
 
+(set-extent-begin-glyph 
+ (make-extent (point) (point))
+ (make-glyph [string :data "xemacs"]))
+
 (defun foo ()
   (interactive)
   (setq ok-select (not ok-select)))
@@ -64,6 +68,7 @@
  (setq tab (make-glyph 
            [tab-control :descriptor "My Tab"
                         :face highlight
+                        :orientation right
                         :properties (:items (["One" foo]
                                              ["Two" fee]
                                              ["Three" foo]))])))
 ;; normal pushbutton
 (set-extent-begin-glyph 
  (make-extent (point) (point))
- (make-glyph [button :descriptor ["A Big Button" foo ]]))
+ (setq pbutton
+       (make-glyph [button :descriptor ["A Big Button" foo ]])))
 
 ;; edit box
 (set-extent-begin-glyph 
index 97bafe3..40561bc 100644 (file)
@@ -2,8 +2,8 @@
 emacs_is_beta=t
 emacs_major_version=21
 emacs_minor_version=2
-emacs_beta_version=26
-xemacs_codename="Millenium"
+emacs_beta_version=27
+xemacs_codename="Hera"
 infodock_major_version=4
 infodock_minor_version=0
 infodock_build_version=8